@s_s/harmonia 1.2.0 → 1.4.0

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 (180) hide show
  1. package/README.md +140 -392
  2. package/build/cli/setup.d.ts +4 -2
  3. package/build/cli/setup.js +44 -18
  4. package/build/cli/setup.js.map +1 -1
  5. package/build/core/action-registry.d.ts +36 -0
  6. package/build/core/action-registry.js +53 -0
  7. package/build/core/action-registry.js.map +1 -0
  8. package/build/core/artifacts.d.ts +66 -0
  9. package/build/core/artifacts.js +178 -0
  10. package/build/core/artifacts.js.map +1 -0
  11. package/build/core/dispatch.d.ts +18 -11
  12. package/build/core/dispatch.js +43 -33
  13. package/build/core/dispatch.js.map +1 -1
  14. package/build/core/issues.d.ts +37 -0
  15. package/build/core/issues.js +100 -0
  16. package/build/core/issues.js.map +1 -0
  17. package/build/core/overrides.d.ts +19 -26
  18. package/build/core/overrides.js +32 -98
  19. package/build/core/overrides.js.map +1 -1
  20. package/build/core/plugin.d.ts +86 -0
  21. package/build/core/plugin.js +332 -0
  22. package/build/core/plugin.js.map +1 -0
  23. package/build/core/registry.d.ts +36 -3
  24. package/build/core/registry.js +63 -5
  25. package/build/core/registry.js.map +1 -1
  26. package/build/core/reviews.d.ts +13 -13
  27. package/build/core/reviews.js +31 -32
  28. package/build/core/reviews.js.map +1 -1
  29. package/build/core/schema.d.ts +43 -15
  30. package/build/core/schema.js +124 -20
  31. package/build/core/schema.js.map +1 -1
  32. package/build/core/state.d.ts +29 -22
  33. package/build/core/state.js +49 -81
  34. package/build/core/state.js.map +1 -1
  35. package/build/core/steps.d.ts +15 -15
  36. package/build/core/steps.js +32 -33
  37. package/build/core/steps.js.map +1 -1
  38. package/build/core/tree-utils.d.ts +52 -0
  39. package/build/core/tree-utils.js +226 -0
  40. package/build/core/tree-utils.js.map +1 -0
  41. package/build/core/types.d.ts +417 -117
  42. package/build/core/types.js +15 -1
  43. package/build/core/types.js.map +1 -1
  44. package/build/core/workflow-engine.d.ts +68 -0
  45. package/build/core/workflow-engine.js +821 -0
  46. package/build/core/workflow-engine.js.map +1 -0
  47. package/build/core/workflow-validator.d.ts +22 -0
  48. package/build/core/workflow-validator.js +489 -0
  49. package/build/core/workflow-validator.js.map +1 -0
  50. package/build/index.js +28 -25
  51. package/build/index.js.map +1 -1
  52. package/build/setup/inject.d.ts +4 -4
  53. package/build/setup/inject.js +6 -6
  54. package/build/setup/inject.js.map +1 -1
  55. package/build/setup/templates.d.ts +9 -7
  56. package/build/setup/templates.js +68 -103
  57. package/build/setup/templates.js.map +1 -1
  58. package/build/tools/artifact-approve.d.ts +8 -0
  59. package/build/tools/artifact-approve.js +94 -0
  60. package/build/tools/artifact-approve.js.map +1 -0
  61. package/build/tools/artifact-schema.d.ts +12 -0
  62. package/build/tools/artifact-schema.js +148 -0
  63. package/build/tools/artifact-schema.js.map +1 -0
  64. package/build/tools/artifact-tools.d.ts +18 -0
  65. package/build/tools/artifact-tools.js +465 -0
  66. package/build/tools/artifact-tools.js.map +1 -0
  67. package/build/tools/{report-dispatch.d.ts → dispatch-report.d.ts} +7 -3
  68. package/build/tools/dispatch-report.js +261 -0
  69. package/build/tools/dispatch-report.js.map +1 -0
  70. package/build/tools/engine-helpers.d.ts +41 -0
  71. package/build/tools/engine-helpers.js +182 -0
  72. package/build/tools/engine-helpers.js.map +1 -0
  73. package/build/tools/get-project-status.d.ts +6 -4
  74. package/build/tools/get-project-status.js +308 -246
  75. package/build/tools/get-project-status.js.map +1 -1
  76. package/build/tools/get-role-prompt.d.ts +1 -1
  77. package/build/tools/get-role-prompt.js +7 -41
  78. package/build/tools/get-role-prompt.js.map +1 -1
  79. package/build/tools/issue-tools.d.ts +10 -0
  80. package/build/tools/issue-tools.js +169 -0
  81. package/build/tools/issue-tools.js.map +1 -0
  82. package/build/tools/iteration-start.d.ts +7 -4
  83. package/build/tools/iteration-start.js +51 -20
  84. package/build/tools/iteration-start.js.map +1 -1
  85. package/build/tools/loop-done.d.ts +11 -0
  86. package/build/tools/loop-done.js +109 -0
  87. package/build/tools/loop-done.js.map +1 -0
  88. package/build/tools/patch-start.d.ts +16 -0
  89. package/build/tools/patch-start.js +122 -0
  90. package/build/tools/patch-start.js.map +1 -0
  91. package/build/tools/project-init.d.ts +5 -5
  92. package/build/tools/project-init.js +47 -18
  93. package/build/tools/project-init.js.map +1 -1
  94. package/build/tools/role-dispatch.d.ts +55 -0
  95. package/build/tools/role-dispatch.js +508 -0
  96. package/build/tools/role-dispatch.js.map +1 -0
  97. package/build/tools/utils.d.ts +40 -0
  98. package/build/tools/utils.js +97 -0
  99. package/build/tools/utils.js.map +1 -0
  100. package/package.json +1 -1
  101. package/{build/hooks/claude-code.js → workflows/dev/hooks/claude.js} +34 -23
  102. package/{build → workflows/dev}/hooks/content.js +27 -18
  103. package/workflows/dev/hooks/index.js +52 -0
  104. package/{build → workflows/dev}/hooks/openclaw.js +31 -20
  105. package/{build → workflows/dev}/hooks/opencode.js +31 -20
  106. package/workflows/dev/roles/architect.md +68 -28
  107. package/workflows/dev/roles/coordinator.md +103 -0
  108. package/workflows/dev/roles/developer.md +5 -5
  109. package/workflows/dev/roles/tester.md +19 -19
  110. package/workflows/dev/schemas/api-contract.json +42 -0
  111. package/workflows/dev/schemas/api-design.json +30 -13
  112. package/workflows/dev/schemas/data-model.json +20 -7
  113. package/workflows/dev/schemas/prd.completeness-check.json +6 -5
  114. package/workflows/dev/schemas/prd.draft.json +13 -5
  115. package/workflows/dev/schemas/prd.final.json +34 -11
  116. package/workflows/dev/schemas/prd.json +29 -11
  117. package/workflows/dev/schemas/prd.requirements.json +6 -5
  118. package/workflows/dev/schemas/prototype.json +6 -2
  119. package/workflows/dev/schemas/task-breakdown.coarse.json +4 -3
  120. package/workflows/dev/schemas/task-breakdown.dependencies.json +5 -4
  121. package/workflows/dev/schemas/task-breakdown.detailed.json +8 -3
  122. package/workflows/dev/schemas/task-breakdown.final.json +8 -3
  123. package/workflows/dev/schemas/task-breakdown.json +8 -3
  124. package/workflows/dev/schemas/tech-design.analysis.json +6 -5
  125. package/workflows/dev/schemas/tech-design.draft.json +14 -5
  126. package/workflows/dev/schemas/tech-design.final.json +39 -13
  127. package/workflows/dev/schemas/tech-design.json +34 -13
  128. package/workflows/dev/schemas/tech-design.research.json +21 -0
  129. package/workflows/dev/schemas/test-plan.json +17 -7
  130. package/workflows/dev/schemas/test-report.json +26 -9
  131. package/workflows/dev/schemas/user-stories.json +7 -3
  132. package/workflows/dev/tools/index.js +23 -0
  133. package/workflows/dev/workflow.json +234 -101
  134. package/build/core/docs.d.ts +0 -32
  135. package/build/core/docs.js +0 -91
  136. package/build/core/docs.js.map +0 -1
  137. package/build/core/workflow.d.ts +0 -33
  138. package/build/core/workflow.js +0 -140
  139. package/build/core/workflow.js.map +0 -1
  140. package/build/hooks/claude-code.d.ts +0 -20
  141. package/build/hooks/claude-code.js.map +0 -1
  142. package/build/hooks/content.d.ts +0 -43
  143. package/build/hooks/content.js.map +0 -1
  144. package/build/hooks/install.d.ts +0 -40
  145. package/build/hooks/install.js +0 -63
  146. package/build/hooks/install.js.map +0 -1
  147. package/build/hooks/openclaw.d.ts +0 -24
  148. package/build/hooks/openclaw.js.map +0 -1
  149. package/build/hooks/opencode.d.ts +0 -29
  150. package/build/hooks/opencode.js.map +0 -1
  151. package/build/tools/approve-doc.d.ts +0 -6
  152. package/build/tools/approve-doc.js +0 -108
  153. package/build/tools/approve-doc.js.map +0 -1
  154. package/build/tools/dispatch-role.d.ts +0 -16
  155. package/build/tools/dispatch-role.js +0 -277
  156. package/build/tools/dispatch-role.js.map +0 -1
  157. package/build/tools/doc-tools.d.ts +0 -16
  158. package/build/tools/doc-tools.js +0 -389
  159. package/build/tools/doc-tools.js.map +0 -1
  160. package/build/tools/override-tools.d.ts +0 -6
  161. package/build/tools/override-tools.js +0 -129
  162. package/build/tools/override-tools.js.map +0 -1
  163. package/build/tools/report-dispatch.js +0 -194
  164. package/build/tools/report-dispatch.js.map +0 -1
  165. package/build/tools/set-scale.d.ts +0 -6
  166. package/build/tools/set-scale.js +0 -107
  167. package/build/tools/set-scale.js.map +0 -1
  168. package/build/tools/setup-project.d.ts +0 -8
  169. package/build/tools/setup-project.js +0 -116
  170. package/build/tools/setup-project.js.map +0 -1
  171. package/build/tools/update-phase.d.ts +0 -12
  172. package/build/tools/update-phase.js +0 -159
  173. package/build/tools/update-phase.js.map +0 -1
  174. package/workflows/dev/roles/pm.md +0 -99
  175. package/workflows/dev/schemas/deploy.json +0 -20
  176. package/workflows/dev/schemas/fsd.json +0 -25
  177. package/workflows/dev/schemas/project-plan.json +0 -20
  178. package/workflows/dev/schemas/retrospective.json +0 -20
  179. package/workflows/dev/schemas/risk-assessment.json +0 -15
  180. package/workflows/dev/schemas/tech-design.api-contract.json +0 -20
@@ -1,277 +0,0 @@
1
- /**
2
- * MCP Tool: role_dispatch
3
- *
4
- * Prepare all data needed to hand off a task to a team member role.
5
- * Returns: role prompt (with overrides injected), frontmatter config,
6
- * input documents, task brief, and dispatch tracking info.
7
- *
8
- * Automatically:
9
- * - Creates a dispatch record for tracking
10
- * - Searches for reusable idle sessions and provides guidance
11
- *
12
- * This tool does NOT launch agents — it only prepares the data.
13
- * The host agent (PM) decides how to pass this to the team member.
14
- */
15
- import { z } from 'zod';
16
- import { loadWorkflow } from '../core/workflow.js';
17
- import { readState } from '../core/state.js';
18
- import { readDoc } from '../core/docs.js';
19
- import { getMergedOverrides, resolveRoleConfig } from '../core/overrides.js';
20
- import { createDispatch, findIdleSession } from '../core/dispatch.js';
21
- import { getProject } from '../core/registry.js';
22
- /**
23
- * Build override instructions to inject into the role prompt.
24
- */
25
- function buildOverrideSection(roleId, overrides) {
26
- const roleOverrides = overrides.roles?.[roleId]?.capabilities;
27
- if (!roleOverrides || Object.keys(roleOverrides).length === 0) {
28
- return '';
29
- }
30
- const lines = [
31
- '',
32
- '## Enhanced Capabilities',
33
- '',
34
- 'The following capabilities have been configured to use external tools.',
35
- 'Use the specified tool instead of built-in behavior for these actions.',
36
- '',
37
- ];
38
- for (const [capId, override] of Object.entries(roleOverrides)) {
39
- const o = override;
40
- const toolRef = o.type === 'mcp' && o.server
41
- ? `\`${o.server}\` MCP server's \`${o.tool}\` tool`
42
- : `\`${o.tool}\` skill tool`;
43
- let instruction = `- **${capId}**: Use ${toolRef}`;
44
- if (o.params && Object.keys(o.params).length > 0) {
45
- const paramStr = Object.entries(o.params)
46
- .map(([k, v]) => `${k}: ${JSON.stringify(v)}`)
47
- .join(', ');
48
- instruction += ` with fixed parameters: ${paramStr}`;
49
- }
50
- if (o.notes) {
51
- instruction += `. Note: ${o.notes}`;
52
- }
53
- lines.push(instruction);
54
- }
55
- return lines.join('\n');
56
- }
57
- /**
58
- * Find the current phase definition from the workflow.
59
- */
60
- function findCurrentPhase(phases, currentPhaseId) {
61
- return phases.find((p) => p.id === currentPhaseId);
62
- }
63
- /**
64
- * Resolve expected output doc IDs for a dispatch.
65
- * Uses the current phase's outputs, filtering out external, scale-skipped, and optional docs.
66
- * When scale is null, returns all non-external outputs (cannot filter by scale).
67
- */
68
- function resolveExpectedOutputs(currentPhase, workflowDef, scale) {
69
- if (!currentPhase)
70
- return [];
71
- return currentPhase.outputs.filter((docId) => {
72
- const docDef = workflowDef.docs[docId];
73
- if (!docDef)
74
- return false;
75
- if (docDef.external)
76
- return false;
77
- if (scale !== null) {
78
- const scaleVal = docDef.scale[scale];
79
- if (scaleVal === 'skip' || scaleVal === 'optional')
80
- return false;
81
- }
82
- return true;
83
- });
84
- }
85
- export function registerDispatchRole(server, builtinDir, customDir) {
86
- server.tool('role_dispatch', "Prepare all data needed to dispatch a task to a team member. Returns the role's prompt (with capability overrides), configuration, input documents, task brief, and a dispatch tracking ID. Automatically searches for reusable sessions and provides guidance. Does NOT launch agents — you (PM) decide how to pass this to the team member. After launching, call dispatch_report to register the session.", {
87
- project_name: z.string().describe('Project name'),
88
- role: z.string().describe('Role ID to dispatch (e.g. architect, developer, tester)'),
89
- task_brief: z
90
- .string()
91
- .describe('Task description for the team member — what they need to do, which tasks from the breakdown, specific instructions, etc.'),
92
- input_doc_ids: z
93
- .array(z.string())
94
- .optional()
95
- .describe("Document IDs to include as input for the team member. If not specified, automatically uses the current phase's input docs."),
96
- }, async ({ project_name, role, task_brief, input_doc_ids }) => {
97
- try {
98
- // Resolve current iteration
99
- const entry = await getProject(project_name);
100
- if (!entry || entry.currentIteration === 0) {
101
- return {
102
- content: [
103
- {
104
- type: 'text',
105
- text: `项目 "${project_name}" 未找到或尚未开始迭代。请先调用 iteration_start。`,
106
- },
107
- ],
108
- isError: true,
109
- };
110
- }
111
- const iteration = entry.currentIteration;
112
- // Load project state and workflow
113
- const state = await readState(project_name, iteration);
114
- const wf = await loadWorkflow(builtinDir, customDir, state.workflow);
115
- // Validate role exists
116
- const roleDef = wf.roles[role];
117
- if (!roleDef) {
118
- const available = Object.keys(wf.roles).join(', ');
119
- return {
120
- content: [
121
- {
122
- type: 'text',
123
- text: `Role "${role}" not found. Available: ${available}`,
124
- },
125
- ],
126
- isError: true,
127
- };
128
- }
129
- // Guard: role-phase validation
130
- const currentPhase = findCurrentPhase(wf.definition.phases, state.currentPhase);
131
- const currentPhaseRoles = currentPhase?.roles ?? [];
132
- const phaseIndex = wf.definition.phases.findIndex((p) => p.id === state.currentPhase);
133
- const nextPhase = phaseIndex >= 0 ? wf.definition.phases[phaseIndex + 1] : undefined;
134
- const nextPhaseRoles = nextPhase?.roles ?? [];
135
- const allowedRoles = [...new Set([...currentPhaseRoles, ...nextPhaseRoles])];
136
- if (allowedRoles.length > 0 && !allowedRoles.includes(role)) {
137
- return {
138
- content: [
139
- {
140
- type: 'text',
141
- text: [
142
- `角色 "${role}" 不属于当前阶段 "${state.currentPhase}" 或下一阶段的角色。`,
143
- `当前阶段允许的角色: ${currentPhaseRoles.join(', ') || '(无)'}`,
144
- nextPhase
145
- ? `下一阶段 (${nextPhase.id}) 允许的角色: ${nextPhaseRoles.join(', ')}`
146
- : '',
147
- '',
148
- '如确需 dispatch 此角色,请先推进阶段。',
149
- ]
150
- .filter(Boolean)
151
- .join('\n'),
152
- },
153
- ],
154
- isError: true,
155
- };
156
- }
157
- // Get merged overrides
158
- const overrides = await getMergedOverrides(project_name);
159
- // Build the full prompt with overrides injected
160
- const overrideSection = buildOverrideSection(role, overrides);
161
- const fullPrompt = overrideSection ? `${roleDef.prompt}\n${overrideSection}` : roleDef.prompt;
162
- // Determine input docs
163
- const docIds = input_doc_ids ?? currentPhase?.inputs ?? [];
164
- // Read input documents (skip external docs like "code" — not managed by doc_write)
165
- const inputDocs = {};
166
- const missingDocs = [];
167
- for (const docId of docIds) {
168
- const docDef = wf.definition.docs[docId];
169
- if (docDef?.external)
170
- continue; // external outputs not stored as docs
171
- try {
172
- inputDocs[docId] = await readDoc(project_name, iteration, docId);
173
- }
174
- catch {
175
- missingDocs.push(docId);
176
- }
177
- }
178
- // Resolve agent/model overrides
179
- const roleConfig = resolveRoleConfig(role, overrides);
180
- // Resolve expected outputs for this dispatch
181
- const expectedOutputs = resolveExpectedOutputs(currentPhase, wf.definition, state.scale);
182
- // Check for reusable idle session
183
- const idleSession = await findIdleSession(project_name, iteration, role);
184
- // Create dispatch record
185
- const dispatch = await createDispatch(project_name, iteration, role, task_brief, expectedOutputs, idleSession?.id);
186
- // Build session guidance
187
- const sessionGuidance = buildSessionGuidance(idleSession, roleDef.frontmatter.session, roleConfig.agent);
188
- // Build human-readable summary for the agent
189
- const agentLine = roleConfig.agent ? `\n- Agent: ${roleConfig.agent}` : '';
190
- const modelDisplay = roleConfig.model ?? roleDef.frontmatter.model;
191
- const summary = [
192
- `# Dispatch: ${role}`,
193
- ``,
194
- `## Dispatch Tracking`,
195
- `- Dispatch ID: \`${dispatch.id}\``,
196
- `- Status: ${dispatch.status}`,
197
- ``,
198
- `## Session Guidance`,
199
- sessionGuidance,
200
- ``,
201
- `## Task Brief`,
202
- task_brief,
203
- ``,
204
- `## Configuration`,
205
- `- Model: ${modelDisplay}`,
206
- `- Session: ${roleDef.frontmatter.session}`,
207
- `- Parallel: ${roleDef.frontmatter.parallel}${agentLine}`,
208
- ``,
209
- `## Project Context`,
210
- `- Project: ${project_name}`,
211
- `- Directory: ${state.projectDir}`,
212
- `- Scale: ${state.scale ?? '(未设定)'}`,
213
- `- Current phase: ${state.currentPhase}`,
214
- ``,
215
- `## Input Documents (${Object.keys(inputDocs).length}${missingDocs.length > 0 ? `, ${missingDocs.length} missing` : ''})`,
216
- ];
217
- for (const [docId, content] of Object.entries(inputDocs)) {
218
- summary.push(``, `### ${docId}`, ``, content);
219
- }
220
- if (missingDocs.length > 0) {
221
- summary.push(``, `### Missing Documents`, ...missingDocs.map((d) => `- ${d}`));
222
- }
223
- summary.push(``, `## Next Step`, `After launching the agent, call \`dispatch_report\` with dispatch_id="${dispatch.id}" and the agent's session ID.`, `When the agent finishes, call \`dispatch_report\` again with status="completed" (or "failed").`, ``, `## Role Prompt`, ``, fullPrompt);
224
- return {
225
- content: [
226
- {
227
- type: 'text',
228
- text: summary.join('\n'),
229
- },
230
- ],
231
- };
232
- }
233
- catch (err) {
234
- return {
235
- content: [
236
- {
237
- type: 'text',
238
- text: `Error: ${err instanceof Error ? err.message : String(err)}`,
239
- },
240
- ],
241
- isError: true,
242
- };
243
- }
244
- });
245
- }
246
- /**
247
- * Build session guidance text based on whether an idle session exists.
248
- */
249
- function buildSessionGuidance(idleSession, sessionType, agentOverride) {
250
- if (idleSession) {
251
- const agentId = idleSession.agentSessionId
252
- ? `Agent session ID: \`${idleSession.agentSessionId}\``
253
- : 'Agent session ID: not recorded';
254
- const label = idleSession.label ? ` (${idleSession.label})` : '';
255
- return [
256
- `**Reusable session found**: ${idleSession.id}${label}`,
257
- `- ${agentId}`,
258
- `- Agent type: ${idleSession.agentType ?? 'unknown'}`,
259
- `- Last active: ${idleSession.lastActiveAt}`,
260
- ``,
261
- `**Action**: Resume this session instead of launching a new agent.`,
262
- idleSession.agentSessionId
263
- ? `Use \`--resume ${idleSession.agentSessionId}\` or \`--session ${idleSession.agentSessionId}\` to restore the conversation.`
264
- : `Note: No agent session ID was recorded for this session. You may need to launch a new agent.`,
265
- ].join('\n');
266
- }
267
- return [
268
- `**No reusable session found** for this role.`,
269
- `Session type: ${sessionType}`,
270
- ``,
271
- `**Action**: Launch a new agent for this role.`,
272
- agentOverride ? `Configured agent type: ${agentOverride}` : '',
273
- ]
274
- .filter(Boolean)
275
- .join('\n');
276
- }
277
- //# sourceMappingURL=dispatch-role.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatch-role.js","sourceRoot":"","sources":["../../src/tools/dispatch-role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AASjD;;GAEG;AACH,SAAS,oBAAoB,CAAC,MAAc,EAAE,SAAyB;IACnE,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC9D,IAAI,CAAC,aAAa,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAa;QACpB,EAAE;QACF,0BAA0B;QAC1B,EAAE;QACF,wEAAwE;QACxE,wEAAwE;QACxE,EAAE;KACL,CAAC;IAEF,KAAK,MAAM,CAAC,KAAK,EAAE,QAAQ,CAA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D,kBAAkB,WAAW,CAAC,YAAY,EAAE;YAC5C,EAAE;YACF,mEAAmE;YACnE,WAAW,CAAC,cAAc;gBACtB,CAAC,CAAC,kBAAkB,WAAW,CAAC,cAAc,qBAAqB,WAAW,CAAC,cAAc,iCAAiC;gBAC9H,CAAC,CAAC,8FAA8F;SACvG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,OAAO;QACH,8CAA8C;QAC9C,iBAAiB,WAAW,EAAE;QAC9B,EAAE;QACF,+CAA+C;QAC/C,aAAa,CAAC,CAAC,CAAC,0BAA0B,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE;KACjE;SACI,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * MCP Tools: doc_write / doc_read / doc_list
3
- * Read and write project documents under <data_dir>/<project_name>/docs/
4
- *
5
- * doc_write validates content against document schemas and checks review
6
- * configuration. If validation fails, the write is rejected with specific
7
- * error details. If review is required, the document is submitted for
8
- * user approval.
9
- *
10
- * Sequential mode (P3): When a document has `steps` defined in workflow.json
11
- * and the project scale is >= medium, doc_write requires a `step` parameter.
12
- * Each step is validated independently, and the final step automatically
13
- * writes the formal document and triggers the review flow.
14
- */
15
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
16
- export declare function registerDocTools(server: McpServer, builtinDir: string, customDir: string): void;