@lambdacurry/arbor 0.22.21 → 0.22.22

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 +19 -19
  2. package/package.json +1 -1
package/dist/arbor.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@lambdacurry/arbor",
5
- version: "0.22.21",
5
+ version: "0.22.22",
6
6
  description: "The Arbor CLI — a shared workspace for people and agents. The human + headless-agent write path over Arbor's guarded operation surface.",
7
7
  keywords: [
8
8
  "agents",
@@ -9949,7 +9949,7 @@ Arbor's MCP is the collaboration and durable-knowledge surface. Configure, autho
9949
9949
 
9950
9950
  Run \`arbor help\` (or read the MCP tool list) for the exact command/flags — those stay generated from the live action surface, so they're always current.`;
9951
9951
  var ARBOR_SKILL_MARKDOWN = renderArborSkill(ORIENTATION);
9952
- var COMPUTER_ORIENTATION = `Long Computer work returns a handle — do not hold one tool call for a full test or build. \`computer_exec\` runs a command; if the result is still running, take \`processId\` and poll \`computer_process_read\`. Do not chain \`pnpm test && pnpm build\` in one exec; split steps or pass \`background:true\`. The CLI waits on the same handle unless \`--no-wait\`.
9952
+ var COMPUTER_ORIENTATION = `Long Computer work returns a handle — do not hold one tool call for a full test or build. \`computer_exec\` runs a command; if the result is still running or output is truncated, take \`processId\`/\`nextCursor\` and continue with \`computer_process_read\`. Do not chain \`pnpm test && pnpm build\` in one exec; split steps or pass \`background:true\`. The CLI polls only while the process is silent unless \`--no-wait\`; it returns the first bounded output page instead of concatenating continuation pages into one agent context.
9953
9953
 
9954
9954
  Arbor Computer is the complete software execution platform attached to Arbor's durable collaboration graph. It configures project environments, executes and verifies work, packages and releases Apps, and preserves reviewable evidence; it does not schedule agents or replace Arbor collaboration.
9955
9955
 
@@ -13520,6 +13520,7 @@ function emitDual(data, human, action, ctx) {
13520
13520
 
13521
13521
  // src/computer-exec-wait.ts
13522
13522
  var DEFAULT_PROCESS_DEADLINE_MS = 1800000;
13523
+ var PROCESS_OUTPUT_PAGE_BYTES = 4096;
13523
13524
  var POLL_MS = 400;
13524
13525
  var processRead = ACTIONS3.find((action) => action.name === "computer_process_read");
13525
13526
  function record3(value) {
@@ -13540,6 +13541,12 @@ function isRunning(value) {
13540
13541
  return false;
13541
13542
  return typeof value.processId === "string";
13542
13543
  }
13544
+ function hasCallerVisibleOutputPage(value) {
13545
+ return typeof value.stdout === "string" && value.stdout.length > 0 || typeof value.stderr === "string" && value.stderr.length > 0 || value.truncated === true;
13546
+ }
13547
+ function withContinuation(value) {
13548
+ return isRunning(value) || value.truncated === true ? { ...value, nextAction: "computer_process_read" } : value;
13549
+ }
13543
13550
  function sleep(ms) {
13544
13551
  return new Promise((resolve) => setTimeout(resolve, ms));
13545
13552
  }
@@ -13551,39 +13558,32 @@ async function waitForComputerExec(executor, input, value, ctx) {
13551
13558
  if (!processRead || !isComputerExecHandle(value))
13552
13559
  return value;
13553
13560
  let latest = value;
13561
+ if (hasCallerVisibleOutputPage(latest))
13562
+ return withContinuation(latest);
13554
13563
  let cursor = typeof latest.nextCursor === "string" && latest.nextCursor ? latest.nextCursor : undefined;
13555
- let stdoutPages = typeof latest.stdout === "string" ? latest.stdout : "";
13556
- let stderrPages = typeof latest.stderr === "string" ? latest.stderr : "";
13557
- if (stdoutPages)
13558
- advise(stdoutPages, ctx);
13559
13564
  const deadline = Date.now() + (typeof input.timeout === "number" && Number.isFinite(input.timeout) ? input.timeout : DEFAULT_PROCESS_DEADLINE_MS);
13560
- advise(isRunning(latest) ? `Process ${String(latest.processId)} is still running; polling computer_process_read.
13561
- ` : `Process ${String(latest.processId)} has unread output; polling computer_process_read.
13565
+ advise(`Process ${String(latest.processId)} is still running; polling computer_process_read.
13562
13566
  `, ctx);
13563
- while ((isRunning(latest) || latest.truncated === true) && Date.now() < deadline) {
13567
+ while (isRunning(latest) && Date.now() < deadline) {
13564
13568
  await sleep(POLL_MS);
13565
13569
  const read = record3(await processRead.run(executor, {
13566
13570
  processId: latest.processId,
13571
+ maxBytes: PROCESS_OUTPUT_PAGE_BYTES,
13567
13572
  ...cursor ? { cursor } : {},
13568
13573
  ...typeof input.runId === "string" ? { runId: input.runId } : {},
13569
13574
  ...typeof input.computerSessionId === "string" ? { computerSessionId: input.computerSessionId } : {}
13570
13575
  }));
13571
- if (!read) {
13576
+ if (!read)
13572
13577
  throw new Error("computer_process_read returned an empty result");
13573
- }
13574
13578
  latest = read;
13575
13579
  if (typeof read.nextCursor === "string" && read.nextCursor)
13576
13580
  cursor = read.nextCursor;
13577
- const stdout = typeof latest.stdout === "string" ? latest.stdout : "";
13578
- const stderr = typeof latest.stderr === "string" ? latest.stderr : "";
13579
- if (stdout)
13580
- advise(stdout, ctx);
13581
- stdoutPages += stdout;
13582
- stderrPages += stderr;
13583
13581
  if (latest.recovery)
13584
- break;
13582
+ return latest;
13583
+ if (hasCallerVisibleOutputPage(latest) || !isRunning(latest))
13584
+ return withContinuation(latest);
13585
13585
  }
13586
- return { ...latest, stdout: stdoutPages, stderr: stderrPages };
13586
+ return withContinuation(latest);
13587
13587
  }
13588
13588
 
13589
13589
  // src/schema.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.22.21",
3
+ "version": "0.22.22",
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",