very-happy-cli 0.2.153 → 0.2.154

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 (53) hide show
  1. package/dist/{AcpBackend-DSt8nTYm.cjs → AcpBackend-B14xNj5L.cjs} +2 -2
  2. package/dist/{AcpBackend-YDGv4E-g.mjs → AcpBackend-Ckyadhf4.mjs} +2 -2
  3. package/dist/{AcpSessionManager-uov6I9C8.cjs → AcpSessionManager-CCHmPdrR.cjs} +1 -1
  4. package/dist/{AcpSessionManager-Cxf5HQX1.mjs → AcpSessionManager-H8t4P-IW.mjs} +1 -1
  5. package/dist/{agentGuidance-BM4kMNyr.cjs → agentGuidance-DUBXppv-.cjs} +2 -1
  6. package/dist/{agentGuidance-C8unGWp7.mjs → agentGuidance-TLYQxsm2.mjs} +2 -1
  7. package/dist/{agentHome-D68Xh2ae.mjs → agentHome-B20RWdgE.mjs} +2 -2
  8. package/dist/{agentHome-BJ7bde35.cjs → agentHome-BUsLTZnz.cjs} +2 -2
  9. package/dist/{auto-CcXxfqkC.mjs → auto-BQnncDcs.mjs} +6 -6
  10. package/dist/{auto-C-90ojIH.cjs → auto-IeldARBS.cjs} +6 -6
  11. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  12. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  13. package/dist/{config-CHJ189UJ.mjs → config-B-ocQh5V.mjs} +4 -4
  14. package/dist/{config-D23kF0_u.cjs → config-DM_xI9M6.cjs} +4 -4
  15. package/dist/{index-BacwoXzs.mjs → index-BELV05ko.mjs} +248 -29
  16. package/dist/{index-DEOVn46R.cjs → index-BUxBxSxJ.cjs} +7 -7
  17. package/dist/{index-BXA9fxbK.mjs → index-CIx3248o.mjs} +4 -4
  18. package/dist/{index-BgYZGODP.mjs → index-ZKuBjvHi.mjs} +8 -8
  19. package/dist/{index-DHrwHxHf.cjs → index-eCjkm8Y2.cjs} +252 -32
  20. package/dist/{index-D49WvbDT.cjs → index-okLyUzeD.cjs} +4 -4
  21. package/dist/index.cjs +4 -4
  22. package/dist/index.mjs +4 -4
  23. package/dist/{install-BiOXBnnS.cjs → install-BZOdxfPd.cjs} +1 -1
  24. package/dist/{install-Ca7_Z3bV.mjs → install-CoLN3whR.mjs} +1 -1
  25. package/dist/{installTerminalHooks-BF0kL0ae.cjs → installTerminalHooks-CA4OcAS7.cjs} +4 -4
  26. package/dist/{installTerminalHooks-Bpl32K75.mjs → installTerminalHooks-Dde_8t36.mjs} +4 -4
  27. package/dist/lib.cjs +2 -2
  28. package/dist/lib.mjs +2 -2
  29. package/dist/{limits-DY_sFA3J.cjs → limits-CmzISka2.cjs} +7 -7
  30. package/dist/{limits-BtAuKRl2.mjs → limits-Dt7_unH4.mjs} +7 -7
  31. package/dist/{mcp-JpqI2POW.cjs → mcp-7iDHlyCI.cjs} +4 -4
  32. package/dist/{mcp-DQkmk4VV.mjs → mcp-9Ui4nQZL.mjs} +4 -4
  33. package/dist/{piRuntime-DRbbeQ72.cjs → piRuntime-BesGGPME.cjs} +2 -2
  34. package/dist/{piRuntime-DBpe12NN.mjs → piRuntime-C4E4pgye.mjs} +2 -2
  35. package/dist/{piTerminal-BoHvPEZ_.mjs → piTerminal-CCEGCQOY.mjs} +6 -6
  36. package/dist/{piTerminal-qdJ9KZVL.cjs → piTerminal-fUogwxYr.cjs} +6 -6
  37. package/dist/{runGemini-YqH7a-7O.mjs → runGemini-BW-pEklU.mjs} +6 -6
  38. package/dist/{runGemini-CtOEFvhf.cjs → runGemini-CNPGSsSK.cjs} +6 -6
  39. package/dist/{runOpenClaw-DoqZXBvL.cjs → runOpenClaw-Bsodkg_s.cjs} +5 -5
  40. package/dist/{runOpenClaw-DSSyFQBb.mjs → runOpenClaw-NRB6-_jU.mjs} +5 -5
  41. package/dist/{send-9075kHZP.cjs → send-Bd00QcHC.cjs} +55 -17
  42. package/dist/{send-Cs-RwqNf.mjs → send-DYeSFg8s.mjs} +55 -18
  43. package/dist/{sessions-iBnYzVUK.mjs → sessions-DlPOYKLU.mjs} +4 -4
  44. package/dist/{sessions-qULzUzlI.cjs → sessions-RIFUoy_g.cjs} +4 -4
  45. package/dist/{spawn-C6fRkedx.mjs → spawn-D1bhyHbH.mjs} +4 -4
  46. package/dist/{spawn-od9V23cc.cjs → spawn-DxrfHTF4.cjs} +4 -4
  47. package/dist/{teams-CrCzU-AV.cjs → teams-Cfy0VMCo.cjs} +5 -5
  48. package/dist/{teams-CkrWQ4uM.mjs → teams-pfKHpkgL.mjs} +5 -5
  49. package/dist/{todo-aCZmSt27.mjs → todo-B2CjDg_V.mjs} +2 -2
  50. package/dist/{todo-BCT_ZPuV.cjs → todo-B4cBFzHB.cjs} +2 -2
  51. package/dist/{types-CUCU7Vw8.cjs → types-Bd_TGr0F.cjs} +22 -3
  52. package/dist/{types-BvqOVUOW.mjs → types-D5RWyBE5.mjs} +22 -4
  53. package/package.json +7 -7
@@ -3,14 +3,14 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var node_crypto = require('node:crypto');
6
- var index = require('./types-CUCU7Vw8.cjs');
7
- var persistence = require('./limits-DY_sFA3J.cjs');
6
+ var index = require('./types-Bd_TGr0F.cjs');
7
+ var persistence = require('./limits-CmzISka2.cjs');
8
8
  var spawn = require('cross-spawn');
9
9
  var path = require('node:path');
10
10
  var node_readline = require('node:readline');
11
11
  var node_fs = require('node:fs');
12
12
  var terminalTitleSuggest = require('./terminalTitleSuggest-Dji8I0Jy.cjs');
13
- var agentGuidance = require('./agentGuidance-BM4kMNyr.cjs');
13
+ var agentGuidance = require('./agentGuidance-DUBXppv-.cjs');
14
14
  var promises = require('node:fs/promises');
15
15
  var fs = require('fs/promises');
16
16
  var ink = require('ink');
@@ -5402,8 +5402,8 @@ ${typeLabels[type] || type}:`));
5402
5402
  }
5403
5403
  console.log(chalk.gray(" An external claude command is only needed for native terminal/mirror use."));
5404
5404
  try {
5405
- const { resolveAgentHomesForCli } = await Promise.resolve().then(function () { return require('./agentHome-BJ7bde35.cjs'); });
5406
- const { describeAgentHome } = await Promise.resolve().then(function () { return require('./types-CUCU7Vw8.cjs'); }).then(function (n) { return n.index; });
5405
+ const { resolveAgentHomesForCli } = await Promise.resolve().then(function () { return require('./agentHome-BUsLTZnz.cjs'); });
5406
+ const { describeAgentHome } = await Promise.resolve().then(function () { return require('./types-Bd_TGr0F.cjs'); }).then(function (n) { return n.index; });
5407
5407
  const homes = await resolveAgentHomesForCli();
5408
5408
  console.log(chalk.green(`\u2713 Claude config dir: ${describeAgentHome(homes.claudeConfigDir)}`));
5409
5409
  console.log(chalk.green(`\u2713 Codex home: ${describeAgentHome(homes.codexHome)}`));
@@ -6284,6 +6284,7 @@ function startDaemonControlServer({
6284
6284
  getChildren,
6285
6285
  stopSession,
6286
6286
  spawnSession,
6287
+ resumeSession,
6287
6288
  requestShutdown,
6288
6289
  onHappySessionWebhook,
6289
6290
  onSessionStateEvent,
@@ -6496,6 +6497,48 @@ function startDaemonControlServer({
6496
6497
  };
6497
6498
  }
6498
6499
  });
6500
+ typed.post("/resume-session", {
6501
+ schema: {
6502
+ body: z.z.object({
6503
+ sessionId: z.z.string().min(1).max(200),
6504
+ model: z.z.string().optional(),
6505
+ permissionMode: z.z.string().optional()
6506
+ }),
6507
+ response: {
6508
+ 200: z.z.object({
6509
+ success: z.z.boolean(),
6510
+ sessionId: z.z.string().optional(),
6511
+ error: z.z.string().optional()
6512
+ }),
6513
+ 500: z.z.object({
6514
+ success: z.z.boolean(),
6515
+ error: z.z.string().optional()
6516
+ }),
6517
+ 503: z.z.object({
6518
+ success: z.z.boolean(),
6519
+ error: z.z.string().optional()
6520
+ })
6521
+ }
6522
+ }
6523
+ }, async (request, reply) => {
6524
+ const { sessionId, model, permissionMode } = request.body;
6525
+ if (!resumeSession) {
6526
+ reply.code(503);
6527
+ return { success: false, error: "daemon is still starting up" };
6528
+ }
6529
+ persistence.logger.debug(`[CONTROL SERVER] Resume session request: ${sessionId} (model=${model ?? "unset"}, permissionMode=${permissionMode ?? "unset"})`);
6530
+ const result = await resumeSession(sessionId, { model, permissionMode });
6531
+ switch (result.type) {
6532
+ case "success":
6533
+ return { success: true, sessionId: result.sessionId };
6534
+ case "requestToApproveDirectoryCreation":
6535
+ reply.code(500);
6536
+ return { success: false, error: `Cannot resume: working directory ${result.directory} needs to be created first` };
6537
+ case "error":
6538
+ reply.code(500);
6539
+ return { success: false, error: result.errorMessage };
6540
+ }
6541
+ });
6499
6542
  typed.post("/terminal-hook", {
6500
6543
  schema: {
6501
6544
  body: z.z.any(),
@@ -8144,7 +8187,7 @@ function parseJsonObject(text) {
8144
8187
  return null;
8145
8188
  }
8146
8189
  }
8147
- 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-DHrwHxHf.cjs', document.baseURI).href))).resolve(s)) {
8190
+ 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-eCjkm8Y2.cjs', document.baseURI).href))).resolve(s)) {
8148
8191
  const platformArch = `${platform}-${arch}`;
8149
8192
  const candidates = [
8150
8193
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -10018,6 +10061,35 @@ async function readSessionMetadata(sessionId, persisted) {
10018
10061
  if (typeof ciphertext !== "string" || ciphertext.length === 0) return null;
10019
10062
  return persistence.decrypt(persistence.decodeBase64(persisted.encryptionKey), persisted.encryptionVariant, persistence.decodeBase64(ciphertext));
10020
10063
  }
10064
+ async function readSessionState(sessionId, persisted) {
10065
+ const token = await bearerToken();
10066
+ const response = await axios.get(`${persistence.configuration.serverUrl}/v1/sessions/${encodeURIComponent(sessionId)}`, {
10067
+ headers: {
10068
+ "Authorization": `Bearer ${token}`,
10069
+ "X-Happy-Client": `${SESSION_OPS_CLIENT}/${persistence.configuration.currentCliVersion}`
10070
+ },
10071
+ timeout: 15e3,
10072
+ validateStatus: (status) => status >= 200 && status < 300 || status === 404
10073
+ });
10074
+ if (response.status === 404) return { found: false, active: false };
10075
+ const row = response.data?.session;
10076
+ if (!row || typeof row.id !== "string") throw new Error(`Server returned no session row for ${sessionId}`);
10077
+ const state = {
10078
+ found: true,
10079
+ active: row.active === true,
10080
+ ...typeof row.activeAt === "number" ? { activeAt: row.activeAt } : {},
10081
+ archivedAt: typeof row.archivedAt === "number" ? row.archivedAt : null,
10082
+ ...typeof row.updatedAt === "number" ? { updatedAt: row.updatedAt } : {}
10083
+ };
10084
+ if (persisted && typeof row.metadata === "string" && row.metadata.length > 0) {
10085
+ try {
10086
+ const metadata = persistence.decrypt(persistence.decodeBase64(persisted.encryptionKey), persisted.encryptionVariant, persistence.decodeBase64(row.metadata));
10087
+ if (metadata?.machineId) state.machineId = metadata.machineId;
10088
+ } catch {
10089
+ }
10090
+ }
10091
+ return state;
10092
+ }
10021
10093
  class TurnWaitTimeoutError extends Error {
10022
10094
  constructor(sessionId, timeoutMs, turn) {
10023
10095
  super(`Session ${sessionId}: the latest turn did not end within ${Math.round(timeoutMs / 1e3)}s`);
@@ -10055,6 +10127,20 @@ async function archiveSession(sessionId) {
10055
10127
  }
10056
10128
  );
10057
10129
  }
10130
+ async function unarchiveSession(sessionId) {
10131
+ const token = await bearerToken();
10132
+ await axios.post(
10133
+ `${persistence.configuration.serverUrl}/v1/sessions/${encodeURIComponent(sessionId)}/unarchive`,
10134
+ {},
10135
+ {
10136
+ headers: {
10137
+ "Authorization": `Bearer ${token}`,
10138
+ "X-Happy-Client": `${SESSION_OPS_CLIENT}/${persistence.configuration.currentCliVersion}`
10139
+ },
10140
+ timeout: 1e4
10141
+ }
10142
+ );
10143
+ }
10058
10144
 
10059
10145
  function receiptPath(home, operationId) {
10060
10146
  if (!/^[a-zA-Z0-9_-]{1,128}$/.test(operationId)) throw new Error("Invalid team operation id");
@@ -12081,6 +12167,8 @@ async function startDaemon() {
12081
12167
  getChildren: getCurrentChildren,
12082
12168
  stopSession,
12083
12169
  spawnSession,
12170
+ resumeSession,
12171
+ // B-501: `very-happy send --resume`
12084
12172
  requestShutdown: () => requestShutdown("happy-cli"),
12085
12173
  onHappySessionWebhook,
12086
12174
  onSessionStateEvent,
@@ -12485,6 +12573,127 @@ This session is now connected as the team lead. Call team_inspect to read the au
12485
12573
  };
12486
12574
  }
12487
12575
 
12576
+ const ACTIVE_FRESH_WINDOW_MS = 15 * 60 * 1e3;
12577
+ const DEFAULT_RESUME_WAIT_MS = 3e4;
12578
+ const DEFAULT_RESUME_POLL_MS = 1e3;
12579
+ function classifySessionState(input) {
12580
+ const { liveHere, server, now } = input;
12581
+ if (!server.found) return "not_found";
12582
+ if (typeof server.archivedAt === "number") return "archived";
12583
+ if (liveHere) return "live";
12584
+ if (server.active && typeof server.activeAt === "number" && now - server.activeAt <= ACTIVE_FRESH_WINDOW_MS) return "live";
12585
+ return "offline";
12586
+ }
12587
+ function explainNotLive(sessionId, status, resumeHint) {
12588
+ switch (status) {
12589
+ case "archived":
12590
+ return `Session ${sessionId} is archived \u2014 no live wrapper will receive this message. ${resumeHint}`;
12591
+ case "offline":
12592
+ return `Session ${sessionId} is offline (its wrapper exited or timed out) \u2014 no live wrapper will receive this message. ${resumeHint}`;
12593
+ case "not_found":
12594
+ return `Session ${sessionId} was not found on this account \u2014 it cannot be messaged or resumed. Spawn a new session instead.`;
12595
+ }
12596
+ }
12597
+ const CLI_RESUME_HINT = "Use --resume to bring it back on this machine, or spawn a new session.";
12598
+ const defaultDeps = {
12599
+ listLive: () => index.listDaemonSessions(),
12600
+ readState: (sessionId, persisted) => readSessionState(sessionId, persisted),
12601
+ send: (sessionId, persisted, text, client, options) => sendUserMessage(sessionId, persisted, text, client, options),
12602
+ unarchive: unarchiveSession,
12603
+ archive: archiveSession,
12604
+ resume: index.resumeDaemonSession,
12605
+ sleep: (ms) => index.delay(ms).then(() => void 0),
12606
+ now: () => Date.now()
12607
+ };
12608
+ async function deliverToSession(sessionId, persisted, text, client, options = {}, deps = {}) {
12609
+ const d = { ...defaultDeps, ...deps };
12610
+ const resumeHint = options.resumeHint ?? CLI_RESUME_HINT;
12611
+ const classify = async () => {
12612
+ const [live, server] = await Promise.all([d.listLive(), d.readState(sessionId, persisted)]);
12613
+ return classifySessionState({ liveHere: sessionLiveness(live, sessionId).live, server, now: d.now() });
12614
+ };
12615
+ let status = await classify();
12616
+ let resumed = false;
12617
+ let resumeOutcome;
12618
+ if (status !== "live") {
12619
+ if (!options.resume || status === "not_found") {
12620
+ return { sessionId, status, delivered: false, resumed: false, stored: false, error: explainNotLive(sessionId, status, resumeHint) };
12621
+ }
12622
+ const wasArchived = status === "archived";
12623
+ if (wasArchived) {
12624
+ try {
12625
+ await d.unarchive(sessionId);
12626
+ } catch (error) {
12627
+ const message = `unarchive failed: ${error instanceof Error ? error.message : String(error)}`;
12628
+ return { sessionId, status, delivered: false, resumed: false, stored: false, error: message, resume: { ok: false, error: message } };
12629
+ }
12630
+ }
12631
+ const outcome = await d.resume(sessionId, {
12632
+ ...typeof options.model === "string" ? { model: options.model } : {},
12633
+ ...options.permissionMode !== void 0 ? { permissionMode: options.permissionMode } : {}
12634
+ });
12635
+ if (!outcome.success) {
12636
+ let message = outcome.error ?? "resume failed";
12637
+ if (wasArchived) {
12638
+ try {
12639
+ await d.archive(sessionId);
12640
+ } catch (error) {
12641
+ message += `; failed to restore archive state: ${error instanceof Error ? error.message : String(error)}`;
12642
+ }
12643
+ }
12644
+ return { sessionId, status, delivered: false, resumed: false, stored: false, error: message, resume: { ok: false, error: message } };
12645
+ }
12646
+ resumed = true;
12647
+ resumeOutcome = { ok: true };
12648
+ status = await waitUntilLive(classify, d, options);
12649
+ if (status !== "live") {
12650
+ const waited = Math.round((options.waitMs ?? DEFAULT_RESUME_WAIT_MS) / 1e3);
12651
+ return {
12652
+ sessionId,
12653
+ status,
12654
+ delivered: false,
12655
+ resumed,
12656
+ stored: false,
12657
+ resume: resumeOutcome,
12658
+ error: `Session ${sessionId} was resumed but no live wrapper showed up within ${waited}s (state: ${status}); message not sent`
12659
+ };
12660
+ }
12661
+ }
12662
+ await d.send(sessionId, persisted, text, client, {
12663
+ ...options.model !== void 0 ? { model: options.model } : {},
12664
+ ...options.sentFrom !== void 0 ? { sentFrom: options.sentFrom } : {}
12665
+ });
12666
+ let after = "live";
12667
+ try {
12668
+ after = await classify();
12669
+ } catch {
12670
+ after = "live";
12671
+ }
12672
+ if (after !== "live") {
12673
+ return {
12674
+ sessionId,
12675
+ status: after,
12676
+ delivered: false,
12677
+ resumed,
12678
+ stored: true,
12679
+ ...resumeOutcome ? { resume: resumeOutcome } : {},
12680
+ error: `Session ${sessionId} went ${after} while sending: the message is stored server-side but no wrapper is attached to read it. ${after === "not_found" ? "Spawn a new session." : resumeHint}`
12681
+ };
12682
+ }
12683
+ return { sessionId, status: "live", delivered: true, resumed, stored: true, ...resumeOutcome ? { resume: resumeOutcome } : {} };
12684
+ }
12685
+ async function waitUntilLive(classify, d, options) {
12686
+ const waitMs = options.waitMs ?? DEFAULT_RESUME_WAIT_MS;
12687
+ const pollMs = options.pollMs ?? DEFAULT_RESUME_POLL_MS;
12688
+ const deadline = d.now() + waitMs;
12689
+ let status = await classify();
12690
+ while (status !== "live" && d.now() < deadline) {
12691
+ await d.sleep(pollMs);
12692
+ status = await classify();
12693
+ }
12694
+ return status;
12695
+ }
12696
+
12488
12697
  const PERSONAL_MEMORY_SOFT_LIMIT_CHARS = 2e3;
12489
12698
  function headingTitle(line) {
12490
12699
  const m = /^##(?!#)\s*(.*?)\s*$/.exec(line);
@@ -12584,11 +12793,13 @@ function fail(text) {
12584
12793
  function describeSession(id, persisted, extra) {
12585
12794
  const meta = persisted?.metadata;
12586
12795
  const parts = [id];
12796
+ if (extra?.live !== void 0) parts.push(extra.live ? "[running]" : "[not running]");
12587
12797
  if (meta?.summary?.text) parts.push(`title="${meta.summary.text}"`);
12588
12798
  if (meta?.path) parts.push(`cwd=${meta.path}`);
12589
12799
  if (meta?.flavor) parts.push(`agent=${meta.flavor}`);
12590
12800
  if (meta?.tags?.length) parts.push(`tags=${meta.tags.join(",")}`);
12591
12801
  if (meta?.variant === "assistant") parts.push("(assistant)");
12802
+ if (extra?.pid) parts.push(`pid=${extra.pid}`);
12592
12803
  parts.push(sessionWebUrl(id));
12593
12804
  return parts.join(" ");
12594
12805
  }
@@ -12642,19 +12853,27 @@ ${body}`);
12642
12853
  }
12643
12854
  });
12644
12855
  mcp.registerTool("session_send", {
12645
- description: "Send a user message into an existing session on this machine. Returns immediately after delivery \u2014 it does NOT wait for the session to respond; use session_read later to check progress.",
12856
+ description: "Send a user message into an existing session on this machine. Only delivers when a live wrapper will read it: an archived / offline session is refused (the server would store the message unread) unless resume:true brings it back on this machine first. Returns immediately after delivery \u2014 it does NOT wait for the session to respond; use session_read later to check progress.",
12646
12857
  title: "Send Message to Session",
12647
12858
  inputSchema: {
12648
12859
  sessionId: z.z.string().describe("The Happy session id to message"),
12649
- text: z.z.string().describe("The message text to send")
12860
+ text: z.z.string().describe("The message text to send"),
12861
+ resume: z.z.boolean().optional().describe("If the session is archived or offline, resume it on this machine (like the web Restore button) and wait until it is live before sending")
12650
12862
  }
12651
12863
  }, async (args) => {
12652
12864
  if (!index.isValidSessionId(args.sessionId)) return fail("Invalid sessionId");
12653
12865
  if (typeof args.text !== "string" || args.text.trim().length === 0) return fail("text must be non-empty");
12654
12866
  try {
12655
12867
  const persisted = await waitForSessionKey(args.sessionId, 0);
12656
- await sendUserMessage(args.sessionId, persisted, args.text, MCP_CLIENT_TAG);
12657
- return ok(`Message delivered to ${describeSession(args.sessionId, persisted)}`);
12868
+ const result = await deliverToSession(args.sessionId, persisted, args.text, MCP_CLIENT_TAG, {
12869
+ resume: args.resume === true,
12870
+ resumeHint: "Pass resume:true to bring it back on this machine, or spawn a new session."
12871
+ });
12872
+ if (!result.delivered) {
12873
+ const detail = result.error ?? `session is ${result.status}`;
12874
+ return fail(result.stored ? `Not delivered: ${detail}` : `Session ${args.sessionId} is ${result.status}: ${detail}`);
12875
+ }
12876
+ return ok(`Message delivered${result.resumed ? " (session resumed on this machine)" : ""} to ${describeSession(args.sessionId, persisted, { live: true })}`);
12658
12877
  } catch (error) {
12659
12878
  return fail(`Failed to send: ${error instanceof Error ? error.message : String(error)}`);
12660
12879
  }
@@ -13427,7 +13646,7 @@ function registerSideQuestionHandler(rpc, deps) {
13427
13646
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
13428
13647
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
13429
13648
  const fork = deps.run ?? (async (input) => {
13430
- const { query } = await Promise.resolve().then(function () { return require('./index-D49WvbDT.cjs'); });
13649
+ const { query } = await Promise.resolve().then(function () { return require('./index-okLyUzeD.cjs'); });
13431
13650
  return runSideQuestion(query, input);
13432
13651
  });
13433
13652
  const run = async (input, live) => {
@@ -13546,7 +13765,7 @@ const MAX_TITLE_CHARS = 60;
13546
13765
  const GENERATION_TIMEOUT_MS = 3e4;
13547
13766
  function resolveClaudeBinary() {
13548
13767
  try {
13549
- 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-DHrwHxHf.cjs', document.baseURI).href)));
13768
+ 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-eCjkm8Y2.cjs', document.baseURI).href)));
13550
13769
  const utilsPath = path.resolve(path.join(terminalTitleSuggest.projectPath(), "scripts", "claude_version_utils.cjs"));
13551
13770
  const { getClaudeCliPath } = require$1(utilsPath);
13552
13771
  const path$1 = getClaudeCliPath();
@@ -15781,9 +16000,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
15781
16000
  };
15782
16001
  }
15783
16002
 
15784
- 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-DHrwHxHf.cjs', document.baseURI).href)));
16003
+ 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-eCjkm8Y2.cjs', document.baseURI).href)));
15785
16004
  const __dirname$1 = path.dirname(__filename$1);
15786
- const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DHrwHxHf.cjs', document.baseURI).href)));
16005
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-eCjkm8Y2.cjs', document.baseURI).href)));
15787
16006
  const PRISMA_QUERY_ENGINE_FILES = {
15788
16007
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
15789
16008
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -18721,7 +18940,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18721
18940
  return;
18722
18941
  } else if (subcommand === "install-terminal-hooks") {
18723
18942
  try {
18724
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-BF0kL0ae.cjs'); });
18943
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CA4OcAS7.cjs'); });
18725
18944
  const command = parseTerminalHooksArgs(args.slice(1));
18726
18945
  if (command.action === "help") {
18727
18946
  console.log(TERMINAL_HOOKS_HELP);
@@ -18738,7 +18957,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18738
18957
  }
18739
18958
  } else if (subcommand === "agent-home") {
18740
18959
  try {
18741
- const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-BJ7bde35.cjs'); });
18960
+ const { parseAgentHomeArgs, runAgentHomeCommand } = await Promise.resolve().then(function () { return require('./agentHome-BUsLTZnz.cjs'); });
18742
18961
  await runAgentHomeCommand(parseAgentHomeArgs(args.slice(1)));
18743
18962
  process.exit(0);
18744
18963
  } catch (error) {
@@ -18747,7 +18966,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18747
18966
  }
18748
18967
  } else if (subcommand === "spawn") {
18749
18968
  try {
18750
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-od9V23cc.cjs'); });
18969
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-DxrfHTF4.cjs'); });
18751
18970
  await handleSpawnCommand(args.slice(1));
18752
18971
  } catch (error) {
18753
18972
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -18759,7 +18978,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18759
18978
  return;
18760
18979
  } else if (subcommand === "sessions") {
18761
18980
  try {
18762
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-qULzUzlI.cjs'); });
18981
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-RIFUoy_g.cjs'); });
18763
18982
  await handleSessionsCommand(args.slice(1));
18764
18983
  } catch (error) {
18765
18984
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -18771,7 +18990,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18771
18990
  return;
18772
18991
  } else if (subcommand === "send") {
18773
18992
  try {
18774
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-9075kHZP.cjs'); });
18993
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-Bd00QcHC.cjs'); });
18775
18994
  await handleSendCommand(args.slice(1));
18776
18995
  } catch (error) {
18777
18996
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -18877,9 +19096,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18877
19096
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
18878
19097
  const projectId = args[3];
18879
19098
  try {
18880
- const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-D23kF0_u.cjs'); });
18881
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-DY_sFA3J.cjs'); }).then(function (n) { return n.persistence; });
18882
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-CUCU7Vw8.cjs'); }).then(function (n) { return n.api; });
19099
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-DM_xI9M6.cjs'); });
19100
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-CmzISka2.cjs'); }).then(function (n) { return n.persistence; });
19101
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-Bd_TGr0F.cjs'); }).then(function (n) { return n.api; });
18883
19102
  let userEmail = void 0;
18884
19103
  try {
18885
19104
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -18910,7 +19129,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18910
19129
  }
18911
19130
  if (geminiSubcommand === "project" && args[2] === "get") {
18912
19131
  try {
18913
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-D23kF0_u.cjs'); });
19132
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-DM_xI9M6.cjs'); });
18914
19133
  const config = readGeminiLocalConfig();
18915
19134
  if (config.googleCloudProject) {
18916
19135
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -18950,7 +19169,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18950
19169
  process.exit(0);
18951
19170
  }
18952
19171
  try {
18953
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CtOEFvhf.cjs'); });
19172
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CNPGSsSK.cjs'); });
18954
19173
  let startedBy = void 0;
18955
19174
  for (let i = 1; i < args.length; i++) {
18956
19175
  if (args[i] === "--started-by") {
@@ -18973,7 +19192,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18973
19192
  } else if (subcommand === "pi") {
18974
19193
  if (args[1] === "--terminal") {
18975
19194
  try {
18976
- const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-qdJ9KZVL.cjs'); });
19195
+ const { runPiTerminal } = await Promise.resolve().then(function () { return require('./piTerminal-fUogwxYr.cjs'); });
18977
19196
  process.exitCode = await runPiTerminal(args.slice(2));
18978
19197
  } catch (error) {
18979
19198
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -18990,7 +19209,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
18990
19209
  }
18991
19210
  };
18992
19211
  try {
18993
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-DEOVn46R.cjs'); });
19212
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BUxBxSxJ.cjs'); });
18994
19213
  const parsed = parsePiRunnerArgs(args.slice(1));
18995
19214
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
18996
19215
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -19018,7 +19237,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19018
19237
  return;
19019
19238
  } else if (subcommand === "acp") {
19020
19239
  try {
19021
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-DEOVn46R.cjs'); });
19240
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BUxBxSxJ.cjs'); });
19022
19241
  let startedBy = void 0;
19023
19242
  let verbose = false;
19024
19243
  const acpArgs = [];
@@ -19058,7 +19277,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19058
19277
  return;
19059
19278
  } else if (subcommand === "openclaw") {
19060
19279
  try {
19061
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-DoqZXBvL.cjs'); });
19280
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-Bsodkg_s.cjs'); });
19062
19281
  let startedBy = void 0;
19063
19282
  let verbose = false;
19064
19283
  let gatewayUrl;
@@ -19109,7 +19328,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19109
19328
  return;
19110
19329
  } else if (subcommand === "todo") {
19111
19330
  try {
19112
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-BCT_ZPuV.cjs'); });
19331
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-B4cBFzHB.cjs'); });
19113
19332
  await handleTodoCommand(args.slice(1));
19114
19333
  } catch (error) {
19115
19334
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -19118,7 +19337,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19118
19337
  return;
19119
19338
  } else if (subcommand === "teams") {
19120
19339
  try {
19121
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-CrCzU-AV.cjs'); });
19340
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-Cfy0VMCo.cjs'); });
19122
19341
  await handleTeamsCommand(args.slice(1));
19123
19342
  } catch (error) {
19124
19343
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -19127,7 +19346,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19127
19346
  return;
19128
19347
  } else if (subcommand === "auto") {
19129
19348
  try {
19130
- const { handleAutoCommand } = await Promise.resolve().then(function () { return require('./auto-C-90ojIH.cjs'); });
19349
+ const { handleAutoCommand } = await Promise.resolve().then(function () { return require('./auto-IeldARBS.cjs'); });
19131
19350
  await handleAutoCommand(args.slice(1));
19132
19351
  } catch (error) {
19133
19352
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Automation command failed");
@@ -19139,7 +19358,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
19139
19358
  return;
19140
19359
  } else if (subcommand === "mcp" && (args.length === 1 || args.length === 2 && args[1] === "--terminal-tools")) {
19141
19360
  try {
19142
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-JpqI2POW.cjs'); });
19361
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-7iDHlyCI.cjs'); });
19143
19362
  await handleMcpCommand(args[1] === "--terminal-tools");
19144
19363
  } catch (error) {
19145
19364
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -19532,6 +19751,7 @@ exports.appendStagedAttachmentsToPrompt = appendStagedAttachmentsToPrompt;
19532
19751
  exports.archiveSession = archiveSession;
19533
19752
  exports.checkPreviewPath = checkPreviewPath;
19534
19753
  exports.createSessionMetadata = createSessionMetadata;
19754
+ exports.deliverToSession = deliverToSession;
19535
19755
  exports.describeAction = describeAction;
19536
19756
  exports.describeTrigger = describeTrigger;
19537
19757
  exports.hashObject = hashObject;
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DHrwHxHf.cjs');
3
+ var index = require('./index-eCjkm8Y2.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-CUCU7Vw8.cjs');
8
+ require('./types-Bd_TGr0F.cjs');
9
9
  require('axios');
10
- require('./limits-DY_sFA3J.cjs');
10
+ require('./limits-CmzISka2.cjs');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
13
13
  require('node:path');
@@ -32,7 +32,7 @@ require('fs');
32
32
  require('node:readline');
33
33
  require('@anthropic-ai/sandbox-runtime');
34
34
  require('expo-server-sdk');
35
- require('./agentGuidance-BM4kMNyr.cjs');
35
+ require('./agentGuidance-DUBXppv-.cjs');
36
36
  require('ink');
37
37
  require('react');
38
38
  require('ps-list');
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-DHrwHxHf.cjs');
5
- require('./limits-DY_sFA3J.cjs');
4
+ require('./index-eCjkm8Y2.cjs');
5
+ require('./limits-CmzISka2.cjs');
6
6
  require('zod');
7
- require('./types-CUCU7Vw8.cjs');
7
+ require('./types-Bd_TGr0F.cjs');
8
8
  require('node:child_process');
9
9
  require('node:os');
10
10
  require('node:crypto');
@@ -15,7 +15,7 @@ require('node:fs');
15
15
  require('./terminalTitleSuggest-Dji8I0Jy.cjs');
16
16
  require('path');
17
17
  require('url');
18
- require('./agentGuidance-BM4kMNyr.cjs');
18
+ require('./agentGuidance-DUBXppv-.cjs');
19
19
  require('node:fs/promises');
20
20
  require('fs/promises');
21
21
  require('ink');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './index-BacwoXzs.mjs';
3
- import './limits-BtAuKRl2.mjs';
2
+ import './index-BELV05ko.mjs';
3
+ import './limits-Dt7_unH4.mjs';
4
4
  import 'zod';
5
- import './types-BvqOVUOW.mjs';
5
+ import './types-D5RWyBE5.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:os';
8
8
  import 'node:crypto';
@@ -13,7 +13,7 @@ import 'node:fs';
13
13
  import './terminalTitleSuggest-DKgX3osW.mjs';
14
14
  import 'path';
15
15
  import 'url';
16
- import './agentGuidance-C8unGWp7.mjs';
16
+ import './agentGuidance-TLYQxsm2.mjs';
17
17
  import 'node:fs/promises';
18
18
  import 'fs/promises';
19
19
  import 'ink';
@@ -3,7 +3,7 @@
3
3
  var node_crypto = require('node:crypto');
4
4
  var promises = require('node:fs/promises');
5
5
  var path = require('node:path');
6
- var index = require('./index-DHrwHxHf.cjs');
6
+ var index = require('./index-eCjkm8Y2.cjs');
7
7
 
8
8
  async function assertPrivateDestination(directory) {
9
9
  for (let path$1 = directory; ; path$1 = path.dirname(path$1)) {
@@ -1,7 +1,7 @@
1
1
  import { createHash, randomUUID } from 'node:crypto';
2
2
  import { unlink, rmdir, mkdir, lstat, readFile, writeFile, rename } from 'node:fs/promises';
3
3
  import { join, resolve, dirname } from 'node:path';
4
- import { z as TEAM_SKILL } from './index-BacwoXzs.mjs';
4
+ import { B as TEAM_SKILL } from './index-BELV05ko.mjs';
5
5
 
6
6
  async function assertPrivateDestination(directory) {
7
7
  for (let path = directory; ; path = dirname(path)) {
@@ -6,14 +6,14 @@ var os = require('node:os');
6
6
  var node_child_process = require('node:child_process');
7
7
  var chalk = require('chalk');
8
8
  var terminalTitleSuggest = require('./terminalTitleSuggest-Dji8I0Jy.cjs');
9
- var index = require('./index-DHrwHxHf.cjs');
9
+ var index = require('./index-eCjkm8Y2.cjs');
10
10
  require('path');
11
11
  require('url');
12
12
  require('zod');
13
13
  require('node:crypto');
14
- require('./types-CUCU7Vw8.cjs');
14
+ require('./types-Bd_TGr0F.cjs');
15
15
  require('axios');
16
- require('./limits-DY_sFA3J.cjs');
16
+ require('./limits-CmzISka2.cjs');
17
17
  require('node:fs/promises');
18
18
  require('tweetnacl');
19
19
  require('node:util');
@@ -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-BM4kMNyr.cjs');
34
+ require('./agentGuidance-DUBXppv-.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('@anthropic-ai/claude-agent-sdk');