happy-imou-cloud 2.1.22 → 2.1.24

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-BYNLDM-T.mjs → BaseReasoningProcessor-BTf3r0UP.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-BVdXoFXc.cjs → BaseReasoningProcessor-C12000HQ.cjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-DDzNcWPJ.cjs → ProviderSelectionHandler-BFdeV3Qi.cjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-DgINCAMh.mjs → ProviderSelectionHandler-DXx9hcjB.mjs} +2 -2
  5. package/dist/{api-BXGRJ5Kn.cjs → api-Baax81ZI.cjs} +1 -1
  6. package/dist/{api-bhF1J82q.mjs → api-DZeS3vrX.mjs} +1 -1
  7. package/dist/{command-CyUpFVkQ.mjs → command-B_RdbyPU.mjs} +2 -2
  8. package/dist/{command-Byj1OLb9.cjs → command-DOZYbypd.cjs} +2 -2
  9. package/dist/{index-BNTRi6Uv.cjs → index-BNqCQ-lZ.cjs} +47 -17
  10. package/dist/{index-CEhnCQim.mjs → index-DA3m13mn.mjs} +44 -14
  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 +50 -50
  15. package/dist/lib.d.mts +50 -50
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-BtPo6LkG.mjs → registerKillSessionHandler-BiG3yHlk.mjs} +2 -2
  18. package/dist/{registerKillSessionHandler-CuP57vY0.cjs → registerKillSessionHandler-BtXtFnRx.cjs} +2 -2
  19. package/dist/{runClaude-CMKm1bBe.mjs → runClaude-BqN1RhrO.mjs} +4 -4
  20. package/dist/{runClaude-CqJgxqjW.cjs → runClaude-DGV1Dcv4.cjs} +4 -4
  21. package/dist/{runCodex-BkfujuLR.mjs → runCodex-C3htqAO7.mjs} +5 -5
  22. package/dist/{runCodex-DIaZ1wGI.cjs → runCodex-DQQkaW3Z.cjs} +5 -5
  23. package/dist/{runGemini-DcN0Nb3f.mjs → runGemini-CH9Cti4U.mjs} +4 -4
  24. package/dist/{runGemini-U4GRLlSn.cjs → runGemini-CmDSS8Qz.cjs} +4 -4
  25. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-CEhnCQim.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-bhF1J82q.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-DA3m13mn.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-DZeS3vrX.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-BNTRi6Uv.cjs');
4
- var persistence = require('./api-BXGRJ5Kn.cjs');
3
+ var index = require('./index-BNqCQ-lZ.cjs');
4
+ var persistence = require('./api-Baax81ZI.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-BXGRJ5Kn.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-CuP57vY0.cjs');
3
+ var persistence = require('./api-Baax81ZI.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-BtXtFnRx.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-bhF1J82q.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BtPo6LkG.mjs';
1
+ import { l as logger } from './api-DZeS3vrX.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BiG3yHlk.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.22";
41
+ var version = "2.1.24";
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 { unlink, readFile, mkdir, open, stat, writeFile, rename } from 'node:fs/
18
18
  import { Expo } from 'expo-server-sdk';
19
19
 
20
20
  var name = "happy-imou-cloud";
21
- var version = "2.1.22";
21
+ var version = "2.1.24";
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-CEhnCQim.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-DA3m13mn.mjs';
2
2
  import 'chalk';
3
- import './api-bhF1J82q.mjs';
3
+ import './api-DZeS3vrX.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-BNTRi6Uv.cjs');
3
+ var index = require('./index-BNqCQ-lZ.cjs');
4
4
  require('chalk');
5
- require('./api-BXGRJ5Kn.cjs');
5
+ require('./api-Baax81ZI.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var persistence = require('./api-BXGRJ5Kn.cjs');
4
+ var persistence = require('./api-Baax81ZI.cjs');
5
5
  var z = require('zod');
6
6
  var fs$2 = require('fs/promises');
7
7
  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-BNTRi6Uv.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-BNqCQ-lZ.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();
@@ -637,7 +637,7 @@ function setupCleanupHandlers() {
637
637
  });
638
638
  }
639
639
 
640
- 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-BNTRi6Uv.cjs', document.baseURI).href))));
640
+ 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-BNqCQ-lZ.cjs', document.baseURI).href))));
641
641
  function projectPath() {
642
642
  const path = path$1.resolve(__dirname$2, "..");
643
643
  return path;
@@ -6433,6 +6433,8 @@ const DEFAULT_IDLE_TIMEOUT_MS = 500;
6433
6433
  const DEFAULT_TOOL_CALL_TIMEOUT_MS = 10 * 6e4;
6434
6434
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES = 2e3;
6435
6435
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES = 4e3;
6436
+ const CONTENTLESS_FETCH_INPUT_NOTE = "ACP runtime did not provide fetch arguments.";
6437
+ const CONTENTLESS_FETCH_RESULT_TEXT = "Fetch completed, but the ACP runtime did not provide structured output.";
6436
6438
  function parseArgsFromContent(content) {
6437
6439
  if (Array.isArray(content)) {
6438
6440
  return { items: content };
@@ -6442,6 +6444,25 @@ function parseArgsFromContent(content) {
6442
6444
  }
6443
6445
  return {};
6444
6446
  }
6447
+ function isContentlessFetchTool(toolKind, content, locations) {
6448
+ if (toolKind !== "fetch") {
6449
+ return false;
6450
+ }
6451
+ if (hasMeaningfulContent(content)) {
6452
+ return false;
6453
+ }
6454
+ return !Array.isArray(locations) || locations.length === 0;
6455
+ }
6456
+ function buildToolCallArgs(toolKind, content, locations) {
6457
+ const args = parseArgsFromContent(content);
6458
+ if (Array.isArray(locations)) {
6459
+ args.locations = locations;
6460
+ }
6461
+ if (isContentlessFetchTool(toolKind, content, locations)) {
6462
+ args.note = CONTENTLESS_FETCH_INPUT_NOTE;
6463
+ }
6464
+ return args;
6465
+ }
6445
6466
  const MAX_TOOL_OUTPUT_OVERLAP_CHARS = 4096;
6446
6467
  function findToolOutputOverlap(previous, next) {
6447
6468
  const maxOverlap = Math.min(previous.length, next.length, MAX_TOOL_OUTPUT_OVERLAP_CHARS);
@@ -6634,6 +6655,16 @@ function mergeStreamedOutputWithResult(content, streamedOutput) {
6634
6655
  }
6635
6656
  return content;
6636
6657
  }
6658
+ function buildCompletedToolResult(toolKind, content, streamedOutput) {
6659
+ const merged = mergeStreamedOutputWithResult(content, streamedOutput);
6660
+ if (toolKind === "fetch" && !hasMeaningfulContent(merged)) {
6661
+ return {
6662
+ text: CONTENTLESS_FETCH_RESULT_TEXT,
6663
+ status: "completed"
6664
+ };
6665
+ }
6666
+ return merged;
6667
+ }
6637
6668
  function extractErrorDetail(content) {
6638
6669
  if (!content) return void 0;
6639
6670
  if (typeof content === "string") {
@@ -6751,10 +6782,7 @@ function startToolCall(toolCallId, toolKind, update, ctx, source) {
6751
6782
  }
6752
6783
  ctx.clearIdleTimeout();
6753
6784
  ctx.emit({ type: "status", status: "running" });
6754
- const args = parseArgsFromContent(update.content);
6755
- if (update.locations && Array.isArray(update.locations)) {
6756
- args.locations = update.locations;
6757
- }
6785
+ const args = buildToolCallArgs(toolKind, update.content, update.locations);
6758
6786
  if (isInvestigation && args.objective) {
6759
6787
  persistence.logger.debug(`[AcpBackend] \u{1F50D} Investigation tool objective: ${String(args.objective).substring(0, 100)}...`);
6760
6788
  }
@@ -6768,9 +6796,10 @@ function startToolCall(toolCallId, toolKind, update, ctx, source) {
6768
6796
  function completeToolCall(toolCallId, toolKind, content, ctx) {
6769
6797
  const startTime = ctx.toolCallStartTimes.get(toolCallId);
6770
6798
  const duration = formatDuration(startTime);
6771
- const toolKindStr = typeof toolKind === "string" ? toolKind : "unknown";
6799
+ const toolKindStr = typeof toolKind === "string" && toolKind !== "unknown" ? toolKind : ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
6772
6800
  ctx.activeToolCalls.delete(toolCallId);
6773
6801
  ctx.toolCallStartTimes.delete(toolCallId);
6802
+ ctx.toolCallIdToNameMap.delete(toolCallId);
6774
6803
  ctx.clearToolCallTimeout(toolCallId);
6775
6804
  const streamedOutput = renderToolOutput(ctx.toolCallOutputs.get(toolCallId));
6776
6805
  ctx.toolCallOutputs.delete(toolCallId);
@@ -6778,7 +6807,7 @@ function completeToolCall(toolCallId, toolKind, content, ctx) {
6778
6807
  ctx.emit({
6779
6808
  type: "tool-result",
6780
6809
  toolName: toolKindStr,
6781
- result: mergeStreamedOutputWithResult(content, streamedOutput),
6810
+ result: buildCompletedToolResult(toolKindStr, content, streamedOutput),
6782
6811
  callId: toolCallId
6783
6812
  });
6784
6813
  if (ctx.activeToolCalls.size === 0) {
@@ -6790,7 +6819,7 @@ function completeToolCall(toolCallId, toolKind, content, ctx) {
6790
6819
  function failToolCall(toolCallId, status, toolKind, content, ctx) {
6791
6820
  const startTime = ctx.toolCallStartTimes.get(toolCallId);
6792
6821
  const duration = startTime ? Date.now() - startTime : null;
6793
- const toolKindStr = typeof toolKind === "string" ? toolKind : "unknown";
6822
+ const toolKindStr = typeof toolKind === "string" && toolKind !== "unknown" ? toolKind : ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
6794
6823
  const isInvestigation = ctx.transport.isInvestigationTool?.(toolCallId, toolKindStr) ?? false;
6795
6824
  const hadTimeout = ctx.toolCallTimeouts.has(toolCallId);
6796
6825
  if (isInvestigation) {
@@ -6810,6 +6839,7 @@ function failToolCall(toolCallId, status, toolKind, content, ctx) {
6810
6839
  }
6811
6840
  ctx.activeToolCalls.delete(toolCallId);
6812
6841
  ctx.toolCallStartTimes.delete(toolCallId);
6842
+ ctx.toolCallIdToNameMap.delete(toolCallId);
6813
6843
  const clearedTimeout = ctx.clearToolCallTimeout(toolCallId);
6814
6844
  if (clearedTimeout) {
6815
6845
  persistence.logger.debug(`[AcpBackend] Cleared timeout for ${toolCallId} (tool call ${status})`);
@@ -9449,7 +9479,7 @@ class AbortError extends Error {
9449
9479
  }
9450
9480
  }
9451
9481
 
9452
- 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-BNTRi6Uv.cjs', document.baseURI).href)));
9482
+ 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-BNqCQ-lZ.cjs', document.baseURI).href)));
9453
9483
  const __dirname$1 = path.join(__filename$1, "..");
9454
9484
  function getGlobalClaudeVersion() {
9455
9485
  try {
@@ -10768,14 +10798,14 @@ var launch = /*#__PURE__*/Object.freeze({
10768
10798
  const unifiedProviderExecutors = {
10769
10799
  claude: async (opts) => {
10770
10800
  const claudeOptions = opts.claudeOptions ?? {};
10771
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-CqJgxqjW.cjs'); });
10801
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-DGV1Dcv4.cjs'); });
10772
10802
  await runClaude(opts.credentials, {
10773
10803
  ...claudeOptions,
10774
10804
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
10775
10805
  });
10776
10806
  },
10777
10807
  codex: async (opts) => {
10778
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-DIaZ1wGI.cjs'); });
10808
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-DQQkaW3Z.cjs'); });
10779
10809
  await runCodex({
10780
10810
  credentials: opts.credentials,
10781
10811
  startedBy: opts.startedBy,
@@ -10784,7 +10814,7 @@ const unifiedProviderExecutors = {
10784
10814
  });
10785
10815
  },
10786
10816
  gemini: async (opts) => {
10787
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-U4GRLlSn.cjs'); });
10817
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-CmDSS8Qz.cjs'); });
10788
10818
  await runGemini({
10789
10819
  credentials: opts.credentials,
10790
10820
  startedBy: opts.startedBy
@@ -10867,7 +10897,7 @@ function shouldRunMainClaudeFlow(opts) {
10867
10897
  return;
10868
10898
  } else if (subcommand === "runtime") {
10869
10899
  if (args[1] === "providers") {
10870
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Byj1OLb9.cjs'); });
10900
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-DOZYbypd.cjs'); });
10871
10901
  console.log(renderRuntimeProviders());
10872
10902
  return;
10873
10903
  }
@@ -11067,8 +11097,8 @@ function shouldRunMainClaudeFlow(opts) {
11067
11097
  const projectId = args[3];
11068
11098
  try {
11069
11099
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11070
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-BXGRJ5Kn.cjs'); }).then(function (n) { return n.persistence; });
11071
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-BXGRJ5Kn.cjs'); }).then(function (n) { return n.api; });
11100
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-Baax81ZI.cjs'); }).then(function (n) { return n.persistence; });
11101
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-Baax81ZI.cjs'); }).then(function (n) { return n.api; });
11072
11102
  let userEmail = void 0;
11073
11103
  try {
11074
11104
  const credentials = await readCredentials2();
@@ -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, j as encodeBase64, c as configuration, k as readCredentials, m as ensureSigningCredentials, r as readSettings, u as updateSettings, n as encodeBase64Url, g as delay, o as buildClientHeaders, q as decodeBase64, w as writeCredentialsLegacy, t as writeCredentialsDataKey, v as readDaemonState, x as HAPPY_CLOUD_DAEMON_PORT, y as clearDaemonState, z as packageJson, i as isAuthenticationRequiredError, B as acquireDaemonLock, C as writeDaemonState, A as ApiClient, D as releaseDaemonLock, E as validateProfileForAgent, F as getProfileEnvironmentVariables, G as clearCredentials, I as clearMachineId, M as MessageContentSchema, J as buildSocketAuth, K as encrypt, L as HeadTailPreviewBuffer, N as getLatestDaemonLog } from './api-bhF1J82q.mjs';
2
+ import { l as logger, j as encodeBase64, c as configuration, k as readCredentials, m as ensureSigningCredentials, r as readSettings, u as updateSettings, n as encodeBase64Url, g as delay, o as buildClientHeaders, q as decodeBase64, w as writeCredentialsLegacy, t as writeCredentialsDataKey, v as readDaemonState, x as HAPPY_CLOUD_DAEMON_PORT, y as clearDaemonState, z as packageJson, i as isAuthenticationRequiredError, B as acquireDaemonLock, C as writeDaemonState, A as ApiClient, D as releaseDaemonLock, E as validateProfileForAgent, F as getProfileEnvironmentVariables, G as clearCredentials, I as clearMachineId, M as MessageContentSchema, J as buildSocketAuth, K as encrypt, L as HeadTailPreviewBuffer, N as getLatestDaemonLog } from './api-DZeS3vrX.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 } from 'os';
@@ -6411,6 +6411,8 @@ const DEFAULT_IDLE_TIMEOUT_MS = 500;
6411
6411
  const DEFAULT_TOOL_CALL_TIMEOUT_MS = 10 * 6e4;
6412
6412
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES = 2e3;
6413
6413
  const DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES = 4e3;
6414
+ const CONTENTLESS_FETCH_INPUT_NOTE = "ACP runtime did not provide fetch arguments.";
6415
+ const CONTENTLESS_FETCH_RESULT_TEXT = "Fetch completed, but the ACP runtime did not provide structured output.";
6414
6416
  function parseArgsFromContent(content) {
6415
6417
  if (Array.isArray(content)) {
6416
6418
  return { items: content };
@@ -6420,6 +6422,25 @@ function parseArgsFromContent(content) {
6420
6422
  }
6421
6423
  return {};
6422
6424
  }
6425
+ function isContentlessFetchTool(toolKind, content, locations) {
6426
+ if (toolKind !== "fetch") {
6427
+ return false;
6428
+ }
6429
+ if (hasMeaningfulContent(content)) {
6430
+ return false;
6431
+ }
6432
+ return !Array.isArray(locations) || locations.length === 0;
6433
+ }
6434
+ function buildToolCallArgs(toolKind, content, locations) {
6435
+ const args = parseArgsFromContent(content);
6436
+ if (Array.isArray(locations)) {
6437
+ args.locations = locations;
6438
+ }
6439
+ if (isContentlessFetchTool(toolKind, content, locations)) {
6440
+ args.note = CONTENTLESS_FETCH_INPUT_NOTE;
6441
+ }
6442
+ return args;
6443
+ }
6423
6444
  const MAX_TOOL_OUTPUT_OVERLAP_CHARS = 4096;
6424
6445
  function findToolOutputOverlap(previous, next) {
6425
6446
  const maxOverlap = Math.min(previous.length, next.length, MAX_TOOL_OUTPUT_OVERLAP_CHARS);
@@ -6612,6 +6633,16 @@ function mergeStreamedOutputWithResult(content, streamedOutput) {
6612
6633
  }
6613
6634
  return content;
6614
6635
  }
6636
+ function buildCompletedToolResult(toolKind, content, streamedOutput) {
6637
+ const merged = mergeStreamedOutputWithResult(content, streamedOutput);
6638
+ if (toolKind === "fetch" && !hasMeaningfulContent(merged)) {
6639
+ return {
6640
+ text: CONTENTLESS_FETCH_RESULT_TEXT,
6641
+ status: "completed"
6642
+ };
6643
+ }
6644
+ return merged;
6645
+ }
6615
6646
  function extractErrorDetail(content) {
6616
6647
  if (!content) return void 0;
6617
6648
  if (typeof content === "string") {
@@ -6729,10 +6760,7 @@ function startToolCall(toolCallId, toolKind, update, ctx, source) {
6729
6760
  }
6730
6761
  ctx.clearIdleTimeout();
6731
6762
  ctx.emit({ type: "status", status: "running" });
6732
- const args = parseArgsFromContent(update.content);
6733
- if (update.locations && Array.isArray(update.locations)) {
6734
- args.locations = update.locations;
6735
- }
6763
+ const args = buildToolCallArgs(toolKind, update.content, update.locations);
6736
6764
  if (isInvestigation && args.objective) {
6737
6765
  logger.debug(`[AcpBackend] \u{1F50D} Investigation tool objective: ${String(args.objective).substring(0, 100)}...`);
6738
6766
  }
@@ -6746,9 +6774,10 @@ function startToolCall(toolCallId, toolKind, update, ctx, source) {
6746
6774
  function completeToolCall(toolCallId, toolKind, content, ctx) {
6747
6775
  const startTime = ctx.toolCallStartTimes.get(toolCallId);
6748
6776
  const duration = formatDuration(startTime);
6749
- const toolKindStr = typeof toolKind === "string" ? toolKind : "unknown";
6777
+ const toolKindStr = typeof toolKind === "string" && toolKind !== "unknown" ? toolKind : ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
6750
6778
  ctx.activeToolCalls.delete(toolCallId);
6751
6779
  ctx.toolCallStartTimes.delete(toolCallId);
6780
+ ctx.toolCallIdToNameMap.delete(toolCallId);
6752
6781
  ctx.clearToolCallTimeout(toolCallId);
6753
6782
  const streamedOutput = renderToolOutput(ctx.toolCallOutputs.get(toolCallId));
6754
6783
  ctx.toolCallOutputs.delete(toolCallId);
@@ -6756,7 +6785,7 @@ function completeToolCall(toolCallId, toolKind, content, ctx) {
6756
6785
  ctx.emit({
6757
6786
  type: "tool-result",
6758
6787
  toolName: toolKindStr,
6759
- result: mergeStreamedOutputWithResult(content, streamedOutput),
6788
+ result: buildCompletedToolResult(toolKindStr, content, streamedOutput),
6760
6789
  callId: toolCallId
6761
6790
  });
6762
6791
  if (ctx.activeToolCalls.size === 0) {
@@ -6768,7 +6797,7 @@ function completeToolCall(toolCallId, toolKind, content, ctx) {
6768
6797
  function failToolCall(toolCallId, status, toolKind, content, ctx) {
6769
6798
  const startTime = ctx.toolCallStartTimes.get(toolCallId);
6770
6799
  const duration = startTime ? Date.now() - startTime : null;
6771
- const toolKindStr = typeof toolKind === "string" ? toolKind : "unknown";
6800
+ const toolKindStr = typeof toolKind === "string" && toolKind !== "unknown" ? toolKind : ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
6772
6801
  const isInvestigation = ctx.transport.isInvestigationTool?.(toolCallId, toolKindStr) ?? false;
6773
6802
  const hadTimeout = ctx.toolCallTimeouts.has(toolCallId);
6774
6803
  if (isInvestigation) {
@@ -6788,6 +6817,7 @@ function failToolCall(toolCallId, status, toolKind, content, ctx) {
6788
6817
  }
6789
6818
  ctx.activeToolCalls.delete(toolCallId);
6790
6819
  ctx.toolCallStartTimes.delete(toolCallId);
6820
+ ctx.toolCallIdToNameMap.delete(toolCallId);
6791
6821
  const clearedTimeout = ctx.clearToolCallTimeout(toolCallId);
6792
6822
  if (clearedTimeout) {
6793
6823
  logger.debug(`[AcpBackend] Cleared timeout for ${toolCallId} (tool call ${status})`);
@@ -10746,14 +10776,14 @@ var launch = /*#__PURE__*/Object.freeze({
10746
10776
  const unifiedProviderExecutors = {
10747
10777
  claude: async (opts) => {
10748
10778
  const claudeOptions = opts.claudeOptions ?? {};
10749
- const { runClaude } = await import('./runClaude-CMKm1bBe.mjs');
10779
+ const { runClaude } = await import('./runClaude-BqN1RhrO.mjs');
10750
10780
  await runClaude(opts.credentials, {
10751
10781
  ...claudeOptions,
10752
10782
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
10753
10783
  });
10754
10784
  },
10755
10785
  codex: async (opts) => {
10756
- const { runCodex } = await import('./runCodex-BkfujuLR.mjs');
10786
+ const { runCodex } = await import('./runCodex-C3htqAO7.mjs');
10757
10787
  await runCodex({
10758
10788
  credentials: opts.credentials,
10759
10789
  startedBy: opts.startedBy,
@@ -10762,7 +10792,7 @@ const unifiedProviderExecutors = {
10762
10792
  });
10763
10793
  },
10764
10794
  gemini: async (opts) => {
10765
- const { runGemini } = await import('./runGemini-DcN0Nb3f.mjs');
10795
+ const { runGemini } = await import('./runGemini-CH9Cti4U.mjs');
10766
10796
  await runGemini({
10767
10797
  credentials: opts.credentials,
10768
10798
  startedBy: opts.startedBy
@@ -10845,7 +10875,7 @@ function shouldRunMainClaudeFlow(opts) {
10845
10875
  return;
10846
10876
  } else if (subcommand === "runtime") {
10847
10877
  if (args[1] === "providers") {
10848
- const { renderRuntimeProviders } = await import('./command-CyUpFVkQ.mjs');
10878
+ const { renderRuntimeProviders } = await import('./command-B_RdbyPU.mjs');
10849
10879
  console.log(renderRuntimeProviders());
10850
10880
  return;
10851
10881
  }
@@ -11045,8 +11075,8 @@ function shouldRunMainClaudeFlow(opts) {
11045
11075
  const projectId = args[3];
11046
11076
  try {
11047
11077
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11048
- const { readCredentials: readCredentials2 } = await import('./api-bhF1J82q.mjs').then(function (n) { return n.O; });
11049
- const { ApiClient: ApiClient2 } = await import('./api-bhF1J82q.mjs').then(function (n) { return n.P; });
11078
+ const { readCredentials: readCredentials2 } = await import('./api-DZeS3vrX.mjs').then(function (n) { return n.O; });
11079
+ const { ApiClient: ApiClient2 } = await import('./api-DZeS3vrX.mjs').then(function (n) { return n.P; });
11050
11080
  let userEmail = void 0;
11051
11081
  try {
11052
11082
  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-BXGRJ5Kn.cjs');
4
+ require('./api-Baax81ZI.cjs');
5
5
  require('zod');
6
- require('./index-BNTRi6Uv.cjs');
6
+ require('./index-BNqCQ-lZ.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-bhF1J82q.mjs';
2
+ import './api-DZeS3vrX.mjs';
3
3
  import 'zod';
4
- import './index-CEhnCQim.mjs';
4
+ import './index-DA3m13mn.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-BXGRJ5Kn.cjs');
3
+ var persistence = require('./api-Baax81ZI.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');