sdd-mcp-server 4.0.0 → 5.0.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.
- package/README.md +18 -35
- package/dist/adapters/cli/SDDToolAdapter.d.ts +2 -5
- package/dist/adapters/cli/SDDToolAdapter.js +48 -92
- package/dist/adapters/cli/SDDToolAdapter.js.map +1 -1
- package/dist/application/services/ContextCompactionService.d.ts +10 -3
- package/dist/application/services/ContextCompactionService.js +139 -35
- package/dist/application/services/ContextCompactionService.js.map +1 -1
- package/dist/application/services/ProjectService.js +3 -3
- package/dist/application/services/ProjectService.js.map +1 -1
- package/dist/application/services/SpecPathResolver.js +1 -1
- package/dist/application/services/SpecPathResolver.js.map +1 -1
- package/dist/application/services/WorkflowEngineService.d.ts +160 -50
- package/dist/application/services/WorkflowEngineService.js +1404 -429
- package/dist/application/services/WorkflowEngineService.js.map +1 -1
- package/dist/application/services/WorkflowErrors.d.ts +16 -0
- package/dist/application/services/WorkflowErrors.js +53 -0
- package/dist/application/services/WorkflowErrors.js.map +1 -0
- package/dist/application/services/WorkflowValidationService.d.ts +25 -46
- package/dist/application/services/WorkflowValidationService.js +284 -627
- package/dist/application/services/WorkflowValidationService.js.map +1 -1
- package/dist/cli/install-skills.js.map +1 -1
- package/dist/cli/install-target.d.ts +4 -1
- package/dist/cli/install-target.js +4 -0
- package/dist/cli/install-target.js.map +1 -1
- package/dist/cli/tool-support/claude-code.js +7 -3
- package/dist/cli/tool-support/claude-code.js.map +1 -1
- package/dist/cli/tool-support/codex.js +6 -2
- package/dist/cli/tool-support/codex.js.map +1 -1
- package/dist/cli/tool-support/mcp-registration.d.ts +22 -0
- package/dist/cli/tool-support/mcp-registration.js +275 -0
- package/dist/cli/tool-support/mcp-registration.js.map +1 -0
- package/dist/cli/tool-support/omp.js +6 -2
- package/dist/cli/tool-support/omp.js.map +1 -1
- package/dist/cli/tool-support/root-guidance.js +2 -2
- package/dist/cli/tool-support/root-guidance.js.map +1 -1
- package/dist/cli/tool-support/target-installer.d.ts +2 -2
- package/dist/cli/tool-support/target-installer.js +9 -3
- package/dist/cli/tool-support/target-installer.js.map +1 -1
- package/dist/cli/utils/preserving-writer.d.ts +35 -1
- package/dist/cli/utils/preserving-writer.js +479 -108
- package/dist/cli/utils/preserving-writer.js.map +1 -1
- package/dist/domain/types.d.ts +52 -7
- package/dist/domain/types.js +5 -4
- package/dist/domain/types.js.map +1 -1
- package/dist/infrastructure/mcp/MCPServer.js +13 -13
- package/dist/infrastructure/mcp/MCPServer.js.map +1 -1
- package/dist/infrastructure/mcp/ToolRegistry.d.ts +5 -1
- package/dist/infrastructure/mcp/ToolRegistry.js +11 -4
- package/dist/infrastructure/mcp/ToolRegistry.js.map +1 -1
- package/dist/infrastructure/mcp/sddToolDefinitions.js +76 -90
- package/dist/infrastructure/mcp/sddToolDefinitions.js.map +1 -1
- package/dist/infrastructure/schemas/project.schema.d.ts +2 -2
- package/dist/infrastructure/schemas/project.schema.js +2 -2
- package/dist/infrastructure/schemas/project.schema.js.map +1 -1
- package/dist/shared/version.d.ts +3 -0
- package/dist/shared/version.js +4 -0
- package/dist/shared/version.js.map +1 -0
- package/dist/utils/atomicWrite.js +20 -5
- package/dist/utils/atomicWrite.js.map +1 -1
- package/dist/utils/withFilesystemLock.d.ts +22 -0
- package/dist/utils/withFilesystemLock.js +219 -0
- package/dist/utils/withFilesystemLock.js.map +1 -0
- package/package.json +4 -2
- package/skills/sdd-design/REFERENCE.md +16 -0
- package/skills/sdd-design/SKILL.md +22 -13
- package/skills/sdd-implement/REFERENCE.md +4 -0
- package/skills/sdd-implement/SKILL.md +20 -16
- package/skills/sdd-requirements/REFERENCE.md +15 -7
- package/skills/sdd-requirements/SKILL.md +30 -22
- package/skills/sdd-tasks/REFERENCE.md +9 -9
- package/skills/sdd-tasks/SKILL.md +27 -15
- package/templates/CLAUDE.md +6 -12
- package/templates/codex-AGENTS.md +7 -9
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
import { Project, WorkflowPhase } from '../../domain/types.js';
|
|
1
|
+
import { PhaseRecord, Project, TaskStatus, WorkflowPhase } from '../../domain/types.js';
|
|
2
2
|
import { ProjectRepository, LoggerPort, FileSystemPort } from '../../domain/ports.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { ContextCompactionService, type ApprovablePhase, type ContextLoadRequest, type ContextLoadResult } from './ContextCompactionService.js';
|
|
4
|
+
import { type DesignValidationResult } from './WorkflowValidationService.js';
|
|
5
|
+
export type NextAction = {
|
|
6
|
+
kind: 'submit-phase' | 'revise-phase' | 'request-approval';
|
|
7
|
+
phase: ApprovablePhase;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'review-test-cases';
|
|
10
|
+
phase: 'tasks';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'start-implementation';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'continue-task';
|
|
15
|
+
taskNumber: string;
|
|
16
|
+
taskState: TaskStatus;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'select-task';
|
|
19
|
+
candidates: Array<{
|
|
20
|
+
taskNumber: string;
|
|
21
|
+
taskState: TaskStatus;
|
|
22
|
+
}>;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'blocked';
|
|
25
|
+
code: 'ArtifactDrift';
|
|
26
|
+
phase: ApprovablePhase;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'complete';
|
|
29
|
+
};
|
|
6
30
|
export interface ApprovalRequest {
|
|
7
31
|
readonly projectRoot: string;
|
|
8
32
|
readonly featureName: string;
|
|
9
33
|
readonly phase: ApprovablePhase;
|
|
34
|
+
readonly expectedRevision: number;
|
|
35
|
+
readonly expectedArtifactSha256: string;
|
|
10
36
|
}
|
|
11
37
|
export interface ReviewTestCasesRequest {
|
|
12
38
|
readonly projectRoot: string;
|
|
13
39
|
readonly featureName: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly projectRoot: string;
|
|
17
|
-
readonly featureName: string;
|
|
18
|
-
readonly triggeredBy: string;
|
|
40
|
+
readonly expectedTasksRevision: number;
|
|
41
|
+
readonly expectedArtifactSha256: string;
|
|
19
42
|
}
|
|
20
43
|
export interface HandoffPublication {
|
|
21
44
|
readonly status: 'published' | 'pending-regeneration';
|
|
@@ -37,7 +60,9 @@ export interface ApprovalResult {
|
|
|
37
60
|
export interface ReviewTestCasesResult {
|
|
38
61
|
readonly featureName: string;
|
|
39
62
|
readonly reviewed: true;
|
|
40
|
-
readonly
|
|
63
|
+
readonly tasksRevision: number;
|
|
64
|
+
readonly artifactSha256: string;
|
|
65
|
+
readonly canApproveTasks: true;
|
|
41
66
|
readonly handoff: HandoffPublication;
|
|
42
67
|
}
|
|
43
68
|
export interface FeatureRequest {
|
|
@@ -45,68 +70,153 @@ export interface FeatureRequest {
|
|
|
45
70
|
readonly featureName: string;
|
|
46
71
|
}
|
|
47
72
|
export interface InitializeFeatureRequest extends FeatureRequest {
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
73
|
+
readonly description: string;
|
|
74
|
+
readonly language?: 'en' | 'ja' | 'zh-TW';
|
|
50
75
|
}
|
|
51
|
-
export interface
|
|
76
|
+
export interface SubmitPhaseArtifactRequest extends FeatureRequest {
|
|
52
77
|
readonly phase: ApprovablePhase;
|
|
78
|
+
readonly content: string;
|
|
79
|
+
readonly expectedRevision: number;
|
|
80
|
+
readonly expectedArtifactSha256: string | null;
|
|
53
81
|
readonly reviewTestCases?: boolean;
|
|
54
82
|
}
|
|
83
|
+
export interface PhaseSubmissionResult {
|
|
84
|
+
readonly featureName: string;
|
|
85
|
+
readonly phase: ApprovablePhase;
|
|
86
|
+
readonly revision: number;
|
|
87
|
+
readonly artifact: {
|
|
88
|
+
readonly path: string;
|
|
89
|
+
readonly sha256: string;
|
|
90
|
+
};
|
|
91
|
+
readonly validation: {
|
|
92
|
+
readonly status: 'passed' | 'failed';
|
|
93
|
+
readonly blockers: readonly {
|
|
94
|
+
code: string;
|
|
95
|
+
message: string;
|
|
96
|
+
reference?: string;
|
|
97
|
+
}[];
|
|
98
|
+
};
|
|
99
|
+
readonly approvalRequired: boolean;
|
|
100
|
+
}
|
|
55
101
|
export interface DurableFeatureStatus {
|
|
56
102
|
readonly featureName: string;
|
|
57
103
|
readonly phase: WorkflowPhase;
|
|
58
|
-
readonly currentPhase
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
readonly
|
|
62
|
-
|
|
104
|
+
readonly currentPhase: WorkflowPhase;
|
|
105
|
+
readonly nextAction: NextAction;
|
|
106
|
+
readonly blockers: readonly string[];
|
|
107
|
+
readonly phases: Record<ApprovablePhase, PhaseRecord & {
|
|
108
|
+
observedArtifactSha256?: string;
|
|
109
|
+
}>;
|
|
110
|
+
readonly checkpoint: {
|
|
63
111
|
required: boolean;
|
|
64
112
|
reviewed: boolean;
|
|
113
|
+
reviewedRevision?: number;
|
|
114
|
+
reviewedArtifactSha256?: string;
|
|
115
|
+
};
|
|
116
|
+
readonly implementation?: {
|
|
117
|
+
revision: number;
|
|
118
|
+
completed: number;
|
|
119
|
+
total: number;
|
|
120
|
+
active: number;
|
|
121
|
+
blocked: number;
|
|
65
122
|
};
|
|
66
123
|
}
|
|
124
|
+
export interface RecordTaskProgressRequest extends FeatureRequest {
|
|
125
|
+
readonly taskNumber: string;
|
|
126
|
+
readonly action: 'start' | 'record-red' | 'record-green' | 'complete' | 'block';
|
|
127
|
+
readonly expectedRevision: number;
|
|
128
|
+
readonly evidence?: {
|
|
129
|
+
command: string;
|
|
130
|
+
exitCode: number;
|
|
131
|
+
summary: string;
|
|
132
|
+
};
|
|
133
|
+
readonly affectedArtifacts?: string[];
|
|
134
|
+
readonly blocker?: string;
|
|
135
|
+
}
|
|
67
136
|
export declare class WorkflowEngineService {
|
|
68
137
|
private readonly projectRepository;
|
|
69
|
-
private readonly projectService;
|
|
70
|
-
private readonly templateService;
|
|
71
138
|
private readonly contextCompactionService;
|
|
72
139
|
private readonly logger;
|
|
73
140
|
private readonly fileSystem?;
|
|
74
|
-
private
|
|
75
|
-
constructor(projectRepository: ProjectRepository,
|
|
141
|
+
private readonly validator;
|
|
142
|
+
constructor(projectRepository: ProjectRepository, contextCompactionService: ContextCompactionService, logger: LoggerPort, fileSystem?: FileSystemPort);
|
|
143
|
+
initializeFeature(request: InitializeFeatureRequest): Promise<Project>;
|
|
144
|
+
submitPhaseArtifact(request: SubmitPhaseArtifactRequest): Promise<PhaseSubmissionResult>;
|
|
76
145
|
approve(request: ApprovalRequest): Promise<ApprovalResult>;
|
|
77
146
|
reviewTestCases(request: ReviewTestCasesRequest): Promise<ReviewTestCasesResult>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
147
|
+
beginImplementation(request: FeatureRequest): Promise<{
|
|
148
|
+
featureName: string;
|
|
149
|
+
phase: WorkflowPhase.IMPLEMENTATION | WorkflowPhase.IMPLEMENTATION_COMPLETED;
|
|
150
|
+
ready: true;
|
|
151
|
+
revision: number;
|
|
152
|
+
tasks: {
|
|
153
|
+
completed: number;
|
|
154
|
+
total: number;
|
|
155
|
+
active: number;
|
|
156
|
+
blocked: number;
|
|
157
|
+
};
|
|
158
|
+
nextAction: NextAction;
|
|
159
|
+
handoff: HandoffPublication;
|
|
82
160
|
}>;
|
|
83
|
-
|
|
161
|
+
recordTaskProgress(request: RecordTaskProgressRequest): Promise<{
|
|
162
|
+
featureName: string;
|
|
163
|
+
taskNumber: string;
|
|
164
|
+
taskState: TaskStatus;
|
|
165
|
+
revision: number;
|
|
166
|
+
nextAction: NextAction;
|
|
167
|
+
handoff: HandoffPublication;
|
|
168
|
+
}>;
|
|
169
|
+
getFeatureStatus(request: FeatureRequest): Promise<DurableFeatureStatus>;
|
|
170
|
+
loadFeatureContext(request: ContextLoadRequest): Promise<ContextLoadResult>;
|
|
84
171
|
listFeatureStatuses(request: {
|
|
85
|
-
|
|
172
|
+
projectRoot: string;
|
|
86
173
|
}): Promise<DurableFeatureStatus[]>;
|
|
87
|
-
getFeatureStatus(request: FeatureRequest): Promise<DurableFeatureStatus>;
|
|
88
174
|
loadProject(request: FeatureRequest): Promise<Project>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
private
|
|
96
|
-
private
|
|
97
|
-
private
|
|
98
|
-
private
|
|
99
|
-
private
|
|
100
|
-
private
|
|
175
|
+
validateDesignArtifact(request: FeatureRequest): Promise<DesignValidationResult>;
|
|
176
|
+
private withLockedFeature;
|
|
177
|
+
private normalizeSpec;
|
|
178
|
+
private buildStatus;
|
|
179
|
+
private resolveNextAction;
|
|
180
|
+
private validate;
|
|
181
|
+
private readUpstream;
|
|
182
|
+
private assertNoApprovedArtifactDrift;
|
|
183
|
+
private commitPhaseSubmission;
|
|
184
|
+
private recoverSubmission;
|
|
185
|
+
private replaceCas;
|
|
186
|
+
private parseLegacyTasks;
|
|
187
|
+
private visibleLegacyLines;
|
|
101
188
|
private hydrateProject;
|
|
102
|
-
private
|
|
103
|
-
private
|
|
104
|
-
private
|
|
105
|
-
private
|
|
106
|
-
private
|
|
107
|
-
private
|
|
108
|
-
private
|
|
109
|
-
private
|
|
189
|
+
private assertPriorApproved;
|
|
190
|
+
private assertLegacyOrdering;
|
|
191
|
+
private assertLegacyPhaseRank;
|
|
192
|
+
private phaseValue;
|
|
193
|
+
private legacyPhaseValue;
|
|
194
|
+
private implementationCounts;
|
|
195
|
+
private allComplete;
|
|
196
|
+
private invalidTransition;
|
|
197
|
+
private evidence;
|
|
198
|
+
private normalizeArtifacts;
|
|
199
|
+
private requireAtomicFileSystem;
|
|
200
|
+
private normalizeV5;
|
|
201
|
+
private normalizeV5Implementation;
|
|
202
|
+
private normalizeV5Evidence;
|
|
203
|
+
private requireSpecRecord;
|
|
204
|
+
private requireStringArray;
|
|
205
|
+
private assertPersistedArtifactPaths;
|
|
206
|
+
private isProjectRelativePath;
|
|
207
|
+
private assertV5Invariants;
|
|
208
|
+
private assertImplementationTasks;
|
|
209
|
+
private assertExecutionEvidence;
|
|
210
|
+
private specBytes;
|
|
211
|
+
private persistSpecCas;
|
|
212
|
+
private parseSpecBytes;
|
|
213
|
+
private requireArtifact;
|
|
214
|
+
private readRequired;
|
|
215
|
+
private assertGovernedFilesContained;
|
|
216
|
+
private readOptional;
|
|
217
|
+
private readOptionalSync;
|
|
218
|
+
private artifactPhaseFromJournal;
|
|
219
|
+
private assertJournalValidation;
|
|
220
|
+
private journalAncillaryState;
|
|
110
221
|
private publishHandoff;
|
|
111
|
-
private synchronizeRepository;
|
|
112
222
|
}
|