mcp-probe-kit 3.6.10 → 3.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +13 -7
  2. package/build/index.js +16 -13
  3. package/build/lib/__tests__/src8-guidance.unit.test.d.ts +1 -0
  4. package/build/lib/__tests__/src8-guidance.unit.test.js +62 -0
  5. package/build/lib/code-review-input.d.ts +15 -0
  6. package/build/lib/code-review-input.js +47 -0
  7. package/build/lib/src8-guidance.d.ts +178 -0
  8. package/build/lib/src8-guidance.js +633 -0
  9. package/build/lib/tbp8-guidance.d.ts +4 -0
  10. package/build/lib/tbp8-guidance.js +4 -0
  11. package/build/schemas/code-analysis-tools.d.ts +49 -5
  12. package/build/schemas/code-analysis-tools.js +49 -5
  13. package/build/schemas/code-gen-tools.d.ts +9 -1
  14. package/build/schemas/code-gen-tools.js +9 -1
  15. package/build/schemas/index.d.ts +65 -9
  16. package/build/schemas/orchestration-tools.d.ts +7 -3
  17. package/build/schemas/orchestration-tools.js +7 -3
  18. package/build/schemas/output/core-tools.d.ts +238 -13
  19. package/build/schemas/output/core-tools.js +63 -13
  20. package/build/schemas/structured-output.d.ts +26 -8
  21. package/build/schemas/structured-output.js +17 -7
  22. package/build/tools/__tests__/code_review.unit.test.d.ts +1 -0
  23. package/build/tools/__tests__/code_review.unit.test.js +43 -0
  24. package/build/tools/__tests__/fix_bug.unit.test.js +54 -17
  25. package/build/tools/__tests__/gentest.unit.test.d.ts +1 -0
  26. package/build/tools/__tests__/gentest.unit.test.js +40 -0
  27. package/build/tools/__tests__/refactor.unit.test.d.ts +1 -0
  28. package/build/tools/__tests__/refactor.unit.test.js +40 -0
  29. package/build/tools/__tests__/start_bugfix.unit.test.js +31 -18
  30. package/build/tools/code_review.js +149 -164
  31. package/build/tools/fix_bug.d.ts +1 -9
  32. package/build/tools/fix_bug.js +137 -289
  33. package/build/tools/gentest.js +149 -186
  34. package/build/tools/refactor.js +132 -360
  35. package/build/tools/start_bugfix.js +258 -344
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -23,6 +23,7 @@
23
23
  [![npm downloads](https://img.shields.io/npm/dm/mcp-probe-kit.svg)](https://www.npmjs.com/package/mcp-probe-kit)
24
24
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
25
25
  [![GitHub stars](https://img.shields.io/github/stars/mybolide/mcp-probe-kit.svg)](https://github.com/mybolide/mcp-probe-kit/stargazers)
26
+ [![Verified on MseeP](https://mseep.ai/badge.svg)](https://mseep.ai/app/ce79a9e5-7422-4862-b235-bc3d65710397)
26
27
 
27
28
  > 🚀 AI-Powered Complete Development Toolkit - Covering the Entire Development Lifecycle
28
29
 
@@ -91,11 +92,16 @@ All hard quality rules live in one module (`src/lib/quality-constraints.ts`) and
91
92
  - Graph snapshots are persisted to `.mcp-probe-kit/graph-snapshots` (customizable via `MCP_GRAPH_SNAPSHOT_DIR`)
92
93
  - Tool responses include `_meta.graph` with snapshot URI and local JSON/Markdown file paths
93
94
 
94
- ### 🐛 TBP 8-Step RCA for Bug Workflows
95
+ ### 🐛 SRC-8 Bug Root-Cause Workflow (TBP-Inspired)
95
96
 
96
- - `start_bugfix` defaults to Toyota-style TBP 8-step root-cause analysis before repair
97
- - `fix_bug` returns a structured TBP skeleton covering phenomenon, timeline, ruled-out paths, boundary, root cause, evidence, and repair plan
98
- - This makes bug, regression, anomaly, and "why didn't it work" investigations follow analyze-first discipline instead of patching symptoms
97
+ - **[SRC-8 Methodology](docs/src8-methodology.md)** (中文: [src8-methodology.zh-CN.md](docs/src8-methodology.zh-CN.md)) Software Root-Cause 8-step protocol inspired by Toyota TBP / PDCA, adapted for code and AI agents
98
+ - `start_bugfix` runs graph narrowing, then **delegated SRC-8 plan** (`metadata.plan.steps` src8-1~8) before repair and tests
99
+ - `fix_bug` returns **delegated plan** (src8-1~8), `src8Checklist`, **`rootCauseWorksheet`** (Step 4 core), and hard gates (no code change until root-cause worksheet is closed)
100
+ - Highlights vs manufacturing TBP: **repro contract**, **attribution layers** (including `agent_behavior`), **contributing factors**, **memorize_asset** for cross-repo learning
101
+
102
+ **Inherited from Toyota TBP:** gap thinking, Plan-before-Do, no skipping to root-cause analysis, fact-based investigation, countermeasures over symptoms, evaluate then standardize.
103
+
104
+ **Our elevation:** genchi-genbutsu → read code/logs/repro; Step 4 worksheet; guidance-only MCP that forces discipline while the Agent executes.
99
105
 
100
106
  ### 🧠 Memory Retrieval
101
107
 
@@ -301,7 +307,7 @@ This mode performs 1-2 rounds of structured clarification before entering spec/f
301
307
 
302
308
  6 intelligent orchestration tools that automatically combine multiple basic tools for one-click complex development workflows:
303
309
  - `start_feature` - New feature development (Requirements → Design → Estimation)
304
- - `start_bugfix` - Bug fixing (TBP 8-step RCA → Fix → Testing)
310
+ - `start_bugfix` - Bug fixing (SRC-8 RCA → Fix → Testing)
305
311
  - `start_onboard` - Project onboarding (Generate project context docs)
306
312
  - `start_ui` - UI development (Design system → Components → Code)
307
313
  - `start_product` - Product design (PRD → Prototype → Design system → HTML)
@@ -386,8 +392,8 @@ This ensures `start_ui` can generate professional-grade UI code even offline.
386
392
  |---------|-----------------|--------|
387
393
  | Develop new feature (complete flow) | `start_feature` | Auto-complete: spec→estimation |
388
394
  | Only need feature spec docs | `add_feature` | More lightweight, only generates docs |
389
- | Fix bug (complete flow) | `start_bugfix` | Root-cause-first flow: TBP RCA → fix → test |
390
- | Only need bug analysis | `fix_bug` | TBP 8-step RCA only, without full orchestration |
395
+ | Fix bug (complete flow) | `start_bugfix` | Delegated SRC-8 plan (src8-1~8) → fix → test → memorize |
396
+ | Only need bug analysis | `fix_bug` | Delegated SRC-8 plan + root-cause worksheet (methodology: [docs](docs/src8-methodology.md)) |
391
397
  | Generate design system | `ui_design_system` | Directly generate design specs |
392
398
  | Develop UI components | `start_ui` | Complete flow: design→components→code |
393
399
  | Product design (requirements to prototype) | `start_product` | One-click: PRD→prototype→HTML |
package/build/index.js CHANGED
@@ -17,6 +17,12 @@ import { ensureMcpProbeKitBootstrapForToolCall, } from "./lib/workflow-skill-ins
17
17
  import { resolveWorkspaceRoot, resolveWorkspaceRootWithMeta } from "./lib/workspace-root.js";
18
18
  import { PROJECT_BOOTSTRAP_URI, discoverProjectResources, readProjectResourceContent, } from "./lib/project-mcp-resources.js";
19
19
  import { isAbortError, } from "./lib/tool-execution-context.js";
20
+ /** 启动日志标识:用于确认 Cursor 是否加载了当前 build(非 npm/npx 缓存旧进程) */
21
+ const MCP_BUILD_TAG = "progress-off-20260710";
22
+ function isProgressNotificationEnabled() {
23
+ const raw = (process.env.MCP_PROGRESS_NOTIFICATIONS ?? "").trim().toLowerCase();
24
+ return raw === "1" || raw === "true" || raw === "yes";
25
+ }
20
26
  const EXTENSIONS_CAPABILITY_KEY = "io.github.mybolide/extensions";
21
27
  const MAX_UI_APP_RESOURCES = 30;
22
28
  const MAX_GRAPH_SNAPSHOTS = 20;
@@ -566,7 +572,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
566
572
  if (shouldAutoEscalateToTask(name, Boolean(taskRequest))) {
567
573
  taskRequest = taskRequest ?? {};
568
574
  }
569
- const emitProgress = async (progress, message) => {
575
+ const emitProgress = async (_progress, _message) => {
576
+ // Cursor Shared MCP 在工具响应返回后会立即注销 progressToken;
577
+ // 迟到的 notifications/progress 会导致整连接 error(unknown token)。
578
+ // 默认关闭;需要时可设 MCP_PROGRESS_NOTIFICATIONS=1。
579
+ if (!isProgressNotificationEnabled()) {
580
+ return;
581
+ }
570
582
  const progressToken = extra._meta?.progressToken;
571
583
  if (progressToken === undefined) {
572
584
  return;
@@ -576,9 +588,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
576
588
  method: "notifications/progress",
577
589
  params: {
578
590
  progressToken,
579
- progress,
591
+ progress: _progress,
580
592
  total: 100,
581
- message,
593
+ message: _message,
582
594
  ...(traceMeta === undefined
583
595
  ? {}
584
596
  : {
@@ -634,7 +646,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
634
646
  // 后台执行任务,不阻塞当前请求,立即返回 taskId 给客户端轮询。
635
647
  void (async () => {
636
648
  try {
637
- await taskContext.reportProgress?.(5, `开始执行工具: ${name}`);
638
649
  const { bootstrap, result: rawResult } = await executeTool(name, args, taskContext);
639
650
  if (!rawResult || typeof rawResult !== "object") {
640
651
  throw new Error(`工具 ${name} 返回了无效响应`);
@@ -689,23 +700,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
689
700
  };
690
701
  try {
691
702
  ensureNotAborted();
692
- await emitProgress(5, `开始执行工具: ${name}`);
693
703
  const { bootstrap, result: rawResult } = await executeTool(name, args, toolContext);
694
704
  if (!rawResult || typeof rawResult !== "object") {
695
705
  throw new Error(`工具 ${name} 返回了无效响应`);
696
706
  }
697
707
  ensureNotAborted();
698
708
  const result = decorateResult(name, args, rawResult, traceMeta, bootstrap);
699
- await emitProgress(100, `工具执行完成: ${name}`);
700
709
  return result;
701
710
  }
702
711
  catch (error) {
703
- if (extra.signal.aborted) {
704
- await emitProgress(100, `工具执行已取消: ${name}`);
705
- }
706
- else {
707
- await emitProgress(100, `工具执行失败: ${name}`);
708
- }
709
712
  const errorMessage = error instanceof Error ? error.message : String(error);
710
713
  return withTraceMeta(makeToolError(errorMessage), traceMeta);
711
714
  }
@@ -1000,7 +1003,7 @@ async function main() {
1000
1003
  const transport = new StdioServerTransport();
1001
1004
  await server.connect(transport);
1002
1005
  const workspaceMeta = resolveWorkspaceRootWithMeta("");
1003
- console.error(`MCP Probe Kit v${VERSION} 已启动 | workspace=${workspaceMeta.root} | source=${workspaceMeta.source}`);
1006
+ console.error(`MCP Probe Kit v${VERSION} 已启动 | build=${MCP_BUILD_TAG} | workspace=${workspaceMeta.root} | source=${workspaceMeta.source}`);
1004
1007
  if (workspaceMeta.warning) {
1005
1008
  console.error(`[MCP Probe Kit] ${workspaceMeta.warning}`);
1006
1009
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,62 @@
1
+ import { describe, expect, test } from "vitest";
2
+ import { ATTRIBUTION_LAYERS, buildRootCauseWorksheet, buildSrc8Checklist, buildSrc8DelegatedPlan, buildSrc8EvidenceFromInput, mergeBugfixOrchestrationPlan, renderSrc8GateRules, renderTbpInspirationSection, resolveAnalysisMode, } from "../../lib/src8-guidance.js";
3
+ describe("src8-guidance 单元测试", () => {
4
+ test("buildSrc8Checklist 为 8 步且 Step 4 为 root_cause", () => {
5
+ const checklist = buildSrc8Checklist();
6
+ expect(checklist).toHaveLength(8);
7
+ expect(checklist[0].id).toBe("clarify_gap");
8
+ expect(checklist[3].id).toBe("root_cause");
9
+ expect(checklist[3].inspiredByTbpStep).toBe(4);
10
+ expect(checklist.every((item) => item.inspiredByTbpStep >= 1)).toBe(true);
11
+ });
12
+ test("buildRootCauseWorksheet 含 4a~4e 子步", () => {
13
+ const ws = buildRootCauseWorksheet({ hasComparisonSample: false });
14
+ expect(ws.substeps.map((s) => s.id)).toEqual(["4a", "4b", "4c", "4d", "4e"]);
15
+ expect(ws.template.evidenceGaps.length).toBeGreaterThan(0);
16
+ });
17
+ test("归因层含 agent_behavior", () => {
18
+ expect(ATTRIBUTION_LAYERS.some((l) => l.id === "agent_behavior")).toBe(true);
19
+ });
20
+ test("renderTbpInspirationSection 说明借鉴关系", () => {
21
+ const text = renderTbpInspirationSection();
22
+ expect(text).toMatch(/丰田 TBP/);
23
+ expect(text).toMatch(/不是.*逐字翻译/);
24
+ });
25
+ test("resolveAnalysisMode 兼容 tbp8 别名", () => {
26
+ expect(resolveAnalysisMode("tbp8")).toBe("src8");
27
+ expect(resolveAnalysisMode("src8")).toBe("src8");
28
+ });
29
+ test("renderSrc8GateRules 强调 Step 4 工作表", () => {
30
+ expect(renderSrc8GateRules()).toMatch(/rootCauseWorksheet|真因工作表/);
31
+ });
32
+ test("buildSrc8EvidenceFromInput 支持验收目标", () => {
33
+ const evidence = buildSrc8EvidenceFromInput({
34
+ error_message: "err",
35
+ verification_target: "test green",
36
+ });
37
+ expect(evidence.some((e) => e.source === "verification_target")).toBe(true);
38
+ });
39
+ test("buildSrc8DelegatedPlan 产出 8 步 delegated plan", () => {
40
+ const plan = buildSrc8DelegatedPlan({ error_message: "boom" });
41
+ expect(plan.mode).toBe("delegated");
42
+ expect(plan.steps.map((s) => s.id)).toEqual([
43
+ "src8-1",
44
+ "src8-2",
45
+ "src8-3",
46
+ "src8-4",
47
+ "src8-5",
48
+ "src8-6",
49
+ "src8-7",
50
+ "src8-8",
51
+ ]);
52
+ expect(plan.steps.find((s) => s.id === "src8-4")?.dependsOn).toContain("src8-3");
53
+ });
54
+ test("mergeBugfixOrchestrationPlan 可前置上下文步骤", () => {
55
+ const plan = mergeBugfixOrchestrationPlan({
56
+ src8Input: { error_message: "err" },
57
+ preambleSteps: [{ id: "context", tool: "init_project_context", outputs: [] }],
58
+ });
59
+ expect(plan.steps[0].id).toBe("context");
60
+ expect(plan.steps.some((s) => s.id === "src8-1")).toBe(true);
61
+ });
62
+ });
@@ -0,0 +1,15 @@
1
+ export type GuidanceCodeInput = {
2
+ code?: string;
3
+ filePath?: string;
4
+ projectRoot?: string;
5
+ };
6
+ export type GuidanceCodeResolved = {
7
+ code: string;
8
+ file?: string;
9
+ error?: string;
10
+ };
11
+ /** 解析指南型工具的代码输入:优先 inline code,否则从 file_path 读取 */
12
+ export declare function resolveGuidanceCode(input: GuidanceCodeInput): GuidanceCodeResolved;
13
+ export declare function resolveReviewCode(input: GuidanceCodeInput): GuidanceCodeResolved;
14
+ export declare function trimCodeForPrompt(code: string, maxChars?: number, inputKey?: string): string;
15
+ export declare function trimReviewCodeForPrompt(code: string, maxChars?: number): string;
@@ -0,0 +1,47 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ /** 解析指南型工具的代码输入:优先 inline code,否则从 file_path 读取 */
4
+ export function resolveGuidanceCode(input) {
5
+ return resolveReviewCode(input);
6
+ }
7
+ export function resolveReviewCode(input) {
8
+ const inline = input.code?.trim() ?? "";
9
+ if (inline) {
10
+ return { code: inline, file: input.filePath?.trim() || undefined };
11
+ }
12
+ const filePath = input.filePath?.trim();
13
+ if (!filePath) {
14
+ return { code: "" };
15
+ }
16
+ const resolved = path.isAbsolute(filePath)
17
+ ? filePath
18
+ : path.resolve(input.projectRoot?.trim() || process.cwd(), filePath);
19
+ if (!fs.existsSync(resolved)) {
20
+ return { code: "", file: filePath, error: `文件不存在: ${resolved}` };
21
+ }
22
+ try {
23
+ const stat = fs.statSync(resolved);
24
+ if (!stat.isFile()) {
25
+ return { code: "", file: filePath, error: `不是文件: ${resolved}` };
26
+ }
27
+ return {
28
+ code: fs.readFileSync(resolved, "utf-8"),
29
+ file: filePath,
30
+ };
31
+ }
32
+ catch (error) {
33
+ const message = error instanceof Error ? error.message : String(error);
34
+ return { code: "", file: filePath, error: `读取文件失败: ${message}` };
35
+ }
36
+ }
37
+ export function trimCodeForPrompt(code, maxChars = 24000, inputKey = "reviewInput") {
38
+ if (code.length <= maxChars) {
39
+ return code;
40
+ }
41
+ const head = Math.floor(maxChars * 0.7);
42
+ const tail = maxChars - head - 80;
43
+ return `${code.slice(0, head)}\n\n/* ... [已截断,完整内容见 structuredContent.${inputKey}.code] ... */\n\n${code.slice(-tail)}`;
44
+ }
45
+ export function trimReviewCodeForPrompt(code, maxChars = 24000) {
46
+ return trimCodeForPrompt(code, maxChars, "reviewInput");
47
+ }
@@ -0,0 +1,178 @@
1
+ /**
2
+ * SRC-8(Software Root-Cause 8-step)
3
+ *
4
+ * 面向软件与 Agent 的真因分析协议,受丰田 TBP(Toyota Business Practice)八步法与 PDCA 启发,
5
+ * 但使用代码世界的语言(复现、分层、贡献因子、测试契约、记忆沉淀)。
6
+ *
7
+ * @see docs/src8-methodology.md
8
+ * @see docs/src8-methodology.zh-CN.md
9
+ */
10
+ export declare const SRC8_METHODOLOGY: "src8";
11
+ /** @deprecated 使用 src8;保留兼容旧调用方 */
12
+ export declare const TBP8_ALIAS: "tbp8";
13
+ export type Src8StepId = "clarify_gap" | "narrow_boundary" | "acceptance_contract" | "root_cause" | "countermeasures" | "implement" | "evaluate" | "standardize";
14
+ export type PdcaPhase = "plan" | "do" | "check" | "act";
15
+ export type AttributionLayer = "code" | "runtime" | "data_contract" | "integration" | "agent_behavior" | "environment";
16
+ export declare const ATTRIBUTION_LAYERS: Array<{
17
+ id: AttributionLayer;
18
+ label: string;
19
+ hint: string;
20
+ }>;
21
+ export type Src8ChecklistItem = {
22
+ step: number;
23
+ id: Src8StepId;
24
+ title: string;
25
+ pdca: PdcaPhase;
26
+ status: "pending" | "agent_must_complete";
27
+ question: string;
28
+ techniques: string[];
29
+ antiPatterns: string[];
30
+ /** 借鉴自丰田 TBP 的对应步骤(1-8) */
31
+ inspiredByTbpStep: number;
32
+ schemaFields?: string[];
33
+ };
34
+ export declare const SRC8_STEPS: Omit<Src8ChecklistItem, "status">[];
35
+ export declare const ROOT_CAUSE_WORKSHEET_GATES: {
36
+ readonly minHypotheses: 2;
37
+ readonly minRuledOutWithEvidence: 2;
38
+ readonly minWhyLevels: 3;
39
+ readonly requireEvidenceGapsIfNoComparison: true;
40
+ readonly blockCountermeasuresIfConfidenceLow: true;
41
+ readonly symptomOnlyPatterns: readonly [RegExp, RegExp, RegExp, RegExp];
42
+ };
43
+ export type RootCauseWorksheetSubstep = {
44
+ id: "4a" | "4b" | "4c" | "4d" | "4e";
45
+ title: string;
46
+ status: "agent_must_complete";
47
+ description: string;
48
+ };
49
+ export declare function buildSrc8Checklist(): Src8ChecklistItem[];
50
+ export declare function buildRootCauseWorksheetSubsteps(): RootCauseWorksheetSubstep[];
51
+ export declare function buildRootCauseWorksheet(input: {
52
+ hasComparisonSample: boolean;
53
+ }): {
54
+ step: number;
55
+ title: string;
56
+ substeps: RootCauseWorksheetSubstep[];
57
+ gates: {
58
+ readonly minHypotheses: 2;
59
+ readonly minRuledOutWithEvidence: 2;
60
+ readonly minWhyLevels: 3;
61
+ readonly requireEvidenceGapsIfNoComparison: true;
62
+ readonly blockCountermeasuresIfConfidenceLow: true;
63
+ readonly symptomOnlyPatterns: readonly [RegExp, RegExp, RegExp, RegExp];
64
+ };
65
+ agentMustProduce: string;
66
+ template: {
67
+ mode: "simple" | "complex" | null;
68
+ attributionLayer: AttributionLayer | null;
69
+ hypotheses: Array<{
70
+ id: string;
71
+ statement: string;
72
+ attributionLayer?: AttributionLayer;
73
+ status: "ruled_out" | "pending" | "confirmed";
74
+ evidence: string[];
75
+ counterEvidence: string[];
76
+ }>;
77
+ forkPoint: string | null;
78
+ whyChain: Array<{
79
+ level: number;
80
+ observation: string;
81
+ why: string;
82
+ because: string;
83
+ }>;
84
+ primaryCause: string | null;
85
+ contributingFactors: string[];
86
+ rootCauseStatement: string | null;
87
+ confidence: "high" | "medium" | "low" | null;
88
+ evidenceGaps: string[];
89
+ };
90
+ };
91
+ export declare function renderTbpInspirationSection(): string;
92
+ export declare function renderSrc8PdcaMap(): string;
93
+ export declare function renderAttributionLayersMarkdown(): string;
94
+ export declare function renderRootCauseWorksheetMarkdown(): string;
95
+ /** Agent 用:可执行清单,不含 TBP 渊源长文(详见 docs/src8-methodology*.md) */
96
+ export declare function renderSrc8AgentChecklistMarkdown(): string;
97
+ /** 文档/完整版:含 TBP 步骤对照标注 */
98
+ export declare function renderSrc8ChecklistMarkdown(): string;
99
+ export declare function renderSrc8GateRules(): string;
100
+ export declare function renderReproductionGate(): string;
101
+ export declare function renderSrc8AgentOutputFormat(): string;
102
+ export type Src8InputEvidence = {
103
+ type: "symptom" | "timeline" | "stack" | "code" | "comparison";
104
+ detail: string;
105
+ source: string;
106
+ };
107
+ export type Src8ExecutionPlanStep = {
108
+ id: string;
109
+ tool?: string;
110
+ action?: string;
111
+ args?: Record<string, unknown>;
112
+ outputs?: string[];
113
+ when?: string;
114
+ dependsOn?: string[];
115
+ note?: string;
116
+ };
117
+ export type Src8ExecutionPlan = {
118
+ mode: "delegated";
119
+ methodology: typeof SRC8_METHODOLOGY;
120
+ steps: Src8ExecutionPlanStep[];
121
+ };
122
+ export type BuildSrc8DelegatedPlanInput = {
123
+ error_message: string;
124
+ stack_trace?: string;
125
+ analysis_mode?: string;
126
+ code_context?: string;
127
+ project_root?: string;
128
+ file_path?: string;
129
+ /** 默认 true;start_bugfix 外层若单独编排可设为 false */
130
+ includeGentest?: boolean;
131
+ includeMemorize?: boolean;
132
+ };
133
+ export declare function buildSrc8DelegatedPlan(input: BuildSrc8DelegatedPlanInput): Src8ExecutionPlan;
134
+ export type MergeBugfixOrchestrationPlanInput = {
135
+ src8Input: BuildSrc8DelegatedPlanInput;
136
+ preambleSteps?: Src8ExecutionPlanStep[];
137
+ appendSteps?: Src8ExecutionPlanStep[];
138
+ /** 为 true 时不在 src8 内嵌 memorize,由 appendSteps 提供 */
139
+ deferMemorize?: boolean;
140
+ };
141
+ /** start_bugfix / loop 外层:上下文步骤 + SRC-8 八步 + 可选闸门/记忆 */
142
+ export declare function mergeBugfixOrchestrationPlan(input: MergeBugfixOrchestrationPlanInput): Src8ExecutionPlan;
143
+ export declare function renderSrc8PlanSummaryMarkdown(plan: Src8ExecutionPlan): string;
144
+ export declare function buildSrc8EvidenceFromInput(input: {
145
+ error_message: string;
146
+ stack_trace?: string;
147
+ code_context?: string;
148
+ steps_to_reproduce?: string;
149
+ expected_behavior?: string;
150
+ actual_behavior?: string;
151
+ success_sample?: string;
152
+ verification_target?: string;
153
+ }): Src8InputEvidence[];
154
+ export declare function renderFixBugAgentPromptBody(sections: {
155
+ error_message: string;
156
+ stack_trace_section: string;
157
+ reproduce_section: string;
158
+ behavior_section: string;
159
+ comparison_section: string;
160
+ verification_target_section: string;
161
+ code_context_section: string;
162
+ plan: Src8ExecutionPlan;
163
+ }): string;
164
+ /** @deprecated 使用 renderFixBugAgentPromptBody;完整 TBP 对照版见 docs */
165
+ export declare function renderFixBugPromptBody(sections: Parameters<typeof renderFixBugAgentPromptBody>[0]): string;
166
+ export declare function resolveAnalysisMode(raw?: string): typeof SRC8_METHODOLOGY;
167
+ export declare const TBP8_STEPS: Omit<Src8ChecklistItem, "status">[];
168
+ export type TbpStepId = Src8StepId;
169
+ export type TbpChecklistItem = Src8ChecklistItem;
170
+ export declare const buildTbpChecklist: typeof buildSrc8Checklist;
171
+ export declare const buildTbpEvidenceFromInput: typeof buildSrc8EvidenceFromInput;
172
+ export declare const renderTbpPdcaMap: typeof renderSrc8PdcaMap;
173
+ export declare const renderTbpChecklistMarkdown: typeof renderSrc8ChecklistMarkdown;
174
+ export declare const renderTbpGateRules: typeof renderSrc8GateRules;
175
+ export declare const renderTbpReproductionGate: typeof renderReproductionGate;
176
+ export declare const renderTbpAgentOutputFormat: typeof renderSrc8AgentOutputFormat;
177
+ export declare const renderTbpFiveWhyTemplate: () => string;
178
+ export declare const renderTbpBugInfoSections: typeof renderFixBugPromptBody;