@autorag/librarian 2.5.2 → 2.6.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 (76) hide show
  1. package/NOTICE +10 -13
  2. package/README.md +53 -13
  3. package/dist/agent/agent.d.ts +25 -15
  4. package/dist/agent/index.d.ts +1 -2
  5. package/dist/agent/refresh-progress.d.ts +30 -0
  6. package/dist/agent/search-documents.d.ts +1 -1
  7. package/dist/agent/search-single-datasource-tool.d.ts +14 -8
  8. package/dist/cli/commands/report.d.ts +3 -0
  9. package/dist/cli/commands/serve.d.ts +2 -1
  10. package/dist/cli/config.d.ts +1 -10
  11. package/dist/cli/index.d.ts +1 -1
  12. package/dist/cli/index.js +20731 -21656
  13. package/dist/core.d.ts +1 -1
  14. package/dist/core.js +2781 -1790
  15. package/dist/datasource/errors.d.ts +1 -1
  16. package/dist/datasource/index.d.ts +3 -2
  17. package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
  18. package/dist/datasource/skills/discrawl/types.d.ts +2 -2
  19. package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
  20. package/dist/datasource/skills/github-gist/index.d.ts +3 -0
  21. package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
  22. package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
  23. package/dist/datasource/skills/lark/client.d.ts +23 -0
  24. package/dist/datasource/skills/lark/index.d.ts +2 -0
  25. package/dist/datasource/skills/lark/skill.d.ts +36 -0
  26. package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
  27. package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
  28. package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
  29. package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
  30. package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
  31. package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
  32. package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
  33. package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
  34. package/dist/datasource/types.d.ts +4 -4
  35. package/dist/embedding-runtime/manifest.d.ts +8 -0
  36. package/dist/embedding-runtime/types.d.ts +4 -0
  37. package/dist/index.js +2792 -1800
  38. package/dist/language.d.ts +21 -0
  39. package/dist/memory/memory.d.ts +0 -1
  40. package/dist/mirror/paths.d.ts +2 -0
  41. package/dist/mirror/sync.d.ts +1 -1
  42. package/dist/p2p/simplex-server.d.ts +21 -5
  43. package/dist/p2p/simplex-transport.d.ts +21 -4
  44. package/dist/parser/defaults.d.ts +10 -4
  45. package/dist/parser/index.d.ts +3 -5
  46. package/dist/parser/kordoc.d.ts +53 -0
  47. package/dist/parser/ocr-engines.d.ts +12 -0
  48. package/dist/parser/ocr.d.ts +7 -1
  49. package/dist/parser/office.d.ts +1 -10
  50. package/dist/parser/types.d.ts +1 -1
  51. package/dist/process/terminate-tree.d.ts +2 -0
  52. package/dist/retrieval/types.d.ts +1 -1
  53. package/licenses/embedding-assets.json +20 -4
  54. package/package.json +10 -10
  55. package/skills/autorag-doctor/SKILL.md +4 -3
  56. package/skills/autorag-lite-search/SKILL.md +57 -7
  57. package/skills/autorag-lite-setup/SKILL.md +4 -4
  58. package/skills/autorag-setup/SKILL.md +11 -8
  59. package/dist/agent/search-datasource-tool.d.ts +0 -30
  60. package/dist/cli/commands/ui.d.ts +0 -13
  61. package/dist/datasource/skills/katok/client.d.ts +0 -21
  62. package/dist/datasource/skills/katok/index.d.ts +0 -12
  63. package/dist/datasource/skills/katok/paths.d.ts +0 -40
  64. package/dist/datasource/skills/katok/types.d.ts +0 -123
  65. package/dist/parser/hwp-markdown.d.ts +0 -25
  66. package/dist/parser/hwp.d.ts +0 -13
  67. package/dist/parser/opendataloader-pdf.d.ts +0 -31
  68. package/dist/parser/rhwp-adapter.d.ts +0 -30
  69. package/dist/ui/browse.d.ts +0 -11
  70. package/dist/ui/catalog.d.ts +0 -59
  71. package/dist/ui/config-store.d.ts +0 -43
  72. package/dist/ui/discover.d.ts +0 -17
  73. package/dist/ui/html.d.ts +0 -2
  74. package/dist/ui/probe.d.ts +0 -24
  75. package/dist/ui/prompt.d.ts +0 -21
  76. package/dist/ui/server.d.ts +0 -28
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Global language configuration for AutoRAG.
3
+ *
4
+ * The tag set is curated rather than free-form BCP-47: every accepted tag must
5
+ * map to a concrete OCR engine configuration (see src/parser/ocr-engines.ts).
6
+ * A tag we cannot map would be a promise the parser stack cannot keep.
7
+ */
8
+ export declare const AUTORAG_LANGUAGE_TAGS: readonly ["ko", "en", "ja", "zh-hans", "zh-hant", "fr", "de", "es", "ru", "it", "pt", "vi", "th", "ar", "hi"];
9
+ export type LanguageTag = (typeof AUTORAG_LANGUAGE_TAGS)[number];
10
+ /** Korean + English: AutoRAG's primary corpus languages. */
11
+ export declare const DEFAULT_LANGUAGES: readonly LanguageTag[];
12
+ export declare class LanguageError extends Error {
13
+ readonly name = "LanguageError";
14
+ }
15
+ /**
16
+ * Normalizes a configured language value into a non-empty, deduplicated,
17
+ * lowercase tag list. The first entry is the primary language.
18
+ */
19
+ export declare function normalizeLanguages(raw: unknown): LanguageTag[];
20
+ /** Parses a comma-separated CLI flag or environment variable value. */
21
+ export declare function parseLanguageList(value: string): LanguageTag[];
@@ -7,7 +7,6 @@ export interface SignalDefaults {
7
7
  readonly followupWeight: number;
8
8
  readonly retryWeight: number;
9
9
  readonly implicitCap: number;
10
- readonly decayHalfLifeMs?: number;
11
10
  }
12
11
  export interface EvidenceContext {
13
12
  readonly retrieverMix?: readonly string[];
@@ -2,7 +2,9 @@ export declare const PARSED_MIRROR_SUBDIR: string;
2
2
  export declare const PARSED_FILES_SUBDIR = "files";
3
3
  export declare const PARSED_INDEX_FILE = "index.json";
4
4
  export declare const REFRESH_READINESS_FILE = "refresh-complete.json";
5
+ export declare const REFRESH_PROGRESS_FILE = "refresh-progress.json";
5
6
  export declare function parsedMirrorRoot(root: string): string;
6
7
  export declare function parsedMirrorIndexPath(root: string): string;
7
8
  export declare function parsedOutputPath(root: string, virtualPath: string): string;
8
9
  export declare function refreshReadinessPath(root: string): string;
10
+ export declare function refreshProgressPath(root: string): string;
@@ -13,7 +13,7 @@ export interface ParsedMirrorSyncOptions {
13
13
  /** Absolute source paths omitted from parsed mirrors (for example exact duplicate copies). */
14
14
  readonly excludeSourcePaths?: ReadonlySet<string>;
15
15
  }
16
- export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "pdf-java-version" | "duplicate-excluded" | "deleted-mirror" | "stale-index" | "pdf-extract-thin" | "pdf-hybrid-unavailable";
16
+ export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "duplicate-excluded" | "deleted-mirror" | "stale-index" | "pdf-extract-thin" | "parser-warning";
17
17
  /** Path-opaque refresh diagnostic. `source` is an opaque virtual path, never a real fs path. */
18
18
  export interface ParsedMirrorDiagnostic {
19
19
  readonly code: ParsedMirrorDiagnosticCode;
@@ -4,7 +4,7 @@ import type { RetrievalOptions } from "../retrieval/types.js";
4
4
  import { type InjectionClassifierModel } from "./injection-classifier.js";
5
5
  import { type PolicyQuotas, type PolicyResolution } from "./policy.js";
6
6
  import type { PolicyResolver } from "./policy-filter.js";
7
- import type { SimplexTransport } from "./simplex-transport.js";
7
+ import { type SimplexContact, type SimplexPeerProfile, type SimplexTransport } from "./simplex-transport.js";
8
8
  import { type PeerQueryRequest, type PeerQueryResponse } from "./wire.js";
9
9
  /**
10
10
  * SimpleX message bodies have no documented byte cap, but the wire envelope
@@ -22,11 +22,15 @@ export interface SimplexPeerRecord {
22
22
  /** SimpleX contact id of the peer (stable per profile). */
23
23
  readonly contactId: number;
24
24
  readonly addedAt: string;
25
- readonly displayName?: string;
25
+ /**
26
+ * The profile this peer shared over SimpleX. It is the source of truth for
27
+ * who the contact is; only `description` below is added locally.
28
+ */
29
+ readonly profile?: SimplexPeerProfile;
30
+ /** When `profile` was last read from simplex-chat. */
31
+ readonly profileSyncedAt?: string;
32
+ /** Your own note about this contact. */
26
33
  readonly description?: string;
27
- readonly role?: string;
28
- readonly org?: string;
29
- readonly accessHint?: readonly string[];
30
34
  }
31
35
  export type SimplexPeerRegistry = Record<string, SimplexPeerRecord>;
32
36
  export interface PeerTargetMatch {
@@ -40,6 +44,18 @@ export declare function rankSimplexPeerTargets(query: string, registry: SimplexP
40
44
  export declare function loadSimplexPeerRegistry(workspacePath: string): SimplexPeerRegistry;
41
45
  /** Persist the SimpleX peer registry. */
42
46
  export declare function saveSimplexPeerRegistry(workspacePath: string, registry: SimplexPeerRegistry): void;
47
+ export interface SimplexPeerSyncResult {
48
+ /** Registry keys whose stored SimpleX profile was refreshed. */
49
+ readonly updated: readonly string[];
50
+ /** SimpleX contacts with no trusted record. Reported, never added automatically. */
51
+ readonly untrusted: readonly SimplexContact[];
52
+ }
53
+ /**
54
+ * Merge the profiles SimpleX delivered into the records you already trusted.
55
+ * Contacts that are not in the registry are reported, never trusted: the
56
+ * registry stays the allowlist for inbound peer queries.
57
+ */
58
+ export declare function syncSimplexPeers(workspacePath: string, contacts: readonly SimplexContact[], syncedAt?: string): SimplexPeerSyncResult;
43
59
  export interface P2pSearchAgent {
44
60
  readonly remoteSession: boolean;
45
61
  searchDocuments(query: string, options?: RetrievalOptions): Promise<SearchDocumentsResponse>;
@@ -9,6 +9,24 @@ export interface SimplexIncomingMessage {
9
9
  readonly text: string;
10
10
  readonly chatItemId: number;
11
11
  }
12
+ /**
13
+ * The profile a peer publishes over SimpleX. It is the identity AutoRAG stores
14
+ * for the contact; only your local name and note are added on top of it.
15
+ */
16
+ export interface SimplexPeerProfile {
17
+ readonly displayName: string;
18
+ readonly fullName?: string;
19
+ readonly shortDescr?: string;
20
+ readonly description?: string;
21
+ readonly image?: string;
22
+ }
23
+ /** A SimpleX contact: the peer's own profile plus the name you call it locally. */
24
+ export interface SimplexContact {
25
+ readonly contactId: number;
26
+ readonly localDisplayName: string;
27
+ /** The profile the peer shared; absent until the peer publishes one. */
28
+ readonly profile?: SimplexPeerProfile;
29
+ }
12
30
  export interface SimplexTransport {
13
31
  readonly dbPrefix: string;
14
32
  readonly displayName: string;
@@ -16,10 +34,7 @@ export interface SimplexTransport {
16
34
  getOrCreateAddress(): Promise<string>;
17
35
  createInvitation(): Promise<string>;
18
36
  connect(link: string): Promise<void>;
19
- listContacts(): Promise<{
20
- contactId: number;
21
- localDisplayName: string;
22
- }[]>;
37
+ listContacts(): Promise<SimplexContact[]>;
23
38
  sendMessage(contactId: number, text: string): Promise<void>;
24
39
  onMessage(handler: (message: SimplexIncomingMessage) => void): () => void;
25
40
  close(): Promise<void>;
@@ -31,6 +46,8 @@ export interface StartSimplexOptions {
31
46
  readonly port?: number;
32
47
  readonly connectTimeoutMs?: number;
33
48
  }
49
+ /** Extract the stored subset of a SimpleX `LocalProfile`; SimpleX-internal fields are dropped. */
50
+ export declare function parseSimplexProfile(value: unknown): SimplexPeerProfile | undefined;
34
51
  /**
35
52
  * Spawn `simplex-chat -p <port> -d <dbPrefix>` and connect to its WebSocket
36
53
  * bot API. Creates the local user profile if it does not exist yet.
@@ -1,10 +1,16 @@
1
- import { type HwpParserOptions } from "./hwp.js";
1
+ import { type LanguageTag } from "../language.js";
2
+ import { type KordocParserOptions } from "./kordoc.js";
2
3
  import { type OcrParserOptions } from "./ocr.js";
3
- import { type OpendataloaderPdfParserOptions } from "./opendataloader-pdf.js";
4
4
  import { ParserRegistry } from "./registry.js";
5
5
  export interface DefaultParserRegistryOptions {
6
6
  readonly ocr?: OcrParserOptions;
7
- readonly hwp?: HwpParserOptions;
8
- readonly thinExtract?: OpendataloaderPdfParserOptions["thinExtract"];
7
+ readonly kordoc?: KordocParserOptions;
8
+ /** Global document languages; drives OCR engine selection. */
9
+ readonly languages?: readonly LanguageTag[];
9
10
  }
11
+ /**
12
+ * Merges the globally configured document languages into registry options.
13
+ * An explicit `parserOptions.languages` wins over the global setting.
14
+ */
15
+ export declare function resolveParserOptions(parserOptions: DefaultParserRegistryOptions | undefined, languages: readonly LanguageTag[]): DefaultParserRegistryOptions;
10
16
  export declare function createDefaultParserRegistry(options?: DefaultParserRegistryOptions): ParserRegistry;
@@ -1,11 +1,9 @@
1
- export { createDefaultParserRegistry, type DefaultParserRegistryOptions } from "./defaults.js";
1
+ export { createDefaultParserRegistry, type DefaultParserRegistryOptions, resolveParserOptions, } from "./defaults.js";
2
2
  export { EmlParser } from "./eml.js";
3
3
  export { ParseError } from "./errors.js";
4
- export { HwpParser, type HwpParserOptions } from "./hwp.js";
4
+ export { KORDOC_EXTENSIONS, type KordocOcrProvider, type KordocParseFn, KordocParser, type KordocParserOptions, } from "./kordoc.js";
5
5
  export { ImageOcrParser, type OcrEngine, type OcrEngineInput, type OcrParserOptions } from "./ocr.js";
6
- export { DocxParser, PptxParser, XlsxParser } from "./office.js";
7
- export { OpendataloaderPdfParser, type OpendataloaderPdfParserOptions, type PdfConverter, } from "./opendataloader-pdf.js";
6
+ export { PptxParser } from "./office.js";
8
7
  export { PlainTextParser } from "./plain-text.js";
9
8
  export { ParserRegistry } from "./registry.js";
10
- export type { HwpExtractionLimits, HwpExtractor } from "./rhwp-adapter.js";
11
9
  export { type ParseDiagnostic, type ParseDiagnosticCode, type ParseInput, type ParseOutput, Parser, } from "./types.js";
@@ -0,0 +1,53 @@
1
+ import { type ParseInput, type ParseOutput, Parser } from "./types.js";
2
+ /** Image mime types kordoc hands to an injected OCR provider. */
3
+ export type KordocOcrMimeType = "image/png" | "image/jpeg" | "image/webp";
4
+ /**
5
+ * OCR seam kordoc calls per page that needs recognition. AutoRAG injects a
6
+ * tesseract-backed provider so recognition follows the configured languages
7
+ * instead of kordoc's Korean+Latin built-in model.
8
+ */
9
+ export type KordocOcrProvider = (pageImage: Uint8Array, pageNumber: number, mimeType: KordocOcrMimeType) => Promise<string>;
10
+ export interface KordocWarning {
11
+ readonly code?: string;
12
+ readonly message: string;
13
+ }
14
+ export interface KordocParseSuccess {
15
+ readonly success: true;
16
+ readonly fileType?: string;
17
+ readonly markdown: string;
18
+ readonly blocks?: readonly unknown[];
19
+ readonly warnings?: readonly KordocWarning[];
20
+ }
21
+ export interface KordocParseFailure {
22
+ readonly success: false;
23
+ readonly fileType?: string;
24
+ readonly error: string;
25
+ readonly code?: string;
26
+ }
27
+ export type KordocParseResult = KordocParseSuccess | KordocParseFailure;
28
+ export interface KordocParseCallOptions {
29
+ readonly ocr?: boolean | "force" | KordocOcrProvider;
30
+ }
31
+ /** Injection seam: the real kordoc `parse`, or a stub in tests. */
32
+ export type KordocParseFn = (bytes: Uint8Array, options: KordocParseCallOptions) => Promise<KordocParseResult>;
33
+ export interface KordocParserOptions {
34
+ /** OCR mode handed to kordoc: off, built-in engine, or an injected provider. */
35
+ readonly ocr?: boolean | "force" | KordocOcrProvider;
36
+ readonly parse?: KordocParseFn;
37
+ }
38
+ /** Document extensions kordoc parses. `.pptx` and `.eml` stay on their own parsers. */
39
+ export declare const KORDOC_EXTENSIONS: readonly [".hwp", ".hwpx", ".hml", ".hwpml", ".pdf", ".docx", ".xlsx", ".xls"];
40
+ /**
41
+ * Parses HWP/HWPX/HWPML, PDF, DOCX and XLSX/XLS through the kordoc library.
42
+ *
43
+ * kordoc reports failures as a result object; AutoRAG's contract is a thrown
44
+ * `ParseError`, so the code and message are forwarded verbatim (AGENTS.md error
45
+ * transparency) and warnings become `parser-warning` diagnostics.
46
+ */
47
+ export declare class KordocParser extends Parser {
48
+ #private;
49
+ readonly name = "kordoc";
50
+ readonly extensions: readonly [".hwp", ".hwpx", ".hml", ".hwpml", ".pdf", ".docx", ".xlsx", ".xls"];
51
+ constructor(options?: KordocParserOptions);
52
+ parse(input: ParseInput): Promise<ParseOutput>;
53
+ }
@@ -0,0 +1,12 @@
1
+ import type { LanguageTag } from "../language.js";
2
+ export type OcrProvider = (pageImage: Uint8Array, pageNumber: number, mimeType: "image/png" | "image/jpeg" | "image/webp") => Promise<string>;
3
+ export type TesseractOcrEngine = (language: string, pageImage: Uint8Array, pageNumber: number, mimeType: "image/png" | "image/jpeg" | "image/webp") => Promise<string>;
4
+ export interface TesseractOcrProviderOptions {
5
+ readonly languages: readonly LanguageTag[];
6
+ readonly timeoutMs?: number;
7
+ readonly engine?: TesseractOcrEngine;
8
+ }
9
+ /** Traineddata codes for the configured languages, order preserved and deduplicated. */
10
+ export declare function tesseractLanguageListFor(tags: readonly LanguageTag[]): string[];
11
+ export declare function tesseractLanguageFor(tags: readonly LanguageTag[]): string;
12
+ export declare function createTesseractOcrProvider(options: TesseractOcrProviderOptions): OcrProvider;
@@ -6,6 +6,10 @@ export interface OcrEngineInput {
6
6
  readonly signal: AbortSignal;
7
7
  }
8
8
  export type OcrEngine = (input: OcrEngineInput) => Promise<string>;
9
+ export type OcrOperation = {
10
+ readonly result: Promise<string>;
11
+ readonly cleanup: Promise<void>;
12
+ };
9
13
  export interface OcrParserOptions {
10
14
  readonly enabled: boolean;
11
15
  readonly languages?: readonly string[];
@@ -15,7 +19,7 @@ export interface OcrParserOptions {
15
19
  }
16
20
  export declare class ImageOcrParser extends Parser {
17
21
  readonly name = "image-ocr";
18
- readonly extensions: readonly [".jpg", ".jpeg", ".png", ".bmp", ".tiff"];
22
+ readonly extensions: readonly [".jpg", ".jpeg", ".png", ".bmp", ".tiff", ".webp"];
19
23
  private readonly languages;
20
24
  private readonly timeoutMs;
21
25
  private readonly maxBytes;
@@ -23,3 +27,5 @@ export declare class ImageOcrParser extends Parser {
23
27
  constructor(options: OcrParserOptions);
24
28
  parse(input: ParseInput): Promise<ParseOutput>;
25
29
  }
30
+ export declare function createTesseractOcrOperation(input: OcrEngineInput): OcrOperation;
31
+ export declare function withTimeout(operation: OcrOperation, timeoutMs: number, onTimeout: () => void): Promise<string>;
@@ -1,16 +1,7 @@
1
1
  import { type ParseInput, type ParseOutput, Parser } from "./types.js";
2
- export declare class DocxParser extends Parser {
3
- readonly name = "docx";
4
- readonly extensions: readonly [".docx"];
5
- parse(input: ParseInput): Promise<ParseOutput>;
6
- }
2
+ /** PPTX stays on AutoRAG's own reader: kordoc detects pptx but does not parse it. */
7
3
  export declare class PptxParser extends Parser {
8
4
  readonly name = "pptx";
9
5
  readonly extensions: readonly [".pptx"];
10
6
  parse(input: ParseInput): Promise<ParseOutput>;
11
7
  }
12
- export declare class XlsxParser extends Parser {
13
- readonly name = "xlsx";
14
- readonly extensions: readonly [".xlsx", ".xls"];
15
- parse(input: ParseInput): Promise<ParseOutput>;
16
- }
@@ -8,7 +8,7 @@ export interface ParseOutput {
8
8
  readonly metadata?: Readonly<Record<string, unknown>>;
9
9
  readonly diagnostics?: readonly ParseDiagnostic[];
10
10
  }
11
- export type ParseDiagnosticCode = "pdf-extract-thin" | "pdf-hybrid-unavailable";
11
+ export type ParseDiagnosticCode = "pdf-extract-thin" | "parser-warning";
12
12
  export interface ParseDiagnostic {
13
13
  readonly code: ParseDiagnosticCode;
14
14
  readonly severity: "warning";
@@ -16,5 +16,7 @@ export declare const TREE_KILL_GRACE_MS = 500;
16
16
  * live parent/child chain and therefore requires `detached: false` there.
17
17
  *
18
18
  * Returns whether the process group / tree was signalled.
19
+ * Default SIGKILL: SIGTERM lets a Node descendant close inherited stdio during
20
+ * shutdown while the pid is still kill(pid,0)-visible (zombie or exiting).
19
21
  */
20
22
  export declare function terminateProcessTree(child: ChildProcess, signal?: NodeJS.Signals): boolean;
@@ -7,7 +7,7 @@ export interface RetrievalResult {
7
7
  }
8
8
  export interface RetrievalMethodDescriptor {
9
9
  name: string;
10
- type: "posix" | "vector" | "bm25" | "hybrid" | "visual";
10
+ type: "posix" | "vector" | "bm25" | "hybrid" | "visual" | "remote";
11
11
  description: string;
12
12
  status: "active" | "stub";
13
13
  capabilities: string[];
@@ -16,7 +16,11 @@
16
16
  "modelAssetId": "qwen3-embedding-0.6b",
17
17
  "licenseId": "Apache-2.0",
18
18
  "noticeFile": "licenses/qwen3-embedding-notice.txt",
19
- "noticeReference": "Qwen3 model card and Apache-2.0 license"
19
+ "noticeReference": "Qwen3 model card and Apache-2.0 license",
20
+ "intendedUse": "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.",
21
+ "unsuitableUse": "Chat or generation, remote embedding of corpus text, shipping weights in the npm package, any GGUF other than the pinned SHA-256.",
22
+ "upstreamCardUrl": "https://huggingface.co/Qwen/Qwen3-Embedding-0.6B",
23
+ "modelCard": "docs/model-cards/qwen3-embedding-0.6b.md"
20
24
  },
21
25
  {
22
26
  "profileId": "embeddinggemma-300m",
@@ -32,7 +36,11 @@
32
36
  "modelAssetId": "embeddinggemma-300m",
33
37
  "licenseId": "Gemma Terms of Use",
34
38
  "noticeFile": "licenses/gemma-notice.txt",
35
- "noticeReference": "Google EmbeddingGemma model card and Gemma Terms of Use"
39
+ "noticeReference": "Google EmbeddingGemma model card and Gemma Terms of Use",
40
+ "intendedUse": "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.",
41
+ "unsuitableUse": "Chat or generation, remote embedding of corpus text, shipping weights in the npm package, any GGUF other than the pinned SHA-256, uses restricted by the Gemma Prohibited Use Policy.",
42
+ "upstreamCardUrl": "https://ai.google.dev/gemma/docs/embeddinggemma/model_card",
43
+ "modelCard": "docs/model-cards/embeddinggemma-300m.md"
36
44
  }
37
45
  ],
38
46
  "assets": [
@@ -45,7 +53,11 @@
45
53
  "sha256": "06507c7b42688469c4e7298b0a1e16deff06caf291cf0a5b278c308249c3e439",
46
54
  "licenseId": "Apache-2.0",
47
55
  "noticeFile": "licenses/qwen3-embedding-notice.txt",
48
- "noticeReference": "Qwen3 model card and Apache-2.0 license"
56
+ "noticeReference": "Qwen3 model card and Apache-2.0 license",
57
+ "intendedUse": "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.",
58
+ "unsuitableUse": "Chat or generation, remote embedding of corpus text, shipping weights in the npm package, any GGUF other than the pinned SHA-256.",
59
+ "upstreamCardUrl": "https://huggingface.co/Qwen/Qwen3-Embedding-0.6B",
60
+ "modelCard": "docs/model-cards/qwen3-embedding-0.6b.md"
49
61
  },
50
62
  {
51
63
  "kind": "model",
@@ -56,7 +68,11 @@
56
68
  "sha256": "b5ce9d77a3fc4b3b39ccb5643c36777911cc4eb46a66962eadfa3f5f60490d63",
57
69
  "licenseId": "Gemma Terms of Use",
58
70
  "noticeFile": "licenses/gemma-notice.txt",
59
- "noticeReference": "Google EmbeddingGemma model card and Gemma Terms of Use"
71
+ "noticeReference": "Google EmbeddingGemma model card and Gemma Terms of Use",
72
+ "intendedUse": "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.",
73
+ "unsuitableUse": "Chat or generation, remote embedding of corpus text, shipping weights in the npm package, any GGUF other than the pinned SHA-256, uses restricted by the Gemma Prohibited Use Policy.",
74
+ "upstreamCardUrl": "https://ai.google.dev/gemma/docs/embeddinggemma/model_card",
75
+ "modelCard": "docs/model-cards/embeddinggemma-300m.md"
60
76
  },
61
77
  {
62
78
  "kind": "runtime",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorag/librarian",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "Self-evolving librarian agent on Pi framework with pluggable retrieval methods",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,31 +49,31 @@
49
49
  "node": ">=24.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@earendil-works/pi-agent-core": "^0.85.1",
53
- "@earendil-works/pi-ai": "^0.85.1",
54
- "@earendil-works/pi-coding-agent": "0.85.1",
55
- "@earendil-works/pi-tui": "0.85.1",
56
- "@opendataloader/pdf": "^2.5.7",
57
- "@rhwp/core": "0.8.6",
52
+ "@earendil-works/pi-agent-core": "^0.86.1",
53
+ "@earendil-works/pi-ai": "^0.86.1",
54
+ "@earendil-works/pi-coding-agent": "0.86.1",
55
+ "@earendil-works/pi-tui": "0.86.1",
58
56
  "chardet": "^2.2.0",
59
57
  "fast-xml-parser": "^5.11.1",
60
58
  "iconv-lite": "^0.7.3",
61
59
  "jszip": "^3.10.1",
60
+ "kordoc": "^4.15.7",
62
61
  "mailparser": "^3.9.20",
62
+ "pdfjs-dist": "^6.3.289",
63
63
  "puppeteer-core": "^25.11.0",
64
64
  "slides-grab": "^1.5.1",
65
65
  "smol-toml": "1.8.0",
66
66
  "tesseract.js": "^7.0.0",
67
67
  "typebox": "^1.3.25",
68
- "xlsx": "^0.18.5",
69
68
  "yaml": "^2.9.0"
70
69
  },
71
70
  "devDependencies": {
72
- "@biomejs/biome": "2.5.13",
71
+ "@biomejs/biome": "2.5.14",
73
72
  "@types/mailparser": "^3.4.6",
74
73
  "@types/node": "^26.4.1",
75
74
  "@types/ws": "^8.18.1",
76
75
  "typescript": "^7.0.2",
77
- "vitest": "^5.0.0"
76
+ "vitest": "^5.0.0",
77
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
78
78
  }
79
79
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: autorag-doctor
3
- description: Diagnose and repair a broken or half-working AutoRAG install so every configured source is both indexed and searchable. Checks AutoRAG, MinSync, Jikji, the embedding gateway, and every CLI-backed datasource (katok, discrawl, slacrawl, wacrawl, telecrawl, notcrawl, qmd, mailcrawl, rclone, Spotlight), then fixes orphan locks, orphan processes, embedding dimension or identity mismatches, stale indexes, and missing setup. Use when search returns nothing or too little, refresh hangs or fails, a datasource disappeared from results, indexes look stale, the gateway will not start, or the user asks to check, diagnose, verify, or repair AutoRAG.
3
+ description: Diagnose and repair a broken or half-working AutoRAG install so every configured source is both indexed and searchable. Checks AutoRAG, MinSync, Jikji, the embedding gateway, and every CLI-backed datasource (lazykatok, discrawl, slacrawl, wacrawl, telecrawl, notcrawl, qmd, mailcrawl, rclone, Spotlight), then fixes orphan locks, orphan processes, embedding dimension or identity mismatches, stale indexes, and missing setup. Use when search returns nothing or too little, refresh hangs or fails, a datasource disappeared from results, indexes look stale, the gateway will not start, or the user asks to check, diagnose, verify, or repair AutoRAG.
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -16,7 +16,7 @@ Always finish with the status table in [Report](#report).
16
16
  ## Safety
17
17
 
18
18
  - Never delete, move, or edit source documents.
19
- - Never delete a datasource's **native** store (`~/.katok`, `~/.discrawl`,
19
+ - Never delete a datasource's **native** store (`~/Library/Application Support/katok`, `~/.discrawl`,
20
20
  `~/.mailcrawl`, `.qmd`, Telegram/WhatsApp/Notion archives). AutoRAG only
21
21
  reads them; rebuilding them is the owning CLI's job.
22
22
  - Only AutoRAG-owned state under `AUTORAG_HOME` and the workspace `.autorag`
@@ -58,7 +58,7 @@ Each CLI owns its archive, so ask the CLI, not AutoRAG. A datasource is only
58
58
  |---|---|---|
59
59
  | MinSync (local docs) | `minsync status`, `minsync check`, `minsync verify` | `autorag refresh --method minsync` |
60
60
  | Jikji (discovery) | `jikji doctor` | `autorag refresh --method jikji` |
61
- | KakaoTalk | `katok doctor` | `katok sync && katok index` |
61
+ | KakaoTalk | `lazykatok doctor` | `lazykatok sync && lazykatok index` |
62
62
  | Discord | `discrawl --json metadata` | `discrawl sync` |
63
63
  | Slack | `slacrawl --json doctor` | `slacrawl sync` |
64
64
  | WhatsApp | `wacrawl --json doctor` | `wacrawl import` |
@@ -68,6 +68,7 @@ Each CLI owns its archive, so ask the CLI, not AutoRAG. A datasource is only
68
68
  | Mail | `mailcrawl doctor`, `mailcrawl status` | `mailcrawl sync && mailcrawl index` |
69
69
  | Cloud drive | `rclone listremotes` | `autorag refresh --method datasources` |
70
70
  | Spotlight (macOS) | `mdutil -s /` | indexed by the OS; no AutoRAG sync |
71
+ | Lark / Feishu | `lark-cli auth status --format json` | no local sync; search is remote |
71
72
 
72
73
  Rules:
73
74
 
@@ -138,13 +138,63 @@ autorag lite report "key findings in the Q3 report" --input report.json --json
138
138
  cat report.json | autorag lite report "key findings in the Q3 report" --json
139
139
  ```
140
140
 
141
- The input is the `emit_autorag_results` JSON schema: `answer`, numbered
142
- `results` (with `number`, `title`, `summary`, `confidence` in `[0, 1]`,
143
- optional `source`), and a `mapping` whose entries map each result number to
144
- its `method` and `source`, plus optional `evidenceRefs` and `warnings`.
145
- Result and mapping numbers must be one-to-one positive integers. Evidence
146
- confidence values must be in `[0, 1]`. Invalid input exits with code 2 and
147
- `{"ok": false, "error": "..."}`.
141
+ The input is the `emit_autorag_results` JSON schema. Every field below that is
142
+ not marked optional is required — `results[].evidence` and `mapping[].content`
143
+ are the two that are easiest to forget:
144
+
145
+ - `answer` (string) — the curated answer, citing results as `[1]`, `[2]`.
146
+ - `results` (array) — one entry per numbered knowledge unit, each with
147
+ `number` (1-based integer), `title` (string), `summary` (string),
148
+ `evidence` (array of `{"excerpt": "..."}` objects, each with an optional
149
+ `lineNumber`), and `confidence` (number in `[0, 1]`). A result carries no
150
+ `source`; source identity lives in `mapping`.
151
+ - `mapping` (array) — exactly one entry per result `number`, each with
152
+ `number`, `source` (the opaque identity carried from retrieve), `method`,
153
+ and `content` (the raw snippet kept for feedback tracking). `evidenceRefs`
154
+ is optional; each ref needs `method` and `source` and may add `excerpt`,
155
+ `content`, `chunkIndex`, `lineNumber`, `retrievalResultId`, and
156
+ `confidence` in `[0, 1]`.
157
+ - `warnings` (optional array of strings).
158
+
159
+ Result and mapping numbers must be one-to-one positive integers, and every
160
+ `confidence` must be in `[0, 1]`. A complete minimal input:
161
+
162
+ ```json
163
+ {
164
+ "answer": "[1] Refund exceptions need director approval before payout.",
165
+ "results": [
166
+ {
167
+ "number": 1,
168
+ "title": "Refund exception approval",
169
+ "summary": "Refund exceptions require director approval before payout.",
170
+ "evidence": [
171
+ {
172
+ "excerpt": "Refund exceptions require director approval.",
173
+ "lineNumber": 12
174
+ }
175
+ ],
176
+ "confidence": 0.9
177
+ }
178
+ ],
179
+ "mapping": [
180
+ {
181
+ "number": 1,
182
+ "source": "/Users/me/corpus/refund-policy.txt",
183
+ "method": "minsync",
184
+ "content": "Refund exceptions require director approval before payout."
185
+ }
186
+ ],
187
+ "warnings": []
188
+ }
189
+ ```
190
+
191
+ Invalid input exits with code 2 and `{"ok": false, "error": "..."}`. The
192
+ rejection names every field that failed, by JSON path, so fix exactly what it
193
+ points at instead of guessing:
194
+
195
+ ```text
196
+ {"ok": false, "error": "Invalid report: expected the emit_autorag_results JSON schema (/results/0: must have required properties evidence; /mapping/0: must have required properties content)"}
197
+ ```
148
198
 
149
199
  `source` values in a report are opaque identifiers carried from retrieval
150
200
  output. Report persistence performs no filesystem reads against them; it
@@ -59,11 +59,11 @@ include `AUTORAG_HOME`, `AUTORAG_CONFIG`, `AUTORAG_SEARCH_PATHS`,
59
59
 
60
60
  ## Probe and configure datasources (setup wizard)
61
61
 
62
- `autorag lite ui` is still in development — do not recommend it for datasource
62
+ A datasource setup UI is not shipped in this build — do not recommend it for datasource
63
63
  setup. Configure datasources directly in trusted config, wizard-style:
64
64
 
65
65
  1. Probe every datasource for setup feasibility before asking the user
66
- anything: the backing CLI exists (`katok`, `discrawl`, `slacrawl`,
66
+ anything: the backing CLI exists (`lazykatok`, `discrawl`, `slacrawl`,
67
67
  `wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`) and its
68
68
  local store or archive is present. CLI-backed datasources own their own
69
69
  archive, index, and authentication, so environment credentials (such as bot
@@ -88,7 +88,7 @@ Datasource skills belong in trusted config and remain default-deny.
88
88
 
89
89
  Config keys may be builtin template names (`kakao`, `whatsapp`, `telegram`,
90
90
  `slack`, `discord`, `clawgallery`, `notion`, `github`, `cloud-drive`,
91
- `mail-export`, `mailcrawl`, `obsidian`, `rss`, `spotlight`) or connection
91
+ `mail-export`, `mailcrawl`, `obsidian`, `rss`, `spotlight`, `lark`) or connection
92
92
  aliases with `"type": "<template>"`. Unknown names are skipped with an
93
93
  `unknown-datasource-skill` warning; they do not fail config resolution.
94
94
  `datasourceAccess.allowedTags` and `allowedScopes` narrow trusted access and
@@ -125,7 +125,7 @@ autorag lite refresh --force --json
125
125
  different provider.
126
126
  - Exact duplicate exclusion during refresh is enabled by default via the
127
127
  external `dupey` CLI. Install dupey during setup when it is missing
128
- (`command -v dupey || cargo install dupey`) and tell the user the feature is
128
+ (`command -v dupey || cargo install dupey --locked`) and tell the user the feature is
129
129
  available; when installation is impossible, refresh continues without it
130
130
  and the user is told duplicate exclusion is off. Set
131
131
  `"excludeExactDuplicates": false` to index every copy.
@@ -138,7 +138,7 @@ Exact duplicate exclusion is enabled by default. AutoRAG invokes the external
138
138
  `dupey` CLI before parsed-mirror indexing, keeps the newest filesystem copy for
139
139
  each exact canonical-text hash, and excludes older copies from the mirror.
140
140
  Install dupey during setup when it is missing (`command -v dupey || cargo
141
- install dupey`) and tell the user the feature is available; when installation
141
+ install dupey --locked`) and tell the user the feature is available; when installation
142
142
  is impossible, refresh continues without this optimization and the user is
143
143
  told duplicate exclusion is off. Set `"excludeExactDuplicates": false` to
144
144
  index every copy.
@@ -180,12 +180,12 @@ datasources automatically:
180
180
  autorag setup --format json
181
181
  ```
182
182
 
183
- `autorag ui` is still in development — do not recommend it for datasource
183
+ A datasource setup UI is not shipped in this build — do not recommend it for datasource
184
184
  setup. Configure datasources directly in trusted config, wizard-style:
185
185
 
186
186
  1. Probe every datasource for setup feasibility before asking the user
187
- anything: the backing CLI exists (`katok`, `discrawl`, `slacrawl`,
188
- `wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`) and its
187
+ anything: the backing CLI exists (`lazykatok`, `discrawl`, `slacrawl`,
188
+ `wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`, `lark-cli`) and its
189
189
  local store or archive is present. CLI-backed datasources own their own
190
190
  archive, index, and authentication, so environment credentials (such as bot
191
191
  tokens) are never required or checked for them. Non-CLI connectors
@@ -207,8 +207,8 @@ setup. Configure datasources directly in trusted config, wizard-style:
207
207
 
208
208
  Datasource skills belong in trusted config and remain default-deny. Builtin
209
209
  template names are `kakao`, `whatsapp`, `telegram`, `slack`, `discord`,
210
- `clawgallery`, `notion`, `github`, `cloud-drive`, `mail-export`,
211
- `mailcrawl`, `obsidian`, `rss`, and `spotlight`. Config keys may be connection
210
+ `clawgallery`, `notion`, `github`, `github-gist`, `cloud-drive`, `mail-export`,
211
+ `mailcrawl`, `obsidian`, `rss`, `spotlight`, and `lark`. Config keys may be connection
212
212
  aliases with `"type": "<template>"`. Unknown names are skipped with an
213
213
  `unknown-datasource-skill` warning; they do not fail config resolution.
214
214
  `scope` and tags can narrow trusted access but cannot grant it.
@@ -217,6 +217,7 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
217
217
  {
218
218
  "datasources": {
219
219
  "github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
220
+ "github-gist": { "connector": { "tokenEnv": "GITHUB_TOKEN" } },
220
221
  "google-drive": { "type": "cloud-drive", "connector": { "provider": "google-drive", "remote": "gdrive:" } },
221
222
  "archive-drive": { "type": "cloud-drive", "connector": { "remote": "archive:" } },
222
223
  "mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
@@ -233,11 +234,13 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
233
234
  Tokens are environment-variable names, not raw secrets. CLI-backed connectors
234
235
  keep authentication in their external tool configuration.
235
236
 
236
- Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.1.6` or newer)
237
+ Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.2.0` or newer)
237
238
  and configured through its own Himalaya account. AutoRAG runs its local `sync`
238
239
  and `index` lifecycle, then uses the mailcrawl CLI for BM25, semantic, or
239
240
  hybrid search. Do not use 0.1.3 or earlier: a no-op sync followed by `index`
240
- fails with `text array must be non-empty`.
241
+ fails with `text array must be non-empty`. 0.2.0 defaults to the in-process
242
+ native `Qwen/Qwen3-Embedding-0.6B` embedder and keeps vectors in LanceDB, so a
243
+ cold cache makes the first `index` download ONNX weights and run for minutes.
241
244
  Use mailcrawl for Gmail, IMAP, and Maildir retrieval. The former Gmail REST
242
245
  datasource is removed.
243
246