happy-imou-cloud 2.1.28 → 2.1.30

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 (26) hide show
  1. package/dist/{BaseReasoningProcessor-DYVFvY85.mjs → BaseReasoningProcessor-C1iacoJW.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-AsSwxX2U.cjs → BaseReasoningProcessor-Ch9R4qmn.cjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-Cd_vN8wA.mjs → ProviderSelectionHandler-2siFKlgs.mjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-BKfo21qx.cjs → ProviderSelectionHandler-Dx6x0Nd4.cjs} +2 -2
  5. package/dist/{api-DYS9sGJr.mjs → api-C68U-kRs.mjs} +626 -126
  6. package/dist/{api-ChV_1TP7.cjs → api-DK1gyZAZ.cjs} +626 -126
  7. package/dist/{command-ErrXrwTw.cjs → command-Cb9nikZh.cjs} +2 -2
  8. package/dist/{command-Bx9UY5D5.mjs → command-D32x08k9.mjs} +2 -2
  9. package/dist/{index-CDyeCS7U.cjs → index-BLeiCte-.cjs} +174 -32
  10. package/dist/{index-DtlrIihs.mjs → index-DQ76ZTNL.mjs} +171 -29
  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 +100 -0
  15. package/dist/lib.d.mts +100 -0
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{registerKillSessionHandler-IlzXqONk.mjs → registerKillSessionHandler-CadrzRgP.mjs} +16 -6
  18. package/dist/{registerKillSessionHandler-CBuJR_D8.cjs → registerKillSessionHandler-DD9uUk4w.cjs} +16 -6
  19. package/dist/{runClaude-VlpAUO9C.mjs → runClaude-CkY6XYJa.mjs} +4 -4
  20. package/dist/{runClaude-D_YCDVmM.cjs → runClaude-U9sxsnU-.cjs} +4 -4
  21. package/dist/{runCodex-jisfibyM.cjs → runCodex-Beikmv-L.cjs} +134 -9
  22. package/dist/{runCodex-CL1yQHxl.mjs → runCodex-C6kV0jfX.mjs} +134 -9
  23. package/dist/{runGemini-BtBrzhkF.cjs → runGemini-BTyqf5MR.cjs} +4 -4
  24. package/dist/{runGemini-EPv-yxY4.mjs → runGemini-IEzJdhc-.mjs} +4 -4
  25. package/package.json +1 -1
  26. package/scripts/release-smoke.mjs +3 -0
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CDyeCS7U.cjs');
3
+ var index = require('./index-BLeiCte-.cjs');
4
4
  require('chalk');
5
- require('./api-ChV_1TP7.cjs');
5
+ require('./api-DK1gyZAZ.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-DtlrIihs.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-DQ76ZTNL.mjs';
2
2
  import 'chalk';
3
- import './api-DYS9sGJr.mjs';
3
+ import './api-C68U-kRs.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chalk = require('chalk');
4
- var persistence = require('./api-ChV_1TP7.cjs');
4
+ var persistence = require('./api-DK1gyZAZ.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-CDyeCS7U.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-BLeiCte-.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-CDyeCS7U.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-BLeiCte-.cjs', document.baseURI).href))));
641
641
  function projectPath() {
642
642
  const path = path$1.resolve(__dirname$2, "..");
643
643
  return path;
@@ -4995,6 +4995,8 @@ function formatDispatchReceipt(receipt) {
4995
4995
  `organization_id=${receipt.organizationId}`,
4996
4996
  `dispatch_id=${receipt.notice.dispatch_id}`,
4997
4997
  `task_id=${receipt.notice.task_id}`,
4998
+ `position_id=${receipt.notice.position_id ?? ""}`,
4999
+ `responsibility_id=${receipt.notice.responsibility_id ?? ""}`,
4998
5000
  `scope=${receipt.notice.scope}`,
4999
5001
  `member_agent_id=${receipt.member?.agentId ?? receipt.business_ack?.memberAgentId ?? ""}`,
5000
5002
  `member_label=${receipt.member?.label ?? ""}`,
@@ -5024,7 +5026,7 @@ ${chalk.bold("hicloud happy-org")} - Thin CLI sender for Happy Org dispatch/rece
5024
5026
 
5025
5027
  ${chalk.bold("Usage:")}
5026
5028
  hicloud happy-org agents [--organization-id <id>] [--json]
5027
- hicloud happy-org dispatch send --task-id <task> --scope <scope> [--member-id <id> | --member-name <name>] --allowed-paths <csv> [--forbidden-paths <csv>] [--organization-id <id>] [--note <text>] [--wait-seconds <n>] [--json]
5029
+ hicloud happy-org dispatch send --task-id <task> --scope <scope> [--member-id <id> | --member-name <name>] --allowed-paths <csv> [--forbidden-paths <csv>] [--position-id <id>] [--responsibility-id <id>] [--organization-id <id>] [--note <text>] [--wait-seconds <n>] [--json]
5028
5030
  hicloud happy-org dispatch receipt <dispatch-id> [--organization-id <id>] [--json]
5029
5031
  hicloud happy-org repo process --root <path> [--request-id <id>] [--json]
5030
5032
  hicloud happy-org repo turn-report --root <path> --report-json <json> [--json]
@@ -5098,6 +5100,8 @@ async function handleDispatchSendCommand(parsed, deps) {
5098
5100
  const scope = readSingleValue(parsed, "scope");
5099
5101
  const allowedPaths = readPathList(parsed, { singular: "allowed-path", plural: "allowed-paths" });
5100
5102
  const forbiddenPaths = readPathList(parsed, { singular: "forbidden-path", plural: "forbidden-paths" });
5103
+ const positionId = readSingleValue(parsed, "position-id");
5104
+ const responsibilityId = readSingleValue(parsed, "responsibility-id");
5101
5105
  const note = readSingleValue(parsed, "note");
5102
5106
  const waitSeconds = readWaitSeconds(parsed);
5103
5107
  if (!taskId) {
@@ -5123,6 +5127,8 @@ async function handleDispatchSendCommand(parsed, deps) {
5123
5127
  scope,
5124
5128
  allowedPaths,
5125
5129
  forbiddenPaths,
5130
+ positionId,
5131
+ responsibilityId,
5126
5132
  note
5127
5133
  });
5128
5134
  receipt = await waitForDispatchAck(api, {
@@ -6898,6 +6904,22 @@ function renderToolOutput(accumulator) {
6898
6904
  }
6899
6905
  return accumulator.preview.render("tool output");
6900
6906
  }
6907
+ function extractTerminalOutputMeta(update) {
6908
+ if (!isRecord$1(update._meta)) {
6909
+ return null;
6910
+ }
6911
+ const terminalOutput = update._meta.terminal_output;
6912
+ if (!isRecord$1(terminalOutput)) {
6913
+ return null;
6914
+ }
6915
+ const data = typeof terminalOutput.data === "string" && terminalOutput.data.length > 0 ? terminalOutput.data : null;
6916
+ if (!data) {
6917
+ return null;
6918
+ }
6919
+ const terminalId = typeof terminalOutput.terminal_id === "string" && terminalOutput.terminal_id.length > 0 ? terminalOutput.terminal_id : null;
6920
+ const toolCallId = typeof update.toolCallId === "string" && update.toolCallId.length > 0 ? update.toolCallId : terminalId;
6921
+ return toolCallId ? { toolCallId, data } : null;
6922
+ }
6901
6923
  function formatToolCallTimeoutLimit(timeoutMs) {
6902
6924
  if (timeoutMs < 1e3) {
6903
6925
  return `${timeoutMs}ms`;
@@ -7233,7 +7255,7 @@ function failToolCall(toolCallId, status, toolKind, content, ctx) {
7233
7255
  ctx.emitIdleStatus();
7234
7256
  }
7235
7257
  }
7236
- function handleToolCallUpdate(update, ctx) {
7258
+ function handleToolCallUpdate(update, ctx, options) {
7237
7259
  const status = update.status;
7238
7260
  const toolCallId = update.toolCallId;
7239
7261
  if (!toolCallId) {
@@ -7242,7 +7264,7 @@ function handleToolCallUpdate(update, ctx) {
7242
7264
  }
7243
7265
  const toolKind = update.kind || ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
7244
7266
  let toolCallCountSincePrompt = ctx.toolCallCountSincePrompt;
7245
- const outputChunk = extractToolOutputChunk(update.content);
7267
+ const outputChunk = extractToolOutputChunk(update.content) ?? options?.supplementalOutputChunk ?? null;
7246
7268
  if (outputChunk) {
7247
7269
  const nextOutput = appendToolOutput(ctx.toolCallOutputs.get(toolCallId), outputChunk);
7248
7270
  ctx.toolCallOutputs.set(toolCallId, nextOutput);
@@ -7259,7 +7281,21 @@ function handleToolCallUpdate(update, ctx) {
7259
7281
  } else if (status === "failed" || status === "cancelled") {
7260
7282
  failToolCall(toolCallId, status, toolKind, update.content, ctx);
7261
7283
  }
7262
- return { handled: true, toolCallCountSincePrompt };
7284
+ return {
7285
+ handled: true,
7286
+ toolCallCountSincePrompt,
7287
+ hadVisibleProgress: outputChunk !== null
7288
+ };
7289
+ }
7290
+ function extractSupplementalToolProgress(update) {
7291
+ const terminalOutput = extractTerminalOutputMeta(update);
7292
+ if (!terminalOutput) {
7293
+ return null;
7294
+ }
7295
+ return {
7296
+ toolCallId: terminalOutput.toolCallId,
7297
+ outputChunk: terminalOutput.data
7298
+ };
7263
7299
  }
7264
7300
  function handleToolCall(update, ctx) {
7265
7301
  const toolCallId = update.toolCallId;
@@ -7328,7 +7364,7 @@ function buildAcpSpawnSpec(params) {
7328
7364
  }
7329
7365
 
7330
7366
  const MAX_DROPPED_LINE_PREVIEW_CHARS = 4096;
7331
- const DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES = 128 * 1024;
7367
+ const DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES = 32 * 1024;
7332
7368
  function formatDroppedLinePreview(line) {
7333
7369
  if (line.length <= MAX_DROPPED_LINE_PREVIEW_CHARS) {
7334
7370
  return line;
@@ -7585,6 +7621,8 @@ const RETRY_CONFIG = {
7585
7621
  };
7586
7622
  const DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS = 2 * 6e4;
7587
7623
  const MAX_DROPPED_STDOUT_LINE_SAMPLES = 5;
7624
+ const HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV = "HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES";
7625
+ const HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV = "HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES";
7588
7626
  function readPositiveIntegerEnv(name) {
7589
7627
  const raw = typeof process.env[name] === "string" ? process.env[name].trim() : "";
7590
7628
  if (!raw) {
@@ -7607,6 +7645,25 @@ function resolvePostPromptNoUpdatesTimeoutMs(transport) {
7607
7645
  }
7608
7646
  return DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS;
7609
7647
  }
7648
+ function resolveAcpMaxMultilineStdoutBytes() {
7649
+ const envValue = readPositiveIntegerEnv(HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV) ?? readPositiveIntegerEnv(HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV);
7650
+ return envValue ?? DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES;
7651
+ }
7652
+ function formatAcpStdoutByteLimit(bytes) {
7653
+ if (bytes >= 1024 * 1024) {
7654
+ const value = bytes / (1024 * 1024);
7655
+ return `${Number.isInteger(value) ? value : value.toFixed(1)} MiB`;
7656
+ }
7657
+ if (bytes >= 1024) {
7658
+ const value = bytes / 1024;
7659
+ return `${Number.isInteger(value) ? value : value.toFixed(1)} KiB`;
7660
+ }
7661
+ return `${bytes} bytes`;
7662
+ }
7663
+ function buildMultilineOverflowStatusDetail(maxBytes) {
7664
+ const formattedLimit = formatAcpStdoutByteLimit(maxBytes);
7665
+ return `Suppressed oversized agent output (>${formattedLimit} / ${maxBytes} bytes per ACP stdout record). Full output stays hidden by default. If you need larger payloads, set ${HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV}.`;
7666
+ }
7610
7667
  function getSessionUpdates(params) {
7611
7668
  const notification = params;
7612
7669
  const updates = Array.isArray(notification.updates) ? notification.updates.filter((update) => Boolean(update && typeof update === "object")) : [];
@@ -7621,14 +7678,14 @@ function getSessionUpdates(params) {
7621
7678
  function asNonNegativeFiniteNumber(value) {
7622
7679
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
7623
7680
  }
7624
- function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive) {
7681
+ function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive, hadVisibleProgress = false) {
7625
7682
  if (!wasToolCallActive && isToolCallActive) {
7626
7683
  return true;
7627
7684
  }
7628
7685
  if (update.status === "completed" || update.status === "failed" || update.status === "cancelled") {
7629
7686
  return true;
7630
7687
  }
7631
- return hasVisibleToolCallProgress(update.content);
7688
+ return hadVisibleProgress || hasVisibleToolCallProgress(update.content);
7632
7689
  }
7633
7690
  function extractUsageTokens(record) {
7634
7691
  const used = asNonNegativeFiniteNumber(record.used);
@@ -7863,32 +7920,37 @@ function enrichAcpError(error, stderrExcerpt) {
7863
7920
  return normalized;
7864
7921
  }
7865
7922
  class AcpProcessStartupError extends Error {
7866
- constructor(message, exitCode, signal) {
7923
+ constructor(message, exitCode, signal, stderr) {
7867
7924
  super(message);
7868
7925
  this.exitCode = exitCode;
7869
7926
  this.signal = signal;
7927
+ this.stderr = stderr;
7870
7928
  this.name = "AcpProcessStartupError";
7871
7929
  }
7872
7930
  }
7873
- function createProcessStartupError(agentName, operationName, code, signal) {
7931
+ function createProcessStartupError(agentName, operationName, code, signal, stderrExcerpt) {
7932
+ const normalizedStderrExcerpt = stderrExcerpt?.trim() || void 0;
7874
7933
  if (code !== null) {
7875
7934
  return new AcpProcessStartupError(
7876
7935
  `${agentName} exited with code ${code} during ${operationName}`,
7877
7936
  code,
7878
- signal
7937
+ signal,
7938
+ normalizedStderrExcerpt
7879
7939
  );
7880
7940
  }
7881
7941
  if (signal) {
7882
7942
  return new AcpProcessStartupError(
7883
7943
  `${agentName} exited due to signal ${signal} during ${operationName}`,
7884
7944
  code,
7885
- signal
7945
+ signal,
7946
+ normalizedStderrExcerpt
7886
7947
  );
7887
7948
  }
7888
7949
  return new AcpProcessStartupError(
7889
7950
  `${agentName} exited unexpectedly during ${operationName}`,
7890
7951
  code,
7891
- signal
7952
+ signal,
7953
+ normalizedStderrExcerpt
7892
7954
  );
7893
7955
  }
7894
7956
  async function raceWithProcessExit(childProcess, operation, options) {
@@ -7897,7 +7959,8 @@ async function raceWithProcessExit(childProcess, operation, options) {
7897
7959
  options.agentName,
7898
7960
  options.operationName,
7899
7961
  childProcess.exitCode,
7900
- childProcess.signalCode ?? null
7962
+ childProcess.signalCode ?? null,
7963
+ options.getStderrExcerpt?.()
7901
7964
  );
7902
7965
  }
7903
7966
  return await new Promise((resolve, reject) => {
@@ -7926,7 +7989,15 @@ async function raceWithProcessExit(childProcess, operation, options) {
7926
7989
  settleReject(error);
7927
7990
  };
7928
7991
  const handleExit = (code, signal) => {
7929
- settleReject(createProcessStartupError(options.agentName, options.operationName, code, signal));
7992
+ settleReject(
7993
+ createProcessStartupError(
7994
+ options.agentName,
7995
+ options.operationName,
7996
+ code,
7997
+ signal,
7998
+ options.getStderrExcerpt?.()
7999
+ )
8000
+ );
7930
8001
  };
7931
8002
  childProcess.once("error", handleError);
7932
8003
  childProcess.once("exit", handleExit);
@@ -7941,6 +8012,7 @@ class AcpBackend {
7941
8012
  agentName: options.agentName,
7942
8013
  env: options.env
7943
8014
  });
8015
+ this.acpMaxMultilineStdoutBytes = resolveAcpMaxMultilineStdoutBytes();
7944
8016
  }
7945
8017
  listeners = [];
7946
8018
  process = null;
@@ -7991,6 +8063,8 @@ class AcpBackend {
7991
8063
  sessionConfigOptions = null;
7992
8064
  /** Keep a short rolling stderr buffer so startup failures can surface the real cause. */
7993
8065
  recentStderrLines = [];
8066
+ acpMaxMultilineStdoutBytes;
8067
+ oversizedStdoutNoticeEmittedForCurrentTurn = false;
7994
8068
  resourceCleanupDone = false;
7995
8069
  recordRecentStderr(text) {
7996
8070
  const normalized = text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
@@ -8005,6 +8079,15 @@ class AcpBackend {
8005
8079
  getRecentStderrExcerpt() {
8006
8080
  return this.recentStderrLines.slice(-6).join("\n");
8007
8081
  }
8082
+ getRecentStderrSummaryLine() {
8083
+ for (const line of this.recentStderrLines.slice(-6).reverse()) {
8084
+ if (/^note:\s+run with\b/i.test(line)) {
8085
+ continue;
8086
+ }
8087
+ return line;
8088
+ }
8089
+ return this.recentStderrLines.at(-1);
8090
+ }
8008
8091
  async cleanupOwnedResources() {
8009
8092
  if (this.resourceCleanupDone) {
8010
8093
  return;
@@ -8163,6 +8246,31 @@ class AcpBackend {
8163
8246
  this.toolCallTimeoutSpecs.delete(toolCallId);
8164
8247
  return hadTimeout;
8165
8248
  }
8249
+ finalizeDanglingToolCallsAfterTaskComplete() {
8250
+ if (this.activeToolCalls.size === 0) {
8251
+ return;
8252
+ }
8253
+ const danglingToolCallIds = Array.from(this.activeToolCalls);
8254
+ persistence.logger.debug(
8255
+ `[AcpBackend] task_complete arrived with ${danglingToolCallIds.length} active tool call(s); synthesizing completion from buffered output`,
8256
+ danglingToolCallIds
8257
+ );
8258
+ for (const toolCallId of danglingToolCallIds) {
8259
+ const toolName = this.toolCallIdToNameMap.get(toolCallId) || "unknown";
8260
+ const streamedOutput = renderToolOutput(this.toolCallOutputs.get(toolCallId));
8261
+ this.activeToolCalls.delete(toolCallId);
8262
+ this.toolCallStartTimes.delete(toolCallId);
8263
+ this.toolCallIdToNameMap.delete(toolCallId);
8264
+ this.toolCallOutputs.delete(toolCallId);
8265
+ this.clearToolCallTimeout(toolCallId);
8266
+ this.emit({
8267
+ type: "tool-result",
8268
+ toolName,
8269
+ result: streamedOutput,
8270
+ callId: toolCallId
8271
+ });
8272
+ }
8273
+ }
8166
8274
  refreshActiveToolCallTimeouts() {
8167
8275
  for (const toolCallId of this.activeToolCalls) {
8168
8276
  if (this.toolCallTimeoutSpecs.has(toolCallId)) {
@@ -8195,6 +8303,7 @@ class AcpBackend {
8195
8303
  this.responseCompletionOutcome = null;
8196
8304
  this.responseCompletionError = null;
8197
8305
  this.sawSessionUpdateSincePrompt = false;
8306
+ this.oversizedStdoutNoticeEmittedForCurrentTurn = false;
8198
8307
  this.resetResponseWaitTracking();
8199
8308
  this.clearIdleTimeoutState();
8200
8309
  this.clearPostPromptCompletionIdleTimeout();
@@ -8252,6 +8361,18 @@ class AcpBackend {
8252
8361
  }
8253
8362
  }
8254
8363
  handleDroppedStdoutLine(entry) {
8364
+ if (entry.reason === "multiline_overflow") {
8365
+ if (!this.waitingForResponse || this.responseCompletionError || this.oversizedStdoutNoticeEmittedForCurrentTurn) {
8366
+ return;
8367
+ }
8368
+ this.oversizedStdoutNoticeEmittedForCurrentTurn = true;
8369
+ this.emit({
8370
+ type: "status",
8371
+ status: "running",
8372
+ detail: buildMultilineOverflowStatusDetail(this.acpMaxMultilineStdoutBytes)
8373
+ });
8374
+ return;
8375
+ }
8255
8376
  if (entry.reason !== "transport_filter_null" || !this.waitingForResponse || this.responseCompletionError) {
8256
8377
  return;
8257
8378
  }
@@ -8341,6 +8462,7 @@ class AcpBackend {
8341
8462
  `[AcpBackend] Process exited with code ${code}, signal ${signal}, disposed=${this.disposed}, waitingForResponse=${this.waitingForResponse}`
8342
8463
  );
8343
8464
  const recentStderrExcerpt = this.getRecentStderrExcerpt();
8465
+ const recentStderrSummaryLine = this.getRecentStderrSummaryLine();
8344
8466
  if (recentStderrExcerpt) {
8345
8467
  persistence.logger.debug(`[AcpBackend] Recent stderr before exit:
8346
8468
  ${recentStderrExcerpt}`);
@@ -8353,11 +8475,15 @@ ${recentStderrExcerpt}`);
8353
8475
  this.failPendingResponseWait(new Error(detail));
8354
8476
  }
8355
8477
  if (code !== 0 && code !== null) {
8356
- this.emit({ type: "status", status: "stopped", detail: `Exit code: ${code}` });
8478
+ const detail = recentStderrSummaryLine ? `Exit code: ${code}
8479
+ Recent stderr: ${recentStderrSummaryLine}` : `Exit code: ${code}`;
8480
+ this.emit({ type: "status", status: "stopped", detail });
8357
8481
  return;
8358
8482
  }
8359
8483
  if (signal) {
8360
- this.emit({ type: "status", status: "stopped", detail: `Signal: ${signal}` });
8484
+ const detail = recentStderrSummaryLine ? `Signal: ${signal}
8485
+ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
8486
+ this.emit({ type: "status", status: "stopped", detail });
8361
8487
  }
8362
8488
  });
8363
8489
  const streams = nodeToWebStreams(
@@ -8384,7 +8510,8 @@ ${recentStderrExcerpt}`);
8384
8510
  droppedStdoutSummary.samples
8385
8511
  );
8386
8512
  }
8387
- }
8513
+ },
8514
+ maxMultilineBytes: this.acpMaxMultilineStdoutBytes
8388
8515
  });
8389
8516
  const stream = sdk.ndJsonStream(writable, filteredReadable);
8390
8517
  const client = {
@@ -8536,6 +8663,9 @@ ${recentStderrExcerpt}`);
8536
8663
  const initRequest = {
8537
8664
  protocolVersion: 1,
8538
8665
  clientCapabilities: {
8666
+ _meta: {
8667
+ terminal_output: true
8668
+ },
8539
8669
  fs: {
8540
8670
  readTextFile: false,
8541
8671
  writeTextFile: false
@@ -8575,7 +8705,8 @@ ${recentStderrExcerpt}`);
8575
8705
  ]),
8576
8706
  {
8577
8707
  agentName: this.transport.agentName,
8578
- operationName: "initialize"
8708
+ operationName: "initialize",
8709
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8579
8710
  }
8580
8711
  );
8581
8712
  return result;
@@ -8627,7 +8758,8 @@ ${recentStderrExcerpt}`);
8627
8758
  ]),
8628
8759
  {
8629
8760
  agentName: this.transport.agentName,
8630
- operationName: "new session"
8761
+ operationName: "new session",
8762
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8631
8763
  }
8632
8764
  );
8633
8765
  return result;
@@ -8750,6 +8882,7 @@ ${recentStderrExcerpt}`);
8750
8882
  const ctx = this.createHandlerContext();
8751
8883
  const toolCallId = update.toolCallId;
8752
8884
  const wasToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
8885
+ const supplementalToolProgress = extractSupplementalToolProgress(update);
8753
8886
  if (sessionUpdateType === "agent_message_chunk") {
8754
8887
  if (handleAgentMessageChunk(update, ctx).handled) {
8755
8888
  this.markResponseProgress();
@@ -8757,12 +8890,19 @@ ${recentStderrExcerpt}`);
8757
8890
  continue;
8758
8891
  }
8759
8892
  if (sessionUpdateType === "tool_call_update") {
8760
- const result = handleToolCallUpdate(update, ctx);
8893
+ const result = handleToolCallUpdate(update, ctx, {
8894
+ supplementalOutputChunk: supplementalToolProgress && supplementalToolProgress.toolCallId === toolCallId ? supplementalToolProgress.outputChunk : null
8895
+ });
8761
8896
  if (result.toolCallCountSincePrompt !== void 0) {
8762
8897
  this.toolCallCountSincePrompt = result.toolCallCountSincePrompt;
8763
8898
  }
8764
8899
  const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
8765
- if (shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive)) {
8900
+ if (shouldRefreshProgressForToolCallUpdate(
8901
+ update,
8902
+ wasToolCallActive,
8903
+ isToolCallActive,
8904
+ result.hadVisibleProgress
8905
+ )) {
8766
8906
  this.markResponseProgress();
8767
8907
  }
8768
8908
  continue;
@@ -8793,6 +8933,7 @@ ${recentStderrExcerpt}`);
8793
8933
  }
8794
8934
  if (sessionUpdateType === "task_complete") {
8795
8935
  this.emitUsageTelemetry(update.usage, "acp-session-usage");
8936
+ this.finalizeDanglingToolCallsAfterTaskComplete();
8796
8937
  ctx.clearIdleTimeout();
8797
8938
  persistence.logger.debug("[AcpBackend] task_complete received, emitting idle status");
8798
8939
  this.emitIdleStatus();
@@ -8849,7 +8990,8 @@ ${recentStderrExcerpt}`);
8849
8990
  this.connection.prompt(promptRequest),
8850
8991
  {
8851
8992
  agentName: this.transport.agentName,
8852
- operationName: "prompt"
8993
+ operationName: "prompt",
8994
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8853
8995
  }
8854
8996
  );
8855
8997
  persistence.logger.debug("[AcpBackend] Prompt request sent to ACP connection");
@@ -9920,7 +10062,7 @@ class AbortError extends Error {
9920
10062
  }
9921
10063
  }
9922
10064
 
9923
- 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-CDyeCS7U.cjs', document.baseURI).href)));
10065
+ 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-BLeiCte-.cjs', document.baseURI).href)));
9924
10066
  const __dirname$1 = path.join(__filename$1, "..");
9925
10067
  function getGlobalClaudeVersion() {
9926
10068
  try {
@@ -11243,14 +11385,14 @@ var launch = /*#__PURE__*/Object.freeze({
11243
11385
  const unifiedProviderExecutors = {
11244
11386
  claude: async (opts) => {
11245
11387
  const claudeOptions = opts.claudeOptions ?? {};
11246
- const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-D_YCDVmM.cjs'); });
11388
+ const { runClaude } = await Promise.resolve().then(function () { return require('./runClaude-U9sxsnU-.cjs'); });
11247
11389
  await runClaude(opts.credentials, {
11248
11390
  ...claudeOptions,
11249
11391
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
11250
11392
  });
11251
11393
  },
11252
11394
  codex: async (opts) => {
11253
- const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-jisfibyM.cjs'); });
11395
+ const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Beikmv-L.cjs'); });
11254
11396
  await runCodex({
11255
11397
  credentials: opts.credentials,
11256
11398
  startedBy: opts.startedBy,
@@ -11259,7 +11401,7 @@ const unifiedProviderExecutors = {
11259
11401
  });
11260
11402
  },
11261
11403
  gemini: async (opts) => {
11262
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BtBrzhkF.cjs'); });
11404
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BTyqf5MR.cjs'); });
11263
11405
  await runGemini({
11264
11406
  credentials: opts.credentials,
11265
11407
  startedBy: opts.startedBy
@@ -11342,7 +11484,7 @@ function shouldRunMainClaudeFlow(opts) {
11342
11484
  return;
11343
11485
  } else if (subcommand === "runtime") {
11344
11486
  if (args[1] === "providers") {
11345
- const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-ErrXrwTw.cjs'); });
11487
+ const { renderRuntimeProviders } = await Promise.resolve().then(function () { return require('./command-Cb9nikZh.cjs'); });
11346
11488
  console.log(renderRuntimeProviders());
11347
11489
  return;
11348
11490
  }
@@ -11548,8 +11690,8 @@ function shouldRunMainClaudeFlow(opts) {
11548
11690
  const projectId = args[3];
11549
11691
  try {
11550
11692
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11551
- const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-ChV_1TP7.cjs'); }).then(function (n) { return n.persistence; });
11552
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-ChV_1TP7.cjs'); }).then(function (n) { return n.api; });
11693
+ const { readCredentials: readCredentials2 } = await Promise.resolve().then(function () { return require('./api-DK1gyZAZ.cjs'); }).then(function (n) { return n.persistence; });
11694
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./api-DK1gyZAZ.cjs'); }).then(function (n) { return n.api; });
11553
11695
  let userEmail = void 0;
11554
11696
  try {
11555
11697
  const credentials = await readCredentials2();