@autorag/librarian 2.1.0 → 2.2.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.
- package/README.md +73 -15
- package/dist/agent/agent.d.ts +11 -0
- package/dist/agent/search-bm25-tool.d.ts +1 -1
- package/dist/agent/search-minsync-tool.d.ts +1 -1
- package/dist/cli/index.js +4206 -2039
- package/dist/datasource/connector-skill.d.ts +1 -1
- package/dist/datasource/connector.d.ts +1 -1
- package/dist/datasource/crawler-client.d.ts +9 -0
- package/dist/datasource/crawler-skill.d.ts +41 -0
- package/dist/datasource/crawler-types.d.ts +53 -0
- package/dist/datasource/index.d.ts +6 -4
- package/dist/datasource/skills/discrawl/client.d.ts +23 -0
- package/dist/datasource/skills/discrawl/config.d.ts +9 -0
- package/dist/datasource/skills/discrawl/index.d.ts +5 -0
- package/dist/datasource/skills/discrawl/methods.d.ts +55 -0
- package/dist/datasource/skills/discrawl/paths.d.ts +30 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +58 -0
- package/dist/datasource/skills/discrawl/types.d.ts +198 -0
- package/dist/datasource/skills/notion/index.d.ts +15 -2
- package/dist/datasource/skills/obsidian/client.d.ts +15 -0
- package/dist/datasource/skills/obsidian/index.d.ts +6 -2
- package/dist/datasource/skills/obsidian/methods.d.ts +26 -0
- package/dist/datasource/skills/obsidian/paths.d.ts +27 -0
- package/dist/datasource/skills/obsidian/skill.d.ts +40 -17
- package/dist/datasource/skills/obsidian/types.d.ts +90 -0
- package/dist/datasource/skills/slack/index.d.ts +15 -2
- package/dist/datasource/skills/telecrawl/index.d.ts +15 -0
- package/dist/datasource/skills/wacrawl/index.d.ts +15 -0
- package/dist/index.js +4231 -2048
- package/dist/retrieval/merger.d.ts +1 -0
- package/dist/retrieval/scope.d.ts +10 -0
- package/package.json +18 -18
- package/skills/autorag-setup/SKILL.md +29 -7
- package/dist/datasource/skills/discord/connector.d.ts +0 -30
- package/dist/datasource/skills/discord/index.d.ts +0 -2
- package/dist/datasource/skills/discord/skill.d.ts +0 -20
- package/dist/datasource/skills/notion/connector.d.ts +0 -26
- package/dist/datasource/skills/notion/skill.d.ts +0 -20
- package/dist/datasource/skills/obsidian/connector.d.ts +0 -22
- package/dist/datasource/skills/slack/connector.d.ts +0 -28
- package/dist/datasource/skills/slack/skill.d.ts +0 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared {@link DatasourceSkill} implementation for connector-backed
|
|
3
3
|
* datasources (Slack, Discord, Notion, GitHub, Google Drive, Gmail/IMAP,
|
|
4
|
-
* local mail exports,
|
|
4
|
+
* local mail exports, RSS/news).
|
|
5
5
|
*
|
|
6
6
|
* Composition: a trusted {@link DatasourceConnector} fetches documents, a
|
|
7
7
|
* {@link DatasourceChunkStore} persists and lexically indexes them, and this
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Connector contract shared by the built-in datasource skills (Slack, Discord,
|
|
3
|
-
* Notion, GitHub, Google Drive, Gmail/IMAP, local mail exports,
|
|
3
|
+
* Notion, GitHub, Google Drive, Gmail/IMAP, local mail exports,
|
|
4
4
|
* RSS/news).
|
|
5
5
|
*
|
|
6
6
|
* A *connector* is the trusted, server-configured bridge to one external
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CrawlerCliOptions, CrawlerProfile, CrawlerSearchOptions, CrawlerSearchResult, CrawlerSyncResult } from "./crawler-types.js";
|
|
2
|
+
export declare class CrawlerCliClient {
|
|
3
|
+
private readonly profile;
|
|
4
|
+
private readonly options;
|
|
5
|
+
constructor(profile: CrawlerProfile, options?: CrawlerCliOptions);
|
|
6
|
+
sync(signal?: AbortSignal): Promise<CrawlerSyncResult>;
|
|
7
|
+
search(query: string, options?: CrawlerSearchOptions): Promise<CrawlerSearchResult>;
|
|
8
|
+
private run;
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { RetrievalMethod } from "../retrieval/types.js";
|
|
2
|
+
import type { CrawlerSearchOptions, CrawlerSearchResult, CrawlerSyncResult } from "./crawler-types.js";
|
|
3
|
+
import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
|
|
4
|
+
export interface CrawlerSkillClient {
|
|
5
|
+
sync(signal?: AbortSignal): Promise<CrawlerSyncResult>;
|
|
6
|
+
search(query: string, options?: CrawlerSearchOptions): Promise<CrawlerSearchResult>;
|
|
7
|
+
}
|
|
8
|
+
export interface CrawlerDatasourceDefinition {
|
|
9
|
+
readonly datasourceId: string;
|
|
10
|
+
readonly skillType: string;
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly defaultTags: readonly string[];
|
|
13
|
+
readonly contentType: string;
|
|
14
|
+
readonly manifestDescription: string;
|
|
15
|
+
readonly backendName: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CrawlerDatasourceSkillOptions {
|
|
18
|
+
readonly client: CrawlerSkillClient;
|
|
19
|
+
readonly instanceId?: string;
|
|
20
|
+
readonly instances?: readonly string[];
|
|
21
|
+
readonly pollingIntervalMs?: number;
|
|
22
|
+
readonly tags?: readonly string[];
|
|
23
|
+
readonly lastIndexedAt?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class CrawlerDatasourceSkill implements DatasourceSkill {
|
|
26
|
+
private readonly definition;
|
|
27
|
+
private readonly client;
|
|
28
|
+
private readonly instanceId;
|
|
29
|
+
private readonly instances;
|
|
30
|
+
private readonly pollingIntervalMs;
|
|
31
|
+
private readonly tags;
|
|
32
|
+
private lastIndexedAt;
|
|
33
|
+
constructor(definition: CrawlerDatasourceDefinition, options: CrawlerDatasourceSkillOptions);
|
|
34
|
+
describe(): DatasourceSkillDescriptor;
|
|
35
|
+
polling(): PollingMetadata;
|
|
36
|
+
index(): Promise<DatasourceIndexResult>;
|
|
37
|
+
retrievalMethods(): readonly RetrievalMethod[];
|
|
38
|
+
describeSources(): readonly SourceDescription[];
|
|
39
|
+
skillManifest(): DatasourceSkillManifest;
|
|
40
|
+
private fail;
|
|
41
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { RetrievalOptions } from "../retrieval/types.js";
|
|
2
|
+
export type CrawlerFailureReason = "binary-missing" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-output";
|
|
3
|
+
export interface CrawlerFailure {
|
|
4
|
+
readonly ok: false;
|
|
5
|
+
readonly reason: CrawlerFailureReason;
|
|
6
|
+
readonly stdout: string;
|
|
7
|
+
readonly stderr: string;
|
|
8
|
+
readonly code: number | null;
|
|
9
|
+
}
|
|
10
|
+
export interface CrawlerHit {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly content: string;
|
|
13
|
+
readonly score: number;
|
|
14
|
+
readonly title?: string;
|
|
15
|
+
readonly hierarchy?: readonly string[];
|
|
16
|
+
readonly publishedAt?: number;
|
|
17
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
18
|
+
}
|
|
19
|
+
export interface CrawlerSyncOk {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
readonly count: number;
|
|
22
|
+
readonly stdout: string;
|
|
23
|
+
readonly stderr: string;
|
|
24
|
+
readonly code: number;
|
|
25
|
+
}
|
|
26
|
+
export interface CrawlerSearchOk {
|
|
27
|
+
readonly ok: true;
|
|
28
|
+
readonly hits: readonly CrawlerHit[];
|
|
29
|
+
readonly stdout: string;
|
|
30
|
+
readonly stderr: string;
|
|
31
|
+
readonly code: number;
|
|
32
|
+
}
|
|
33
|
+
export type CrawlerSyncResult = CrawlerSyncOk | CrawlerFailure;
|
|
34
|
+
export type CrawlerSearchResult = CrawlerSearchOk | CrawlerFailure;
|
|
35
|
+
export type CrawlerSearchOptions = RetrievalOptions;
|
|
36
|
+
export interface CrawlerCliOptions {
|
|
37
|
+
readonly binaryPath?: string;
|
|
38
|
+
readonly databasePath?: string;
|
|
39
|
+
readonly sourcePath?: string;
|
|
40
|
+
readonly configPath?: string;
|
|
41
|
+
readonly syncSource?: string;
|
|
42
|
+
readonly timeoutMs?: number;
|
|
43
|
+
readonly maxBufferBytes?: number;
|
|
44
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
45
|
+
}
|
|
46
|
+
export interface CrawlerProfile {
|
|
47
|
+
readonly binaryName: string;
|
|
48
|
+
readonly allowedEnvPrefixes: readonly string[];
|
|
49
|
+
readonly syncArgs: (options: CrawlerCliOptions) => readonly string[];
|
|
50
|
+
readonly searchArgs: (options: CrawlerCliOptions, query: string, topK: number) => readonly string[];
|
|
51
|
+
readonly parseSyncCount: (stdout: string) => number | undefined;
|
|
52
|
+
readonly parseHits: (stdout: string) => readonly CrawlerHit[] | undefined;
|
|
53
|
+
}
|
|
@@ -7,7 +7,7 @@ export { type CronParseResult, isDue, parseCronExpr } from "./polling.js";
|
|
|
7
7
|
export { DatasourceSkillRegistry, type RegisteredDatasourceSkill } from "./registry.js";
|
|
8
8
|
export { DatasourceResultFilter, type ResultsByMethod } from "./result-filter.js";
|
|
9
9
|
export { buildDatasourceChunkSource, buildDatasourceInstanceSource, DATASOURCE_CHUNKS_SEGMENT, datasourceSourceHasFragment, datasourceSourcePath, isDatasourceSource, matchesDatasourceScope, matchesVirtualPathScope, normalizeVirtualPath, } from "./scope.js";
|
|
10
|
-
export {
|
|
10
|
+
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";
|
|
11
11
|
export { BUILTIN_DATASOURCE_SKILL_NAMES, type BuildDatasourceSkillsResult, buildDatasourceSkills, type DatasourceSkillConfig, type DatasourcesConfig, } from "./skills/factory.js";
|
|
12
12
|
export { GDriveConnector, type GDriveConnectorOptions, GDriveSkill, type GDriveSkillOptions, } from "./skills/gdrive/index.js";
|
|
13
13
|
export { GitHubConnector, type GitHubConnectorOptions, GitHubSkill, type GitHubSkillOptions, } from "./skills/github/index.js";
|
|
@@ -15,9 +15,11 @@ export { GmailConnector, type GmailConnectorOptions, GmailSkill, type GmailSkill
|
|
|
15
15
|
export type { KatokFailureReason, KatokHit, KatokOptions, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSkillClient, KatokSkillOptions, } from "./skills/katok/index.js";
|
|
16
16
|
export { KatokBm25Method, KatokClient, KatokSemanticMethod, KatokSkill } from "./skills/katok/index.js";
|
|
17
17
|
export { MailExportConnector, type MailExportConnectorOptions, MailExportSkill, type MailExportSkillOptions, } from "./skills/mail-export/index.js";
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
18
|
+
export { NotcrawlClient, type NotcrawlOptions, NotionSkill, type NotionSkillOptions, } from "./skills/notion/index.js";
|
|
19
|
+
export { ObsidianBm25Method, ObsidianSemanticMethod, ObsidianSkill, type ObsidianSkillClient, type ObsidianSkillOptions, QmdClient, type QmdOptions, type QmdSearchHit, type QmdSearchMode, type QmdSearchResult, } from "./skills/obsidian/index.js";
|
|
20
20
|
export { RssConnector, type RssConnectorOptions, type RssFeedConfig, RssSkill, type RssSkillOptions, } from "./skills/rss/index.js";
|
|
21
|
-
export {
|
|
21
|
+
export { SlackSkill, type SlackSkillOptions, SlacrawlClient, type SlacrawlOptions, } from "./skills/slack/index.js";
|
|
22
22
|
export { SpotlightConnector, type SpotlightConnectorOptions, SpotlightSkill, type SpotlightSkillOptions, } from "./skills/spotlight/index.js";
|
|
23
|
+
export { TelecrawlClient, type TelecrawlOptions, TelecrawlSkill, type TelecrawlSkillOptions, } from "./skills/telecrawl/index.js";
|
|
24
|
+
export { WacrawlClient, type WacrawlOptions, WacrawlSkill, type WacrawlSkillOptions } from "./skills/wacrawl/index.js";
|
|
23
25
|
export type { DatasourceAccessible, DatasourceDiagnostic, DatasourceDiagnosticCode, DatasourceIndexFail, DatasourceIndexOk, DatasourceIndexResult, DatasourceInstance, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription, } from "./types.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DiscrawlDoctorResult, DiscrawlEmbedResult, DiscrawlOptions, DiscrawlSearchMode, DiscrawlSearchOptions, DiscrawlSearchResult, DiscrawlStatusResult, DiscrawlSyncResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Thin external `discrawl` CLI wrapper. Every method spawns the `discrawl`
|
|
4
|
+
* binary as a child process, parses JSON from stdout, and returns a
|
|
5
|
+
* discriminated ok/fail union. No method throws for expected failures (missing
|
|
6
|
+
* binary, rejected user token, CLI nonzero exit, timeout, oversized output, or
|
|
7
|
+
* invalid JSON). The client never opens the Discord archive database directly.
|
|
8
|
+
*
|
|
9
|
+
* `--json` is a *global* discrawl flag and must precede the subcommand;
|
|
10
|
+
* `discrawl search --json` is rejected by the CLI as an unknown flag.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DiscrawlClient {
|
|
13
|
+
private readonly options;
|
|
14
|
+
constructor(options?: DiscrawlOptions);
|
|
15
|
+
doctor(signal?: AbortSignal): Promise<DiscrawlDoctorResult>;
|
|
16
|
+
status(signal?: AbortSignal): Promise<DiscrawlStatusResult>;
|
|
17
|
+
sync(signal?: AbortSignal): Promise<DiscrawlSyncResult>;
|
|
18
|
+
embed(limit?: number, signal?: AbortSignal): Promise<DiscrawlEmbedResult>;
|
|
19
|
+
search(mode: DiscrawlSearchMode, query: string, options?: DiscrawlSearchOptions): Promise<DiscrawlSearchResult>;
|
|
20
|
+
private runJson;
|
|
21
|
+
private run;
|
|
22
|
+
}
|
|
23
|
+
export declare function discrawlWorkspace(options: DiscrawlOptions): string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DiscrawlOptions } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates or updates AutoRAG's workspace-local discrawl config.
|
|
4
|
+
*
|
|
5
|
+
* Only the fields AutoRAG owns are changed: the workspace database path and
|
|
6
|
+
* embedding enablement/provider/model. Existing operator settings such as
|
|
7
|
+
* guilds, source filters, sync policy, and search mode are preserved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ensureManagedDiscrawlConfig(configPath: string, databasePath: string, options: DiscrawlOptions): void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DiscrawlClient, discrawlWorkspace } from "./client.js";
|
|
2
|
+
export { DiscrawlFtsMethod, DiscrawlHybridMethod, type DiscrawlMethodOptions, type DiscrawlSearchClient, DiscrawlSemanticMethod, } from "./methods.js";
|
|
3
|
+
export { DISCRAWL_SOURCE_KIND, discrawlConfigPath, discrawlDatabasePath, discrawlDatasourceRoot, discrawlSourcePath, parseDiscrawlSourcePath, } from "./paths.js";
|
|
4
|
+
export { DiscrawlSkill, type DiscrawlSkillClient, type DiscrawlSkillOptions } from "./skill.js";
|
|
5
|
+
export { DEFAULT_DISCRAWL_BINARY, DEFAULT_DISCRAWL_EMBEDDING_MODEL, DEFAULT_DISCRAWL_EMBEDDING_PROVIDER, DEFAULT_DISCRAWL_MAX_BUFFER_BYTES, DEFAULT_DISCRAWL_MODE, DEFAULT_DISCRAWL_SOURCE, DEFAULT_DISCRAWL_TIMEOUT_MS, type DiscrawlDoctorInfo, type DiscrawlDoctorResult, type DiscrawlEmbedInfo, type DiscrawlEmbedResult, type DiscrawlFailure, type DiscrawlFailureReason, type DiscrawlMessage, type DiscrawlOptions, type DiscrawlSearchHit, type DiscrawlSearchMode, type DiscrawlSearchOptions, type DiscrawlSearchResult, type DiscrawlSourceKind, type DiscrawlStatusInfo, type DiscrawlStatusResult, type DiscrawlSyncInfo, type DiscrawlSyncResult, ENGLISH_ONLY_EMBEDDING_MODELS, } from "./types.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../../../retrieval/types.js";
|
|
2
|
+
import type { DiscrawlSearchMode, DiscrawlSearchOptions, DiscrawlSearchResult } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Narrow client surface required by the Discord retrieval methods. The real
|
|
5
|
+
* {@link DiscrawlClient} satisfies this structurally; tests may stub it.
|
|
6
|
+
*/
|
|
7
|
+
export interface DiscrawlSearchClient {
|
|
8
|
+
search(mode: DiscrawlSearchMode, query: string, options?: DiscrawlSearchOptions): Promise<DiscrawlSearchResult>;
|
|
9
|
+
}
|
|
10
|
+
export interface DiscrawlMethodOptions {
|
|
11
|
+
readonly client: DiscrawlSearchClient;
|
|
12
|
+
readonly instanceId: string;
|
|
13
|
+
readonly tags?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Lexical (SQLite FTS5) retrieval over a Discord archive via the external
|
|
17
|
+
* `discrawl` CLI. All client failures collapse to an empty result set;
|
|
18
|
+
* retrieval never throws.
|
|
19
|
+
*/
|
|
20
|
+
export declare class DiscrawlFtsMethod implements RetrievalMethod {
|
|
21
|
+
private readonly client;
|
|
22
|
+
private readonly instanceId;
|
|
23
|
+
private readonly tags;
|
|
24
|
+
constructor(options: DiscrawlMethodOptions);
|
|
25
|
+
describe(): RetrievalMethodDescriptor;
|
|
26
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Semantic (vector) retrieval over a Discord archive via the external
|
|
30
|
+
* `discrawl` CLI. Requires a configured embedding provider and a completed
|
|
31
|
+
* `discrawl embed` pass; when either is missing the CLI exits non-zero and
|
|
32
|
+
* this method returns no results rather than throwing.
|
|
33
|
+
*/
|
|
34
|
+
export declare class DiscrawlSemanticMethod implements RetrievalMethod {
|
|
35
|
+
private readonly client;
|
|
36
|
+
private readonly instanceId;
|
|
37
|
+
private readonly tags;
|
|
38
|
+
constructor(options: DiscrawlMethodOptions);
|
|
39
|
+
describe(): RetrievalMethodDescriptor;
|
|
40
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Hybrid retrieval (FTS5 + semantic, deduplicated by message id). This is the
|
|
44
|
+
* preferred Discord method: discrawl's FTS index welds words across newlines
|
|
45
|
+
* into one token, so semantic recall is what covers terms FTS cannot reach.
|
|
46
|
+
* See AutoRAG issue #1413.
|
|
47
|
+
*/
|
|
48
|
+
export declare class DiscrawlHybridMethod implements RetrievalMethod {
|
|
49
|
+
private readonly client;
|
|
50
|
+
private readonly instanceId;
|
|
51
|
+
private readonly tags;
|
|
52
|
+
constructor(options: DiscrawlMethodOptions);
|
|
53
|
+
describe(): RetrievalMethodDescriptor;
|
|
54
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const AUTORAG_DIRNAME = ".autorag";
|
|
2
|
+
export declare const DATASOURCES_DIRNAME = "datasources";
|
|
3
|
+
export declare const DISCRAWL_DATASOURCE_DIRNAME = "discrawl";
|
|
4
|
+
/** Logical datasource kind for source identifiers. */
|
|
5
|
+
export declare const DISCRAWL_SOURCE_KIND: "discord";
|
|
6
|
+
/**
|
|
7
|
+
* Root directory for discrawl-managed state under a workspace. This is where
|
|
8
|
+
* the external `discrawl` CLI stores its SQLite archive, FTS index, and
|
|
9
|
+
* message vectors.
|
|
10
|
+
*/
|
|
11
|
+
export declare function discrawlDatasourceRoot(workspaceRoot: string): string;
|
|
12
|
+
/** Config file discrawl reads for embedding provider/model settings. */
|
|
13
|
+
export declare function discrawlConfigPath(workspaceRoot: string): string;
|
|
14
|
+
/** SQLite archive maintained by the discrawl CLI. */
|
|
15
|
+
export declare function discrawlDatabasePath(workspaceRoot: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Builds the slash-hierarchical source identifier for a single archived
|
|
18
|
+
* message. Discord message ids are stable snowflakes, so these sources stay
|
|
19
|
+
* traceable across re-syncs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function discrawlSourcePath(instanceId: string, messageId: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Parses a discrawl source identifier back into its components. Returns
|
|
24
|
+
* `undefined` for malformed or non-discord sources so deny decisions stay
|
|
25
|
+
* explicit rather than undefined-as-deny.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseDiscrawlSourcePath(source: string): {
|
|
28
|
+
readonly instanceId: string;
|
|
29
|
+
readonly messageId: string;
|
|
30
|
+
} | undefined;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RetrievalMethod } from "../../../retrieval/types.js";
|
|
2
|
+
import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
|
|
3
|
+
import { type DiscrawlSearchClient } from "./methods.js";
|
|
4
|
+
import type { DiscrawlDoctorResult, DiscrawlEmbedResult, DiscrawlSearchMode, DiscrawlSyncResult } from "./types.js";
|
|
5
|
+
export interface DiscrawlSkillClient extends DiscrawlSearchClient {
|
|
6
|
+
doctor(): Promise<DiscrawlDoctorResult>;
|
|
7
|
+
sync(): Promise<DiscrawlSyncResult>;
|
|
8
|
+
embed(limit?: number): Promise<DiscrawlEmbedResult>;
|
|
9
|
+
}
|
|
10
|
+
export interface DiscrawlSkillOptions {
|
|
11
|
+
readonly client: DiscrawlSkillClient;
|
|
12
|
+
readonly instanceId?: string;
|
|
13
|
+
readonly instances?: readonly string[];
|
|
14
|
+
readonly pollingIntervalMs?: number;
|
|
15
|
+
readonly tags?: readonly string[];
|
|
16
|
+
readonly lastIndexedAt?: number;
|
|
17
|
+
readonly embeddingModel?: string;
|
|
18
|
+
readonly defaultMode?: DiscrawlSearchMode;
|
|
19
|
+
/** Max messages embedded per index pass. Undefined drains the whole backlog. */
|
|
20
|
+
readonly embedLimit?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Discord datasource skill backed by the external `discrawl` CLI.
|
|
24
|
+
*
|
|
25
|
+
* Mirrors the katok model: the CLI owns the archive, the FTS5 index, and the
|
|
26
|
+
* vector index; AutoRAG only spawns it and maps results. AutoRAG never calls
|
|
27
|
+
* the Discord API itself and never reads the Discord Desktop cache directly.
|
|
28
|
+
*
|
|
29
|
+
* `index()` runs the CLI's two-phase pipeline — `sync` (incremental, cursor
|
|
30
|
+
* based) then `embed` (drains the embedding queue) — so a poll costs work
|
|
31
|
+
* proportional to what changed rather than to archive size.
|
|
32
|
+
*/
|
|
33
|
+
export declare class DiscrawlSkill implements DatasourceSkill {
|
|
34
|
+
private readonly client;
|
|
35
|
+
private readonly instanceId;
|
|
36
|
+
private readonly instances;
|
|
37
|
+
private readonly pollingIntervalMs;
|
|
38
|
+
private readonly tags;
|
|
39
|
+
private readonly embeddingModel;
|
|
40
|
+
private readonly defaultMode;
|
|
41
|
+
private readonly embedLimit;
|
|
42
|
+
private lastIndexedAt;
|
|
43
|
+
constructor(options: DiscrawlSkillOptions);
|
|
44
|
+
describe(): DatasourceSkillDescriptor;
|
|
45
|
+
polling(): PollingMetadata;
|
|
46
|
+
index(): Promise<DatasourceIndexResult>;
|
|
47
|
+
retrievalMethods(): readonly RetrievalMethod[];
|
|
48
|
+
describeSources(): readonly SourceDescription[];
|
|
49
|
+
skillManifest(): DatasourceSkillManifest;
|
|
50
|
+
private runEmbed;
|
|
51
|
+
/**
|
|
52
|
+
* English-only embedders map non-English text into one narrow similarity
|
|
53
|
+
* band, so semantic search degrades to noise without ever erroring. Surfacing
|
|
54
|
+
* it as a diagnostic keeps that failure visible. See AutoRAG issue #1414.
|
|
55
|
+
*/
|
|
56
|
+
private englishOnlyModelDiagnostic;
|
|
57
|
+
private fail;
|
|
58
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { RetrievalOptions } from "../../../retrieval/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Search modes accepted by the external `discrawl search --mode` flag.
|
|
4
|
+
*
|
|
5
|
+
* - `fts` — SQLite FTS5 lexical ranking over archived messages.
|
|
6
|
+
* - `semantic` — dense vector similarity over locally stored message vectors.
|
|
7
|
+
* - `hybrid` — runs both, deduplicates by message id, falls back to FTS when
|
|
8
|
+
* semantic is unavailable.
|
|
9
|
+
*/
|
|
10
|
+
export type DiscrawlSearchMode = "fts" | "semantic" | "hybrid";
|
|
11
|
+
/**
|
|
12
|
+
* Where the `discrawl` CLI reads Discord data from.
|
|
13
|
+
*
|
|
14
|
+
* - `wiretap` — the local Discord Desktop cache. Requires no token and issues
|
|
15
|
+
* no Discord API calls; it reads only files Discord already
|
|
16
|
+
* wrote to disk. Includes classifiable direct messages.
|
|
17
|
+
* - `discord` — the Discord bot API using a server-configured bot token. This
|
|
18
|
+
* is the ToS-sanctioned automation path (a bot token identifies
|
|
19
|
+
* an OAuth2 application, not a human user).
|
|
20
|
+
* - `both` — bot API plus desktop cache.
|
|
21
|
+
*
|
|
22
|
+
* AutoRAG never uses a Discord *user* token: automating a user account is
|
|
23
|
+
* prohibited by Discord's Community Guidelines and can get the account
|
|
24
|
+
* terminated.
|
|
25
|
+
*/
|
|
26
|
+
export type DiscrawlSourceKind = "wiretap" | "discord" | "both";
|
|
27
|
+
/**
|
|
28
|
+
* Embedding models known to be English-only. Selecting one for a non-English
|
|
29
|
+
* archive silently degrades semantic search to noise rather than failing, so
|
|
30
|
+
* the skill emits a diagnostic instead of staying quiet.
|
|
31
|
+
*
|
|
32
|
+
* Measured on a real Korean archive: unrelated `nomic-embed-text` Korean
|
|
33
|
+
* sentence pairs score 0.65-0.82 cosine (vs 0.30-0.46 for English), i.e. the
|
|
34
|
+
* embedding space collapses and top-k ranking becomes random.
|
|
35
|
+
*
|
|
36
|
+
* See AutoRAG issue #1414.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ENGLISH_ONLY_EMBEDDING_MODELS: ReadonlySet<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Default embedding model AutoRAG configures for workspace-managed discrawl
|
|
41
|
+
* configs. `embeddinggemma`
|
|
42
|
+
* (Gemma 3 300M, 768 dimensions) covers 100+ languages and matches the
|
|
43
|
+
* EmbeddingGemma embedder katok uses for KakaoTalk, so every CLI-backed
|
|
44
|
+
* datasource shares one local embedding model (served through Ollama).
|
|
45
|
+
*/
|
|
46
|
+
export declare const DEFAULT_DISCRAWL_EMBEDDING_MODEL = "embeddinggemma";
|
|
47
|
+
export declare const DEFAULT_DISCRAWL_EMBEDDING_PROVIDER = "ollama";
|
|
48
|
+
/**
|
|
49
|
+
* Configuration for the discrawl client. All fields optional; defaults mirror
|
|
50
|
+
* the katok client. The client spawns the `discrawl` binary as a child process
|
|
51
|
+
* — it never opens the Discord archive database directly.
|
|
52
|
+
*/
|
|
53
|
+
export interface DiscrawlOptions {
|
|
54
|
+
/** Explicit path to the `discrawl` binary. Defaults to a bare PATH lookup. */
|
|
55
|
+
readonly binaryPath?: string;
|
|
56
|
+
/** Spawn timeout in milliseconds. Default 30_000 (sync/embed are slow). */
|
|
57
|
+
readonly timeoutMs?: number;
|
|
58
|
+
/** Max stdout/stderr bytes retained. Default 1_048_576 (1 MiB). */
|
|
59
|
+
readonly maxBufferBytes?: number;
|
|
60
|
+
/** Archive source for the CLI. Default `wiretap` (no token required). */
|
|
61
|
+
readonly source?: DiscrawlSourceKind;
|
|
62
|
+
/**
|
|
63
|
+
* Explicit operator-owned discrawl config file passed as `--config`.
|
|
64
|
+
* AutoRAG never rewrites an explicit config.
|
|
65
|
+
*/
|
|
66
|
+
readonly configPath?: string;
|
|
67
|
+
/** Workspace root used to compute the default discrawl workspace path. */
|
|
68
|
+
readonly root?: string;
|
|
69
|
+
/** Explicit workspace directory overriding the computed default. */
|
|
70
|
+
readonly workspacePath?: string;
|
|
71
|
+
/** Restrict search and sync to one guild id. */
|
|
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
|
+
*/
|
|
77
|
+
readonly embeddingProvider?: string;
|
|
78
|
+
/**
|
|
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.
|
|
82
|
+
*/
|
|
83
|
+
readonly embeddingModel?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Default search mode. Defaults to `hybrid` so semantic retrieval covers
|
|
86
|
+
* terms FTS cannot reach: discrawl strips newlines without substituting a
|
|
87
|
+
* space, welding words across line breaks into a single unsearchable token
|
|
88
|
+
* (measured at ~47% of post-newline words on a real archive). See AutoRAG
|
|
89
|
+
* issue #1413.
|
|
90
|
+
*/
|
|
91
|
+
readonly defaultMode?: DiscrawlSearchMode;
|
|
92
|
+
/** Environment overrides merged on top of `process.env` for the child. */
|
|
93
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
94
|
+
}
|
|
95
|
+
export declare const DEFAULT_DISCRAWL_BINARY = "discrawl";
|
|
96
|
+
export declare const DEFAULT_DISCRAWL_TIMEOUT_MS = 30000;
|
|
97
|
+
export declare const DEFAULT_DISCRAWL_MAX_BUFFER_BYTES = 1048576;
|
|
98
|
+
export declare const DEFAULT_DISCRAWL_SOURCE: DiscrawlSourceKind;
|
|
99
|
+
export declare const DEFAULT_DISCRAWL_MODE: DiscrawlSearchMode;
|
|
100
|
+
/**
|
|
101
|
+
* Reasons a discrawl CLI invocation can fail. The client never throws for
|
|
102
|
+
* these — every method returns a discriminated union with `ok: false`.
|
|
103
|
+
*/
|
|
104
|
+
export type DiscrawlFailureReason = "binary-missing" | "user-token-rejected" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-json" | "invalid-shape";
|
|
105
|
+
/** Common failure payload shared by every method result union. */
|
|
106
|
+
export interface DiscrawlFailure {
|
|
107
|
+
readonly ok: false;
|
|
108
|
+
readonly reason: DiscrawlFailureReason;
|
|
109
|
+
readonly stdout: string;
|
|
110
|
+
readonly stderr: string;
|
|
111
|
+
readonly code: number | null;
|
|
112
|
+
/**
|
|
113
|
+
* The offending environment key when `reason === "user-token-rejected"`.
|
|
114
|
+
* A config key name (never a path, never the key's value).
|
|
115
|
+
*/
|
|
116
|
+
readonly violatingKey?: string;
|
|
117
|
+
readonly hits?: readonly unknown[];
|
|
118
|
+
}
|
|
119
|
+
/** A single archived Discord message returned by the discrawl CLI. */
|
|
120
|
+
export interface DiscrawlMessage {
|
|
121
|
+
readonly messageId: string;
|
|
122
|
+
readonly content: string;
|
|
123
|
+
readonly channelId?: string;
|
|
124
|
+
readonly channelName?: string;
|
|
125
|
+
readonly guildId?: string;
|
|
126
|
+
readonly guildName?: string;
|
|
127
|
+
readonly authorName?: string;
|
|
128
|
+
readonly timestamp?: string;
|
|
129
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
130
|
+
}
|
|
131
|
+
/** A scored search hit. */
|
|
132
|
+
export interface DiscrawlSearchHit extends DiscrawlMessage {
|
|
133
|
+
readonly score: number;
|
|
134
|
+
}
|
|
135
|
+
/** Result of `discrawl status`. */
|
|
136
|
+
export interface DiscrawlStatusInfo {
|
|
137
|
+
readonly messages: number;
|
|
138
|
+
readonly channels: number;
|
|
139
|
+
readonly guilds: number;
|
|
140
|
+
readonly databasePath?: string;
|
|
141
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
142
|
+
}
|
|
143
|
+
/** Result of `discrawl doctor`. */
|
|
144
|
+
export interface DiscrawlDoctorInfo {
|
|
145
|
+
readonly ready: boolean;
|
|
146
|
+
readonly configOk: boolean;
|
|
147
|
+
readonly databaseOk: boolean;
|
|
148
|
+
readonly ftsOk: boolean;
|
|
149
|
+
readonly embeddingsOk: boolean;
|
|
150
|
+
readonly embeddingModel?: string;
|
|
151
|
+
readonly embeddingProvider?: string;
|
|
152
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
153
|
+
}
|
|
154
|
+
/** Result of `discrawl sync` / `discrawl wiretap`. */
|
|
155
|
+
export interface DiscrawlSyncInfo {
|
|
156
|
+
readonly messages: number;
|
|
157
|
+
readonly guilds?: number;
|
|
158
|
+
readonly channels?: number;
|
|
159
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
160
|
+
}
|
|
161
|
+
/** Result of `discrawl embed`. */
|
|
162
|
+
export interface DiscrawlEmbedInfo {
|
|
163
|
+
readonly processed: number;
|
|
164
|
+
readonly succeeded: number;
|
|
165
|
+
readonly failed: number;
|
|
166
|
+
readonly remainingBacklog: number;
|
|
167
|
+
readonly model?: string;
|
|
168
|
+
readonly provider?: string;
|
|
169
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
170
|
+
}
|
|
171
|
+
/** Discriminated ok-success shape carrying typed `data`. */
|
|
172
|
+
export interface DiscrawlOk<T> {
|
|
173
|
+
readonly ok: true;
|
|
174
|
+
readonly data: T;
|
|
175
|
+
readonly stdout: string;
|
|
176
|
+
readonly stderr: string;
|
|
177
|
+
readonly code: number;
|
|
178
|
+
}
|
|
179
|
+
export interface DiscrawlSearchOk {
|
|
180
|
+
readonly ok: true;
|
|
181
|
+
readonly hits: readonly DiscrawlSearchHit[];
|
|
182
|
+
readonly stdout: string;
|
|
183
|
+
readonly stderr: string;
|
|
184
|
+
readonly code: number;
|
|
185
|
+
readonly data: {
|
|
186
|
+
readonly hits: readonly DiscrawlSearchHit[];
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export type DiscrawlDoctorResult = DiscrawlOk<DiscrawlDoctorInfo> | DiscrawlFailure;
|
|
190
|
+
export type DiscrawlStatusResult = DiscrawlOk<DiscrawlStatusInfo> | DiscrawlFailure;
|
|
191
|
+
export type DiscrawlSyncResult = DiscrawlOk<DiscrawlSyncInfo> | DiscrawlFailure;
|
|
192
|
+
export type DiscrawlEmbedResult = DiscrawlOk<DiscrawlEmbedInfo> | DiscrawlFailure;
|
|
193
|
+
export type DiscrawlSearchResult = DiscrawlSearchOk | DiscrawlFailure;
|
|
194
|
+
/**
|
|
195
|
+
* Search-specific options. Reuses the shared {@link RetrievalOptions} so the
|
|
196
|
+
* retrieval methods can pass their options straight through.
|
|
197
|
+
*/
|
|
198
|
+
export type DiscrawlSearchOptions = RetrievalOptions;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CrawlerCliClient } from "../../crawler-client.js";
|
|
2
|
+
import { CrawlerDatasourceSkill, type CrawlerDatasourceSkillOptions, type CrawlerSkillClient } from "../../crawler-skill.js";
|
|
3
|
+
import type { CrawlerCliOptions } from "../../crawler-types.js";
|
|
4
|
+
export interface NotcrawlOptions extends CrawlerCliOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class NotcrawlClient extends CrawlerCliClient {
|
|
7
|
+
constructor(options?: NotcrawlOptions);
|
|
8
|
+
}
|
|
9
|
+
export interface NotionSkillOptions extends Omit<CrawlerDatasourceSkillOptions, "client"> {
|
|
10
|
+
readonly client?: CrawlerSkillClient;
|
|
11
|
+
readonly connectorOptions?: NotcrawlOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare class NotionSkill extends CrawlerDatasourceSkill {
|
|
14
|
+
constructor(options?: NotionSkillOptions);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QmdEmbedResult, QmdEnsureResult, QmdOptions, QmdSearchMode, QmdSearchOptions, QmdSearchResult, QmdUpdateResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Thin external `qmd` CLI wrapper for Obsidian vault indexing/search.
|
|
4
|
+
* Every method spawns the `qmd` binary, never throws for expected failures,
|
|
5
|
+
* and isolates config/cache under the AutoRAG workspace.
|
|
6
|
+
*/
|
|
7
|
+
export declare class QmdClient {
|
|
8
|
+
private readonly options;
|
|
9
|
+
constructor(options?: QmdOptions);
|
|
10
|
+
ensureCollection(signal?: AbortSignal): Promise<QmdEnsureResult>;
|
|
11
|
+
update(signal?: AbortSignal): Promise<QmdUpdateResult>;
|
|
12
|
+
embed(signal?: AbortSignal): Promise<QmdEmbedResult>;
|
|
13
|
+
search(mode: QmdSearchMode, query: string, options?: QmdSearchOptions): Promise<QmdSearchResult>;
|
|
14
|
+
private run;
|
|
15
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { QmdClient } from "./client.js";
|
|
2
|
+
export { ObsidianBm25Method, type ObsidianMethodOptions, type ObsidianSearchClient, ObsidianSemanticMethod, } from "./methods.js";
|
|
3
|
+
export { obsidianDatasourceRoot, obsidianQmdCacheDir, obsidianQmdConfigDir, obsidianSourcePath, parseObsidianSourcePath, stripEdgeDashes, toQmdCollectionName, } from "./paths.js";
|
|
4
|
+
export { ObsidianSkill, type ObsidianSkillClient, type ObsidianSkillOptions } from "./skill.js";
|
|
5
|
+
export type { QmdEmbedResult, QmdEnsureResult, QmdFailureReason, QmdOptions, QmdSearchHit, QmdSearchMode, QmdSearchOptions, QmdSearchResult, QmdUpdateResult, } from "./types.js";
|
|
6
|
+
export { DEFAULT_QMD_BINARY, DEFAULT_QMD_MAX_BUFFER_BYTES, DEFAULT_QMD_TIMEOUT_MS, } from "./types.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../../../retrieval/types.js";
|
|
2
|
+
import type { QmdSearchMode, QmdSearchOptions, QmdSearchResult } from "./types.js";
|
|
3
|
+
export interface ObsidianSearchClient {
|
|
4
|
+
search(mode: QmdSearchMode, query: string, options?: QmdSearchOptions): Promise<QmdSearchResult>;
|
|
5
|
+
}
|
|
6
|
+
export interface ObsidianMethodOptions {
|
|
7
|
+
readonly client: ObsidianSearchClient;
|
|
8
|
+
readonly instanceId: string;
|
|
9
|
+
readonly tags?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export declare class ObsidianBm25Method implements RetrievalMethod {
|
|
12
|
+
private readonly client;
|
|
13
|
+
private readonly instanceId;
|
|
14
|
+
private readonly tags;
|
|
15
|
+
constructor(options: ObsidianMethodOptions);
|
|
16
|
+
describe(): RetrievalMethodDescriptor;
|
|
17
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
18
|
+
}
|
|
19
|
+
export declare class ObsidianSemanticMethod implements RetrievalMethod {
|
|
20
|
+
private readonly client;
|
|
21
|
+
private readonly instanceId;
|
|
22
|
+
private readonly tags;
|
|
23
|
+
constructor(options: ObsidianMethodOptions);
|
|
24
|
+
describe(): RetrievalMethodDescriptor;
|
|
25
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path helpers for the Obsidian (`qmd`) datasource skill.
|
|
3
|
+
*
|
|
4
|
+
* All AutoRAG-managed state lives under
|
|
5
|
+
* `<workspaceRoot>/.autorag/datasources/obsidian/<instanceId>/`. The external
|
|
6
|
+
* `qmd` CLI is pointed at isolated config/cache dirs so multiple workspaces
|
|
7
|
+
* never share an index. Callers surface opaque slash-hierarchical sources of
|
|
8
|
+
* the form `/obsidian/<instance-id>/chunks/<chunk-id>`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const AUTORAG_DIRNAME = ".autorag";
|
|
11
|
+
export declare const DATASOURCES_DIRNAME = "datasources";
|
|
12
|
+
export declare const OBSIDIAN_DATASOURCE_DIRNAME = "obsidian";
|
|
13
|
+
export declare const OBSIDIAN_SOURCE_KIND: "obsidian";
|
|
14
|
+
export declare function obsidianDatasourceRoot(workspaceRoot: string, instanceId: string): string;
|
|
15
|
+
/** Directory passed to `QMD_CONFIG_DIR` (holds `index.yml`). */
|
|
16
|
+
export declare function obsidianQmdConfigDir(workspaceRoot: string, instanceId: string): string;
|
|
17
|
+
/** Directory passed to `XDG_CACHE_HOME` (holds `qmd/index.sqlite`). */
|
|
18
|
+
export declare function obsidianQmdCacheDir(workspaceRoot: string, instanceId: string): string;
|
|
19
|
+
export declare function obsidianSourcePath(instanceId: string, chunkId: string): string;
|
|
20
|
+
export declare function parseObsidianSourcePath(source: string): {
|
|
21
|
+
readonly instanceId: string;
|
|
22
|
+
readonly chunkId: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
/** Strip leading and trailing ASCII dashes without a quadratic regex. */
|
|
25
|
+
export declare function stripEdgeDashes(value: string): string;
|
|
26
|
+
/** Sanitize an instance id into a qmd collection name. */
|
|
27
|
+
export declare function toQmdCollectionName(instanceId: string): string;
|