acpx 0.15.0 → 0.15.1

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.
package/dist/flows.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as parseStrictJsonObject, d as checkpoint, f as compute, i as parseJsonObject, l as acp, m as shell, n as decisionEdge, o as FlowRunner, p as defineFlow, r as extractJsonObject, s as flowRunsBaseDir, t as decision, u as action } from "./flows-D-F3Y2o9.js";
1
+ import { a as parseStrictJsonObject, d as checkpoint, f as compute, i as parseJsonObject, l as acp, m as shell, n as decisionEdge, o as FlowRunner, p as defineFlow, r as extractJsonObject, s as flowRunsBaseDir, t as decision, u as action } from "./flows-BOI1XkMp.js";
2
2
  export { FlowRunner, acp, action, checkpoint, compute, decision, decisionEdge, defineFlow, extractJsonObject, flowRunsBaseDir, parseJsonObject, parseStrictJsonObject, shell };
@@ -3327,9 +3327,10 @@ function assertRequestedModelSupported(params) {
3327
3327
  }
3328
3328
  //#endregion
3329
3329
  //#region src/acp/ndjson-stream.ts
3330
+ const DEFAULT_MAX_ACP_MESSAGE_BYTES = 67108864;
3330
3331
  var AcpMessageLimitError = class extends AcpxOperationalError {
3331
3332
  constructor(limit) {
3332
- super(`ACP message exceeded ACPX_MAX_ACP_MESSAGE_BYTES (${limit} bytes)`, {
3333
+ super(`ACP message exceeded ACPX_MAX_ACP_MESSAGE_BYTES (${limit} bytes). Increase the limit or set it to 0 for unlimited input.`, {
3333
3334
  outputCode: "RUNTIME",
3334
3335
  detailCode: "ACP_MESSAGE_TOO_LARGE",
3335
3336
  origin: "acp",
@@ -3339,7 +3340,7 @@ var AcpMessageLimitError = class extends AcpxOperationalError {
3339
3340
  };
3340
3341
  function readMaxAcpMessageBytes(raw = process.env.ACPX_MAX_ACP_MESSAGE_BYTES) {
3341
3342
  const value = raw?.trim();
3342
- if (!value) return;
3343
+ if (!value) return DEFAULT_MAX_ACP_MESSAGE_BYTES;
3343
3344
  const bytes = Number(value);
3344
3345
  if (!/^\d+$/.test(value) || !Number.isSafeInteger(bytes)) throw new Error("ACPX_MAX_ACP_MESSAGE_BYTES must be a non-negative safe integer; zero is unlimited");
3345
3346
  return bytes === 0 ? void 0 : bytes;
@@ -3469,6 +3470,13 @@ function buildTerminalSpawnOptions(command, cwd, env, platform = process.platfor
3469
3470
  windowsHide: true
3470
3471
  }, platform, resolvedEnv ?? process.env);
3471
3472
  }
3473
+ function readTerminalOutputCeiling() {
3474
+ const raw = process.env.ACPX_TERMINAL_MAX_OUTPUT_BYTES?.trim();
3475
+ if (!raw) return;
3476
+ const bytes = Number(raw);
3477
+ if (!/^\d+$/.test(raw) || !Number.isSafeInteger(bytes)) throw new Error("ACPX_TERMINAL_MAX_OUTPUT_BYTES must be a non-negative safe integer; zero disables the host ceiling");
3478
+ return bytes === 0 ? void 0 : bytes;
3479
+ }
3472
3480
  function trimToUtf8Boundary(buffer, limit) {
3473
3481
  if (limit <= 0) return Buffer.alloc(0);
3474
3482
  if (buffer.length <= limit) return buffer;
@@ -3512,8 +3520,10 @@ var TerminalManager = class {
3512
3520
  confirmExecute;
3513
3521
  killGraceMs;
3514
3522
  processHelperTimeoutMs;
3523
+ outputCeilingBytes;
3515
3524
  terminals = /* @__PURE__ */ new Map();
3516
3525
  constructor(options) {
3526
+ this.outputCeilingBytes = readTerminalOutputCeiling();
3517
3527
  this.cwd = options.cwd;
3518
3528
  this.permissionMode = options.permissionMode;
3519
3529
  this.nonInteractivePermissions = options.nonInteractivePermissions ?? "deny";
@@ -3538,7 +3548,8 @@ var TerminalManager = class {
3538
3548
  });
3539
3549
  try {
3540
3550
  if (!await this.isExecuteApproved(commandLine)) throw new PermissionDeniedError("Permission denied for terminal/create");
3541
- const outputByteLimit = Math.max(0, Math.round(params.outputByteLimit ?? DEFAULT_TERMINAL_OUTPUT_LIMIT_BYTES));
3551
+ const requestedLimit = Math.max(0, Math.round(params.outputByteLimit ?? DEFAULT_TERMINAL_OUTPUT_LIMIT_BYTES));
3552
+ const outputByteLimit = Math.min(requestedLimit, this.outputCeilingBytes ?? Number.POSITIVE_INFINITY);
3542
3553
  const { proc, spawnCommand } = await spawnTerminalProcess(params, this.cwd);
3543
3554
  let resolveExit = () => {};
3544
3555
  const exitPromise = new Promise((resolve) => {
@@ -6740,4 +6751,4 @@ var LiveSessionCheckpoint = class {
6740
6751
  //#endregion
6741
6752
  export { formatPerfMetric as $, AgentSpawnError as $t, RequestedModelUnsupportedError as A, DEFAULT_AGENT_NAME as At, absolutePath as B, extractAcpError as Bt, sessionOptionsFromRecord as C, parsePromptSource as Ct, AcpClient as D, TimeoutError as Dt, reconcileAgentSessionId as E, InterruptedError as Et, runTimedExecFile as F, resolveCanonicalAgentName as Ft, listSessions as G, NON_INTERACTIVE_PERMISSION_POLICIES as Gt, findSession as H, toAcpErrorPayload as Ht, splitCommandLine as I, exitCodeForOutputErrorCode as It, pruneSessions as J, OUTPUT_FORMATS as Jt, listSessionsForAgent as K, OUTPUT_ERROR_CODES as Kt, getAcpxVersion as L, formatErrorMessage as Lt, modelStateFromConfigOptions as M, normalizeAgentName$1 as Mt, normalizeAgentCommandInput as N, resolveAgentArgv as Nt, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE as O, withInterrupt as Ot, renderArgvIdentity as P, resolveAgentCommand as Pt, assertPersistedKeyPolicy as Q, AcpxOperationalError as Qt, permissionModeSatisfies as R, isRetryablePromptError as Rt, persistSessionOptions as S, mergePromptSourceWithText as St, applyLifecycleSnapshotToRecord as T, textPrompt as Tt, findSessionByDirectoryWalk as U, AUTH_POLICIES as Ut, findGitRepositoryRoot as V, isAcpResourceNotFoundError as Vt, isoNow$2 as W, EXIT_CODES as Wt, writeSessionRecord as X, PERMISSION_POLICY_ACTIONS as Xt, resolveSessionRecord as Y, PERMISSION_MODES as Yt, createAtomicWriteTempPath as Z, SESSION_RECORD_SCHEMA as Zt, recordPromptSubmission as _, isAcpJsonRpcMessage as _t, applyConfigOptionSelection as a, setPerfGauge as at, advertisedModelState as b, PromptInputValidationError as bt, applyRequestedModelIfAdvertised as c, serializeSessionRecordForDisk as ct, setDesiredModeId as d, defaultSessionEventLog as dt, QueueConnectionError as en, getPerfMetricsSnapshot as et, syncAdvertisedModelState as f, sessionBaseDir$1 as ft, recordClientOperation as g, extractSessionUpdateNotification as gt, createSessionConversation as h, sessionEventSegmentPath as ht, connectAndLoadSession as i, resetPerfMetrics as it, isRequestedModelUnsupportedError as j, listBuiltInAgents as jt, REQUESTED_MODEL_UNSUPPORTED_REASONS as k, withTimeout as kt, currentModelIdFromSetModelResponse as l, normalizeRuntimeSessionId as lt, cloneSessionConversation as m, sessionEventLockPath as mt, runPromptTurn as n, measurePerf as nt, applyConfigOptionsToRecord as o, startPerfTimer as ot, cloneSessionAcpxState as p, sessionEventActivePath as pt, normalizeName as q, OUTPUT_ERROR_ORIGINS as qt, withConnectedSession as r, recordPerfDuration as rt, applyModelSelection as s, parseSessionRecord as st, LiveSessionCheckpoint as t, QueueProtocolError as tn, incrementPerfCounter as tt, setCurrentModelId as u, DEFAULT_EVENT_SEGMENT_MAX_BYTES as ut, recordSessionUpdate as v, parseJsonRpcErrorMessage as vt, applyConversation as w, promptToDisplayText as wt, mergeSessionOptions as x, isPromptInput as xt, trimConversationForRuntime as y, parsePromptStopReason as yt, DEFAULT_HISTORY_LIMIT as z, normalizeOutputError as zt };
6742
6753
 
6743
- //# sourceMappingURL=live-checkpoint-CYRs-D9t.js.map
6754
+ //# sourceMappingURL=live-checkpoint-sB7dFOYR.js.map