very-happy-cli 0.2.152 → 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 (61) hide show
  1. package/dist/{AcpBackend-CogiKCng.cjs → AcpBackend-B14xNj5L.cjs} +2 -2
  2. package/dist/{AcpBackend-Bs3wwYbt.mjs → AcpBackend-Ckyadhf4.mjs} +2 -2
  3. package/dist/{AcpSessionManager-BazkBuFo.cjs → AcpSessionManager-CCHmPdrR.cjs} +1 -1
  4. package/dist/{AcpSessionManager-BT8PJMEm.mjs → AcpSessionManager-H8t4P-IW.mjs} +1 -1
  5. package/dist/{agentGuidance-CqBn77AI.cjs → agentGuidance-DUBXppv-.cjs} +2 -1
  6. package/dist/{agentGuidance-Daxn5Nvj.mjs → agentGuidance-TLYQxsm2.mjs} +2 -1
  7. package/dist/{agentHome-CCYfs8Ec.mjs → agentHome-B20RWdgE.mjs} +3 -3
  8. package/dist/{agentHome-CpJjrQZc.cjs → agentHome-BUsLTZnz.cjs} +3 -3
  9. package/dist/{auto-DV5emt1-.mjs → auto-BQnncDcs.mjs} +7 -7
  10. package/dist/{auto-DncmTDvw.cjs → auto-IeldARBS.cjs} +7 -7
  11. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  12. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  13. package/dist/{config-DbKpQpdL.mjs → config-B-ocQh5V.mjs} +5 -5
  14. package/dist/{config-DeJgSMh-.cjs → config-DM_xI9M6.cjs} +5 -5
  15. package/dist/{index-BauTv2jB.mjs → index-BELV05ko.mjs} +284 -45
  16. package/dist/{index-imt4mC41.cjs → index-BUxBxSxJ.cjs} +9 -9
  17. package/dist/{index-CN7OF2cU.mjs → index-CIx3248o.mjs} +5 -5
  18. package/dist/{index-DahaLbu4.mjs → index-ZKuBjvHi.mjs} +9 -9
  19. package/dist/{index-ZIW1jrYm.cjs → index-eCjkm8Y2.cjs} +307 -66
  20. package/dist/{index-CRaJ9k2p.cjs → index-okLyUzeD.cjs} +5 -5
  21. package/dist/index.cjs +5 -5
  22. package/dist/index.mjs +5 -5
  23. package/dist/{install-CDR3qBhs.cjs → install-BZOdxfPd.cjs} +1 -1
  24. package/dist/{install-C1K3nrxF.mjs → install-CoLN3whR.mjs} +1 -1
  25. package/dist/{installPiTools-C-Lxv4Bt.mjs → installPiTools-Cj7yU9Fc.mjs} +2 -1
  26. package/dist/{installPiTools-BKnXjrVu.cjs → installPiTools-DuZ6jZvX.cjs} +3 -2
  27. package/dist/{installTerminalHooks-BoDxpaBO.cjs → installTerminalHooks-CA4OcAS7.cjs} +7 -7
  28. package/dist/{installTerminalHooks-VvmlO6Ue.mjs → installTerminalHooks-Dde_8t36.mjs} +6 -6
  29. package/dist/lib.cjs +3 -3
  30. package/dist/lib.mjs +3 -3
  31. package/dist/{limits-BNTWyUaZ.cjs → limits-CmzISka2.cjs} +7 -7
  32. package/dist/{limits-CKR_HJnO.mjs → limits-Dt7_unH4.mjs} +7 -7
  33. package/dist/{mcp-CCKCKL6l.cjs → mcp-7iDHlyCI.cjs} +14 -6
  34. package/dist/{mcp-D4dAo5BQ.mjs → mcp-9Ui4nQZL.mjs} +14 -7
  35. package/dist/piExtension.d.mts +4 -1
  36. package/dist/piExtension.mjs +24 -1
  37. package/dist/{piRuntime-Bn5ypbjH.cjs → piRuntime-BesGGPME.cjs} +2 -2
  38. package/dist/{piRuntime-CW-XA4rz.mjs → piRuntime-C4E4pgye.mjs} +2 -2
  39. package/dist/{piTerminal-BLSXK1u2.mjs → piTerminal-CCEGCQOY.mjs} +8 -7
  40. package/dist/{piTerminal-B7K75aXB.cjs → piTerminal-fUogwxYr.cjs} +8 -7
  41. package/dist/{runGemini-D5N11LxO.mjs → runGemini-BW-pEklU.mjs} +7 -7
  42. package/dist/{runGemini-Bgg1BzDK.cjs → runGemini-CNPGSsSK.cjs} +8 -8
  43. package/dist/{runOpenClaw-B9qWHybc.cjs → runOpenClaw-Bsodkg_s.cjs} +6 -6
  44. package/dist/{runOpenClaw-CCpyKbrn.mjs → runOpenClaw-NRB6-_jU.mjs} +6 -6
  45. package/dist/{send-wl9ei8yG.cjs → send-Bd00QcHC.cjs} +56 -18
  46. package/dist/{send-C44kcXz5.mjs → send-DYeSFg8s.mjs} +56 -19
  47. package/dist/{sessions-DXJEcUg6.mjs → sessions-DlPOYKLU.mjs} +5 -5
  48. package/dist/{sessions-Tad8elmy.cjs → sessions-RIFUoy_g.cjs} +5 -5
  49. package/dist/{spawn-BOlb5y1_.mjs → spawn-D1bhyHbH.mjs} +5 -5
  50. package/dist/{spawn-DA8WAFmm.cjs → spawn-DxrfHTF4.cjs} +5 -5
  51. package/dist/{teams-qVLrFcdd.cjs → teams-Cfy0VMCo.cjs} +6 -6
  52. package/dist/{teams-Bs8lI887.mjs → teams-pfKHpkgL.mjs} +6 -6
  53. package/dist/terminalTitleSuggest-DKgX3osW.mjs +38 -0
  54. package/dist/terminalTitleSuggest-Dji8I0Jy.cjs +45 -0
  55. package/dist/{todo-nzsqGZqp.mjs → todo-B2CjDg_V.mjs} +2 -2
  56. package/dist/{todo-mCMoGjJk.cjs → todo-B4cBFzHB.cjs} +2 -2
  57. package/dist/{types-CN28qJl7.cjs → types-Bd_TGr0F.cjs} +34 -10
  58. package/dist/{types-xKrxbCRv.mjs → types-D5RWyBE5.mjs} +32 -9
  59. package/package.json +7 -7
  60. package/dist/projectPath-CSpqWdxp.mjs +0 -10
  61. package/dist/projectPath-ChLhdOyt.cjs +0 -13
@@ -2,12 +2,12 @@ import { useStdout, useInput, Box, Text, render } from 'ink';
2
2
  import React, { useState, useRef, useEffect, useCallback } from 'react';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { join } from 'node:path';
5
- import { o as connectionState, A as ApiClient, t as errorLogMetadata, q as notifyDaemonSessionStarted, u as contentLogMetadata } from './types-xKrxbCRv.mjs';
6
- import { l as logger, r as readSettings, j as encodeBase64 } from './limits-CKR_HJnO.mjs';
7
- import { X as GEMINI_API_KEY_ENV, Y as GOOGLE_API_KEY_ENV, G as GEMINI_MODEL_ENV, R as BasePermissionHandler, Z as BaseReasoningProcessor, z as initialMachineMetadata, B as createSessionMetadata, C as setupOfflineReconnection, F as MessageQueue2, H as hashObject, _ as MessageBuffer, $ as CHANGE_TITLE_INSTRUCTION, L as registerKillSessionHandler, I as startHappyServer } from './index-BauTv2jB.mjs';
8
- import { p as projectPath } from './projectPath-CSpqWdxp.mjs';
9
- import { A as AcpBackend } from './AcpBackend-Bs3wwYbt.mjs';
10
- import { readGeminiLocalConfig, determineGeminiModel, getGeminiModelSource, getInitialGeminiModel, saveGeminiModelToConfig } from './config-DbKpQpdL.mjs';
5
+ import { o as connectionState, A as ApiClient, t as errorLogMetadata, q as notifyDaemonSessionStarted, u as contentLogMetadata } from './types-D5RWyBE5.mjs';
6
+ import { l as logger, r as readSettings, j as encodeBase64 } from './limits-Dt7_unH4.mjs';
7
+ import { Z as GEMINI_API_KEY_ENV, _ as GOOGLE_API_KEY_ENV, G as GEMINI_MODEL_ENV, V as BasePermissionHandler, $ as BaseReasoningProcessor, C as initialMachineMetadata, E as createSessionMetadata, F as setupOfflineReconnection, I as MessageQueue2, J as hashObject, a0 as MessageBuffer, a1 as CHANGE_TITLE_INSTRUCTION, O as registerKillSessionHandler, K as startHappyServer } from './index-BELV05ko.mjs';
8
+ import { p as projectPath } from './terminalTitleSuggest-DKgX3osW.mjs';
9
+ import { A as AcpBackend } from './AcpBackend-Ckyadhf4.mjs';
10
+ import { readGeminiLocalConfig, determineGeminiModel, getGeminiModelSource, getInitialGeminiModel, saveGeminiModelToConfig } from './config-B-ocQh5V.mjs';
11
11
  import 'axios';
12
12
  import 'node:events';
13
13
  import 'socket.io-client';
@@ -32,7 +32,7 @@ import '@anthropic-ai/sandbox-runtime';
32
32
  import 'expo-server-sdk';
33
33
  import 'chalk';
34
34
  import 'node:util';
35
- import './agentGuidance-Daxn5Nvj.mjs';
35
+ import './agentGuidance-TLYQxsm2.mjs';
36
36
  import '@anthropic-ai/claude-agent-sdk';
37
37
  import 'ps-list';
38
38
  import 'tmp';
@@ -4,12 +4,12 @@ var ink = require('ink');
4
4
  var React = require('react');
5
5
  var node_crypto = require('node:crypto');
6
6
  var path = require('node:path');
7
- var index$1 = require('./types-CN28qJl7.cjs');
8
- var persistence = require('./limits-BNTWyUaZ.cjs');
9
- var index = require('./index-ZIW1jrYm.cjs');
10
- var projectPath = require('./projectPath-ChLhdOyt.cjs');
11
- var AcpBackend = require('./AcpBackend-CogiKCng.cjs');
12
- var config = require('./config-DeJgSMh-.cjs');
7
+ var index$1 = require('./types-Bd_TGr0F.cjs');
8
+ var persistence = require('./limits-CmzISka2.cjs');
9
+ var index = require('./index-eCjkm8Y2.cjs');
10
+ var terminalTitleSuggest = require('./terminalTitleSuggest-Dji8I0Jy.cjs');
11
+ var AcpBackend = require('./AcpBackend-B14xNj5L.cjs');
12
+ var config = require('./config-DM_xI9M6.cjs');
13
13
  require('axios');
14
14
  require('node:events');
15
15
  require('socket.io-client');
@@ -34,7 +34,7 @@ require('@anthropic-ai/sandbox-runtime');
34
34
  require('expo-server-sdk');
35
35
  require('chalk');
36
36
  require('node:util');
37
- require('./agentGuidance-CqBn77AI.cjs');
37
+ require('./agentGuidance-DUBXppv-.cjs');
38
38
  require('@anthropic-ai/claude-agent-sdk');
39
39
  require('ps-list');
40
40
  require('tmp');
@@ -1169,7 +1169,7 @@ async function runGemini(opts) {
1169
1169
  process.stdin.setEncoding("utf8");
1170
1170
  }
1171
1171
  const happyServer = await index.startHappyServer(session);
1172
- const bridgeCommand = path.join(projectPath.projectPath(), "bin", "very-happy-mcp.mjs");
1172
+ const bridgeCommand = path.join(terminalTitleSuggest.projectPath(), "bin", "very-happy-mcp.mjs");
1173
1173
  const mcpServers = {
1174
1174
  happy: {
1175
1175
  command: bridgeCommand,
@@ -5,10 +5,10 @@ var node_child_process = require('node:child_process');
5
5
  var os = require('node:os');
6
6
  var node_fs = require('node:fs');
7
7
  var path = require('node:path');
8
- var index = require('./types-CN28qJl7.cjs');
9
- var AcpSessionManager = require('./AcpSessionManager-BazkBuFo.cjs');
10
- var persistence = require('./limits-BNTWyUaZ.cjs');
11
- var index$1 = require('./index-ZIW1jrYm.cjs');
8
+ var index = require('./types-Bd_TGr0F.cjs');
9
+ var AcpSessionManager = require('./AcpSessionManager-CCHmPdrR.cjs');
10
+ var persistence = require('./limits-CmzISka2.cjs');
11
+ var index$1 = require('./index-eCjkm8Y2.cjs');
12
12
  var WebSocket = require('ws');
13
13
  var ed = require('@noble/ed25519');
14
14
  var sha2_js = require('@noble/hashes/sha2.js');
@@ -22,7 +22,7 @@ require('fs/promises');
22
22
  require('crypto');
23
23
  require('path');
24
24
  require('cross-spawn');
25
- require('./projectPath-ChLhdOyt.cjs');
25
+ require('./terminalTitleSuggest-Dji8I0Jy.cjs');
26
26
  require('url');
27
27
  require('os');
28
28
  require('@paralleldrive/cuid2');
@@ -35,7 +35,7 @@ require('@anthropic-ai/sandbox-runtime');
35
35
  require('expo-server-sdk');
36
36
  require('chalk');
37
37
  require('node:util');
38
- require('./agentGuidance-CqBn77AI.cjs');
38
+ require('./agentGuidance-DUBXppv-.cjs');
39
39
  require('ink');
40
40
  require('react');
41
41
  require('@anthropic-ai/claude-agent-sdk');
@@ -3,10 +3,10 @@ import { execFileSync } from 'node:child_process';
3
3
  import os from 'node:os';
4
4
  import { existsSync, readFileSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
- import { t as errorLogMetadata, u as contentLogMetadata, o as connectionState, A as ApiClient, q as notifyDaemonSessionStarted } from './types-xKrxbCRv.mjs';
7
- import { A as AcpSessionManager } from './AcpSessionManager-BT8PJMEm.mjs';
8
- import { m as ensurePrivateDirectorySync, n as hardenPrivateFileSync, w as writePrivateFileSync, r as readSettings, j as encodeBase64, l as logger, c as configuration } from './limits-CKR_HJnO.mjs';
9
- import { z as initialMachineMetadata, B as createSessionMetadata, C as setupOfflineReconnection, F as MessageQueue2, L as registerKillSessionHandler } from './index-BauTv2jB.mjs';
6
+ import { t as errorLogMetadata, u as contentLogMetadata, o as connectionState, A as ApiClient, q as notifyDaemonSessionStarted } from './types-D5RWyBE5.mjs';
7
+ import { A as AcpSessionManager } from './AcpSessionManager-H8t4P-IW.mjs';
8
+ import { m as ensurePrivateDirectorySync, n as hardenPrivateFileSync, w as writePrivateFileSync, r as readSettings, j as encodeBase64, l as logger, c as configuration } from './limits-Dt7_unH4.mjs';
9
+ import { C as initialMachineMetadata, E as createSessionMetadata, F as setupOfflineReconnection, I as MessageQueue2, O as registerKillSessionHandler } from './index-BELV05ko.mjs';
10
10
  import WebSocket from 'ws';
11
11
  import * as ed from '@noble/ed25519';
12
12
  import { sha512 } from '@noble/hashes/sha2.js';
@@ -20,7 +20,7 @@ import 'fs/promises';
20
20
  import 'crypto';
21
21
  import 'path';
22
22
  import 'cross-spawn';
23
- import './projectPath-CSpqWdxp.mjs';
23
+ import './terminalTitleSuggest-DKgX3osW.mjs';
24
24
  import 'url';
25
25
  import 'os';
26
26
  import '@paralleldrive/cuid2';
@@ -33,7 +33,7 @@ import '@anthropic-ai/sandbox-runtime';
33
33
  import 'expo-server-sdk';
34
34
  import 'chalk';
35
35
  import 'node:util';
36
- import './agentGuidance-Daxn5Nvj.mjs';
36
+ import './agentGuidance-TLYQxsm2.mjs';
37
37
  import 'ink';
38
38
  import 'react';
39
39
  import '@anthropic-ai/claude-agent-sdk';
@@ -3,8 +3,8 @@
3
3
  var chalk = require('chalk');
4
4
  var node_fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var persistence = require('./limits-BNTWyUaZ.cjs');
7
- var index = require('./index-ZIW1jrYm.cjs');
6
+ var persistence = require('./limits-CmzISka2.cjs');
7
+ var index = require('./index-eCjkm8Y2.cjs');
8
8
  require('node:fs/promises');
9
9
  require('node:os');
10
10
  require('zod');
@@ -12,7 +12,7 @@ require('node:crypto');
12
12
  require('tweetnacl');
13
13
  require('node:util');
14
14
  require('@paralleldrive/cuid2');
15
- require('./types-CN28qJl7.cjs');
15
+ require('./types-Bd_TGr0F.cjs');
16
16
  require('axios');
17
17
  require('node:events');
18
18
  require('socket.io-client');
@@ -22,7 +22,7 @@ require('fs/promises');
22
22
  require('crypto');
23
23
  require('path');
24
24
  require('cross-spawn');
25
- require('./projectPath-ChLhdOyt.cjs');
25
+ require('./terminalTitleSuggest-Dji8I0Jy.cjs');
26
26
  require('url');
27
27
  require('os');
28
28
  require('node:child_process');
@@ -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-CqBn77AI.cjs');
34
+ require('./agentGuidance-DUBXppv-.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('@anthropic-ai/claude-agent-sdk');
@@ -49,8 +49,9 @@ require('inquirer');
49
49
  require('node:url');
50
50
  require('node:readline/promises');
51
51
 
52
+ const EXIT_SESSION_NOT_LIVE = 3;
52
53
  function parseSendArgs(args) {
53
- const options = { json: false, help: false };
54
+ const options = { resume: false, json: false, help: false };
54
55
  for (let i = 0; i < args.length; i++) {
55
56
  const arg = args[i];
56
57
  if (arg === "--session" || arg === "-s") {
@@ -69,6 +70,8 @@ function parseSendArgs(args) {
69
70
  const value = args[++i];
70
71
  if (value === void 0 || value.trim().length === 0) throw new Error("--model requires a value");
71
72
  options.model = value;
73
+ } else if (arg === "--resume") {
74
+ options.resume = true;
72
75
  } else if (arg === "--json") {
73
76
  options.json = true;
74
77
  } else if (arg === "--help" || arg === "-h") {
@@ -88,7 +91,7 @@ ${chalk.bold("very-happy send")} - Send a message into an existing session (for
88
91
 
89
92
  ${chalk.bold("Usage:")}
90
93
  very-happy send --session <id> (--prompt <text> | --prompt-file <file>)
91
- [--model <id>] [--json]
94
+ [--model <id>] [--resume] [--json]
92
95
 
93
96
  ${chalk.bold("Options:")}
94
97
  --session, -s <id> Target session id (required)
@@ -97,7 +100,10 @@ ${chalk.bold("Options:")}
97
100
  --model, -m <id> Switch the session to this model with this message
98
101
  ('default' = the machine default). Without it the
99
102
  session keeps whatever model it is on.
100
- --json Machine-readable output: {"sessionId", "url", "delivered"}
103
+ --resume If the session is archived or offline, bring it back
104
+ on THIS machine first (same as the web's Restore),
105
+ wait until it is live, then send.
106
+ --json Machine-readable output (see below)
101
107
  -h, --help Show this help
102
108
 
103
109
  ${chalk.bold("Behavior:")}
@@ -105,9 +111,23 @@ ${chalk.bold("Behavior:")}
105
111
  encryption key must be in ${persistence.configuration.sessionsFile}); sessions from
106
112
  other machines or from daemons too old to persist keys cannot be reached.
107
113
 
114
+ Before sending, the session is classified from the local daemon and the
115
+ server: live (a wrapper is attached, here or on another machine), archived,
116
+ offline (wrapper exited / presence timed out) or not_found. The server
117
+ stores messages for any session, so only "live" means someone will read it;
118
+ anything else is refused with exit 3 unless --resume is given.
119
+
120
+ ${chalk.bold("JSON output:")}
121
+ delivered {"sessionId","url","delivered":true,"status":"live","resumed":false|true}
122
+ refused {"sessionId","url","delivered":false,"status":"archived"|"offline"|"not_found",
123
+ "error":"...","resume":{"ok":false,"error":"..."}} (resume only with --resume)
124
+ dropped {"delivered":false,"stored":true,...} the POST succeeded but the wrapper
125
+ went away meanwhile: the message is stored server-side, unread
126
+
108
127
  ${chalk.bold("Exit codes:")}
109
- 0 message delivered
110
- 1 bad arguments, unknown session, or delivery failed
128
+ 0 message delivered to a live wrapper
129
+ 1 bad arguments, unknown session, or transport failure
130
+ 3 session not live (archived / offline / not found) or resume failed
111
131
  `);
112
132
  }
113
133
  function fail(options, sessionId, message) {
@@ -166,27 +186,45 @@ async function handleSendCommand(args) {
166
186
  `Session ${sessionId} has no encryption key in ${persistence.configuration.sessionsFile}. It was not spawned by this machine's daemon, or the daemon is too old to persist session keys.`
167
187
  );
168
188
  }
189
+ let result;
169
190
  try {
170
- await index.sendUserMessage(
171
- sessionId,
172
- persisted,
173
- prompt,
174
- "cli-send",
175
- options.model !== void 0 ? { model: options.model === "default" ? null : options.model } : {}
176
- );
191
+ result = await index.deliverToSession(sessionId, persisted, prompt, "cli-send", {
192
+ resume: options.resume,
193
+ ...options.model !== void 0 ? { model: options.model === "default" ? null : options.model } : {}
194
+ });
177
195
  } catch (error) {
178
196
  fail(options, sessionId, `Failed to send message: ${error instanceof Error ? error.message : String(error)}`);
179
197
  }
180
198
  const url = index.sessionWebUrl(sessionId);
199
+ if (!result.delivered) {
200
+ if (options.json) {
201
+ console.log(JSON.stringify({
202
+ sessionId,
203
+ url,
204
+ delivered: false,
205
+ status: result.status,
206
+ resumed: result.resumed,
207
+ stored: result.stored,
208
+ error: result.error,
209
+ ...result.resume ? { resume: result.resume } : {}
210
+ }));
211
+ } else {
212
+ console.error(chalk.red("Not delivered:"), result.error ?? `session is ${result.status}`);
213
+ if (result.stored) console.error(chalk.yellow("The message is stored server-side; nothing is reading it."));
214
+ }
215
+ process.exit(EXIT_SESSION_NOT_LIVE);
216
+ }
181
217
  if (options.json) {
182
- console.log(JSON.stringify({ sessionId, url, delivered: true }));
218
+ console.log(JSON.stringify({ sessionId, url, delivered: true, status: "live", resumed: result.resumed }));
183
219
  } else {
184
220
  console.log(`${chalk.bold("Session:")} ${sessionId}`);
185
221
  console.log(`${chalk.bold("URL:")} ${url}`);
222
+ if (result.resumed) console.log(chalk.green("Session resumed on this machine."));
186
223
  console.log(chalk.green("Message sent."));
187
224
  }
188
225
  process.exit(0);
189
226
  }
190
227
 
228
+ exports.EXIT_SESSION_NOT_LIVE = EXIT_SESSION_NOT_LIVE;
191
229
  exports.handleSendCommand = handleSendCommand;
192
230
  exports.parseSendArgs = parseSendArgs;
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
2
  import { readFileSync } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
- import { d as readPersistedSessions, c as configuration } from './limits-CKR_HJnO.mjs';
5
- import { d as sendUserMessage, e as sessionWebUrl } from './index-BauTv2jB.mjs';
4
+ import { d as readPersistedSessions, c as configuration } from './limits-Dt7_unH4.mjs';
5
+ import { d as deliverToSession, e as sessionWebUrl } from './index-BELV05ko.mjs';
6
6
  import 'node:fs/promises';
7
7
  import 'node:os';
8
8
  import 'zod';
@@ -10,7 +10,7 @@ import 'node:crypto';
10
10
  import 'tweetnacl';
11
11
  import 'node:util';
12
12
  import '@paralleldrive/cuid2';
13
- import './types-xKrxbCRv.mjs';
13
+ import './types-D5RWyBE5.mjs';
14
14
  import 'axios';
15
15
  import 'node:events';
16
16
  import 'socket.io-client';
@@ -20,7 +20,7 @@ import 'fs/promises';
20
20
  import 'crypto';
21
21
  import 'path';
22
22
  import 'cross-spawn';
23
- import './projectPath-CSpqWdxp.mjs';
23
+ import './terminalTitleSuggest-DKgX3osW.mjs';
24
24
  import 'url';
25
25
  import 'os';
26
26
  import 'node:child_process';
@@ -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-Daxn5Nvj.mjs';
32
+ import './agentGuidance-TLYQxsm2.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import '@anthropic-ai/claude-agent-sdk';
@@ -47,8 +47,9 @@ import 'inquirer';
47
47
  import 'node:url';
48
48
  import 'node:readline/promises';
49
49
 
50
+ const EXIT_SESSION_NOT_LIVE = 3;
50
51
  function parseSendArgs(args) {
51
- const options = { json: false, help: false };
52
+ const options = { resume: false, json: false, help: false };
52
53
  for (let i = 0; i < args.length; i++) {
53
54
  const arg = args[i];
54
55
  if (arg === "--session" || arg === "-s") {
@@ -67,6 +68,8 @@ function parseSendArgs(args) {
67
68
  const value = args[++i];
68
69
  if (value === void 0 || value.trim().length === 0) throw new Error("--model requires a value");
69
70
  options.model = value;
71
+ } else if (arg === "--resume") {
72
+ options.resume = true;
70
73
  } else if (arg === "--json") {
71
74
  options.json = true;
72
75
  } else if (arg === "--help" || arg === "-h") {
@@ -86,7 +89,7 @@ ${chalk.bold("very-happy send")} - Send a message into an existing session (for
86
89
 
87
90
  ${chalk.bold("Usage:")}
88
91
  very-happy send --session <id> (--prompt <text> | --prompt-file <file>)
89
- [--model <id>] [--json]
92
+ [--model <id>] [--resume] [--json]
90
93
 
91
94
  ${chalk.bold("Options:")}
92
95
  --session, -s <id> Target session id (required)
@@ -95,7 +98,10 @@ ${chalk.bold("Options:")}
95
98
  --model, -m <id> Switch the session to this model with this message
96
99
  ('default' = the machine default). Without it the
97
100
  session keeps whatever model it is on.
98
- --json Machine-readable output: {"sessionId", "url", "delivered"}
101
+ --resume If the session is archived or offline, bring it back
102
+ on THIS machine first (same as the web's Restore),
103
+ wait until it is live, then send.
104
+ --json Machine-readable output (see below)
99
105
  -h, --help Show this help
100
106
 
101
107
  ${chalk.bold("Behavior:")}
@@ -103,9 +109,23 @@ ${chalk.bold("Behavior:")}
103
109
  encryption key must be in ${configuration.sessionsFile}); sessions from
104
110
  other machines or from daemons too old to persist keys cannot be reached.
105
111
 
112
+ Before sending, the session is classified from the local daemon and the
113
+ server: live (a wrapper is attached, here or on another machine), archived,
114
+ offline (wrapper exited / presence timed out) or not_found. The server
115
+ stores messages for any session, so only "live" means someone will read it;
116
+ anything else is refused with exit 3 unless --resume is given.
117
+
118
+ ${chalk.bold("JSON output:")}
119
+ delivered {"sessionId","url","delivered":true,"status":"live","resumed":false|true}
120
+ refused {"sessionId","url","delivered":false,"status":"archived"|"offline"|"not_found",
121
+ "error":"...","resume":{"ok":false,"error":"..."}} (resume only with --resume)
122
+ dropped {"delivered":false,"stored":true,...} the POST succeeded but the wrapper
123
+ went away meanwhile: the message is stored server-side, unread
124
+
106
125
  ${chalk.bold("Exit codes:")}
107
- 0 message delivered
108
- 1 bad arguments, unknown session, or delivery failed
126
+ 0 message delivered to a live wrapper
127
+ 1 bad arguments, unknown session, or transport failure
128
+ 3 session not live (archived / offline / not found) or resume failed
109
129
  `);
110
130
  }
111
131
  function fail(options, sessionId, message) {
@@ -164,26 +184,43 @@ async function handleSendCommand(args) {
164
184
  `Session ${sessionId} has no encryption key in ${configuration.sessionsFile}. It was not spawned by this machine's daemon, or the daemon is too old to persist session keys.`
165
185
  );
166
186
  }
187
+ let result;
167
188
  try {
168
- await sendUserMessage(
169
- sessionId,
170
- persisted,
171
- prompt,
172
- "cli-send",
173
- options.model !== void 0 ? { model: options.model === "default" ? null : options.model } : {}
174
- );
189
+ result = await deliverToSession(sessionId, persisted, prompt, "cli-send", {
190
+ resume: options.resume,
191
+ ...options.model !== void 0 ? { model: options.model === "default" ? null : options.model } : {}
192
+ });
175
193
  } catch (error) {
176
194
  fail(options, sessionId, `Failed to send message: ${error instanceof Error ? error.message : String(error)}`);
177
195
  }
178
196
  const url = sessionWebUrl(sessionId);
197
+ if (!result.delivered) {
198
+ if (options.json) {
199
+ console.log(JSON.stringify({
200
+ sessionId,
201
+ url,
202
+ delivered: false,
203
+ status: result.status,
204
+ resumed: result.resumed,
205
+ stored: result.stored,
206
+ error: result.error,
207
+ ...result.resume ? { resume: result.resume } : {}
208
+ }));
209
+ } else {
210
+ console.error(chalk.red("Not delivered:"), result.error ?? `session is ${result.status}`);
211
+ if (result.stored) console.error(chalk.yellow("The message is stored server-side; nothing is reading it."));
212
+ }
213
+ process.exit(EXIT_SESSION_NOT_LIVE);
214
+ }
179
215
  if (options.json) {
180
- console.log(JSON.stringify({ sessionId, url, delivered: true }));
216
+ console.log(JSON.stringify({ sessionId, url, delivered: true, status: "live", resumed: result.resumed }));
181
217
  } else {
182
218
  console.log(`${chalk.bold("Session:")} ${sessionId}`);
183
219
  console.log(`${chalk.bold("URL:")} ${url}`);
220
+ if (result.resumed) console.log(chalk.green("Session resumed on this machine."));
184
221
  console.log(chalk.green("Message sent."));
185
222
  }
186
223
  process.exit(0);
187
224
  }
188
225
 
189
- export { handleSendCommand, parseSendArgs };
226
+ export { EXIT_SESSION_NOT_LIVE, handleSendCommand, parseSendArgs };
@@ -1,9 +1,9 @@
1
1
  import chalk from 'chalk';
2
- import { D as DEFAULT_RECENT_LIMIT, M as MAX_READ_LIMIT, l as listAccountSessions, a as listSessions, w as waitForTurnEnd, T as TurnWaitTimeoutError, r as readSessionTranscript, s as stopSession, b as resolvePermissionRequest, c as archiveSession } from './index-BauTv2jB.mjs';
3
- import { i as isValidSessionId } from './types-xKrxbCRv.mjs';
2
+ import { D as DEFAULT_RECENT_LIMIT, M as MAX_READ_LIMIT, l as listAccountSessions, a as listSessions, w as waitForTurnEnd, T as TurnWaitTimeoutError, r as readSessionTranscript, s as stopSession, b as resolvePermissionRequest, c as archiveSession } from './index-BELV05ko.mjs';
3
+ import { i as isValidSessionId } from './types-D5RWyBE5.mjs';
4
4
  import 'node:os';
5
5
  import 'node:crypto';
6
- import './limits-CKR_HJnO.mjs';
6
+ import './limits-Dt7_unH4.mjs';
7
7
  import 'node:fs/promises';
8
8
  import 'node:fs';
9
9
  import 'node:path';
@@ -13,10 +13,10 @@ import 'node:util';
13
13
  import '@paralleldrive/cuid2';
14
14
  import 'cross-spawn';
15
15
  import 'node:readline';
16
- import './projectPath-CSpqWdxp.mjs';
16
+ import './terminalTitleSuggest-DKgX3osW.mjs';
17
17
  import 'path';
18
18
  import 'url';
19
- import './agentGuidance-Daxn5Nvj.mjs';
19
+ import './agentGuidance-TLYQxsm2.mjs';
20
20
  import 'fs/promises';
21
21
  import 'ink';
22
22
  import 'react';
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var index = require('./index-ZIW1jrYm.cjs');
5
- var index$1 = require('./types-CN28qJl7.cjs');
4
+ var index = require('./index-eCjkm8Y2.cjs');
5
+ var index$1 = require('./types-Bd_TGr0F.cjs');
6
6
  require('node:os');
7
7
  require('node:crypto');
8
- require('./limits-BNTWyUaZ.cjs');
8
+ require('./limits-CmzISka2.cjs');
9
9
  require('node:fs/promises');
10
10
  require('node:fs');
11
11
  require('node:path');
@@ -15,10 +15,10 @@ require('node:util');
15
15
  require('@paralleldrive/cuid2');
16
16
  require('cross-spawn');
17
17
  require('node:readline');
18
- require('./projectPath-ChLhdOyt.cjs');
18
+ require('./terminalTitleSuggest-Dji8I0Jy.cjs');
19
19
  require('path');
20
20
  require('url');
21
- require('./agentGuidance-CqBn77AI.cjs');
21
+ require('./agentGuidance-DUBXppv-.cjs');
22
22
  require('fs/promises');
23
23
  require('ink');
24
24
  require('react');
@@ -1,9 +1,9 @@
1
1
  import chalk from 'chalk';
2
2
  import { readFileSync, statSync } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
- import { f as forkSession, g as getProjectPath, F as ForkSourceMissingError, C as CodexAppServerClient, h as forkCodexThread, j as checkIfDaemonRunningAndCleanupStaleState, s as spawnDaemonSession, k as stopDaemonSession } from './types-xKrxbCRv.mjs';
5
- import { d as readPersistedSessions, l as logger } from './limits-CKR_HJnO.mjs';
6
- import { k as readSessionMetadata, m as resolveSpawnPermissionMode, e as sessionWebUrl, n as resolveFirstMessageMeta, o as isValidSpawnOrigin, i as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES, S as SPAWN_AGENTS, u as waitForSessionKey, d as sendUserMessage } from './index-BauTv2jB.mjs';
4
+ import { f as forkSession, g as getProjectPath, F as ForkSourceMissingError, C as CodexAppServerClient, h as forkCodexThread, j as checkIfDaemonRunningAndCleanupStaleState, s as spawnDaemonSession, k as stopDaemonSession } from './types-D5RWyBE5.mjs';
5
+ import { d as readPersistedSessions, l as logger } from './limits-Dt7_unH4.mjs';
6
+ import { k as readSessionMetadata, m as resolveSpawnPermissionMode, e as sessionWebUrl, n as resolveFirstMessageMeta, o as isValidSpawnOrigin, i as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES, S as SPAWN_AGENTS, u as waitForSessionKey, v as sendUserMessage } from './index-BELV05ko.mjs';
7
7
  import 'axios';
8
8
  import 'node:events';
9
9
  import 'socket.io-client';
@@ -15,7 +15,7 @@ import 'fs/promises';
15
15
  import 'crypto';
16
16
  import 'path';
17
17
  import 'cross-spawn';
18
- import './projectPath-CSpqWdxp.mjs';
18
+ import './terminalTitleSuggest-DKgX3osW.mjs';
19
19
  import 'url';
20
20
  import 'os';
21
21
  import '@paralleldrive/cuid2';
@@ -29,7 +29,7 @@ import 'node:readline';
29
29
  import '@anthropic-ai/sandbox-runtime';
30
30
  import 'expo-server-sdk';
31
31
  import 'node:util';
32
- import './agentGuidance-Daxn5Nvj.mjs';
32
+ import './agentGuidance-TLYQxsm2.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import '@anthropic-ai/claude-agent-sdk';
@@ -3,9 +3,9 @@
3
3
  var chalk = require('chalk');
4
4
  var node_fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var index$1 = require('./types-CN28qJl7.cjs');
7
- var persistence = require('./limits-BNTWyUaZ.cjs');
8
- var index = require('./index-ZIW1jrYm.cjs');
6
+ var index$1 = require('./types-Bd_TGr0F.cjs');
7
+ var persistence = require('./limits-CmzISka2.cjs');
8
+ var index = require('./index-eCjkm8Y2.cjs');
9
9
  require('axios');
10
10
  require('node:events');
11
11
  require('socket.io-client');
@@ -17,7 +17,7 @@ require('fs/promises');
17
17
  require('crypto');
18
18
  require('path');
19
19
  require('cross-spawn');
20
- require('./projectPath-ChLhdOyt.cjs');
20
+ require('./terminalTitleSuggest-Dji8I0Jy.cjs');
21
21
  require('url');
22
22
  require('os');
23
23
  require('@paralleldrive/cuid2');
@@ -31,7 +31,7 @@ require('node:readline');
31
31
  require('@anthropic-ai/sandbox-runtime');
32
32
  require('expo-server-sdk');
33
33
  require('node:util');
34
- require('./agentGuidance-CqBn77AI.cjs');
34
+ require('./agentGuidance-DUBXppv-.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('@anthropic-ai/claude-agent-sdk');
@@ -4,17 +4,17 @@ var os = require('node:os');
4
4
  var promises = require('node:fs/promises');
5
5
  var z = require('zod');
6
6
  var node_crypto = require('node:crypto');
7
- var agentGuidance = require('./agentGuidance-CqBn77AI.cjs');
8
- var persistence = require('./limits-BNTWyUaZ.cjs');
9
- var install = require('./install-CDR3qBhs.cjs');
7
+ var agentGuidance = require('./agentGuidance-DUBXppv-.cjs');
8
+ var persistence = require('./limits-CmzISka2.cjs');
9
+ var install = require('./install-BZOdxfPd.cjs');
10
10
  require('node:fs');
11
11
  require('node:path');
12
12
  require('tweetnacl');
13
13
  require('chalk');
14
14
  require('node:util');
15
15
  require('@paralleldrive/cuid2');
16
- require('./index-ZIW1jrYm.cjs');
17
- require('./types-CN28qJl7.cjs');
16
+ require('./index-eCjkm8Y2.cjs');
17
+ require('./types-Bd_TGr0F.cjs');
18
18
  require('axios');
19
19
  require('node:events');
20
20
  require('socket.io-client');
@@ -24,7 +24,7 @@ require('fs/promises');
24
24
  require('crypto');
25
25
  require('path');
26
26
  require('cross-spawn');
27
- require('./projectPath-ChLhdOyt.cjs');
27
+ require('./terminalTitleSuggest-Dji8I0Jy.cjs');
28
28
  require('url');
29
29
  require('os');
30
30
  require('node:child_process');
@@ -2,17 +2,17 @@ import { homedir } from 'node:os';
2
2
  import { readFile } from 'node:fs/promises';
3
3
  import { z } from 'zod';
4
4
  import { randomUUID } from 'node:crypto';
5
- import { g as teamRequest, h as createTeamsClient } from './agentGuidance-Daxn5Nvj.mjs';
6
- import { f as readCredentialsForConfiguredRelay } from './limits-CKR_HJnO.mjs';
7
- import { a as installTeamSkill, i as installAutomationSkill } from './install-C1K3nrxF.mjs';
5
+ import { g as teamRequest, h as createTeamsClient } from './agentGuidance-TLYQxsm2.mjs';
6
+ import { f as readCredentialsForConfiguredRelay } from './limits-Dt7_unH4.mjs';
7
+ import { a as installTeamSkill, i as installAutomationSkill } from './install-CoLN3whR.mjs';
8
8
  import 'node:fs';
9
9
  import 'node:path';
10
10
  import 'tweetnacl';
11
11
  import 'chalk';
12
12
  import 'node:util';
13
13
  import '@paralleldrive/cuid2';
14
- import './index-BauTv2jB.mjs';
15
- import './types-xKrxbCRv.mjs';
14
+ import './index-BELV05ko.mjs';
15
+ import './types-D5RWyBE5.mjs';
16
16
  import 'axios';
17
17
  import 'node:events';
18
18
  import 'socket.io-client';
@@ -22,7 +22,7 @@ import 'fs/promises';
22
22
  import 'crypto';
23
23
  import 'path';
24
24
  import 'cross-spawn';
25
- import './projectPath-CSpqWdxp.mjs';
25
+ import './terminalTitleSuggest-DKgX3osW.mjs';
26
26
  import 'url';
27
27
  import 'os';
28
28
  import 'node:child_process';