@tritard/waterbrother 0.15.1 → 0.15.2
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/package.json +1 -1
- package/src/cli.js +25 -5
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -5377,7 +5377,7 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
5377
5377
|
agent.toolRuntime.setAutonomyMode("auto");
|
|
5378
5378
|
|
|
5379
5379
|
// Phase 1: Scaffold foundation (package.json, config, shared components)
|
|
5380
|
-
const scaffoldPrompt = `${productCtx}\n\nFirst, set up the project foundation:\n1. Create package.json with all dependencies\n2. Create
|
|
5380
|
+
const scaffoldPrompt = `${productCtx}\n\nFirst, set up the project foundation:\n1. Create package.json with all dependencies\n2. Create the app/ directory and app/layout.tsx and app/page.tsx\n3. Create config files (tailwind.config.js, next.config.js, postcss.config.js, tsconfig.json)\n4. Create app/globals.css with Tailwind directives\n5. Run npm install\n\nIMPORTANT: You MUST use write_file to create each file. Do not just describe what to create — actually create the files using the write_file tool. Every file must be written to disk.\n\nDo NOT build individual page components yet — just the skeleton that compiles and runs.`;
|
|
5381
5381
|
|
|
5382
5382
|
spinner.setLabel("scaffolding...");
|
|
5383
5383
|
await agent.runTurn(scaffoldPrompt, {
|
|
@@ -5391,7 +5391,7 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
5391
5391
|
for (let i = 0; i < planned.length; i++) {
|
|
5392
5392
|
const surface = planned[i];
|
|
5393
5393
|
spinner.setLabel(`building ${surface} (${i + 1}/${planned.length})...`);
|
|
5394
|
-
const surfacePrompt = `${productCtx}\n\nBuild the "${surface}" page/flow. Create all components needed for this surface. Make it complete and polished — real content, proper styling, working interactions. Follow the product's style: ${product.qualityBar.taste || "clean and modern"}.`;
|
|
5394
|
+
const surfacePrompt = `${productCtx}\n\nBuild the "${surface}" page/flow. Create all components needed for this surface. Make it complete and polished — real content, proper styling, working interactions. Follow the product's style: ${product.qualityBar.taste || "clean and modern"}.\n\nIMPORTANT: You MUST use write_file to create each file. Do not describe or explain — use the write_file tool to actually write every file to disk. If a directory doesn't exist, create it first with make_directory.`;
|
|
5395
5395
|
await agent.runTurn(surfacePrompt, {
|
|
5396
5396
|
onAssistantDelta() {},
|
|
5397
5397
|
onToolStart(tc) { spinner.setLabel(`${surface}: ${tc?.function?.name || "tool"}...`); },
|
|
@@ -5414,9 +5414,29 @@ Be concrete about surfaces — name actual pages/flows. Choose the best stack fo
|
|
|
5414
5414
|
}
|
|
5415
5415
|
} catch {}
|
|
5416
5416
|
|
|
5417
|
-
// Mark surfaces as built
|
|
5418
|
-
|
|
5419
|
-
|
|
5417
|
+
// Mark surfaces as built — but only if files actually exist
|
|
5418
|
+
const { readdir } = await import("node:fs/promises");
|
|
5419
|
+
let hasFiles = false;
|
|
5420
|
+
try {
|
|
5421
|
+
const entries = await readdir(path.join(context.cwd, "app"), { recursive: true });
|
|
5422
|
+
hasFiles = entries.some((e) => e.endsWith(".tsx") || e.endsWith(".jsx") || e.endsWith(".ts") || e.endsWith(".js"));
|
|
5423
|
+
} catch {
|
|
5424
|
+
try {
|
|
5425
|
+
const entries = await readdir(path.join(context.cwd, "src"), { recursive: true });
|
|
5426
|
+
hasFiles = entries.some((e) => e.endsWith(".tsx") || e.endsWith(".jsx") || e.endsWith(".ts") || e.endsWith(".js"));
|
|
5427
|
+
} catch {
|
|
5428
|
+
try {
|
|
5429
|
+
const entries = await readdir(path.join(context.cwd, "pages"), { recursive: true });
|
|
5430
|
+
hasFiles = entries.length > 0;
|
|
5431
|
+
} catch {}
|
|
5432
|
+
}
|
|
5433
|
+
}
|
|
5434
|
+
if (hasFiles) {
|
|
5435
|
+
for (const s of product.surfaces) {
|
|
5436
|
+
s.status = "built";
|
|
5437
|
+
}
|
|
5438
|
+
} else {
|
|
5439
|
+
console.log(yellow("warning: no source files detected — surfaces may not have been written to disk"));
|
|
5420
5440
|
}
|
|
5421
5441
|
await saveProduct(context.cwd, product);
|
|
5422
5442
|
|