sql-chatbot-agent 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/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/client.d.ts +13 -0
- package/dist/llm/client.d.ts.map +1 -0
- package/dist/llm/client.js +50 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/middleware.d.ts +6 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +112 -0
- package/dist/middleware.js.map +1 -0
- package/dist/prompts/answer.d.ts +22 -0
- package/dist/prompts/answer.d.ts.map +1 -0
- package/dist/prompts/answer.js +141 -0
- package/dist/prompts/answer.js.map +1 -0
- package/dist/prompts/classify.d.ts +13 -0
- package/dist/prompts/classify.d.ts.map +1 -0
- package/dist/prompts/classify.js +43 -0
- package/dist/prompts/classify.js.map +1 -0
- package/dist/prompts/generate-sql.d.ts +10 -0
- package/dist/prompts/generate-sql.d.ts.map +1 -0
- package/dist/prompts/generate-sql.js +35 -0
- package/dist/prompts/generate-sql.js.map +1 -0
- package/dist/services/code-indexer.d.ts +35 -0
- package/dist/services/code-indexer.d.ts.map +1 -0
- package/dist/services/code-indexer.js +319 -0
- package/dist/services/code-indexer.js.map +1 -0
- package/dist/services/orchestrator.d.ts +33 -0
- package/dist/services/orchestrator.d.ts.map +1 -0
- package/dist/services/orchestrator.js +196 -0
- package/dist/services/orchestrator.js.map +1 -0
- package/dist/services/schema.d.ts +9 -0
- package/dist/services/schema.d.ts.map +1 -0
- package/dist/services/schema.js +122 -0
- package/dist/services/schema.js.map +1 -0
- package/dist/services/sql-executor.d.ts +13 -0
- package/dist/services/sql-executor.d.ts.map +1 -0
- package/dist/services/sql-executor.js +104 -0
- package/dist/services/sql-executor.js.map +1 -0
- package/package.json +40 -0
- package/widget/widget.js +50 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CodeIndexer = void 0;
|
|
37
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const SUPPORTED_EXTENSIONS = new Set(['.js', '.ts', '.jsx', '.tsx', '.rb', '.py', '.erb', '.vue']);
|
|
40
|
+
const SKIP_DIRS = new Set(['node_modules', '.git', 'dist', 'build', 'vendor', 'tmp', '__pycache__', '.next']);
|
|
41
|
+
const DEFAULT_MAX_FILES = 2000;
|
|
42
|
+
class CodeIndexer {
|
|
43
|
+
files = [];
|
|
44
|
+
routes = [];
|
|
45
|
+
maxFiles;
|
|
46
|
+
constructor(options) {
|
|
47
|
+
this.maxFiles = options?.maxFiles ?? DEFAULT_MAX_FILES;
|
|
48
|
+
}
|
|
49
|
+
async index(codePaths) {
|
|
50
|
+
this.files = [];
|
|
51
|
+
this.routes = [];
|
|
52
|
+
for (const codePath of codePaths) {
|
|
53
|
+
if (this.files.length >= this.maxFiles)
|
|
54
|
+
break;
|
|
55
|
+
await this.scanDirectory(codePath, codePath);
|
|
56
|
+
}
|
|
57
|
+
if (this.files.length >= this.maxFiles) {
|
|
58
|
+
// Trim to exactly maxFiles
|
|
59
|
+
this.files = this.files.slice(0, this.maxFiles);
|
|
60
|
+
console.warn(`CodeIndexer: file cap reached (${this.maxFiles}). Some files were not indexed.`);
|
|
61
|
+
}
|
|
62
|
+
this.detectRoutes(codePaths);
|
|
63
|
+
}
|
|
64
|
+
getRoutes() {
|
|
65
|
+
return [...this.routes];
|
|
66
|
+
}
|
|
67
|
+
search(terms) {
|
|
68
|
+
const lowerTerms = terms.map(t => t.toLowerCase());
|
|
69
|
+
const results = [];
|
|
70
|
+
for (const file of this.files) {
|
|
71
|
+
const lowerContent = file.content.toLowerCase();
|
|
72
|
+
const matchCount = lowerTerms.filter(term => lowerContent.includes(term)).length;
|
|
73
|
+
if (matchCount === 0)
|
|
74
|
+
continue;
|
|
75
|
+
const lines = file.content.split('\n');
|
|
76
|
+
const matchedLineIndices = new Set();
|
|
77
|
+
for (const term of lowerTerms) {
|
|
78
|
+
for (let i = 0; i < lines.length; i++) {
|
|
79
|
+
if (lines[i].toLowerCase().includes(term)) {
|
|
80
|
+
matchedLineIndices.add(i);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Build snippet with context (+-10 lines around each match, max ~50 lines)
|
|
85
|
+
const includeLines = new Set();
|
|
86
|
+
for (const idx of matchedLineIndices) {
|
|
87
|
+
const start = Math.max(0, idx - 10);
|
|
88
|
+
const end = Math.min(lines.length - 1, idx + 10);
|
|
89
|
+
for (let i = start; i <= end; i++) {
|
|
90
|
+
includeLines.add(i);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const sortedLines = [...includeLines].sort((a, b) => a - b).slice(0, 50);
|
|
94
|
+
const snippet = sortedLines.map(i => lines[i]).join('\n');
|
|
95
|
+
results.push({
|
|
96
|
+
file: file.relativePath,
|
|
97
|
+
content: snippet,
|
|
98
|
+
matchCount,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
// Sort by matchCount descending, take top 10
|
|
102
|
+
results.sort((a, b) => b.matchCount - a.matchCount);
|
|
103
|
+
return results.slice(0, 10);
|
|
104
|
+
}
|
|
105
|
+
fileCount() {
|
|
106
|
+
return this.files.length;
|
|
107
|
+
}
|
|
108
|
+
getRouteSummary() {
|
|
109
|
+
if (this.routes.length === 0) {
|
|
110
|
+
return 'No routes detected.';
|
|
111
|
+
}
|
|
112
|
+
const lines = this.routes.map(r => `${r.method} ${r.path} \u2192 ${r.file}`);
|
|
113
|
+
return 'Routes detected:\n' + lines.join('\n');
|
|
114
|
+
}
|
|
115
|
+
// --- Private methods ---
|
|
116
|
+
async scanDirectory(dir, basePath) {
|
|
117
|
+
if (this.files.length >= this.maxFiles)
|
|
118
|
+
return;
|
|
119
|
+
let entries;
|
|
120
|
+
try {
|
|
121
|
+
entries = await fs.readdir(dir, { withFileTypes: true });
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return; // skip unreadable directories
|
|
125
|
+
}
|
|
126
|
+
for (const entry of entries) {
|
|
127
|
+
if (this.files.length >= this.maxFiles)
|
|
128
|
+
return;
|
|
129
|
+
if (entry.isDirectory()) {
|
|
130
|
+
if (SKIP_DIRS.has(entry.name))
|
|
131
|
+
continue;
|
|
132
|
+
await this.scanDirectory(path.join(dir, entry.name), basePath);
|
|
133
|
+
}
|
|
134
|
+
else if (entry.isFile()) {
|
|
135
|
+
const ext = path.extname(entry.name);
|
|
136
|
+
if (!SUPPORTED_EXTENSIONS.has(ext))
|
|
137
|
+
continue;
|
|
138
|
+
const fullPath = path.join(dir, entry.name);
|
|
139
|
+
const relativePath = path.relative(basePath, fullPath);
|
|
140
|
+
try {
|
|
141
|
+
const content = await fs.readFile(fullPath, 'utf-8');
|
|
142
|
+
this.files.push({ relativePath, content });
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// skip unreadable files
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
detectRoutes(codePaths) {
|
|
151
|
+
for (const file of this.files) {
|
|
152
|
+
this.detectExpressRoutes(file);
|
|
153
|
+
this.detectReactRouterRoutes(file);
|
|
154
|
+
this.detectRailsRoutes(file);
|
|
155
|
+
}
|
|
156
|
+
// Detect Next.js file-based routes
|
|
157
|
+
this.detectNextJsRoutes(codePaths);
|
|
158
|
+
}
|
|
159
|
+
detectExpressRoutes(file) {
|
|
160
|
+
// Match: app.get('/path', ...) or router.post('/path', ...)
|
|
161
|
+
const pattern = /(?:app|router)\.(get|post|put|patch|delete)\(\s*['"`]([^'"`]+)['"`]/gi;
|
|
162
|
+
let match;
|
|
163
|
+
while ((match = pattern.exec(file.content)) !== null) {
|
|
164
|
+
this.routes.push({
|
|
165
|
+
method: match[1].toUpperCase(),
|
|
166
|
+
path: match[2],
|
|
167
|
+
file: file.relativePath,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
detectReactRouterRoutes(file) {
|
|
172
|
+
// Match: <Route ... path="/something" ... /> — path can appear anywhere in the tag
|
|
173
|
+
// Line-oriented to avoid cross-tag matching issues
|
|
174
|
+
const pattern = /<Route\b.*?path=["']([^"']+)["']/gim;
|
|
175
|
+
let match;
|
|
176
|
+
while ((match = pattern.exec(file.content)) !== null) {
|
|
177
|
+
this.routes.push({
|
|
178
|
+
method: 'GET',
|
|
179
|
+
path: match[1],
|
|
180
|
+
file: file.relativePath,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Match: path: '/something' in route config objects
|
|
184
|
+
const configPattern = /path:\s*['"`]([^'"`]+)['"`]/gi;
|
|
185
|
+
// Only match if file also contains route-related imports
|
|
186
|
+
if (/useRoutes|createBrowserRouter|createRoutesFromElements/i.test(file.content)) {
|
|
187
|
+
while ((match = configPattern.exec(file.content)) !== null) {
|
|
188
|
+
this.routes.push({
|
|
189
|
+
method: 'GET',
|
|
190
|
+
path: match[1],
|
|
191
|
+
file: file.relativePath,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
detectNextJsRoutes(codePaths) {
|
|
197
|
+
for (const file of this.files) {
|
|
198
|
+
const parts = file.relativePath.split(path.sep);
|
|
199
|
+
// Try pages/ router (Next.js 12 and earlier)
|
|
200
|
+
const pagesIdx = parts.indexOf('pages');
|
|
201
|
+
if (pagesIdx !== -1) {
|
|
202
|
+
this.detectNextJsPagesRoute(file, parts, pagesIdx);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
// Try app/ router (Next.js 13+)
|
|
206
|
+
const appIdx = parts.indexOf('app');
|
|
207
|
+
if (appIdx !== -1) {
|
|
208
|
+
this.detectNextJsAppRoute(file, parts, appIdx);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
detectNextJsPagesRoute(file, parts, pagesIdx) {
|
|
213
|
+
const routeParts = parts.slice(pagesIdx + 1);
|
|
214
|
+
const fileName = routeParts[routeParts.length - 1];
|
|
215
|
+
// Skip _app, _document, _error files
|
|
216
|
+
if (fileName.startsWith('_'))
|
|
217
|
+
return;
|
|
218
|
+
const baseName = fileName.replace(/\.[^.]+$/, '');
|
|
219
|
+
const dirParts = routeParts.slice(0, -1);
|
|
220
|
+
const allParts = baseName === 'index' ? dirParts : [...dirParts, baseName];
|
|
221
|
+
const routePath = '/' + this.convertNextJsDynamicSegments(allParts).join('/');
|
|
222
|
+
this.routes.push({
|
|
223
|
+
method: 'GET',
|
|
224
|
+
path: routePath,
|
|
225
|
+
file: file.relativePath,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
detectNextJsAppRoute(file, parts, appIdx) {
|
|
229
|
+
const fileName = parts[parts.length - 1];
|
|
230
|
+
const baseName = fileName.replace(/\.[^.]+$/, '');
|
|
231
|
+
// In app/ router, only page files define routes
|
|
232
|
+
if (baseName !== 'page')
|
|
233
|
+
return;
|
|
234
|
+
// Route comes from directory path (exclude the page.tsx filename)
|
|
235
|
+
const routeParts = parts.slice(appIdx + 1, -1);
|
|
236
|
+
// Skip route groups (directories starting with parentheses like (auth))
|
|
237
|
+
const filteredParts = routeParts.filter(p => !p.startsWith('('));
|
|
238
|
+
const routePath = '/' + this.convertNextJsDynamicSegments(filteredParts).join('/');
|
|
239
|
+
this.routes.push({
|
|
240
|
+
method: 'GET',
|
|
241
|
+
path: routePath,
|
|
242
|
+
file: file.relativePath,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
convertNextJsDynamicSegments(parts) {
|
|
246
|
+
return parts.map(part => {
|
|
247
|
+
// [...slug] -> :slug*
|
|
248
|
+
if (part.startsWith('[...') && part.endsWith(']')) {
|
|
249
|
+
return ':' + part.slice(4, -1) + '*';
|
|
250
|
+
}
|
|
251
|
+
// [id] -> :id
|
|
252
|
+
if (part.startsWith('[') && part.endsWith(']')) {
|
|
253
|
+
return ':' + part.slice(1, -1);
|
|
254
|
+
}
|
|
255
|
+
return part;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
detectRailsRoutes(file) {
|
|
259
|
+
if (!file.relativePath.endsWith('routes.rb'))
|
|
260
|
+
return;
|
|
261
|
+
const content = file.content;
|
|
262
|
+
// root 'controller#action'
|
|
263
|
+
if (/root\s+['"]/.test(content)) {
|
|
264
|
+
this.routes.push({
|
|
265
|
+
method: 'GET',
|
|
266
|
+
path: '/',
|
|
267
|
+
file: file.relativePath,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
// resources :name
|
|
271
|
+
const resourcesPattern = /resources\s+:(\w+)/gi;
|
|
272
|
+
let match;
|
|
273
|
+
while ((match = resourcesPattern.exec(content)) !== null) {
|
|
274
|
+
this.routes.push({
|
|
275
|
+
method: 'GET',
|
|
276
|
+
path: '/' + match[1],
|
|
277
|
+
file: file.relativePath,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// get '/path', to: 'controller#action'
|
|
281
|
+
const getPattern = /get\s+['"]([^'"]+)['"]/gi;
|
|
282
|
+
while ((match = getPattern.exec(content)) !== null) {
|
|
283
|
+
this.routes.push({
|
|
284
|
+
method: 'GET',
|
|
285
|
+
path: match[1],
|
|
286
|
+
file: file.relativePath,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
// post '/path', to: 'controller#action'
|
|
290
|
+
const postPattern = /post\s+['"]([^'"]+)['"]/gi;
|
|
291
|
+
while ((match = postPattern.exec(content)) !== null) {
|
|
292
|
+
this.routes.push({
|
|
293
|
+
method: 'POST',
|
|
294
|
+
path: match[1],
|
|
295
|
+
file: file.relativePath,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
// put '/path', to: 'controller#action'
|
|
299
|
+
const putPattern = /put\s+['"]([^'"]+)['"]/gi;
|
|
300
|
+
while ((match = putPattern.exec(content)) !== null) {
|
|
301
|
+
this.routes.push({
|
|
302
|
+
method: 'PUT',
|
|
303
|
+
path: match[1],
|
|
304
|
+
file: file.relativePath,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
// delete '/path', to: 'controller#action'
|
|
308
|
+
const deletePattern = /delete\s+['"]([^'"]+)['"]/gi;
|
|
309
|
+
while ((match = deletePattern.exec(content)) !== null) {
|
|
310
|
+
this.routes.push({
|
|
311
|
+
method: 'DELETE',
|
|
312
|
+
path: match[1],
|
|
313
|
+
file: file.relativePath,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
exports.CodeIndexer = CodeIndexer;
|
|
319
|
+
//# sourceMappingURL=code-indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-indexer.js","sourceRoot":"","sources":["../../src/services/code-indexer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,gDAAkC;AAuBlC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACnG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9G,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B,MAAa,WAAW;IACd,KAAK,GAAkB,EAAE,CAAC;IAC1B,MAAM,GAAgB,EAAE,CAAC;IACzB,QAAQ,CAAS;IAEzB,YAAY,OAA4B;QACtC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,iBAAiB,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,SAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,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AC,YAAY;aACxB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AAlUD,kCAkUC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SchemaService } from './schema.js';
|
|
2
|
+
import type { CodeIndexer } from './code-indexer.js';
|
|
3
|
+
import type { ChatMessage } from '../prompts/classify.js';
|
|
4
|
+
export interface AskInput {
|
|
5
|
+
question: string;
|
|
6
|
+
pageContext?: string;
|
|
7
|
+
history?: ChatMessage[];
|
|
8
|
+
}
|
|
9
|
+
export interface OrchestratorDeps {
|
|
10
|
+
schemaService: SchemaService;
|
|
11
|
+
codeIndexer: CodeIndexer;
|
|
12
|
+
databaseUrl: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SSEEvent {
|
|
15
|
+
type: 'classifying' | 'classified' | 'sql' | 'executing' | 'token' | 'error' | 'done';
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare class Orchestrator {
|
|
19
|
+
private schemaService;
|
|
20
|
+
private codeIndexer;
|
|
21
|
+
private databaseUrl;
|
|
22
|
+
constructor(deps: OrchestratorDeps);
|
|
23
|
+
handleQuestion(input: AskInput): AsyncGenerator<SSEEvent>;
|
|
24
|
+
private handleData;
|
|
25
|
+
private handleDataWithCode;
|
|
26
|
+
private handleCode;
|
|
27
|
+
private handleNavigationOrGuidance;
|
|
28
|
+
private parseClassification;
|
|
29
|
+
private parseSqlGeneration;
|
|
30
|
+
private formatCodeContext;
|
|
31
|
+
private toCodeSnippets;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../src/services/orchestrator.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQ1D,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,aAAa,GAAG,YAAY,GAAG,KAAK,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IACtF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAYD,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAAS;gBAEhB,IAAI,EAAE,gBAAgB;IAM3B,cAAc,CAAC,KAAK,EAAE,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;YAsDjD,UAAU;YA6DV,kBAAkB;YAelB,UAAU;YA0BV,0BAA0B;IAwBzC,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Orchestrator = void 0;
|
|
4
|
+
const client_js_1 = require("../llm/client.js");
|
|
5
|
+
const classify_js_1 = require("../prompts/classify.js");
|
|
6
|
+
const generate_sql_js_1 = require("../prompts/generate-sql.js");
|
|
7
|
+
const answer_js_1 = require("../prompts/answer.js");
|
|
8
|
+
const sql_executor_js_1 = require("./sql-executor.js");
|
|
9
|
+
// ============================================================
|
|
10
|
+
// Orchestrator
|
|
11
|
+
// ============================================================
|
|
12
|
+
class Orchestrator {
|
|
13
|
+
schemaService;
|
|
14
|
+
codeIndexer;
|
|
15
|
+
databaseUrl;
|
|
16
|
+
constructor(deps) {
|
|
17
|
+
this.schemaService = deps.schemaService;
|
|
18
|
+
this.codeIndexer = deps.codeIndexer;
|
|
19
|
+
this.databaseUrl = deps.databaseUrl;
|
|
20
|
+
}
|
|
21
|
+
async *handleQuestion(input) {
|
|
22
|
+
const history = input.history ?? [];
|
|
23
|
+
// --- Step 1: Classify ---
|
|
24
|
+
yield { type: 'classifying' };
|
|
25
|
+
const schemaSummary = this.schemaService.getSummary();
|
|
26
|
+
const classifyMessages = (0, classify_js_1.buildClassifyMessages)({
|
|
27
|
+
question: input.question,
|
|
28
|
+
schemaSummary,
|
|
29
|
+
pageContext: input.pageContext,
|
|
30
|
+
history,
|
|
31
|
+
});
|
|
32
|
+
const classifyRaw = await (0, client_js_1.callLLM)(classifyMessages, { jsonMode: true });
|
|
33
|
+
const classification = this.parseClassification(classifyRaw);
|
|
34
|
+
yield {
|
|
35
|
+
type: 'classified',
|
|
36
|
+
questionType: classification.type,
|
|
37
|
+
confidence: classification.confidence,
|
|
38
|
+
};
|
|
39
|
+
// --- Step 2: Route by question type ---
|
|
40
|
+
switch (classification.type) {
|
|
41
|
+
case 'data':
|
|
42
|
+
yield* this.handleData(input, history, schemaSummary);
|
|
43
|
+
break;
|
|
44
|
+
case 'data_with_code':
|
|
45
|
+
yield* this.handleDataWithCode(input, history, schemaSummary, classification.searchTerms);
|
|
46
|
+
break;
|
|
47
|
+
case 'code':
|
|
48
|
+
yield* this.handleCode(input, history, classification.searchTerms);
|
|
49
|
+
break;
|
|
50
|
+
case 'navigation':
|
|
51
|
+
case 'guidance':
|
|
52
|
+
yield* this.handleNavigationOrGuidance(input, history, classification.type);
|
|
53
|
+
break;
|
|
54
|
+
case 'unsafe':
|
|
55
|
+
yield { type: 'token', content: "I can't help with that request." };
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
yield { type: 'done' };
|
|
59
|
+
}
|
|
60
|
+
// ============================================================
|
|
61
|
+
// Route handlers
|
|
62
|
+
// ============================================================
|
|
63
|
+
async *handleData(input, history, schemaSummary, codeContext, codeSnippets) {
|
|
64
|
+
const questionType = codeContext ? 'data_with_code' : 'data';
|
|
65
|
+
// Generate SQL
|
|
66
|
+
const sqlMessages = (0, generate_sql_js_1.buildGenerateSqlMessages)({
|
|
67
|
+
question: input.question,
|
|
68
|
+
schema: schemaSummary,
|
|
69
|
+
codeContext,
|
|
70
|
+
history,
|
|
71
|
+
});
|
|
72
|
+
const sqlRaw = await (0, client_js_1.callLLM)(sqlMessages, { jsonMode: true });
|
|
73
|
+
const sqlParsed = this.parseSqlGeneration(sqlRaw);
|
|
74
|
+
if (!sqlParsed.sql) {
|
|
75
|
+
yield { type: 'error', message: 'Failed to generate a SQL query for this question.' };
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
yield { type: 'sql', sql: sqlParsed.sql };
|
|
79
|
+
// Validate SQL
|
|
80
|
+
const validation = (0, sql_executor_js_1.validateSql)(sqlParsed.sql);
|
|
81
|
+
if (!validation.valid) {
|
|
82
|
+
yield { type: 'error', message: validation.reason };
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// Execute SQL
|
|
86
|
+
yield { type: 'executing' };
|
|
87
|
+
let sqlResult;
|
|
88
|
+
try {
|
|
89
|
+
sqlResult = await (0, sql_executor_js_1.executeSql)(this.databaseUrl, validation.sql);
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
yield { type: 'error', message };
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// Stream answer
|
|
97
|
+
const answerMessages = (0, answer_js_1.buildAnswerMessages)({
|
|
98
|
+
question: input.question,
|
|
99
|
+
type: questionType,
|
|
100
|
+
history,
|
|
101
|
+
sqlResult: sqlResult.rows,
|
|
102
|
+
sqlQuery: sqlParsed.sql,
|
|
103
|
+
codeSnippets,
|
|
104
|
+
pageContext: input.pageContext,
|
|
105
|
+
});
|
|
106
|
+
for await (const chunk of (0, client_js_1.streamLLM)(answerMessages)) {
|
|
107
|
+
yield { type: 'token', content: chunk };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async *handleDataWithCode(input, history, schemaSummary, searchTerms) {
|
|
111
|
+
// Search code index
|
|
112
|
+
const results = this.codeIndexer.search(searchTerms ?? []);
|
|
113
|
+
const codeContext = this.formatCodeContext(results);
|
|
114
|
+
const codeSnippets = this.toCodeSnippets(results);
|
|
115
|
+
// Delegate to handleData with code context
|
|
116
|
+
yield* this.handleData(input, history, schemaSummary, codeContext, codeSnippets);
|
|
117
|
+
}
|
|
118
|
+
async *handleCode(input, history, searchTerms) {
|
|
119
|
+
const results = this.codeIndexer.search(searchTerms ?? []);
|
|
120
|
+
if (results.length === 0) {
|
|
121
|
+
yield { type: 'token', content: "I couldn't find relevant code for that question." };
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const codeSnippets = this.toCodeSnippets(results);
|
|
125
|
+
const answerMessages = (0, answer_js_1.buildAnswerMessages)({
|
|
126
|
+
question: input.question,
|
|
127
|
+
type: 'code',
|
|
128
|
+
history,
|
|
129
|
+
codeSnippets,
|
|
130
|
+
});
|
|
131
|
+
for await (const chunk of (0, client_js_1.streamLLM)(answerMessages)) {
|
|
132
|
+
yield { type: 'token', content: chunk };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async *handleNavigationOrGuidance(input, history, type) {
|
|
136
|
+
const routeSummary = this.codeIndexer.getRouteSummary();
|
|
137
|
+
const answerMessages = (0, answer_js_1.buildAnswerMessages)({
|
|
138
|
+
question: input.question,
|
|
139
|
+
type,
|
|
140
|
+
history,
|
|
141
|
+
pageContext: input.pageContext,
|
|
142
|
+
navigationLinks: routeSummary ? [routeSummary] : undefined,
|
|
143
|
+
});
|
|
144
|
+
for await (const chunk of (0, client_js_1.streamLLM)(answerMessages)) {
|
|
145
|
+
yield { type: 'token', content: chunk };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// ============================================================
|
|
149
|
+
// Parsing helpers
|
|
150
|
+
// ============================================================
|
|
151
|
+
parseClassification(raw) {
|
|
152
|
+
try {
|
|
153
|
+
const parsed = JSON.parse(raw);
|
|
154
|
+
const validTypes = [
|
|
155
|
+
'data', 'data_with_code', 'code', 'navigation', 'guidance', 'unsafe',
|
|
156
|
+
];
|
|
157
|
+
const type = validTypes.includes(parsed.type) ? parsed.type : 'data';
|
|
158
|
+
return {
|
|
159
|
+
type,
|
|
160
|
+
confidence: typeof parsed.confidence === 'number' ? parsed.confidence : 0.5,
|
|
161
|
+
searchTerms: Array.isArray(parsed.searchTerms) ? parsed.searchTerms : undefined,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return { type: 'data', confidence: 0.5 };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
parseSqlGeneration(raw) {
|
|
169
|
+
try {
|
|
170
|
+
const parsed = JSON.parse(raw);
|
|
171
|
+
if (!parsed.sql || typeof parsed.sql !== 'string') {
|
|
172
|
+
return { sql: '', explanation: parsed.explanation || '' };
|
|
173
|
+
}
|
|
174
|
+
return { sql: parsed.sql, explanation: parsed.explanation || '' };
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// Non-JSON response — don't treat garbled text as SQL
|
|
178
|
+
return { sql: '', explanation: '' };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
formatCodeContext(results) {
|
|
182
|
+
if (results.length === 0)
|
|
183
|
+
return '';
|
|
184
|
+
return results
|
|
185
|
+
.map((r) => `File: ${r.file}\n${r.content}`)
|
|
186
|
+
.join('\n\n');
|
|
187
|
+
}
|
|
188
|
+
toCodeSnippets(results) {
|
|
189
|
+
return results.map((r) => ({
|
|
190
|
+
filePath: r.file,
|
|
191
|
+
content: r.content,
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.Orchestrator = Orchestrator;
|
|
196
|
+
//# sourceMappingURL=orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../src/services/orchestrator.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AACtD,wDAA+D;AAC/D,gEAAsE;AACtE,oDAA2D;AAC3D,uDAA4D;AAkC5D,+DAA+D;AAC/D,eAAe;AACf,+DAA+D;AAE/D,MAAa,YAAY;IACf,aAAa,CAAgB;IAC7B,WAAW,CAAc;IACzB,WAAW,CAAS;IAE5B,YAAY,IAAsB;QAChC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,CAAC,cAAc,CAAC,KAAe;QACnC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;QAEpC,2BAA2B;QAC3B,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;QAE9B,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QACtD,MAAM,gBAAgB,GAAG,IAAA,mCAAqB,EAAC;YAC7C,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,aAAa;YACb,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,OAAO;SACR,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,MAAM,IAAA,mBAAO,EAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QACxE,MAAM,cAAc,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAE7D,MAAM;YACJ,IAAI,EAAE,YAAY;YAClB,YAAY,EAA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