very-happy-cli 0.2.99 → 0.2.101

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 (33) hide show
  1. package/dist/{AcpBackend-DkvV2nhl.cjs → AcpBackend-BHst4DAF.cjs} +1 -1
  2. package/dist/{AcpBackend-C9LtzYSx.mjs → AcpBackend-mbMlyZnj.mjs} +1 -1
  3. package/dist/{AcpSessionManager-B5rJcE82.mjs → AcpSessionManager-CwdvDD_z.mjs} +1 -1
  4. package/dist/{AcpSessionManager-gsp_-PGy.cjs → AcpSessionManager-Nyxm1kCR.cjs} +1 -1
  5. package/dist/{config-BcCVR-Wx.mjs → config-C1Z39_GK.mjs} +2 -2
  6. package/dist/{config-Bidi0Yeq.cjs → config-DjtLOWRc.cjs} +2 -2
  7. package/dist/{index-B87z2DOo.mjs → index-3ssSAknz.mjs} +241 -15
  8. package/dist/{index-Wfds4scC.mjs → index-BL9LWtAR.mjs} +5 -5
  9. package/dist/index-BnVk_E3V.mjs +51 -0
  10. package/dist/{index-Dp1EYEyF.cjs → index-DemE8OgZ.cjs} +245 -18
  11. package/dist/index-DqA3-Xxl.cjs +57 -0
  12. package/dist/{index-CxdGnaov.cjs → index-tQZwyC3N.cjs} +4 -4
  13. package/dist/index.cjs +2 -2
  14. package/dist/index.mjs +2 -2
  15. package/dist/{installTerminalHooks-jaCruGfR.cjs → installTerminalHooks-BC9thC5_.cjs} +2 -2
  16. package/dist/{installTerminalHooks-DkOh088o.mjs → installTerminalHooks-BvYqvibn.mjs} +2 -2
  17. package/dist/lib.cjs +1 -1
  18. package/dist/lib.d.cts +6 -0
  19. package/dist/lib.d.mts +6 -0
  20. package/dist/lib.mjs +1 -1
  21. package/dist/{mcp-ZQbu8tL1.cjs → mcp-ChjpeHtZ.cjs} +2 -2
  22. package/dist/{mcp-DhftF_XE.mjs → mcp-D6qSHTLO.mjs} +2 -2
  23. package/dist/{runGemini-3-xWWBRA.mjs → runGemini-D1SFLnxb.mjs} +4 -4
  24. package/dist/{runGemini-Ce7Maf-D.cjs → runGemini-Dy7X7eDh.cjs} +4 -4
  25. package/dist/{runOpenClaw-DZhGhihh.mjs → runOpenClaw-AsjRz-Q3.mjs} +3 -3
  26. package/dist/{runOpenClaw-q3inEsDr.cjs → runOpenClaw-BpyEPSp5.cjs} +3 -3
  27. package/dist/{send-BdEJeVye.cjs → send-CvArl8UY.cjs} +2 -2
  28. package/dist/{send-B3NOqi9-.mjs → send-D1arw2mU.mjs} +2 -2
  29. package/dist/{spawn-DEVUh4iW.cjs → spawn-BYby4e76.cjs} +2 -2
  30. package/dist/{spawn-CCYAeBfN.mjs → spawn-D3k-ywKX.mjs} +2 -2
  31. package/dist/{types-DhxxJFD0.cjs → types-BEwKkfnX.cjs} +99 -37
  32. package/dist/{types-CrJj-daH.mjs → types-CkxTp9iI.mjs} +98 -36
  33. package/package.json +7 -7
@@ -3,7 +3,7 @@
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('./types-DhxxJFD0.cjs');
6
+ var persistence = require('./types-BEwKkfnX.cjs');
7
7
 
8
8
  const DEFAULT_TIMEOUTS = {
9
9
  /** Default initialization timeout: 60 seconds */
@@ -1,7 +1,7 @@
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, d as contentLogMetadata, e as errorLogMetadata, f as packageJson, g as delay } from './types-CrJj-daH.mjs';
4
+ import { l as logger, d as contentLogMetadata, e as errorLogMetadata, f as packageJson, g as delay } from './types-CkxTp9iI.mjs';
5
5
 
6
6
  const DEFAULT_TIMEOUTS = {
7
7
  /** Default initialization timeout: 60 seconds */
@@ -1,5 +1,5 @@
1
1
  import { createId } from '@paralleldrive/cuid2';
2
- import { b as createEnvelope } from './types-CrJj-daH.mjs';
2
+ import { b as createEnvelope } from './types-CkxTp9iI.mjs';
3
3
 
4
4
  function turnOptions(turnId, time) {
5
5
  return turnId ? { turn: turnId, time } : { time };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
- var persistence = require('./types-DhxxJFD0.cjs');
4
+ var persistence = require('./types-BEwKkfnX.cjs');
5
5
 
6
6
  function turnOptions(turnId, time) {
7
7
  return turnId ? { turn: turnId, time } : { time };
@@ -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 './types-CrJj-daH.mjs';
6
- import { D as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-B87z2DOo.mjs';
5
+ import { l as logger } from './types-CkxTp9iI.mjs';
6
+ import { D as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-3ssSAknz.mjs';
7
7
  import 'axios';
8
8
  import 'chalk';
9
9
  import 'node:util';
@@ -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('./types-DhxxJFD0.cjs');
8
- var index = require('./index-Dp1EYEyF.cjs');
7
+ var persistence = require('./types-BEwKkfnX.cjs');
8
+ var index = require('./index-DemE8OgZ.cjs');
9
9
  require('axios');
10
10
  require('chalk');
11
11
  require('node:util');
@@ -1,7 +1,7 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
2
  import os, { homedir, userInfo } from 'node:os';
3
3
  import { randomUUID, randomBytes, createHash as createHash$1, timingSafeEqual } from 'node:crypto';
4
- import { n as readDaemonState, l as logger, c as configuration, o as clearDaemonState, q as getProjectPath, p as projectPath, s as initializeSandbox, t as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, g as delay, u as AsyncLock, v as ensurePrivateDirectory, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, x as hardenPrivateFile, f as packageJson, i as readSettings, y as readCredentials, z as credentialRelayProblem, B as deriveLocalCliUpdateSummary, j as encodeBase64, C as updateSettings, D as encodeBase64Url, E as decodeBase64, F as writeCredentialsLegacy, G as writeCredentialsDataKey, H as readCredentialsForConfiguredRelay, J as encrypt, r as readPersistedSessions, K as isClaudeSessionId, L as getLocalHappyAgentCredentialPath, N as readLocalHappyAgentCredentials, O as decryptWithDataKey, P as decryptLegacy, Q as extractCompleteLines, S as decideBackfill, T as parseTerminalHookPayload, U as tmuxArgs, V as scrubTmuxClientEnv, W as decideMirrorBinding, X as MIRROR_BACKFILL_LINES_DEFAULT, Y as persistSession, Z as mirrorLineKey, _ as mirrorLocalId, w as writePrivateFileSync, $ as detectResumeSupport, a0 as detectCLIAvailability, a1 as acquireDaemonLock, a2 as summarizeSpawnSessionForLog, a3 as deletePersistedSessions, a4 as shellescape, a5 as decrypt, a6 as writeDaemonState, A as ApiClient, a7 as writeSettings, a8 as fetchCliUpdateState, a9 as resolveCliUpdateCheckInterval, aa as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, ab as releaseDaemonLock, ac as isValidSessionId, ad as listVhTerminals, ae as isValidTerminalId, af as readVhTerminal, ag as sendToVhTerminal, h as connectionState, ah as startOfflineReconnection, ai as clearCredentials, aj as clearMachineId, k as ensurePrivateDirectorySync, ak as SandboxConfigSchema, b as createEnvelope, al as CodexAppServerClient, am as getLatestDaemonLog } from './types-CrJj-daH.mjs';
4
+ import { n as readDaemonState, l as logger, c as configuration, o as clearDaemonState, q as getProjectPath, p as projectPath, s as initializeSandbox, t as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, g as delay, u as AsyncLock, v as ensurePrivateDirectory, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, x as hardenPrivateFile, f as packageJson, i as readSettings, y as readCredentials, z as credentialRelayProblem, B as deriveLocalCliUpdateSummary, j as encodeBase64, C as updateSettings, D as encodeBase64Url, E as decodeBase64, F as writeCredentialsLegacy, G as writeCredentialsDataKey, H as readCredentialsForConfiguredRelay, J as encrypt, r as readPersistedSessions, K as isClaudeSessionId, L as getLocalHappyAgentCredentialPath, N as readLocalHappyAgentCredentials, O as decryptWithDataKey, P as decryptLegacy, Q as extractCompleteLines, S as decideBackfill, T as parseTerminalHookPayload, U as tmuxArgs, V as scrubTmuxClientEnv, W as decideMirrorBinding, X as MIRROR_BACKFILL_LINES_DEFAULT, Y as persistSession, Z as mirrorLineKey, _ as mirrorLocalId, w as writePrivateFileSync, $ as detectResumeSupport, a0 as detectCLIAvailability, a1 as acquireDaemonLock, a2 as summarizeSpawnSessionForLog, a3 as deletePersistedSessions, a4 as shellescape, a5 as decrypt, a6 as writeDaemonState, A as ApiClient, a7 as writeSettings, a8 as fetchCliUpdateState, a9 as resolveCliUpdateCheckInterval, aa as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, ab as releaseDaemonLock, ac as isValidSessionId, ad as listVhTerminals, ae as isValidTerminalId, af as readVhTerminal, ag as sendToVhTerminal, h as connectionState, ah as startOfflineReconnection, ai as clearCredentials, aj as clearMachineId, k as ensurePrivateDirectorySync, ak as SandboxConfigSchema, b as createEnvelope, al as CodexAppServerClient, am as getLatestDaemonLog } from './types-CkxTp9iI.mjs';
5
5
  import spawn$1, { spawn } from 'cross-spawn';
6
6
  import path, { join, resolve, basename, delimiter, isAbsolute, normalize, sep, dirname } from 'node:path';
7
7
  import { createInterface } from 'node:readline';
@@ -1579,6 +1579,10 @@ function query(params) {
1579
1579
  strictMcpConfig: opts?.strictMcpConfig,
1580
1580
  sessionId: void 0,
1581
1581
  effort: opts?.effort,
1582
+ forkSession: opts?.forkSession,
1583
+ tools: opts?.tools,
1584
+ persistSession: opts?.persistSession,
1585
+ includePartialMessages: opts?.includePartialMessages,
1582
1586
  onElicitation: opts?.onElicitation,
1583
1587
  onUserDialog: opts?.onUserDialog,
1584
1588
  supportedDialogKinds: opts?.onUserDialog ? opts.supportedDialogKinds : void 0
@@ -1596,7 +1600,10 @@ function query(params) {
1596
1600
  for (const [key, value] of Object.entries(process.env)) {
1597
1601
  if (typeof value === "string") env[key] = value;
1598
1602
  }
1599
- env.CLAUDE_CODE_ENTRYPOINT = resolveHappyEntrypoint(process.env.CLAUDE_CODE_ENTRYPOINT);
1603
+ for (const [key, value] of Object.entries(opts?.env ?? {})) {
1604
+ if (typeof value === "string") env[key] = value;
1605
+ }
1606
+ env.CLAUDE_CODE_ENTRYPOINT = resolveHappyEntrypoint(env.CLAUDE_CODE_ENTRYPOINT);
1600
1607
  pinSmallFastModel(env);
1601
1608
  if (opts?.mcpServers && Object.keys(opts.mcpServers).length > 0) {
1602
1609
  ensureLocalProxyBypass(env);
@@ -9912,6 +9919,215 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEve
9912
9919
  });
9913
9920
  }
9914
9921
 
9922
+ const SIDE_QUESTION_SYSTEM_PROMPT = [
9923
+ "This is a SIDE QUESTION from the user, asked next to the main conversation above.",
9924
+ "Answer it directly in a single response, using the conversation context and your own knowledge.",
9925
+ "Side questions cannot use tools: do not attempt to read files, run commands, or call tools \u2014 if",
9926
+ "the answer would require that, say what you would check and why.",
9927
+ "Do NOT continue, resume, or reference progress on the main task; the main conversation is",
9928
+ "unaffected by this exchange."
9929
+ ].join(" ");
9930
+ const MAX_HISTORY_CHARS = 2e3;
9931
+ function clip(text, max) {
9932
+ return text.length > max ? `${text.slice(0, max)}\u2026` : text;
9933
+ }
9934
+ function buildSideQuestionPrompt(question, history = []) {
9935
+ const trimmed = question.trim();
9936
+ const prior = history.filter((h) => h.question.trim() && h.answer.trim()).slice(-12);
9937
+ if (prior.length === 0) return trimmed;
9938
+ const lines = prior.map((h) => `Q: ${clip(h.question.trim(), MAX_HISTORY_CHARS)}
9939
+ A: ${clip(h.answer.trim(), MAX_HISTORY_CHARS)}`);
9940
+ return `<earlier-side-questions>
9941
+ ${lines.join("\n\n")}
9942
+ </earlier-side-questions>
9943
+
9944
+ ${trimmed}`;
9945
+ }
9946
+ function sideQuestionQueryOptions(input) {
9947
+ return {
9948
+ cwd: input.cwd,
9949
+ ...input.resumeSessionId ? { resume: input.resumeSessionId, forkSession: true } : {},
9950
+ persistSession: false,
9951
+ tools: [],
9952
+ mcpServers: {},
9953
+ strictMcpConfig: true,
9954
+ maxTurns: 1,
9955
+ includePartialMessages: true,
9956
+ permissionMode: "default",
9957
+ model: input.model,
9958
+ env: input.env,
9959
+ settingsPath: input.settingsPath,
9960
+ appendSystemPrompt: SIDE_QUESTION_SYSTEM_PROMPT,
9961
+ canCallTool: async () => ({ behavior: "deny", message: "Side questions cannot use tools" }),
9962
+ abort: input.signal
9963
+ };
9964
+ }
9965
+ function textFromAssistant(message) {
9966
+ if (message.type !== "assistant") return "";
9967
+ const content = message.message?.content;
9968
+ if (!Array.isArray(content)) return "";
9969
+ return content.map((block) => block && typeof block === "object" && block.type === "text" ? String(block.text ?? "") : "").join("");
9970
+ }
9971
+ async function runSideQuestion(query, input) {
9972
+ const options = sideQuestionQueryOptions(input);
9973
+ const stream = query({ prompt: buildSideQuestionPrompt(input.question, input.history), options });
9974
+ let streamed = "";
9975
+ let final = "";
9976
+ let resultSeen = false;
9977
+ for await (const message of stream) {
9978
+ if (message.type === "stream_event") {
9979
+ const event = message.event;
9980
+ if (event?.type === "content_block_delta" && event.delta?.type === "text_delta" && event.delta.text) {
9981
+ streamed += event.delta.text;
9982
+ input.onText?.(streamed);
9983
+ }
9984
+ continue;
9985
+ }
9986
+ if (message.type === "assistant") {
9987
+ const text = textFromAssistant(message);
9988
+ if (text) {
9989
+ final = final ? `${final}
9990
+
9991
+ ${text}` : text;
9992
+ input.onText?.(final);
9993
+ }
9994
+ continue;
9995
+ }
9996
+ if (message.type === "result") {
9997
+ resultSeen = true;
9998
+ const result = message;
9999
+ if (result.subtype !== "success") {
10000
+ 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";
10001
+ throw new Error(`Side question failed: ${detail}`);
10002
+ }
10003
+ if (!final && typeof result.result === "string") final = result.result;
10004
+ }
10005
+ }
10006
+ if (input.signal?.aborted) throw new Error("Side question cancelled");
10007
+ if (!resultSeen && !final && !streamed) throw new Error("Side question ended without a result");
10008
+ return { answer: final || streamed, hadContext: Boolean(input.resumeSessionId) };
10009
+ }
10010
+
10011
+ const SIDE_QUESTION_RETAIN_MS = 5 * 6e4;
10012
+ const SIDE_QUESTION_MAX_CHARS = 8e3;
10013
+ const SIDE_QUESTION_MAX_RUN_MS = 10 * 6e4;
10014
+ function writeSideQuestionSettingsFile(homeDir) {
10015
+ const dir = join(homeDir, "tmp", "hooks");
10016
+ mkdirSync(dir, { recursive: true });
10017
+ const file = join(dir, `side-question-${process.pid}.json`);
10018
+ writeFileSync(file, JSON.stringify({ disableAllHooks: true }));
10019
+ return file;
10020
+ }
10021
+ function parseHistory(raw) {
10022
+ if (!Array.isArray(raw)) return [];
10023
+ return raw.flatMap((item) => {
10024
+ if (!item || typeof item !== "object") return [];
10025
+ const { question, answer } = item;
10026
+ return typeof question === "string" && typeof answer === "string" ? [{ question, answer }] : [];
10027
+ });
10028
+ }
10029
+ function registerSideQuestionHandler(rpc, deps) {
10030
+ const now = deps.now ?? (() => Date.now());
10031
+ const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
10032
+ const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
10033
+ const run = deps.run ?? (async (input) => {
10034
+ const { query } = await import('./index-BnVk_E3V.mjs');
10035
+ return runSideQuestion(query, input);
10036
+ });
10037
+ const slots = /* @__PURE__ */ new Map();
10038
+ let active = null;
10039
+ const prune = () => {
10040
+ const t = now();
10041
+ for (const [id, slot] of slots) {
10042
+ if (slot.status !== "running" && slot.finishedAt !== void 0 && t - slot.finishedAt > retainMs) slots.delete(id);
10043
+ }
10044
+ };
10045
+ const finish = (slot, status, error) => {
10046
+ if (slot.status !== "running") return;
10047
+ slot.status = status;
10048
+ slot.error = error;
10049
+ slot.finishedAt = now();
10050
+ if (active === slot) active = null;
10051
+ };
10052
+ rpc.registerHandler("btw-ask", async (request) => {
10053
+ const question = typeof request?.question === "string" ? request.question.trim() : "";
10054
+ if (!question) throw new Error("Side question is empty");
10055
+ if (question.length > SIDE_QUESTION_MAX_CHARS) throw new Error("Side question is too long");
10056
+ prune();
10057
+ if (active) throw new Error("A side question is already running");
10058
+ const resumeSessionId = deps.getClaudeSessionId() ?? null;
10059
+ const slot = {
10060
+ requestId: randomUUID(),
10061
+ status: "running",
10062
+ text: "",
10063
+ startedAt: now(),
10064
+ abort: new AbortController()
10065
+ };
10066
+ slots.set(slot.requestId, slot);
10067
+ active = slot;
10068
+ logger.debug(`[btw] side question ${slot.requestId} start (context=${resumeSessionId ? "fork" : "none"})`);
10069
+ const deadline = setTimeout(() => {
10070
+ if (slot.status !== "running") return;
10071
+ slot.abort.abort("timeout");
10072
+ finish(slot, "error", "Side question timed out");
10073
+ logger.debug(`[btw] side question ${slot.requestId} timed out after ${maxRunMs}ms`);
10074
+ }, maxRunMs);
10075
+ deadline.unref?.();
10076
+ void run({
10077
+ question,
10078
+ history: parseHistory(request.history),
10079
+ resumeSessionId,
10080
+ cwd: deps.cwd,
10081
+ model: deps.getModel(),
10082
+ env: deps.getEnv?.(),
10083
+ settingsPath: deps.settingsPath,
10084
+ signal: slot.abort.signal,
10085
+ onText: (text) => {
10086
+ if (slot.status === "running") slot.text = text;
10087
+ }
10088
+ }).then((result) => {
10089
+ slot.text = result.answer;
10090
+ finish(slot, "done");
10091
+ logger.debug(`[btw] side question ${slot.requestId} done (${result.answer.length} chars)`);
10092
+ }).catch((error) => {
10093
+ const message = error instanceof Error ? error.message : String(error);
10094
+ if (slot.abort.signal.aborted) {
10095
+ finish(slot, "cancelled");
10096
+ } else {
10097
+ finish(slot, "error", message);
10098
+ logger.debug(`[btw] side question ${slot.requestId} failed: ${message}`);
10099
+ }
10100
+ }).finally(() => clearTimeout(deadline));
10101
+ return { requestId: slot.requestId, hadContext: Boolean(resumeSessionId) };
10102
+ });
10103
+ rpc.registerHandler("btw-poll", async (request) => {
10104
+ prune();
10105
+ const id = typeof request?.requestId === "string" ? request.requestId : "";
10106
+ const slot = slots.get(id);
10107
+ if (!slot) throw new Error("Unknown side question");
10108
+ return {
10109
+ requestId: slot.requestId,
10110
+ status: slot.status,
10111
+ text: slot.text,
10112
+ error: slot.error,
10113
+ startedAt: slot.startedAt,
10114
+ finishedAt: slot.finishedAt
10115
+ };
10116
+ });
10117
+ rpc.registerHandler("btw-cancel", async (request) => {
10118
+ const id = typeof request?.requestId === "string" ? request.requestId : "";
10119
+ const slot = slots.get(id);
10120
+ if (!slot || slot.status !== "running") return { cancelled: false };
10121
+ slot.abort.abort("cancelled by user");
10122
+ finish(slot, "cancelled");
10123
+ return { cancelled: true };
10124
+ });
10125
+ return {
10126
+ /** Test/introspection hook. */
10127
+ _slots: slots
10128
+ };
10129
+ }
10130
+
9915
10131
  const MAX_PROMPT_SAMPLE_CHARS = 500;
9916
10132
  const MAX_TITLE_CHARS = 60;
9917
10133
  const GENERATION_TIMEOUT_MS = 3e4;
@@ -10374,7 +10590,7 @@ async function runClaude(credentials, options = {}) {
10374
10590
  // a brand-new session cannot pick a PDF until after sending once.
10375
10591
  attachmentKinds: [...CLAUDE_ATTACHMENT_KINDS],
10376
10592
  queueCancellation: true,
10377
- capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2"],
10593
+ capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2", "claude-btw-v1"],
10378
10594
  // Effective mode this process enforces. Kept current by
10379
10595
  // publishPermissionMode below; the web renders it instead of guessing.
10380
10596
  permissionMode: mapToClaudeMode(initialPermissionMode ?? "default"),
@@ -10660,6 +10876,16 @@ async function runClaude(credentials, options = {}) {
10660
10876
  let currentAllowedTools = void 0;
10661
10877
  let currentDisallowedTools = withAssistantDenylist(void 0, isAssistantVariant);
10662
10878
  let currentEffort = DEFAULT_CLAUDE_EFFORT;
10879
+ registerSideQuestionHandler(session.rpcHandlerManager, {
10880
+ getClaudeSessionId: () => {
10881
+ const id = currentSession?.sessionId ?? null;
10882
+ return id && claudeCheckSession(id, workingDirectory) ? id : null;
10883
+ },
10884
+ getModel: () => currentModel,
10885
+ cwd: workingDirectory,
10886
+ getEnv: () => options.claudeEnvVars,
10887
+ settingsPath: writeSideQuestionSettingsFile(configuration.happyHomeDir)
10888
+ });
10663
10889
  const resetCurrentModeDefaults = () => {
10664
10890
  currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
10665
10891
  currentFallbackModel = void 0;
@@ -14738,7 +14964,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14738
14964
  process.exit(0);
14739
14965
  } else if (subcommand === "install-terminal-hooks") {
14740
14966
  try {
14741
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-DkOh088o.mjs');
14967
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-BvYqvibn.mjs');
14742
14968
  const command = parseTerminalHooksArgs(args.slice(1));
14743
14969
  if (command.action === "help") {
14744
14970
  console.log(TERMINAL_HOOKS_HELP);
@@ -14755,7 +14981,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14755
14981
  }
14756
14982
  } else if (subcommand === "spawn") {
14757
14983
  try {
14758
- const { handleSpawnCommand } = await import('./spawn-CCYAeBfN.mjs');
14984
+ const { handleSpawnCommand } = await import('./spawn-D3k-ywKX.mjs');
14759
14985
  await handleSpawnCommand(args.slice(1));
14760
14986
  } catch (error) {
14761
14987
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -14767,7 +14993,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14767
14993
  return;
14768
14994
  } else if (subcommand === "send") {
14769
14995
  try {
14770
- const { handleSendCommand } = await import('./send-B3NOqi9-.mjs');
14996
+ const { handleSendCommand } = await import('./send-D1arw2mU.mjs');
14771
14997
  await handleSendCommand(args.slice(1));
14772
14998
  } catch (error) {
14773
14999
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -14873,9 +15099,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14873
15099
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
14874
15100
  const projectId = args[3];
14875
15101
  try {
14876
- const { saveGoogleCloudProjectToConfig } = await import('./config-BcCVR-Wx.mjs');
14877
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./types-CrJj-daH.mjs').then(function (n) { return n.an; });
14878
- const { ApiClient: ApiClient2 } = await import('./types-CrJj-daH.mjs').then(function (n) { return n.ao; });
15102
+ const { saveGoogleCloudProjectToConfig } = await import('./config-C1Z39_GK.mjs');
15103
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./types-CkxTp9iI.mjs').then(function (n) { return n.an; });
15104
+ const { ApiClient: ApiClient2 } = await import('./types-CkxTp9iI.mjs').then(function (n) { return n.ao; });
14879
15105
  let userEmail = void 0;
14880
15106
  try {
14881
15107
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -14906,7 +15132,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14906
15132
  }
14907
15133
  if (geminiSubcommand === "project" && args[2] === "get") {
14908
15134
  try {
14909
- const { readGeminiLocalConfig } = await import('./config-BcCVR-Wx.mjs');
15135
+ const { readGeminiLocalConfig } = await import('./config-C1Z39_GK.mjs');
14910
15136
  const config = readGeminiLocalConfig();
14911
15137
  if (config.googleCloudProject) {
14912
15138
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -14946,7 +15172,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14946
15172
  process.exit(0);
14947
15173
  }
14948
15174
  try {
14949
- const { runGemini } = await import('./runGemini-3-xWWBRA.mjs');
15175
+ const { runGemini } = await import('./runGemini-D1SFLnxb.mjs');
14950
15176
  let startedBy = void 0;
14951
15177
  for (let i = 1; i < args.length; i++) {
14952
15178
  if (args[i] === "--started-by") {
@@ -14968,7 +15194,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
14968
15194
  return;
14969
15195
  } else if (subcommand === "acp") {
14970
15196
  try {
14971
- const { runAcp, resolveAcpAgentConfig } = await import('./index-Wfds4scC.mjs');
15197
+ const { runAcp, resolveAcpAgentConfig } = await import('./index-BL9LWtAR.mjs');
14972
15198
  let startedBy = void 0;
14973
15199
  let verbose = false;
14974
15200
  const acpArgs = [];
@@ -15008,7 +15234,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
15008
15234
  return;
15009
15235
  } else if (subcommand === "openclaw") {
15010
15236
  try {
15011
- const { runOpenClaw } = await import('./runOpenClaw-DZhGhihh.mjs');
15237
+ const { runOpenClaw } = await import('./runOpenClaw-AsjRz-Q3.mjs');
15012
15238
  let startedBy = void 0;
15013
15239
  let verbose = false;
15014
15240
  let gatewayUrl;
@@ -15059,7 +15285,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
15059
15285
  return;
15060
15286
  } else if (subcommand === "mcp" && args.length === 1) {
15061
15287
  try {
15062
- const { handleMcpCommand } = await import('./mcp-DhftF_XE.mjs');
15288
+ const { handleMcpCommand } = await import('./mcp-D6qSHTLO.mjs');
15063
15289
  await handleMcpCommand();
15064
15290
  } catch (error) {
15065
15291
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -15415,4 +15641,4 @@ ${chalk.bold("Examples:")}
15415
15641
  }
15416
15642
  }
15417
15643
 
15418
- export { BasePermissionHandler as B, CHANGE_TITLE_INSTRUCTION as C, DEFAULT_GEMINI_MODEL as D, GEMINI_MODEL_ENV as G, MessageQueue2 as M, sessionWebUrl as a, sendUserMessage as b, checkIfDaemonRunningAndCleanupStaleState as c, createSessionMetadata as d, setupOfflineReconnection as e, startHappyServer as f, GEMINI_API_KEY_ENV as g, hashObject as h, initialMachineMetadata as i, GOOGLE_API_KEY_ENV as j, BaseReasoningProcessor as k, MessageBuffer as l, notifyDaemonSessionStarted as n, pushClipboardViaDaemon as p, registerKillSessionHandler as r, spawnDaemonSession as s, tmuxSupportsSessionEnv as t, waitForSessionKey as w };
15644
+ export { BasePermissionHandler as B, CHANGE_TITLE_INSTRUCTION as C, DEFAULT_GEMINI_MODEL as D, GEMINI_MODEL_ENV as G, MessageQueue2 as M, sessionWebUrl as a, sendUserMessage as b, checkIfDaemonRunningAndCleanupStaleState as c, createSessionMetadata as d, setupOfflineReconnection as e, startHappyServer as f, GEMINI_API_KEY_ENV as g, hashObject as h, initialMachineMetadata as i, GOOGLE_API_KEY_ENV as j, BaseReasoningProcessor as k, MessageBuffer as l, notifyDaemonSessionStarted as n, pushClipboardViaDaemon as p, query as q, registerKillSessionHandler as r, spawnDaemonSession as s, tmuxSupportsSessionEnv as t, waitForSessionKey as w };
@@ -1,10 +1,10 @@
1
- import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-C9LtzYSx.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-C9LtzYSx.mjs';
3
- import { h as connectionState, A as ApiClient, i as readSettings, j as encodeBase64, l as logger, p as projectPath } from './types-CrJj-daH.mjs';
4
- import { A as AcpSessionManager } from './AcpSessionManager-B5rJcE82.mjs';
1
+ import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-mbMlyZnj.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-mbMlyZnj.mjs';
3
+ import { h as connectionState, A as ApiClient, i as readSettings, j as encodeBase64, l as logger, p as projectPath } from './types-CkxTp9iI.mjs';
4
+ import { A as AcpSessionManager } from './AcpSessionManager-CwdvDD_z.mjs';
5
5
  import { randomUUID } from 'node:crypto';
6
6
  import { join } from 'node:path';
7
- import { i as initialMachineMetadata, d as createSessionMetadata, e as setupOfflineReconnection, n as notifyDaemonSessionStarted, M as MessageQueue2, h as hashObject, f as startHappyServer, r as registerKillSessionHandler, B as BasePermissionHandler } from './index-B87z2DOo.mjs';
7
+ import { i as initialMachineMetadata, d as createSessionMetadata, e as setupOfflineReconnection, n as notifyDaemonSessionStarted, M as MessageQueue2, h as hashObject, f as startHappyServer, r as registerKillSessionHandler, B as BasePermissionHandler } from './index-3ssSAknz.mjs';
8
8
  import 'node:child_process';
9
9
  import '@agentclientprotocol/sdk';
10
10
  import 'axios';
@@ -0,0 +1,51 @@
1
+ import { q as query } from './index-3ssSAknz.mjs';
2
+ export { AbortError } from '@anthropic-ai/claude-agent-sdk';
3
+ import 'chalk';
4
+ import 'node:os';
5
+ import 'node:crypto';
6
+ import './types-CkxTp9iI.mjs';
7
+ import 'axios';
8
+ import 'node:util';
9
+ import 'node:fs';
10
+ import 'node:path';
11
+ import 'node:fs/promises';
12
+ import 'node:events';
13
+ import 'socket.io-client';
14
+ import 'zod';
15
+ import '@paralleldrive/cuid2';
16
+ import 'tweetnacl';
17
+ import './limits-CwFb5S2b.mjs';
18
+ import 'child_process';
19
+ import 'util';
20
+ import 'fs/promises';
21
+ import 'crypto';
22
+ import 'path';
23
+ import 'cross-spawn';
24
+ import 'url';
25
+ import 'os';
26
+ import 'node:child_process';
27
+ import 'node-pty';
28
+ import 'fs';
29
+ import 'node:readline';
30
+ import '@anthropic-ai/sandbox-runtime';
31
+ import 'expo-server-sdk';
32
+ import './agentGuidance-C2_pkgRI.mjs';
33
+ import 'ink';
34
+ import 'react';
35
+ import 'ps-list';
36
+ import 'tmp';
37
+ import 'open';
38
+ import 'fastify';
39
+ import 'fastify-type-provider-zod';
40
+ import 'node:module';
41
+ import '@modelcontextprotocol/sdk/server/mcp.js';
42
+ import 'node:http';
43
+ import '@modelcontextprotocol/sdk/server/streamableHttp.js';
44
+ import 'http';
45
+ import 'inquirer';
46
+ import 'node:url';
47
+ import 'node:readline/promises';
48
+
49
+
50
+
51
+ export { query };