38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { tool } from "@opencode-ai/plugin";
|
|
|
|
export default tool({
|
|
description:
|
|
"开始一个新的业务活动阶段。仅在语义阶段发生变化时调用一次,用 title 概括阶段,用 reason 说明本阶段为何必要;同一阶段内的多个工具动作不要重复调用。该工具只更新用户可见的过程信息,不执行外部操作。",
|
|
args: {
|
|
title: tool.schema
|
|
.string()
|
|
.min(1)
|
|
.describe("面向用户的简短业务阶段标题,不包含工具名、函数名、文件名或命令。"),
|
|
reason: tool.schema
|
|
.string()
|
|
.min(1)
|
|
.describe("本阶段对完成用户目标的必要性,使用一句简洁的自然语言。"),
|
|
todos: tool.schema
|
|
.array(
|
|
tool.schema.object({
|
|
id: tool.schema.string().optional(),
|
|
content: tool.schema.string().min(1),
|
|
status: tool.schema.enum([
|
|
"pending",
|
|
"in_progress",
|
|
"completed",
|
|
"cancelled",
|
|
]),
|
|
priority: tool.schema.enum(["low", "medium", "high"]).optional(),
|
|
}),
|
|
)
|
|
.optional()
|
|
.describe(
|
|
"已有任务计划时提交完整状态快照,使本阶段与任务状态在同一次更新中生效。",
|
|
),
|
|
},
|
|
async execute() {
|
|
return "活动阶段已更新。";
|
|
},
|
|
});
|