Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/app/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export const dict = {
"command.category.agent": "智能体",
"command.category.permissions": "权限",
"command.category.workspace": "工作区",
"command.clearTasks": "清除任务",
"command.clearTasks.description": "清除所有待办任务",
"command.category.tasks": "任务",
"command.category.settings": "设置",

"theme.scheme.system": "系统",
Expand Down
20 changes: 20 additions & 0 deletions packages/opencode/src/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export function hints(template: string) {
export const Default = {
INIT: "init",
REVIEW: "review",
CLEAR_TASKS: "clear-tasks",
CLEAR_TASKS_ZH: "清除任务",
} as const

export interface Interface {
Expand Down Expand Up @@ -99,6 +101,24 @@ export const layer = Layer.effect(
subtask: true,
hints: hints(PROMPT_REVIEW),
}
commands[Default.CLEAR_TASKS] = {
name: Default.CLEAR_TASKS,
description: "clear all active tasks",
source: "command",
get template() {
return "Call todowrite with an empty todos array [] to clear all remaining tasks."
},
hints: [],
}
commands[Default.CLEAR_TASKS_ZH] = {
name: Default.CLEAR_TASKS_ZH,
description: "清除所有待办任务",
source: "command",
get template() {
return "Call todowrite with an empty todos array [] to clear all remaining tasks."
},
hints: [],
}

for (const [name, command] of Object.entries(cfg.command ?? {})) {
commands[name] = {
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/session/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const layer = Layer.effect(
db.select().from(TodoTable).where(eq(TodoTable.session_id, sessionID)).orderBy(asc(TodoTable.position)).all(),
),
)
return rows.map((row) => ({
return rows.filter((row) => row.status === "pending" || row.status === "in_progress").map((row) => ({
content: row.content,
status: row.status,
priority: row.priority,
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/tool/todowrite.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
Use this tool to create and manage a structured task list. Completed/cancelled tasks are auto-removed for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
It also helps the user understand the progress of the task and overall progress of their requests.

## When to Use This Tool
Expand Down
Loading