@autorag/librarian 2.4.1 → 2.4.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.
package/README.md CHANGED
@@ -465,7 +465,7 @@ installations in `PATH` (or set `JAVA_HOME` to the Java 11+ installation and
465
465
  start a new shell). Java 8 is not supported by the PDF parser.
466
466
 
467
467
  Git-based installs build `dist/` via the `prepare` script and require Bun on the installing machine.
468
- External tool binaries auto-install on first use into `<workspace>/.autorag/bin`: **MinSync** downloads a verified GitHub release asset (on by default; `minSync.autoInstall: false` to opt out), and **Jikji** compiles the [`jikji-cli`](https://crates.io/crates/jikji-cli) crate via cargo (requires the [Rust toolchain](https://rustup.rs); `jikji.autoInstall: false` to opt out). New `autorag init` configs enable Jikji find-first discovery by default. KakaoTalk (`katok`) and Discord (`discrawl`) stay manual, optional installs. All of them degrade gracefully when missing — core BM25 search works without any of them.
468
+ External tool binaries auto-install on first use into `<workspace>/.autorag/bin`: **MinSync** installs from crates.io via `cargo install minsync` first (on by default; verified GitHub release assets are the fallback when cargo is unavailable; `minSync.autoInstall: false` to opt out), and **Jikji** compiles the [`jikji-cli`](https://crates.io/crates/jikji-cli) crate via cargo (requires the [Rust toolchain](https://rustup.rs); `jikji.autoInstall: false` to opt out). New `autorag init` configs enable Jikji find-first discovery by default. KakaoTalk (`katok`) and Discord (`discrawl`) stay manual, optional installs. All of them degrade gracefully when missing — core BM25 search works without any of them.
469
469
 
470
470
  ### Experimental TUI (beta)
471
471
 
@@ -8,6 +8,7 @@ import type { ResultFeedback } from "../memory/memory.js";
8
8
  import { type MinSyncSyncResult, type MinSyncVectorMethodOptions } from "../minsync/index.js";
9
9
  import { type ParsedMirrorSyncResult } from "../mirror/sync.js";
10
10
  import type { DefaultParserRegistryOptions } from "../parser/index.js";
11
+ import { RetrievalEngine } from "../retrieval/engine.js";
11
12
  import { RetrievalMethodRegistry } from "../retrieval/registry.js";
12
13
  import type { CuratedResult, RetrievalDiagnostic, RetrievalOptions, RetrievalResult } from "../retrieval/types.js";
13
14
  import { type ScanDuplicateDocumentsDetails } from "./dupey-tool.js";
@@ -236,7 +237,7 @@ export declare class AutoRAGAgent {
236
237
  */
237
238
  private scanMirrorStaleness;
238
239
  private exactDuplicateExclusions;
239
- syncMinSync(): Promise<MinSyncSyncResult | undefined>;
240
+ syncMinSync(force?: boolean): Promise<MinSyncSyncResult | undefined>;
240
241
  prepareJikji(): Promise<readonly AutoRAGJikjiPrepareResult[] | undefined>;
241
242
  private executeJikjiPrepare;
242
243
  /**
@@ -305,6 +306,13 @@ export declare class AutoRAGAgent {
305
306
  }>;
306
307
  /** The retrieval method registry (posix, MinSync, and datasource methods). */
307
308
  getMethodRegistry(): RetrievalMethodRegistry;
309
+ /**
310
+ * The standalone retrieval engine for this agent's method pipeline.
311
+ * Built on first access using the agent's registered methods and configured
312
+ * datasource access context. Model-free — no agent state required.
313
+ */
314
+ private retrievalEngine;
315
+ getRetrievalEngine(): RetrievalEngine;
308
316
  getSystemPrompt(): string;
309
317
  private rerankWithMemory;
310
318
  private normalizeRetrievalOptions;
@@ -1,7 +1,7 @@
1
1
  import type { AgentTool } from "@earendil-works/pi-agent-core";
2
2
  import { Type } from "typebox";
3
3
  export declare const EMIT_AUTORAG_RESULTS_TOOL_NAME = "emit_autorag_results";
4
- declare const emitResultsSchema: Type.TObject<{
4
+ export declare const emitResultsSchema: Type.TObject<{
5
5
  answer: Type.TString;
6
6
  results: Type.TArray<Type.TObject<{
7
7
  number: Type.TInteger;
@@ -86,4 +86,3 @@ export interface AutoRAGResultsDetails {
86
86
  * assistant-text parsing involved.
87
87
  */
88
88
  export declare function createEmitResultsTool(capture: (details: AutoRAGResultsDetails) => void): AgentTool<typeof emitResultsSchema, AutoRAGResultsDetails>;
89
- export {};
@@ -3,7 +3,7 @@ export { AutoRAGAgent } from "./agent.js";
3
3
  export { buildDatasourceSkillsPrompt, createLoadDatasourceSkillTool, type DatasourceSkillProvider, datasourceSkillLocation, formatDatasourceSkillInvocation, LOAD_DATASOURCE_SKILL_TOOL_NAME, type LoadDatasourceSkillDetails, toDatasourceAgentSkill, } from "./datasource-skill.js";
4
4
  export { createScanDuplicateDocumentsTool, SCAN_DUPLICATE_DOCUMENTS_TOOL_NAME, type ScanDuplicateDocumentsDetails, type ScanDuplicateDocumentsProvider, } from "./dupey-tool.js";
5
5
  export type { AutoRAGEmittedResult, AutoRAGMappingEntry, AutoRAGResultsDetails, } from "./emit-results-tool.js";
6
- export { createEmitResultsTool, EMIT_AUTORAG_RESULTS_TOOL_NAME } from "./emit-results-tool.js";
6
+ export { createEmitResultsTool, EMIT_AUTORAG_RESULTS_TOOL_NAME, emitResultsSchema, } from "./emit-results-tool.js";
7
7
  export { createJikjiFindTool, JIKJI_FIND_TOOL_NAME, type JikjiFindDetails, type JikjiFindPerRootPolicy, type JikjiFindProvider, type JikjiFindProviderResult, type MergedJikjiPolicy, } from "./jikji-find-tool.js";
8
8
  export { createSearchAllDocumentsTool, SEARCH_ALL_DOCUMENTS_TOOL_NAME, type SearchAllDocumentsDetails, type SearchAllDocumentsProvider, type SearchAllDocumentsResult, } from "./search-all-tool.js";
9
9
  export { createSearchDatasourceDocumentsTool, type DatasourceSearchProvider, SEARCH_DATASOURCE_DOCUMENTS_TOOL_NAME, type SearchDatasourceDocumentsDetails, } from "./search-datasource-tool.js";
@@ -1,4 +1,10 @@
1
1
  import type { DupeyScanResult } from "../../dupey/index.js";
2
2
  import type { CommandContext } from "./types.js";
3
3
  export type DuplicateScanner = (path: string) => Promise<DupeyScanResult>;
4
+ /**
5
+ * `autorag duplicates` — scan configured roots for exact and near duplicate
6
+ * document families. Never deletes or moves source files.
7
+ *
8
+ * Exit codes: 0 on success, 2 on config error, 1 on runtime error.
9
+ */
4
10
  export declare function runDuplicates(ctx: CommandContext, scanner?: DuplicateScanner): Promise<number>;
@@ -0,0 +1,10 @@
1
+ import type { CommandContext } from "./types.js";
2
+ /**
3
+ * `autorag lite refresh` — model-free index refresh using AutoRAGLite.
4
+ *
5
+ * Delegates to the agent's refresh pipeline (parsed mirrors, MinSync,
6
+ * datasources, Jikji) without requiring any model configuration.
7
+ *
8
+ * Exit codes: 0 on success, 2 on config error, 1 on runtime error.
9
+ */
10
+ export declare function runLiteRefresh(ctx: CommandContext): Promise<number>;
@@ -0,0 +1,33 @@
1
+ import type { CommandContext } from "./types.js";
2
+ export interface LiteRetrieveEnvelope {
3
+ readonly ok: true;
4
+ readonly query: string;
5
+ readonly results: readonly LiteRetrieveResultItem[];
6
+ readonly diagnostics: readonly LiteRetrieveDiagnostic[];
7
+ }
8
+ export interface LiteRetrieveResultItem {
9
+ readonly number: number;
10
+ readonly source: string;
11
+ readonly method: string;
12
+ readonly score: number;
13
+ readonly metadata: Record<string, unknown>;
14
+ readonly content: string;
15
+ }
16
+ export interface LiteRetrieveDiagnostic {
17
+ readonly code: string;
18
+ readonly severity: string;
19
+ readonly message: string;
20
+ readonly source?: string;
21
+ }
22
+ /**
23
+ * Run the `autorag lite retrieve` command.
24
+ *
25
+ * Returns exit code 2 for:
26
+ * - Empty query
27
+ * - Config resolution failure
28
+ * - Index not ready (never refreshed)
29
+ *
30
+ * Returns exit code 0 on successful retrieval (results may be empty).
31
+ * Returns exit code 1 for runtime errors.
32
+ */
33
+ export declare function runLiteRetrieve(ctx: CommandContext): Promise<number>;
@@ -0,0 +1,3 @@
1
+ import type { CommandContext } from "./types.js";
2
+ export declare function liteUsage(): string;
3
+ export declare function runLite(ctx: CommandContext): Promise<number>;
@@ -0,0 +1,3 @@
1
+ import type { CommandContext } from "./types.js";
2
+ /** Persist a structured report submitted by an external curator. */
3
+ export declare function runReport(ctx: CommandContext): Promise<number>;
@@ -3,5 +3,7 @@ import type { CommandContext } from "./types.js";
3
3
  * `autorag status` — path-opaque snapshot of corpus freshness and index health.
4
4
  * Runs a cheap parse-free staleness scan plus the cached last-refresh outcome.
5
5
  * Model-free. Never emits filesystem paths; only the renderered status text.
6
+ *
7
+ * Exit codes: 0 on success, 2 on config error, 1 on runtime error.
6
8
  */
7
9
  export declare function runStatus(ctx: CommandContext): Promise<number>;
@@ -4,5 +4,7 @@ import type { CommandContext } from "./types.js";
4
4
  *
5
5
  * - default: long-running recursive fs watch with debounced refresh
6
6
  * - `--once`: single refresh tick (for cron / launchd / Task Scheduler)
7
+ *
8
+ * Exit codes: 0 on success, 2 on config error, 1 on runtime error.
7
9
  */
8
10
  export declare function runWatch(ctx: CommandContext): Promise<number>;