@robthepcguy/rag-vault 1.0.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/LICENSE +24 -0
- package/README.md +421 -0
- package/dist/bin/install-skills.d.ts +20 -0
- package/dist/bin/install-skills.d.ts.map +1 -0
- package/dist/bin/install-skills.js +196 -0
- package/dist/bin/install-skills.js.map +1 -0
- package/dist/chunker/index.d.ts +11 -0
- package/dist/chunker/index.d.ts.map +1 -0
- package/dist/chunker/index.js +6 -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 +267 -0
- package/dist/chunker/semantic-chunker.js.map +1 -0
- package/dist/chunker/sentence-splitter.d.ts +16 -0
- package/dist/chunker/sentence-splitter.d.ts.map +1 -0
- package/dist/chunker/sentence-splitter.js +114 -0
- package/dist/chunker/sentence-splitter.js.map +1 -0
- package/dist/embedder/index.d.ts +55 -0
- package/dist/embedder/index.d.ts.map +1 -0
- package/dist/embedder/index.js +146 -0
- package/dist/embedder/index.js.map +1 -0
- package/dist/errors/index.d.ts +73 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +170 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/html-parser.d.ts +14 -0
- package/dist/parser/html-parser.d.ts.map +1 -0
- package/dist/parser/html-parser.js +99 -0
- package/dist/parser/html-parser.js.map +1 -0
- package/dist/parser/index.d.ts +144 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +446 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/pdf-filter.d.ts +89 -0
- package/dist/parser/pdf-filter.d.ts.map +1 -0
- package/dist/parser/pdf-filter.js +304 -0
- package/dist/parser/pdf-filter.js.map +1 -0
- package/dist/server/index.d.ts +144 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +518 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/raw-data-utils.d.ts +81 -0
- package/dist/server/raw-data-utils.d.ts.map +1 -0
- package/dist/server/raw-data-utils.js +196 -0
- package/dist/server/raw-data-utils.js.map +1 -0
- package/dist/server/schemas.d.ts +186 -0
- package/dist/server/schemas.d.ts.map +1 -0
- package/dist/server/schemas.js +99 -0
- package/dist/server/schemas.js.map +1 -0
- package/dist/utils/config-parsers.d.ts +14 -0
- package/dist/utils/config-parsers.d.ts.map +1 -0
- package/dist/utils/config-parsers.js +47 -0
- package/dist/utils/config-parsers.js.map +1 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +52 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/logger.d.ts +36 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +64 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/math.d.ts +34 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/math.js +73 -0
- package/dist/utils/math.js.map +1 -0
- package/dist/utils/process-handlers.d.ts +26 -0
- package/dist/utils/process-handlers.d.ts.map +1 -0
- package/dist/utils/process-handlers.js +69 -0
- package/dist/utils/process-handlers.js.map +1 -0
- package/dist/vectordb/index.d.ts +210 -0
- package/dist/vectordb/index.d.ts.map +1 -0
- package/dist/vectordb/index.js +613 -0
- package/dist/vectordb/index.js.map +1 -0
- package/dist/web/api-routes.d.ts +9 -0
- package/dist/web/api-routes.d.ts.map +1 -0
- package/dist/web/api-routes.js +127 -0
- package/dist/web/api-routes.js.map +1 -0
- package/dist/web/config-routes.d.ts +7 -0
- package/dist/web/config-routes.d.ts.map +1 -0
- package/dist/web/config-routes.js +54 -0
- package/dist/web/config-routes.js.map +1 -0
- package/dist/web/database-manager.d.ts +130 -0
- package/dist/web/database-manager.d.ts.map +1 -0
- package/dist/web/database-manager.js +382 -0
- package/dist/web/database-manager.js.map +1 -0
- package/dist/web/http-server.d.ts +28 -0
- package/dist/web/http-server.d.ts.map +1 -0
- package/dist/web/http-server.js +311 -0
- package/dist/web/http-server.js.map +1 -0
- package/dist/web/index.d.ts +3 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +114 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/middleware/async-handler.d.ts +17 -0
- package/dist/web/middleware/async-handler.d.ts.map +1 -0
- package/dist/web/middleware/async-handler.js +26 -0
- package/dist/web/middleware/async-handler.js.map +1 -0
- package/dist/web/middleware/auth.d.ts +22 -0
- package/dist/web/middleware/auth.d.ts.map +1 -0
- package/dist/web/middleware/auth.js +81 -0
- package/dist/web/middleware/auth.js.map +1 -0
- package/dist/web/middleware/error-handler.d.ts +36 -0
- package/dist/web/middleware/error-handler.d.ts.map +1 -0
- package/dist/web/middleware/error-handler.js +68 -0
- package/dist/web/middleware/error-handler.js.map +1 -0
- package/dist/web/middleware/index.d.ts +6 -0
- package/dist/web/middleware/index.d.ts.map +1 -0
- package/dist/web/middleware/index.js +19 -0
- package/dist/web/middleware/index.js.map +1 -0
- package/dist/web/middleware/rate-limit.d.ts +38 -0
- package/dist/web/middleware/rate-limit.d.ts.map +1 -0
- package/dist/web/middleware/rate-limit.js +116 -0
- package/dist/web/middleware/rate-limit.js.map +1 -0
- package/dist/web/middleware/request-logger.d.ts +52 -0
- package/dist/web/middleware/request-logger.d.ts.map +1 -0
- package/dist/web/middleware/request-logger.js +74 -0
- package/dist/web/middleware/request-logger.js.map +1 -0
- package/dist/web/types.d.ts +6 -0
- package/dist/web/types.d.ts.map +1 -0
- package/dist/web/types.js +4 -0
- package/dist/web/types.js.map +1 -0
- package/package.json +135 -0
- package/skills/rag-vault/SKILL.md +111 -0
- package/skills/rag-vault/references/html-ingestion.md +73 -0
- package/skills/rag-vault/references/query-optimization.md +57 -0
- package/skills/rag-vault/references/result-refinement.md +54 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// RAGServer implementation with MCP tools
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RAGServer = void 0;
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const promises_1 = require("node:fs/promises");
|
|
7
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
8
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const index_js_1 = require("../chunker/index.js");
|
|
11
|
+
const index_js_2 = require("../embedder/index.js");
|
|
12
|
+
const index_js_3 = require("../errors/index.js");
|
|
13
|
+
const html_parser_js_1 = require("../parser/html-parser.js");
|
|
14
|
+
const index_js_4 = require("../parser/index.js");
|
|
15
|
+
const index_js_5 = require("../vectordb/index.js");
|
|
16
|
+
const raw_data_utils_js_1 = require("./raw-data-utils.js");
|
|
17
|
+
const schemas_js_1 = require("./schemas.js");
|
|
18
|
+
// ============================================
|
|
19
|
+
// RAGServer Class
|
|
20
|
+
// ============================================
|
|
21
|
+
/**
|
|
22
|
+
* RAG server compliant with MCP Protocol
|
|
23
|
+
*
|
|
24
|
+
* Responsibilities:
|
|
25
|
+
* - MCP tool integration (6 tools)
|
|
26
|
+
* - Tool handler implementation with Zod validation
|
|
27
|
+
* - Error handling
|
|
28
|
+
* - Initialization (LanceDB, Transformers.js)
|
|
29
|
+
*/
|
|
30
|
+
class RAGServer {
|
|
31
|
+
constructor(config) {
|
|
32
|
+
this.dbPath = config.dbPath;
|
|
33
|
+
this.server = new mcp_js_1.McpServer({
|
|
34
|
+
name: 'rag-mcp-server',
|
|
35
|
+
version: '1.0.0',
|
|
36
|
+
});
|
|
37
|
+
// Component initialization
|
|
38
|
+
// Only pass quality filter settings if they are defined
|
|
39
|
+
const vectorStoreConfig = {
|
|
40
|
+
dbPath: config.dbPath,
|
|
41
|
+
tableName: 'chunks',
|
|
42
|
+
};
|
|
43
|
+
if (config.maxDistance !== undefined) {
|
|
44
|
+
vectorStoreConfig.maxDistance = config.maxDistance;
|
|
45
|
+
}
|
|
46
|
+
if (config.grouping !== undefined) {
|
|
47
|
+
vectorStoreConfig.grouping = config.grouping;
|
|
48
|
+
}
|
|
49
|
+
if (config.hybridWeight !== undefined) {
|
|
50
|
+
vectorStoreConfig.hybridWeight = config.hybridWeight;
|
|
51
|
+
}
|
|
52
|
+
this.vectorStore = new index_js_5.VectorStore(vectorStoreConfig);
|
|
53
|
+
this.embedder = new index_js_2.Embedder({
|
|
54
|
+
modelPath: config.modelName,
|
|
55
|
+
batchSize: 16,
|
|
56
|
+
cacheDir: config.cacheDir,
|
|
57
|
+
});
|
|
58
|
+
this.chunker = new index_js_1.SemanticChunker();
|
|
59
|
+
this.parser = new index_js_4.DocumentParser({
|
|
60
|
+
baseDir: config.baseDir,
|
|
61
|
+
maxFileSize: config.maxFileSize,
|
|
62
|
+
});
|
|
63
|
+
this.setupHandlers();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Set up MCP handlers using tool() API
|
|
67
|
+
* Note: Type casts are used to work around Zod version compatibility between project and SDK
|
|
68
|
+
*/
|
|
69
|
+
setupHandlers() {
|
|
70
|
+
// query_documents tool
|
|
71
|
+
this.server.tool('query_documents', 'Search ingested documents. Your query words are matched exactly (keyword search). Your query meaning is matched semantically (vector search). Preserve specific terms from the user. Add context if the query is ambiguous. Results include score (0 = most relevant, higher = less relevant).', {
|
|
72
|
+
query: zod_1.z.string(),
|
|
73
|
+
limit: zod_1.z.number().optional(),
|
|
74
|
+
}, async (args) => {
|
|
75
|
+
const results = await this.executeQueryDocuments(args);
|
|
76
|
+
return {
|
|
77
|
+
content: [{ type: 'text', text: JSON.stringify(results, null, 2) }],
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
// ingest_file tool
|
|
81
|
+
this.server.tool('ingest_file', 'Ingest a document file (PDF, DOCX, TXT, MD, JSON, JSONL) into the vector database for semantic search. File path must be an absolute path. Supports re-ingestion to update existing documents.', {
|
|
82
|
+
filePath: zod_1.z.string(),
|
|
83
|
+
}, async (args) => {
|
|
84
|
+
const result = await this.executeIngestFile(args);
|
|
85
|
+
return {
|
|
86
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
// ingest_data tool
|
|
90
|
+
this.server.tool('ingest_data', 'Ingest content as a string, not from a file. Use for: fetched web pages (format: html), copied text (format: text), or markdown strings (format: markdown). The source identifier enables re-ingestion to update existing content. For files on disk, use ingest_file instead.', {
|
|
91
|
+
content: zod_1.z.string(),
|
|
92
|
+
metadata: zod_1.z.object({
|
|
93
|
+
source: zod_1.z.string(),
|
|
94
|
+
format: zod_1.z.enum(['text', 'html', 'markdown']),
|
|
95
|
+
}),
|
|
96
|
+
}, async (args) => {
|
|
97
|
+
const result = await this.executeIngestData(args);
|
|
98
|
+
return {
|
|
99
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
// delete_file tool (uses .refine(), so handle validation in handler)
|
|
103
|
+
this.server.tool('delete_file', 'Delete a previously ingested file or data from the vector database. Use filePath for files ingested via ingest_file, or source for data ingested via ingest_data. Either filePath or source must be provided.', {
|
|
104
|
+
filePath: zod_1.z.string().optional(),
|
|
105
|
+
source: zod_1.z.string().optional(),
|
|
106
|
+
}, async (args) => {
|
|
107
|
+
// Validate with refinement separately
|
|
108
|
+
const parsed = schemas_js_1.DeleteFileSchema.safeParse(args);
|
|
109
|
+
if (!parsed.success) {
|
|
110
|
+
throw new Error(`Invalid arguments: ${parsed.error.message}`);
|
|
111
|
+
}
|
|
112
|
+
const result = await this.executeDeleteFile(parsed.data);
|
|
113
|
+
return {
|
|
114
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
// list_files tool
|
|
118
|
+
this.server.tool('list_files', 'List all ingested files in the vector database. Returns file paths and chunk counts for each document.', {}, async () => {
|
|
119
|
+
const files = await this.executeListFiles();
|
|
120
|
+
return {
|
|
121
|
+
content: [{ type: 'text', text: JSON.stringify(files, null, 2) }],
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
// status tool
|
|
125
|
+
this.server.tool('status', 'Get system status including total documents, total chunks, database size, and configuration information.', {}, async () => {
|
|
126
|
+
const status = await this.executeStatus();
|
|
127
|
+
return {
|
|
128
|
+
content: [{ type: 'text', text: JSON.stringify(status, null, 2) }],
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Initialization
|
|
134
|
+
*/
|
|
135
|
+
async initialize() {
|
|
136
|
+
await this.vectorStore.initialize();
|
|
137
|
+
console.error('RAGServer initialized');
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Close the server and release resources
|
|
141
|
+
*/
|
|
142
|
+
async close() {
|
|
143
|
+
await this.vectorStore.close();
|
|
144
|
+
console.error('RAGServer closed');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get the current database configuration
|
|
148
|
+
*/
|
|
149
|
+
getConfig() {
|
|
150
|
+
return {
|
|
151
|
+
dbPath: this.dbPath,
|
|
152
|
+
modelName: this.embedder.getModelName(),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Execute query_documents logic (returns plain data)
|
|
157
|
+
*/
|
|
158
|
+
async executeQueryDocuments(args) {
|
|
159
|
+
// Generate query embedding
|
|
160
|
+
const queryVector = await this.embedder.embed(args.query);
|
|
161
|
+
// Hybrid search (vector + BM25 keyword matching)
|
|
162
|
+
const searchResults = await this.vectorStore.search(queryVector, args.query, args.limit || 10);
|
|
163
|
+
// Format results with source restoration for raw-data files
|
|
164
|
+
return searchResults.map((result) => {
|
|
165
|
+
const queryResult = {
|
|
166
|
+
filePath: result.filePath,
|
|
167
|
+
chunkIndex: result.chunkIndex,
|
|
168
|
+
text: result.text,
|
|
169
|
+
score: result.score,
|
|
170
|
+
};
|
|
171
|
+
// Restore source for raw-data files (ingested via ingest_data)
|
|
172
|
+
if ((0, raw_data_utils_js_1.isRawDataPath)(result.filePath)) {
|
|
173
|
+
const source = (0, raw_data_utils_js_1.extractSourceFromPath)(result.filePath);
|
|
174
|
+
if (source) {
|
|
175
|
+
queryResult.source = source;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return queryResult;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* query_documents tool handler (for test compatibility)
|
|
183
|
+
*/
|
|
184
|
+
async handleQueryDocuments(args) {
|
|
185
|
+
try {
|
|
186
|
+
const results = await this.executeQueryDocuments(args);
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{
|
|
190
|
+
type: 'text',
|
|
191
|
+
text: JSON.stringify(results, null, 2),
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
console.error('Failed to query documents:', error);
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Execute ingest_file logic (returns plain data)
|
|
203
|
+
*/
|
|
204
|
+
async executeIngestFile(args) {
|
|
205
|
+
let backup = null;
|
|
206
|
+
// Parse file (with header/footer filtering for PDFs)
|
|
207
|
+
// For raw-data files (from ingest_data), read directly without validation
|
|
208
|
+
// since the path is internally generated and content is already processed
|
|
209
|
+
const isPdf = args.filePath.toLowerCase().endsWith('.pdf');
|
|
210
|
+
let text;
|
|
211
|
+
if ((0, raw_data_utils_js_1.isRawDataPath)(args.filePath)) {
|
|
212
|
+
// Raw-data files: skip validation, read directly
|
|
213
|
+
text = await (0, promises_1.readFile)(args.filePath, 'utf-8');
|
|
214
|
+
console.error(`Read raw-data file: ${args.filePath} (${text.length} characters)`);
|
|
215
|
+
}
|
|
216
|
+
else if (isPdf) {
|
|
217
|
+
text = await this.parser.parsePdf(args.filePath, this.embedder);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
text = await this.parser.parseFile(args.filePath);
|
|
221
|
+
}
|
|
222
|
+
// Split text into semantic chunks
|
|
223
|
+
const chunks = await this.chunker.chunkText(text, this.embedder);
|
|
224
|
+
// Generate embeddings for final chunks
|
|
225
|
+
const embeddings = await this.embedder.embedBatch(chunks.map((chunk) => chunk.text));
|
|
226
|
+
// Create backup (if existing data exists)
|
|
227
|
+
try {
|
|
228
|
+
const existingFiles = await this.vectorStore.listFiles();
|
|
229
|
+
const existingFile = existingFiles.find((file) => file.filePath === args.filePath);
|
|
230
|
+
if (existingFile && existingFile.chunkCount > 0) {
|
|
231
|
+
// Backup existing data (retrieve via search)
|
|
232
|
+
const queryVector = embeddings[0] || [];
|
|
233
|
+
if (queryVector.length > 0) {
|
|
234
|
+
const allChunks = await this.vectorStore.search(queryVector, undefined, 20); // Retrieve max 20 items
|
|
235
|
+
backup = allChunks
|
|
236
|
+
.filter((chunk) => chunk.filePath === args.filePath)
|
|
237
|
+
.map((chunk) => ({
|
|
238
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
239
|
+
filePath: chunk.filePath,
|
|
240
|
+
chunkIndex: chunk.chunkIndex,
|
|
241
|
+
text: chunk.text,
|
|
242
|
+
vector: queryVector, // Use dummy vector since actual vector cannot be retrieved
|
|
243
|
+
metadata: chunk.metadata,
|
|
244
|
+
timestamp: new Date().toISOString(),
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
console.error(`Backup created: ${backup?.length || 0} chunks for ${args.filePath}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
// Backup creation failure is warning only (for new files)
|
|
252
|
+
console.warn('Failed to create backup (new file?):', error);
|
|
253
|
+
}
|
|
254
|
+
// Delete existing data
|
|
255
|
+
await this.vectorStore.deleteChunks(args.filePath);
|
|
256
|
+
console.error(`Deleted existing chunks for: ${args.filePath}`);
|
|
257
|
+
// Create vector chunks
|
|
258
|
+
const timestamp = new Date().toISOString();
|
|
259
|
+
const vectorChunks = chunks.map((chunk, index) => {
|
|
260
|
+
const embedding = embeddings[index];
|
|
261
|
+
if (!embedding) {
|
|
262
|
+
throw new Error(`Missing embedding for chunk ${index}`);
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
266
|
+
filePath: args.filePath,
|
|
267
|
+
chunkIndex: chunk.index,
|
|
268
|
+
text: chunk.text,
|
|
269
|
+
vector: embedding,
|
|
270
|
+
metadata: {
|
|
271
|
+
fileName: args.filePath.split('/').pop() || args.filePath,
|
|
272
|
+
fileSize: text.length,
|
|
273
|
+
fileType: args.filePath.split('.').pop() || '',
|
|
274
|
+
},
|
|
275
|
+
timestamp,
|
|
276
|
+
};
|
|
277
|
+
});
|
|
278
|
+
// Insert vectors (transaction processing)
|
|
279
|
+
try {
|
|
280
|
+
await this.vectorStore.insertChunks(vectorChunks);
|
|
281
|
+
console.error(`Inserted ${vectorChunks.length} chunks for: ${args.filePath}`);
|
|
282
|
+
// Delete backup on success
|
|
283
|
+
backup = null;
|
|
284
|
+
}
|
|
285
|
+
catch (insertError) {
|
|
286
|
+
// Rollback on error
|
|
287
|
+
if (backup && backup.length > 0) {
|
|
288
|
+
console.error('Ingestion failed, rolling back...', insertError);
|
|
289
|
+
try {
|
|
290
|
+
await this.vectorStore.insertChunks(backup);
|
|
291
|
+
console.error(`Rollback completed: ${backup.length} chunks restored`);
|
|
292
|
+
}
|
|
293
|
+
catch (rollbackError) {
|
|
294
|
+
console.error('Rollback failed:', rollbackError);
|
|
295
|
+
throw new Error(`Failed to ingest file and rollback failed: ${insertError.message}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
throw insertError;
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
filePath: args.filePath,
|
|
302
|
+
chunkCount: chunks.length,
|
|
303
|
+
timestamp,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* ingest_file tool handler (for test compatibility)
|
|
308
|
+
*/
|
|
309
|
+
async handleIngestFile(args) {
|
|
310
|
+
try {
|
|
311
|
+
const result = await this.executeIngestFile(args);
|
|
312
|
+
return {
|
|
313
|
+
content: [
|
|
314
|
+
{
|
|
315
|
+
type: 'text',
|
|
316
|
+
text: JSON.stringify(result, null, 2),
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
const errorMessage = (0, index_js_3.getErrorMessage)(error);
|
|
323
|
+
console.error('Failed to ingest file:', errorMessage);
|
|
324
|
+
throw new Error(`Failed to ingest file: ${errorMessage}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Execute ingest_data logic (returns plain data)
|
|
329
|
+
*/
|
|
330
|
+
async executeIngestData(args) {
|
|
331
|
+
let contentToSave = args.content;
|
|
332
|
+
let formatToSave = args.metadata.format;
|
|
333
|
+
// For HTML content, convert to Markdown first
|
|
334
|
+
if (args.metadata.format === 'html') {
|
|
335
|
+
console.error(`Parsing HTML from: ${args.metadata.source}`);
|
|
336
|
+
const markdown = await (0, html_parser_js_1.parseHtml)(args.content, args.metadata.source);
|
|
337
|
+
if (!markdown.trim()) {
|
|
338
|
+
throw new Error('Failed to extract content from HTML. The page may have no readable content.');
|
|
339
|
+
}
|
|
340
|
+
contentToSave = markdown;
|
|
341
|
+
formatToSave = 'markdown'; // Save as .md file
|
|
342
|
+
console.error(`Converted HTML to Markdown: ${markdown.length} characters`);
|
|
343
|
+
}
|
|
344
|
+
// Save content to raw-data directory
|
|
345
|
+
const rawDataPath = await (0, raw_data_utils_js_1.saveRawData)(this.dbPath, args.metadata.source, contentToSave, formatToSave);
|
|
346
|
+
console.error(`Saved raw data: ${args.metadata.source} -> ${rawDataPath}`);
|
|
347
|
+
// Call executeIngestFile internally with rollback on failure
|
|
348
|
+
try {
|
|
349
|
+
return await this.executeIngestFile({ filePath: rawDataPath });
|
|
350
|
+
}
|
|
351
|
+
catch (ingestError) {
|
|
352
|
+
// Rollback: delete the raw-data file if ingest fails
|
|
353
|
+
try {
|
|
354
|
+
await (0, promises_1.unlink)(rawDataPath);
|
|
355
|
+
console.error(`Rolled back raw-data file: ${rawDataPath}`);
|
|
356
|
+
}
|
|
357
|
+
catch {
|
|
358
|
+
console.warn(`Failed to rollback raw-data file: ${rawDataPath}`);
|
|
359
|
+
}
|
|
360
|
+
throw ingestError;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* ingest_data tool handler (for test compatibility)
|
|
365
|
+
*/
|
|
366
|
+
async handleIngestData(args) {
|
|
367
|
+
try {
|
|
368
|
+
const result = await this.executeIngestData(args);
|
|
369
|
+
return {
|
|
370
|
+
content: [
|
|
371
|
+
{
|
|
372
|
+
type: 'text',
|
|
373
|
+
text: JSON.stringify(result, null, 2),
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
const errorMessage = (0, index_js_3.getErrorMessage)(error);
|
|
380
|
+
console.error('Failed to ingest data:', errorMessage);
|
|
381
|
+
throw new Error(`Failed to ingest data: ${errorMessage}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Execute list_files logic (returns plain data)
|
|
386
|
+
*/
|
|
387
|
+
async executeListFiles() {
|
|
388
|
+
const files = await this.vectorStore.listFiles();
|
|
389
|
+
// Enrich raw-data files with source information
|
|
390
|
+
return files.map((file) => {
|
|
391
|
+
if ((0, raw_data_utils_js_1.isRawDataPath)(file.filePath)) {
|
|
392
|
+
const source = (0, raw_data_utils_js_1.extractSourceFromPath)(file.filePath);
|
|
393
|
+
if (source) {
|
|
394
|
+
return { ...file, source };
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return file;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* list_files tool handler (for test compatibility)
|
|
402
|
+
*/
|
|
403
|
+
async handleListFiles() {
|
|
404
|
+
try {
|
|
405
|
+
const files = await this.executeListFiles();
|
|
406
|
+
return {
|
|
407
|
+
content: [
|
|
408
|
+
{
|
|
409
|
+
type: 'text',
|
|
410
|
+
text: JSON.stringify(files, null, 2),
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
console.error('Failed to list files:', error);
|
|
417
|
+
throw error;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Execute status logic (returns plain data)
|
|
422
|
+
*/
|
|
423
|
+
async executeStatus() {
|
|
424
|
+
return await this.vectorStore.getStatus();
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* status tool handler (for test compatibility)
|
|
428
|
+
*/
|
|
429
|
+
async handleStatus() {
|
|
430
|
+
try {
|
|
431
|
+
const status = await this.executeStatus();
|
|
432
|
+
return {
|
|
433
|
+
content: [
|
|
434
|
+
{
|
|
435
|
+
type: 'text',
|
|
436
|
+
text: JSON.stringify(status, null, 2),
|
|
437
|
+
},
|
|
438
|
+
],
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
console.error('Failed to get status:', error);
|
|
443
|
+
throw error;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Execute delete_file logic (returns plain data)
|
|
448
|
+
*/
|
|
449
|
+
async executeDeleteFile(args) {
|
|
450
|
+
let targetPath;
|
|
451
|
+
let skipValidation = false;
|
|
452
|
+
if (args.source) {
|
|
453
|
+
// Generate raw-data path from source (extension is always .md)
|
|
454
|
+
// Internal path generation is secure, skip baseDir validation
|
|
455
|
+
targetPath = (0, raw_data_utils_js_1.generateRawDataPath)(this.dbPath, args.source, 'markdown');
|
|
456
|
+
skipValidation = true;
|
|
457
|
+
}
|
|
458
|
+
else if (args.filePath) {
|
|
459
|
+
targetPath = args.filePath;
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
throw new Error('Either filePath or source must be provided');
|
|
463
|
+
}
|
|
464
|
+
// Only validate user-provided filePath (not internally generated paths)
|
|
465
|
+
if (!skipValidation) {
|
|
466
|
+
this.parser.validateFilePath(targetPath);
|
|
467
|
+
}
|
|
468
|
+
// Delete chunks from vector database
|
|
469
|
+
await this.vectorStore.deleteChunks(targetPath);
|
|
470
|
+
// Also delete physical raw-data file if applicable
|
|
471
|
+
if ((0, raw_data_utils_js_1.isRawDataPath)(targetPath)) {
|
|
472
|
+
try {
|
|
473
|
+
await (0, promises_1.unlink)(targetPath);
|
|
474
|
+
console.error(`Deleted raw-data file: ${targetPath}`);
|
|
475
|
+
}
|
|
476
|
+
catch {
|
|
477
|
+
// File may already be deleted, log warning only
|
|
478
|
+
console.warn(`Could not delete raw-data file (may not exist): ${targetPath}`);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return {
|
|
482
|
+
filePath: targetPath,
|
|
483
|
+
deleted: true,
|
|
484
|
+
timestamp: new Date().toISOString(),
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* delete_file tool handler (for test compatibility)
|
|
489
|
+
*/
|
|
490
|
+
async handleDeleteFile(args) {
|
|
491
|
+
try {
|
|
492
|
+
const result = await this.executeDeleteFile(args);
|
|
493
|
+
return {
|
|
494
|
+
content: [
|
|
495
|
+
{
|
|
496
|
+
type: 'text',
|
|
497
|
+
text: JSON.stringify(result, null, 2),
|
|
498
|
+
},
|
|
499
|
+
],
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
catch (error) {
|
|
503
|
+
const errorMessage = (0, index_js_3.getErrorMessage)(error);
|
|
504
|
+
console.error('Failed to delete file:', errorMessage);
|
|
505
|
+
throw new Error(`Failed to delete file: ${errorMessage}`);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Start the server
|
|
510
|
+
*/
|
|
511
|
+
async run() {
|
|
512
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
513
|
+
await this.server.connect(transport);
|
|
514
|
+
console.error('RAGServer running on stdio transport');
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
exports.RAGServer = RAGServer;
|
|
518
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;;;AAE1C,6CAAwC;AACxC,+CAAmD;AACnD,oEAAmE;AACnE,wEAAgF;AAChF,6BAAuB;AACvB,kDAAqD;AACrD,mDAA+C;AAC/C,iDAAoD;AACpD,6DAAoD;AACpD,iDAAmD;AACnD,mDAAuF;AACvF,2DAM4B;AAC5B,6CAWqB;AA4BrB,+CAA+C;AAC/C,kBAAkB;AAClB,+CAA+C;AAE/C;;;;;;;;GAQG;AACH,MAAa,SAAS;IAQpB,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAS,CAAC;YAC1B,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,OAAO;SACjB,CAAC,CAAA;QAEF,2BAA2B;QAC3B,wDAAwD;QACxD,MAAM,iBAAiB,GAAiD;YACtE,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,QAAQ;SACpB,CAAA;QACD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACrC,iBAAiB,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;QACpD,CAAC;QACD,IAAI,MAAM,CAAC,QA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encode string to URL-safe base64 (base64url)
|
|
3
|
+
* - Replaces + with -
|
|
4
|
+
* - Replaces / with _
|
|
5
|
+
* - Removes padding (=)
|
|
6
|
+
*
|
|
7
|
+
* @param str - String to encode
|
|
8
|
+
* @returns URL-safe base64 encoded string
|
|
9
|
+
*/
|
|
10
|
+
export declare function encodeBase64Url(str: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Decode URL-safe base64 (base64url) to string
|
|
13
|
+
*
|
|
14
|
+
* @param base64url - URL-safe base64 encoded string
|
|
15
|
+
* @returns Decoded string
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodeBase64Url(base64url: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Validate that a source doesn't use a dangerous protocol
|
|
20
|
+
*
|
|
21
|
+
* @param source - Source identifier to validate
|
|
22
|
+
* @throws Error if the protocol is blocked
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateSourceProtocol(source: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Normalize source URL by removing query string and fragment
|
|
27
|
+
* Only normalizes HTTP(S) URLs. Other sources (e.g., "clipboard://...") are returned as-is
|
|
28
|
+
*
|
|
29
|
+
* @param source - Source identifier (URL or custom ID)
|
|
30
|
+
* @returns Normalized source
|
|
31
|
+
* @throws Error if the source uses a disallowed protocol
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeSource(source: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Content format type for ingest_data
|
|
36
|
+
*/
|
|
37
|
+
export type ContentFormat = 'text' | 'html' | 'markdown';
|
|
38
|
+
/**
|
|
39
|
+
* Get raw-data directory path
|
|
40
|
+
*
|
|
41
|
+
* @param dbPath - LanceDB database path
|
|
42
|
+
* @returns Raw-data directory path
|
|
43
|
+
*/
|
|
44
|
+
export declare function getRawDataDir(dbPath: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate raw-data file path from source and format
|
|
47
|
+
* Path format: {dbPath}/raw-data/{base64url(normalizedSource)}.{ext}
|
|
48
|
+
*
|
|
49
|
+
* @param dbPath - LanceDB database path
|
|
50
|
+
* @param source - Source identifier (URL or custom ID)
|
|
51
|
+
* @param format - Content format
|
|
52
|
+
* @returns Generated file path
|
|
53
|
+
*/
|
|
54
|
+
export declare function generateRawDataPath(dbPath: string, source: string, _format: ContentFormat): string;
|
|
55
|
+
/**
|
|
56
|
+
* Save content to raw-data directory
|
|
57
|
+
* Creates directory if it doesn't exist
|
|
58
|
+
*
|
|
59
|
+
* @param dbPath - LanceDB database path
|
|
60
|
+
* @param source - Source identifier (URL or custom ID)
|
|
61
|
+
* @param content - Content to save
|
|
62
|
+
* @param format - Content format
|
|
63
|
+
* @returns Saved file path
|
|
64
|
+
*/
|
|
65
|
+
export declare function saveRawData(dbPath: string, source: string, content: string, format: ContentFormat): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Check if file path is in raw-data directory
|
|
68
|
+
*
|
|
69
|
+
* @param filePath - File path to check
|
|
70
|
+
* @returns True if path is in raw-data directory
|
|
71
|
+
*/
|
|
72
|
+
export declare function isRawDataPath(filePath: string): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Extract original source from raw-data file path
|
|
75
|
+
* Returns null if not a raw-data path
|
|
76
|
+
*
|
|
77
|
+
* @param filePath - Raw-data file path
|
|
78
|
+
* @returns Original source or null
|
|
79
|
+
*/
|
|
80
|
+
export declare function extractSourceFromPath(filePath: string): string | null;
|
|
81
|
+
//# sourceMappingURL=raw-data-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-data-utils.d.ts","sourceRoot":"","sources":["../../src/server/raw-data-utils.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUzD;AAcD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAa3D;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAgBtD;AAMD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AAMxD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,MAAM,CAMR;AAMD;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAUD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBrE"}
|