@autorag/librarian 2.5.1 → 2.5.3

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 (100) hide show
  1. package/NOTICE +3 -0
  2. package/README.md +230 -490
  3. package/dist/agent/agent.d.ts +40 -3
  4. package/dist/agent/index.d.ts +1 -1
  5. package/dist/agent/search-single-datasource-tool.d.ts +63 -0
  6. package/dist/agent/web-fetch-tool.d.ts +32 -0
  7. package/dist/agent/web-search-tool.d.ts +48 -0
  8. package/dist/cli/commands/lite-retrieve.d.ts +15 -0
  9. package/dist/cli/commands/search.d.ts +6 -0
  10. package/dist/cli/config.d.ts +20 -0
  11. package/dist/cli/index.js +17643 -10464
  12. package/dist/core.d.ts +3 -1
  13. package/dist/core.js +11081 -3945
  14. package/dist/datasource/connector-skill.d.ts +6 -0
  15. package/dist/datasource/crawler-skill.d.ts +2 -0
  16. package/dist/datasource/errors.d.ts +26 -0
  17. package/dist/datasource/index.d.ts +3 -2
  18. package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
  19. package/dist/datasource/skills/discrawl/types.d.ts +2 -2
  20. package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
  21. package/dist/datasource/skills/github-gist/index.d.ts +3 -0
  22. package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
  23. package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
  24. package/dist/datasource/skills/lark/client.d.ts +23 -0
  25. package/dist/datasource/skills/lark/index.d.ts +2 -0
  26. package/dist/datasource/skills/lark/skill.d.ts +36 -0
  27. package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
  28. package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
  29. package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
  30. package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
  31. package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
  32. package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
  33. package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
  34. package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
  35. package/dist/datasource/skills/slack/index.d.ts +8 -0
  36. package/dist/datasource/tool-naming.d.ts +11 -0
  37. package/dist/datasource/types.d.ts +4 -4
  38. package/dist/embedding-runtime/manifest.d.ts +8 -0
  39. package/dist/embedding-runtime/types.d.ts +4 -0
  40. package/dist/index.js +11598 -4461
  41. package/dist/minsync/types.d.ts +7 -0
  42. package/dist/process/terminate-tree.d.ts +2 -0
  43. package/dist/retrieval/engine.d.ts +14 -5
  44. package/dist/retrieval/index.d.ts +2 -1
  45. package/dist/retrieval/merger.d.ts +30 -5
  46. package/dist/retrieval/skip.d.ts +41 -0
  47. package/dist/retrieval/types.d.ts +24 -3
  48. package/dist/web/entities.d.ts +10 -0
  49. package/dist/web/fetch/convert.d.ts +35 -0
  50. package/dist/web/fetch/feeds.d.ts +37 -0
  51. package/dist/web/fetch/html-renderer.d.ts +54 -0
  52. package/dist/web/fetch/index.d.ts +12 -0
  53. package/dist/web/fetch/negotiate.d.ts +27 -0
  54. package/dist/web/fetch/page-loader.d.ts +60 -0
  55. package/dist/web/fetch/render.d.ts +23 -0
  56. package/dist/web/fetch/turndown/gfm.d.ts +11 -0
  57. package/dist/web/fetch/turndown/html.d.ts +5 -0
  58. package/dist/web/fetch/turndown/index.d.ts +10 -0
  59. package/dist/web/fetch/turndown/service.d.ts +21 -0
  60. package/dist/web/fetch/turndown/types.d.ts +73 -0
  61. package/dist/web/fetch/url-target.d.ts +29 -0
  62. package/dist/web/search/browser-headers.d.ts +17 -0
  63. package/dist/web/search/browser-loader.d.ts +56 -0
  64. package/dist/web/search/browser-page.d.ts +41 -0
  65. package/dist/web/search/credentials.d.ts +10 -0
  66. package/dist/web/search/format.d.ts +30 -0
  67. package/dist/web/search/index.d.ts +46 -0
  68. package/dist/web/search/model-auth.d.ts +36 -0
  69. package/dist/web/search/provider.d.ts +62 -0
  70. package/dist/web/search/providers/anthropic.d.ts +9 -0
  71. package/dist/web/search/providers/base.d.ts +106 -0
  72. package/dist/web/search/providers/codex.d.ts +9 -0
  73. package/dist/web/search/providers/duckduckgo.d.ts +22 -0
  74. package/dist/web/search/providers/ecosia.d.ts +29 -0
  75. package/dist/web/search/providers/gemini.d.ts +9 -0
  76. package/dist/web/search/providers/google.d.ts +22 -0
  77. package/dist/web/search/providers/mojeek.d.ts +24 -0
  78. package/dist/web/search/providers/parallel.d.ts +10 -0
  79. package/dist/web/search/providers/perplexity.d.ts +10 -0
  80. package/dist/web/search/providers/public.d.ts +15 -0
  81. package/dist/web/search/providers/responses-api.d.ts +26 -0
  82. package/dist/web/search/providers/searxng.d.ts +19 -0
  83. package/dist/web/search/providers/startpage.d.ts +25 -0
  84. package/dist/web/search/providers/utils.d.ts +39 -0
  85. package/dist/web/search/providers/xai.d.ts +9 -0
  86. package/dist/web/search/query.d.ts +193 -0
  87. package/dist/web/search/types.d.ts +198 -0
  88. package/dist/web/search/utils.d.ts +8 -0
  89. package/licenses/embedding-assets.json +20 -4
  90. package/package.json +2 -1
  91. package/skills/autorag/SKILL.md +2 -1
  92. package/skills/autorag-doctor/SKILL.md +238 -0
  93. package/skills/autorag-lite-search/SKILL.md +29 -7
  94. package/skills/autorag-lite-setup/SKILL.md +22 -15
  95. package/skills/autorag-setup/SKILL.md +40 -19
  96. package/dist/agent/search-datasource-tool.d.ts +0 -29
  97. package/dist/datasource/skills/katok/client.d.ts +0 -21
  98. package/dist/datasource/skills/katok/index.d.ts +0 -12
  99. package/dist/datasource/skills/katok/paths.d.ts +0 -40
  100. package/dist/datasource/skills/katok/types.d.ts +0 -123
@@ -0,0 +1,134 @@
1
+ import type { RetrievalOptions } from "../../../retrieval/types.js";
2
+ /**
3
+ * Search modes accepted by the external `lazykatok search` subcommand.
4
+ *
5
+ * - `semantic` — dense vector similarity over indexed chunks.
6
+ * - `keyword` — exact / tokenized keyword matching.
7
+ * - `hybrid` — fused semantic + keyword scores.
8
+ */
9
+ export type LazykatokSearchMode = "semantic" | "keyword" | "hybrid";
10
+ /**
11
+ * Configuration for {@link LazykatokClient}. All fields optional; sensible defaults
12
+ * mirror the jikji client. The client spawns the `lazykatok` binary as a child
13
+ * process — it never opens the KakaoTalk database directly.
14
+ */
15
+ export interface LazykatokOptions {
16
+ /** Explicit path to the `lazykatok` binary. Defaults to a bare `lazykatok` PATH lookup. */
17
+ readonly binaryPath?: string;
18
+ /** Spawn timeout in milliseconds. Default 60_000 (sync/index over large archives can be slow). */
19
+ readonly timeoutMs?: number;
20
+ /** Max stdout/stderr bytes retained. Default 16 MiB (an `index --json` report alone is multiple MB on a real archive). */
21
+ readonly maxBufferBytes?: number;
22
+ /** Explicit native lazykatok data directory, passed as `--data-dir`. */
23
+ readonly workspacePath?: string;
24
+ /** Explicit operator-owned configuration/workspace transport. */
25
+ readonly configPath?: string;
26
+ /**
27
+ * Source adapter passed to `sync --source`. Without it the CLI falls back to its
28
+ * config file, whose default adapter is `fixture` and fails without a JSONL path.
29
+ * AutoRAG names the live adapter (`macos`) on macOS and passes no flag elsewhere,
30
+ * so a non-macOS operator's own CLI config still decides; set this to use another
31
+ * adapter (`kakaocli`, `fixture`, …).
32
+ */
33
+ readonly source?: string;
34
+ /** Environment overrides merged on top of `process.env` for the child. */
35
+ readonly env?: Readonly<Record<string, string | undefined>>;
36
+ }
37
+ export declare const DEFAULT_LAZYKATOK_BINARY = "lazykatok";
38
+ export declare const DEFAULT_LAZYKATOK_TIMEOUT_MS = 60000;
39
+ /** The live macOS adapter `sync` names by default on darwin. */
40
+ export declare const DEFAULT_LAZYKATOK_SOURCE = "macos";
41
+ export declare const DEFAULT_LAZYKATOK_MAX_BUFFER_BYTES: number;
42
+ export declare const DEFAULT_LAZYKATOK_OPTIONS: {
43
+ readonly binaryPath: "lazykatok";
44
+ readonly timeoutMs: 60000;
45
+ readonly maxBufferBytes: number;
46
+ };
47
+ /**
48
+ * Reasons a lazykatok CLI invocation can fail. The client never throws for these —
49
+ * every method returns a discriminated union with `ok: false` and one of these
50
+ * reasons.
51
+ */
52
+ export type LazykatokFailureReason = "binary-missing" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-json" | "invalid-shape";
53
+ /** Common failure payload shared by every method result union. */
54
+ export interface LazykatokFailure {
55
+ readonly ok: false;
56
+ readonly reason: LazykatokFailureReason;
57
+ /** Raw stdout captured (may be partial / empty). Never a binary path. */
58
+ readonly stdout: string;
59
+ /** Raw stderr captured (may be partial / empty). Never a binary path. */
60
+ readonly stderr: string;
61
+ /** Exit code, or `null` when the process never exited normally. */
62
+ readonly code: number | null;
63
+ readonly hits?: readonly unknown[];
64
+ }
65
+ /** A single indexed chat chunk returned by the lazykatok CLI. */
66
+ export interface LazykatokChunk {
67
+ readonly chunkId: string;
68
+ readonly content: string;
69
+ readonly metadata?: Readonly<Record<string, unknown>>;
70
+ }
71
+ /** A scored search hit. */
72
+ export interface LazykatokSearchHit {
73
+ readonly chunkId: string;
74
+ readonly score: number;
75
+ readonly content: string;
76
+ readonly metadata?: Readonly<Record<string, unknown>>;
77
+ readonly source?: string;
78
+ }
79
+ export type LazykatokHit = LazykatokSearchHit;
80
+ /** Result of `lazykatok doctor`. */
81
+ export interface LazykatokDoctorInfo {
82
+ readonly version?: string;
83
+ readonly ready: boolean;
84
+ readonly metadata?: Readonly<Record<string, unknown>>;
85
+ }
86
+ /** Result of `lazykatok sync`. */
87
+ export interface LazykatokSyncInfo {
88
+ readonly synced: boolean;
89
+ readonly messageCount?: number;
90
+ readonly metadata?: Readonly<Record<string, unknown>>;
91
+ }
92
+ /** Result of `lazykatok index`. */
93
+ export interface LazykatokIndexInfo {
94
+ readonly chunkCount: number;
95
+ readonly metadata?: Readonly<Record<string, unknown>>;
96
+ }
97
+ /** Context payload: the chunks surrounding a target chunk. */
98
+ export interface LazykatokContext {
99
+ readonly chunks: readonly LazykatokChunk[];
100
+ readonly metadata?: Readonly<Record<string, unknown>>;
101
+ }
102
+ /** Discriminated ok-success shape carrying typed `data`. */
103
+ export interface LazykatokOk<T> {
104
+ readonly ok: true;
105
+ readonly data: T;
106
+ readonly stdout: string;
107
+ readonly stderr: string;
108
+ readonly code: number;
109
+ }
110
+ export interface LazykatokSearchOk {
111
+ readonly ok: true;
112
+ readonly hits: readonly LazykatokSearchHit[];
113
+ readonly stdout: string;
114
+ readonly stderr: string;
115
+ readonly code: number;
116
+ readonly data: {
117
+ readonly hits: readonly LazykatokSearchHit[];
118
+ };
119
+ }
120
+ export type LazykatokDoctorResult = LazykatokOk<LazykatokDoctorInfo> | LazykatokFailure;
121
+ export type LazykatokSyncResult = LazykatokOk<LazykatokSyncInfo> | LazykatokFailure;
122
+ export type LazykatokIndexResult = LazykatokOk<LazykatokIndexInfo> | LazykatokFailure;
123
+ export type LazykatokSearchResult = LazykatokSearchOk | LazykatokFailure;
124
+ export type LazykatokChunkResult = LazykatokOk<LazykatokChunk> | LazykatokFailure;
125
+ export type LazykatokContextResult = LazykatokOk<LazykatokContext> | LazykatokFailure;
126
+ /** The real `chunk parent --json` payload is a list of parent windows. */
127
+ export type LazykatokParentResult = LazykatokOk<readonly LazykatokChunk[]> | LazykatokFailure;
128
+ /**
129
+ * Search-specific options. Reuses the shared {@link RetrievalOptions} so the
130
+ * LazykatokSkill retrieval method can pass its options straight through. The
131
+ * client maps `topK` to the native CLI limit flag; other fields are handled
132
+ * by the retrieval layer or are not supported by lazykatok.
133
+ */
134
+ export type LazykatokSearchOptions = RetrievalOptions;
@@ -10,6 +10,8 @@ export declare class MailcrawlClient implements MailcrawlSearchClient {
10
10
  constructor(options?: MailcrawlOptions);
11
11
  sync(signal?: AbortSignal): Promise<MailcrawlSyncResult>;
12
12
  search(mode: MailcrawlSearchMode, query: string, options?: MailcrawlSearchOptions): Promise<MailcrawlSearchResult>;
13
+ /** `sync`/`index` share the long non-interactive budget. */
14
+ private indexTimeoutMs;
13
15
  private run;
14
16
  index(signal?: AbortSignal): Promise<MailcrawlOk<MailcrawlIndexInfo> | MailcrawlFailure>;
15
17
  }
@@ -13,7 +13,13 @@ export interface MailcrawlOptions {
13
13
  readonly source?: string;
14
14
  readonly fixture?: string;
15
15
  readonly himalayaConfig?: string;
16
+ /**
17
+ * Applies to every operation. `sync`/`index` additionally honor
18
+ * `indexTimeoutMs`, because a 0.2.0 native index run is not interactive.
19
+ */
16
20
  readonly timeoutMs?: number;
21
+ /** Non-interactive budget for `sync`/`index`; defaults to 30 minutes. */
22
+ readonly indexTimeoutMs?: number;
17
23
  readonly maxBufferBytes?: number;
18
24
  readonly env?: Readonly<Record<string, string | undefined>>;
19
25
  }
@@ -38,6 +44,12 @@ export interface MailcrawlIndexInfo {
38
44
  readonly embedded?: number;
39
45
  readonly reused?: number;
40
46
  readonly generation?: string;
47
+ /** 0.2.0 LanceDB index report: archive revision the vectors were built for. */
48
+ readonly archiveRevision?: string;
49
+ /** 0.2.0: the store was rebuilt instead of incrementally extended. */
50
+ readonly rebuilt?: boolean;
51
+ /** 0.2.0: embedder identity the vectors belong to, e.g. `native:Qwen/Qwen3-Embedding-0.6B:1024`. */
52
+ readonly embedder?: string;
41
53
  }
42
54
  export interface MailcrawlSearchHit {
43
55
  readonly chunkId: string;
@@ -2,6 +2,14 @@ import { CrawlerCliClient } from "../../crawler-client.js";
2
2
  import { CrawlerDatasourceSkill, type CrawlerDatasourceSkillOptions, type CrawlerSkillClient } from "../../crawler-skill.js";
3
3
  import type { CrawlerCliOptions } from "../../crawler-types.js";
4
4
  export interface SlacrawlOptions extends CrawlerCliOptions {
5
+ /**
6
+ * Slack workspace (team) id to scope reads to, e.g. `T0435JHH63Z`.
7
+ *
8
+ * slacrawl's `search`/`messages` read paths return nothing unless a workspace
9
+ * is named explicitly, even when the archive and its FTS index hold matching
10
+ * rows, so an unscoped search silently looks like an empty archive.
11
+ */
12
+ readonly workspace?: string;
5
13
  }
6
14
  export declare class SlacrawlClient extends CrawlerCliClient {
7
15
  constructor(options?: SlacrawlOptions);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Canonical model-visible search tool name for one datasource connection.
3
+ *
4
+ * The agent generates one `search_datasource_<id>` tool per authorized
5
+ * connection (see `src/agent/search-single-datasource-tool.ts`), and skill
6
+ * manifests must be able to name that tool without importing the agent layer
7
+ * (the import direction is agent → datasource, never the reverse). The alias
8
+ * rewrite in `aliased-skill.ts` relies on this exact transformation, so keep
9
+ * it stable: lowercase, non-alphanumerics collapse to `_`, edges trimmed.
10
+ */
11
+ export declare function datasourceSearchToolName(datasourceId: string): string;
@@ -2,7 +2,7 @@
2
2
  * Datasource core contract.
3
3
  *
4
4
  * A *datasource* is an external, server-bound source of retrieval evidence
5
- * (e.g. a KakaoTalk export reached through the external `katok` CLI). The
5
+ * (e.g. a KakaoTalk export reached through the external `lazykatok` CLI). The
6
6
  * datasource layer sits *on top of* the existing retrieval pipeline: it owns
7
7
  * access gating and slash-hierarchical source naming, while actual retrieval
8
8
  * still flows through {@link RetrievalMethod} instances returned by a skill.
@@ -21,7 +21,7 @@
21
21
  import type { RetrievalMethod } from "../retrieval/types.js";
22
22
  export type { RetrievalMethod } from "../retrieval/types.js";
23
23
  /**
24
- * Descriptor for a datasource skill (e.g. KakaoTalk via `katok`).
24
+ * Descriptor for a datasource skill (e.g. KakaoTalk via `lazykatok`).
25
25
  *
26
26
  * Structurally compatible with {@link RetrievalMethodDescriptor} so that
27
27
  * retrieval method descriptors can be gated by the same access context.
@@ -42,7 +42,7 @@ export interface DatasourceSkillDescriptor {
42
42
  */
43
43
  readonly tags: readonly string[];
44
44
  readonly status: "active" | "stub";
45
- /** True when the skill shells out to an external CLI (e.g. `katok`). */
45
+ /** True when the skill shells out to an external CLI (e.g. `lazykatok`). */
46
46
  readonly requiresExternalCli?: boolean;
47
47
  /**
48
48
  * Set when this descriptor describes a datasource-backed surface.
@@ -112,7 +112,7 @@ export interface DatasourceSkillManifest {
112
112
  }
113
113
  /**
114
114
  * A configured, running instance of a datasource skill (e.g. one KakaoTalk
115
- * account reached through `katok`).
115
+ * account reached through `lazykatok`).
116
116
  */
117
117
  export interface DatasourceInstance {
118
118
  /** Stable instance id, unique within a skill. */
@@ -9,6 +9,10 @@ export declare const MODEL_ASSETS: {
9
9
  readonly sha256: "06507c7b42688469c4e7298b0a1e16deff06caf291cf0a5b278c308249c3e439";
10
10
  readonly license: "Apache-2.0";
11
11
  readonly noticeReference: "Qwen3 model card and Apache-2.0 license";
12
+ readonly intendedUse: "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.";
13
+ readonly unsuitableUse: "Chat or generation, remote embedding of corpus text, shipping weights in the npm package, any GGUF other than the pinned SHA-256.";
14
+ readonly upstreamCardUrl: "https://huggingface.co/Qwen/Qwen3-Embedding-0.6B";
15
+ readonly modelCard: "docs/model-cards/qwen3-embedding-0.6b.md";
12
16
  };
13
17
  readonly embeddinggemma: {
14
18
  readonly url: "https://huggingface.co/ggml-org/embeddinggemma-300M-GGUF/resolve/0f741b5a6585bd53aeb15cd1372c56f2a0f65e12/embeddinggemma-300M-Q8_0.gguf";
@@ -16,6 +20,10 @@ export declare const MODEL_ASSETS: {
16
20
  readonly sha256: "b5ce9d77a3fc4b3b39ccb5643c36777911cc4eb46a66962eadfa3f5f60490d63";
17
21
  readonly license: "Gemma Terms of Use";
18
22
  readonly noticeReference: "Google EmbeddingGemma model card and Gemma Terms of Use";
23
+ readonly intendedUse: "Local loopback embedding for AutoRAG MinSync and native-datasource semantic retrieval. Not a generative model.";
24
+ readonly 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.";
25
+ readonly upstreamCardUrl: "https://ai.google.dev/gemma/docs/embeddinggemma/model_card";
26
+ readonly modelCard: "docs/model-cards/embeddinggemma-300m.md";
19
27
  };
20
28
  };
21
29
  export declare const MODEL_ASSET_URLS: {
@@ -53,6 +53,10 @@ export interface ModelAsset {
53
53
  readonly sha256: string;
54
54
  readonly license: string;
55
55
  readonly noticeReference: string;
56
+ readonly intendedUse: string;
57
+ readonly unsuitableUse: string;
58
+ readonly upstreamCardUrl: string;
59
+ readonly modelCard: string;
56
60
  }
57
61
  export interface RuntimeAsset {
58
62
  readonly id: string;