very-happy-cli 0.2.135 → 0.2.137

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 (43) hide show
  1. package/dist/{AcpBackend-C0Bwx6bc.cjs → AcpBackend-Bcmm51Ya.cjs} +2 -2
  2. package/dist/{AcpBackend-CkDpu1n_.mjs → AcpBackend-POcimRNQ.mjs} +2 -2
  3. package/dist/{AcpSessionManager-DqvUp-UU.cjs → AcpSessionManager-CjrwSZbh.cjs} +1 -1
  4. package/dist/{AcpSessionManager-DB_mfFaH.mjs → AcpSessionManager-D54Juu2-.mjs} +1 -1
  5. package/dist/{agentGuidance-DlZM_YPV.cjs → agentGuidance-D1tKg2UW.cjs} +1 -1
  6. package/dist/{agentGuidance-7MByWxKj.mjs → agentGuidance-DulugsMk.mjs} +1 -1
  7. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  8. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  9. package/dist/{config-DzvbcL_x.mjs → config-C1gQprK_.mjs} +4 -4
  10. package/dist/{config-BO0ZHyoB.cjs → config-Dr3A4IGp.cjs} +4 -4
  11. package/dist/{index-DNbKbe23.cjs → index-B0KIJdSt.cjs} +98 -32
  12. package/dist/{index-C33JB4xB.mjs → index-B11rFE7f.mjs} +7 -7
  13. package/dist/{index-BEpZjXs4.cjs → index-C3JqT3Ql.cjs} +6 -6
  14. package/dist/{index-CpEdOGpe.mjs → index-C3agc8KT.mjs} +4 -4
  15. package/dist/{index-gefLe1Bk.mjs → index-D5MRxCHs.mjs} +94 -28
  16. package/dist/{index-DHI6Y1xW.cjs → index-hGg5G5uO.cjs} +4 -4
  17. package/dist/index.cjs +4 -4
  18. package/dist/index.mjs +4 -4
  19. package/dist/{installTerminalHooks-gmWKACNb.cjs → installTerminalHooks-Culr259-.cjs} +4 -4
  20. package/dist/{installTerminalHooks-BWoHGCew.mjs → installTerminalHooks-DfZTXVWO.mjs} +4 -4
  21. package/dist/lib.cjs +2 -2
  22. package/dist/lib.mjs +2 -2
  23. package/dist/{limits-CPTgiQ9A.mjs → limits-CAD4UF8w.mjs} +7 -7
  24. package/dist/{limits-K17AgMHD.cjs → limits-CJrrAhB4.cjs} +7 -7
  25. package/dist/{mcp-CK1NCZm0.cjs → mcp-5Jf6V4eb.cjs} +4 -4
  26. package/dist/{mcp-DhuxpwTB.mjs → mcp-CdnZbYKV.mjs} +4 -4
  27. package/dist/{runGemini-BVJE7LZl.mjs → runGemini-CwWEorS7.mjs} +6 -6
  28. package/dist/{runGemini-n0wD2Z9R.cjs → runGemini-GjBPzXEt.cjs} +6 -6
  29. package/dist/{runOpenClaw-CJaIYpB7.mjs → runOpenClaw-BZHHy9T7.mjs} +5 -5
  30. package/dist/{runOpenClaw-fYx1XweW.cjs → runOpenClaw-DGe5c571.cjs} +5 -5
  31. package/dist/{send-fWHOFJV9.mjs → send-BN2PncAH.mjs} +4 -4
  32. package/dist/{send-WlJ4r3U2.cjs → send-teYpfTtw.cjs} +4 -4
  33. package/dist/{sessions-5fJxQ2xj.mjs → sessions-TLUfYdLX.mjs} +4 -4
  34. package/dist/{sessions-Cx_3cvN6.cjs → sessions-qP1YUf5E.cjs} +4 -4
  35. package/dist/{spawn-CF1ZV-YH.mjs → spawn-D3P8wJ_r.mjs} +4 -4
  36. package/dist/{spawn-DVJtNwWN.cjs → spawn-GekaZ7h2.cjs} +4 -4
  37. package/dist/{teams-BbYi0fWG.cjs → teams-BSqAW2S5.cjs} +4 -4
  38. package/dist/{teams-gzvKrMfn.mjs → teams-WSjEXh4d.mjs} +4 -4
  39. package/dist/{todo-BAK2DVLV.mjs → todo-BblDgT77.mjs} +3 -3
  40. package/dist/{todo-DHY20tpD.cjs → todo-DsnXWl77.cjs} +3 -3
  41. package/dist/{types-BEXGahmj.mjs → types-B8g_V-LQ.mjs} +19 -5
  42. package/dist/{types-DjAHWb4J.cjs → types-BAhQF6Xp.cjs} +20 -6
  43. 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-K17AgMHD.cjs');
7
- var api = require('./types-DjAHWb4J.cjs');
6
+ var persistence = require('./limits-CJrrAhB4.cjs');
7
+ var api = require('./types-BAhQF6Xp.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-CPTgiQ9A.mjs';
5
- import { d as contentLogMetadata, e as errorLogMetadata, h as delay } from './types-BEXGahmj.mjs';
4
+ import { l as logger, p as packageJson } from './limits-CAD4UF8w.mjs';
5
+ import { d as contentLogMetadata, e as errorLogMetadata, h as delay } from './types-B8g_V-LQ.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 api = require('./types-DjAHWb4J.cjs');
4
+ var api = require('./types-BAhQF6Xp.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 { s as streamKeyOf, c as createEnvelope } from './types-BEXGahmj.mjs';
2
+ import { s as streamKeyOf, c as createEnvelope } from './types-B8g_V-LQ.mjs';
3
3
 
4
4
  function turnOptions(turnId, time) {
5
5
  return turnId ? { turn: turnId, time } : { time };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var z = require('zod');
4
4
  var node_crypto = require('node:crypto');
5
- var persistence = require('./limits-K17AgMHD.cjs');
5
+ var persistence = require('./limits-CJrrAhB4.cjs');
6
6
  var promises = require('node:fs/promises');
7
7
  var node_fs = require('node:fs');
8
8
  var path = require('node:path');
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { randomUUID } from 'node:crypto';
3
- import { n as normalizeHttpEndpoint, c as configuration, g as readSettings, r as readPersistedSessions, d as readCredentialsForConfiguredRelay } from './limits-CPTgiQ9A.mjs';
3
+ import { n as normalizeHttpEndpoint, c as configuration, g as readSettings, r as readPersistedSessions, d as readCredentialsForConfiguredRelay } from './limits-CAD4UF8w.mjs';
4
4
  import { open, mkdir, rename, unlink } from 'node:fs/promises';
5
5
  import { constants } from 'node:fs';
6
6
  import { isAbsolute, join, dirname } from 'node:path';
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var agentGuidance = require('../agentGuidance-DlZM_YPV.cjs');
3
+ var agentGuidance = require('../agentGuidance-D1tKg2UW.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-K17AgMHD.cjs');
9
+ var persistence = require('../limits-CJrrAhB4.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-7MByWxKj.mjs';
1
+ import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-DulugsMk.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-CPTgiQ9A.mjs';
7
+ import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-CAD4UF8w.mjs';
8
8
  import 'node:crypto';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
@@ -2,8 +2,8 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { homedir } from 'os';
4
4
  import { execSync } from 'child_process';
5
- import { l as logger } from './limits-CPTgiQ9A.mjs';
6
- import { j as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-gefLe1Bk.mjs';
5
+ import { l as logger } from './limits-CAD4UF8w.mjs';
6
+ import { j as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-D5MRxCHs.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-BEXGahmj.mjs';
16
+ import './types-B8g_V-LQ.mjs';
17
17
  import 'axios';
18
18
  import 'node:events';
19
19
  import 'socket.io-client';
@@ -28,7 +28,7 @@ import 'node-pty';
28
28
  import 'node:readline';
29
29
  import '@anthropic-ai/sandbox-runtime';
30
30
  import 'expo-server-sdk';
31
- import './agentGuidance-7MByWxKj.mjs';
31
+ import './agentGuidance-DulugsMk.mjs';
32
32
  import 'ink';
33
33
  import 'react';
34
34
  import '@anthropic-ai/claude-agent-sdk';
@@ -4,8 +4,8 @@ var fs = require('fs');
4
4
  var path = require('path');
5
5
  var os = require('os');
6
6
  var child_process = require('child_process');
7
- var persistence = require('./limits-K17AgMHD.cjs');
8
- var index = require('./index-DNbKbe23.cjs');
7
+ var persistence = require('./limits-CJrrAhB4.cjs');
8
+ var index = require('./index-B0KIJdSt.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-DjAHWb4J.cjs');
18
+ require('./types-BAhQF6Xp.cjs');
19
19
  require('axios');
20
20
  require('node:events');
21
21
  require('socket.io-client');
@@ -30,7 +30,7 @@ require('node-pty');
30
30
  require('node:readline');
31
31
  require('@anthropic-ai/sandbox-runtime');
32
32
  require('expo-server-sdk');
33
- require('./agentGuidance-DlZM_YPV.cjs');
33
+ require('./agentGuidance-D1tKg2UW.cjs');
34
34
  require('ink');
35
35
  require('react');
36
36
  require('@anthropic-ai/claude-agent-sdk');
@@ -3,13 +3,13 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var node_crypto = require('node:crypto');
6
- var api = require('./types-DjAHWb4J.cjs');
7
- var persistence = require('./limits-K17AgMHD.cjs');
6
+ var api = require('./types-BAhQF6Xp.cjs');
7
+ var persistence = require('./limits-CJrrAhB4.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
- var agentGuidance = require('./agentGuidance-DlZM_YPV.cjs');
12
+ var agentGuidance = require('./agentGuidance-D1tKg2UW.cjs');
13
13
  var promises = require('node:fs/promises');
14
14
  var fs = require('fs/promises');
15
15
  var ink = require('ink');
@@ -342,6 +342,20 @@ class Session {
342
342
  sessionId;
343
343
  mode = "local";
344
344
  thinking = false;
345
+ /**
346
+ * Window after a user-initiated abort during which stray promise rejections
347
+ * from tearing down the SDK query (MCP transports, in-flight tool calls,
348
+ * the aborted streaming generator) are benign teardown noise — NOT a real
349
+ * crash. The process-level unhandledRejection/uncaughtException handlers
350
+ * must not treat them as fatal and force-archive the session (the reported
351
+ * "点终止就 archive" bug). Self-expiring so a genuine later crash still
352
+ * archives normally.
353
+ */
354
+ abortingUntil = 0;
355
+ markAborting = (windowMs = 8e3) => {
356
+ this.abortingUntil = Date.now() + windowMs;
357
+ };
358
+ isAborting = () => Date.now() < this.abortingUntil;
345
359
  /**
346
360
  * Account-encrypted notification producer. Set lazily once we have a
347
361
  * server session id (notifications are addressed per session). May be
@@ -3925,6 +3939,18 @@ function createTurnSteeringController() {
3925
3939
  throw error;
3926
3940
  }
3927
3941
  },
3942
+ /**
3943
+ * Interrupt the current turn WITHOUT injecting a follow-up message —
3944
+ * used by the stop button. Like steer it keeps the streaming query
3945
+ * alive (same process, same claudeSessionId); unlike steer it does not
3946
+ * set the steering flag, so the turn simply ends and the query waits
3947
+ * for the next user message. Returns false when no query is attached.
3948
+ */
3949
+ async interruptTurn() {
3950
+ if (!interrupt) return false;
3951
+ await interrupt();
3952
+ return true;
3953
+ },
3928
3954
  consumeReady() {
3929
3955
  if (!steering) return false;
3930
3956
  steering = false;
@@ -4033,6 +4059,7 @@ class LaunchModeGate {
4033
4059
  }
4034
4060
  }
4035
4061
 
4062
+ const ABORT_INTERRUPT_GRACE_MS = 4e3;
4036
4063
  async function claudeRemoteLauncher(session, onPermissionModeChange, onEffectivePermissionMode, onPromptFinalized) {
4037
4064
  persistence.logger.debug("[claudeRemoteLauncher] Starting remote launcher");
4038
4065
  const hasTTY = process.stdout.isTTY && process.stdin.isTTY;
@@ -4081,9 +4108,29 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
4081
4108
  }
4082
4109
  async function doAbort() {
4083
4110
  persistence.logger.debug("[remote]: doAbort");
4111
+ session.markAborting();
4084
4112
  session.onAbort();
4113
+ if (session.thinking) {
4114
+ const interrupted = await turnSteering.interruptTurn().catch((e) => {
4115
+ persistence.logger.debug("[remote]: interruptTurn threw, falling back to hard abort", e);
4116
+ return false;
4117
+ });
4118
+ if (interrupted && await waitForThinkingToStop(ABORT_INTERRUPT_GRACE_MS)) {
4119
+ persistence.logger.debug("[remote]: interrupt stopped the turn gracefully; query kept alive");
4120
+ return;
4121
+ }
4122
+ persistence.logger.debug("[remote]: interrupt did not stop the turn in time; escalating to hard abort");
4123
+ }
4085
4124
  await abort();
4086
4125
  }
4126
+ async function waitForThinkingToStop(graceMs) {
4127
+ const deadline = Date.now() + graceMs;
4128
+ while (Date.now() < deadline) {
4129
+ if (!session.thinking) return true;
4130
+ await new Promise((resolve) => setTimeout(resolve, 100));
4131
+ }
4132
+ return !session.thinking;
4133
+ }
4087
4134
  async function doSwitch() {
4088
4135
  persistence.logger.debug("[remote]: doSwitch");
4089
4136
  if (!exitReason) {
@@ -7499,10 +7546,13 @@ function buildResumeLaunch(session, options = {}) {
7499
7546
  const { metadata } = session;
7500
7547
  const flavor = resolveFlavor(metadata);
7501
7548
  if (flavor === "codex") {
7502
- if (!metadata.codexThreadId) {
7503
- throw new Error(`Happy session ${session.id} is missing its Codex thread ID.`);
7549
+ const args = ["codex"];
7550
+ if (options.freshConversation) ; else {
7551
+ if (!metadata.codexThreadId) {
7552
+ throw new Error(`Happy session ${session.id} is missing its Codex thread ID.`);
7553
+ }
7554
+ args.push("--resume", metadata.codexThreadId);
7504
7555
  }
7505
- const args = ["codex", "--resume", metadata.codexThreadId];
7506
7556
  if (options.startedBy) {
7507
7557
  args.push("--started-by", options.startedBy);
7508
7558
  }
@@ -7512,9 +7562,6 @@ function buildResumeLaunch(session, options = {}) {
7512
7562
  };
7513
7563
  }
7514
7564
  if (flavor === "claude") {
7515
- if (!metadata.claudeSessionId) {
7516
- throw new Error(`Happy session ${session.id} is missing its Claude session ID.`);
7517
- }
7518
7565
  const args = ["claude"];
7519
7566
  if (options.claudeStartingMode) {
7520
7567
  args.push("--happy-starting-mode", options.claudeStartingMode);
@@ -7522,7 +7569,12 @@ function buildResumeLaunch(session, options = {}) {
7522
7569
  if (options.startedBy) {
7523
7570
  args.push("--started-by", options.startedBy);
7524
7571
  }
7525
- args.push("--resume", metadata.claudeSessionId);
7572
+ if (options.freshConversation) ; else {
7573
+ if (!metadata.claudeSessionId) {
7574
+ throw new Error(`Happy session ${session.id} is missing its Claude session ID.`);
7575
+ }
7576
+ args.push("--resume", metadata.claudeSessionId);
7577
+ }
7526
7578
  return {
7527
7579
  cwd: metadata.path,
7528
7580
  args
@@ -8003,7 +8055,7 @@ function parseJsonObject(text) {
8003
8055
  return null;
8004
8056
  }
8005
8057
  }
8006
- 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-DNbKbe23.cjs', document.baseURI).href))).resolve(s)) {
8058
+ 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-B0KIJdSt.cjs', document.baseURI).href))).resolve(s)) {
8007
8059
  const platformArch = `${platform}-${arch}`;
8008
8060
  const candidates = [
8009
8061
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -10821,12 +10873,18 @@ async function startDaemon() {
10821
10873
  cwdExists: (p) => fs$1.existsSync(p),
10822
10874
  conversationExists: (cwd, claudeSessionId) => fs$1.existsSync(path$1.join(api.getProjectPath(cwd), `${claudeSessionId}.jsonl`))
10823
10875
  });
10876
+ let freshConversation = false;
10824
10877
  if (!precheck.ok) {
10825
- return { type: "error", errorMessage: `resume-precheck:${precheck.reason}: ${precheck.detail}` };
10878
+ if (precheck.reason === "conversation-missing") {
10879
+ persistence.logger.debug(`[DAEMON RUN] resume: transcript for ${happySessionId} is gone (${precheck.detail}); starting a fresh conversation in ${metadata.path}`);
10880
+ freshConversation = true;
10881
+ } else {
10882
+ return { type: "error", errorMessage: `resume-precheck:${precheck.reason}: ${precheck.detail}` };
10883
+ }
10826
10884
  }
10827
10885
  const launch = buildResumeLaunch(
10828
10886
  { id: happySessionId, active: true, metadata },
10829
- { startedBy: "daemon", claudeStartingMode: "remote" }
10887
+ { startedBy: "daemon", claudeStartingMode: "remote", freshConversation }
10830
10888
  );
10831
10889
  const model = sanitizeResumeModel(options?.model);
10832
10890
  if (model) launch.args.push("--model", model);
@@ -12440,7 +12498,7 @@ function registerSideQuestionHandler(rpc, deps) {
12440
12498
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12441
12499
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12442
12500
  const run = deps.run ?? (async (input) => {
12443
- const { query } = await Promise.resolve().then(function () { return require('./index-DHI6Y1xW.cjs'); });
12501
+ const { query } = await Promise.resolve().then(function () { return require('./index-hGg5G5uO.cjs'); });
12444
12502
  return runSideQuestion(query, input);
12445
12503
  });
12446
12504
  const slots = /* @__PURE__ */ new Map();
@@ -12542,7 +12600,7 @@ const MAX_TITLE_CHARS = 60;
12542
12600
  const GENERATION_TIMEOUT_MS = 3e4;
12543
12601
  function resolveClaudeBinary() {
12544
12602
  try {
12545
- 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-DNbKbe23.cjs', document.baseURI).href)));
12603
+ 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-B0KIJdSt.cjs', document.baseURI).href)));
12546
12604
  const utilsPath = path.resolve(path.join(api.projectPath(), "scripts", "claude_version_utils.cjs"));
12547
12605
  const { getClaudeCliPath } = require$1(utilsPath);
12548
12606
  const path$1 = getClaudeCliPath();
@@ -13582,10 +13640,18 @@ async function runClaude(credentials, options = {}) {
13582
13640
  });
13583
13641
  process.on("uncaughtException", (error) => {
13584
13642
  persistence.logger.debug("[START] Uncaught exception:", error);
13643
+ if (currentSession?.isAborting()) {
13644
+ persistence.logger.debug("[START] Uncaught exception during abort teardown \u2014 swallowing, not archiving");
13645
+ return;
13646
+ }
13585
13647
  void cleanup({ archive: true });
13586
13648
  });
13587
13649
  process.on("unhandledRejection", (reason) => {
13588
13650
  persistence.logger.debug("[START] Unhandled rejection:", reason);
13651
+ if (currentSession?.isAborting()) {
13652
+ persistence.logger.debug("[START] Unhandled rejection during abort teardown \u2014 swallowing, not archiving");
13653
+ return;
13654
+ }
13589
13655
  void cleanup({ archive: true });
13590
13656
  });
13591
13657
  registerKillSessionHandler(session.rpcHandlerManager, () => cleanup({ archive: true }), session);
@@ -14760,9 +14826,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
14760
14826
  };
14761
14827
  }
14762
14828
 
14763
- 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-DNbKbe23.cjs', document.baseURI).href)));
14829
+ 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-B0KIJdSt.cjs', document.baseURI).href)));
14764
14830
  const __dirname$1 = path.dirname(__filename$1);
14765
- const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DNbKbe23.cjs', document.baseURI).href)));
14831
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-B0KIJdSt.cjs', document.baseURI).href)));
14766
14832
  const PRISMA_QUERY_ENGINE_FILES = {
14767
14833
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
14768
14834
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -17521,7 +17587,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17521
17587
  process.exit(0);
17522
17588
  } else if (subcommand === "install-terminal-hooks") {
17523
17589
  try {
17524
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-gmWKACNb.cjs'); });
17590
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-Culr259-.cjs'); });
17525
17591
  const command = parseTerminalHooksArgs(args.slice(1));
17526
17592
  if (command.action === "help") {
17527
17593
  console.log(TERMINAL_HOOKS_HELP);
@@ -17538,7 +17604,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17538
17604
  }
17539
17605
  } else if (subcommand === "spawn") {
17540
17606
  try {
17541
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-DVJtNwWN.cjs'); });
17607
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-GekaZ7h2.cjs'); });
17542
17608
  await handleSpawnCommand(args.slice(1));
17543
17609
  } catch (error) {
17544
17610
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17550,7 +17616,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17550
17616
  return;
17551
17617
  } else if (subcommand === "sessions") {
17552
17618
  try {
17553
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-Cx_3cvN6.cjs'); });
17619
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-qP1YUf5E.cjs'); });
17554
17620
  await handleSessionsCommand(args.slice(1));
17555
17621
  } catch (error) {
17556
17622
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17562,7 +17628,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17562
17628
  return;
17563
17629
  } else if (subcommand === "send") {
17564
17630
  try {
17565
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-WlJ4r3U2.cjs'); });
17631
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-teYpfTtw.cjs'); });
17566
17632
  await handleSendCommand(args.slice(1));
17567
17633
  } catch (error) {
17568
17634
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17668,9 +17734,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17668
17734
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17669
17735
  const projectId = args[3];
17670
17736
  try {
17671
- const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-BO0ZHyoB.cjs'); });
17672
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-K17AgMHD.cjs'); }).then(function (n) { return n.persistence; });
17673
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-DjAHWb4J.cjs'); }).then(function (n) { return n.api; });
17737
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-Dr3A4IGp.cjs'); });
17738
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-CJrrAhB4.cjs'); }).then(function (n) { return n.persistence; });
17739
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-BAhQF6Xp.cjs'); }).then(function (n) { return n.api; });
17674
17740
  let userEmail = void 0;
17675
17741
  try {
17676
17742
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17701,7 +17767,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17701
17767
  }
17702
17768
  if (geminiSubcommand === "project" && args[2] === "get") {
17703
17769
  try {
17704
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-BO0ZHyoB.cjs'); });
17770
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-Dr3A4IGp.cjs'); });
17705
17771
  const config = readGeminiLocalConfig();
17706
17772
  if (config.googleCloudProject) {
17707
17773
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17741,7 +17807,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17741
17807
  process.exit(0);
17742
17808
  }
17743
17809
  try {
17744
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-n0wD2Z9R.cjs'); });
17810
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-GjBPzXEt.cjs'); });
17745
17811
  let startedBy = void 0;
17746
17812
  for (let i = 1; i < args.length; i++) {
17747
17813
  if (args[i] === "--started-by") {
@@ -17771,7 +17837,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17771
17837
  }
17772
17838
  };
17773
17839
  try {
17774
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BEpZjXs4.cjs'); });
17840
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-C3JqT3Ql.cjs'); });
17775
17841
  const parsed = parsePiRunnerArgs(args.slice(1));
17776
17842
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17777
17843
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17799,7 +17865,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17799
17865
  return;
17800
17866
  } else if (subcommand === "acp") {
17801
17867
  try {
17802
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BEpZjXs4.cjs'); });
17868
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-C3JqT3Ql.cjs'); });
17803
17869
  let startedBy = void 0;
17804
17870
  let verbose = false;
17805
17871
  const acpArgs = [];
@@ -17839,7 +17905,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17839
17905
  return;
17840
17906
  } else if (subcommand === "openclaw") {
17841
17907
  try {
17842
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-fYx1XweW.cjs'); });
17908
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-DGe5c571.cjs'); });
17843
17909
  let startedBy = void 0;
17844
17910
  let verbose = false;
17845
17911
  let gatewayUrl;
@@ -17890,7 +17956,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17890
17956
  return;
17891
17957
  } else if (subcommand === "todo") {
17892
17958
  try {
17893
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-DHY20tpD.cjs'); });
17959
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-DsnXWl77.cjs'); });
17894
17960
  await handleTodoCommand(args.slice(1));
17895
17961
  } catch (error) {
17896
17962
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -17899,7 +17965,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17899
17965
  return;
17900
17966
  } else if (subcommand === "teams") {
17901
17967
  try {
17902
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-BbYi0fWG.cjs'); });
17968
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-BSqAW2S5.cjs'); });
17903
17969
  await handleTeamsCommand(args.slice(1));
17904
17970
  } catch (error) {
17905
17971
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -17908,7 +17974,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17908
17974
  return;
17909
17975
  } else if (subcommand === "mcp" && args.length === 1) {
17910
17976
  try {
17911
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-CK1NCZm0.cjs'); });
17977
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-5Jf6V4eb.cjs'); });
17912
17978
  await handleMcpCommand();
17913
17979
  } catch (error) {
17914
17980
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -1,9 +1,9 @@
1
- import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-CkDpu1n_.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-CkDpu1n_.mjs';
3
- import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-CPTgiQ9A.mjs';
4
- import { A as AcpSessionManager } from './AcpSessionManager-DB_mfFaH.mjs';
5
- import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-BEXGahmj.mjs';
6
- import { P as PI_TEAMS_EXTENSION, n as initialMachineMetadata, o as createSessionMetadata, u as setupOfflineReconnection, v as notifyDaemonSessionStarted, z as StreamRelay, x as MessageQueue2, B as hashObject, C as startHappyServer, E as registerAgentAttachmentDownloads, F as TitleGenerator, y as registerKillSessionHandler, H as CLAUDE_ATTACHMENT_KINDS, I as stageClaudeAttachments, J as appendStagedAttachmentsToPrompt, K as BasePermissionHandler, L as writeSessionModeFile, N as normalizeAcpPermissionMode, O as removeSessionModeFile } from './index-gefLe1Bk.mjs';
1
+ import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-POcimRNQ.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-POcimRNQ.mjs';
3
+ import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-CAD4UF8w.mjs';
4
+ import { A as AcpSessionManager } from './AcpSessionManager-D54Juu2-.mjs';
5
+ import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-B8g_V-LQ.mjs';
6
+ import { P as PI_TEAMS_EXTENSION, n as initialMachineMetadata, o as createSessionMetadata, u as setupOfflineReconnection, v as notifyDaemonSessionStarted, z as StreamRelay, x as MessageQueue2, B as hashObject, C as startHappyServer, E as registerAgentAttachmentDownloads, F as TitleGenerator, y as registerKillSessionHandler, H as CLAUDE_ATTACHMENT_KINDS, I as stageClaudeAttachments, J as appendStagedAttachmentsToPrompt, K as BasePermissionHandler, L as writeSessionModeFile, N as normalizeAcpPermissionMode, O as removeSessionModeFile } from './index-D5MRxCHs.mjs';
7
7
  import { mkdir, chmod, writeFile, rename } from 'node:fs/promises';
8
8
  import { randomUUID } from 'node:crypto';
9
9
  import { join } from 'node:path';
@@ -32,7 +32,7 @@ import 'fs';
32
32
  import 'node:readline';
33
33
  import '@anthropic-ai/sandbox-runtime';
34
34
  import 'expo-server-sdk';
35
- import './agentGuidance-7MByWxKj.mjs';
35
+ import './agentGuidance-DulugsMk.mjs';
36
36
  import 'ink';
37
37
  import 'react';
38
38
  import '@anthropic-ai/claude-agent-sdk';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var AcpBackend = require('./AcpBackend-C0Bwx6bc.cjs');
4
- var persistence = require('./limits-K17AgMHD.cjs');
5
- var AcpSessionManager = require('./AcpSessionManager-DqvUp-UU.cjs');
6
- var api = require('./types-DjAHWb4J.cjs');
7
- var index = require('./index-DNbKbe23.cjs');
3
+ var AcpBackend = require('./AcpBackend-Bcmm51Ya.cjs');
4
+ var persistence = require('./limits-CJrrAhB4.cjs');
5
+ var AcpSessionManager = require('./AcpSessionManager-CjrwSZbh.cjs');
6
+ var api = require('./types-BAhQF6Xp.cjs');
7
+ var index = require('./index-B0KIJdSt.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-DlZM_YPV.cjs');
36
+ require('./agentGuidance-D1tKg2UW.cjs');
37
37
  require('ink');
38
38
  require('react');
39
39
  require('@anthropic-ai/claude-agent-sdk');
@@ -1,11 +1,11 @@
1
- import { q as query } from './index-gefLe1Bk.mjs';
1
+ import { q as query } from './index-D5MRxCHs.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-BEXGahmj.mjs';
6
+ import './types-B8g_V-LQ.mjs';
7
7
  import 'axios';
8
- import './limits-CPTgiQ9A.mjs';
8
+ import './limits-CAD4UF8w.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-7MByWxKj.mjs';
32
+ import './agentGuidance-DulugsMk.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import 'ps-list';