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,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, k as encodeBase64, c as configuration, m as readCredentials, n as ensureSigningCredentials, r as readSettings, u as updateSettings, o as encodeBase64Url, h as delay, q as buildClientHeaders, t as decodeBase64, w as writeCredentialsLegacy, v as writeCredentialsDataKey, x as readDaemonState, y as HAPPY_CLOUD_DAEMON_PORT, z as clearDaemonState, B as packageJson, i as isAuthenticationRequiredError, C as acquireDaemonLock, D as writeDaemonState, A as ApiClient, E as releaseDaemonLock, F as validateProfileForAgent, G as getProfileEnvironmentVariables, I as clearCredentials, J as clearMachineId, K as processHappyOrgRepoRequests, L as HappyOrgTurnReportSchema, M as recordHappyOrgTurnReport, N as MessageContentSchema, O as buildSocketAuth, P as encrypt, H as HeadTailPreviewBuffer, Q as getLatestDaemonLog } from './api-DYS9sGJr.mjs';
2
+ import { l as logger, k as encodeBase64, c as configuration, m as readCredentials, n as ensureSigningCredentials, r as readSettings, u as updateSettings, o as encodeBase64Url, h as delay, q as buildClientHeaders, t as decodeBase64, w as writeCredentialsLegacy, v as writeCredentialsDataKey, x as readDaemonState, y as HAPPY_CLOUD_DAEMON_PORT, z as clearDaemonState, B as packageJson, i as isAuthenticationRequiredError, C as acquireDaemonLock, D as writeDaemonState, A as ApiClient, E as releaseDaemonLock, F as validateProfileForAgent, G as getProfileEnvironmentVariables, I as clearCredentials, J as clearMachineId, K as processHappyOrgRepoRequests, L as HappyOrgTurnReportSchema, M as recordHappyOrgTurnReport, N as MessageContentSchema, O as buildSocketAuth, P as encrypt, H as HeadTailPreviewBuffer, Q as getLatestDaemonLog } from './api-C68U-kRs.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';
@@ -4973,6 +4973,8 @@ function formatDispatchReceipt(receipt) {
4973
4973
  `organization_id=${receipt.organizationId}`,
4974
4974
  `dispatch_id=${receipt.notice.dispatch_id}`,
4975
4975
  `task_id=${receipt.notice.task_id}`,
4976
+ `position_id=${receipt.notice.position_id ?? ""}`,
4977
+ `responsibility_id=${receipt.notice.responsibility_id ?? ""}`,
4976
4978
  `scope=${receipt.notice.scope}`,
4977
4979
  `member_agent_id=${receipt.member?.agentId ?? receipt.business_ack?.memberAgentId ?? ""}`,
4978
4980
  `member_label=${receipt.member?.label ?? ""}`,
@@ -5002,7 +5004,7 @@ ${chalk.bold("hicloud happy-org")} - Thin CLI sender for Happy Org dispatch/rece
5002
5004
 
5003
5005
  ${chalk.bold("Usage:")}
5004
5006
  hicloud happy-org agents [--organization-id <id>] [--json]
5005
- 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]
5007
+ 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]
5006
5008
  hicloud happy-org dispatch receipt <dispatch-id> [--organization-id <id>] [--json]
5007
5009
  hicloud happy-org repo process --root <path> [--request-id <id>] [--json]
5008
5010
  hicloud happy-org repo turn-report --root <path> --report-json <json> [--json]
@@ -5076,6 +5078,8 @@ async function handleDispatchSendCommand(parsed, deps) {
5076
5078
  const scope = readSingleValue(parsed, "scope");
5077
5079
  const allowedPaths = readPathList(parsed, { singular: "allowed-path", plural: "allowed-paths" });
5078
5080
  const forbiddenPaths = readPathList(parsed, { singular: "forbidden-path", plural: "forbidden-paths" });
5081
+ const positionId = readSingleValue(parsed, "position-id");
5082
+ const responsibilityId = readSingleValue(parsed, "responsibility-id");
5079
5083
  const note = readSingleValue(parsed, "note");
5080
5084
  const waitSeconds = readWaitSeconds(parsed);
5081
5085
  if (!taskId) {
@@ -5101,6 +5105,8 @@ async function handleDispatchSendCommand(parsed, deps) {
5101
5105
  scope,
5102
5106
  allowedPaths,
5103
5107
  forbiddenPaths,
5108
+ positionId,
5109
+ responsibilityId,
5104
5110
  note
5105
5111
  });
5106
5112
  receipt = await waitForDispatchAck(api, {
@@ -6876,6 +6882,22 @@ function renderToolOutput(accumulator) {
6876
6882
  }
6877
6883
  return accumulator.preview.render("tool output");
6878
6884
  }
6885
+ function extractTerminalOutputMeta(update) {
6886
+ if (!isRecord$1(update._meta)) {
6887
+ return null;
6888
+ }
6889
+ const terminalOutput = update._meta.terminal_output;
6890
+ if (!isRecord$1(terminalOutput)) {
6891
+ return null;
6892
+ }
6893
+ const data = typeof terminalOutput.data === "string" && terminalOutput.data.length > 0 ? terminalOutput.data : null;
6894
+ if (!data) {
6895
+ return null;
6896
+ }
6897
+ const terminalId = typeof terminalOutput.terminal_id === "string" && terminalOutput.terminal_id.length > 0 ? terminalOutput.terminal_id : null;
6898
+ const toolCallId = typeof update.toolCallId === "string" && update.toolCallId.length > 0 ? update.toolCallId : terminalId;
6899
+ return toolCallId ? { toolCallId, data } : null;
6900
+ }
6879
6901
  function formatToolCallTimeoutLimit(timeoutMs) {
6880
6902
  if (timeoutMs < 1e3) {
6881
6903
  return `${timeoutMs}ms`;
@@ -7211,7 +7233,7 @@ function failToolCall(toolCallId, status, toolKind, content, ctx) {
7211
7233
  ctx.emitIdleStatus();
7212
7234
  }
7213
7235
  }
7214
- function handleToolCallUpdate(update, ctx) {
7236
+ function handleToolCallUpdate(update, ctx, options) {
7215
7237
  const status = update.status;
7216
7238
  const toolCallId = update.toolCallId;
7217
7239
  if (!toolCallId) {
@@ -7220,7 +7242,7 @@ function handleToolCallUpdate(update, ctx) {
7220
7242
  }
7221
7243
  const toolKind = update.kind || ctx.toolCallIdToNameMap.get(toolCallId) || "unknown";
7222
7244
  let toolCallCountSincePrompt = ctx.toolCallCountSincePrompt;
7223
- const outputChunk = extractToolOutputChunk(update.content);
7245
+ const outputChunk = extractToolOutputChunk(update.content) ?? options?.supplementalOutputChunk ?? null;
7224
7246
  if (outputChunk) {
7225
7247
  const nextOutput = appendToolOutput(ctx.toolCallOutputs.get(toolCallId), outputChunk);
7226
7248
  ctx.toolCallOutputs.set(toolCallId, nextOutput);
@@ -7237,7 +7259,21 @@ function handleToolCallUpdate(update, ctx) {
7237
7259
  } else if (status === "failed" || status === "cancelled") {
7238
7260
  failToolCall(toolCallId, status, toolKind, update.content, ctx);
7239
7261
  }
7240
- return { handled: true, toolCallCountSincePrompt };
7262
+ return {
7263
+ handled: true,
7264
+ toolCallCountSincePrompt,
7265
+ hadVisibleProgress: outputChunk !== null
7266
+ };
7267
+ }
7268
+ function extractSupplementalToolProgress(update) {
7269
+ const terminalOutput = extractTerminalOutputMeta(update);
7270
+ if (!terminalOutput) {
7271
+ return null;
7272
+ }
7273
+ return {
7274
+ toolCallId: terminalOutput.toolCallId,
7275
+ outputChunk: terminalOutput.data
7276
+ };
7241
7277
  }
7242
7278
  function handleToolCall(update, ctx) {
7243
7279
  const toolCallId = update.toolCallId;
@@ -7306,7 +7342,7 @@ function buildAcpSpawnSpec(params) {
7306
7342
  }
7307
7343
 
7308
7344
  const MAX_DROPPED_LINE_PREVIEW_CHARS = 4096;
7309
- const DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES = 128 * 1024;
7345
+ const DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES = 32 * 1024;
7310
7346
  function formatDroppedLinePreview(line) {
7311
7347
  if (line.length <= MAX_DROPPED_LINE_PREVIEW_CHARS) {
7312
7348
  return line;
@@ -7563,6 +7599,8 @@ const RETRY_CONFIG = {
7563
7599
  };
7564
7600
  const DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS = 2 * 6e4;
7565
7601
  const MAX_DROPPED_STDOUT_LINE_SAMPLES = 5;
7602
+ const HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV = "HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES";
7603
+ const HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV = "HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES";
7566
7604
  function readPositiveIntegerEnv(name) {
7567
7605
  const raw = typeof process.env[name] === "string" ? process.env[name].trim() : "";
7568
7606
  if (!raw) {
@@ -7585,6 +7623,25 @@ function resolvePostPromptNoUpdatesTimeoutMs(transport) {
7585
7623
  }
7586
7624
  return DEFAULT_POST_PROMPT_NO_UPDATES_TIMEOUT_MS;
7587
7625
  }
7626
+ function resolveAcpMaxMultilineStdoutBytes() {
7627
+ const envValue = readPositiveIntegerEnv(HAPPY_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV) ?? readPositiveIntegerEnv(HAPPIER_ACP_MAX_MULTILINE_STDOUT_BYTES_ENV);
7628
+ return envValue ?? DEFAULT_ACP_MAX_MULTILINE_STDOUT_BYTES;
7629
+ }
7630
+ function formatAcpStdoutByteLimit(bytes) {
7631
+ if (bytes >= 1024 * 1024) {
7632
+ const value = bytes / (1024 * 1024);
7633
+ return `${Number.isInteger(value) ? value : value.toFixed(1)} MiB`;
7634
+ }
7635
+ if (bytes >= 1024) {
7636
+ const value = bytes / 1024;
7637
+ return `${Number.isInteger(value) ? value : value.toFixed(1)} KiB`;
7638
+ }
7639
+ return `${bytes} bytes`;
7640
+ }
7641
+ function buildMultilineOverflowStatusDetail(maxBytes) {
7642
+ const formattedLimit = formatAcpStdoutByteLimit(maxBytes);
7643
+ 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}.`;
7644
+ }
7588
7645
  function getSessionUpdates(params) {
7589
7646
  const notification = params;
7590
7647
  const updates = Array.isArray(notification.updates) ? notification.updates.filter((update) => Boolean(update && typeof update === "object")) : [];
@@ -7599,14 +7656,14 @@ function getSessionUpdates(params) {
7599
7656
  function asNonNegativeFiniteNumber(value) {
7600
7657
  return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : null;
7601
7658
  }
7602
- function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive) {
7659
+ function shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive, hadVisibleProgress = false) {
7603
7660
  if (!wasToolCallActive && isToolCallActive) {
7604
7661
  return true;
7605
7662
  }
7606
7663
  if (update.status === "completed" || update.status === "failed" || update.status === "cancelled") {
7607
7664
  return true;
7608
7665
  }
7609
- return hasVisibleToolCallProgress(update.content);
7666
+ return hadVisibleProgress || hasVisibleToolCallProgress(update.content);
7610
7667
  }
7611
7668
  function extractUsageTokens(record) {
7612
7669
  const used = asNonNegativeFiniteNumber(record.used);
@@ -7841,32 +7898,37 @@ function enrichAcpError(error, stderrExcerpt) {
7841
7898
  return normalized;
7842
7899
  }
7843
7900
  class AcpProcessStartupError extends Error {
7844
- constructor(message, exitCode, signal) {
7901
+ constructor(message, exitCode, signal, stderr) {
7845
7902
  super(message);
7846
7903
  this.exitCode = exitCode;
7847
7904
  this.signal = signal;
7905
+ this.stderr = stderr;
7848
7906
  this.name = "AcpProcessStartupError";
7849
7907
  }
7850
7908
  }
7851
- function createProcessStartupError(agentName, operationName, code, signal) {
7909
+ function createProcessStartupError(agentName, operationName, code, signal, stderrExcerpt) {
7910
+ const normalizedStderrExcerpt = stderrExcerpt?.trim() || void 0;
7852
7911
  if (code !== null) {
7853
7912
  return new AcpProcessStartupError(
7854
7913
  `${agentName} exited with code ${code} during ${operationName}`,
7855
7914
  code,
7856
- signal
7915
+ signal,
7916
+ normalizedStderrExcerpt
7857
7917
  );
7858
7918
  }
7859
7919
  if (signal) {
7860
7920
  return new AcpProcessStartupError(
7861
7921
  `${agentName} exited due to signal ${signal} during ${operationName}`,
7862
7922
  code,
7863
- signal
7923
+ signal,
7924
+ normalizedStderrExcerpt
7864
7925
  );
7865
7926
  }
7866
7927
  return new AcpProcessStartupError(
7867
7928
  `${agentName} exited unexpectedly during ${operationName}`,
7868
7929
  code,
7869
- signal
7930
+ signal,
7931
+ normalizedStderrExcerpt
7870
7932
  );
7871
7933
  }
7872
7934
  async function raceWithProcessExit(childProcess, operation, options) {
@@ -7875,7 +7937,8 @@ async function raceWithProcessExit(childProcess, operation, options) {
7875
7937
  options.agentName,
7876
7938
  options.operationName,
7877
7939
  childProcess.exitCode,
7878
- childProcess.signalCode ?? null
7940
+ childProcess.signalCode ?? null,
7941
+ options.getStderrExcerpt?.()
7879
7942
  );
7880
7943
  }
7881
7944
  return await new Promise((resolve, reject) => {
@@ -7904,7 +7967,15 @@ async function raceWithProcessExit(childProcess, operation, options) {
7904
7967
  settleReject(error);
7905
7968
  };
7906
7969
  const handleExit = (code, signal) => {
7907
- settleReject(createProcessStartupError(options.agentName, options.operationName, code, signal));
7970
+ settleReject(
7971
+ createProcessStartupError(
7972
+ options.agentName,
7973
+ options.operationName,
7974
+ code,
7975
+ signal,
7976
+ options.getStderrExcerpt?.()
7977
+ )
7978
+ );
7908
7979
  };
7909
7980
  childProcess.once("error", handleError);
7910
7981
  childProcess.once("exit", handleExit);
@@ -7919,6 +7990,7 @@ class AcpBackend {
7919
7990
  agentName: options.agentName,
7920
7991
  env: options.env
7921
7992
  });
7993
+ this.acpMaxMultilineStdoutBytes = resolveAcpMaxMultilineStdoutBytes();
7922
7994
  }
7923
7995
  listeners = [];
7924
7996
  process = null;
@@ -7969,6 +8041,8 @@ class AcpBackend {
7969
8041
  sessionConfigOptions = null;
7970
8042
  /** Keep a short rolling stderr buffer so startup failures can surface the real cause. */
7971
8043
  recentStderrLines = [];
8044
+ acpMaxMultilineStdoutBytes;
8045
+ oversizedStdoutNoticeEmittedForCurrentTurn = false;
7972
8046
  resourceCleanupDone = false;
7973
8047
  recordRecentStderr(text) {
7974
8048
  const normalized = text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
@@ -7983,6 +8057,15 @@ class AcpBackend {
7983
8057
  getRecentStderrExcerpt() {
7984
8058
  return this.recentStderrLines.slice(-6).join("\n");
7985
8059
  }
8060
+ getRecentStderrSummaryLine() {
8061
+ for (const line of this.recentStderrLines.slice(-6).reverse()) {
8062
+ if (/^note:\s+run with\b/i.test(line)) {
8063
+ continue;
8064
+ }
8065
+ return line;
8066
+ }
8067
+ return this.recentStderrLines.at(-1);
8068
+ }
7986
8069
  async cleanupOwnedResources() {
7987
8070
  if (this.resourceCleanupDone) {
7988
8071
  return;
@@ -8141,6 +8224,31 @@ class AcpBackend {
8141
8224
  this.toolCallTimeoutSpecs.delete(toolCallId);
8142
8225
  return hadTimeout;
8143
8226
  }
8227
+ finalizeDanglingToolCallsAfterTaskComplete() {
8228
+ if (this.activeToolCalls.size === 0) {
8229
+ return;
8230
+ }
8231
+ const danglingToolCallIds = Array.from(this.activeToolCalls);
8232
+ logger.debug(
8233
+ `[AcpBackend] task_complete arrived with ${danglingToolCallIds.length} active tool call(s); synthesizing completion from buffered output`,
8234
+ danglingToolCallIds
8235
+ );
8236
+ for (const toolCallId of danglingToolCallIds) {
8237
+ const toolName = this.toolCallIdToNameMap.get(toolCallId) || "unknown";
8238
+ const streamedOutput = renderToolOutput(this.toolCallOutputs.get(toolCallId));
8239
+ this.activeToolCalls.delete(toolCallId);
8240
+ this.toolCallStartTimes.delete(toolCallId);
8241
+ this.toolCallIdToNameMap.delete(toolCallId);
8242
+ this.toolCallOutputs.delete(toolCallId);
8243
+ this.clearToolCallTimeout(toolCallId);
8244
+ this.emit({
8245
+ type: "tool-result",
8246
+ toolName,
8247
+ result: streamedOutput,
8248
+ callId: toolCallId
8249
+ });
8250
+ }
8251
+ }
8144
8252
  refreshActiveToolCallTimeouts() {
8145
8253
  for (const toolCallId of this.activeToolCalls) {
8146
8254
  if (this.toolCallTimeoutSpecs.has(toolCallId)) {
@@ -8173,6 +8281,7 @@ class AcpBackend {
8173
8281
  this.responseCompletionOutcome = null;
8174
8282
  this.responseCompletionError = null;
8175
8283
  this.sawSessionUpdateSincePrompt = false;
8284
+ this.oversizedStdoutNoticeEmittedForCurrentTurn = false;
8176
8285
  this.resetResponseWaitTracking();
8177
8286
  this.clearIdleTimeoutState();
8178
8287
  this.clearPostPromptCompletionIdleTimeout();
@@ -8230,6 +8339,18 @@ class AcpBackend {
8230
8339
  }
8231
8340
  }
8232
8341
  handleDroppedStdoutLine(entry) {
8342
+ if (entry.reason === "multiline_overflow") {
8343
+ if (!this.waitingForResponse || this.responseCompletionError || this.oversizedStdoutNoticeEmittedForCurrentTurn) {
8344
+ return;
8345
+ }
8346
+ this.oversizedStdoutNoticeEmittedForCurrentTurn = true;
8347
+ this.emit({
8348
+ type: "status",
8349
+ status: "running",
8350
+ detail: buildMultilineOverflowStatusDetail(this.acpMaxMultilineStdoutBytes)
8351
+ });
8352
+ return;
8353
+ }
8233
8354
  if (entry.reason !== "transport_filter_null" || !this.waitingForResponse || this.responseCompletionError) {
8234
8355
  return;
8235
8356
  }
@@ -8319,6 +8440,7 @@ class AcpBackend {
8319
8440
  `[AcpBackend] Process exited with code ${code}, signal ${signal}, disposed=${this.disposed}, waitingForResponse=${this.waitingForResponse}`
8320
8441
  );
8321
8442
  const recentStderrExcerpt = this.getRecentStderrExcerpt();
8443
+ const recentStderrSummaryLine = this.getRecentStderrSummaryLine();
8322
8444
  if (recentStderrExcerpt) {
8323
8445
  logger.debug(`[AcpBackend] Recent stderr before exit:
8324
8446
  ${recentStderrExcerpt}`);
@@ -8331,11 +8453,15 @@ ${recentStderrExcerpt}`);
8331
8453
  this.failPendingResponseWait(new Error(detail));
8332
8454
  }
8333
8455
  if (code !== 0 && code !== null) {
8334
- this.emit({ type: "status", status: "stopped", detail: `Exit code: ${code}` });
8456
+ const detail = recentStderrSummaryLine ? `Exit code: ${code}
8457
+ Recent stderr: ${recentStderrSummaryLine}` : `Exit code: ${code}`;
8458
+ this.emit({ type: "status", status: "stopped", detail });
8335
8459
  return;
8336
8460
  }
8337
8461
  if (signal) {
8338
- this.emit({ type: "status", status: "stopped", detail: `Signal: ${signal}` });
8462
+ const detail = recentStderrSummaryLine ? `Signal: ${signal}
8463
+ Recent stderr: ${recentStderrSummaryLine}` : `Signal: ${signal}`;
8464
+ this.emit({ type: "status", status: "stopped", detail });
8339
8465
  }
8340
8466
  });
8341
8467
  const streams = nodeToWebStreams(
@@ -8362,7 +8488,8 @@ ${recentStderrExcerpt}`);
8362
8488
  droppedStdoutSummary.samples
8363
8489
  );
8364
8490
  }
8365
- }
8491
+ },
8492
+ maxMultilineBytes: this.acpMaxMultilineStdoutBytes
8366
8493
  });
8367
8494
  const stream = ndJsonStream(writable, filteredReadable);
8368
8495
  const client = {
@@ -8514,6 +8641,9 @@ ${recentStderrExcerpt}`);
8514
8641
  const initRequest = {
8515
8642
  protocolVersion: 1,
8516
8643
  clientCapabilities: {
8644
+ _meta: {
8645
+ terminal_output: true
8646
+ },
8517
8647
  fs: {
8518
8648
  readTextFile: false,
8519
8649
  writeTextFile: false
@@ -8553,7 +8683,8 @@ ${recentStderrExcerpt}`);
8553
8683
  ]),
8554
8684
  {
8555
8685
  agentName: this.transport.agentName,
8556
- operationName: "initialize"
8686
+ operationName: "initialize",
8687
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8557
8688
  }
8558
8689
  );
8559
8690
  return result;
@@ -8605,7 +8736,8 @@ ${recentStderrExcerpt}`);
8605
8736
  ]),
8606
8737
  {
8607
8738
  agentName: this.transport.agentName,
8608
- operationName: "new session"
8739
+ operationName: "new session",
8740
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8609
8741
  }
8610
8742
  );
8611
8743
  return result;
@@ -8728,6 +8860,7 @@ ${recentStderrExcerpt}`);
8728
8860
  const ctx = this.createHandlerContext();
8729
8861
  const toolCallId = update.toolCallId;
8730
8862
  const wasToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
8863
+ const supplementalToolProgress = extractSupplementalToolProgress(update);
8731
8864
  if (sessionUpdateType === "agent_message_chunk") {
8732
8865
  if (handleAgentMessageChunk(update, ctx).handled) {
8733
8866
  this.markResponseProgress();
@@ -8735,12 +8868,19 @@ ${recentStderrExcerpt}`);
8735
8868
  continue;
8736
8869
  }
8737
8870
  if (sessionUpdateType === "tool_call_update") {
8738
- const result = handleToolCallUpdate(update, ctx);
8871
+ const result = handleToolCallUpdate(update, ctx, {
8872
+ supplementalOutputChunk: supplementalToolProgress && supplementalToolProgress.toolCallId === toolCallId ? supplementalToolProgress.outputChunk : null
8873
+ });
8739
8874
  if (result.toolCallCountSincePrompt !== void 0) {
8740
8875
  this.toolCallCountSincePrompt = result.toolCallCountSincePrompt;
8741
8876
  }
8742
8877
  const isToolCallActive = typeof toolCallId === "string" && this.activeToolCalls.has(toolCallId);
8743
- if (shouldRefreshProgressForToolCallUpdate(update, wasToolCallActive, isToolCallActive)) {
8878
+ if (shouldRefreshProgressForToolCallUpdate(
8879
+ update,
8880
+ wasToolCallActive,
8881
+ isToolCallActive,
8882
+ result.hadVisibleProgress
8883
+ )) {
8744
8884
  this.markResponseProgress();
8745
8885
  }
8746
8886
  continue;
@@ -8771,6 +8911,7 @@ ${recentStderrExcerpt}`);
8771
8911
  }
8772
8912
  if (sessionUpdateType === "task_complete") {
8773
8913
  this.emitUsageTelemetry(update.usage, "acp-session-usage");
8914
+ this.finalizeDanglingToolCallsAfterTaskComplete();
8774
8915
  ctx.clearIdleTimeout();
8775
8916
  logger.debug("[AcpBackend] task_complete received, emitting idle status");
8776
8917
  this.emitIdleStatus();
@@ -8827,7 +8968,8 @@ ${recentStderrExcerpt}`);
8827
8968
  this.connection.prompt(promptRequest),
8828
8969
  {
8829
8970
  agentName: this.transport.agentName,
8830
- operationName: "prompt"
8971
+ operationName: "prompt",
8972
+ getStderrExcerpt: () => this.getRecentStderrExcerpt()
8831
8973
  }
8832
8974
  );
8833
8975
  logger.debug("[AcpBackend] Prompt request sent to ACP connection");
@@ -11221,14 +11363,14 @@ var launch = /*#__PURE__*/Object.freeze({
11221
11363
  const unifiedProviderExecutors = {
11222
11364
  claude: async (opts) => {
11223
11365
  const claudeOptions = opts.claudeOptions ?? {};
11224
- const { runClaude } = await import('./runClaude-VlpAUO9C.mjs');
11366
+ const { runClaude } = await import('./runClaude-CkY6XYJa.mjs');
11225
11367
  await runClaude(opts.credentials, {
11226
11368
  ...claudeOptions,
11227
11369
  startingMode: claudeOptions.startingMode ?? (claudeOptions.startedBy === "daemon" ? "remote" : void 0)
11228
11370
  });
11229
11371
  },
11230
11372
  codex: async (opts) => {
11231
- const { runCodex } = await import('./runCodex-CL1yQHxl.mjs');
11373
+ const { runCodex } = await import('./runCodex-C6kV0jfX.mjs');
11232
11374
  await runCodex({
11233
11375
  credentials: opts.credentials,
11234
11376
  startedBy: opts.startedBy,
@@ -11237,7 +11379,7 @@ const unifiedProviderExecutors = {
11237
11379
  });
11238
11380
  },
11239
11381
  gemini: async (opts) => {
11240
- const { runGemini } = await import('./runGemini-EPv-yxY4.mjs');
11382
+ const { runGemini } = await import('./runGemini-IEzJdhc-.mjs');
11241
11383
  await runGemini({
11242
11384
  credentials: opts.credentials,
11243
11385
  startedBy: opts.startedBy
@@ -11320,7 +11462,7 @@ function shouldRunMainClaudeFlow(opts) {
11320
11462
  return;
11321
11463
  } else if (subcommand === "runtime") {
11322
11464
  if (args[1] === "providers") {
11323
- const { renderRuntimeProviders } = await import('./command-Bx9UY5D5.mjs');
11465
+ const { renderRuntimeProviders } = await import('./command-D32x08k9.mjs');
11324
11466
  console.log(renderRuntimeProviders());
11325
11467
  return;
11326
11468
  }
@@ -11526,8 +11668,8 @@ function shouldRunMainClaudeFlow(opts) {
11526
11668
  const projectId = args[3];
11527
11669
  try {
11528
11670
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
11529
- const { readCredentials: readCredentials2 } = await import('./api-DYS9sGJr.mjs').then(function (n) { return n.R; });
11530
- const { ApiClient: ApiClient2 } = await import('./api-DYS9sGJr.mjs').then(function (n) { return n.S; });
11671
+ const { readCredentials: readCredentials2 } = await import('./api-C68U-kRs.mjs').then(function (n) { return n.R; });
11672
+ const { ApiClient: ApiClient2 } = await import('./api-C68U-kRs.mjs').then(function (n) { return n.S; });
11531
11673
  let userEmail = void 0;
11532
11674
  try {
11533
11675
  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-ChV_1TP7.cjs');
4
+ require('./api-DK1gyZAZ.cjs');
5
5
  require('zod');
6
- require('./index-CDyeCS7U.cjs');
6
+ require('./index-BLeiCte-.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-DYS9sGJr.mjs';
2
+ import './api-C68U-kRs.mjs';
3
3
  import 'zod';
4
- import './index-DtlrIihs.mjs';
4
+ import './index-DQ76ZTNL.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-ChV_1TP7.cjs');
3
+ var persistence = require('./api-DK1gyZAZ.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');