@autorag/librarian 2.13.4 → 2.13.6

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 (91) hide show
  1. package/NOTICE +3 -0
  2. package/README.md +50 -18
  3. package/dist/agent/agent.d.ts +111 -40
  4. package/dist/agent/cloud-release-extension.d.ts +43 -0
  5. package/dist/agent/decision-backends.d.ts +49 -0
  6. package/dist/agent/decision-model-check.d.ts +92 -0
  7. package/dist/agent/dupey-tool.d.ts +2 -0
  8. package/dist/agent/everything-search-tool.d.ts +1 -0
  9. package/dist/agent/fsearch-search-tool.d.ts +1 -0
  10. package/dist/agent/index.d.ts +4 -1
  11. package/dist/agent/jev-extension.d.ts +27 -32
  12. package/dist/agent/jikji-find-tool.d.ts +5 -0
  13. package/dist/agent/name-candidates.d.ts +88 -0
  14. package/dist/agent/permission-gate.d.ts +2 -5
  15. package/dist/agent/query-routing.d.ts +1 -1
  16. package/dist/agent/search-documents.d.ts +1 -1
  17. package/dist/agent/sllm-decision.d.ts +34 -0
  18. package/dist/cli/commands/duplicates.d.ts +3 -2
  19. package/dist/cli/commands/models.d.ts +2 -0
  20. package/dist/cli/commands/search.d.ts +2 -0
  21. package/dist/cli/config.d.ts +49 -30
  22. package/dist/cli/index.js +13522 -10169
  23. package/dist/cli/setup.d.ts +27 -1
  24. package/dist/cloud/jev-backend.d.ts +26 -4
  25. package/dist/core.js +6079 -2840
  26. package/dist/datasource/index.d.ts +2 -2
  27. package/dist/datasource/skills/obsidian/index.d.ts +1 -1
  28. package/dist/datasource/skills/obsidian/methods.d.ts +1 -1
  29. package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
  30. package/dist/datasource/skills/obsidian/vault-index.d.ts +1 -1
  31. package/dist/datasource/skills/wombat/client.d.ts +17 -0
  32. package/dist/datasource/skills/wombat/index.d.ts +4 -0
  33. package/dist/datasource/skills/wombat/methods.d.ts +15 -0
  34. package/dist/datasource/skills/wombat/skill.d.ts +38 -0
  35. package/dist/datasource/skills/wombat/types.d.ts +89 -0
  36. package/dist/dupey/cli.d.ts +21 -1
  37. package/dist/dupey/filter.d.ts +8 -1
  38. package/dist/dupey/index.d.ts +1 -0
  39. package/dist/dupey/scan-plan.d.ts +23 -0
  40. package/dist/embedding/index.d.ts +3 -1
  41. package/dist/everything/client.d.ts +1 -2
  42. package/dist/filesystem/cloud-placeholder.d.ts +313 -21
  43. package/dist/filesystem/shared-exclusive-queue.d.ts +16 -0
  44. package/dist/fsearch/client.d.ts +3 -2
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +6184 -2905
  47. package/dist/jikji/answer-pack.d.ts +7 -1
  48. package/dist/jikji/client.d.ts +28 -14
  49. package/dist/jikji/diagnostics.d.ts +16 -2
  50. package/dist/jikji/index.d.ts +3 -3
  51. package/dist/jikji/installer.d.ts +11 -5
  52. package/dist/jikji/retry-command.d.ts +10 -0
  53. package/dist/jikji/types.d.ts +47 -1
  54. package/dist/jikji/version.d.ts +20 -0
  55. package/dist/mcp/index.js +6154 -2902
  56. package/dist/mcp/server.d.ts +3 -0
  57. package/dist/minsync/binary.d.ts +10 -5
  58. package/dist/minsync/client.d.ts +7 -10
  59. package/dist/minsync/embedder-config.d.ts +11 -10
  60. package/dist/minsync/errors.d.ts +3 -0
  61. package/dist/minsync/index.d.ts +1 -1
  62. package/dist/minsync/installer.d.ts +1 -1
  63. package/dist/minsync/method.d.ts +1 -0
  64. package/dist/minsync/types.d.ts +0 -9
  65. package/dist/minsync/version.d.ts +20 -0
  66. package/dist/mirror/cloud-fingerprints.d.ts +30 -0
  67. package/dist/mirror/cloud.d.ts +79 -0
  68. package/dist/mirror/index.d.ts +4 -0
  69. package/dist/mirror/sync.d.ts +79 -1
  70. package/dist/parser/csv.d.ts +26 -0
  71. package/dist/parser/defaults.d.ts +1 -1
  72. package/dist/parser/index.d.ts +2 -0
  73. package/dist/parser/kordoc.d.ts +6 -3
  74. package/dist/parser/parse-worker.js +668 -28
  75. package/dist/parser/spreadsheet-render.d.ts +53 -0
  76. package/dist/parser/spreadsheet.d.ts +27 -0
  77. package/dist/profiles/loop-guard.d.ts +8 -2
  78. package/dist/profiles/retrieval-tools.d.ts +2 -1
  79. package/dist/profiles.js +13520 -10280
  80. package/dist/retrieval/skip.d.ts +1 -1
  81. package/dist/retrieval/types.d.ts +1 -1
  82. package/package.json +3 -3
  83. package/skills/autorag/SKILL.md +7 -4
  84. package/skills/autorag-doctor/SKILL.md +8 -3
  85. package/skills/autorag-lite-setup/SKILL.md +4 -4
  86. package/skills/autorag-setup/SKILL.md +53 -30
  87. package/dist/datasource/skills/cloud-drive/index.d.ts +0 -2
  88. package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +0 -49
  89. package/dist/datasource/skills/cloud-drive/skill.d.ts +0 -14
  90. package/dist/minsync/kiwi.d.ts +0 -17
  91. package/dist/minsync/lexical-language.d.ts +0 -18
@@ -1,5 +1,11 @@
1
1
  import type { SourceRoot } from "../filesystem/source-paths.js";
2
- import type { JikjiAnswerPack } from "./types.js";
2
+ import type { JikjiAnswerPack, JikjiConfidence } from "./types.js";
3
+ /**
4
+ * Combine the confidence of several roots' responses into one. Weakest wins: the root with the lowest level
5
+ * (then lowest score) supplies every field, and `requiresLlmRerank` is true when any root asked for it. A
6
+ * missing or unknown level counts as the weakest.
7
+ */
8
+ export declare function mergeJikjiConfidence(entries: readonly (JikjiConfidence | undefined)[]): JikjiConfidence | undefined;
3
9
  /**
4
10
  * Strict-parse and validate a `jikji find --json` answer-pack from raw stdout.
5
11
  *
@@ -1,27 +1,41 @@
1
- import type { JikjiFindOptions, JikjiFindResult, JikjiOptions, JikjiPrepareOptions, JikjiPrepareResult } from "./types.js";
1
+ import type { JikjiFindOptions, JikjiFindResult, JikjiOptions, JikjiPrepareOptions, JikjiPrepareResult, JikjiRetryStep } from "./types.js";
2
2
  export declare class JikjiClient {
3
3
  private readonly options;
4
- private resolvedCommand;
5
- private installCommandInFlight;
4
+ private resolved;
5
+ private installInFlight;
6
6
  private readonly prepareQueue;
7
7
  private readonly findQueue;
8
8
  constructor(options?: JikjiOptions);
9
9
  /**
10
- * Resolve the jikji command following the priority chain:
11
- * 1. explicit binaryPath
12
- * 2. PATH lookup for `jikji`
13
- * 3. cached `<root>/.autorag/bin/jikji`
14
- * 4. autoInstall (default true) via `cargo install jikji-cli` into the cache
15
- * — only for `prepare` (refresh); `find` passes `install: false` so a
16
- * query never waits on an install
17
- * 5. bare `jikji` (spawn-error degrade preserves the previous behavior)
18
- * A found binary is cached per client. The bare fallback is cached only after
19
- * an install attempt, so a query-time miss does not block a later refresh
20
- * from installing.
10
+ * Resolve the jikji command, refusing any binary below {@link JIKJI_MIN_VERSION}:
11
+ * 1. explicit binaryPath: used as given, never probed (the operator chose it).
12
+ * 2. PATH lookup for `jikji`, then cached `<root>/.autorag/bin/jikji`. The first one
13
+ * whose `--version` clears the floor wins. A binary whose `--version` output is
14
+ * not recognised is used as-is, so a custom build is never locked out.
15
+ * 3. Every candidate was below the floor (or none exists): `prepare` installs the
16
+ * pinned {@link JIKJI_INSTALL_VERSION} into the cache with `cargo install --force`.
17
+ * `find` (`install: false`) never installs; it reports the stale version instead.
18
+ * 4. Nothing resolvable and no root or autoInstall off: bare `jikji` (spawn-error
19
+ * degrade preserves the previous behavior).
20
+ * A usable result is cached per client. A query-time miss is not cached, so a later
21
+ * refresh can still install.
21
22
  */
22
23
  private resolveCommand;
24
+ /** Run `<candidate> --version` and decide whether it clears the floor. */
25
+ private probe;
23
26
  prepare(root: string, options?: JikjiPrepareOptions): Promise<JikjiPrepareResult>;
24
27
  find(root: string, query: string, options?: JikjiFindOptions): Promise<JikjiFindResult>;
28
+ /**
29
+ * Run the follow-up step jikji named in a `jikji_retry` answer: `discover`
30
+ * with the proof it issued, parsed like a `find` result. Queued with finds
31
+ * (a query never waits behind a refresh) and, like `find`, never installs the
32
+ * binary, refreshes in the background, or reindexes. A step whose root is not
33
+ * the root being queried is refused before anything is spawned: jikji binds
34
+ * each proof to one root, so it must not be applied to another.
35
+ */
36
+ discover(root: string, step: JikjiRetryStep, options?: {
37
+ readonly signal?: AbortSignal;
38
+ }): Promise<JikjiFindResult>;
25
39
  /**
26
40
  * Hang guard for one root, never a fixed total wall: `timeoutMs` (base) plus a
27
41
  * per-file slice for every file under the root, so a very large root is not
@@ -5,10 +5,10 @@ import type { JikjiFindResult, JikjiPrepareResult } from "./types.js";
5
5
  * path-free so they can be surfaced through public search/refresh diagnostics
6
6
  * without leaking filesystem or binary paths.
7
7
  */
8
- export type JikjiDiagnosticCode = "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed";
8
+ export type JikjiDiagnosticCode = "jikji-unavailable" | "jikji-prepare-failed" | "jikji-cloud-root-skipped" | "jikji-find-failed" | "jikji-discover-failed" | "jikji-unsupported-version";
9
9
  export interface JikjiDiagnostic {
10
10
  readonly code: JikjiDiagnosticCode;
11
- readonly severity: "warning" | "error";
11
+ readonly severity: "info" | "warning" | "error";
12
12
  readonly message: string;
13
13
  readonly source: "jikji";
14
14
  }
@@ -22,5 +22,19 @@ export declare function jikjiPrepareDiagnostic(result: JikjiPrepareResult): Jikj
22
22
  * Maps a {@link JikjiFindResult} to a path-opaque degraded-mode diagnostic.
23
23
  * Successful results map to `undefined`. The message never echoes the binary
24
24
  * path, stderr, or any filesystem path so it is safe for public diagnostics.
25
+ * The one exception is an unsupported version, see {@link unsupportedVersionDiagnostic}.
25
26
  */
26
27
  export declare function jikjiFindDiagnostic(result: JikjiFindResult): JikjiDiagnostic | undefined;
28
+ /**
29
+ * Maps a failed `discover` retry step to a diagnostic. Unlike find/prepare
30
+ * diagnostics it is deliberately NOT path-opaque: the retry step is the one
31
+ * place AutoRAG runs jikji on the model's behalf after a miss, so a failure
32
+ * must be debuggable and carries the CLI exit status and stderr verbatim,
33
+ * real paths included. Successful results map to `undefined`.
34
+ */
35
+ export declare function jikjiDiscoverDiagnostic(result: JikjiFindResult): JikjiDiagnostic | undefined;
36
+ /**
37
+ * `jikji_retry` named follow-up commands AutoRAG could not turn into a
38
+ * `discover` step. The commands are quoted verbatim so the shape can be fixed.
39
+ */
40
+ export declare function jikjiUnusableRetryDiagnostic(nextCommands: readonly string[]): JikjiDiagnostic;
@@ -1,10 +1,10 @@
1
- export { normalizeJikjiAnswerPath, parseJikjiAnswerPack, } from "./answer-pack.js";
1
+ export { mergeJikjiConfidence, normalizeJikjiAnswerPath, parseJikjiAnswerPack, } from "./answer-pack.js";
2
2
  export { JikjiClient } from "./client.js";
3
3
  export type { JikjiDiagnostic, JikjiDiagnosticCode } from "./diagnostics.js";
4
- export { jikjiFindDiagnostic, jikjiPrepareDiagnostic } from "./diagnostics.js";
4
+ export { jikjiDiscoverDiagnostic, jikjiFindDiagnostic, jikjiPrepareDiagnostic, jikjiUnusableRetryDiagnostic, } from "./diagnostics.js";
5
5
  export type { EnsureJikjiBinaryOptions, EnsureJikjiBinaryResult, JikjiInstallRunner, JikjiInstallRunResult, } from "./installer.js";
6
6
  export { cachedJikjiBinaryPath, ensureJikjiBinary, JIKJI_CRATE_NAME, JIKJI_INSTALL_TIMEOUT_MS, jikjiExecutableName, lookupExecutableInPath, } from "./installer.js";
7
7
  export type { JikjiSourceRoot } from "./path-map.js";
8
8
  export { mapJikjiPath, outermostJikjiRoots, planJikjiSourceRoots, resolveReturnedPath } from "./path-map.js";
9
- export type { JikjiAnswerPack, JikjiCandidate, JikjiEvidence, JikjiFailureReason, JikjiFindOptions, JikjiFindResult, JikjiHandoffAction, JikjiNextRead, JikjiOptions, JikjiPrepareOptions, JikjiPrepareResult, JikjiToolCallPolicy, } from "./types.js";
9
+ export type { JikjiAnswerPack, JikjiCandidate, JikjiConfidence, JikjiEvidence, JikjiFailureReason, JikjiFindOptions, JikjiFindResult, JikjiHandoffAction, JikjiNextRead, JikjiOptions, JikjiPrepareOptions, JikjiPrepareResult, JikjiRetryStep, JikjiToolCallPolicy, } from "./types.js";
10
10
  export { DEFAULT_JIKJI_OPTIONS } from "./types.js";
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Jikji CLI installer. Jikji ships as the `jikji-cli` crate on crates.io
3
- * (binary name `jikji`); there are no prebuilt GitHub release binaries, so
4
- * installation compiles from source through the user's Rust toolchain.
5
- * The binary is cached under `<root>/.autorag/bin` — the same directory the
6
- * MinSync installer uses.
3
+ * (binary name `jikji`). Since v0.2.0 it also publishes prebuilt GitHub release
4
+ * archives, but AutoRAG still installs by compiling the crate through the user's
5
+ * Rust toolchain so the pinned version (`JIKJI_INSTALL_VERSION`) is built from the
6
+ * published, checksummed source. The binary is cached under `<root>/.autorag/bin`
7
+ * — the same directory the MinSync installer uses.
7
8
  */
8
9
  export declare const JIKJI_CRATE_NAME = "jikji-cli";
9
10
  export declare const JIKJI_INSTALL_TIMEOUT_MS: number;
@@ -20,8 +21,13 @@ export type JikjiInstallRunner = (args: readonly string[], timeoutMs: number) =>
20
21
  export interface EnsureJikjiBinaryOptions {
21
22
  /** Workspace root; the binary is cached at `<root>/.autorag/bin/jikji`. */
22
23
  readonly root: string;
23
- /** crates.io version pin for `jikji-cli`. Defaults to latest. */
24
+ /** crates.io version pin for `jikji-cli`. Omit to install the latest release. */
24
25
  readonly version?: string;
26
+ /**
27
+ * Reinstall over an existing cached binary (`cargo install --force`). Without it a
28
+ * cached binary is returned untouched, so a stale cached build would never be replaced.
29
+ */
30
+ readonly force?: boolean;
25
31
  readonly env?: NodeJS.ProcessEnv;
26
32
  readonly timeoutMs?: number;
27
33
  /** Injectable process runner for tests. Defaults to spawning `cargo install`. */
@@ -0,0 +1,10 @@
1
+ import type { JikjiRetryStep } from "./types.js";
2
+ /**
3
+ * Read the `jikji discover` step out of a `next_commands` entry. The command is
4
+ * data: AutoRAG builds its own argv from the parsed root, query, top-k and
5
+ * proof, never runs the string. Returns `undefined` unless the line is exactly
6
+ * a `discover <root> <query>` retry (`--after-jikji-retry` plus a proof, only
7
+ * flags AutoRAG understands) whose proof matches `envelopeProof` when jikji
8
+ * also reports one, so an unknown or tampered shape never reaches a process.
9
+ */
10
+ export declare function parseJikjiRetryCommand(command: string, envelopeProof: string | undefined): JikjiRetryStep | undefined;
@@ -66,8 +66,15 @@ export interface JikjiPrepareOptions {
66
66
  readonly timeoutMs?: number;
67
67
  /** `--parse-timeout` seconds for this root; replaces the client `parseTimeout`. */
68
68
  readonly parseTimeout?: number;
69
+ /**
70
+ * Extra `--exclude` patterns for this one root, appended to the client's own list. AutoRAG passes the
71
+ * relative paths of cloud or network folders nested under the root so `jikji prepare` never reads them.
72
+ */
73
+ readonly exclude?: readonly string[];
69
74
  }
70
- export type JikjiFailureReason = "aborted" | "nonzero-exit" | "spawn-error" | "stderr-too-large" | "stdout-too-large" | "timeout" | "bad-answer-pack";
75
+ export type JikjiFailureReason = "aborted" | "cloud-root-skipped" | "nonzero-exit" | "spawn-error" | "stderr-too-large" | "stdout-too-large" | "timeout" | "bad-answer-pack" | "bad-retry-step"
76
+ /** The resolved `jikji` is older than {@link JIKJI_MIN_VERSION}; it was probed, never run for real. */
77
+ | "unsupported-version";
71
78
  export type JikjiPrepareResult = {
72
79
  readonly ok: true;
73
80
  readonly stdout: string;
@@ -79,6 +86,8 @@ export type JikjiPrepareResult = {
79
86
  readonly stdout: string;
80
87
  readonly stderr: string;
81
88
  readonly code: number | null;
89
+ /** Set with `reason: "unsupported-version"`: the version `jikji --version` reported. */
90
+ readonly detectedVersion?: string;
82
91
  };
83
92
  export type JikjiNextRead = "cache" | "wiki" | "original" | "none";
84
93
  export interface JikjiCandidate {
@@ -87,6 +96,18 @@ export interface JikjiCandidate {
87
96
  readonly label?: string;
88
97
  readonly score?: number;
89
98
  }
99
+ /**
100
+ * Response-level confidence jikji reports for one `find`. A signal, not a verdict: jikji reports `high`
101
+ * confidence for weak matches, so nothing here may skip reranking or verification.
102
+ */
103
+ export interface JikjiConfidence {
104
+ readonly level?: string;
105
+ readonly score?: number;
106
+ readonly answerability?: string;
107
+ readonly recommendedAction?: string;
108
+ readonly requiresLlmRerank?: boolean;
109
+ readonly indexStatus?: string;
110
+ }
90
111
  export interface JikjiEvidence {
91
112
  readonly path: string;
92
113
  readonly nextRead: JikjiNextRead;
@@ -97,6 +118,17 @@ export interface JikjiToolCallPolicy {
97
118
  readonly allowedFollowups: readonly string[];
98
119
  }
99
120
  export type JikjiHandoffAction = "direct_use" | "jikji_retry" | "raw_fallback_after_retry";
121
+ /**
122
+ * The follow-up step jikji names when `find` answers `jikji_retry`: a
123
+ * `discover` run on the same root with the rewritten query and the proof jikji
124
+ * issued for exactly that root and query.
125
+ */
126
+ export interface JikjiRetryStep {
127
+ readonly root: string;
128
+ readonly query: string;
129
+ readonly topK?: number;
130
+ readonly proof: string;
131
+ }
100
132
  export interface JikjiAnswerPack {
101
133
  readonly answerPaths: readonly string[];
102
134
  readonly paths: readonly string[];
@@ -105,6 +137,18 @@ export interface JikjiAnswerPack {
105
137
  readonly handoffAction: JikjiHandoffAction;
106
138
  readonly toolCallPolicy: JikjiToolCallPolicy;
107
139
  readonly agentShouldNotRerank: boolean;
140
+ /** Absent when jikji reported none of the confidence fields. */
141
+ readonly confidence?: JikjiConfidence;
142
+ /** `raw_fallback_allowed`; derived from the handoff when the envelope omits it. */
143
+ readonly rawFallbackAllowed: boolean;
144
+ /** `max_jikji_retries`: how many more jikji steps jikji allows before raw fallback. */
145
+ readonly maxJikjiRetries?: number;
146
+ /** `max_raw_fallback_commands`: raw shell commands jikji allows once raw fallback is open. */
147
+ readonly maxRawFallbackCommands?: number;
148
+ /** `next_commands` verbatim. */
149
+ readonly nextCommands?: readonly string[];
150
+ /** Present only for `jikji_retry` when `next_commands` names an understood discover step. */
151
+ readonly retry?: JikjiRetryStep;
108
152
  }
109
153
  export interface JikjiFindOptions {
110
154
  readonly topK?: number;
@@ -126,4 +170,6 @@ export type JikjiFindResult = {
126
170
  readonly stdout: string;
127
171
  readonly stderr: string;
128
172
  readonly code: number | null;
173
+ /** Set with `reason: "unsupported-version"`: the version `jikji --version` reported. */
174
+ readonly detectedVersion?: string;
129
175
  };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Jikji version policy.
3
+ *
4
+ * AutoRAG talks to the `jikji` CLI through a fixed argv, so it must refuse a binary that
5
+ * cannot accept that argv instead of spawning it and reporting a generic failure.
6
+ */
7
+ /**
8
+ * Oldest `jikji` AutoRAG will run. `jikji find` only accepts `--no-background-refresh`
9
+ * from 0.2.0 (0.1.1 exits 2 with `unexpected argument`), and AutoRAG passes it on every find.
10
+ */
11
+ export declare const JIKJI_MIN_VERSION = "0.2.0";
12
+ /**
13
+ * Version AutoRAG installs and pins. 0.2.1 is the first 0.2.x with the Windows rooted
14
+ * cache-path rejection (a path such as `\secret` or `C:\x` is no longer joined onto the store).
15
+ */
16
+ export declare const JIKJI_INSTALL_VERSION = "0.2.1";
17
+ /** Version from `jikji --version` output, or `undefined` when the output is not a jikji version line. */
18
+ export declare function parseJikjiVersion(output: string): string | undefined;
19
+ /** True when `version` is at or above {@link JIKJI_MIN_VERSION}. Numeric, per component. */
20
+ export declare function isSupportedJikjiVersion(version: string): boolean;