@autorag/librarian 2.3.0 → 2.4.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.
Files changed (82) hide show
  1. package/README.md +143 -16
  2. package/dist/agent/agent.d.ts +45 -13
  3. package/dist/agent/bash-tool.d.ts +2 -0
  4. package/dist/agent/index.d.ts +1 -1
  5. package/dist/agent/search-documents.d.ts +12 -3
  6. package/dist/agent/search-minsync-tool.d.ts +2 -2
  7. package/dist/cli/commands/evidence.d.ts +3 -0
  8. package/dist/cli/commands/index.d.ts +3 -3
  9. package/dist/cli/commands/refresh.d.ts +3 -4
  10. package/dist/cli/commands/search.d.ts +2 -2
  11. package/dist/cli/commands/tui.d.ts +36 -0
  12. package/dist/cli/commands/ui.d.ts +13 -0
  13. package/dist/cli/commands/watch.d.ts +1 -1
  14. package/dist/cli/config.d.ts +17 -19
  15. package/dist/cli/index.js +14497 -10906
  16. package/dist/cli/tui-commands.d.ts +16 -0
  17. package/dist/cli/tui-session-store.d.ts +16 -0
  18. package/dist/datasource/access-context.d.ts +6 -12
  19. package/dist/datasource/crawler-types.d.ts +2 -0
  20. package/dist/datasource/described-skill.d.ts +17 -0
  21. package/dist/datasource/index.d.ts +3 -3
  22. package/dist/datasource/result-filter.d.ts +2 -1
  23. package/dist/datasource/skills/clawgallery/client.d.ts +9 -0
  24. package/dist/datasource/skills/clawgallery/index.d.ts +5 -0
  25. package/dist/datasource/skills/clawgallery/methods.d.ts +19 -0
  26. package/dist/datasource/skills/clawgallery/paths.d.ts +7 -0
  27. package/dist/datasource/skills/clawgallery/skill.d.ts +35 -0
  28. package/dist/datasource/skills/clawgallery/types.d.ts +58 -0
  29. package/dist/datasource/skills/cloud-drive/index.d.ts +1 -0
  30. package/dist/datasource/skills/{gdrive → cloud-drive}/rclone-connector.d.ts +4 -0
  31. package/dist/datasource/skills/cloud-drive/skill.d.ts +1 -1
  32. package/dist/datasource/skills/discrawl/types.d.ts +4 -8
  33. package/dist/datasource/skills/factory.d.ts +2 -0
  34. package/dist/datasource/skills/gmail/index.d.ts +0 -1
  35. package/dist/datasource/skills/gmail/skill.d.ts +1 -1
  36. package/dist/datasource/skills/katok/methods.d.ts +6 -4
  37. package/dist/datasource/skills/katok/types.d.ts +8 -26
  38. package/dist/datasource/skills/mailcrawl/client.d.ts +15 -0
  39. package/dist/datasource/skills/mailcrawl/config.d.ts +2 -0
  40. package/dist/datasource/skills/mailcrawl/index.d.ts +4 -0
  41. package/dist/datasource/skills/mailcrawl/methods.d.ts +15 -0
  42. package/dist/datasource/skills/mailcrawl/skill.d.ts +34 -0
  43. package/dist/datasource/skills/mailcrawl/types.d.ts +71 -0
  44. package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
  45. package/dist/datasource/skills/obsidian/types.d.ts +2 -0
  46. package/dist/datasource/types.d.ts +5 -2
  47. package/dist/filesystem/cloud-placeholder.d.ts +26 -0
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +2591 -1438
  50. package/dist/jikji/client.d.ts +3 -0
  51. package/dist/minsync/client.d.ts +5 -1
  52. package/dist/minsync/embedder-config.d.ts +4 -1
  53. package/dist/minsync/index.d.ts +4 -4
  54. package/dist/minsync/installer.d.ts +1 -0
  55. package/dist/minsync/method.d.ts +17 -8
  56. package/dist/minsync/types.d.ts +5 -0
  57. package/dist/mirror/sync.d.ts +1 -1
  58. package/dist/parser/defaults.d.ts +2 -0
  59. package/dist/parser/index.d.ts +2 -2
  60. package/dist/parser/opendataloader-pdf.d.ts +10 -0
  61. package/dist/parser/types.d.ts +7 -0
  62. package/dist/retrieval/index.d.ts +0 -2
  63. package/dist/retrieval/registry.d.ts +2 -2
  64. package/dist/retrieval/types.d.ts +1 -1
  65. package/dist/ui/browse.d.ts +11 -0
  66. package/dist/ui/catalog.d.ts +59 -0
  67. package/dist/ui/config-store.d.ts +43 -0
  68. package/dist/ui/discover.d.ts +17 -0
  69. package/dist/ui/html.d.ts +2 -0
  70. package/dist/ui/probe.d.ts +24 -0
  71. package/dist/ui/prompt.d.ts +21 -0
  72. package/dist/ui/server.d.ts +28 -0
  73. package/package.json +13 -12
  74. package/skills/autorag/SKILL.md +64 -43
  75. package/skills/autorag-setup/SKILL.md +76 -39
  76. package/dist/agent/search-bm25-tool.d.ts +0 -18
  77. package/dist/datasource/skills/discrawl/config.d.ts +0 -9
  78. package/dist/datasource/skills/gdrive/connector.d.ts +0 -30
  79. package/dist/datasource/skills/gdrive/index.d.ts +0 -3
  80. package/dist/datasource/skills/gdrive/skill.d.ts +0 -24
  81. package/dist/datasource/skills/gmail/himalaya-connector.d.ts +0 -40
  82. package/dist/retrieval/methods/bm25.d.ts +0 -52
@@ -0,0 +1,16 @@
1
+ import type { SlashCommand } from "@earendil-works/pi-tui";
2
+ import type { TuiSessionStore } from "./tui-session-store.js";
3
+ export type ParsedSlashCommand = {
4
+ kind: "incomplete";
5
+ } | {
6
+ kind: "quit";
7
+ } | {
8
+ kind: "resume";
9
+ sessionId: string | undefined;
10
+ } | {
11
+ kind: "unknown";
12
+ name: string;
13
+ };
14
+ export declare function parseSlashCommand(input: string): ParsedSlashCommand | undefined;
15
+ export declare function createTuiSlashCommands(store: TuiSessionStore): SlashCommand[];
16
+ export declare function renderSlashHelp(): string;
@@ -0,0 +1,16 @@
1
+ export interface TuiSessionRecord {
2
+ readonly id: string;
3
+ readonly query: string;
4
+ readonly answer: string;
5
+ readonly trace: string;
6
+ readonly updatedAt: number;
7
+ }
8
+ export interface TuiSessionStore {
9
+ list(): readonly TuiSessionRecord[];
10
+ get(id: string): TuiSessionRecord | undefined;
11
+ save(session: TuiSessionRecord): void;
12
+ }
13
+ export declare function createFileTuiSessionStore(path: string): TuiSessionStore;
14
+ export declare function createMergedTuiSessionStore(...stores: readonly TuiSessionStore[]): TuiSessionStore;
15
+ export declare function renderTuiSessionList(sessions: readonly TuiSessionRecord[]): string;
16
+ export declare function renderRestoredTuiSession(session: TuiSessionRecord): string;
@@ -2,8 +2,8 @@
2
2
  * Trusted, server-bound access context for the datasource layer.
3
3
  *
4
4
  * Constructed from server-supplied allow-tags and allow-scopes ONLY — never
5
- * from model or tool arguments. Enforces default-deny semantics and uses
6
- * explicit boolean `false` for every deny decision (never `undefined`).
5
+ * from model or tool arguments. Tags authorize datasource skills; scopes are
6
+ * applied only to skills that advertise the `scoped` capability.
7
7
  */
8
8
  import type { DatasourceAccessible } from "./types.js";
9
9
  export interface DatasourceAccessContextOptions {
@@ -35,15 +35,9 @@ export declare class DatasourceAccessContext {
35
35
  */
36
36
  isAccessible(descriptor: DatasourceAccessible): boolean;
37
37
  /**
38
- * Build a predicate that filters source paths by trusted allow-scopes,
39
- * intersected with an optional user-supplied scope (the model/tool view).
40
- *
41
- * The predicate always returns an explicit boolean. On default-deny it
42
- * returns `() => false`. Sources containing a `#` fragment are denied
43
- * (datasource sources are slash-hierarchical only).
44
- *
45
- * @param userScope Optional user/model-requested scope; when provided a
46
- * source must match BOTH a trusted allow-scope AND the user scope.
38
+ * Scope-capable datasource results are filtered by trusted and user scopes.
39
+ * Datasources without the `scoped` capability bypass this predicate and
40
+ * are authorized only at the skill/tag level.
47
41
  */
48
- allowedSourcesPredicate(userScope?: string): (source: string) => boolean;
42
+ allowedSourcesPredicate(_userScope?: string): (source: string) => boolean;
49
43
  }
@@ -42,6 +42,8 @@ export interface CrawlerCliOptions {
42
42
  readonly timeoutMs?: number;
43
43
  readonly maxBufferBytes?: number;
44
44
  readonly env?: Readonly<Record<string, string | undefined>>;
45
+ /** Working directory for the native CLI process, when explicitly needed. */
46
+ readonly workspacePath?: string;
45
47
  }
46
48
  export interface CrawlerProfile {
47
49
  readonly binaryName: string;
@@ -0,0 +1,17 @@
1
+ import type { RetrievalMethod } from "../retrieval/types.js";
2
+ import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
3
+ /**
4
+ * Adds operator-authored context to a configured datasource without changing
5
+ * its backend, access identity, or retrieval methods.
6
+ */
7
+ export declare class DescribedDatasourceSkill implements DatasourceSkill {
8
+ private readonly skill;
9
+ private readonly description;
10
+ constructor(skill: DatasourceSkill, description: string);
11
+ describe(): DatasourceSkillDescriptor;
12
+ polling(): PollingMetadata;
13
+ index(): Promise<DatasourceIndexResult>;
14
+ retrievalMethods(): readonly RetrievalMethod[];
15
+ describeSources(): readonly SourceDescription[];
16
+ skillManifest(): DatasourceSkillManifest;
17
+ }
@@ -8,15 +8,15 @@ export { type CronParseResult, isDue, parseCronExpr } from "./polling.js";
8
8
  export { DatasourceSkillRegistry, type RegisteredDatasourceSkill } from "./registry.js";
9
9
  export { DatasourceResultFilter, type ResultsByMethod } from "./result-filter.js";
10
10
  export { buildDatasourceChunkSource, buildDatasourceInstanceSource, DATASOURCE_CHUNKS_SEGMENT, datasourceSourceHasFragment, datasourceSourcePath, isDatasourceSource, matchesDatasourceScope, matchesVirtualPathScope, normalizeVirtualPath, } from "./scope.js";
11
- export { CLOUD_DRIVE_SKILL_DEFINITION, CloudDriveSkill, type CloudDriveSkillOptions, } from "./skills/cloud-drive/index.js";
11
+ export { CLOUD_DRIVE_SKILL_DEFINITION, CloudDriveSkill, type CloudDriveSkillOptions, RcloneConnector, type RcloneConnectorOptions, type RcloneRunner, type RcloneRunResult, } from "./skills/cloud-drive/index.js";
12
12
  export { DEFAULT_DISCRAWL_EMBEDDING_MODEL, DEFAULT_DISCRAWL_MODE, DEFAULT_DISCRAWL_SOURCE, DiscrawlClient, type DiscrawlFailureReason, DiscrawlFtsMethod, DiscrawlHybridMethod, type DiscrawlOptions, type DiscrawlSearchHit, type DiscrawlSearchMode, type DiscrawlSearchOptions, type DiscrawlSearchResult, DiscrawlSemanticMethod, DiscrawlSkill, type DiscrawlSkillClient, type DiscrawlSkillOptions, type DiscrawlSourceKind, ENGLISH_ONLY_EMBEDDING_MODELS, } from "./skills/discrawl/index.js";
13
13
  export { BUILTIN_DATASOURCE_SKILL_NAMES, type BuildDatasourceSkillsResult, buildDatasourceSkills, type DatasourceSkillConfig, type DatasourcesConfig, } from "./skills/factory.js";
14
- export { GDriveConnector, type GDriveConnectorOptions, GDriveSkill, type GDriveSkillOptions, } from "./skills/gdrive/index.js";
15
14
  export { GitHubConnector, type GitHubConnectorOptions, GitHubSkill, type GitHubSkillOptions, } from "./skills/github/index.js";
16
15
  export { GmailConnector, type GmailConnectorOptions, GmailSkill, type GmailSkillOptions, } from "./skills/gmail/index.js";
17
16
  export type { KatokFailureReason, KatokHit, KatokOptions, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSkillClient, KatokSkillOptions, } from "./skills/katok/index.js";
18
- export { KatokBm25Method, KatokClient, KatokSemanticMethod, KatokSkill } from "./skills/katok/index.js";
17
+ export { KatokBm25Method, KatokClient, KatokSemanticMethod, KatokSkill, } from "./skills/katok/index.js";
19
18
  export { MailExportConnector, type MailExportConnectorOptions, MailExportSkill, type MailExportSkillOptions, } from "./skills/mail-export/index.js";
19
+ export { MAILCRAWL_MODES, MailcrawlClient, type MailcrawlFailure, type MailcrawlFailureReason, type MailcrawlIndexInfo, MailcrawlMethod, type MailcrawlOptions, type MailcrawlSearchHit, type MailcrawlSearchMode, type MailcrawlSearchResult, MailcrawlSkill, type MailcrawlSyncInfo, type MailcrawlSyncResult, } from "./skills/mailcrawl/index.js";
20
20
  export { NotcrawlClient, type NotcrawlOptions, NotionSkill, type NotionSkillOptions, } from "./skills/notion/index.js";
21
21
  export { ObsidianBm25Method, ObsidianSemanticMethod, ObsidianSkill, type ObsidianSkillClient, type ObsidianSkillOptions, QmdClient, type QmdOptions, type QmdSearchHit, type QmdSearchMode, type QmdSearchResult, } from "./skills/obsidian/index.js";
22
22
  export { RssConnector, type RssConnectorOptions, type RssFeedConfig, RssSkill, type RssSkillOptions, } from "./skills/rss/index.js";
@@ -6,7 +6,8 @@
6
6
  * takes the per-method result map and the {@link RetrievalMethod}s that
7
7
  * produced it, then for every datasource-backed method either drops all of
8
8
  * its results (when the trusted access context denies the descriptor) or
9
- * keeps only the sources the context allows for the current user scope.
9
+ * keeps only the sources the context allows for the current user scope when
10
+ * the method advertises the `scoped` capability.
10
11
  *
11
12
  * Non-datasource methods (those whose descriptor has no `datasourceId`) pass
12
13
  * through completely untouched — they are gated by their own retrieval
@@ -0,0 +1,9 @@
1
+ import type { ClawGalleryIndexResult, ClawGalleryOptions, ClawGallerySearchMode, ClawGallerySearchOptions, ClawGallerySearchResult, ClawGalleryVdrResult } from "./types.js";
2
+ export declare class ClawGalleryClient {
3
+ private readonly options;
4
+ constructor(options?: ClawGalleryOptions);
5
+ bootstrap(signal?: AbortSignal): Promise<ClawGalleryIndexResult>;
6
+ syncVisual(signal?: AbortSignal): Promise<ClawGalleryVdrResult>;
7
+ search(mode: ClawGallerySearchMode, query: string, options?: ClawGallerySearchOptions): Promise<ClawGallerySearchResult>;
8
+ private run;
9
+ }
@@ -0,0 +1,5 @@
1
+ export { ClawGalleryClient } from "./client.js";
2
+ export { ClawGalleryMethod, type ClawGalleryMethodOptions, type ClawGallerySearchClient } from "./methods.js";
3
+ export { CLAWGALLERY_DATASOURCE_ID, CLAWGALLERY_SOURCE_KIND, clawGallerySourcePath, parseClawGallerySourcePath, } from "./paths.js";
4
+ export { ClawGallerySkill, type ClawGallerySkillClient, type ClawGallerySkillOptions } from "./skill.js";
5
+ export type { ClawGalleryFailure, ClawGalleryFailureReason, ClawGalleryHit, ClawGalleryIndexInfo, ClawGalleryIndexResult, ClawGalleryOptions, ClawGallerySearchMode, ClawGallerySearchOptions, ClawGallerySearchResult, ClawGalleryVdrBackend, ClawGalleryVdrInfo, ClawGalleryVdrResult, } from "./types.js";
@@ -0,0 +1,19 @@
1
+ import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../../../retrieval/types.js";
2
+ import type { ClawGallerySearchMode, ClawGallerySearchOptions, ClawGallerySearchResult } from "./types.js";
3
+ export interface ClawGallerySearchClient {
4
+ search(mode: ClawGallerySearchMode, query: string, options?: ClawGallerySearchOptions): Promise<ClawGallerySearchResult>;
5
+ }
6
+ export interface ClawGalleryMethodOptions {
7
+ readonly client: ClawGallerySearchClient;
8
+ readonly instanceId: string;
9
+ readonly tags?: readonly string[];
10
+ }
11
+ export declare class ClawGalleryMethod implements RetrievalMethod {
12
+ private readonly mode;
13
+ private readonly client;
14
+ private readonly instanceId;
15
+ private readonly tags;
16
+ constructor(mode: ClawGallerySearchMode, client: ClawGallerySearchClient, instanceId: string, tags: readonly string[]);
17
+ describe(): RetrievalMethodDescriptor;
18
+ retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
19
+ }
@@ -0,0 +1,7 @@
1
+ export declare const CLAWGALLERY_DATASOURCE_ID = "clawgallery";
2
+ export declare const CLAWGALLERY_SOURCE_KIND = "screenshots";
3
+ export declare function clawGallerySourcePath(instanceId: string, imageId: string): string;
4
+ export declare function parseClawGallerySourcePath(source: string): {
5
+ readonly instanceId: string;
6
+ readonly imageId: string;
7
+ } | undefined;
@@ -0,0 +1,35 @@
1
+ import type { RetrievalMethod } from "../../../retrieval/types.js";
2
+ import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
+ import { type ClawGallerySearchClient } from "./methods.js";
4
+ import type { ClawGalleryIndexResult, ClawGalleryOptions, ClawGallerySearchMode, ClawGalleryVdrResult } from "./types.js";
5
+ export interface ClawGallerySkillClient extends ClawGallerySearchClient {
6
+ bootstrap(): Promise<ClawGalleryIndexResult>;
7
+ syncVisual(): Promise<ClawGalleryVdrResult>;
8
+ }
9
+ export interface ClawGallerySkillOptions {
10
+ readonly client: ClawGallerySkillClient;
11
+ readonly instanceId?: string;
12
+ readonly instances?: readonly string[];
13
+ readonly pollingIntervalMs?: number;
14
+ readonly tags?: readonly string[];
15
+ readonly defaultMode?: ClawGallerySearchMode;
16
+ readonly syncVisual?: boolean;
17
+ readonly vdrBackend?: ClawGalleryOptions["vdrBackend"];
18
+ }
19
+ export declare class ClawGallerySkill implements DatasourceSkill {
20
+ private readonly instanceId;
21
+ private readonly instances;
22
+ private readonly tags;
23
+ private readonly mode;
24
+ private readonly interval;
25
+ private readonly sync;
26
+ private lastIndexedAt;
27
+ private readonly options;
28
+ constructor(options: ClawGallerySkillOptions);
29
+ describe(): DatasourceSkillDescriptor;
30
+ polling(): PollingMetadata;
31
+ index(): Promise<DatasourceIndexResult>;
32
+ retrievalMethods(): readonly RetrievalMethod[];
33
+ describeSources(): readonly SourceDescription[];
34
+ skillManifest(): DatasourceSkillManifest;
35
+ }
@@ -0,0 +1,58 @@
1
+ import type { RetrievalOptions } from "../../../retrieval/types.js";
2
+ export type ClawGallerySearchMode = "keyword" | "lexical" | "embedding" | "hybrid";
3
+ export type ClawGalleryVdrBackend = "mlx" | "jina-mlx" | "vsplade";
4
+ export interface ClawGalleryOptions {
5
+ readonly binaryPath?: string;
6
+ readonly timeoutMs?: number;
7
+ readonly maxBufferBytes?: number;
8
+ readonly configDir?: string;
9
+ readonly path?: string;
10
+ readonly syncVisual?: boolean;
11
+ readonly vdrBackend?: ClawGalleryVdrBackend;
12
+ readonly defaultMode?: ClawGallerySearchMode;
13
+ readonly env?: Readonly<Record<string, string | undefined>>;
14
+ }
15
+ export type ClawGalleryFailureReason = "binary-missing" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-json" | "invalid-shape";
16
+ export interface ClawGalleryFailure {
17
+ readonly ok: false;
18
+ readonly reason: ClawGalleryFailureReason;
19
+ readonly stdout: string;
20
+ readonly stderr: string;
21
+ readonly code: number | null;
22
+ }
23
+ export interface ClawGalleryOk<T> {
24
+ readonly ok: true;
25
+ readonly data: T;
26
+ readonly stdout: string;
27
+ readonly stderr: string;
28
+ readonly code: number;
29
+ }
30
+ export interface ClawGalleryHit {
31
+ readonly imageId: string;
32
+ readonly content: string;
33
+ readonly score: number;
34
+ readonly path?: string;
35
+ readonly title?: string;
36
+ readonly caption?: string;
37
+ readonly metadata?: Readonly<Record<string, unknown>>;
38
+ }
39
+ export interface ClawGalleryIndexInfo {
40
+ readonly indexed: number;
41
+ readonly skipped: number;
42
+ readonly pruned: number;
43
+ readonly metadata?: Readonly<Record<string, unknown>>;
44
+ }
45
+ export interface ClawGalleryVdrInfo {
46
+ readonly processed: number;
47
+ readonly skipped: number;
48
+ readonly failed: number;
49
+ readonly metadata?: Readonly<Record<string, unknown>>;
50
+ }
51
+ export type ClawGalleryIndexResult = ClawGalleryOk<ClawGalleryIndexInfo> | ClawGalleryFailure;
52
+ export type ClawGalleryVdrResult = ClawGalleryOk<ClawGalleryVdrInfo> | ClawGalleryFailure;
53
+ export type ClawGallerySearchResult = (ClawGalleryOk<{
54
+ readonly hits: readonly ClawGalleryHit[];
55
+ }> & {
56
+ readonly hits: readonly ClawGalleryHit[];
57
+ }) | ClawGalleryFailure;
58
+ export type ClawGallerySearchOptions = RetrievalOptions;
@@ -1 +1,2 @@
1
+ export { RcloneConnector, type RcloneConnectorOptions, type RcloneRunner, type RcloneRunResult, } from "./rclone-connector.js";
1
2
  export { CLOUD_DRIVE_SKILL_DEFINITION, CloudDriveSkill, type CloudDriveSkillOptions, } from "./skill.js";
@@ -6,6 +6,7 @@
6
6
  * manifest is published only after every changed file is available, so search
7
7
  * can continue using the previous completed snapshot after an interrupted run.
8
8
  */
9
+ import type { DefaultParserRegistryOptions } from "../../../parser/defaults.js";
9
10
  import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
10
11
  export interface RcloneRunResult {
11
12
  readonly ok: boolean;
@@ -32,6 +33,9 @@ export interface RcloneConnectorOptions {
32
33
  readonly dryRun?: boolean;
33
34
  readonly timeoutMs?: number;
34
35
  readonly runner?: RcloneRunner;
36
+ /** Explicit operator-owned rclone.conf path, passed read-only. */
37
+ readonly configPath?: string;
38
+ readonly parserOptions?: DefaultParserRegistryOptions;
35
39
  }
36
40
  export declare class RcloneConnector implements DatasourceConnector {
37
41
  private readonly options;
@@ -1,6 +1,6 @@
1
1
  import type { DatasourceConnector } from "../../connector.js";
2
2
  import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
3
- import { type RcloneConnectorOptions } from "../gdrive/rclone-connector.js";
3
+ import { type RcloneConnectorOptions } from "./rclone-connector.js";
4
4
  export declare const CLOUD_DRIVE_SKILL_DEFINITION: ConnectorSkillDefinition;
5
5
  export interface CloudDriveSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
6
6
  /** Unique model-visible datasource name for this configured connection. */
@@ -64,21 +64,17 @@ export interface DiscrawlOptions {
64
64
  * AutoRAG never rewrites an explicit config.
65
65
  */
66
66
  readonly configPath?: string;
67
- /** Workspace root used to compute the default discrawl workspace path. */
67
+ /** Retained for source compatibility; native discrawl defaults are used. */
68
68
  readonly root?: string;
69
69
  /** Explicit workspace directory overriding the computed default. */
70
70
  readonly workspacePath?: string;
71
71
  /** Restrict search and sync to one guild id. */
72
72
  readonly guildId?: string;
73
- /**
74
- * Embedding provider written to AutoRAG's workspace-local discrawl config.
75
- * Defaults to `ollama`; explicit operator-owned config files are untouched.
76
- */
73
+ /** Embedding provider understood by the native discrawl configuration. */
77
74
  readonly embeddingProvider?: string;
78
75
  /**
79
- * Embedding model discrawl should use for semantic/hybrid search. Defaults
80
- * to {@link DEFAULT_DISCRAWL_EMBEDDING_MODEL}. English-only models are
81
- * accepted but reported through a diagnostic.
76
+ * Embedding model understood by the native discrawl configuration.
77
+ * English-only models are accepted but reported through a diagnostic.
82
78
  */
83
79
  readonly embeddingModel?: string;
84
80
  /**
@@ -11,6 +11,8 @@ import type { DatasourceSkill } from "../types.js";
11
11
  /** One configured datasource entry (the trusted `datasources.<name>` value). */
12
12
  export interface DatasourceSkillConfig {
13
13
  readonly enabled?: boolean;
14
+ /** Operator-authored context shown to the agent for this connection. */
15
+ readonly description?: string;
14
16
  /** Built-in datasource template used when the config key is a connection alias. */
15
17
  readonly type?: string;
16
18
  readonly instanceId?: string;
@@ -1,3 +1,2 @@
1
1
  export { GmailConnector, type GmailConnectorOptions } from "./connector.js";
2
- export { HimalayaConnector, type HimalayaConnectorOptions, type HimalayaRunner, type HimalayaRunResult, } from "./himalaya-connector.js";
3
2
  export { GMAIL_SKILL_DEFINITION, GmailSkill, type GmailSkillOptions } from "./skill.js";
@@ -14,7 +14,7 @@ export declare const GMAIL_SKILL_DEFINITION: ConnectorSkillDefinition;
14
14
  export interface GmailSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
15
15
  /**
16
16
  * Trusted pre-built connector; wins over {@link connectorOptions}. Accepts
17
- * any mail-backed connector (Gmail REST or the himalaya CLI bridge).
17
+ * any compatible mail-backed connector.
18
18
  */
19
19
  readonly connector?: DatasourceConnector;
20
20
  readonly connectorOptions?: GmailConnectorOptions;
@@ -14,8 +14,9 @@ export interface KatokMethodOptions {
14
14
  }
15
15
  /**
16
16
  * Lexical (BM25) retrieval over a KakaoTalk datasource via the external
17
- * `katok` CLI in keyword mode. All client failures collapse to an empty
18
- * result set; retrieval never throws.
17
+ * `katok` CLI in keyword mode. Katok does not expose source scopes; access is
18
+ * controlled at the datasource/tag level. All client failures collapse to an
19
+ * empty result set; retrieval never throws.
19
20
  */
20
21
  export declare class KatokBm25Method implements RetrievalMethod {
21
22
  private readonly client;
@@ -27,8 +28,9 @@ export declare class KatokBm25Method implements RetrievalMethod {
27
28
  }
28
29
  /**
29
30
  * Semantic (vector) retrieval over a KakaoTalk datasource via the external
30
- * `katok` CLI in semantic mode. All client failures collapse to an empty
31
- * result set; retrieval never throws.
31
+ * `katok` CLI in semantic mode. Katok does not expose source scopes; access is
32
+ * controlled at the datasource/tag level. All client failures collapse to an
33
+ * empty result set; retrieval never throws.
32
34
  */
33
35
  export declare class KatokSemanticMethod implements RetrievalMethod {
34
36
  private readonly client;
@@ -7,14 +7,6 @@ import type { RetrievalOptions } from "../../../retrieval/types.js";
7
7
  * - `hybrid` — fused semantic + keyword scores.
8
8
  */
9
9
  export type KatokSearchMode = "semantic" | "keyword" | "hybrid";
10
- /**
11
- * Where the `katok` CLI reads KakaoTalk data from.
12
- *
13
- * - `macos` — live KakaoTalk install on macOS (the CLI owns DB access; this
14
- * client never touches the DB directly).
15
- * - `fixture` — a frozen fixture directory (used for tests / dry runs).
16
- */
17
- export type KatokSourceKind = "macos" | "fixture";
18
10
  /**
19
11
  * Configuration for {@link KatokClient}. All fields optional; sensible defaults
20
12
  * mirror the jikji client. The client spawns the `katok` binary as a child
@@ -23,34 +15,24 @@ export type KatokSourceKind = "macos" | "fixture";
23
15
  export interface KatokOptions {
24
16
  /** Explicit path to the `katok` binary. Defaults to a bare `katok` PATH lookup. */
25
17
  readonly binaryPath?: string;
26
- /** Spawn timeout in milliseconds. Default 10_000. */
18
+ /** Spawn timeout in milliseconds. Default 60_000 (sync/index over large archives can be slow). */
27
19
  readonly timeoutMs?: number;
28
20
  /** Max stdout/stderr bytes retained. Default 1_048_576 (1 MiB). */
29
21
  readonly maxBufferBytes?: number;
30
- /** Data source for the CLI. Default `macos`. */
31
- readonly source?: KatokSourceKind;
32
- /** Path to a fixture directory; required when `source === "fixture"`. */
33
- readonly fixturePath?: string;
34
- /**
35
- * Explicit katok workspace directory (the `.autorag/datasources/katok`
36
- * root). When omitted, computed from {@link KatokOptions.root} (or
37
- * `process.cwd()`) via the paths helper.
38
- */
22
+ /** Explicit native katok data directory, passed as `--data-dir`. */
39
23
  readonly workspacePath?: string;
40
- /** Workspace root used to compute the default katok workspace path. */
41
- readonly root?: string;
24
+ /** Explicit operator-owned configuration/workspace transport. */
25
+ readonly configPath?: string;
42
26
  /** Environment overrides merged on top of `process.env` for the child. */
43
27
  readonly env?: Readonly<Record<string, string | undefined>>;
44
28
  }
45
29
  export declare const DEFAULT_KATOK_BINARY = "katok";
46
- export declare const DEFAULT_KATOK_TIMEOUT_MS = 10000;
30
+ export declare const DEFAULT_KATOK_TIMEOUT_MS = 60000;
47
31
  export declare const DEFAULT_KATOK_MAX_BUFFER_BYTES = 1048576;
48
- export declare const DEFAULT_KATOK_SOURCE: KatokSourceKind;
49
32
  export declare const DEFAULT_KATOK_OPTIONS: {
50
33
  readonly binaryPath: "katok";
51
- readonly timeoutMs: 10000;
34
+ readonly timeoutMs: 60000;
52
35
  readonly maxBufferBytes: 1048576;
53
- readonly source: "macos";
54
36
  };
55
37
  /**
56
38
  * Reasons a katok CLI invocation can fail. The client never throws for these —
@@ -140,7 +122,7 @@ export type KatokParentResult = KatokOk<KatokChunk> | KatokFailure;
140
122
  /**
141
123
  * Search-specific options. Reuses the shared {@link RetrievalOptions} so the
142
124
  * KatokSkill retrieval method can pass its options straight through. The
143
- * client maps `topK` and `scope` to CLI flags; other fields are accepted but
144
- * not currently forwarded.
125
+ * client maps `topK` to the native CLI limit flag; other fields are handled
126
+ * by the retrieval layer or are not supported by katok.
145
127
  */
146
128
  export type KatokSearchOptions = RetrievalOptions;
@@ -0,0 +1,15 @@
1
+ import type { MailcrawlFailure, MailcrawlIndexInfo, MailcrawlOk, MailcrawlOptions, MailcrawlSearchMode, MailcrawlSearchOptions, MailcrawlSearchResult, MailcrawlSyncResult } from "./types.js";
2
+ export interface MailcrawlSearchClient {
3
+ search(mode: MailcrawlSearchMode, query: string, options?: MailcrawlSearchOptions): Promise<MailcrawlSearchResult>;
4
+ }
5
+ export interface MailcrawlIndexClient extends MailcrawlSearchClient {
6
+ index(signal?: AbortSignal): Promise<MailcrawlOk<MailcrawlIndexInfo> | MailcrawlFailure>;
7
+ }
8
+ export declare class MailcrawlClient implements MailcrawlSearchClient {
9
+ private readonly options;
10
+ constructor(options?: MailcrawlOptions);
11
+ sync(signal?: AbortSignal): Promise<MailcrawlSyncResult>;
12
+ search(mode: MailcrawlSearchMode, query: string, options?: MailcrawlSearchOptions): Promise<MailcrawlSearchResult>;
13
+ private run;
14
+ index(signal?: AbortSignal): Promise<MailcrawlOk<MailcrawlIndexInfo> | MailcrawlFailure>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export declare function validateMailcrawlInstanceId(instanceId: string): void;
2
+ export declare function ensurePrivateMailcrawlDataDir(path: string): void;
@@ -0,0 +1,4 @@
1
+ export { MailcrawlClient, type MailcrawlIndexClient, type MailcrawlSearchClient } from "./client.js";
2
+ export { MAILCRAWL_MODES, MailcrawlMethod } from "./methods.js";
3
+ export { MailcrawlSkill, type MailcrawlSkillClient, type MailcrawlSkillOptions } from "./skill.js";
4
+ export type { MailcrawlFailure, MailcrawlFailureReason, MailcrawlIndexInfo, MailcrawlOptions, MailcrawlSearchHit, MailcrawlSearchMode, MailcrawlSearchOptions, MailcrawlSearchResult, MailcrawlSyncInfo, MailcrawlSyncResult, } from "./types.js";
@@ -0,0 +1,15 @@
1
+ import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../../../retrieval/types.js";
2
+ import type { MailcrawlSearchClient } from "./client.js";
3
+ import type { MailcrawlSearchMode } from "./types.js";
4
+ export declare class MailcrawlMethod implements RetrievalMethod {
5
+ private readonly client;
6
+ private readonly mode;
7
+ private readonly instanceId;
8
+ private readonly tags;
9
+ private readonly account;
10
+ private readonly mailbox;
11
+ constructor(client: MailcrawlSearchClient, mode: MailcrawlSearchMode, instanceId: string, tags: readonly string[], account?: string, mailbox?: string);
12
+ describe(): RetrievalMethodDescriptor;
13
+ retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
14
+ }
15
+ export declare const MAILCRAWL_MODES: readonly MailcrawlSearchMode[];
@@ -0,0 +1,34 @@
1
+ import type { RetrievalMethod } from "../../../retrieval/types.js";
2
+ import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
+ import { type MailcrawlIndexClient } from "./client.js";
4
+ import type { MailcrawlOptions, MailcrawlSyncResult } from "./types.js";
5
+ export interface MailcrawlSkillClient extends MailcrawlIndexClient {
6
+ sync(signal?: AbortSignal): Promise<MailcrawlSyncResult>;
7
+ }
8
+ export interface MailcrawlSkillOptions extends MailcrawlOptions {
9
+ readonly client?: MailcrawlSkillClient;
10
+ readonly datasourceId?: string;
11
+ readonly instanceId?: string;
12
+ readonly instances?: readonly string[];
13
+ readonly pollingIntervalMs?: number;
14
+ readonly tags?: readonly string[];
15
+ readonly connectorOptions?: MailcrawlOptions;
16
+ }
17
+ export declare class MailcrawlSkill implements DatasourceSkill {
18
+ private readonly client;
19
+ private readonly instanceId;
20
+ private readonly instances;
21
+ private readonly interval;
22
+ private readonly tags;
23
+ private readonly account;
24
+ private readonly mailbox;
25
+ private lastIndexedAt;
26
+ constructor(options?: MailcrawlSkillOptions);
27
+ describe(): DatasourceSkillDescriptor;
28
+ polling(): PollingMetadata;
29
+ index(): Promise<DatasourceIndexResult>;
30
+ retrievalMethods(): readonly RetrievalMethod[];
31
+ describeSources(): readonly SourceDescription[];
32
+ skillManifest(): DatasourceSkillManifest;
33
+ private fail;
34
+ }
@@ -0,0 +1,71 @@
1
+ export type MailcrawlSearchMode = "keyword" | "bm25" | "semantic" | "hybrid";
2
+ export interface MailcrawlSearchOptions {
3
+ readonly topK?: number;
4
+ readonly signal?: AbortSignal;
5
+ }
6
+ export interface MailcrawlOptions {
7
+ readonly binaryPath?: string;
8
+ readonly instanceId?: string;
9
+ readonly dataDir?: string;
10
+ readonly account?: string;
11
+ readonly mailbox?: string;
12
+ readonly backend?: string;
13
+ readonly source?: string;
14
+ readonly fixture?: string;
15
+ readonly himalayaConfig?: string;
16
+ readonly timeoutMs?: number;
17
+ readonly maxBufferBytes?: number;
18
+ readonly env?: Readonly<Record<string, string | undefined>>;
19
+ }
20
+ export type MailcrawlFailureReason = "binary-missing" | "not-configured" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-output" | "remote-embedding-rejected";
21
+ export interface MailcrawlFailure {
22
+ readonly ok: false;
23
+ readonly reason: MailcrawlFailureReason;
24
+ readonly stdout: string;
25
+ readonly stderr: string;
26
+ readonly code: number | null;
27
+ }
28
+ export interface MailcrawlSyncInfo {
29
+ readonly added?: number;
30
+ readonly updated?: number;
31
+ readonly deleted?: number;
32
+ readonly unchanged?: number;
33
+ readonly chunksAdded?: number;
34
+ readonly archiveRevision?: string;
35
+ readonly messages: number;
36
+ }
37
+ export interface MailcrawlIndexInfo {
38
+ readonly embedded?: number;
39
+ readonly reused?: number;
40
+ readonly generation?: string;
41
+ }
42
+ export interface MailcrawlSearchHit {
43
+ readonly chunkId: string;
44
+ readonly messageId: string;
45
+ readonly threadId: string;
46
+ readonly accountId: string;
47
+ readonly mailbox: string;
48
+ readonly subject: string;
49
+ readonly from: string;
50
+ readonly to: readonly string[];
51
+ readonly date: string;
52
+ readonly snippet: string;
53
+ readonly score: number;
54
+ readonly mode: MailcrawlSearchMode;
55
+ }
56
+ export interface MailcrawlOk<T> {
57
+ readonly ok: true;
58
+ readonly data: T;
59
+ readonly stdout: string;
60
+ readonly stderr: string;
61
+ readonly code: number;
62
+ }
63
+ export interface MailcrawlSearchOk {
64
+ readonly ok: true;
65
+ readonly hits: readonly MailcrawlSearchHit[];
66
+ readonly stdout: string;
67
+ readonly stderr: string;
68
+ readonly code: number;
69
+ }
70
+ export type MailcrawlSyncResult = MailcrawlOk<MailcrawlSyncInfo> | MailcrawlFailure;
71
+ export type MailcrawlSearchResult = MailcrawlSearchOk | MailcrawlFailure;
@@ -20,6 +20,7 @@ export interface ObsidianSkillOptions {
20
20
  readonly workspaceRoot?: string;
21
21
  readonly collectionName?: string;
22
22
  readonly timeoutMs?: number;
23
+ readonly configPath?: string;
23
24
  readonly connectorOptions?: {
24
25
  readonly vaultPath?: string;
25
26
  };
@@ -27,6 +27,8 @@ export interface QmdOptions {
27
27
  readonly collectionName?: string;
28
28
  /** Environment overrides merged on top of a restricted process env. */
29
29
  readonly env?: Readonly<Record<string, string | undefined>>;
30
+ /** Explicit operator-owned qmd config directory, never rewritten. */
31
+ readonly configPath?: string;
30
32
  }
31
33
  export declare const DEFAULT_QMD_BINARY = "qmd";
32
34
  export declare const DEFAULT_QMD_TIMEOUT_MS = 60000;