@tritard/waterbrother 0.12.0 → 0.12.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 +24 -7
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -5012,10 +5012,12 @@ async function promptLoop(agent, session, context) {
|
|
|
5012
5012
|
// Product builder intake: detect "I want a recipe app" in any mode
|
|
5013
5013
|
if (detectProductRequest(line)) {
|
|
5014
5014
|
const intent = parseProductIntent(line);
|
|
5015
|
-
const spinner = createProgressSpinner("understanding your product...");
|
|
5016
5015
|
|
|
5016
|
+
// Extract everything from the request — no interactive prompts (stdin is unreliable on Windows)
|
|
5017
|
+
// Users can be specific: "I want a mobile recipe app, clean style, deploy to vercel"
|
|
5018
|
+
// Or minimal: "I want a recipe app" — LLM infers the rest
|
|
5019
|
+
const spinner = createProgressSpinner("building your blueprint...");
|
|
5017
5020
|
try {
|
|
5018
|
-
// Ask the model to extract product details via structured JSON
|
|
5019
5021
|
const { createJsonCompletion } = await import("./grok-client.js");
|
|
5020
5022
|
const model = context.runtime.plannerModel || agent.getModel();
|
|
5021
5023
|
const completion = await createJsonCompletion({
|
|
@@ -5023,18 +5025,18 @@ async function promptLoop(agent, session, context) {
|
|
|
5023
5025
|
baseUrl: context.runtime.baseUrl,
|
|
5024
5026
|
model,
|
|
5025
5027
|
messages: [
|
|
5026
|
-
{ role: "system", content: `You are a product strategist. Extract a product brief from the user's request. Respond with JSON only:
|
|
5028
|
+
{ role: "system", content: `You are a product strategist. Extract a complete product brief from the user's request. Infer anything not stated. Respond with JSON only:
|
|
5027
5029
|
{
|
|
5028
5030
|
"name": "short product name",
|
|
5029
5031
|
"description": "one-sentence description",
|
|
5030
5032
|
"audience": "who is this for",
|
|
5031
|
-
"type": "web|mobile|api
|
|
5032
|
-
"surfaces": ["Landing", "Login", "Dashboard"
|
|
5033
|
+
"type": "web|mobile|api",
|
|
5034
|
+
"surfaces": ["Landing", "Login", "Dashboard"],
|
|
5033
5035
|
"stack": { "framework": "Next.js", "styling": "Tailwind", "backend": "Supabase", "auth": "email", "deploy": "Vercel" },
|
|
5034
5036
|
"taste": "visual style in 3-5 words",
|
|
5035
5037
|
"features": ["feature 1", "feature 2"]
|
|
5036
5038
|
}
|
|
5037
|
-
|
|
5039
|
+
Be concrete about surfaces — name actual pages/flows. Choose the best stack for the request. Default to web if not specified.` },
|
|
5038
5040
|
{ role: "user", content: line }
|
|
5039
5041
|
],
|
|
5040
5042
|
temperature: 0.3
|
|
@@ -5058,7 +5060,7 @@ Infer reasonable defaults. Keep it practical.` },
|
|
|
5058
5060
|
applyTemplate(product, templateType);
|
|
5059
5061
|
}
|
|
5060
5062
|
|
|
5061
|
-
// Fill in
|
|
5063
|
+
// Fill in from brief + answers
|
|
5062
5064
|
if (brief.stack) {
|
|
5063
5065
|
product.stack = { ...product.stack, ...brief.stack };
|
|
5064
5066
|
}
|
|
@@ -5186,6 +5188,21 @@ Infer reasonable defaults. Keep it practical.` },
|
|
|
5186
5188
|
return true;
|
|
5187
5189
|
}
|
|
5188
5190
|
|
|
5191
|
+
// Mode transitions: builder ↔ cockpit
|
|
5192
|
+
if (/^(show me the code|show code|view code|drop into code|engineering mode|cockpit)$/.test(lower)) {
|
|
5193
|
+
agent.setExperienceMode("expert");
|
|
5194
|
+
console.log("switched to expert mode — cockpit active");
|
|
5195
|
+
console.log(dim("use /feature to start a structured task, or type what to work on"));
|
|
5196
|
+
updatePanel();
|
|
5197
|
+
return true;
|
|
5198
|
+
}
|
|
5199
|
+
if (/^(back to builder|builder mode|just build|product mode|guide mode)$/.test(lower)) {
|
|
5200
|
+
agent.setExperienceMode("guide");
|
|
5201
|
+
console.log("switched to guide mode — product builder active");
|
|
5202
|
+
console.log(generateBlueprint(product));
|
|
5203
|
+
return true;
|
|
5204
|
+
}
|
|
5205
|
+
|
|
5189
5206
|
if (/^(adjust|change|modify)$/.test(lower)) {
|
|
5190
5207
|
console.log(generateBlueprint(product));
|
|
5191
5208
|
console.log("\nDescribe what to adjust (e.g. 'add a settings page' or 'change auth to Google')");
|