very-happy-cli 0.2.132 → 0.2.134

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 (45) hide show
  1. package/dist/{AcpBackend-BNMLGtST.mjs → AcpBackend-B8KEjDwF.mjs} +3 -3
  2. package/dist/{AcpBackend--EnHZRC4.cjs → AcpBackend-CeNp7tgD.cjs} +3 -3
  3. package/dist/{AcpSessionManager-RoOyx5KI.cjs → AcpSessionManager-Bu1d05bx.cjs} +1 -1
  4. package/dist/{AcpSessionManager-BF5JZYCC.mjs → AcpSessionManager-KlDZbEmZ.mjs} +1 -1
  5. package/dist/{agentGuidance-DeOIgOhh.mjs → agentGuidance-CPG5Cr5T.mjs} +1 -1
  6. package/dist/{agentGuidance-R9MH5Cd5.cjs → agentGuidance-Cg8Lha39.cjs} +1 -1
  7. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  8. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  9. package/dist/{config-CkmssSRu.cjs → config-C3e90AIH.cjs} +4 -4
  10. package/dist/{config-ClCkJ1a_.mjs → config-C4gWfnJX.mjs} +4 -4
  11. package/dist/{index-Dn7s2iaT.cjs → index-B1plzL9M.cjs} +85 -36
  12. package/dist/{index-DdbU8FmA.mjs → index-B6UvB88K.mjs} +16 -10
  13. package/dist/{index-D1gHXtkw.mjs → index-BqUOj1zK.mjs} +81 -32
  14. package/dist/{index-DK0qz1y7.mjs → index-CEDPokKf.mjs} +4 -4
  15. package/dist/{index-Bqg6yo5s.cjs → index-CX-zp3FH.cjs} +4 -4
  16. package/dist/{index-CjopZZg3.cjs → index-jqG8CV0c.cjs} +15 -9
  17. package/dist/index.cjs +4 -4
  18. package/dist/index.mjs +4 -4
  19. package/dist/{installTerminalHooks-CRWWmonO.mjs → installTerminalHooks-BT4Dq28Y.mjs} +4 -4
  20. package/dist/{installTerminalHooks-CPZ3vVn8.cjs → installTerminalHooks-DPmEaHg2.cjs} +4 -4
  21. package/dist/lib.cjs +2 -2
  22. package/dist/lib.d.cts +15 -60
  23. package/dist/lib.d.mts +15 -60
  24. package/dist/lib.mjs +2 -2
  25. package/dist/{limits-C9aXkP7U.mjs → limits-BGeIBBE3.mjs} +7 -7
  26. package/dist/{limits-DLlsV71c.cjs → limits-D6kiAfXJ.cjs} +7 -7
  27. package/dist/{mcp-DkoXvc07.mjs → mcp-BGu_dUaJ.mjs} +4 -4
  28. package/dist/{mcp-DHkYfENQ.cjs → mcp-DGZmUpuZ.cjs} +4 -4
  29. package/dist/{runGemini-Cx1YcK2o.cjs → runGemini-BPPnulIk.cjs} +6 -6
  30. package/dist/{runGemini-BjEl7syj.mjs → runGemini-DGTNwiLo.mjs} +6 -6
  31. package/dist/{runOpenClaw-I4sGAQf1.cjs → runOpenClaw-BB3Ivt1S.cjs} +5 -5
  32. package/dist/{runOpenClaw-ByHu69K5.mjs → runOpenClaw-CxgTFOSM.mjs} +5 -5
  33. package/dist/{send-gH1vJ0iv.cjs → send-Bo6iKuXr.cjs} +4 -4
  34. package/dist/{send-CSOeUlQC.mjs → send-DHShoBeq.mjs} +4 -4
  35. package/dist/{sessions-CP9FlcJ6.mjs → sessions-CJuwvEr0.mjs} +4 -4
  36. package/dist/{sessions-BBc8L8qf.cjs → sessions-DyC5Attg.cjs} +4 -4
  37. package/dist/{spawn-DrQo81MW.mjs → spawn-QtKlr8Ig.mjs} +4 -4
  38. package/dist/{spawn-Dmfbot5k.cjs → spawn-gha6nGx-.cjs} +4 -4
  39. package/dist/{teams-Bbvo1G6y.mjs → teams-BF-GxUZc.mjs} +4 -4
  40. package/dist/{teams-DtXQYmEK.cjs → teams-BbzWNV9e.cjs} +4 -4
  41. package/dist/{todo-DOi6svw9.cjs → todo-BaNaNZ8c.cjs} +3 -3
  42. package/dist/{todo-BAwevRyb.mjs → todo-CkJ5UjWs.mjs} +3 -3
  43. package/dist/{types-CA-c2NH7.mjs → types-Cq-tvv9t.mjs} +89 -27
  44. package/dist/{types-B15E2OVy.cjs → types-Dabm17Ln.cjs} +90 -28
  45. package/package.json +7 -7
@@ -1,13 +1,13 @@
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, tmpdir } from 'node:os';
3
3
  import { randomUUID, randomBytes, createHash as createHash$1, timingSafeEqual } from 'node:crypto';
4
- import { j as getProjectPath, g as BUILTIN_TODO_DISCOVERY, p as projectPath, k as initializeSandbox, w as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, h as delay, l as AsyncLock, S as STREAM_DELTA_MAX_CHARS, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, m as commandOnPath, n as deriveLocalCliUpdateSummary, o as isClaudeSessionId, q as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials, t as parseExactVersion, u as compareExactVersions, v as extractCompleteLines, x as decideBackfill, y as parseTerminalHookPayload, z as tmuxArgs, C as scrubTmuxClientEnv, D as decideMirrorBinding, E as MIRROR_BACKFILL_LINES_DEFAULT, F as mirrorLineKey, G as mirrorLocalId, H as detectCLIAvailability, J as detectResumeSupport, K as summarizeSpawnSessionForLog, L as shellescape, A as ApiClient, N as fetchCliUpdateState, O as resolveCliUpdateCheckInterval, P as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, i as isValidSessionId, Q as listVhTerminals, T as isValidTerminalId, U as readVhTerminal, V as sendToVhTerminal, W as ContextUsageSchema, X as TITLE_PROMPT_PREFIX, Y as BOARD_ANALYZER_PROMPT_PREFIX, f as connectionState, Z as startOfflineReconnection, c as createEnvelope, _ as CodexAppServerClient } from './types-CA-c2NH7.mjs';
5
- import { z as readDaemonState, l as logger, c as configuration, A as clearDaemonState, B as ensurePrivateDirectory, D as hardenPrivateFile, p as packageJson, g as readSettings, E as readCredentials, s as credentialRelayProblem, i as encodeBase64, F as readSettingsOutcome, G as updateSettings, H as encodeBase64Url, m as decodeBase64, I as writeCredentialsLegacy, J as writeCredentialsDataKey, d as readCredentialsForConfiguredRelay, j as encrypt, r as readPersistedSessions, w as writePrivateFileSync, K as decryptWithDataKey, L as decryptLegacy, M as persistSession, k as decrypt, f as ensurePrivateDirectorySync, N as acquireDaemonLock, O as deletePersistedSessions, P as writeDaemonState, Q as writeSettings, R as releaseDaemonLock, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES, S as clearCredentials, T as clearMachineId, U as SandboxConfigSchema, V as getLatestDaemonLog } from './limits-C9aXkP7U.mjs';
4
+ import { j as getProjectPath, g as BUILTIN_TODO_DISCOVERY, p as projectPath, k as initializeSandbox, w as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, h as delay, l as AsyncLock, S as STREAM_DELTA_MAX_CHARS, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, m as commandOnPath, n as deriveLocalCliUpdateSummary, o as isClaudeSessionId, q as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials, t as parseExactVersion, u as compareExactVersions, v as extractCompleteLines, x as decideBackfill, y as parseTerminalHookPayload, z as tmuxArgs, C as scrubTmuxClientEnv, D as decideMirrorBinding, E as MIRROR_BACKFILL_LINES_DEFAULT, F as mirrorLineKey, G as mirrorLocalId, H as detectCLIAvailability, J as detectResumeSupport, K as summarizeSpawnSessionForLog, L as shellescape, A as ApiClient, N as fetchCliUpdateState, O as resolveCliUpdateCheckInterval, P as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, i as isValidSessionId, Q as listVhTerminals, T as isValidTerminalId, U as readVhTerminal, V as sendToVhTerminal, W as ContextUsageSchema, X as TITLE_PROMPT_PREFIX, Y as BOARD_ANALYZER_PROMPT_PREFIX, f as connectionState, Z as startOfflineReconnection, c as createEnvelope, _ as CodexAppServerClient } from './types-Cq-tvv9t.mjs';
5
+ import { z as readDaemonState, l as logger, c as configuration, A as clearDaemonState, B as ensurePrivateDirectory, D as hardenPrivateFile, p as packageJson, g as readSettings, E as readCredentials, s as credentialRelayProblem, i as encodeBase64, F as readSettingsOutcome, G as updateSettings, H as encodeBase64Url, m as decodeBase64, I as writeCredentialsLegacy, J as writeCredentialsDataKey, d as readCredentialsForConfiguredRelay, j as encrypt, r as readPersistedSessions, w as writePrivateFileSync, K as decryptWithDataKey, L as decryptLegacy, M as persistSession, k as decrypt, f as ensurePrivateDirectorySync, N as acquireDaemonLock, O as deletePersistedSessions, P as writeDaemonState, Q as writeSettings, R as releaseDaemonLock, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES, S as clearCredentials, T as clearMachineId, U as SandboxConfigSchema, V as getLatestDaemonLog } from './limits-BGeIBBE3.mjs';
6
6
  import spawn$1, { spawn } from 'cross-spawn';
7
7
  import path, { join, resolve, basename, isAbsolute, dirname, sep, delimiter, normalize } from 'node:path';
8
8
  import { createInterface } from 'node:readline';
9
9
  import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, unlinkSync, renameSync, writeFileSync, accessSync, constants, openSync, fsyncSync, closeSync, rmSync as rmSync$1, chmodSync as chmodSync$1 } from 'node:fs';
10
- import { f as trimIdent, A as AGENT_GUIDANCE, t as teamScopePath, T as TeamConnectionPreflightError, e as createTeamsClient, P as PREVIEW_TOOL_NAME, R as REPORT_PROGRESS_TOOL_NAME, g as TEAM_TOOL_NAMES, r as registerTeamsTools, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, h as REPORT_PROGRESS_TOOL_TITLE, i as REPORT_PROGRESS_TOOL_DESCRIPTION } from './agentGuidance-DeOIgOhh.mjs';
10
+ import { f as trimIdent, A as AGENT_GUIDANCE, t as teamScopePath, T as TeamConnectionPreflightError, e as createTeamsClient, P as PREVIEW_TOOL_NAME, R as REPORT_PROGRESS_TOOL_NAME, g as TEAM_TOOL_NAMES, r as registerTeamsTools, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, h as REPORT_PROGRESS_TOOL_TITLE, i as REPORT_PROGRESS_TOOL_DESCRIPTION } from './agentGuidance-CPG5Cr5T.mjs';
11
11
  import { readFile, writeFile, rename, unlink, mkdir, symlink, rm, readlink, lstat, stat, open as open$1, appendFile } from 'node:fs/promises';
12
12
  import fs, { watch, access } from 'fs/promises';
13
13
  import { useStdout, useInput, Box, Text, render } from 'ink';
@@ -7502,27 +7502,31 @@ function createUpdateController(deps) {
7502
7502
  let policy = null;
7503
7503
  let outcome = null;
7504
7504
  let running = false;
7505
+ let manualVersion = null;
7505
7506
  let operation = null;
7506
7507
  let blocked = false;
7507
7508
  let handoverHold;
7508
7509
  let lastPublished = "";
7509
7510
  const now = deps.now ?? Date.now;
7511
+ function validManualTarget(next, version) {
7512
+ return version === next.recommendedVersion && Number.isFinite(next.checkedAt) && now() - next.checkedAt <= 65 * 6e4 && next.checkedAt <= now() + 6e4 && compareExactVersions(next.currentVersion, version) === -1 && (!next.minimumVersion || [0, 1].includes(compareExactVersions(version, next.minimumVersion) ?? -1));
7513
+ }
7510
7514
  function publish(state, version, detail) {
7511
7515
  if (!policy) return;
7512
- const fingerprint = JSON.stringify([policy.checkedAt, state, version, detail]);
7516
+ const fingerprint = JSON.stringify([policy.checkedAt, state, version, detail, manualVersion]);
7513
7517
  if (fingerprint === lastPublished) return;
7514
7518
  lastPublished = fingerprint;
7515
- outcome = { state, version, detail, at: now() };
7516
- deps.publish({ ...policy, retrySupported: !blocked, handoverHold, autoUpdate: outcome });
7519
+ outcome = { state, version, detail, at: now(), ...manualVersion ? { source: "manual" } : {} };
7520
+ deps.publish({ ...policy, retrySupported: !blocked, manualUpdateSupported: !blocked, handoverHold, autoUpdate: outcome });
7517
7521
  }
7518
7522
  async function evaluate() {
7519
7523
  if (!policy || running) return;
7520
- const target = policy.autoUpdateVersion ?? null;
7524
+ const target = manualVersion ?? policy.autoUpdateVersion ?? null;
7521
7525
  if (outcome?.version === target && ["failed", "installed"].includes(outcome.state)) {
7522
- const fingerprint = JSON.stringify([policy.checkedAt, outcome.state, outcome.version, outcome.detail]);
7526
+ const fingerprint = JSON.stringify([policy.checkedAt, outcome.state, outcome.version, outcome.detail, manualVersion]);
7523
7527
  if (fingerprint !== lastPublished) {
7524
7528
  lastPublished = fingerprint;
7525
- deps.publish({ ...policy, retrySupported: !blocked, handoverHold, autoUpdate: outcome });
7529
+ deps.publish({ ...policy, retrySupported: !blocked, manualUpdateSupported: !blocked, handoverHold, autoUpdate: outcome });
7526
7530
  }
7527
7531
  return;
7528
7532
  }
@@ -7530,7 +7534,7 @@ function createUpdateController(deps) {
7530
7534
  publish("policy_stale", target);
7531
7535
  return;
7532
7536
  }
7533
- if (!await deps.enabled()) {
7537
+ if (!manualVersion && !await deps.enabled()) {
7534
7538
  publish("disabled", target);
7535
7539
  return;
7536
7540
  }
@@ -7583,6 +7587,7 @@ function createUpdateController(deps) {
7583
7587
  try {
7584
7588
  const next = await deps.policy();
7585
7589
  if (!next) return;
7590
+ if (manualVersion && !validManualTarget(next, manualVersion)) manualVersion = null;
7586
7591
  policy = next;
7587
7592
  await evaluate();
7588
7593
  } finally {
@@ -7597,10 +7602,10 @@ function createUpdateController(deps) {
7597
7602
  operation = "retry";
7598
7603
  try {
7599
7604
  const next = await deps.policy();
7600
- if (!next || next.autoUpdateVersion !== version || now() - next.checkedAt > 65 * 6e4) {
7605
+ if (!next || (manualVersion ? !validManualTarget(next, version) : next.autoUpdateVersion !== version || now() - next.checkedAt > 65 * 6e4)) {
7601
7606
  return { error: "update_policy_changed_or_unavailable" };
7602
7607
  }
7603
- if (!await deps.enabled()) return { error: "auto_update_disabled" };
7608
+ if (!manualVersion && !await deps.enabled()) return { error: "auto_update_disabled" };
7604
7609
  policy = next;
7605
7610
  outcome = null;
7606
7611
  handoverHold = null;
@@ -7613,6 +7618,37 @@ function createUpdateController(deps) {
7613
7618
  operation = null;
7614
7619
  }
7615
7620
  }
7621
+ async function request(version) {
7622
+ if (operation || blocked) return { error: blocked ? "manual_recovery_required" : "update_in_progress" };
7623
+ operation = "request";
7624
+ try {
7625
+ const next = await deps.policy();
7626
+ if (next && manualVersion && !validManualTarget(next, manualVersion)) {
7627
+ manualVersion = null;
7628
+ policy = next;
7629
+ publish("policy_stale", null);
7630
+ }
7631
+ if (!next || typeof version !== "string" || !validManualTarget(next, version)) {
7632
+ return { error: "update_policy_changed_or_unavailable" };
7633
+ }
7634
+ if (outcome?.version === version && (outcome.state === "installed" || manualVersion === version && outcome.state === "waiting_idle")) {
7635
+ policy = next;
7636
+ publish(outcome.state, version, outcome.detail);
7637
+ return { accepted: true };
7638
+ }
7639
+ policy = next;
7640
+ manualVersion = version;
7641
+ outcome = null;
7642
+ handoverHold = null;
7643
+ publish("waiting_idle", version);
7644
+ setTimeout(() => {
7645
+ void tick().catch(() => publish("policy_stale", version));
7646
+ }, 0);
7647
+ return { accepted: true };
7648
+ } finally {
7649
+ operation = null;
7650
+ }
7651
+ }
7616
7652
  async function withHandover(task) {
7617
7653
  if (operation || blocked) return;
7618
7654
  operation = "handover";
@@ -7624,9 +7660,9 @@ function createUpdateController(deps) {
7624
7660
  }
7625
7661
  function holdHandover(reason) {
7626
7662
  handoverHold = { reason, at: now() };
7627
- publish("failed", policy?.autoUpdateVersion ?? null, "handover_preflight_failed");
7663
+ publish("failed", manualVersion ?? policy?.autoUpdateVersion ?? null, "handover_preflight_failed");
7628
7664
  }
7629
- return { refresh, retry, tick, withHandover, holdHandover, isRunning: () => running };
7665
+ return { refresh, retry, request, tick, withHandover, holdHandover, isRunning: () => running };
7630
7666
  }
7631
7667
 
7632
7668
  const CLAUDE_KEYCHAIN_SERVICE_PREFIX = "Claude Code";
@@ -10923,6 +10959,7 @@ async function startDaemon() {
10923
10959
  }
10924
10960
  });
10925
10961
  apiMachine.setCliUpdateRetryHandler(updateController.retry);
10962
+ apiMachine.setCliUpdateRequestHandler(updateController.request);
10926
10963
  const refreshCliUpdate = () => updateController.refresh().catch((error) => {
10927
10964
  logger.debug("[DAEMON RUN] CLI update policy check failed:", error);
10928
10965
  });
@@ -11981,7 +12018,7 @@ function cleanupHookSettingsFile(filepath) {
11981
12018
  }
11982
12019
  }
11983
12020
 
11984
- function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEvents) {
12021
+ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEvents, options) {
11985
12022
  let terminationStarted = false;
11986
12023
  const terminateOnce = () => {
11987
12024
  if (terminationStarted) return;
@@ -11989,6 +12026,10 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEve
11989
12026
  void killThisHappy();
11990
12027
  };
11991
12028
  archiveEvents.on("archived", terminateOnce);
12029
+ if (options?.processSignals) {
12030
+ process.on("SIGTERM", terminateOnce);
12031
+ process.on("SIGINT", terminateOnce);
12032
+ }
11992
12033
  rpcHandlerManager.registerHandler("killSession", async () => {
11993
12034
  logger.debug("Kill session request received");
11994
12035
  terminateOnce();
@@ -11997,6 +12038,13 @@ function registerKillSessionHandler(rpcHandlerManager, killThisHappy, archiveEve
11997
12038
  message: "Killing happy-cli process"
11998
12039
  };
11999
12040
  });
12041
+ return () => {
12042
+ archiveEvents.off?.("archived", terminateOnce);
12043
+ if (options?.processSignals) {
12044
+ process.off("SIGTERM", terminateOnce);
12045
+ process.off("SIGINT", terminateOnce);
12046
+ }
12047
+ };
12000
12048
  }
12001
12049
 
12002
12050
  const SIDE_QUESTION_SYSTEM_PROMPT = [
@@ -12111,7 +12159,7 @@ function registerSideQuestionHandler(rpc, deps) {
12111
12159
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12112
12160
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12113
12161
  const run = deps.run ?? (async (input) => {
12114
- const { query } = await import('./index-DK0qz1y7.mjs');
12162
+ const { query } = await import('./index-CEDPokKf.mjs');
12115
12163
  return runSideQuestion(query, input);
12116
12164
  });
12117
12165
  const slots = /* @__PURE__ */ new Map();
@@ -16590,7 +16638,7 @@ async function runCodex(opts) {
16590
16638
  }
16591
16639
  };
16592
16640
  session.rpcHandlerManager.registerHandler("abort", handleAbort);
16593
- registerKillSessionHandler(session.rpcHandlerManager, handleKillSession, session);
16641
+ const disposeTermination = registerKillSessionHandler(session.rpcHandlerManager, handleKillSession, session, { processSignals: true });
16594
16642
  const messageBuffer = new MessageBuffer();
16595
16643
  const hasTTY = process.stdout.isTTY && process.stdin.isTTY;
16596
16644
  let inkInstance = null;
@@ -16926,6 +16974,7 @@ async function runCodex(opts) {
16926
16974
  }
16927
16975
  }
16928
16976
  } finally {
16977
+ disposeTermination?.();
16929
16978
  logger.debug("[codex]: Final cleanup start");
16930
16979
  logActiveHandles("cleanup-start");
16931
16980
  if (reconnectionHandle) {
@@ -17128,7 +17177,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17128
17177
  process.exit(0);
17129
17178
  } else if (subcommand === "install-terminal-hooks") {
17130
17179
  try {
17131
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-CRWWmonO.mjs');
17180
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-BT4Dq28Y.mjs');
17132
17181
  const command = parseTerminalHooksArgs(args.slice(1));
17133
17182
  if (command.action === "help") {
17134
17183
  console.log(TERMINAL_HOOKS_HELP);
@@ -17145,7 +17194,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17145
17194
  }
17146
17195
  } else if (subcommand === "spawn") {
17147
17196
  try {
17148
- const { handleSpawnCommand } = await import('./spawn-DrQo81MW.mjs');
17197
+ const { handleSpawnCommand } = await import('./spawn-QtKlr8Ig.mjs');
17149
17198
  await handleSpawnCommand(args.slice(1));
17150
17199
  } catch (error) {
17151
17200
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17157,7 +17206,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17157
17206
  return;
17158
17207
  } else if (subcommand === "sessions") {
17159
17208
  try {
17160
- const { handleSessionsCommand } = await import('./sessions-CP9FlcJ6.mjs');
17209
+ const { handleSessionsCommand } = await import('./sessions-CJuwvEr0.mjs');
17161
17210
  await handleSessionsCommand(args.slice(1));
17162
17211
  } catch (error) {
17163
17212
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17169,7 +17218,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17169
17218
  return;
17170
17219
  } else if (subcommand === "send") {
17171
17220
  try {
17172
- const { handleSendCommand } = await import('./send-CSOeUlQC.mjs');
17221
+ const { handleSendCommand } = await import('./send-DHShoBeq.mjs');
17173
17222
  await handleSendCommand(args.slice(1));
17174
17223
  } catch (error) {
17175
17224
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17275,9 +17324,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17275
17324
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17276
17325
  const projectId = args[3];
17277
17326
  try {
17278
- const { saveGoogleCloudProjectToConfig } = await import('./config-ClCkJ1a_.mjs');
17279
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./limits-C9aXkP7U.mjs').then(function (n) { return n.W; });
17280
- const { ApiClient: ApiClient2 } = await import('./types-CA-c2NH7.mjs').then(function (n) { return n.$; });
17327
+ const { saveGoogleCloudProjectToConfig } = await import('./config-C4gWfnJX.mjs');
17328
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./limits-BGeIBBE3.mjs').then(function (n) { return n.W; });
17329
+ const { ApiClient: ApiClient2 } = await import('./types-Cq-tvv9t.mjs').then(function (n) { return n.$; });
17281
17330
  let userEmail = void 0;
17282
17331
  try {
17283
17332
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17308,7 +17357,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17308
17357
  }
17309
17358
  if (geminiSubcommand === "project" && args[2] === "get") {
17310
17359
  try {
17311
- const { readGeminiLocalConfig } = await import('./config-ClCkJ1a_.mjs');
17360
+ const { readGeminiLocalConfig } = await import('./config-C4gWfnJX.mjs');
17312
17361
  const config = readGeminiLocalConfig();
17313
17362
  if (config.googleCloudProject) {
17314
17363
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17348,7 +17397,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17348
17397
  process.exit(0);
17349
17398
  }
17350
17399
  try {
17351
- const { runGemini } = await import('./runGemini-BjEl7syj.mjs');
17400
+ const { runGemini } = await import('./runGemini-DGTNwiLo.mjs');
17352
17401
  let startedBy = void 0;
17353
17402
  for (let i = 1; i < args.length; i++) {
17354
17403
  if (args[i] === "--started-by") {
@@ -17378,7 +17427,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17378
17427
  }
17379
17428
  };
17380
17429
  try {
17381
- const { runAcp, resolveAcpAgentConfig } = await import('./index-DdbU8FmA.mjs');
17430
+ const { runAcp, resolveAcpAgentConfig } = await import('./index-B6UvB88K.mjs');
17382
17431
  const parsed = parsePiRunnerArgs(args.slice(1));
17383
17432
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17384
17433
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17406,7 +17455,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17406
17455
  return;
17407
17456
  } else if (subcommand === "acp") {
17408
17457
  try {
17409
- const { runAcp, resolveAcpAgentConfig } = await import('./index-DdbU8FmA.mjs');
17458
+ const { runAcp, resolveAcpAgentConfig } = await import('./index-B6UvB88K.mjs');
17410
17459
  let startedBy = void 0;
17411
17460
  let verbose = false;
17412
17461
  const acpArgs = [];
@@ -17446,7 +17495,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17446
17495
  return;
17447
17496
  } else if (subcommand === "openclaw") {
17448
17497
  try {
17449
- const { runOpenClaw } = await import('./runOpenClaw-ByHu69K5.mjs');
17498
+ const { runOpenClaw } = await import('./runOpenClaw-CxgTFOSM.mjs');
17450
17499
  let startedBy = void 0;
17451
17500
  let verbose = false;
17452
17501
  let gatewayUrl;
@@ -17497,7 +17546,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17497
17546
  return;
17498
17547
  } else if (subcommand === "todo") {
17499
17548
  try {
17500
- const { handleTodoCommand } = await import('./todo-BAwevRyb.mjs');
17549
+ const { handleTodoCommand } = await import('./todo-CkJ5UjWs.mjs');
17501
17550
  await handleTodoCommand(args.slice(1));
17502
17551
  } catch (error) {
17503
17552
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -17506,7 +17555,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17506
17555
  return;
17507
17556
  } else if (subcommand === "teams") {
17508
17557
  try {
17509
- const { handleTeamsCommand } = await import('./teams-Bbvo1G6y.mjs');
17558
+ const { handleTeamsCommand } = await import('./teams-BF-GxUZc.mjs');
17510
17559
  await handleTeamsCommand(args.slice(1));
17511
17560
  } catch (error) {
17512
17561
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -17515,7 +17564,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17515
17564
  return;
17516
17565
  } else if (subcommand === "mcp" && args.length === 1) {
17517
17566
  try {
17518
- const { handleMcpCommand } = await import('./mcp-DkoXvc07.mjs');
17567
+ const { handleMcpCommand } = await import('./mcp-BGu_dUaJ.mjs');
17519
17568
  await handleMcpCommand();
17520
17569
  } catch (error) {
17521
17570
  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-D1gHXtkw.mjs';
1
+ import { q as query } from './index-BqUOj1zK.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-CA-c2NH7.mjs';
6
+ import './types-Cq-tvv9t.mjs';
7
7
  import 'axios';
8
- import './limits-C9aXkP7U.mjs';
8
+ import './limits-BGeIBBE3.mjs';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
11
11
  import 'node:path';
@@ -29,7 +29,7 @@ import 'fs';
29
29
  import 'node:readline';
30
30
  import '@anthropic-ai/sandbox-runtime';
31
31
  import 'expo-server-sdk';
32
- import './agentGuidance-DeOIgOhh.mjs';
32
+ import './agentGuidance-CPG5Cr5T.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import 'ps-list';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Dn7s2iaT.cjs');
3
+ var index = require('./index-B1plzL9M.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-B15E2OVy.cjs');
8
+ require('./types-Dabm17Ln.cjs');
9
9
  require('axios');
10
- require('./limits-DLlsV71c.cjs');
10
+ require('./limits-D6kiAfXJ.cjs');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
13
13
  require('node:path');
@@ -31,7 +31,7 @@ require('fs');
31
31
  require('node:readline');
32
32
  require('@anthropic-ai/sandbox-runtime');
33
33
  require('expo-server-sdk');
34
- require('./agentGuidance-R9MH5Cd5.cjs');
34
+ require('./agentGuidance-Cg8Lha39.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('ps-list');
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var AcpBackend = require('./AcpBackend--EnHZRC4.cjs');
4
- var persistence = require('./limits-DLlsV71c.cjs');
5
- var AcpSessionManager = require('./AcpSessionManager-RoOyx5KI.cjs');
6
- var api = require('./types-B15E2OVy.cjs');
7
- var index = require('./index-Dn7s2iaT.cjs');
3
+ var AcpBackend = require('./AcpBackend-CeNp7tgD.cjs');
4
+ var persistence = require('./limits-D6kiAfXJ.cjs');
5
+ var AcpSessionManager = require('./AcpSessionManager-Bu1d05bx.cjs');
6
+ var api = require('./types-Dabm17Ln.cjs');
7
+ var index = require('./index-B1plzL9M.cjs');
8
8
  var promises = require('node:fs/promises');
9
9
  var node_crypto = require('node:crypto');
10
10
  var path = require('node:path');
@@ -33,7 +33,7 @@ require('fs');
33
33
  require('node:readline');
34
34
  require('@anthropic-ai/sandbox-runtime');
35
35
  require('expo-server-sdk');
36
- require('./agentGuidance-R9MH5Cd5.cjs');
36
+ require('./agentGuidance-Cg8Lha39.cjs');
37
37
  require('ink');
38
38
  require('react');
39
39
  require('@anthropic-ai/claude-agent-sdk');
@@ -750,6 +750,7 @@ async function runAcp(opts) {
750
750
  let shouldExit = false;
751
751
  let abortController = new AbortController();
752
752
  let pendingTurn = null;
753
+ let turnCancelled = false;
753
754
  const clearPendingTurn = (error) => {
754
755
  if (!pendingTurn) {
755
756
  return;
@@ -1095,6 +1096,7 @@ async function runAcp(opts) {
1095
1096
  session.keepAlive(thinking, "remote");
1096
1097
  }, 2e3);
1097
1098
  async function handleAbort() {
1099
+ turnCancelled = thinking;
1098
1100
  try {
1099
1101
  if (acpSessionId) {
1100
1102
  await backend.cancel(acpSessionId);
@@ -1124,12 +1126,12 @@ async function runAcp(opts) {
1124
1126
  return { mode };
1125
1127
  }
1126
1128
  );
1127
- index.registerKillSessionHandler(session.rpcHandlerManager, async () => {
1129
+ const disposeTermination = index.registerKillSessionHandler(session.rpcHandlerManager, async () => {
1128
1130
  shouldExit = true;
1129
1131
  messageQueue.close();
1130
1132
  clearPendingTurn(new Error("Session terminated"));
1131
1133
  await handleAbort();
1132
- }, session);
1134
+ }, session, { processSignals: true });
1133
1135
  try {
1134
1136
  const started = await backend.startSession();
1135
1137
  acpSessionId = started.sessionId;
@@ -1175,8 +1177,11 @@ async function runAcp(opts) {
1175
1177
  }
1176
1178
  logAcp("incoming", `Incoming prompt: ${formatUnknownForConsole(batch.message, ACP_EVENT_PREVIEW_CHARS)}`);
1177
1179
  sendEnvelopes(sessionManager.startTurn());
1180
+ turnCancelled = false;
1178
1181
  setThinking(true);
1179
1182
  const turnEnded = waitForTurnEnd();
1183
+ void turnEnded.catch(() => {
1184
+ });
1180
1185
  try {
1181
1186
  if (typeof batch.mode.permissionMode === "string" && batch.mode.permissionMode.length > 0) {
1182
1187
  await switchPermissionModeIfRequested(batch.mode.permissionMode);
@@ -1196,7 +1201,7 @@ ${api.BUILTIN_TODO_DISCOVERY}`;
1196
1201
  await backend.sendPrompt(acpSessionId, index.appendStagedAttachmentsToPrompt(prompt, staged), attachments);
1197
1202
  todoDiscoverySent = true;
1198
1203
  await turnEnded;
1199
- sendEnvelopes(sessionManager.endTurn("completed"));
1204
+ sendEnvelopes(sessionManager.endTurn(turnCancelled ? "cancelled" : "completed"));
1200
1205
  streamRelay.endTurn();
1201
1206
  setThinking(false);
1202
1207
  session.sendSessionEvent({ type: "ready" });
@@ -1215,6 +1220,7 @@ ${api.BUILTIN_TODO_DISCOVERY}`;
1215
1220
  }
1216
1221
  }
1217
1222
  } finally {
1223
+ disposeTermination?.();
1218
1224
  setThinking(false);
1219
1225
  clearInterval(keepAliveInterval);
1220
1226
  streamRelay.endTurn();
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-Dn7s2iaT.cjs');
5
- require('./limits-DLlsV71c.cjs');
4
+ require('./index-B1plzL9M.cjs');
5
+ require('./limits-D6kiAfXJ.cjs');
6
6
  require('zod');
7
- require('./types-B15E2OVy.cjs');
7
+ require('./types-Dabm17Ln.cjs');
8
8
  require('node:child_process');
9
9
  require('node:os');
10
10
  require('node:crypto');
@@ -12,7 +12,7 @@ require('cross-spawn');
12
12
  require('node:path');
13
13
  require('node:readline');
14
14
  require('node:fs');
15
- require('./agentGuidance-R9MH5Cd5.cjs');
15
+ require('./agentGuidance-Cg8Lha39.cjs');
16
16
  require('node:fs/promises');
17
17
  require('fs/promises');
18
18
  require('ink');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './index-D1gHXtkw.mjs';
3
- import './limits-C9aXkP7U.mjs';
2
+ import './index-BqUOj1zK.mjs';
3
+ import './limits-BGeIBBE3.mjs';
4
4
  import 'zod';
5
- import './types-CA-c2NH7.mjs';
5
+ import './types-Cq-tvv9t.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:os';
8
8
  import 'node:crypto';
@@ -10,7 +10,7 @@ import 'cross-spawn';
10
10
  import 'node:path';
11
11
  import 'node:readline';
12
12
  import 'node:fs';
13
- import './agentGuidance-DeOIgOhh.mjs';
13
+ import './agentGuidance-CPG5Cr5T.mjs';
14
14
  import 'node:fs/promises';
15
15
  import 'fs/promises';
16
16
  import 'ink';
@@ -3,10 +3,10 @@ import { join, resolve } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { spawnSync } from 'node:child_process';
5
5
  import chalk from 'chalk';
6
- import { p as projectPath } from './types-CA-c2NH7.mjs';
7
- import { t as tmuxSupportsSessionEnv } from './index-D1gHXtkw.mjs';
6
+ import { p as projectPath } from './types-Cq-tvv9t.mjs';
7
+ import { t as tmuxSupportsSessionEnv } from './index-BqUOj1zK.mjs';
8
8
  import 'axios';
9
- import './limits-C9aXkP7U.mjs';
9
+ import './limits-BGeIBBE3.mjs';
10
10
  import 'node:fs/promises';
11
11
  import 'zod';
12
12
  import 'node:crypto';
@@ -28,7 +28,7 @@ import 'fs';
28
28
  import 'node:readline';
29
29
  import '@anthropic-ai/sandbox-runtime';
30
30
  import 'expo-server-sdk';
31
- import './agentGuidance-DeOIgOhh.mjs';
31
+ import './agentGuidance-CPG5Cr5T.mjs';
32
32
  import 'ink';
33
33
  import 'react';
34
34
  import '@anthropic-ai/claude-agent-sdk';
@@ -5,10 +5,10 @@ var path = require('node:path');
5
5
  var os = require('node:os');
6
6
  var node_child_process = require('node:child_process');
7
7
  var chalk = require('chalk');
8
- var api = require('./types-B15E2OVy.cjs');
9
- var index = require('./index-Dn7s2iaT.cjs');
8
+ var api = require('./types-Dabm17Ln.cjs');
9
+ var index = require('./index-B1plzL9M.cjs');
10
10
  require('axios');
11
- require('./limits-DLlsV71c.cjs');
11
+ require('./limits-D6kiAfXJ.cjs');
12
12
  require('node:fs/promises');
13
13
  require('zod');
14
14
  require('node:crypto');
@@ -30,7 +30,7 @@ require('fs');
30
30
  require('node:readline');
31
31
  require('@anthropic-ai/sandbox-runtime');
32
32
  require('expo-server-sdk');
33
- require('./agentGuidance-R9MH5Cd5.cjs');
33
+ require('./agentGuidance-Cg8Lha39.cjs');
34
34
  require('ink');
35
35
  require('react');
36
36
  require('@anthropic-ai/claude-agent-sdk');
package/dist/lib.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./types-B15E2OVy.cjs');
4
- var persistence = require('./limits-DLlsV71c.cjs');
3
+ var api = require('./types-Dabm17Ln.cjs');
4
+ var persistence = require('./limits-D6kiAfXJ.cjs');
5
5
  require('axios');
6
6
  require('node:events');
7
7
  require('socket.io-client');