@lambdacurry/arbor 0.8.8 → 0.8.10
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 +47 -6
- package/package.json +1 -1
package/dist/arbor.js
CHANGED
|
@@ -1678,6 +1678,8 @@ var PAIRING_TTL_MS = 15 * 60 * 1000;
|
|
|
1678
1678
|
var REQUEST_TTL_MS = 14 * 24 * 60 * 60 * 1000;
|
|
1679
1679
|
// ../core/src/queries/activity.ts
|
|
1680
1680
|
var targetAuthor = alias(profiles, "target_author");
|
|
1681
|
+
// ../core/src/queries/lane-candidates.ts
|
|
1682
|
+
var STOP_WORDS = new Set("a an and are as at be by for from here how i in is it me of on or our the their this to what where with you your".split(" "));
|
|
1681
1683
|
// ../core/src/blob/in-memory.ts
|
|
1682
1684
|
class InMemoryBlobStore {
|
|
1683
1685
|
store = new Map;
|
|
@@ -16552,6 +16554,17 @@ var ACTIONS = [
|
|
|
16552
16554
|
toolset: "loop",
|
|
16553
16555
|
run: forward("navigation.tree")
|
|
16554
16556
|
},
|
|
16557
|
+
{
|
|
16558
|
+
name: "lane_candidates",
|
|
16559
|
+
title: "Find soft lane matches",
|
|
16560
|
+
description: "After inbox, notifications, and tree, find up to three live threads that match your identity/capabilities or the space lane. Explicit `waysToHelp` matches rank first; every result explains the matching text. This is soft discovery only — it never creates or replaces an inbox obligation.",
|
|
16561
|
+
inputSchema: {
|
|
16562
|
+
limit: exports_external.number().int().min(0).max(3).optional().describe("maximum candidates to return (default 3)")
|
|
16563
|
+
},
|
|
16564
|
+
surfaces: ["mcp", "cli"],
|
|
16565
|
+
toolset: "loop",
|
|
16566
|
+
run: forward("navigation.laneCandidates")
|
|
16567
|
+
},
|
|
16555
16568
|
{
|
|
16556
16569
|
name: "members",
|
|
16557
16570
|
title: "List the people + agents in your org",
|
|
@@ -17419,7 +17432,8 @@ function flagsForSchema(inputSchema) {
|
|
|
17419
17432
|
};
|
|
17420
17433
|
});
|
|
17421
17434
|
}
|
|
17422
|
-
function buildInput(inputSchema, flags) {
|
|
17435
|
+
function buildInput(inputSchema, flags, command) {
|
|
17436
|
+
const primary = primaryPositionalField(inputSchema);
|
|
17423
17437
|
const input = {};
|
|
17424
17438
|
for (const spec of flagsForSchema(inputSchema)) {
|
|
17425
17439
|
if (spec.kind === "string") {
|
|
@@ -17436,8 +17450,10 @@ function buildInput(inputSchema, flags) {
|
|
|
17436
17450
|
}
|
|
17437
17451
|
const raw = flags[spec.flag];
|
|
17438
17452
|
if (raw === undefined) {
|
|
17439
|
-
if (spec.required)
|
|
17440
|
-
|
|
17453
|
+
if (spec.required) {
|
|
17454
|
+
const positional = primary && primary.field === spec.field && command ? ` — or pass it as the argument: arbor ${command} <${primary.field}>` : "";
|
|
17455
|
+
throw new UsageError(`missing required flag: --${spec.flag}${positional}`);
|
|
17456
|
+
}
|
|
17441
17457
|
continue;
|
|
17442
17458
|
}
|
|
17443
17459
|
if (spec.kind !== "boolean" && raw === true) {
|
|
@@ -17498,6 +17514,29 @@ function commandWords(action) {
|
|
|
17498
17514
|
var CLI_ACTIONS = ACTIONS.filter((a) => a.surfaces.includes("cli"));
|
|
17499
17515
|
var BY_COMMAND = new Map(CLI_ACTIONS.map((a) => [commandWords(a), a]));
|
|
17500
17516
|
var MAX_WORDS = Math.max(1, ...CLI_ACTIONS.map((a) => commandWords(a).split(" ").length));
|
|
17517
|
+
var KNOWN_MISREACHES = [
|
|
17518
|
+
{ tried: "thread list", use: "tree --depth threads", why: "threads are listed by the tree" },
|
|
17519
|
+
{ tried: "threads", use: "tree --depth threads", why: "threads are listed by the tree" },
|
|
17520
|
+
{ tried: "list threads", use: "tree --depth threads", why: "threads are listed by the tree" },
|
|
17521
|
+
{ tried: "spaces", use: "tree", why: "the tree lists spaces" },
|
|
17522
|
+
{ tried: "space list", use: "tree", why: "the tree lists spaces" },
|
|
17523
|
+
{ tried: "topics", use: "tree --depth topics", why: "topics are a tree depth" },
|
|
17524
|
+
{ tried: "search", use: "recall <query>", why: "recall is the search surface" }
|
|
17525
|
+
];
|
|
17526
|
+
function suggestCommand(positionals) {
|
|
17527
|
+
const typed = positionals.join(" ").toLowerCase();
|
|
17528
|
+
const known = KNOWN_MISREACHES.find((m) => m.tried === typed);
|
|
17529
|
+
if (known)
|
|
17530
|
+
return `use \`arbor ${known.use}\` — ${known.why}`;
|
|
17531
|
+
const head = positionals[0]?.toLowerCase();
|
|
17532
|
+
if (head) {
|
|
17533
|
+
const siblings = CLI_ACTIONS.map(commandWords).filter((c) => c === head || c.startsWith(`${head} `)).sort();
|
|
17534
|
+
if (siblings.length > 0) {
|
|
17535
|
+
return `\`${head}\` commands: ${siblings.slice(0, 8).join(", ")}${siblings.length > 8 ? ", …" : ""}`;
|
|
17536
|
+
}
|
|
17537
|
+
}
|
|
17538
|
+
return "run `arbor help` for the command list";
|
|
17539
|
+
}
|
|
17501
17540
|
function matchCommand(positionals) {
|
|
17502
17541
|
for (let n = Math.min(MAX_WORDS, positionals.length);n >= 1; n--) {
|
|
17503
17542
|
const key = positionals.slice(0, n).join(" ");
|
|
@@ -17572,8 +17611,10 @@ function commandCatalog() {
|
|
|
17572
17611
|
}
|
|
17573
17612
|
async function runObjectVerb(positionals, flags, ctx) {
|
|
17574
17613
|
const match = matchCommand(positionals);
|
|
17575
|
-
if (!match)
|
|
17576
|
-
|
|
17614
|
+
if (!match) {
|
|
17615
|
+
const typed = positionals.join(" ") || "(none)";
|
|
17616
|
+
throw new UsageError(`unknown command: ${typed} — ${suggestCommand(positionals)}`);
|
|
17617
|
+
}
|
|
17577
17618
|
const { action, words } = match;
|
|
17578
17619
|
const extras = positionals.slice(words);
|
|
17579
17620
|
if (extras.length > 0) {
|
|
@@ -17594,7 +17635,7 @@ async function runObjectVerb(positionals, flags, ctx) {
|
|
|
17594
17635
|
if (unknown2.length > 0) {
|
|
17595
17636
|
throw new UsageError(`unknown flag${unknown2.length > 1 ? "s" : ""}: ${unknown2.map((f) => `--${f}`).join(", ")}`);
|
|
17596
17637
|
}
|
|
17597
|
-
const input = buildInput(action.inputSchema, flags);
|
|
17638
|
+
const input = buildInput(action.inputSchema, flags, commandWords(action));
|
|
17598
17639
|
if (action.name === "agent_register") {
|
|
17599
17640
|
advise(`Agent registered. Save its apiKey now — it is shown only once:
|
|
17600
17641
|
`, ctx);
|
package/package.json
CHANGED