@lambdacurry/arbor 0.21.39 → 0.21.40
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/arbor.js +22 -8
- package/package.json +1 -1
package/dist/arbor.js
CHANGED
|
@@ -16,7 +16,7 @@ var __export = (target, all) => {
|
|
|
16
16
|
// package.json
|
|
17
17
|
var package_default = {
|
|
18
18
|
name: "@lambdacurry/arbor",
|
|
19
|
-
version: "0.21.
|
|
19
|
+
version: "0.21.40",
|
|
20
20
|
description: "The Arbor CLI — a shared workspace for people and agents. The human + headless-agent write path over Arbor's guarded operation surface.",
|
|
21
21
|
keywords: [
|
|
22
22
|
"agents",
|
|
@@ -22132,6 +22132,20 @@ var httpExecutor = {
|
|
|
22132
22132
|
};
|
|
22133
22133
|
|
|
22134
22134
|
// src/output.ts
|
|
22135
|
+
function writeOutput(value, stream, fallback) {
|
|
22136
|
+
if (stream && typeof stream.write === "function") {
|
|
22137
|
+
stream.write(value);
|
|
22138
|
+
return;
|
|
22139
|
+
}
|
|
22140
|
+
fallback(value.endsWith(`
|
|
22141
|
+
`) ? value.slice(0, -1) : value);
|
|
22142
|
+
}
|
|
22143
|
+
function writeStdout(value) {
|
|
22144
|
+
writeOutput(value, process.stdout, (line) => console.log(line));
|
|
22145
|
+
}
|
|
22146
|
+
function writeStderr(value) {
|
|
22147
|
+
writeOutput(value, process.stderr, (line) => console.error(line));
|
|
22148
|
+
}
|
|
22135
22149
|
function lastValue(value) {
|
|
22136
22150
|
return Array.isArray(value) ? value[value.length - 1] : value;
|
|
22137
22151
|
}
|
|
@@ -22165,7 +22179,7 @@ function stringFlag(value, name) {
|
|
|
22165
22179
|
}
|
|
22166
22180
|
function resolveOutput(flags, opts) {
|
|
22167
22181
|
const json2 = truthyFlag(flags.json);
|
|
22168
|
-
const isTTY = opts?.isTTY ?? Boolean(process.stdout
|
|
22182
|
+
const isTTY = opts?.isTTY ?? Boolean(process.stdout?.isTTY);
|
|
22169
22183
|
const quiet = truthyFlag(flags["no-quiet"]) ? false : truthyFlag(flags.quiet) || json2 || !isTTY;
|
|
22170
22184
|
const fieldsRaw = lastValue(flags.fields);
|
|
22171
22185
|
const fields = typeof fieldsRaw === "string" && fieldsRaw.trim() ? fieldsRaw.split(",").map((f) => f.trim()).filter(Boolean) : undefined;
|
|
@@ -22197,10 +22211,10 @@ function emitData(data, _action, ctx) {
|
|
|
22197
22211
|
const shaped = ctx.fields ? applyFields(data, ctx.fields) : data;
|
|
22198
22212
|
if (ctx.json) {
|
|
22199
22213
|
const envelope = { ok: true, data: shaped };
|
|
22200
|
-
|
|
22214
|
+
writeStdout(`${JSON.stringify(envelope)}
|
|
22201
22215
|
`);
|
|
22202
22216
|
} else {
|
|
22203
|
-
|
|
22217
|
+
writeStdout(`${JSON.stringify(shaped, null, 2)}
|
|
22204
22218
|
`);
|
|
22205
22219
|
}
|
|
22206
22220
|
}
|
|
@@ -22212,24 +22226,24 @@ function emitError(err, _action, ctx) {
|
|
|
22212
22226
|
ok: false,
|
|
22213
22227
|
error: { code, message, ...detailsForError(err) }
|
|
22214
22228
|
};
|
|
22215
|
-
|
|
22229
|
+
writeStdout(`${JSON.stringify(envelope)}
|
|
22216
22230
|
`);
|
|
22217
22231
|
process.exitCode = exitCodeForError(code);
|
|
22218
22232
|
} else {
|
|
22219
|
-
|
|
22233
|
+
writeStderr(`✗ ${message}
|
|
22220
22234
|
`);
|
|
22221
22235
|
process.exitCode = 1;
|
|
22222
22236
|
}
|
|
22223
22237
|
}
|
|
22224
22238
|
function advise(message, ctx) {
|
|
22225
22239
|
if (!ctx.quiet)
|
|
22226
|
-
|
|
22240
|
+
writeStderr(message);
|
|
22227
22241
|
}
|
|
22228
22242
|
function emitDual(data, human, action, ctx) {
|
|
22229
22243
|
if (ctx.json)
|
|
22230
22244
|
emitData(data, action, ctx);
|
|
22231
22245
|
else
|
|
22232
|
-
|
|
22246
|
+
writeStdout(human);
|
|
22233
22247
|
}
|
|
22234
22248
|
|
|
22235
22249
|
// src/computer-exec-wait.ts
|
package/package.json
CHANGED