@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 +1 -1
- package/dist/agent/agent.d.ts +9 -1
- package/dist/agent/emit-results-tool.d.ts +1 -2
- package/dist/agent/index.d.ts +1 -1
- package/dist/cli/commands/duplicates.d.ts +6 -0
- package/dist/cli/commands/lite-refresh.d.ts +10 -0
- package/dist/cli/commands/lite-retrieve.d.ts +33 -0
- package/dist/cli/commands/lite.d.ts +3 -0
- package/dist/cli/commands/report.d.ts +3 -0
- package/dist/cli/commands/status.d.ts +2 -0
- package/dist/cli/commands/watch.d.ts +2 -0
- package/dist/cli/index.js +770 -49
- package/dist/core.d.ts +67 -0
- package/dist/core.js +14786 -0
- package/dist/datasource/access-context.d.ts +1 -1
- package/dist/datasource/result-filter.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4361 -3195
- package/dist/minsync/client.d.ts +2 -1
- package/dist/minsync/installer.d.ts +7 -1
- package/dist/minsync/method.d.ts +5 -2
- package/dist/mirror/index.d.ts +1 -1
- package/dist/mirror/paths.d.ts +2 -0
- package/dist/retrieval/engine.d.ts +123 -0
- package/dist/retrieval/index.d.ts +1 -0
- package/package.json +6 -2
- package/skills/autorag-lite-search/SKILL.md +155 -0
- package/skills/autorag-lite-setup/SKILL.md +182 -0
- package/skills/autorag-setup/SKILL.md +52 -19
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**
|
|
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
|
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -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>;
|