@autorag/librarian 2.10.1 → 2.10.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 (73) hide show
  1. package/NOTICE +0 -3
  2. package/README.md +76 -33
  3. package/dist/agent/agent.d.ts +96 -18
  4. package/dist/agent/evidence-ledger.d.ts +54 -5
  5. package/dist/agent/evidence-persistence.d.ts +24 -0
  6. package/dist/agent/jev-extension.d.ts +5 -3
  7. package/dist/agent/search-documents.d.ts +1 -1
  8. package/dist/agent/system-prompt.d.ts +0 -2
  9. package/dist/agent/tool-burst-guard.d.ts +26 -0
  10. package/dist/cli/config.d.ts +37 -23
  11. package/dist/cli/index.js +2122 -1153
  12. package/dist/cloud/config.d.ts +16 -10
  13. package/dist/cloud/credential.d.ts +17 -0
  14. package/dist/cloud/errors.d.ts +6 -6
  15. package/dist/cloud/index.d.ts +5 -4
  16. package/dist/cloud/jev-backend.d.ts +15 -13
  17. package/dist/cloud/models.d.ts +4 -4
  18. package/dist/cloud/oauth-login.d.ts +3 -3
  19. package/dist/cloud/provider.d.ts +16 -11
  20. package/dist/cloud/token.d.ts +2 -2
  21. package/dist/core.d.ts +2 -1
  22. package/dist/core.js +2265 -1313
  23. package/dist/datasource/aliased-skill.d.ts +2 -2
  24. package/dist/datasource/connector-skill.d.ts +2 -2
  25. package/dist/datasource/crawler-skill.d.ts +2 -2
  26. package/dist/datasource/described-skill.d.ts +2 -2
  27. package/dist/datasource/index.d.ts +1 -1
  28. package/dist/datasource/retry.d.ts +49 -0
  29. package/dist/datasource/skills/clawgallery/skill.d.ts +4 -4
  30. package/dist/datasource/skills/discrawl/skill.d.ts +5 -5
  31. package/dist/datasource/skills/github-gist/skill.d.ts +2 -2
  32. package/dist/datasource/skills/lazykatok/skill.d.ts +5 -5
  33. package/dist/datasource/skills/mailcrawl/skill.d.ts +2 -2
  34. package/dist/datasource/skills/obsidian/skill.d.ts +5 -5
  35. package/dist/datasource/types.d.ts +13 -1
  36. package/dist/embedding-runtime/cache.d.ts +9 -0
  37. package/dist/index.d.ts +1 -2
  38. package/dist/index.js +2338 -1387
  39. package/dist/jikji/client.d.ts +13 -2
  40. package/dist/jikji/index.d.ts +1 -1
  41. package/dist/jikji/path-map.d.ts +9 -0
  42. package/dist/jikji/prepare-budget.d.ts +18 -0
  43. package/dist/jikji/serial-queue.d.ts +17 -0
  44. package/dist/jikji/types.d.ts +17 -0
  45. package/dist/mcp/index.js +2326 -1374
  46. package/dist/minsync/client.d.ts +3 -1
  47. package/dist/minsync/index.d.ts +1 -1
  48. package/dist/minsync/installer.d.ts +1 -1
  49. package/dist/minsync/method.d.ts +1 -1
  50. package/dist/minsync/types.d.ts +8 -1
  51. package/dist/mirror/atomic-write.d.ts +6 -0
  52. package/dist/mirror/index-store.d.ts +8 -1
  53. package/dist/mirror/index.d.ts +2 -2
  54. package/dist/mirror/sync.d.ts +57 -1
  55. package/dist/p2p/simplex-server.d.ts +0 -1
  56. package/dist/parser/defaults.d.ts +8 -0
  57. package/dist/parser/errors.d.ts +10 -0
  58. package/dist/parser/isolated.d.ts +77 -0
  59. package/dist/parser/kordoc.d.ts +1 -0
  60. package/dist/parser/parse-worker.d.ts +1 -0
  61. package/dist/parser/parse-worker.js +780 -0
  62. package/dist/parser/types.d.ts +5 -0
  63. package/dist/process/abort-reason.d.ts +2 -0
  64. package/dist/retrieval/index.d.ts +1 -1
  65. package/dist/retrieval/rerank.d.ts +16 -10
  66. package/package.json +5 -5
  67. package/skills/autorag/SKILL.md +2 -1
  68. package/skills/autorag-doctor/SKILL.md +7 -0
  69. package/skills/autorag-lite-setup/SKILL.md +2 -2
  70. package/skills/autorag-setup/SKILL.md +42 -17
  71. package/dist/manifest/index.d.ts +0 -2
  72. package/dist/manifest/loader.d.ts +0 -3
  73. package/dist/manifest/types.d.ts +0 -8
@@ -1,5 +1,5 @@
1
1
  import type { RetrievalMethod } from "../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, SourceDescription } from "./types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, SourceDescription } from "./types.js";
3
3
  export interface AliasDatasourceSkillOptions {
4
4
  readonly alias: string;
5
5
  readonly channelIds?: readonly string[];
@@ -19,7 +19,7 @@ export declare class AliasedDatasourceSkill implements DatasourceSkill {
19
19
  constructor(skill: DatasourceSkill, options: AliasDatasourceSkillOptions);
20
20
  describe(): DatasourceSkillDescriptor;
21
21
  polling(): import("./types.js").PollingMetadata;
22
- index(): Promise<DatasourceIndexResult>;
22
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
23
23
  retrievalMethods(): readonly RetrievalMethod[];
24
24
  describeSources(): readonly SourceDescription[];
25
25
  skillManifest(): DatasourceSkillManifest;
@@ -22,7 +22,7 @@
22
22
  import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../retrieval/types.js";
23
23
  import { DatasourceChunkStore } from "./chunk-store.js";
24
24
  import type { DatasourceConnector } from "./connector.js";
25
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
25
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
26
26
  /** Static identity/behavior shared by all instances of one skill kind. */
27
27
  export interface ConnectorSkillDefinition {
28
28
  /** Stable skill name and datasource id, e.g. `"slack"`. */
@@ -86,7 +86,7 @@ export declare class ConnectorDatasourceSkill implements DatasourceSkill {
86
86
  constructor(definition: ConnectorSkillDefinition, options: ConnectorSkillOptions);
87
87
  describe(): DatasourceSkillDescriptor;
88
88
  polling(): PollingMetadata;
89
- index(): Promise<DatasourceIndexResult>;
89
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
90
90
  retrievalMethods(): readonly RetrievalMethod[];
91
91
  describeSources(): readonly SourceDescription[];
92
92
  skillManifest(): DatasourceSkillManifest;
@@ -1,7 +1,7 @@
1
1
  import type { RetrievalMethod } from "../retrieval/types.js";
2
2
  import type { CrawlerSearchOptions, CrawlerSearchResult, CrawlerSyncResult } from "./crawler-types.js";
3
3
  import { type CrawlerSidecarOptions } from "./sidecar/index.js";
4
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
4
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
5
5
  export interface CrawlerSkillClient {
6
6
  sync(signal?: AbortSignal): Promise<CrawlerSyncResult>;
7
7
  search(query: string, options?: CrawlerSearchOptions): Promise<CrawlerSearchResult>;
@@ -49,7 +49,7 @@ export declare class CrawlerDatasourceSkill implements DatasourceSkill {
49
49
  constructor(definition: CrawlerDatasourceDefinition, options: CrawlerDatasourceSkillOptions);
50
50
  describe(): DatasourceSkillDescriptor;
51
51
  polling(): PollingMetadata;
52
- index(): Promise<DatasourceIndexResult>;
52
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
53
53
  /**
54
54
  * Embed new crawler messages into the sidecar. Never fails the index (the CLI sync already succeeded and BM25
55
55
  * stays available): any sidecar problem, including a thrown database error, becomes a warning. A bounded sync
@@ -1,5 +1,5 @@
1
1
  import type { RetrievalMethod } from "../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "./types.js";
3
3
  /**
4
4
  * Adds operator-authored context to a configured datasource without changing
5
5
  * its backend, access identity, or retrieval methods.
@@ -10,7 +10,7 @@ export declare class DescribedDatasourceSkill implements DatasourceSkill {
10
10
  constructor(skill: DatasourceSkill, description: string);
11
11
  describe(): DatasourceSkillDescriptor;
12
12
  polling(): PollingMetadata;
13
- index(): Promise<DatasourceIndexResult>;
13
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
14
14
  retrievalMethods(): readonly RetrievalMethod[];
15
15
  describeSources(): readonly SourceDescription[];
16
16
  skillManifest(): DatasourceSkillManifest;
@@ -22,4 +22,4 @@ export { SlackSkill, type SlackSkillOptions, SlacrawlClient, type SlacrawlOption
22
22
  export { SpotlightConnector, type SpotlightConnectorOptions, SpotlightSkill, type SpotlightSkillOptions, } from "./skills/spotlight/index.js";
23
23
  export { TelecrawlClient, type TelecrawlOptions, TelecrawlSkill, type TelecrawlSkillOptions, } from "./skills/telecrawl/index.js";
24
24
  export { WacrawlClient, type WacrawlOptions, WacrawlSkill, type WacrawlSkillOptions } from "./skills/wacrawl/index.js";
25
- export type { DatasourceDiagnostic, DatasourceDiagnosticCode, DatasourceIndexFail, DatasourceIndexOk, DatasourceIndexResult, DatasourceInstance, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription, } from "./types.js";
25
+ export type { DatasourceDiagnostic, DatasourceDiagnosticCode, DatasourceIndexFail, DatasourceIndexOk, DatasourceIndexOptions, DatasourceIndexResult, DatasourceInstance, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription, } from "./types.js";
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Shared retry/backoff policy for datasource `index()` calls.
3
+ *
4
+ * Failure causes differ per datasource (HTTP status, CLI exit reason, ...), so
5
+ * no attempt is made to classify them. {@link indexWithRetry} retries every
6
+ * failed or thrown `index()` with jittered exponential backoff and, once the
7
+ * retries are used up, reports that datasource as failed so the refresh moves
8
+ * on to the next one.
9
+ *
10
+ * Process-tree termination of a timed-out CLI is a separate concern (#1587,
11
+ * #1586); this module never touches the spawn code.
12
+ */
13
+ import type { DatasourceIndexResult, DatasourceSkill } from "./types.js";
14
+ export interface DatasourceRetryPolicy {
15
+ /** Re-runs after the first call; `0` disables retrying. */
16
+ readonly maxRetries: number;
17
+ /** Backoff before the first retry; doubles for each later retry. */
18
+ readonly baseDelayMs: number;
19
+ /** Upper bound on one backoff step (before jitter). */
20
+ readonly maxDelayMs: number;
21
+ }
22
+ export interface DatasourceRetryOptions extends Partial<DatasourceRetryPolicy> {
23
+ /** Jitter source in `[0, 1]`; injectable for deterministic tests. */
24
+ readonly random?: () => number;
25
+ /** Delay implementation; injectable so tests and hosts need not wait in real time. */
26
+ readonly sleep?: (ms: number) => Promise<void>;
27
+ }
28
+ /** Two retries (three calls in total) with 1s then 2s of backoff, jittered. */
29
+ export declare const DEFAULT_DATASOURCE_RETRY_POLICY: DatasourceRetryPolicy;
30
+ /**
31
+ * Backoff before retry number `retry` (1-based): `baseDelayMs * 2^(retry-1)`
32
+ * capped at `maxDelayMs`, then jittered into the upper half of that step so
33
+ * simultaneous refreshes do not hammer the same upstream in lockstep.
34
+ */
35
+ export declare function datasourceRetryDelayMs(retry: number, policy: DatasourceRetryPolicy & {
36
+ readonly random?: () => number;
37
+ }): number;
38
+ /**
39
+ * Run `skill.index()`, retrying any failure (a failed result or a throw). A
40
+ * first-time success is returned untouched. Otherwise the result carries the
41
+ * total `attempts`; an exhausted failure also carries `attempts` in its message
42
+ * and last diagnostic, and a late success carries an info diagnostic naming the
43
+ * last error it recovered from. A thrown `index()` becomes a
44
+ * `datasource-index-failed` result.
45
+ *
46
+ * A cancelled `signal` is not a datasource failure: it is rethrown at once
47
+ * (also from the backoff wait) instead of being retried or reported.
48
+ */
49
+ export declare function indexWithRetry(skill: DatasourceSkill, options?: DatasourceRetryOptions, signal?: AbortSignal): Promise<DatasourceIndexResult>;
@@ -1,10 +1,10 @@
1
1
  import type { RetrievalMethod } from "../../../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
3
  import { type ClawGallerySearchClient } from "./methods.js";
4
4
  import type { ClawGalleryIndexResult, ClawGalleryOptions, ClawGallerySearchMode, ClawGalleryVdrResult } from "./types.js";
5
5
  export interface ClawGallerySkillClient extends ClawGallerySearchClient {
6
- bootstrap(): Promise<ClawGalleryIndexResult>;
7
- syncVisual(): Promise<ClawGalleryVdrResult>;
6
+ bootstrap(signal?: AbortSignal): Promise<ClawGalleryIndexResult>;
7
+ syncVisual(signal?: AbortSignal): Promise<ClawGalleryVdrResult>;
8
8
  }
9
9
  export interface ClawGallerySkillOptions {
10
10
  readonly client: ClawGallerySkillClient;
@@ -28,7 +28,7 @@ export declare class ClawGallerySkill implements DatasourceSkill {
28
28
  constructor(options: ClawGallerySkillOptions);
29
29
  describe(): DatasourceSkillDescriptor;
30
30
  polling(): PollingMetadata;
31
- index(): Promise<DatasourceIndexResult>;
31
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
32
32
  retrievalMethods(): readonly RetrievalMethod[];
33
33
  describeSources(): readonly SourceDescription[];
34
34
  skillManifest(): DatasourceSkillManifest;
@@ -1,11 +1,11 @@
1
1
  import type { RetrievalMethod } from "../../../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
3
  import { type DiscrawlSearchClient } from "./methods.js";
4
4
  import type { DiscrawlDoctorResult, DiscrawlEmbedResult, DiscrawlSearchMode, DiscrawlSyncResult } from "./types.js";
5
5
  export interface DiscrawlSkillClient extends DiscrawlSearchClient {
6
- doctor(): Promise<DiscrawlDoctorResult>;
7
- sync(): Promise<DiscrawlSyncResult>;
8
- embed(limit?: number, rebuild?: boolean): Promise<DiscrawlEmbedResult>;
6
+ doctor(signal?: AbortSignal): Promise<DiscrawlDoctorResult>;
7
+ sync(signal?: AbortSignal): Promise<DiscrawlSyncResult>;
8
+ embed(limit?: number, rebuild?: boolean, signal?: AbortSignal): Promise<DiscrawlEmbedResult>;
9
9
  prepareEmbeddings?(): Promise<boolean>;
10
10
  }
11
11
  export interface DiscrawlSkillOptions {
@@ -47,7 +47,7 @@ export declare class DiscrawlSkill implements DatasourceSkill {
47
47
  constructor(options: DiscrawlSkillOptions);
48
48
  describe(): DatasourceSkillDescriptor;
49
49
  polling(): PollingMetadata;
50
- index(): Promise<DatasourceIndexResult>;
50
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
51
51
  retrievalMethods(): readonly RetrievalMethod[];
52
52
  describeSources(): readonly SourceDescription[];
53
53
  skillManifest(): DatasourceSkillManifest;
@@ -10,7 +10,7 @@
10
10
  import { type Embedder, type GatewayEmbedderOptions } from "../../../embedding-runtime/gateway-embedder.js";
11
11
  import type { RetrievalMethod } from "../../../retrieval/types.js";
12
12
  import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
13
- import type { DatasourceIndexResult } from "../../types.js";
13
+ import type { DatasourceIndexOptions, DatasourceIndexResult } from "../../types.js";
14
14
  import { GitHubGistConnector, type GitHubGistConnectorOptions } from "./connector.js";
15
15
  export declare const GITHUB_GIST_SKILL_DEFINITION: ConnectorSkillDefinition;
16
16
  export declare function gistDatasourceDir(workspaceRoot: string, skillName: string, instanceId: string): string;
@@ -34,6 +34,6 @@ export declare class GitHubGistSkill extends ConnectorDatasourceSkill {
34
34
  private readonly semanticEmbedder;
35
35
  private readonly semanticMethod;
36
36
  constructor(options?: GitHubGistSkillOptions);
37
- index(): Promise<DatasourceIndexResult>;
37
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
38
38
  retrievalMethods(): readonly RetrievalMethod[];
39
39
  }
@@ -1,11 +1,11 @@
1
1
  import type { RetrievalMethod } from "../../../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
3
  import { type LazykatokSearchClient } from "./methods.js";
4
4
  import type { LazykatokDoctorResult, LazykatokIndexResult, LazykatokSyncResult } from "./types.js";
5
5
  export interface LazykatokSkillClient extends LazykatokSearchClient {
6
- doctor(): Promise<LazykatokDoctorResult>;
7
- sync(): Promise<LazykatokSyncResult>;
8
- index(): Promise<LazykatokIndexResult>;
6
+ doctor(signal?: AbortSignal): Promise<LazykatokDoctorResult>;
7
+ sync(signal?: AbortSignal): Promise<LazykatokSyncResult>;
8
+ index(signal?: AbortSignal): Promise<LazykatokIndexResult>;
9
9
  }
10
10
  export interface LazykatokSkillOptions {
11
11
  readonly client: LazykatokSkillClient;
@@ -25,7 +25,7 @@ export declare class LazykatokSkill implements DatasourceSkill {
25
25
  constructor(options: LazykatokSkillOptions);
26
26
  describe(): DatasourceSkillDescriptor;
27
27
  polling(): PollingMetadata;
28
- index(): Promise<DatasourceIndexResult>;
28
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
29
29
  retrievalMethods(): readonly RetrievalMethod[];
30
30
  describeSources(): readonly SourceDescription[];
31
31
  skillManifest(): DatasourceSkillManifest;
@@ -1,5 +1,5 @@
1
1
  import type { RetrievalMethod } from "../../../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
3
  import { type MailcrawlIndexClient } from "./client.js";
4
4
  import type { MailcrawlOptions, MailcrawlSyncResult } from "./types.js";
5
5
  export interface MailcrawlSkillClient extends MailcrawlIndexClient {
@@ -26,7 +26,7 @@ export declare class MailcrawlSkill implements DatasourceSkill {
26
26
  constructor(options?: MailcrawlSkillOptions);
27
27
  describe(): DatasourceSkillDescriptor;
28
28
  polling(): PollingMetadata;
29
- index(): Promise<DatasourceIndexResult>;
29
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
30
30
  retrievalMethods(): readonly RetrievalMethod[];
31
31
  describeSources(): readonly SourceDescription[];
32
32
  skillManifest(): DatasourceSkillManifest;
@@ -1,11 +1,11 @@
1
1
  import type { RetrievalMethod } from "../../../retrieval/types.js";
2
- import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
2
+ import type { DatasourceIndexOptions, DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, PollingMetadata, SourceDescription } from "../../types.js";
3
3
  import { type ObsidianSearchClient } from "./methods.js";
4
4
  import type { QmdEmbedResult, QmdEnsureResult, QmdUpdateResult } from "./types.js";
5
5
  export interface ObsidianSkillClient extends ObsidianSearchClient {
6
- ensureCollection(): Promise<QmdEnsureResult>;
7
- update(): Promise<QmdUpdateResult>;
8
- embed(): Promise<QmdEmbedResult>;
6
+ ensureCollection(signal?: AbortSignal): Promise<QmdEnsureResult>;
7
+ update(signal?: AbortSignal): Promise<QmdUpdateResult>;
8
+ embed(signal?: AbortSignal): Promise<QmdEmbedResult>;
9
9
  }
10
10
  export interface ObsidianSkillOptions {
11
11
  readonly datasourceId?: string;
@@ -37,7 +37,7 @@ export declare class ObsidianSkill implements DatasourceSkill {
37
37
  constructor(options?: ObsidianSkillOptions);
38
38
  describe(): DatasourceSkillDescriptor;
39
39
  polling(): PollingMetadata;
40
- index(): Promise<DatasourceIndexResult>;
40
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
41
41
  retrievalMethods(): readonly RetrievalMethod[];
42
42
  describeSources(): readonly SourceDescription[];
43
43
  skillManifest(): DatasourceSkillManifest;
@@ -52,6 +52,11 @@ export interface DatasourceSkillDescriptor {
52
52
  /** Optional list of instance ids this skill reports. */
53
53
  readonly instances?: readonly string[];
54
54
  }
55
+ /** Per-call options for {@link DatasourceSkill.index}. */
56
+ export interface DatasourceIndexOptions {
57
+ /** Aborting stops the index run and kills any CLI it spawned. An aborted run may reject instead of returning a fail variant. */
58
+ readonly signal?: AbortSignal;
59
+ }
55
60
  /**
56
61
  * A pluggable datasource skill. Skills are server-bound: they are constructed
57
62
  * with trusted configuration and never derive authority from model/tool args.
@@ -67,7 +72,7 @@ export interface DatasourceSkill {
67
72
  * never throws. Remote embedding egress MUST be rejected here and reported
68
73
  * via a `datasource-embedding-egress-rejected` diagnostic.
69
74
  */
70
- index(): Promise<DatasourceIndexResult>;
75
+ index(options?: DatasourceIndexOptions): Promise<DatasourceIndexResult>;
71
76
  /** Retrieval methods exposed by this skill, fed into the shared pipeline. */
72
77
  retrievalMethods(): readonly RetrievalMethod[];
73
78
  /** Opaque source descriptions for the skill's current evidence set. */
@@ -128,6 +133,11 @@ export interface DatasourceIndexOk {
128
133
  readonly chunkCount: number;
129
134
  readonly indexedAt: number;
130
135
  readonly diagnostics: readonly DatasourceDiagnostic[];
136
+ /**
137
+ * Total `index()` calls it took (set only when the refresh retried; a
138
+ * first-time success omits it).
139
+ */
140
+ readonly attempts?: number;
131
141
  }
132
142
  /** Failed indexing outcome. Never thrown; returned with diagnostics. */
133
143
  export interface DatasourceIndexFail {
@@ -139,6 +149,8 @@ export interface DatasourceIndexFail {
139
149
  readonly error?: string;
140
150
  readonly code?: DatasourceDiagnosticCode;
141
151
  readonly message?: string;
152
+ /** Total `index()` calls made before this result was reported (set by the refresh retry policy). */
153
+ readonly attempts?: number;
142
154
  }
143
155
  /**
144
156
  * Index result — an ok/fail discriminated union. Skills MUST NOT throw from
@@ -16,6 +16,15 @@ export interface CacheOptions {
16
16
  readonly downloadTimeoutMs?: number;
17
17
  }
18
18
  export declare function verifyCacheEntry(path: string, expectedSha256: string): Promise<string>;
19
+ /**
20
+ * Marker a distributor writes inside `<archive>.extracted/` when it ships the
21
+ * runtime already extracted instead of as the pinned archive. Its content is the
22
+ * archive's SHA-256, so a tree provisioned for another runtime build is never
23
+ * taken for this one. A signed and notarized macOS app needs this: every Mach-O
24
+ * it carries must be re-signed with the app's Developer ID, so the binaries can
25
+ * no longer be packed back into an archive that matches the pinned digest.
26
+ */
27
+ export declare const PROVISIONED_RUNTIME_MARKER = ".autorag-archive-sha256";
19
28
  export declare function hasVerifiedAsset(asset: CacheAsset, cacheRoot?: string): Promise<boolean>;
20
29
  export declare function downloadAsset(asset: CacheAsset, options?: CacheOptions): Promise<string>;
21
30
  export declare function importAsset(sourcePath: string, asset: CacheAsset, options?: CacheOptions): Promise<string>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AutoRAGAgent, type AutoRAGAgentOptions, type AutoRAGRefreshComponentStatus, type AutoRAGRefreshOptions, type AutoRAGRefreshResult, type AutoRAGRefreshStatus, type AutoRAGWatchRefreshHandle, type AutoRAGWatchRefreshOptions, type AutoRefreshOptions, type RefreshMethod, } from "./agent/agent.js";
1
+ export { AutoRAGAgent, type AutoRAGAgentOptions, type AutoRAGRefreshComponentStatus, type AutoRAGRefreshOptions, type AutoRAGRefreshProgress, type AutoRAGRefreshResult, type AutoRAGRefreshStatus, type AutoRAGWatchRefreshHandle, type AutoRAGWatchRefreshOptions, type AutoRefreshOptions, type RefreshMethod, } from "./agent/agent.js";
2
2
  export { type AutoRAGResultsDetails, reportSchema, type SearchDocumentDiagnostic, type SearchDocumentDiagnosticCode, type SearchDocumentDiagnosticSeverity, type SearchDocumentsResponse, type SearchDocumentsStreamEvent, type SearchDocumentWarning, } from "./agent/index.js";
3
3
  export { buildSystemPrompt, type SystemPromptConfig } from "./agent/system-prompt.js";
4
4
  export * from "./cloud/index.js";
@@ -8,7 +8,6 @@ export * from "./dupey/index.js";
8
8
  export * from "./everything/index.js";
9
9
  export * from "./fsearch/index.js";
10
10
  export * from "./jikji/index.js";
11
- export * from "./manifest/index.js";
12
11
  export { type AutoRAGMcpServerOptions, createAutoRAGMcpServer } from "./mcp/server.js";
13
12
  export * from "./memory/index.js";
14
13
  export * from "./minsync/index.js";