happy-imou-cloud 2.1.1 → 2.1.2

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 (44) hide show
  1. package/bin/happy-cloud.mjs +21 -21
  2. package/compat/acp-sdk-schema/index.js +27 -27
  3. package/compat/acp-sdk-schema/types.gen.js +2 -2
  4. package/compat/acp-sdk-schema/zod.gen.js +1553 -1553
  5. package/compat/ink-build/components/Cursor.d.ts +83 -83
  6. package/compat/ink-build/components/Cursor.js +52 -52
  7. package/compat/ink-build/components/CursorContext.d.ts +11 -11
  8. package/compat/ink-build/components/CursorContext.js +7 -7
  9. package/compat/ink-build/components/ErrorBoundary.d.ts +18 -18
  10. package/compat/ink-build/components/ErrorBoundary.js +22 -22
  11. package/compat/ink-build/hooks/use-cursor.d.ts +12 -12
  12. package/compat/ink-build/hooks/use-cursor.js +28 -28
  13. package/dist/{BaseReasoningProcessor-Dn9FxfxU.mjs → BaseReasoningProcessor-BaOWkVcu.mjs} +3 -3
  14. package/dist/{BaseReasoningProcessor-CBMK-8Gi.cjs → BaseReasoningProcessor-CzvqwxuY.cjs} +3 -3
  15. package/dist/ProviderSelectionHandler-Q8pl7e-d.mjs +261 -0
  16. package/dist/ProviderSelectionHandler-wwbfeK_s.cjs +265 -0
  17. package/dist/{api-DBy5lPZw.mjs → api-Cxifhw5r.mjs} +3 -3
  18. package/dist/{api-DId_j3C2.cjs → api-DZimmN4C.cjs} +2 -2
  19. package/dist/{command-CeaBwYCW.mjs → command-B6LM3Nml.mjs} +3 -3
  20. package/dist/{command-DwfUpmId.cjs → command-RcCJI1jl.cjs} +3 -3
  21. package/dist/{index-CuuYSKiv.cjs → index-Cuvs0lFS.cjs} +168 -75
  22. package/dist/{index-66vjECEd.mjs → index-Des7I5WX.mjs} +165 -72
  23. package/dist/index.cjs +3 -3
  24. package/dist/index.mjs +3 -3
  25. package/dist/lib.cjs +1 -1
  26. package/dist/lib.d.cts +36 -36
  27. package/dist/lib.d.mts +36 -36
  28. package/dist/lib.mjs +1 -1
  29. package/dist/{persistence-BOWh1NER.mjs → persistence-6d4U4Sh8.mjs} +1 -1
  30. package/dist/{persistence-Dzr6sFwD.cjs → persistence-C8-MtdQK.cjs} +1 -1
  31. package/dist/{registerKillSessionHandler-D4_wpN18.mjs → registerKillSessionHandler-BFBkz_XT.mjs} +417 -5
  32. package/dist/{registerKillSessionHandler-Dg_iRBPm.cjs → registerKillSessionHandler-BapPCRmp.cjs} +419 -4
  33. package/dist/{runClaude-B74dHAnQ.mjs → runClaude-CPV5Uap2.mjs} +34 -5
  34. package/dist/{runClaude-oIFzkfuU.cjs → runClaude-DVnqKa1q.cjs} +37 -8
  35. package/dist/{runCodex-D_9CuL6M.cjs → runCodex-Bzsp8gFO.cjs} +29 -21
  36. package/dist/{runCodex-mLHjsgVj.mjs → runCodex-CwtLSTMJ.mjs} +26 -18
  37. package/dist/{runGemini-CcWGezMt.cjs → runGemini-6Dwyk_Km.cjs} +267 -82
  38. package/dist/{runGemini-BMiho2ab.mjs → runGemini-Bmoxehlh.mjs} +267 -82
  39. package/package.json +9 -9
  40. package/scripts/build.mjs +68 -68
  41. package/scripts/ensureAcpSdkCompat.mjs +170 -172
  42. package/scripts/release-smoke.mjs +38 -35
  43. package/dist/ProviderSelectionHandler-BuXk-8ji.cjs +0 -680
  44. package/dist/ProviderSelectionHandler-CMaQThYO.mjs +0 -673
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var api = require('./api-DId_j3C2.cjs');
5
- var persistence = require('./persistence-Dzr6sFwD.cjs');
4
+ var api = require('./api-DZimmN4C.cjs');
5
+ var persistence = require('./persistence-C8-MtdQK.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-CuuYSKiv.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-Cuvs0lFS.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-CuuYSKiv.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-Cuvs0lFS.cjs', document.baseURI).href))));
699
699
  function projectPath() {
700
700
  const path = path$1.resolve(__dirname$2, "..");
701
701
  return path;
@@ -4867,10 +4867,10 @@ function truncateDisplayMessage(value, maxLength) {
4867
4867
  const DEFAULT_TIMEOUTS = {
4868
4868
  /** Default initialization timeout: 60 seconds */
4869
4869
  init: 6e4,
4870
- /** Default tool call timeout: 2 minutes */
4871
- toolCall: 12e4,
4872
- /** Think tool timeout: 30 seconds */
4873
- think: 3e4
4870
+ /** Default tool call timeout: 10 minutes */
4871
+ toolCall: 10 * 6e4,
4872
+ /** Think tool timeout: 2 minutes */
4873
+ think: 2 * 6e4
4874
4874
  };
4875
4875
  class DefaultTransport {
4876
4876
  agentName;
@@ -4947,7 +4947,7 @@ class DefaultTransport {
4947
4947
  return toolName;
4948
4948
  }
4949
4949
  getPostPromptNoUpdatesTimeoutMs() {
4950
- return 3e4;
4950
+ return 2 * 6e4;
4951
4951
  }
4952
4952
  }
4953
4953
 
@@ -4957,11 +4957,11 @@ const GEMINI_TIMEOUTS = {
4957
4957
  /** Gemini ACP can swallow an initialize request sent too early after spawn */
4958
4958
  initDelay: 2500,
4959
4959
  /** Standard tool call timeout */
4960
- toolCall: 12e4,
4960
+ toolCall: 10 * 6e4,
4961
4961
  /** Investigation tools (codebase_investigator) can run for a long time */
4962
- investigation: 6e5,
4962
+ investigation: 30 * 6e4,
4963
4963
  /** Think tools are usually quick */
4964
- think: 3e4,
4964
+ think: 2 * 6e4,
4965
4965
  /** Idle detection after last message chunk */
4966
4966
  idle: 500
4967
4967
  };
@@ -5158,6 +5158,21 @@ class GeminiTransport {
5158
5158
  }
5159
5159
  const geminiTransport = new GeminiTransport();
5160
5160
 
5161
+ const DEFAULT_CODEX_EXECUTE_TIMEOUT_MS = 30 * 6e4;
5162
+ function readPositiveIntegerEnv$1(name) {
5163
+ const raw = typeof process.env[name] === "string" ? process.env[name].trim() : "";
5164
+ if (!raw) {
5165
+ return null;
5166
+ }
5167
+ const value = Number(raw);
5168
+ if (!Number.isFinite(value) || !Number.isInteger(value) || value <= 0) {
5169
+ return null;
5170
+ }
5171
+ return value;
5172
+ }
5173
+ function resolveCodexExecuteTimeoutMs() {
5174
+ return readPositiveIntegerEnv$1("HAPPY_CODEX_EXECUTE_TIMEOUT_MS") ?? readPositiveIntegerEnv$1("HAPPIER_CODEX_EXECUTE_TIMEOUT_MS") ?? DEFAULT_CODEX_EXECUTE_TIMEOUT_MS;
5175
+ }
5161
5176
  class CodexTransport extends DefaultTransport {
5162
5177
  constructor() {
5163
5178
  super("codex");
@@ -5168,6 +5183,12 @@ class CodexTransport extends DefaultTransport {
5168
5183
  getIdleTimeout() {
5169
5184
  return 800;
5170
5185
  }
5186
+ getToolCallTimeout(toolCallId, toolKind) {
5187
+ if (toolKind === "execute") {
5188
+ return resolveCodexExecuteTimeoutMs();
5189
+ }
5190
+ return super.getToolCallTimeout(toolCallId, toolKind);
5191
+ }
5171
5192
  }
5172
5193
  new CodexTransport();
5173
5194
 
@@ -5198,7 +5219,7 @@ class CursorTransport extends DefaultTransport {
5198
5219
  const cursorTransport = new CursorTransport();
5199
5220
 
5200
5221
  const DEFAULT_IDLE_TIMEOUT_MS = 500;
5201
- const DEFAULT_TOOL_CALL_TIMEOUT_MS = 12e4;
5222
+ const DEFAULT_TOOL_CALL_TIMEOUT_MS = 10 * 6e4;
5202
5223
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES = 2e3;
5203
5224
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES = 4e3;
5204
5225
  function parseArgsFromContent(content) {
@@ -5458,41 +5479,14 @@ function startToolCall(toolCallId, toolKind, update, ctx, source) {
5458
5479
  }
5459
5480
  const timeoutMs = ctx.transport.getToolCallTimeout?.(toolCallId, toolKindStr) ?? DEFAULT_TOOL_CALL_TIMEOUT_MS;
5460
5481
  if (!ctx.toolCallTimeouts.has(toolCallId)) {
5461
- const timeout = setTimeout(() => {
5462
- const duration = formatDuration(ctx.toolCallStartTimes.get(toolCallId));
5463
- const timeoutLabel = formatToolCallTimeoutLimit(timeoutMs);
5464
- const timeoutDetail = `Tool call ${realToolName} timed out after ${timeoutLabel}`;
5465
- api.logger.debug(`[AcpBackend] \u23F1\uFE0F Tool call TIMEOUT (from ${source}): ${toolCallId} (${toolKind}) after ${timeoutLabel} - Duration: ${duration}, failing current turn`);
5466
- ctx.activeToolCalls.delete(toolCallId);
5467
- ctx.toolCallStartTimes.delete(toolCallId);
5468
- ctx.toolCallTimeouts.delete(toolCallId);
5469
- ctx.clearIdleTimeout();
5470
- const streamedOutput = renderToolOutput(ctx.toolCallOutputs.get(toolCallId));
5471
- ctx.toolCallOutputs.delete(toolCallId);
5472
- ctx.emit({
5473
- type: "tool-result",
5474
- toolName: realToolName,
5475
- result: streamedOutput ? {
5476
- stdout: streamedOutput,
5477
- error: timeoutDetail,
5478
- status: "failed",
5479
- timedOut: true
5480
- } : {
5481
- error: timeoutDetail,
5482
- status: "failed",
5483
- timedOut: true
5484
- },
5485
- callId: toolCallId
5486
- });
5487
- ctx.emit({
5488
- type: "status",
5489
- status: "error",
5490
- detail: timeoutDetail
5491
- });
5492
- ctx.failPendingResponseWait(new Error(timeoutDetail));
5493
- }, timeoutMs);
5494
- ctx.toolCallTimeouts.set(toolCallId, timeout);
5495
- api.logger.debug(`[AcpBackend] \u23F1\uFE0F Set timeout for ${toolCallId}: ${(timeoutMs / 1e3).toFixed(0)}s${isInvestigation ? " (investigation tool)" : ""}`);
5482
+ ctx.armToolCallTimeout({
5483
+ toolCallId,
5484
+ toolKind,
5485
+ toolName: realToolName,
5486
+ timeoutMs,
5487
+ source
5488
+ });
5489
+ api.logger.debug(`[AcpBackend] \u23F1\uFE0F Set no-progress timeout for ${toolCallId}: ${(timeoutMs / 1e3).toFixed(0)}s${isInvestigation ? " (investigation tool)" : ""}`);
5496
5490
  } else {
5497
5491
  api.logger.debug(`[AcpBackend] Timeout already set for ${toolCallId}, skipping`);
5498
5492
  }
@@ -5518,11 +5512,7 @@ function completeToolCall(toolCallId, toolKind, content, ctx) {
5518
5512
  const toolKindStr = typeof toolKind === "string" ? toolKind : "unknown";
5519
5513
  ctx.activeToolCalls.delete(toolCallId);
5520
5514
  ctx.toolCallStartTimes.delete(toolCallId);
5521
- const timeout = ctx.toolCallTimeouts.get(toolCallId);
5522
- if (timeout) {
5523
- clearTimeout(timeout);
5524
- ctx.toolCallTimeouts.delete(toolCallId);
5525
- }
5515
+ ctx.clearToolCallTimeout(toolCallId);
5526
5516
  const streamedOutput = renderToolOutput(ctx.toolCallOutputs.get(toolCallId));
5527
5517
  ctx.toolCallOutputs.delete(toolCallId);
5528
5518
  api.logger.debug(`[AcpBackend] \u2705 Tool call COMPLETED: ${toolCallId} (${toolKindStr}) - Duration: ${duration}. Active tool calls: ${ctx.activeToolCalls.size}`);
@@ -5561,10 +5551,8 @@ function failToolCall(toolCallId, status, toolKind, content, ctx) {
5561
5551
  }
5562
5552
  ctx.activeToolCalls.delete(toolCallId);
5563
5553
  ctx.toolCallStartTimes.delete(toolCallId);
5564
- const timeout = ctx.toolCallTimeouts.get(toolCallId);
5565
- if (timeout) {
5566
- clearTimeout(timeout);
5567
- ctx.toolCallTimeouts.delete(toolCallId);
5554
+ const clearedTimeout = ctx.clearToolCallTimeout(toolCallId);
5555
+ if (clearedTimeout) {
5568
5556
  api.logger.debug(`[AcpBackend] Cleared timeout for ${toolCallId} (tool call ${status})`);
5569
5557
  } else {
5570
5558
  api.logger.debug(`[AcpBackend] No timeout found for ${toolCallId} (tool call ${status}) - timeout may not have been set`);
@@ -5887,7 +5875,7 @@ const RETRY_CONFIG = {
5887
5875
  /** Maximum delay between retries in ms */
5888
5876
  maxDelayMs: 5e3
5889
5877
  };
5890
- const DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS = 3e4;
5878
+ const DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS = 2 * 6e4;
5891
5879
  function readPositiveIntegerEnv(name) {
5892
5880
  const raw = typeof process.env[name] === "string" ? process.env[name].trim() : "";
5893
5881
  if (!raw) {
@@ -6196,6 +6184,7 @@ class AcpBackend {
6196
6184
  /** Track active tool calls to prevent duplicate events */
6197
6185
  activeToolCalls = /* @__PURE__ */ new Set();
6198
6186
  toolCallTimeouts = /* @__PURE__ */ new Map();
6187
+ toolCallTimeoutSpecs = /* @__PURE__ */ new Map();
6199
6188
  /** Track tool call start times for performance monitoring */
6200
6189
  toolCallStartTimes = /* @__PURE__ */ new Map();
6201
6190
  /** Track streamed tool output between ACP updates and final completion */
@@ -6220,6 +6209,12 @@ class AcpBackend {
6220
6209
  waitingForResponse = false;
6221
6210
  /** First fatal prompt-level error observed for the current turn */
6222
6211
  responseCompletionError = null;
6212
+ /** Resettable no-progress timeout while waiting for a turn to finish */
6213
+ responseWaitTimeout = null;
6214
+ /** Current inactivity threshold used by waitForResponseComplete */
6215
+ responseWaitTimeoutMs = null;
6216
+ /** Timestamp of the last meaningful response progress for the current turn */
6217
+ responseLastProgressAt = null;
6223
6218
  /** Fallback completion when prompt returns but the agent emits no session updates */
6224
6219
  postPromptCompletionIdleTimeout = null;
6225
6220
  /** Whether at least one session/update arrived after the current prompt */
@@ -6253,12 +6248,110 @@ class AcpBackend {
6253
6248
  this.postPromptCompletionIdleTimeout = null;
6254
6249
  }
6255
6250
  }
6251
+ clearResponseWaitTimeout() {
6252
+ if (this.responseWaitTimeout) {
6253
+ clearTimeout(this.responseWaitTimeout);
6254
+ this.responseWaitTimeout = null;
6255
+ }
6256
+ }
6257
+ resetResponseWaitTracking() {
6258
+ this.clearResponseWaitTimeout();
6259
+ this.responseWaitTimeoutMs = null;
6260
+ this.responseLastProgressAt = null;
6261
+ }
6262
+ armResponseWaitTimeout(timeoutMs) {
6263
+ this.responseWaitTimeoutMs = timeoutMs;
6264
+ this.clearResponseWaitTimeout();
6265
+ const lastProgressAt = this.responseLastProgressAt ?? Date.now();
6266
+ const elapsedMs = Math.max(0, Date.now() - lastProgressAt);
6267
+ const remainingMs = Math.max(1, timeoutMs - elapsedMs);
6268
+ this.responseWaitTimeout = setTimeout(() => {
6269
+ this.responseWaitTimeout = null;
6270
+ this.responseWaitTimeoutMs = null;
6271
+ this.failPendingResponseWait(new Error("Timeout waiting for response to complete"));
6272
+ }, remainingMs);
6273
+ }
6274
+ scheduleToolCallTimeout(toolCallId) {
6275
+ const spec = this.toolCallTimeoutSpecs.get(toolCallId);
6276
+ if (!spec) {
6277
+ return;
6278
+ }
6279
+ const existing = this.toolCallTimeouts.get(toolCallId);
6280
+ if (existing) {
6281
+ clearTimeout(existing);
6282
+ }
6283
+ const timeout = setTimeout(() => {
6284
+ const duration = formatDuration(this.toolCallStartTimes.get(toolCallId));
6285
+ const timeoutLabel = formatToolCallTimeoutLimit(spec.timeoutMs);
6286
+ const timeoutDetail = `Tool call ${spec.toolName} timed out after ${timeoutLabel}`;
6287
+ api.logger.debug(`[AcpBackend] \u23F1\uFE0F Tool call TIMEOUT (from ${spec.source}): ${toolCallId} (${spec.toolKind}) after ${timeoutLabel} without progress - Duration: ${duration}, failing current turn`);
6288
+ this.activeToolCalls.delete(toolCallId);
6289
+ this.toolCallStartTimes.delete(toolCallId);
6290
+ this.clearToolCallTimeout(toolCallId);
6291
+ this.clearIdleTimeoutState();
6292
+ const streamedOutput = renderToolOutput(this.toolCallOutputs.get(toolCallId));
6293
+ this.toolCallOutputs.delete(toolCallId);
6294
+ this.emit({
6295
+ type: "tool-result",
6296
+ toolName: spec.toolName,
6297
+ result: streamedOutput ? {
6298
+ stdout: streamedOutput,
6299
+ error: timeoutDetail,
6300
+ status: "failed",
6301
+ timedOut: true
6302
+ } : {
6303
+ error: timeoutDetail,
6304
+ status: "failed",
6305
+ timedOut: true
6306
+ },
6307
+ callId: toolCallId
6308
+ });
6309
+ this.emit({
6310
+ type: "status",
6311
+ status: "error",
6312
+ detail: timeoutDetail
6313
+ });
6314
+ this.failPendingResponseWait(new Error(timeoutDetail));
6315
+ }, spec.timeoutMs);
6316
+ this.toolCallTimeouts.set(toolCallId, timeout);
6317
+ }
6318
+ armToolCallTimeout(spec) {
6319
+ this.toolCallTimeoutSpecs.set(spec.toolCallId, spec);
6320
+ this.scheduleToolCallTimeout(spec.toolCallId);
6321
+ }
6322
+ clearToolCallTimeout(toolCallId) {
6323
+ const timeout = this.toolCallTimeouts.get(toolCallId);
6324
+ const hadTimeout = Boolean(timeout);
6325
+ if (timeout) {
6326
+ clearTimeout(timeout);
6327
+ this.toolCallTimeouts.delete(toolCallId);
6328
+ }
6329
+ this.toolCallTimeoutSpecs.delete(toolCallId);
6330
+ return hadTimeout;
6331
+ }
6332
+ refreshActiveToolCallTimeouts() {
6333
+ for (const toolCallId of this.activeToolCalls) {
6334
+ if (this.toolCallTimeoutSpecs.has(toolCallId)) {
6335
+ this.scheduleToolCallTimeout(toolCallId);
6336
+ }
6337
+ }
6338
+ }
6339
+ markResponseProgress(opts = {}) {
6340
+ this.responseLastProgressAt = Date.now();
6341
+ if (opts.refreshToolTimeouts !== false) {
6342
+ this.refreshActiveToolCallTimeouts();
6343
+ }
6344
+ if (this.waitingForResponse && this.responseWaitTimeoutMs != null) {
6345
+ this.armResponseWaitTimeout(this.responseWaitTimeoutMs);
6346
+ }
6347
+ }
6256
6348
  clearToolCallTracking() {
6257
6349
  this.activeToolCalls.clear();
6258
6350
  for (const timeout of this.toolCallTimeouts.values()) {
6259
6351
  clearTimeout(timeout);
6260
6352
  }
6261
6353
  this.toolCallTimeouts.clear();
6354
+ this.toolCallTimeoutSpecs.clear();
6262
6355
  this.toolCallStartTimes.clear();
6263
6356
  this.toolCallIdToNameMap.clear();
6264
6357
  this.toolCallOutputs.clear();
@@ -6268,6 +6361,7 @@ class AcpBackend {
6268
6361
  this.responseCompletionOutcome = null;
6269
6362
  this.responseCompletionError = null;
6270
6363
  this.sawSessionUpdateSincePrompt = false;
6364
+ this.resetResponseWaitTracking();
6271
6365
  this.clearIdleTimeoutState();
6272
6366
  this.clearPostPromptCompletionIdleTimeout();
6273
6367
  this.clearToolCallTracking();
@@ -6279,6 +6373,7 @@ class AcpBackend {
6279
6373
  this.responseCompletionError = error;
6280
6374
  this.responseCompletionOutcome = null;
6281
6375
  this.waitingForResponse = false;
6376
+ this.resetResponseWaitTracking();
6282
6377
  this.clearPostPromptCompletionIdleTimeout();
6283
6378
  if (this.idleRejecter) {
6284
6379
  this.idleRejecter(error);
@@ -6288,6 +6383,7 @@ class AcpBackend {
6288
6383
  }
6289
6384
  settleResponseWaiter(outcome) {
6290
6385
  const hasActiveWaiter = Boolean(this.idleResolver || this.idleRejecter);
6386
+ this.resetResponseWaitTracking();
6291
6387
  if (!this.waitingForResponse && !hasActiveWaiter) {
6292
6388
  return;
6293
6389
  }
@@ -6759,6 +6855,8 @@ ${recentStderrExcerpt}`);
6759
6855
  emit: (msg) => this.emit(msg),
6760
6856
  emitIdleStatus: () => this.emitIdleStatus(),
6761
6857
  failPendingResponseWait: (error) => this.failPendingResponseWait(error),
6858
+ armToolCallTimeout: (spec) => this.armToolCallTimeout(spec),
6859
+ clearToolCallTimeout: (toolCallId) => this.clearToolCallTimeout(toolCallId),
6762
6860
  clearIdleTimeout: () => {
6763
6861
  if (this.idleTimeout) {
6764
6862
  clearTimeout(this.idleTimeout);
@@ -6799,6 +6897,7 @@ ${recentStderrExcerpt}`);
6799
6897
  this.clearPostPromptCompletionIdleTimeout();
6800
6898
  for (const update of updates) {
6801
6899
  const sessionUpdateType = update.sessionUpdate;
6900
+ this.markResponseProgress();
6802
6901
  if (sessionUpdateType !== "agent_message_chunk" && sessionUpdateType !== "tool_call_update") {
6803
6902
  api.logger.debug(`[AcpBackend] Received session update: ${sessionUpdateType}`, JSON.stringify({
6804
6903
  sessionUpdate: sessionUpdateType,
@@ -6862,6 +6961,7 @@ ${recentStderrExcerpt}`);
6862
6961
  this.resetResponseTrackingForNewPrompt();
6863
6962
  this.emit({ type: "status", status: "running" });
6864
6963
  this.waitingForResponse = true;
6964
+ this.markResponseProgress({ refreshToolTimeouts: false });
6865
6965
  try {
6866
6966
  api.logger.debug(`[AcpBackend] Sending prompt (length: ${prompt.length}): ${prompt.substring(0, 100)}...`);
6867
6967
  api.logger.debug(`[AcpBackend] Full prompt: ${prompt}`);
@@ -6922,7 +7022,7 @@ ${recentStderrExcerpt}`);
6922
7022
  * Wait for the response to complete (idle status after all chunks received)
6923
7023
  * Call this after sendPrompt to wait for Gemini to finish responding
6924
7024
  */
6925
- async waitForResponseComplete(timeoutMs = 12e4) {
7025
+ async waitForResponseComplete(timeoutMs = 10 * 6e4) {
6926
7026
  if (this.responseCompletionError) {
6927
7027
  throw this.responseCompletionError;
6928
7028
  }
@@ -6938,26 +7038,19 @@ ${recentStderrExcerpt}`);
6938
7038
  return;
6939
7039
  }
6940
7040
  return new Promise((resolve, reject) => {
6941
- const timeout = setTimeout(() => {
6942
- this.idleResolver = null;
6943
- this.idleRejecter = null;
6944
- this.waitingForResponse = false;
6945
- reject(new Error("Timeout waiting for response to complete"));
6946
- }, timeoutMs);
6947
7041
  this.idleResolver = () => {
6948
- clearTimeout(timeout);
6949
7042
  this.idleResolver = null;
6950
7043
  this.idleRejecter = null;
6951
7044
  this.waitingForResponse = false;
6952
7045
  resolve();
6953
7046
  };
6954
7047
  this.idleRejecter = (error) => {
6955
- clearTimeout(timeout);
6956
7048
  this.idleResolver = null;
6957
7049
  this.idleRejecter = null;
6958
7050
  this.waitingForResponse = false;
6959
7051
  reject(error);
6960
7052
  };
7053
+ this.armResponseWaitTimeout(timeoutMs);
6961
7054
  });
6962
7055
  }
6963
7056
  /**
@@ -7772,7 +7865,7 @@ class AbortError extends Error {
7772
7865
  }
7773
7866
  }
7774
7867
 
7775
- 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-CuuYSKiv.cjs', document.baseURI).href)));
7868
+ 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-Cuvs0lFS.cjs', document.baseURI).href)));
7776
7869
  const __dirname$1 = path.join(__filename$1, "..");
7777
7870
  function getGlobalClaudeVersion() {
7778
7871
  try {
@@ -8443,7 +8536,7 @@ class ClaudeCodeBackend {
8443
8536
  api.logger.debug("[ClaudeRuntimeBackend] Error interrupting Claude query:", error);
8444
8537
  }
8445
8538
  }
8446
- async waitForResponseComplete(timeoutMs = 12e4) {
8539
+ async waitForResponseComplete(timeoutMs = 10 * 6e4) {
8447
8540
  if (this.responseCompletionOutcome) {
8448
8541
  const outcome = this.responseCompletionOutcome;
8449
8542
  if (outcome.kind === "rejected") {
@@ -9023,11 +9116,11 @@ var launch = /*#__PURE__*/Object.freeze({
9023
9116
 
9024
9117
  const unifiedProviderExecutors = {
9025
9118
  claude: async (opts) => {
9026
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-oIFzkfuU.cjs'); });
9119
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-DVnqKa1q.cjs'); });
9027
9120
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9028
9121
  },
9029
9122
  codex: async (opts) => {
9030
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-D_9CuL6M.cjs'); });
9123
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Bzsp8gFO.cjs'); });
9031
9124
  await runCodex({
9032
9125
  credentials: opts.credentials,
9033
9126
  startedBy: opts.startedBy,
@@ -9036,7 +9129,7 @@ const unifiedProviderExecutors = {
9036
9129
  });
9037
9130
  },
9038
9131
  gemini: async (opts) => {
9039
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CcWGezMt.cjs'); });
9132
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-6Dwyk_Km.cjs'); });
9040
9133
  await runGemini({
9041
9134
  credentials: opts.credentials,
9042
9135
  startedBy: opts.startedBy
@@ -9112,7 +9205,7 @@ function shouldRunMainClaudeFlow(opts) {
9112
9205
  return;
9113
9206
  } else if (subcommand === "runtime") {
9114
9207
  if (args[1] === "providers") {
9115
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-DwfUpmId.cjs'); });
9208
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-RcCJI1jl.cjs'); });
9116
9209
  console.log(renderRuntimeProviders());
9117
9210
  return;
9118
9211
  }
@@ -9290,8 +9383,8 @@ function shouldRunMainClaudeFlow(opts) {
9290
9383
  const projectId = args[3];
9291
9384
  try {
9292
9385
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
9293
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-Dzr6sFwD.cjs'); });
9294
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DId_j3C2.cjs'); }).then(function (n) { return n.api; });
9386
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-C8-MtdQK.cjs'); });
9387
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DZimmN4C.cjs'); }).then(function (n) { return n.api; });
9295
9388
  let userEmail = void 0;
9296
9389
  try {
9297
9390
  const credentials = await readCredentials2();