happy-imou-cloud 2.0.10 → 2.0.11

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 (34) hide show
  1. package/dist/BaseReasoningProcessor-5ACv9gKu.mjs +320 -0
  2. package/dist/BaseReasoningProcessor-COrRWyn0.cjs +323 -0
  3. package/dist/ProviderSelectionHandler-BljOLMQn.mjs +261 -0
  4. package/dist/ProviderSelectionHandler-DBGobhGZ.cjs +265 -0
  5. package/dist/{api-BjxmW-0W.mjs → api-BcWf5v4i.mjs} +174 -46
  6. package/dist/{api-DUE5TJBE.cjs → api-Ye-rPX6s.cjs} +174 -46
  7. package/dist/{command-Df7u5eAT.cjs → command-BK93nizl.cjs} +6 -6
  8. package/dist/{command-ComOeFLY.mjs → command-nOI80Mnm.mjs} +6 -6
  9. package/dist/{index-CzvgPwr1.mjs → index-DnsqY6I_.mjs} +189 -60
  10. package/dist/{index-Cuvfa15L.cjs → index-J7QKJ8lc.cjs} +194 -61
  11. package/dist/index.cjs +8 -8
  12. package/dist/index.mjs +8 -8
  13. package/dist/lib.cjs +2 -3
  14. package/dist/lib.d.cts +2 -0
  15. package/dist/lib.d.mts +2 -0
  16. package/dist/lib.mjs +2 -3
  17. package/dist/{persistence-BxP6Jw1f.mjs → persistence-BMa6cyw9.mjs} +2 -3
  18. package/dist/{persistence-D7JtnrYA.cjs → persistence-xK5CKhbn.cjs} +2 -3
  19. package/dist/registerKillSessionHandler-CH6yN0eG.cjs +1198 -0
  20. package/dist/registerKillSessionHandler-Dxwg4L4J.mjs +1179 -0
  21. package/dist/{runClaude-C1W_Nw0C.cjs → runClaude-BMHlBny_.cjs} +884 -398
  22. package/dist/{runClaude-B_fTMxc4.mjs → runClaude-cQ-UT0Ke.mjs} +882 -396
  23. package/dist/{runCodex-CUgOiIEz.mjs → runCodex-AnJUPIhX.mjs} +155 -578
  24. package/dist/{runCodex-D2VCWVEK.cjs → runCodex-roOSOWWL.cjs} +158 -583
  25. package/dist/{runGemini-2_FEtJYa.mjs → runGemini-BGo_0mzA.mjs} +142 -387
  26. package/dist/{runGemini-CiGnjflq.cjs → runGemini-Cg6Zbqlz.cjs} +145 -390
  27. package/package.json +9 -8
  28. package/scripts/e2e/fake-codex-acp-agent.mjs +139 -0
  29. package/scripts/e2e/local-server-session-roundtrip.mjs +1063 -0
  30. package/scripts/release-smoke.mjs +23 -6
  31. package/dist/names-CicSgRNg.mjs +0 -625
  32. package/dist/names-yJNZoTv_.cjs +0 -636
  33. package/dist/registerKillSessionHandler-ARQrPvnT.mjs +0 -454
  34. package/dist/registerKillSessionHandler-DCMFiXyA.cjs +0 -459
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var api = require('./api-DUE5TJBE.cjs');
5
- var persistence = require('./persistence-D7JtnrYA.cjs');
4
+ var api = require('./api-Ye-rPX6s.cjs');
5
+ var persistence = require('./persistence-xK5CKhbn.cjs');
6
6
  var z = require('zod');
7
7
  var fs$2 = require('fs/promises');
8
8
  var os$1 = require('os');
@@ -33,6 +33,7 @@ var node_readline = require('node:readline');
33
33
  var http = require('http');
34
34
  var util = require('util');
35
35
  var sdk = require('@agentclientprotocol/sdk');
36
+ require('node:events');
36
37
 
37
38
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
38
39
  function _interopNamespaceDefault(e) {
@@ -70,7 +71,7 @@ async function openBrowser(url) {
70
71
  }
71
72
  }
72
73
 
73
- 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-Cuvfa15L.cjs', document.baseURI).href)));
74
+ 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-J7QKJ8lc.cjs', document.baseURI).href)));
74
75
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
75
76
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
76
77
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -693,7 +694,7 @@ function setupCleanupHandlers() {
693
694
  });
694
695
  }
695
696
 
696
- const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Cuvfa15L.cjs', document.baseURI).href))));
697
+ const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-J7QKJ8lc.cjs', document.baseURI).href))));
697
698
  function projectPath() {
698
699
  const path = path$1.resolve(__dirname$1, "..");
699
700
  return path;
@@ -2666,6 +2667,14 @@ async function recoverTrackedSessionsFromLocalRegistry({
2666
2667
  return { recoveredCount, removedStaleCount };
2667
2668
  }
2668
2669
 
2670
+ const DEFAULT_SESSION_WEBHOOK_TIMEOUT_MS = 45e3;
2671
+ function resolveSessionWebhookTimeoutMs() {
2672
+ const parsed = Number.parseInt(process.env.HAPPY_DAEMON_SESSION_WEBHOOK_TIMEOUT || "", 10);
2673
+ if (Number.isFinite(parsed) && parsed > 0) {
2674
+ return parsed;
2675
+ }
2676
+ return DEFAULT_SESSION_WEBHOOK_TIMEOUT_MS;
2677
+ }
2669
2678
  const initialMachineMetadata = {
2670
2679
  host: os$1.hostname(),
2671
2680
  platform: os$1.platform(),
@@ -2695,6 +2704,7 @@ async function getProfileEnvironmentVariablesForAgent(profileId, agentType) {
2695
2704
  }
2696
2705
  }
2697
2706
  async function startDaemon() {
2707
+ const sessionWebhookTimeoutMs = resolveSessionWebhookTimeoutMs();
2698
2708
  const shutdownCoordinator = createShutdownCoordinator(async () => {
2699
2709
  api.logger.debug("[DAEMON RUN] Startup malfunctioned, forcing exit with code 1");
2700
2710
  await new Promise((resolve) => setTimeout(resolve, 100));
@@ -2937,7 +2947,7 @@ async function startDaemon() {
2937
2947
  type: spawnError.type,
2938
2948
  errorMessage: spawnError.errorMessage
2939
2949
  });
2940
- }, 15e3);
2950
+ }, sessionWebhookTimeoutMs);
2941
2951
  pidToAwaiter.set(tmuxResult.pid, (result) => {
2942
2952
  clearTimeout(timeout);
2943
2953
  resolve(result);
@@ -3024,7 +3034,7 @@ async function startDaemon() {
3024
3034
  type: spawnError.type,
3025
3035
  errorMessage: spawnError.errorMessage
3026
3036
  });
3027
- }, 15e3);
3037
+ }, sessionWebhookTimeoutMs);
3028
3038
  pidToAwaiter.set(happyProcess.pid, (result) => {
3029
3039
  clearTimeout(timeout);
3030
3040
  resolve(result);
@@ -3099,17 +3109,19 @@ async function startDaemon() {
3099
3109
  onHappySessionWebhook,
3100
3110
  port: api.HAPPY_CLOUD_DAEMON_PORT
3101
3111
  });
3102
- const recoveryResult = await recoverTrackedSessionsFromLocalRegistry({
3103
- trackedSessionPids: pidToTrackedSession.keys(),
3104
- trackSession: (pid, trackedSession) => {
3105
- pidToTrackedSession.set(pid, trackedSession);
3112
+ const runSessionRegistryRecovery = async (label) => {
3113
+ const recoveryResult = await recoverTrackedSessionsFromLocalRegistry({
3114
+ trackedSessionPids: pidToTrackedSession.keys(),
3115
+ trackSession: (pid, trackedSession) => {
3116
+ pidToTrackedSession.set(pid, trackedSession);
3117
+ }
3118
+ });
3119
+ if (recoveryResult.recoveredCount > 0 || recoveryResult.removedStaleCount > 0) {
3120
+ api.logger.debug(
3121
+ `[DAEMON RUN] Session registry recovery ${label} completed: recovered=${recoveryResult.recoveredCount}, removedStale=${recoveryResult.removedStaleCount}`
3122
+ );
3106
3123
  }
3107
- });
3108
- if (recoveryResult.recoveredCount > 0 || recoveryResult.removedStaleCount > 0) {
3109
- api.logger.debug(
3110
- `[DAEMON RUN] Session registry recovery completed: recovered=${recoveryResult.recoveredCount}, removedStale=${recoveryResult.removedStaleCount}`
3111
- );
3112
- }
3124
+ };
3113
3125
  const fileState = {
3114
3126
  pid: process.pid,
3115
3127
  httpPort: controlPort,
@@ -3139,6 +3151,9 @@ async function startDaemon() {
3139
3151
  requestShutdown: () => requestShutdown("happy-app")
3140
3152
  });
3141
3153
  apiMachine.connect();
3154
+ void runSessionRegistryRecovery("startup").catch((error) => {
3155
+ api.logger.debug("[DAEMON RUN] Session registry startup recovery failed", error);
3156
+ });
3142
3157
  const heartbeatIntervalMs = parseInt(process.env.HAPPY_DAEMON_HEARTBEAT_INTERVAL || "60000");
3143
3158
  let heartbeatRunning = false;
3144
3159
  const restartOnStaleVersionAndHeartbeat = setInterval(async () => {
@@ -3150,17 +3165,7 @@ async function startDaemon() {
3150
3165
  api.logger.debug(`[DAEMON RUN] Health check started at ${(/* @__PURE__ */ new Date()).toLocaleString()}`);
3151
3166
  }
3152
3167
  try {
3153
- const recoveryResult2 = await recoverTrackedSessionsFromLocalRegistry({
3154
- trackedSessionPids: pidToTrackedSession.keys(),
3155
- trackSession: (pid, trackedSession) => {
3156
- pidToTrackedSession.set(pid, trackedSession);
3157
- }
3158
- });
3159
- if (recoveryResult2.recoveredCount > 0 || recoveryResult2.removedStaleCount > 0) {
3160
- api.logger.debug(
3161
- `[DAEMON RUN] Session registry recovery tick completed: recovered=${recoveryResult2.recoveredCount}, removedStale=${recoveryResult2.removedStaleCount}`
3162
- );
3163
- }
3168
+ await runSessionRegistryRecovery("tick");
3164
3169
  await runDaemonHealthCheck({
3165
3170
  trackedSessionPids: pidToTrackedSession.keys(),
3166
3171
  removeTrackedSession: (pid) => {
@@ -7339,12 +7344,57 @@ function registerCodexAgent() {
7339
7344
  agentRegistry.register("codex", (opts) => createCodexBackend(opts).backend);
7340
7345
  }
7341
7346
 
7347
+ function mapToClaudeMode(mode) {
7348
+ const codexToClaudeMap = {
7349
+ "yolo": "bypassPermissions",
7350
+ "safe-yolo": "default",
7351
+ "read-only": "default"
7352
+ };
7353
+ return codexToClaudeMap[mode] ?? mode;
7354
+ }
7355
+
7356
+ function ensureExperimentalAcp(args) {
7357
+ if (args.includes("--experimental-acp")) {
7358
+ return args;
7359
+ }
7360
+ return ["--experimental-acp", ...args];
7361
+ }
7342
7362
  function defaultClaudeArgs() {
7343
- return ["--experimental-acp"];
7363
+ return ensureExperimentalAcp([]);
7364
+ }
7365
+ function appendStringFlag(args, flag, value) {
7366
+ if (value && value.trim().length > 0) {
7367
+ args.push(flag, value);
7368
+ }
7369
+ }
7370
+ function appendListFlag(args, flag, values) {
7371
+ if (values && values.length > 0) {
7372
+ args.push(flag, values.join(","));
7373
+ }
7374
+ }
7375
+ function resolveClaudeAcpArgs(options) {
7376
+ if (options.args) {
7377
+ return ensureExperimentalAcp([...options.args]);
7378
+ }
7379
+ const args = ensureExperimentalAcp([...options.baseArgs ?? []]);
7380
+ appendStringFlag(args, "--system-prompt", options.customSystemPrompt);
7381
+ appendStringFlag(args, "--append-system-prompt", options.appendSystemPrompt);
7382
+ appendStringFlag(args, "--model", options.model);
7383
+ appendStringFlag(args, "--fallback-model", options.fallbackModel);
7384
+ appendListFlag(args, "--allowedTools", options.allowedTools);
7385
+ appendListFlag(args, "--disallowedTools", options.disallowedTools);
7386
+ appendStringFlag(args, "--settings", options.settingsPath);
7387
+ if (options.permissionMode) {
7388
+ args.push("--permission-mode", mapToClaudeMode(options.permissionMode));
7389
+ }
7390
+ return args;
7344
7391
  }
7345
7392
  function createClaudeBackend(options) {
7346
7393
  const command = options.command ?? process.env.HAPPY_CLAUDE_ACP_COMMAND ?? "claude";
7347
- const args = options.args ?? defaultClaudeArgs();
7394
+ const args = resolveClaudeAcpArgs({
7395
+ ...options,
7396
+ baseArgs: options.baseArgs ?? defaultClaudeArgs()
7397
+ });
7348
7398
  const backendOptions = {
7349
7399
  agentName: "claude",
7350
7400
  cwd: options.cwd,
@@ -7356,6 +7406,7 @@ function createClaudeBackend(options) {
7356
7406
  },
7357
7407
  mcpServers: options.mcpServers,
7358
7408
  permissionHandler: options.permissionHandler,
7409
+ selectionHandler: options.selectionHandler,
7359
7410
  transportHandler: claudeTransport
7360
7411
  };
7361
7412
  return {
@@ -7406,8 +7457,15 @@ function initializeAgents() {
7406
7457
 
7407
7458
  class InMemoryRuntimeEventBuffer {
7408
7459
  events = [];
7460
+ maxEvents;
7461
+ constructor(maxEvents = 64) {
7462
+ this.maxEvents = Math.max(1, maxEvents);
7463
+ }
7409
7464
  push(event) {
7410
7465
  this.events.push(event);
7466
+ while (this.events.length > this.maxEvents) {
7467
+ this.events.shift();
7468
+ }
7411
7469
  }
7412
7470
  drain() {
7413
7471
  return this.events.splice(0, this.events.length);
@@ -7422,17 +7480,20 @@ class RuntimeShell {
7422
7480
  return this.registry.has(provider);
7423
7481
  }
7424
7482
  async launch(opts) {
7425
- if (!this.registry.has(opts.provider)) {
7483
+ if (!opts.createBackend && !this.registry.has(opts.provider)) {
7426
7484
  throw new Error(`Runtime provider "${opts.provider}" is not registered`);
7427
7485
  }
7428
- const backend = this.registry.create(opts.provider, {
7486
+ const backendFactory = opts.createBackend ?? ((factoryOpts) => this.registry.create(opts.provider, factoryOpts));
7487
+ const backend = backendFactory({
7429
7488
  cwd: opts.cwd,
7430
7489
  env: opts.env
7431
7490
  });
7432
7491
  const handlers = /* @__PURE__ */ new Set();
7433
7492
  const eventBuffer = new InMemoryRuntimeEventBuffer();
7434
7493
  const fanout = (message) => {
7435
- eventBuffer.push(message);
7494
+ if (handlers.size === 0) {
7495
+ eventBuffer.push(message);
7496
+ }
7436
7497
  for (const handler of handlers) {
7437
7498
  handler(message);
7438
7499
  }
@@ -7474,6 +7535,69 @@ function createDefaultRuntimeShell() {
7474
7535
  return new RuntimeShell();
7475
7536
  }
7476
7537
 
7538
+ const KNOWN_CANONICAL_TOOL_NAMES_V2 = [
7539
+ "Bash",
7540
+ "Read",
7541
+ "Write",
7542
+ "Edit",
7543
+ "MultiEdit",
7544
+ "Delete",
7545
+ "Patch",
7546
+ "Diff",
7547
+ "Glob",
7548
+ "Grep",
7549
+ "LS",
7550
+ "CodeSearch",
7551
+ "WebFetch",
7552
+ "WebSearch",
7553
+ "TodoWrite",
7554
+ "TodoRead",
7555
+ "Task",
7556
+ "Reasoning",
7557
+ "EnterPlanMode",
7558
+ "ExitPlanMode",
7559
+ "AskUserQuestion",
7560
+ "AcpHistoryImport",
7561
+ "WorkspaceIndexingPermission",
7562
+ "SubAgentRun",
7563
+ "AgentTeamCreate",
7564
+ "AgentTeamDelete",
7565
+ "AgentTeamSendMessage"
7566
+ ];
7567
+ const CANONICAL_TOOL_NAME_LOOKUP = new Map(
7568
+ KNOWN_CANONICAL_TOOL_NAMES_V2.map((name) => [name.toLowerCase(), name])
7569
+ );
7570
+ const RAW_TO_CANONICAL_TOOL_NAME_LOOKUP = {
7571
+ bash: "Bash",
7572
+ shell: "Bash",
7573
+ execute: "Bash",
7574
+ claudebash: "Bash",
7575
+ codexbash: "Bash",
7576
+ geminibash: "Bash",
7577
+ claudepatch: "Patch",
7578
+ codexpatch: "Patch",
7579
+ geminipatch: "Patch"
7580
+ };
7581
+ function resolveCanonicalToolNameV2(rawToolName) {
7582
+ const normalized = typeof rawToolName === "string" ? rawToolName.trim() : "";
7583
+ if (!normalized) {
7584
+ return "Bash";
7585
+ }
7586
+ if (normalized.startsWith("mcp__")) {
7587
+ return normalized;
7588
+ }
7589
+ const lower = normalized.toLowerCase();
7590
+ const known = CANONICAL_TOOL_NAME_LOOKUP.get(lower);
7591
+ if (known) {
7592
+ return known;
7593
+ }
7594
+ const mapped = RAW_TO_CANONICAL_TOOL_NAME_LOOKUP[lower];
7595
+ if (mapped) {
7596
+ return mapped;
7597
+ }
7598
+ return normalized;
7599
+ }
7600
+
7477
7601
  const DAEMON_STARTUP_TIMEOUT_MS = 3e4;
7478
7602
  const DAEMON_STARTUP_POLL_INTERVAL_MS = 250;
7479
7603
  async function waitForDaemonReady(timeoutMs = DAEMON_STARTUP_TIMEOUT_MS, pollIntervalMs = DAEMON_STARTUP_POLL_INTERVAL_MS) {
@@ -7515,6 +7639,34 @@ var launch = /*#__PURE__*/Object.freeze({
7515
7639
  launchRuntimeProvider: launchRuntimeProvider
7516
7640
  });
7517
7641
 
7642
+ const unifiedProviderExecutors = {
7643
+ claude: async (opts) => {
7644
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-BMHlBny_.cjs'); });
7645
+ await runClaude(opts.credentials, opts.claudeOptions ?? {});
7646
+ },
7647
+ codex: async (opts) => {
7648
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-roOSOWWL.cjs'); });
7649
+ await runCodex({
7650
+ credentials: opts.credentials,
7651
+ startedBy: opts.startedBy,
7652
+ startingMode: opts.startingMode ?? (opts.startedBy === "daemon" ? "remote" : "local"),
7653
+ codexArgs: opts.codexArgs ?? []
7654
+ });
7655
+ },
7656
+ gemini: async (opts) => {
7657
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Cg6Zbqlz.cjs'); });
7658
+ await runGemini({
7659
+ credentials: opts.credentials,
7660
+ startedBy: opts.startedBy
7661
+ });
7662
+ },
7663
+ cursor: async (opts) => {
7664
+ await launchRuntimeProvider({
7665
+ provider: "cursor",
7666
+ initialPrompt: opts.initialPrompt
7667
+ });
7668
+ }
7669
+ };
7518
7670
  async function ensureUnifiedRuntimePrerequisites(credentials) {
7519
7671
  if (credentials) {
7520
7672
  await ensureUnifiedDaemonStarted();
@@ -7543,32 +7695,9 @@ async function ensureUnifiedDaemonStarted() {
7543
7695
  }
7544
7696
  async function executeUnifiedProvider(opts) {
7545
7697
  const credentials = await ensureUnifiedRuntimePrerequisites(opts.credentials);
7546
- if (opts.provider === "claude") {
7547
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-C1W_Nw0C.cjs'); });
7548
- await runClaude(credentials, opts.claudeOptions ?? {});
7549
- return;
7550
- }
7551
- if (opts.provider === "codex") {
7552
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-D2VCWVEK.cjs'); });
7553
- await runCodex({
7554
- credentials,
7555
- startedBy: opts.startedBy,
7556
- startingMode: opts.startingMode ?? (opts.startedBy === "daemon" ? "remote" : "local"),
7557
- codexArgs: opts.codexArgs ?? []
7558
- });
7559
- return;
7560
- }
7561
- if (opts.provider === "gemini") {
7562
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CiGnjflq.cjs'); });
7563
- await runGemini({
7564
- credentials,
7565
- startedBy: opts.startedBy
7566
- });
7567
- return;
7568
- }
7569
- await launchRuntimeProvider({
7570
- provider: "cursor",
7571
- initialPrompt: opts.initialPrompt
7698
+ await unifiedProviderExecutors[opts.provider]({
7699
+ ...opts,
7700
+ credentials
7572
7701
  });
7573
7702
  }
7574
7703
 
@@ -7601,7 +7730,7 @@ function shouldRunMainClaudeFlow(opts) {
7601
7730
  return;
7602
7731
  } else if (subcommand === "runtime") {
7603
7732
  if (args[1] === "providers") {
7604
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Df7u5eAT.cjs'); });
7733
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-BK93nizl.cjs'); });
7605
7734
  console.log(renderRuntimeProviders());
7606
7735
  return;
7607
7736
  }
@@ -7779,8 +7908,8 @@ function shouldRunMainClaudeFlow(opts) {
7779
7908
  const projectId = args[3];
7780
7909
  try {
7781
7910
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
7782
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-D7JtnrYA.cjs'); });
7783
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DUE5TJBE.cjs'); }).then(function (n) { return n.api; });
7911
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-xK5CKhbn.cjs'); });
7912
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-Ye-rPX6s.cjs'); }).then(function (n) { return n.api; });
7784
7913
  let userEmail = void 0;
7785
7914
  try {
7786
7915
  const credentials = await readCredentials2();
@@ -8198,8 +8327,10 @@ ${chalk.bold("Examples:")}
8198
8327
 
8199
8328
  exports.ExitCodeError = ExitCodeError;
8200
8329
  exports.GEMINI_MODEL_ENV = GEMINI_MODEL_ENV;
8330
+ exports.RuntimeShell = RuntimeShell;
8201
8331
  exports.claudeCheckSession = claudeCheckSession;
8202
8332
  exports.claudeLocal = claudeLocal;
8333
+ exports.createClaudeBackend = createClaudeBackend;
8203
8334
  exports.createCodexBackend = createCodexBackend;
8204
8335
  exports.createDefaultRuntimeShell = createDefaultRuntimeShell;
8205
8336
  exports.createGeminiBackend = createGeminiBackend;
@@ -8209,9 +8340,11 @@ exports.getInitialGeminiModel = getInitialGeminiModel;
8209
8340
  exports.getProjectPath = getProjectPath;
8210
8341
  exports.initialMachineMetadata = initialMachineMetadata;
8211
8342
  exports.isBun = isBun;
8343
+ exports.mapToClaudeMode = mapToClaudeMode;
8212
8344
  exports.projectPath = projectPath;
8213
8345
  exports.publishSessionRegistration = publishSessionRegistration;
8214
8346
  exports.readGeminiLocalConfig = readGeminiLocalConfig;
8347
+ exports.resolveCanonicalToolNameV2 = resolveCanonicalToolNameV2;
8215
8348
  exports.saveGeminiModelToConfig = saveGeminiModelToConfig;
8216
8349
  exports.startCaffeinate = startCaffeinate;
8217
8350
  exports.stopCaffeinate = stopCaffeinate;
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-DUE5TJBE.cjs');
5
- require('./persistence-D7JtnrYA.cjs');
4
+ require('./api-Ye-rPX6s.cjs');
5
+ require('./persistence-xK5CKhbn.cjs');
6
6
  require('zod');
7
- require('./index-Cuvfa15L.cjs');
7
+ require('./index-J7QKJ8lc.cjs');
8
8
  require('node:child_process');
9
9
  require('node:fs');
10
10
  require('cross-spawn');
@@ -17,15 +17,14 @@ require('os');
17
17
  require('child_process');
18
18
  require('node:path');
19
19
  require('node:os');
20
- require('axios');
20
+ require('node:fs/promises');
21
+ require('fs/promises');
22
+ require('crypto');
21
23
  require('node:events');
24
+ require('axios');
22
25
  require('socket.io-client');
23
26
  require('tweetnacl');
24
- require('util');
25
- require('fs/promises');
26
- require('crypto');
27
27
  require('expo-server-sdk');
28
- require('node:fs/promises');
29
28
  require('tmp');
30
29
  require('qrcode-terminal');
31
30
  require('node:module');
@@ -37,4 +36,5 @@ require('fastify');
37
36
  require('fastify-type-provider-zod');
38
37
  require('node:readline');
39
38
  require('http');
39
+ require('util');
40
40
 
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './api-BjxmW-0W.mjs';
3
- import './persistence-BxP6Jw1f.mjs';
2
+ import './api-BcWf5v4i.mjs';
3
+ import './persistence-BMa6cyw9.mjs';
4
4
  import 'zod';
5
- import './index-CzvgPwr1.mjs';
5
+ import './index-DnsqY6I_.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:fs';
8
8
  import 'cross-spawn';
@@ -15,15 +15,14 @@ import 'os';
15
15
  import 'child_process';
16
16
  import 'node:path';
17
17
  import 'node:os';
18
- import 'axios';
18
+ import 'node:fs/promises';
19
+ import 'fs/promises';
20
+ import 'crypto';
19
21
  import 'node:events';
22
+ import 'axios';
20
23
  import 'socket.io-client';
21
24
  import 'tweetnacl';
22
- import 'util';
23
- import 'fs/promises';
24
- import 'crypto';
25
25
  import 'expo-server-sdk';
26
- import 'node:fs/promises';
27
26
  import 'tmp';
28
27
  import 'qrcode-terminal';
29
28
  import 'node:module';
@@ -35,3 +34,4 @@ import 'fastify';
35
34
  import 'fastify-type-provider-zod';
36
35
  import 'node:readline';
37
36
  import 'http';
37
+ import 'util';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-DUE5TJBE.cjs');
3
+ var api = require('./api-Ye-rPX6s.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
@@ -13,11 +13,10 @@ require('socket.io-client');
13
13
  require('zod');
14
14
  require('node:crypto');
15
15
  require('tweetnacl');
16
- require('child_process');
17
- require('util');
18
16
  require('fs/promises');
19
17
  require('crypto');
20
18
  require('path');
19
+ require('node:child_process');
21
20
  require('expo-server-sdk');
22
21
 
23
22
 
package/dist/lib.d.cts CHANGED
@@ -688,6 +688,7 @@ declare class ApiSessionClient extends EventEmitter {
688
688
  private encryptionKey;
689
689
  private encryptionVariant;
690
690
  private pendingReliableCodexMessages;
691
+ private pendingReliableCodexMessageBytes;
691
692
  private reconnectAfterServerDisconnectTimer;
692
693
  private lastSocketServerError;
693
694
  constructor(credentials: Credentials, session: Session);
@@ -751,6 +752,7 @@ declare class ApiSessionClient extends EventEmitter {
751
752
  private emitEncryptedSessionMessage;
752
753
  private flushReliableCodexMessages;
753
754
  private shouldBufferReliableCodexMessage;
755
+ private trimPendingReliableCodexMessages;
754
756
  private retryAfterServerDisconnect;
755
757
  private clearReconnectAfterServerDisconnectTimer;
756
758
  private normalizeSocketError;
package/dist/lib.d.mts CHANGED
@@ -688,6 +688,7 @@ declare class ApiSessionClient extends EventEmitter {
688
688
  private encryptionKey;
689
689
  private encryptionVariant;
690
690
  private pendingReliableCodexMessages;
691
+ private pendingReliableCodexMessageBytes;
691
692
  private reconnectAfterServerDisconnectTimer;
692
693
  private lastSocketServerError;
693
694
  constructor(credentials: Credentials, session: Session);
@@ -751,6 +752,7 @@ declare class ApiSessionClient extends EventEmitter {
751
752
  private emitEncryptedSessionMessage;
752
753
  private flushReliableCodexMessages;
753
754
  private shouldBufferReliableCodexMessage;
755
+ private trimPendingReliableCodexMessages;
754
756
  private retryAfterServerDisconnect;
755
757
  private clearReconnectAfterServerDisconnectTimer;
756
758
  private normalizeSocketError;
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-BjxmW-0W.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-BcWf5v4i.mjs';
2
2
  export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
3
3
  import 'axios';
4
4
  import 'chalk';
@@ -11,9 +11,8 @@ import 'socket.io-client';
11
11
  import 'zod';
12
12
  import 'node:crypto';
13
13
  import 'tweetnacl';
14
- import 'child_process';
15
- import 'util';
16
14
  import 'fs/promises';
17
15
  import 'crypto';
18
16
  import 'path';
17
+ import 'node:child_process';
19
18
  import 'expo-server-sdk';
@@ -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-BjxmW-0W.mjs';
4
+ import { c as configuration, l as logger, e as encodeBase64 } from './api-BcWf5v4i.mjs';
5
5
  import * as z from 'zod';
6
6
  import 'axios';
7
7
  import 'chalk';
@@ -11,11 +11,10 @@ import 'node:events';
11
11
  import 'socket.io-client';
12
12
  import 'node:crypto';
13
13
  import 'tweetnacl';
14
- import 'child_process';
15
- import 'util';
16
14
  import 'fs/promises';
17
15
  import 'crypto';
18
16
  import 'path';
17
+ import 'node:child_process';
19
18
  import 'expo-server-sdk';
20
19
 
21
20
  const AnthropicConfigSchema = z.object({
@@ -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-DUE5TJBE.cjs');
6
+ var api = require('./api-Ye-rPX6s.cjs');
7
7
  var z = require('zod');
8
8
  require('axios');
9
9
  require('chalk');
@@ -13,11 +13,10 @@ require('node:events');
13
13
  require('socket.io-client');
14
14
  require('node:crypto');
15
15
  require('tweetnacl');
16
- require('child_process');
17
- require('util');
18
16
  require('fs/promises');
19
17
  require('crypto');
20
18
  require('path');
19
+ require('node:child_process');
21
20
  require('expo-server-sdk');
22
21
 
23
22
  function _interopNamespaceDefault(e) {