@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/cli.js +33 -9
- package/dist/cli.js.map +4 -4
- package/dist/index.js +33 -9
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -31081,7 +31081,7 @@ var {
|
|
|
31081
31081
|
} = import_index.default;
|
|
31082
31082
|
|
|
31083
31083
|
// src/cli-version.ts
|
|
31084
|
-
var CLI_VERSION = "0.1.
|
|
31084
|
+
var CLI_VERSION = "0.1.82".length > 0 ? "0.1.82" : "0.0.0-dev";
|
|
31085
31085
|
|
|
31086
31086
|
// src/cli/defaults.ts
|
|
31087
31087
|
var DEFAULT_API_URL = process.env.BUILDAUTOMATON_API_URL ?? "https://api.buildautomaton.com";
|
|
@@ -35153,21 +35153,45 @@ async function execProbeShutdownAware(file2, args, timeoutMs) {
|
|
|
35153
35153
|
}
|
|
35154
35154
|
}
|
|
35155
35155
|
|
|
35156
|
+
// src/agents/acp/clients/format-stderr-for-terminal.ts
|
|
35157
|
+
var STDERR_TERMINAL_CHUNK_MAX = 400;
|
|
35158
|
+
function formatStderrForTerminal(text, maxChars = STDERR_TERMINAL_CHUNK_MAX) {
|
|
35159
|
+
if (!text) return text;
|
|
35160
|
+
const bodyIdx = text.indexOf("; body:");
|
|
35161
|
+
if (bodyIdx >= 0) {
|
|
35162
|
+
const s = `${text.slice(0, bodyIdx)}; body: [omitted]`;
|
|
35163
|
+
return s.length <= maxChars ? `${s}
|
|
35164
|
+
` : `${s.slice(0, maxChars)}\u2026 [stderr truncated]
|
|
35165
|
+
`;
|
|
35166
|
+
}
|
|
35167
|
+
const trimmed2 = text.trimStart();
|
|
35168
|
+
if (text.length > maxChars && (trimmed2.startsWith("{") || trimmed2.startsWith('"') || trimmed2.startsWith("["))) {
|
|
35169
|
+
return "";
|
|
35170
|
+
}
|
|
35171
|
+
if (text.length <= maxChars) return text;
|
|
35172
|
+
return `${text.slice(0, maxChars)}\u2026 [stderr truncated]
|
|
35173
|
+
`;
|
|
35174
|
+
}
|
|
35175
|
+
|
|
35156
35176
|
// src/agents/acp/clients/agent-stderr-capture.ts
|
|
35157
|
-
var STDERR_CAPTURE_MAX =
|
|
35158
|
-
function createStderrCapture(
|
|
35177
|
+
var STDERR_CAPTURE_MAX = 4e3;
|
|
35178
|
+
function createStderrCapture(_child) {
|
|
35159
35179
|
const chunks = [];
|
|
35160
35180
|
let total = 0;
|
|
35161
35181
|
return {
|
|
35162
35182
|
append(chunk) {
|
|
35163
|
-
|
|
35164
|
-
|
|
35165
|
-
|
|
35183
|
+
const forTerminal = formatStderrForTerminal(chunk.toString("utf8"));
|
|
35184
|
+
if (forTerminal) {
|
|
35185
|
+
try {
|
|
35186
|
+
process.stderr.write(forTerminal);
|
|
35187
|
+
} catch {
|
|
35188
|
+
}
|
|
35166
35189
|
}
|
|
35167
|
-
if (total >= STDERR_CAPTURE_MAX) return;
|
|
35168
|
-
const
|
|
35190
|
+
if (!forTerminal || total >= STDERR_CAPTURE_MAX) return;
|
|
35191
|
+
const buf = Buffer.from(forTerminal, "utf8");
|
|
35192
|
+
const n = Math.min(buf.length, STDERR_CAPTURE_MAX - total);
|
|
35169
35193
|
if (n <= 0) return;
|
|
35170
|
-
chunks.push(n ===
|
|
35194
|
+
chunks.push(n === buf.length ? buf : buf.subarray(0, n));
|
|
35171
35195
|
total += n;
|
|
35172
35196
|
},
|
|
35173
35197
|
getText() {
|