@lambdacurry/arbor 0.23.27 → 0.23.28
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.
- package/dist/arbor.js +176 -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.
|
|
5
|
+
version: "0.23.28",
|
|
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);
|
|
@@ -11111,13 +11279,19 @@ var ACTION_DEFINITIONS = [
|
|
|
11111
11279
|
{
|
|
11112
11280
|
name: "recall",
|
|
11113
11281
|
title: "Recall existing knowledge",
|
|
11114
|
-
description: "Search Arbor semantically for existing contributions, artifacts, and decisions. Use `tree` for lifecycle/attention routing;
|
|
11282
|
+
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
11283
|
inputSchema: {
|
|
11116
11284
|
query: string2().min(1).describe("what you want to recall, in natural language"),
|
|
11117
11285
|
space: string2().optional().describe("optional space id to scope the search"),
|
|
11118
11286
|
topic: string2().optional().describe("optional topic id to scope the search"),
|
|
11119
11287
|
thread: string2().optional().describe("optional thread id to scope the search"),
|
|
11120
11288
|
topK: number2().int().min(1).optional().describe("how many results to return (default 10)"),
|
|
11289
|
+
status: union([
|
|
11290
|
+
literal("current"),
|
|
11291
|
+
_enum(LIFECYCLE_TYPES),
|
|
11292
|
+
tuple([literal("current")]),
|
|
11293
|
+
array(_enum(LIFECYCLE_TYPES)).min(1).max(8)
|
|
11294
|
+
]).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
11295
|
includeHistorical: boolean2().optional().describe("include superseded/archived knowledge (default false)")
|
|
11122
11296
|
},
|
|
11123
11297
|
surfaces: ["mcp", "cli"],
|
package/package.json
CHANGED