@buildautomaton/cli 0.1.81 → 0.1.82

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/index.js CHANGED
@@ -28247,21 +28247,45 @@ function sendWsMessage(ws, payload) {
28247
28247
  // src/files/cwd/index.ts
28248
28248
  init_bridge_root();
28249
28249
 
28250
+ // src/agents/acp/clients/format-stderr-for-terminal.ts
28251
+ var STDERR_TERMINAL_CHUNK_MAX = 400;
28252
+ function formatStderrForTerminal(text, maxChars = STDERR_TERMINAL_CHUNK_MAX) {
28253
+ if (!text) return text;
28254
+ const bodyIdx = text.indexOf("; body:");
28255
+ if (bodyIdx >= 0) {
28256
+ const s = `${text.slice(0, bodyIdx)}; body: [omitted]`;
28257
+ return s.length <= maxChars ? `${s}
28258
+ ` : `${s.slice(0, maxChars)}\u2026 [stderr truncated]
28259
+ `;
28260
+ }
28261
+ const trimmed2 = text.trimStart();
28262
+ if (text.length > maxChars && (trimmed2.startsWith("{") || trimmed2.startsWith('"') || trimmed2.startsWith("["))) {
28263
+ return "";
28264
+ }
28265
+ if (text.length <= maxChars) return text;
28266
+ return `${text.slice(0, maxChars)}\u2026 [stderr truncated]
28267
+ `;
28268
+ }
28269
+
28250
28270
  // src/agents/acp/clients/agent-stderr-capture.ts
28251
- var STDERR_CAPTURE_MAX = 48e3;
28252
- function createStderrCapture(child) {
28271
+ var STDERR_CAPTURE_MAX = 4e3;
28272
+ function createStderrCapture(_child) {
28253
28273
  const chunks = [];
28254
28274
  let total = 0;
28255
28275
  return {
28256
28276
  append(chunk) {
28257
- try {
28258
- process.stderr.write(chunk);
28259
- } catch {
28277
+ const forTerminal = formatStderrForTerminal(chunk.toString("utf8"));
28278
+ if (forTerminal) {
28279
+ try {
28280
+ process.stderr.write(forTerminal);
28281
+ } catch {
28282
+ }
28260
28283
  }
28261
- if (total >= STDERR_CAPTURE_MAX) return;
28262
- const n = Math.min(chunk.length, STDERR_CAPTURE_MAX - total);
28284
+ if (!forTerminal || total >= STDERR_CAPTURE_MAX) return;
28285
+ const buf = Buffer.from(forTerminal, "utf8");
28286
+ const n = Math.min(buf.length, STDERR_CAPTURE_MAX - total);
28263
28287
  if (n <= 0) return;
28264
- chunks.push(n === chunk.length ? chunk : chunk.subarray(0, n));
28288
+ chunks.push(n === buf.length ? buf : buf.subarray(0, n));
28265
28289
  total += n;
28266
28290
  },
28267
28291
  getText() {
@@ -31737,7 +31761,7 @@ function createPendingAuthOnMessage(params) {
31737
31761
  }
31738
31762
 
31739
31763
  // src/cli-version.ts
31740
- var CLI_VERSION = "0.1.81".length > 0 ? "0.1.81" : "0.0.0-dev";
31764
+ var CLI_VERSION = "0.1.82".length > 0 ? "0.1.82" : "0.0.0-dev";
31741
31765
 
31742
31766
  // src/auth/pending/pending-auth-on-open.ts
31743
31767
  function createPendingAuthOnOpen(params) {