@lambdacurry/arbor 0.23.27 → 0.23.29

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 +209 -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.23.27",
5
+ version: "0.23.29",
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",
@@ -2232,6 +2232,112 @@ function handleIntersectionResults(result, left, right) {
2232
2232
  result.value = merged.data;
2233
2233
  return result;
2234
2234
  }
2235
+ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
2236
+ $ZodType.init(inst, def);
2237
+ const items = def.items;
2238
+ inst._zod.parse = (payload, ctx) => {
2239
+ const input = payload.value;
2240
+ if (!Array.isArray(input)) {
2241
+ payload.issues.push({
2242
+ input,
2243
+ inst,
2244
+ expected: "tuple",
2245
+ code: "invalid_type"
2246
+ });
2247
+ return payload;
2248
+ }
2249
+ payload.value = [];
2250
+ const proms = [];
2251
+ const optinStart = getTupleOptStart(items, "optin");
2252
+ const optoutStart = getTupleOptStart(items, "optout");
2253
+ if (!def.rest) {
2254
+ if (input.length < optinStart) {
2255
+ payload.issues.push({
2256
+ code: "too_small",
2257
+ minimum: optinStart,
2258
+ inclusive: true,
2259
+ input,
2260
+ inst,
2261
+ origin: "array"
2262
+ });
2263
+ return payload;
2264
+ }
2265
+ if (input.length > items.length) {
2266
+ payload.issues.push({
2267
+ code: "too_big",
2268
+ maximum: items.length,
2269
+ inclusive: true,
2270
+ input,
2271
+ inst,
2272
+ origin: "array"
2273
+ });
2274
+ }
2275
+ }
2276
+ const itemResults = new Array(items.length);
2277
+ for (let i = 0;i < items.length; i++) {
2278
+ const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);
2279
+ if (r instanceof Promise) {
2280
+ proms.push(r.then((rr) => {
2281
+ itemResults[i] = rr;
2282
+ }));
2283
+ } else {
2284
+ itemResults[i] = r;
2285
+ }
2286
+ }
2287
+ if (def.rest) {
2288
+ let i = items.length - 1;
2289
+ const rest = input.slice(items.length);
2290
+ for (const el of rest) {
2291
+ i++;
2292
+ const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
2293
+ if (result instanceof Promise) {
2294
+ proms.push(result.then((r) => handleTupleResult(r, payload, i)));
2295
+ } else {
2296
+ handleTupleResult(result, payload, i);
2297
+ }
2298
+ }
2299
+ }
2300
+ if (proms.length) {
2301
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
2302
+ }
2303
+ return handleTupleResults(itemResults, payload, items, input, optoutStart);
2304
+ };
2305
+ });
2306
+ function getTupleOptStart(items, key) {
2307
+ for (let i = items.length - 1;i >= 0; i--) {
2308
+ if (items[i]._zod[key] !== "optional")
2309
+ return i + 1;
2310
+ }
2311
+ return 0;
2312
+ }
2313
+ function handleTupleResult(result, final, index) {
2314
+ if (result.issues.length) {
2315
+ final.issues.push(...prefixIssues(index, result.issues));
2316
+ }
2317
+ final.value[index] = result.value;
2318
+ }
2319
+ function handleTupleResults(itemResults, final, items, input, optoutStart) {
2320
+ for (let i = 0;i < items.length; i++) {
2321
+ const r = itemResults[i];
2322
+ const isPresent = i < input.length;
2323
+ if (r.issues.length) {
2324
+ if (!isPresent && i >= optoutStart) {
2325
+ final.value.length = i;
2326
+ break;
2327
+ }
2328
+ final.issues.push(...prefixIssues(i, r.issues));
2329
+ }
2330
+ final.value[i] = r.value;
2331
+ }
2332
+ for (let i = final.value.length - 1;i >= input.length; i--) {
2333
+ if (items[i]._zod.optout === "optional" && final.value[i] === undefined) {
2334
+ final.value.length = i;
2335
+ } else {
2336
+ break;
2337
+ }
2338
+ }
2339
+ return final;
2340
+ }
2235
2341
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2236
2342
  $ZodType.init(inst, def);
2237
2343
  inst._zod.parse = (payload, ctx) => {
@@ -3875,6 +3981,48 @@ var intersectionProcessor = (schema, ctx, json, params) => {
3875
3981
  ];
3876
3982
  json.allOf = allOf;
3877
3983
  };
3984
+ var tupleProcessor = (schema, ctx, _json, params) => {
3985
+ const json = _json;
3986
+ const def = schema._zod.def;
3987
+ json.type = "array";
3988
+ const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
3989
+ const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
3990
+ const prefixItems = def.items.map((x, i) => process2(x, ctx, {
3991
+ ...params,
3992
+ path: [...params.path, prefixPath, i]
3993
+ }));
3994
+ const rest = def.rest ? process2(def.rest, ctx, {
3995
+ ...params,
3996
+ path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
3997
+ }) : null;
3998
+ if (ctx.target === "draft-2020-12") {
3999
+ json.prefixItems = prefixItems;
4000
+ if (rest) {
4001
+ json.items = rest;
4002
+ }
4003
+ } else if (ctx.target === "openapi-3.0") {
4004
+ json.items = {
4005
+ anyOf: prefixItems
4006
+ };
4007
+ if (rest) {
4008
+ json.items.anyOf.push(rest);
4009
+ }
4010
+ json.minItems = prefixItems.length;
4011
+ if (!rest) {
4012
+ json.maxItems = prefixItems.length;
4013
+ }
4014
+ } else {
4015
+ json.items = prefixItems;
4016
+ if (rest) {
4017
+ json.additionalItems = rest;
4018
+ }
4019
+ }
4020
+ const { minimum, maximum } = schema._zod.bag;
4021
+ if (typeof minimum === "number")
4022
+ json.minItems = minimum;
4023
+ if (typeof maximum === "number")
4024
+ json.maxItems = maximum;
4025
+ };
3878
4026
  var recordProcessor = (schema, ctx, _json, params) => {
3879
4027
  const json = _json;
3880
4028
  const def = schema._zod.def;
@@ -4629,6 +4777,26 @@ function intersection(left, right) {
4629
4777
  right
4630
4778
  });
4631
4779
  }
4780
+ var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
4781
+ $ZodTuple.init(inst, def);
4782
+ ZodType.init(inst, def);
4783
+ inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
4784
+ inst.rest = (rest) => inst.clone({
4785
+ ...inst._zod.def,
4786
+ rest
4787
+ });
4788
+ });
4789
+ function tuple(items, _paramsOrRest, _params) {
4790
+ const hasRest = _paramsOrRest instanceof $ZodType;
4791
+ const params = hasRest ? _params : _paramsOrRest;
4792
+ const rest = hasRest ? _paramsOrRest : null;
4793
+ return new ZodTuple({
4794
+ type: "tuple",
4795
+ items,
4796
+ rest,
4797
+ ...normalizeParams(params)
4798
+ });
4799
+ }
4632
4800
  var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4633
4801
  $ZodRecord.init(inst, def);
4634
4802
  ZodType.init(inst, def);
@@ -8766,7 +8934,8 @@ var workflowSummary = looseObject({
8766
8934
  isDefault: boolean2().optional(),
8767
8935
  labels: array(jsonObject).optional(),
8768
8936
  createdAt: string2().optional(),
8769
- updatedAt: string2().optional()
8937
+ updatedAt: string2().optional(),
8938
+ usedBySpaceCount: number2().optional()
8770
8939
  });
8771
8940
  var transitionFrom = looseObject({
8772
8941
  label: string2(),
@@ -8779,7 +8948,8 @@ var topic2 = looseObject({
8779
8948
  spaceId: id.optional(),
8780
8949
  title: string2(),
8781
8950
  purpose: nullableString.optional(),
8782
- url: string2().optional()
8951
+ url: string2().optional(),
8952
+ workflowId: nullableString.optional()
8783
8953
  });
8784
8954
  var space3 = looseObject({
8785
8955
  id,
@@ -9286,7 +9456,32 @@ var MCP_OUTPUT_SCHEMAS = {
9286
9456
  stage: string2().optional(),
9287
9457
  attached: jsonObject.optional(),
9288
9458
  defaulted: jsonObject.optional(),
9289
- detached: jsonObject.optional()
9459
+ detached: jsonObject.optional(),
9460
+ dryRun: boolean2().optional(),
9461
+ preview: looseObject({
9462
+ target: looseObject({ id, name: string2() }),
9463
+ current: looseObject({ id, name: string2() }),
9464
+ changesDefault: boolean2(),
9465
+ inheritingTopics: array(looseObject({
9466
+ topicId: id,
9467
+ title: string2(),
9468
+ threadCount: number2(),
9469
+ moves: array(looseObject({
9470
+ fromLabel: string2(),
9471
+ fromName: string2(),
9472
+ toLabel: string2(),
9473
+ toName: string2(),
9474
+ type: string2(),
9475
+ count: number2()
9476
+ }))
9477
+ })),
9478
+ blocking: array(looseObject({
9479
+ topicId: id,
9480
+ title: string2(),
9481
+ types: array(string2()),
9482
+ threadCount: number2()
9483
+ }))
9484
+ }).optional()
9290
9485
  }),
9291
9486
  space_get: looseObject({
9292
9487
  space: space3,
@@ -11111,13 +11306,19 @@ var ACTION_DEFINITIONS = [
11111
11306
  {
11112
11307
  name: "recall",
11113
11308
  title: "Recall existing knowledge",
11114
- description: "Search Arbor semantically for existing contributions, artifacts, and decisions. Use `tree` for lifecycle/attention routing; once you know the area, pass space/topic/thread to keep recall inside that working set before targeted reads.",
11309
+ description: "Search Arbor semantically for existing contributions, artifacts, and decisions. Use `tree` for lifecycle/attention routing; pass space/topic/thread to narrow the working set, status: current for work awaiting conclusion, or lifecycle types for another slice; omit status for broad prior art.",
11115
11310
  inputSchema: {
11116
11311
  query: string2().min(1).describe("what you want to recall, in natural language"),
11117
11312
  space: string2().optional().describe("optional space id to scope the search"),
11118
11313
  topic: string2().optional().describe("optional topic id to scope the search"),
11119
11314
  thread: string2().optional().describe("optional thread id to scope the search"),
11120
11315
  topK: number2().int().min(1).optional().describe("how many results to return (default 10)"),
11316
+ status: union([
11317
+ literal("current"),
11318
+ _enum(LIFECYCLE_TYPES),
11319
+ tuple([literal("current")]),
11320
+ array(_enum(LIFECYCLE_TYPES)).min(1).max(8)
11321
+ ]).optional().describe("current = active + needs-review + stuck; or one or more protocol lifecycle types. Omit for broad prior art. Explicit status excludes Topic hits; archived includes archived Thread content without includeHistorical."),
11121
11322
  includeHistorical: boolean2().optional().describe("include superseded/archived knowledge (default false)")
11122
11323
  },
11123
11324
  surfaces: ["mcp", "cli"],
@@ -12660,7 +12861,7 @@ var ACTION_DEFINITIONS = [
12660
12861
  {
12661
12862
  name: "space_update",
12662
12863
  title: "Edit a space's config",
12663
- description: "Edit a Space's purpose, title, visibility, or offered workflows (`--attach-workflow` / `--detach-workflow` / `--default-workflow` take a built-in id like `queue` or a catalog `wfl_…`); org owner/admin or that Space's admin only, patching only supplied fields. Norms belong in Space guidance.",
12864
+ description: "Edit a Space's purpose, title, visibility, or offered workflows (`--attach-workflow` / `--detach-workflow` / `--default-workflow` take a built-in id or catalog `wfl_…`; `--dry-run` previews Topic moves); org owner/admin or that Space's admin only, patching only supplied fields. Norms belong in Space guidance.",
12664
12865
  inputSchema: {
12665
12866
  spaceId: string2().describe("the space, spc_…"),
12666
12867
  purpose: string2().optional().describe("why this boundary exists and what it is around — commonly a Product/System, Program/Function, Portfolio/Network, or Practice/Community — plus its dominant work modes (Build, Operate, Coordinate, Discuss, Share) when that helps; plain prose, not metadata syntax"),
@@ -12668,7 +12869,8 @@ var ACTION_DEFINITIONS = [
12668
12869
  visibility: _enum(["open", "private"]).optional().describe("open or private (invite-only)"),
12669
12870
  attachWorkflow: string2().optional().describe("add a workflow to this Space's list: a built-in id (`standard`, `queue`, `content`, `experiment`, `funnel`) or a catalog `wfl_…` from `workflow_list`"),
12670
12871
  detachWorkflow: string2().optional().describe("remove a workflow (built-in id or `wfl_…`) from this Space's list; rejected while a Topic still selects it"),
12671
- defaultWorkflow: string2().optional().describe("name which attached workflow (built-in id or `wfl_…`) new Topics inherit; with none, Standard")
12872
+ defaultWorkflow: string2().optional().describe("name which attached workflow (built-in id or `wfl_…`) new Topics inherit; with none, Standard"),
12873
+ dryRun: boolean2().optional().describe("preview a `defaultWorkflow` change or a `detachWorkflow` without writing: returns `preview` with `inheritingTopics` (each with its label `moves`) and `blocking` Topics whose threads sit in a type the new default lacks")
12672
12874
  },
12673
12875
  surfaces: ["mcp", "cli"],
12674
12876
  toolset: "spaces",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambdacurry/arbor",
3
- "version": "0.23.27",
3
+ "version": "0.23.29",
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",