@lambdacurry/arbor 0.22.7 → 0.22.9

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 +102 -7
  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.7",
5
+ version: "0.22.9",
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",
@@ -4910,6 +4910,13 @@ function json(params) {
4910
4910
  }
4911
4911
  // ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
4912
4912
  config(en_default());
4913
+ // ../actions/src/agent-guides.ts
4914
+ var AGENT_GUIDE_URLS = {
4915
+ tldraw: "https://arborthreads.com/docs/agents/tldraw",
4916
+ computer: "https://arborthreads.com/docs/agents/computer",
4917
+ apps: "https://arborthreads.com/docs/agents/apps"
4918
+ };
4919
+
4913
4920
  // ../core/src/objects/types.ts
4914
4921
  var CONTRIBUTION_TYPES = [
4915
4922
  "comment",
@@ -9722,6 +9729,88 @@ Artifacts Arbor keeps current. Use it to decide things with others and to rememb
9722
9729
  ${orientation}
9723
9730
  `;
9724
9731
  }
9732
+
9733
+ // ../actions/src/tldraw-agent.ts
9734
+ var TLDRAW_EXEC_MAX_OPERATIONS = 100;
9735
+ var shapeId = string2().regex(/^shape:[A-Za-z0-9_-]{1,128}$/).describe("stable tldraw shape id, shape:…");
9736
+ var shapeType = _enum(["geo", "text", "note", "frame", "arrow", "line", "draw", "group"]).describe("built-in tldraw shape type; use code mode for custom or asset-backed shapes");
9737
+ var finite = number2().finite();
9738
+ var jsonRecord = record(string2(), unknown());
9739
+ var create = object({
9740
+ op: literal("create"),
9741
+ id: shapeId,
9742
+ type: shapeType,
9743
+ x: finite,
9744
+ y: finite,
9745
+ parentId: string2().min(1).max(200).optional(),
9746
+ rotation: finite.optional(),
9747
+ opacity: finite.min(0).max(1).optional(),
9748
+ isLocked: boolean2().optional(),
9749
+ props: jsonRecord.optional().describe("shape properties such as w, h, geo, color, or richText"),
9750
+ meta: jsonRecord.optional()
9751
+ }).strict();
9752
+ var update = object({
9753
+ op: literal("update"),
9754
+ id: shapeId,
9755
+ type: shapeType,
9756
+ x: finite.optional(),
9757
+ y: finite.optional(),
9758
+ parentId: string2().min(1).max(200).optional(),
9759
+ rotation: finite.optional(),
9760
+ opacity: finite.min(0).max(1).optional(),
9761
+ isLocked: boolean2().optional(),
9762
+ props: jsonRecord.optional().describe("partial shape properties"),
9763
+ meta: jsonRecord.optional()
9764
+ }).strict();
9765
+ var shapeIds = array(shapeId).min(1).max(TLDRAW_EXEC_MAX_OPERATIONS);
9766
+ var TLDRAW_EXEC_OPERATION_SCHEMA = discriminatedUnion("op", [
9767
+ create,
9768
+ update,
9769
+ object({ op: literal("delete"), ids: shapeIds }).strict(),
9770
+ object({
9771
+ op: literal("align"),
9772
+ ids: shapeIds.min(2),
9773
+ alignment: _enum(["bottom", "center-horizontal", "center-vertical", "left", "right", "top"])
9774
+ }).strict(),
9775
+ object({
9776
+ op: literal("distribute"),
9777
+ ids: shapeIds.min(3),
9778
+ axis: _enum(["horizontal", "vertical"])
9779
+ }).strict(),
9780
+ object({
9781
+ op: literal("group"),
9782
+ ids: shapeIds.min(2),
9783
+ groupId: shapeId.optional()
9784
+ }).strict()
9785
+ ]);
9786
+ var TLDRAW_EXEC_OPERATIONS_SCHEMA = array(TLDRAW_EXEC_OPERATION_SCHEMA).min(1).max(TLDRAW_EXEC_MAX_OPERATIONS).superRefine((operations, ctx) => {
9787
+ const createdIds = new Set;
9788
+ operations.forEach((operation, index) => {
9789
+ if (operation.op === "create") {
9790
+ if (createdIds.has(operation.id)) {
9791
+ ctx.addIssue({
9792
+ code: "custom",
9793
+ message: `duplicate create id: ${operation.id}`,
9794
+ path: [index, "id"]
9795
+ });
9796
+ }
9797
+ createdIds.add(operation.id);
9798
+ }
9799
+ if ("ids" in operation) {
9800
+ const seen = new Set;
9801
+ operation.ids.forEach((id, idIndex) => {
9802
+ if (seen.has(id)) {
9803
+ ctx.addIssue({
9804
+ code: "custom",
9805
+ message: `duplicate shape id: ${id}`,
9806
+ path: [index, "ids", idIndex]
9807
+ });
9808
+ }
9809
+ seen.add(id);
9810
+ });
9811
+ }
9812
+ });
9813
+ }).describe("preferred declarative edits, applied in order; mutually exclusive with code");
9725
9814
  // ../actions/src/index.ts
9726
9815
  var ARBOR_FEEDBACK_INPUT_TYPES = [...ARBOR_FEEDBACK_TYPES, "friction"];
9727
9816
  var CONTRIBUTION_ADD_LINK_RELS = [
@@ -10494,7 +10583,7 @@ var ACTION_DEFINITIONS = [
10494
10583
  {
10495
10584
  name: "computer_run_start",
10496
10585
  title: "Start a run",
10497
- description: "Start one bounded unit of work on a Thread's Computer by threadId, no computer_open first: an isolated write Run (the default) restores its own environment from the Thread's snapshot without booting the parent; shared and read Runs use the live parent. The caller-owned idempotencyKey makes a lost response recover zero-or-one Run, and failures return the exact runId for computer_run_receipt.",
10586
+ description: `Start one bounded unit of work by threadId, no computer_open first: write defaults to an isolated Run from the Thread snapshot without booting the parent; shared/read Runs use the live parent; idempotencyKey recovers zero-or-one Run after response loss, and failures return runId for computer_run_receipt. First use: read the Computer guide at ${AGENT_GUIDE_URLS.computer}.`,
10498
10587
  inputSchema: {
10499
10588
  threadId: string2().optional().describe("the Thread whose Computer this Run works in, thr_…; the front door — no computer_open first"),
10500
10589
  computerSessionId: string2().optional().describe("alternative to threadId: an existing computerSessionId from computer_open, cms_… (parent already open)"),
@@ -10773,7 +10862,7 @@ var ACTION_DEFINITIONS = [
10773
10862
  {
10774
10863
  name: "computer_publish_app_bundle",
10775
10864
  title: "Publish an immutable AppBundle",
10776
- description: "Publish an immutable AppBundle from the parent Computer behind a shared write Run (runId) after a green build when an ArtifactVersion is ready; Arbor acquires compatible bun-typescript-v1 execution internally. Verifies entry bytes against the ArtifactVersion, captures source/Git provenance and static assets, and returns bundleId; isolated Runs are refused, so push and start a shared Run first.",
10865
+ description: `Publish an immutable AppBundle from parent bytes behind a shared write Run after a green build; Arbor acquires compatible bun-typescript-v1 execution, verifies bytes against ArtifactVersion, captures provenance/assets, and returns bundleId; isolated Runs are refused, so push then start shared first. First use: read the Apps guide at ${AGENT_GUIDE_URLS.apps}.`,
10777
10866
  inputSchema: {
10778
10867
  runId: string2().optional().describe("an active shared write Run on the parent whose bytes to publish, run_…"),
10779
10868
  computerSessionId: string2().optional().describe("legacy alternative to runId: a computerSessionId on that Computer, cms_…"),
@@ -11936,7 +12025,7 @@ var ACTION_DEFINITIONS = [
11936
12025
  {
11937
12026
  name: "tldraw_observe",
11938
12027
  title: "Observe a tldraw board",
11939
- description: "Capture a fresh bounded tldraw scene, lint result, document clock and digest, plus a PNG attachment for visual review.",
12028
+ description: `Capture a fresh bounded tldraw scene, lint result, document clock and digest, plus a PNG attachment for visual review; observe before editing. First use: read the tldraw guide at ${AGENT_GUIDE_URLS.tldraw}.`,
11940
12029
  inputSchema: {
11941
12030
  artifactId: string2().describe("the tldraw Artifact, art_…"),
11942
12031
  pageId: string2().min(1).max(200).optional().describe("optional page to observe"),
@@ -11950,10 +12039,11 @@ var ACTION_DEFINITIONS = [
11950
12039
  {
11951
12040
  name: "tldraw_exec",
11952
12041
  title: "Run a one-shot tldraw program",
11953
- description: "Run bounded one-shot code against the current live tldraw board without changing its persistent document script, and return a durable execution receipt. An unknown result is reported for recovery and is never replayed automatically.",
12042
+ description: `Modify the current live tldraw board with preferred declarative operations or bounded JavaScript, then return a durable execution receipt; observe first, and never replay an unknown result automatically. First use: read the tldraw guide at ${AGENT_GUIDE_URLS.tldraw}.`,
11954
12043
  inputSchema: {
11955
12044
  artifactId: string2().describe("the tldraw Artifact, art_…"),
11956
- code: string2().min(1).max(1e5).describe("the script source to execute"),
12045
+ code: string2().min(1).max(1e5).optional().describe("advanced script source; mutually exclusive with operations"),
12046
+ operations: TLDRAW_EXEC_OPERATIONS_SCHEMA.optional(),
11957
12047
  idempotencyKey: string2().min(1).max(200).describe("stable key for this execution"),
11958
12048
  expectedDocumentClock: number2().int().min(0).optional().describe("optional current room clock guard"),
11959
12049
  boundedSettleMs: number2().int().min(400).max(3000).optional().describe("maximum settle time")
@@ -12231,7 +12321,7 @@ var ACTION_DEFINITIONS = [
12231
12321
  {
12232
12322
  name: "app_create",
12233
12323
  title: "Create an App",
12234
- description: "Create a stable first-class App identity in a Space before deploying code. Public Apps are stateless and start public+unlisted+none; durable Apps are always space+durable with membership authorization and isolated SQLite state.",
12324
+ description: `Create a stable first-class App identity in a Space before deploying code; public Apps are stateless and start public+unlisted+none, while durable Apps are always space+durable with membership authorization and isolated SQLite state. First use: read the Apps guide at ${AGENT_GUIDE_URLS.apps}.`,
12235
12325
  inputSchema: {
12236
12326
  spaceId: string2().describe("owning Space, spc_…"),
12237
12327
  title: string2().min(1).max(160).describe("short factual App title"),
@@ -12549,6 +12639,11 @@ function retentionAction(action) {
12549
12639
  var ACTIONS2 = ACTIONS.map(retentionAction);
12550
12640
 
12551
12641
  // ../actions/src/recovery-entry.ts
12642
+ var TLDRAW_GUIDE_URI = AGENT_GUIDE_URLS.tldraw;
12643
+ var TLDRAW_GUIDE_MARKDOWN = `# Working well in native tldraw
12644
+
12645
+ This guide moved to ${AGENT_GUIDE_URLS.tldraw}.
12646
+ `;
12552
12647
  var grantOutput = object({
12553
12648
  grant: object({
12554
12649
  grantId: string2(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.22.7",
3
+ "version": "0.22.9",
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",