@autorag/librarian 2.6.2 → 2.7.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.
Files changed (56) hide show
  1. package/NOTICE +12 -0
  2. package/README.md +22 -5
  3. package/dist/agent/agent.d.ts +151 -8
  4. package/dist/agent/everything-search-tool.d.ts +35 -0
  5. package/dist/agent/fsearch-search-tool.d.ts +35 -0
  6. package/dist/agent/jikji-find-tool.d.ts +2 -0
  7. package/dist/agent/pi-session.d.ts +35 -0
  8. package/dist/agent/refresh-progress.d.ts +1 -1
  9. package/dist/agent/search-documents.d.ts +1 -1
  10. package/dist/cli/commands/health.d.ts +2 -3
  11. package/dist/cli/commands/models.d.ts +20 -0
  12. package/dist/cli/commands/refresh.d.ts +1 -1
  13. package/dist/cli/commands/search.d.ts +2 -2
  14. package/dist/cli/commands/serve.d.ts +2 -2
  15. package/dist/cli/commands/tui.d.ts +12 -35
  16. package/dist/cli/config.d.ts +67 -7
  17. package/dist/cli/index.js +3064 -1726
  18. package/dist/core.d.ts +1 -1
  19. package/dist/core.js +3056 -1223
  20. package/dist/datasource/connector-timeouts.d.ts +19 -0
  21. package/dist/datasource/crawler-types.d.ts +10 -0
  22. package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +2 -0
  23. package/dist/datasource/skills/lazykatok/client.d.ts +2 -0
  24. package/dist/datasource/skills/lazykatok/index.d.ts +1 -1
  25. package/dist/datasource/skills/lazykatok/types.d.ts +17 -1
  26. package/dist/datasource/skills/rss/connector.d.ts +2 -0
  27. package/dist/datasource/skills/spotlight/connector.d.ts +2 -0
  28. package/dist/dupey/filter.d.ts +7 -1
  29. package/dist/everything/bundle.d.ts +62 -0
  30. package/dist/everything/client.d.ts +123 -0
  31. package/dist/everything/index.d.ts +2 -0
  32. package/dist/fsearch/client.d.ts +173 -0
  33. package/dist/fsearch/index.d.ts +2 -0
  34. package/dist/fsearch/walk.d.ts +22 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +3082 -1223
  37. package/dist/minsync/method.d.ts +6 -0
  38. package/dist/retrieval/engine.d.ts +14 -0
  39. package/dist/retrieval/index.d.ts +1 -0
  40. package/dist/retrieval/rerank.d.ts +117 -0
  41. package/dist/retrieval/types.d.ts +1 -1
  42. package/licenses/es-MIT.txt +21 -0
  43. package/licenses/everything-MIT-and-PCRE-BSD.txt +51 -0
  44. package/package.json +7 -2
  45. package/skills/autorag/SKILL.md +4 -3
  46. package/skills/autorag-doctor/SKILL.md +2 -0
  47. package/skills/autorag-lite-setup/SKILL.md +3 -2
  48. package/skills/autorag-setup/SKILL.md +67 -6
  49. package/vendor/everything/ES-1.1.0.38.ARM64.zip +0 -0
  50. package/vendor/everything/ES-1.1.0.38.x64.zip +0 -0
  51. package/vendor/everything/Everything-1.4.1.1032.ARM64.en-US.zip +0 -0
  52. package/vendor/everything/Everything-1.4.1.1032.x64.en-US.zip +0 -0
  53. package/vendor/everything/manifest.json +30 -0
  54. package/dist/agent/bash-tool.d.ts +0 -32
  55. package/dist/cli/tui-commands.d.ts +0 -16
  56. package/dist/cli/tui-session-store.d.ts +0 -16
package/NOTICE CHANGED
@@ -18,6 +18,9 @@ License: MIT
18
18
  @earendil-works/pi-tui@0.86.1
19
19
  License: MIT
20
20
 
21
+ @openrouter/sdk@1.4.21
22
+ License: Apache-2.0
23
+
21
24
  chardet@2.2.0
22
25
  License: MIT
23
26
 
@@ -66,3 +69,12 @@ licenses/gemma-section-3.2-flow-down.txt
66
69
  licenses/gemma-terms-of-use.txt
67
70
  licenses/gemma-terms-of-use.html
68
71
  licenses/embedding-assets.json
72
+
73
+ Bundled Windows binaries (vendor/everything, extracted only on Windows):
74
+ Everything 1.4.1.1032 portable (voidtools, David Carpenter)
75
+ License: MIT (closed source); includes PCRE (BSD-3-Clause)
76
+ licenses/everything-MIT-and-PCRE-BSD.txt
77
+
78
+ ES 1.1.0.38 command-line interface (voidtools)
79
+ License: MIT
80
+ licenses/es-MIT.txt
package/README.md CHANGED
@@ -51,7 +51,7 @@ Three principles drive every design decision in AutoRAG Agent:
51
51
 
52
52
  1. **Never migrate your data to search it.** Traditional RAG systems force you to upload, ETL, and duplicate your files into a centralized vector database. AutoRAG Agent federates your data **in place**, querying CLI-native stores (`lazykatok`, `discrawl`, `slacrawl`, `mailcrawl`, `rclone`, `qmd`) where your data already lives. Results retain opaque, source-native identities (`/kakao/...`, `/slack/...`) that preserve local access control and privacy. *(See our [Competitive Landscape Study](docs/competitive-landscape-2026-09.md) on why in-place federation is the durable differentiator).*
53
53
 
54
- 2. **Just works — no RAG degree required.** No pipeline tuning, no vector-DB maintenance, and no remote embedding API keys. AutoRAG Agent automatically manages [MinSync](docs/minsync-setup.md) for incremental Change Data Capture (CDC) chunking and provides a local [embedding gateway](docs/embedding-runtime.md) out of the box with zero external telemetry.
54
+ 2. **Just works — no RAG degree required.** No pipeline tuning, no vector-DB maintenance, and no remote embedding keys required. AutoRAG Agent automatically manages [MinSync](docs/minsync-setup.md) for incremental Change Data Capture (CDC) chunking and provides a local [embedding gateway](docs/embedding-runtime.md) out of the box with zero external telemetry. A [remote rerank model](docs/rerank.md) (OpenRouter, `voyageai/rerank-3-lite` by default) is an opt-in extra.
55
55
 
56
56
  3. **Fast by design.** Rather than coordinating slow multi-agent hierarchies, a single configured model owns the entire retrieval, direct-read, and curation loop. Local CDC chunks (BM25, vector, and hybrid modes) deliver rapid, low-latency turnaround across multi-turn research queries.
57
57
 
@@ -67,11 +67,20 @@ AutoRAG Agent orchestrates five integrated subsystems:
67
67
  - **Semantic Vector Search:** Dense vector retrieval over CDC chunks via the built-in embedding gateway.
68
68
  - **Hybrid Search:** Combines BM25 and vector ranking via Reciprocal Rank Fusion (RRF).
69
69
  - **Jikji Find-First Discovery:** Local CLI-backed fast discovery answer packs.
70
+ - **Everything File-Name Search (Windows):** The bundled [voidtools Everything](https://www.voidtools.com/) indexes file and folder names under your search roots so the agent finds files by name, extension, path, size, or date instantly (`everything_search`).
71
+ - **FSearch File-Name Search (macOS/Linux):** [fsearch-cli](https://github.com/NomaDamas/fsearch-mac) (FSearch) keeps a live, per-workspace name index of your search roots so the agent finds files by name, extension, path, size, or date instantly (`fsearch_search`); without fsearch-cli installed it degrades to a slow filesystem walk.
70
72
  - **Datasource Skills:** Server-authorized federated retrieval across external applications.
71
73
  3. **Result Merger & Scoped Access Gate:** Cross-method deduplication, score normalization, and default-deny permission checks.
72
74
  4. **Direct Evidence Reading (`bash`):** The agent directly opens and inspects promising files with `cat`, `grep`, or `find` to verify facts against ground truth.
73
75
  5. **Curation & Active Feedback:** Structured findings are returned via `emit_autorag_results`. When callers provide feedback on which items were useful, AutoRAG records this to optimize future queries.
74
76
 
77
+ ### Pi host boundary
78
+
79
+ AutoRAG uses `@earendil-works/pi-coding-agent` as the runtime host for model sessions. Pi owns provider credentials and OAuth storage, model-runtime dispatch, session JSONL persistence/resume, extension loading, lifecycle events, and the built-in `read`/`bash`/`edit`/`write`/`grep`/`find`/`ls` tools. AutoRAG registers only its domain tools and keeps orchestration outside the host: datasource authorization, MinSync/Jikji preparation, memory hints, fast-to-verification two-phase search, structured result emission, and remote-session filtering.
80
+
81
+ The CLI TUI (`autorag tui`) is Pi's interactive mode hosted on the AutoRAG librarian: there is no separate AutoRAG renderer. Pi owns the terminal UI and its native in-session commands — `/login`/`/logout`, `/model`, `/resume`, `/new`, `/tree`, `/compact`, and `/settings` — so provider sign-in and model selection work on first launch even when no AutoRAG model is configured. AutoRAG registers its retrieval tools and streams progress, preliminary answers, and final results into the same Pi session, so resume and two-phase search keep working together.
82
+
83
+
75
84
  ---
76
85
 
77
86
  ## 🤖 For AI Agents & LLMs: Setup & Skills
@@ -175,7 +184,7 @@ AutoRAG Agent connects to external tools and communication platforms using dedic
175
184
  | **RSS / News** | `rss` | Native HTTP Poller | RSS 2.0 & Atom feeds (24h deduplication) | Lexical |
176
185
  | **macOS Spotlight** | `spotlight` | Native `mdfind` CLI | macOS system metadata and content index | System Native |
177
186
 
178
- For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md).
187
+ For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md). Non-interactive `sync`/`index` steps get a 30-minute per-connector budget (`connector.indexTimeoutMs`) because first-run imports routinely take minutes; interactive search keeps its 60-second default.
179
188
 
180
189
  ---
181
190
 
@@ -198,6 +207,8 @@ bun add @autorag/librarian
198
207
  - **No Java required:** Document parsing (HWP/HWPX/HWPML, PDF, DOCX, XLSX/XLS) runs in-process through [`kordoc`](https://github.com/chrisryugj/kordoc).
199
208
  - **Rust Toolchain (Optional):** Automatically compiles Jikji (`jikji-cli`) if installed.
200
209
  - **MinSync:** Automatically downloaded and installed into `<workspace>/.autorag/bin` on first run.
210
+ - **Everything (Windows only, bundled):** The package ships the portable Everything 1.4.1.1032 and its ES 1.1.0.38 CLI (x64 and ARM64, SHA-256 pinned). On Windows, AutoRAG extracts them into `<workspace>/.autorag/everything/` and runs a private, user-level instance that indexes only your configured search roots: no administrator rights, no Everything service, no whole-drive scan, no HTTP/ETP server, and no change to any Everything you already run. Set `"everything": false` in the config to turn it off. macOS and Linux are not affected.
211
+ - **FSearch (macOS/Linux only, separate install):** Install [`fsearch-cli`](https://github.com/NomaDamas/fsearch-mac) yourself (e.g. `brew install NomaDamas/fsearch-mac/fsearch-mac` (installs the `fsearch-cli` binary); GPL-2.0, spawned as a separate process, never bundled or linked). On macOS and Linux, AutoRAG builds a per-workspace database at `<workspace>/.autorag/fsearch/` indexing only your configured search roots, and keeps a `fsearch-cli watch` daemon live (FSEvents/inotify) for sub-second name search. It never touches the FSearch app's own database. Without fsearch-cli, name search falls back to a slow bounded filesystem walk. Set `"fsearch": false` in the config to turn it off. Windows is not affected (Everything covers it).
201
212
 
202
213
  ---
203
214
 
@@ -245,7 +256,7 @@ PDF pages.
245
256
  # Perform a curated search (uses your configured reasoning model)
246
257
  autorag search "What are our primary Q3 deliverables?"
247
258
 
248
- # Launch the interactive Terminal UI (beta)
259
+ # Launch the interactive Terminal UI (Pi host: /login, /model, /resume, …)
249
260
  autorag tui
250
261
  ```
251
262
 
@@ -279,11 +290,12 @@ agent.recordFeedbackByNumbers(response.sessionId, [1], [2]);
279
290
  | Command | Description |
280
291
  |---|---|
281
292
  | `autorag init` | Initialize `~/.autorag/config.json` with search roots, document languages, and model settings |
282
- | `autorag refresh` | Refresh parsed mirrors, MinSync CDC chunks, datasources, and Jikji |
293
+ | `autorag refresh` | Refresh parsed mirrors, MinSync CDC chunks, datasources, Jikji, and the platform file-name index (Everything on Windows, FSearch on macOS/Linux) |
283
294
  | `autorag search "<query>"` | Run the librarian agent to curate structured answers |
284
295
  | `autorag status` | Inspect corpus freshness, indexing status, and vector readiness |
285
296
  | `autorag health` | Check model provider authentication, token validity, and API reachability |
286
- | `autorag tui` | Open the interactive librarian terminal UI |
297
+ | `autorag models list` | List chat models the pi runtime can resolve (built-ins, `models.json`, custom/extension providers) with provider auth status; never prints credential values |
298
+ | `autorag tui` | Open Pi's interactive librarian TUI (`/login`, `/model`, `/resume`, …) |
287
299
  | `autorag duplicates [DIR]` | Read-only scan for exact and near-duplicate document families with `dupey` |
288
300
  | `autorag lite ...` | Model-free indexing, retrieval, report generation, and status |
289
301
  | `autorag feedback <session>` | Record useful / not-useful feedback by item number |
@@ -325,6 +337,8 @@ AutoRAG Agent stands on the shoulders of fantastic open-source projects:
325
337
  - **[Pi Framework](https://github.com/earendil-works/pi-mono)** by [@earendil-works](https://github.com/earendil-works) — The foundational agent framework powering AutoRAG's reasoning loop.
326
338
  - **[MinSync](https://github.com/Marker-Inc-Korea/minsync)** — Ultra-fast incremental Change Data Capture (CDC) chunking and local BM25/vector indexing.
327
339
  - **[Jikji](https://github.com/NomaDamas/jikji)** by [NomaDamas](https://github.com/NomaDamas) — High-performance find-first local document discovery.
340
+ - **[Everything](https://www.voidtools.com/)** and **[ES](https://github.com/voidtools/ES)** by voidtools (David Carpenter) — Instant Windows file-name indexing and its command-line interface, bundled under the MIT License.
341
+ - **[FSearch](https://github.com/cboxdoerfer/fsearch)** and **[fsearch-cli](https://github.com/NomaDamas/fsearch-mac)** — Everything-style file-name search for macOS/Linux (GPL-2.0-or-later). Never bundled or linked: users install fsearch-cli separately and AutoRAG spawns it as a separate process (mere aggregation per the FSF GPL FAQ).
328
342
  - **[dupey](https://github.com/NomaDamas/dupey)** by [NomaDamas](https://github.com/NomaDamas) — Fast duplicate and near-duplicate document family detection.
329
343
  - **Federated CLI Authors:** External datasource tools [`lazykatok`](https://github.com/changeroa/lazykatok), [`discrawl`](https://github.com/openclaw/discrawl), [`mailcrawl`](https://github.com/NomaDamas/mailcrawl), [`wacrawl`](https://github.com/openclaw/wacrawl), [`telecrawl`](https://github.com/openclaw/telecrawl), [`slacrawl`](https://github.com/openclaw/slacrawl), [`notcrawl`](https://github.com/openclaw/notcrawl), [`qmd`](https://github.com/tobi/qmd), and [`rclone`](https://rclone.org).
330
344
  - **[kordoc](https://github.com/chrisryugj/kordoc)** by [chrisryugj](https://github.com/chrisryugj) — HWP/HWPX/HWPML, PDF, DOCX and XLSX parsing with nested-table fidelity, used as AutoRAG's default document parser.
@@ -360,6 +374,7 @@ Common failures and their fix:
360
374
  | A datasource is healthy in its own CLI but absent from results | — | add its tag/scope to `datasourceAccess` |
361
375
  | A datasource errors during refresh | `datasource-index-failed` | run that CLI's own `doctor` |
362
376
  | MinSync or Jikji missing | `minsync-unavailable`, `jikji-unavailable` | check the Rust toolchain, re-run refresh |
377
+ | Windows file-name search fails during refresh | `everything-index-failed` | read the ES exit code and stderr in the message, then `autorag refresh --method everything --json` |
363
378
 
364
379
  Native datasource stores stay owned by their CLIs — AutoRAG never rebuilds them. Fix a broken archive with `lazykatok doctor`, `discrawl --json metadata`, `slacrawl --json doctor`, `wacrawl --json doctor`, `telecrawl --json doctor`, `notcrawl doctor`, `qmd status`, or `mailcrawl doctor`, then re-run `autorag refresh --method datasources --json`.
365
380
 
@@ -368,3 +383,5 @@ Native datasource stores stay owned by their CLIs — AutoRAG never rebuilds the
368
383
  - **AutoRAG 2.0 (AutoRAG Agent):** Released under the [MIT License](LICENSE).
369
384
  - **Legacy Python AutoRAG (`legacy/`):** Released under the [Apache License 2.0](legacy/LICENSE).
370
385
  - Production third-party notices and licenses are documented in [`NOTICE`](NOTICE).
386
+ - The bundled Windows binaries keep their own licenses: Everything (MIT, plus PCRE BSD-3-Clause) in [`licenses/everything-MIT-and-PCRE-BSD.txt`](licenses/everything-MIT-and-PCRE-BSD.txt) and ES (MIT) in [`licenses/es-MIT.txt`](licenses/es-MIT.txt). Everything's source code is not public; AutoRAG redistributes the unmodified voidtools portable ZIPs.
387
+ - FSearch/fsearch-cli (GPL-2.0-or-later) are **not** distributed with AutoRAG: no code is copied, linked, or bundled. Users install fsearch-cli themselves and AutoRAG communicates with it only through its command-line interface and daemon socket — separate programs, per the [FSF mere-aggregation FAQ](https://www.gnu.org/licenses/gpl-faq.html#MereAggregation). Source: https://github.com/NomaDamas/fsearch-mac.
@@ -1,8 +1,10 @@
1
- import { Agent, type AgentTool, type Skill } from "@earendil-works/pi-agent-core";
1
+ import type { Agent, AgentTool, Skill } from "@earendil-works/pi-agent-core";
2
2
  import type { Api, Model } from "@earendil-works/pi-ai";
3
3
  import { type DatasourceAccessContextOptions } from "../datasource/access-context.js";
4
4
  import type { DatasourceIndexResult, DatasourceSkill } from "../datasource/types.js";
5
5
  import { type DupeyCliOptions } from "../dupey/index.js";
6
+ import { type EverythingClientOptions, type EverythingSearchRequest, type EverythingSearchResult } from "../everything/index.js";
7
+ import { type FSearchClientOptions, type FSearchFailureReason, type FSearchSearchRequest, type FSearchSearchResult } from "../fsearch/index.js";
6
8
  import { type JikjiFailureReason, type JikjiOptions } from "../jikji/index.js";
7
9
  import { type LanguageTag } from "../language.js";
8
10
  import type { ResultFeedback } from "../memory/memory.js";
@@ -17,18 +19,49 @@ import { RetrievalEngine } from "../retrieval/engine.js";
17
19
  import { RetrievalMethodRegistry } from "../retrieval/registry.js";
18
20
  import type { CuratedResult, RetrievalDiagnostic, RetrievalOptions, RetrievalResult } from "../retrieval/types.js";
19
21
  import { type ScanDuplicateDocumentsDetails } from "./dupey-tool.js";
22
+ import { type AutoRAGFastAnswerDetails } from "./fast-answer-tool.js";
20
23
  import { type JikjiFindProviderResult } from "./jikji-find-tool.js";
24
+ import { type AutoRAGPiInteractiveRuntime, type AutoRAGPiSession } from "./pi-session.js";
21
25
  import { type RefreshProgressCounts, type RefreshProgressPhase } from "./refresh-progress.js";
22
26
  import { type SearchDocumentDiagnostic, type SearchDocumentsResponse, type SearchDocumentsStreamEvent } from "./search-documents.js";
23
27
  import { type WatcherFactory, type WatchRefreshHandle } from "./watch-refresh.js";
24
28
  import { type WebFetchToolOptions } from "./web-fetch-tool.js";
25
29
  import { type WebSearchToolOptions } from "./web-search-tool.js";
30
+ /**
31
+ * Hard caps on retrieval, baseline prefetch, and the candidate lists handed to
32
+ * the model. Every field is optional: an omitted field keeps the shipped
33
+ * default below, so this only exists to let an operator tighten or widen a
34
+ * specific cap without rebuilding. Values must be positive integers.
35
+ */
36
+ export interface AutoRAGRetrievalLimits {
37
+ /** `search_all_documents` merge ceiling when the model omits `topK`. Default 500. */
38
+ readonly mergedEvidenceCeiling?: number;
39
+ /** `search_datasource_*` merge default when the model omits `topK`. Default 50. */
40
+ readonly singleDatasourceTopK?: number;
41
+ /** MinSync semantic retrieval default `topK`. Default 50. */
42
+ readonly minSyncTopK?: number;
43
+ /** MinSync fetch cap when a scope narrows the query. Default 100. */
44
+ readonly minSyncScopedQueryTopK?: number;
45
+ /** Instance scopes listed in one datasource tool description. Default 8. */
46
+ readonly toolDescriptionInstanceScopes?: number;
47
+ /** Baseline evidence prefetched for the fast answer. */
48
+ readonly prefetch?: {
49
+ /** Jikji find candidate count. Default 30. */
50
+ readonly jikjiTopK?: number;
51
+ /** MinSync retrieve candidate count. Default 100. */
52
+ readonly minSyncTopK?: number;
53
+ /** Max Jikji answer paths rendered into the baseline. Default 100. */
54
+ readonly jikjiPathLimit?: number;
55
+ /** Max results rendered per baseline section. Default 100. */
56
+ readonly sectionLimit?: number;
57
+ };
58
+ }
26
59
  export interface AutoRefreshOptions {
27
60
  readonly intervalMs: number;
28
61
  readonly immediate?: boolean;
29
62
  }
30
63
  /** Methods that `refresh` can selectively run. Defaults to all when omitted. */
31
- export type RefreshMethod = "parsed" | "minsync" | "datasources" | "jikji";
64
+ export type RefreshMethod = "parsed" | "minsync" | "datasources" | "jikji" | "everything" | "fsearch";
32
65
  export interface AutoRAGRefreshOptions {
33
66
  /** Restrict refresh to specific methods. Defaults to all when undefined. */
34
67
  readonly methods?: readonly RefreshMethod[];
@@ -45,11 +78,30 @@ export interface AutoRAGRefreshResult extends Omit<ParsedMirrorSyncResult, "diag
45
78
  readonly diagnostics: readonly SearchDocumentDiagnostic[];
46
79
  readonly minsync?: AutoRAGMinSyncRefreshResult;
47
80
  readonly datasources?: readonly DatasourceIndexResult[];
81
+ /** Windows-only Everything file-name index outcome; absent on other platforms or when not selected. */
82
+ readonly everything?: AutoRAGEverythingRefreshResult;
83
+ /** macOS/Linux-only FSearch file-name index outcome; absent on other platforms or when not selected. */
84
+ readonly fsearch?: AutoRAGFSearchRefreshResult;
85
+ }
86
+ export interface AutoRAGEverythingRefreshResult {
87
+ readonly ok: boolean;
88
+ readonly indexedItems?: number;
89
+ readonly reason?: string;
90
+ }
91
+ export interface AutoRAGFSearchRefreshResult {
92
+ readonly ok: boolean;
93
+ readonly indexedItems?: number;
94
+ /** Stable failure kind (e.g. "binary-missing") when ok is false. */
95
+ readonly reason?: FSearchFailureReason;
96
+ /** Verbatim underlying failure text when ok is false. */
97
+ readonly message?: string;
48
98
  }
49
99
  export interface AutoRAGRefreshComponentStatus {
50
100
  readonly minsync?: string;
51
101
  readonly jikji?: string;
52
102
  readonly datasources?: string;
103
+ readonly everything?: string;
104
+ readonly fsearch?: string;
53
105
  }
54
106
  /** Path-opaque snapshot of corpus freshness and the last refresh outcome. */
55
107
  export interface AutoRAGRefreshStatus {
@@ -139,6 +191,23 @@ export interface AutoRAGAgentOptions {
139
191
  tools?: AgentTool[];
140
192
  minSync?: Omit<MinSyncVectorMethodOptions, "root"> | false;
141
193
  jikji?: JikjiOptions | false;
194
+ /**
195
+ * Windows-only instant file/folder name search through the bundled
196
+ * voidtools Everything (portable, user-level, folder-only index over
197
+ * `searchPaths`). Enabled by default on Windows; ignored elsewhere.
198
+ * `false` disables it. The remaining fields are test seams.
199
+ */
200
+ everything?: Omit<EverythingClientOptions, "root" | "folders"> | false;
201
+ /**
202
+ * macOS/Linux-only instant file/folder name search through the user's
203
+ * fsearch-cli (FSearch, GPL — spawned as a separate process, never
204
+ * bundled). Indexes only `searchPaths` into `<workspace>/.autorag/fsearch/`
205
+ * and keeps a per-workspace `fsearch-cli watch` daemon live; searches fall
206
+ * back to a bounded slow filesystem walk when fsearch-cli is not
207
+ * installed. Enabled by default on macOS/Linux; ignored elsewhere.
208
+ * `false` disables it. The remaining fields are test seams.
209
+ */
210
+ fsearch?: Omit<FSearchClientOptions, "root" | "folders"> | false;
142
211
  /**
143
212
  * Internet web tools (`web_search` + `web_fetch`), ported from oh-my-pi's
144
213
  * provider-chain web module. Default enabled and credential-free: the
@@ -154,11 +223,24 @@ export interface AutoRAGAgentOptions {
154
223
  webSearch?: (WebSearchToolOptions & {
155
224
  fetch?: WebFetchToolOptions | false;
156
225
  }) | false;
226
+ /**
227
+ * Post-merge reranking. When set (and not `false`), merged retrieval evidence
228
+ * is reordered by a dedicated rerank model — OpenRouter by default. A
229
+ * configured-but-unavailable reranker is reported as a diagnostic and the
230
+ * merged order is preserved. `false` disables reranking.
231
+ */
232
+ rerank?: RerankAgentOptions | false;
157
233
  autoRefresh?: AutoRefreshOptions;
158
234
  parserOptions?: DefaultParserRegistryOptions;
159
235
  dupey?: DupeyCliOptions | false;
160
236
  excludeExactDuplicates?: boolean;
161
237
  excludePaths?: readonly string[];
238
+ /**
239
+ * Hard caps on retrieval, baseline prefetch, and model-facing candidate
240
+ * lists. Omitted fields keep their shipped defaults — see
241
+ * {@link AutoRAGRetrievalLimits}. Values must be positive integers.
242
+ */
243
+ limits?: AutoRAGRetrievalLimits;
162
244
  datasourceSkills?: readonly DatasourceSkill[];
163
245
  datasourceAccess?: DatasourceAccessContextOptions;
164
246
  /** Non-fatal diagnostics from config/agent construction (e.g. skipped unknown datasources). */
@@ -176,9 +258,33 @@ export interface AutoRAGAgentOptions {
176
258
  remoteSession?: boolean;
177
259
  /** Two-phase progressive answers with per-phase thinking control. Default enabled. */
178
260
  thinking?: AutoRAGThinkingOptions | false;
261
+ /** pi agent directory for auth/models/extensions. Defaults to ~/.pi/agent. */
262
+ piAgentDir?: string;
263
+ /** Optional persistent pi session directory. */
264
+ piSessionDir?: string;
265
+ /** Persist one pi session transcript per AutoRAG search. Defaults true. */
266
+ persistPiSessions?: boolean;
267
+ }
268
+ /** Post-merge reranking options. Mirrors the CLI `RerankConfig` (secrets via env). */
269
+ export interface RerankAgentOptions {
270
+ /** Provider id. @default "openrouter" */
271
+ provider?: string;
272
+ /** Wire model id. @default "voyageai/rerank-3-lite" */
273
+ model?: string;
274
+ /** API key. Prefer `apiKeyEnv`; this is a programmatic seam. */
275
+ apiKey?: string;
276
+ /** Environment variable holding the provider API key. */
277
+ apiKeyEnv?: string;
278
+ /** Override the provider base URL. */
279
+ baseUrl?: string;
280
+ /** Return only the top N merged results. */
281
+ topN?: number;
282
+ /** Per-request timeout in milliseconds. */
283
+ timeoutMs?: number;
179
284
  }
180
285
  export interface AutoRAGSearchSession {
181
286
  readonly agent: Agent;
287
+ readonly piSession?: AutoRAGPiSession["session"];
182
288
  prompt(text: string): Promise<void>;
183
289
  abort(): Promise<void> | void;
184
290
  dispose(): void;
@@ -210,7 +316,7 @@ export declare class AutoRAGAgent {
210
316
  private readonly sessions;
211
317
  private activeRun;
212
318
  private resultCapture;
213
- /** This agent's model credential for model-native web search (per instance, never shared). */
319
+ private interactiveFastAnswerCallback;
214
320
  private modelNativeSearchAuth;
215
321
  private retrievalTrace;
216
322
  private preliminaryCallback;
@@ -233,9 +339,13 @@ export declare class AutoRAGAgent {
233
339
  private readonly methodRegistry;
234
340
  private readonly retriever;
235
341
  private readonly merger;
342
+ private readonly reranker;
343
+ private readonly rerankTopN;
236
344
  private readonly datasourceFilter;
237
345
  private readonly minSyncMethod;
238
346
  private readonly jikjiClient;
347
+ private readonly everythingClient;
348
+ private readonly fsearchClient;
239
349
  private readonly datasourceSkills;
240
350
  private readonly datasourceAccessOptions;
241
351
  private readonly startupDiagnostics;
@@ -248,10 +358,15 @@ export declare class AutoRAGAgent {
248
358
  private readonly droppedCallerToolNames;
249
359
  private readonly searchTimeoutMs;
250
360
  private readonly maxSearchToolCalls;
361
+ private readonly piAgentDir;
362
+ private readonly piSessionDir;
363
+ private readonly persistPiSessions;
364
+ private boundPiRuntime;
251
365
  /** True when this agent was constructed for an untrusted remote peer. */
252
366
  readonly remoteSession: boolean;
253
367
  private activeRetrievalOptions;
254
368
  private searchToolCallCount;
369
+ private readonly limits;
255
370
  constructor(options: AutoRAGAgentOptions);
256
371
  scanDuplicateDocuments(): Promise<ScanDuplicateDocumentsDetails>;
257
372
  private withMemoryContext;
@@ -261,6 +376,8 @@ export declare class AutoRAGAgent {
261
376
  private recordSearchToolEvent;
262
377
  private currentSystemPromptConfig;
263
378
  subscribe(listener: Parameters<Agent["subscribe"]>[0]): () => void;
379
+ createPiInteractiveRuntime(): Promise<AutoRAGPiInteractiveRuntime>;
380
+ private runInteractivePiQuery;
264
381
  abort(): void;
265
382
  /**
266
383
  * Periodically re-runs the incremental {@link refresh} so parsed mirrors and
@@ -322,12 +439,15 @@ export declare class AutoRAGAgent {
322
439
  * via emit_fast_answer, without any further tool calls.
323
440
  */
324
441
  buildFastAnswerPrompt(query: string, options: RetrievalOptions, baseline: string): string;
442
+ /** Discovery-tool hint naming only the registered discovery tools; empty when none. */
443
+ private discoveryHint;
325
444
  /**
326
- * Verification-phase prompt for two-phase searches. The user already saw
327
- * the fast answer; the model now verifies it against sources with thinking
328
- * on and finalizes with emit_autorag_results exactly once.
445
+ * Verification-phase prompt for two-phase searches. The fast answer, when a
446
+ * consumer already received it, is embedded verbatim so the model can diff
447
+ * against it; the model then verifies with thinking on and finalizes with
448
+ * emit_autorag_results exactly once, returning only the delta.
329
449
  */
330
- buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: string | undefined): string;
450
+ buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: AutoRAGFastAnswerDetails | undefined, fastAnswerDelivered: boolean): string;
331
451
  buildSearchPrompt(query: string, options: RetrievalOptions, initialRetrievalContext?: string): string;
332
452
  refresh(force?: boolean, opts?: AutoRAGRefreshOptions): Promise<AutoRAGRefreshResult>;
333
453
  /**
@@ -341,7 +461,7 @@ export declare class AutoRAGAgent {
341
461
  */
342
462
  getRefreshStatus(): Promise<AutoRAGRefreshStatus>;
343
463
  /**
344
- * Synchronous per-component readiness snapshot (minsync/jikji/datasources).
464
+ * Synchronous per-component readiness snapshot (minsync/jikji/datasources/everything).
345
465
  * `minsync` is "ready" only after a successful sync wrote its cursor;
346
466
  * "configured" means the binary resolved but no index exists yet.
347
467
  */
@@ -366,6 +486,23 @@ export declare class AutoRAGAgent {
366
486
  private scanMirrorStaleness;
367
487
  private exactDuplicateExclusions;
368
488
  syncMinSync(force?: boolean): Promise<MinSyncSyncResult | undefined>;
489
+ /** Provider for the Windows-only everything_search tool. */
490
+ searchEverything(request: EverythingSearchRequest): Promise<EverythingSearchResult>;
491
+ /**
492
+ * Exit this workspace's Everything instance. The instance otherwise stays
493
+ * running on purpose (live folder monitoring between CLI invocations), so
494
+ * call this only when the workspace is being torn down. No-op off Windows.
495
+ */
496
+ stopEverything(): Promise<void>;
497
+ /** Provider for the macOS/Linux-only fsearch_search tool. */
498
+ searchFsearch(request: FSearchSearchRequest): Promise<FSearchSearchResult>;
499
+ /**
500
+ * Terminate this workspace's fsearch-cli watch daemon. The daemon otherwise
501
+ * stays running on purpose (live index updates between CLI invocations), so
502
+ * call this only when the workspace is being torn down. No-op off
503
+ * macOS/Linux.
504
+ */
505
+ stopFsearch(): Promise<void>;
369
506
  prepareJikji(): Promise<readonly AutoRAGJikjiPrepareResult[] | undefined>;
370
507
  private executeJikjiPrepare;
371
508
  /**
@@ -453,6 +590,12 @@ export declare class AutoRAGAgent {
453
590
  private retrievalEngine;
454
591
  getRetrievalEngine(): RetrievalEngine;
455
592
  getSystemPrompt(): string;
593
+ /**
594
+ * Reorder merged evidence with the configured reranker. A configured-but-
595
+ * unavailable reranker, or a rerank failure, is reported as a diagnostic and
596
+ * the merged order is preserved — a reranker outage never hides evidence.
597
+ */
598
+ private applyRerank;
456
599
  private rerankWithMemory;
457
600
  private remoteFilteredRetrievalMethod;
458
601
  private normalizeRetrievalOptions;
@@ -0,0 +1,35 @@
1
+ import type { AgentTool } from "@earendil-works/pi-agent-core";
2
+ import { Type } from "typebox";
3
+ import type { EverythingSearchRequest, EverythingSearchResult } from "../everything/index.js";
4
+ export declare const EVERYTHING_SEARCH_TOOL_NAME = "everything_search";
5
+ export interface EverythingSearchProvider {
6
+ searchEverything(request: EverythingSearchRequest): Promise<EverythingSearchResult>;
7
+ }
8
+ export interface EverythingSearchDetails {
9
+ readonly method: typeof EVERYTHING_SEARCH_TOOL_NAME;
10
+ readonly resultCount: number;
11
+ readonly sources: readonly string[];
12
+ /** Retrieval-trace shape: each hit's absolute path plus its rendered line. */
13
+ readonly results: readonly {
14
+ readonly source: string;
15
+ readonly excerpt: string;
16
+ }[];
17
+ }
18
+ declare const everythingSearchSchema: Type.TObject<{
19
+ query: Type.TString;
20
+ regex: Type.TOptional<Type.TBoolean>;
21
+ matchCase: Type.TOptional<Type.TBoolean>;
22
+ matchPath: Type.TOptional<Type.TBoolean>;
23
+ wholeWord: Type.TOptional<Type.TBoolean>;
24
+ kind: Type.TOptional<Type.TUnion<[Type.TLiteral<"files">, Type.TLiteral<"folders">]>>;
25
+ path: Type.TOptional<Type.TString>;
26
+ sort: Type.TOptional<Type.TUnion<[Type.TLiteral<"name-ascending">, Type.TLiteral<"name-descending">, Type.TLiteral<"path-ascending">, Type.TLiteral<"path-descending">, Type.TLiteral<"size-ascending">, Type.TLiteral<"size-descending">, Type.TLiteral<"date-modified-ascending">, Type.TLiteral<"date-modified-descending">]>>;
27
+ offset: Type.TOptional<Type.TInteger>;
28
+ maxResults: Type.TOptional<Type.TInteger>;
29
+ }>;
30
+ /**
31
+ * Windows-only instant file/folder name search through the bundled voidtools
32
+ * Everything instance that indexes the configured search folders.
33
+ */
34
+ export declare function createEverythingSearchTool(provider: EverythingSearchProvider): AgentTool<typeof everythingSearchSchema, EverythingSearchDetails>;
35
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { AgentTool } from "@earendil-works/pi-agent-core";
2
+ import { Type } from "typebox";
3
+ import type { FSearchSearchRequest, FSearchSearchResult } from "../fsearch/index.js";
4
+ export declare const FSEARCH_SEARCH_TOOL_NAME = "fsearch_search";
5
+ export interface FSearchSearchProvider {
6
+ searchFsearch(request: FSearchSearchRequest): Promise<FSearchSearchResult>;
7
+ }
8
+ export interface FSearchSearchDetails {
9
+ readonly method: typeof FSEARCH_SEARCH_TOOL_NAME;
10
+ readonly resultCount: number;
11
+ readonly sources: readonly string[];
12
+ /** Retrieval-trace shape: each hit's absolute path plus its rendered line. */
13
+ readonly results: readonly {
14
+ readonly source: string;
15
+ readonly excerpt: string;
16
+ }[];
17
+ }
18
+ declare const fsearchSearchSchema: Type.TObject<{
19
+ query: Type.TString;
20
+ regex: Type.TOptional<Type.TBoolean>;
21
+ matchCase: Type.TOptional<Type.TBoolean>;
22
+ matchPath: Type.TOptional<Type.TBoolean>;
23
+ kind: Type.TOptional<Type.TUnion<[Type.TLiteral<"files">, Type.TLiteral<"folders">]>>;
24
+ path: Type.TOptional<Type.TString>;
25
+ sort: Type.TOptional<Type.TUnion<[Type.TLiteral<"name-ascending">, Type.TLiteral<"name-descending">, Type.TLiteral<"path-ascending">, Type.TLiteral<"path-descending">, Type.TLiteral<"size-ascending">, Type.TLiteral<"size-descending">, Type.TLiteral<"date-modified-ascending">, Type.TLiteral<"date-modified-descending">]>>;
26
+ offset: Type.TOptional<Type.TInteger>;
27
+ maxResults: Type.TOptional<Type.TInteger>;
28
+ }>;
29
+ /**
30
+ * macOS/Linux instant file/folder name search through the user's fsearch-cli
31
+ * (FSearch) database that indexes the configured search folders. Degrades to
32
+ * a bounded slow filesystem walk when fsearch-cli is not installed.
33
+ */
34
+ export declare function createFSearchSearchTool(provider: FSearchSearchProvider): AgentTool<typeof fsearchSearchSchema, FSearchSearchDetails>;
35
+ export {};
@@ -46,6 +46,8 @@ export interface JikjiFindProvider {
46
46
  }): Promise<JikjiFindProviderResult>;
47
47
  }
48
48
  export interface JikjiFindDetails {
49
+ /** Provider diagnostics, including failed roots alongside healthy answers. */
50
+ readonly diagnostics?: readonly JikjiDiagnostic[];
49
51
  readonly method: "jikji_find";
50
52
  readonly answerCount: number;
51
53
  readonly handoffAction: JikjiHandoffAction | undefined;
@@ -0,0 +1,35 @@
1
+ import type { AgentMessage, AgentTool } from "@earendil-works/pi-agent-core";
2
+ import type { Api, Model } from "@earendil-works/pi-ai";
3
+ import { type AgentSession, type AgentSessionRuntime, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
4
+ export declare const PI_BUILTIN_TOOL_NAMES: readonly ["read", "bash", "edit", "write", "grep", "find", "ls"];
5
+ export interface AutoRAGPiSessionOptions {
6
+ readonly cwd: string;
7
+ readonly agentDir?: string;
8
+ readonly sessionDir?: string;
9
+ readonly sessionPath?: string;
10
+ readonly persistSession?: boolean;
11
+ readonly model: Model<Api>;
12
+ readonly apiKey?: string;
13
+ readonly providerApiKeys?: Readonly<Record<string, string>>;
14
+ readonly getSystemPrompt: () => string;
15
+ readonly customTools: readonly AgentTool[];
16
+ readonly remoteSession?: boolean;
17
+ readonly contextTransform?: (messages: AgentMessage[]) => Promise<AgentMessage[]>;
18
+ }
19
+ export interface AutoRAGPiInteractiveRuntimeOptions extends Omit<AutoRAGPiSessionOptions, "model"> {
20
+ readonly model?: Model<Api>;
21
+ readonly inactiveToolNames?: readonly string[];
22
+ readonly onQuery: (query: string, pi: ExtensionAPI) => void | Promise<void>;
23
+ }
24
+ export interface AutoRAGPiSession {
25
+ readonly session: AgentSession;
26
+ readonly baseToolNames: readonly string[];
27
+ readonly sessionFile: string | undefined;
28
+ }
29
+ /** Creates a pi session with AutoRAG's tools and prompt. */
30
+ export declare function createAutoRAGPiSession(options: AutoRAGPiSessionOptions): Promise<AutoRAGPiSession>;
31
+ export interface AutoRAGPiInteractiveRuntime {
32
+ readonly runtime: AgentSessionRuntime;
33
+ readonly dispose: () => Promise<void>;
34
+ }
35
+ export declare function createAutoRAGPiInteractiveRuntime(options: AutoRAGPiInteractiveRuntimeOptions): Promise<AutoRAGPiInteractiveRuntime>;
@@ -1,4 +1,4 @@
1
- export type RefreshProgressPhase = "parsed" | "minsync" | "datasources" | "jikji" | "finalizing";
1
+ export type RefreshProgressPhase = "parsed" | "minsync" | "datasources" | "jikji" | "everything" | "fsearch" | "finalizing";
2
2
  export interface RefreshProgressCounts {
3
3
  readonly scanned: number;
4
4
  readonly written: number;
@@ -10,7 +10,7 @@ export type SearchDocumentDiagnosticSeverity = "info" | "warning" | "error";
10
10
  * (#21/#22) does not require another source-breaking type change; codes not yet
11
11
  * emitted are still valid members.
12
12
  */
13
- export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "minsync-staging-excluded" | "minsync-sync-failed" | "embedder-unavailable" | "embedding-identity-mismatch" | "parser-skipped" | "parser-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "retrieval-method-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit";
13
+ export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "minsync-staging-excluded" | "minsync-sync-failed" | "embedder-unavailable" | "embedding-identity-mismatch" | "parser-skipped" | "parser-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit" | "model-request-failed";
14
14
  export interface SearchDocumentDiagnostic {
15
15
  readonly code: SearchDocumentDiagnosticCode;
16
16
  readonly severity: SearchDocumentDiagnosticSeverity;
@@ -1,6 +1,5 @@
1
1
  import type { Api, Model } from "@earendil-works/pi-ai";
2
- import type { LoadLocalAutoRAGModelOptions } from "../../agent/local-model.js";
3
- import { type CliConfig, type ResolvedAgentModelDetailed } from "../config.js";
2
+ import { type CliConfig, type ResolveAgentModelOptions, type ResolvedAgentModelDetailed } from "../config.js";
4
3
  import type { CommandContext } from "./types.js";
5
4
  export type HealthCategory = "config" | "model_resolution" | "auth_missing" | "provider_unreachable" | "completion_failed" | "timeout" | "ok";
6
5
  export interface HealthCoverage {
@@ -83,7 +82,7 @@ export interface HealthDeps {
83
82
  cwd?: string;
84
83
  env?: NodeJS.ProcessEnv;
85
84
  }) => CliConfig;
86
- modelResolver?: (config: CliConfig, localOptions?: LoadLocalAutoRAGModelOptions) => ResolvedHealthModel;
85
+ modelResolver?: (config: CliConfig, options?: ResolveAgentModelOptions) => ResolvedHealthModel | Promise<ResolvedHealthModel>;
87
86
  probe?: (input: ProbeInput, signal: AbortSignal) => Promise<ProbeOutput>;
88
87
  now?: () => number;
89
88
  }
@@ -1,5 +1,24 @@
1
1
  import type { ProfileId } from "../../embedding-runtime/types.js";
2
2
  import type { CommandContext } from "./types.js";
3
+ /**
4
+ * One chat model discovered through the pi model runtime (built-in catalog plus
5
+ * `models.json`, custom, and extension providers). `available` reports whether
6
+ * the provider has complete auth configuration, including stored `auth.json`
7
+ * credentials (api-key or OAuth).
8
+ */
9
+ export interface ModelCatalogEntry {
10
+ readonly provider: string;
11
+ readonly id: string;
12
+ readonly name: string;
13
+ readonly api: string;
14
+ readonly available: boolean;
15
+ }
16
+ export interface ModelCatalogOptions {
17
+ readonly provider?: string;
18
+ /** Only list models whose provider has complete auth configuration. */
19
+ readonly available?: boolean;
20
+ readonly agentDir?: string;
21
+ }
3
22
  export interface ModelsCommandDeps {
4
23
  prefetchModel?: (profileId?: ProfileId) => Promise<{
5
24
  profileId: ProfileId;
@@ -14,5 +33,6 @@ export interface ModelsCommandDeps {
14
33
  path: string;
15
34
  hash: string;
16
35
  }>;
36
+ listModels?: (options: ModelCatalogOptions) => Promise<readonly ModelCatalogEntry[]>;
17
37
  }
18
38
  export declare function runModels(ctx: CommandContext, deps?: ModelsCommandDeps): Promise<number>;
@@ -2,7 +2,7 @@ import { type RefreshMethod } from "../../agent/agent.js";
2
2
  import type { CommandContext } from "./types.js";
3
3
  /**
4
4
  * `autorag refresh` — parse configured search paths and resync every active
5
- * index (parsed mirror, MinSync, datasources, jikji). Model-free: no LLM
5
+ * index (parsed mirror, MinSync, datasources, jikji, and Everything on Windows). Model-free: no LLM
6
6
  * is constructed. Output is rendered through the path-opaque refresh renderer;
7
7
  * the raw result (which carries absolute `indexPath`) is never printed.
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import { AutoRAGAgent, type AutoRAGAgentOptions } from "../../agent/agent.js";
2
- import { type CliConfig, type ResolvedAgentModel } from "../config.js";
2
+ import { type CliConfig, type ResolveAgentModelOptions, type ResolvedAgentModel } from "../config.js";
3
3
  import type { CommandContext } from "./types.js";
4
4
  /**
5
5
  * A recoverable health hint surfaced when `autorag search` fails for a reason
@@ -25,7 +25,7 @@ export declare function classifySearchHealthHint(error: unknown): SearchHealthHi
25
25
  */
26
26
  export interface SearchDeps {
27
27
  agentFactory?: (opts: AutoRAGAgentOptions) => Pick<AutoRAGAgent, "searchDocumentsStream">;
28
- modelResolver?: (config: CliConfig) => ResolvedAgentModel;
28
+ modelResolver?: (config: CliConfig, options?: ResolveAgentModelOptions) => ResolvedAgentModel | Promise<ResolvedAgentModel>;
29
29
  /**
30
30
  * Stops the on-demand embedding gateway so the process can exit. Without
31
31
  * this the semantic MinSync path's loopback gateway keeps the event loop