feat: startup git clone for template repo + pass config through

- ensure_repo_ready() at startup: clone if missing, fetch if exists
- TemplateRepoConfig gains local_path field
- list_all_templates/select_template/extract_repo_template accept repo config
- Remove hardcoded repo_dir(), use config.local_path
This commit is contained in:
Fam Zheng
2026-03-09 08:42:23 +00:00
parent 815477a73b
commit d4d9edeb78
5 changed files with 93 additions and 18 deletions

View File

@@ -197,6 +197,8 @@ async fn list_llm_calls(
.map_err(db_err)
}
async fn list_templates() -> Json<Vec<template::TemplateListItem>> {
Json(template::list_all_templates().await)
async fn list_templates(
State(state): State<Arc<AppState>>,
) -> Json<Vec<template::TemplateListItem>> {
Json(template::list_all_templates(state.config.template_repo.as_ref()).await)
}