@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
@@ -1,10 +1,10 @@
1
1
  import type { Api, Model } from "@earendil-works/pi-ai";
2
2
  import { ModelRuntime } from "@earendil-works/pi-coding-agent";
3
3
  import type { AutoRAGAgentOptions, AutoRAGRefreshLimits, AutoRAGRetrievalLimits } from "../agent/agent.js";
4
- import type { JevBackendName } from "../agent/jev-extension.js";
5
4
  import { type LoadLocalAutoRAGModelOptions } from "../agent/local-model.js";
6
5
  import { type PermissionMode } from "../agent/permission-gate.js";
7
6
  import type { DecompositionModel } from "../agent/query-decomposition.js";
7
+ import { type SllmDecisionModel } from "../agent/sllm-decision.js";
8
8
  import { type DatasourcesConfig } from "../datasource/skills/factory.js";
9
9
  import type { EnsureMinSyncBinaryOptions, MinSyncEmbedderConfig } from "../minsync/index.js";
10
10
  export declare const DEFAULT_CONFIG_FILENAME = "config.json";
@@ -55,20 +55,36 @@ export interface WebSearchCliConfig {
55
55
  } | false;
56
56
  }
57
57
  /**
58
- * Jev decision-tool config. Absent disables the tool; `enabled: false` disables
59
- * it explicitly. Secrets never appear here: `jev-use` reads the backend
60
- * credential from its own environment variable (`TYPESAFE_API_KEY`,
61
- * `OPENROUTER_API_KEY`, or `AI_GATEWAY_API_KEY`), and the hosted Dazzi Models
62
- * `dazzi` backend uses the credential stored by `/login`.
58
+ * Decision-model config. The decision model is required: an absent section or `{}` uses
59
+ * {@link defaultJevBackend}, and there is no opt-out. It is either Jev (`backend` names `dazzi` or a pi
60
+ * provider with decision models) or the small chat LLM (`backend: "sllm"`, see {@link JevCliConfig.sllm}).
61
+ * Secrets never appear here: a pi provider's credential comes from its
62
+ * environment variable (`OPENROUTER_API_KEY`, `OPENAI_API_KEY`, ...) or pi's
63
+ * `auth.json`, and the hosted Dazzi Models `dazzi` backend uses the credential
64
+ * stored by `/login`.
63
65
  */
64
66
  export interface JevCliConfig {
65
- enabled?: boolean;
66
- /** Force one backend (`openrouter`, `typesafe`, `vercel`, or `dazzi`); omit to let the first credential present win. */
67
- backend?: JevBackendName;
68
- /** Model id sent with every call, e.g. `jev-latest`. */
67
+ /**
68
+ * `dazzi`, or a pi provider with decision models: `openrouter`, `openai`, `typesafe`,
69
+ * `vercel-ai-gateway`, `cloudflare-workers-ai`, or `opencode` (`autorag models list --decision`).
70
+ * `sllm` decides with the small chat LLM ({@link JevCliConfig.sllm}) and never calls Jev.
71
+ */
72
+ backend?: string;
73
+ /** Jev model id within the backend, e.g. `openai/gpt-6-luna-decisions` on OpenRouter. Not valid with `backend: "sllm"`. */
69
74
  model?: string;
70
75
  /** Escalate verdicts below this confidence (0-1). Default: per-source thresholds. */
71
76
  confidenceThreshold?: number;
77
+ /**
78
+ * The small chat LLM (sLLM). It is the decision model when `backend` is `sllm`, and otherwise the
79
+ * fallback a session moves to when Jev is unavailable. Absent or `{}` uses the question-decomposition model.
80
+ */
81
+ sllm?: JevSllmConfig;
82
+ /** Move to the sLLM when Jev is unavailable. Default true; `false` fails the session instead. Ignored with `backend: "sllm"`. */
83
+ fallback?: boolean;
84
+ }
85
+ /** The sLLM; same model reference shape and auth rules as the top-level `model`. */
86
+ export interface JevSllmConfig {
87
+ model?: AgentModelConfig;
72
88
  }
73
89
  /** Question-decomposition config. Secrets stay in env/pi auth like the main model. */
74
90
  export interface QueryDecompositionConfig {
@@ -76,19 +92,17 @@ export interface QueryDecompositionConfig {
76
92
  model?: AgentModelConfig;
77
93
  }
78
94
  /**
79
- * Post-merge reranking config. Routes merged evidence through a dedicated
80
- * rerank model. `provider` is `openrouter` (default) or the hosted Dazzi Models
81
- * plan (`dazzi`); each provider supplies its own default `model`. OpenRouter
82
- * reads its key from `apiKeyEnv`; Dazzi uses the credential stored by `/login`.
83
- * Secrets never appear here — only the environment-variable name that holds a
84
- * provider API key.
95
+ * Post-merge reranking config. Opt-in: reranking runs only when a `model` is named, and a block without one is treated
96
+ * as off (reported once at startup). `provider` is `openrouter` (default) or the hosted Dazzi Models plan (`dazzi`).
97
+ * OpenRouter reads its key from `apiKeyEnv`; Dazzi uses the credential stored by `/login`. Secrets never appear
98
+ * here, only the environment-variable name that holds a provider API key.
85
99
  */
86
100
  export interface RerankConfig {
87
- /** `false` disables reranking. Missing means enabled when the block is present. */
101
+ /** `false` disables reranking. Missing means enabled when the block is present and names a model. */
88
102
  enabled?: boolean;
89
103
  /** Provider id (`openrouter` or `dazzi`). @default "openrouter" */
90
104
  provider?: string;
91
- /** Wire model id. @default "voyageai/rerank-3-lite" (`openrouter`) / "qwen/qwen3-reranker-8b" (`dazzi`) */
105
+ /** Wire model id. Required to turn reranking on; there is no default model. */
92
106
  model?: string;
93
107
  /** Environment variable holding the provider API key (`openrouter` only). @default "OPENROUTER_API_KEY" */
94
108
  apiKeyEnv?: string;
@@ -156,13 +170,13 @@ export interface CliConfig {
156
170
  } | false;
157
171
  webSearch?: WebSearchCliConfig;
158
172
  /**
159
- * Jev query routing (direct / local), the decomposition check, the
160
- * post-fast-answer follow-up check, and the `jev` tool. On by default with
161
- * the OpenRouter backend; `false` or `enabled: false` disables it. Secrets
162
- * never appear here: `jev-use` reads the backend key from its own
163
- * environment variable.
173
+ * Jev, the required decision model: query routing, the decomposition
174
+ * check, the post-fast-answer follow-up check, citation and evidence
175
+ * judgment, the `auto` permission gate, and the `jev` tool. Absent or `{}`
176
+ * uses the default backend. Secrets never appear here: `jev-use` reads the
177
+ * backend key from its own environment variable.
164
178
  */
165
- jev?: JevCliConfig | false;
179
+ jev?: JevCliConfig;
166
180
  /**
167
181
  * Question decomposition for the Jev query pipeline. `model` names the LLM
168
182
  * that splits one question into at most five search queries; absent or `{}`
@@ -256,7 +270,7 @@ export declare function normalizeJevConfig(raw: unknown): JevCliConfig;
256
270
  * Jev backend used when the config names none (absent section or `{}`): the
257
271
  * hosted Dazzi Models plan when the user is signed in, else OpenRouter.
258
272
  */
259
- export declare function defaultJevBackend(agentDir?: string): JevBackendName;
273
+ export declare function defaultJevBackend(agentDir?: string): string;
260
274
  /** The OpenRouter fallback decomposition model, used when not signed in to Dazzi Models. */
261
275
  export declare const OPENROUTER_QUERY_DECOMPOSITION_MODEL: AgentModelConfig;
262
276
  /**
@@ -268,13 +282,11 @@ export declare const OPENROUTER_QUERY_DECOMPOSITION_MODEL: AgentModelConfig;
268
282
  export declare function defaultQueryDecompositionModel(agentDir?: string): AgentModelConfig;
269
283
  /** Validate the `queryDecomposition` config section (`false` = decompose with the session model). */
270
284
  export declare function normalizeQueryDecompositionConfig(raw: unknown): QueryDecompositionConfig | false;
271
- /** Normalize and validate the `rerank` config section, filling in defaults. */
272
- export declare function normalizeRerankConfig(raw: unknown, path: string): RerankConfig | false;
273
285
  /**
274
- * Rerank block `autorag init` writes when none is given: the hosted Dazzi
275
- * Models reranker when signed in, else OpenRouter's.
286
+ * Normalize and validate the `rerank` config section, filling in the provider, key-env, and `topN` defaults. It never
287
+ * invents a model: reranking is opt-in and runs only on a model the operator names.
276
288
  */
277
- export declare function defaultRerankConfig(agentDir?: string): RerankConfig;
289
+ export declare function normalizeRerankConfig(raw: unknown, path: string): RerankConfig | false;
278
290
  export declare function buildAgentOptions(config: CliConfig, agentDir?: string): Omit<AutoRAGAgentOptions, "model">;
279
291
  /**
280
292
  * Extra resolution inputs beyond the local codex-runtime options. `agentDir`
@@ -343,6 +355,13 @@ export declare function validateAgentConfigFile(configPath: string, options?: Re
343
355
  * returns undefined so the agent's own model decomposes.
344
356
  */
345
357
  export declare function resolveQueryDecompositionModel(config: CliConfig, options?: ResolveAgentModelOptions): Promise<DecompositionModel | undefined>;
358
+ /**
359
+ * Resolve the sLLM and its credential through the same chain as the agent model. `jev.sllm.model` names it;
360
+ * absent, it is the question-decomposition model (its configured one, else {@link defaultQueryDecompositionModel}).
361
+ * It decides in Jev's place when `jev.backend` is `sllm`, and otherwise is Jev's fallback; `jev.fallback: false`
362
+ * returns undefined for the fallback, so a session without Jev fails.
363
+ */
364
+ export declare function resolveSllmDecisionModel(config: CliConfig, options?: ResolveAgentModelOptions): Promise<SllmDecisionModel | undefined>;
346
365
  export declare function resolveAgentModelDetailed(config: CliConfig, options?: ResolveAgentModelOptions): Promise<ResolvedAgentModelDetailed>;
347
366
  export declare function readRawConfigObject(path: string): Record<string, unknown>;
348
367
  /** Atomically replace a config file, preserving the caller's JSON object. */