@autorag/librarian 2.2.0 → 2.3.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 +84 -42
- package/dist/agent/agent.d.ts +16 -41
- package/dist/agent/bash-tool.d.ts +0 -11
- package/dist/agent/dupey-tool.d.ts +15 -0
- package/dist/agent/emit-results-tool.d.ts +14 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/local-model.d.ts +12 -0
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/agent/system-prompt.d.ts +1 -2
- package/dist/cli/commands/duplicates.d.ts +4 -0
- package/dist/cli/commands/health.d.ts +9 -65
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/config.d.ts +10 -14
- package/dist/cli/index.js +10383 -11845
- package/dist/datasource/aliased-skill.d.ts +28 -0
- package/dist/datasource/chunk-store.d.ts +2 -0
- package/dist/datasource/connector-skill.d.ts +3 -0
- package/dist/datasource/connector.d.ts +4 -0
- package/dist/datasource/crawler-skill.d.ts +6 -0
- package/dist/datasource/index.d.ts +2 -0
- package/dist/datasource/skills/cloud-drive/index.d.ts +1 -0
- package/dist/datasource/skills/cloud-drive/skill.d.ts +14 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +3 -0
- package/dist/datasource/skills/factory.d.ts +7 -0
- package/dist/datasource/skills/gdrive/rclone-connector.d.ts +16 -24
- package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
- package/dist/dupey/cli.d.ts +40 -0
- package/dist/dupey/filter.d.ts +8 -0
- package/dist/dupey/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5063 -6881
- package/dist/memory/check-memory-tool.d.ts +1 -0
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/memory.d.ts +33 -3
- package/dist/memory/renderer.d.ts +2 -1
- package/dist/mirror/sync.d.ts +3 -1
- package/dist/observability/run-log.d.ts +1 -26
- package/dist/process/portable-spawn.d.ts +10 -0
- package/package.json +5 -4
- package/skills/autorag/SKILL.md +59 -96
- package/skills/autorag-setup/SKILL.md +144 -400
- package/dist/subagents/contracts.d.ts +0 -90
- package/dist/subagents/dispatch-templates.d.ts +0 -104
- package/dist/subagents/dispatch-validation.d.ts +0 -169
- package/dist/subagents/explorer-tools-extension.d.ts +0 -4
- package/dist/subagents/explorer-tools-extension.js +0 -130
- package/dist/subagents/local-models.d.ts +0 -14
- package/dist/subagents/model-policy.d.ts +0 -31
- package/dist/subagents/runtime.d.ts +0 -52
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RetrievalMethod } from "../retrieval/types.js";
|
|
2
|
+
import type { DatasourceIndexResult, DatasourceSkill, DatasourceSkillDescriptor, DatasourceSkillManifest, SourceDescription } from "./types.js";
|
|
3
|
+
export interface AliasDatasourceSkillOptions {
|
|
4
|
+
readonly alias: string;
|
|
5
|
+
readonly channelIds?: readonly string[];
|
|
6
|
+
readonly channelNames?: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Gives any datasource connection an independent model-visible identity.
|
|
10
|
+
* Channel allowlists are enforced after the backend search so omitted lists
|
|
11
|
+
* retain the backend's default "all channels" behavior.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AliasedDatasourceSkill implements DatasourceSkill {
|
|
14
|
+
private readonly skill;
|
|
15
|
+
private readonly alias;
|
|
16
|
+
private readonly originalId;
|
|
17
|
+
private readonly channelIds;
|
|
18
|
+
private readonly channelNames;
|
|
19
|
+
constructor(skill: DatasourceSkill, options: AliasDatasourceSkillOptions);
|
|
20
|
+
describe(): DatasourceSkillDescriptor;
|
|
21
|
+
polling(): import("./types.js").PollingMetadata;
|
|
22
|
+
index(): Promise<DatasourceIndexResult>;
|
|
23
|
+
retrievalMethods(): readonly RetrievalMethod[];
|
|
24
|
+
describeSources(): readonly SourceDescription[];
|
|
25
|
+
skillManifest(): DatasourceSkillManifest;
|
|
26
|
+
private matchesChannel;
|
|
27
|
+
private rewriteResult;
|
|
28
|
+
}
|
|
@@ -46,6 +46,8 @@ export declare class DatasourceChunkStore {
|
|
|
46
46
|
* (in-memory contents stay authoritative for this process).
|
|
47
47
|
*/
|
|
48
48
|
replaceDocuments(documents: readonly ConnectorDocument[]): number;
|
|
49
|
+
/** Apply file-level additions/updates/deletions without rebuilding unchanged chunks. */
|
|
50
|
+
updateDocuments(documents: readonly ConnectorDocument[], deletedDocIds?: readonly string[]): number;
|
|
49
51
|
/** Load persisted chunks when present. Returns true when data was loaded. */
|
|
50
52
|
load(): boolean;
|
|
51
53
|
/** Ensure persisted chunks are loaded once for read paths. */
|
|
@@ -33,6 +33,7 @@ export interface ConnectorSkillDefinition {
|
|
|
33
33
|
readonly description: string;
|
|
34
34
|
/** Capability tags such as `"chat"`, `"api"`, `"polling"`. */
|
|
35
35
|
readonly capabilities: readonly string[];
|
|
36
|
+
readonly requiresExternalCli?: boolean;
|
|
36
37
|
/** Default authorization tags when the server config supplies none. */
|
|
37
38
|
readonly defaultTags: readonly string[];
|
|
38
39
|
/** Content type reported on source descriptions, e.g. `"chat"`. */
|
|
@@ -44,6 +45,8 @@ export interface ConnectorSkillDefinition {
|
|
|
44
45
|
}
|
|
45
46
|
export interface ConnectorSkillOptions {
|
|
46
47
|
readonly connector: DatasourceConnector;
|
|
48
|
+
/** Config alias used as the independent datasource/skill identity. */
|
|
49
|
+
readonly skillName?: string;
|
|
47
50
|
readonly instanceId?: string;
|
|
48
51
|
readonly instances?: readonly string[];
|
|
49
52
|
/** Poll interval in ms. Default 15 minutes; `0` disables polling. */
|
|
@@ -36,6 +36,10 @@ export interface ConnectorDocument {
|
|
|
36
36
|
export interface ConnectorFetchOk {
|
|
37
37
|
readonly ok: true;
|
|
38
38
|
readonly documents: readonly ConnectorDocument[];
|
|
39
|
+
/** True when the completed datasource snapshot changed since the last fetch. */
|
|
40
|
+
readonly changed?: boolean;
|
|
41
|
+
/** Stable ids removed from an incremental datasource snapshot. */
|
|
42
|
+
readonly deletedDocIds?: readonly string[];
|
|
39
43
|
/** Sanitized, path/PII-opaque warning strings. */
|
|
40
44
|
readonly warnings?: readonly string[];
|
|
41
45
|
}
|
|
@@ -16,11 +16,15 @@ export interface CrawlerDatasourceDefinition {
|
|
|
16
16
|
}
|
|
17
17
|
export interface CrawlerDatasourceSkillOptions {
|
|
18
18
|
readonly client: CrawlerSkillClient;
|
|
19
|
+
readonly datasourceId?: string;
|
|
19
20
|
readonly instanceId?: string;
|
|
20
21
|
readonly instances?: readonly string[];
|
|
21
22
|
readonly pollingIntervalMs?: number;
|
|
22
23
|
readonly tags?: readonly string[];
|
|
23
24
|
readonly lastIndexedAt?: number;
|
|
25
|
+
/** Omitted/empty means search every chat/channel. */
|
|
26
|
+
readonly channelIds?: readonly string[];
|
|
27
|
+
readonly channelNames?: readonly string[];
|
|
24
28
|
}
|
|
25
29
|
export declare class CrawlerDatasourceSkill implements DatasourceSkill {
|
|
26
30
|
private readonly definition;
|
|
@@ -29,6 +33,8 @@ export declare class CrawlerDatasourceSkill implements DatasourceSkill {
|
|
|
29
33
|
private readonly instances;
|
|
30
34
|
private readonly pollingIntervalMs;
|
|
31
35
|
private readonly tags;
|
|
36
|
+
private readonly channelIds;
|
|
37
|
+
private readonly channelNames;
|
|
32
38
|
private lastIndexedAt;
|
|
33
39
|
constructor(definition: CrawlerDatasourceDefinition, options: CrawlerDatasourceSkillOptions);
|
|
34
40
|
describe(): DatasourceSkillDescriptor;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { DatasourceAccessContext, type DatasourceAccessContextOptions } from "./access-context.js";
|
|
2
|
+
export { type AliasDatasourceSkillOptions, AliasedDatasourceSkill } from "./aliased-skill.js";
|
|
2
3
|
export { DatasourceChunkStore, type DatasourceChunkStoreOptions, datasourceChunkStorePath, type ScoredChunk, type StoredChunk, } from "./chunk-store.js";
|
|
3
4
|
export { boundDiagnosticText, type ConnectorDocument, type ConnectorFailureReason, type ConnectorFetchFail, type ConnectorFetchOk, type ConnectorFetchResult, connectorFailureToDiagnosticCode, type DatasourceConnector, sanitizeIdSegment, } from "./connector.js";
|
|
4
5
|
export { ConnectorDatasourceSkill, ConnectorLexicalMethod, type ConnectorSkillDefinition, type ConnectorSkillOptions, } from "./connector-skill.js";
|
|
@@ -7,6 +8,7 @@ export { type CronParseResult, isDue, parseCronExpr } from "./polling.js";
|
|
|
7
8
|
export { DatasourceSkillRegistry, type RegisteredDatasourceSkill } from "./registry.js";
|
|
8
9
|
export { DatasourceResultFilter, type ResultsByMethod } from "./result-filter.js";
|
|
9
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";
|
|
10
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";
|
|
11
13
|
export { BUILTIN_DATASOURCE_SKILL_NAMES, type BuildDatasourceSkillsResult, buildDatasourceSkills, type DatasourceSkillConfig, type DatasourcesConfig, } from "./skills/factory.js";
|
|
12
14
|
export { GDriveConnector, type GDriveConnectorOptions, GDriveSkill, type GDriveSkillOptions, } from "./skills/gdrive/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CLOUD_DRIVE_SKILL_DEFINITION, CloudDriveSkill, type CloudDriveSkillOptions, } from "./skill.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DatasourceConnector } from "../../connector.js";
|
|
2
|
+
import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
|
|
3
|
+
import { type RcloneConnectorOptions } from "../gdrive/rclone-connector.js";
|
|
4
|
+
export declare const CLOUD_DRIVE_SKILL_DEFINITION: ConnectorSkillDefinition;
|
|
5
|
+
export interface CloudDriveSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
|
|
6
|
+
/** Unique model-visible datasource name for this configured connection. */
|
|
7
|
+
readonly skillName?: string;
|
|
8
|
+
readonly provider?: "google-drive" | "onedrive" | "icloud" | string;
|
|
9
|
+
readonly connector?: DatasourceConnector;
|
|
10
|
+
readonly connectorOptions?: RcloneConnectorOptions;
|
|
11
|
+
}
|
|
12
|
+
export declare class CloudDriveSkill extends ConnectorDatasourceSkill {
|
|
13
|
+
constructor(options?: CloudDriveSkillOptions);
|
|
14
|
+
}
|
|
@@ -9,6 +9,7 @@ export interface DiscrawlSkillClient extends DiscrawlSearchClient {
|
|
|
9
9
|
}
|
|
10
10
|
export interface DiscrawlSkillOptions {
|
|
11
11
|
readonly client: DiscrawlSkillClient;
|
|
12
|
+
readonly datasourceId?: string;
|
|
12
13
|
readonly instanceId?: string;
|
|
13
14
|
readonly instances?: readonly string[];
|
|
14
15
|
readonly pollingIntervalMs?: number;
|
|
@@ -18,6 +19,8 @@ export interface DiscrawlSkillOptions {
|
|
|
18
19
|
readonly defaultMode?: DiscrawlSearchMode;
|
|
19
20
|
/** Max messages embedded per index pass. Undefined drains the whole backlog. */
|
|
20
21
|
readonly embedLimit?: number;
|
|
22
|
+
readonly channelIds?: readonly string[];
|
|
23
|
+
readonly channelNames?: readonly string[];
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* Discord datasource skill backed by the external `discrawl` CLI.
|
|
@@ -11,11 +11,18 @@ 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
|
+
/** Built-in datasource template used when the config key is a connection alias. */
|
|
15
|
+
readonly type?: string;
|
|
14
16
|
readonly instanceId?: string;
|
|
15
17
|
readonly pollingIntervalMs?: number;
|
|
16
18
|
readonly tags?: readonly string[];
|
|
17
19
|
/** Connector-specific options (token env names, repos, feeds, paths, …). */
|
|
18
20
|
readonly connector?: Record<string, unknown>;
|
|
21
|
+
/** Optional chat/channel allowlist; absent means all channels. */
|
|
22
|
+
readonly channels?: {
|
|
23
|
+
readonly ids?: readonly string[];
|
|
24
|
+
readonly names?: readonly string[];
|
|
25
|
+
};
|
|
19
26
|
}
|
|
20
27
|
/** The trusted `datasources` config section: skill name → config. */
|
|
21
28
|
export type DatasourcesConfig = Readonly<Record<string, DatasourceSkillConfig | boolean>>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provider-neutral incremental rclone mirror.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* as text via rclone's `--drive-export-formats`. Never throws; failures map
|
|
9
|
-
* onto the coarse connector failure union with path/PII-opaque messages.
|
|
10
|
-
*
|
|
11
|
-
* Listing: `rclone lsjson <remote> --recursive --files-only`
|
|
12
|
-
* Content: `rclone cat <remote>/<path>` (bounded, text formats only)
|
|
4
|
+
* `lsjson` inventories a remote, a workspace manifest computes its diff, and
|
|
5
|
+
* only added/changed indexable files are copied into a managed mirror. The
|
|
6
|
+
* manifest is published only after every changed file is available, so search
|
|
7
|
+
* can continue using the previous completed snapshot after an interrupted run.
|
|
13
8
|
*/
|
|
14
9
|
import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
|
|
15
10
|
export interface RcloneRunResult {
|
|
@@ -20,27 +15,22 @@ export interface RcloneRunResult {
|
|
|
20
15
|
}
|
|
21
16
|
export type RcloneRunner = (args: readonly string[], timeoutMs: number) => Promise<RcloneRunResult>;
|
|
22
17
|
export interface RcloneConnectorOptions {
|
|
23
|
-
/** Path to the rclone binary. Default bare `rclone` PATH lookup. */
|
|
24
18
|
readonly binaryPath?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Rclone remote path, e.g. `gdrive:` or `gdrive:Team/Docs`. Required
|
|
27
|
-
* trusted configuration (`rclone config` defines the remote).
|
|
28
|
-
*/
|
|
29
19
|
readonly remote?: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
readonly provider?: string;
|
|
21
|
+
readonly workspaceRoot?: string;
|
|
22
|
+
readonly instanceId?: string;
|
|
23
|
+
readonly skillName?: string;
|
|
34
24
|
readonly extensions?: readonly string[];
|
|
35
|
-
|
|
25
|
+
readonly include?: readonly string[];
|
|
26
|
+
readonly exclude?: readonly string[];
|
|
36
27
|
readonly exportFormats?: string;
|
|
37
|
-
/** Max files whose contents are fetched per run. Default 200. */
|
|
38
28
|
readonly maxDocuments?: number;
|
|
39
|
-
/** Files larger than this are skipped. Default 2 MiB. */
|
|
40
29
|
readonly maxBytesPerFile?: number;
|
|
41
|
-
|
|
30
|
+
readonly concurrency?: number;
|
|
31
|
+
readonly bandwidthLimit?: string;
|
|
32
|
+
readonly dryRun?: boolean;
|
|
42
33
|
readonly timeoutMs?: number;
|
|
43
|
-
/** Injectable process runner for tests. */
|
|
44
34
|
readonly runner?: RcloneRunner;
|
|
45
35
|
}
|
|
46
36
|
export declare class RcloneConnector implements DatasourceConnector {
|
|
@@ -48,4 +38,6 @@ export declare class RcloneConnector implements DatasourceConnector {
|
|
|
48
38
|
private readonly runner;
|
|
49
39
|
constructor(options?: RcloneConnectorOptions);
|
|
50
40
|
fetch(): Promise<ConnectorFetchResult>;
|
|
41
|
+
private fetchIncremental;
|
|
42
|
+
private fetchWithoutMirror;
|
|
51
43
|
}
|
|
@@ -8,6 +8,7 @@ export interface ObsidianSkillClient extends ObsidianSearchClient {
|
|
|
8
8
|
embed(): Promise<QmdEmbedResult>;
|
|
9
9
|
}
|
|
10
10
|
export interface ObsidianSkillOptions {
|
|
11
|
+
readonly datasourceId?: string;
|
|
11
12
|
readonly client?: ObsidianSkillClient;
|
|
12
13
|
readonly vaultPath?: string;
|
|
13
14
|
readonly binaryPath?: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface DupeyScanFile {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly content_hash?: string;
|
|
4
|
+
readonly [key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface DupeyScanEdge {
|
|
7
|
+
readonly relation: string;
|
|
8
|
+
readonly a: string;
|
|
9
|
+
readonly b: string;
|
|
10
|
+
readonly [key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface DupeyScanFamily {
|
|
13
|
+
readonly id: number;
|
|
14
|
+
readonly relation: string;
|
|
15
|
+
readonly files: readonly string[];
|
|
16
|
+
readonly members: readonly Record<string, unknown>[];
|
|
17
|
+
readonly edges: readonly DupeyScanEdge[];
|
|
18
|
+
readonly pick?: Record<string, unknown>;
|
|
19
|
+
readonly [key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface DupeyScanResult {
|
|
22
|
+
readonly dir: string;
|
|
23
|
+
readonly threshold?: number;
|
|
24
|
+
readonly contains_threshold?: number;
|
|
25
|
+
readonly contains_min_jaccard?: number;
|
|
26
|
+
readonly files: readonly DupeyScanFile[];
|
|
27
|
+
readonly families: readonly DupeyScanFamily[];
|
|
28
|
+
readonly errors: readonly Record<string, unknown>[];
|
|
29
|
+
readonly [key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface DupeyCliOptions {
|
|
32
|
+
readonly executable?: string;
|
|
33
|
+
readonly cwd?: string;
|
|
34
|
+
readonly timeoutMs?: number;
|
|
35
|
+
readonly run?: (args: readonly string[]) => Promise<string>;
|
|
36
|
+
}
|
|
37
|
+
export declare class DupeyCliError extends Error {
|
|
38
|
+
constructor(message: string);
|
|
39
|
+
}
|
|
40
|
+
export declare function scanWithDupey(dir: string, options?: DupeyCliOptions): Promise<DupeyScanResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DupeyScanResult } from "./cli.js";
|
|
2
|
+
export interface ExactDuplicateFilterResult {
|
|
3
|
+
readonly excluded: ReadonlySet<string>;
|
|
4
|
+
readonly keepers: ReadonlySet<string>;
|
|
5
|
+
readonly errors: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
/** Selects the newest filesystem copy for each exact canonical-text hash. */
|
|
8
|
+
export declare function selectExactDuplicateExclusions(root: string, scan: DupeyScanResult): Promise<ExactDuplicateFilterResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { AutoRAGAgent, type AutoRAGAgentOptions, type AutoRAGRefreshComponentSta
|
|
|
2
2
|
export { type AutoRAGResultsDetails, createEmitResultsTool, EMIT_AUTORAG_RESULTS_TOOL_NAME, type SearchDocumentDiagnostic, type SearchDocumentDiagnosticCode, type SearchDocumentDiagnosticSeverity, type SearchDocumentsResponse, type SearchDocumentWarning, } from "./agent/index.js";
|
|
3
3
|
export { buildSystemPrompt, type SystemPromptConfig } from "./agent/system-prompt.js";
|
|
4
4
|
export * from "./datasource/index.js";
|
|
5
|
+
export * from "./dupey/index.js";
|
|
5
6
|
export * from "./jikji/index.js";
|
|
6
7
|
export * from "./manifest/index.js";
|
|
7
8
|
export * from "./memory/index.js";
|