feat: 添加后台 Agent 执行和模型选择功能

- 新增 AgentManager 管理后台 Agent 生命周期
- Task 工具支持 run_in_background 参数实现后台执行
- Task 工具支持 model 参数选择 sonnet/opus/haiku 模型
- 新增 agent_output 工具查询后台 Agent 执行状态和结果
- 添加 AgentManager 和 AgentOutput 工具单元测试
This commit is contained in:
2025-12-11 15:46:30 +08:00
parent 729fb2d42a
commit ad5d30b262
10 changed files with 927 additions and 13 deletions
+22
View File
@@ -19,6 +19,7 @@
"js-yaml": "^4.1.1",
"ora": "^8.1.0",
"tree-sitter-bash": "^0.25.1",
"uuid": "^13.0.0",
"vscode-jsonrpc": "^8.2.1",
"vscode-languageserver-protocol": "^3.17.5",
"web-tree-sitter": "^0.25.10",
@@ -30,6 +31,7 @@
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.0.0",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^4.0.15",
"tsx": "^4.19.0",
"typescript": "^5.6.0",
@@ -1354,6 +1356,13 @@
"undici-types": "~6.21.0"
}
},
"node_modules/@types/uuid": {
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz",
"integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==",
"dev": true,
"license": "MIT"
},
"node_modules/@vercel/oidc": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.0.5.tgz",
@@ -2882,6 +2891,19 @@
"devOptional": true,
"license": "MIT"
},
"node_modules/uuid": {
"version": "13.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz",
"integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT",
"bin": {
"uuid": "dist-node/bin/uuid"
}
},
"node_modules/vite": {
"version": "7.2.7",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.2.7.tgz",