@autorag/librarian 2.6.3 → 2.8.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 (54) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +76 -25
  3. package/dist/agent/agent.d.ts +135 -27
  4. package/dist/agent/answer-guidelines.d.ts +19 -0
  5. package/dist/agent/citations.d.ts +20 -0
  6. package/dist/agent/index.d.ts +1 -0
  7. package/dist/agent/jev-extension.d.ts +68 -0
  8. package/dist/agent/pi-session.d.ts +55 -0
  9. package/dist/agent/query-decomposition.d.ts +25 -0
  10. package/dist/agent/query-routing.d.ts +54 -0
  11. package/dist/agent/search-documents.d.ts +2 -2
  12. package/dist/agent/system-prompt.d.ts +1 -0
  13. package/dist/cli/commands/evidence.d.ts +22 -0
  14. package/dist/cli/commands/health.d.ts +2 -3
  15. package/dist/cli/commands/init.d.ts +2 -1
  16. package/dist/cli/commands/models.d.ts +20 -0
  17. package/dist/cli/commands/search.d.ts +2 -2
  18. package/dist/cli/commands/serve.d.ts +2 -2
  19. package/dist/cli/commands/tui.d.ts +12 -35
  20. package/dist/cli/commands/update-check.d.ts +8 -0
  21. package/dist/cli/config.d.ts +82 -5
  22. package/dist/cli/index.d.ts +1 -1
  23. package/dist/cli/index.js +9802 -9324
  24. package/dist/cli/update-check.d.ts +34 -0
  25. package/dist/cli/version.d.ts +5 -0
  26. package/dist/core.d.ts +34 -2
  27. package/dist/core.js +9848 -8977
  28. package/dist/everything/bundle.d.ts +15 -3
  29. package/dist/everything/client.d.ts +22 -5
  30. package/dist/everything/index.d.ts +1 -1
  31. package/dist/filesystem/name-search.d.ts +57 -0
  32. package/dist/fsearch/client.d.ts +7 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +11181 -9015
  35. package/dist/jikji/client.d.ts +6 -1
  36. package/dist/mcp/index.d.ts +2 -0
  37. package/dist/mcp/index.js +29949 -0
  38. package/dist/mcp/server.d.ts +9 -0
  39. package/dist/minsync/method.d.ts +6 -3
  40. package/dist/mirror/index.d.ts +1 -1
  41. package/dist/mirror/paths.d.ts +6 -0
  42. package/dist/retrieval/engine.d.ts +32 -1
  43. package/dist/retrieval/index.d.ts +2 -1
  44. package/dist/retrieval/rerank.d.ts +8 -3
  45. package/dist/retrieval/selection.d.ts +97 -0
  46. package/package.json +10 -3
  47. package/skills/autorag/SKILL.md +25 -4
  48. package/skills/autorag-doctor/SKILL.md +27 -18
  49. package/skills/autorag-lite-setup/SKILL.md +115 -59
  50. package/skills/autorag-setup/SKILL.md +99 -16
  51. package/dist/agent/bash-tool.d.ts +0 -32
  52. package/dist/cli/tui-commands.d.ts +0 -16
  53. package/dist/cli/tui-session-store.d.ts +0 -16
  54. package/skills/autorag-lite-search/SKILL.md +0 -245
@@ -6,6 +6,12 @@
6
6
  * and nothing is installed system-wide.
7
7
  */
8
8
  export type EverythingArch = "x64" | "arm64";
9
+ /**
10
+ * `"install"` extracts and verifies the pinned binaries when the workspace
11
+ * cache is missing or invalid; `"cached"` returns only an already extracted,
12
+ * hash-verified cache entry and never writes to disk.
13
+ */
14
+ export type EverythingBinaryResolutionMode = "cached" | "install";
9
15
  export interface EverythingArchAssets {
10
16
  readonly everythingArchive: string;
11
17
  readonly everythingArchiveSha256: string;
@@ -31,6 +37,8 @@ export interface EnsureEverythingBinariesOptions {
31
37
  readonly bundleDir?: string;
32
38
  /** Bundle manifest. Defaults to `<bundleDir>/manifest.json`. */
33
39
  readonly manifest?: EverythingBundleManifest;
40
+ /** Defaults to `"install"`; `"cached"` is the read-only resolution a query uses. */
41
+ readonly mode?: EverythingBinaryResolutionMode;
34
42
  }
35
43
  export type EnsureEverythingBinariesResult = {
36
44
  readonly ok: true;
@@ -39,7 +47,7 @@ export type EnsureEverythingBinariesResult = {
39
47
  readonly source: "cached" | "installed";
40
48
  } | {
41
49
  readonly ok: false;
42
- readonly reason: "unsupported-platform" | "bundle-missing" | "install-failed";
50
+ readonly reason: "unsupported-platform" | "bundle-missing" | "install-failed" | "not-installed";
43
51
  readonly message: string;
44
52
  };
45
53
  /**
@@ -56,7 +64,11 @@ export declare function everythingBinaryPaths(root: string, version: string, arc
56
64
  };
57
65
  export declare function loadEverythingBundleManifest(bundleDir: string): EverythingBundleManifest;
58
66
  /**
59
- * Extract and verify the bundled Everything + ES binaries for this Windows
60
- * host. Never throws: every failure is reported with its underlying message.
67
+ * Resolve the bundled Everything + ES binaries for this Windows host. Never
68
+ * throws: every failure is reported with its underlying message. `mode:
69
+ * "install"` (default) extracts and verifies them from the bundled ZIPs when
70
+ * the workspace cache is missing or invalid; `mode: "cached"` is read-only and
71
+ * reports `not-installed` instead of writing so a query can only use verified,
72
+ * already-extracted binaries.
61
73
  */
62
74
  export declare function ensureEverythingBinaries(options: EnsureEverythingBinariesOptions): Promise<EnsureEverythingBinariesResult>;
@@ -1,4 +1,4 @@
1
- import { type EnsureEverythingBinariesResult } from "./bundle.js";
1
+ import { type EnsureEverythingBinariesResult, type EverythingBinaryResolutionMode } from "./bundle.js";
2
2
  /**
3
3
  * Drives a private, user-level Everything instance per AutoRAG workspace.
4
4
  *
@@ -32,7 +32,7 @@ export interface EverythingSearchRequest {
32
32
  readonly offset?: number;
33
33
  readonly maxResults?: number;
34
34
  }
35
- export type EverythingFailureReason = "unsupported-platform" | "bundle-missing" | "install-failed" | "startup-failed" | "index-failed" | "search-failed";
35
+ export type EverythingFailureReason = "unsupported-platform" | "bundle-missing" | "install-failed" | "not-installed" | "not-running" | "startup-failed" | "index-failed" | "search-failed";
36
36
  export interface EverythingFailure {
37
37
  readonly ok: false;
38
38
  readonly reason: EverythingFailureReason;
@@ -70,7 +70,12 @@ export interface EverythingClientOptions extends EverythingOptions {
70
70
  /** Folders Everything indexes (the configured search paths). */
71
71
  readonly folders: readonly string[];
72
72
  readonly platform?: NodeJS.Platform;
73
- readonly resolveBinaries?: () => Promise<EnsureEverythingBinariesResult>;
73
+ /**
74
+ * Resolve the bundled executables. `"cached"` (queries and stop) must
75
+ * return only already extracted, hash-verified binaries; `"install"`
76
+ * (refresh/index) may extract them. Defaults to `ensureEverythingBinaries`.
77
+ */
78
+ readonly resolveBinaries?: (mode: EverythingBinaryResolutionMode) => Promise<EnsureEverythingBinariesResult>;
74
79
  readonly run?: EverythingRunner;
75
80
  readonly launch?: EverythingLauncher;
76
81
  readonly pollIntervalMs?: number;
@@ -105,16 +110,28 @@ export declare class EverythingClient {
105
110
  private operation;
106
111
  constructor(options: EverythingClientOptions);
107
112
  isSupported(): boolean;
108
- /** Start the instance when needed and search it. */
113
+ /**
114
+ * Search the running instance. Read-only: never starts Everything, waits
115
+ * for it to index, or installs its binaries (refresh does that), so a query
116
+ * never pays startup or extraction cost. A cold cache reports
117
+ * `not-installed` with a refresh hint instead.
118
+ */
109
119
  search(request: EverythingSearchRequest): Promise<EverythingSearchResult>;
110
120
  /**
111
121
  * (Re)write the folder configuration, restart the instance so Everything
112
122
  * loads it, and wait until the database finished indexing.
113
123
  */
114
124
  index(): Promise<EverythingIndexResult>;
115
- /** Exit this workspace's Everything instance if it is running. */
125
+ /** Exit this workspace's Everything instance if it is running. Never installs binaries. */
116
126
  stop(): Promise<void>;
117
127
  private serialize;
128
+ /**
129
+ * Resolve the ES + Everything executables. `"cached"` reads only the
130
+ * already extracted, hash-verified workspace cache and never writes;
131
+ * `"install"` (refresh/index) may extract from the bundled ZIPs. Only a
132
+ * verified resolution is memoized, so a cached-mode miss never poisons the
133
+ * install-mode resolution that refresh depends on.
134
+ */
118
135
  private resolveBinaries;
119
136
  private ensureRunning;
120
137
  /** Exit code 0 only when the instance answered with its version. */
@@ -1,2 +1,2 @@
1
- export { type EnsureEverythingBinariesOptions, type EnsureEverythingBinariesResult, type EverythingArch, type EverythingArchAssets, type EverythingBundleManifest, ensureEverythingBinaries, everythingArch, everythingBinaryPaths, loadEverythingBundleManifest, resolveEverythingBundleDir, } from "./bundle.js";
1
+ export { type EnsureEverythingBinariesOptions, type EnsureEverythingBinariesResult, type EverythingArch, type EverythingArchAssets, type EverythingBinaryResolutionMode, type EverythingBundleManifest, ensureEverythingBinaries, everythingArch, everythingBinaryPaths, loadEverythingBundleManifest, resolveEverythingBundleDir, } from "./bundle.js";
2
2
  export { buildEverythingIni, buildEverythingSearchArgs, EverythingClient, type EverythingClientOptions, type EverythingEntry, type EverythingFailure, type EverythingFailureReason, type EverythingIndexResult, type EverythingLauncher, type EverythingOptions, type EverythingRunner, type EverythingRunResult, type EverythingSearchRequest, type EverythingSearchResult, type EverythingSort, everythingInstanceName, parseEverythingJson, } from "./client.js";
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Literal (never regex) file-name search over configured filesystem roots.
3
+ *
4
+ * This is a discovery-only backend: it walks directories directly and never
5
+ * consults a parsed mirror/index, so a name can be found before any refresh
6
+ * has run. It never opens file contents — only directory listings are read.
7
+ *
8
+ * Path safety is the whole point of this module:
9
+ * - configured roots are `realpath`-pinned; missing roots degrade to a
10
+ * diagnostic instead of an exception;
11
+ * - `request.root` may only select a configured root or a real subdirectory
12
+ * *inside* one (realpath containment), so it can never widen scope;
13
+ * - child symlinks are never followed, so a symlink inside a root cannot leak
14
+ * results from outside it;
15
+ * - when nothing can be searched, the result is an empty page plus a warning
16
+ * diagnostic, never an arbitrary global `/` scan.
17
+ */
18
+ /** A single matched entry, with its canonical absolute filesystem path. */
19
+ export interface FileNameSearchMatch {
20
+ readonly path: string;
21
+ readonly type: "file" | "folder";
22
+ }
23
+ /** A non-fatal problem encountered while resolving or walking roots. */
24
+ export interface FileNameSearchDiagnostic {
25
+ readonly code: string;
26
+ readonly severity: "warning";
27
+ readonly source: string;
28
+ readonly message: string;
29
+ }
30
+ export interface FileNameSearchRequest {
31
+ readonly query: string;
32
+ /** Configured root or subdirectory (absolute or root-relative) to limit the walk to. */
33
+ readonly root?: string;
34
+ /** Match the query against the path relative to the search root instead of the file name. */
35
+ readonly matchPath?: boolean;
36
+ /** Case-sensitive matching. Defaults to case-insensitive. */
37
+ readonly matchCase?: boolean;
38
+ readonly kind?: "files" | "folders";
39
+ readonly maxResults?: number;
40
+ readonly offset?: number;
41
+ readonly signal?: AbortSignal;
42
+ }
43
+ export interface FileNameSearchResult {
44
+ readonly ok: true;
45
+ readonly backend: "filesystem" | "everything";
46
+ readonly results: readonly FileNameSearchMatch[];
47
+ readonly truncated: boolean;
48
+ readonly diagnostics: readonly FileNameSearchDiagnostic[];
49
+ }
50
+ /** Resolve one requested root inside the configured roots for backend routing. */
51
+ export declare function resolveConfiguredFileSearchRoot(roots: readonly string[], requestRoot: string): Promise<string | undefined>;
52
+ /**
53
+ * Keep provider-returned file-name hits inside configured roots and exclusions.
54
+ * Revalidates lstat/realpath so an external index cannot widen MCP scope.
55
+ */
56
+ export declare function filterFileNameSearchMatches(roots: readonly string[], candidates: readonly FileNameSearchMatch[], excludePaths?: readonly string[]): Promise<FileNameSearchMatch[]>;
57
+ export declare function searchFileNames(roots: readonly string[], request: FileNameSearchRequest, excludePaths?: readonly string[]): Promise<FileNameSearchResult>;
@@ -90,6 +90,8 @@ export interface FSearchClientOptions extends FSearchOptions {
90
90
  readonly root: string;
91
91
  /** Folders FSearch indexes (the configured search paths). */
92
92
  readonly folders: readonly string[];
93
+ /** Additional configured folders omitted from the index. */
94
+ readonly excludeFolders?: readonly string[];
93
95
  readonly platform?: NodeJS.Platform;
94
96
  readonly run?: FSearchRunner;
95
97
  readonly launch?: FSearchLauncher;
@@ -144,7 +146,11 @@ export declare class FSearchClient {
144
146
  private operation;
145
147
  constructor(options: FSearchClientOptions);
146
148
  isSupported(): boolean;
147
- /** Search the workspace database, building it on first use; walks when fsearch-cli is missing. */
149
+ /**
150
+ * Search the prebuilt workspace database. Read-only: a missing database is
151
+ * never built here (refresh does that), so a query never pays for indexing.
152
+ * Without fsearch-cli or a database, it walks the configured folders.
153
+ */
148
154
  search(request: FSearchSearchRequest): Promise<FSearchSearchResult>;
149
155
  /** (Re)build the database over the configured folders and keep the watch daemon live. */
150
156
  index(): Promise<FSearchIndexResult>;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./everything/index.js";
8
8
  export * from "./fsearch/index.js";
9
9
  export * from "./jikji/index.js";
10
10
  export * from "./manifest/index.js";
11
+ export { type AutoRAGMcpServerOptions, createAutoRAGMcpServer } from "./mcp/server.js";
11
12
  export * from "./memory/index.js";
12
13
  export * from "./minsync/index.js";
13
14
  export * from "./mirror/index.js";