@autorag/librarian 2.13.1 → 2.13.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 (43) hide show
  1. package/NOTICE +9 -9
  2. package/README.md +11 -8
  3. package/dist/agent/agent.d.ts +12 -6
  4. package/dist/agent/refresh-progress.d.ts +4 -0
  5. package/dist/agent/search-documents.d.ts +3 -1
  6. package/dist/agent/search-progress.d.ts +5 -0
  7. package/dist/cli/index.js +2502 -1567
  8. package/dist/cloud/context-overflow.d.ts +29 -0
  9. package/dist/convert/installer.d.ts +1 -1
  10. package/dist/core.js +2427 -1500
  11. package/dist/datasource/connector-skill.d.ts +1 -2
  12. package/dist/datasource/connector.d.ts +2 -3
  13. package/dist/datasource/index.d.ts +1 -2
  14. package/dist/datasource/skills/hister/client.d.ts +5 -5
  15. package/dist/datasource/skills/hister/setup.d.ts +5 -0
  16. package/dist/datasource/skills/mailcrawl/types.d.ts +18 -0
  17. package/dist/datasource/skills/spotlight/connector.d.ts +16 -24
  18. package/dist/datasource/skills/spotlight/index.d.ts +2 -2
  19. package/dist/datasource/skills/spotlight/skill.d.ts +26 -13
  20. package/dist/index.js +2489 -1561
  21. package/dist/mcp/index.js +2484 -1550
  22. package/dist/minsync/client.d.ts +2 -2
  23. package/dist/minsync/index.d.ts +1 -1
  24. package/dist/minsync/installer.d.ts +1 -1
  25. package/dist/minsync/method.d.ts +3 -3
  26. package/dist/minsync/process.d.ts +1 -0
  27. package/dist/minsync/stage.d.ts +361 -0
  28. package/dist/minsync/types.d.ts +4 -0
  29. package/dist/minsync/workspace.d.ts +2 -1
  30. package/dist/mirror/index-store.d.ts +16 -15
  31. package/dist/mirror/index.d.ts +2 -2
  32. package/dist/mirror/paths.d.ts +0 -2
  33. package/dist/mirror/sync.d.ts +6 -15
  34. package/dist/parser/types.d.ts +2 -2
  35. package/dist/process/lifecycle.d.ts +10 -0
  36. package/dist/profiles.js +2454 -1527
  37. package/dist/retrieval/scope.d.ts +1 -1
  38. package/package.json +14 -15
  39. package/skills/autorag-lite-setup/SKILL.md +3 -3
  40. package/skills/autorag-setup/SKILL.md +8 -8
  41. package/dist/datasource/skills/mail-export/connector.d.ts +0 -21
  42. package/dist/datasource/skills/mail-export/index.d.ts +0 -2
  43. package/dist/datasource/skills/mail-export/skill.d.ts +0 -20
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Shared {@link DatasourceSkill} implementation for connector-backed
3
- * datasources (Slack, Discord, Notion, GitHub, Google Drive,
4
- * local mail exports, RSS/news).
3
+ * datasources (GitHub, cloud drives, RSS/news, Spotlight).
5
4
  *
6
5
  * Composition: a trusted {@link DatasourceConnector} fetches documents, a
7
6
  * {@link DatasourceChunkStore} persists and lexically indexes them, and this
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Connector contract shared by the built-in datasource skills (Slack, Discord,
3
- * Notion, GitHub, Google Drive, local mail exports,
4
- * RSS/news).
2
+ * Connector contract shared by the built-in datasource skills (GitHub,
3
+ * cloud drives, RSS/news, Spotlight).
5
4
  *
6
5
  * A *connector* is the trusted, server-configured bridge to one external
7
6
  * system. It fetches documents for indexing and NEVER throws — every failure
@@ -14,13 +14,12 @@ export { HISTER_SKILL_TYPE, HisterClient, type HisterClientOptions, HisterSkill,
14
14
  export { LarkClient, type LarkClientOptions, LarkSkill, type LarkSkillOptions } from "./skills/lark/index.js";
15
15
  export type { LazykatokFailureReason, LazykatokHit, LazykatokOptions, LazykatokSearchMode, LazykatokSearchOptions, LazykatokSearchResult, LazykatokSkillClient, LazykatokSkillOptions, } from "./skills/lazykatok/index.js";
16
16
  export { LazykatokBm25Method, LazykatokClient, LazykatokHybridMethod, LazykatokSkill, } from "./skills/lazykatok/index.js";
17
- export { MailExportConnector, type MailExportConnectorOptions, MailExportSkill, type MailExportSkillOptions, } from "./skills/mail-export/index.js";
18
17
  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";
19
18
  export { NotcrawlClient, type NotcrawlOptions, NotionSkill, type NotionSkillOptions, } from "./skills/notion/index.js";
20
19
  export { ObsidianBm25Method, type ObsidianMethodOptions, ObsidianSemanticMethod, ObsidianSkill, type ObsidianSkillOptions, } from "./skills/obsidian/index.js";
21
20
  export { RssConnector, type RssConnectorOptions, type RssFeedConfig, RssSkill, type RssSkillOptions, } from "./skills/rss/index.js";
22
21
  export { SlackSkill, type SlackSkillOptions, SlacrawlClient, type SlacrawlOptions, } from "./skills/slack/index.js";
23
- export { SpotlightConnector, type SpotlightConnectorOptions, SpotlightSkill, type SpotlightSkillOptions, } from "./skills/spotlight/index.js";
22
+ export { SpotlightConnector, type SpotlightConnectorFailure, type SpotlightConnectorOptions, type SpotlightConnectorResult, SpotlightSkill, type SpotlightSkillOptions, } from "./skills/spotlight/index.js";
24
23
  export { TelecrawlClient, type TelecrawlOptions, TelecrawlSkill, type TelecrawlSkillOptions, } from "./skills/telecrawl/index.js";
25
24
  export { WacrawlClient, type WacrawlOptions, WacrawlSkill, type WacrawlSkillOptions } from "./skills/wacrawl/index.js";
26
25
  export type { DatasourceDiagnostic, DatasourceDiagnosticCode, DatasourceIndexFail, DatasourceIndexOk, DatasourceIndexOptions, DatasourceIndexResult, DatasourceInstance, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription, } from "./types.js";
@@ -69,11 +69,11 @@ export declare class HisterClient {
69
69
  * Wrap a free-text question as a Hister query confined to web pages.
70
70
  *
71
71
  * Hister ANDs bare terms, so a natural-language question would match almost nothing. Plain words become one
72
- * alternation group `(a|b|c)`. That pipe is Hister's only OR: the word `OR` is not an operator there, it is searched
73
- * as the literal English word, which matches most English pages. Hister's own syntax (quoted phrases,
74
- * `field:value`, wildcards, negation) passes through untouched, and a query using any of it is sent with its plain
75
- * words ANDed, exactly as written. A `sort:` directive is hoisted out of the group because Hister only honours it at
76
- * the top level.
72
+ * alternation group `(a|b|c)`, while uppercase `AND`/`OR`/`NOT` tokens in natural-language questions are stripped by
73
+ * {@link normalizeTerm} so Hister 0.21+'s boolean operator parser never rejects casual English phrasing. Hister's own
74
+ * syntax (quoted phrases, `field:value`, wildcards, negation) passes through untouched, and a query using any of it is
75
+ * sent with its plain words ANDed, exactly as written. A `sort:` directive is hoisted out of the group because Hister
76
+ * only honours it at the top level.
77
77
  */
78
78
  export declare function buildWebQuery(question: string, domain?: string): string | undefined;
79
79
  /** Hister snippets carry `<mark>` highlights and HTML entities; the model reads plain text. */
@@ -41,6 +41,11 @@ export interface HisterServiceDeps {
41
41
  readonly semanticEnabled?: boolean;
42
42
  readonly reason?: string;
43
43
  }>;
44
+ /** Reload a running Hister server's config (`hister reload`, v0.21.0+). Preferred over restarting the service. */
45
+ readonly reload?: (baseUrl: string) => Promise<{
46
+ readonly ok: boolean;
47
+ readonly reason?: string;
48
+ }>;
44
49
  /** Restart the Hister service. Omitted means the operator must do it. */
45
50
  readonly restart?: () => Promise<{
46
51
  readonly ok: boolean;
@@ -13,7 +13,21 @@ export interface MailcrawlOptions {
13
13
  readonly backend?: string;
14
14
  readonly source?: string;
15
15
  readonly fixture?: string;
16
+ /** `source: "files"` (mailcrawl 0.3.0+): `.eml` files, `.mbox`/`.mbx` archives, Apple Mail bundles, or directories. */
17
+ readonly paths?: readonly string[];
16
18
  readonly himalayaConfig?: string;
19
+ /** Envelopes fetched per IMAP window (`--page-size`). */
20
+ readonly pageSize?: number;
21
+ /** Simultaneous message reads during Himalaya sync (`--concurrency`, mailcrawl 0.3.0+). */
22
+ readonly concurrency?: number;
23
+ /** Per-message read deadline in milliseconds (`--read-timeout`, mailcrawl 0.3.0+). */
24
+ readonly readTimeoutMs?: number;
25
+ /** Categories re-included over mailcrawl's default exclusions (`--include-category`, mailcrawl 0.3.0+). */
26
+ readonly includeCategories?: readonly string[];
27
+ /** Categories excluded from sync (`--exclude-category`, mailcrawl 0.3.0+). */
28
+ readonly excludeCategories?: readonly string[];
29
+ /** Force vector store rebuild on `index` (`--rebuild`, mailcrawl 0.3.0+). */
30
+ readonly rebuildIndex?: boolean;
17
31
  /**
18
32
  * Applies to every operation. `sync`/`index` additionally honor
19
33
  * `indexTimeoutMs`, because a 0.2.0 native index run is not interactive.
@@ -45,7 +59,11 @@ export interface MailcrawlSyncInfo {
45
59
  readonly deleted?: number;
46
60
  readonly unchanged?: number;
47
61
  readonly chunksAdded?: number;
62
+ readonly excluded?: number;
63
+ readonly files?: number;
64
+ readonly filesRead?: number;
48
65
  readonly archiveRevision?: string;
66
+ readonly account?: string;
49
67
  readonly messages: number;
50
68
  }
51
69
  export interface MailcrawlIndexInfo {
@@ -1,23 +1,10 @@
1
- /**
2
- * macOS Spotlight connector (issue #1350).
3
- *
4
- * Runs the built-in `mdfind` CLI for trusted, server-configured Spotlight
5
- * queries and hydrates text content for chunking. No external installs —
6
- * Spotlight ships with macOS. **macOS only**: on any other platform the
7
- * connector reports `unavailable` before spawning anything.
8
- *
9
- * Full Disk Access: Spotlight returns hits for protected locations (Mail,
10
- * Messages, Safari data, parts of ~/Library) but reading those files fails
11
- * with EPERM/EACCES unless the process running AutoRAG (the terminal app or
12
- * host binary) has Full Disk Access under System Settings -> Privacy &
13
- * Security. When every content read is denied this maps to the `permission`
14
- * failure reason with opaque FDA guidance; partial denials surface as
15
- * count-only warnings. Full absolute paths are exposed in document metadata
16
- * (`path`) so results stay traceable back to the file on disk — privacy is
17
- * the operator's responsibility (run AutoRAG with a local LLM if paths must
18
- * not leave the machine).
19
- */
20
- import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
1
+ import type { ConnectorFetchFail, ConnectorFetchOk } from "../../connector.js";
2
+ export interface SpotlightConnectorFailure extends ConnectorFetchFail {
3
+ readonly stderr?: string;
4
+ readonly stdout?: string;
5
+ readonly code?: number | null;
6
+ }
7
+ export type SpotlightConnectorResult = ConnectorFetchOk | SpotlightConnectorFailure;
21
8
  export interface ProcessRunResult {
22
9
  readonly ok: boolean;
23
10
  readonly stdout: string;
@@ -30,13 +17,13 @@ export interface ProcessRunResult {
30
17
  export type ProcessRunner = (command: string, args: readonly string[], timeoutMs: number) => Promise<ProcessRunResult>;
31
18
  export type FileReader = (path: string) => Promise<string>;
32
19
  export interface SpotlightConnectorOptions {
33
- /** Trusted Spotlight query strings passed to `mdfind`. Required. */
20
+ /** Trusted Spotlight filters AND-ed with each user query. Required. */
34
21
  readonly queries?: readonly string[];
35
22
  /** Trusted directory restricting every query (`mdfind -onlyin`). */
36
23
  readonly onlyIn?: string;
37
24
  /** Hits kept per query after dedupe. Default 100. */
38
25
  readonly maxResultsPerQuery?: number;
39
- /** Total documents hydrated per fetch. Default 300. */
26
+ /** Maximum documents hydrated by one live search. Default 300. */
40
27
  readonly maxDocuments?: number;
41
28
  /** Characters kept per document body. Default 100000. */
42
29
  readonly maxContentChars?: number;
@@ -51,11 +38,16 @@ export interface SpotlightConnectorOptions {
51
38
  /** Injectable file reader; defaults to utf8 `fs.readFile`. */
52
39
  readonly readFile?: FileReader;
53
40
  }
54
- export declare class SpotlightConnector implements DatasourceConnector {
41
+ /** Executes live Spotlight queries. macOS owns indexing; no local snapshot is collected. */
42
+ export declare class SpotlightConnector {
55
43
  private readonly options;
56
44
  private readonly run;
57
45
  private readonly readFile;
58
46
  private readonly platform;
59
47
  constructor(options?: SpotlightConnectorOptions);
60
- fetch(): Promise<ConnectorFetchResult>;
48
+ /** Refresh-time health check only: never runs `mdfind` or hydrates files. */
49
+ probe(): Promise<SpotlightConnectorResult>;
50
+ /** Search the current macOS Spotlight index and hydrate only the requested hits. */
51
+ search(query: string, limit?: number, acceptDocument?: (docId: string) => boolean): Promise<SpotlightConnectorResult>;
52
+ private readinessFailure;
61
53
  }
@@ -1,2 +1,2 @@
1
- export { type FileReader, type ProcessRunner, type ProcessRunResult, SpotlightConnector, type SpotlightConnectorOptions, } from "./connector.js";
2
- export { SPOTLIGHT_SKILL_DEFINITION, SpotlightSkill, type SpotlightSkillOptions } from "./skill.js";
1
+ export { type FileReader, type ProcessRunner, type ProcessRunResult, SpotlightConnector, type SpotlightConnectorFailure, type SpotlightConnectorOptions, type SpotlightConnectorResult, } from "./connector.js";
2
+ export { SpotlightSkill, type SpotlightSkillOptions } from "./skill.js";
@@ -1,20 +1,33 @@
1
- /**
2
- * macOS Spotlight datasource skill (issue #1350).
3
- *
4
- * Thin composition of {@link SpotlightConnector} with the shared
5
- * {@link ConnectorDatasourceSkill} base. The skill is **macOS only** and
6
- * needs no external installs — it drives the built-in `mdfind` CLI. The
7
- * manifest carries operator guidance for mdfind/mdls/mdutil and the Full
8
- * Disk Access requirement.
9
- */
10
- import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
1
+ import type { RetrievalMethod, RetrievalOptions, RetrievalResult } from "../../../retrieval/types.js";
2
+ import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
11
3
  import { SpotlightConnector, type SpotlightConnectorOptions } from "./connector.js";
12
- export declare const SPOTLIGHT_SKILL_DEFINITION: ConnectorSkillDefinition;
13
- export interface SpotlightSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
4
+ export interface SpotlightSkillOptions {
5
+ /** Config alias used as the independent datasource/skill identity. */
6
+ readonly skillName?: string;
7
+ readonly instanceId?: string;
8
+ readonly instances?: readonly string[];
9
+ readonly tags?: readonly string[];
14
10
  /** Trusted connector configuration; a pre-built connector wins. */
15
11
  readonly connector?: SpotlightConnector;
16
12
  readonly connectorOptions?: SpotlightConnectorOptions;
17
13
  }
18
- export declare class SpotlightSkill extends ConnectorDatasourceSkill {
14
+ /** Live macOS Spotlight datasource. Refresh probes readiness; retrieval runs `mdfind`. */
15
+ export declare class SpotlightSkill implements DatasourceSkill {
16
+ private readonly connector;
17
+ private readonly skillName;
18
+ private readonly instanceId;
19
+ private readonly instances;
20
+ private readonly tags;
21
+ private lastIndexedAt;
22
+ private lastError;
19
23
  constructor(options?: SpotlightSkillOptions);
24
+ describe(): DatasourceSkillDescriptor;
25
+ polling(): PollingMetadata;
26
+ index(): Promise<DatasourceIndexResult>;
27
+ retrievalMethods(): readonly RetrievalMethod[];
28
+ describeSources(): readonly SourceDescription[];
29
+ skillManifest(): DatasourceSkillManifest;
30
+ search(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
31
+ private fail;
32
+ private note;
20
33
  }