diff --git a/.blueprint/modules/onboarding-pack.md b/.blueprint/modules/onboarding-pack.md index 3f56cc6..332ef54 100644 --- a/.blueprint/modules/onboarding-pack.md +++ b/.blueprint/modules/onboarding-pack.md @@ -73,8 +73,8 @@ git 是「过去时 + 量化」(做了什么),蓝图是「将来时 + 语 - files: src-tauri/src/commands/onboarding.rs, src-tauri/resources/onboarding/{AGENTS.md,lefthook.yml,git-workflow.md}.tmpl - acceptance: include_str! 内嵌 3 个标准模板(蓝本取自 enterprise-system);分发时文件不存在→写入、已存在→跳过并在报告标注,绝不覆盖;复用 mcp_inject 的路径解析(含 WSL);返回每个模板的 written/skipped/failed -### 🔵 B apply_onboarding_pack 编排 + 前端入口 -- status: in_progress +### ✅ B apply_onboarding_pack 编排 + 前端入口 +- status: done - complexity: M - depends: onboarding-pack(卡A) - files: src-tauri/src/commands/onboarding.rs, src-tauri/src/lib.rs, src/lib/commands.ts, src/components/dashboard/ProjectCard.tsx diff --git a/src/components/dashboard/BlueprintModal.tsx b/src/components/dashboard/BlueprintModal.tsx index f5a9d24..1851692 100644 --- a/src/components/dashboard/BlueprintModal.tsx +++ b/src/components/dashboard/BlueprintModal.tsx @@ -22,7 +22,7 @@ import { getFlywheelStats, generateMuhePrompt, archiveProjectDocs, - applyBlueprintBuff, + applyOnboardingPack, removeBlueprintBuff, getBuffStatus, getUserConventionsStatus, @@ -38,6 +38,7 @@ import { type FlywheelStats, type StalledProject, type BuffStatus, + type TemplateResult, type UserConventionsStatus, } from "../../lib/commands"; @@ -1068,6 +1069,7 @@ function GovernancePanel({ const [buffError, setBuffError] = useState(null); const [buffInitPrompt, setBuffInitPrompt] = useState(null); const [buffInitCopied, setBuffInitCopied] = useState(false); + const [packTemplates, setPackTemplates] = useState(null); const [promptMode, setPromptMode] = useState<"init" | "sync" | null>(null); const [prompt, setPrompt] = useState(""); @@ -1091,8 +1093,10 @@ function GovernancePanel({ setBuffLoading(true); setBuffError(null); setBuffInitPrompt(null); + setPackTemplates(null); try { - await applyBlueprintBuff(projectPath, projectId); + const report = await applyOnboardingPack(projectPath, projectId); + setPackTemplates(report.templates); refetchBuff(); // 只有尚无蓝图时才展示 init prompt;已有蓝图则 Buff 直接激活无需初始化 if (bpStatus?.status === "none") { @@ -1113,6 +1117,7 @@ function GovernancePanel({ await removeBlueprintBuff(projectPath); refetchBuff(); setBuffInitPrompt(null); + setPackTemplates(null); } catch (e) { setBuffError(String(e)); } finally { @@ -1435,13 +1440,13 @@ function GovernancePanel({ {/* ── 蓝图 Buff ─────────────────────────────────────── */}
-

蓝图 Buff

+

接入包

{buffStatus?.status === "active" && ( ⚡ 已激活 )}

- 施加 Buff 后,炼境将自动监听 git 提交,匹配任务文件并更新进度。 + 应用接入包:种入 AGENTS.md / lefthook / git-workflow 标准模板(不覆盖已有),并挂 buff 自动监听 git 提交、采集飞轮数据。

{buffStatus?.last_sync_at && (

上次同步:{buffStatus.last_sync_at}

@@ -1449,6 +1454,30 @@ function GovernancePanel({ {buffError && (

{buffError}

)} + {packTemplates && ( +
+

模板分发

+ {packTemplates.map((t) => ( +

+ + {t.action === "written" ? "✓" : t.action === "skipped" ? "○" : "✗"} + + {t.name} + + {t.action === "written" ? "已写入" : t.action === "skipped" ? "已存在" : t.detail} + +

+ ))} +
+ )} {buffStatus?.status === "active" ? (