@autorag/librarian 2.5.2 → 2.6.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/NOTICE +10 -13
- package/README.md +53 -13
- package/dist/agent/agent.d.ts +25 -15
- package/dist/agent/index.d.ts +1 -2
- package/dist/agent/refresh-progress.d.ts +30 -0
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/agent/search-single-datasource-tool.d.ts +14 -8
- package/dist/cli/commands/report.d.ts +3 -0
- package/dist/cli/commands/serve.d.ts +2 -1
- package/dist/cli/config.d.ts +1 -10
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +20731 -21656
- package/dist/core.d.ts +1 -1
- package/dist/core.js +2781 -1790
- package/dist/datasource/errors.d.ts +1 -1
- package/dist/datasource/index.d.ts +3 -2
- package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +2 -2
- package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
- package/dist/datasource/skills/github-gist/index.d.ts +3 -0
- package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
- package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
- package/dist/datasource/skills/lark/client.d.ts +23 -0
- package/dist/datasource/skills/lark/index.d.ts +2 -0
- package/dist/datasource/skills/lark/skill.d.ts +36 -0
- package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
- package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
- package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
- package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
- package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
- package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
- package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
- package/dist/datasource/types.d.ts +4 -4
- package/dist/embedding-runtime/manifest.d.ts +8 -0
- package/dist/embedding-runtime/types.d.ts +4 -0
- package/dist/index.js +2792 -1800
- package/dist/language.d.ts +21 -0
- package/dist/memory/memory.d.ts +0 -1
- package/dist/mirror/paths.d.ts +2 -0
- package/dist/mirror/sync.d.ts +1 -1
- package/dist/p2p/simplex-server.d.ts +21 -5
- package/dist/p2p/simplex-transport.d.ts +21 -4
- package/dist/parser/defaults.d.ts +10 -4
- package/dist/parser/index.d.ts +3 -5
- package/dist/parser/kordoc.d.ts +53 -0
- package/dist/parser/ocr-engines.d.ts +12 -0
- package/dist/parser/ocr.d.ts +7 -1
- package/dist/parser/office.d.ts +1 -10
- package/dist/parser/types.d.ts +1 -1
- package/dist/process/terminate-tree.d.ts +2 -0
- package/dist/retrieval/types.d.ts +1 -1
- package/licenses/embedding-assets.json +20 -4
- package/package.json +10 -10
- package/skills/autorag-doctor/SKILL.md +4 -3
- package/skills/autorag-lite-search/SKILL.md +57 -7
- package/skills/autorag-lite-setup/SKILL.md +4 -4
- package/skills/autorag-setup/SKILL.md +11 -8
- package/dist/agent/search-datasource-tool.d.ts +0 -30
- package/dist/cli/commands/ui.d.ts +0 -13
- package/dist/datasource/skills/katok/client.d.ts +0 -21
- package/dist/datasource/skills/katok/index.d.ts +0 -12
- package/dist/datasource/skills/katok/paths.d.ts +0 -40
- package/dist/datasource/skills/katok/types.d.ts +0 -123
- package/dist/parser/hwp-markdown.d.ts +0 -25
- package/dist/parser/hwp.d.ts +0 -13
- package/dist/parser/opendataloader-pdf.d.ts +0 -31
- package/dist/parser/rhwp-adapter.d.ts +0 -30
- package/dist/ui/browse.d.ts +0 -11
- package/dist/ui/catalog.d.ts +0 -59
- package/dist/ui/config-store.d.ts +0 -43
- package/dist/ui/discover.d.ts +0 -17
- package/dist/ui/html.d.ts +0 -2
- package/dist/ui/probe.d.ts +0 -24
- package/dist/ui/prompt.d.ts +0 -21
- package/dist/ui/server.d.ts +0 -28
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
-
import { Type } from "typebox";
|
|
3
|
-
import type { RetrievalDiagnostic, RetrievalResult } from "../retrieval/types.js";
|
|
4
|
-
import { type SearchDocumentRetrievalTraceResult } from "./search-documents.js";
|
|
5
|
-
export declare const SEARCH_DATASOURCE_DOCUMENTS_TOOL_NAME = "search_datasource_documents";
|
|
6
|
-
declare const searchDatasourceSchema: Type.TObject<{
|
|
7
|
-
query: Type.TString;
|
|
8
|
-
topK: Type.TOptional<Type.TInteger>;
|
|
9
|
-
scope: Type.TOptional<Type.TString>;
|
|
10
|
-
}>;
|
|
11
|
-
export interface SearchDatasourceDocumentsDetails {
|
|
12
|
-
readonly method: "datasource";
|
|
13
|
-
readonly resultCount: number;
|
|
14
|
-
readonly sources: readonly string[];
|
|
15
|
-
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
16
|
-
/** Top candidates in traceable shape (additive; used for the run's retrieval trace). */
|
|
17
|
-
readonly results?: readonly SearchDocumentRetrievalTraceResult[];
|
|
18
|
-
}
|
|
19
|
-
export interface DatasourceSearchProvider {
|
|
20
|
-
searchDatasourceDocuments(query: string, options?: {
|
|
21
|
-
readonly topK?: number;
|
|
22
|
-
readonly scope?: string;
|
|
23
|
-
}): Promise<{
|
|
24
|
-
readonly results: readonly RetrievalResult[];
|
|
25
|
-
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
export declare function createSearchDatasourceDocumentsTool(provider: DatasourceSearchProvider): AgentTool<typeof searchDatasourceSchema, SearchDatasourceDocumentsDetails>;
|
|
29
|
-
export declare function formatDatasourceResults(results: readonly RetrievalResult[], diagnostics: readonly RetrievalDiagnostic[]): string;
|
|
30
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { startUiServer, type UiServer } from "../../ui/server.js";
|
|
2
|
-
import type { CommandContext } from "./types.js";
|
|
3
|
-
export interface UiCommandDeps {
|
|
4
|
-
readonly startServer?: typeof startUiServer;
|
|
5
|
-
readonly openBrowser?: (url: string) => Promise<void>;
|
|
6
|
-
readonly waitUntilStopped?: (server: UiServer) => Promise<void>;
|
|
7
|
-
readonly createToken?: () => string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* `autorag ui` — local loopback dashboard for folders and datasource connections.
|
|
11
|
-
*/
|
|
12
|
-
export declare function runUi(ctx: CommandContext, deps?: UiCommandDeps): Promise<number>;
|
|
13
|
-
export declare function openBrowser(url: string): Promise<void>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { KatokChunkResult, KatokContextResult, KatokDoctorResult, KatokIndexResult, KatokOptions, KatokParentResult, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSyncResult } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Thin external `katok` CLI wrapper. Every method spawns the `katok` binary as
|
|
4
|
-
* a child process, parses JSON from stdout, and returns a discriminated ok/fail
|
|
5
|
-
* union. No method throws for expected failures (missing binary, CLI nonzero
|
|
6
|
-
* exit, timeout, oversized output, or invalid JSON). The client never opens the
|
|
7
|
-
* KakaoTalk database directly.
|
|
8
|
-
*/
|
|
9
|
-
export declare class KatokClient {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options?: KatokOptions);
|
|
12
|
-
doctor(signal?: AbortSignal): Promise<KatokDoctorResult>;
|
|
13
|
-
sync(signal?: AbortSignal): Promise<KatokSyncResult>;
|
|
14
|
-
index(signal?: AbortSignal): Promise<KatokIndexResult>;
|
|
15
|
-
search(mode: KatokSearchMode, query: string, options?: KatokSearchOptions): Promise<KatokSearchResult>;
|
|
16
|
-
chunkGet(chunkId: string, signal?: AbortSignal): Promise<KatokChunkResult>;
|
|
17
|
-
context(chunkId: string, signal?: AbortSignal): Promise<KatokContextResult>;
|
|
18
|
-
parent(chunkId: string, signal?: AbortSignal): Promise<KatokParentResult>;
|
|
19
|
-
/** Single retrieval pipeline: build env, spawn, parse-free raw result. */
|
|
20
|
-
private run;
|
|
21
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KakaoTalk datasource skill barrel.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports the retrieval methods and skill plus the underlying client/types
|
|
5
|
-
* from sibling modules. Public source paths are path-opaque virtual paths of
|
|
6
|
-
* the form `/kakao/<instance-id>/chunks/<chunk-id>`.
|
|
7
|
-
*/
|
|
8
|
-
export { KatokClient } from "./client.js";
|
|
9
|
-
export { KatokBm25Method, type KatokMethodOptions, type KatokSearchClient, KatokSemanticMethod } from "./methods.js";
|
|
10
|
-
export { KatokSkill, type KatokSkillClient, type KatokSkillOptions } from "./skill.js";
|
|
11
|
-
export type { KatokChunkResult, KatokDoctorResult, KatokFailureReason, KatokHit, KatokIndexResult, KatokOptions, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSyncResult, } from "./types.js";
|
|
12
|
-
export { DEFAULT_KATOK_OPTIONS } from "./types.js";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path helpers for the KakaoTalk (`katok`) datasource skill.
|
|
3
|
-
*
|
|
4
|
-
* All paths are workspace-relative and live under
|
|
5
|
-
* `<workspaceRoot>/.autorag/datasources/katok`. The client never exposes raw
|
|
6
|
-
* filesystem paths to callers; chunk identifiers are surfaced as opaque
|
|
7
|
-
* slash-hierarchical sources of the form
|
|
8
|
-
* `/kakao/<instance-id>/chunks/<chunk-id>`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const AUTORAG_DIRNAME = ".autorag";
|
|
11
|
-
export declare const DATASOURCES_DIRNAME = "datasources";
|
|
12
|
-
export declare const KATOK_DATASOURCE_DIRNAME = "katok";
|
|
13
|
-
/** Logical datasource kind for source identifiers. */
|
|
14
|
-
export declare const KATOK_SOURCE_KIND: "kakao";
|
|
15
|
-
/**
|
|
16
|
-
* Root directory for katok-managed state under a workspace. This is where the
|
|
17
|
-
* external `katok` CLI stores its index, chunks, and sync state.
|
|
18
|
-
*/
|
|
19
|
-
export declare function katokDatasourceRoot(workspaceRoot: string): string;
|
|
20
|
-
/** Directory holding the katok chunk index. */
|
|
21
|
-
export declare function katokIndexPath(workspaceRoot: string): string;
|
|
22
|
-
/** Directory holding materialized katok chunks. */
|
|
23
|
-
export declare function katokChunksPath(workspaceRoot: string): string;
|
|
24
|
-
/** Directory holding katok sync state. */
|
|
25
|
-
export declare function katokSyncPath(workspaceRoot: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Builds the path-opaque, slash-hierarchical source identifier for a single
|
|
28
|
-
* katok chunk. Callers (the KatokSkill methods) use this to populate
|
|
29
|
-
* `RetrievalResult.source` so no real filesystem path ever leaks.
|
|
30
|
-
*/
|
|
31
|
-
export declare function katokSourcePath(instanceId: string, chunkId: string): string;
|
|
32
|
-
/**
|
|
33
|
-
* Parses a katok source identifier back into its `{ instanceId, chunkId }`
|
|
34
|
-
* components. Returns `undefined` for malformed or non-kakao sources so that
|
|
35
|
-
* deny decisions remain explicit rather than undefined-as-deny.
|
|
36
|
-
*/
|
|
37
|
-
export declare function parseKatokSourcePath(source: string): {
|
|
38
|
-
readonly instanceId: string;
|
|
39
|
-
readonly chunkId: string;
|
|
40
|
-
} | undefined;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { RetrievalOptions } from "../../../retrieval/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Search modes accepted by the external `katok search` subcommand.
|
|
4
|
-
*
|
|
5
|
-
* - `semantic` — dense vector similarity over indexed chunks.
|
|
6
|
-
* - `keyword` — exact / tokenized keyword matching.
|
|
7
|
-
* - `hybrid` — fused semantic + keyword scores.
|
|
8
|
-
*/
|
|
9
|
-
export type KatokSearchMode = "semantic" | "keyword" | "hybrid";
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for {@link KatokClient}. All fields optional; sensible defaults
|
|
12
|
-
* mirror the jikji client. The client spawns the `katok` binary as a child
|
|
13
|
-
* process — it never opens the KakaoTalk database directly.
|
|
14
|
-
*/
|
|
15
|
-
export interface KatokOptions {
|
|
16
|
-
/** Explicit path to the `katok` binary. Defaults to a bare `katok` PATH lookup. */
|
|
17
|
-
readonly binaryPath?: string;
|
|
18
|
-
/** Spawn timeout in milliseconds. Default 60_000 (sync/index over large archives can be slow). */
|
|
19
|
-
readonly timeoutMs?: number;
|
|
20
|
-
/** Max stdout/stderr bytes retained. Default 1_048_576 (1 MiB). */
|
|
21
|
-
readonly maxBufferBytes?: number;
|
|
22
|
-
/** Explicit native katok data directory, passed as `--data-dir`. */
|
|
23
|
-
readonly workspacePath?: string;
|
|
24
|
-
/** Explicit operator-owned configuration/workspace transport. */
|
|
25
|
-
readonly configPath?: string;
|
|
26
|
-
/** Environment overrides merged on top of `process.env` for the child. */
|
|
27
|
-
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
28
|
-
}
|
|
29
|
-
export declare const DEFAULT_KATOK_BINARY = "katok";
|
|
30
|
-
export declare const DEFAULT_KATOK_TIMEOUT_MS = 60000;
|
|
31
|
-
export declare const DEFAULT_KATOK_MAX_BUFFER_BYTES = 1048576;
|
|
32
|
-
export declare const DEFAULT_KATOK_OPTIONS: {
|
|
33
|
-
readonly binaryPath: "katok";
|
|
34
|
-
readonly timeoutMs: 60000;
|
|
35
|
-
readonly maxBufferBytes: 1048576;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Reasons a katok CLI invocation can fail. The client never throws for these —
|
|
39
|
-
* every method returns a discriminated union with `ok: false` and one of these
|
|
40
|
-
* reasons.
|
|
41
|
-
*/
|
|
42
|
-
export type KatokFailureReason = "binary-missing" | "nonzero-exit" | "spawn-error" | "timeout" | "aborted" | "stdout-too-large" | "stderr-too-large" | "invalid-json" | "invalid-shape";
|
|
43
|
-
/** Common failure payload shared by every method result union. */
|
|
44
|
-
export interface KatokFailure {
|
|
45
|
-
readonly ok: false;
|
|
46
|
-
readonly reason: KatokFailureReason;
|
|
47
|
-
/** Raw stdout captured (may be partial / empty). Never a binary path. */
|
|
48
|
-
readonly stdout: string;
|
|
49
|
-
/** Raw stderr captured (may be partial / empty). Never a binary path. */
|
|
50
|
-
readonly stderr: string;
|
|
51
|
-
/** Exit code, or `null` when the process never exited normally. */
|
|
52
|
-
readonly code: number | null;
|
|
53
|
-
readonly hits?: readonly unknown[];
|
|
54
|
-
}
|
|
55
|
-
/** A single indexed chat chunk returned by the katok CLI. */
|
|
56
|
-
export interface KatokChunk {
|
|
57
|
-
readonly chunkId: string;
|
|
58
|
-
readonly content: string;
|
|
59
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
60
|
-
}
|
|
61
|
-
/** A scored search hit. */
|
|
62
|
-
export interface KatokSearchHit {
|
|
63
|
-
readonly chunkId: string;
|
|
64
|
-
readonly score: number;
|
|
65
|
-
readonly content: string;
|
|
66
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
67
|
-
readonly source?: string;
|
|
68
|
-
}
|
|
69
|
-
export type KatokHit = KatokSearchHit;
|
|
70
|
-
/** Result of `katok doctor`. */
|
|
71
|
-
export interface KatokDoctorInfo {
|
|
72
|
-
readonly version?: string;
|
|
73
|
-
readonly ready: boolean;
|
|
74
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
75
|
-
}
|
|
76
|
-
/** Result of `katok sync`. */
|
|
77
|
-
export interface KatokSyncInfo {
|
|
78
|
-
readonly synced: boolean;
|
|
79
|
-
readonly messageCount?: number;
|
|
80
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
81
|
-
}
|
|
82
|
-
/** Result of `katok index`. */
|
|
83
|
-
export interface KatokIndexInfo {
|
|
84
|
-
readonly chunkCount: number;
|
|
85
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
86
|
-
}
|
|
87
|
-
/** Context payload: the chunks surrounding a target chunk. */
|
|
88
|
-
export interface KatokContext {
|
|
89
|
-
readonly chunks: readonly KatokChunk[];
|
|
90
|
-
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
91
|
-
}
|
|
92
|
-
/** Discriminated ok-success shape carrying typed `data`. */
|
|
93
|
-
export interface KatokOk<T> {
|
|
94
|
-
readonly ok: true;
|
|
95
|
-
readonly data: T;
|
|
96
|
-
readonly stdout: string;
|
|
97
|
-
readonly stderr: string;
|
|
98
|
-
readonly code: number;
|
|
99
|
-
}
|
|
100
|
-
export interface KatokSearchOk {
|
|
101
|
-
readonly ok: true;
|
|
102
|
-
readonly hits: readonly KatokSearchHit[];
|
|
103
|
-
readonly stdout: string;
|
|
104
|
-
readonly stderr: string;
|
|
105
|
-
readonly code: number;
|
|
106
|
-
readonly data: {
|
|
107
|
-
readonly hits: readonly KatokSearchHit[];
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
export type KatokDoctorResult = KatokOk<KatokDoctorInfo> | KatokFailure;
|
|
111
|
-
export type KatokSyncResult = KatokOk<KatokSyncInfo> | KatokFailure;
|
|
112
|
-
export type KatokIndexResult = KatokOk<KatokIndexInfo> | KatokFailure;
|
|
113
|
-
export type KatokSearchResult = KatokSearchOk | KatokFailure;
|
|
114
|
-
export type KatokChunkResult = KatokOk<KatokChunk> | KatokFailure;
|
|
115
|
-
export type KatokContextResult = KatokOk<KatokContext> | KatokFailure;
|
|
116
|
-
export type KatokParentResult = KatokOk<KatokChunk> | KatokFailure;
|
|
117
|
-
/**
|
|
118
|
-
* Search-specific options. Reuses the shared {@link RetrievalOptions} so the
|
|
119
|
-
* KatokSkill retrieval method can pass its options straight through. The
|
|
120
|
-
* client maps `topK` to the native CLI limit flag; other fields are handled
|
|
121
|
-
* by the retrieval layer or are not supported by katok.
|
|
122
|
-
*/
|
|
123
|
-
export type KatokSearchOptions = RetrievalOptions;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export interface HwpExtractedDocument {
|
|
2
|
-
readonly paragraphs: readonly HwpBodyParagraph[];
|
|
3
|
-
readonly tables: readonly HwpTable[];
|
|
4
|
-
}
|
|
5
|
-
export interface HwpBodyParagraph {
|
|
6
|
-
readonly sectionIndex: number;
|
|
7
|
-
readonly paragraphIndex: number;
|
|
8
|
-
readonly text: string;
|
|
9
|
-
}
|
|
10
|
-
export interface HwpTable {
|
|
11
|
-
readonly sectionIndex: number;
|
|
12
|
-
readonly parentParagraphIndex: number;
|
|
13
|
-
readonly controlIndex: number;
|
|
14
|
-
readonly rowCount: number;
|
|
15
|
-
readonly columnCount: number;
|
|
16
|
-
readonly cells: readonly HwpTableCell[];
|
|
17
|
-
}
|
|
18
|
-
export interface HwpTableCell {
|
|
19
|
-
readonly row: number;
|
|
20
|
-
readonly column: number;
|
|
21
|
-
readonly rowSpan: number;
|
|
22
|
-
readonly columnSpan: number;
|
|
23
|
-
readonly paragraphs: readonly string[];
|
|
24
|
-
}
|
|
25
|
-
export declare function renderHwpMarkdown(document: HwpExtractedDocument): string;
|
package/dist/parser/hwp.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type HwpExtractionLimits, type HwpExtractor } from "./rhwp-adapter.js";
|
|
2
|
-
import { type ParseInput, type ParseOutput, Parser } from "./types.js";
|
|
3
|
-
export interface HwpParserOptions {
|
|
4
|
-
readonly limits?: HwpExtractionLimits;
|
|
5
|
-
readonly extractor?: HwpExtractor;
|
|
6
|
-
}
|
|
7
|
-
export declare class HwpParser extends Parser {
|
|
8
|
-
readonly name = "hwp";
|
|
9
|
-
readonly extensions: readonly [".hwpx", ".hwp"];
|
|
10
|
-
private readonly extractor;
|
|
11
|
-
constructor(options?: HwpParserOptions);
|
|
12
|
-
parse(input: ParseInput): Promise<ParseOutput>;
|
|
13
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { ConvertOptions } from "@opendataloader/pdf";
|
|
2
|
-
import { type ParseInput, type ParseOutput, Parser } from "./types.js";
|
|
3
|
-
export type PdfConverter = (inputPath: string, options: ConvertOptions) => Promise<string>;
|
|
4
|
-
export interface OpendataloaderPdfParserOptions {
|
|
5
|
-
readonly converter?: PdfConverter;
|
|
6
|
-
readonly ocr?: {
|
|
7
|
-
readonly enabled: boolean;
|
|
8
|
-
readonly timeoutMs?: number;
|
|
9
|
-
readonly hybrid?: string;
|
|
10
|
-
readonly hybridMode?: string;
|
|
11
|
-
readonly maxBytes?: number;
|
|
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
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare class OpendataloaderPdfParser extends Parser {
|
|
25
|
-
readonly name = "opendataloader-pdf";
|
|
26
|
-
readonly extensions: readonly [".pdf"];
|
|
27
|
-
private readonly options;
|
|
28
|
-
private readonly converter;
|
|
29
|
-
constructor(options?: OpendataloaderPdfParserOptions);
|
|
30
|
-
parse(input: ParseInput): Promise<ParseOutput>;
|
|
31
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { HwpExtractedDocument } from "./hwp-markdown.js";
|
|
2
|
-
export interface HwpExtractionLimits {
|
|
3
|
-
readonly maxSections?: number;
|
|
4
|
-
readonly maxBodyParagraphs?: number;
|
|
5
|
-
readonly maxTables?: number;
|
|
6
|
-
readonly maxCells?: number;
|
|
7
|
-
readonly maxCellParagraphs?: number;
|
|
8
|
-
readonly maxCharacters?: number;
|
|
9
|
-
}
|
|
10
|
-
export type HwpExtractor = (bytes: Uint8Array) => Promise<HwpExtractedDocument>;
|
|
11
|
-
export interface RhwpDocumentApi {
|
|
12
|
-
free(): void;
|
|
13
|
-
getCellInfo(sectionIndex: number, parentParagraphIndex: number, controlIndex: number, cellIndex: number): string;
|
|
14
|
-
getCellParagraphCount(sectionIndex: number, parentParagraphIndex: number, controlIndex: number, cellIndex: number): number;
|
|
15
|
-
getCellParagraphLength(sectionIndex: number, parentParagraphIndex: number, controlIndex: number, cellIndex: number, cellParagraphIndex: number): number;
|
|
16
|
-
getPageControlLayout(pageNumber: number): string;
|
|
17
|
-
getParagraphCount(sectionIndex: number): number;
|
|
18
|
-
getParagraphLength(sectionIndex: number, paragraphIndex: number): number;
|
|
19
|
-
getSectionCount(): number;
|
|
20
|
-
getTableDimensions(sectionIndex: number, parentParagraphIndex: number, controlIndex: number): string;
|
|
21
|
-
getTextInCell(sectionIndex: number, parentParagraphIndex: number, controlIndex: number, cellIndex: number, cellParagraphIndex: number, characterOffset: number, count: number): string;
|
|
22
|
-
getTextRange(sectionIndex: number, paragraphIndex: number, characterOffset: number, count: number): string;
|
|
23
|
-
pageCount(): number;
|
|
24
|
-
}
|
|
25
|
-
export interface RhwpRuntime {
|
|
26
|
-
initialize(): Promise<void>;
|
|
27
|
-
open(bytes: Uint8Array): RhwpDocumentApi;
|
|
28
|
-
}
|
|
29
|
-
export declare function createRhwpExtractor(runtime?: RhwpRuntime, overrides?: HwpExtractionLimits): HwpExtractor;
|
|
30
|
-
export declare function extractHwpWithRhwp(bytes: Uint8Array, limits?: HwpExtractionLimits): Promise<HwpExtractedDocument>;
|
package/dist/ui/browse.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
package/dist/ui/catalog.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
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;
|
|
@@ -1,43 +0,0 @@
|
|
|
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;
|
package/dist/ui/discover.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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 choicesForType(type: string, run?: DiscoverRun): Promise<{
|
|
15
|
-
rcloneRemotes: readonly Choice[];
|
|
16
|
-
mailAccounts: readonly Choice[];
|
|
17
|
-
}>;
|
package/dist/ui/html.d.ts
DELETED
package/dist/ui/probe.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
package/dist/ui/prompt.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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;
|
package/dist/ui/server.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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>;
|