feat: auto-install Python deps from template pyproject.toml via uv

ExternalToolManager.discover() now accepts template root dir, detects
pyproject.toml and runs `uv sync` to create a venv. Tool invocation and
schema discovery inject the venv PATH/VIRTUAL_ENV so template tools can
import declared dependencies without manual installation.
This commit is contained in:
Fam Zheng
2026-03-09 15:22:35 +00:00
parent fa800b1601
commit c70fbc49f0
7 changed files with 197 additions and 32 deletions

View File

@@ -698,13 +698,13 @@ fn build_step_tools() -> Vec<Tool> {
},
"required": ["reason"]
})),
make_tool("step_done", "完成当前步骤。必须提供摘要。可选声明本步骤的产出物", serde_json::json!({
make_tool("step_done", "完成当前步骤。必须提供摘要和产出物列表(无产出物时传空数组)", serde_json::json!({
"type": "object",
"properties": {
"summary": { "type": "string", "description": "本步骤的工作摘要" },
"artifacts": {
"type": "array",
"description": "本步骤的产出物列表",
"description": "本步骤的产出物列表。无产出物时传空数组 []",
"items": {
"type": "object",
"properties": {
@@ -717,7 +717,7 @@ fn build_step_tools() -> Vec<Tool> {
}
}
},
"required": ["summary"]
"required": ["summary", "artifacts"]
})),
tool_kb_search(),
tool_kb_read(),