@auto-engineer/server-implementer 1.139.0 → 1.140.1
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +3 -3
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +30 -0
- package/DEBUG.md +4 -4
- package/README.md +4 -4
- package/dist/src/agent/detectShadowsInSlice.specs.js +6 -6
- package/dist/src/agent/detectShadowsInSlice.specs.js.map +1 -1
- package/dist/src/agent/runAllSlices.d.ts +1 -1
- package/dist/src/agent/runAllSlices.d.ts.map +1 -1
- package/dist/src/agent/runAllSlices.js +7 -7
- package/dist/src/agent/runAllSlices.js.map +1 -1
- package/dist/src/agent/runFlows.d.ts +1 -1
- package/dist/src/agent/runFlows.d.ts.map +1 -1
- package/dist/src/agent/runFlows.js +20 -20
- package/dist/src/agent/runFlows.js.map +1 -1
- package/dist/src/agent/runSlice.d.ts +4 -4
- package/dist/src/agent/runSlice.d.ts.map +1 -1
- package/dist/src/agent/runSlice.js +64 -64
- package/dist/src/agent/runSlice.js.map +1 -1
- package/dist/src/agent/runTests.d.ts +1 -1
- package/dist/src/agent/runTests.d.ts.map +1 -1
- package/dist/src/agent/runTests.js +12 -12
- package/dist/src/agent/runTests.js.map +1 -1
- package/dist/src/commands/implement-server.d.ts +1 -1
- package/dist/src/commands/implement-server.d.ts.map +1 -1
- package/dist/src/commands/implement-server.js +17 -17
- package/dist/src/commands/implement-server.js.map +1 -1
- package/dist/src/commands/implement-slice.d.ts +10 -10
- package/dist/src/commands/implement-slice.d.ts.map +1 -1
- package/dist/src/commands/implement-slice.js +47 -47
- package/dist/src/commands/implement-slice.js.map +1 -1
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/systemPrompt.d.ts +1 -1
- package/dist/src/prompts/systemPrompt.d.ts.map +1 -1
- package/dist/src/prompts/systemPrompt.js +1 -1
- package/dist/src/utils/buildContextSections.js +3 -3
- package/dist/src/utils/buildContextSections.js.map +1 -1
- package/dist/src/utils/buildContextSections.specs.js +6 -6
- package/dist/src/utils/buildContextSections.specs.js.map +1 -1
- package/dist/src/utils/loadContextFiles.d.ts +1 -1
- package/dist/src/utils/loadContextFiles.d.ts.map +1 -1
- package/dist/src/utils/loadContextFiles.js +4 -4
- package/dist/src/utils/loadContextFiles.js.map +1 -1
- package/dist/src/utils/loadContextFiles.specs.js +12 -12
- package/dist/src/utils/loadContextFiles.specs.js.map +1 -1
- package/dist/src/utils/loadSharedContext.d.ts +1 -1
- package/dist/src/utils/loadSharedContext.d.ts.map +1 -1
- package/dist/src/utils/loadSharedContext.js +2 -2
- package/dist/src/utils/loadSharedContext.js.map +1 -1
- package/dist/src/utils/loadSharedContext.specs.js +7 -7
- package/dist/src/utils/loadSharedContext.specs.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/agent/detectShadowsInSlice.specs.ts +6 -6
- package/src/agent/runAllSlices.ts +7 -7
- package/src/agent/runFlows.ts +21 -21
- package/src/agent/runSlice.ts +65 -65
- package/src/agent/runTests.ts +12 -12
- package/src/commands/implement-server.ts +18 -18
- package/src/commands/implement-slice.ts +73 -71
- package/src/index.ts +8 -8
- package/src/prompts/systemPrompt.ts +1 -1
- package/src/utils/buildContextSections.specs.ts +6 -6
- package/src/utils/buildContextSections.ts +3 -3
- package/src/utils/loadContextFiles.specs.ts +12 -12
- package/src/utils/loadContextFiles.ts +4 -4
- package/src/utils/loadSharedContext.specs.ts +7 -7
- package/src/utils/loadSharedContext.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-slice.d.ts","sourceRoot":"","sources":["../../../src/commands/implement-slice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAgB5F,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"implement-slice.d.ts","sourceRoot":"","sources":["../../../src/commands/implement-slice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAgB5F,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,iBAAiB,EACjB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QACR,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CACF,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,KAAK,CACjD,4BAA4B,EAC5B;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CACF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,+BAA+B,CAAC;AAE7F,eAAO,MAAM,cAAc;;;oBA7BX,MAAM;kBACR;YACR,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;oBACW;YACV,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB;;;;;GAsEH,CAAC;AA4MH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,sBAAsB,GAAG,+BAA+B,CAAC,CA2CnE;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -16,14 +16,14 @@ const debugHandler = createDebug('auto:server-implementer:slice:handler');
|
|
|
16
16
|
const debugProcess = createDebug('auto:server-implementer:slice:process');
|
|
17
17
|
const debugResult = createDebug('auto:server-implementer:slice:result');
|
|
18
18
|
export const commandHandler = defineCommandHandler({
|
|
19
|
-
name: '
|
|
20
|
-
displayName: 'Implement
|
|
19
|
+
name: 'ImplementMoment',
|
|
20
|
+
displayName: 'Implement Moment',
|
|
21
21
|
alias: 'implement:slice',
|
|
22
22
|
description: 'AI implements a specific server slice',
|
|
23
23
|
category: 'implement',
|
|
24
24
|
icon: 'layers',
|
|
25
25
|
fields: {
|
|
26
|
-
|
|
26
|
+
momentPath: {
|
|
27
27
|
description: 'Path to the slice directory to implement',
|
|
28
28
|
required: true,
|
|
29
29
|
},
|
|
@@ -37,24 +37,24 @@ export const commandHandler = defineCommandHandler({
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
examples: [
|
|
40
|
-
'$ auto implement:slice --slice-path=./server/src/domain/
|
|
40
|
+
'$ auto implement:slice --slice-path=./server/src/domain/narratives/seasonal-assistant/enters-shopping-criteria-into-assistant',
|
|
41
41
|
],
|
|
42
42
|
events: [
|
|
43
|
-
{ name: '
|
|
44
|
-
{ name: '
|
|
43
|
+
{ name: 'MomentImplemented', displayName: 'Moment Implemented' },
|
|
44
|
+
{ name: 'MomentImplementationFailed', displayName: 'Moment Implementation Failed' },
|
|
45
45
|
],
|
|
46
46
|
handle: async (command) => {
|
|
47
|
-
debug('CommandHandler executing for
|
|
48
|
-
const result = await
|
|
49
|
-
if (result.type === '
|
|
47
|
+
debug('CommandHandler executing for ImplementMoment');
|
|
48
|
+
const result = await handleImplementMomentCommand(command);
|
|
49
|
+
if (result.type === 'MomentImplemented') {
|
|
50
50
|
debug('Command handler completed: success');
|
|
51
|
-
debug('✅
|
|
52
|
-
debug('
|
|
51
|
+
debug('✅ Moment implementation completed successfully');
|
|
52
|
+
debug(' Moment: %s', path.basename(result.data.momentPath));
|
|
53
53
|
debug(' Files implemented: %d', result.data.filesImplemented.length);
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
56
|
debug('Command handler completed: failure - %s', result.data.error);
|
|
57
|
-
debug('❌
|
|
57
|
+
debug('❌ Moment implementation failed: %s', result.data.error);
|
|
58
58
|
}
|
|
59
59
|
return result;
|
|
60
60
|
},
|
|
@@ -108,19 +108,19 @@ ${buildContextSections(targetFile, context)}
|
|
|
108
108
|
Return only the corrected full contents of ${targetFile}, no commentary, no markdown.
|
|
109
109
|
`.trim();
|
|
110
110
|
}
|
|
111
|
-
async function addMarkersToFiles(
|
|
111
|
+
async function addMarkersToFiles(momentPath, contextFiles) {
|
|
112
112
|
const filesToMark = Object.entries(contextFiles).filter(([, content]) => needsImplementation(content));
|
|
113
113
|
debugProcess(`Found ${filesToMark.length} files needing implementation markers`);
|
|
114
114
|
for (const [filename, content] of filesToMark) {
|
|
115
115
|
if (!hasImplementationMarker(content)) {
|
|
116
116
|
const markedContent = addImplementationMarker(content);
|
|
117
|
-
await writeFile(path.join(
|
|
117
|
+
await writeFile(path.join(momentPath, filename), markedContent, 'utf-8');
|
|
118
118
|
contextFiles[filename] = markedContent;
|
|
119
119
|
debugProcess(`Added implementation marker to ${filename}`);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
async function implementFile(
|
|
123
|
+
async function implementFile(momentPath, targetFile, contextFiles, retryContext, aiOptions) {
|
|
124
124
|
debugProcess(`Implementing ${targetFile}`);
|
|
125
125
|
const previousOutputs = retryContext?.previousOutputs;
|
|
126
126
|
const isRetry = previousOutputs !== undefined && previousOutputs.length > 0;
|
|
@@ -137,18 +137,18 @@ async function implementFile(slicePath, targetFile, contextFiles, retryContext,
|
|
|
137
137
|
});
|
|
138
138
|
let cleanedCode = extractCodeBlock(aiOutput);
|
|
139
139
|
cleanedCode = addImplementationMarker(cleanedCode);
|
|
140
|
-
const filePath = path.join(
|
|
140
|
+
const filePath = path.join(momentPath, targetFile);
|
|
141
141
|
await writeFile(filePath, cleanedCode, 'utf-8');
|
|
142
142
|
debugProcess(`Successfully implemented ${targetFile}`);
|
|
143
143
|
contextFiles[targetFile] = cleanedCode;
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
146
|
-
const
|
|
147
|
-
debugProcess(`Implementing slice: ${
|
|
145
|
+
async function implementMoment(momentPath, context, aiOptions) {
|
|
146
|
+
const momentName = path.basename(momentPath);
|
|
147
|
+
debugProcess(`Implementing slice: ${momentName}`);
|
|
148
148
|
try {
|
|
149
|
-
const contextFiles = await loadContextFiles(
|
|
149
|
+
const contextFiles = await loadContextFiles(momentPath);
|
|
150
150
|
debugProcess(`Loaded ${Object.keys(contextFiles).join(', ')} files from slice`);
|
|
151
|
-
await addMarkersToFiles(
|
|
151
|
+
await addMarkersToFiles(momentPath, contextFiles);
|
|
152
152
|
const filesToImplement = findFilesToImplement(contextFiles, hasImplementationMarker);
|
|
153
153
|
debugProcess(`Found ${filesToImplement.length} files with markers to implement`);
|
|
154
154
|
if (filesToImplement.length === 0) {
|
|
@@ -157,7 +157,7 @@ async function implementSlice(slicePath, context, aiOptions) {
|
|
|
157
157
|
}
|
|
158
158
|
const implementedFiles = [];
|
|
159
159
|
for (const [targetFile] of filesToImplement) {
|
|
160
|
-
await implementFile(
|
|
160
|
+
await implementFile(momentPath, targetFile, contextFiles, context, aiOptions);
|
|
161
161
|
implementedFiles.push(targetFile);
|
|
162
162
|
}
|
|
163
163
|
return { success: true, filesImplemented: implementedFiles };
|
|
@@ -168,12 +168,12 @@ async function implementSlice(slicePath, context, aiOptions) {
|
|
|
168
168
|
return { success: false, filesImplemented: [], error: errorMessage };
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
function logCommandDebugInfo(command,
|
|
171
|
+
function logCommandDebugInfo(command, resolvedMomentPath) {
|
|
172
172
|
const rawData = command.data;
|
|
173
|
-
const
|
|
173
|
+
const momentPath = rawData.momentPath ?? rawData.path;
|
|
174
174
|
const { context } = command.data;
|
|
175
|
-
debug('Handling
|
|
176
|
-
debug('
|
|
175
|
+
debug('Handling ImplementMomentCommand');
|
|
176
|
+
debug(' Moment path: %s', resolvedMomentPath ?? momentPath);
|
|
177
177
|
debug(' Context provided: %s', context ? 'yes' : 'no');
|
|
178
178
|
if (context) {
|
|
179
179
|
debug(' Attempt number: %d', context.attemptNumber ?? 1);
|
|
@@ -181,13 +181,13 @@ function logCommandDebugInfo(command, resolvedSlicePath) {
|
|
|
181
181
|
debug(' Request ID: %s', command.requestId);
|
|
182
182
|
debug(' Correlation ID: %s', command.correlationId ?? 'none');
|
|
183
183
|
}
|
|
184
|
-
function createFailedEvent(command, error,
|
|
184
|
+
function createFailedEvent(command, error, resolvedMomentPath) {
|
|
185
185
|
const rawData = command.data;
|
|
186
|
-
const
|
|
186
|
+
const momentPath = resolvedMomentPath ?? rawData.momentPath ?? rawData.path;
|
|
187
187
|
return {
|
|
188
|
-
type: '
|
|
188
|
+
type: 'MomentImplementationFailed',
|
|
189
189
|
data: {
|
|
190
|
-
|
|
190
|
+
momentPath,
|
|
191
191
|
error,
|
|
192
192
|
},
|
|
193
193
|
timestamp: new Date(),
|
|
@@ -195,13 +195,13 @@ function createFailedEvent(command, error, resolvedSlicePath) {
|
|
|
195
195
|
correlationId: command.correlationId,
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
function createSuccessEvent(command, filesImplemented,
|
|
198
|
+
function createSuccessEvent(command, filesImplemented, resolvedMomentPath) {
|
|
199
199
|
const rawData = command.data;
|
|
200
|
-
const
|
|
200
|
+
const momentPath = resolvedMomentPath ?? rawData.momentPath ?? rawData.path;
|
|
201
201
|
return {
|
|
202
|
-
type: '
|
|
202
|
+
type: 'MomentImplemented',
|
|
203
203
|
data: {
|
|
204
|
-
|
|
204
|
+
momentPath,
|
|
205
205
|
filesImplemented,
|
|
206
206
|
},
|
|
207
207
|
timestamp: new Date(),
|
|
@@ -215,40 +215,40 @@ function logRetryContext(context) {
|
|
|
215
215
|
debugProcess('Previous outputs: %s', context.previousOutputs.substring(0, 500));
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
export async function
|
|
218
|
+
export async function handleImplementMomentCommand(command) {
|
|
219
219
|
const rawData = command.data;
|
|
220
|
-
const
|
|
220
|
+
const momentPath = rawData.momentPath ?? rawData.path;
|
|
221
221
|
const { context } = command.data;
|
|
222
222
|
const aiOptions = command.data.aiOptions;
|
|
223
|
-
if (
|
|
224
|
-
debugHandler('ERROR: No slice path provided. Expected
|
|
225
|
-
return createFailedEvent(command, 'No slice path provided. Expected
|
|
223
|
+
if (momentPath === undefined || momentPath === null || momentPath === '') {
|
|
224
|
+
debugHandler('ERROR: No slice path provided. Expected momentPath or path parameter');
|
|
225
|
+
return createFailedEvent(command, 'No slice path provided. Expected momentPath parameter');
|
|
226
226
|
}
|
|
227
|
-
logCommandDebugInfo(command,
|
|
227
|
+
logCommandDebugInfo(command, momentPath);
|
|
228
228
|
try {
|
|
229
|
-
const sliceRoot = path.resolve(
|
|
229
|
+
const sliceRoot = path.resolve(momentPath);
|
|
230
230
|
debugHandler('Resolved paths:');
|
|
231
|
-
debugHandler('
|
|
231
|
+
debugHandler(' Moment root: %s', sliceRoot);
|
|
232
232
|
if (!existsSync(sliceRoot)) {
|
|
233
|
-
debugHandler('ERROR:
|
|
234
|
-
return createFailedEvent(command, `
|
|
233
|
+
debugHandler('ERROR: Moment directory not found at %s', sliceRoot);
|
|
234
|
+
return createFailedEvent(command, `Moment directory not found at: ${sliceRoot}`, sliceRoot);
|
|
235
235
|
}
|
|
236
236
|
debugProcess('Starting slice implementation for: %s', sliceRoot);
|
|
237
237
|
logRetryContext(context);
|
|
238
|
-
const result = await
|
|
238
|
+
const result = await implementMoment(sliceRoot, context, aiOptions);
|
|
239
239
|
if (!result.success) {
|
|
240
240
|
return createFailedEvent(command, result.error ?? 'Implementation failed', sliceRoot);
|
|
241
241
|
}
|
|
242
242
|
debugResult('Process succeeded');
|
|
243
243
|
debugResult('Files implemented: %d', result.filesImplemented.length);
|
|
244
244
|
debugResult('Files: %s', result.filesImplemented.join(', '));
|
|
245
|
-
debugResult('Returning success event:
|
|
245
|
+
debugResult('Returning success event: MomentImplemented');
|
|
246
246
|
return createSuccessEvent(command, result.filesImplemented, sliceRoot);
|
|
247
247
|
}
|
|
248
248
|
catch (error) {
|
|
249
249
|
debug('ERROR: Exception caught: %O', error);
|
|
250
250
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
251
|
-
return createFailedEvent(command, errorMessage,
|
|
251
|
+
return createFailedEvent(command, errorMessage, momentPath);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
export default commandHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-slice.js","sourceRoot":"","sources":["../../../src/commands/implement-slice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAgB,oBAAoB,EAAc,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,KAAK,GAAG,WAAW,CAAC,+BAA+B,CAAC,CAAC;AAC3D,MAAM,YAAY,GAAG,WAAW,CAAC,uCAAuC,CAAC,CAAC;AAC1E,MAAM,YAAY,GAAG,WAAW,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AC;QAEpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,IAAI,uBAAuB,EAAE,SAAS,CAAC,CAAC;QACxF,CAAC;QAED,WAAW,CAAC,mBAAmB,CAAC,CAAC;QACjC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACrE,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7D,WAAW,CAAC,4CAA4C,CAAC,CAAC;QAE1D,OAAO,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QAC5C,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;QACvF,OAAO,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC;AAED,eAAe,cAAc,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { commandHandler as implementServerHandler } from './commands/implement-server';
|
|
2
|
-
import { commandHandler as
|
|
2
|
+
import { commandHandler as implementMomentHandler } from './commands/implement-slice';
|
|
3
3
|
export declare const COMMANDS: (import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
4
4
|
type: "ImplementServer";
|
|
5
5
|
data: Readonly<{
|
|
@@ -9,9 +9,9 @@ export declare const COMMANDS: (import("@auto-engineer/message-bus").UnifiedComm
|
|
|
9
9
|
requestId?: string;
|
|
10
10
|
correlationId?: string;
|
|
11
11
|
}>> | import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
12
|
-
type: "
|
|
12
|
+
type: "ImplementMoment";
|
|
13
13
|
data: Readonly<{
|
|
14
|
-
|
|
14
|
+
momentPath: string;
|
|
15
15
|
context?: {
|
|
16
16
|
previousOutputs?: string;
|
|
17
17
|
attemptNumber?: number;
|
|
@@ -24,7 +24,7 @@ export declare const COMMANDS: (import("@auto-engineer/message-bus").UnifiedComm
|
|
|
24
24
|
requestId?: string;
|
|
25
25
|
correlationId?: string;
|
|
26
26
|
}>>)[];
|
|
27
|
-
export { implementServerHandler,
|
|
27
|
+
export { implementServerHandler, implementMomentHandler };
|
|
28
28
|
export type { ImplementServerCommand, ImplementServerEvents, ServerImplementationFailedEvent, ServerImplementedEvent, } from './commands/implement-server';
|
|
29
|
-
export {
|
|
29
|
+
export { handleImplementMomentCommand, type ImplementMomentCommand, type ImplementMomentEvents, type MomentImplementationFailedEvent, type MomentImplementedEvent, } from './commands/implement-slice';
|
|
30
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,cAAc,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEtF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;2BAemc,CAAC;yBAA6B,CAAC;;;qBAAkD,CAAC;;;;;;MAfle,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;AAC1D,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACpC,KAAK,sBAAsB,GAC5B,MAAM,4BAA4B,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { commandHandler as implementServerHandler } from './commands/implement-server.js';
|
|
2
|
-
import { commandHandler as
|
|
3
|
-
export const COMMANDS = [implementServerHandler,
|
|
4
|
-
export { implementServerHandler,
|
|
5
|
-
export {
|
|
2
|
+
import { commandHandler as implementMomentHandler } from './commands/implement-slice.js';
|
|
3
|
+
export const COMMANDS = [implementServerHandler, implementMomentHandler];
|
|
4
|
+
export { implementServerHandler, implementMomentHandler };
|
|
5
|
+
export { handleImplementMomentCommand, } from './commands/implement-slice.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,cAAc,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEtF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;AAO1D,OAAO,EACL,4BAA4B,GAK7B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SYSTEM_PROMPT = "\n## 1. ROLE & CONTEXT\n\nYou are a software engineer implementing @auto-implement files in a sliced event-driven TypeScript server.\n\n- Architecture: event-sourced CQRS with @event-driven-io/emmett\n- Language: TypeScript with type-graphql\n-
|
|
1
|
+
export declare const SYSTEM_PROMPT = "\n## 1. ROLE & CONTEXT\n\nYou are a software engineer implementing @auto-implement files in a sliced event-driven TypeScript server.\n\n- Architecture: event-sourced CQRS with @event-driven-io/emmett\n- Language: TypeScript with type-graphql\n- Structured moments: Command, Reaction, Query moments\n- Each slice has scaffolded files with implementation instructions marked with comments or TODOs\n\n## 2. TASK\n\n- Complete the logic in the target file following embedded instructions\n- Return the entire updated file, production-ready\n- Remove all TODO/instruction comments after implementing\n- Scaffolded files contain fixed generated structure.\n Only change code inside the implementation area indicated by TODOs or instruction comments.\n\n## 3. EMMETT FRAMEWORK PATTERNS\n\ndecide(command, state) returns only { type, data }:\n CORRECT:\n return { type: 'OrderPlaced', data: { orderId: command.data.id } };\n WRONG \u2014 framework adds kind/metadata internally:\n return { type: 'OrderPlaced', data: {...}, kind: 'Event', metadata: {...} };\n\nevolve(state, event) returns new state derived from event data:\n CORRECT:\n return { ...state, status: event.data.status, updatedAt: event.data.timestamp };\n\nreact(context) returns void \u2014 queries eventStore, sends commands:\n CORRECT:\n const { state } = await eventStore.aggregateStream(streamId, { evolve, initialState });\n await commandSender.send({ type: 'ProcessItem', kind: 'Command', data: {...} });\n\nProjection evolve(document, event) returns updated document.\n\n## 4. IMPORT RULES\n\n- The provided context files are the COMPLETE set of available modules.\n If a module or type does not appear in any provided file, it does not exist.\n- Only import from: sibling files (./), shared directory ('../../../shared'),\n or packages already imported in the scaffolded code.\n- Never create imports to modules not shown in the provided context.\n- If you need a type that doesn't exist in any provided file,\n use inline types or primitive values instead.\n- Preserve existing import statements exactly \u2014 do not remove, rename, replace,\n or reorganize them unless a scaffold instruction explicitly requires a change.\n- Use the node: protocol for Node.js built-in modules (e.g., node:crypto, node:path).\n\n## 5. TEST SPECIFICATIONS GUIDANCE\n\n- .specs.ts files show expected behavior via Given/When/Then patterns\n- given([events]) = initial state, when({input}) = trigger, then({output}) = expected result\n- Match the exact field names, types, and value derivations in assertions\n- Pay attention to which values come from state vs. command/event data\n- If a spec queries eventStore before testing, the implementation must too\n- Derive values from inputs \u2014 never hardcode test literals\n\n## 6. CONSTRAINTS\n\n- Type safety: no type errors, annotate array literals with explicit types\n- Enums: if shared types define enums, use constants (e.g., Status.ACTIVE) not string literals ('active')\n- Immutability: functional patterns, never mutate state\n- Include ALL required fields in object literals\n- Preserve index signatures ([key: string]: unknown)\n- When mapping objects to a typed array, include ALL required fields in each object literal\n\n## 7. SLICE CONVENTIONS\n\n- Command slice: validate command, inspect state, emit events, never mutate state. Uses graphql mutations.\n- Reaction slice: respond to events with commands.\n- Query slice: maintain projections based on events, do not emit or throw. Uses graphql queries.\n\n## 8. AVOID\n\n- Adding dependencies\n- Refactoring unrelated code\n- Inventing types, enums, or modules not present in provided files\n- String literals for enum-typed fields\n- Hardcoding values that should be computed from inputs\n- Reproducing literal values from test examples\n- Type assertions and escape hatches such as `as any`, `as unknown as`, or broad casts to silence errors\n- Changing scaffolded framework calls or helper names unless explicitly instructed by the scaffold\n- Importing types or modules not directly referenced in the implementation code\n\n## 9. OUTPUT\n\nReturn only the entire updated file. No commentary, no markdown fences.\nEnsure the output is valid TypeScript.\n";
|
|
2
2
|
//# sourceMappingURL=systemPrompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"systemPrompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/systemPrompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"systemPrompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/systemPrompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,4pIA0FzB,CAAC"}
|
|
@@ -5,7 +5,7 @@ You are a software engineer implementing @auto-implement files in a sliced event
|
|
|
5
5
|
|
|
6
6
|
- Architecture: event-sourced CQRS with @event-driven-io/emmett
|
|
7
7
|
- Language: TypeScript with type-graphql
|
|
8
|
-
-
|
|
8
|
+
- Structured moments: Command, Reaction, Query moments
|
|
9
9
|
- Each slice has scaffolded files with implementation instructions marked with comments or TODOs
|
|
10
10
|
|
|
11
11
|
## 2. TASK
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function buildContextSections(targetFile, context, options) {
|
|
2
2
|
const sharedFiles = Object.entries(context).filter(([name]) => name.startsWith('shared/'));
|
|
3
3
|
const specs = Object.entries(context).filter(([name]) => name.endsWith('.specs.ts'));
|
|
4
|
-
const
|
|
4
|
+
const momentFiles = Object.entries(context).filter(([name]) => name !== targetFile && !name.startsWith('shared/') && !name.endsWith('.specs.ts'));
|
|
5
5
|
let result = '';
|
|
6
6
|
if (sharedFiles.length > 0) {
|
|
7
7
|
result += `---\n📦 Shared domain types (importable from '../../../shared'):\n`;
|
|
@@ -10,8 +10,8 @@ export function buildContextSections(targetFile, context, options) {
|
|
|
10
10
|
result += `\n\n${options.enumExamples}`;
|
|
11
11
|
result += '\n\n';
|
|
12
12
|
}
|
|
13
|
-
result += `---\n🧠 Other files in the same
|
|
14
|
-
result +=
|
|
13
|
+
result += `---\n🧠 Other files in the same moment:\n`;
|
|
14
|
+
result += momentFiles.map(([name, content]) => `// File: ${name}\n${content}`).join('\n\n');
|
|
15
15
|
if (specs.length > 0) {
|
|
16
16
|
result += `\n\n---\n🧪 Test specifications (READ-ONLY reference):\n`;
|
|
17
17
|
result += specs.map(([name, content]) => `// File: ${name}\n${content}`).join('\n\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildContextSections.js","sourceRoot":"","sources":["../../../src/utils/buildContextSections.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAClC,UAAkB,EAClB,OAA+B,EAC/B,OAAmC;IAEnC,MAAM,WAAW,GAA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AAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,YAAY,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5F,IAAI,OAAO,EAAE,YAAY;YAAE,MAAM,IAAI,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC;QACnE,MAAM,IAAI,MAAM,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,2CAA2C,CAAC;IACtD,MAAM,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,YAAY,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE5F,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,0DAA0D,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,YAAY,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
import { buildContextSections } from './buildContextSections.js';
|
|
3
3
|
describe('buildContextSections', () => {
|
|
4
|
-
it('separates shared files,
|
|
4
|
+
it('separates shared files, moment files, and spec files into labeled sections', () => {
|
|
5
5
|
const context = {
|
|
6
6
|
'decide.ts': 'export function decide() {}',
|
|
7
7
|
'state.ts': 'export type State = {}',
|
|
@@ -16,7 +16,7 @@ describe('buildContextSections', () => {
|
|
|
16
16
|
'export type Foo = string;',
|
|
17
17
|
'',
|
|
18
18
|
'---',
|
|
19
|
-
'🧠 Other files in the same
|
|
19
|
+
'🧠 Other files in the same moment:',
|
|
20
20
|
'// File: state.ts',
|
|
21
21
|
'export type State = {}',
|
|
22
22
|
'',
|
|
@@ -32,7 +32,7 @@ describe('buildContextSections', () => {
|
|
|
32
32
|
'state.ts': 'export type State = {}',
|
|
33
33
|
};
|
|
34
34
|
const result = buildContextSections('decide.ts', context);
|
|
35
|
-
expect(result).toBe(['---', '🧠 Other files in the same
|
|
35
|
+
expect(result).toBe(['---', '🧠 Other files in the same moment:', '// File: state.ts', 'export type State = {}'].join('\n'));
|
|
36
36
|
});
|
|
37
37
|
it('omits spec section when no spec files exist', () => {
|
|
38
38
|
const context = {
|
|
@@ -48,7 +48,7 @@ describe('buildContextSections', () => {
|
|
|
48
48
|
'export type Foo = string;',
|
|
49
49
|
'',
|
|
50
50
|
'---',
|
|
51
|
-
'🧠 Other files in the same
|
|
51
|
+
'🧠 Other files in the same moment:',
|
|
52
52
|
'// File: evolve.ts',
|
|
53
53
|
'export function evolve() {}',
|
|
54
54
|
].join('\n'));
|
|
@@ -69,12 +69,12 @@ describe('buildContextSections', () => {
|
|
|
69
69
|
'Use Status.ACTIVE not "active"',
|
|
70
70
|
'',
|
|
71
71
|
'---',
|
|
72
|
-
'🧠 Other files in the same
|
|
72
|
+
'🧠 Other files in the same moment:',
|
|
73
73
|
'// File: evolve.ts',
|
|
74
74
|
'export function evolve() {}',
|
|
75
75
|
].join('\n'));
|
|
76
76
|
});
|
|
77
|
-
it('excludes target file from
|
|
77
|
+
it('excludes target file from moment files section', () => {
|
|
78
78
|
const context = {
|
|
79
79
|
'decide.ts': 'export function decide() {}',
|
|
80
80
|
'evolve.ts': 'export function evolve() {}',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildContextSections.specs.js","sourceRoot":"","sources":["../../../src/utils/buildContextSections.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"buildContextSections.specs.js","sourceRoot":"","sources":["../../../src/utils/buildContextSections.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,MAAM,OAAO,GAA2B;YACtC,WAAW,EAAE,6BAA6B;YAC1C,UAAU,EAAE,wBAAwB;YACpC,iBAAiB,EAAE,uBAAuB;YAC1C,iBAAiB,EAAE,2BAA2B;SAC/C,CAAC;QAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CACjB;YACE,KAAK;YACL,6DAA6D;YAC7D,0BAA0B;YAC1B,2BAA2B;YAC3B,EAAE;YACF,KAAK;YACL,oCAAoC;YACpC,mBAAmB;YACnB,wBAAwB;YACxB,EAAE;YACF,KAAK;YACL,+CAA+C;YAC/C,0BAA0B;YAC1B,uBAAuB;SACxB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,OAAO,GAA2B;YACtC,WAAW,EAAE,6BAA6B;YAC1C,UAAU,EAAE,wBAAwB;SACrC,CAAC;QAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CACjB,CAAC,KAAK,EAAE,oCAAoC,EAAE,mBAAmB,EAAE,wBAAwB,CAAC,CAAC,IAAI,CAAC,IA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AAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function loadContextFiles(
|
|
1
|
+
export declare function loadContextFiles(momentDir: string): Promise<Record<string, string>>;
|
|
2
2
|
//# sourceMappingURL=loadContextFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadContextFiles.d.ts","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.ts"],"names":[],"mappings":"AAKA,wBAAsB,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"loadContextFiles.d.ts","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.ts"],"names":[],"mappings":"AAKA,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CASzF"}
|
|
@@ -2,13 +2,13 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fg from 'fast-glob';
|
|
4
4
|
import { loadSharedContext } from './loadSharedContext.js';
|
|
5
|
-
export async function loadContextFiles(
|
|
6
|
-
const files = await fg(['*.ts'], { cwd:
|
|
5
|
+
export async function loadContextFiles(momentDir) {
|
|
6
|
+
const files = await fg(['*.ts'], { cwd: momentDir });
|
|
7
7
|
const context = {};
|
|
8
8
|
for (const file of files) {
|
|
9
|
-
context[file] = await readFile(path.join(
|
|
9
|
+
context[file] = await readFile(path.join(momentDir, file), 'utf-8');
|
|
10
10
|
}
|
|
11
|
-
const sharedFiles = await loadSharedContext(
|
|
11
|
+
const sharedFiles = await loadSharedContext(momentDir);
|
|
12
12
|
Object.assign(context, sharedFiles);
|
|
13
13
|
return context;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadContextFiles.js","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"loadContextFiles.js","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IACtD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACrD,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,SAAS,CAAC,CAAC;IACvD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -4,22 +4,22 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
|
4
4
|
import { loadContextFiles } from './loadContextFiles.js';
|
|
5
5
|
describe('loadContextFiles', () => {
|
|
6
6
|
let tmpDir;
|
|
7
|
-
let
|
|
7
|
+
let momentDir;
|
|
8
8
|
let sharedDir;
|
|
9
9
|
beforeEach(async () => {
|
|
10
10
|
tmpDir = await fs.mkdtemp(path.join(import.meta.dirname, '.tmp-'));
|
|
11
11
|
sharedDir = path.join(tmpDir, 'shared');
|
|
12
|
-
|
|
13
|
-
await fs.mkdir(
|
|
12
|
+
momentDir = path.join(tmpDir, 'src', 'moments', 'some-moment');
|
|
13
|
+
await fs.mkdir(momentDir, { recursive: true });
|
|
14
14
|
});
|
|
15
15
|
afterEach(async () => {
|
|
16
16
|
await fs.rm(tmpDir, { recursive: true, force: true });
|
|
17
17
|
});
|
|
18
|
-
it('loads all .ts files from
|
|
19
|
-
await fs.writeFile(path.join(
|
|
20
|
-
await fs.writeFile(path.join(
|
|
21
|
-
await fs.writeFile(path.join(
|
|
22
|
-
const result = await loadContextFiles(
|
|
18
|
+
it('loads all .ts files from moment directory including specs', async () => {
|
|
19
|
+
await fs.writeFile(path.join(momentDir, 'decide.ts'), 'export function decide() {}');
|
|
20
|
+
await fs.writeFile(path.join(momentDir, 'state.ts'), 'export type State = {}');
|
|
21
|
+
await fs.writeFile(path.join(momentDir, 'decide.specs.ts'), 'it("works", () => {})');
|
|
22
|
+
const result = await loadContextFiles(momentDir);
|
|
23
23
|
expect(result).toEqual({
|
|
24
24
|
'decide.ts': 'export function decide() {}',
|
|
25
25
|
'state.ts': 'export type State = {}',
|
|
@@ -28,16 +28,16 @@ describe('loadContextFiles', () => {
|
|
|
28
28
|
});
|
|
29
29
|
it('integrates shared context files with real filenames', async () => {
|
|
30
30
|
await fs.mkdir(sharedDir, { recursive: true });
|
|
31
|
-
await fs.writeFile(path.join(
|
|
31
|
+
await fs.writeFile(path.join(momentDir, 'decide.ts'), 'export function decide() {}');
|
|
32
32
|
await fs.writeFile(path.join(sharedDir, 'types.ts'), 'export type Foo = string;');
|
|
33
|
-
const result = await loadContextFiles(
|
|
33
|
+
const result = await loadContextFiles(momentDir);
|
|
34
34
|
expect(result).toEqual({
|
|
35
35
|
'decide.ts': 'export function decide() {}',
|
|
36
36
|
'shared/types.ts': 'export type Foo = string;',
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
it('returns empty record for empty
|
|
40
|
-
const result = await loadContextFiles(
|
|
39
|
+
it('returns empty record for empty moment directory', async () => {
|
|
40
|
+
const result = await loadContextFiles(momentDir);
|
|
41
41
|
expect(result).toEqual({});
|
|
42
42
|
});
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadContextFiles.specs.js","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,MAAc,CAAC;IACnB,IAAI,
|
|
1
|
+
{"version":3,"file":"loadContextFiles.specs.js","sourceRoot":"","sources":["../../../src/utils/loadContextFiles.specs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAA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EAAE,wBAAwB;YACpC,iBAAiB,EAAE,uBAAuB;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,6BAA6B,CAAC,CAAC;QACrF,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,2BAA2B,CAAC,CAAC;QAElF,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEjD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,6BAA6B;YAC1C,iBAAiB,EAAE,2BAA2B;SAC/C,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEjD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function loadSharedContext(
|
|
1
|
+
export declare function loadSharedContext(momentDir: string): Promise<Record<string, string>>;
|
|
2
2
|
//# sourceMappingURL=loadSharedContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadSharedContext.d.ts","sourceRoot":"","sources":["../../../src/utils/loadSharedContext.ts"],"names":[],"mappings":"AAKA,wBAAsB,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"loadSharedContext.d.ts","sourceRoot":"","sources":["../../../src/utils/loadSharedContext.ts"],"names":[],"mappings":"AAKA,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAY1F"}
|
|
@@ -2,8 +2,8 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import fg from 'fast-glob';
|
|
5
|
-
export async function loadSharedContext(
|
|
6
|
-
const sharedDir = path.resolve(
|
|
5
|
+
export async function loadSharedContext(momentDir) {
|
|
6
|
+
const sharedDir = path.resolve(momentDir, '../../../shared');
|
|
7
7
|
if (!existsSync(sharedDir))
|
|
8
8
|
return {};
|
|
9
9
|
const sharedFiles = await fg(['*.ts'], { cwd: sharedDir });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadSharedContext.js","sourceRoot":"","sources":["../../../src/utils/loadSharedContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"loadSharedContext.js","sourceRoot":"","sources":["../../../src/utils/loadSharedContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,WAAW,CAAC;AAE3B,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAC3D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAExC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC;QACtC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|