feat: multi-branch template scanning from git repo + manual template selection

- Rewrite template.rs to scan all remote branches via git commands
  (git fetch/branch -r/ls-tree/git show/git archive)
- Add manual template picker dropdown in CreateForm UI
- Remove sentence-transformers/embed.py from Dockerfile (separate container)
- Clean up Gitea API approach, use local git repo instead
- Add chat panel and sidebar layout improvements
This commit is contained in:
Fam Zheng
2026-03-07 16:24:56 +00:00
parent cb81d7eb41
commit 07f1f285b6
14 changed files with 1030 additions and 321 deletions

View File

@@ -11,6 +11,7 @@ use crate::AppState;
use crate::agent::{AgentEvent, PlanStepInfo};
use crate::db::{Workflow, ExecutionLogEntry, Comment, LlmCallLogEntry};
use crate::state::AgentState;
use crate::template;
use super::{ApiResult, db_err};
#[derive(serde::Serialize)]
@@ -21,6 +22,8 @@ struct ReportResponse {
#[derive(Deserialize)]
pub struct CreateWorkflow {
pub requirement: String,
#[serde(default)]
pub template_id: Option<String>,
}
#[derive(Deserialize)]
@@ -36,6 +39,7 @@ pub fn router(state: Arc<AppState>) -> Router {
.route("/workflows/{id}/report", get(get_report))
.route("/workflows/{id}/plan", get(get_plan))
.route("/workflows/{id}/llm-calls", get(list_llm_calls))
.route("/templates", get(list_templates))
.with_state(state)
}
@@ -72,6 +76,7 @@ async fn create_workflow(
state.agent_mgr.send_event(&project_id, AgentEvent::NewRequirement {
workflow_id: workflow.id.clone(),
requirement: workflow.requirement.clone(),
template_id: input.template_id,
}).await;
Ok(Json(workflow))
@@ -191,3 +196,7 @@ async fn list_llm_calls(
.map(Json)
.map_err(db_err)
}
async fn list_templates() -> Json<Vec<template::TemplateListItem>> {
Json(template::list_all_templates().await)
}