@auto-engineer/server-implementer 0.6.5 → 0.8.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 +13 -14
- package/.turbo/turbo-type-check.log +4 -5
- package/CHANGELOG.md +12 -0
- package/dist/agent/runSlice.d.ts.map +1 -1
- package/dist/agent/runSlice.js +4 -10
- package/dist/agent/runSlice.js.map +1 -1
- package/dist/commands/implement-server.d.ts +11 -42
- package/dist/commands/implement-server.d.ts.map +1 -1
- package/dist/commands/implement-server.js +30 -26
- package/dist/commands/implement-server.js.map +1 -1
- package/dist/commands/implement-slice.d.ts +15 -46
- package/dist/commands/implement-slice.d.ts.map +1 -1
- package/dist/commands/implement-slice.js +61 -45
- package/dist/commands/implement-slice.js.map +1 -1
- package/dist/index.d.ts +26 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/agent/runSlice.ts +4 -14
- package/src/commands/implement-server.ts +34 -35
- package/src/commands/implement-slice.ts +74 -58
- package/src/index.ts +4 -4
- package/.turbo/turbo-format.log +0 -20
- package/.turbo/turbo-lint.log +0 -5
- package/dist/cli-manifest.d.ts +0 -3
- package/dist/cli-manifest.d.ts.map +0 -1
- package/dist/cli-manifest.js +0 -37
- package/dist/cli-manifest.js.map +0 -1
- package/src/cli-manifest.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implement-slice.js","sourceRoot":"","sources":["../../src/commands/implement-slice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"implement-slice.js","sourceRoot":"","sources":["../../src/commands/implement-slice.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,IAAI,MAAM,MA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AAC,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,2CAA2C,CAAC,CAAC;QAEzD,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,SAAS,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,eAAe,cAAc,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { commandHandler as implementServerHandler } from './commands/implement-server';
|
|
2
|
+
import { commandHandler as implementSliceHandler } from './commands/implement-slice';
|
|
3
|
+
export declare const COMMANDS: (import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
4
|
+
type: "ImplementServer";
|
|
5
|
+
data: Readonly<{
|
|
6
|
+
serverDirectory: string;
|
|
7
|
+
}>;
|
|
8
|
+
timestamp?: Date;
|
|
9
|
+
requestId?: string;
|
|
10
|
+
correlationId?: string;
|
|
11
|
+
}>> | import("@auto-engineer/message-bus").UnifiedCommandHandler<Readonly<{
|
|
12
|
+
type: "ImplementSlice";
|
|
13
|
+
data: Readonly<{
|
|
14
|
+
slicePath: string;
|
|
15
|
+
context?: {
|
|
16
|
+
previousOutputs?: string;
|
|
17
|
+
attemptNumber?: number;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
timestamp?: Date;
|
|
21
|
+
requestId?: string;
|
|
22
|
+
correlationId?: string;
|
|
23
|
+
}>>)[];
|
|
24
|
+
export { implementServerHandler, implementSliceHandler };
|
|
25
|
+
export { type ImplementServerCommand, type ServerImplementedEvent, type ServerImplementationFailedEvent, } from './commands/implement-server';
|
|
26
|
+
export { handleImplementSliceCommand, type ImplementSliceCommand, type SliceImplementedEvent, type SliceImplementationFailedEvent, } from './commands/implement-slice';
|
|
4
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
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,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAErF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;2BAayC,CAAC;yBAA6B,CAAC;;;;;;MAbtB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;AACzD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,+BAA+B,GACrC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,GACpC,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { commandHandler as implementServerHandler } from './commands/implement-server.js';
|
|
2
|
+
import { commandHandler as implementSliceHandler } from './commands/implement-slice.js';
|
|
3
|
+
export const COMMANDS = [implementServerHandler, implementSliceHandler];
|
|
4
|
+
export { implementServerHandler, implementSliceHandler };
|
|
5
|
+
export { handleImplementSliceCommand, } from './commands/implement-slice.js';
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
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,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAErF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;AAMzD,OAAO,EACL,2BAA2B,GAI5B,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-engineer/server-implementer",
|
|
3
|
-
"version": "0.6.5",
|
|
4
3
|
"type": "module",
|
|
5
4
|
"main": "./dist/index.js",
|
|
6
5
|
"types": "./dist/index.d.ts",
|
|
@@ -14,15 +13,14 @@
|
|
|
14
13
|
"access": "public"
|
|
15
14
|
},
|
|
16
15
|
"dependencies": {
|
|
17
|
-
"@auto-engineer/ai-gateway": "^0.6.3",
|
|
18
|
-
"@auto-engineer/message-bus": "^0.5.5",
|
|
19
16
|
"@modelcontextprotocol/sdk": "^1.3.0",
|
|
20
17
|
"debug": "^4.3.4",
|
|
21
18
|
"fast-glob": "^3.3.3",
|
|
22
|
-
"vite": "^5.4.1"
|
|
19
|
+
"vite": "^5.4.1",
|
|
20
|
+
"@auto-engineer/ai-gateway": "0.8.1",
|
|
21
|
+
"@auto-engineer/message-bus": "0.8.1"
|
|
23
22
|
},
|
|
24
23
|
"devDependencies": {
|
|
25
|
-
"@auto-engineer/cli": "^0.7.6",
|
|
26
24
|
"@types/fs-extra": "^11.0.4",
|
|
27
25
|
"dotenv": "^16.6.1",
|
|
28
26
|
"execa": "^9.6.0",
|
|
@@ -30,17 +28,19 @@
|
|
|
30
28
|
"glob": "^11.0.3",
|
|
31
29
|
"tsx": "^4.20.3",
|
|
32
30
|
"typescript": "^5.8.3",
|
|
33
|
-
"vitest": "^3.2.4"
|
|
31
|
+
"vitest": "^3.2.4",
|
|
32
|
+
"@auto-engineer/cli": "0.8.1"
|
|
34
33
|
},
|
|
34
|
+
"version": "0.8.1",
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsc && tsx ../../scripts/fix-esm-imports.ts",
|
|
37
37
|
"dev": "tsc --watch",
|
|
38
|
-
"test": "vitest run",
|
|
38
|
+
"test": "vitest run --reporter=dot",
|
|
39
39
|
"lint": "eslint 'src/**/*.ts' --max-warnings 0 --config ../../eslint.config.ts",
|
|
40
40
|
"type-check": "tsc --noEmit",
|
|
41
|
-
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
41
|
+
"format": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
42
42
|
"lint:fix": "eslint 'src/**/*.ts' --fix --config ../../eslint.config.ts",
|
|
43
|
-
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore",
|
|
43
|
+
"format:fix": "prettier --write \"**/*.{js,ts,json,md,yml,yaml}\" --ignore-path ../../.prettierignore --log-level warn",
|
|
44
44
|
"link:dev": "pnpm build && pnpm link --global",
|
|
45
45
|
"unlink:dev": "pnpm unlink --global"
|
|
46
46
|
}
|
package/src/agent/runSlice.ts
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
2
|
import fg from 'fast-glob';
|
|
3
|
-
import { generateTextWithAI
|
|
3
|
+
import { generateTextWithAI } from '@auto-engineer/ai-gateway';
|
|
4
4
|
import { readFile, writeFile, access } from 'fs/promises';
|
|
5
5
|
import { execa } from 'execa';
|
|
6
6
|
import { SYSTEM_PROMPT } from '../prompts/systemPrompt';
|
|
7
7
|
import { extractCodeBlock } from '../utils/extractCodeBlock';
|
|
8
8
|
import { runTests } from './runTests';
|
|
9
9
|
|
|
10
|
-
const availableProviders = getAvailableProviders();
|
|
11
|
-
const AI_PROVIDER = availableProviders[0];
|
|
12
|
-
|
|
13
|
-
if (availableProviders.length === 0) {
|
|
14
|
-
console.error(
|
|
15
|
-
'❌ No AI providers configured. Please set one of: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, or XAI_API_KEY',
|
|
16
|
-
);
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
type TestAndTypecheckResult = {
|
|
21
11
|
success: boolean;
|
|
22
12
|
failedTestFiles: string[];
|
|
@@ -72,7 +62,7 @@ async function retryFailedFiles(sliceDir: string, flow: string, initialResult: T
|
|
|
72
62
|
const fileName = path.basename(filePath);
|
|
73
63
|
const retryPrompt = buildRetryPrompt(fileName, contextFiles, result.testErrors, result.typecheckErrors);
|
|
74
64
|
console.log(`🔧 Retrying typecheck error in ${fileName} in flow ${flow}...`);
|
|
75
|
-
const aiOutput = await generateTextWithAI(retryPrompt
|
|
65
|
+
const aiOutput = await generateTextWithAI(retryPrompt);
|
|
76
66
|
const cleanedCode = extractCodeBlock(aiOutput);
|
|
77
67
|
await writeFile(path.join(sliceDir, fileName), cleanedCode, 'utf-8');
|
|
78
68
|
console.log(`♻️ Updated ${fileName} to fix typecheck errors`);
|
|
@@ -173,7 +163,7 @@ async function implementFileFromAI(sliceDir: string, targetFile: string, context
|
|
|
173
163
|
const filePath = path.join(sliceDir, targetFile);
|
|
174
164
|
const prompt = buildInitialPrompt(targetFile, contextFiles);
|
|
175
165
|
console.log(`🔮 Analysing and Implementing ${targetFile}`);
|
|
176
|
-
const aiOutput = await generateTextWithAI(prompt
|
|
166
|
+
const aiOutput = await generateTextWithAI(prompt);
|
|
177
167
|
//console.log('AI output:', aiOutput);
|
|
178
168
|
const cleanedCode = extractCodeBlock(aiOutput);
|
|
179
169
|
await writeFile(filePath, cleanedCode, 'utf-8');
|
|
@@ -228,7 +218,7 @@ No commentary or markdown outside the code block.
|
|
|
228
218
|
`.trim();
|
|
229
219
|
|
|
230
220
|
console.log('🔮 Asking AI to suggest a fix for test failures...');
|
|
231
|
-
const aiOutput = await generateTextWithAI(smartPrompt
|
|
221
|
+
const aiOutput = await generateTextWithAI(smartPrompt);
|
|
232
222
|
const cleaned = extractCodeBlock(aiOutput);
|
|
233
223
|
const match = cleaned.match(/^\/\/ File: (.+?)\n([\s\S]*)/m);
|
|
234
224
|
if (!match) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Command, type Event, defineCommandHandler } from '@auto-engineer/message-bus';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import { runFlows } from '../agent/runFlows';
|
|
@@ -9,14 +9,6 @@ const debugHandler = createDebug('server-impl:command:handler');
|
|
|
9
9
|
const debugProcess = createDebug('server-impl:command:process');
|
|
10
10
|
const debugResult = createDebug('server-impl:command:result');
|
|
11
11
|
|
|
12
|
-
export const implementServerManifest = {
|
|
13
|
-
handler: () => Promise.resolve({ default: implementServerCommandHandler }),
|
|
14
|
-
description: 'AI implements server TODOs and tests',
|
|
15
|
-
usage: 'implement:server <server-dir>',
|
|
16
|
-
examples: ['$ auto implement:server ./server'],
|
|
17
|
-
args: [{ name: 'server-dir', description: 'Server directory path', required: true }],
|
|
18
|
-
};
|
|
19
|
-
|
|
20
12
|
export type ImplementServerCommand = Command<
|
|
21
13
|
'ImplementServer',
|
|
22
14
|
{
|
|
@@ -40,6 +32,38 @@ export type ServerImplementationFailedEvent = Event<
|
|
|
40
32
|
}
|
|
41
33
|
>;
|
|
42
34
|
|
|
35
|
+
export const commandHandler = defineCommandHandler<ImplementServerCommand>({
|
|
36
|
+
name: 'ImplementServer',
|
|
37
|
+
alias: 'implement:server',
|
|
38
|
+
description: 'AI implements server TODOs and tests',
|
|
39
|
+
category: 'implement',
|
|
40
|
+
fields: {
|
|
41
|
+
serverDirectory: {
|
|
42
|
+
description: 'Server directory path',
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
examples: ['$ auto implement:server --server-directory=./server'],
|
|
47
|
+
handle: async (
|
|
48
|
+
command: ImplementServerCommand,
|
|
49
|
+
): Promise<ServerImplementedEvent | ServerImplementationFailedEvent> => {
|
|
50
|
+
debug('CommandHandler executing for ImplementServer');
|
|
51
|
+
const result = await handleImplementServerCommandInternal(command);
|
|
52
|
+
|
|
53
|
+
if (result.type === 'ServerImplemented') {
|
|
54
|
+
debug('Command handler completed: success');
|
|
55
|
+
debug('✅ Server implementation completed successfully');
|
|
56
|
+
if (result.data.flowsImplemented > 0) {
|
|
57
|
+
debug(' %d flows implemented', result.data.flowsImplemented);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
debug('Command handler completed: failure - %s', result.data.error);
|
|
61
|
+
debug('❌ Server implementation failed: %s', result.data.error);
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
43
67
|
async function handleImplementServerCommandInternal(
|
|
44
68
|
command: ImplementServerCommand,
|
|
45
69
|
): Promise<ServerImplementedEvent | ServerImplementationFailedEvent> {
|
|
@@ -116,30 +140,5 @@ async function handleImplementServerCommandInternal(
|
|
|
116
140
|
}
|
|
117
141
|
}
|
|
118
142
|
|
|
119
|
-
export const implementServerCommandHandler: CommandHandler<
|
|
120
|
-
ImplementServerCommand,
|
|
121
|
-
ServerImplementedEvent | ServerImplementationFailedEvent
|
|
122
|
-
> = {
|
|
123
|
-
name: 'ImplementServer',
|
|
124
|
-
handle: async (
|
|
125
|
-
command: ImplementServerCommand,
|
|
126
|
-
): Promise<ServerImplementedEvent | ServerImplementationFailedEvent> => {
|
|
127
|
-
debug('CommandHandler executing for ImplementServer');
|
|
128
|
-
const result = await handleImplementServerCommandInternal(command);
|
|
129
|
-
|
|
130
|
-
if (result.type === 'ServerImplemented') {
|
|
131
|
-
debug('Command handler completed: success');
|
|
132
|
-
debug('✅ Server implementation completed successfully');
|
|
133
|
-
if (result.data.flowsImplemented > 0) {
|
|
134
|
-
debug(' %d flows implemented', result.data.flowsImplemented);
|
|
135
|
-
}
|
|
136
|
-
} else {
|
|
137
|
-
debug('Command handler completed: failure - %s', result.data.error);
|
|
138
|
-
debug('❌ Server implementation failed: %s', result.data.error);
|
|
139
|
-
}
|
|
140
|
-
return result;
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
143
|
// Default export is the command handler
|
|
145
|
-
export default
|
|
144
|
+
export default commandHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { generateTextWithAI
|
|
1
|
+
import { type Command, type Event, defineCommandHandler } from '@auto-engineer/message-bus';
|
|
2
|
+
import { generateTextWithAI } from '@auto-engineer/ai-gateway';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { existsSync } from 'fs';
|
|
5
5
|
import { readFile, writeFile } from 'fs/promises';
|
|
@@ -11,16 +11,6 @@ const debugHandler = createDebug('server-impl:slice:handler');
|
|
|
11
11
|
const debugProcess = createDebug('server-impl:slice:process');
|
|
12
12
|
const debugResult = createDebug('server-impl:slice:result');
|
|
13
13
|
|
|
14
|
-
export const implementSliceManifest = {
|
|
15
|
-
handler: () => Promise.resolve({ default: implementSliceCommandHandler }),
|
|
16
|
-
description: 'AI implements a specific server slice',
|
|
17
|
-
usage: 'implement:slice <slice-path>',
|
|
18
|
-
examples: [
|
|
19
|
-
'$ auto implement:slice ./server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant',
|
|
20
|
-
],
|
|
21
|
-
args: [{ name: 'slice-path', description: 'Path to the slice directory to implement', required: true }],
|
|
22
|
-
};
|
|
23
|
-
|
|
24
14
|
export type ImplementSliceCommand = Command<
|
|
25
15
|
'ImplementSlice',
|
|
26
16
|
{
|
|
@@ -48,6 +38,41 @@ export type SliceImplementationFailedEvent = Event<
|
|
|
48
38
|
}
|
|
49
39
|
>;
|
|
50
40
|
|
|
41
|
+
export const commandHandler = defineCommandHandler<ImplementSliceCommand>({
|
|
42
|
+
name: 'ImplementSlice',
|
|
43
|
+
alias: 'implement:slice',
|
|
44
|
+
description: 'AI implements a specific server slice',
|
|
45
|
+
category: 'implement',
|
|
46
|
+
fields: {
|
|
47
|
+
slicePath: {
|
|
48
|
+
description: 'Path to the slice directory to implement',
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
context: {
|
|
52
|
+
description: 'Context for retry attempts with previous outputs',
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
examples: [
|
|
57
|
+
'$ auto implement:slice --slice-path=./server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant',
|
|
58
|
+
],
|
|
59
|
+
handle: async (command: ImplementSliceCommand): Promise<SliceImplementedEvent | SliceImplementationFailedEvent> => {
|
|
60
|
+
debug('CommandHandler executing for ImplementSlice');
|
|
61
|
+
const result = await handleImplementSliceCommand(command);
|
|
62
|
+
|
|
63
|
+
if (result.type === 'SliceImplemented') {
|
|
64
|
+
debug('Command handler completed: success');
|
|
65
|
+
debug('✅ Slice implementation completed successfully');
|
|
66
|
+
debug(' Slice: %s', path.basename(result.data.slicePath));
|
|
67
|
+
debug(' Files implemented: %d', result.data.filesImplemented.length);
|
|
68
|
+
} else {
|
|
69
|
+
debug('Command handler completed: failure - %s', result.data.error);
|
|
70
|
+
debug('❌ Slice implementation failed: %s', result.data.error);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
51
76
|
// Helper function to extract code block from AI response
|
|
52
77
|
function extractCodeBlock(text: string): string {
|
|
53
78
|
return text
|
|
@@ -171,15 +196,6 @@ async function implementSlice(
|
|
|
171
196
|
slicePath: string,
|
|
172
197
|
context?: { previousOutputs?: string; attemptNumber?: number },
|
|
173
198
|
): Promise<{ success: boolean; filesImplemented: string[]; error?: string }> {
|
|
174
|
-
const availableProviders = getAvailableProviders();
|
|
175
|
-
|
|
176
|
-
if (availableProviders.length === 0) {
|
|
177
|
-
throw new Error(
|
|
178
|
-
'No AI providers configured. Please set one of: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, or XAI_API_KEY',
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const AI_PROVIDER = availableProviders[0];
|
|
183
199
|
const sliceName = path.basename(slicePath);
|
|
184
200
|
|
|
185
201
|
debugProcess(`Implementing slice: ${sliceName}`);
|
|
@@ -210,7 +226,7 @@ async function implementSlice(
|
|
|
210
226
|
}
|
|
211
227
|
|
|
212
228
|
// Generate implementation with AI
|
|
213
|
-
const aiOutput = await generateTextWithAI(prompt
|
|
229
|
+
const aiOutput = await generateTextWithAI(prompt);
|
|
214
230
|
const cleanedCode = extractCodeBlock(aiOutput);
|
|
215
231
|
|
|
216
232
|
// Write the implemented file
|
|
@@ -232,10 +248,12 @@ async function implementSlice(
|
|
|
232
248
|
}
|
|
233
249
|
}
|
|
234
250
|
|
|
235
|
-
function logCommandDebugInfo(command: ImplementSliceCommand): void {
|
|
236
|
-
const
|
|
251
|
+
function logCommandDebugInfo(command: ImplementSliceCommand, resolvedSlicePath?: string): void {
|
|
252
|
+
const rawData = command.data as ImplementSliceCommand['data'] & { path?: string };
|
|
253
|
+
const slicePath = rawData.slicePath ?? rawData.path;
|
|
254
|
+
const { context } = command.data;
|
|
237
255
|
debug('Handling ImplementSliceCommand');
|
|
238
|
-
debug(' Slice path: %s', slicePath);
|
|
256
|
+
debug(' Slice path: %s', resolvedSlicePath ?? slicePath);
|
|
239
257
|
debug(' Context provided: %s', context ? 'yes' : 'no');
|
|
240
258
|
if (context) {
|
|
241
259
|
debug(' Attempt number: %d', context.attemptNumber ?? 1);
|
|
@@ -244,11 +262,17 @@ function logCommandDebugInfo(command: ImplementSliceCommand): void {
|
|
|
244
262
|
debug(' Correlation ID: %s', command.correlationId ?? 'none');
|
|
245
263
|
}
|
|
246
264
|
|
|
247
|
-
function createFailedEvent(
|
|
265
|
+
function createFailedEvent(
|
|
266
|
+
command: ImplementSliceCommand,
|
|
267
|
+
error: string,
|
|
268
|
+
resolvedSlicePath?: string,
|
|
269
|
+
): SliceImplementationFailedEvent {
|
|
270
|
+
const rawData = command.data as ImplementSliceCommand['data'] & { path?: string };
|
|
271
|
+
const slicePath = resolvedSlicePath ?? rawData.slicePath ?? rawData.path;
|
|
248
272
|
return {
|
|
249
273
|
type: 'SliceImplementationFailed',
|
|
250
274
|
data: {
|
|
251
|
-
slicePath
|
|
275
|
+
slicePath,
|
|
252
276
|
error,
|
|
253
277
|
},
|
|
254
278
|
timestamp: new Date(),
|
|
@@ -257,11 +281,17 @@ function createFailedEvent(command: ImplementSliceCommand, error: string): Slice
|
|
|
257
281
|
};
|
|
258
282
|
}
|
|
259
283
|
|
|
260
|
-
function createSuccessEvent(
|
|
284
|
+
function createSuccessEvent(
|
|
285
|
+
command: ImplementSliceCommand,
|
|
286
|
+
filesImplemented: string[],
|
|
287
|
+
resolvedSlicePath?: string,
|
|
288
|
+
): SliceImplementedEvent {
|
|
289
|
+
const rawData = command.data as ImplementSliceCommand['data'] & { path?: string };
|
|
290
|
+
const slicePath = resolvedSlicePath ?? rawData.slicePath ?? rawData.path;
|
|
261
291
|
return {
|
|
262
292
|
type: 'SliceImplemented',
|
|
263
293
|
data: {
|
|
264
|
-
slicePath
|
|
294
|
+
slicePath,
|
|
265
295
|
filesImplemented,
|
|
266
296
|
},
|
|
267
297
|
timestamp: new Date(),
|
|
@@ -280,9 +310,17 @@ function logRetryContext(context: { previousOutputs?: string; attemptNumber?: nu
|
|
|
280
310
|
export async function handleImplementSliceCommand(
|
|
281
311
|
command: ImplementSliceCommand,
|
|
282
312
|
): Promise<SliceImplementedEvent | SliceImplementationFailedEvent> {
|
|
283
|
-
|
|
313
|
+
// Handle both 'slicePath' and 'path' parameters for backward compatibility
|
|
314
|
+
const rawData = command.data as ImplementSliceCommand['data'] & { path?: string };
|
|
315
|
+
const slicePath = rawData.slicePath ?? rawData.path;
|
|
316
|
+
const { context } = command.data;
|
|
317
|
+
|
|
318
|
+
if (slicePath === undefined || slicePath === null || slicePath === '') {
|
|
319
|
+
debugHandler('ERROR: No slice path provided. Expected slicePath or path parameter');
|
|
320
|
+
return createFailedEvent(command, 'No slice path provided. Expected slicePath parameter');
|
|
321
|
+
}
|
|
284
322
|
|
|
285
|
-
logCommandDebugInfo(command);
|
|
323
|
+
logCommandDebugInfo(command, slicePath);
|
|
286
324
|
|
|
287
325
|
try {
|
|
288
326
|
const sliceRoot = path.resolve(slicePath);
|
|
@@ -291,7 +329,7 @@ export async function handleImplementSliceCommand(
|
|
|
291
329
|
|
|
292
330
|
if (!existsSync(sliceRoot)) {
|
|
293
331
|
debugHandler('ERROR: Slice directory not found at %s', sliceRoot);
|
|
294
|
-
return createFailedEvent(command, `Slice directory not found at: ${sliceRoot}
|
|
332
|
+
return createFailedEvent(command, `Slice directory not found at: ${sliceRoot}`, sliceRoot);
|
|
295
333
|
}
|
|
296
334
|
|
|
297
335
|
debugProcess('Starting slice implementation for: %s', sliceRoot);
|
|
@@ -300,7 +338,7 @@ export async function handleImplementSliceCommand(
|
|
|
300
338
|
const result = await implementSlice(sliceRoot, context);
|
|
301
339
|
|
|
302
340
|
if (!result.success) {
|
|
303
|
-
return createFailedEvent(command, result.error ?? 'Implementation failed');
|
|
341
|
+
return createFailedEvent(command, result.error ?? 'Implementation failed', sliceRoot);
|
|
304
342
|
}
|
|
305
343
|
|
|
306
344
|
debugResult('Process succeeded');
|
|
@@ -308,35 +346,13 @@ export async function handleImplementSliceCommand(
|
|
|
308
346
|
debugResult('Files: %s', result.filesImplemented.join(', '));
|
|
309
347
|
debugResult('Returning success event: SliceImplemented');
|
|
310
348
|
|
|
311
|
-
return createSuccessEvent(command, result.filesImplemented);
|
|
349
|
+
return createSuccessEvent(command, result.filesImplemented, sliceRoot);
|
|
312
350
|
} catch (error) {
|
|
313
351
|
debug('ERROR: Exception caught: %O', error);
|
|
314
352
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
315
|
-
return createFailedEvent(command, errorMessage);
|
|
353
|
+
return createFailedEvent(command, errorMessage, slicePath);
|
|
316
354
|
}
|
|
317
355
|
}
|
|
318
356
|
|
|
319
|
-
export const implementSliceCommandHandler: CommandHandler<
|
|
320
|
-
ImplementSliceCommand,
|
|
321
|
-
SliceImplementedEvent | SliceImplementationFailedEvent
|
|
322
|
-
> = {
|
|
323
|
-
name: 'ImplementSlice',
|
|
324
|
-
handle: async (command: ImplementSliceCommand): Promise<SliceImplementedEvent | SliceImplementationFailedEvent> => {
|
|
325
|
-
debug('CommandHandler executing for ImplementSlice');
|
|
326
|
-
const result = await handleImplementSliceCommand(command);
|
|
327
|
-
|
|
328
|
-
if (result.type === 'SliceImplemented') {
|
|
329
|
-
debug('Command handler completed: success');
|
|
330
|
-
debug('✅ Slice implementation completed successfully');
|
|
331
|
-
debug(' Slice: %s', path.basename(result.data.slicePath));
|
|
332
|
-
debug(' Files implemented: %d', result.data.filesImplemented.length);
|
|
333
|
-
} else {
|
|
334
|
-
debug('Command handler completed: failure - %s', result.data.error);
|
|
335
|
-
debug('❌ Slice implementation failed: %s', result.data.error);
|
|
336
|
-
}
|
|
337
|
-
return result;
|
|
338
|
-
},
|
|
339
|
-
};
|
|
340
|
-
|
|
341
357
|
// Default export is the command handler
|
|
342
|
-
export default
|
|
358
|
+
export default commandHandler;
|
package/src/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { commandHandler as implementServerHandler } from './commands/implement-server';
|
|
2
|
+
import { commandHandler as implementSliceHandler } from './commands/implement-slice';
|
|
2
3
|
|
|
4
|
+
export const COMMANDS = [implementServerHandler, implementSliceHandler];
|
|
5
|
+
export { implementServerHandler, implementSliceHandler };
|
|
3
6
|
export {
|
|
4
|
-
implementServerCommandHandler,
|
|
5
7
|
type ImplementServerCommand,
|
|
6
8
|
type ServerImplementedEvent,
|
|
7
9
|
type ServerImplementationFailedEvent,
|
|
8
10
|
} from './commands/implement-server';
|
|
9
|
-
|
|
10
11
|
export {
|
|
11
|
-
implementSliceCommandHandler,
|
|
12
12
|
handleImplementSliceCommand,
|
|
13
13
|
type ImplementSliceCommand,
|
|
14
14
|
type SliceImplementedEvent,
|
package/.turbo/turbo-format.log
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @auto-engineer/server-implementer@0.6.5 format /Users/sam/WebstormProjects/top/auto-engineer/packages/server-implementer
|
|
4
|
-
> prettier --write "**/*.{js,ts,json,md,yml,yaml}" --ignore-path ../../.prettierignore
|
|
5
|
-
|
|
6
|
-
CHANGELOG.md[2K[1G[90mCHANGELOG.md[39m 28ms (unchanged)
|
|
7
|
-
DEBUG.md[2K[1G[90mDEBUG.md[39m 3ms (unchanged)
|
|
8
|
-
package.json[2K[1G[90mpackage.json[39m 14ms (unchanged)
|
|
9
|
-
README.md[2K[1G[90mREADME.md[39m 51ms (unchanged)
|
|
10
|
-
src/agent/runAllSlices.ts[2K[1G[90msrc/agent/runAllSlices.ts[39m 4ms (unchanged)
|
|
11
|
-
src/agent/runFlows.ts[2K[1G[90msrc/agent/runFlows.ts[39m 4ms (unchanged)
|
|
12
|
-
src/agent/runSlice.ts[2K[1G[90msrc/agent/runSlice.ts[39m 28ms (unchanged)
|
|
13
|
-
src/agent/runTests.ts[2K[1G[90msrc/agent/runTests.ts[39m 7ms (unchanged)
|
|
14
|
-
src/cli-manifest.ts[2K[1G[90msrc/cli-manifest.ts[39m 4ms (unchanged)
|
|
15
|
-
src/commands/implement-server.ts[2K[1G[90msrc/commands/implement-server.ts[39m 6ms (unchanged)
|
|
16
|
-
src/commands/implement-slice.ts[2K[1G[90msrc/commands/implement-slice.ts[39m 10ms (unchanged)
|
|
17
|
-
src/index.ts[2K[1G[90msrc/index.ts[39m 1ms (unchanged)
|
|
18
|
-
src/prompts/systemPrompt.ts[2K[1G[90msrc/prompts/systemPrompt.ts[39m 1ms (unchanged)
|
|
19
|
-
src/utils/extractCodeBlock.ts[2K[1G[90msrc/utils/extractCodeBlock.ts[39m 1ms (unchanged)
|
|
20
|
-
tsconfig.json[2K[1G[90mtsconfig.json[39m 1ms (unchanged)
|
package/.turbo/turbo-lint.log
DELETED
package/dist/cli-manifest.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AA+BrE,eAAO,MAAM,YAAY,EAAE,WAO1B,CAAC"}
|
package/dist/cli-manifest.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { implementServerManifest } from './commands/implement-server.js';
|
|
2
|
-
import { implementSliceManifest } from './commands/implement-slice.js';
|
|
3
|
-
import * as fs from 'fs';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
6
|
-
// Get version from package.json
|
|
7
|
-
const getVersion = () => {
|
|
8
|
-
try {
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = path.dirname(__filename);
|
|
11
|
-
// In dev: src/cli-manifest.ts -> ../../package.json
|
|
12
|
-
// In dist: dist/cli-manifest.js -> ../package.json
|
|
13
|
-
const possiblePaths = [
|
|
14
|
-
path.join(__dirname, '..', 'package.json'), // dist build
|
|
15
|
-
path.join(__dirname, '..', '..', 'package.json'), // dev/src
|
|
16
|
-
];
|
|
17
|
-
for (const packageJsonPath of possiblePaths) {
|
|
18
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
19
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
20
|
-
return packageJson.version;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
// Fall through
|
|
26
|
-
}
|
|
27
|
-
return 'unknown';
|
|
28
|
-
};
|
|
29
|
-
export const CLI_MANIFEST = {
|
|
30
|
-
category: '@auto-engineer/server-implementer',
|
|
31
|
-
version: getVersion(),
|
|
32
|
-
commands: {
|
|
33
|
-
'implement:server': implementServerManifest,
|
|
34
|
-
'implement:slice': implementSliceManifest,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=cli-manifest.js.map
|
package/dist/cli-manifest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,gCAAgC;AAChC,MAAM,UAAU,GAAG,GAAW,EAAE;IAC9B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,oDAAoD;QACpD,mDAAmD;QACnD,MAAM,aAAa,GAAG;YACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,aAAa;YACzD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,UAAU;SAC7D,CAAC;QAEF,KAAK,MAAM,eAAe,IAAI,aAAa,EAAE,CAAC;YAC5C,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;gBACnC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAwB,CAAC;gBACjG,OAAO,WAAW,CAAC,OAAO,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,eAAe;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,QAAQ,EAAE,mCAAmC;IAC7C,OAAO,EAAE,UAAU,EAAE;IACrB,QAAQ,EAAE;QACR,kBAAkB,EAAE,uBAAuB;QAC3C,iBAAiB,EAAE,sBAAsB;KAC1C;CACF,CAAC"}
|
package/src/cli-manifest.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { CliManifest } from '@auto-engineer/cli/manifest-types';
|
|
2
|
-
import { implementServerManifest } from './commands/implement-server';
|
|
3
|
-
import { implementSliceManifest } from './commands/implement-slice';
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
|
|
8
|
-
// Get version from package.json
|
|
9
|
-
const getVersion = (): string => {
|
|
10
|
-
try {
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = path.dirname(__filename);
|
|
13
|
-
// In dev: src/cli-manifest.ts -> ../../package.json
|
|
14
|
-
// In dist: dist/cli-manifest.js -> ../package.json
|
|
15
|
-
const possiblePaths = [
|
|
16
|
-
path.join(__dirname, '..', 'package.json'), // dist build
|
|
17
|
-
path.join(__dirname, '..', '..', 'package.json'), // dev/src
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
for (const packageJsonPath of possiblePaths) {
|
|
21
|
-
if (fs.existsSync(packageJsonPath)) {
|
|
22
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) as { version: string };
|
|
23
|
-
return packageJson.version;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
} catch {
|
|
27
|
-
// Fall through
|
|
28
|
-
}
|
|
29
|
-
return 'unknown';
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const CLI_MANIFEST: CliManifest = {
|
|
33
|
-
category: '@auto-engineer/server-implementer',
|
|
34
|
-
version: getVersion(),
|
|
35
|
-
commands: {
|
|
36
|
-
'implement:server': implementServerManifest,
|
|
37
|
-
'implement:slice': implementSliceManifest,
|
|
38
|
-
},
|
|
39
|
-
};
|