@autorag/librarian 2.5.0 → 2.5.1
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 +7 -4
- package/dist/agent/agent.d.ts +8 -0
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/cli/command-help.d.ts +1 -0
- package/dist/cli/commands/lite-retrieve.d.ts +9 -0
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +10192 -9622
- package/dist/cli/setup.d.ts +2 -0
- package/dist/core.js +255 -61
- package/dist/datasource/index.d.ts +1 -1
- package/dist/datasource/skills/discrawl/client.d.ts +6 -0
- package/dist/datasource/skills/discrawl/index.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +7 -21
- package/dist/filesystem/source-paths.d.ts +6 -2
- package/dist/index.js +258 -62
- package/dist/minsync/client.d.ts +1 -1
- package/dist/minsync/embedder-config.d.ts +3 -0
- package/dist/minsync/index.d.ts +1 -1
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/minsync/method.d.ts +2 -0
- package/dist/minsync/types.d.ts +7 -1
- package/dist/minsync/workspace.d.ts +6 -0
- package/dist/mirror/index-store.d.ts +17 -0
- package/dist/mirror/sync.d.ts +7 -4
- package/package.json +2 -2
- package/skills/autorag/SKILL.md +3 -1
- package/skills/autorag-lite-search/SKILL.md +24 -6
- package/skills/autorag-lite-setup/SKILL.md +8 -0
package/README.md
CHANGED
|
@@ -323,13 +323,13 @@ Discord uses the external [`discrawl`](https://github.com/openclaw/discrawl) CLI
|
|
|
323
323
|
brew install openclaw/tap/discrawl
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
AutoRAG reads discrawl's own local archive: `discrawl wiretap` imports the Discord Desktop cache and needs **no token at all**, and every search, embed, and sync step runs against that native store. AutoRAG carries no Discord credential — no bot token, no credential env var, no credential check in `autorag setup` — and it refuses to spawn the CLI when a Discord *user* token is present in the environment, because automating a user account violates Discord's Community Guidelines and can get the account terminated. A bot-backed archive is the CLI's own concern: configure and sync it with `discrawl` itself.
|
|
327
327
|
|
|
328
328
|
```typescript
|
|
329
329
|
import { AutoRAGAgent, DiscrawlClient, DiscrawlSkill } from "@autorag/librarian";
|
|
330
330
|
|
|
331
331
|
const discord = new DiscrawlSkill({
|
|
332
|
-
client: new DiscrawlClient({
|
|
332
|
+
client: new DiscrawlClient({ root: process.cwd() }),
|
|
333
333
|
instanceId: "community",
|
|
334
334
|
});
|
|
335
335
|
|
|
@@ -350,7 +350,6 @@ Or through the trusted config factory:
|
|
|
350
350
|
"discord": {
|
|
351
351
|
"instanceId": "community",
|
|
352
352
|
"connector": {
|
|
353
|
-
"source": "wiretap",
|
|
354
353
|
"embeddingProvider": "ollama",
|
|
355
354
|
"embeddingModel": "embeddinggemma",
|
|
356
355
|
"defaultMode": "hybrid"
|
|
@@ -413,6 +412,8 @@ Config path precedence is `--config` > `AUTORAG_CONFIG` > `~/.autorag/config.jso
|
|
|
413
412
|
|
|
414
413
|
`autorag refresh` and `autorag index reset|rebuild` accept `--method <csv>` (e.g. `--method minsync,parsed` or `--method datasources,jikji`) to scope which indexing methods run or which index directories are removed. Valid values are `parsed`, `minsync`, `datasources`, `jikji`, and `all`. BM25 is a MinSync retrieval mode, not a `--method` name. When omitted, all methods run. `autorag init` accepts `--embedder-*` flags to configure the MinSync embedder endpoint in the config file.
|
|
415
414
|
|
|
415
|
+
`autorag refresh --json` reports the MinSync outcome in a `minsync` block (`ok`, `synced`, and a `reason`/`diagnostics` on failure), and the envelope's `ok` is `false` whenever MinSync, a datasource index, or any error-severity diagnostic failed — a green envelope never hides a semantic index that did not update.
|
|
416
|
+
|
|
416
417
|
`autorag health` checks model/provider auth before a search — it resolves the model, verifies credential presence, and optionally probes one completion call. Use it to diagnose model, provider, auth, or timeout failures. `autorag status` remains the model-free index-health command (corpus freshness and BM25/MinSync readiness). When `autorag search` fails for a model/provider reason, the error output includes a hint pointing to `autorag health`.
|
|
417
418
|
|
|
418
419
|
`autorag ui` opens a loopback-only page (`127.0.0.1`) to connect local folders and datasource skills without editing JSON. It writes the same trusted `datasources` / `datasourceAccess` fields as a hand-edited config, stores env-var *names* rather than secrets, and refuses non-loopback binds. Use `--no-open` to print the URL without launching a browser.
|
|
@@ -464,7 +465,9 @@ autorag serve # P2P peer query server over SimpleX (opt-in)
|
|
|
464
465
|
autorag p2p # peer trust, approvals, and sharing policy
|
|
465
466
|
```
|
|
466
467
|
|
|
467
|
-
`autorag --help` is the command list of record
|
|
468
|
+
`autorag --help` is the command list of record; `autorag <command> --help`
|
|
469
|
+
prints that command's flags and subcommands, and `autorag --version` prints the
|
|
470
|
+
installed version. See
|
|
468
471
|
[docs/embedding-runtime.md](docs/embedding-runtime.md) for the local embedding
|
|
469
472
|
runtime and gateway setup.
|
|
470
473
|
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ export interface AutoRAGMinSyncRefreshResult {
|
|
|
30
30
|
readonly ok: boolean;
|
|
31
31
|
readonly synced: number;
|
|
32
32
|
readonly reason?: string;
|
|
33
|
+
/** Count of parsed documents excluded from the MinSync index by file name. */
|
|
34
|
+
readonly stagingExcludedCount?: number;
|
|
35
|
+
readonly diagnostics?: readonly SearchDocumentDiagnostic[];
|
|
33
36
|
}
|
|
34
37
|
export interface AutoRAGRefreshResult extends Omit<ParsedMirrorSyncResult, "diagnostics"> {
|
|
35
38
|
readonly diagnostics: readonly SearchDocumentDiagnostic[];
|
|
@@ -273,6 +276,11 @@ export declare class AutoRAGAgent {
|
|
|
273
276
|
/**
|
|
274
277
|
* Path-opaque snapshot of corpus freshness and the last refresh outcome. Runs
|
|
275
278
|
* a cheap parse-free staleness scan (stat only); never parses in this path.
|
|
279
|
+
*
|
|
280
|
+
* Freshness is read from disk, not from this instance's history: a separate CLI
|
|
281
|
+
* process (for example `autorag status` or `autorag lite status`) reports the
|
|
282
|
+
* corpus as current when the last refresh left parsed mirrors behind and no
|
|
283
|
+
* source has changed since.
|
|
276
284
|
*/
|
|
277
285
|
getRefreshStatus(): Promise<AutoRAGRefreshStatus>;
|
|
278
286
|
/**
|
|
@@ -10,7 +10,7 @@ export type SearchDocumentDiagnosticSeverity = "info" | "warning" | "error";
|
|
|
10
10
|
* (#21/#22) does not require another source-breaking type change; codes not yet
|
|
11
11
|
* emitted are still valid members.
|
|
12
12
|
*/
|
|
13
|
-
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "parser-skipped" | "parser-failed" | "pdf-java-version" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "pdf-hybrid-unavailable" | "retrieval-method-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "refresh-failed" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit";
|
|
13
|
+
export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "minsync-staging-excluded" | "minsync-sync-failed" | "embedder-unavailable" | "embedding-identity-mismatch" | "parser-skipped" | "parser-failed" | "pdf-java-version" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "pdf-hybrid-unavailable" | "retrieval-method-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "refresh-failed" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit";
|
|
14
14
|
export interface SearchDocumentDiagnostic {
|
|
15
15
|
readonly code: SearchDocumentDiagnosticCode;
|
|
16
16
|
readonly severity: SearchDocumentDiagnosticSeverity;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function commandUsage(command: string | undefined): string | undefined;
|
|
@@ -2,6 +2,11 @@ import type { CommandContext } from "./types.js";
|
|
|
2
2
|
export interface LiteRetrieveEnvelope {
|
|
3
3
|
readonly ok: true;
|
|
4
4
|
readonly query: string;
|
|
5
|
+
/**
|
|
6
|
+
* True when the last refresh does not cover the current sources. Retrieval still
|
|
7
|
+
* runs; the caller decides whether to trust the result or refresh first.
|
|
8
|
+
*/
|
|
9
|
+
readonly stale: boolean;
|
|
5
10
|
readonly results: readonly LiteRetrieveResultItem[];
|
|
6
11
|
readonly diagnostics: readonly LiteRetrieveDiagnostic[];
|
|
7
12
|
}
|
|
@@ -18,6 +23,10 @@ export interface LiteRetrieveDiagnostic {
|
|
|
18
23
|
readonly severity: string;
|
|
19
24
|
readonly message: string;
|
|
20
25
|
readonly source?: string;
|
|
26
|
+
/** Why a source is considered stale, e.g. `mtime-and-size-changed`. */
|
|
27
|
+
readonly reason?: string;
|
|
28
|
+
/** Suggested recovery action, e.g. `refresh`. */
|
|
29
|
+
readonly action?: string;
|
|
21
30
|
}
|
|
22
31
|
/**
|
|
23
32
|
* Run the `autorag lite retrieve` command.
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
declare const COMMANDS: readonly ["init", "setup", "refresh", "status", "search", "feedback", "evidence", "memory", "index", "watch", "health", "duplicates", "tui", "ui", "serve", "p2p", "lite", "models", "gateway"];
|
|
3
|
+
type CommandName = (typeof COMMANDS)[number];
|
|
4
|
+
export type { CommandName };
|
|
2
5
|
interface ParsedArgs {
|
|
3
6
|
positionals: string[];
|
|
4
7
|
flags: Record<string, string | boolean>;
|
|
@@ -7,4 +10,3 @@ export declare function parseArgs(argv: readonly string[]): ParsedArgs | {
|
|
|
7
10
|
error: string;
|
|
8
11
|
};
|
|
9
12
|
export declare function main(argv: readonly string[]): Promise<number>;
|
|
10
|
-
export {};
|