@tritard/waterbrother 0.15.13 → 0.15.15
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 +33 -6
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -5780,14 +5780,41 @@ async function promptLoop(agent, session, context) {
|
|
|
5780
5780
|
}
|
|
5781
5781
|
|
|
5782
5782
|
async function handleNaturalInput(line) {
|
|
5783
|
-
// Product builder intake:
|
|
5783
|
+
// Product builder intake: detect creation intent, ask permission before oneshotting
|
|
5784
5784
|
const currentMode = agent.getExperienceMode();
|
|
5785
|
-
if (detectProductRequest(line)
|
|
5786
|
-
|
|
5785
|
+
if (detectProductRequest(line)) {
|
|
5786
|
+
// Ask: oneshot or work through it?
|
|
5787
|
+
console.log(dim(" oneshot it → blueprint + build in one go"));
|
|
5788
|
+
console.log(dim(" work through it → start coding naturally"));
|
|
5789
|
+
let choice = "";
|
|
5790
|
+
try {
|
|
5791
|
+
choice = await readInteractiveLine({
|
|
5792
|
+
getFooterText() { return "oneshot · work through it"; }
|
|
5793
|
+
});
|
|
5794
|
+
choice = (choice || "").trim().toLowerCase().replace(/[.!?,;:]+$/, "");
|
|
5795
|
+
} catch {
|
|
5796
|
+
return false;
|
|
5797
|
+
}
|
|
5787
5798
|
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5799
|
+
const isOneshot = /^(oneshot|one.?shot|blueprint|yes|go|build|do it|sure|yep|ok|okay|1)$/.test(choice);
|
|
5800
|
+
if (!isOneshot) {
|
|
5801
|
+
// User said no — don't auto-act. Respond conversationally and ask what they want.
|
|
5802
|
+
const prevTools = agent.enableTools;
|
|
5803
|
+
agent.enableTools = false;
|
|
5804
|
+
try {
|
|
5805
|
+
await runTextTurnInteractive({
|
|
5806
|
+
agent, currentSession, context,
|
|
5807
|
+
promptText: `The user wants to make something: "${line}" — but they want to talk through it first, not jump into building. Ask what kind of app, who it's for, and what features they care about. Be conversational. Do NOT use any tools or create any files.`,
|
|
5808
|
+
pendingInput: line,
|
|
5809
|
+
spinnerLabel: "thinking..."
|
|
5810
|
+
});
|
|
5811
|
+
} finally {
|
|
5812
|
+
agent.enableTools = prevTools;
|
|
5813
|
+
}
|
|
5814
|
+
return true;
|
|
5815
|
+
}
|
|
5816
|
+
|
|
5817
|
+
const intent = parseProductIntent(line);
|
|
5791
5818
|
const spinner = createProgressSpinner("building your blueprint...");
|
|
5792
5819
|
try {
|
|
5793
5820
|
const { createJsonCompletion } = await import("./model-client.js");
|