@tritard/waterbrother 0.6.4 → 0.6.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +31 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Waterbrother: Grok-powered coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -4244,6 +4244,9 @@ async function promptLoop(agent, session, context) {
4244
4244
 
4245
4245
  try {
4246
4246
  if (routed.kind === "start-work") {
4247
+ // Only auto-create tasks in expert mode. Standard/guide = CC mode (straight to model).
4248
+ const mode = agent.getExperienceMode();
4249
+ if (mode !== "expert") return false;
4247
4250
  const task = await ensureTaskFromNaturalInput(line);
4248
4251
  await runNaturalDecision({ task, goal: line, invent: false });
4249
4252
  return true;
@@ -5893,22 +5896,34 @@ async function promptLoop(agent, session, context) {
5893
5896
  continue;
5894
5897
  }
5895
5898
 
5896
- // Chat fallback: router returned false (chat/unhandled) send to model without tools
5897
- const prevTools = agent.enableTools;
5898
- agent.enableTools = false;
5899
- try {
5900
- await runTextTurnInteractive({
5901
- agent,
5902
- currentSession,
5903
- context,
5904
- promptText: line,
5905
- pendingInput: line,
5906
- spinnerLabel: "thinking..."
5907
- });
5908
- } catch (error) {
5909
- console.log(`request failed: ${error instanceof Error ? error.message : String(error)}`);
5910
- } finally {
5911
- agent.enableTools = prevTools;
5899
+ // Fallback: no active task = CC mode (tools on), active task = chat (tools off for safety)
5900
+ const hasTask = Boolean(context.runtime.activeTask);
5901
+ const isCasual = /^(hey|hi|hello|sup|yo|what'?s ?up|thanks|thank you|thx|bye|goodbye|lol|haha|ok|okay|sure|nah|nope|yep|cool|nice|bruh|dude|how are you|good morning|good night|i feel|i think|i like|i love|i hate|i want|i need|i wish|that'?s? (great|cool|nice|interesting|funny|weird|sad|good|bad|awesome))\b/i.test(line.trim());
5902
+ if (isCasual) {
5903
+ const prevTools = agent.enableTools;
5904
+ agent.enableTools = false;
5905
+ try {
5906
+ await runTextTurnInteractive({
5907
+ agent, currentSession, context,
5908
+ promptText: line, pendingInput: line,
5909
+ spinnerLabel: "thinking..."
5910
+ });
5911
+ } catch (error) {
5912
+ console.log(`request failed: ${error instanceof Error ? error.message : String(error)}`);
5913
+ } finally {
5914
+ agent.enableTools = prevTools;
5915
+ }
5916
+ } else {
5917
+ // Full tool access — CC mode
5918
+ try {
5919
+ await runTextTurnInteractive({
5920
+ agent, currentSession, context,
5921
+ promptText: line, pendingInput: line,
5922
+ spinnerLabel: "thinking..."
5923
+ });
5924
+ } catch (error) {
5925
+ console.log(`request failed: ${error instanceof Error ? error.message : String(error)}`);
5926
+ }
5912
5927
  }
5913
5928
  }
5914
5929