@ssmeo/mcp-local-rag 0.18.6
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/LICENSE +21 -0
- package/README.de.md +441 -0
- package/README.es.md +441 -0
- package/README.fr.md +441 -0
- package/README.md +530 -0
- package/README.pt-BR.md +441 -0
- package/README.zh-CN.md +441 -0
- package/dist/bin/install-skills.d.ts +19 -0
- package/dist/bin/install-skills.d.ts.map +1 -0
- package/dist/bin/install-skills.js +218 -0
- package/dist/bin/install-skills.js.map +1 -0
- package/dist/chunker/index.d.ts +24 -0
- package/dist/chunker/index.d.ts.map +1 -0
- package/dist/chunker/index.js +2 -0
- package/dist/chunker/index.js.map +1 -0
- package/dist/chunker/semantic-chunker.d.ts +96 -0
- package/dist/chunker/semantic-chunker.d.ts.map +1 -0
- package/dist/chunker/semantic-chunker.js +362 -0
- package/dist/chunker/semantic-chunker.js.map +1 -0
- package/dist/chunker/sentence-splitter.d.ts +32 -0
- package/dist/chunker/sentence-splitter.d.ts.map +1 -0
- package/dist/chunker/sentence-splitter.js +231 -0
- package/dist/chunker/sentence-splitter.js.map +1 -0
- package/dist/chunker/token-containment.d.ts +39 -0
- package/dist/chunker/token-containment.d.ts.map +1 -0
- package/dist/chunker/token-containment.js +83 -0
- package/dist/chunker/token-containment.js.map +1 -0
- package/dist/cli/common.d.ts +34 -0
- package/dist/cli/common.d.ts.map +1 -0
- package/dist/cli/common.js +121 -0
- package/dist/cli/common.js.map +1 -0
- package/dist/cli/delete.d.ts +3 -0
- package/dist/cli/delete.d.ts.map +1 -0
- package/dist/cli/delete.js +169 -0
- package/dist/cli/delete.js.map +1 -0
- package/dist/cli/file-collection.d.ts +2 -0
- package/dist/cli/file-collection.d.ts.map +1 -0
- package/dist/cli/file-collection.js +53 -0
- package/dist/cli/file-collection.js.map +1 -0
- package/dist/cli/ingest.d.ts +69 -0
- package/dist/cli/ingest.d.ts.map +1 -0
- package/dist/cli/ingest.js +323 -0
- package/dist/cli/ingest.js.map +1 -0
- package/dist/cli/list.d.ts +27 -0
- package/dist/cli/list.d.ts.map +1 -0
- package/dist/cli/list.js +207 -0
- package/dist/cli/list.js.map +1 -0
- package/dist/cli/options.d.ts +89 -0
- package/dist/cli/options.d.ts.map +1 -0
- package/dist/cli/options.js +244 -0
- package/dist/cli/options.js.map +1 -0
- package/dist/cli/query.d.ts +17 -0
- package/dist/cli/query.d.ts.map +1 -0
- package/dist/cli/query.js +194 -0
- package/dist/cli/query.js.map +1 -0
- package/dist/cli/read-neighbors.d.ts +3 -0
- package/dist/cli/read-neighbors.d.ts.map +1 -0
- package/dist/cli/read-neighbors.js +192 -0
- package/dist/cli/read-neighbors.js.map +1 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +78 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/cli/sync.d.ts +6 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +271 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli-main.d.ts +9 -0
- package/dist/cli-main.d.ts.map +1 -0
- package/dist/cli-main.js +60 -0
- package/dist/cli-main.js.map +1 -0
- package/dist/embedder/index.d.ts +143 -0
- package/dist/embedder/index.d.ts.map +1 -0
- package/dist/embedder/index.js +429 -0
- package/dist/embedder/index.js.map +1 -0
- package/dist/embedder/remote.d.ts +51 -0
- package/dist/embedder/remote.d.ts.map +1 -0
- package/dist/embedder/remote.js +182 -0
- package/dist/embedder/remote.js.map +1 -0
- package/dist/features/list.d.ts +37 -0
- package/dist/features/list.d.ts.map +1 -0
- package/dist/features/list.js +41 -0
- package/dist/features/list.js.map +1 -0
- package/dist/features/sync.d.ts +219 -0
- package/dist/features/sync.d.ts.map +1 -0
- package/dist/features/sync.js +461 -0
- package/dist/features/sync.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest/compute.d.ts +63 -0
- package/dist/ingest/compute.d.ts.map +1 -0
- package/dist/ingest/compute.js +161 -0
- package/dist/ingest/compute.js.map +1 -0
- package/dist/ingest/file.d.ts +40 -0
- package/dist/ingest/file.d.ts.map +1 -0
- package/dist/ingest/file.js +74 -0
- package/dist/ingest/file.js.map +1 -0
- package/dist/ingest/visual.d.ts +52 -0
- package/dist/ingest/visual.d.ts.map +1 -0
- package/dist/ingest/visual.js +294 -0
- package/dist/ingest/visual.js.map +1 -0
- package/dist/parser/docx-parser.d.ts +12 -0
- package/dist/parser/docx-parser.d.ts.map +1 -0
- package/dist/parser/docx-parser.js +375 -0
- package/dist/parser/docx-parser.js.map +1 -0
- package/dist/parser/html-parser.d.ts +16 -0
- package/dist/parser/html-parser.d.ts.map +1 -0
- package/dist/parser/html-parser.js +119 -0
- package/dist/parser/html-parser.js.map +1 -0
- package/dist/parser/index.d.ts +125 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +364 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/pdf-extract.d.ts +49 -0
- package/dist/parser/pdf-extract.d.ts.map +1 -0
- package/dist/parser/pdf-extract.js +114 -0
- package/dist/parser/pdf-extract.js.map +1 -0
- package/dist/parser/pdf-filter.d.ts +91 -0
- package/dist/parser/pdf-filter.d.ts.map +1 -0
- package/dist/parser/pdf-filter.js +522 -0
- package/dist/parser/pdf-filter.js.map +1 -0
- package/dist/parser/title-extractor.d.ts +28 -0
- package/dist/parser/title-extractor.d.ts.map +1 -0
- package/dist/parser/title-extractor.js +105 -0
- package/dist/parser/title-extractor.js.map +1 -0
- package/dist/pdf-visual/captioner.d.ts +11 -0
- package/dist/pdf-visual/captioner.d.ts.map +1 -0
- package/dist/pdf-visual/captioner.js +48 -0
- package/dist/pdf-visual/captioner.js.map +1 -0
- package/dist/pdf-visual/captioners/fast.d.ts +7 -0
- package/dist/pdf-visual/captioners/fast.d.ts.map +1 -0
- package/dist/pdf-visual/captioners/fast.js +108 -0
- package/dist/pdf-visual/captioners/fast.js.map +1 -0
- package/dist/pdf-visual/captioners/quality.d.ts +7 -0
- package/dist/pdf-visual/captioners/quality.d.ts.map +1 -0
- package/dist/pdf-visual/captioners/quality.js +101 -0
- package/dist/pdf-visual/captioners/quality.js.map +1 -0
- package/dist/pdf-visual/captioners/shared.d.ts +81 -0
- package/dist/pdf-visual/captioners/shared.d.ts.map +1 -0
- package/dist/pdf-visual/captioners/shared.js +156 -0
- package/dist/pdf-visual/captioners/shared.js.map +1 -0
- package/dist/pdf-visual/detector.d.ts +9 -0
- package/dist/pdf-visual/detector.d.ts.map +1 -0
- package/dist/pdf-visual/detector.js +269 -0
- package/dist/pdf-visual/detector.js.map +1 -0
- package/dist/pdf-visual/index.d.ts +13 -0
- package/dist/pdf-visual/index.d.ts.map +1 -0
- package/dist/pdf-visual/index.js +53 -0
- package/dist/pdf-visual/index.js.map +1 -0
- package/dist/pdf-visual/renderer.d.ts +9 -0
- package/dist/pdf-visual/renderer.d.ts.map +1 -0
- package/dist/pdf-visual/renderer.js +186 -0
- package/dist/pdf-visual/renderer.js.map +1 -0
- package/dist/pdf-visual/types.d.ts +53 -0
- package/dist/pdf-visual/types.d.ts.map +1 -0
- package/dist/pdf-visual/types.js +17 -0
- package/dist/pdf-visual/types.js.map +1 -0
- package/dist/server/error-utils.d.ts +63 -0
- package/dist/server/error-utils.d.ts.map +1 -0
- package/dist/server/error-utils.js +124 -0
- package/dist/server/error-utils.js.map +1 -0
- package/dist/server/index.d.ts +216 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +1068 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/list-scanner.d.ts +30 -0
- package/dist/server/list-scanner.d.ts.map +1 -0
- package/dist/server/list-scanner.js +50 -0
- package/dist/server/list-scanner.js.map +1 -0
- package/dist/server/tool-definitions.d.ts +8 -0
- package/dist/server/tool-definitions.d.ts.map +1 -0
- package/dist/server/tool-definitions.js +181 -0
- package/dist/server/tool-definitions.js.map +1 -0
- package/dist/server/tool-input.d.ts +37 -0
- package/dist/server/tool-input.d.ts.map +1 -0
- package/dist/server/tool-input.js +211 -0
- package/dist/server/tool-input.js.map +1 -0
- package/dist/server/types.d.ts +307 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/types.js +3 -0
- package/dist/server/types.js.map +1 -0
- package/dist/server-main.d.ts +40 -0
- package/dist/server-main.d.ts.map +1 -0
- package/dist/server-main.js +254 -0
- package/dist/server-main.js.map +1 -0
- package/dist/utils/base-dirs.d.ts +145 -0
- package/dist/utils/base-dirs.d.ts.map +1 -0
- package/dist/utils/base-dirs.js +344 -0
- package/dist/utils/base-dirs.js.map +1 -0
- package/dist/utils/errors.d.ts +32 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +61 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/limits.d.ts +26 -0
- package/dist/utils/limits.d.ts.map +1 -0
- package/dist/utils/limits.js +28 -0
- package/dist/utils/limits.js.map +1 -0
- package/dist/utils/list-sources.d.ts +38 -0
- package/dist/utils/list-sources.d.ts.map +1 -0
- package/dist/utils/list-sources.js +40 -0
- package/dist/utils/list-sources.js.map +1 -0
- package/dist/utils/raw-data-utils.d.ts +76 -0
- package/dist/utils/raw-data-utils.d.ts.map +1 -0
- package/dist/utils/raw-data-utils.js +202 -0
- package/dist/utils/raw-data-utils.js.map +1 -0
- package/dist/utils/scan.d.ts +114 -0
- package/dist/utils/scan.d.ts.map +1 -0
- package/dist/utils/scan.js +209 -0
- package/dist/utils/scan.js.map +1 -0
- package/dist/utils/scope-match.d.ts +38 -0
- package/dist/utils/scope-match.d.ts.map +1 -0
- package/dist/utils/scope-match.js +86 -0
- package/dist/utils/scope-match.js.map +1 -0
- package/dist/utils/sensitive-path.d.ts +9 -0
- package/dist/utils/sensitive-path.d.ts.map +1 -0
- package/dist/utils/sensitive-path.js +78 -0
- package/dist/utils/sensitive-path.js.map +1 -0
- package/dist/utils/sync-path-key.d.ts +14 -0
- package/dist/utils/sync-path-key.d.ts.map +1 -0
- package/dist/utils/sync-path-key.js +27 -0
- package/dist/utils/sync-path-key.js.map +1 -0
- package/dist/utils/type-guards.d.ts +18 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +34 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/visual-profile.d.ts +10 -0
- package/dist/utils/visual-profile.d.ts.map +1 -0
- package/dist/utils/visual-profile.js +15 -0
- package/dist/utils/visual-profile.js.map +1 -0
- package/dist/vectordb/index.d.ts +132 -0
- package/dist/vectordb/index.d.ts.map +1 -0
- package/dist/vectordb/index.js +617 -0
- package/dist/vectordb/index.js.map +1 -0
- package/dist/vectordb/search-filters.d.ts +15 -0
- package/dist/vectordb/search-filters.d.ts.map +1 -0
- package/dist/vectordb/search-filters.js +129 -0
- package/dist/vectordb/search-filters.js.map +1 -0
- package/dist/vectordb/types.d.ts +194 -0
- package/dist/vectordb/types.d.ts.map +1 -0
- package/dist/vectordb/types.js +237 -0
- package/dist/vectordb/types.js.map +1 -0
- package/package.json +108 -0
- package/skills/mcp-local-rag/SKILL.md +234 -0
- package/skills/mcp-local-rag/references/cli-reference.md +190 -0
- package/skills/mcp-local-rag/references/html-ingestion.md +78 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
+
import { type RagContentBlock, type RagTextContentBlock } from './error-utils.js';
|
|
3
|
+
import type { IngestDataInput, ListFilesInput, QueryDocumentsInput, RAGServerConfig, SyncStartInput, SyncStatusInput } from './types.js';
|
|
4
|
+
type QueryContent = [RagTextContentBlock, ...RagContentBlock[]];
|
|
5
|
+
export declare class RAGServer {
|
|
6
|
+
private readonly server;
|
|
7
|
+
private readonly vectorStore;
|
|
8
|
+
private readonly embedder;
|
|
9
|
+
private readonly chunker;
|
|
10
|
+
private readonly parser;
|
|
11
|
+
private readonly dbPath;
|
|
12
|
+
/**
|
|
13
|
+
* Allowed document roots, REALPATH-normalized — the security boundary handed
|
|
14
|
+
* to `DocumentParser`. `list_files` scanning and display use the normal-path
|
|
15
|
+
* `rawBaseDirs` below instead.
|
|
16
|
+
*/
|
|
17
|
+
private readonly baseDirs;
|
|
18
|
+
/**
|
|
19
|
+
* Normal-path (resolve()) roots, index-aligned with `baseDirs`, for
|
|
20
|
+
* user-facing `list_files` scan/display. Falls back to `baseDirs` for legacy
|
|
21
|
+
* `{ baseDir }` callers. See {@link BaseDirsConfig} for the path policy.
|
|
22
|
+
*/
|
|
23
|
+
private readonly rawBaseDirs;
|
|
24
|
+
/** Legacy single-root accessor for `rawBaseDirs`. Derived from `rawBaseDirs[0]`. */
|
|
25
|
+
private readonly rawBaseDir;
|
|
26
|
+
private readonly cacheDir;
|
|
27
|
+
private readonly excludePaths;
|
|
28
|
+
private readonly configWarnings;
|
|
29
|
+
/**
|
|
30
|
+
* When non-null the server is in degraded mode: `status` stays callable so the
|
|
31
|
+
* user can diagnose over MCP, while root-dependent tools must reject first.
|
|
32
|
+
*/
|
|
33
|
+
private readonly configError;
|
|
34
|
+
private readonly minChunkLength;
|
|
35
|
+
/**
|
|
36
|
+
* Configured byte ceiling for one ingested file. The parser enforces it for
|
|
37
|
+
* parsing; sync also needs it before hashing, where nothing else bounds the
|
|
38
|
+
* read.
|
|
39
|
+
*/
|
|
40
|
+
private readonly maxFileSize;
|
|
41
|
+
private readonly device;
|
|
42
|
+
private readonly storeImages;
|
|
43
|
+
/**
|
|
44
|
+
* The one current-or-latest sync job this process retains. A new `sync_start`
|
|
45
|
+
* replaces a terminal record, so the older id becomes unknown; there is no
|
|
46
|
+
* history, persistence or recovery.
|
|
47
|
+
*/
|
|
48
|
+
private syncJob;
|
|
49
|
+
/**
|
|
50
|
+
* True while one external mutation is in flight (SYNC-007). A request-scoped
|
|
51
|
+
* mutation clears it when the request completes; a sync keeps it until its
|
|
52
|
+
* job reaches a terminal state.
|
|
53
|
+
*/
|
|
54
|
+
private mutationInFlight;
|
|
55
|
+
constructor(config: RAGServerConfig);
|
|
56
|
+
/**
|
|
57
|
+
* Fail-fast guard for root-dependent tools in degraded mode: reject before any
|
|
58
|
+
* DB / embedder / parser access. Throws the stored error so the dispatcher
|
|
59
|
+
* mapper owns the code, rather than hand-building one here.
|
|
60
|
+
*
|
|
61
|
+
* `status` deliberately does not call this — it stays callable and reports the
|
|
62
|
+
* error in a diagnostic block, so recovery does not need stderr.
|
|
63
|
+
*/
|
|
64
|
+
private assertConfigOk;
|
|
65
|
+
/** Every handler funnels through here, so the warning shape lives in one place. */
|
|
66
|
+
private withWarnings;
|
|
67
|
+
/**
|
|
68
|
+
* Take the single external-mutation slot, or describe the overlap.
|
|
69
|
+
*
|
|
70
|
+
* Returns `null` when the slot was free. Otherwise an ordinary result with
|
|
71
|
+
* `isError: true` rather than a thrown error, naming the holding job id and
|
|
72
|
+
* pointing at `sync_status` — the only way to learn when to retry.
|
|
73
|
+
*/
|
|
74
|
+
private acquireMutation;
|
|
75
|
+
private releaseMutation;
|
|
76
|
+
/**
|
|
77
|
+
* Set up MCP handlers
|
|
78
|
+
*/
|
|
79
|
+
private setupHandlers;
|
|
80
|
+
/**
|
|
81
|
+
* Initialization
|
|
82
|
+
*/
|
|
83
|
+
initialize(): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* query_documents tool handler
|
|
86
|
+
*/
|
|
87
|
+
handleQueryDocuments(args: QueryDocumentsInput): Promise<{
|
|
88
|
+
content: QueryContent;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* `options.skipOptimize` is internal: sync compacts once per run, so its reuse
|
|
92
|
+
* of this handler must not compact once per file (a 100-file sync would
|
|
93
|
+
* otherwise perform 101 compactions). The tools omit it and compact per call.
|
|
94
|
+
*/
|
|
95
|
+
handleIngestFile(raw: unknown, options?: {
|
|
96
|
+
skipOptimize?: boolean;
|
|
97
|
+
images?: boolean;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
content: RagTextContentBlock[];
|
|
100
|
+
}>;
|
|
101
|
+
/** What one ingest source contributed, before rows are built and stored. */
|
|
102
|
+
private prepareRawDataIngest;
|
|
103
|
+
private prepareSourceFileIngest;
|
|
104
|
+
/**
|
|
105
|
+
* Restore the pre-ingest state after a failed insert. A rollback that itself
|
|
106
|
+
* fails is reported as its own error, because the prior data may now be gone.
|
|
107
|
+
*/
|
|
108
|
+
private rollbackIngest;
|
|
109
|
+
private ingestFile;
|
|
110
|
+
/**
|
|
111
|
+
* Saves raw content under raw-data and re-enters `handleIngestFile`. HTML is
|
|
112
|
+
* reduced to its main content and converted to Markdown first, so chunking
|
|
113
|
+
* sees prose rather than markup.
|
|
114
|
+
*/
|
|
115
|
+
handleIngestData(args: IngestDataInput): Promise<{
|
|
116
|
+
content: RagTextContentBlock[];
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Scans the normal-path roots (`this.rawBaseDirs`) so scanned paths match the
|
|
120
|
+
* resolve()-stored DB keys (see {@link BaseDirsConfig}).
|
|
121
|
+
*
|
|
122
|
+
* Multi-root contract: a top-level `baseDir` is still reported as
|
|
123
|
+
* `rawBaseDirs[0]` for clients written against the single-root shape;
|
|
124
|
+
* duplicate paths across roots collapse to the first occurrence in root
|
|
125
|
+
* order; raw-data and orphaned DB entries stay under `sources` with no
|
|
126
|
+
* producing root.
|
|
127
|
+
*/
|
|
128
|
+
handleListFiles(input?: ListFilesInput): Promise<{
|
|
129
|
+
content: RagTextContentBlock[];
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* status tool handler
|
|
133
|
+
*/
|
|
134
|
+
handleStatus(): Promise<{
|
|
135
|
+
content: RagTextContentBlock[];
|
|
136
|
+
}>;
|
|
137
|
+
/**
|
|
138
|
+
* delete_file tool handler
|
|
139
|
+
* Deletes chunks from VectorDB and physical raw-data files
|
|
140
|
+
* Supports both filePath (for ingest_file) and source (for ingest_data)
|
|
141
|
+
*/
|
|
142
|
+
handleDeleteFile(raw: unknown): Promise<{
|
|
143
|
+
content: RagTextContentBlock[];
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Context expansion around a chunkIndex, not a search tool. Mirrors
|
|
147
|
+
* handleDeleteFile's filePath-XOR-source resolution.
|
|
148
|
+
*/
|
|
149
|
+
handleReadChunkNeighbors(raw: unknown): Promise<{
|
|
150
|
+
content: RagTextContentBlock[];
|
|
151
|
+
}>;
|
|
152
|
+
/** Resolve the shared filePath/source reference without changing its DB-key spelling. */
|
|
153
|
+
private resolveDocumentTarget;
|
|
154
|
+
/**
|
|
155
|
+
* Registers the one current job and answers with its id without waiting: the
|
|
156
|
+
* caller polls `sync_status`.
|
|
157
|
+
*
|
|
158
|
+
* The scheduled promise is deliberately floating — an unexpected rejection is
|
|
159
|
+
* captured into the job record rather than escaping, and the run holds the
|
|
160
|
+
* external-mutation guard until it is terminal.
|
|
161
|
+
*/
|
|
162
|
+
handleSyncStart(input: SyncStartInput): Promise<{
|
|
163
|
+
content: RagTextContentBlock[];
|
|
164
|
+
}>;
|
|
165
|
+
/**
|
|
166
|
+
* Read-only, so it stays callable while a sync holds the mutation guard. Any
|
|
167
|
+
* id but the current one is unknown — replaced by a newer `sync_start`, or
|
|
168
|
+
* lost with a previous server process.
|
|
169
|
+
*/
|
|
170
|
+
handleSyncStatus(input: SyncStatusInput): Promise<{
|
|
171
|
+
content: RagTextContentBlock[];
|
|
172
|
+
}>;
|
|
173
|
+
/** Patch the current job, ignoring a write aimed at a record already replaced. */
|
|
174
|
+
private updateSyncJob;
|
|
175
|
+
/**
|
|
176
|
+
* One sync job's body: supply the real collaborators to the shared core and
|
|
177
|
+
* fold its result into the pollable record. Planning and the
|
|
178
|
+
* stop-on-first-error policy stay in the core, so path classification and
|
|
179
|
+
* depth match the CLI exactly.
|
|
180
|
+
*/
|
|
181
|
+
private runSyncJob;
|
|
182
|
+
/**
|
|
183
|
+
* Sync's `ingestFile` uses the same typed operation as `ingest_file`, keeping
|
|
184
|
+
* its backup and rollback semantics. A zero-chunk file is rejected before the
|
|
185
|
+
* delete, so prior rows survive, and is reported as `empty`.
|
|
186
|
+
*
|
|
187
|
+
* The planner's resolved profile is expressed through the same `visual` /
|
|
188
|
+
* `visualQuality` arguments a direct `ingest_file` call uses, so inheritance
|
|
189
|
+
* reuses the configured cache and device rather than a second VLM route.
|
|
190
|
+
*
|
|
191
|
+
* Per-file compaction is skipped because the sync core runs one `optimize()`
|
|
192
|
+
* for the whole run. A rollback still compacts — that path restores rows and
|
|
193
|
+
* then aborts, so no later `optimize()` follows.
|
|
194
|
+
*/
|
|
195
|
+
private ingestFileForSync;
|
|
196
|
+
/**
|
|
197
|
+
* Serve this instance's tool registration over `transport` — the registration
|
|
198
|
+
* itself, not a copy, since `this.server` is private. `run()` passes stdio; a
|
|
199
|
+
* test passes an in-memory pair.
|
|
200
|
+
*
|
|
201
|
+
* One instance serves at most one client: the job record and the mutation slot
|
|
202
|
+
* are per-process, so a multiplexing transport would share one caller's write
|
|
203
|
+
* lock with every other caller.
|
|
204
|
+
*/
|
|
205
|
+
connect(transport: Transport): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Start the server
|
|
208
|
+
*/
|
|
209
|
+
run(): Promise<void>;
|
|
210
|
+
/**
|
|
211
|
+
* Stop the server and release resources
|
|
212
|
+
*/
|
|
213
|
+
close(): Promise<void>;
|
|
214
|
+
}
|
|
215
|
+
export {};
|
|
216
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAA;AAyD9E,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAGzB,MAAM,kBAAkB,CAAA;AAazB,OAAO,KAAK,EAIV,eAAe,EAGf,cAAc,EAEd,mBAAmB,EAEnB,eAAe,EAGf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