happy-imou-cloud 2.1.2 → 2.1.3

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 (31) hide show
  1. package/dist/{BaseReasoningProcessor-CzvqwxuY.cjs → BaseReasoningProcessor-BrcBFCoL.cjs} +3 -3
  2. package/dist/{BaseReasoningProcessor-BaOWkVcu.mjs → BaseReasoningProcessor-CPLK0a8y.mjs} +3 -3
  3. package/dist/{ProviderSelectionHandler-Q8pl7e-d.mjs → ProviderSelectionHandler-CrXfMTg1.mjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-wwbfeK_s.cjs → ProviderSelectionHandler-f7_I3vQa.cjs} +2 -2
  5. package/dist/{api-Cxifhw5r.mjs → api-BGv79x9Q.mjs} +2 -2
  6. package/dist/{api-DZimmN4C.cjs → api-OoiG7XjD.cjs} +2 -2
  7. package/dist/{command-RcCJI1jl.cjs → command-DAYJSP16.cjs} +3 -3
  8. package/dist/{command-B6LM3Nml.mjs → command-FbV44egL.mjs} +3 -3
  9. package/dist/{index-Cuvs0lFS.cjs → index-D9lWHpn-.cjs} +43 -15
  10. package/dist/{index-Des7I5WX.mjs → index-TRC83Ks9.mjs} +40 -12
  11. package/dist/index.cjs +3 -3
  12. package/dist/index.mjs +3 -3
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +81 -82
  15. package/dist/lib.d.mts +81 -82
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{persistence-6d4U4Sh8.mjs → persistence-Cmgj3ubQ.mjs} +1 -1
  18. package/dist/{persistence-C8-MtdQK.cjs → persistence-lN9HV4IZ.cjs} +1 -1
  19. package/dist/{registerKillSessionHandler-BFBkz_XT.mjs → registerKillSessionHandler-NZd3xieQ.mjs} +3 -3
  20. package/dist/{registerKillSessionHandler-BapPCRmp.cjs → registerKillSessionHandler-pk4Ohq4Y.cjs} +3 -3
  21. package/dist/{runClaude-CPV5Uap2.mjs → runClaude-7St9-Jci.mjs} +5 -5
  22. package/dist/{runClaude-DVnqKa1q.cjs → runClaude-BP-O6ucu.cjs} +5 -5
  23. package/dist/{runCodex-Bzsp8gFO.cjs → runCodex-BV6kKtTO.cjs} +6 -6
  24. package/dist/{runCodex-CwtLSTMJ.mjs → runCodex-BaXi_9BC.mjs} +6 -6
  25. package/dist/{runGemini-6Dwyk_Km.cjs → runGemini-BiYKqJqO.cjs} +5 -5
  26. package/dist/{runGemini-Bmoxehlh.mjs → runGemini-ClNqE9N3.mjs} +5 -5
  27. package/package.json +1 -1
  28. package/scripts/devtools/README.md +9 -9
  29. package/scripts/e2e/fake-codex-acp-agent.mjs +139 -139
  30. package/scripts/e2e/local-server-session-roundtrip.mjs +1063 -1063
  31. package/scripts/ensureAcpSdkCompat.mjs +1 -1
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cuvs0lFS.cjs');
4
- var api = require('./api-DZimmN4C.cjs');
5
- var registerKillSessionHandler = require('./registerKillSessionHandler-BapPCRmp.cjs');
3
+ var index = require('./index-D9lWHpn-.cjs');
4
+ var api = require('./api-OoiG7XjD.cjs');
5
+ var registerKillSessionHandler = require('./registerKillSessionHandler-pk4Ohq4Y.cjs');
6
6
  var node_events = require('node:events');
7
7
  var node_crypto = require('node:crypto');
8
8
 
@@ -1,6 +1,6 @@
1
- import { p as publishSessionRegistration } from './index-Des7I5WX.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-Cxifhw5r.mjs';
3
- import { c as createSessionMetadata } from './registerKillSessionHandler-BFBkz_XT.mjs';
1
+ import { p as publishSessionRegistration } from './index-TRC83Ks9.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-BGv79x9Q.mjs';
3
+ import { c as createSessionMetadata } from './registerKillSessionHandler-NZd3xieQ.mjs';
4
4
  import { EventEmitter } from 'node:events';
5
5
  import { randomUUID } from 'node:crypto';
6
6
 
@@ -1,5 +1,5 @@
1
- import { l as logger } from './api-Cxifhw5r.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BFBkz_XT.mjs';
1
+ import { l as logger } from './api-BGv79x9Q.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-NZd3xieQ.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-DZimmN4C.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-BapPCRmp.cjs');
3
+ var api = require('./api-OoiG7XjD.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-pk4Ohq4Y.cjs');
5
5
 
6
6
  async function runModeLoop(opts) {
7
7
  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.2";
19
+ var version = "2.1.3";
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-6d4U4Sh8.mjs');
434
+ const { readDaemonState } = await import('./persistence-Cmgj3ubQ.mjs');
435
435
  const state = await readDaemonState();
436
436
  if (!state) {
437
437
  return logs;
@@ -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.2";
21
+ var version = "2.1.3";
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-C8-MtdQK.cjs'); });
436
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-lN9HV4IZ.cjs'); });
437
437
  const state = await readDaemonState();
438
438
  if (!state) {
439
439
  return logs;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Cuvs0lFS.cjs');
3
+ var index = require('./index-D9lWHpn-.cjs');
4
4
  require('chalk');
5
- require('./api-DZimmN4C.cjs');
5
+ require('./api-OoiG7XjD.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-C8-MtdQK.cjs');
21
+ require('./persistence-lN9HV4IZ.cjs');
22
22
  require('node:fs/promises');
23
23
  require('os');
24
24
  require('tmp');
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-Des7I5WX.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-TRC83Ks9.mjs';
2
2
  import 'chalk';
3
- import './api-Cxifhw5r.mjs';
3
+ import './api-BGv79x9Q.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-6d4U4Sh8.mjs';
19
+ import './persistence-Cmgj3ubQ.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
3
  var chalk = require('chalk');
4
- var api = require('./api-DZimmN4C.cjs');
5
- var persistence = require('./persistence-C8-MtdQK.cjs');
4
+ var api = require('./api-OoiG7XjD.cjs');
5
+ var persistence = require('./persistence-lN9HV4IZ.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-Cuvs0lFS.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-D9lWHpn-.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-Cuvs0lFS.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-D9lWHpn-.cjs', document.baseURI).href))));
699
699
  function projectPath() {
700
700
  const path = path$1.resolve(__dirname$2, "..");
701
701
  return path;
@@ -5357,6 +5357,9 @@ function extractToolOutputChunk(content) {
5357
5357
  const formatted = formatDisplayMessage(content);
5358
5358
  return formatted.length > 0 ? formatted : null;
5359
5359
  }
5360
+ function hasVisibleToolCallProgress(content) {
5361
+ return extractToolOutputChunk(content) !== null;
5362
+ }
5360
5363
  function mergeStreamedOutputWithResult(content, streamedOutput) {
5361
5364
  if (!streamedOutput || streamedOutput.length === 0) {
5362
5365
  return content;
@@ -5912,6 +5915,15 @@ function getSessionUpdates(params) {
5912
5915
  function asNonNegativeFiniteNumber(value) {
5913
5916
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
5914
5917
  }
5918
+ function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive) {
5919
+ if (!wasToolCallActive && isToolCallActive) {
5920
+ return true;
5921
+ }
5922
+ if (update.status === "completed" || update.status === "failed" || update.status === "cancelled") {
5923
+ return true;
5924
+ }
5925
+ return hasVisibleToolCallProgress(update.content);
5926
+ }
5915
5927
  function extractUsageTokens(record) {
5916
5928
  const used = asNonNegativeFiniteNumber(record.used);
5917
5929
  const size = asNonNegativeFiniteNumber(record.size);
@@ -6897,7 +6909,6 @@ ${recentStderrExcerpt}`);
6897
6909
  this.clearPostPromptCompletionIdleTimeout();
6898
6910
  for (const update of updates) {
6899
6911
  const sessionUpdateType = update.sessionUpdate;
6900
- this.markResponseProgress();
6901
6912
  if (sessionUpdateType !== "agent_message_chunk" && sessionUpdateType !== "tool_call_update") {
6902
6913
  api.logger.debug(`[AcpBackend] Received session update: ${sessionUpdateType}`, JSON.stringify({
6903
6914
  sessionUpdate: sessionUpdateType,
@@ -6909,8 +6920,12 @@ ${recentStderrExcerpt}`);
6909
6920
  }, null, 2));
6910
6921
  }
6911
6922
  const ctx = this.createHandlerContext();
6923
+ const toolCallId = update.toolCallId;
6924
+ const wasToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6912
6925
  if (sessionUpdateType === "agent_message_chunk") {
6913
- handleAgentMessageChunk(update, ctx);
6926
+ if (handleAgentMessageChunk(update, ctx).handled) {
6927
+ this.markResponseProgress();
6928
+ }
6914
6929
  continue;
6915
6930
  }
6916
6931
  if (sessionUpdateType === "tool_call_update") {
@@ -6918,14 +6933,24 @@ ${recentStderrExcerpt}`);
6918
6933
  if (result.toolCallCountSincePrompt !== void 0) {
6919
6934
  this.toolCallCountSincePrompt = result.toolCallCountSincePrompt;
6920
6935
  }
6936
+ const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6937
+ if (shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive)) {
6938
+ this.markResponseProgress();
6939
+ }
6921
6940
  continue;
6922
6941
  }
6923
6942
  if (sessionUpdateType === "agent_thought_chunk") {
6924
- handleAgentThoughtChunk(update, ctx);
6943
+ if (handleAgentThoughtChunk(update, ctx).handled) {
6944
+ this.markResponseProgress();
6945
+ }
6925
6946
  continue;
6926
6947
  }
6927
6948
  if (sessionUpdateType === "tool_call") {
6928
- handleToolCall(update, ctx);
6949
+ const result = handleToolCall(update, ctx);
6950
+ const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6951
+ if (result.handled && !wasToolCallActive && isToolCallActive) {
6952
+ this.markResponseProgress();
6953
+ }
6929
6954
  continue;
6930
6955
  }
6931
6956
  if (sessionUpdateType === "usage_update") {
@@ -6943,6 +6968,9 @@ ${recentStderrExcerpt}`);
6943
6968
  const handledPlan = handlePlanUpdate(update, ctx).handled;
6944
6969
  const handledThinking = handleThinkingUpdate(update, ctx).handled;
6945
6970
  const handledUsage = this.emitUsageTelemetry(update.usage, "acp-session-usage");
6971
+ if (handledLegacy || handledPlan || handledThinking) {
6972
+ this.markResponseProgress();
6973
+ }
6946
6974
  const updateTypeStr = sessionUpdateType;
6947
6975
  const handledTypes = ["agent_message_chunk", "tool_call_update", "agent_thought_chunk", "tool_call", "usage_update", "task_complete"];
6948
6976
  if (updateTypeStr && !handledTypes.includes(updateTypeStr) && !handledLegacy && !handledPlan && !handledThinking && !handledUsage) {
@@ -7865,7 +7893,7 @@ class AbortError extends Error {
7865
7893
  }
7866
7894
  }
7867
7895
 
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)));
7896
+ 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-D9lWHpn-.cjs', document.baseURI).href)));
7869
7897
  const __dirname$1 = path.join(__filename$1, "..");
7870
7898
  function getGlobalClaudeVersion() {
7871
7899
  try {
@@ -9116,11 +9144,11 @@ var launch = /*#__PURE__*/Object.freeze({
9116
9144
 
9117
9145
  const unifiedProviderExecutors = {
9118
9146
  claude: async (opts) => {
9119
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-DVnqKa1q.cjs'); });
9147
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-BP-O6ucu.cjs'); });
9120
9148
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9121
9149
  },
9122
9150
  codex: async (opts) => {
9123
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Bzsp8gFO.cjs'); });
9151
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-BV6kKtTO.cjs'); });
9124
9152
  await runCodex({
9125
9153
  credentials: opts.credentials,
9126
9154
  startedBy: opts.startedBy,
@@ -9129,7 +9157,7 @@ const unifiedProviderExecutors = {
9129
9157
  });
9130
9158
  },
9131
9159
  gemini: async (opts) => {
9132
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-6Dwyk_Km.cjs'); });
9160
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BiYKqJqO.cjs'); });
9133
9161
  await runGemini({
9134
9162
  credentials: opts.credentials,
9135
9163
  startedBy: opts.startedBy
@@ -9205,7 +9233,7 @@ function shouldRunMainClaudeFlow(opts) {
9205
9233
  return;
9206
9234
  } else if (subcommand === "runtime") {
9207
9235
  if (args[1] === "providers") {
9208
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-RcCJI1jl.cjs'); });
9236
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-DAYJSP16.cjs'); });
9209
9237
  console.log(renderRuntimeProviders());
9210
9238
  return;
9211
9239
  }
@@ -9383,8 +9411,8 @@ function shouldRunMainClaudeFlow(opts) {
9383
9411
  const projectId = args[3];
9384
9412
  try {
9385
9413
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
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; });
9414
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./persistence-lN9HV4IZ.cjs'); });
9415
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-OoiG7XjD.cjs'); }).then(function (n) { return n.api; });
9388
9416
  let userEmail = void 0;
9389
9417
  try {
9390
9418
  const credentials = await readCredentials2();
@@ -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, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-Cxifhw5r.mjs';
3
- import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-6d4U4Sh8.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, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, t as HeadTailPreviewBuffer, u as getLatestDaemonLog } from './api-BGv79x9Q.mjs';
3
+ import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-Cmgj3ubQ.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, { homedir } from 'os';
@@ -5335,6 +5335,9 @@ function extractToolOutputChunk(content) {
5335
5335
  const formatted = formatDisplayMessage(content);
5336
5336
  return formatted.length > 0 ? formatted : null;
5337
5337
  }
5338
+ function hasVisibleToolCallProgress(content) {
5339
+ return extractToolOutputChunk(content) !== null;
5340
+ }
5338
5341
  function mergeStreamedOutputWithResult(content, streamedOutput) {
5339
5342
  if (!streamedOutput || streamedOutput.length === 0) {
5340
5343
  return content;
@@ -5890,6 +5893,15 @@ function getSessionUpdates(params) {
5890
5893
  function asNonNegativeFiniteNumber(value) {
5891
5894
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
5892
5895
  }
5896
+ function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive) {
5897
+ if (!wasToolCallActive && isToolCallActive) {
5898
+ return true;
5899
+ }
5900
+ if (update.status === "completed" || update.status === "failed" || update.status === "cancelled") {
5901
+ return true;
5902
+ }
5903
+ return hasVisibleToolCallProgress(update.content);
5904
+ }
5893
5905
  function extractUsageTokens(record) {
5894
5906
  const used = asNonNegativeFiniteNumber(record.used);
5895
5907
  const size = asNonNegativeFiniteNumber(record.size);
@@ -6875,7 +6887,6 @@ ${recentStderrExcerpt}`);
6875
6887
  this.clearPostPromptCompletionIdleTimeout();
6876
6888
  for (const update of updates) {
6877
6889
  const sessionUpdateType = update.sessionUpdate;
6878
- this.markResponseProgress();
6879
6890
  if (sessionUpdateType !== "agent_message_chunk" && sessionUpdateType !== "tool_call_update") {
6880
6891
  logger.debug(`[AcpBackend] Received session update: ${sessionUpdateType}`, JSON.stringify({
6881
6892
  sessionUpdate: sessionUpdateType,
@@ -6887,8 +6898,12 @@ ${recentStderrExcerpt}`);
6887
6898
  }, null, 2));
6888
6899
  }
6889
6900
  const ctx = this.createHandlerContext();
6901
+ const toolCallId = update.toolCallId;
6902
+ const wasToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6890
6903
  if (sessionUpdateType === "agent_message_chunk") {
6891
- handleAgentMessageChunk(update, ctx);
6904
+ if (handleAgentMessageChunk(update, ctx).handled) {
6905
+ this.markResponseProgress();
6906
+ }
6892
6907
  continue;
6893
6908
  }
6894
6909
  if (sessionUpdateType === "tool_call_update") {
@@ -6896,14 +6911,24 @@ ${recentStderrExcerpt}`);
6896
6911
  if (result.toolCallCountSincePrompt !== void 0) {
6897
6912
  this.toolCallCountSincePrompt = result.toolCallCountSincePrompt;
6898
6913
  }
6914
+ const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6915
+ if (shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive)) {
6916
+ this.markResponseProgress();
6917
+ }
6899
6918
  continue;
6900
6919
  }
6901
6920
  if (sessionUpdateType === "agent_thought_chunk") {
6902
- handleAgentThoughtChunk(update, ctx);
6921
+ if (handleAgentThoughtChunk(update, ctx).handled) {
6922
+ this.markResponseProgress();
6923
+ }
6903
6924
  continue;
6904
6925
  }
6905
6926
  if (sessionUpdateType === "tool_call") {
6906
- handleToolCall(update, ctx);
6927
+ const result = handleToolCall(update, ctx);
6928
+ const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
6929
+ if (result.handled && !wasToolCallActive && isToolCallActive) {
6930
+ this.markResponseProgress();
6931
+ }
6907
6932
  continue;
6908
6933
  }
6909
6934
  if (sessionUpdateType === "usage_update") {
@@ -6921,6 +6946,9 @@ ${recentStderrExcerpt}`);
6921
6946
  const handledPlan = handlePlanUpdate(update, ctx).handled;
6922
6947
  const handledThinking = handleThinkingUpdate(update, ctx).handled;
6923
6948
  const handledUsage = this.emitUsageTelemetry(update.usage, "acp-session-usage");
6949
+ if (handledLegacy || handledPlan || handledThinking) {
6950
+ this.markResponseProgress();
6951
+ }
6924
6952
  const updateTypeStr = sessionUpdateType;
6925
6953
  const handledTypes = ["agent_message_chunk", "tool_call_update", "agent_thought_chunk", "tool_call", "usage_update", "task_complete"];
6926
6954
  if (updateTypeStr && !handledTypes.includes(updateTypeStr) && !handledLegacy && !handledPlan && !handledThinking && !handledUsage) {
@@ -9094,11 +9122,11 @@ var launch = /*#__PURE__*/Object.freeze({
9094
9122
 
9095
9123
  const unifiedProviderExecutors = {
9096
9124
  claude: async (opts) => {
9097
- const { runClaude } = await import('./runClaude-CPV5Uap2.mjs');
9125
+ const { runClaude } = await import('./runClaude-7St9-Jci.mjs');
9098
9126
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
9099
9127
  },
9100
9128
  codex: async (opts) => {
9101
- const { runCodex } = await import('./runCodex-CwtLSTMJ.mjs');
9129
+ const { runCodex } = await import('./runCodex-BaXi_9BC.mjs');
9102
9130
  await runCodex({
9103
9131
  credentials: opts.credentials,
9104
9132
  startedBy: opts.startedBy,
@@ -9107,7 +9135,7 @@ const unifiedProviderExecutors = {
9107
9135
  });
9108
9136
  },
9109
9137
  gemini: async (opts) => {
9110
- const { runGemini } = await import('./runGemini-Bmoxehlh.mjs');
9138
+ const { runGemini } = await import('./runGemini-ClNqE9N3.mjs');
9111
9139
  await runGemini({
9112
9140
  credentials: opts.credentials,
9113
9141
  startedBy: opts.startedBy
@@ -9183,7 +9211,7 @@ function shouldRunMainClaudeFlow(opts) {
9183
9211
  return;
9184
9212
  } else if (subcommand === "runtime") {
9185
9213
  if (args[1] === "providers") {
9186
- const { renderRuntimeProviders } = await import('./command-B6LM3Nml.mjs');
9214
+ const { renderRuntimeProviders } = await import('./command-FbV44egL.mjs');
9187
9215
  console.log(renderRuntimeProviders());
9188
9216
  return;
9189
9217
  }
@@ -9361,8 +9389,8 @@ function shouldRunMainClaudeFlow(opts) {
9361
9389
  const projectId = args[3];
9362
9390
  try {
9363
9391
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
9364
- const { readCredentials: readCredentials2 } = await import('./persistence-6d4U4Sh8.mjs');
9365
- const { ApiClient: ApiClient2 } = await import('./api-Cxifhw5r.mjs').then(function (n) { return n.v; });
9392
+ const { readCredentials: readCredentials2 } = await import('./persistence-Cmgj3ubQ.mjs');
9393
+ const { ApiClient: ApiClient2 } = await import('./api-BGv79x9Q.mjs').then(function (n) { return n.v; });
9366
9394
  let userEmail = void 0;
9367
9395
  try {
9368
9396
  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-DZimmN4C.cjs');
5
- require('./persistence-C8-MtdQK.cjs');
4
+ require('./api-OoiG7XjD.cjs');
5
+ require('./persistence-lN9HV4IZ.cjs');
6
6
  require('zod');
7
- require('./index-Cuvs0lFS.cjs');
7
+ require('./index-D9lWHpn-.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-Cxifhw5r.mjs';
3
- import './persistence-6d4U4Sh8.mjs';
2
+ import './api-BGv79x9Q.mjs';
3
+ import './persistence-Cmgj3ubQ.mjs';
4
4
  import 'zod';
5
- import './index-Des7I5WX.mjs';
5
+ import './index-TRC83Ks9.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-DZimmN4C.cjs');
3
+ var api = require('./api-OoiG7XjD.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');