@autorag/librarian 2.4.1 → 2.5.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 (94) hide show
  1. package/NOTICE +68 -0
  2. package/README.md +72 -30
  3. package/dist/agent/agent.d.ts +74 -2
  4. package/dist/agent/emit-results-tool.d.ts +1 -2
  5. package/dist/agent/fast-answer-tool.d.ts +46 -0
  6. package/dist/agent/index.d.ts +1 -1
  7. package/dist/agent/peer-target-tool.d.ts +19 -0
  8. package/dist/agent/search-all-tool.d.ts +3 -0
  9. package/dist/agent/search-datasource-tool.d.ts +3 -0
  10. package/dist/agent/search-documents.d.ts +50 -5
  11. package/dist/agent/search-minsync-tool.d.ts +3 -0
  12. package/dist/agent/system-prompt.d.ts +1 -0
  13. package/dist/cli/commands/duplicates.d.ts +6 -0
  14. package/dist/cli/commands/gateway.d.ts +7 -0
  15. package/dist/cli/commands/lite-refresh.d.ts +10 -0
  16. package/dist/cli/commands/lite-retrieve.d.ts +33 -0
  17. package/dist/cli/commands/lite.d.ts +3 -0
  18. package/dist/cli/commands/models.d.ts +18 -0
  19. package/dist/cli/commands/p2p-policy.d.ts +2 -0
  20. package/dist/cli/commands/p2p.d.ts +7 -0
  21. package/dist/cli/commands/report.d.ts +3 -0
  22. package/dist/cli/commands/serve.d.ts +18 -0
  23. package/dist/cli/commands/setup.d.ts +2 -0
  24. package/dist/cli/commands/status.d.ts +2 -0
  25. package/dist/cli/commands/tui.d.ts +1 -1
  26. package/dist/cli/commands/watch.d.ts +2 -0
  27. package/dist/cli/config.d.ts +20 -0
  28. package/dist/cli/index.js +7911 -2518
  29. package/dist/cli/output.d.ts +6 -0
  30. package/dist/cli/setup.d.ts +59 -0
  31. package/dist/core.d.ts +67 -0
  32. package/dist/core.js +18172 -0
  33. package/dist/datasource/access-context.d.ts +1 -1
  34. package/dist/datasource/connector-skill.d.ts +1 -1
  35. package/dist/datasource/connector.d.ts +1 -1
  36. package/dist/datasource/index.d.ts +0 -1
  37. package/dist/datasource/result-filter.d.ts +1 -1
  38. package/dist/datasource/skills/discrawl/client.d.ts +6 -2
  39. package/dist/datasource/skills/discrawl/index.d.ts +1 -1
  40. package/dist/datasource/skills/discrawl/skill.d.ts +2 -1
  41. package/dist/datasource/skills/discrawl/types.d.ts +22 -0
  42. package/dist/datasource/skills/factory.d.ts +2 -1
  43. package/dist/datasource/skills/katok/client.d.ts +4 -7
  44. package/dist/datasource/skills/katok/types.d.ts +1 -6
  45. package/dist/embedding-runtime/cache.d.ts +21 -0
  46. package/dist/embedding-runtime/gateway.d.ts +27 -0
  47. package/dist/embedding-runtime/index.d.ts +120 -0
  48. package/dist/embedding-runtime/manifest.d.ts +24 -0
  49. package/dist/embedding-runtime/supervisor.d.ts +74 -0
  50. package/dist/embedding-runtime/types.d.ts +66 -0
  51. package/dist/filesystem/source-paths.d.ts +27 -0
  52. package/dist/index.d.ts +2 -1
  53. package/dist/index.js +13214 -8659
  54. package/dist/minsync/client.d.ts +26 -1
  55. package/dist/minsync/embedder-config.d.ts +12 -0
  56. package/dist/minsync/index.d.ts +4 -3
  57. package/dist/minsync/installer.d.ts +7 -1
  58. package/dist/minsync/local-embedder.d.ts +16 -0
  59. package/dist/minsync/method.d.ts +8 -2
  60. package/dist/minsync/types.d.ts +9 -0
  61. package/dist/mirror/index.d.ts +1 -1
  62. package/dist/mirror/paths.d.ts +2 -0
  63. package/dist/mirror/sync.d.ts +1 -0
  64. package/dist/observability/run-log.d.ts +2 -0
  65. package/dist/p2p/approval-store.d.ts +31 -0
  66. package/dist/p2p/egress-gate.d.ts +22 -0
  67. package/dist/p2p/file-sharing.d.ts +33 -0
  68. package/dist/p2p/injection-classifier.d.ts +33 -0
  69. package/dist/p2p/injection-gate.d.ts +37 -0
  70. package/dist/p2p/pii-gate.d.ts +47 -0
  71. package/dist/p2p/policy-filter.d.ts +15 -0
  72. package/dist/p2p/policy.d.ts +77 -0
  73. package/dist/p2p/simplex-server.d.ts +95 -0
  74. package/dist/p2p/simplex-transport.d.ts +38 -0
  75. package/dist/p2p/wire.d.ts +39 -0
  76. package/dist/process/terminate-tree.d.ts +20 -0
  77. package/dist/retrieval/engine.d.ts +123 -0
  78. package/dist/retrieval/index.d.ts +1 -0
  79. package/licenses/apache-2.0.txt +202 -0
  80. package/licenses/embedding-assets.json +104 -0
  81. package/licenses/gemma-notice.txt +24 -0
  82. package/licenses/gemma-section-3.2-flow-down.txt +9 -0
  83. package/licenses/gemma-terms-of-use.html +4750 -0
  84. package/licenses/gemma-terms-of-use.txt +158 -0
  85. package/licenses/llama.cpp-MIT.txt +21 -0
  86. package/licenses/qwen3-embedding-notice.txt +13 -0
  87. package/package.json +19 -10
  88. package/skills/autorag/SKILL.md +16 -6
  89. package/skills/autorag-lite-search/SKILL.md +155 -0
  90. package/skills/autorag-lite-setup/SKILL.md +182 -0
  91. package/skills/autorag-setup/SKILL.md +58 -27
  92. package/dist/datasource/skills/gmail/connector.d.ts +0 -30
  93. package/dist/datasource/skills/gmail/index.d.ts +0 -2
  94. package/dist/datasource/skills/gmail/skill.d.ts +0 -24
@@ -136,11 +136,21 @@ defaults to true; requires the Rust toolchain).
136
136
 
137
137
  Exact duplicate exclusion is enabled by default. AutoRAG invokes the external
138
138
  `dupey` CLI before parsed-mirror indexing, keeps the newest filesystem copy for
139
- each exact canonical-text hash, and excludes older copies from the mirror. Set
140
- `"excludeExactDuplicates": false` to index every copy. Missing dupey is
141
- non-fatal; refresh continues without this optimization.
142
-
143
- Optional MinSync embedder settings:
139
+ each exact canonical-text hash, and excludes older copies from the mirror.
140
+ Install dupey during setup when it is missing (`command -v dupey || cargo
141
+ install dupey`) and tell the user the feature is available; when installation
142
+ is impossible, refresh continues without this optimization and the user is
143
+ told duplicate exclusion is off. Set `"excludeExactDuplicates": false` to
144
+ index every copy.
145
+
146
+ MinSync's default embedder is local EmbeddingGemma (768 dimensions, served
147
+ locally via Ollama). The default needs no embedder flags and no API key, and
148
+ no corpus text is sent to a remote embedding service. During setup, verify the
149
+ local model is available (`ollama pull embeddinggemma` with `ollama serve`
150
+ running) instead of silently falling back.
151
+
152
+ Override the embedder only when intentionally using a different, for example
153
+ remote, provider:
144
154
 
145
155
  ```bash
146
156
  autorag init \
@@ -152,18 +162,36 @@ autorag init \
152
162
  ```
153
163
 
154
164
  Only store the environment-variable name, never its value. Dimension and batch
155
- size must be positive integers.
156
-
157
- ## Configure datasource skills when requested
158
-
159
- Prefer `autorag ui --no-open` to connect datasources. It writes the same trusted
160
- `datasources` / `datasourceAccess` fields as a hand-edited config, stores
161
- env-var names rather than secrets, and prints a loopback URL (`127.0.0.1`).
162
- Do not bind non-loopback hosts unless the user explicitly set `ui.allowRemote`.
165
+ size must be positive integers, and the dimension must match the embedder
166
+ (EmbeddingGemma is 768; text-embedding-3-small is 1536).
167
+
168
+ ## Probe and configure datasource skills (setup wizard)
169
+
170
+ `autorag ui` is still in development — do not recommend it for datasource
171
+ setup. Configure datasources directly in trusted config, wizard-style:
172
+
173
+ 1. Probe every datasource for setup feasibility before asking the user
174
+ anything: the backing CLI exists (`katok`, `discrawl`, `slacrawl`,
175
+ `wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`), its
176
+ local store or archive is present, and any credentials it needs are
177
+ available as environment variables or in the tool's own external
178
+ configuration.
179
+ 2. Auto-configure every datasource that probes feasible — write its trusted
180
+ `datasources` / `datasourceAccess` entries without asking. For example,
181
+ when Slack (`slacrawl`) and Discord (`discrawl`) are installed, set both up
182
+ automatically.
183
+ 3. Skip every datasource that probes infeasible (for example Notion or
184
+ Telegram when their CLIs are not installed) and always report the skipped
185
+ list to the user, with what is missing for each.
186
+ 4. Set up a skipped datasource only when the user explicitly asks for it:
187
+ install or authenticate the backing CLI first, then configure it.
188
+ 5. E-mail datasources (`mail-export`, `mailcrawl`) matter to most
189
+ users — always probe them and report their status, even when they end up
190
+ skipped.
163
191
 
164
192
  Datasource skills belong in trusted config and remain default-deny. Builtin
165
193
  template names are `kakao`, `whatsapp`, `telegram`, `slack`, `discord`,
166
- `clawgallery`, `notion`, `github`, `cloud-drive`, `gmail`, `mail-export`,
194
+ `clawgallery`, `notion`, `github`, `cloud-drive`, `mail-export`,
167
195
  `mailcrawl`, `obsidian`, `rss`, and `spotlight`. Config keys may be connection
168
196
  aliases with `"type": "<template>"`. Unknown names are skipped with an
169
197
  `unknown-datasource-skill` warning; they do not fail config resolution.
@@ -175,14 +203,13 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
175
203
  "github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
176
204
  "google-drive": { "type": "cloud-drive", "connector": { "provider": "google-drive", "remote": "gdrive:" } },
177
205
  "archive-drive": { "type": "cloud-drive", "connector": { "remote": "archive:" } },
178
- "gmail": { "connector": { "tokenEnv": "GMAIL_ACCESS_TOKEN", "labelIds": ["INBOX"] } },
179
206
  "mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
180
207
  "obsidian": { "connector": { "vaultPath": "/path/to/vault" } },
181
208
  "rss": { "connector": { "feeds": [{ "url": "https://example.com/feed.xml" }] } }
182
209
  },
183
210
  "datasourceAccess": {
184
- "allowedTags": ["github", "cloud-drive", "gmail", "mailcrawl", "obsidian", "rss"],
185
- "allowedScopes": ["/github/**", "/google-drive/**", "/archive-drive/**", "/gmail/**", "/mailcrawl/**", "/obsidian/**", "/rss/**"]
211
+ "allowedTags": ["github", "cloud-drive", "mailcrawl", "obsidian", "rss"],
212
+ "allowedScopes": ["/github/**", "/google-drive/**", "/archive-drive/**", "/mailcrawl/**", "/obsidian/**", "/rss/**"]
186
213
  }
187
214
  }
188
215
  ```
@@ -190,14 +217,13 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
190
217
  Tokens are environment-variable names, not raw secrets. CLI-backed connectors
191
218
  keep authentication in their external tool configuration.
192
219
 
193
- Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.1.4` or newer)
220
+ Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.1.6` or newer)
194
221
  and configured through its own Himalaya account. AutoRAG runs its local `sync`
195
222
  and `index` lifecycle, then uses the mailcrawl CLI for BM25, semantic, or
196
223
  hybrid search. Do not use 0.1.3 or earlier: a no-op sync followed by `index`
197
224
  fails with `text array must be non-empty`.
198
- Use mailcrawl for Himalaya-backed IMAP/Maildir retrieval. The legacy
199
- `gmail` connector option `backend: "himalaya"` is no longer registered; migrate
200
- that configuration to an explicit `mailcrawl` datasource.
225
+ Use mailcrawl for Gmail, IMAP, and Maildir retrieval. The former Gmail REST
226
+ datasource is removed.
201
227
 
202
228
  ## Verify and build indexes
203
229
 
@@ -228,10 +254,12 @@ autorag search "summarize the collection" --top-k 3 --json --debug
228
254
  ## Keep indexes fresh
229
255
 
230
256
  For continuous freshness, create or verify an OS-appropriate scheduled
231
- `autorag watch --once` job, typically every 15–30 minutes. Prefer cron or
232
- launchd on macOS, cron or a user systemd timer on Linux, and Task Scheduler on
233
- Windows. Use the same config as search, avoid overlapping runs, and keep logs
234
- outside source trees.
257
+ `autorag watch --once` job, hourly by default (every 1 hour; shorten only when
258
+ the user asks for fresher indexes). Prefer cron or launchd on macOS, cron or a
259
+ user systemd timer on Linux, and Task Scheduler on Windows. Use the same
260
+ config as search, avoid overlapping runs, and keep logs outside source trees.
261
+ Once the schedule is installed, tell the user right away that hourly freshness
262
+ is set up.
235
263
 
236
264
  ## Environment overrides
237
265
 
@@ -246,6 +274,9 @@ outside source trees.
246
274
  ## Completion condition
247
275
 
248
276
  Setup is complete only when the CLI is installed, roots are approved, a
249
- non-secret single-model config is written, `status` is acceptable, live `health`
277
+ non-secret single-model config is written, every datasource has been probed
278
+ and the auto-configured and skipped lists reported to the user, dupey is
279
+ installed or its absence reported, `status` is acceptable, live `health`
250
280
  passes, `refresh` builds the requested indexes, one real structured search
251
- succeeds, and any requested ongoing schedule is installed or verified.
281
+ succeeds, and any requested ongoing schedule is installed or verified with the
282
+ user told it is active.
@@ -1,30 +0,0 @@
1
- /**
2
- * Gmail connector (issue #1304).
3
- *
4
- * Lists and fetches messages through the Gmail REST v1 API with a trusted,
5
- * server-configured OAuth access token. Per-message fetch failures degrade
6
- * to warnings. Never throws; messages stay path/PII-opaque (addresses appear
7
- * only inside indexed chunk content, never in diagnostics).
8
- */
9
- import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
10
- export interface GmailConnectorOptions {
11
- /** Gmail REST base; override to point at a mock server in tests. */
12
- readonly baseUrl?: string;
13
- /** OAuth access token; explicit value wins over {@link tokenEnv}. */
14
- readonly token?: string;
15
- /** Env var name holding the access token. Default `GMAIL_ACCESS_TOKEN`. */
16
- readonly tokenEnv?: string;
17
- /** Restrict to these label ids (e.g. `["INBOX"]`). */
18
- readonly labelIds?: readonly string[];
19
- /** Gmail search query (the `q` parameter). */
20
- readonly query?: string;
21
- readonly timeoutMs?: number;
22
- readonly fetchImpl?: typeof fetch;
23
- readonly maxPages?: number;
24
- readonly maxDocuments?: number;
25
- }
26
- export declare class GmailConnector implements DatasourceConnector {
27
- private readonly options;
28
- constructor(options?: GmailConnectorOptions);
29
- fetch(signal?: AbortSignal): Promise<ConnectorFetchResult>;
30
- }
@@ -1,2 +0,0 @@
1
- export { GmailConnector, type GmailConnectorOptions } from "./connector.js";
2
- export { GMAIL_SKILL_DEFINITION, GmailSkill, type GmailSkillOptions } from "./skill.js";
@@ -1,24 +0,0 @@
1
- /**
2
- * Gmail datasource skill (issue #1304).
3
- *
4
- * Thin composition of GmailConnector with the shared
5
- * {@link ConnectorDatasourceSkill} base: descriptor, polling metadata,
6
- * ok/fail indexing with path/PII-opaque diagnostics, lexical retrieval via
7
- * the shared pipeline, opaque `/gmail/<instance>/…` sources, and a
8
- * progressive-disclosure agent-skill manifest.
9
- */
10
- import type { DatasourceConnector } from "../../connector.js";
11
- import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
12
- import { type GmailConnectorOptions } from "./connector.js";
13
- export declare const GMAIL_SKILL_DEFINITION: ConnectorSkillDefinition;
14
- export interface GmailSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
15
- /**
16
- * Trusted pre-built connector; wins over {@link connectorOptions}. Accepts
17
- * any compatible mail-backed connector.
18
- */
19
- readonly connector?: DatasourceConnector;
20
- readonly connectorOptions?: GmailConnectorOptions;
21
- }
22
- export declare class GmailSkill extends ConnectorDatasourceSkill {
23
- constructor(options?: GmailSkillOptions);
24
- }