tryassay 0.14.0 → 0.15.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/dist/api/server.js +7 -0
- package/dist/api/server.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/create.js +45 -7
- package/dist/commands/create.js.map +1 -1
- package/dist/runtime/agents/planner-agent.js +25 -1
- package/dist/runtime/agents/planner-agent.js.map +1 -1
- package/dist/runtime/app-create-orchestrator.d.ts +19 -0
- package/dist/runtime/app-create-orchestrator.js +283 -23
- package/dist/runtime/app-create-orchestrator.js.map +1 -1
- package/dist/runtime/build-verifier.d.ts +39 -0
- package/dist/runtime/build-verifier.js +571 -0
- package/dist/runtime/build-verifier.js.map +1 -0
- package/dist/runtime/types.d.ts +58 -2
- package/package.json +1 -1
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Build Verifier — Build-Test-Repair loop for generated apps
|
|
3
|
+
// Runs npm install, npm run build, starts dev server, health checks.
|
|
4
|
+
// On failure, feeds errors to CodeAgent for repair, then retries.
|
|
5
|
+
// ============================================================
|
|
6
|
+
import { exec, spawn } from 'node:child_process';
|
|
7
|
+
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
8
|
+
import { join, dirname } from 'node:path';
|
|
9
|
+
import { randomUUID } from 'node:crypto';
|
|
10
|
+
import { CodeAgent } from './agents/code-agent.js';
|
|
11
|
+
import { MessageBus } from './message-bus.js';
|
|
12
|
+
// ── Build Verifier ───────────────────────────────────────────
|
|
13
|
+
export class BuildVerifier {
|
|
14
|
+
projectPath;
|
|
15
|
+
framework;
|
|
16
|
+
options;
|
|
17
|
+
constructor(projectPath, options) {
|
|
18
|
+
this.projectPath = projectPath;
|
|
19
|
+
this.framework = (options.framework ?? 'next.js').toLowerCase();
|
|
20
|
+
this.options = {
|
|
21
|
+
maxRepairAttempts: options.maxRepairAttempts,
|
|
22
|
+
installTimeoutMs: options.installTimeoutMs ?? 120_000,
|
|
23
|
+
buildTimeoutMs: options.buildTimeoutMs ?? 120_000,
|
|
24
|
+
startStabilityMs: options.startStabilityMs ?? 15_000,
|
|
25
|
+
healthCheckTimeoutMs: options.healthCheckTimeoutMs ?? 10_000,
|
|
26
|
+
healthCheckRetries: options.healthCheckRetries ?? 3,
|
|
27
|
+
codeModel: options.codeModel,
|
|
28
|
+
onReconcileDeps: options.onReconcileDeps,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** Run the full build-test-repair loop. */
|
|
32
|
+
async verify() {
|
|
33
|
+
const loopStart = Date.now();
|
|
34
|
+
const repairAttempts = [];
|
|
35
|
+
let lastInstall = null;
|
|
36
|
+
let lastBuild = null;
|
|
37
|
+
let lastStart = null;
|
|
38
|
+
let lastHealthCheck = null;
|
|
39
|
+
let allErrors = [];
|
|
40
|
+
for (let attempt = 0; attempt <= this.options.maxRepairAttempts; attempt++) {
|
|
41
|
+
allErrors = [];
|
|
42
|
+
// Step 1: npm install
|
|
43
|
+
lastInstall = await this.runInstall();
|
|
44
|
+
if (lastInstall.status === 'fail' || lastInstall.status === 'timeout') {
|
|
45
|
+
allErrors.push(...this.parseErrors(lastInstall.stderr + '\n' + lastInstall.stdout));
|
|
46
|
+
if (allErrors.length === 0) {
|
|
47
|
+
allErrors.push({ file: 'package.json', line: null, message: lastInstall.stderr.slice(0, 500) || 'npm install failed', category: 'dependency_error' });
|
|
48
|
+
}
|
|
49
|
+
if (attempt < this.options.maxRepairAttempts) {
|
|
50
|
+
const repairResult = await this.runRepair(attempt + 1, allErrors);
|
|
51
|
+
repairAttempts.push(repairResult);
|
|
52
|
+
if (!repairResult.repairSucceeded)
|
|
53
|
+
continue;
|
|
54
|
+
continue; // Retry from install
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
// Step 2: npm run build
|
|
59
|
+
lastBuild = await this.runBuild();
|
|
60
|
+
if (lastBuild.status === 'fail' || lastBuild.status === 'timeout') {
|
|
61
|
+
allErrors.push(...this.parseErrors(lastBuild.stderr + '\n' + lastBuild.stdout));
|
|
62
|
+
if (allErrors.length === 0) {
|
|
63
|
+
allErrors.push({ file: 'unknown', line: null, message: lastBuild.stderr.slice(0, 500) || 'Build failed', category: 'other' });
|
|
64
|
+
}
|
|
65
|
+
if (attempt < this.options.maxRepairAttempts) {
|
|
66
|
+
const repairResult = await this.runRepair(attempt + 1, allErrors);
|
|
67
|
+
repairAttempts.push(repairResult);
|
|
68
|
+
continue; // Retry from install
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
// Step 3: Start dev server and check stability
|
|
73
|
+
lastStart = await this.runStart();
|
|
74
|
+
if (lastStart.status === 'fail' || lastStart.status === 'timeout') {
|
|
75
|
+
allErrors.push(...this.parseErrors(lastStart.stderr + '\n' + lastStart.stdout));
|
|
76
|
+
if (allErrors.length === 0) {
|
|
77
|
+
allErrors.push({ file: 'unknown', line: null, message: lastStart.stderr.slice(0, 500) || 'Dev server failed to start', category: 'runtime_error' });
|
|
78
|
+
}
|
|
79
|
+
if (attempt < this.options.maxRepairAttempts) {
|
|
80
|
+
const repairResult = await this.runRepair(attempt + 1, allErrors);
|
|
81
|
+
repairAttempts.push(repairResult);
|
|
82
|
+
continue; // Retry from install
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
// Step 4: Health check
|
|
87
|
+
const port = this.detectPort();
|
|
88
|
+
lastHealthCheck = await this.runHealthCheck(port);
|
|
89
|
+
// If all steps pass, we're done
|
|
90
|
+
if (lastInstall.status === 'pass' && lastBuild.status === 'pass') {
|
|
91
|
+
const status = repairAttempts.length > 0 ? 'repaired' : 'pass';
|
|
92
|
+
return {
|
|
93
|
+
status,
|
|
94
|
+
install: lastInstall,
|
|
95
|
+
build: lastBuild,
|
|
96
|
+
start: lastStart,
|
|
97
|
+
healthCheck: lastHealthCheck,
|
|
98
|
+
repairAttempts,
|
|
99
|
+
finalErrors: [],
|
|
100
|
+
totalDurationMs: Date.now() - loopStart,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Max attempts exhausted or unrecoverable failure
|
|
105
|
+
return {
|
|
106
|
+
status: 'fail',
|
|
107
|
+
install: lastInstall,
|
|
108
|
+
build: lastBuild,
|
|
109
|
+
start: lastStart,
|
|
110
|
+
healthCheck: lastHealthCheck,
|
|
111
|
+
repairAttempts,
|
|
112
|
+
finalErrors: allErrors,
|
|
113
|
+
totalDurationMs: Date.now() - loopStart,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
// ── Build Steps ────────────────────────────────────────────
|
|
117
|
+
async runInstall() {
|
|
118
|
+
const start = Date.now();
|
|
119
|
+
const result = await this.execCommand('npm install', this.options.installTimeoutMs);
|
|
120
|
+
return {
|
|
121
|
+
step: 'install',
|
|
122
|
+
status: this.resultStatus(result),
|
|
123
|
+
command: 'npm install',
|
|
124
|
+
stdout: result.stdout.slice(0, 5000),
|
|
125
|
+
stderr: result.stderr.slice(0, 5000),
|
|
126
|
+
durationMs: Date.now() - start,
|
|
127
|
+
exitCode: result.exitCode,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
async runBuild() {
|
|
131
|
+
const start = Date.now();
|
|
132
|
+
// Check if build script exists
|
|
133
|
+
const hasBuild = await this.hasPkgScript('build');
|
|
134
|
+
if (!hasBuild) {
|
|
135
|
+
return {
|
|
136
|
+
step: 'build',
|
|
137
|
+
status: 'skip',
|
|
138
|
+
command: 'npm run build',
|
|
139
|
+
stdout: 'No build script in package.json',
|
|
140
|
+
stderr: '',
|
|
141
|
+
durationMs: 0,
|
|
142
|
+
exitCode: null,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const result = await this.execCommand('npm run build', this.options.buildTimeoutMs);
|
|
146
|
+
return {
|
|
147
|
+
step: 'build',
|
|
148
|
+
status: this.resultStatus(result),
|
|
149
|
+
command: 'npm run build',
|
|
150
|
+
stdout: result.stdout.slice(0, 5000),
|
|
151
|
+
stderr: result.stderr.slice(0, 5000),
|
|
152
|
+
durationMs: Date.now() - start,
|
|
153
|
+
exitCode: result.exitCode,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
async runStart() {
|
|
157
|
+
// For Electron apps, skip HTTP server spawn — run TypeScript compile check instead
|
|
158
|
+
if (this.framework.includes('electron')) {
|
|
159
|
+
return this.runElectronCompileCheck();
|
|
160
|
+
}
|
|
161
|
+
const start = Date.now();
|
|
162
|
+
const hasDev = await this.hasPkgScript('dev');
|
|
163
|
+
const hasStart = await this.hasPkgScript('start');
|
|
164
|
+
const script = hasDev ? 'dev' : hasStart ? 'start' : null;
|
|
165
|
+
if (!script) {
|
|
166
|
+
return {
|
|
167
|
+
step: 'start',
|
|
168
|
+
status: 'skip',
|
|
169
|
+
command: 'npm run dev',
|
|
170
|
+
stdout: 'No dev or start script in package.json',
|
|
171
|
+
stderr: '',
|
|
172
|
+
durationMs: 0,
|
|
173
|
+
exitCode: null,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
// Spawn the dev server and wait for stability
|
|
177
|
+
let serverProcess = null;
|
|
178
|
+
let stdout = '';
|
|
179
|
+
let stderr = '';
|
|
180
|
+
try {
|
|
181
|
+
serverProcess = spawn('npm', ['run', script], {
|
|
182
|
+
cwd: this.projectPath,
|
|
183
|
+
env: { ...process.env, NODE_ENV: 'development', BROWSER: 'none' },
|
|
184
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
185
|
+
detached: true,
|
|
186
|
+
});
|
|
187
|
+
serverProcess.stdout?.on('data', (data) => { stdout += data.toString(); });
|
|
188
|
+
serverProcess.stderr?.on('data', (data) => { stderr += data.toString(); });
|
|
189
|
+
// Wait for "Ready" indicator or stability period
|
|
190
|
+
const stable = await this.waitForReady(serverProcess, stdout, () => stdout, this.options.startStabilityMs);
|
|
191
|
+
return {
|
|
192
|
+
step: 'start',
|
|
193
|
+
status: stable ? 'pass' : 'fail',
|
|
194
|
+
command: `npm run ${script}`,
|
|
195
|
+
stdout: stdout.slice(0, 5000),
|
|
196
|
+
stderr: stderr.slice(0, 5000),
|
|
197
|
+
durationMs: Date.now() - start,
|
|
198
|
+
exitCode: stable ? 0 : 1,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
return {
|
|
203
|
+
step: 'start',
|
|
204
|
+
status: 'fail',
|
|
205
|
+
command: `npm run ${script}`,
|
|
206
|
+
stdout: stdout.slice(0, 5000),
|
|
207
|
+
stderr: (stderr + '\n' + (err instanceof Error ? err.message : String(err))).slice(0, 5000),
|
|
208
|
+
durationMs: Date.now() - start,
|
|
209
|
+
exitCode: 1,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
// Kill the dev server process tree
|
|
214
|
+
if (serverProcess?.pid) {
|
|
215
|
+
try {
|
|
216
|
+
process.kill(-serverProcess.pid, 'SIGTERM');
|
|
217
|
+
}
|
|
218
|
+
catch { /* already dead */ }
|
|
219
|
+
// Force kill after 2s
|
|
220
|
+
setTimeout(() => {
|
|
221
|
+
try {
|
|
222
|
+
process.kill(-serverProcess.pid, 'SIGKILL');
|
|
223
|
+
}
|
|
224
|
+
catch { /* already dead */ }
|
|
225
|
+
}, 2000);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/** Electron compile check — runs `npx tsc --noEmit` on the main process TypeScript. */
|
|
230
|
+
async runElectronCompileCheck() {
|
|
231
|
+
const start = Date.now();
|
|
232
|
+
const result = await this.execCommand('npx tsc --noEmit', this.options.buildTimeoutMs);
|
|
233
|
+
return {
|
|
234
|
+
step: 'start',
|
|
235
|
+
status: this.resultStatus(result),
|
|
236
|
+
command: 'npx tsc --noEmit',
|
|
237
|
+
stdout: result.stdout.slice(0, 5000),
|
|
238
|
+
stderr: result.stderr.slice(0, 5000),
|
|
239
|
+
durationMs: Date.now() - start,
|
|
240
|
+
exitCode: result.exitCode,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
async runHealthCheck(port) {
|
|
244
|
+
// For Electron apps, check that build outputs exist instead of HTTP fetch
|
|
245
|
+
if (this.framework.includes('electron')) {
|
|
246
|
+
return this.runElectronOutputCheck();
|
|
247
|
+
}
|
|
248
|
+
const start = Date.now();
|
|
249
|
+
for (let retry = 0; retry < this.options.healthCheckRetries; retry++) {
|
|
250
|
+
try {
|
|
251
|
+
const controller = new AbortController();
|
|
252
|
+
const timeout = setTimeout(() => controller.abort(), this.options.healthCheckTimeoutMs);
|
|
253
|
+
const response = await fetch(`http://localhost:${port}/`, {
|
|
254
|
+
signal: controller.signal,
|
|
255
|
+
});
|
|
256
|
+
clearTimeout(timeout);
|
|
257
|
+
if (response.ok || response.status < 500) {
|
|
258
|
+
return {
|
|
259
|
+
step: 'health_check',
|
|
260
|
+
status: 'pass',
|
|
261
|
+
command: `GET http://localhost:${port}/`,
|
|
262
|
+
stdout: `HTTP ${response.status} ${response.statusText}`,
|
|
263
|
+
stderr: '',
|
|
264
|
+
durationMs: Date.now() - start,
|
|
265
|
+
exitCode: 0,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
// Retry after delay
|
|
271
|
+
if (retry < this.options.healthCheckRetries - 1) {
|
|
272
|
+
await this.sleep(2000);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
step: 'health_check',
|
|
278
|
+
status: 'fail',
|
|
279
|
+
command: `GET http://localhost:${port}/`,
|
|
280
|
+
stdout: '',
|
|
281
|
+
stderr: `Health check failed after ${this.options.healthCheckRetries} retries`,
|
|
282
|
+
durationMs: Date.now() - start,
|
|
283
|
+
exitCode: 1,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
/** Electron output check — verify that dist/ or out/ build outputs exist. */
|
|
287
|
+
async runElectronOutputCheck() {
|
|
288
|
+
const start = Date.now();
|
|
289
|
+
const candidates = ['dist', 'out', 'build'];
|
|
290
|
+
const found = [];
|
|
291
|
+
for (const dir of candidates) {
|
|
292
|
+
try {
|
|
293
|
+
const { readdir: rd } = await import('node:fs/promises');
|
|
294
|
+
const entries = await rd(join(this.projectPath, dir));
|
|
295
|
+
if (entries.length > 0)
|
|
296
|
+
found.push(dir);
|
|
297
|
+
}
|
|
298
|
+
catch {
|
|
299
|
+
// Directory doesn't exist
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (found.length > 0) {
|
|
303
|
+
return {
|
|
304
|
+
step: 'health_check',
|
|
305
|
+
status: 'pass',
|
|
306
|
+
command: 'check build output directories',
|
|
307
|
+
stdout: `Build outputs found in: ${found.join(', ')}`,
|
|
308
|
+
stderr: '',
|
|
309
|
+
durationMs: Date.now() - start,
|
|
310
|
+
exitCode: 0,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
// If no build output dirs found but build passed, that's still OK for Electron
|
|
314
|
+
// (electron-vite may output differently)
|
|
315
|
+
return {
|
|
316
|
+
step: 'health_check',
|
|
317
|
+
status: 'skip',
|
|
318
|
+
command: 'check build output directories',
|
|
319
|
+
stdout: 'No dist/out/build directory found — skipping output check for Electron',
|
|
320
|
+
stderr: '',
|
|
321
|
+
durationMs: Date.now() - start,
|
|
322
|
+
exitCode: null,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
// ── Error Parsing ──────────────────────────────────────────
|
|
326
|
+
parseErrors(output) {
|
|
327
|
+
const errors = [];
|
|
328
|
+
const lines = output.split('\n');
|
|
329
|
+
for (const line of lines) {
|
|
330
|
+
// TypeScript errors: file(line,col): error TS####: message
|
|
331
|
+
const tsMatch = line.match(/^(.+?)\((\d+),\d+\):\s*error\s+TS\d+:\s*(.+)$/);
|
|
332
|
+
if (tsMatch) {
|
|
333
|
+
errors.push({ file: tsMatch[1], line: parseInt(tsMatch[2], 10), message: tsMatch[3], category: 'type_error' });
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
// TypeScript errors (alternative format): file:line:col - error TS####: message
|
|
337
|
+
const tsMatch2 = line.match(/^(.+?):(\d+):\d+\s*-\s*error\s+TS\d+:\s*(.+)$/);
|
|
338
|
+
if (tsMatch2) {
|
|
339
|
+
errors.push({ file: tsMatch2[1], line: parseInt(tsMatch2[2], 10), message: tsMatch2[3], category: 'type_error' });
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
// Next.js / Webpack module not found
|
|
343
|
+
const moduleMatch = line.match(/Module not found:\s*(?:Can't resolve|Error:\s*Can't resolve)\s*'([^']+)'/);
|
|
344
|
+
if (moduleMatch) {
|
|
345
|
+
errors.push({ file: 'package.json', line: null, message: `Module not found: '${moduleMatch[1]}'`, category: 'module_not_found' });
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
// SyntaxError
|
|
349
|
+
const syntaxMatch = line.match(/SyntaxError:\s*(.+)/);
|
|
350
|
+
if (syntaxMatch) {
|
|
351
|
+
errors.push({ file: 'unknown', line: null, message: syntaxMatch[1], category: 'syntax_error' });
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
// npm ERR! with dependency info
|
|
355
|
+
const npmErrMatch = line.match(/npm ERR!\s+(.+)/);
|
|
356
|
+
if (npmErrMatch && (line.includes('peer dep') || line.includes('ERESOLVE') || line.includes('could not resolve'))) {
|
|
357
|
+
errors.push({ file: 'package.json', line: null, message: npmErrMatch[1], category: 'dependency_error' });
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
// Generic Error:
|
|
361
|
+
const errorMatch = line.match(/^Error:\s*(.+)/);
|
|
362
|
+
if (errorMatch) {
|
|
363
|
+
errors.push({ file: 'unknown', line: null, message: errorMatch[1], category: 'other' });
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
// Deduplicate by message
|
|
368
|
+
const seen = new Set();
|
|
369
|
+
return errors.filter(e => {
|
|
370
|
+
const key = `${e.file}:${e.line}:${e.message}`;
|
|
371
|
+
if (seen.has(key))
|
|
372
|
+
return false;
|
|
373
|
+
seen.add(key);
|
|
374
|
+
return true;
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
// ── Repair via CodeAgent ───────────────────────────────────
|
|
378
|
+
async runRepair(attempt, errors) {
|
|
379
|
+
const repairStart = Date.now();
|
|
380
|
+
const filesModified = [];
|
|
381
|
+
// Group errors by file
|
|
382
|
+
const errorsByFile = new Map();
|
|
383
|
+
for (const error of errors) {
|
|
384
|
+
const existing = errorsByFile.get(error.file) ?? [];
|
|
385
|
+
existing.push(error);
|
|
386
|
+
errorsByFile.set(error.file, existing);
|
|
387
|
+
}
|
|
388
|
+
// Read failing file contents
|
|
389
|
+
const fileContents = [];
|
|
390
|
+
for (const [filePath, fileErrors] of errorsByFile) {
|
|
391
|
+
if (filePath === 'unknown' || filePath === 'package.json') {
|
|
392
|
+
fileContents.push({ path: filePath, content: '', errors: fileErrors });
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
try {
|
|
396
|
+
const absPath = filePath.startsWith('/') ? filePath : join(this.projectPath, filePath);
|
|
397
|
+
const content = await readFile(absPath, 'utf-8');
|
|
398
|
+
fileContents.push({ path: filePath, content, errors: fileErrors });
|
|
399
|
+
}
|
|
400
|
+
catch {
|
|
401
|
+
fileContents.push({ path: filePath, content: '(file not readable)', errors: fileErrors });
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
// Build the repair goal
|
|
405
|
+
const errorSummary = fileContents.map(fc => {
|
|
406
|
+
const errLines = fc.errors.map(e => ` - ${e.category}: ${e.message}${e.line ? ` (line ${e.line})` : ''}`).join('\n');
|
|
407
|
+
return `File: ${fc.path}\nErrors:\n${errLines}\n${fc.content ? `Current content:\n\`\`\`\n${fc.content.slice(0, 3000)}\n\`\`\`` : ''}`;
|
|
408
|
+
}).join('\n\n---\n\n');
|
|
409
|
+
// Also read package.json for context
|
|
410
|
+
let pkgJson = '';
|
|
411
|
+
try {
|
|
412
|
+
pkgJson = await readFile(join(this.projectPath, 'package.json'), 'utf-8');
|
|
413
|
+
}
|
|
414
|
+
catch { /* no package.json */ }
|
|
415
|
+
const repairGoal = `Fix these build errors in a generated application. Return corrected files.
|
|
416
|
+
|
|
417
|
+
Attempt ${attempt} of ${this.options.maxRepairAttempts}.
|
|
418
|
+
|
|
419
|
+
Build errors found:
|
|
420
|
+
${errorSummary}
|
|
421
|
+
|
|
422
|
+
${pkgJson ? `package.json:\n\`\`\`json\n${pkgJson.slice(0, 2000)}\n\`\`\`` : ''}
|
|
423
|
+
|
|
424
|
+
Fix ALL errors. If a module is not found, either fix the import or add the dependency. If there are type errors, fix the types. Return the complete corrected file contents.`;
|
|
425
|
+
const messageBus = new MessageBus();
|
|
426
|
+
const codeAgent = new CodeAgent(messageBus, { model: this.options.codeModel });
|
|
427
|
+
try {
|
|
428
|
+
const result = await codeAgent.executeTask({
|
|
429
|
+
taskId: `repair-${attempt}-${randomUUID().slice(0, 8)}`,
|
|
430
|
+
goal: repairGoal,
|
|
431
|
+
constraints: ['Fix build errors only — do not add new features or refactor working code.'],
|
|
432
|
+
dependencies: [],
|
|
433
|
+
contextRefs: [],
|
|
434
|
+
});
|
|
435
|
+
if (result.status === 'failed') {
|
|
436
|
+
return {
|
|
437
|
+
attempt,
|
|
438
|
+
errors,
|
|
439
|
+
filesModified: [],
|
|
440
|
+
repairSucceeded: false,
|
|
441
|
+
durationMs: Date.now() - repairStart,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
// Write repaired files to disk
|
|
445
|
+
let touchedPackageJson = false;
|
|
446
|
+
for (const artifact of result.artifacts) {
|
|
447
|
+
if (!artifact.path)
|
|
448
|
+
continue;
|
|
449
|
+
const absPath = join(this.projectPath, artifact.path);
|
|
450
|
+
try {
|
|
451
|
+
await mkdir(dirname(absPath), { recursive: true });
|
|
452
|
+
await writeFile(absPath, artifact.content, 'utf-8');
|
|
453
|
+
filesModified.push(artifact.path);
|
|
454
|
+
if (artifact.path === 'package.json' || artifact.path.endsWith('/package.json')) {
|
|
455
|
+
touchedPackageJson = true;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
catch {
|
|
459
|
+
// Best-effort write
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
// Re-reconcile deps if package.json was touched
|
|
463
|
+
if (touchedPackageJson && this.options.onReconcileDeps) {
|
|
464
|
+
await this.options.onReconcileDeps();
|
|
465
|
+
}
|
|
466
|
+
return {
|
|
467
|
+
attempt,
|
|
468
|
+
errors,
|
|
469
|
+
filesModified,
|
|
470
|
+
repairSucceeded: filesModified.length > 0,
|
|
471
|
+
durationMs: Date.now() - repairStart,
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
catch {
|
|
475
|
+
return {
|
|
476
|
+
attempt,
|
|
477
|
+
errors,
|
|
478
|
+
filesModified: [],
|
|
479
|
+
repairSucceeded: false,
|
|
480
|
+
durationMs: Date.now() - repairStart,
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
// ── Process Helpers ────────────────────────────────────────
|
|
485
|
+
execCommand(command, timeoutMs) {
|
|
486
|
+
return new Promise((resolve) => {
|
|
487
|
+
exec(command, {
|
|
488
|
+
cwd: this.projectPath,
|
|
489
|
+
timeout: timeoutMs,
|
|
490
|
+
maxBuffer: 10 * 1024 * 1024, // 10MB
|
|
491
|
+
env: { ...process.env, NODE_ENV: 'development', CI: 'true' },
|
|
492
|
+
}, (error, stdout, stderr) => {
|
|
493
|
+
const timedOut = error?.killed === true;
|
|
494
|
+
resolve({
|
|
495
|
+
stdout: stdout ?? '',
|
|
496
|
+
stderr: stderr ?? '',
|
|
497
|
+
exitCode: timedOut ? null : (error?.code !== undefined ? (typeof error.code === 'number' ? error.code : 1) : 0),
|
|
498
|
+
timedOut,
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
waitForReady(proc, _initialStdout, getStdout, stabilityMs) {
|
|
504
|
+
return new Promise((resolve) => {
|
|
505
|
+
const readyPatterns = [
|
|
506
|
+
/ready/i,
|
|
507
|
+
/started.*on/i,
|
|
508
|
+
/listening.*on/i,
|
|
509
|
+
/compiled.*successfully/i,
|
|
510
|
+
/Local:\s+http/i,
|
|
511
|
+
];
|
|
512
|
+
let resolved = false;
|
|
513
|
+
const done = (result) => {
|
|
514
|
+
if (!resolved) {
|
|
515
|
+
resolved = true;
|
|
516
|
+
resolve(result);
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
// Check for ready pattern in output
|
|
520
|
+
const checkInterval = setInterval(() => {
|
|
521
|
+
const output = getStdout();
|
|
522
|
+
if (readyPatterns.some(p => p.test(output))) {
|
|
523
|
+
clearInterval(checkInterval);
|
|
524
|
+
clearTimeout(stabilityTimeout);
|
|
525
|
+
done(true);
|
|
526
|
+
}
|
|
527
|
+
}, 500);
|
|
528
|
+
// Timeout: if no ready pattern found, consider it a failure
|
|
529
|
+
const stabilityTimeout = setTimeout(() => {
|
|
530
|
+
clearInterval(checkInterval);
|
|
531
|
+
// If process is still running, it might be okay (just no ready message)
|
|
532
|
+
done(!proc.killed && proc.exitCode === null);
|
|
533
|
+
}, stabilityMs);
|
|
534
|
+
// Process exit = failure
|
|
535
|
+
proc.on('exit', (code) => {
|
|
536
|
+
clearInterval(checkInterval);
|
|
537
|
+
clearTimeout(stabilityTimeout);
|
|
538
|
+
done(code === 0);
|
|
539
|
+
});
|
|
540
|
+
proc.on('error', () => {
|
|
541
|
+
clearInterval(checkInterval);
|
|
542
|
+
clearTimeout(stabilityTimeout);
|
|
543
|
+
done(false);
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
resultStatus(result) {
|
|
548
|
+
if (result.timedOut)
|
|
549
|
+
return 'timeout';
|
|
550
|
+
if (result.exitCode === 0)
|
|
551
|
+
return 'pass';
|
|
552
|
+
return 'fail';
|
|
553
|
+
}
|
|
554
|
+
async hasPkgScript(name) {
|
|
555
|
+
try {
|
|
556
|
+
const pkg = JSON.parse(await readFile(join(this.projectPath, 'package.json'), 'utf-8'));
|
|
557
|
+
return typeof pkg.scripts?.[name] === 'string';
|
|
558
|
+
}
|
|
559
|
+
catch {
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
detectPort() {
|
|
564
|
+
// Default Next.js port
|
|
565
|
+
return 3000;
|
|
566
|
+
}
|
|
567
|
+
sleep(ms) {
|
|
568
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
//# sourceMappingURL=build-verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-verifier.js","sourceRoot":"","sources":["../../src/runtime/build-verifier.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,6DAA6D;AAC7D,qEAAqE;AACrE,kEAAkE;AAClE,+DAA+D;AAE/D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAiC9C,gEAAgE;AAEhE,MAAM,OAAO,aAAa;IAChB,WAAW,CAAS;IACpB,SAAS,CAAS;IAClB,OAAO,CAGb;IAEF,YAAY,WAAmB,EAAE,OAA6B;QAC5D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,CAA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