@lambdacurry/arbor 0.18.0 → 0.20.0

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 +155 -85
  2. package/package.json +1 -1
package/dist/arbor.js CHANGED
@@ -1679,9 +1679,9 @@ var computerRuns = sqliteTable("computer_runs", {
1679
1679
  profileId: text("profile_id").notNull().references(() => profiles.id),
1680
1680
  executionContextId: text("execution_context_id").notNull().references(() => executionContexts.id),
1681
1681
  mode: text("mode").$type().notNull(),
1682
- isolation: text("isolation").$type().notNull(),
1682
+ execution: text("isolation").$type().notNull(),
1683
1683
  workspaceDir: text("workspace_dir").notNull(),
1684
- workspaceRef: text("workspace_ref"),
1684
+ _legacyWorkspaceRef: text("workspace_ref"),
1685
1685
  baseSnapshotId: text("base_snapshot_id"),
1686
1686
  status: text("status").$type().notNull().default("active"),
1687
1687
  label: text("label"),
@@ -2198,8 +2198,6 @@ var watches = sqliteTable("watches", {
2198
2198
  watchTargetIdx: index("watches_target_idx").on(t.targetType, t.targetId)
2199
2199
  }));
2200
2200
  // ../core/src/ops/computer-run.ts
2201
- var COMPUTER_WORKSPACE_ROOT = "/workspace";
2202
- var COMPUTER_RUN_WORKSPACE_ROOT = `${COMPUTER_WORKSPACE_ROOT}/.arbor-runs`;
2203
2201
  var TERMINAL = new Set(["finished", "failed", "cancelled"]);
2204
2202
 
2205
2203
  // ../core/src/ops/computer.ts
@@ -16773,9 +16771,8 @@ var computerRun = exports_external.looseObject({
16773
16771
  profileId: id,
16774
16772
  executionContextId: id,
16775
16773
  mode: exports_external.enum(["read", "write"]),
16776
- isolation: exports_external.enum(["shared", "isolated"]),
16774
+ execution: exports_external.enum(["shared", "isolated"]),
16777
16775
  workspaceDir: exports_external.string(),
16778
- workspaceRef: exports_external.string().nullable(),
16779
16776
  baseSnapshotId: id.nullable(),
16780
16777
  status: exports_external.enum(["active", "finished", "failed", "cancelled"]),
16781
16778
  label: exports_external.string().nullable(),
@@ -16791,8 +16788,8 @@ var computerRunReceipt = exports_external.looseObject({
16791
16788
  actor: exports_external.looseObject({ profileId: id, executionContextId: id }),
16792
16789
  label: exports_external.string().nullable(),
16793
16790
  mode: exports_external.enum(["read", "write"]),
16794
- isolation: exports_external.enum(["shared", "isolated"]),
16795
- workspace: exports_external.looseObject({ dir: exports_external.string(), ref: exports_external.string().nullable() }),
16791
+ execution: exports_external.enum(["shared", "isolated"]),
16792
+ workspace: exports_external.looseObject({ dir: exports_external.string() }),
16796
16793
  baseSnapshotId: id.nullable(),
16797
16794
  status: exports_external.enum(["active", "finished", "failed", "cancelled"]),
16798
16795
  outcome: exports_external.enum(["finished", "failed", "cancelled"]).nullable(),
@@ -17056,34 +17053,24 @@ var MCP_OUTPUT_SCHEMAS = {
17056
17053
  recall: exports_external.object({ result: exports_external.array(recallHit) }),
17057
17054
  contribute: exports_external.looseObject({
17058
17055
  contributionId: id,
17059
- threadId: id,
17060
- type: exports_external.string(),
17061
17056
  replayed: exports_external.boolean(),
17062
17057
  url: exports_external.string(),
17063
17058
  priorArt: exports_external.array(contributionRef).optional(),
17064
17059
  summaryHint: exports_external.string().optional()
17065
17060
  }),
17066
- edit: exports_external.looseObject({ contributionId: id, editedAt: timestamp }),
17067
- stamp: exports_external.looseObject({
17068
- reviewId: id,
17069
- contributionId: id,
17070
- facetKey: exports_external.string().nullable(),
17071
- polarity: exports_external.string().nullable()
17072
- }),
17061
+ edit: exports_external.looseObject({ editedAt: timestamp }),
17062
+ stamp: exports_external.looseObject({ reviewId: id }),
17073
17063
  react: exports_external.looseObject({
17074
17064
  reacted: exports_external.boolean(),
17075
- targetType: exports_external.string(),
17076
- targetId: id,
17077
- emoji: exports_external.string(),
17078
17065
  reactions: exports_external.array(reactionCount)
17079
17066
  }),
17080
- create_topic: topic2,
17067
+ create_topic: exports_external.looseObject({ topicId: id }),
17081
17068
  topic_update: exports_external.looseObject({
17082
17069
  id,
17083
17070
  title: exports_external.string().optional(),
17084
17071
  purpose: nullableString.optional()
17085
17072
  }),
17086
- create_thread: thread3,
17073
+ create_thread: exports_external.looseObject({ threadId: id }),
17087
17074
  set_organization_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
17088
17075
  set_space_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
17089
17076
  set_topic_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
@@ -17142,30 +17129,20 @@ var MCP_OUTPUT_SCHEMAS = {
17142
17129
  reason: exports_external.string().optional(),
17143
17130
  currentSnapshotId: nullableString.optional()
17144
17131
  }),
17145
- transition_thread: exports_external.looseObject({ threadId: id, status: exports_external.string() }),
17132
+ transition_thread: exports_external.looseObject({ status: exports_external.string() }),
17146
17133
  request: exports_external.looseObject({
17147
17134
  requestId: id,
17148
- threadId: id,
17149
- audience: exports_external.string(),
17150
- completion: exports_external.string(),
17151
17135
  status: exports_external.string(),
17152
17136
  opensAt: timestamp.optional()
17153
17137
  }),
17154
17138
  respond: exports_external.looseObject({
17155
- requestId: id,
17156
- requestStatus: exports_external.string(),
17157
17139
  contributionId: id,
17158
- computerSessionId: id.optional(),
17159
- attachmentIds: exports_external.array(id).optional()
17140
+ requestStatus: exports_external.string()
17160
17141
  }),
17161
- mark_as_response: exports_external.looseObject({
17162
- requestId: id,
17163
- requestStatus: exports_external.string(),
17164
- contributionId: id
17165
- }),
17166
- cancel_request: exports_external.looseObject({ requestId: id, status: exports_external.string(), withdrawn: exports_external.number() }),
17142
+ mark_as_response: exports_external.looseObject({ requestStatus: exports_external.string() }),
17143
+ cancel_request: exports_external.looseObject({ status: exports_external.string(), withdrawn: exports_external.number() }),
17167
17144
  inbox: paged("items", jsonObject),
17168
- dismiss: exports_external.looseObject({ inboxItemId: id, status: exports_external.literal("dismissed") }),
17145
+ dismiss: exports_external.looseObject({ status: exports_external.literal("dismissed") }),
17169
17146
  whoami: exports_external.looseObject({
17170
17147
  profile: profile2,
17171
17148
  client: exports_external.looseObject({ id, kind: exports_external.string() }),
@@ -17195,7 +17172,7 @@ var MCP_OUTPUT_SCHEMAS = {
17195
17172
  }),
17196
17173
  tree: exports_external.looseObject({ spaces: exports_external.array(treeSpace) }),
17197
17174
  members: exports_external.looseObject({ members: exports_external.array(orgMember), total: exports_external.number().optional() }),
17198
- space_create: space3,
17175
+ space_create: exports_external.looseObject({ spaceId: id, visibility: exports_external.string() }),
17199
17176
  space_update: exports_external.looseObject({
17200
17177
  id,
17201
17178
  title: exports_external.string().optional(),
@@ -17420,17 +17397,13 @@ var MCP_OUTPUT_SCHEMAS = {
17420
17397
  }).optional()
17421
17398
  }),
17422
17399
  computer_run_start: exports_external.looseObject({
17423
- run: computerRun,
17424
- workspace: exports_external.looseObject({
17425
- workspaceRoot: exports_external.string(),
17426
- repositories: exports_external.array(exports_external.looseObject({ repository: exports_external.string(), path: exports_external.string() })),
17427
- defaultCwd: exports_external.string(),
17428
- ref: exports_external.string().nullable().optional(),
17429
- root: exports_external.string().optional()
17430
- })
17400
+ runId: id,
17401
+ execution: exports_external.enum(["shared", "isolated"]),
17402
+ baseSnapshotId: id.nullable(),
17403
+ status: exports_external.string()
17431
17404
  }),
17432
17405
  computer_run_finish: exports_external.looseObject({
17433
- run: computerRun,
17406
+ status: exports_external.string(),
17434
17407
  replayed: exports_external.boolean()
17435
17408
  }),
17436
17409
  computer_run_receipt: exports_external.looseObject({
@@ -17458,27 +17431,21 @@ var MCP_OUTPUT_SCHEMAS = {
17458
17431
  stdout: exports_external.string().optional(),
17459
17432
  stderr: exports_external.string().optional(),
17460
17433
  exitCode: exports_external.number().optional(),
17461
- jobId: exports_external.string().optional(),
17462
17434
  processId: exports_external.string().optional(),
17463
17435
  status: exports_external.string().optional(),
17464
- cwd: exports_external.string(),
17465
- strict: exports_external.boolean()
17436
+ cwd: exports_external.string().optional()
17466
17437
  }),
17467
17438
  computer_process_read: exports_external.looseObject({
17468
- processId: id,
17469
17439
  status: exports_external.string(),
17470
- command: exports_external.string().optional(),
17471
- cwd: exports_external.string().optional(),
17472
- startedAt: timestamp.nullable().optional(),
17473
17440
  endedAt: timestamp.nullable().optional(),
17474
17441
  durationMs: exports_external.number().int().min(0).nullable().optional(),
17475
17442
  stdout: exports_external.string().optional(),
17476
17443
  stderr: exports_external.string().optional(),
17477
17444
  truncated: exports_external.boolean().optional(),
17445
+ nextCursor: exports_external.string().optional(),
17478
17446
  exitCode: exports_external.number().int().nullable().optional()
17479
17447
  }),
17480
17448
  computer_process_terminate: exports_external.looseObject({
17481
- processId: id,
17482
17449
  status: exports_external.string(),
17483
17450
  terminated: exports_external.boolean().optional()
17484
17451
  }),
@@ -17517,7 +17484,6 @@ var MCP_OUTPUT_SCHEMAS = {
17517
17484
  }),
17518
17485
  computer_write: exports_external.looseObject({
17519
17486
  ok: exports_external.boolean(),
17520
- path: exports_external.string().optional(),
17521
17487
  size: exports_external.number().optional()
17522
17488
  }),
17523
17489
  computer_checkpoint: checkpoint,
@@ -17591,6 +17557,105 @@ function outputSchemaFor(actionName) {
17591
17557
  return MCP_OUTPUT_SCHEMAS[actionName];
17592
17558
  }
17593
17559
 
17560
+ // ../actions/src/output-shaping.ts
17561
+ function record2(value) {
17562
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
17563
+ }
17564
+ function defined(entries) {
17565
+ return Object.fromEntries(entries.filter(([, value]) => value !== undefined));
17566
+ }
17567
+ var OUTPUT_SHAPERS = {
17568
+ contribute: (result) => defined([
17569
+ ["contributionId", result.contributionId],
17570
+ ["replayed", result.replayed],
17571
+ ["url", result.url],
17572
+ ["priorArt", result.priorArt],
17573
+ ["summaryHint", result.summaryHint]
17574
+ ]),
17575
+ edit: (result) => defined([["editedAt", result.editedAt]]),
17576
+ stamp: (result) => defined([["reviewId", result.reviewId]]),
17577
+ react: (result) => defined([
17578
+ ["reacted", result.reacted],
17579
+ ["reactions", result.reactions]
17580
+ ]),
17581
+ create_topic: (result) => defined([["topicId", result.id]]),
17582
+ create_thread: (result) => defined([["threadId", result.id]]),
17583
+ space_create: (result) => defined([
17584
+ ["spaceId", result.id],
17585
+ ["visibility", result.visibility]
17586
+ ]),
17587
+ transition_thread: (result) => defined([["status", result.status]]),
17588
+ request: (result) => defined([
17589
+ ["requestId", result.requestId],
17590
+ ["status", result.status],
17591
+ ["opensAt", result.opensAt]
17592
+ ]),
17593
+ respond: (result) => defined([
17594
+ ["contributionId", result.contributionId],
17595
+ ["requestStatus", result.requestStatus]
17596
+ ]),
17597
+ mark_as_response: (result) => defined([["requestStatus", result.requestStatus]]),
17598
+ cancel_request: (result) => defined([
17599
+ ["status", result.status],
17600
+ ["withdrawn", result.withdrawn]
17601
+ ]),
17602
+ dismiss: (result) => defined([["status", result.status]]),
17603
+ computer_run_start: (result) => {
17604
+ const run = record2(result.run) ?? {};
17605
+ return defined([
17606
+ ["runId", run.runId],
17607
+ ["execution", run.execution],
17608
+ ["baseSnapshotId", run.baseSnapshotId],
17609
+ ["status", run.status]
17610
+ ]);
17611
+ },
17612
+ computer_run_finish: (result) => {
17613
+ const run = record2(result.run) ?? {};
17614
+ return defined([
17615
+ ["status", run.status],
17616
+ ["replayed", result.replayed]
17617
+ ]);
17618
+ },
17619
+ computer_exec: (result, input) => defined([
17620
+ ["stdout", result.stdout],
17621
+ ["stderr", result.stderr],
17622
+ ["exitCode", result.exitCode],
17623
+ ["processId", result.processId],
17624
+ ["status", result.status],
17625
+ ["cwd", input.cwd === undefined ? result.cwd : undefined]
17626
+ ]),
17627
+ computer_process_read: (result) => defined([
17628
+ ["status", result.status],
17629
+ ["stdout", result.stdout],
17630
+ ["stderr", result.stderr],
17631
+ ["truncated", result.truncated],
17632
+ ["nextCursor", result.nextCursor],
17633
+ ["endedAt", result.endedAt],
17634
+ ["durationMs", result.durationMs],
17635
+ ["exitCode", result.exitCode]
17636
+ ]),
17637
+ computer_process_terminate: (result) => defined([
17638
+ ["status", result.status],
17639
+ ["terminated", result.terminated]
17640
+ ]),
17641
+ computer_write: (result) => defined([
17642
+ ["ok", result.ok],
17643
+ ["size", result.size]
17644
+ ])
17645
+ };
17646
+ function shapeActionOutput(actionName, value, input = {}) {
17647
+ const shaper = OUTPUT_SHAPERS[actionName];
17648
+ if (!shaper)
17649
+ return value;
17650
+ const publicValue = shaper(record2(value) ?? {}, input);
17651
+ const schema = outputSchemaFor(actionName);
17652
+ if (!schema)
17653
+ throw new Error(`${actionName}: compact action is missing an output schema`);
17654
+ const parsed = schema.safeParse(publicValue);
17655
+ if (!parsed.success)
17656
+ throw new Error(`${actionName}: action returned an invalid public result`);
17657
+ return parsed.data;
17658
+ }
17594
17659
  // ../actions/src/tool-annotations.ts
17595
17660
  var readOnly = {
17596
17661
  readOnlyHint: true,
@@ -18114,10 +18179,11 @@ var ACTION_DEFINITIONS = [
18114
18179
  {
18115
18180
  name: "computer_run_start",
18116
18181
  title: "Start a run",
18117
- description: "Start one unit of work inside an opened Thread computer and receive the workspace it may use. A write run is given its OWN mutable checkout — a working tree per materialized repository, forked from the computer's current shared state so a second task started on the SAME computer does not land in its edits. Pass the returned runId to computer_exec and computer_write: exec starts in that checkout and write's path is confined to it, so an Arbor-routed path cannot address the shared workspace or another run's checkout. This routes collaborating tasks apart rather than sandboxing them — the raw command text is not sandboxed, so an absolute path inside a command string still reaches the shared workspace or another run's checkout in the shared container, while relative paths keep a command's writes in your own checkout. It is isolation against collision, not against untrusted code. A read run stays on the shared /workspace. Finish every run with computer_run_finish. This creates no Thread and no second computer.",
18182
+ description: "Start one unit of work inside an opened Thread computer. Write Runs default to isolated execution restored from the Computer's current base snapshot, so independent work does not collide. For intentional live collaboration, pass execution='shared' and the Run works directly in the Thread Computer alongside other shared Runs. Read Runs always share. All placements present the same /workspace layout; pass runId to Run-aware Computer operations and Arbor routes them correctly. Finish every Run with computer_run_finish, which destroys its isolated environment. This creates no second Thread or durable Computer.",
18118
18183
  inputSchema: {
18119
18184
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18120
- mode: exports_external.enum(["read", "write"]).describe("write for an isolated mutable checkout; read to share /workspace"),
18185
+ mode: exports_external.enum(["read", "write"]).describe("write for mutable work; read for shared inspection"),
18186
+ execution: exports_external.enum(["shared", "isolated"]).optional().describe("write Run placement; defaults to isolated. Use shared only for intentional live collaboration on the Thread Computer"),
18121
18187
  label: exports_external.string().max(120).optional().describe("short factual label for this unit of work")
18122
18188
  },
18123
18189
  surfaces: ["computer-mcp", "computer-cli"],
@@ -18127,7 +18193,7 @@ var ACTION_DEFINITIONS = [
18127
18193
  {
18128
18194
  name: "computer_run_finish",
18129
18195
  title: "Finish a run",
18130
- description: "Close a run with its terminal outcome and the one line that explains it. Checkpoint anything worth keeping first (computer_checkpoint or computer_stop); finishing a run releases the unit of work, it does not save or discard the files in its checkout. Repeating the same outcome is a safe no-op, and it keeps the reason the first caller settled — a different outcome is a conflict. Say what happened in reason: it is what computer_run_receipt shows a reader who was not here.",
18196
+ description: "Close a Run with its terminal outcome and the one line that explains it. Finishing an isolated write Run destroys its execution environment, so push or otherwise publish anything that must outlive the Run before finishing it. Repeating the same outcome is a safe no-op, and it keeps the reason the first caller settled — a different one conflicts. Say what happened in reason: it is what computer_run_receipt shows a reader who was not here.",
18131
18197
  inputSchema: {
18132
18198
  runId: exports_external.string().describe("the runId returned by computer_run_start, run_…"),
18133
18199
  outcome: exports_external.enum(["finished", "failed", "cancelled"]).optional().describe("terminal outcome; defaults to finished"),
@@ -18140,7 +18206,7 @@ var ACTION_DEFINITIONS = [
18140
18206
  {
18141
18207
  name: "computer_run_receipt",
18142
18208
  title: "Read a run receipt",
18143
- description: "READ ONLY: read one run's compact receipt — its purpose, actor, computer session, the base snapshot it forked from, its workspace and effective isolation, how it ended and why, how long it took, and its lifecycle events. This is the normal way to inspect a run you or someone else started, and it stays readable after the run is terminal. Arbor keeps no process state and no command output, so the receipt says what the protocol recorded, not what scrolled past in the shell.",
18209
+ description: "READ ONLY: read one run's compact receipt — its purpose, actor, computer session, the base snapshot it forked from, its workspace and execution placement, how it ended and why, how long it took, and its lifecycle events. This is the normal way to inspect a run you or someone else started, and it stays readable after the run is terminal. Arbor keeps no process state and no command output, so the receipt says what the protocol recorded, not what scrolled past in the shell.",
18144
18210
  inputSchema: {
18145
18211
  runId: exports_external.string().describe("the run to read, run_… (from computer_run_start or computer_runs)")
18146
18212
  },
@@ -18151,7 +18217,7 @@ var ACTION_DEFINITIONS = [
18151
18217
  {
18152
18218
  name: "computer_runs",
18153
18219
  title: "List runs",
18154
- description: "READ ONLY: list the active and recent runs of this Thread computer with each run's mode, effective isolation, and workspace identity. Use it to see what other work is in flight on the same computer before starting or finishing your own.",
18220
+ description: "READ ONLY: list the active and recent runs of this Thread computer with each run's mode, execution placement, and workspace identity. Use it to see what other work is in flight on the same computer before starting or finishing your own.",
18155
18221
  inputSchema: {
18156
18222
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18157
18223
  status: exports_external.enum(["active", "finished", "failed", "cancelled"]).optional().describe("filter to one lifecycle status"),
@@ -18164,11 +18230,11 @@ var ACTION_DEFINITIONS = [
18164
18230
  {
18165
18231
  name: "computer_exec",
18166
18232
  title: "Run a command",
18167
- description: "Run one bounded logical operation in an opened Thread computer. Omitting cwd runs from the Computer's defaultCwd — the one materialized checkout when the recipe has exactly one repository, otherwise the workspace root — and the receipt echoes the cwd it ran in; pass cwd explicitly to override it. Pass runId to work inside that run's own checkout: the command starts there and relative paths keep its writes there, while the raw command text is not sandboxed — an absolute path still reaches the shared workspace or another run's checkout in the shared container. Strict Bash semantics are ON by default: an early command failure or failed pipeline makes the execution nonzero, while explicit handling such as `cmd || fallback` still works. Set strict=false only for an intentional best-effort script. For a connected human, Arbor supplies ambient GitHub authorization for normal gh/HTTPS Git commands and GitHub-linked author/committer identity ephemerally for every exec without writing credentials into the workspace; command-local Git environment overrides may still replace the identity. Use background only for the container backend; it returns a processId for computer_process_read / computer_process_terminate. worker-shell deliberately serializes mutations and rejects long-lived processes.",
18233
+ description: "Run one bounded logical operation in an opened Thread computer. Omitting cwd uses the environment's defaultCwd; pass cwd explicitly to override it. Pass runId to route the command according to that Run's execution placement; without runId the command executes in the parent Computer. Strict Bash semantics are ON by default. For tests, builds, installs, or any command likely to run long, prefer background=true so the call returns a processId immediately; follow it with computer_process_read using the returned cursor for small incremental tails. For a connected human, Arbor supplies ambient GitHub authorization and Git identity ephemerally without writing credentials into the workspace. Background processes stay in the environment where they were started.",
18168
18234
  inputSchema: {
18169
18235
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18170
18236
  command: exports_external.string().min(1).describe("the shell command to run"),
18171
- runId: exports_external.string().optional().describe("run this inside the checkout of this run, run_… (from computer_run_start)"),
18237
+ runId: exports_external.string().optional().describe("route this command according to this Run execution placement, run_… (from computer_run_start)"),
18172
18238
  cwd: exports_external.string().optional().describe("working directory under /workspace, or under the run"),
18173
18239
  timeout: exports_external.number().int().min(1000).max(1800000).optional().describe("timeout in milliseconds, from 1,000 through 1,800,000"),
18174
18240
  background: exports_external.boolean().optional().describe("start a container process and return its pid"),
@@ -18181,11 +18247,13 @@ var ACTION_DEFINITIONS = [
18181
18247
  {
18182
18248
  name: "computer_process_read",
18183
18249
  title: "Read a background process",
18184
- description: "READ ONLY: Inspect one process returned by computer_exec(background=true). Returns provider-owned lifecycle metadata plus bounded latest stdout/stderr and, once terminal, the final exit result. Re-read the same processId for progress without sentinel files or shell process archaeology.",
18250
+ description: "READ ONLY: Tail one process returned by computer_exec(background=true). With no cursor, returns only the latest small output window; pass nextCursor on the next read to receive only newer output. Defaults to 4 KB total and allows an explicit larger read up to 64 KB. Once terminal, also returns the final exit result.",
18185
18251
  inputSchema: {
18186
18252
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18253
+ runId: exports_external.string().optional().describe("the Run that owns this process, if it was started inside a Run"),
18187
18254
  processId: exports_external.string().min(1).describe("the opaque processId returned by computer_exec(background=true), proc_…"),
18188
- maxBytes: exports_external.number().int().min(1024).max(65536).optional().describe("maximum combined output bytes to return; default 16,384")
18255
+ cursor: exports_external.string().optional().describe("continue after nextCursor from the prior process read; omit for a small latest tail"),
18256
+ maxBytes: exports_external.number().int().min(1024).max(65536).optional().describe("maximum combined output bytes to return; default 4,096, opt up only when needed")
18189
18257
  },
18190
18258
  surfaces: ["computer-mcp", "computer-cli"],
18191
18259
  toolset: "loop",
@@ -18197,6 +18265,7 @@ var ACTION_DEFINITIONS = [
18197
18265
  description: "Terminate one process returned by computer_exec(background=true), including its provider-owned process tree. Returns the observed terminal state so ChatGPT can stop long verification explicitly without shell PIDs or ps/kill workarounds.",
18198
18266
  inputSchema: {
18199
18267
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18268
+ runId: exports_external.string().optional().describe("the Run that owns this process, if it was started inside a Run"),
18200
18269
  processId: exports_external.string().min(1).describe("the opaque processId returned by computer_exec(background=true), proc_…")
18201
18270
  },
18202
18271
  surfaces: ["computer-mcp", "computer-cli"],
@@ -18232,6 +18301,7 @@ var ACTION_DEFINITIONS = [
18232
18301
  description: "Outline the symbols a file or directory defines, resolved by the project's language server. Reach for this before reading a large unfamiliar file — unlike a grep through `computer_exec`, it returns the real declarations with their kinds rather than every textual match. Needs the semantic-code capability shown on the computer_status card.",
18233
18302
  inputSchema: {
18234
18303
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18304
+ runId: exports_external.string().optional().describe("route this semantic read according to this Run execution placement, run_…"),
18235
18305
  path: exports_external.string().max(512).describe("file or directory, absolute under /workspace or workspace-relative")
18236
18306
  },
18237
18307
  surfaces: ["computer-mcp", "computer-cli"],
@@ -18244,6 +18314,7 @@ var ACTION_DEFINITIONS = [
18244
18314
  description: "Locate a declaration by its name path (`ClassName/methodName`) and optionally return its body. Use it instead of a `computer_exec` grep when you want THE definition rather than every line mentioning the name; the language server distinguishes the declaration from its call sites and its string occurrences. Needs the semantic-code capability shown on the computer_status card.",
18245
18315
  inputSchema: {
18246
18316
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18317
+ runId: exports_external.string().optional().describe("route this semantic read according to this Run execution placement, run_…"),
18247
18318
  namePath: exports_external.string().min(1).max(200).describe("symbol name path within a file, e.g. MyClass/myMethod"),
18248
18319
  path: exports_external.string().max(512).optional().describe("optional file or directory to restrict the search to"),
18249
18320
  includeBody: exports_external.boolean().optional().describe("include each symbol's source body"),
@@ -18259,6 +18330,7 @@ var ACTION_DEFINITIONS = [
18259
18330
  description: 'List the places that actually reference a symbol, each with a short snippet. This is the operation `computer_exec` cannot do: a text search finds the same identifier in comments, unrelated modules, and shadowed scopes, while the language server resolves real references — so it answers "is this safe to change". Needs the semantic-code capability shown on the computer_status card.',
18260
18331
  inputSchema: {
18261
18332
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18333
+ runId: exports_external.string().optional().describe("route this semantic read according to this Run execution placement, run_…"),
18262
18334
  namePath: exports_external.string().min(1).max(200).describe("name path of the symbol to trace"),
18263
18335
  path: exports_external.string().max(512).describe("the file declaring that symbol, absolute under /workspace or workspace-relative")
18264
18336
  },
@@ -18272,6 +18344,7 @@ var ACTION_DEFINITIONS = [
18272
18344
  description: "List the concrete implementations or subtypes of an interface, abstract type, or method. A `computer_exec` search cannot follow a type relationship — only the language server knows which declarations satisfy this one. Needs the semantic-code capability shown on the computer_status card.",
18273
18345
  inputSchema: {
18274
18346
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18347
+ runId: exports_external.string().optional().describe("route this semantic read according to this Run execution placement, run_…"),
18275
18348
  namePath: exports_external.string().min(1).max(200).describe("name path of the interface, type, or method"),
18276
18349
  path: exports_external.string().max(512).describe("the file declaring that symbol, absolute under /workspace or workspace-relative")
18277
18350
  },
@@ -18285,6 +18358,7 @@ var ACTION_DEFINITIONS = [
18285
18358
  description: "Return the language server's live errors and warnings for one file, mapped to symbols. Reach for it on a file you just edited: it answers in seconds without the whole-project build a `computer_exec` typecheck runs, though a green result here is not a substitute for that build. Needs the semantic-code capability shown on the computer_status card.",
18286
18359
  inputSchema: {
18287
18360
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18361
+ runId: exports_external.string().optional().describe("route this semantic read according to this Run execution placement, run_…"),
18288
18362
  path: exports_external.string().max(512).describe("the file to inspect, absolute under /workspace or workspace-relative")
18289
18363
  },
18290
18364
  surfaces: ["computer-mcp", "computer-cli"],
@@ -18294,9 +18368,10 @@ var ACTION_DEFINITIONS = [
18294
18368
  {
18295
18369
  name: "computer_export",
18296
18370
  title: "Export a Thread file",
18297
- description: "Move one bounded image, MP4/WebM video, or supported file from an opened computer into a durable Thread Attachment. Describe what it shows so the returned attachments[].markdown has meaningful image alt text or a video/file label; put that Markdown where the media belongs and bind those ids when contributing or responding. Supply one stable idempotencyKey per logical export: safe retries return the original Attachment, while reusing the key for another path or description conflicts.",
18371
+ description: "Move one bounded image, MP4/WebM video, or supported file from an opened Computer or Run into a durable Thread Attachment. Pass runId to export the exact files visible to that Run execution placement. Describe what it shows so the returned attachments[].markdown has meaningful image alt text or a video/file label; put that Markdown where the media belongs and bind those ids when contributing or responding. Supply one stable idempotencyKey per logical export: safe retries return the original Attachment, while reusing the key for another path or description conflicts.",
18298
18372
  inputSchema: {
18299
18373
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18374
+ runId: exports_external.string().optional().describe("route this export according to this Run execution placement, run_…"),
18300
18375
  path: exports_external.string().describe("absolute path to one supported file under /workspace"),
18301
18376
  description: exports_external.string().min(1).max(500).describe("concise description of what the file shows or contains; becomes image alt text, a video caption, and the Artifact summary"),
18302
18377
  idempotencyKey: exports_external.string().min(1).max(200).describe("stable key for this ONE logical export (≤200 chars); reuse it only to retry the same path")
@@ -18308,11 +18383,11 @@ var ACTION_DEFINITIONS = [
18308
18383
  {
18309
18384
  name: "computer_write",
18310
18385
  title: "Write a project file",
18311
- description: "Write one file under /workspace. Content is UTF-8 by default; pass encoding=base64 only for binary bytes. Pass runId to write inside that run's own checkout, where the path may be relative and, being an Arbor-routed path, cannot reach the shared workspace or another run's files. Prefer normal editing tools for code changes; reach for this when the MCP/CLI computer surface is the only filesystem path.",
18386
+ description: "Write one file under /workspace. Content is UTF-8 by default; pass encoding=base64 only for binary bytes. Pass runId to route the write according to that Run: isolated Runs target their Sandbox, shared Runs target the live parent Computer. Without runId the write targets the parent Computer. Prefer normal editing tools for code changes; reach for this when the MCP/CLI computer surface is the only filesystem path.",
18312
18387
  inputSchema: {
18313
18388
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18314
18389
  path: exports_external.string().describe("absolute path under /workspace, or a path inside the run"),
18315
- runId: exports_external.string().optional().describe("write into the checkout of this run, run_… (from computer_run_start)"),
18390
+ runId: exports_external.string().optional().describe("route this write according to this Run execution placement, run_… (from computer_run_start)"),
18316
18391
  content: exports_external.string().describe("complete UTF-8 content, or base64 bytes when encoding=base64"),
18317
18392
  encoding: exports_external.enum(["utf8", "base64"]).optional().describe("content encoding; defaults to utf8, use base64 for binary files")
18318
18393
  },
@@ -18323,7 +18398,7 @@ var ACTION_DEFINITIONS = [
18323
18398
  {
18324
18399
  name: "computer_checkpoint",
18325
18400
  title: "Checkpoint completed work",
18326
- description: "Save an intermediate complete unit of project work into durable Thread lineage. A running background process may still be writing the workspace, so checkpointing refuses until it is finished or explicitly terminated; use computer_status to inspect active processes. For the final unit, call computer_stop instead; it performs the final checkpoint before teardown. No checkpoint is needed for computer_verify alone because remote visual capture starts no project runtime.",
18401
+ description: "Save the live parent Thread Computer into durable Thread lineage. This is intentionally not Run-scoped: isolated Run publication/integration is a separate contract. If your work is in an isolated Run, do not call this expecting it to save that fork; publish the work through its repository workflow first. A running background process may still be writing the workspace, so checkpointing refuses until it is finished or explicitly terminated; use computer_status to inspect active processes. For the final unit, call computer_stop instead; it performs the final checkpoint before teardown. No checkpoint is needed for computer_verify alone because remote visual capture starts no project runtime.",
18327
18402
  inputSchema: {
18328
18403
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…")
18329
18404
  },
@@ -18334,7 +18409,7 @@ var ACTION_DEFINITIONS = [
18334
18409
  {
18335
18410
  name: "computer_publish_preview",
18336
18411
  title: "Publish an immutable static Preview",
18337
- description: "Publish one checked HTML file or bounded static build directory as a private immutable Preview after checkpointing its source. The returned arborthreads.dev URL survives computer teardown; put it on its own line to show the interactive Preview card. A directory must contain index.html, use relative local asset URLs, and cannot include dotfiles, source maps, secrets, symlinks, or server code. Supply one stable idempotencyKey per logical publication: safe retries return the original immutable URL, while reusing the key for another path/title conflicts.",
18412
+ description: "Publish one checked HTML file or bounded static build directory from the live parent Thread Computer as a private immutable Preview after checkpointing its source. This is intentionally not Run-scoped yet; an isolated Run must not silently publish stale parent files or imply integration. The returned arborthreads.dev URL survives computer teardown; put it on its own line to show the interactive Preview card. A directory must contain index.html, use relative local asset URLs, and cannot include dotfiles, source maps, secrets, symlinks, or server code. Supply one stable idempotencyKey per logical publication: safe retries return the original immutable URL, while reusing the key for another path/title conflicts.",
18338
18413
  inputSchema: {
18339
18414
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18340
18415
  path: exports_external.string().describe("absolute path to one HTML file or static build directory under /workspace"),
@@ -18348,7 +18423,7 @@ var ACTION_DEFINITIONS = [
18348
18423
  {
18349
18424
  name: "computer_publish_app_bundle",
18350
18425
  title: "Publish an immutable AppBundle",
18351
- description: "After a Bun container build is green, verify that entryPath bytes exactly match the referenced ArtifactVersion, capture source hashes plus Git/workspace provenance, then freeze the Worker module and optional static assets into a content-addressed AppBundle. A mismatch is rejected; dirty or untracked source is allowed but returned as an explicit warning. Use the returned bundleId with app_deploy; retries require the same idempotencyKey.",
18426
+ description: "From the live parent Thread Computer, after a Bun container build is green, verify that entryPath bytes exactly match the referenced ArtifactVersion. This is intentionally not Run-scoped yet; isolated Run publication requires a separate integration/provenance decision. Then capture source hashes plus Git/workspace provenance, then freeze the Worker module and optional static assets into a content-addressed AppBundle. A mismatch is rejected; dirty or untracked source is allowed but returned as an explicit warning. Use the returned bundleId with app_deploy; retries require the same idempotencyKey.",
18352
18427
  inputSchema: {
18353
18428
  computerSessionId: exports_external.string().describe("the computerSessionId returned by computer_open, cms_…"),
18354
18429
  artifactVersionId: exports_external.string().describe("the source ArtifactVersion, artv_…"),
@@ -18381,7 +18456,7 @@ var ACTION_DEFINITIONS = [
18381
18456
  {
18382
18457
  name: "get_computer",
18383
18458
  title: "Read a Thread computer",
18384
- description: "Read a Thread's redacted effective recipe, active materialized generation, compatibility state, historical generation lineage, current Topic/Thread snapshot refs, recent attachment receipts, active and recent runs with each run's mode/isolation/workspace, and replacement outcomes. Recipe metadata includes provider/backend/profile/repositories/config revision and whether setup is configured, never setup content or credentials. This is durable Arbor protocol state, not live process/presence status.",
18459
+ description: "Read a Thread's redacted effective recipe, active materialized generation, compatibility state, historical generation lineage, current Topic/Thread snapshot refs, recent attachment receipts, active and recent runs with each run's mode/execution/workspace, and replacement outcomes. Recipe metadata includes provider/backend/profile/repositories/config revision and whether setup is configured, never setup content or credentials. This is durable Arbor protocol state, not live process/presence status.",
18385
18460
  inputSchema: {
18386
18461
  threadId: exports_external.string().describe("the Thread, thr_…"),
18387
18462
  lineageLimit: exports_external.number().int().min(1).max(100).optional().describe("recent receipts/lineage rows (default 20)")
@@ -20021,7 +20096,6 @@ var httpExecutor = {
20021
20096
  };
20022
20097
 
20023
20098
  // src/output.ts
20024
- import { randomUUID } from "node:crypto";
20025
20099
  function lastValue(value) {
20026
20100
  return Array.isArray(value) ? value[value.length - 1] : value;
20027
20101
  }
@@ -20082,14 +20156,10 @@ function applyFields(data, fields) {
20082
20156
  out.nextCursor = obj.nextCursor;
20083
20157
  return out;
20084
20158
  }
20085
- function emitData(data, action, ctx) {
20159
+ function emitData(data, _action, ctx) {
20086
20160
  const shaped = ctx.fields ? applyFields(data, ctx.fields) : data;
20087
20161
  if (ctx.json) {
20088
- const envelope = {
20089
- ok: true,
20090
- data: shaped,
20091
- meta: { action, requestId: randomUUID() }
20092
- };
20162
+ const envelope = { ok: true, data: shaped };
20093
20163
  process.stdout.write(`${JSON.stringify(envelope)}
20094
20164
  `);
20095
20165
  } else {
@@ -20097,14 +20167,13 @@ function emitData(data, action, ctx) {
20097
20167
  `);
20098
20168
  }
20099
20169
  }
20100
- function emitError(err, action, ctx) {
20170
+ function emitError(err, _action, ctx) {
20101
20171
  const code = codeForError(err);
20102
20172
  const message = err instanceof Error ? err.message : String(err);
20103
20173
  if (ctx.json) {
20104
20174
  const envelope = {
20105
20175
  ok: false,
20106
- error: { code, message, ...detailsForError(err) },
20107
- meta: { action, requestId: randomUUID() }
20176
+ error: { code, message, ...detailsForError(err) }
20108
20177
  };
20109
20178
  process.stdout.write(`${JSON.stringify(envelope)}
20110
20179
  `);
@@ -20481,12 +20550,12 @@ async function runObjectVerb(positionals, flags, ctx) {
20481
20550
  if (extras.length > positionalTargets.length) {
20482
20551
  throw new UsageError(`too many arguments: \`${commandWords(action)}\` takes ${positionalTargets.length === 1 ? "one positional" : `${positionalTargets.length} positionals`}; pass the rest as flags`);
20483
20552
  }
20484
- for (const [index2, value] of extras.entries()) {
20553
+ for (const [index2, value2] of extras.entries()) {
20485
20554
  const target = positionalTargets[index2];
20486
20555
  if (flags[target.flag] !== undefined || flags[`${target.flag}-file`] !== undefined) {
20487
20556
  throw new UsageError(`pass --${target.flag} either as a flag or as the positional argument, not both`);
20488
20557
  }
20489
- flags[target.flag] = value;
20558
+ flags[target.flag] = value2;
20490
20559
  }
20491
20560
  }
20492
20561
  const accepted = acceptedFlags(action.inputSchema);
@@ -20520,7 +20589,8 @@ async function runObjectVerb(positionals, flags, ctx) {
20520
20589
  advise(`Agent registered. Save its apiKey now — it is shown only once:
20521
20590
  `, ctx);
20522
20591
  }
20523
- emitData(await action.run(httpExecutor, input), action.name, ctx);
20592
+ const value = await action.run(httpExecutor, input);
20593
+ emitData(shapeActionOutput(action.name, value, input), action.name, ctx);
20524
20594
  }
20525
20595
 
20526
20596
  // src/connect.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
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",