very-happy-cli 0.2.144 → 0.2.146

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 (49) hide show
  1. package/dist/{AcpBackend-DLsPpWnc.mjs → AcpBackend--1XmtY13.mjs} +2 -2
  2. package/dist/{AcpBackend-DssrjZDS.cjs → AcpBackend-D4J-b7TB.cjs} +2 -2
  3. package/dist/{AcpSessionManager-DkBV80Rr.cjs → AcpSessionManager-BUh-XYb7.cjs} +1 -1
  4. package/dist/{AcpSessionManager-1pAH8SdV.mjs → AcpSessionManager-BXHAABP5.mjs} +1 -1
  5. package/dist/{agentGuidance-D1PDVswF.cjs → agentGuidance-BI4l2HRo.cjs} +1 -1
  6. package/dist/{agentGuidance-CupQ9Lve.mjs → agentGuidance-BL1SZ7I3.mjs} +1 -1
  7. package/dist/{agentHome-BaSxP7lQ.mjs → agentHome-BdFP00V7.mjs} +2 -2
  8. package/dist/{agentHome-uf1zs2Fi.cjs → agentHome-Ck-uqSJ2.cjs} +2 -2
  9. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  10. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  11. package/dist/{config-CxHoQo52.mjs → config-1MpGxQ9y.mjs} +4 -4
  12. package/dist/{config-kx4y9oAI.cjs → config-CpY7JwBj.cjs} +4 -4
  13. package/dist/{index-Dox9iD5R.cjs → index-BDts8AaI.cjs} +7 -7
  14. package/dist/{index-DIoSNgtt.cjs → index-BEpwCxqf.cjs} +4 -4
  15. package/dist/{index-Dn0JMM8l.cjs → index-BRygi44L.cjs} +94 -42
  16. package/dist/{index-DxEaiVzX.mjs → index-BnkxOdPZ.mjs} +4 -4
  17. package/dist/{index-Diu81aSC.mjs → index-GZ--m9D1.mjs} +90 -38
  18. package/dist/{index-J6a8OHS6.mjs → index-k5Q1BYVe.mjs} +8 -8
  19. package/dist/index.cjs +4 -4
  20. package/dist/index.mjs +4 -4
  21. package/dist/{installTerminalHooks-BBMGk3q5.mjs → installTerminalHooks-BYMuFagt.mjs} +4 -4
  22. package/dist/{installTerminalHooks-De7_iOOC.cjs → installTerminalHooks-CcDZxqew.cjs} +4 -4
  23. package/dist/lib.cjs +2 -2
  24. package/dist/lib.mjs +2 -2
  25. package/dist/{limits-C_Sklt--.cjs → limits-Cs9ZqLsR.cjs} +7 -7
  26. package/dist/{limits-DxArdmkZ.mjs → limits-DNPVbu0o.mjs} +7 -7
  27. package/dist/{mcp-xyb8dYIQ.cjs → mcp-B0SoNWuQ.cjs} +4 -4
  28. package/dist/{mcp-C1oNnlw5.mjs → mcp-BtuzLwSL.mjs} +4 -4
  29. package/dist/{piRuntime-3Vbdgv6X.cjs → piRuntime-C52DKuoS.cjs} +2 -2
  30. package/dist/{piRuntime-CzJdE4z4.mjs → piRuntime-RzukAlha.mjs} +2 -2
  31. package/dist/{piTerminal-Do2GiKMN.mjs → piTerminal-BhHNN6o7.mjs} +6 -6
  32. package/dist/{piTerminal-BFpwVGWr.cjs → piTerminal-BjATNNi_.cjs} +6 -6
  33. package/dist/{runGemini-CCdGxTF2.cjs → runGemini-CSbocY0x.cjs} +6 -6
  34. package/dist/{runGemini-De5NRMT9.mjs → runGemini-H0nzGgAr.mjs} +6 -6
  35. package/dist/{runOpenClaw-CRMUfrWk.cjs → runOpenClaw-DTf27x3y.cjs} +5 -5
  36. package/dist/{runOpenClaw-C2t4DRyi.mjs → runOpenClaw-DgLSw9ye.mjs} +5 -5
  37. package/dist/{send-l6Rj09c0.mjs → send-B1xGe7BR.mjs} +4 -4
  38. package/dist/{send-BA1Dgpgn.cjs → send-D_gFbnUb.cjs} +4 -4
  39. package/dist/{sessions-MWLDqQk-.mjs → sessions-C_5xh0tc.mjs} +4 -4
  40. package/dist/{sessions-CtVcoXvG.cjs → sessions-DTef64KU.cjs} +4 -4
  41. package/dist/{spawn-Be4nsNuQ.cjs → spawn-CaClsWIZ.cjs} +4 -4
  42. package/dist/{spawn-DKWR-6Qc.mjs → spawn-jDF92zCE.mjs} +4 -4
  43. package/dist/{teams-DMf9GNGE.mjs → teams-BL-EFcfu.mjs} +4 -4
  44. package/dist/{teams-CcjjNLi8.cjs → teams-CA6BHcPk.cjs} +4 -4
  45. package/dist/{todo-EffYAnre.cjs → todo-B-CAD9Y3.cjs} +3 -3
  46. package/dist/{todo-BEXZRm1A.mjs → todo-DxNoHaPw.mjs} +3 -3
  47. package/dist/{types-DZ5c-9f3.cjs → types-CgOMSh1y.cjs} +1 -1
  48. package/dist/{types-D6YKR7wo.mjs → types-DjB5fcAr.mjs} +1 -1
  49. package/package.json +7 -7
@@ -1,8 +1,8 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { ndJsonStream, ClientSideConnection } from '@agentclientprotocol/sdk';
3
3
  import { randomUUID } from 'node:crypto';
4
- import { l as logger, p as packageJson } from './limits-DxArdmkZ.mjs';
5
- import { t as contentLogMetadata, q as errorLogMetadata, u as delay } from './types-D6YKR7wo.mjs';
4
+ import { l as logger, p as packageJson } from './limits-DNPVbu0o.mjs';
5
+ import { t as contentLogMetadata, q as errorLogMetadata, u as delay } from './types-DjB5fcAr.mjs';
6
6
 
7
7
  function acpImageBlocks(attachments, supportsImages) {
8
8
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -3,8 +3,8 @@
3
3
  var node_child_process = require('node:child_process');
4
4
  var sdk = require('@agentclientprotocol/sdk');
5
5
  var node_crypto = require('node:crypto');
6
- var persistence = require('./limits-C_Sklt--.cjs');
7
- var index = require('./types-DZ5c-9f3.cjs');
6
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
7
+ var index = require('./types-CgOMSh1y.cjs');
8
8
 
9
9
  function acpImageBlocks(attachments, supportsImages) {
10
10
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
- var index = require('./types-DZ5c-9f3.cjs');
4
+ var index = require('./types-CgOMSh1y.cjs');
5
5
 
6
6
  function turnOptions(turnId, time) {
7
7
  return turnId ? { turn: turnId, time } : { time };
@@ -1,5 +1,5 @@
1
1
  import { createId } from '@paralleldrive/cuid2';
2
- import { f as streamKeyOf, g as createEnvelope } from './types-D6YKR7wo.mjs';
2
+ import { f as streamKeyOf, g as createEnvelope } from './types-DjB5fcAr.mjs';
3
3
 
4
4
  function turnOptions(turnId, time) {
5
5
  return turnId ? { turn: turnId, time } : { time };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var z = require('zod');
4
4
  var node_crypto = require('node:crypto');
5
- var persistence = require('./limits-C_Sklt--.cjs');
5
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
6
6
  var promises = require('node:fs/promises');
7
7
  var node_fs = require('node:fs');
8
8
  var path = require('node:path');
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { randomUUID } from 'node:crypto';
3
- import { n as normalizeHttpEndpoint, c as configuration, r as readSettings, d as readPersistedSessions, e as readCredentialsForConfiguredRelay } from './limits-DxArdmkZ.mjs';
3
+ import { n as normalizeHttpEndpoint, c as configuration, r as readSettings, d as readPersistedSessions, e as readCredentialsForConfiguredRelay } from './limits-DNPVbu0o.mjs';
4
4
  import { open, mkdir, rename, unlink } from 'node:fs/promises';
5
5
  import { constants } from 'node:fs';
6
6
  import { isAbsolute, join, dirname } from 'node:path';
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
2
  import { homedir } from 'node:os';
3
- import { r as readSettings, u as updateSettings } from './limits-DxArdmkZ.mjs';
3
+ import { r as readSettings, u as updateSettings } from './limits-DNPVbu0o.mjs';
4
4
  import 'node:fs';
5
- import { d as describeAgentHome, p as probeLoginShellEnv, r as resolveAgentHomes, e as expandHomePath, b as AGENT_HOME_ENV_NAMES } from './types-D6YKR7wo.mjs';
5
+ import { d as describeAgentHome, p as probeLoginShellEnv, r as resolveAgentHomes, e as expandHomePath, b as AGENT_HOME_ENV_NAMES } from './types-DjB5fcAr.mjs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:path';
8
8
  import 'zod';
@@ -2,9 +2,9 @@
2
2
 
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
- var persistence = require('./limits-C_Sklt--.cjs');
5
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
6
6
  require('node:fs');
7
- var index = require('./types-DZ5c-9f3.cjs');
7
+ var index = require('./types-CgOMSh1y.cjs');
8
8
  require('node:fs/promises');
9
9
  require('node:path');
10
10
  require('zod');
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var agentGuidance = require('../agentGuidance-D1PDVswF.cjs');
3
+ var agentGuidance = require('../agentGuidance-BI4l2HRo.cjs');
4
4
  var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
5
5
  var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
6
6
  var index_js = require('@modelcontextprotocol/sdk/client/index.js');
7
7
  var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
8
8
  var z = require('zod');
9
- var persistence = require('../limits-C_Sklt--.cjs');
9
+ var persistence = require('../limits-Cs9ZqLsR.cjs');
10
10
  require('node:crypto');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
@@ -1,10 +1,10 @@
1
- import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-CupQ9Lve.mjs';
1
+ import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-BL1SZ7I3.mjs';
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
5
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
6
  import { z } from 'zod';
7
- import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-DxArdmkZ.mjs';
7
+ import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-DNPVbu0o.mjs';
8
8
  import 'node:crypto';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
@@ -2,8 +2,8 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { homedir } from 'os';
4
4
  import { execSync } from 'child_process';
5
- import { l as logger } from './limits-DxArdmkZ.mjs';
6
- import { g as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-Diu81aSC.mjs';
5
+ import { l as logger } from './limits-DNPVbu0o.mjs';
6
+ import { g as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-GZ--m9D1.mjs';
7
7
  import 'node:fs/promises';
8
8
  import 'node:fs';
9
9
  import 'node:os';
@@ -13,7 +13,7 @@ import 'node:crypto';
13
13
  import 'tweetnacl';
14
14
  import 'chalk';
15
15
  import 'node:util';
16
- import './types-D6YKR7wo.mjs';
16
+ import './types-DjB5fcAr.mjs';
17
17
  import 'axios';
18
18
  import 'node:events';
19
19
  import 'socket.io-client';
@@ -29,7 +29,7 @@ import 'node-pty';
29
29
  import 'node:readline';
30
30
  import '@anthropic-ai/sandbox-runtime';
31
31
  import 'expo-server-sdk';
32
- import './agentGuidance-CupQ9Lve.mjs';
32
+ import './agentGuidance-BL1SZ7I3.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import '@anthropic-ai/claude-agent-sdk';
@@ -4,8 +4,8 @@ var fs = require('fs');
4
4
  var path = require('path');
5
5
  var os = require('os');
6
6
  var child_process = require('child_process');
7
- var persistence = require('./limits-C_Sklt--.cjs');
8
- var index = require('./index-Dn0JMM8l.cjs');
7
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
8
+ var index = require('./index-BRygi44L.cjs');
9
9
  require('node:fs/promises');
10
10
  require('node:fs');
11
11
  require('node:os');
@@ -15,7 +15,7 @@ require('node:crypto');
15
15
  require('tweetnacl');
16
16
  require('chalk');
17
17
  require('node:util');
18
- require('./types-DZ5c-9f3.cjs');
18
+ require('./types-CgOMSh1y.cjs');
19
19
  require('axios');
20
20
  require('node:events');
21
21
  require('socket.io-client');
@@ -31,7 +31,7 @@ require('node-pty');
31
31
  require('node:readline');
32
32
  require('@anthropic-ai/sandbox-runtime');
33
33
  require('expo-server-sdk');
34
- require('./agentGuidance-D1PDVswF.cjs');
34
+ require('./agentGuidance-BI4l2HRo.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('@anthropic-ai/claude-agent-sdk');
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var AcpBackend = require('./AcpBackend-DssrjZDS.cjs');
4
- var persistence = require('./limits-C_Sklt--.cjs');
5
- var AcpSessionManager = require('./AcpSessionManager-DkBV80Rr.cjs');
6
- var index = require('./types-DZ5c-9f3.cjs');
7
- var index$1 = require('./index-Dn0JMM8l.cjs');
8
- var piRuntime = require('./piRuntime-3Vbdgv6X.cjs');
3
+ var AcpBackend = require('./AcpBackend-D4J-b7TB.cjs');
4
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
5
+ var AcpSessionManager = require('./AcpSessionManager-BUh-XYb7.cjs');
6
+ var index = require('./types-CgOMSh1y.cjs');
7
+ var index$1 = require('./index-BRygi44L.cjs');
8
+ var piRuntime = require('./piRuntime-C52DKuoS.cjs');
9
9
  var node_crypto = require('node:crypto');
10
10
  var path = require('node:path');
11
11
  var projectPath = require('./projectPath-ChLhdOyt.cjs');
@@ -34,7 +34,7 @@ require('fs');
34
34
  require('node:readline');
35
35
  require('@anthropic-ai/sandbox-runtime');
36
36
  require('expo-server-sdk');
37
- require('./agentGuidance-D1PDVswF.cjs');
37
+ require('./agentGuidance-BI4l2HRo.cjs');
38
38
  require('ink');
39
39
  require('react');
40
40
  require('@anthropic-ai/claude-agent-sdk');
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Dn0JMM8l.cjs');
3
+ var index = require('./index-BRygi44L.cjs');
4
4
  var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
5
5
  require('chalk');
6
6
  require('node:os');
7
7
  require('node:crypto');
8
- require('./types-DZ5c-9f3.cjs');
8
+ require('./types-CgOMSh1y.cjs');
9
9
  require('axios');
10
- require('./limits-C_Sklt--.cjs');
10
+ require('./limits-Cs9ZqLsR.cjs');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
13
13
  require('node:path');
@@ -32,7 +32,7 @@ require('fs');
32
32
  require('node:readline');
33
33
  require('@anthropic-ai/sandbox-runtime');
34
34
  require('expo-server-sdk');
35
- require('./agentGuidance-D1PDVswF.cjs');
35
+ require('./agentGuidance-BI4l2HRo.cjs');
36
36
  require('ink');
37
37
  require('react');
38
38
  require('ps-list');
@@ -3,14 +3,14 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var node_crypto = require('node:crypto');
6
- var index = require('./types-DZ5c-9f3.cjs');
7
- var persistence = require('./limits-C_Sklt--.cjs');
6
+ var index = require('./types-CgOMSh1y.cjs');
7
+ var persistence = require('./limits-Cs9ZqLsR.cjs');
8
8
  var spawn = require('cross-spawn');
9
9
  var path = require('node:path');
10
10
  var node_readline = require('node:readline');
11
11
  var node_fs = require('node:fs');
12
12
  var projectPath = require('./projectPath-ChLhdOyt.cjs');
13
- var agentGuidance = require('./agentGuidance-D1PDVswF.cjs');
13
+ var agentGuidance = require('./agentGuidance-BI4l2HRo.cjs');
14
14
  var promises = require('node:fs/promises');
15
15
  var fs = require('fs/promises');
16
16
  var ink = require('ink');
@@ -5317,8 +5317,8 @@ ${typeLabels[type] || type}:`));
5317
5317
  }
5318
5318
  console.log(chalk.gray(" An external claude command is only needed for native terminal/mirror use."));
5319
5319
  try {
5320
- const { resolveAgentHomesForCli } = await Promise.resolve().then(function () { return require('./agentHome-uf1zs2Fi.cjs'); });
5321
- const { describeAgentHome } = await Promise.resolve().then(function () { return require('./types-DZ5c-9f3.cjs'); }).then(function (n) { return n.index; });
5320
+ const { resolveAgentHomesForCli } = await Promise.resolve().then(function () { return require('./agentHome-Ck-uqSJ2.cjs'); });
5321
+ const { describeAgentHome } = await Promise.resolve().then(function () { return require('./types-CgOMSh1y.cjs'); }).then(function (n) { return n.index; });
5322
5322
  const homes = await resolveAgentHomesForCli();
5323
5323
  console.log(chalk.green(`\u2713 Claude config dir: ${describeAgentHome(homes.claudeConfigDir)}`));
5324
5324
  console.log(chalk.green(`\u2713 Codex home: ${describeAgentHome(homes.codexHome)}`));
@@ -7998,7 +7998,7 @@ function parseJsonObject(text) {
7998
7998
  return null;
7999
7999
  }
8000
8000
  }
8001
- function resolveSdkClaudeBinary(platform = process.platform, arch = process.arch, resolver = (s) => node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn0JMM8l.cjs', document.baseURI).href))).resolve(s)) {
8001
+ function resolveSdkClaudeBinary(platform = process.platform, arch = process.arch, resolver = (s) => node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BRygi44L.cjs', document.baseURI).href))).resolve(s)) {
8002
8002
  const platformArch = `${platform}-${arch}`;
8003
8003
  const candidates = [
8004
8004
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -12299,13 +12299,27 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEve
12299
12299
  }
12300
12300
 
12301
12301
  const SIDE_QUESTION_SYSTEM_PROMPT = [
12302
- "This is a SIDE QUESTION from the user, asked next to the main conversation above.",
12303
- "Answer it directly in a single response, using the conversation context and your own knowledge.",
12304
- "Side questions cannot use tools: do not attempt to read files, run commands, or call tools \u2014 if",
12305
- "the answer would require that, say what you would check and why.",
12306
- "Do NOT continue, resume, or reference progress on the main task; the main conversation is",
12307
- "unaffected by this exchange."
12302
+ "A user message wrapped in a side-question system-reminder is a SIDE QUESTION: answer it",
12303
+ "directly in one response from the conversation context, with no tools and no action on the main task."
12308
12304
  ].join(" ");
12305
+ const SIDE_QUESTION_REMINDER = [
12306
+ "<system-reminder>This is a side question from the user. You must answer this question directly in a single response.",
12307
+ "",
12308
+ "IMPORTANT CONTEXT:",
12309
+ "- You are a separate, lightweight agent spawned to answer this one question",
12310
+ "- The main agent is NOT interrupted - it continues working independently in the background",
12311
+ "- You share the conversation context but are a completely separate instance",
12312
+ '- Do NOT reference being interrupted or what you were "previously doing" - that framing is incorrect',
12313
+ "",
12314
+ "CRITICAL CONSTRAINTS:",
12315
+ "- You have NO tools available - you cannot read files, run commands, search, or take any actions",
12316
+ "- This is a one-off response - there will be no follow-up turns",
12317
+ "- You can ONLY provide information based on what you already know from the conversation context",
12318
+ `- NEVER say things like "Let me try...", "I'll now...", "Let me check...", or promise to take any action`,
12319
+ "- If you don't know the answer, say so - do not offer to look it up or investigate",
12320
+ "",
12321
+ "Simply answer the question with the information you have.</system-reminder>"
12322
+ ].join("\n");
12309
12323
  const MAX_HISTORY_CHARS = 2e3;
12310
12324
  function clip(text, max) {
12311
12325
  return text.length > max ? `${text.slice(0, max)}\u2026` : text;
@@ -12313,14 +12327,17 @@ function clip(text, max) {
12313
12327
  function buildSideQuestionPrompt(question, history = []) {
12314
12328
  const trimmed = question.trim();
12315
12329
  const prior = history.filter((h) => h.question.trim() && h.answer.trim()).slice(-12);
12316
- if (prior.length === 0) return trimmed;
12330
+ const body = `${SIDE_QUESTION_REMINDER}
12331
+
12332
+ ${trimmed}`;
12333
+ if (prior.length === 0) return body;
12317
12334
  const lines = prior.map((h) => `Q: ${clip(h.question.trim(), MAX_HISTORY_CHARS)}
12318
12335
  A: ${clip(h.answer.trim(), MAX_HISTORY_CHARS)}`);
12319
12336
  return `<earlier-side-questions>
12320
12337
  ${lines.join("\n\n")}
12321
12338
  </earlier-side-questions>
12322
12339
 
12323
- ${trimmed}`;
12340
+ ${body}`;
12324
12341
  }
12325
12342
  function sideQuestionQueryOptions(input) {
12326
12343
  return {
@@ -12341,17 +12358,36 @@ function sideQuestionQueryOptions(input) {
12341
12358
  abort: input.signal
12342
12359
  };
12343
12360
  }
12344
- function textFromAssistant(message) {
12345
- if (message.type !== "assistant") return "";
12361
+ function assistantBlocks(message) {
12362
+ if (message.type !== "assistant") return [];
12346
12363
  const content = message.message?.content;
12347
- if (!Array.isArray(content)) return "";
12348
- return content.map((block) => block && typeof block === "object" && block.type === "text" ? String(block.text ?? "") : "").join("");
12364
+ return Array.isArray(content) ? content.filter((b) => Boolean(b) && typeof b === "object") : [];
12365
+ }
12366
+ function textFromAssistant(message) {
12367
+ return assistantBlocks(message).map((block) => block.type === "text" ? String(block.text ?? "") : "").join("");
12368
+ }
12369
+ function toolUseFromAssistant(message) {
12370
+ const block = assistantBlocks(message).find((b) => b.type === "tool_use");
12371
+ return block ? String(block.name ?? "a tool") : null;
12372
+ }
12373
+ function toolAttemptNotice(toolName) {
12374
+ return `(The model tried to call ${toolName} instead of answering directly. Try rephrasing or ask in the main conversation.)`;
12375
+ }
12376
+ function apiErrorFromSystem(message) {
12377
+ if (message.type !== "system") return null;
12378
+ const m = message;
12379
+ if (m.subtype !== "api_error") return null;
12380
+ if (typeof m.error === "string") return m.error;
12381
+ const detail = m.error?.formatted ?? m.error?.message;
12382
+ return typeof detail === "string" && detail ? detail : "API error";
12349
12383
  }
12350
12384
  async function runSideQuestion(query, input) {
12351
12385
  const options = sideQuestionQueryOptions(input);
12352
12386
  const stream = query({ prompt: buildSideQuestionPrompt(input.question, input.history), options });
12353
12387
  let streamed = "";
12354
12388
  let final = "";
12389
+ let toolAttempt = null;
12390
+ let lastApiError = null;
12355
12391
  let resultSeen = false;
12356
12392
  for await (const message of stream) {
12357
12393
  if (message.type === "stream_event") {
@@ -12370,20 +12406,31 @@ async function runSideQuestion(query, input) {
12370
12406
  ${text}` : text;
12371
12407
  input.onText?.(final);
12372
12408
  }
12409
+ toolAttempt ??= toolUseFromAssistant(message);
12410
+ continue;
12411
+ }
12412
+ if (message.type === "system") {
12413
+ lastApiError = apiErrorFromSystem(message) ?? lastApiError;
12373
12414
  continue;
12374
12415
  }
12375
12416
  if (message.type === "result") {
12376
12417
  resultSeen = true;
12377
12418
  const result = message;
12378
12419
  if (result.subtype !== "success") {
12379
- const detail = Array.isArray(result.errors) && result.errors.length > 0 ? String(result.errors[0]) : typeof result.result === "string" && result.result ? result.result : result.subtype ?? "unknown";
12420
+ if (toolAttempt && result.subtype === "error_max_turns") break;
12421
+ const detail = Array.isArray(result.errors) && result.errors.length > 0 ? String(result.errors[0]) : typeof result.result === "string" && result.result ? result.result : lastApiError ?? result.subtype ?? "unknown";
12380
12422
  throw new Error(`Side question failed: ${detail}`);
12381
12423
  }
12382
12424
  if (!final && typeof result.result === "string") final = result.result;
12383
12425
  }
12384
12426
  }
12385
12427
  if (input.signal?.aborted) throw new Error("Side question cancelled");
12386
- if (!resultSeen && !final && !streamed) throw new Error("Side question ended without a result");
12428
+ if (toolAttempt && !final.trim() && !streamed.trim()) {
12429
+ const notice = toolAttemptNotice(toolAttempt);
12430
+ input.onText?.(notice);
12431
+ return { answer: notice, hadContext: Boolean(input.resumeSessionId) };
12432
+ }
12433
+ if (!resultSeen && !final && !streamed) throw new Error(`Side question ended without a result${lastApiError ? `: ${lastApiError}` : ""}`);
12387
12434
  return { answer: final || streamed, hadContext: Boolean(input.resumeSessionId) };
12388
12435
  }
12389
12436
 
@@ -12410,7 +12457,7 @@ function registerSideQuestionHandler(rpc, deps) {
12410
12457
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12411
12458
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12412
12459
  const run = deps.run ?? (async (input) => {
12413
- const { query } = await Promise.resolve().then(function () { return require('./index-DIoSNgtt.cjs'); });
12460
+ const { query } = await Promise.resolve().then(function () { return require('./index-BEpwCxqf.cjs'); });
12414
12461
  return runSideQuestion(query, input);
12415
12462
  });
12416
12463
  const slots = /* @__PURE__ */ new Map();
@@ -12433,7 +12480,12 @@ function registerSideQuestionHandler(rpc, deps) {
12433
12480
  if (!question) throw new Error("Side question is empty");
12434
12481
  if (question.length > SIDE_QUESTION_MAX_CHARS) throw new Error("Side question is too long");
12435
12482
  prune();
12436
- if (active) throw new Error("A side question is already running");
12483
+ if (active) {
12484
+ const stale = active;
12485
+ stale.abort.abort("superseded");
12486
+ finish(stale, "cancelled");
12487
+ persistence.logger.debug(`[btw] side question ${stale.requestId} superseded by a new ask`);
12488
+ }
12437
12489
  const resumeSessionId = deps.getClaudeSessionId() ?? null;
12438
12490
  const slot = {
12439
12491
  requestId: node_crypto.randomUUID(),
@@ -12512,7 +12564,7 @@ const MAX_TITLE_CHARS = 60;
12512
12564
  const GENERATION_TIMEOUT_MS = 3e4;
12513
12565
  function resolveClaudeBinary() {
12514
12566
  try {
12515
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn0JMM8l.cjs', document.baseURI).href)));
12567
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BRygi44L.cjs', document.baseURI).href)));
12516
12568
  const utilsPath = path.resolve(path.join(projectPath.projectPath(), "scripts", "claude_version_utils.cjs"));
12517
12569
  const { getClaudeCliPath } = require$1(utilsPath);
12518
12570
  const path$1 = getClaudeCliPath();
@@ -14738,9 +14790,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
14738
14790
  };
14739
14791
  }
14740
14792
 
14741
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn0JMM8l.cjs', document.baseURI).href)));
14793
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BRygi44L.cjs', document.baseURI).href)));
14742
14794
  const __dirname$1 = path.dirname(__filename$1);
14743
- const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn0JMM8l.cjs', document.baseURI).href)));
14795
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-BRygi44L.cjs', document.baseURI).href)));
14744
14796
  const PRISMA_QUERY_ENGINE_FILES = {
14745
14797
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
14746
14798
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -17655,7 +17707,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17655
17707
  return;
17656
17708
  } else if (subcommand === "install-terminal-hooks") {
17657
17709
  try {
17658
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-De7_iOOC.cjs'); });
17710
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CcDZxqew.cjs'); });
17659
17711
  const command = parseTerminalHooksArgs(args.slice(1));
17660
17712
  if (command.action === "help") {
17661
17713
  console.log(TERMINAL_HOOKS_HELP);
@@ -17672,7 +17724,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17672
17724
  }
17673
17725
  } else if (subcommand === "agent-home") {
17674
17726
  try {
17675
- const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-uf1zs2Fi.cjs'); });
17727
+ const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-Ck-uqSJ2.cjs'); });
17676
17728
  await runAgentHomeCommand(parseAgentHomeArgs(args.slice(1)));
17677
17729
  process.exit(0);
17678
17730
  } catch (error) {
@@ -17681,7 +17733,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17681
17733
  }
17682
17734
  } else if (subcommand === "spawn") {
17683
17735
  try {
17684
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-Be4nsNuQ.cjs'); });
17736
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-CaClsWIZ.cjs'); });
17685
17737
  await handleSpawnCommand(args.slice(1));
17686
17738
  } catch (error) {
17687
17739
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17693,7 +17745,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17693
17745
  return;
17694
17746
  } else if (subcommand === "sessions") {
17695
17747
  try {
17696
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-CtVcoXvG.cjs'); });
17748
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-DTef64KU.cjs'); });
17697
17749
  await handleSessionsCommand(args.slice(1));
17698
17750
  } catch (error) {
17699
17751
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17705,7 +17757,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17705
17757
  return;
17706
17758
  } else if (subcommand === "send") {
17707
17759
  try {
17708
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-BA1Dgpgn.cjs'); });
17760
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-D_gFbnUb.cjs'); });
17709
17761
  await handleSendCommand(args.slice(1));
17710
17762
  } catch (error) {
17711
17763
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17811,9 +17863,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17811
17863
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17812
17864
  const projectId = args[3];
17813
17865
  try {
17814
- const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-kx4y9oAI.cjs'); });
17815
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-C_Sklt--.cjs'); }).then(function (n) { return n.persistence; });
17816
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-DZ5c-9f3.cjs'); }).then(function (n) { return n.api; });
17866
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-CpY7JwBj.cjs'); });
17867
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-Cs9ZqLsR.cjs'); }).then(function (n) { return n.persistence; });
17868
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-CgOMSh1y.cjs'); }).then(function (n) { return n.api; });
17817
17869
  let userEmail = void 0;
17818
17870
  try {
17819
17871
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17844,7 +17896,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17844
17896
  }
17845
17897
  if (geminiSubcommand === "project" && args[2] === "get") {
17846
17898
  try {
17847
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-kx4y9oAI.cjs'); });
17899
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-CpY7JwBj.cjs'); });
17848
17900
  const config = readGeminiLocalConfig();
17849
17901
  if (config.googleCloudProject) {
17850
17902
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17884,7 +17936,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17884
17936
  process.exit(0);
17885
17937
  }
17886
17938
  try {
17887
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CCdGxTF2.cjs'); });
17939
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CSbocY0x.cjs'); });
17888
17940
  let startedBy = void 0;
17889
17941
  for (let i = 1; i < args.length; i++) {
17890
17942
  if (args[i] === "--started-by") {
@@ -17907,7 +17959,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17907
17959
  } else if (subcommand === "pi") {
17908
17960
  if (args[1] === "--terminal") {
17909
17961
  try {
17910
- const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-BFpwVGWr.cjs'); });
17962
+ const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-BjATNNi_.cjs'); });
17911
17963
  process.exitCode = await runPiTerminal(args.slice(2));
17912
17964
  } catch (error) {
17913
17965
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17924,7 +17976,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17924
17976
  }
17925
17977
  };
17926
17978
  try {
17927
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-Dox9iD5R.cjs'); });
17979
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BDts8AaI.cjs'); });
17928
17980
  const parsed = parsePiRunnerArgs(args.slice(1));
17929
17981
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17930
17982
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17952,7 +18004,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17952
18004
  return;
17953
18005
  } else if (subcommand === "acp") {
17954
18006
  try {
17955
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-Dox9iD5R.cjs'); });
18007
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BDts8AaI.cjs'); });
17956
18008
  let startedBy = void 0;
17957
18009
  let verbose = false;
17958
18010
  const acpArgs = [];
@@ -17992,7 +18044,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17992
18044
  return;
17993
18045
  } else if (subcommand === "openclaw") {
17994
18046
  try {
17995
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-CRMUfrWk.cjs'); });
18047
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-DTf27x3y.cjs'); });
17996
18048
  let startedBy = void 0;
17997
18049
  let verbose = false;
17998
18050
  let gatewayUrl;
@@ -18043,7 +18095,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18043
18095
  return;
18044
18096
  } else if (subcommand === "todo") {
18045
18097
  try {
18046
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-EffYAnre.cjs'); });
18098
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-B-CAD9Y3.cjs'); });
18047
18099
  await handleTodoCommand(args.slice(1));
18048
18100
  } catch (error) {
18049
18101
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -18052,7 +18104,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18052
18104
  return;
18053
18105
  } else if (subcommand === "teams") {
18054
18106
  try {
18055
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-CcjjNLi8.cjs'); });
18107
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-CA6BHcPk.cjs'); });
18056
18108
  await handleTeamsCommand(args.slice(1));
18057
18109
  } catch (error) {
18058
18110
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -18061,7 +18113,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18061
18113
  return;
18062
18114
  } else if (subcommand === "mcp" && (args.length === 1 || args.length === 2 && args[1] === "--terminal-tools")) {
18063
18115
  try {
18064
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-xyb8dYIQ.cjs'); });
18116
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-B0SoNWuQ.cjs'); });
18065
18117
  await handleMcpCommand(args[1] === "--terminal-tools");
18066
18118
  } catch (error) {
18067
18119
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -1,11 +1,11 @@
1
- import { q as query } from './index-Diu81aSC.mjs';
1
+ import { q as query } from './index-GZ--m9D1.mjs';
2
2
  export { AbortError } from '@anthropic-ai/claude-agent-sdk';
3
3
  import 'chalk';
4
4
  import 'node:os';
5
5
  import 'node:crypto';
6
- import './types-D6YKR7wo.mjs';
6
+ import './types-DjB5fcAr.mjs';
7
7
  import 'axios';
8
- import './limits-DxArdmkZ.mjs';
8
+ import './limits-DNPVbu0o.mjs';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
11
11
  import 'node:path';
@@ -30,7 +30,7 @@ import 'fs';
30
30
  import 'node:readline';
31
31
  import '@anthropic-ai/sandbox-runtime';
32
32
  import 'expo-server-sdk';
33
- import './agentGuidance-CupQ9Lve.mjs';
33
+ import './agentGuidance-BL1SZ7I3.mjs';
34
34
  import 'ink';
35
35
  import 'react';
36
36
  import 'ps-list';