@slashfi/agents-sdk 0.79.0 → 0.80.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.
@@ -0,0 +1,185 @@
1
+ /**
2
+ * adk search — BM25 over materialized ref/tool docs.
3
+ *
4
+ * Walks `${configDir}/refs/` and indexes every ref + tool + skill found:
5
+ *
6
+ * `<configDir>/refs/<ref>/agent.json` → ref-level fields
7
+ * `<configDir>/refs/<ref>/entrypoint.md` → ref-level body
8
+ * `<configDir>/refs/<ref>/tools/<t>.tool.md` → per-tool body
9
+ * `<configDir>/refs/<ref>/tools/<t>.tool.json` → per-tool param names/descs
10
+ * `<configDir>/refs/<ref>/skills/<file>` → per-resource body
11
+ *
12
+ * Platform agents nest under `refs/agents/<@name>/`; integration refs sit
13
+ * directly at `refs/<name>/`. The walker handles both layouts.
14
+ *
15
+ * One BM25 document per ref + one per tool + one per skill resource. Tool
16
+ * and ref names get inserted multiple times into the document text so they
17
+ * outweigh surrounding prose without the BM25 implementation needing
18
+ * per-field weighting.
19
+ *
20
+ * Persistence: `adk sync` calls `writeSearchIndex(configDir)` to dump the
21
+ * raw BM25 docs + per-doc result metadata to `<configDir>/.search-index.json`.
22
+ * `searchRefs` prefers that file when it exists — `adk search` becomes a
23
+ * single file read + BM25 build (a few ms) instead of a recursive walk.
24
+ * Falls back to a fresh walk when the persisted file is missing or stale.
25
+ *
26
+ * The file is dot-prefixed so coding agents treat it as a hidden artifact
27
+ * and don't try to read it directly — they should use `adk search` instead.
28
+ */
29
+ export interface SearchOptions {
30
+ /** Max results returned. */
31
+ limit?: number;
32
+ /**
33
+ * Restrict to one ref by name. Matches both bare names (`notion`) and
34
+ * platform-agent paths (`/agents/@clock`). Filtering happens after
35
+ * scoring, so other refs' content doesn't affect the ranking of
36
+ * the kept ref's documents.
37
+ */
38
+ ref?: string;
39
+ /** Only include per-tool results. */
40
+ toolsOnly?: boolean;
41
+ /** Only include ref-level results. */
42
+ refsOnly?: boolean;
43
+ }
44
+ export type SearchResult = {
45
+ kind: "tool";
46
+ /** Canonical ref name (e.g. `notion`, `/agents/@clock`). */
47
+ ref: string;
48
+ /** Tool name. */
49
+ tool: string;
50
+ score: number;
51
+ /** First non-blank line of the tool's .tool.md (description). */
52
+ summary: string;
53
+ /** Path to the per-tool .tool.md. */
54
+ docs: string;
55
+ /** Path to the per-tool .tool.json. */
56
+ schema: string;
57
+ /** Suggested CLI snippet. */
58
+ call: string;
59
+ } | {
60
+ kind: "ref";
61
+ /** Canonical ref name. */
62
+ ref: string;
63
+ score: number;
64
+ /** Description from agent.json. */
65
+ summary: string;
66
+ /** Ref directory path. */
67
+ docs: string;
68
+ /** Path to entrypoint.md. */
69
+ entrypoint: string;
70
+ /** Number of tools the ref exposes. */
71
+ toolCount: number;
72
+ } | {
73
+ kind: "resource";
74
+ /** Canonical ref name that owns this resource. */
75
+ ref: string;
76
+ /** Resource name (file basename, e.g. `writing-pages.md`). */
77
+ resource: string;
78
+ score: number;
79
+ /** First non-blank, non-heading line of the resource. */
80
+ summary: string;
81
+ /** Absolute or `~`-rooted path to the resource file. */
82
+ docs: string;
83
+ };
84
+ /** Per-document metadata we need to render a SearchResult — score is added at search time. */
85
+ type IndexItem = {
86
+ kind: "ref";
87
+ ref: string;
88
+ summary: string;
89
+ docs: string;
90
+ entrypoint: string;
91
+ toolCount: number;
92
+ } | {
93
+ kind: "tool";
94
+ ref: string;
95
+ tool: string;
96
+ summary: string;
97
+ docs: string;
98
+ schema: string;
99
+ call: string;
100
+ } | {
101
+ kind: "resource";
102
+ ref: string;
103
+ resource: string;
104
+ summary: string;
105
+ docs: string;
106
+ };
107
+ /**
108
+ * Serialized BM25 index. Written by `writeSearchIndex` (called from
109
+ * `adk sync`) and read by `searchRefs` to skip the recursive filesystem
110
+ * walk on every query.
111
+ *
112
+ * `docs` feeds `createBM25Index` directly. `items` is keyed by the same
113
+ * `id` so we can map ranked hits back to renderable result objects.
114
+ */
115
+ export interface PersistedSearchIndex {
116
+ /** Bumped on incompatible changes. Older readers must rebuild. */
117
+ version: 1;
118
+ generatedAt: string;
119
+ /** BM25 input documents. */
120
+ docs: {
121
+ id: string;
122
+ text: string;
123
+ }[];
124
+ /** Per-id metadata used to render `SearchResult`. */
125
+ items: Record<string, IndexItem>;
126
+ }
127
+ /**
128
+ * Sibling to `refs/` and `adk.d.ts` in the config directory. Dot-prefixed
129
+ * so coding agents treat it as a hidden artifact rather than something
130
+ * they should read directly — agents should query through `adk search`.
131
+ */
132
+ export declare const SEARCH_INDEX_FILENAME = ".search-index.json";
133
+ /**
134
+ * Walk `refsRoot` recursively. Every directory containing an `agent.json`
135
+ * is a materialized ref. Builds the unified BM25 docs + per-result metadata
136
+ * map used by both the live search path and the persisted index writer.
137
+ *
138
+ * Ids embed the kind so that `adk search`'s kind filters can apply post-rank
139
+ * without re-running BM25:
140
+ *
141
+ * `ref:<refName>`
142
+ * `tool:<refName>|<toolName>`
143
+ * `resource:<refName>|<fileName>`
144
+ *
145
+ * The `|` separator is safe because ref / tool / resource names use
146
+ * letters / numbers / `-` / `_` / `/` / `@` / `.` only.
147
+ */
148
+ export declare function buildSearchIndex(refsRoot: string): PersistedSearchIndex;
149
+ /** Resolve the persisted-index path for a given config directory. */
150
+ export declare function searchIndexPath(configDir: string): string;
151
+ /**
152
+ * Build and write the persisted index to `<configDir>/.search-index.json`.
153
+ * Called from `adk sync` so subsequent `adk search` invocations skip the
154
+ * recursive ref walk.
155
+ */
156
+ export declare function writeSearchIndex(configDir: string): {
157
+ path: string;
158
+ documentCount: number;
159
+ };
160
+ /**
161
+ * Read a persisted index. Returns `null` if the file is missing,
162
+ * unreadable, malformed, or written by an incompatible version.
163
+ */
164
+ export declare function readSearchIndex(configDir: string): PersistedSearchIndex | null;
165
+ /**
166
+ * Run a BM25 search over the materialized refs.
167
+ *
168
+ * Prefers the persisted `<configDir>/search-index.json` (written by
169
+ * `adk sync`) when it exists — that path skips the recursive walk and
170
+ * runs in single-digit ms even with hundreds of tools. Falls back to a
171
+ * fresh walk of `refsRoot` when the persisted file is missing or stale.
172
+ *
173
+ * @param refsRoot The materialized refs directory (e.g. `~/.adk/refs`).
174
+ * We derive `<configDir>` from this as the parent so callers don't
175
+ * have to plumb both. Pass an `index` directly via `options.index` to
176
+ * bypass disk I/O entirely (used by tests).
177
+ */
178
+ export declare function searchRefs(refsRoot: string, query: string, options?: SearchOptions & {
179
+ index?: PersistedSearchIndex;
180
+ }): SearchResult[];
181
+ /** Concise human-readable rendering — one numbered block per result. */
182
+ export declare function renderResults(results: SearchResult[]): string;
183
+ export declare function refsRootExists(refsRoot: string): boolean;
184
+ export {};
185
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAiBH,MAAM,WAAW,aAAa;IAC5B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAA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AAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC;AAGD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAM1D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,CAgJvE;AAMD,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAUA;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAChB,oBAAoB,GAAG,IAAI,CAa7B;AAiED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,aAAa,GAAG;IAAE,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAAO,GAC7D,YAAY,EAAE,CA4BhB;AAeD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAkC7D;AAID,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD"}
package/dist/search.js ADDED
@@ -0,0 +1,396 @@
1
+ /**
2
+ * adk search — BM25 over materialized ref/tool docs.
3
+ *
4
+ * Walks `${configDir}/refs/` and indexes every ref + tool + skill found:
5
+ *
6
+ * `<configDir>/refs/<ref>/agent.json` → ref-level fields
7
+ * `<configDir>/refs/<ref>/entrypoint.md` → ref-level body
8
+ * `<configDir>/refs/<ref>/tools/<t>.tool.md` → per-tool body
9
+ * `<configDir>/refs/<ref>/tools/<t>.tool.json` → per-tool param names/descs
10
+ * `<configDir>/refs/<ref>/skills/<file>` → per-resource body
11
+ *
12
+ * Platform agents nest under `refs/agents/<@name>/`; integration refs sit
13
+ * directly at `refs/<name>/`. The walker handles both layouts.
14
+ *
15
+ * One BM25 document per ref + one per tool + one per skill resource. Tool
16
+ * and ref names get inserted multiple times into the document text so they
17
+ * outweigh surrounding prose without the BM25 implementation needing
18
+ * per-field weighting.
19
+ *
20
+ * Persistence: `adk sync` calls `writeSearchIndex(configDir)` to dump the
21
+ * raw BM25 docs + per-doc result metadata to `<configDir>/.search-index.json`.
22
+ * `searchRefs` prefers that file when it exists — `adk search` becomes a
23
+ * single file read + BM25 build (a few ms) instead of a recursive walk.
24
+ * Falls back to a fresh walk when the persisted file is missing or stale.
25
+ *
26
+ * The file is dot-prefixed so coding agents treat it as a hidden artifact
27
+ * and don't try to read it directly — they should use `adk search` instead.
28
+ */
29
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync, } from "node:fs";
30
+ import { basename, dirname, join } from "node:path";
31
+ import { createBM25Index } from "./bm25.js";
32
+ const INDEX_VERSION = 1;
33
+ /**
34
+ * Sibling to `refs/` and `adk.d.ts` in the config directory. Dot-prefixed
35
+ * so coding agents treat it as a hidden artifact rather than something
36
+ * they should read directly — agents should query through `adk search`.
37
+ */
38
+ export const SEARCH_INDEX_FILENAME = ".search-index.json";
39
+ // ============================================
40
+ // Index building (filesystem walk)
41
+ // ============================================
42
+ /**
43
+ * Walk `refsRoot` recursively. Every directory containing an `agent.json`
44
+ * is a materialized ref. Builds the unified BM25 docs + per-result metadata
45
+ * map used by both the live search path and the persisted index writer.
46
+ *
47
+ * Ids embed the kind so that `adk search`'s kind filters can apply post-rank
48
+ * without re-running BM25:
49
+ *
50
+ * `ref:<refName>`
51
+ * `tool:<refName>|<toolName>`
52
+ * `resource:<refName>|<fileName>`
53
+ *
54
+ * The `|` separator is safe because ref / tool / resource names use
55
+ * letters / numbers / `-` / `_` / `/` / `@` / `.` only.
56
+ */
57
+ export function buildSearchIndex(refsRoot) {
58
+ const docs = [];
59
+ const items = {};
60
+ function walk(dir) {
61
+ if (!existsSync(dir))
62
+ return;
63
+ let entries;
64
+ try {
65
+ entries = readdirSync(dir);
66
+ }
67
+ catch {
68
+ return;
69
+ }
70
+ const agentJsonPath = join(dir, "agent.json");
71
+ if (existsSync(agentJsonPath)) {
72
+ try {
73
+ const manifest = JSON.parse(readFileSync(agentJsonPath, "utf-8"));
74
+ const refName = manifest.name ?? basename(dir);
75
+ const description = manifest.description ?? "";
76
+ const toolCount = manifest.toolCount ?? manifest.tools?.length ?? 0;
77
+ const entrypointPath = join(dir, "entrypoint.md");
78
+ const entrypointBody = existsSync(entrypointPath)
79
+ ? readFileSync(entrypointPath, "utf-8")
80
+ : "";
81
+ const refId = `ref:${refName}`;
82
+ docs.push({
83
+ id: refId,
84
+ text: [refName, refName, description, entrypointBody].join(" \n "),
85
+ });
86
+ items[refId] = {
87
+ kind: "ref",
88
+ ref: refName,
89
+ summary: description || refName,
90
+ docs: dir,
91
+ entrypoint: entrypointPath,
92
+ toolCount,
93
+ };
94
+ const toolsDir = join(dir, "tools");
95
+ if (existsSync(toolsDir)) {
96
+ for (const file of readdirSync(toolsDir)) {
97
+ if (!file.endsWith(".tool.md"))
98
+ continue;
99
+ const toolMdPath = join(toolsDir, file);
100
+ const toolJsonPath = toolMdPath.replace(/\.tool\.md$/, ".tool.json");
101
+ const md = readFileSync(toolMdPath, "utf-8");
102
+ const summary = firstNonBlankLine(md, refName, file);
103
+ const tool = parseToolName(toolJsonPath, file);
104
+ const paramText = extractParamText(toolJsonPath);
105
+ // Repeat the high-signal terms (ref + tool name) so BM25
106
+ // ranks exact-name matches above ambient body matches.
107
+ const text = [
108
+ tool,
109
+ tool,
110
+ tool,
111
+ refName,
112
+ refName,
113
+ md,
114
+ paramText,
115
+ ].join(" \n ");
116
+ const id = `tool:${refName}|${tool}`;
117
+ docs.push({ id, text });
118
+ items[id] = {
119
+ kind: "tool",
120
+ ref: refName,
121
+ tool,
122
+ summary,
123
+ docs: toolMdPath,
124
+ schema: toolJsonPath,
125
+ call: `adk ref call ${refName} ${tool} '{...}'`,
126
+ };
127
+ }
128
+ }
129
+ // Skills / resources written by `materializeRef` — text content
130
+ // synced from the registry's `read_resources` / `list_resources`
131
+ // surface. Indexed so `adk search` can surface ref-specific
132
+ // skill files (e.g. "writing pages" → notion's writing-pages.md).
133
+ const skillsDir = join(dir, "skills");
134
+ if (existsSync(skillsDir)) {
135
+ for (const file of readdirSync(skillsDir)) {
136
+ const path = join(skillsDir, file);
137
+ try {
138
+ if (!statSync(path).isFile())
139
+ continue;
140
+ }
141
+ catch {
142
+ continue;
143
+ }
144
+ let body;
145
+ try {
146
+ body = readFileSync(path, "utf-8");
147
+ }
148
+ catch {
149
+ continue;
150
+ }
151
+ const summary = firstNonBlankLine(body, refName, file);
152
+ const text = [file, file, refName, refName, body].join(" \n ");
153
+ const id = `resource:${refName}|${file}`;
154
+ docs.push({ id, text });
155
+ items[id] = {
156
+ kind: "resource",
157
+ ref: refName,
158
+ resource: file,
159
+ summary,
160
+ docs: path,
161
+ };
162
+ }
163
+ }
164
+ }
165
+ catch {
166
+ // Malformed agent.json — skip this directory but keep walking.
167
+ }
168
+ }
169
+ // Recurse into subdirectories that aren't tool / skill / types output —
170
+ // those have no nested agents. Anything else (e.g. `agents/`) might
171
+ // hold platform-agent refs.
172
+ for (const entry of entries) {
173
+ const full = join(dir, entry);
174
+ let isDir;
175
+ try {
176
+ isDir = statSync(full).isDirectory();
177
+ }
178
+ catch {
179
+ continue;
180
+ }
181
+ if (!isDir)
182
+ continue;
183
+ if (entry === "tools" || entry === "skills" || entry === "types")
184
+ continue;
185
+ walk(full);
186
+ }
187
+ }
188
+ walk(refsRoot);
189
+ return {
190
+ version: INDEX_VERSION,
191
+ generatedAt: new Date().toISOString(),
192
+ docs,
193
+ items,
194
+ };
195
+ }
196
+ // ============================================
197
+ // Persistence
198
+ // ============================================
199
+ /** Resolve the persisted-index path for a given config directory. */
200
+ export function searchIndexPath(configDir) {
201
+ return join(configDir, SEARCH_INDEX_FILENAME);
202
+ }
203
+ /**
204
+ * Build and write the persisted index to `<configDir>/.search-index.json`.
205
+ * Called from `adk sync` so subsequent `adk search` invocations skip the
206
+ * recursive ref walk.
207
+ */
208
+ export function writeSearchIndex(configDir) {
209
+ const refsRoot = join(configDir, "refs");
210
+ const index = buildSearchIndex(refsRoot);
211
+ const path = searchIndexPath(configDir);
212
+ const dir = dirname(path);
213
+ if (!existsSync(dir))
214
+ mkdirSync(dir, { recursive: true });
215
+ // Pretty-print in dev only; production indexes will be small enough
216
+ // that minified output isn't worth the readability cost.
217
+ writeFileSync(path, `${JSON.stringify(index, null, 2)}\n`, "utf-8");
218
+ return { path, documentCount: index.docs.length };
219
+ }
220
+ /**
221
+ * Read a persisted index. Returns `null` if the file is missing,
222
+ * unreadable, malformed, or written by an incompatible version.
223
+ */
224
+ export function readSearchIndex(configDir) {
225
+ const path = searchIndexPath(configDir);
226
+ if (!existsSync(path))
227
+ return null;
228
+ try {
229
+ const raw = readFileSync(path, "utf-8");
230
+ const parsed = JSON.parse(raw);
231
+ if (parsed?.version !== INDEX_VERSION)
232
+ return null;
233
+ if (!Array.isArray(parsed.docs))
234
+ return null;
235
+ if (!parsed.items || typeof parsed.items !== "object")
236
+ return null;
237
+ return parsed;
238
+ }
239
+ catch {
240
+ return null;
241
+ }
242
+ }
243
+ /** Pick the first non-blank line of `body` as a one-line summary. */
244
+ function firstNonBlankLine(body, refName, fileName) {
245
+ for (const raw of body.split("\n")) {
246
+ const line = raw.trim();
247
+ if (!line)
248
+ continue;
249
+ if (line.startsWith("#"))
250
+ continue;
251
+ return line;
252
+ }
253
+ return `${refName}/${fileName}`;
254
+ }
255
+ /**
256
+ * Pull the actual tool name from the .tool.json. Falls back to the
257
+ * filename (without .tool.md) if the json is missing or unreadable —
258
+ * still useful as a search anchor even if not exact.
259
+ */
260
+ function parseToolName(toolJsonPath, fileName) {
261
+ if (existsSync(toolJsonPath)) {
262
+ try {
263
+ const obj = JSON.parse(readFileSync(toolJsonPath, "utf-8"));
264
+ if (typeof obj.name === "string" && obj.name.length > 0)
265
+ return obj.name;
266
+ }
267
+ catch {
268
+ // fall through
269
+ }
270
+ }
271
+ return fileName.replace(/\.tool\.md$/, "");
272
+ }
273
+ /**
274
+ * Pull parameter names + descriptions out of a .tool.json's inputSchema.
275
+ * Surfaces them as plain text into the BM25 index so queries like
276
+ * "calendar event id" land on the right tool.
277
+ */
278
+ function extractParamText(toolJsonPath) {
279
+ if (!existsSync(toolJsonPath))
280
+ return "";
281
+ try {
282
+ const obj = JSON.parse(readFileSync(toolJsonPath, "utf-8"));
283
+ const parts = [];
284
+ if (obj.description)
285
+ parts.push(obj.description);
286
+ const props = obj.inputSchema?.properties ?? {};
287
+ for (const [name, info] of Object.entries(props)) {
288
+ parts.push(name);
289
+ if (typeof info?.description === "string")
290
+ parts.push(info.description);
291
+ }
292
+ return parts.join(" ");
293
+ }
294
+ catch {
295
+ return "";
296
+ }
297
+ }
298
+ // ============================================
299
+ // Search
300
+ // ============================================
301
+ /**
302
+ * Run a BM25 search over the materialized refs.
303
+ *
304
+ * Prefers the persisted `<configDir>/search-index.json` (written by
305
+ * `adk sync`) when it exists — that path skips the recursive walk and
306
+ * runs in single-digit ms even with hundreds of tools. Falls back to a
307
+ * fresh walk of `refsRoot` when the persisted file is missing or stale.
308
+ *
309
+ * @param refsRoot The materialized refs directory (e.g. `~/.adk/refs`).
310
+ * We derive `<configDir>` from this as the parent so callers don't
311
+ * have to plumb both. Pass an `index` directly via `options.index` to
312
+ * bypass disk I/O entirely (used by tests).
313
+ */
314
+ export function searchRefs(refsRoot, query, options = {}) {
315
+ const index = options.index ??
316
+ readSearchIndex(dirname(refsRoot)) ??
317
+ buildSearchIndex(refsRoot);
318
+ const bm25 = createBM25Index(index.docs);
319
+ const limit = options.limit ?? 10;
320
+ // Pull more raw hits than `limit` so the kind / ref filters below have
321
+ // headroom to drop irrelevant matches without short-changing the caller.
322
+ // 5x is plenty for typical 10-20 limits.
323
+ const raw = bm25.search(query, limit * 5);
324
+ const results = [];
325
+ for (const hit of raw) {
326
+ if (results.length >= limit)
327
+ break;
328
+ const item = index.items[hit.id];
329
+ if (!item)
330
+ continue;
331
+ if (options.toolsOnly && item.kind !== "tool")
332
+ continue;
333
+ if (options.refsOnly && item.kind !== "ref")
334
+ continue;
335
+ if (options.ref && !refMatches(options.ref, item.ref))
336
+ continue;
337
+ // Spread the stored item and tack on the query-time score. Each
338
+ // `item` matches one of the `SearchResult` variants by construction
339
+ // (see `buildSearchIndex`), so this is type-safe.
340
+ results.push({ ...item, score: hit.score });
341
+ }
342
+ return results;
343
+ }
344
+ /** Match `ref` filter loosely — accepts both bare names and `/agents/@…` paths. */
345
+ function refMatches(filter, ref) {
346
+ if (filter === ref)
347
+ return true;
348
+ // Allow `@clock` as a shorthand for `/agents/@clock`, and vice versa.
349
+ if (ref === `/agents/${filter}`)
350
+ return true;
351
+ if (`/agents/${ref}` === filter)
352
+ return true;
353
+ return false;
354
+ }
355
+ // ============================================
356
+ // CLI rendering
357
+ // ============================================
358
+ /** Concise human-readable rendering — one numbered block per result. */
359
+ export function renderResults(results) {
360
+ if (results.length === 0)
361
+ return "No results.";
362
+ const blocks = [];
363
+ for (let i = 0; i < results.length; i++) {
364
+ const r = results[i];
365
+ const score = r.score.toFixed(2);
366
+ if (r.kind === "tool") {
367
+ blocks.push([
368
+ `${i + 1}. ${r.ref}.${r.tool} score=${score}`,
369
+ ` ${r.summary}`,
370
+ ` Docs: ${r.docs}`,
371
+ ` Call: ${r.call}`,
372
+ ].join("\n"));
373
+ }
374
+ else if (r.kind === "ref") {
375
+ blocks.push([
376
+ `${i + 1}. ${r.ref} (ref, ${r.toolCount} tools) score=${score}`,
377
+ ` ${r.summary}`,
378
+ ` Docs: ${r.docs}`,
379
+ ].join("\n"));
380
+ }
381
+ else {
382
+ blocks.push([
383
+ `${i + 1}. ${r.ref}/${r.resource} (resource) score=${score}`,
384
+ ` ${r.summary}`,
385
+ ` Docs: ${r.docs}`,
386
+ ].join("\n"));
387
+ }
388
+ }
389
+ return blocks.join("\n\n");
390
+ }
391
+ // Local helpers — exposed so callers (the CLI) can detect a missing
392
+ // refs root and print a useful message instead of an empty result list.
393
+ export function refsRootExists(refsRoot) {
394
+ return existsSync(refsRoot) && statSync(refsRoot).isDirectory();
395
+ }
396
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmH5C,MAAM,aAAa,GAAG,CAAU,CAAC;AACjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAE1D,+CAA+C;AAC/C,mCAAmC;AACnC,+CAA+C;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,IAAI,GAAmC,EAAE,CAAC;IAChD,MAAM,KAAK,GAA8B,EAAE,CAAC;IAE5C,SAAS,IAAI,CAAC,GAAW;QACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO;QAC7B,IAAI,OAAiB,CAAC;QACtB,IAAI,CAAC;YACH,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC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GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,SAAS,kBAAkB,KAAK,EAAE;gBACjE,MAAM,CAAC,CAAC,OAAO,EAAE;gBACjB,YAAY,CAAC,CAAC,IAAI,EAAE;aACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CACT;gBACE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,QAAQ,uBAAuB,KAAK,EAAE;gBAC9D,MAAM,CAAC,CAAC,OAAO,EAAE;gBACjB,YAAY,CAAC,CAAC,IAAI,EAAE;aACrB,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,oEAAoE;AACpE,wEAAwE;AACxE,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;AAClE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slashfi/agents-sdk",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "author": "Slash Financial",
5
5
  "repository": {
6
6
  "type": "git",