very-happy-cli 0.2.146 → 0.2.148

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 (51) hide show
  1. package/dist/{AcpBackend-D4J-b7TB.cjs → AcpBackend-BrM-mcjR.cjs} +2 -2
  2. package/dist/{AcpBackend--1XmtY13.mjs → AcpBackend-CrcdMnL6.mjs} +2 -2
  3. package/dist/{AcpSessionManager-BUh-XYb7.cjs → AcpSessionManager-CKhv-rBo.cjs} +1 -1
  4. package/dist/{AcpSessionManager-BXHAABP5.mjs → AcpSessionManager-DIafxIVU.mjs} +1 -1
  5. package/dist/{agentGuidance-BL1SZ7I3.mjs → agentGuidance-CR7rOQUF.mjs} +1 -1
  6. package/dist/{agentGuidance-BI4l2HRo.cjs → agentGuidance-gzl2qRkG.cjs} +1 -1
  7. package/dist/{agentHome-BdFP00V7.mjs → agentHome-CQrd95jc.mjs} +2 -2
  8. package/dist/{agentHome-Ck-uqSJ2.cjs → agentHome-Qh6SWyHx.cjs} +2 -2
  9. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  10. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  11. package/dist/{config-CpY7JwBj.cjs → config-CFSD65_X.cjs} +4 -4
  12. package/dist/{config-1MpGxQ9y.mjs → config-DkCS4663.mjs} +4 -4
  13. package/dist/{index-BRygi44L.cjs → index-C1OeYxxj.cjs} +85 -35
  14. package/dist/{index-k5Q1BYVe.mjs → index-C4JoaSCO.mjs} +8 -8
  15. package/dist/{index-BEpwCxqf.cjs → index-C_hZVtR-.cjs} +4 -4
  16. package/dist/{index-GZ--m9D1.mjs → index-Cobfu9V_.mjs} +81 -31
  17. package/dist/{index-BnkxOdPZ.mjs → index-eLVXOce3.mjs} +4 -4
  18. package/dist/{index-BDts8AaI.cjs → index-x5-N7ElS.cjs} +7 -7
  19. package/dist/index.cjs +4 -4
  20. package/dist/index.mjs +4 -4
  21. package/dist/{installTerminalHooks-CcDZxqew.cjs → installTerminalHooks-CuqhiAo9.cjs} +4 -4
  22. package/dist/{installTerminalHooks-BYMuFagt.mjs → installTerminalHooks-D9pIHXxU.mjs} +4 -4
  23. package/dist/lib.cjs +2 -2
  24. package/dist/lib.d.cts +10 -0
  25. package/dist/lib.d.mts +10 -0
  26. package/dist/lib.mjs +2 -2
  27. package/dist/{limits-DNPVbu0o.mjs → limits-BfYfA7tt.mjs} +7 -7
  28. package/dist/{limits-Cs9ZqLsR.cjs → limits-D364Cpe3.cjs} +7 -7
  29. package/dist/{mcp-B0SoNWuQ.cjs → mcp-B5ojE8_m.cjs} +4 -4
  30. package/dist/{mcp-BtuzLwSL.mjs → mcp-DTXsdDwc.mjs} +4 -4
  31. package/dist/{piRuntime-RzukAlha.mjs → piRuntime-BWEgqBHm.mjs} +2 -2
  32. package/dist/{piRuntime-C52DKuoS.cjs → piRuntime-CbSaG74b.cjs} +2 -2
  33. package/dist/{piTerminal-BjATNNi_.cjs → piTerminal-Bzremid-.cjs} +6 -6
  34. package/dist/{piTerminal-BhHNN6o7.mjs → piTerminal-CnS3TF7M.mjs} +6 -6
  35. package/dist/{runGemini-H0nzGgAr.mjs → runGemini-C13-aRss.mjs} +6 -6
  36. package/dist/{runGemini-CSbocY0x.cjs → runGemini-Ci6ULPA7.cjs} +6 -6
  37. package/dist/{runOpenClaw-DTf27x3y.cjs → runOpenClaw-D2DW9Umc.cjs} +5 -5
  38. package/dist/{runOpenClaw-DgLSw9ye.mjs → runOpenClaw-D4ABejEy.mjs} +5 -5
  39. package/dist/{send-D_gFbnUb.cjs → send-1hJXKzeP.cjs} +4 -4
  40. package/dist/{send-B1xGe7BR.mjs → send-D-9_jOIS.mjs} +4 -4
  41. package/dist/{sessions-C_5xh0tc.mjs → sessions-C9VwpMKY.mjs} +4 -4
  42. package/dist/{sessions-DTef64KU.cjs → sessions-DOrymTYB.cjs} +4 -4
  43. package/dist/{spawn-CaClsWIZ.cjs → spawn-B1IlltVe.cjs} +4 -4
  44. package/dist/{spawn-jDF92zCE.mjs → spawn-C4uID9JX.mjs} +4 -4
  45. package/dist/{teams-BL-EFcfu.mjs → teams-CCv46ebr.mjs} +4 -4
  46. package/dist/{teams-CA6BHcPk.cjs → teams-xIRGgxwJ.cjs} +4 -4
  47. package/dist/{todo-DxNoHaPw.mjs → todo-5QemH15n.mjs} +3 -3
  48. package/dist/{todo-B-CAD9Y3.cjs → todo-DrsOEfYU.cjs} +3 -3
  49. package/dist/{types-DjB5fcAr.mjs → types-CXF6tULJ.mjs} +113 -7
  50. package/dist/{types-CgOMSh1y.cjs → types-IU5nGuaQ.cjs} +113 -7
  51. package/package.json +7 -7
@@ -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-Cs9ZqLsR.cjs');
7
- var index = require('./types-CgOMSh1y.cjs');
6
+ var persistence = require('./limits-D364Cpe3.cjs');
7
+ var index = require('./types-IU5nGuaQ.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,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-DNPVbu0o.mjs';
5
- import { t as contentLogMetadata, q as errorLogMetadata, u as delay } from './types-DjB5fcAr.mjs';
4
+ import { l as logger, p as packageJson } from './limits-BfYfA7tt.mjs';
5
+ import { t as contentLogMetadata, q as errorLogMetadata, u as delay } from './types-CXF6tULJ.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) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
- var index = require('./types-CgOMSh1y.cjs');
4
+ var index = require('./types-IU5nGuaQ.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-DjB5fcAr.mjs';
2
+ import { f as streamKeyOf, g as createEnvelope } from './types-CXF6tULJ.mjs';
3
3
 
4
4
  function turnOptions(turnId, time) {
5
5
  return turnId ? { turn: turnId, time } : { time };
@@ -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-DNPVbu0o.mjs';
3
+ import { n as normalizeHttpEndpoint, c as configuration, r as readSettings, d as readPersistedSessions, e as readCredentialsForConfiguredRelay } from './limits-BfYfA7tt.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';
@@ -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-Cs9ZqLsR.cjs');
5
+ var persistence = require('./limits-D364Cpe3.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,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-DNPVbu0o.mjs';
3
+ import { r as readSettings, u as updateSettings } from './limits-BfYfA7tt.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-DjB5fcAr.mjs';
5
+ import { d as describeAgentHome, p as probeLoginShellEnv, r as resolveAgentHomes, e as expandHomePath, b as AGENT_HOME_ENV_NAMES } from './types-CXF6tULJ.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-Cs9ZqLsR.cjs');
5
+ var persistence = require('./limits-D364Cpe3.cjs');
6
6
  require('node:fs');
7
- var index = require('./types-CgOMSh1y.cjs');
7
+ var index = require('./types-IU5nGuaQ.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-BI4l2HRo.cjs');
3
+ var agentGuidance = require('../agentGuidance-gzl2qRkG.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-Cs9ZqLsR.cjs');
9
+ var persistence = require('../limits-D364Cpe3.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-BL1SZ7I3.mjs';
1
+ import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-CR7rOQUF.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-DNPVbu0o.mjs';
7
+ import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-BfYfA7tt.mjs';
8
8
  import 'node:crypto';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
@@ -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-Cs9ZqLsR.cjs');
8
- var index = require('./index-BRygi44L.cjs');
7
+ var persistence = require('./limits-D364Cpe3.cjs');
8
+ var index = require('./index-C1OeYxxj.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-CgOMSh1y.cjs');
18
+ require('./types-IU5nGuaQ.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-BI4l2HRo.cjs');
34
+ require('./agentGuidance-gzl2qRkG.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('@anthropic-ai/claude-agent-sdk');
@@ -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-DNPVbu0o.mjs';
6
- import { g as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-GZ--m9D1.mjs';
5
+ import { l as logger } from './limits-BfYfA7tt.mjs';
6
+ import { g as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-Cobfu9V_.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-DjB5fcAr.mjs';
16
+ import './types-CXF6tULJ.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-BL1SZ7I3.mjs';
32
+ import './agentGuidance-CR7rOQUF.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import '@anthropic-ai/claude-agent-sdk';
@@ -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-CgOMSh1y.cjs');
7
- var persistence = require('./limits-Cs9ZqLsR.cjs');
6
+ var index = require('./types-IU5nGuaQ.cjs');
7
+ var persistence = require('./limits-D364Cpe3.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-BI4l2HRo.cjs');
13
+ var agentGuidance = require('./agentGuidance-gzl2qRkG.cjs');
14
14
  var promises = require('node:fs/promises');
15
15
  var fs = require('fs/promises');
16
16
  var ink = require('ink');
@@ -167,6 +167,8 @@ class Session {
167
167
  lastAssistantSnippet;
168
168
  /** Live remote-query input sink. Absent in local mode and between SDK queries. */
169
169
  steerHandler = null;
170
+ /** B-482: the live remote Query's in-process side-question entry; null between Queries and in local mode. */
171
+ sideQuestionLive = null;
170
172
  /** Callbacks to be notified when session ID is found/changed */
171
173
  sessionFoundCallbacks = [];
172
174
  /** Keep alive interval reference for cleanup */
@@ -208,8 +210,14 @@ class Session {
208
210
  clearInterval(this.keepAliveInterval);
209
211
  this.sessionFoundCallbacks = [];
210
212
  this.steerHandler = null;
213
+ this.sideQuestionLive = null;
211
214
  persistence.logger.debug("[Session] Cleaned up resources");
212
215
  };
216
+ /** Register the current remote query's in-process side-question entry (B-482); null removes it. */
217
+ setSideQuestionLive = (live) => {
218
+ this.sideQuestionLive = live;
219
+ };
220
+ getSideQuestionLive = () => this.sideQuestionLive;
213
221
  /** Register the current remote query's Steer sink; null removes it. */
214
222
  setSteerHandler = (handler) => {
215
223
  this.steerHandler = handler;
@@ -2084,6 +2092,14 @@ async function claudeRemote(opts) {
2084
2092
  interrupt: async () => {
2085
2093
  await response.interrupt();
2086
2094
  },
2095
+ // `request` is the SDK's generic control-request sender (every typed
2096
+ // method wraps it); the public types omit `side_question`, the CLI
2097
+ // handles it. An abort on `signal` becomes control_cancel_request.
2098
+ sideQuestion: async (request, signal) => {
2099
+ const raw = await response.request({ subtype: "side_question", ...request }, { signal });
2100
+ const body = raw?.response;
2101
+ return body && typeof body === "object" ? body : { response: null };
2102
+ },
2087
2103
  steer: (message, nextMode) => {
2088
2104
  mode = { ...nextMode, model: mode.model };
2089
2105
  messages.push({
@@ -4234,6 +4250,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4234
4250
  onQueryReady: (q) => {
4235
4251
  runtimeControls.setQuery(q);
4236
4252
  turnSteering.setInterrupt(q.interrupt);
4253
+ session.setSideQuestionLive({ ask: q.sideQuestion, canControl: q.canControl });
4237
4254
  session.setSteerHandler(async (input) => {
4238
4255
  if (!modeGate.matches(input.mode)) return false;
4239
4256
  let message = input.message;
@@ -4330,6 +4347,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4330
4347
  runtimeControls.setQuery(null);
4331
4348
  turnSteering.reset();
4332
4349
  session.setSteerHandler(null);
4350
+ session.setSideQuestionLive(null);
4333
4351
  livePermissionModeHandler = null;
4334
4352
  permissionHandler.setPermissionModeUpdater(void 0);
4335
4353
  sdkToLogConverter.resetTransientState();
@@ -5317,8 +5335,8 @@ ${typeLabels[type] || type}:`));
5317
5335
  }
5318
5336
  console.log(chalk.gray(" An external claude command is only needed for native terminal/mirror use."));
5319
5337
  try {
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; });
5338
+ const { resolveAgentHomesForCli } = await Promise.resolve().then(function () { return require('./agentHome-Qh6SWyHx.cjs'); });
5339
+ const { describeAgentHome } = await Promise.resolve().then(function () { return require('./types-IU5nGuaQ.cjs'); }).then(function (n) { return n.index; });
5322
5340
  const homes = await resolveAgentHomesForCli();
5323
5341
  console.log(chalk.green(`\u2713 Claude config dir: ${describeAgentHome(homes.claudeConfigDir)}`));
5324
5342
  console.log(chalk.green(`\u2713 Codex home: ${describeAgentHome(homes.codexHome)}`));
@@ -7998,7 +8016,7 @@ function parseJsonObject(text) {
7998
8016
  return null;
7999
8017
  }
8000
8018
  }
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)) {
8019
+ 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-C1OeYxxj.cjs', document.baseURI).href))).resolve(s)) {
8002
8020
  const platformArch = `${platform}-${arch}`;
8003
8021
  const candidates = [
8004
8022
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -12298,6 +12316,23 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEve
12298
12316
  };
12299
12317
  }
12300
12318
 
12319
+ function isUnsupportedSideQuestionError(error) {
12320
+ const message = error instanceof Error ? error.message : String(error);
12321
+ return /unknown|unsupported|not supported|unrecognized|invalid.*subtype/i.test(message);
12322
+ }
12323
+ async function runSideQuestionLive(ask, input) {
12324
+ const history = (input.history ?? []).filter((h) => h.question.trim() && h.answer.trim()).slice(-12).map((h) => ({ question: clip(h.question.trim(), MAX_HISTORY_CHARS), response: clip(h.answer.trim(), MAX_HISTORY_CHARS) }));
12325
+ const result = await ask({ question: input.question.trim(), ...history.length ? { history } : {} }, input.signal);
12326
+ if (input.signal?.aborted) throw new Error("Side question cancelled");
12327
+ const text = typeof result?.response === "string" ? result.response : "";
12328
+ if (!text.trim()) throw new Error("Side question ended without a result");
12329
+ const fallback = result.refusal_fallback?.content;
12330
+ const answer = fallback ? `\u26A0 ${fallback}
12331
+
12332
+ ${text}` : text;
12333
+ input.onText?.(answer);
12334
+ return { answer, hadContext: true, mode: "live" };
12335
+ }
12301
12336
  const SIDE_QUESTION_SYSTEM_PROMPT = [
12302
12337
  "A user message wrapped in a side-question system-reminder is a SIDE QUESTION: answer it",
12303
12338
  "directly in one response from the conversation context, with no tools and no action on the main task."
@@ -12428,10 +12463,10 @@ ${text}` : text;
12428
12463
  if (toolAttempt && !final.trim() && !streamed.trim()) {
12429
12464
  const notice = toolAttemptNotice(toolAttempt);
12430
12465
  input.onText?.(notice);
12431
- return { answer: notice, hadContext: Boolean(input.resumeSessionId) };
12466
+ return { answer: notice, hadContext: Boolean(input.resumeSessionId), mode: "fork" };
12432
12467
  }
12433
12468
  if (!resultSeen && !final && !streamed) throw new Error(`Side question ended without a result${lastApiError ? `: ${lastApiError}` : ""}`);
12434
- return { answer: final || streamed, hadContext: Boolean(input.resumeSessionId) };
12469
+ return { answer: final || streamed, hadContext: Boolean(input.resumeSessionId), mode: "fork" };
12435
12470
  }
12436
12471
 
12437
12472
  const SIDE_QUESTION_RETAIN_MS = 5 * 6e4;
@@ -12456,10 +12491,20 @@ function registerSideQuestionHandler(rpc, deps) {
12456
12491
  const now = deps.now ?? (() => Date.now());
12457
12492
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12458
12493
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12459
- const run = deps.run ?? (async (input) => {
12460
- const { query } = await Promise.resolve().then(function () { return require('./index-BEpwCxqf.cjs'); });
12494
+ const fork = deps.run ?? (async (input) => {
12495
+ const { query } = await Promise.resolve().then(function () { return require('./index-C_hZVtR-.cjs'); });
12461
12496
  return runSideQuestion(query, input);
12462
12497
  });
12498
+ const run = async (input, live) => {
12499
+ if (!live) return fork(input);
12500
+ try {
12501
+ return await runSideQuestionLive(live.ask, input);
12502
+ } catch (error) {
12503
+ if (input.signal?.aborted || !isUnsupportedSideQuestionError(error)) throw error;
12504
+ persistence.logger.debug(`[btw] live side question unsupported by this CLI, forking instead: ${error instanceof Error ? error.message : String(error)}`);
12505
+ return fork(input);
12506
+ }
12507
+ };
12463
12508
  const slots = /* @__PURE__ */ new Map();
12464
12509
  let active = null;
12465
12510
  const prune = () => {
@@ -12486,6 +12531,8 @@ function registerSideQuestionHandler(rpc, deps) {
12486
12531
  finish(stale, "cancelled");
12487
12532
  persistence.logger.debug(`[btw] side question ${stale.requestId} superseded by a new ask`);
12488
12533
  }
12534
+ const candidate = deps.getLiveQuery?.() ?? null;
12535
+ const live = candidate && candidate.canControl() ? candidate : null;
12489
12536
  const resumeSessionId = deps.getClaudeSessionId() ?? null;
12490
12537
  const slot = {
12491
12538
  requestId: node_crypto.randomUUID(),
@@ -12496,7 +12543,7 @@ function registerSideQuestionHandler(rpc, deps) {
12496
12543
  };
12497
12544
  slots.set(slot.requestId, slot);
12498
12545
  active = slot;
12499
- persistence.logger.debug(`[btw] side question ${slot.requestId} start (context=${resumeSessionId ? "fork" : "none"})`);
12546
+ persistence.logger.debug(`[btw] side question ${slot.requestId} start (${live ? "live" : resumeSessionId ? "fork" : "no-context"})`);
12500
12547
  const deadline = setTimeout(() => {
12501
12548
  if (slot.status !== "running") return;
12502
12549
  slot.abort.abort("timeout");
@@ -12516,10 +12563,10 @@ function registerSideQuestionHandler(rpc, deps) {
12516
12563
  onText: (text) => {
12517
12564
  if (slot.status === "running") slot.text = text;
12518
12565
  }
12519
- }).then((result) => {
12566
+ }, live).then((result) => {
12520
12567
  slot.text = result.answer;
12521
12568
  finish(slot, "done");
12522
- persistence.logger.debug(`[btw] side question ${slot.requestId} done (${result.answer.length} chars)`);
12569
+ persistence.logger.debug(`[btw] side question ${slot.requestId} done (${result.mode ?? "fork"}, ${result.answer.length} chars)`);
12523
12570
  }).catch((error) => {
12524
12571
  const message = error instanceof Error ? error.message : String(error);
12525
12572
  if (slot.abort.signal.aborted) {
@@ -12529,7 +12576,7 @@ function registerSideQuestionHandler(rpc, deps) {
12529
12576
  persistence.logger.debug(`[btw] side question ${slot.requestId} failed: ${message}`);
12530
12577
  }
12531
12578
  }).finally(() => clearTimeout(deadline));
12532
- return { requestId: slot.requestId, hadContext: Boolean(resumeSessionId) };
12579
+ return { requestId: slot.requestId, hadContext: live ? true : Boolean(resumeSessionId), mode: live ? "live" : "fork" };
12533
12580
  });
12534
12581
  rpc.registerHandler("btw-poll", async (request) => {
12535
12582
  prune();
@@ -12564,7 +12611,7 @@ const MAX_TITLE_CHARS = 60;
12564
12611
  const GENERATION_TIMEOUT_MS = 3e4;
12565
12612
  function resolveClaudeBinary() {
12566
12613
  try {
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)));
12614
+ 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-C1OeYxxj.cjs', document.baseURI).href)));
12568
12615
  const utilsPath = path.resolve(path.join(projectPath.projectPath(), "scripts", "claude_version_utils.cjs"));
12569
12616
  const { getClaudeCliPath } = require$1(utilsPath);
12570
12617
  const path$1 = getClaudeCliPath();
@@ -13326,7 +13373,10 @@ async function runClaude(credentials, options = {}) {
13326
13373
  getModel: () => currentModel,
13327
13374
  cwd: workingDirectory,
13328
13375
  getEnv: () => options.claudeEnvVars,
13329
- settingsPath: writeSideQuestionSettingsFile(persistence.configuration.happyHomeDir)
13376
+ settingsPath: writeSideQuestionSettingsFile(persistence.configuration.happyHomeDir),
13377
+ // B-482: in remote mode the launcher parks the live Query's /btw entry
13378
+ // on the session while the Query is alive; local mode never sets it.
13379
+ getLiveQuery: () => currentSession?.getSideQuestionLive() ?? null
13330
13380
  });
13331
13381
  const resetCurrentModeDefaults = () => {
13332
13382
  currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
@@ -14790,9 +14840,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
14790
14840
  };
14791
14841
  }
14792
14842
 
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)));
14843
+ 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-C1OeYxxj.cjs', document.baseURI).href)));
14794
14844
  const __dirname$1 = path.dirname(__filename$1);
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)));
14845
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C1OeYxxj.cjs', document.baseURI).href)));
14796
14846
  const PRISMA_QUERY_ENGINE_FILES = {
14797
14847
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
14798
14848
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -17707,7 +17757,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17707
17757
  return;
17708
17758
  } else if (subcommand === "install-terminal-hooks") {
17709
17759
  try {
17710
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CcDZxqew.cjs'); });
17760
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CuqhiAo9.cjs'); });
17711
17761
  const command = parseTerminalHooksArgs(args.slice(1));
17712
17762
  if (command.action === "help") {
17713
17763
  console.log(TERMINAL_HOOKS_HELP);
@@ -17724,7 +17774,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17724
17774
  }
17725
17775
  } else if (subcommand === "agent-home") {
17726
17776
  try {
17727
- const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-Ck-uqSJ2.cjs'); });
17777
+ const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-Qh6SWyHx.cjs'); });
17728
17778
  await runAgentHomeCommand(parseAgentHomeArgs(args.slice(1)));
17729
17779
  process.exit(0);
17730
17780
  } catch (error) {
@@ -17733,7 +17783,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17733
17783
  }
17734
17784
  } else if (subcommand === "spawn") {
17735
17785
  try {
17736
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-CaClsWIZ.cjs'); });
17786
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-B1IlltVe.cjs'); });
17737
17787
  await handleSpawnCommand(args.slice(1));
17738
17788
  } catch (error) {
17739
17789
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17745,7 +17795,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17745
17795
  return;
17746
17796
  } else if (subcommand === "sessions") {
17747
17797
  try {
17748
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-DTef64KU.cjs'); });
17798
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-DOrymTYB.cjs'); });
17749
17799
  await handleSessionsCommand(args.slice(1));
17750
17800
  } catch (error) {
17751
17801
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17757,7 +17807,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17757
17807
  return;
17758
17808
  } else if (subcommand === "send") {
17759
17809
  try {
17760
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-D_gFbnUb.cjs'); });
17810
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-1hJXKzeP.cjs'); });
17761
17811
  await handleSendCommand(args.slice(1));
17762
17812
  } catch (error) {
17763
17813
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17863,9 +17913,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17863
17913
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17864
17914
  const projectId = args[3];
17865
17915
  try {
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; });
17916
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-CFSD65_X.cjs'); });
17917
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-D364Cpe3.cjs'); }).then(function (n) { return n.persistence; });
17918
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-IU5nGuaQ.cjs'); }).then(function (n) { return n.api; });
17869
17919
  let userEmail = void 0;
17870
17920
  try {
17871
17921
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17896,7 +17946,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17896
17946
  }
17897
17947
  if (geminiSubcommand === "project" && args[2] === "get") {
17898
17948
  try {
17899
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-CpY7JwBj.cjs'); });
17949
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-CFSD65_X.cjs'); });
17900
17950
  const config = readGeminiLocalConfig();
17901
17951
  if (config.googleCloudProject) {
17902
17952
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17936,7 +17986,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17936
17986
  process.exit(0);
17937
17987
  }
17938
17988
  try {
17939
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CSbocY0x.cjs'); });
17989
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Ci6ULPA7.cjs'); });
17940
17990
  let startedBy = void 0;
17941
17991
  for (let i = 1; i < args.length; i++) {
17942
17992
  if (args[i] === "--started-by") {
@@ -17959,7 +18009,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17959
18009
  } else if (subcommand === "pi") {
17960
18010
  if (args[1] === "--terminal") {
17961
18011
  try {
17962
- const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-BjATNNi_.cjs'); });
18012
+ const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-Bzremid-.cjs'); });
17963
18013
  process.exitCode = await runPiTerminal(args.slice(2));
17964
18014
  } catch (error) {
17965
18015
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17976,7 +18026,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17976
18026
  }
17977
18027
  };
17978
18028
  try {
17979
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BDts8AaI.cjs'); });
18029
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-x5-N7ElS.cjs'); });
17980
18030
  const parsed = parsePiRunnerArgs(args.slice(1));
17981
18031
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17982
18032
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -18004,7 +18054,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18004
18054
  return;
18005
18055
  } else if (subcommand === "acp") {
18006
18056
  try {
18007
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BDts8AaI.cjs'); });
18057
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-x5-N7ElS.cjs'); });
18008
18058
  let startedBy = void 0;
18009
18059
  let verbose = false;
18010
18060
  const acpArgs = [];
@@ -18044,7 +18094,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18044
18094
  return;
18045
18095
  } else if (subcommand === "openclaw") {
18046
18096
  try {
18047
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-DTf27x3y.cjs'); });
18097
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-D2DW9Umc.cjs'); });
18048
18098
  let startedBy = void 0;
18049
18099
  let verbose = false;
18050
18100
  let gatewayUrl;
@@ -18095,7 +18145,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18095
18145
  return;
18096
18146
  } else if (subcommand === "todo") {
18097
18147
  try {
18098
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-B-CAD9Y3.cjs'); });
18148
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-DrsOEfYU.cjs'); });
18099
18149
  await handleTodoCommand(args.slice(1));
18100
18150
  } catch (error) {
18101
18151
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -18104,7 +18154,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18104
18154
  return;
18105
18155
  } else if (subcommand === "teams") {
18106
18156
  try {
18107
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-CA6BHcPk.cjs'); });
18157
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-xIRGgxwJ.cjs'); });
18108
18158
  await handleTeamsCommand(args.slice(1));
18109
18159
  } catch (error) {
18110
18160
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -18113,7 +18163,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18113
18163
  return;
18114
18164
  } else if (subcommand === "mcp" && (args.length === 1 || args.length === 2 && args[1] === "--terminal-tools")) {
18115
18165
  try {
18116
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-B0SoNWuQ.cjs'); });
18166
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-B5ojE8_m.cjs'); });
18117
18167
  await handleMcpCommand(args[1] === "--terminal-tools");
18118
18168
  } catch (error) {
18119
18169
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -1,10 +1,10 @@
1
- import { D as DefaultTransport, A as AcpBackend } from './AcpBackend--1XmtY13.mjs';
2
- export { a as DEFAULT_IDLE_TIMEOUT_MS, b as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, c as formatDurationMinutes, h as handleAgentMessageChunk, d as handleAgentThoughtChunk, g as handleLegacyMessageChunk, i as handlePlanUpdate, j as handleThinkingUpdate, k as handleToolCall, l as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend--1XmtY13.mjs';
3
- import { r as readSettings, g as encodeBase64, l as logger, c as configuration } from './limits-DNPVbu0o.mjs';
4
- import { A as AcpSessionManager } from './AcpSessionManager-BXHAABP5.mjs';
5
- import { m as connectionState, A as ApiClient, n as notifyDaemonSessionStarted, o as BUILTIN_TODO_DISCOVERY } from './types-DjB5fcAr.mjs';
6
- import { k as initialMachineMetadata, m as createSessionMetadata, n as setupOfflineReconnection, o as StreamRelay, p as MessageQueue2, u as hashObject, v as startHappyServer, x as registerAgentAttachmentDownloads, T as TitleGenerator, y as registerKillSessionHandler, C as CLAUDE_ATTACHMENT_KINDS, z as stageClaudeAttachments, B as appendStagedAttachmentsToPrompt, E as BasePermissionHandler, F as writeSessionModeFile, H as normalizeAcpPermissionMode, I as removeSessionModeFile } from './index-GZ--m9D1.mjs';
7
- import { p as preparePiTeamsRuntime } from './piRuntime-RzukAlha.mjs';
1
+ import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-CrcdMnL6.mjs';
2
+ export { a as DEFAULT_IDLE_TIMEOUT_MS, b as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, c as formatDurationMinutes, h as handleAgentMessageChunk, d as handleAgentThoughtChunk, g as handleLegacyMessageChunk, i as handlePlanUpdate, j as handleThinkingUpdate, k as handleToolCall, l as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend-CrcdMnL6.mjs';
3
+ import { r as readSettings, g as encodeBase64, l as logger, c as configuration } from './limits-BfYfA7tt.mjs';
4
+ import { A as AcpSessionManager } from './AcpSessionManager-DIafxIVU.mjs';
5
+ import { m as connectionState, A as ApiClient, n as notifyDaemonSessionStarted, o as BUILTIN_TODO_DISCOVERY } from './types-CXF6tULJ.mjs';
6
+ import { k as initialMachineMetadata, m as createSessionMetadata, n as setupOfflineReconnection, o as StreamRelay, p as MessageQueue2, u as hashObject, v as startHappyServer, x as registerAgentAttachmentDownloads, T as TitleGenerator, y as registerKillSessionHandler, C as CLAUDE_ATTACHMENT_KINDS, z as stageClaudeAttachments, B as appendStagedAttachmentsToPrompt, E as BasePermissionHandler, F as writeSessionModeFile, H as normalizeAcpPermissionMode, I as removeSessionModeFile } from './index-Cobfu9V_.mjs';
7
+ import { p as preparePiTeamsRuntime } from './piRuntime-BWEgqBHm.mjs';
8
8
  import { randomUUID } from 'node:crypto';
9
9
  import { join } from 'node:path';
10
10
  import { p as projectPath } from './projectPath-CSpqWdxp.mjs';
@@ -33,7 +33,7 @@ import 'fs';
33
33
  import 'node:readline';
34
34
  import '@anthropic-ai/sandbox-runtime';
35
35
  import 'expo-server-sdk';
36
- import './agentGuidance-BL1SZ7I3.mjs';
36
+ import './agentGuidance-CR7rOQUF.mjs';
37
37
  import 'ink';
38
38
  import 'react';
39
39
  import '@anthropic-ai/claude-agent-sdk';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BRygi44L.cjs');
3
+ var index = require('./index-C1OeYxxj.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-CgOMSh1y.cjs');
8
+ require('./types-IU5nGuaQ.cjs');
9
9
  require('axios');
10
- require('./limits-Cs9ZqLsR.cjs');
10
+ require('./limits-D364Cpe3.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-BI4l2HRo.cjs');
35
+ require('./agentGuidance-gzl2qRkG.cjs');
36
36
  require('ink');
37
37
  require('react');
38
38
  require('ps-list');