@lambdacurry/arbor 0.21.39 → 0.21.41

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 (2) hide show
  1. package/dist/arbor.js +24 -10
  2. 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.39",
19
+ version: "0.21.41",
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.isTTY);
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
- process.stdout.write(`${JSON.stringify(envelope)}
22214
+ writeStdout(`${JSON.stringify(envelope)}
22201
22215
  `);
22202
22216
  } else {
22203
- process.stdout.write(`${JSON.stringify(shaped, null, 2)}
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
- process.stdout.write(`${JSON.stringify(envelope)}
22229
+ writeStdout(`${JSON.stringify(envelope)}
22216
22230
  `);
22217
22231
  process.exitCode = exitCodeForError(code);
22218
22232
  } else {
22219
- process.stderr.write(`✗ ${message}
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
- process.stderr.write(message);
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
- process.stdout.write(human);
22246
+ writeStdout(human);
22233
22247
  }
22234
22248
 
22235
22249
  // src/computer-exec-wait.ts
@@ -22807,7 +22821,7 @@ async function connect(opts) {
22807
22821
  throw new Error(`could not start pairing (${initRes.status}): ${init.error ?? "is the server reachable?"}`);
22808
22822
  }
22809
22823
  const approvalUrl = bareConnectUrl(apiUrl, init.url);
22810
- process.stderr.write(`
22824
+ writeStderr(`
22811
22825
  Pairing against ${apiUrl}
22812
22826
  ` + ` Ask the person who will manage this agent${init.agentName ? ` (“${init.agentName}”)` : ""} to approve it:
22813
22827
  ` + ` 1. open ${approvalUrl}
@@ -22859,7 +22873,7 @@ async function login(opts) {
22859
22873
  if (!codeRes.ok)
22860
22874
  throw new Error(`could not start device login (${codeRes.status}). Is ${apiUrl} running?`);
22861
22875
  const code = await codeRes.json();
22862
- process.stderr.write(`
22876
+ writeStderr(`
22863
22877
  To authorize the Arbor CLI:
22864
22878
  ` + ` 1. open ${code.verification_uri}
22865
22879
  ` + ` 2. enter the code: ${code.user_code}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.21.39",
3
+ "version": "0.21.41",
4
4
  "description": "The Arbor CLI — a shared workspace for people and agents. The human + headless-agent write path over Arbor's guarded operation surface.",
5
5
  "keywords": [
6
6
  "agents",