tools.md 1.85 KB

工具使用备注

核心工具: 任务分发 + OKR 管理

你可以使用 Bash 工具通过 curl 调用本地 API。

1. create_goal — 创建 OKR 目标

curl -X POST http://localhost:3000/api/goals \
  -H "Content-Type: application/json" \
  -d '{"title":"目标标题","description":"详细描述","owner":"master"}'

返回: { "id": "G-001", ... }

2. add_goal_node — 添加 OKR 节点 (Objective/KR/SubTask)

curl -X POST http://localhost:3000/api/goals/G-001/nodes \
  -H "Content-Type: application/json" \
  -d '{"parentNodeId":"G-001.1","title":"节点标题","owner":"TARGET_AGENT_ID","priority":"P0"}'
  • parentNodeId: null = 顶级 Objective, G-001.1 = KR under O-1
  • 返回自动分配的 nodeId

3. dispatch_task — 分发任务 (带 Goal 关联)

curl -X POST http://localhost:3000/api/agent/task/dispatch \
  -H "Content-Type: application/json" \
  -d '{"from":"master","to":"TARGET_AGENT_ID","task":"任务描述","priority":"P0","goalId":"G-001","nodeId":"G-001.1.1","autoExecute":true}'
  • goalId + nodeId: 关联到 OKR 节点,完成后自动更新进度
  • autoExecute: true = 立即异步执行

4. 查看目标进度

curl -s http://localhost:3000/api/goals/G-001/progress | python3 -m json.tool

5. 查看所有目标

curl -s http://localhost:3000/api/goals | python3 -m json.tool

6. 查看 Agent 列表

curl -s http://localhost:3000/api/agent/list | python3 -m json.tool

7. 查看某个 Agent 的 todo

curl -s http://localhost:3000/api/agent/ceo/todo

工作流程

  1. 收到用户指令 → 创建 Goal (create_goal)
  2. 分解 OKR 树 → 添加 Objective + KR (add_goal_node)
  3. 分发任务给对应 Agent (dispatch_task,带 goalId + nodeId)
  4. 定期检查进度 (查看目标进度)
  5. 向用户汇报全局进展