@lambdacurry/arbor 0.19.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 +123 -61
  2. package/package.json +1 -1
package/dist/arbor.js CHANGED
@@ -17053,34 +17053,24 @@ var MCP_OUTPUT_SCHEMAS = {
17053
17053
  recall: exports_external.object({ result: exports_external.array(recallHit) }),
17054
17054
  contribute: exports_external.looseObject({
17055
17055
  contributionId: id,
17056
- threadId: id,
17057
- type: exports_external.string(),
17058
17056
  replayed: exports_external.boolean(),
17059
17057
  url: exports_external.string(),
17060
17058
  priorArt: exports_external.array(contributionRef).optional(),
17061
17059
  summaryHint: exports_external.string().optional()
17062
17060
  }),
17063
- edit: exports_external.looseObject({ contributionId: id, editedAt: timestamp }),
17064
- stamp: exports_external.looseObject({
17065
- reviewId: id,
17066
- contributionId: id,
17067
- facetKey: exports_external.string().nullable(),
17068
- polarity: exports_external.string().nullable()
17069
- }),
17061
+ edit: exports_external.looseObject({ editedAt: timestamp }),
17062
+ stamp: exports_external.looseObject({ reviewId: id }),
17070
17063
  react: exports_external.looseObject({
17071
17064
  reacted: exports_external.boolean(),
17072
- targetType: exports_external.string(),
17073
- targetId: id,
17074
- emoji: exports_external.string(),
17075
17065
  reactions: exports_external.array(reactionCount)
17076
17066
  }),
17077
- create_topic: topic2,
17067
+ create_topic: exports_external.looseObject({ topicId: id }),
17078
17068
  topic_update: exports_external.looseObject({
17079
17069
  id,
17080
17070
  title: exports_external.string().optional(),
17081
17071
  purpose: nullableString.optional()
17082
17072
  }),
17083
- create_thread: thread3,
17073
+ create_thread: exports_external.looseObject({ threadId: id }),
17084
17074
  set_organization_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
17085
17075
  set_space_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
17086
17076
  set_topic_computer: exports_external.looseObject({ config: computerConfigLayer.nullable() }),
@@ -17139,30 +17129,20 @@ var MCP_OUTPUT_SCHEMAS = {
17139
17129
  reason: exports_external.string().optional(),
17140
17130
  currentSnapshotId: nullableString.optional()
17141
17131
  }),
17142
- transition_thread: exports_external.looseObject({ threadId: id, status: exports_external.string() }),
17132
+ transition_thread: exports_external.looseObject({ status: exports_external.string() }),
17143
17133
  request: exports_external.looseObject({
17144
17134
  requestId: id,
17145
- threadId: id,
17146
- audience: exports_external.string(),
17147
- completion: exports_external.string(),
17148
17135
  status: exports_external.string(),
17149
17136
  opensAt: timestamp.optional()
17150
17137
  }),
17151
17138
  respond: exports_external.looseObject({
17152
- requestId: id,
17153
- requestStatus: exports_external.string(),
17154
17139
  contributionId: id,
17155
- computerSessionId: id.optional(),
17156
- attachmentIds: exports_external.array(id).optional()
17157
- }),
17158
- mark_as_response: exports_external.looseObject({
17159
- requestId: id,
17160
- requestStatus: exports_external.string(),
17161
- contributionId: id
17140
+ requestStatus: exports_external.string()
17162
17141
  }),
17163
- 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() }),
17164
17144
  inbox: paged("items", jsonObject),
17165
- dismiss: exports_external.looseObject({ inboxItemId: id, status: exports_external.literal("dismissed") }),
17145
+ dismiss: exports_external.looseObject({ status: exports_external.literal("dismissed") }),
17166
17146
  whoami: exports_external.looseObject({
17167
17147
  profile: profile2,
17168
17148
  client: exports_external.looseObject({ id, kind: exports_external.string() }),
@@ -17192,7 +17172,7 @@ var MCP_OUTPUT_SCHEMAS = {
17192
17172
  }),
17193
17173
  tree: exports_external.looseObject({ spaces: exports_external.array(treeSpace) }),
17194
17174
  members: exports_external.looseObject({ members: exports_external.array(orgMember), total: exports_external.number().optional() }),
17195
- space_create: space3,
17175
+ space_create: exports_external.looseObject({ spaceId: id, visibility: exports_external.string() }),
17196
17176
  space_update: exports_external.looseObject({
17197
17177
  id,
17198
17178
  title: exports_external.string().optional(),
@@ -17417,17 +17397,13 @@ var MCP_OUTPUT_SCHEMAS = {
17417
17397
  }).optional()
17418
17398
  }),
17419
17399
  computer_run_start: exports_external.looseObject({
17420
- run: computerRun,
17421
- workspace: exports_external.looseObject({
17422
- workspaceRoot: exports_external.string(),
17423
- repositories: exports_external.array(exports_external.looseObject({ repository: exports_external.string(), path: exports_external.string() })),
17424
- defaultCwd: exports_external.string(),
17425
- ref: exports_external.string().nullable().optional(),
17426
- root: exports_external.string().optional()
17427
- })
17400
+ runId: id,
17401
+ execution: exports_external.enum(["shared", "isolated"]),
17402
+ baseSnapshotId: id.nullable(),
17403
+ status: exports_external.string()
17428
17404
  }),
17429
17405
  computer_run_finish: exports_external.looseObject({
17430
- run: computerRun,
17406
+ status: exports_external.string(),
17431
17407
  replayed: exports_external.boolean()
17432
17408
  }),
17433
17409
  computer_run_receipt: exports_external.looseObject({
@@ -17455,18 +17431,12 @@ var MCP_OUTPUT_SCHEMAS = {
17455
17431
  stdout: exports_external.string().optional(),
17456
17432
  stderr: exports_external.string().optional(),
17457
17433
  exitCode: exports_external.number().optional(),
17458
- jobId: exports_external.string().optional(),
17459
17434
  processId: exports_external.string().optional(),
17460
17435
  status: exports_external.string().optional(),
17461
- cwd: exports_external.string(),
17462
- strict: exports_external.boolean()
17436
+ cwd: exports_external.string().optional()
17463
17437
  }),
17464
17438
  computer_process_read: exports_external.looseObject({
17465
- processId: id,
17466
17439
  status: exports_external.string(),
17467
- command: exports_external.string().optional(),
17468
- cwd: exports_external.string().optional(),
17469
- startedAt: timestamp.nullable().optional(),
17470
17440
  endedAt: timestamp.nullable().optional(),
17471
17441
  durationMs: exports_external.number().int().min(0).nullable().optional(),
17472
17442
  stdout: exports_external.string().optional(),
@@ -17476,7 +17446,6 @@ var MCP_OUTPUT_SCHEMAS = {
17476
17446
  exitCode: exports_external.number().int().nullable().optional()
17477
17447
  }),
17478
17448
  computer_process_terminate: exports_external.looseObject({
17479
- processId: id,
17480
17449
  status: exports_external.string(),
17481
17450
  terminated: exports_external.boolean().optional()
17482
17451
  }),
@@ -17515,7 +17484,6 @@ var MCP_OUTPUT_SCHEMAS = {
17515
17484
  }),
17516
17485
  computer_write: exports_external.looseObject({
17517
17486
  ok: exports_external.boolean(),
17518
- path: exports_external.string().optional(),
17519
17487
  size: exports_external.number().optional()
17520
17488
  }),
17521
17489
  computer_checkpoint: checkpoint,
@@ -17589,6 +17557,105 @@ function outputSchemaFor(actionName) {
17589
17557
  return MCP_OUTPUT_SCHEMAS[actionName];
17590
17558
  }
17591
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
+ }
17592
17659
  // ../actions/src/tool-annotations.ts
17593
17660
  var readOnly = {
17594
17661
  readOnlyHint: true,
@@ -20029,7 +20096,6 @@ var httpExecutor = {
20029
20096
  };
20030
20097
 
20031
20098
  // src/output.ts
20032
- import { randomUUID } from "node:crypto";
20033
20099
  function lastValue(value) {
20034
20100
  return Array.isArray(value) ? value[value.length - 1] : value;
20035
20101
  }
@@ -20090,14 +20156,10 @@ function applyFields(data, fields) {
20090
20156
  out.nextCursor = obj.nextCursor;
20091
20157
  return out;
20092
20158
  }
20093
- function emitData(data, action, ctx) {
20159
+ function emitData(data, _action, ctx) {
20094
20160
  const shaped = ctx.fields ? applyFields(data, ctx.fields) : data;
20095
20161
  if (ctx.json) {
20096
- const envelope = {
20097
- ok: true,
20098
- data: shaped,
20099
- meta: { action, requestId: randomUUID() }
20100
- };
20162
+ const envelope = { ok: true, data: shaped };
20101
20163
  process.stdout.write(`${JSON.stringify(envelope)}
20102
20164
  `);
20103
20165
  } else {
@@ -20105,14 +20167,13 @@ function emitData(data, action, ctx) {
20105
20167
  `);
20106
20168
  }
20107
20169
  }
20108
- function emitError(err, action, ctx) {
20170
+ function emitError(err, _action, ctx) {
20109
20171
  const code = codeForError(err);
20110
20172
  const message = err instanceof Error ? err.message : String(err);
20111
20173
  if (ctx.json) {
20112
20174
  const envelope = {
20113
20175
  ok: false,
20114
- error: { code, message, ...detailsForError(err) },
20115
- meta: { action, requestId: randomUUID() }
20176
+ error: { code, message, ...detailsForError(err) }
20116
20177
  };
20117
20178
  process.stdout.write(`${JSON.stringify(envelope)}
20118
20179
  `);
@@ -20489,12 +20550,12 @@ async function runObjectVerb(positionals, flags, ctx) {
20489
20550
  if (extras.length > positionalTargets.length) {
20490
20551
  throw new UsageError(`too many arguments: \`${commandWords(action)}\` takes ${positionalTargets.length === 1 ? "one positional" : `${positionalTargets.length} positionals`}; pass the rest as flags`);
20491
20552
  }
20492
- for (const [index2, value] of extras.entries()) {
20553
+ for (const [index2, value2] of extras.entries()) {
20493
20554
  const target = positionalTargets[index2];
20494
20555
  if (flags[target.flag] !== undefined || flags[`${target.flag}-file`] !== undefined) {
20495
20556
  throw new UsageError(`pass --${target.flag} either as a flag or as the positional argument, not both`);
20496
20557
  }
20497
- flags[target.flag] = value;
20558
+ flags[target.flag] = value2;
20498
20559
  }
20499
20560
  }
20500
20561
  const accepted = acceptedFlags(action.inputSchema);
@@ -20528,7 +20589,8 @@ async function runObjectVerb(positionals, flags, ctx) {
20528
20589
  advise(`Agent registered. Save its apiKey now — it is shown only once:
20529
20590
  `, ctx);
20530
20591
  }
20531
- 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);
20532
20594
  }
20533
20595
 
20534
20596
  // src/connect.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.19.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",