happy-imou-cloud 2.1.56 → 2.1.58

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 (66) hide show
  1. package/bin/happy-cloud.mjs +1 -1
  2. package/compat/acp-sdk-schema/types.gen.js +2 -2
  3. package/dist/{BaseReasoningProcessor-aDwfLWFR.cjs → BaseReasoningProcessor-BUJg-t7A.cjs} +1 -1
  4. package/dist/{BaseReasoningProcessor-Cu129Kvz.mjs → BaseReasoningProcessor-DopiVh3K.mjs} +1 -1
  5. package/dist/{ConversationHistory-DghAI90W.mjs → ConversationHistory-Cq-fEGhB.mjs} +3 -3
  6. package/dist/{ConversationHistory-ChzJu7b_.cjs → ConversationHistory-DFbRL5PU.cjs} +10 -10
  7. package/dist/{ProviderSelectionHandler-KBda4cGb.mjs → ProviderSelectionHandler-ClHEE9Y7.mjs} +76 -3
  8. package/dist/{ProviderSelectionHandler-DzIOnFlp.cjs → ProviderSelectionHandler-t7A2AzWf.cjs} +80 -6
  9. package/dist/{bootstrapManagedProviderSession-BI1uwf00.cjs → bootstrapManagedProviderSession-CIp820ue.cjs} +8 -6
  10. package/dist/{bootstrapManagedProviderSession-qmnyxNrj.mjs → bootstrapManagedProviderSession-SAFpVSlz.mjs} +5 -3
  11. package/dist/{command-NdLWSLXz.cjs → command-BJ34eRUF.cjs} +18 -26
  12. package/dist/{command-CYTjKTpW.mjs → command-_A4t1AKe.mjs} +17 -25
  13. package/dist/index-3DMKRJP3.mjs +13085 -0
  14. package/dist/index-CFuaE0GF.cjs +13103 -0
  15. package/dist/index.cjs +19 -12
  16. package/dist/index.mjs +19 -12
  17. package/dist/{installFatalProcessHandlers-Cklewa02.mjs → installFatalProcessHandlers-DpfM1Yez.mjs} +1 -1
  18. package/dist/{installFatalProcessHandlers-CAogSuf7.cjs → installFatalProcessHandlers-aV_EvLPf.cjs} +1 -1
  19. package/dist/{launch-C_d8tUSD.cjs → launch-HeUFcnMB.cjs} +18 -26
  20. package/dist/{launch-B0J0joT-.mjs → launch-w2Lk38-8.mjs} +17 -25
  21. package/dist/lib.cjs +19 -1
  22. package/dist/lib.d.cts +3086 -414
  23. package/dist/lib.d.mts +3086 -414
  24. package/dist/lib.mjs +19 -1
  25. package/dist/{runClaude-h5PduXL7.mjs → runClaude-B0QJyJff.mjs} +20 -132
  26. package/dist/{runClaude-C3bk2AkK.cjs → runClaude-Dgz8bszq.cjs} +53 -165
  27. package/dist/runCodex-D_Dxx5-s.cjs +9024 -0
  28. package/dist/runCodex-eUEMuhKm.mjs +9019 -0
  29. package/dist/{runCursor-BcS5NRyz.mjs → runCursor-9mumCX25.mjs} +29 -24
  30. package/dist/{runCursor-D4DksmwR.cjs → runCursor-Diodh8Ie.cjs} +32 -27
  31. package/dist/{runGemini-DdDwVysh.cjs → runGemini-DpgM7jLy.cjs} +30 -296
  32. package/dist/{runGemini-DRyHlB7h.mjs → runGemini-onm_NF1q.mjs} +24 -290
  33. package/dist/{sessionControl-BTPsASVE.cjs → sessionControl-QC9j-t4R.cjs} +78 -248
  34. package/dist/{sessionControl-CQC1ffi5.mjs → sessionControl-iX5WRKiy.mjs} +74 -240
  35. package/dist/types-D5JZOVqD.mjs +64316 -0
  36. package/dist/types-YSuc04nv.cjs +64486 -0
  37. package/package.json +12 -4
  38. package/scripts/e2e/codex-app-server-goal-smoke.mjs +159 -0
  39. package/scripts/e2e/codex-mcp-memory-summarizer-smoke.mjs +255 -0
  40. package/scripts/e2e/fake-codex-app-server.mjs +267 -0
  41. package/scripts/e2e/local-server-session-roundtrip.mjs +996 -108
  42. package/scripts/e2e/mcp-stdio-real-server-probe.mjs +189 -0
  43. package/dist/AcpBackend-4InE9FwE.mjs +0 -2665
  44. package/dist/AcpBackend-B3ro_tdV.cjs +0 -2667
  45. package/dist/RuntimeShell--T97e4f5.cjs +0 -258
  46. package/dist/RuntimeShell-DV7j_wJL.mjs +0 -252
  47. package/dist/claude-BuBeJMOX.mjs +0 -1073
  48. package/dist/claude-s2HCITr6.cjs +0 -1080
  49. package/dist/codex-AnifHbja.mjs +0 -581
  50. package/dist/codex-DPhkIcfb.cjs +0 -586
  51. package/dist/config-B_c2F2bF.mjs +0 -174
  52. package/dist/config-NsagnVOI.cjs +0 -184
  53. package/dist/createDefaultRuntimeShell-Bt79Le83.mjs +0 -31
  54. package/dist/createDefaultRuntimeShell-_a3R9SbY.cjs +0 -33
  55. package/dist/cursor-Csc_nwUR.cjs +0 -91
  56. package/dist/cursor-ps28W3Y6.mjs +0 -88
  57. package/dist/future-Dq4Ha1Dn.cjs +0 -24
  58. package/dist/future-xRdLl3vf.mjs +0 -22
  59. package/dist/index-BkggJHjM.mjs +0 -8153
  60. package/dist/index-D5WM-gNy.cjs +0 -8183
  61. package/dist/resolveCommand-CdF591A1.mjs +0 -190
  62. package/dist/resolveCommand-H8HwprW3.cjs +0 -195
  63. package/dist/runCodex-BNVkKJhH.mjs +0 -2307
  64. package/dist/runCodex-bLGp0SYz.cjs +0 -2312
  65. package/dist/types-B6Hka3jh.cjs +0 -7712
  66. package/dist/types-DkfOkkim.mjs +0 -7640
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import { execFileSync } from 'child_process';
4
4
  import { fileURLToPath } from 'url';
@@ -1,3 +1,3 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export {};
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};
3
3
  //# sourceMappingURL=types.gen.js.map
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var node_crypto = require('node:crypto');
4
- var persistence = require('./types-B6Hka3jh.cjs');
4
+ var persistence = require('./types-YSuc04nv.cjs');
5
5
 
6
6
  class BaseReasoningProcessor {
7
7
  accumulator = "";
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { F as logger } from './types-DkfOkkim.mjs';
2
+ import { aE as logger } from './types-D5JZOVqD.mjs';
3
3
 
4
4
  class BaseReasoningProcessor {
5
5
  accumulator = "";
@@ -1,6 +1,5 @@
1
- import { R as RuntimeShell, f as formatDisplayMessage, t as truncateDisplayMessage } from './RuntimeShell-DV7j_wJL.mjs';
2
- import { j as renderTerminalOutputPreview } from './sessionControl-CQC1ffi5.mjs';
3
- import { F as logger } from './types-DkfOkkim.mjs';
1
+ import { q as RuntimeShell, ac as formatDisplayMessage, bp as truncateDisplayMessage, aE as logger } from './types-D5JZOVqD.mjs';
2
+ import { d as renderTerminalOutputPreview } from './sessionControl-iX5WRKiy.mjs';
4
3
 
5
4
  async function launchRuntimeHandleWithFactoryResult(opts) {
6
5
  const shell = opts.shell ?? new RuntimeShell();
@@ -9,6 +8,7 @@ async function launchRuntimeHandleWithFactoryResult(opts) {
9
8
  provider: opts.provider,
10
9
  cwd: opts.cwd,
11
10
  env: opts.env,
11
+ mcpServers: opts.mcpServers,
12
12
  createBackend: (factoryOpts) => {
13
13
  factoryResult = opts.createBackendResult(factoryOpts);
14
14
  return factoryResult.backend;
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var RuntimeShell = require('./RuntimeShell--T97e4f5.cjs');
4
- var sessionControl = require('./sessionControl-BTPsASVE.cjs');
5
- var persistence = require('./types-B6Hka3jh.cjs');
3
+ var persistence = require('./types-YSuc04nv.cjs');
4
+ var sessionControl = require('./sessionControl-QC9j-t4R.cjs');
6
5
 
7
6
  async function launchRuntimeHandleWithFactoryResult(opts) {
8
- const shell = opts.shell ?? new RuntimeShell.RuntimeShell();
7
+ const shell = opts.shell ?? new persistence.RuntimeShell();
9
8
  let factoryResult;
10
9
  const session = await shell.launch({
11
10
  provider: opts.provider,
12
11
  cwd: opts.cwd,
13
12
  env: opts.env,
13
+ mcpServers: opts.mcpServers,
14
14
  createBackend: (factoryOpts) => {
15
15
  factoryResult = opts.createBackendResult(factoryOpts);
16
16
  return factoryResult.backend;
@@ -391,7 +391,7 @@ class MessageBuffer {
391
391
  };
392
392
  }
393
393
  normalizeContent(content) {
394
- return this.truncateContent(RuntimeShell.formatDisplayMessage(content));
394
+ return this.truncateContent(persistence.formatDisplayMessage(content));
395
395
  }
396
396
  truncateContent(content) {
397
397
  if (content.length <= this.maxMessageCharacters) {
@@ -505,7 +505,7 @@ function createSessionTranscriptInkRenderer(opts) {
505
505
  }
506
506
  case "tool-call": {
507
507
  const name = typeof payload.name === "string" ? payload.name : typeof payload.toolName === "string" ? payload.toolName : "tool";
508
- const inputPreview = RuntimeShell.truncateDisplayMessage(
508
+ const inputPreview = persistence.truncateDisplayMessage(
509
509
  isRecord(payload.input) || Array.isArray(payload.input) ? JSON.stringify(payload.input) : payload.input,
510
510
  120
511
511
  );
@@ -518,7 +518,7 @@ function createSessionTranscriptInkRenderer(opts) {
518
518
  case "tool-result":
519
519
  case "tool-call-result": {
520
520
  const resultValue = Object.prototype.hasOwnProperty.call(payload, "output") ? payload.output : payload.result;
521
- const resultPreview = RuntimeShell.truncateDisplayMessage(resultValue, 200);
521
+ const resultPreview = persistence.truncateDisplayMessage(resultValue, 200);
522
522
  const prefix = payload.isError ? "Error:" : "Result:";
523
523
  opts.messageBuffer.addMessage(
524
524
  resultPreview ? `${prefix} ${resultPreview}` : "Tool completed",
@@ -556,7 +556,7 @@ function createSessionTranscriptInkRenderer(opts) {
556
556
  return;
557
557
  }
558
558
  case "patch-apply-end": {
559
- const completionMessage = payload.success === false ? RuntimeShell.truncateDisplayMessage(payload.stderr, 200) || "Patch failed" : RuntimeShell.truncateDisplayMessage(payload.stdout, 200) || "Patch applied";
559
+ const completionMessage = payload.success === false ? persistence.truncateDisplayMessage(payload.stderr, 200) || "Patch failed" : persistence.truncateDisplayMessage(payload.stdout, 200) || "Patch applied";
560
560
  opts.messageBuffer.addMessage(completionMessage, payload.success === false ? "status" : "result");
561
561
  return;
562
562
  }
@@ -611,7 +611,7 @@ function createSessionTranscriptInkRenderer(opts) {
611
611
  }
612
612
  if (block.type === "tool_use") {
613
613
  const toolName = typeof block.name === "string" ? block.name : "tool";
614
- const inputPreview = RuntimeShell.truncateDisplayMessage(
614
+ const inputPreview = persistence.truncateDisplayMessage(
615
615
  isRecord(block.input) || Array.isArray(block.input) ? JSON.stringify(block.input) : block.input,
616
616
  120
617
617
  );
@@ -670,7 +670,7 @@ function createSessionTranscriptInkRenderer(opts) {
670
670
  renderSessionEvent(transcriptMessage.message.content.data);
671
671
  return;
672
672
  default:
673
- opts.messageBuffer.addMessage(RuntimeShell.formatDisplayMessage(transcriptMessage.message), "status");
673
+ opts.messageBuffer.addMessage(persistence.formatDisplayMessage(transcriptMessage.message), "status");
674
674
  }
675
675
  };
676
676
  }
@@ -1,5 +1,6 @@
1
- import { F as logger } from './types-DkfOkkim.mjs';
2
- import { h as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, b as INTERACTION_TIMED_OUT_ERROR } from './sessionControl-CQC1ffi5.mjs';
1
+ import { aE as logger, a3 as delay, ai as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, o as INTERACTION_TIMED_OUT_ERROR } from './types-D5JZOVqD.mjs';
2
+ import { stat, watch } from 'fs/promises';
3
+ import { dirname, basename } from 'node:path';
3
4
 
4
5
  async function runModeLoop(opts) {
5
6
  let currentMode = opts.startingMode;
@@ -51,6 +52,76 @@ function createKeepAliveController(opts) {
51
52
  };
52
53
  }
53
54
 
55
+ function startFileWatcher(file, onFileChange) {
56
+ const abortController = new AbortController();
57
+ const parentDir = dirname(file);
58
+ const targetName = basename(file);
59
+ void (async () => {
60
+ while (true) {
61
+ try {
62
+ try {
63
+ await stat(file);
64
+ } catch (e) {
65
+ if (abortController.signal.aborted) {
66
+ return;
67
+ }
68
+ if (e?.code === "ENOENT") {
69
+ logger.debug(`[FILE_WATCHER] Waiting for file to exist: ${file}`);
70
+ const dirWatcher = watch(parentDir, { persistent: true, signal: abortController.signal });
71
+ try {
72
+ await stat(file);
73
+ } catch (err) {
74
+ if (err?.code !== "ENOENT") {
75
+ throw err;
76
+ }
77
+ for await (const event of dirWatcher) {
78
+ if (abortController.signal.aborted) {
79
+ return;
80
+ }
81
+ const name = typeof event?.filename === "string" ? String(event.filename) : null;
82
+ if (name && name !== targetName) {
83
+ continue;
84
+ }
85
+ try {
86
+ await stat(file);
87
+ logger.debug(`[FILE_WATCHER] File appeared: ${file}`);
88
+ break;
89
+ } catch (nextErr) {
90
+ if (nextErr?.code === "ENOENT") {
91
+ continue;
92
+ }
93
+ throw nextErr;
94
+ }
95
+ }
96
+ }
97
+ } else {
98
+ throw e;
99
+ }
100
+ }
101
+ onFileChange(file);
102
+ logger.debug(`[FILE_WATCHER] Starting watcher for ${file}`);
103
+ const watcher = watch(file, { persistent: true, signal: abortController.signal });
104
+ for await (const event of watcher) {
105
+ if (abortController.signal.aborted) {
106
+ return;
107
+ }
108
+ logger.debug(`[FILE_WATCHER] File changed: ${file}`);
109
+ onFileChange(file);
110
+ }
111
+ } catch (e) {
112
+ if (abortController.signal.aborted) {
113
+ return;
114
+ }
115
+ logger.debug(`[FILE_WATCHER] Watch error: ${e.message}, restarting watcher in a second`);
116
+ await delay(1e3);
117
+ }
118
+ }
119
+ })();
120
+ return () => {
121
+ abortController.abort();
122
+ };
123
+ }
124
+
54
125
  class ProviderSelectionHandler {
55
126
  pendingRequests = /* @__PURE__ */ new Map();
56
127
  session;
@@ -81,6 +152,7 @@ class ProviderSelectionHandler {
81
152
  ...currentState.requests,
82
153
  [request.id]: {
83
154
  tool: "AskUserQuestion",
155
+ kind: "user_action",
84
156
  arguments: {
85
157
  requestKind: "selection",
86
158
  questions: [
@@ -225,6 +297,7 @@ class ProviderSelectionHandler {
225
297
  this.session.updateAgentState((currentState) => {
226
298
  const request = currentState.requests?.[requestId] || {
227
299
  tool: "AskUserQuestion",
300
+ kind: "user_action",
228
301
  arguments: {
229
302
  requestKind: "selection",
230
303
  questions: []
@@ -258,4 +331,4 @@ class ProviderSelectionHandler {
258
331
  }
259
332
  }
260
333
 
261
- export { ProviderSelectionHandler as P, createKeepAliveController as c, runModeLoop as r };
334
+ export { ProviderSelectionHandler as P, createKeepAliveController as c, runModeLoop as r, startFileWatcher as s };
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./types-B6Hka3jh.cjs');
4
- var sessionControl = require('./sessionControl-BTPsASVE.cjs');
3
+ var persistence = require('./types-YSuc04nv.cjs');
4
+ var fs = require('fs/promises');
5
+ var path = require('node:path');
5
6
 
6
7
  async function runModeLoop(opts) {
7
8
  let currentMode = opts.startingMode;
@@ -53,6 +54,76 @@ function createKeepAliveController(opts) {
53
54
  };
54
55
  }
55
56
 
57
+ function startFileWatcher(file, onFileChange) {
58
+ const abortController = new AbortController();
59
+ const parentDir = path.dirname(file);
60
+ const targetName = path.basename(file);
61
+ void (async () => {
62
+ while (true) {
63
+ try {
64
+ try {
65
+ await fs.stat(file);
66
+ } catch (e) {
67
+ if (abortController.signal.aborted) {
68
+ return;
69
+ }
70
+ if (e?.code === "ENOENT") {
71
+ persistence.logger.debug(`[FILE_WATCHER] Waiting for file to exist: ${file}`);
72
+ const dirWatcher = fs.watch(parentDir, { persistent: true, signal: abortController.signal });
73
+ try {
74
+ await fs.stat(file);
75
+ } catch (err) {
76
+ if (err?.code !== "ENOENT") {
77
+ throw err;
78
+ }
79
+ for await (const event of dirWatcher) {
80
+ if (abortController.signal.aborted) {
81
+ return;
82
+ }
83
+ const name = typeof event?.filename === "string" ? String(event.filename) : null;
84
+ if (name && name !== targetName) {
85
+ continue;
86
+ }
87
+ try {
88
+ await fs.stat(file);
89
+ persistence.logger.debug(`[FILE_WATCHER] File appeared: ${file}`);
90
+ break;
91
+ } catch (nextErr) {
92
+ if (nextErr?.code === "ENOENT") {
93
+ continue;
94
+ }
95
+ throw nextErr;
96
+ }
97
+ }
98
+ }
99
+ } else {
100
+ throw e;
101
+ }
102
+ }
103
+ onFileChange(file);
104
+ persistence.logger.debug(`[FILE_WATCHER] Starting watcher for ${file}`);
105
+ const watcher = fs.watch(file, { persistent: true, signal: abortController.signal });
106
+ for await (const event of watcher) {
107
+ if (abortController.signal.aborted) {
108
+ return;
109
+ }
110
+ persistence.logger.debug(`[FILE_WATCHER] File changed: ${file}`);
111
+ onFileChange(file);
112
+ }
113
+ } catch (e) {
114
+ if (abortController.signal.aborted) {
115
+ return;
116
+ }
117
+ persistence.logger.debug(`[FILE_WATCHER] Watch error: ${e.message}, restarting watcher in a second`);
118
+ await persistence.delay(1e3);
119
+ }
120
+ }
121
+ })();
122
+ return () => {
123
+ abortController.abort();
124
+ };
125
+ }
126
+
56
127
  class ProviderSelectionHandler {
57
128
  pendingRequests = /* @__PURE__ */ new Map();
58
129
  session;
@@ -75,7 +146,7 @@ class ProviderSelectionHandler {
75
146
  };
76
147
  pending.timeoutHandle = setTimeout(() => {
77
148
  this.handleSelectionTimeout(request.id, pending);
78
- }, sessionControl.getPendingInteractionTimeoutMs());
149
+ }, persistence.getPendingInteractionTimeoutMs());
79
150
  this.pendingRequests.set(request.id, pending);
80
151
  this.session.updateAgentState((currentState) => ({
81
152
  ...currentState,
@@ -83,6 +154,7 @@ class ProviderSelectionHandler {
83
154
  ...currentState.requests,
84
155
  [request.id]: {
85
156
  tool: "AskUserQuestion",
157
+ kind: "user_action",
86
158
  arguments: {
87
159
  requestKind: "selection",
88
160
  questions: [
@@ -111,7 +183,7 @@ class ProviderSelectionHandler {
111
183
  hasPendingRequests() {
112
184
  return this.pendingRequests.size > 0;
113
185
  }
114
- supersedePendingRequests(reason = sessionControl.INTERACTION_SUPERSEDED_ERROR) {
186
+ supersedePendingRequests(reason = persistence.INTERACTION_SUPERSEDED_ERROR) {
115
187
  const pendingSnapshot = Array.from(this.pendingRequests.entries());
116
188
  if (pendingSnapshot.length === 0) {
117
189
  return 0;
@@ -223,10 +295,11 @@ class ProviderSelectionHandler {
223
295
  }
224
296
  this.pendingRequests.delete(requestId);
225
297
  this.clearPendingRequestTimeout(active);
226
- active.reject(new Error(sessionControl.INTERACTION_TIMED_OUT_ERROR));
298
+ active.reject(new Error(persistence.INTERACTION_TIMED_OUT_ERROR));
227
299
  this.session.updateAgentState((currentState) => {
228
300
  const request = currentState.requests?.[requestId] || {
229
301
  tool: "AskUserQuestion",
302
+ kind: "user_action",
230
303
  arguments: {
231
304
  requestKind: "selection",
232
305
  questions: []
@@ -246,7 +319,7 @@ class ProviderSelectionHandler {
246
319
  ...request,
247
320
  completedAt: Date.now(),
248
321
  status: "canceled",
249
- reason: sessionControl.INTERACTION_TIMED_OUT_ERROR,
322
+ reason: persistence.INTERACTION_TIMED_OUT_ERROR,
250
323
  requestKind: "selection"
251
324
  }
252
325
  }
@@ -263,3 +336,4 @@ class ProviderSelectionHandler {
263
336
  exports.ProviderSelectionHandler = ProviderSelectionHandler;
264
337
  exports.createKeepAliveController = createKeepAliveController;
265
338
  exports.runModeLoop = runModeLoop;
339
+ exports.startFileWatcher = startFileWatcher;
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D5WM-gNy.cjs');
4
- var persistence = require('./types-B6Hka3jh.cjs');
3
+ var persistence = require('./types-YSuc04nv.cjs');
5
4
  var node_events = require('node:events');
6
5
 
7
6
  function createOfflineSessionStub(sessionTag) {
@@ -86,7 +85,7 @@ function setupOfflineReconnection(opts) {
86
85
  }
87
86
 
88
87
  async function bootstrapManagedProviderSession(opts) {
89
- const { state, metadata, happyOrgStartupBinding } = index.createSessionMetadata({
88
+ const { state, metadata, happyOrgStartupBinding } = persistence.createSessionMetadata({
90
89
  flavor: opts.flavor,
91
90
  machineId: opts.machineId,
92
91
  startedBy: opts.startedBy,
@@ -97,7 +96,10 @@ async function bootstrapManagedProviderSession(opts) {
97
96
  return;
98
97
  }
99
98
  try {
100
- session2.updateMetadata(() => metadata);
99
+ session2.updateMetadata((currentMetadata) => ({
100
+ ...currentMetadata,
101
+ ...metadata
102
+ }));
101
103
  } catch (error) {
102
104
  persistence.logger.debug(`[managed-session] Failed to reconcile metadata for ${opts.flavor} session`, error);
103
105
  }
@@ -125,14 +127,14 @@ async function bootstrapManagedProviderSession(opts) {
125
127
  onSessionSwap: (newSession) => {
126
128
  opts.onSessionSwap?.(newSession, metadata);
127
129
  reconcileAttachedSessionMetadata(newSession);
128
- void index.publishSessionRegistration(newSession.sessionId, metadata);
130
+ void persistence.publishSessionRegistration(newSession.sessionId, metadata);
129
131
  }
130
132
  });
131
133
  if (response) {
132
134
  reconcileAttachedSessionMetadata(session);
133
135
  }
134
136
  if (response) {
135
- await index.publishSessionRegistration(response.id, metadata);
137
+ await persistence.publishSessionRegistration(response.id, metadata);
136
138
  }
137
139
  return {
138
140
  state,
@@ -1,5 +1,4 @@
1
- import { e as createSessionMetadata, m as publishSessionRegistration } from './index-BkggJHjM.mjs';
2
- import { V as startOfflineReconnection, s as configuration, E as isAuthenticationRequiredError, F as logger } from './types-DkfOkkim.mjs';
1
+ import { bl as startOfflineReconnection, Q as configuration, a0 as createSessionMetadata, aq as isAuthenticationRequiredError, aE as logger, aU as publishSessionRegistration } from './types-D5JZOVqD.mjs';
3
2
  import { EventEmitter } from 'node:events';
4
3
 
5
4
  function createOfflineSessionStub(sessionTag) {
@@ -95,7 +94,10 @@ async function bootstrapManagedProviderSession(opts) {
95
94
  return;
96
95
  }
97
96
  try {
98
- session2.updateMetadata(() => metadata);
97
+ session2.updateMetadata((currentMetadata) => ({
98
+ ...currentMetadata,
99
+ ...metadata
100
+ }));
99
101
  } catch (error) {
100
102
  logger.debug(`[managed-session] Failed to reconcile metadata for ${opts.flavor} session`, error);
101
103
  }
@@ -1,10 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createDefaultRuntimeShell = require('./createDefaultRuntimeShell-_a3R9SbY.cjs');
4
- require('cross-spawn');
5
- require('@agentclientprotocol/sdk');
6
- require('node:crypto');
7
- require('./types-B6Hka3jh.cjs');
3
+ var persistence = require('./types-YSuc04nv.cjs');
8
4
  require('axios');
9
5
  require('chalk');
10
6
  require('fs');
@@ -15,39 +11,35 @@ require('zod');
15
11
  require('node:events');
16
12
  require('node:fs/promises');
17
13
  require('socket.io-client');
14
+ require('node:crypto');
18
15
  require('tweetnacl');
19
16
  require('fs/promises');
20
17
  require('crypto');
21
18
  require('path');
22
19
  require('sharp');
23
20
  require('node:child_process');
24
- require('expo-server-sdk');
25
- require('./index-D5WM-gNy.cjs');
26
- require('os');
27
- require('qrcode-terminal');
28
- require('node:module');
29
- require('open');
30
- require('react');
31
- require('ink');
21
+ require('@noble/hashes/hmac');
22
+ require('@noble/hashes/sha512');
23
+ require('base64-js');
32
24
  require('child_process');
33
- require('url');
25
+ require('util');
26
+ require('cross-spawn');
27
+ require('@agentclientprotocol/sdk');
34
28
  require('ps-list');
29
+ require('url');
30
+ require('node:util');
31
+ require('node:stream');
32
+ require('node:stream/promises');
33
+ require('node:url');
34
+ require('os');
35
+ require('node:readline');
35
36
  require('fastify');
36
37
  require('fastify-type-provider-zod');
37
- require('node:readline');
38
- require('http');
39
- require('util');
40
- require('node:url');
41
- require('./codex-DPhkIcfb.cjs');
42
- require('./AcpBackend-B3ro_tdV.cjs');
43
- require('./RuntimeShell--T97e4f5.cjs');
44
- require('./resolveCommand-H8HwprW3.cjs');
45
- require('./claude-s2HCITr6.cjs');
46
- require('./future-Dq4Ha1Dn.cjs');
47
- require('./cursor-Csc_nwUR.cjs');
38
+ require('expo-server-sdk');
39
+ require('node:module');
48
40
 
49
41
  function listRuntimeProviders() {
50
- const shell = createDefaultRuntimeShell.createDefaultRuntimeShell();
42
+ const shell = persistence.createDefaultRuntimeShell();
51
43
  const providers = ["claude", "codex", "cursor"];
52
44
  return providers.map((provider) => ({
53
45
  provider,
@@ -1,8 +1,4 @@
1
- import { c as createDefaultRuntimeShell } from './createDefaultRuntimeShell-Bt79Le83.mjs';
2
- import 'cross-spawn';
3
- import '@agentclientprotocol/sdk';
4
- import 'node:crypto';
5
- import './types-DkfOkkim.mjs';
1
+ import { Y as createDefaultRuntimeShell } from './types-D5JZOVqD.mjs';
6
2
  import 'axios';
7
3
  import 'chalk';
8
4
  import 'fs';
@@ -13,36 +9,32 @@ import 'zod';
13
9
  import 'node:events';
14
10
  import 'node:fs/promises';
15
11
  import 'socket.io-client';
12
+ import 'node:crypto';
16
13
  import 'tweetnacl';
17
14
  import 'fs/promises';
18
15
  import 'crypto';
19
16
  import 'path';
20
17
  import 'sharp';
21
18
  import 'node:child_process';
22
- import 'expo-server-sdk';
23
- import './index-BkggJHjM.mjs';
24
- import 'os';
25
- import 'qrcode-terminal';
26
- import 'node:module';
27
- import 'open';
28
- import 'react';
29
- import 'ink';
19
+ import '@noble/hashes/hmac';
20
+ import '@noble/hashes/sha512';
21
+ import 'base64-js';
30
22
  import 'child_process';
31
- import 'url';
23
+ import 'util';
24
+ import 'cross-spawn';
25
+ import '@agentclientprotocol/sdk';
32
26
  import 'ps-list';
27
+ import 'url';
28
+ import 'node:util';
29
+ import 'node:stream';
30
+ import 'node:stream/promises';
31
+ import 'node:url';
32
+ import 'os';
33
+ import 'node:readline';
33
34
  import 'fastify';
34
35
  import 'fastify-type-provider-zod';
35
- import 'node:readline';
36
- import 'http';
37
- import 'util';
38
- import 'node:url';
39
- import './codex-AnifHbja.mjs';
40
- import './AcpBackend-4InE9FwE.mjs';
41
- import './RuntimeShell-DV7j_wJL.mjs';
42
- import './resolveCommand-CdF591A1.mjs';
43
- import './claude-BuBeJMOX.mjs';
44
- import './future-xRdLl3vf.mjs';
45
- import './cursor-ps28W3Y6.mjs';
36
+ import 'expo-server-sdk';
37
+ import 'node:module';
46
38
 
47
39
  function listRuntimeProviders() {
48
40
  const shell = createDefaultRuntimeShell();