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

@@ -550,8 +550,7 @@ impl LoadedTemplate {
.await
.unwrap_or_default();
let tools_dir = base.join("tools");
let external_tools = ExternalToolManager::discover(&tools_dir).await;
let external_tools = ExternalToolManager::discover(base).await;
tracing::info!("Template '{}': {} external tools", template_id, external_tools.len());
let kb_dir = base.join("kb");