@autorag/librarian 2.2.0 → 2.4.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 +194 -47
- package/dist/agent/agent.d.ts +34 -47
- package/dist/agent/bash-tool.d.ts +2 -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-bm25-tool.d.ts +11 -3
- package/dist/agent/search-documents.d.ts +2 -2
- package/dist/agent/search-minsync-tool.d.ts +2 -2
- 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/index.d.ts +3 -3
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/commands/tui.d.ts +36 -0
- package/dist/cli/commands/ui.d.ts +13 -0
- package/dist/cli/config.d.ts +27 -22
- package/dist/cli/index.js +14965 -12563
- package/dist/cli/tui-commands.d.ts +16 -0
- package/dist/cli/tui-session-store.d.ts +16 -0
- package/dist/datasource/access-context.d.ts +6 -12
- 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/crawler-types.d.ts +2 -0
- package/dist/datasource/described-skill.d.ts +17 -0
- package/dist/datasource/index.d.ts +4 -2
- package/dist/datasource/result-filter.d.ts +2 -1
- package/dist/datasource/skills/clawgallery/client.d.ts +9 -0
- package/dist/datasource/skills/clawgallery/index.d.ts +5 -0
- package/dist/datasource/skills/clawgallery/methods.d.ts +19 -0
- package/dist/datasource/skills/clawgallery/paths.d.ts +7 -0
- package/dist/datasource/skills/clawgallery/skill.d.ts +35 -0
- package/dist/datasource/skills/clawgallery/types.d.ts +58 -0
- package/dist/datasource/skills/cloud-drive/index.d.ts +2 -0
- package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +47 -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/discrawl/types.d.ts +4 -8
- package/dist/datasource/skills/factory.d.ts +9 -0
- package/dist/datasource/skills/gmail/himalaya-connector.d.ts +12 -1
- package/dist/datasource/skills/katok/methods.d.ts +6 -4
- package/dist/datasource/skills/katok/types.d.ts +8 -26
- package/dist/datasource/skills/mailcrawl/client.d.ts +15 -0
- package/dist/datasource/skills/mailcrawl/config.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/index.d.ts +4 -0
- package/dist/datasource/skills/mailcrawl/methods.d.ts +15 -0
- package/dist/datasource/skills/mailcrawl/skill.d.ts +34 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +71 -0
- package/dist/datasource/skills/obsidian/skill.d.ts +2 -0
- package/dist/datasource/skills/obsidian/types.d.ts +2 -0
- package/dist/datasource/types.d.ts +5 -2
- 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/filesystem/cloud-placeholder.d.ts +26 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8889 -9292
- package/dist/jikji/client.d.ts +1 -0
- 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/minsync/client.d.ts +5 -1
- package/dist/minsync/embedder-config.d.ts +4 -1
- package/dist/minsync/index.d.ts +4 -4
- package/dist/minsync/installer.d.ts +1 -0
- package/dist/minsync/method.d.ts +22 -1
- package/dist/minsync/types.d.ts +5 -0
- package/dist/mirror/sync.d.ts +3 -1
- package/dist/observability/run-log.d.ts +1 -26
- package/dist/parser/defaults.d.ts +2 -0
- package/dist/parser/index.d.ts +2 -2
- package/dist/parser/opendataloader-pdf.d.ts +10 -0
- package/dist/parser/types.d.ts +7 -0
- package/dist/process/portable-spawn.d.ts +10 -0
- package/dist/retrieval/index.d.ts +2 -2
- package/dist/retrieval/methods/bm25.d.ts +7 -36
- package/dist/ui/browse.d.ts +11 -0
- package/dist/ui/catalog.d.ts +59 -0
- package/dist/ui/config-store.d.ts +43 -0
- package/dist/ui/discover.d.ts +19 -0
- package/dist/ui/html.d.ts +2 -0
- package/dist/ui/probe.d.ts +24 -0
- package/dist/ui/prompt.d.ts +21 -0
- package/dist/ui/server.d.ts +28 -0
- package/package.json +17 -15
- package/skills/autorag/SKILL.md +79 -108
- package/skills/autorag-setup/SKILL.md +170 -395
- package/dist/datasource/skills/discrawl/config.d.ts +0 -9
- package/dist/datasource/skills/gdrive/connector.d.ts +0 -30
- package/dist/datasource/skills/gdrive/index.d.ts +0 -3
- package/dist/datasource/skills/gdrive/rclone-connector.d.ts +0 -51
- package/dist/datasource/skills/gdrive/skill.d.ts +0 -24
- 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
package/dist/jikji/client.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface CheckMemoryDetails {
|
|
|
8
8
|
signalCount: number;
|
|
9
9
|
topMethod: string | null;
|
|
10
10
|
insightCount: number;
|
|
11
|
+
contextHintCount: number;
|
|
11
12
|
}
|
|
12
13
|
export declare function createCheckMemoryTool(memory: RetrievalMemory): AgentTool<typeof checkMemorySchema, CheckMemoryDetails>;
|
|
13
14
|
export {};
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CheckMemoryDetails } from "./check-memory-tool.js";
|
|
2
2
|
export { createCheckMemoryTool } from "./check-memory-tool.js";
|
|
3
|
-
export type { MemoryEntry, ResultFeedback, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt } from "./memory.js";
|
|
4
|
-
export { RetrievalMemory } from "./memory.js";
|
|
3
|
+
export type { ContextValueHint, EvidenceContext, FeedbackIdInput, MemoryEntry, ResultFeedback, RetrievalContextHints, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt, } from "./memory.js";
|
|
4
|
+
export { normalizeSessionEvidenceRef, RetrievalMemory } from "./memory.js";
|
|
5
5
|
export { renderMemoryContext } from "./renderer.js";
|
package/dist/memory/memory.d.ts
CHANGED
|
@@ -9,7 +9,16 @@ export interface SignalDefaults {
|
|
|
9
9
|
readonly implicitCap: number;
|
|
10
10
|
readonly decayHalfLifeMs?: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface EvidenceContext {
|
|
13
|
+
readonly retrieverMix?: readonly string[];
|
|
14
|
+
readonly parserType?: string;
|
|
15
|
+
readonly documentType?: string;
|
|
16
|
+
readonly documentArea?: string;
|
|
17
|
+
readonly evidenceType?: string;
|
|
18
|
+
readonly evidenceLocation?: string;
|
|
19
|
+
readonly confidence?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface EvidenceChunkRecord extends NormalizedEvidenceRef, EvidenceContext {
|
|
13
22
|
readonly excerptHash: string;
|
|
14
23
|
readonly firstSeenAt: number;
|
|
15
24
|
readonly lastSeenAt: number;
|
|
@@ -24,6 +33,7 @@ export interface CuratedResultRecord {
|
|
|
24
33
|
readonly summary: string;
|
|
25
34
|
readonly resultHash: string;
|
|
26
35
|
readonly evidenceIds: readonly string[];
|
|
36
|
+
readonly confidence?: number;
|
|
27
37
|
readonly createdAt: number;
|
|
28
38
|
}
|
|
29
39
|
export interface FeedbackSignal {
|
|
@@ -53,6 +63,19 @@ export interface MethodHint {
|
|
|
53
63
|
readonly confidence: number;
|
|
54
64
|
readonly reason: string;
|
|
55
65
|
}
|
|
66
|
+
export interface ContextValueHint {
|
|
67
|
+
readonly value: string;
|
|
68
|
+
readonly score: number;
|
|
69
|
+
readonly confidence: number;
|
|
70
|
+
}
|
|
71
|
+
export interface RetrievalContextHints {
|
|
72
|
+
readonly documentAreas: readonly ContextValueHint[];
|
|
73
|
+
readonly documentTypes: readonly ContextValueHint[];
|
|
74
|
+
readonly evidenceTypes: readonly ContextValueHint[];
|
|
75
|
+
readonly evidenceLocations: readonly ContextValueHint[];
|
|
76
|
+
readonly parserTypes: readonly ContextValueHint[];
|
|
77
|
+
readonly retrieverMix: readonly ContextValueHint[];
|
|
78
|
+
}
|
|
56
79
|
export interface RetrievalInsight {
|
|
57
80
|
readonly id: string;
|
|
58
81
|
readonly clusterKey: string;
|
|
@@ -107,7 +130,7 @@ export interface ResultFeedback {
|
|
|
107
130
|
source: string;
|
|
108
131
|
useful: boolean;
|
|
109
132
|
}
|
|
110
|
-
export interface SessionEvidenceRef extends NormalizedEvidenceRef {
|
|
133
|
+
export interface SessionEvidenceRef extends NormalizedEvidenceRef, EvidenceContext {
|
|
111
134
|
readonly metadata?: Record<string, unknown>;
|
|
112
135
|
}
|
|
113
136
|
export interface SessionCuratedResultInput {
|
|
@@ -117,6 +140,7 @@ export interface SessionCuratedResultInput {
|
|
|
117
140
|
readonly content: string;
|
|
118
141
|
readonly method: string;
|
|
119
142
|
readonly source: string;
|
|
143
|
+
readonly confidence?: number;
|
|
120
144
|
readonly evidenceRefs: readonly SessionEvidenceRef[];
|
|
121
145
|
}
|
|
122
146
|
export interface SessionRecordInput {
|
|
@@ -132,6 +156,10 @@ export interface NumberedFeedbackInput {
|
|
|
132
156
|
readonly useful: boolean;
|
|
133
157
|
}[];
|
|
134
158
|
}
|
|
159
|
+
export interface FeedbackIdInput {
|
|
160
|
+
readonly feedbackId: string;
|
|
161
|
+
readonly useful: boolean;
|
|
162
|
+
}
|
|
135
163
|
export interface RetrievalMemoryOptions {
|
|
136
164
|
storagePath: string;
|
|
137
165
|
insightExtractor?: InsightExtractor;
|
|
@@ -150,8 +178,10 @@ export declare class RetrievalMemory {
|
|
|
150
178
|
getSignalCount(): number;
|
|
151
179
|
recordCuratedResultsSession(input: SessionRecordInput): void;
|
|
152
180
|
recordNumberedFeedback(input: NumberedFeedbackInput): boolean;
|
|
181
|
+
recordFeedbackByIds(feedback: readonly FeedbackIdInput[]): boolean;
|
|
153
182
|
recordWeakSignal(query: string, method: string, source: "followup" | "retry"): void;
|
|
154
|
-
getMethodHints(
|
|
183
|
+
getMethodHints(_query: string): MethodHint[];
|
|
184
|
+
getContextHints(_query: string): RetrievalContextHints;
|
|
155
185
|
getInsights(query: string): RetrievalInsight[];
|
|
156
186
|
getMethodPriority(query: string): Array<{
|
|
157
187
|
method: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { MethodHint, RetrievalInsight } from "./memory.js";
|
|
1
|
+
import type { MethodHint, RetrievalContextHints, RetrievalInsight } from "./memory.js";
|
|
2
2
|
export declare function renderMemoryContext(hints: readonly MethodHint[], opts?: {
|
|
3
3
|
maxHints?: number;
|
|
4
4
|
insights?: readonly RetrievalInsight[];
|
|
5
5
|
maxInsights?: number;
|
|
6
|
+
contextHints?: RetrievalContextHints;
|
|
6
7
|
}): string;
|
package/dist/minsync/client.d.ts
CHANGED
|
@@ -3,12 +3,16 @@ export interface MinSyncClientOptions {
|
|
|
3
3
|
readonly binaryPath: string;
|
|
4
4
|
readonly workspacePath: string;
|
|
5
5
|
readonly embedder?: MinSyncEmbedderConfig;
|
|
6
|
+
readonly maxChunkSize?: number;
|
|
6
7
|
}
|
|
8
|
+
export type MinSyncQueryMode = "vector" | "bm25" | "hybrid";
|
|
7
9
|
export declare class MinSyncClient {
|
|
8
10
|
private readonly binaryPath;
|
|
9
11
|
private readonly workspacePath;
|
|
10
12
|
private readonly embedder;
|
|
13
|
+
private readonly maxChunkSize;
|
|
11
14
|
constructor(options: MinSyncClientOptions);
|
|
12
15
|
sync(): Promise<MinSyncSyncResult>;
|
|
13
|
-
query(text: string, topK: number): Promise<readonly MinSyncQueryHit[]>;
|
|
16
|
+
query(text: string, topK: number, mode?: MinSyncQueryMode): Promise<readonly MinSyncQueryHit[]>;
|
|
17
|
+
private spawn;
|
|
14
18
|
}
|
|
@@ -7,6 +7,7 @@ import type { MinSyncEmbedderConfig } from "./types.js";
|
|
|
7
7
|
export declare const MINSYNC_CONFIG_DIR = ".minsync";
|
|
8
8
|
export declare const MINSYNC_CONFIG_FILE = "config.toml";
|
|
9
9
|
export declare function minSyncConfigPath(workspacePath: string): string;
|
|
10
|
+
export declare function configuredMaxChunkSize(workspacePath: string): number | undefined;
|
|
10
11
|
/**
|
|
11
12
|
* Atomically rewrite allowlisted embedder fields in MinSync config.toml.
|
|
12
13
|
* Reads the existing file, merges the allowlisted fields from `embedder`,
|
|
@@ -19,4 +20,6 @@ export declare function minSyncConfigPath(workspacePath: string): string;
|
|
|
19
20
|
*
|
|
20
21
|
* Returns true if the file was rewritten, false if the file does not exist.
|
|
21
22
|
*/
|
|
22
|
-
export declare function rewriteEmbedderConfig(workspacePath: string, embedder: MinSyncEmbedderConfig
|
|
23
|
+
export declare function rewriteEmbedderConfig(workspacePath: string, embedder: MinSyncEmbedderConfig, chunkerConfig?: {
|
|
24
|
+
readonly maxChunkSize?: number;
|
|
25
|
+
}): boolean;
|
package/dist/minsync/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { MinSyncClient, type MinSyncClientOptions } from "./client.js";
|
|
1
|
+
export { MinSyncClient, type MinSyncClientOptions, type MinSyncQueryMode } from "./client.js";
|
|
2
2
|
export { MINSYNC_CONFIG_DIR, MINSYNC_CONFIG_FILE, minSyncConfigPath, rewriteEmbedderConfig, } from "./embedder-config.js";
|
|
3
|
-
export { type EnsureMinSyncBinaryOptions, ensureMinSyncBinary, executableName, fetchLatestMinSyncRelease, type InstalledMinSyncBinary, type MinSyncRelease, type MinSyncReleaseAsset, MinSyncReleaseError, selectReleaseAsset, } from "./installer.js";
|
|
4
|
-
export { MinSyncVectorMethod, type MinSyncVectorMethodOptions } from "./method.js";
|
|
3
|
+
export { type EnsureMinSyncBinaryOptions, ensureMinSyncBinary, executableName, fetchLatestMinSyncRelease, type InstalledMinSyncBinary, MINSYNC_VERSION, type MinSyncRelease, type MinSyncReleaseAsset, MinSyncReleaseError, selectReleaseAsset, } from "./installer.js";
|
|
4
|
+
export { MinSyncBM25Method, type MinSyncBM25MethodOptions, MinSyncHybridMethod, type MinSyncHybridMethodOptions, MinSyncVectorMethod, type MinSyncVectorMethodOptions, } from "./method.js";
|
|
5
5
|
export { MINSYNC_FILES_SUBDIR, MINSYNC_SUBDIR, minSyncDocumentPath, minSyncWorkspaceRoot } from "./paths.js";
|
|
6
|
-
export type { MinSyncEmbedderConfig, MinSyncOptions, MinSyncQueryHit, MinSyncSyncResult } from "./types.js";
|
|
6
|
+
export type { MinSyncChunkerConfig, MinSyncEmbedderConfig, MinSyncOptions, MinSyncQueryHit, MinSyncSyncResult, } from "./types.js";
|
|
7
7
|
export { buildMinSyncPathMap, type MinSyncWorkspaceEntry, type MinSyncWorkspaceSyncResult, syncMinSyncWorkspace, } from "./workspace.js";
|
package/dist/minsync/method.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type BM25Status, type BM25SyncResult } from "../retrieval/methods/bm25.js";
|
|
1
2
|
import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../retrieval/types.js";
|
|
3
|
+
import type { MinSyncQueryMode } from "./client.js";
|
|
2
4
|
import { type EnsureMinSyncBinaryOptions } from "./installer.js";
|
|
3
5
|
import type { MinSyncEmbedderConfig, MinSyncSyncResult } from "./types.js";
|
|
4
6
|
export interface MinSyncVectorMethodOptions {
|
|
@@ -8,7 +10,11 @@ export interface MinSyncVectorMethodOptions {
|
|
|
8
10
|
readonly installer?: Omit<EnsureMinSyncBinaryOptions, "root">;
|
|
9
11
|
readonly autoInstall?: boolean;
|
|
10
12
|
readonly embedder?: MinSyncEmbedderConfig;
|
|
13
|
+
readonly maxChunkSize?: number;
|
|
14
|
+
readonly mode?: MinSyncQueryMode;
|
|
11
15
|
}
|
|
16
|
+
export type MinSyncBM25MethodOptions = Omit<MinSyncVectorMethodOptions, "mode">;
|
|
17
|
+
export type MinSyncHybridMethodOptions = Omit<MinSyncVectorMethodOptions, "mode">;
|
|
12
18
|
export declare class MinSyncVectorMethod implements RetrievalMethod {
|
|
13
19
|
private readonly root;
|
|
14
20
|
private readonly binaryPath;
|
|
@@ -16,6 +22,8 @@ export declare class MinSyncVectorMethod implements RetrievalMethod {
|
|
|
16
22
|
private readonly installer;
|
|
17
23
|
private readonly autoInstall;
|
|
18
24
|
private readonly embedder;
|
|
25
|
+
private readonly maxChunkSize;
|
|
26
|
+
private readonly mode;
|
|
19
27
|
constructor(options: MinSyncVectorMethodOptions);
|
|
20
28
|
describe(): RetrievalMethodDescriptor;
|
|
21
29
|
sync(): Promise<MinSyncSyncResult>;
|
|
@@ -33,5 +41,18 @@ export declare class MinSyncVectorMethod implements RetrievalMethod {
|
|
|
33
41
|
* Returns: string path on success, undefined for missing-binary, or a MinSyncSyncResult
|
|
34
42
|
* for install-failed.
|
|
35
43
|
*/
|
|
36
|
-
|
|
44
|
+
protected resolveBinary(): Promise<string | undefined | MinSyncSyncResult>;
|
|
45
|
+
}
|
|
46
|
+
export declare class MinSyncBM25Method extends MinSyncVectorMethod {
|
|
47
|
+
private status;
|
|
48
|
+
constructor(options: MinSyncBM25MethodOptions);
|
|
49
|
+
describe(): RetrievalMethodDescriptor;
|
|
50
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
51
|
+
syncFromMinSync(result: MinSyncSyncResult): BM25SyncResult;
|
|
52
|
+
getStatus(): BM25Status;
|
|
53
|
+
private resolveBinaryForRetrieve;
|
|
54
|
+
}
|
|
55
|
+
export declare class MinSyncHybridMethod extends MinSyncVectorMethod {
|
|
56
|
+
constructor(options: MinSyncHybridMethodOptions);
|
|
57
|
+
describe(): RetrievalMethodDescriptor;
|
|
37
58
|
}
|
package/dist/minsync/types.d.ts
CHANGED
|
@@ -13,12 +13,17 @@ export interface MinSyncEmbedderConfig {
|
|
|
13
13
|
readonly maxRetries?: number;
|
|
14
14
|
readonly maxConcurrent?: number;
|
|
15
15
|
}
|
|
16
|
+
/** MinSync chunker settings exposed by AutoRAG's public configuration. */
|
|
17
|
+
export interface MinSyncChunkerConfig {
|
|
18
|
+
readonly maxChunkSize?: number;
|
|
19
|
+
}
|
|
16
20
|
export interface MinSyncOptions {
|
|
17
21
|
readonly root: string;
|
|
18
22
|
readonly binaryPath?: string;
|
|
19
23
|
readonly workspacePath?: string;
|
|
20
24
|
readonly autoInstall?: boolean;
|
|
21
25
|
readonly embedder?: MinSyncEmbedderConfig;
|
|
26
|
+
readonly maxChunkSize?: number;
|
|
22
27
|
}
|
|
23
28
|
export interface MinSyncSyncResult {
|
|
24
29
|
readonly ok: boolean;
|
package/dist/mirror/sync.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ export interface ParsedMirrorSyncOptions {
|
|
|
10
10
|
readonly force?: boolean;
|
|
11
11
|
/** Override max source size for parse attempts (bytes). */
|
|
12
12
|
readonly maxSourceBytes?: number;
|
|
13
|
+
/** Absolute source paths omitted from parsed mirrors (for example exact duplicate copies). */
|
|
14
|
+
readonly excludeSourcePaths?: ReadonlySet<string>;
|
|
13
15
|
}
|
|
14
|
-
export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "deleted-mirror" | "stale-index";
|
|
16
|
+
export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "pdf-java-version" | "duplicate-excluded" | "deleted-mirror" | "stale-index" | "pdf-extract-thin" | "pdf-hybrid-unavailable";
|
|
15
17
|
/** Path-opaque refresh diagnostic. `source` is an opaque virtual path, never a real fs path. */
|
|
16
18
|
export interface ParsedMirrorDiagnostic {
|
|
17
19
|
readonly code: ParsedMirrorDiagnosticCode;
|
|
@@ -3,8 +3,7 @@ export type AutoRAGRunEvent = {
|
|
|
3
3
|
timestamp: string;
|
|
4
4
|
sessionId: string;
|
|
5
5
|
queryLength: number;
|
|
6
|
-
|
|
7
|
-
explorerModel: string;
|
|
6
|
+
model: string;
|
|
8
7
|
} | {
|
|
9
8
|
event: "search_completed";
|
|
10
9
|
timestamp: string;
|
|
@@ -21,30 +20,6 @@ export type AutoRAGRunEvent = {
|
|
|
21
20
|
sessionId: string;
|
|
22
21
|
failureCount: number;
|
|
23
22
|
errorTypes: string[];
|
|
24
|
-
} | {
|
|
25
|
-
event: "dispatch_rejected";
|
|
26
|
-
schemaVersion: 1;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
toolCallId: string | null;
|
|
29
|
-
sequence: number;
|
|
30
|
-
timestamp: string;
|
|
31
|
-
dispatchKind: "launch" | "admin" | "control" | "mutation" | "schedule" | "hybrid" | "unknown";
|
|
32
|
-
code: string;
|
|
33
|
-
field: string;
|
|
34
|
-
forceCorrectable: boolean;
|
|
35
|
-
} | {
|
|
36
|
-
event: "dispatch_autofilled";
|
|
37
|
-
schemaVersion: 1;
|
|
38
|
-
sessionId: string;
|
|
39
|
-
toolCallId: string | null;
|
|
40
|
-
sequence: number;
|
|
41
|
-
timestamp: string;
|
|
42
|
-
dispatchKind: "launch";
|
|
43
|
-
fields: {
|
|
44
|
-
artifacts: boolean;
|
|
45
|
-
agentScope: boolean;
|
|
46
|
-
leafModelFillCount: number;
|
|
47
|
-
};
|
|
48
23
|
};
|
|
49
24
|
export declare class AutoRAGRunLogger {
|
|
50
25
|
private readonly path;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type HwpParserOptions } from "./hwp.js";
|
|
2
2
|
import { type OcrParserOptions } from "./ocr.js";
|
|
3
|
+
import { type OpendataloaderPdfParserOptions } from "./opendataloader-pdf.js";
|
|
3
4
|
import { ParserRegistry } from "./registry.js";
|
|
4
5
|
export interface DefaultParserRegistryOptions {
|
|
5
6
|
readonly ocr?: OcrParserOptions;
|
|
6
7
|
readonly hwp?: HwpParserOptions;
|
|
8
|
+
readonly thinExtract?: OpendataloaderPdfParserOptions["thinExtract"];
|
|
7
9
|
}
|
|
8
10
|
export declare function createDefaultParserRegistry(options?: DefaultParserRegistryOptions): ParserRegistry;
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { ParseError } from "./errors.js";
|
|
|
4
4
|
export { HwpParser, type HwpParserOptions } from "./hwp.js";
|
|
5
5
|
export { ImageOcrParser, type OcrEngine, type OcrEngineInput, type OcrParserOptions } from "./ocr.js";
|
|
6
6
|
export { DocxParser, PptxParser, XlsxParser } from "./office.js";
|
|
7
|
-
export { OpendataloaderPdfParser, type PdfConverter } from "./opendataloader-pdf.js";
|
|
7
|
+
export { OpendataloaderPdfParser, type OpendataloaderPdfParserOptions, type PdfConverter, } from "./opendataloader-pdf.js";
|
|
8
8
|
export { PlainTextParser } from "./plain-text.js";
|
|
9
9
|
export { ParserRegistry } from "./registry.js";
|
|
10
10
|
export type { HwpExtractionLimits, HwpExtractor } from "./rhwp-adapter.js";
|
|
11
|
-
export { type ParseInput, type ParseOutput, Parser } from "./types.js";
|
|
11
|
+
export { type ParseDiagnostic, type ParseDiagnosticCode, type ParseInput, type ParseOutput, Parser, } from "./types.js";
|
|
@@ -10,6 +10,16 @@ export interface OpendataloaderPdfParserOptions {
|
|
|
10
10
|
readonly hybridMode?: string;
|
|
11
11
|
readonly maxBytes?: number;
|
|
12
12
|
};
|
|
13
|
+
/** Quality gate for multi-page PDFs whose local markdown yield is abnormally thin. */
|
|
14
|
+
readonly thinExtract?: {
|
|
15
|
+
readonly enabled?: boolean;
|
|
16
|
+
readonly minPages?: number;
|
|
17
|
+
readonly minChars?: number;
|
|
18
|
+
readonly minCharsPerPage?: number;
|
|
19
|
+
readonly timeoutMs?: number;
|
|
20
|
+
readonly hybrid?: string;
|
|
21
|
+
readonly hybridMode?: string;
|
|
22
|
+
};
|
|
13
23
|
}
|
|
14
24
|
export declare class OpendataloaderPdfParser extends Parser {
|
|
15
25
|
readonly name = "opendataloader-pdf";
|
package/dist/parser/types.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ export interface ParseInput {
|
|
|
6
6
|
export interface ParseOutput {
|
|
7
7
|
readonly markdown: string;
|
|
8
8
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly diagnostics?: readonly ParseDiagnostic[];
|
|
10
|
+
}
|
|
11
|
+
export type ParseDiagnosticCode = "pdf-extract-thin" | "pdf-hybrid-unavailable";
|
|
12
|
+
export interface ParseDiagnostic {
|
|
13
|
+
readonly code: ParseDiagnosticCode;
|
|
14
|
+
readonly severity: "warning";
|
|
15
|
+
readonly message: string;
|
|
9
16
|
}
|
|
10
17
|
export declare abstract class Parser {
|
|
11
18
|
abstract readonly name: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PortableSpawnCommand {
|
|
2
|
+
readonly command: string;
|
|
3
|
+
readonly args: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Windows does not execute Unix shebang files or extensionless scripts through
|
|
7
|
+
* child_process.spawn. Resolve test/dev script entrypoints through their
|
|
8
|
+
* interpreter while leaving native executables untouched.
|
|
9
|
+
*/
|
|
10
|
+
export declare function portableSpawnCommand(command: string, args: readonly string[], platform?: NodeJS.Platform): PortableSpawnCommand;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { MergeOptions } from "./merger.js";
|
|
2
2
|
export { ParallelRetriever, ResultMerger } from "./merger.js";
|
|
3
|
-
export type { BM25Engine,
|
|
4
|
-
export {
|
|
3
|
+
export type { BM25Engine, BM25ReadinessState, BM25Status, BM25SyncResult } from "./methods/bm25.js";
|
|
4
|
+
export { BM25_SUBDIR, BM25UnavailableError, hasLegacyBm25Artifacts, removeLegacyBm25Artifacts, } from "./methods/bm25.js";
|
|
5
5
|
export { RetrievalMethodRegistry } from "./registry.js";
|
|
6
6
|
export { matchesVirtualPathScope, normalizeVirtualPath, normalizeVirtualPathScope, virtualPathScopeToRegExp, } from "./scope.js";
|
|
7
7
|
export type { CuratedResult, NumberedResult, RetrievalDiagnostic, RetrievalDiagnosticCode, RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult, RetrievalWithDiagnostics, } from "./types.js";
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type BM25Engine = "
|
|
4
|
-
export type BM25FallbackMode = "typescript" | "disabled";
|
|
5
|
-
export interface BM25MethodOptions {
|
|
6
|
-
readonly root: string;
|
|
7
|
-
readonly indexPath?: string;
|
|
8
|
-
readonly enabled?: boolean;
|
|
9
|
-
readonly fallback?: BM25FallbackMode;
|
|
10
|
-
readonly forceEngine?: Exclude<BM25Engine, "none">;
|
|
11
|
-
readonly importBinding?: () => Promise<TantivyBinding>;
|
|
12
|
-
}
|
|
1
|
+
export type BM25ReadinessState = "disabled" | "dependency_unavailable" | "index_missing" | "indexing" | "ready" | "error";
|
|
2
|
+
/** Local BM25 is always MinSync-backed when enabled. */
|
|
3
|
+
export type BM25Engine = "minsync" | "none";
|
|
13
4
|
export interface BM25SyncResult {
|
|
14
5
|
readonly indexPath: string;
|
|
15
6
|
readonly indexedChunks: number;
|
|
@@ -21,32 +12,12 @@ export interface BM25Status {
|
|
|
21
12
|
readonly engine: BM25Engine;
|
|
22
13
|
readonly message?: string;
|
|
23
14
|
}
|
|
24
|
-
|
|
15
|
+
/** Legacy AutoRAG-local BM25 artifact directory. Never an active index. */
|
|
25
16
|
export declare const BM25_SUBDIR: string;
|
|
26
17
|
export declare class BM25UnavailableError extends Error {
|
|
27
18
|
readonly readiness: BM25ReadinessState;
|
|
28
19
|
constructor(readiness: BM25ReadinessState, message: string);
|
|
29
20
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
private readonly fallback;
|
|
34
|
-
private readonly forceEngine;
|
|
35
|
-
private readonly importBinding;
|
|
36
|
-
private status;
|
|
37
|
-
constructor(options: BM25MethodOptions);
|
|
38
|
-
describe(): RetrievalMethodDescriptor;
|
|
39
|
-
getStatus(): BM25Status;
|
|
40
|
-
sync(): Promise<BM25SyncResult>;
|
|
41
|
-
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
42
|
-
private writeTantivyIndex;
|
|
43
|
-
private retrieveTantivy;
|
|
44
|
-
private writeFallbackIndex;
|
|
45
|
-
private retrieveFallback;
|
|
46
|
-
private readFallbackIndex;
|
|
47
|
-
private hasFallbackIndex;
|
|
48
|
-
private tantivyIndexPath;
|
|
49
|
-
private fallbackIndexPath;
|
|
50
|
-
private syncResult;
|
|
51
|
-
}
|
|
52
|
-
export {};
|
|
21
|
+
/** Remove leftover `.autorag/bm25` artifacts from the pre-MinSync BM25 path. */
|
|
22
|
+
export declare function removeLegacyBm25Artifacts(root: string): void;
|
|
23
|
+
export declare function hasLegacyBm25Artifacts(root: string): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface BrowseEntry {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly directory: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface BrowseResult {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly parent: string | null;
|
|
9
|
+
readonly entries: readonly BrowseEntry[];
|
|
10
|
+
}
|
|
11
|
+
export declare function browseDirectory(inputPath: string | undefined): BrowseResult;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operator-facing connection catalog for the local datasource UI.
|
|
3
|
+
*
|
|
4
|
+
* Each built-in factory key gets a small form: paths, env-var *names*,
|
|
5
|
+
* feed/repo lists, and optional CLI binary paths. Secret values are never
|
|
6
|
+
* catalog fields.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LOCAL_FOLDERS_ID = "local-folders";
|
|
9
|
+
export type CatalogFieldKind = "text" | "path" | "path-list" | "env" | "textarea" | "select" | "checkbox";
|
|
10
|
+
export interface CatalogField {
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly kind: CatalogFieldKind;
|
|
14
|
+
readonly help?: string;
|
|
15
|
+
readonly required?: boolean;
|
|
16
|
+
readonly placeholder?: string;
|
|
17
|
+
readonly options?: readonly {
|
|
18
|
+
readonly value: string;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
}[];
|
|
21
|
+
}
|
|
22
|
+
export interface DatasourceTypeCatalog {
|
|
23
|
+
readonly type: string;
|
|
24
|
+
readonly title: string;
|
|
25
|
+
readonly summary: string;
|
|
26
|
+
readonly defaultTags: readonly string[];
|
|
27
|
+
readonly binaryName?: string;
|
|
28
|
+
readonly installHint?: string;
|
|
29
|
+
readonly fields: readonly CatalogField[];
|
|
30
|
+
}
|
|
31
|
+
export declare const DATASOURCE_TYPE_CATALOG: readonly DatasourceTypeCatalog[];
|
|
32
|
+
export declare function getDatasourceType(type: string): DatasourceTypeCatalog | undefined;
|
|
33
|
+
export type SourcePickerKind = "folders" | "index" | "datasource";
|
|
34
|
+
export interface SourcePickerEntry {
|
|
35
|
+
readonly type: string;
|
|
36
|
+
readonly title: string;
|
|
37
|
+
readonly summary: string;
|
|
38
|
+
readonly kind: SourcePickerKind;
|
|
39
|
+
readonly binaryName?: string;
|
|
40
|
+
readonly installHint?: string;
|
|
41
|
+
/** False for sources that cannot attach a second account (KakaoTalk). */
|
|
42
|
+
readonly supportsMultiple: boolean;
|
|
43
|
+
readonly extras: readonly PickerExtra[];
|
|
44
|
+
}
|
|
45
|
+
export type PickerExtraKind = "text" | "textarea" | "select" | "path";
|
|
46
|
+
export interface PickerExtra {
|
|
47
|
+
readonly key: string;
|
|
48
|
+
readonly label: string;
|
|
49
|
+
readonly kind: PickerExtraKind;
|
|
50
|
+
readonly placeholder?: string;
|
|
51
|
+
readonly help?: string;
|
|
52
|
+
readonly choices?: "rclone-remotes" | "mail-accounts";
|
|
53
|
+
readonly allowOther?: boolean;
|
|
54
|
+
/** Asked in the coding-agent prompt when this extra is left blank. */
|
|
55
|
+
readonly question: string;
|
|
56
|
+
}
|
|
57
|
+
export declare const SOURCE_PICKER: readonly SourcePickerEntry[];
|
|
58
|
+
export declare function getPickerEntry(type: string): SourcePickerEntry | undefined;
|
|
59
|
+
export declare function assertCatalogCoversBuiltins(): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trusted config mutations for the local datasource UI.
|
|
3
|
+
*
|
|
4
|
+
* Reads/writes the operator `config.json` on disk. Never persists secret
|
|
5
|
+
* values — only env-var names, paths, and lists. Enabling a connection
|
|
6
|
+
* recomputes `datasourceAccess` from catalog tags + `/${alias}/**` scopes.
|
|
7
|
+
*/
|
|
8
|
+
import { DATASOURCE_TYPE_CATALOG, SOURCE_PICKER } from "./catalog.js";
|
|
9
|
+
import { type ProbeResult } from "./probe.js";
|
|
10
|
+
export interface ConnectionInput {
|
|
11
|
+
readonly alias: string;
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly enabled?: boolean;
|
|
14
|
+
readonly instanceId?: string;
|
|
15
|
+
readonly connector?: Record<string, unknown>;
|
|
16
|
+
readonly tags?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface UiConnection {
|
|
19
|
+
readonly alias: string;
|
|
20
|
+
readonly type: string;
|
|
21
|
+
readonly enabled: boolean;
|
|
22
|
+
readonly instanceId?: string;
|
|
23
|
+
readonly connector: Record<string, unknown>;
|
|
24
|
+
readonly tags: readonly string[];
|
|
25
|
+
readonly probe: ProbeResult;
|
|
26
|
+
}
|
|
27
|
+
export interface UiState {
|
|
28
|
+
readonly searchPaths: readonly string[];
|
|
29
|
+
readonly connections: readonly UiConnection[];
|
|
30
|
+
readonly catalog: typeof DATASOURCE_TYPE_CATALOG;
|
|
31
|
+
readonly picker: typeof SOURCE_PICKER;
|
|
32
|
+
readonly access: {
|
|
33
|
+
readonly allowedTags: readonly string[];
|
|
34
|
+
readonly allowedScopes: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare function listUiState(configPath: string, env?: NodeJS.ProcessEnv): UiState;
|
|
38
|
+
export declare function upsertConnection(configPath: string, input: ConnectionInput): UiState;
|
|
39
|
+
export declare function toggleConnection(configPath: string, alias: string, enabled: boolean): UiState;
|
|
40
|
+
export declare function removeConnection(configPath: string, alias: string): UiState;
|
|
41
|
+
export declare function setSearchPaths(configPath: string, searchPaths: readonly string[]): UiState;
|
|
42
|
+
export declare function normalizeAlias(alias: string): string;
|
|
43
|
+
export declare function stripSecrets<T>(value: T): T;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort local account/remote discovery for the datasource UI.
|
|
3
|
+
* Spawns operator CLIs with a short timeout. Failures return empty lists.
|
|
4
|
+
*/
|
|
5
|
+
export interface Choice {
|
|
6
|
+
readonly value: string;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
}
|
|
9
|
+
export type DiscoverRun = (binary: string, args: readonly string[]) => Promise<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
stdout: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function listRcloneRemotes(run?: DiscoverRun): Promise<readonly Choice[]>;
|
|
14
|
+
export declare function listMailAccounts(run?: DiscoverRun): Promise<readonly Choice[]>;
|
|
15
|
+
export declare function listHimalayaAccounts(run?: DiscoverRun): Promise<readonly Choice[]>;
|
|
16
|
+
export declare function choicesForType(type: string, run?: DiscoverRun): Promise<{
|
|
17
|
+
rcloneRemotes: readonly Choice[];
|
|
18
|
+
mailAccounts: readonly Choice[];
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local, side-effect-free connection probes for the datasource UI.
|
|
3
|
+
*
|
|
4
|
+
* Checks env-var presence, path existence, and CLI binaries on PATH.
|
|
5
|
+
* Never returns secret values.
|
|
6
|
+
*/
|
|
7
|
+
export type ProbeStatus = "ready" | "auth-missing" | "binary-missing" | "path-missing" | "not-configured" | "unknown-type";
|
|
8
|
+
export interface ProbeResult {
|
|
9
|
+
readonly ok: boolean;
|
|
10
|
+
readonly status: ProbeStatus;
|
|
11
|
+
readonly detail: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProbeConnectionInput {
|
|
14
|
+
readonly alias: string;
|
|
15
|
+
readonly type: string;
|
|
16
|
+
readonly enabled?: boolean;
|
|
17
|
+
readonly connector?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface ProbeDeps {
|
|
20
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
21
|
+
readonly pathExists?: (path: string) => boolean;
|
|
22
|
+
readonly binaryExists?: (binaryName: string, binaryPath?: string) => boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function probeConnection(input: ProbeConnectionInput, deps?: ProbeDeps): ProbeResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Short copy-paste prompt for a coding agent.
|
|
3
|
+
*
|
|
4
|
+
* The operator picks a type, names it, and may fill optional extras
|
|
5
|
+
* (repos, remotes, mailbox). Blank extras become questions the agent
|
|
6
|
+
* must ask the user.
|
|
7
|
+
*/
|
|
8
|
+
export interface RegistrationPromptInput {
|
|
9
|
+
readonly type: string;
|
|
10
|
+
readonly alias?: string;
|
|
11
|
+
readonly note?: string;
|
|
12
|
+
readonly extras?: Readonly<Record<string, string>>;
|
|
13
|
+
}
|
|
14
|
+
export interface RegistrationPrompt {
|
|
15
|
+
readonly type: string;
|
|
16
|
+
readonly title: string;
|
|
17
|
+
readonly alias: string;
|
|
18
|
+
readonly prompt: string;
|
|
19
|
+
readonly questions: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
export declare function buildRegistrationPrompt(input: RegistrationPromptInput): RegistrationPrompt;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loopback-only HTTP server for the datasource UI.
|
|
3
|
+
*
|
|
4
|
+
* Binds 127.0.0.1 / ::1, requires a session token, and never returns secret
|
|
5
|
+
* connector values. This is a trusted local control plane — the same trust
|
|
6
|
+
* boundary as editing config.json by hand.
|
|
7
|
+
*/
|
|
8
|
+
export interface StartUiServerOptions {
|
|
9
|
+
readonly configPath: string;
|
|
10
|
+
readonly host?: string;
|
|
11
|
+
readonly port?: number;
|
|
12
|
+
readonly token: string;
|
|
13
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
14
|
+
readonly allowRemote?: boolean;
|
|
15
|
+
readonly publicOrigin?: string;
|
|
16
|
+
readonly corsOrigins?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
export interface UiServer {
|
|
19
|
+
readonly url: string;
|
|
20
|
+
readonly origin: string;
|
|
21
|
+
readonly host: string;
|
|
22
|
+
readonly port: number;
|
|
23
|
+
readonly token: string;
|
|
24
|
+
close(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare function isLoopbackHost(host: string): boolean;
|
|
27
|
+
export declare function isLoopbackAddress(address: string | undefined): boolean;
|
|
28
|
+
export declare function startUiServer(options: StartUiServerOptions): Promise<UiServer>;
|