@autorag/librarian 2.10.0 → 2.10.2

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/LICENSE +195 -21
  2. package/NOTICE +16 -23
  3. package/README.md +399 -182
  4. package/dist/agent/agent.d.ts +163 -20
  5. package/dist/agent/context-token-guard.d.ts +23 -0
  6. package/dist/agent/evidence-ledger.d.ts +54 -5
  7. package/dist/agent/evidence-persistence.d.ts +24 -0
  8. package/dist/agent/jev-extension.d.ts +7 -4
  9. package/dist/agent/jikji-find-tool.d.ts +1 -0
  10. package/dist/agent/pi-session.d.ts +35 -2
  11. package/dist/agent/request-limits.d.ts +20 -0
  12. package/dist/agent/search-all-tool.d.ts +1 -0
  13. package/dist/agent/search-documents.d.ts +1 -1
  14. package/dist/agent/search-single-datasource-tool.d.ts +1 -0
  15. package/dist/agent/system-prompt.d.ts +0 -2
  16. package/dist/agent/tool-burst-guard.d.ts +26 -0
  17. package/dist/cli/config.d.ts +39 -23
  18. package/dist/cli/index.js +4195 -1478
  19. package/dist/cloud/config.d.ts +33 -9
  20. package/dist/cloud/credential.d.ts +17 -0
  21. package/dist/cloud/errors.d.ts +6 -6
  22. package/dist/cloud/index.d.ts +5 -4
  23. package/dist/cloud/jev-backend.d.ts +92 -0
  24. package/dist/cloud/models.d.ts +4 -4
  25. package/dist/cloud/oauth-login.d.ts +3 -3
  26. package/dist/cloud/provider.d.ts +16 -11
  27. package/dist/cloud/token.d.ts +2 -2
  28. package/dist/core.d.ts +2 -1
  29. package/dist/core.js +4200 -1506
  30. package/dist/datasource/aliased-skill.d.ts +2 -2
  31. package/dist/datasource/connector-skill.d.ts +2 -2
  32. package/dist/datasource/crawler-skill.d.ts +19 -2
  33. package/dist/datasource/described-skill.d.ts +2 -2
  34. package/dist/datasource/index.d.ts +1 -1
  35. package/dist/datasource/retry.d.ts +49 -0
  36. package/dist/datasource/sidecar/config.d.ts +26 -0
  37. package/dist/datasource/sidecar/descriptors.d.ts +67 -0
  38. package/dist/datasource/sidecar/fusion.d.ts +25 -0
  39. package/dist/datasource/sidecar/index.d.ts +131 -0
  40. package/dist/datasource/sidecar/methods.d.ts +27 -0
  41. package/dist/datasource/skills/clawgallery/skill.d.ts +4 -4
  42. package/dist/datasource/skills/discrawl/skill.d.ts +5 -5
  43. package/dist/datasource/skills/github-gist/skill.d.ts +2 -2
  44. package/dist/datasource/skills/lazykatok/skill.d.ts +5 -5
  45. package/dist/datasource/skills/mailcrawl/skill.d.ts +2 -2
  46. package/dist/datasource/skills/obsidian/skill.d.ts +5 -5
  47. package/dist/datasource/types.d.ts +16 -2
  48. package/dist/embedding-runtime/cache.d.ts +9 -0
  49. package/dist/embedding-runtime/index.d.ts +6 -6
  50. package/dist/embedding-runtime/manifest.d.ts +0 -12
  51. package/dist/embedding-runtime/types.d.ts +1 -1
  52. package/dist/index.d.ts +1 -2
  53. package/dist/index.js +4454 -1757
  54. package/dist/jikji/client.d.ts +13 -2
  55. package/dist/jikji/index.d.ts +1 -1
  56. package/dist/jikji/path-map.d.ts +9 -0
  57. package/dist/jikji/prepare-budget.d.ts +18 -0
  58. package/dist/jikji/serial-queue.d.ts +17 -0
  59. package/dist/jikji/types.d.ts +17 -0
  60. package/dist/mcp/index.js +4442 -1748
  61. package/dist/minsync/client.d.ts +6 -4
  62. package/dist/minsync/installer.d.ts +1 -1
  63. package/dist/minsync/method.d.ts +1 -1
  64. package/dist/minsync/process.d.ts +1 -0
  65. package/dist/minsync/types.d.ts +2 -2
  66. package/dist/mirror/atomic-write.d.ts +6 -0
  67. package/dist/mirror/index-store.d.ts +8 -1
  68. package/dist/mirror/index.d.ts +2 -2
  69. package/dist/mirror/sync.d.ts +57 -1
  70. package/dist/p2p/simplex-server.d.ts +0 -1
  71. package/dist/parser/defaults.d.ts +14 -4
  72. package/dist/parser/errors.d.ts +10 -0
  73. package/dist/parser/isolated.d.ts +77 -0
  74. package/dist/parser/kordoc.d.ts +1 -0
  75. package/dist/parser/ocr-engines.d.ts +6 -0
  76. package/dist/parser/parse-worker.d.ts +1 -0
  77. package/dist/parser/parse-worker.js +780 -0
  78. package/dist/parser/types.d.ts +5 -0
  79. package/dist/process/abort-reason.d.ts +2 -0
  80. package/dist/retrieval/index.d.ts +1 -1
  81. package/dist/retrieval/rerank.d.ts +28 -5
  82. package/licenses/embedding-assets.json +0 -35
  83. package/package.json +26 -29
  84. package/skills/autorag/SKILL.md +3 -2
  85. package/skills/autorag-doctor/SKILL.md +7 -1
  86. package/skills/autorag-lite-setup/SKILL.md +3 -3
  87. package/skills/autorag-setup/SKILL.md +43 -18
  88. package/dist/manifest/index.d.ts +0 -2
  89. package/dist/manifest/loader.d.ts +0 -3
  90. package/dist/manifest/types.d.ts +0 -8
  91. package/licenses/gemma-notice.txt +0 -24
  92. package/licenses/gemma-section-3.2-flow-down.txt +0 -9
  93. package/licenses/gemma-terms-of-use.html +0 -4750
  94. package/licenses/gemma-terms-of-use.txt +0 -158
@@ -3,9 +3,9 @@ export declare class JikjiClient {
3
3
  private readonly options;
4
4
  private resolvedCommand;
5
5
  private installCommandInFlight;
6
+ private readonly prepareQueue;
7
+ private readonly findQueue;
6
8
  constructor(options?: JikjiOptions);
7
- /** Jikji stores prepared corpus metadata under a hidden directory in each root. */
8
- isPrepared(root: string): boolean;
9
9
  /**
10
10
  * Resolve the jikji command following the priority chain:
11
11
  * 1. explicit binaryPath
@@ -22,5 +22,16 @@ export declare class JikjiClient {
22
22
  private resolveCommand;
23
23
  prepare(root: string, options?: JikjiPrepareOptions): Promise<JikjiPrepareResult>;
24
24
  find(root: string, query: string, options?: JikjiFindOptions): Promise<JikjiFindResult>;
25
+ /**
26
+ * Hang guard for one root, never a fixed total wall: `timeoutMs` (base) plus a
27
+ * per-file slice for every file under the root, so a very large root is not
28
+ * cut by its size. The slice defaults to the per-file parse limit
29
+ * (`parseTimeout`, seconds) that jikji itself enforces by skipping the file,
30
+ * so only a run that outlives even an all-files-hit-the-limit budget is
31
+ * killed (reported as a degraded root). `prepareTimeoutMsPerFile` overrides
32
+ * the slice; `0` restores a flat `timeoutMs` wall. A per-call `timeoutMs`
33
+ * bypasses all of this.
34
+ */
35
+ private prepareTimeoutMs;
25
36
  private spawn;
26
37
  }
@@ -5,6 +5,6 @@ export { jikjiFindDiagnostic, jikjiPrepareDiagnostic } 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
- export { mapJikjiPath, planJikjiSourceRoots, resolveReturnedPath } from "./path-map.js";
8
+ export { mapJikjiPath, outermostJikjiRoots, planJikjiSourceRoots, resolveReturnedPath } from "./path-map.js";
9
9
  export type { JikjiAnswerPack, JikjiCandidate, JikjiEvidence, JikjiFailureReason, JikjiFindOptions, JikjiFindResult, JikjiHandoffAction, JikjiNextRead, JikjiOptions, JikjiPrepareOptions, JikjiPrepareResult, JikjiToolCallPolicy, } from "./types.js";
10
10
  export { DEFAULT_JIKJI_OPTIONS } from "./types.js";
@@ -3,6 +3,15 @@ export interface JikjiSourceRoot extends SourceRoot {
3
3
  readonly searchPath: string;
4
4
  }
5
5
  export declare function planJikjiSourceRoots(searchPaths: readonly string[]): readonly JikjiSourceRoot[];
6
+ /**
7
+ * Reduce search roots to the ones Jikji should index and query: duplicates
8
+ * collapse to their first occurrence and a root nested inside another root is
9
+ * dropped, because the outer root's index already covers it. Upstream Jikji
10
+ * rejects `prepare` on a root that overlaps an indexed one, so passing nested
11
+ * roots through only produces failed refreshes and duplicate answer paths.
12
+ * Input order is preserved for the survivors.
13
+ */
14
+ export declare function outermostJikjiRoots(searchPaths: readonly string[]): readonly string[];
6
15
  export declare function mapJikjiPath(sourceRoot: SourceRoot, returnedPath: string): string | undefined;
7
16
  export declare function resolveReturnedPath(rootPath: string, returnedPath: string): string | undefined;
8
17
  export declare function isUnsafeReturnedPath(normalizedPath: string): boolean;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Largest delay `setTimeout` honors (2^31 - 1 ms, ~24.8 days); Node fires a
3
+ * larger delay after 1 ms. This is a platform limit, not a policy cap.
4
+ */
5
+ export declare const MAX_TIMER_MS = 2147483647;
6
+ /**
7
+ * `base + perFile * fileCount`. There is deliberately no policy ceiling: the
8
+ * budget grows with the root, so a huge root is never cut by a fixed wall while
9
+ * a hung run on a small root still is. Clamped only to the timer limit.
10
+ */
11
+ export declare function scaledPrepareTimeoutMs(baseMs: number, perFileMs: number, fileCount: number): number;
12
+ /**
13
+ * Count regular files under `root`. Symlinks are not followed and hidden
14
+ * entries are skipped unless `includeHidden` (matching what `jikji prepare`
15
+ * indexes by default). `exclude` globs are ignored: over-counting only
16
+ * lengthens the budget. Stops early when `signal` aborts.
17
+ */
18
+ export declare function countFiles(root: string, includeHidden: boolean, signal?: AbortSignal): Promise<number>;
@@ -0,0 +1,17 @@
1
+ /** What a queued task resolves to when its signal aborts before its turn. */
2
+ export interface SerialQueueSkip<S> {
3
+ readonly signal: AbortSignal | undefined;
4
+ readonly value: S;
5
+ }
6
+ /**
7
+ * Runs async tasks strictly one after another, in submission order. A task that
8
+ * throws rejects only its own caller; the queue keeps serving later tasks.
9
+ *
10
+ * A caller whose signal aborts while it is still waiting resolves immediately
11
+ * with `skip.value` and its task never runs. Once a task has started, aborting
12
+ * is the task's own business.
13
+ */
14
+ export declare class SerialQueue {
15
+ private tail;
16
+ run<T, S = never>(task: () => Promise<T>, skip?: SerialQueueSkip<S>): Promise<T | S>;
17
+ }
@@ -8,7 +8,20 @@ export interface JikjiOptions {
8
8
  * cargo. Set false to disable auto-installation.
9
9
  */
10
10
  readonly autoInstall?: boolean;
11
+ /**
12
+ * Wall-clock budget for one `jikji` process. Default 60 s. For `prepare` this
13
+ * is only the base of a hang guard that grows with the root's file count
14
+ * (see `prepareTimeoutMsPerFile`), not a total cap.
15
+ */
11
16
  readonly timeoutMs?: number;
17
+ /**
18
+ * Milliseconds each file under the root adds to `timeoutMs` for `prepare`.
19
+ * There is no overall ceiling, so a very large root is never cut by its
20
+ * size. Defaults to `parseTimeout` (5 s) per file, i.e. the budget only
21
+ * expires when the run is stuck beyond what per-file parse limits allow.
22
+ * `0` restores a flat `timeoutMs` wall.
23
+ */
24
+ readonly prepareTimeoutMsPerFile?: number;
12
25
  readonly maxBufferBytes?: number;
13
26
  readonly includeHidden?: boolean;
14
27
  readonly includeSensitive?: boolean;
@@ -49,6 +62,10 @@ export interface JikjiDefaultOptions {
49
62
  export declare const DEFAULT_JIKJI_OPTIONS: JikjiDefaultOptions;
50
63
  export interface JikjiPrepareOptions {
51
64
  readonly signal?: AbortSignal;
65
+ /** Hard wall for this one root; replaces the client budget (including the size-scaled one). */
66
+ readonly timeoutMs?: number;
67
+ /** `--parse-timeout` seconds for this root; replaces the client `parseTimeout`. */
68
+ readonly parseTimeout?: number;
52
69
  }
53
70
  export type JikjiFailureReason = "aborted" | "nonzero-exit" | "spawn-error" | "stderr-too-large" | "stdout-too-large" | "timeout" | "bad-answer-pack";
54
71
  export type JikjiPrepareResult = {