@autorag/librarian 2.13.3 → 2.13.5

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 (98) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +50 -19
  3. package/dist/agent/agent.d.ts +110 -39
  4. package/dist/agent/cloud-release-extension.d.ts +43 -0
  5. package/dist/agent/context-token-guard.d.ts +11 -6
  6. package/dist/agent/decision-backends.d.ts +49 -0
  7. package/dist/agent/decision-model-check.d.ts +92 -0
  8. package/dist/agent/dupey-tool.d.ts +2 -0
  9. package/dist/agent/everything-search-tool.d.ts +1 -0
  10. package/dist/agent/fsearch-search-tool.d.ts +1 -0
  11. package/dist/agent/index.d.ts +4 -1
  12. package/dist/agent/jev-extension.d.ts +27 -32
  13. package/dist/agent/jikji-find-tool.d.ts +5 -0
  14. package/dist/agent/name-candidates.d.ts +88 -0
  15. package/dist/agent/permission-gate.d.ts +2 -5
  16. package/dist/agent/query-routing.d.ts +1 -1
  17. package/dist/agent/search-documents.d.ts +1 -1
  18. package/dist/agent/sllm-decision.d.ts +34 -0
  19. package/dist/agent/token-count.d.ts +4 -0
  20. package/dist/cli/commands/duplicates.d.ts +3 -2
  21. package/dist/cli/commands/models.d.ts +2 -0
  22. package/dist/cli/commands/search.d.ts +2 -0
  23. package/dist/cli/config.d.ts +49 -30
  24. package/dist/cli/index.js +11417 -8530
  25. package/dist/cli/setup.d.ts +27 -1
  26. package/dist/cloud/jev-backend.d.ts +26 -4
  27. package/dist/core.js +5905 -3131
  28. package/dist/datasource/connector-skill.d.ts +1 -1
  29. package/dist/datasource/connector.d.ts +1 -1
  30. package/dist/datasource/index.d.ts +2 -3
  31. package/dist/datasource/skills/obsidian/index.d.ts +1 -1
  32. package/dist/datasource/skills/obsidian/methods.d.ts +1 -1
  33. package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
  34. package/dist/datasource/skills/obsidian/vault-index.d.ts +1 -1
  35. package/dist/datasource/skills/wombat/client.d.ts +17 -0
  36. package/dist/datasource/skills/wombat/index.d.ts +4 -0
  37. package/dist/datasource/skills/wombat/methods.d.ts +15 -0
  38. package/dist/datasource/skills/wombat/skill.d.ts +38 -0
  39. package/dist/datasource/skills/wombat/types.d.ts +89 -0
  40. package/dist/dupey/cli.d.ts +21 -1
  41. package/dist/dupey/filter.d.ts +8 -1
  42. package/dist/dupey/index.d.ts +1 -0
  43. package/dist/dupey/scan-plan.d.ts +23 -0
  44. package/dist/embedding/index.d.ts +3 -1
  45. package/dist/everything/client.d.ts +1 -2
  46. package/dist/filesystem/cloud-placeholder.d.ts +313 -21
  47. package/dist/filesystem/shared-exclusive-queue.d.ts +16 -0
  48. package/dist/fsearch/client.d.ts +3 -2
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.js +6010 -3199
  51. package/dist/jikji/answer-pack.d.ts +7 -1
  52. package/dist/jikji/client.d.ts +28 -14
  53. package/dist/jikji/diagnostics.d.ts +16 -2
  54. package/dist/jikji/index.d.ts +3 -3
  55. package/dist/jikji/installer.d.ts +11 -5
  56. package/dist/jikji/retry-command.d.ts +10 -0
  57. package/dist/jikji/types.d.ts +47 -1
  58. package/dist/jikji/version.d.ts +20 -0
  59. package/dist/mcp/index.js +5980 -3193
  60. package/dist/mcp/server.d.ts +3 -0
  61. package/dist/minsync/binary.d.ts +10 -5
  62. package/dist/minsync/client.d.ts +7 -10
  63. package/dist/minsync/embedder-config.d.ts +11 -10
  64. package/dist/minsync/errors.d.ts +3 -0
  65. package/dist/minsync/index.d.ts +1 -1
  66. package/dist/minsync/installer.d.ts +1 -1
  67. package/dist/minsync/method.d.ts +1 -0
  68. package/dist/minsync/types.d.ts +0 -9
  69. package/dist/minsync/version.d.ts +20 -0
  70. package/dist/mirror/cloud-fingerprints.d.ts +30 -0
  71. package/dist/mirror/cloud.d.ts +79 -0
  72. package/dist/mirror/index.d.ts +4 -0
  73. package/dist/mirror/sync.d.ts +33 -1
  74. package/dist/parser/csv.d.ts +26 -0
  75. package/dist/parser/defaults.d.ts +1 -1
  76. package/dist/parser/index.d.ts +2 -0
  77. package/dist/parser/kordoc.d.ts +6 -3
  78. package/dist/parser/parse-worker.js +668 -28
  79. package/dist/parser/spreadsheet-render.d.ts +53 -0
  80. package/dist/parser/spreadsheet.d.ts +27 -0
  81. package/dist/profiles/loop-guard.d.ts +8 -2
  82. package/dist/profiles/retrieval-tools.d.ts +2 -1
  83. package/dist/profiles.js +13531 -10756
  84. package/dist/retrieval/skip.d.ts +1 -1
  85. package/dist/retrieval/types.d.ts +1 -1
  86. package/package.json +4 -3
  87. package/skills/autorag/SKILL.md +7 -4
  88. package/skills/autorag-doctor/SKILL.md +8 -4
  89. package/skills/autorag-lite-setup/SKILL.md +4 -4
  90. package/skills/autorag-setup/SKILL.md +53 -31
  91. package/dist/datasource/skills/cloud-drive/index.d.ts +0 -2
  92. package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +0 -49
  93. package/dist/datasource/skills/cloud-drive/skill.d.ts +0 -14
  94. package/dist/datasource/skills/spotlight/connector.d.ts +0 -53
  95. package/dist/datasource/skills/spotlight/index.d.ts +0 -2
  96. package/dist/datasource/skills/spotlight/skill.d.ts +0 -33
  97. package/dist/minsync/kiwi.d.ts +0 -17
  98. package/dist/minsync/lexical-language.d.ts +0 -18
package/NOTICE CHANGED
@@ -36,6 +36,9 @@ License: Apache-2.0
36
36
  fast-xml-parser@5.11.2
37
37
  License: MIT
38
38
 
39
+ gpt-tokenizer@4.1.0
40
+ License: MIT
41
+
39
42
  iconv-lite@0.7.3
40
43
  License: MIT
41
44
 
@@ -75,6 +78,9 @@ License: Apache-2.0
75
78
  typebox@1.3.37
76
79
  License: MIT
77
80
 
81
+ xlsx@0.20.3
82
+ License: Apache-2.0
83
+
78
84
  Bundled Windows binaries (vendor/everything, extracted only on Windows):
79
85
  Everything 1.4.1.1032 portable (voidtools, David Carpenter)
80
86
  License: MIT (closed source); includes PCRE (BSD-3-Clause)
package/README.md CHANGED
@@ -187,11 +187,11 @@ AutoRAG Agent:
187
187
 
188
188
  Three principles drive every design decision in AutoRAG Agent:
189
189
 
190
- 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`) 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).*
190
+ 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`) 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).*
191
191
 
192
- 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 backend](docs/minsync-setup.md#embedding-backends) out of the box with zero external telemetry. A [remote rerank model](docs/rerank.md) (the hosted Dazzi Models reranker when signed in, else OpenRouter `voyageai/rerank-3-lite`) is an opt-in extra.
192
+ 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 backend](docs/minsync-setup.md#embedding-backends) out of the box with zero external telemetry. A [remote rerank model](docs/rerank.md) is an opt-in extra: it runs only when you name one in `rerank.model`, and otherwise the first answer is built from each source's own top 10.
193
193
 
194
- 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.
194
+ 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 (SPLADE sparse, vector, and hybrid modes) deliver rapid, low-latency turnaround across multi-turn research queries.
195
195
 
196
196
  ---
197
197
 
@@ -201,9 +201,9 @@ AutoRAG Agent orchestrates five integrated subsystems:
201
201
 
202
202
  1. **Retrieval Memory (`check_memory`):** After each answer, cited evidence Jev judges to genuinely support it is stored in `~/.autorag/memory.json`. Later searches receive this conversation's evidence, similar past questions, and long-term insights as **advisory reference** — it never reorders results or overrides current evidence. See [docs/retrieval-memory.md](docs/retrieval-memory.md).
203
203
  2. **Pluggable Multi-Method Retrieval:**
204
- - **BM25 Lexical Search:** Fast keyword ranking via MinSync over parsed markdown mirrors. AutoRAG always uses MinSync's `multilingual` tokenizer, which keeps each original word and adds Korean morphemes (via the [Kiwi](https://github.com/bab2min/Kiwi) library), so both `연구목표` and `인증서를` → `인증서` match; without Kiwi AutoRAG warns and tokenizes on whitespace. See [docs/minsync-setup.md](docs/minsync-setup.md#bm25-tokenizer).
204
+ - **SPLADE Sparse Search:** Learned-sparse keyword ranking via MinSync's KURE-Sparse-nano encoder over parsed markdown mirrors; it replaced BM25 in MinSync 0.6 and matches Korean inflected forms (`인증서를` → `인증서`) with no tokenizer library. Exact identifiers among many look-alike files rank less reliably than with BM25. See [docs/minsync-setup.md](docs/minsync-setup.md#sparse-retrieval-splade).
205
205
  - **Semantic Vector Search:** Dense vector retrieval over CDC chunks via the shared MinSync embedder.
206
- - **Hybrid Search:** Combines BM25 and vector ranking via Reciprocal Rank Fusion (RRF).
206
+ - **Hybrid Search:** MinSync fuses sparse and vector ranking over the same chunks.
207
207
  - **Jikji Find-First Discovery:** Local CLI-backed fast discovery answer packs.
208
208
  - **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`).
209
209
  - **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.
@@ -260,7 +260,7 @@ bun add @autorag/librarian
260
260
  ### System Prerequisites
261
261
 
262
262
  - **No Java required:** Document parsing (HWP/HWPX/HWPML, PDF, DOCX, XLSX/XLS) runs in-process through [`kordoc`](https://github.com/chrisryugj/kordoc).
263
- - **Rust Toolchain (Optional):** Automatically compiles Jikji (`jikji-cli`) if installed.
263
+ - **Rust Toolchain (Optional):** Automatically compiles Jikji (`jikji-cli`, pinned to 0.2.1) if installed. A `jikji` older than 0.2.0 on your PATH is skipped and replaced by the pinned build on the next refresh.
264
264
  - **MinSync:** Automatically downloaded and installed into `<workspace>/.autorag/bin` on first run.
265
265
  - **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.
266
266
  - **filee-cli (file conversion, automatic):** `autorag setup` and the TUI download the pinned filee-cli release (~85 MB, SHA-256 verified) into `<AUTORAG_HOME>/tools/filee-cli/<version>/`, so the agent can convert between 255 formats offline with `convert_files`. A `filee`/`filee-cli` already on `PATH` is used instead. Set `"filee": { "autoInstall": false }` to forbid the download or `"filee": { "enabled": false }` to remove the tools. Filee fetches its own engines (FFmpeg, Pandoc, LibreOffice, calibre, Ghostscript; hundreds of MB, only when a conversion needs one) on first use.
@@ -279,7 +279,7 @@ autorag init --search-paths ~/Documents/research
279
279
  # Korean + English is the default; set it explicitly for other corpora
280
280
  autorag init --search-paths ~/Documents/research --languages ja,en
281
281
 
282
- # Index documents (parses PDFs/Markdown, builds BM25 and MinSync vectors)
282
+ # Index documents (parses PDFs/Markdown, builds MinSync sparse and dense vectors)
283
283
  autorag refresh
284
284
 
285
285
  # Check indexing health
@@ -314,7 +314,9 @@ falling back to `["ko", "en"]`. Supported tags: `ko`, `en`, `ja`, `zh-hans`,
314
314
 
315
315
  | Extension | Parser |
316
316
  |---|---|
317
- | `.hwp` `.hwpx` `.hml` `.hwpml` `.pdf` `.docx` `.xlsx` `.xls` | `kordoc` (nested tables, per-sheet workbooks, no Java) |
317
+ | `.hwp` `.hwpx` `.hml` `.hwpml` `.pdf` `.docx` | `kordoc` (nested tables, no Java) |
318
+ | `.xlsx` `.xlsm` `.xlsb` `.xls` `.ods` | built-in spreadsheet reader (SheetJS) |
319
+ | `.csv` `.tsv` | built-in CSV reader (CP949/EUC-KR aware) |
318
320
  | `.pptx` | built-in PPTX reader |
319
321
  | `.eml` | built-in mail reader |
320
322
  | `.txt` `.text` `.md` `.markdown` | plain text (CP949/EUC-KR aware) |
@@ -322,6 +324,34 @@ falling back to `["ko", "en"]`. Supported tags: `ko`, `en`, `ja`, `zh-hans`,
322
324
 
323
325
  `.bmp` and `.tiff` are not parsed: kordoc rejects both as unsupported.
324
326
 
327
+ The spreadsheet reader writes one line per row. Each line names the sheet, the
328
+ cell range and the table title, and pairs every value with its column label, so
329
+ a search hit always says what a number is:
330
+
331
+ ```text
332
+ [예산총괄!A4:F4 · 2026년 연구개발비 편성표 (단위: 천원)] 구분: 직접비 | 비목: 인건비 | 편성액: 742,000 | 비율(%): 32.1%
333
+ ```
334
+
335
+ Values are what the spreadsheet shows: cached formula results with their number
336
+ formats (`742,000`, `32.1%`, dates). A format that scales the stored number keeps
337
+ that number too (`742천원 (742000)`), and a formula saved without a result shows
338
+ its formula (`=SUM(B2:B3)`). Titles above a table become its caption, merged
339
+ group headers become `상반기 > 1월`, several tables on one sheet are kept apart,
340
+ and a row longer than a search chunk is split into lines that repeat its first
341
+ value. A first row counts as the header only with clear evidence (a merged group
342
+ header, or at least three rows below it with a mostly numeric, date or formula
343
+ column); otherwise rows are kept exactly as written, so a form's label/value
344
+ cells are never relabelled. Sheets are read up to 100,000 rows each; a longer
345
+ sheet is indexed partially with a `parser-warning` diagnostic.
346
+
347
+ `.csv` and `.tsv` files produce the same lines, with the file name in place of
348
+ the sheet name. Bytes decode as UTF-8 (with or without BOM) or CP949/EUC-KR,
349
+ quoted fields keep separators, line breaks and doubled quotes, and values stay
350
+ exactly as written (`00123` and `=1+2` are not converted). `.tsv` is
351
+ tab-separated; a `.csv` follows Excel's `sep=;` first line when present and
352
+ otherwise picks the separator (`,` `;` tab `|`) that splits its first lines
353
+ most consistently.
354
+
325
355
  ### Making photos and scans searchable
326
356
 
327
357
  Image files and scanned PDF pages become searchable through one switch,
@@ -348,7 +378,7 @@ explicit `parserOptions.kordoc.ocr` overrides the language-based choice.
348
378
 
349
379
  ### Bounding and cancelling a parse
350
380
 
351
- `kordoc` (PDF, HWP/HWPX, DOCX, XLSX/XLS, images), `.pptx` and `.eml` parse in a worker
381
+ `kordoc` (PDF, HWP/HWPX, DOCX, images), the spreadsheet reader, `.pptx` and `.eml` parse in a worker
352
382
  thread during a refresh, so one corrupt or hostile file cannot hang or crash the run. A
353
383
  `Promise.race` deadline cannot stop a synchronous parse; terminating the worker can.
354
384
 
@@ -480,7 +510,7 @@ behaves as before.
480
510
  | `autorag search "<query>"` | Run the librarian agent to curate structured answers |
481
511
  | `autorag status` | Inspect corpus freshness, indexing status, and vector readiness |
482
512
  | `autorag health` | Check model provider authentication, token validity, and API reachability |
483
- | `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 |
513
+ | `autorag models list` | List chat models the pi runtime can resolve (built-ins, `models.json`, custom/extension providers) with provider auth status; `--decision` lists decision models (`jev.backend`/`jev.model` candidates) instead; never prints credential values |
484
514
  | `autorag update-check` | Compare the running `autorag` against the published npm version (also runs on `autorag tui` launch) |
485
515
  | `autorag tui` | Open Pi's interactive librarian TUI (`/login`, `/model`, `/resume`, …); the agent can stop and ask you a multiple-choice or open question through the [`ask_user` tool](docs/ask-user.md); `--telegram` / `--whatsapp` / `--discord` add the Telegram / WhatsApp / Discord remote-control bridges; `--permission-mode ask\|auto\|full` (Shift+Tab, `/permissions`) sets the [approval gate for file changes](docs/permissions.md) |
486
516
  | `autorag duplicates [DIR]` | Read-only scan for exact and near-duplicate document families with `dupey` |
@@ -653,7 +683,7 @@ AutoRAG Agent connects to external tools and communication platforms using dedic
653
683
 
654
684
  | Datasource | Skill Alias | Backend / Driver | Storage & Privacy Model | Search Capabilities |
655
685
  |---|---|---|---|---|
656
- | **Local Documents** | `local` | Native filesystem & MinSync | Workspace-local parsed mirrors (`.autorag/`) | BM25, Semantic, Hybrid |
686
+ | **Local Documents** | `local` | Native filesystem & MinSync | Workspace-local parsed mirrors (`.autorag/`) | Sparse (SPLADE), Semantic, Hybrid |
657
687
  | **KakaoTalk** | `kakao` | [`lazykatok`](https://github.com/changeroa/lazykatok) CLI | Native KakaoTalk archive; zero direct DB access | BM25, Semantic, Hybrid |
658
688
  | **Discord** | `discord` | [`discrawl`](https://github.com/openclaw/discrawl) CLI | Native SQLite archive; token-free wiretap mode | BM25 + native semantic hybrid ranking by default via a [read-only sidecar](docs/datasource-skills.md#discord-bm25-ranking); native FTS supplements lexical recall |
659
689
  | **WhatsApp** | `whatsapp` | [`wacrawl`](https://github.com/openclaw/wacrawl) CLI | Local-first incremental archive + FTS5 | Lexical FTS5; BM25 + Semantic + Hybrid by default via [`sidecar`](docs/datasource-skills.md#hybrid-search-for-chat-crawlers-sidecar) |
@@ -661,13 +691,12 @@ AutoRAG Agent connects to external tools and communication platforms using dedic
661
691
  | **Slack** | `slack` | [`slacrawl`](https://github.com/openclaw/slacrawl) CLI | Local workspace/channel/thread archive + FTS5 | Lexical FTS5; BM25 + Semantic + Hybrid by default via [`sidecar`](docs/datasource-skills.md#hybrid-search-for-chat-crawlers-sidecar) |
662
692
  | **Notion** | `notion` | [`notcrawl`](https://github.com/openclaw/notcrawl) CLI | Local page/database/block archive + FTS5 | Lexical FTS5 |
663
693
  | **Email Archives** | `mailcrawl` | [`mailcrawl`](https://github.com/NomaDamas/mailcrawl) CLI | Local Gmail, IMAP, Maildir, and `.eml`/`.mbox` mailbox backups (`--source files`) | BM25, Semantic, Hybrid |
694
+ | **Coding-Agent Sessions** | `wombat` | [`wombat`](https://github.com/NomaDamas/wombat) CLI (`cargo install wombat-sessions`) | Codex, Claude Code, OpenCode, pi, and omp conversations; thinking, tool output, and diffs are not indexed | Keyword (SPLADE), Semantic, Hybrid |
664
695
  | **Obsidian Vaults** | `obsidian` | Indexed with MinSync in its own workspace (no external CLI) | Markdown notes, folder-scopable | Lexical (BM25), Semantic, Scoped |
665
696
  | **GitHub** | `github` | GitHub REST API | In-memory fetched Issues and Pull Requests | Lexical, Scoped |
666
697
  | **GitHub Gists** | `github-gist` | GitHub REST API | Incremental local index of own-account public and permitted secret Gist content/metadata; token not stored | Lexical (BM25), Local Semantic, Scoped |
667
- | **Cloud Drives** | `cloud-drive` | [`rclone`](https://rclone.org) CLI | Google Drive (Tier-1), OneDrive, Dropbox, etc. | Incremental Mirror + BM25 |
668
698
  | **Photos & Shots** | `clawgallery` | `clawgallery` CLI | Local screenshot and photo store | Hybrid OCR/Visual Search |
669
699
  | **RSS / News** | `rss` | Native HTTP Poller | RSS 2.0 & Atom feeds (24h deduplication) | Lexical |
670
- | **macOS Spotlight** | `spotlight` | Native `mdfind` CLI | macOS system metadata and content index | System Native |
671
700
  | **Browser History** | `hister` | [Hister](https://github.com/asciimoo/hister) server (AGPL-3.0-or-later, separate program, HTTP API) | Pages visited in Chrome/Chromium/Firefox, captured by Hister's own extension and indexed by Hister (web pages only; its local-file indexing is never used) | Lexical full-text; optional Semantic via Hister's own embedding endpoint |
672
701
 
673
702
  For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md). Non-interactive `sync`/`index` steps get a one-hour per-connector budget (`connector.indexTimeoutMs`) because first-run imports routinely take minutes; interactive search keeps its 60-second default.
@@ -734,9 +763,9 @@ the whole librarian loop runs on the hosted account:
734
763
 
735
764
  `jev.backend: "dazzi"` posts Jev's native dialect to `<root>/v1/jev`
736
765
  (default model `jev-1.13`); `rerank.provider: "dazzi"` reranks against
737
- `<root>/v1/rerank` (default model `qwen/qwen3-reranker-8b`). Both use the stored
738
- `/login` credential, and an explicit `rerank.baseUrl` or `rerank.model` still overrides
739
- the defaults.
766
+ `<root>/v1/rerank`. Both use the stored `/login` credential. Reranking is opt-in and
767
+ has no default model: it runs only when `rerank.model` names one, and an explicit
768
+ `rerank.baseUrl` overrides the endpoint.
740
769
 
741
770
  ---
742
771
 
@@ -750,7 +779,7 @@ Deep dive into AutoRAG Agent's architecture, security, and integration guides:
750
779
  - **[Telegram Remote Control](docs/telegram.md):** Ask the librarian from a Telegram chat through a running `autorag tui --telegram` session: setup, commands, and keeping it alive.
751
780
  - **[Datasource Skills Reference](docs/datasource-skills.md):** Full configuration contracts, connection aliases, and connector options.
752
781
  - **[Apple Calendar & Reminders via EventKit MCP](docs/eventkit-mcp.md):** macOS-only: read Calendar events and Reminders (Google/iCloud/Exchange accounts already in Calendar.app) by running `mcp-server-apple-events` beside `autorag-mcp`. Live, read-only; not indexed.
753
- - **[Jev Decisions](docs/jev-decisions.md):** Jev query pipeline, **on by default** via Dazzi Models when signed in (OpenRouter otherwise): it routes each question to local search (everything needing more information, including the public web when the question needs recent public facts), `extra` (a knowledge answer or any other action such as committing code; one turn with every tool, no retrieval), `organize` (move, rename, convert, or sort files and folders), or its own `config` branch, and keeps a weakly-favored non-local verdict on local search through a 0.75 confidence floor. It also splits multi-part questions into up to five parallel searches (`dazzi/openai/gpt-6-luna` when signed in, else `openrouter/qwen/qwen3.7-flash`), picks which registered datasources to search before the fast answer, and ends the run after the fast answer when that answer is complete. Also covers the `jev` judgment tool, backends (OpenRouter, TypeSafe, Vercel AI Gateway), and how to opt out.
782
+ - **[Jev Decisions](docs/jev-decisions.md):** Jev, the **required** decision model, via Dazzi Models when signed in (OpenRouter otherwise), or any decision model in pi's catalog: `jev.backend` names the provider (`openrouter`, `openai`, `typesafe`, `vercel-ai-gateway`, `cloudflare-workers-ai`, `opencode`, or `dazzi`) and `jev.model` the model (e.g. `openai/gpt-6-luna-decisions` on OpenRouter, `gpt-6-luna` on OpenAI); `autorag models list --decision` lists them. The first question of every session checks that it answers; when it cannot, the session moves to an sLLM fallback (`jev.sllm.model`, the decomposition model by default, with a `decision-model-fallback` warning), and `jev.backend: "sllm"` makes that small chat LLM the decision model with no Jev call, and when that fails too it stops with `decision-model-unavailable` (exit 3 for `autorag search`). It routes each question to local search (everything needing more information, including the public web when the question needs recent public facts), `extra` (a knowledge answer or any other action such as committing code; one turn with every tool, no retrieval), `organize` (move, rename, convert, or sort files and folders), or its own `config` branch, and keeps a weakly-favored non-local verdict on local search through a 0.75 confidence floor. It also splits multi-part questions into up to five parallel searches (`dazzi/openai/gpt-6-luna` when signed in, else `openrouter/qwen/qwen3.7-flash`), picks which registered datasources to search before the fast answer, and ends the run after the fast answer when that answer is complete.
754
783
  - **[Manual QA & Datasource Test Harnesses](docs/manual-qa-datasources.md):** Real-world testing guides for Discord, KakaoTalk, Slack, Notion, and email.
755
784
  - **[Supply Chain Security & License Audits](docs/supply-chain.md):** Software bill of materials (SBOM) and dependency gate policies.
756
785
  - **[Competitive Landscape Study](docs/competitive-landscape-2026-09.md):** In-depth analysis of why in-place federation outperforms centralized RAG.
@@ -782,7 +811,7 @@ AutoRAG Agent stands on the shoulders of fantastic open-source projects:
782
811
  - **[Hister](https://github.com/asciimoo/hister)** by [asciimoo](https://github.com/asciimoo) and contributors — Self-hosted browser web-history search (AGPL-3.0-or-later). Never bundled, linked, copied, or modified: users run Hister as a separate program and AutoRAG only calls its public HTTP search API (mere aggregation). Hister is always named as the backend of the `hister` datasource.
783
812
  - **[dupey](https://github.com/NomaDamas/dupey)** by [NomaDamas](https://github.com/NomaDamas) — Fast duplicate and near-duplicate document family detection.
784
813
  - **[Filee](https://github.com/KnifeLemon/Filee)** by [KnifeLemon](https://github.com/KnifeLemon) — Offline conversion of 240+ file formats (MIT). Never bundled or linked: AutoRAG downloads the SHA-256-pinned [`filee-cli`](https://github.com/NomaDamas/filee-cli) release (NomaDamas' CLI-only redistribution, MIT) into `<AUTORAG_HOME>/tools/filee-cli/` on `autorag setup` / first conversion and spawns it as a separate process. An existing `filee`/`filee-cli` on `PATH` or `filee.binaryPath` wins. Filee downloads its own engines (FFmpeg, Pandoc, LibreOffice, …) on first use.
785
- - **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), and [`rclone`](https://rclone.org).
814
+ - **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), and [`notcrawl`](https://github.com/openclaw/notcrawl).
786
815
  - **[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.
787
816
 
788
817
  ---
@@ -823,9 +852,11 @@ Common failures and their fix:
823
852
  | A datasource errors during refresh | `datasource-index-failed` | run that CLI's own `doctor` |
824
853
  | MinSync binary missing (search and refresh fail with `MinSync is required ...`) | — | `cargo install minsync`, or leave `minSync.autoInstall` on and re-run refresh |
825
854
  | Jikji missing | `jikji-unavailable` | check the Rust toolchain, re-run refresh |
855
+ | Jikji older than 0.2.0 (the message names the version and the binary path) | `jikji-unsupported-version` | re-run `autorag refresh --method jikji` to install the pinned build, or `cargo install jikji-cli --version 0.2.1 --locked --force`; with `jikji.autoInstall: false` or `jikji.binaryPath`, upgrade it yourself |
826
856
  | Jikji prepare of a large root times out (`the Jikji prepare run timed out`) | `jikji-prepare-failed` | the refresh still finishes and the other roots are indexed. There is no fixed total wall: the per-root hang guard is `jikji.timeoutMs` (60 s base) plus `jikji.prepareTimeoutMsPerFile` ms per file under the root (default: `jikji.parseTimeout`, 5 s), uncapped, so a huge root is not cut by its size and only a run stuck beyond every file hitting its parse limit is killed. Set `prepareTimeoutMsPerFile: 0` for a flat `timeoutMs` wall. `jikji.parseTimeout` (seconds) is the per-file limit, forwarded to `jikji prepare --parse-timeout`; jikji skips a file that exceeds it. A timeout kills jikji's whole process group |
857
+ | `jikji_find` miss: the `discover` retry step fails (`Jikji discover retry failed: ... (exit status N): <stderr>`) | `jikji-discover-failed` | a miss makes AutoRAG run the `jikji discover ... --after-jikji-retry --retry-proof <proof>` command jikji named (the proof is bound to that root and rewritten query; `--no-background-refresh --no-auto-prepare` keep it from reindexing or rewriting `AGENTS.md`/`CLAUDE.md`/`.cursorrules`). The message carries the CLI exit status and stderr verbatim, real paths included; the failed root is dropped and healthy roots still answer. A `next_commands` line AutoRAG cannot parse as a plain `discover` step is quoted in the same diagnostic and is never executed |
827
858
  | 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` |
828
- | Every search does a full local search and verification, even for small talk | `query-route-fallback` | sign in to Dazzi Models with `/login`, or set `OPENROUTER_API_KEY` (Jev routing and decomposition are on by default) |
859
+ | A search stops before answering with `[decision-model-unavailable] ... (missing-credential)` | `decision-model-unavailable` (exit 3) | sign in to Dazzi Models with `/login`, or set `OPENROUTER_API_KEY`; the error's `reason` names what failed (Jev is required) |
829
860
 
830
861
  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`, or `mailcrawl doctor`, then re-run `autorag refresh --method datasources --json`.
831
862
 
@@ -6,6 +6,7 @@ import type { DatasourceIndexResult, DatasourceSkill } from "../datasource/types
6
6
  import { type DupeyCliOptions } from "../dupey/index.js";
7
7
  import { type Embedder, type ManagedEmbedder } from "../embedding/index.js";
8
8
  import { type EverythingClientOptions, type EverythingSearchRequest, type EverythingSearchResult } from "../everything/index.js";
9
+ import { type CloudFileProbe } from "../filesystem/cloud-placeholder.js";
9
10
  import { type FSearchClientOptions, type FSearchFailureReason, type FSearchSearchRequest, type FSearchSearchResult } from "../fsearch/index.js";
10
11
  import { type JikjiFailureReason, type JikjiOptions, type JikjiPrepareOptions } from "../jikji/index.js";
11
12
  import { type LanguageTag } from "../language.js";
@@ -48,6 +49,22 @@ export interface AutoRAGRefreshLimits {
48
49
  readonly maxDepth?: number;
49
50
  /** Retries for a transient per-file I/O error (EMFILE/EBUSY/EIO/ETIMEDOUT) before the file is skipped. Default 3. */
50
51
  readonly transientRetries?: number;
52
+ /**
53
+ * Most cloud-file placeholders (files whose data is not on disk) one refresh may download.
54
+ * Reading a placeholder downloads it, so this bounds disk and network use per refresh; the rest wait
55
+ * for the next one. Default 200.
56
+ */
57
+ readonly cloudMaxFiles?: number;
58
+ /** Most placeholder bytes one refresh may download; the first file is always allowed. Default 536870912 (512 MiB). */
59
+ readonly cloudMaxBytes?: number;
60
+ /** Release a downloaded cloud file again once it is parsed and indexed. Default true. */
61
+ readonly cloudEvictAfterParse?: boolean;
62
+ /**
63
+ * Retries after a failed release of a downloaded cloud file (`evictUbiquitousItem` can be refused while the
64
+ * provider still holds the file), waiting 500 ms then 1 s then 2 s. After the last retry the file is left on
65
+ * disk and `cloud-evict-failed` is reported. `0` tries once. Default 3.
66
+ */
67
+ readonly cloudEvictRetries?: number;
51
68
  }
52
69
  /**
53
70
  * Hard caps on retrieval, baseline prefetch, and the candidate lists handed to
@@ -66,13 +83,18 @@ export interface AutoRAGRetrievalLimits {
66
83
  readonly minSyncScopedQueryTopK?: number;
67
84
  /** Instance scopes listed in one datasource tool description. Default 8. */
68
85
  readonly toolDescriptionInstanceScopes?: number;
69
- /** Baseline evidence prefetched for the fast answer. */
86
+ /**
87
+ * Baseline evidence prefetched for the fast answer. Each field's default depends on reranking: with a named rerank
88
+ * model the pool is wide (the reranker picks the best); without one every source contributes its own top 10.
89
+ */
70
90
  readonly prefetch?: {
71
- /** Jikji find candidate count. Default 30. */
91
+ /** Jikji find candidate count. Default 30 with a reranker, else 10. */
72
92
  readonly jikjiTopK?: number;
73
- /** MinSync retrieve candidate count. Default 100. */
93
+ /** MinSync retrieve candidate count. Default 100 with a reranker, else 10. */
74
94
  readonly minSyncTopK?: number;
75
- /** Max Jikji answer paths rendered into the baseline. Default 100. */
95
+ /** Hits requested from each selected datasource. Default `singleDatasourceTopK` (20) with a reranker, else 10. */
96
+ readonly datasourceTopK?: number;
97
+ /** Max Jikji answer paths handed to the verification prompt as starting points. Default 100. */
76
98
  readonly jikjiPathLimit?: number;
77
99
  /** Max results rendered per baseline section. Default 100. */
78
100
  readonly sectionLimit?: number;
@@ -255,15 +277,20 @@ export interface AutoRAGAgentOptions {
255
277
  fetch?: WebFetchToolOptions | false;
256
278
  }) | false;
257
279
  /**
258
- * Post-merge reranking. When set (and not `false`), merged retrieval evidence
259
- * is reordered by a dedicated rerank model — OpenRouter by default. A
260
- * configured-but-unavailable reranker is reported as a diagnostic and the
261
- * merged order is preserved. `false` disables reranking.
280
+ * Post-merge reranking, opt-in: it runs only when a rerank `model` is named. A block without a model is treated as
281
+ * off and reported once as a `rerank-disabled` diagnostic; absent or `false` is off. With reranking off the fast
282
+ * answer's baseline keeps each source's own top 10 (see {@link AutoRAGRetrievalLimits.prefetch}). A configured
283
+ * but unavailable reranker is reported as a diagnostic and the merged order is preserved.
262
284
  */
263
285
  rerank?: RerankAgentOptions | false;
264
286
  autoRefresh?: AutoRefreshOptions;
265
287
  parserOptions?: DefaultParserRegistryOptions;
266
288
  dupey?: DupeyCliOptions | false;
289
+ /**
290
+ * Cloud placeholder probe. Omitted, the platform probe is used (macOS and Windows). A programmatic seam for
291
+ * hosts and tests that need to stand in for this machine's cloud and network roots.
292
+ */
293
+ cloudProbe?: CloudFileProbe;
267
294
  /**
268
295
  * Filee command line behind `convert_files` and `list_file_conversions`.
269
296
  * `false` leaves both tools out. The duplicate-family check on converted
@@ -271,18 +298,20 @@ export interface AutoRAGAgentOptions {
271
298
  */
272
299
  filee?: FileeCliOptions | false;
273
300
  /**
274
- * Jev (TypeSafe's judgment model: typed questions in, calibrated
275
- * probabilities out). When set, the two-phase search asks Jev before the
276
- * fast answer which branch handles the question (local search, file
277
- * organization, an extra task, or — in a local host — its own configuration)
278
- * and whether to decompose it; after the fast answer, whether
279
- * verification is needed. It also exposes the `jev` tool.
301
+ * Jev, the decision model (typed questions in, calibrated probabilities
302
+ * out). It is required: before the fast answer the two-phase search asks
303
+ * it which branch handles the question (local search, file organization,
304
+ * an extra task, or — in a local host — its own configuration) and whether
305
+ * to decompose it; after the fast answer, whether verification is needed.
306
+ * It also judges citations and evidence, drives the `auto` permission
307
+ * gate, and backs the `jev` tool.
280
308
  *
281
- * The CLI config enables this by default on OpenRouter (`buildAgentOptions`
282
- * fills it in). On this programmatic option, absent or `false` keeps Jev
283
- * off, so library callers never make paid network calls they did not ask for.
309
+ * The first question of every session probes it and fails with
310
+ * `DecisionModelUnavailableError` (code `decision-model-unavailable`) when
311
+ * it cannot answer. Omitted, the backend is resolved from the environment
312
+ * (the first credential present); `false` is rejected.
284
313
  */
285
- jev?: JevToolOptions | false;
314
+ jev?: JevToolOptions;
286
315
  /**
287
316
  * The embedder shared by memory and the datasources. Omitted, it is built from `minSync.embedder`: a
288
317
  * configured remote endpoint, else MinSync's `minsync serve` daemon, else MinSync's in-process engine.
@@ -296,11 +325,10 @@ export interface AutoRAGAgentOptions {
296
325
  */
297
326
  memoryEmbedder?: Embedder | false;
298
327
  /**
299
- * Agent self-configuration. When set (and Jev is on), Jev gains a `config`
300
- * branch for questions about AutoRAG's own settings: the turn skips the
301
- * fast answer, receives the full `autorag-setup` skill, edits
302
- * `configPath` with the pi tools, and reports what it changed as its final
303
- * message.
328
+ * Agent self-configuration. When set, Jev gains a `config` branch for
329
+ * questions about AutoRAG's own settings: the turn skips the fast answer,
330
+ * receives the full `autorag-setup` skill, edits `configPath` with the pi
331
+ * tools, and reports what it changed as its final message.
304
332
  */
305
333
  selfConfig?: SelfConfigOptions;
306
334
  /**
@@ -393,7 +421,7 @@ export interface AutoRAGAgentOptions {
393
421
  export interface RerankAgentOptions {
394
422
  /** Provider id. @default "openrouter" */
395
423
  provider?: string;
396
- /** Wire model id. @default "voyageai/rerank-3-lite" */
424
+ /** Wire model id. Required: reranking runs only when a model is named; there is no default. */
397
425
  model?: string;
398
426
  /** API key. Prefer `apiKeyEnv`; this is a programmatic seam. Not used by the `dazzi` provider. */
399
427
  apiKey?: string;
@@ -497,14 +525,28 @@ export declare class AutoRAGAgent {
497
525
  private readonly parserOptions;
498
526
  private readonly dupeyOptions;
499
527
  private readonly fileeOptions;
500
- /** pi extension registering the optional `jev` tool; undefined when disabled. */
528
+ /** Platform cloud probe; `undefined` where AutoRAG has no cloud handling. */
529
+ private readonly cloudProbe;
530
+ /** Resolved once: the machine's non-physical roots, or `[]` when they cannot be listed. */
531
+ private cloudRootsPromise;
532
+ /** pi extension registering the `jev` tool. */
501
533
  private readonly jevExtension;
502
- /** Jev judge shared by the `jev` tool and the query router; undefined when disabled. */
534
+ /** pi extension releasing the cloud files the agent opened during a run. */
535
+ private readonly cloudRelease;
536
+ /** Jev and its sLLM fallback: the session check picks which one {@link jevJudge} asks. */
537
+ private readonly decisionModels;
538
+ /** Jev judge shared by the `jev` tool, the query router, the judgments, and the permission gate. */
503
539
  private readonly jevJudge;
540
+ /**
541
+ * Session whose first question already confirmed that the decision model answers: the bound pi
542
+ * session's id, or {@link UNBOUND_DECISION_SESSION} for runs without a TUI session. Undefined until a
543
+ * check passed; a failed check leaves it unchanged, so the next question checks again.
544
+ */
545
+ private decisionModelCheckedSession;
504
546
  /** Mode and grants of the file-change approval gate; shared by every pi session this agent creates. */
505
547
  private readonly permissions;
506
548
  private readonly permissionGate;
507
- /** Self-configuration, enabled only with Jev on a local session. */
549
+ /** Self-configuration, enabled only on a local session. */
508
550
  private readonly selfConfig;
509
551
  /** Override for the packaged organize skill the `organize` branch loads; undefined keeps the packaged one. */
510
552
  private readonly organizeSkillPath;
@@ -532,6 +574,14 @@ export declare class AutoRAGAgent {
532
574
  private readonly memoryVectorPath;
533
575
  /** Every retrieval result of the in-flight run with the query/method that surfaced it. */
534
576
  private readonly evidenceOrigins;
577
+ /**
578
+ * Files Jikji found for the current search's queries, in Jikji's order. The baseline prefetch sets it;
579
+ * only the verification prompt uses it, as places to start exploring. The fast answer never sees them:
580
+ * a path says nothing about what a file contains, and the reranker cannot judge one.
581
+ */
582
+ private jikjiStartingPoints;
583
+ /** Settles once Jikji's find for every query of the current search is done. Never rejects. */
584
+ private jikjiDiscovery;
535
585
  /** Search-tool queries by tool call id, read back when the call ends. */
536
586
  private readonly searchToolQueries;
537
587
  /** Identifies this agent's conversation: everything judged in it is "current" memory. */
@@ -581,8 +631,8 @@ export declare class AutoRAGAgent {
581
631
  * After the final answer: map every cited evidence back to the search query
582
632
  * and method that found it, ask Jev (one batched call, evidence judged in
583
633
  * parallel) whether it really supports the answer sentence it backs, and
584
- * keep only what clears the threshold. Runs without Jev
585
- * store nothing; a failed judgment stores nothing and says why.
634
+ * keep only what clears the threshold. A failed judgment stores nothing and
635
+ * says why.
586
636
  */
587
637
  private recordJudgedEvidence;
588
638
  private resolveSessionModel;
@@ -615,7 +665,7 @@ export declare class AutoRAGAgent {
615
665
  private interruptibleBySteer;
616
666
  /**
617
667
  * Resolve the model's inline `[eN]` citations against this run's evidence and derive the structured results.
618
- * With Jev on, every cited chunk is first checked for relevance to the sentence that cites it and to what
668
+ * Every cited chunk is first checked for relevance to the sentence that cites it and to what
619
669
  * the user typed in this conversation; a chunk Jev finds unrelated (a table of contents, a footer) is dropped
620
670
  * from the citations before the answer is returned or judged for memory.
621
671
  */
@@ -724,8 +774,8 @@ export declare class AutoRAGAgent {
724
774
  /**
725
775
  * Jev check run after the fast answer: does the answer need correction,
726
776
  * clarification, or further research? "No" ends the run with the fast
727
- * answer as the final answer. Without Jev, or when the check fails, the run
728
- * always continues into verification.
777
+ * answer as the final answer. When the check fails, the run continues into
778
+ * verification.
729
779
  */
730
780
  private shouldFollowUp;
731
781
  /**
@@ -735,8 +785,8 @@ export declare class AutoRAGAgent {
735
785
  * most five search queries with the configured decomposition model
736
786
  * (default: the session model). On the local branch, Jev also judges, per
737
787
  * registered datasource, whether it must be searched (in parallel with
738
- * decomposition). Without Jev, and on any routing failure, this is today's
739
- * single local search for the original question with no datasource search.
788
+ * decomposition). On any routing failure this is a single local search for
789
+ * the original question with no datasource search.
740
790
  * A non-local branch that misses the confidence floor is not a failure: it
741
791
  * becomes a full local plan, decomposition and datasource check included.
742
792
  */
@@ -753,11 +803,20 @@ export declare class AutoRAGAgent {
753
803
  */
754
804
  private selectSearchDatasources;
755
805
  /**
756
- * Baseline local evidence for the fast answer. Jikji, MinSync, every
806
+ * Start Jikji's find for every search query without waiting for it. The fast answer never sees Jikji's
807
+ * files (a path says nothing about what a file contains), so nothing in the baseline depends on this; it
808
+ * runs alongside the fast answer and `searchDocuments` waits for it only before the follow-up check, to
809
+ * hand the files to the verification prompt. It stops with the run, not with a steer: a steer makes the
810
+ * run verify anyway, which is when the files are used. A failed find contributes no files.
811
+ */
812
+ private discoverJikjiFiles;
813
+ /**
814
+ * Baseline local evidence for the fast answer. MinSync, every
757
815
  * Jev-selected datasource, and (when Jev selected it) one web search run for
758
816
  * every search query in parallel (MinSync itself queues per workspace), the
759
817
  * per-query hits are interleaved and deduplicated into one pool, and that
760
- * pool is reranked against the original question.
818
+ * pool is reranked against the original question. Jikji is started here too
819
+ * (see `discoverJikjiFiles`) but is not awaited and adds nothing to the pool.
761
820
  */
762
821
  private prefetchInitialRetrievalContext;
763
822
  /**
@@ -770,7 +829,7 @@ export declare class AutoRAGAgent {
770
829
  */
771
830
  private prefetchWebSearch;
772
831
  /**
773
- * Rerank the pre-fast-answer baseline pool — Jikji answer paths, MinSync
832
+ * Rerank the pre-fast-answer baseline pool — MinSync
774
833
  * chunks, Jev-selected datasource chunks, and prefetched web hits — down to
775
834
  * the configured `rerank.topN`. With decomposition the pool merges every
776
835
  * search query's hits (interleaved), capped at the same per-source sizes as a
@@ -859,7 +918,7 @@ export declare class AutoRAGAgent {
859
918
  * against it; the model then verifies with thinking on and ends with the
860
919
  * final answer as a plain reply, returning only the delta.
861
920
  */
862
- buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: string | undefined, fastAnswerDelivered: boolean, steers?: readonly string[]): string;
921
+ buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: string | undefined, fastAnswerDelivered: boolean, steers?: readonly string[], jikjiStartingPoints?: readonly string[]): string;
863
922
  buildSearchPrompt(query: string, options: RetrievalOptions, initialRetrievalContext?: string): string;
864
923
  refresh(force?: boolean, opts?: AutoRAGRefreshOptions): Promise<AutoRAGRefreshResult>;
865
924
  /**
@@ -901,6 +960,8 @@ export declare class AutoRAGAgent {
901
960
  * so the refresh result and status remain consistent.
902
961
  */
903
962
  private scanMirrorStaleness;
963
+ /** The machine's non-physical roots, resolved once; a probe failure reads as no roots, never an error. */
964
+ private cloudRoots;
904
965
  private exactDuplicateExclusions;
905
966
  syncMinSync(force?: boolean, signal?: AbortSignal, onProgress?: (progress: MinSyncSyncProgress) => void): Promise<MinSyncSyncResult>;
906
967
  /** Provider for the Windows-only everything_search tool. */
@@ -947,6 +1008,15 @@ export declare class AutoRAGAgent {
947
1008
  readonly first?: boolean;
948
1009
  readonly signal?: AbortSignal;
949
1010
  }): Promise<JikjiFindProviderResult>;
1011
+ /**
1012
+ * One root's find, followed by jikji's recovery step. When `find` answers
1013
+ * `jikji_retry`, run the `discover` command it named with the proof it
1014
+ * issued for this root and rewritten query (re-running `find` with the proof
1015
+ * does not advance jikji, only `discover` does). One step per find: whatever
1016
+ * discover answers is final for the root, so the protocol cannot loop. A
1017
+ * failed discover drops the root and reports the CLI failure verbatim.
1018
+ */
1019
+ private findJikjiRoot;
950
1020
  /**
951
1021
  * Merge per-root answer packs into one. Concatenates answer_paths/candidates
952
1022
  * preserving per-root order; dedupes by normalized path. Does NOT cross-root
@@ -968,7 +1038,8 @@ export declare class AutoRAGAgent {
968
1038
  * - stopAfterFind: OR
969
1039
  * - agentShouldNotRerank: OR
970
1040
  * - handoffAction: MOST RESTRICTIVE (direct_use < jikji_retry < raw_fallback_after_retry)
971
- * - rawFallbackAllowed: handoffAction===raw_fallback_after_retry
1041
+ * - rawFallbackAllowed: handoffAction===raw_fallback_after_retry and every root's raw_fallback_allowed
1042
+ * - maxRawFallbackCommands: MIN over the roots that report one
972
1043
  */
973
1044
  private mergePolicy;
974
1045
  /**
@@ -0,0 +1,43 @@
1
+ import type { ExtensionFactory } from "@earendil-works/pi-coding-agent";
2
+ import { type CloudFileProbe, type CloudRoot } from "../filesystem/cloud-placeholder.js";
3
+ /** Direct child files one directory candidate contributes; beyond this a directory is left unwatched. */
4
+ export declare const DEFAULT_CLOUD_RELEASE_CHILD_CAP = 500;
5
+ /**
6
+ * Every absolute path in a tool input value: a string that is itself absolute (a `path` argument), and the
7
+ * absolute words of any string that is not (a `bash` command, where `cd "<dir>" && pdftotext "a.pdf" -` names
8
+ * the directory `/…/dir` and no absolute file). Object and array values are walked, so a tool that nests its
9
+ * arguments is covered too.
10
+ */
11
+ export declare function absolutePathsIn(value: unknown): string[];
12
+ export interface CloudReleaseExtensionOptions {
13
+ /** Platform cloud probe; without one the extension registers nothing (a platform AutoRAG cannot release on). */
14
+ readonly probe?: CloudFileProbe;
15
+ /**
16
+ * The machine's non-physical roots, resolved lazily and cached by the caller. Without one, or when it
17
+ * resolves to no releasable root (Linux, or a machine with no cloud folders), the extension does nothing.
18
+ */
19
+ readonly cloudRoots?: () => Promise<readonly CloudRoot[]>;
20
+ /** Direct child files one directory candidate contributes. Default {@link DEFAULT_CLOUD_RELEASE_CHILD_CAP}. */
21
+ readonly childCap?: number;
22
+ /** Retries after the first failed release; `0` tries once. Default {@link DEFAULT_CLOUD_EVICT_RETRIES}. */
23
+ readonly evictRetries?: number;
24
+ /** First retry wait in ms, doubled each retry. Default {@link DEFAULT_CLOUD_EVICT_BACKOFF_MS}. */
25
+ readonly evictBackoffMs?: number;
26
+ /** Wait implementation; tests inject one that records instead of sleeping. */
27
+ readonly sleep?: (ms: number) => Promise<void>;
28
+ /** One line per file that could not be released; defaults to stderr. Never thrown, never shown in the UI. */
29
+ readonly log?: (message: string) => void;
30
+ }
31
+ /**
32
+ * pi extension that releases cloud files the agent itself opened during an answer.
33
+ *
34
+ * A refresh releases the placeholders it downloads, but the agent's own tools (`bash`, `read`, `grep`, …) open
35
+ * originals too, and nothing released those. This extension watches the files a run named or was shown: before
36
+ * each call it stats the candidates a tool input names (an absolute `path`, the absolute words of a `bash`
37
+ * command, the direct children of a directory candidate) and remembers the ones that are placeholders now;
38
+ * after each result it does the same for the absolute paths a retrieval result printed. At `agent_end` it
39
+ * re-stats what it remembered and releases each file that is now on disk. A file that was already local when
40
+ * first seen is never watched, so only what this run hydrated is released. Without a probe or without a
41
+ * releasable cloud root the extension does nothing; a failed release is logged once and never thrown.
42
+ */
43
+ export declare function createCloudReleaseExtension(options: CloudReleaseExtensionOptions): ExtensionFactory;
@@ -20,15 +20,20 @@ export declare function createContextTokenGuardedTransform(model: ContextTokenGu
20
20
  /** The model with its output limit held to {@link MAX_OUTPUT_TOKENS}; the same model when already within it, or when absent. */
21
21
  export declare function withBoundedOutput<T extends Model<any> | undefined>(model: T): T;
22
22
  /**
23
- * Keep complete retrieval candidates while the assembled request fits the
24
- * model budget. Removing a per-chunk cut is only safe because this drops whole
25
- * lower-ranked candidates (with an explicit marker) instead of hiding text.
23
+ * Keep the request inside the model budget by dropping retrieval chunks only: the
24
+ * lowest-ranked ones go first, across every ranked list in the transcript (every
25
+ * list's best chunk stays before any list's second), each with an explicit marker.
26
+ * The user's query, earlier turns, and the system prompt are never edited. When no
27
+ * chunk is left to drop, only the newest tool result is shortened; anything still
28
+ * too large is left for the provider to reject and pi's compaction to recover.
26
29
  */
27
30
  export declare function guardAgentContextMessages(model: Model<any> | undefined, messages: AgentMessage[], useReportedUsage?: boolean, fixedOverheadTokens?: number): AgentMessage[];
28
31
  /**
29
- * Estimate the current transcript with pi-coding-agent's conservative chars/4
30
- * counter. `useReportedUsage` adds the last assistant turn's provider-reported
31
- * usage for the settled prefix; pass false when the messages were just edited.
32
+ * Estimate the current transcript: pi-coding-agent's chars/4 counter as the
33
+ * floor, raised by a real BPE count for text that chars/4 undercounts (see
34
+ * `token-count.ts`). `useReportedUsage` adds the last assistant turn's
35
+ * provider-reported usage for the settled prefix; pass false when the messages
36
+ * were just edited.
32
37
  */
33
38
  export declare function estimateContextMessageTokens(messages: readonly AgentMessage[], useReportedUsage?: boolean): number;
34
39
  export {};