happy-imou-cloud 2.1.48 → 2.1.49

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 (25) hide show
  1. package/dist/{BaseReasoningProcessor-CM3JbXUC.mjs → BaseReasoningProcessor-CAVeOdyo.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-CKtDfihV.cjs → BaseReasoningProcessor-Dn9NcoHz.cjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-BHKIBw4t.cjs → ProviderSelectionHandler-BJJc7qOR.cjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-vgZ2egD_.mjs → ProviderSelectionHandler-DIYidT13.mjs} +2 -2
  5. package/dist/{api-eaGKJjMt.cjs → api-D7nAeZi7.cjs} +1 -1
  6. package/dist/{api-CSjP-Z3Y.mjs → api-DnqaNvyV.mjs} +1 -1
  7. package/dist/{command-BzPI4N1n.mjs → command-CzfRRhVe.mjs} +2 -2
  8. package/dist/{command-DDoz1Eky.cjs → command-VcH4hbhi.cjs} +2 -2
  9. package/dist/{index-BzsBo3_Z.mjs → index-7Z93BoVn.mjs} +95 -20
  10. package/dist/{index-C8X1VlHZ.cjs → index-xa1kwZoj.cjs} +98 -23
  11. package/dist/index.cjs +2 -2
  12. package/dist/index.mjs +2 -2
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +86 -86
  15. package/dist/lib.d.mts +86 -86
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-CLCYBgZX.cjs → registerKillSessionHandler-CfCya6si.cjs} +2 -2
  18. package/dist/{registerKillSessionHandler-BHu-3hZQ.mjs → registerKillSessionHandler-DLDg2EES.mjs} +2 -2
  19. package/dist/{runClaude-BkUbXE2F.cjs → runClaude-BBGNmGj6.cjs} +4 -4
  20. package/dist/{runClaude-D3CBLW5o.mjs → runClaude-zCwRhpOw.mjs} +4 -4
  21. package/dist/{runCodex-DqzdgDwZ.mjs → runCodex-BbgLVjb9.mjs} +56 -8
  22. package/dist/{runCodex-CdgrZK7P.cjs → runCodex-jUU6U2tZ.cjs} +56 -8
  23. package/dist/{runGemini-BE05R24D.cjs → runGemini-C0NT8MHK.cjs} +4 -4
  24. package/dist/{runGemini-UZuiKe59.mjs → runGemini-DcwNsudA.mjs} +4 -4
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-BzsBo3_Z.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-CSjP-Z3Y.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-7Z93BoVn.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-DnqaNvyV.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { randomUUID } from 'node:crypto';
5
5
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-C8X1VlHZ.cjs');
4
- var persistence = require('./api-eaGKJjMt.cjs');
3
+ var index = require('./index-xa1kwZoj.cjs');
4
+ var persistence = require('./api-D7nAeZi7.cjs');
5
5
  var node_events = require('node:events');
6
6
  var node_crypto = require('node:crypto');
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./api-eaGKJjMt.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-CLCYBgZX.cjs');
3
+ var persistence = require('./api-D7nAeZi7.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-CfCya6si.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-CSjP-Z3Y.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BHu-3hZQ.mjs';
1
+ import { l as logger } from './api-DnqaNvyV.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-DLDg2EES.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -38,7 +38,7 @@ function _interopNamespaceDefault(e) {
38
38
  var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
39
39
 
40
40
  var name = "happy-imou-cloud";
41
- var version = "2.1.48";
41
+ var version = "2.1.49";
42
42
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
43
43
  var author = "long.zhu";
44
44
  var license = "MIT";
@@ -18,7 +18,7 @@ import { spawn } from 'node:child_process';
18
18
  import { Expo } from 'expo-server-sdk';
19
19
 
20
20
  var name = "happy-imou-cloud";
21
- var version = "2.1.48";
21
+ var version = "2.1.49";
22
22
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
23
23
  var author = "long.zhu";
24
24
  var license = "MIT";
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-BzsBo3_Z.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-7Z93BoVn.mjs';
2
2
  import 'chalk';
3
- import './api-CSjP-Z3Y.mjs';
3
+ import './api-DnqaNvyV.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-C8X1VlHZ.cjs');
3
+ var index = require('./index-xa1kwZoj.cjs');
4
4
  require('chalk');
5
- require('./api-eaGKJjMt.cjs');
5
+ require('./api-D7nAeZi7.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -1,5 +1,5 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
- import { l as logger, q as encodeBase64, c as configuration, t as readCredentials, u as ensureSigningCredentials, r as readSettings, v as updateSettings, w as encodeBase64Url, m as delay, x as buildClientHeaders, y as decodeBase64, z as writeCredentialsLegacy, B as writeCredentialsDataKey, C as readDaemonState, D as HAPPY_CLOUD_DAEMON_PORT, E as clearDaemonState, F as packageJson, i as isAuthenticationRequiredError, G as buildSessionRuntimeIndex, I as acquireDaemonLock, J as writeDaemonState, A as ApiClient, K as releaseDaemonLock, L as validateProfileForAgent, M as getProfileEnvironmentVariables, N as clearCredentials, O as clearMachineId, P as readHappyOrgDispatchTruthSnapshot, Q as processHappyOrgRepoRequests, R as readHappyOrgRepoTaskBoard, S as HappyOrgTurnReportSchema, T as recordHappyOrgTurnReport, U as MessageContentSchema, V as buildSocketAuth, W as encrypt, H as HeadTailPreviewBuffer, X as getLatestDaemonLog } from './api-CSjP-Z3Y.mjs';
2
+ import { l as logger, q as encodeBase64, c as configuration, t as readCredentials, u as ensureSigningCredentials, r as readSettings, v as updateSettings, w as encodeBase64Url, m as delay, x as buildClientHeaders, y as decodeBase64, z as writeCredentialsLegacy, B as writeCredentialsDataKey, C as readDaemonState, D as HAPPY_CLOUD_DAEMON_PORT, E as clearDaemonState, F as packageJson, i as isAuthenticationRequiredError, G as buildSessionRuntimeIndex, I as acquireDaemonLock, J as writeDaemonState, A as ApiClient, K as releaseDaemonLock, L as validateProfileForAgent, M as getProfileEnvironmentVariables, N as clearCredentials, O as clearMachineId, P as readHappyOrgDispatchTruthSnapshot, Q as processHappyOrgRepoRequests, R as readHappyOrgRepoTaskBoard, S as HappyOrgTurnReportSchema, T as recordHappyOrgTurnReport, U as MessageContentSchema, V as buildSocketAuth, W as encrypt, H as HeadTailPreviewBuffer, X as getLatestDaemonLog } from './api-DnqaNvyV.mjs';
3
3
  import { z } from 'zod';
4
4
  import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
5
5
  import os$1, { homedir as homedir$1 } from 'os';
@@ -2338,19 +2338,23 @@ function buildDaemonSpawnArgs(agent, optionsOrResume) {
2338
2338
  const options = isLegacyResumeOptions(optionsOrResume) ? { resume: optionsOrResume } : optionsOrResume ?? {};
2339
2339
  const startingMode = options.startingMode ?? "remote";
2340
2340
  const startedBy = options.startedBy ?? "daemon";
2341
+ const resolvedAgent = resolveDaemonSpawnAgent(agent);
2341
2342
  const args = [
2342
- resolveDaemonSpawnAgent(agent),
2343
+ resolvedAgent,
2343
2344
  "--happy-starting-mode",
2344
2345
  startingMode,
2345
2346
  "--started-by",
2346
2347
  startedBy
2347
2348
  ];
2348
2349
  const providerSessionId = typeof options.resume?.providerSessionId === "string" ? options.resume.providerSessionId.trim() : "";
2349
- if (providerSessionId.length > 0) {
2350
+ if (providerSessionId.length > 0 && supportsProviderResumeArg(resolvedAgent)) {
2350
2351
  args.push("--resume", providerSessionId);
2351
2352
  }
2352
2353
  return args;
2353
2354
  }
2355
+ function supportsProviderResumeArg(agent) {
2356
+ return agent === "claude" || agent === "codex";
2357
+ }
2354
2358
  function buildTerminalWindowSpawnArgs(agent, resume) {
2355
2359
  return buildDaemonSpawnArgs(agent, {
2356
2360
  resume,
@@ -9061,6 +9065,69 @@ class AcpBackend {
9061
9065
  }
9062
9066
  return resolvePostPromptNoUpdatesTimeoutMs(this.transport);
9063
9067
  }
9068
+ getResponseWaitTimeoutMs(timeoutMs) {
9069
+ if (typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0) {
9070
+ return Math.trunc(timeoutMs);
9071
+ }
9072
+ return readPositiveIntegerEnv("HAPPY_ACP_RESPONSE_WAIT_TIMEOUT_MS") ?? readPositiveIntegerEnv("HAPPIER_ACP_RESPONSE_WAIT_TIMEOUT_MS") ?? resolveAcpResponseWaitTimeoutMs(this.sessionPreferences.timeoutProfile);
9073
+ }
9074
+ createPromptCompletionWatchdog(timeoutMs) {
9075
+ let timeoutHandle = null;
9076
+ let cancelled = false;
9077
+ const promise = new Promise((resolve, reject) => {
9078
+ const schedule = () => {
9079
+ if (cancelled) {
9080
+ return;
9081
+ }
9082
+ if (this.responseCompletionError) {
9083
+ reject(this.responseCompletionError);
9084
+ return;
9085
+ }
9086
+ if (!this.waitingForResponse) {
9087
+ resolve();
9088
+ return;
9089
+ }
9090
+ const lastProgressAt = this.responseLastProgressAt ?? Date.now();
9091
+ const elapsedMs = Math.max(0, Date.now() - lastProgressAt);
9092
+ const remainingMs = Math.max(1, timeoutMs - elapsedMs);
9093
+ timeoutHandle = setTimeout(() => {
9094
+ timeoutHandle = null;
9095
+ if (cancelled) {
9096
+ return;
9097
+ }
9098
+ if (this.responseCompletionError) {
9099
+ reject(this.responseCompletionError);
9100
+ return;
9101
+ }
9102
+ if (!this.waitingForResponse) {
9103
+ resolve();
9104
+ return;
9105
+ }
9106
+ const latestProgressAt = this.responseLastProgressAt ?? Date.now();
9107
+ const latestElapsedMs = Math.max(0, Date.now() - latestProgressAt);
9108
+ if (latestElapsedMs < timeoutMs) {
9109
+ schedule();
9110
+ return;
9111
+ }
9112
+ const timeoutLabel = formatToolCallTimeoutLimit(timeoutMs);
9113
+ const error = new Error(`Timeout waiting for Codex ACP prompt to complete after ${timeoutLabel} without response progress`);
9114
+ this.failPendingResponseWait(error);
9115
+ reject(error);
9116
+ }, remainingMs);
9117
+ };
9118
+ schedule();
9119
+ });
9120
+ return {
9121
+ promise,
9122
+ cancel: () => {
9123
+ cancelled = true;
9124
+ if (timeoutHandle) {
9125
+ clearTimeout(timeoutHandle);
9126
+ timeoutHandle = null;
9127
+ }
9128
+ }
9129
+ };
9130
+ }
9064
9131
  clearIdleTimeoutState() {
9065
9132
  if (this.idleTimeout) {
9066
9133
  clearTimeout(this.idleTimeout);
@@ -9912,15 +9979,23 @@ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
9912
9979
  prompt: [contentBlock]
9913
9980
  };
9914
9981
  logger.debug(`[AcpBackend] Prompt request:`, JSON.stringify(promptRequest, null, 2));
9915
- await raceWithProcessExit(
9916
- this.process,
9917
- () => this.connection.prompt(promptRequest),
9918
- {
9919
- agentName: this.transport.agentName,
9920
- operationName: "prompt",
9921
- getStderrExcerpt: () => this.getRecentStderrExcerpt()
9922
- }
9923
- );
9982
+ const promptWatchdog = this.createPromptCompletionWatchdog(this.getResponseWaitTimeoutMs());
9983
+ try {
9984
+ await raceWithProcessExit(
9985
+ this.process,
9986
+ () => Promise.race([
9987
+ this.connection.prompt(promptRequest),
9988
+ promptWatchdog.promise
9989
+ ]),
9990
+ {
9991
+ agentName: this.transport.agentName,
9992
+ operationName: "prompt",
9993
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
9994
+ }
9995
+ );
9996
+ } finally {
9997
+ promptWatchdog.cancel();
9998
+ }
9924
9999
  logger.debug("[AcpBackend] Prompt request sent to ACP connection");
9925
10000
  if (this.waitingForResponse && this.activeToolCalls.size === 0 && this.sawSessionUpdateSincePrompt === false) {
9926
10001
  const noUpdatesTimeoutMs = this.getPostPromptNoUpdatesTimeoutMs();
@@ -9983,7 +10058,7 @@ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
9983
10058
  if (!this.waitingForResponse) {
9984
10059
  return;
9985
10060
  }
9986
- const effectiveTimeoutMs = timeoutMs ?? resolveAcpResponseWaitTimeoutMs(this.sessionPreferences.timeoutProfile);
10061
+ const effectiveTimeoutMs = this.getResponseWaitTimeoutMs(timeoutMs);
9987
10062
  return new Promise((resolve, reject) => {
9988
10063
  this.idleResolver = () => {
9989
10064
  this.idleResolver = null;
@@ -10317,7 +10392,7 @@ function registerGeminiAgent() {
10317
10392
  logger.debug("[Gemini] Registered with agent registry");
10318
10393
  }
10319
10394
 
10320
- const DEFAULT_CODEX_ACP_NPX_PACKAGE = "@zed-industries/codex-acp@0.10.0";
10395
+ const DEFAULT_CODEX_ACP_NPX_PACKAGE = "@zed-industries/codex-acp@0.14.0";
10321
10396
  function readFirstEnv(...names) {
10322
10397
  for (const name of names) {
10323
10398
  const raw = process.env[name];
@@ -12491,14 +12566,14 @@ var launch = /*#__PURE__*/Object.freeze({
12491
12566
  const unifiedProviderExecutors = {
12492
12567
  claude: async (opts) => {
12493
12568
  const claudeOptions = opts.claudeOptions ?? {};
12494
- const { runClaude } = await import('./runClaude-D3CBLW5o.mjs');
12569
+ const { runClaude } = await import('./runClaude-zCwRhpOw.mjs');
12495
12570
  await runClaude(opts.credentials, {
12496
12571
  ...claudeOptions,
12497
12572
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
12498
12573
  });
12499
12574
  },
12500
12575
  codex: async (opts) => {
12501
- const { runCodex } = await import('./runCodex-DqzdgDwZ.mjs');
12576
+ const { runCodex } = await import('./runCodex-BbgLVjb9.mjs');
12502
12577
  await runCodex({
12503
12578
  credentials: opts.credentials,
12504
12579
  startedBy: opts.startedBy,
@@ -12507,7 +12582,7 @@ const unifiedProviderExecutors = {
12507
12582
  });
12508
12583
  },
12509
12584
  gemini: async (opts) => {
12510
- const { runGemini } = await import('./runGemini-UZuiKe59.mjs');
12585
+ const { runGemini } = await import('./runGemini-DcwNsudA.mjs');
12511
12586
  await runGemini({
12512
12587
  credentials: opts.credentials,
12513
12588
  startedBy: opts.startedBy
@@ -12590,7 +12665,7 @@ function shouldRunMainClaudeFlow(opts) {
12590
12665
  return;
12591
12666
  } else if (subcommand === "runtime") {
12592
12667
  if (args[1] === "providers") {
12593
- const { renderRuntimeProviders } = await import('./command-BzPI4N1n.mjs');
12668
+ const { renderRuntimeProviders } = await import('./command-CzfRRhVe.mjs');
12594
12669
  console.log(renderRuntimeProviders());
12595
12670
  return;
12596
12671
  }
@@ -12796,8 +12871,8 @@ function shouldRunMainClaudeFlow(opts) {
12796
12871
  const projectId = args[3];
12797
12872
  try {
12798
12873
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
12799
- const { readCredentials: readCredentials2 } = await import('./api-CSjP-Z3Y.mjs').then(function (n) { return n.Y; });
12800
- const { ApiClient: ApiClient2 } = await import('./api-CSjP-Z3Y.mjs').then(function (n) { return n.Z; });
12874
+ const { readCredentials: readCredentials2 } = await import('./api-DnqaNvyV.mjs').then(function (n) { return n.Y; });
12875
+ const { ApiClient: ApiClient2 } = await import('./api-DnqaNvyV.mjs').then(function (n) { return n.Z; });
12801
12876
  let userEmail = void 0;
12802
12877
  try {
12803
12878
  const credentials = await readCredentials2();
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var persistence = require('./api-eaGKJjMt.cjs');
4
+ var persistence = require('./api-D7nAeZi7.cjs');
5
5
  var z = require('zod');
6
6
  var fs$2 = require('fs/promises');
7
7
  var os$1 = require('os');
@@ -52,7 +52,7 @@ async function openBrowser(url) {
52
52
  }
53
53
  }
54
54
 
55
- 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-C8X1VlHZ.cjs', document.baseURI).href)));
55
+ 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-xa1kwZoj.cjs', document.baseURI).href)));
56
56
  const QRCode = require$1("qrcode-terminal/vendor/QRCode");
57
57
  const QRErrorCorrectLevel = require$1("qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel");
58
58
  const pendingTempFiles = /* @__PURE__ */ new Set();
@@ -617,7 +617,7 @@ function setupCleanupHandlers() {
617
617
  });
618
618
  }
619
619
 
620
- 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-C8X1VlHZ.cjs', document.baseURI).href))));
620
+ 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-xa1kwZoj.cjs', document.baseURI).href))));
621
621
  function projectPath() {
622
622
  const path = path$1.resolve(__dirname$2, "..");
623
623
  return path;
@@ -2341,19 +2341,23 @@ function buildDaemonSpawnArgs(agent, optionsOrResume) {
2341
2341
  const options = isLegacyResumeOptions(optionsOrResume) ? { resume: optionsOrResume } : optionsOrResume ?? {};
2342
2342
  const startingMode = options.startingMode ?? "remote";
2343
2343
  const startedBy = options.startedBy ?? "daemon";
2344
+ const resolvedAgent = resolveDaemonSpawnAgent(agent);
2344
2345
  const args = [
2345
- resolveDaemonSpawnAgent(agent),
2346
+ resolvedAgent,
2346
2347
  "--happy-starting-mode",
2347
2348
  startingMode,
2348
2349
  "--started-by",
2349
2350
  startedBy
2350
2351
  ];
2351
2352
  const providerSessionId = typeof options.resume?.providerSessionId === "string" ? options.resume.providerSessionId.trim() : "";
2352
- if (providerSessionId.length > 0) {
2353
+ if (providerSessionId.length > 0 && supportsProviderResumeArg(resolvedAgent)) {
2353
2354
  args.push("--resume", providerSessionId);
2354
2355
  }
2355
2356
  return args;
2356
2357
  }
2358
+ function supportsProviderResumeArg(agent) {
2359
+ return agent === "claude" || agent === "codex";
2360
+ }
2357
2361
  function buildTerminalWindowSpawnArgs(agent, resume) {
2358
2362
  return buildDaemonSpawnArgs(agent, {
2359
2363
  resume,
@@ -9064,6 +9068,69 @@ class AcpBackend {
9064
9068
  }
9065
9069
  return resolvePostPromptNoUpdatesTimeoutMs(this.transport);
9066
9070
  }
9071
+ getResponseWaitTimeoutMs(timeoutMs) {
9072
+ if (typeof timeoutMs === "number" && Number.isFinite(timeoutMs) && timeoutMs > 0) {
9073
+ return Math.trunc(timeoutMs);
9074
+ }
9075
+ return readPositiveIntegerEnv("HAPPY_ACP_RESPONSE_WAIT_TIMEOUT_MS") ?? readPositiveIntegerEnv("HAPPIER_ACP_RESPONSE_WAIT_TIMEOUT_MS") ?? resolveAcpResponseWaitTimeoutMs(this.sessionPreferences.timeoutProfile);
9076
+ }
9077
+ createPromptCompletionWatchdog(timeoutMs) {
9078
+ let timeoutHandle = null;
9079
+ let cancelled = false;
9080
+ const promise = new Promise((resolve, reject) => {
9081
+ const schedule = () => {
9082
+ if (cancelled) {
9083
+ return;
9084
+ }
9085
+ if (this.responseCompletionError) {
9086
+ reject(this.responseCompletionError);
9087
+ return;
9088
+ }
9089
+ if (!this.waitingForResponse) {
9090
+ resolve();
9091
+ return;
9092
+ }
9093
+ const lastProgressAt = this.responseLastProgressAt ?? Date.now();
9094
+ const elapsedMs = Math.max(0, Date.now() - lastProgressAt);
9095
+ const remainingMs = Math.max(1, timeoutMs - elapsedMs);
9096
+ timeoutHandle = setTimeout(() => {
9097
+ timeoutHandle = null;
9098
+ if (cancelled) {
9099
+ return;
9100
+ }
9101
+ if (this.responseCompletionError) {
9102
+ reject(this.responseCompletionError);
9103
+ return;
9104
+ }
9105
+ if (!this.waitingForResponse) {
9106
+ resolve();
9107
+ return;
9108
+ }
9109
+ const latestProgressAt = this.responseLastProgressAt ?? Date.now();
9110
+ const latestElapsedMs = Math.max(0, Date.now() - latestProgressAt);
9111
+ if (latestElapsedMs < timeoutMs) {
9112
+ schedule();
9113
+ return;
9114
+ }
9115
+ const timeoutLabel = formatToolCallTimeoutLimit(timeoutMs);
9116
+ const error = new Error(`Timeout waiting for Codex ACP prompt to complete after ${timeoutLabel} without response progress`);
9117
+ this.failPendingResponseWait(error);
9118
+ reject(error);
9119
+ }, remainingMs);
9120
+ };
9121
+ schedule();
9122
+ });
9123
+ return {
9124
+ promise,
9125
+ cancel: () => {
9126
+ cancelled = true;
9127
+ if (timeoutHandle) {
9128
+ clearTimeout(timeoutHandle);
9129
+ timeoutHandle = null;
9130
+ }
9131
+ }
9132
+ };
9133
+ }
9067
9134
  clearIdleTimeoutState() {
9068
9135
  if (this.idleTimeout) {
9069
9136
  clearTimeout(this.idleTimeout);
@@ -9915,15 +9982,23 @@ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
9915
9982
  prompt: [contentBlock]
9916
9983
  };
9917
9984
  persistence.logger.debug(`[AcpBackend] Prompt request:`, JSON.stringify(promptRequest, null, 2));
9918
- await raceWithProcessExit(
9919
- this.process,
9920
- () => this.connection.prompt(promptRequest),
9921
- {
9922
- agentName: this.transport.agentName,
9923
- operationName: "prompt",
9924
- getStderrExcerpt: () => this.getRecentStderrExcerpt()
9925
- }
9926
- );
9985
+ const promptWatchdog = this.createPromptCompletionWatchdog(this.getResponseWaitTimeoutMs());
9986
+ try {
9987
+ await raceWithProcessExit(
9988
+ this.process,
9989
+ () => Promise.race([
9990
+ this.connection.prompt(promptRequest),
9991
+ promptWatchdog.promise
9992
+ ]),
9993
+ {
9994
+ agentName: this.transport.agentName,
9995
+ operationName: "prompt",
9996
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
9997
+ }
9998
+ );
9999
+ } finally {
10000
+ promptWatchdog.cancel();
10001
+ }
9927
10002
  persistence.logger.debug("[AcpBackend] Prompt request sent to ACP connection");
9928
10003
  if (this.waitingForResponse && this.activeToolCalls.size === 0 && this.sawSessionUpdateSincePrompt === false) {
9929
10004
  const noUpdatesTimeoutMs = this.getPostPromptNoUpdatesTimeoutMs();
@@ -9986,7 +10061,7 @@ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
9986
10061
  if (!this.waitingForResponse) {
9987
10062
  return;
9988
10063
  }
9989
- const effectiveTimeoutMs = timeoutMs ?? resolveAcpResponseWaitTimeoutMs(this.sessionPreferences.timeoutProfile);
10064
+ const effectiveTimeoutMs = this.getResponseWaitTimeoutMs(timeoutMs);
9990
10065
  return new Promise((resolve, reject) => {
9991
10066
  this.idleResolver = () => {
9992
10067
  this.idleResolver = null;
@@ -10320,7 +10395,7 @@ function registerGeminiAgent() {
10320
10395
  persistence.logger.debug("[Gemini] Registered with agent registry");
10321
10396
  }
10322
10397
 
10323
- const DEFAULT_CODEX_ACP_NPX_PACKAGE = "@zed-industries/codex-acp@0.10.0";
10398
+ const DEFAULT_CODEX_ACP_NPX_PACKAGE = "@zed-industries/codex-acp@0.14.0";
10324
10399
  function readFirstEnv(...names) {
10325
10400
  for (const name of names) {
10326
10401
  const raw = process.env[name];
@@ -11169,7 +11244,7 @@ class AbortError extends Error {
11169
11244
  }
11170
11245
  }
11171
11246
 
11172
- 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-C8X1VlHZ.cjs', document.baseURI).href)));
11247
+ 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-xa1kwZoj.cjs', document.baseURI).href)));
11173
11248
  const __dirname$1 = path.join(__filename$1, "..");
11174
11249
  function getGlobalClaudeVersion() {
11175
11250
  try {
@@ -12494,14 +12569,14 @@ var launch = /*#__PURE__*/Object.freeze({
12494
12569
  const unifiedProviderExecutors = {
12495
12570
  claude: async (opts) => {
12496
12571
  const claudeOptions = opts.claudeOptions ?? {};
12497
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-BkUbXE2F.cjs'); });
12572
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-BBGNmGj6.cjs'); });
12498
12573
  await runClaude(opts.credentials, {
12499
12574
  ...claudeOptions,
12500
12575
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
12501
12576
  });
12502
12577
  },
12503
12578
  codex: async (opts) => {
12504
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-CdgrZK7P.cjs'); });
12579
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-jUU6U2tZ.cjs'); });
12505
12580
  await runCodex({
12506
12581
  credentials: opts.credentials,
12507
12582
  startedBy: opts.startedBy,
@@ -12510,7 +12585,7 @@ const unifiedProviderExecutors = {
12510
12585
  });
12511
12586
  },
12512
12587
  gemini: async (opts) => {
12513
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BE05R24D.cjs'); });
12588
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-C0NT8MHK.cjs'); });
12514
12589
  await runGemini({
12515
12590
  credentials: opts.credentials,
12516
12591
  startedBy: opts.startedBy
@@ -12593,7 +12668,7 @@ function shouldRunMainClaudeFlow(opts) {
12593
12668
  return;
12594
12669
  } else if (subcommand === "runtime") {
12595
12670
  if (args[1] === "providers") {
12596
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-DDoz1Eky.cjs'); });
12671
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-VcH4hbhi.cjs'); });
12597
12672
  console.log(renderRuntimeProviders());
12598
12673
  return;
12599
12674
  }
@@ -12799,8 +12874,8 @@ function shouldRunMainClaudeFlow(opts) {
12799
12874
  const projectId = args[3];
12800
12875
  try {
12801
12876
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
12802
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-eaGKJjMt.cjs'); }).then(function (n) { return n.persistence; });
12803
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-eaGKJjMt.cjs'); }).then(function (n) { return n.api; });
12877
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-D7nAeZi7.cjs'); }).then(function (n) { return n.persistence; });
12878
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-D7nAeZi7.cjs'); }).then(function (n) { return n.api; });
12804
12879
  let userEmail = void 0;
12805
12880
  try {
12806
12881
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-eaGKJjMt.cjs');
4
+ require('./api-D7nAeZi7.cjs');
5
5
  require('zod');
6
- require('./index-C8X1VlHZ.cjs');
6
+ require('./index-xa1kwZoj.cjs');
7
7
  require('node:child_process');
8
8
  require('node:fs');
9
9
  require('cross-spawn');
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import 'chalk';
2
- import './api-CSjP-Z3Y.mjs';
2
+ import './api-DnqaNvyV.mjs';
3
3
  import 'zod';
4
- import './index-BzsBo3_Z.mjs';
4
+ import './index-7Z93BoVn.mjs';
5
5
  import 'node:child_process';
6
6
  import 'node:fs';
7
7
  import 'cross-spawn';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var persistence = require('./api-eaGKJjMt.cjs');
3
+ var persistence = require('./api-D7nAeZi7.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');