happy-imou-cloud 2.1.8 → 2.1.9

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 (32) hide show
  1. package/bin/happy-cloud.mjs +1 -1
  2. package/dist/{BaseReasoningProcessor-DJ9zxAdt.mjs → BaseReasoningProcessor-CgEO6Vh-.mjs} +4 -3
  3. package/dist/{BaseReasoningProcessor-CbqNgi4p.cjs → BaseReasoningProcessor-DV6TAtd7.cjs} +4 -3
  4. package/dist/{ProviderSelectionHandler-BZVtGMAn.cjs → ProviderSelectionHandler-C6ILAmE3.cjs} +2 -2
  5. package/dist/{ProviderSelectionHandler-BleheBks.mjs → ProviderSelectionHandler-dczuX21U.mjs} +2 -2
  6. package/dist/{api-DRdn4-dL.mjs → api-CfHYTLZX.mjs} +57 -5
  7. package/dist/{api-CeIpGPqs.cjs → api-CfmTDha2.cjs} +57 -5
  8. package/dist/{command-mDMWVdh5.mjs → command-B0HfYWYW.mjs} +3 -3
  9. package/dist/{command-CTad-7bA.cjs → command-Bw2XKjA9.cjs} +3 -3
  10. package/dist/{index-C4S85XB7.mjs → index-BKjWLXkN.mjs} +10 -9
  11. package/dist/{index-D68EOBHW.cjs → index-C3bSe5_d.cjs} +13 -12
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.mjs +3 -3
  14. package/dist/lib.cjs +1 -1
  15. package/dist/lib.d.cts +1 -0
  16. package/dist/lib.d.mts +1 -0
  17. package/dist/lib.mjs +1 -1
  18. package/dist/{persistence-Czyd-Uei.cjs → persistence-Db4p7gsX.cjs} +1 -1
  19. package/dist/{persistence-DgpGouOO.mjs → persistence-Nun5c360.mjs} +1 -1
  20. package/dist/{registerKillSessionHandler-Dg0DFPae.mjs → registerKillSessionHandler-C1S9ytML.mjs} +3 -3
  21. package/dist/{registerKillSessionHandler-DECzSYvQ.cjs → registerKillSessionHandler-FIQEW2Rx.cjs} +3 -3
  22. package/dist/{runClaude-OWT6ZYiP.mjs → runClaude-ClXU2LZA.mjs} +5 -5
  23. package/dist/{runClaude-DtCH-nx-.cjs → runClaude-Dxye_oZf.cjs} +5 -5
  24. package/dist/{runCodex-BU3BA1l8.mjs → runCodex-CXu7_Wgk.mjs} +6 -6
  25. package/dist/{runCodex-reARLjN0.cjs → runCodex-IaL6Vqwc.cjs} +6 -6
  26. package/dist/{runGemini-BvJUvOvj.cjs → runGemini-BgcZcZsv.cjs} +5 -5
  27. package/dist/{runGemini-DeLxSapY.mjs → runGemini-BlJjRWN1.mjs} +5 -5
  28. package/package.json +1 -1
  29. package/scripts/devtools/README.md +9 -9
  30. package/scripts/e2e/fake-codex-acp-agent.mjs +139 -139
  31. package/scripts/e2e/local-server-session-roundtrip.mjs +1063 -1063
  32. package/scripts/ensureAcpSdkCompat.mjs +1 -1
@@ -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,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-C4S85XB7.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-DRdn4-dL.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-BKjWLXkN.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-CfHYTLZX.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { randomUUID } from 'node:crypto';
5
5
 
@@ -103,7 +103,8 @@ async function bootstrapManagedProviderSession(opts) {
103
103
  response = await opts.api.getOrCreateSession({
104
104
  tag: opts.sessionTag,
105
105
  metadata,
106
- state
106
+ state,
107
+ stableDataKeyPath: ["managed-session-tag", opts.sessionTag]
107
108
  });
108
109
  } catch (error) {
109
110
  if (!isAuthenticationRequiredError(error)) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D68EOBHW.cjs');
4
- var api = require('./api-CeIpGPqs.cjs');
3
+ var index = require('./index-C3bSe5_d.cjs');
4
+ var api = require('./api-CfmTDha2.cjs');
5
5
  var node_events = require('node:events');
6
6
  var node_crypto = require('node:crypto');
7
7
 
@@ -105,7 +105,8 @@ async function bootstrapManagedProviderSession(opts) {
105
105
  response = await opts.api.getOrCreateSession({
106
106
  tag: opts.sessionTag,
107
107
  metadata,
108
- state
108
+ state,
109
+ stableDataKeyPath: ["managed-session-tag", opts.sessionTag]
109
110
  });
110
111
  } catch (error) {
111
112
  if (!api.isAuthenticationRequiredError(error)) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-CeIpGPqs.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-DECzSYvQ.cjs');
3
+ var api = require('./api-CfmTDha2.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-FIQEW2Rx.cjs');
5
5
 
6
6
  async function runModeLoop(opts) {
7
7
  let currentMode = opts.startingMode;
@@ -1,5 +1,5 @@
1
- import { l as logger } from './api-DRdn4-dL.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-Dg0DFPae.mjs';
1
+ import { l as logger } from './api-CfHYTLZX.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-C1S9ytML.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -16,7 +16,7 @@ import { spawn } from 'node:child_process';
16
16
  import { Expo } from 'expo-server-sdk';
17
17
 
18
18
  var name = "happy-imou-cloud";
19
- var version = "2.1.8";
19
+ var version = "2.1.9";
20
20
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
21
21
  var author = "long.zhu";
22
22
  var license = "MIT";
@@ -431,7 +431,7 @@ async function listDaemonLogFiles(limit = 50) {
431
431
  return { file, path: fullPath, modified: stats.mtime };
432
432
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
433
433
  try {
434
- const { readDaemonState } = await import('./persistence-DgpGouOO.mjs');
434
+ const { readDaemonState } = await import('./persistence-Nun5c360.mjs');
435
435
  const state = await readDaemonState();
436
436
  if (!state) {
437
437
  return logs;
@@ -1782,7 +1782,14 @@ class ApiSessionClient extends EventEmitter {
1782
1782
  encryptionVariant: this.encryptionVariant,
1783
1783
  logger: (msg, data) => logger.debug(msg, data)
1784
1784
  });
1785
- registerCommonHandlers(this.rpcHandlerManager, this.metadata.path);
1785
+ const workingDirectory = this.metadata?.path ?? process.cwd();
1786
+ if (!this.metadata?.path) {
1787
+ logger.debug("[API] Session metadata missing path during client initialization, falling back to process.cwd()", {
1788
+ sessionId: this.sessionId,
1789
+ workingDirectory
1790
+ });
1791
+ }
1792
+ registerCommonHandlers(this.rpcHandlerManager, workingDirectory);
1786
1793
  this.socket = io(configuration.serverUrl, {
1787
1794
  auth: (cb) => cb(buildSocketAuth({
1788
1795
  credentials: this.credentials,
@@ -3257,6 +3264,39 @@ class OfflineState {
3257
3264
  }
3258
3265
  const connectionState = new OfflineState();
3259
3266
 
3267
+ async function hmac_sha512(key, data) {
3268
+ const hmac = createHmac("sha512", key);
3269
+ hmac.update(data);
3270
+ return new Uint8Array(hmac.digest());
3271
+ }
3272
+
3273
+ async function deriveSecretKeyTreeRoot(seed, usage) {
3274
+ const I = await hmac_sha512(new TextEncoder().encode(usage + " Master Seed"), seed);
3275
+ return {
3276
+ key: I.slice(0, 32),
3277
+ chainCode: I.slice(32)
3278
+ };
3279
+ }
3280
+ async function deriveSecretKeyTreeChild(chainCode, index) {
3281
+ const data = new Uint8Array([0, ...new TextEncoder().encode(index)]);
3282
+ const I = await hmac_sha512(chainCode, data);
3283
+ return {
3284
+ key: I.subarray(0, 32),
3285
+ chainCode: I.subarray(32)
3286
+ };
3287
+ }
3288
+ async function deriveKey(master, usage, path) {
3289
+ let state = await deriveSecretKeyTreeRoot(master, usage);
3290
+ let remaining = [...path];
3291
+ while (remaining.length > 0) {
3292
+ let index = remaining[0];
3293
+ remaining = remaining.slice(1);
3294
+ state = await deriveSecretKeyTreeChild(state.chainCode, index);
3295
+ }
3296
+ return state.key;
3297
+ }
3298
+
3299
+ const SESSION_DATA_KEY_USAGE = "Happy Session Data Key";
3260
3300
  class ApiClient {
3261
3301
  static async create(credential) {
3262
3302
  return new ApiClient(credential);
@@ -3398,7 +3438,15 @@ class ApiClient {
3398
3438
  let encryptionKey;
3399
3439
  let encryptionVariant;
3400
3440
  if (this.credential.encryption.type === "dataKey") {
3401
- encryptionKey = getRandomBytes(32);
3441
+ if (opts.stableDataKeyPath && opts.stableDataKeyPath.length > 0) {
3442
+ encryptionKey = await deriveKey(
3443
+ this.credential.encryption.machineKey,
3444
+ SESSION_DATA_KEY_USAGE,
3445
+ opts.stableDataKeyPath
3446
+ );
3447
+ } else {
3448
+ encryptionKey = getRandomBytes(32);
3449
+ }
3402
3450
  encryptionVariant = "dataKey";
3403
3451
  let encryptedDataKey = libsodiumEncryptForPublicKey(encryptionKey, this.credential.encryption.publicKey);
3404
3452
  dataEncryptionKey = new Uint8Array(encryptedDataKey.length + 1);
@@ -3424,10 +3472,14 @@ class ApiClient {
3424
3472
  });
3425
3473
  logger.debug(`Session created/loaded: ${response.data.session.id} (tag: ${opts.tag})`);
3426
3474
  let raw = response.data.session;
3475
+ const metadata = decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.metadata));
3476
+ if (metadata === null) {
3477
+ throw new Error(`Failed to decrypt session metadata for tag ${opts.tag}`);
3478
+ }
3427
3479
  let session = {
3428
3480
  id: raw.id,
3429
3481
  seq: raw.seq,
3430
- metadata: decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.metadata)),
3482
+ metadata,
3431
3483
  metadataVersion: raw.metadataVersion,
3432
3484
  agentState: raw.agentState ? decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.agentState)) : null,
3433
3485
  agentStateVersion: raw.agentStateVersion,
@@ -18,7 +18,7 @@ var node_child_process = require('node:child_process');
18
18
  var expoServerSdk = require('expo-server-sdk');
19
19
 
20
20
  var name = "happy-imou-cloud";
21
- var version = "2.1.8";
21
+ var version = "2.1.9";
22
22
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
23
23
  var author = "long.zhu";
24
24
  var license = "MIT";
@@ -433,7 +433,7 @@ async function listDaemonLogFiles(limit = 50) {
433
433
  return { file, path: fullPath, modified: stats.mtime };
434
434
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
435
435
  try {
436
- const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-Czyd-Uei.cjs'); });
436
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-Db4p7gsX.cjs'); });
437
437
  const state = await readDaemonState();
438
438
  if (!state) {
439
439
  return logs;
@@ -1784,7 +1784,14 @@ class ApiSessionClient extends node_events.EventEmitter {
1784
1784
  encryptionVariant: this.encryptionVariant,
1785
1785
  logger: (msg, data) => logger.debug(msg, data)
1786
1786
  });
1787
- registerCommonHandlers(this.rpcHandlerManager, this.metadata.path);
1787
+ const workingDirectory = this.metadata?.path ?? process.cwd();
1788
+ if (!this.metadata?.path) {
1789
+ logger.debug("[API] Session metadata missing path during client initialization, falling back to process.cwd()", {
1790
+ sessionId: this.sessionId,
1791
+ workingDirectory
1792
+ });
1793
+ }
1794
+ registerCommonHandlers(this.rpcHandlerManager, workingDirectory);
1788
1795
  this.socket = socket_ioClient.io(configuration.serverUrl, {
1789
1796
  auth: (cb) => cb(buildSocketAuth({
1790
1797
  credentials: this.credentials,
@@ -3259,6 +3266,39 @@ class OfflineState {
3259
3266
  }
3260
3267
  const connectionState = new OfflineState();
3261
3268
 
3269
+ async function hmac_sha512(key, data) {
3270
+ const hmac = node_crypto.createHmac("sha512", key);
3271
+ hmac.update(data);
3272
+ return new Uint8Array(hmac.digest());
3273
+ }
3274
+
3275
+ async function deriveSecretKeyTreeRoot(seed, usage) {
3276
+ const I = await hmac_sha512(new TextEncoder().encode(usage + " Master Seed"), seed);
3277
+ return {
3278
+ key: I.slice(0, 32),
3279
+ chainCode: I.slice(32)
3280
+ };
3281
+ }
3282
+ async function deriveSecretKeyTreeChild(chainCode, index) {
3283
+ const data = new Uint8Array([0, ...new TextEncoder().encode(index)]);
3284
+ const I = await hmac_sha512(chainCode, data);
3285
+ return {
3286
+ key: I.subarray(0, 32),
3287
+ chainCode: I.subarray(32)
3288
+ };
3289
+ }
3290
+ async function deriveKey(master, usage, path) {
3291
+ let state = await deriveSecretKeyTreeRoot(master, usage);
3292
+ let remaining = [...path];
3293
+ while (remaining.length > 0) {
3294
+ let index = remaining[0];
3295
+ remaining = remaining.slice(1);
3296
+ state = await deriveSecretKeyTreeChild(state.chainCode, index);
3297
+ }
3298
+ return state.key;
3299
+ }
3300
+
3301
+ const SESSION_DATA_KEY_USAGE = "Happy Session Data Key";
3262
3302
  class ApiClient {
3263
3303
  static async create(credential) {
3264
3304
  return new ApiClient(credential);
@@ -3400,7 +3440,15 @@ class ApiClient {
3400
3440
  let encryptionKey;
3401
3441
  let encryptionVariant;
3402
3442
  if (this.credential.encryption.type === "dataKey") {
3403
- encryptionKey = getRandomBytes(32);
3443
+ if (opts.stableDataKeyPath && opts.stableDataKeyPath.length > 0) {
3444
+ encryptionKey = await deriveKey(
3445
+ this.credential.encryption.machineKey,
3446
+ SESSION_DATA_KEY_USAGE,
3447
+ opts.stableDataKeyPath
3448
+ );
3449
+ } else {
3450
+ encryptionKey = getRandomBytes(32);
3451
+ }
3404
3452
  encryptionVariant = "dataKey";
3405
3453
  let encryptedDataKey = libsodiumEncryptForPublicKey(encryptionKey, this.credential.encryption.publicKey);
3406
3454
  dataEncryptionKey = new Uint8Array(encryptedDataKey.length + 1);
@@ -3426,10 +3474,14 @@ class ApiClient {
3426
3474
  });
3427
3475
  logger.debug(`Session created/loaded: ${response.data.session.id} (tag: ${opts.tag})`);
3428
3476
  let raw = response.data.session;
3477
+ const metadata = decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.metadata));
3478
+ if (metadata === null) {
3479
+ throw new Error(`Failed to decrypt session metadata for tag ${opts.tag}`);
3480
+ }
3429
3481
  let session = {
3430
3482
  id: raw.id,
3431
3483
  seq: raw.seq,
3432
- metadata: decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.metadata)),
3484
+ metadata,
3433
3485
  metadataVersion: raw.metadataVersion,
3434
3486
  agentState: raw.agentState ? decrypt(encryptionKey, encryptionVariant, decodeBase64(raw.agentState)) : null,
3435
3487
  agentStateVersion: raw.agentStateVersion,
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-C4S85XB7.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-BKjWLXkN.mjs';
2
2
  import 'chalk';
3
- import './api-DRdn4-dL.mjs';
3
+ import './api-CfHYTLZX.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -16,7 +16,7 @@ import 'crypto';
16
16
  import 'path';
17
17
  import 'node:child_process';
18
18
  import 'expo-server-sdk';
19
- import './persistence-DgpGouOO.mjs';
19
+ import './persistence-Nun5c360.mjs';
20
20
  import 'node:fs/promises';
21
21
  import 'os';
22
22
  import 'tmp';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D68EOBHW.cjs');
3
+ var index = require('./index-C3bSe5_d.cjs');
4
4
  require('chalk');
5
- require('./api-CeIpGPqs.cjs');
5
+ require('./api-CfmTDha2.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -18,7 +18,7 @@ require('crypto');
18
18
  require('path');
19
19
  require('node:child_process');
20
20
  require('expo-server-sdk');
21
- require('./persistence-Czyd-Uei.cjs');
21
+ require('./persistence-Db4p7gsX.cjs');
22
22
  require('node:fs/promises');
23
23
  require('os');
24
24
  require('tmp');
@@ -1,6 +1,6 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
- import { l as logger, e as encodeBase64, c as configuration, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, p as decodeBase64, q as HAPPY_CLOUD_DAEMON_PORT, r as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-DRdn4-dL.mjs';
3
- import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-DgpGouOO.mjs';
2
+ import { l as logger, e as encodeBase64, c as configuration, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, p as decodeBase64, q as HAPPY_CLOUD_DAEMON_PORT, r as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-CfHYTLZX.mjs';
3
+ import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-Nun5c360.mjs';
4
4
  import { z } from 'zod';
5
5
  import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
6
6
  import os$1, { homedir } from 'os';
@@ -2604,7 +2604,8 @@ async function precreateDaemonManagedSession(opts) {
2604
2604
  return await opts.api.getOrCreateSession({
2605
2605
  tag: opts.sessionTag,
2606
2606
  metadata,
2607
- state
2607
+ state,
2608
+ stableDataKeyPath: ["managed-session-tag", opts.sessionTag]
2608
2609
  });
2609
2610
  } catch (error) {
2610
2611
  logger.debug(`[DAEMON RUN] Failed to precreate ${opts.flavor} session for tag ${opts.sessionTag}`, error);
@@ -9838,11 +9839,11 @@ var launch = /*#__PURE__*/Object.freeze({
9838
9839
 
9839
9840
  const unifiedProviderExecutors = {
9840
9841
  claude: async (opts) => {
9841
- const { runClaude } = await import('./runClaude-OWT6ZYiP.mjs');
9842
+ const { runClaude } = await import('./runClaude-ClXU2LZA.mjs');
9842
9843
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9843
9844
  },
9844
9845
  codex: async (opts) => {
9845
- const { runCodex } = await import('./runCodex-BU3BA1l8.mjs');
9846
+ const { runCodex } = await import('./runCodex-CXu7_Wgk.mjs');
9846
9847
  await runCodex({
9847
9848
  credentials: opts.credentials,
9848
9849
  startedBy: opts.startedBy,
@@ -9851,7 +9852,7 @@ const unifiedProviderExecutors = {
9851
9852
  });
9852
9853
  },
9853
9854
  gemini: async (opts) => {
9854
- const { runGemini } = await import('./runGemini-DeLxSapY.mjs');
9855
+ const { runGemini } = await import('./runGemini-BlJjRWN1.mjs');
9855
9856
  await runGemini({
9856
9857
  credentials: opts.credentials,
9857
9858
  startedBy: opts.startedBy
@@ -9934,7 +9935,7 @@ function shouldRunMainClaudeFlow(opts) {
9934
9935
  return;
9935
9936
  } else if (subcommand === "runtime") {
9936
9937
  if (args[1] === "providers") {
9937
- const { renderRuntimeProviders } = await import('./command-mDMWVdh5.mjs');
9938
+ const { renderRuntimeProviders } = await import('./command-B0HfYWYW.mjs');
9938
9939
  console.log(renderRuntimeProviders());
9939
9940
  return;
9940
9941
  }
@@ -10112,8 +10113,8 @@ function shouldRunMainClaudeFlow(opts) {
10112
10113
  const projectId = args[3];
10113
10114
  try {
10114
10115
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
10115
- const { readCredentials: readCredentials2 } = await import('./persistence-DgpGouOO.mjs');
10116
- const { ApiClient: ApiClient2 } = await import('./api-DRdn4-dL.mjs').then(function (n) { return n.v; });
10116
+ const { readCredentials: readCredentials2 } = await import('./persistence-Nun5c360.mjs');
10117
+ const { ApiClient: ApiClient2 } = await import('./api-CfHYTLZX.mjs').then(function (n) { return n.v; });
10117
10118
  let userEmail = void 0;
10118
10119
  try {
10119
10120
  const credentials = await readCredentials2();
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var api = require('./api-CeIpGPqs.cjs');
5
- var persistence = require('./persistence-Czyd-Uei.cjs');
4
+ var api = require('./api-CfmTDha2.cjs');
5
+ var persistence = require('./persistence-Db4p7gsX.cjs');
6
6
  var z = require('zod');
7
7
  var fs$2 = require('fs/promises');
8
8
  var os$1 = require('os');
@@ -72,7 +72,7 @@ async function openBrowser(url) {
72
72
  }
73
73
  }
74
74
 
75
- 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-D68EOBHW.cjs', document.baseURI).href)));
75
+ 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-C3bSe5_d.cjs', document.baseURI).href)));
76
76
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
77
77
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
78
78
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -695,7 +695,7 @@ function setupCleanupHandlers() {
695
695
  });
696
696
  }
697
697
 
698
- const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-D68EOBHW.cjs', document.baseURI).href))));
698
+ const __dirname$2 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C3bSe5_d.cjs', document.baseURI).href))));
699
699
  function projectPath() {
700
700
  const path = path$1.resolve(__dirname$2, "..");
701
701
  return path;
@@ -2626,7 +2626,8 @@ async function precreateDaemonManagedSession(opts) {
2626
2626
  return await opts.api.getOrCreateSession({
2627
2627
  tag: opts.sessionTag,
2628
2628
  metadata,
2629
- state
2629
+ state,
2630
+ stableDataKeyPath: ["managed-session-tag", opts.sessionTag]
2630
2631
  });
2631
2632
  } catch (error) {
2632
2633
  api.logger.debug(`[DAEMON RUN] Failed to precreate ${opts.flavor} session for tag ${opts.sessionTag}`, error);
@@ -8590,7 +8591,7 @@ class AbortError extends Error {
8590
8591
  }
8591
8592
  }
8592
8593
 
8593
- 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-D68EOBHW.cjs', document.baseURI).href)));
8594
+ 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-C3bSe5_d.cjs', document.baseURI).href)));
8594
8595
  const __dirname$1 = path.join(__filename$1, "..");
8595
8596
  function getGlobalClaudeVersion() {
8596
8597
  try {
@@ -9860,11 +9861,11 @@ var launch = /*#__PURE__*/Object.freeze({
9860
9861
 
9861
9862
  const unifiedProviderExecutors = {
9862
9863
  claude: async (opts) => {
9863
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-DtCH-nx-.cjs'); });
9864
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-Dxye_oZf.cjs'); });
9864
9865
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9865
9866
  },
9866
9867
  codex: async (opts) => {
9867
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-reARLjN0.cjs'); });
9868
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-IaL6Vqwc.cjs'); });
9868
9869
  await runCodex({
9869
9870
  credentials: opts.credentials,
9870
9871
  startedBy: opts.startedBy,
@@ -9873,7 +9874,7 @@ const unifiedProviderExecutors = {
9873
9874
  });
9874
9875
  },
9875
9876
  gemini: async (opts) => {
9876
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BvJUvOvj.cjs'); });
9877
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BgcZcZsv.cjs'); });
9877
9878
  await runGemini({
9878
9879
  credentials: opts.credentials,
9879
9880
  startedBy: opts.startedBy
@@ -9956,7 +9957,7 @@ function shouldRunMainClaudeFlow(opts) {
9956
9957
  return;
9957
9958
  } else if (subcommand === "runtime") {
9958
9959
  if (args[1] === "providers") {
9959
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-CTad-7bA.cjs'); });
9960
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Bw2XKjA9.cjs'); });
9960
9961
  console.log(renderRuntimeProviders());
9961
9962
  return;
9962
9963
  }
@@ -10134,8 +10135,8 @@ function shouldRunMainClaudeFlow(opts) {
10134
10135
  const projectId = args[3];
10135
10136
  try {
10136
10137
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
10137
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-Czyd-Uei.cjs'); });
10138
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-CeIpGPqs.cjs'); }).then(function (n) { return n.api; });
10138
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-Db4p7gsX.cjs'); });
10139
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-CfmTDha2.cjs'); }).then(function (n) { return n.api; });
10139
10140
  let userEmail = void 0;
10140
10141
  try {
10141
10142
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-CeIpGPqs.cjs');
5
- require('./persistence-Czyd-Uei.cjs');
4
+ require('./api-CfmTDha2.cjs');
5
+ require('./persistence-Db4p7gsX.cjs');
6
6
  require('zod');
7
- require('./index-D68EOBHW.cjs');
7
+ require('./index-C3bSe5_d.cjs');
8
8
  require('node:child_process');
9
9
  require('node:fs');
10
10
  require('cross-spawn');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './api-DRdn4-dL.mjs';
3
- import './persistence-DgpGouOO.mjs';
2
+ import './api-CfHYTLZX.mjs';
3
+ import './persistence-Nun5c360.mjs';
4
4
  import 'zod';
5
- import './index-C4S85XB7.mjs';
5
+ import './index-BKjWLXkN.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:fs';
8
8
  import 'cross-spawn';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-CeIpGPqs.cjs');
3
+ var api = require('./api-CfmTDha2.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
package/dist/lib.d.cts CHANGED
@@ -2279,6 +2279,7 @@ declare class ApiClient {
2279
2279
  tag: string;
2280
2280
  metadata: Metadata;
2281
2281
  state: AgentState | null;
2282
+ stableDataKeyPath?: string[];
2282
2283
  }): Promise<Session | null>;
2283
2284
  /**
2284
2285
  * Register or update machine with the server
package/dist/lib.d.mts CHANGED
@@ -2279,6 +2279,7 @@ declare class ApiClient {
2279
2279
  tag: string;
2280
2280
  metadata: Metadata;
2281
2281
  state: AgentState | null;
2282
+ stableDataKeyPath?: string[];
2282
2283
  }): Promise<Session | null>;
2283
2284
  /**
2284
2285
  * Register or update machine with the server
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-DRdn4-dL.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-CfHYTLZX.mjs';
2
2
  export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
3
3
  import 'axios';
4
4
  import 'chalk';
@@ -3,7 +3,7 @@
3
3
  var promises = require('node:fs/promises');
4
4
  var fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var api = require('./api-CeIpGPqs.cjs');
6
+ var api = require('./api-CfmTDha2.cjs');
7
7
  var z = require('zod');
8
8
  require('axios');
9
9
  require('chalk');
@@ -1,7 +1,7 @@
1
1
  import { unlink, readFile, mkdir, open, stat, writeFile, rename } from 'node:fs/promises';
2
2
  import { existsSync, unlinkSync, readdirSync, constants, writeFileSync, readFileSync } from 'node:fs';
3
3
  import { join, dirname } from 'node:path';
4
- import { c as configuration, l as logger, e as encodeBase64 } from './api-DRdn4-dL.mjs';
4
+ import { c as configuration, l as logger, e as encodeBase64 } from './api-CfHYTLZX.mjs';
5
5
  import * as z from 'zod';
6
6
  import 'axios';
7
7
  import 'chalk';
@@ -1,7 +1,7 @@
1
- import { k as initialMachineMetadata, R as RuntimeShell, l as resolveCanonicalToolNameV2, f as formatDisplayMessage } from './index-C4S85XB7.mjs';
2
- import { readSettings } from './persistence-DgpGouOO.mjs';
1
+ import { k as initialMachineMetadata, R as RuntimeShell, l as resolveCanonicalToolNameV2, f as formatDisplayMessage } from './index-BKjWLXkN.mjs';
2
+ import { readSettings } from './persistence-Nun5c360.mjs';
3
3
  import { randomUUID } from 'node:crypto';
4
- import { H as HAPPY_ORG_TURN_REPORT_TAG, d as HAPPY_ORG_SUMMARY_MAX_LENGTH, f as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-DRdn4-dL.mjs';
4
+ import { H as HAPPY_ORG_TURN_REPORT_TAG, d as HAPPY_ORG_SUMMARY_MAX_LENGTH, f as HAPPY_ORG_REPEAT_THRESHOLD, l as logger } from './api-CfHYTLZX.mjs';
5
5
  import { createHash } from 'crypto';
6
6
  import 'axios';
7
7
  import 'node:events';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D68EOBHW.cjs');
4
- var persistence = require('./persistence-Czyd-Uei.cjs');
3
+ var index = require('./index-C3bSe5_d.cjs');
4
+ var persistence = require('./persistence-Db4p7gsX.cjs');
5
5
  var node_crypto = require('node:crypto');
6
- var api = require('./api-CeIpGPqs.cjs');
6
+ var api = require('./api-CfmTDha2.cjs');
7
7
  var crypto = require('crypto');
8
8
  require('axios');
9
9
  require('node:events');
@@ -1,8 +1,8 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { l as logger, g as backoff, h as delay, j as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-DRdn4-dL.mjs';
2
+ import { l as logger, g as backoff, h as delay, j as AsyncLock, c as configuration, s as startOfflineReconnection, b as connectionState, A as ApiClient, i as isAuthenticationRequiredError } from './api-CfHYTLZX.mjs';
3
3
  import 'cross-spawn';
4
4
  import '@agentclientprotocol/sdk';
5
- import { m as getProjectPath, F as Future, n as claudeLocal, E as ExitCodeError, o as trimIdent, q as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, u as claudeCheckSession, w as projectPath, x as mapToClaudeMode, P as PushableAsyncIterable, y as query, A as AbortError, e as stopCaffeinate, p as publishSessionRegistration, z as getEnvironmentInfo, a as createSessionMetadata, B as startCaffeinate, b as closeProviderSession } from './index-C4S85XB7.mjs';
5
+ import { m as getProjectPath, F as Future, n as claudeLocal, E as ExitCodeError, o as trimIdent, q as createClaudeBackend, f as formatDisplayMessage, t as truncateDisplayMessage, u as claudeCheckSession, w as projectPath, x as mapToClaudeMode, P as PushableAsyncIterable, y as query, A as AbortError, e as stopCaffeinate, p as publishSessionRegistration, z as getEnvironmentInfo, a as createSessionMetadata, B as startCaffeinate, b as closeProviderSession } from './index-BKjWLXkN.mjs';
6
6
  import 'ps-list';
7
7
  import 'fs';
8
8
  import 'path';
@@ -13,7 +13,7 @@ import { dirname, basename, join, resolve } from 'node:path';
13
13
  import { homedir } from 'node:os';
14
14
  import { execSync } from 'node:child_process';
15
15
  import 'node:readline';
16
- import './persistence-DgpGouOO.mjs';
16
+ import './persistence-Nun5c360.mjs';
17
17
  import { readFile } from 'node:fs/promises';
18
18
  import { stat, watch, access } from 'fs/promises';
19
19
  import 'crypto';
@@ -24,9 +24,9 @@ import 'tweetnacl';
24
24
  import 'open';
25
25
  import React, { useState, useRef, useEffect, useCallback } from 'react';
26
26
  import { useStdout, useInput, Box, Text, render } from 'ink';
27
- import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-BleheBks.mjs';
27
+ import { c as createKeepAliveController, P as ProviderSelectionHandler, r as runModeLoop } from './ProviderSelectionHandler-dczuX21U.mjs';
28
28
  import { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
29
- import { B as BasePermissionHandler, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurn, l as launchRuntimeHandleWithFactoryResult, k as forwardAgentMessageToProviderSession, s as syncControlledByUserState, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, h as hashObject, c as registerKillSessionHandler } from './registerKillSessionHandler-Dg0DFPae.mjs';
29
+ import { B as BasePermissionHandler, d as MessageBuffer, C as ConversationHistory$1, f as buildHappyOrgTurnPrompt, w as waitForResponseCompleteWithAbort, i as finalizeHappyOrgTurn, l as launchRuntimeHandleWithFactoryResult, k as forwardAgentMessageToProviderSession, s as syncControlledByUserState, r as resolveHappyOrgQueuedTurn, e as ensureManagedProviderMachine, M as MissingMachineIdError, b as MessageQueue2, h as hashObject, c as registerKillSessionHandler } from './registerKillSessionHandler-C1S9ytML.mjs';
30
30
  import 'socket.io-client';
31
31
  import 'expo-server-sdk';
32
32
  import { isDeepStrictEqual } from 'node:util';