ruvector 0.2.23 → 0.2.26
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/bin/cli.js +332 -79
- package/bin/mcp-server.js +94 -22
- package/dist/analysis/complexity.d.ts +52 -0
- package/dist/analysis/complexity.d.ts.map +1 -0
- package/dist/analysis/complexity.js +146 -0
- package/dist/analysis/index.d.ts +15 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +38 -0
- package/dist/analysis/patterns.d.ts +71 -0
- package/dist/analysis/patterns.d.ts.map +1 -0
- package/dist/analysis/patterns.js +243 -0
- package/dist/analysis/security.d.ts +51 -0
- package/dist/analysis/security.d.ts.map +1 -0
- package/dist/analysis/security.js +139 -0
- package/dist/core/adaptive-embedder.d.ts +156 -0
- package/dist/core/adaptive-embedder.d.ts.map +1 -0
- package/dist/core/adaptive-embedder.js +838 -0
- package/dist/core/agentdb-fast.d.ts +149 -0
- package/dist/core/agentdb-fast.d.ts.map +1 -0
- package/dist/core/agentdb-fast.js +301 -0
- package/dist/core/ast-parser.d.ts +108 -0
- package/dist/core/ast-parser.d.ts.map +1 -0
- package/dist/core/ast-parser.js +602 -0
- package/dist/core/attention-fallbacks.d.ts +321 -0
- package/dist/core/attention-fallbacks.d.ts.map +1 -0
- package/dist/core/attention-fallbacks.js +552 -0
- package/dist/core/cluster-wrapper.d.ts +148 -0
- package/dist/core/cluster-wrapper.d.ts.map +1 -0
- package/dist/core/cluster-wrapper.js +271 -0
- package/dist/core/coverage-router.d.ts +88 -0
- package/dist/core/coverage-router.d.ts.map +1 -0
- package/dist/core/coverage-router.js +315 -0
- package/dist/core/diff-embeddings.d.ts +93 -0
- package/dist/core/diff-embeddings.d.ts.map +1 -0
- package/dist/core/diff-embeddings.js +334 -0
- package/dist/core/diskann-wrapper.d.ts +53 -0
- package/dist/core/diskann-wrapper.d.ts.map +1 -0
- package/dist/core/diskann-wrapper.js +105 -0
- package/dist/core/gnn-wrapper.d.ts +143 -0
- package/dist/core/gnn-wrapper.d.ts.map +1 -0
- package/dist/core/gnn-wrapper.js +213 -0
- package/dist/core/graph-algorithms.d.ts +83 -0
- package/dist/core/graph-algorithms.d.ts.map +1 -0
- package/dist/core/graph-algorithms.js +514 -0
- package/dist/core/graph-wrapper.d.ts +147 -0
- package/dist/core/graph-wrapper.d.ts.map +1 -0
- package/dist/core/graph-wrapper.js +299 -0
- package/dist/core/index.d.ts +50 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +92 -0
- package/dist/core/intelligence-engine.d.ts +258 -0
- package/dist/core/intelligence-engine.d.ts.map +1 -0
- package/dist/core/intelligence-engine.js +1026 -0
- package/dist/core/learning-engine.d.ts +162 -0
- package/dist/core/learning-engine.d.ts.map +1 -0
- package/dist/core/learning-engine.js +609 -0
- package/dist/core/neural-embeddings.d.ts +393 -0
- package/dist/core/neural-embeddings.d.ts.map +1 -0
- package/dist/core/neural-embeddings.js +1091 -0
- package/dist/core/neural-perf.d.ts +331 -0
- package/dist/core/neural-perf.d.ts.map +1 -0
- package/dist/core/neural-perf.js +704 -0
- package/dist/core/onnx/loader.js +348 -0
- package/dist/core/onnx/pkg/LICENSE +21 -0
- package/dist/core/onnx/pkg/loader.js +348 -0
- package/dist/core/onnx/pkg/package.json +3 -0
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.d.ts +112 -0
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.js +5 -0
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.js +638 -0
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm +0 -0
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +29 -0
- package/dist/core/onnx-embedder.d.ts +105 -0
- package/dist/core/onnx-embedder.d.ts.map +1 -0
- package/dist/core/onnx-embedder.js +414 -0
- package/dist/core/onnx-optimized.d.ts +109 -0
- package/dist/core/onnx-optimized.d.ts.map +1 -0
- package/dist/core/onnx-optimized.js +419 -0
- package/dist/core/parallel-intelligence.d.ts +109 -0
- package/dist/core/parallel-intelligence.d.ts.map +1 -0
- package/dist/core/parallel-intelligence.js +340 -0
- package/dist/core/parallel-workers.d.ts +177 -0
- package/dist/core/parallel-workers.d.ts.map +1 -0
- package/dist/core/parallel-workers.js +783 -0
- package/dist/core/router-wrapper.d.ts +75 -0
- package/dist/core/router-wrapper.d.ts.map +1 -0
- package/dist/core/router-wrapper.js +243 -0
- package/dist/core/rvf-wrapper.d.ts +86 -0
- package/dist/core/rvf-wrapper.d.ts.map +1 -0
- package/dist/core/rvf-wrapper.js +102 -0
- package/dist/core/sona-wrapper.d.ts +226 -0
- package/dist/core/sona-wrapper.d.ts.map +1 -0
- package/dist/core/sona-wrapper.js +282 -0
- package/dist/core/tensor-compress.d.ts +134 -0
- package/dist/core/tensor-compress.d.ts.map +1 -0
- package/dist/core/tensor-compress.js +432 -0
- package/dist/index.d.ts +160 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +359 -0
- package/dist/services/embedding-service.d.ts +136 -0
- package/dist/services/embedding-service.d.ts.map +1 -0
- package/dist/services/embedding-service.js +294 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +26 -0
- package/dist/types.d.ts +145 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/workers/benchmark.d.ts +44 -0
- package/dist/workers/benchmark.d.ts.map +1 -0
- package/dist/workers/benchmark.js +230 -0
- package/dist/workers/index.d.ts +10 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +25 -0
- package/dist/workers/native-worker.d.ts +76 -0
- package/dist/workers/native-worker.d.ts.map +1 -0
- package/dist/workers/native-worker.js +490 -0
- package/dist/workers/types.d.ts +69 -0
- package/dist/workers/types.d.ts.map +1 -0
- package/dist/workers/types.js +7 -0
- package/package.json +11 -9
package/bin/mcp-server.js
CHANGED
|
@@ -2301,12 +2301,72 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2301
2301
|
}
|
|
2302
2302
|
|
|
2303
2303
|
case 'hooks_route_enhanced': {
|
|
2304
|
+
// Issue #463/#422: previously shelled out via `npx ruvector hooks
|
|
2305
|
+
// route-enhanced …` and execSync'd it with a 30s timeout. `npx`
|
|
2306
|
+
// package-resolution + bin-launch can exceed 30s on cold cache
|
|
2307
|
+
// even though the underlying work finishes in ~500ms, so MCP
|
|
2308
|
+
// callers got deterministic `spawnSync /bin/sh ETIMEDOUT`. Run the
|
|
2309
|
+
// same logic in-process against the live Intelligence instance.
|
|
2304
2310
|
try {
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2311
|
+
const baseRoute = await intel.route(args.task, args.file);
|
|
2312
|
+
|
|
2313
|
+
let coverageWeight = null;
|
|
2314
|
+
let complexity = null;
|
|
2315
|
+
|
|
2316
|
+
if (args.file) {
|
|
2317
|
+
try {
|
|
2318
|
+
const covMod = require('../dist/core/coverage-router.js');
|
|
2319
|
+
if (covMod.findCoverageReport && covMod.findCoverageReport()) {
|
|
2320
|
+
coverageWeight = covMod.getCoverageRoutingWeight(args.file);
|
|
2321
|
+
}
|
|
2322
|
+
} catch (_) {}
|
|
2323
|
+
|
|
2324
|
+
try {
|
|
2325
|
+
const ASTParserMod = require('../dist/core/ast-parser.js');
|
|
2326
|
+
const ASTParserCls = ASTParserMod.ASTParser || ASTParserMod.default;
|
|
2327
|
+
if (ASTParserCls) {
|
|
2328
|
+
const parser = new ASTParserCls();
|
|
2329
|
+
const code = require('fs').readFileSync(args.file, 'utf-8');
|
|
2330
|
+
const ext = require('path').extname(args.file).slice(1);
|
|
2331
|
+
const parsed = parser.parse(code, ext);
|
|
2332
|
+
complexity = parser.calculateComplexity(parsed);
|
|
2333
|
+
}
|
|
2334
|
+
} catch (_) {}
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
let finalAgent = baseRoute.agent;
|
|
2338
|
+
let adjustedConfidence = baseRoute.confidence;
|
|
2339
|
+
const signals = [];
|
|
2340
|
+
|
|
2341
|
+
if (coverageWeight && coverageWeight.tester > 0.4) {
|
|
2342
|
+
signals.push('low coverage detected');
|
|
2343
|
+
if (coverageWeight.tester > adjustedConfidence * 0.5) {
|
|
2344
|
+
finalAgent = 'tester';
|
|
2345
|
+
adjustedConfidence = coverageWeight.tester;
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
if (complexity && complexity.cyclomatic > 15) {
|
|
2349
|
+
signals.push('high complexity detected');
|
|
2350
|
+
if (finalAgent === 'coder') {
|
|
2351
|
+
finalAgent = 'reviewer';
|
|
2352
|
+
adjustedConfidence = Math.max(adjustedConfidence, 0.7);
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
return {
|
|
2357
|
+
content: [{
|
|
2358
|
+
type: 'text',
|
|
2359
|
+
text: JSON.stringify({
|
|
2360
|
+
success: true,
|
|
2361
|
+
agent: finalAgent,
|
|
2362
|
+
confidence: adjustedConfidence,
|
|
2363
|
+
reason: baseRoute.reason,
|
|
2364
|
+
signals,
|
|
2365
|
+
coverageWeight,
|
|
2366
|
+
complexity
|
|
2367
|
+
}, null, 2)
|
|
2368
|
+
}]
|
|
2369
|
+
};
|
|
2310
2370
|
} catch (e) {
|
|
2311
2371
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }] };
|
|
2312
2372
|
}
|
|
@@ -3148,9 +3208,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3148
3208
|
// ── rvlite Query Tool Handlers ──────────────────────────────────────
|
|
3149
3209
|
case 'rvlite_sql': {
|
|
3150
3210
|
try {
|
|
3151
|
-
let
|
|
3211
|
+
let rvliteModule;
|
|
3152
3212
|
try {
|
|
3153
|
-
|
|
3213
|
+
rvliteModule = await import('rvlite');
|
|
3154
3214
|
} catch (_e) {
|
|
3155
3215
|
return { content: [{ type: 'text', text: JSON.stringify({
|
|
3156
3216
|
success: false,
|
|
@@ -3158,6 +3218,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3158
3218
|
hint: 'Install with: npm install rvlite'
|
|
3159
3219
|
}, null, 2) }] };
|
|
3160
3220
|
}
|
|
3221
|
+
const rvlite = rvliteModule.default || rvliteModule;
|
|
3161
3222
|
const safeQuery = sanitizeShellArg(args.query);
|
|
3162
3223
|
const dbOpts = args.db_path ? { path: validateRvfPath(args.db_path) } : {};
|
|
3163
3224
|
const db = new rvlite.Database(dbOpts);
|
|
@@ -3178,9 +3239,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3178
3239
|
|
|
3179
3240
|
case 'rvlite_cypher': {
|
|
3180
3241
|
try {
|
|
3181
|
-
let
|
|
3242
|
+
let rvliteModule;
|
|
3182
3243
|
try {
|
|
3183
|
-
|
|
3244
|
+
rvliteModule = await import('rvlite');
|
|
3184
3245
|
} catch (_e) {
|
|
3185
3246
|
return { content: [{ type: 'text', text: JSON.stringify({
|
|
3186
3247
|
success: false,
|
|
@@ -3188,6 +3249,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3188
3249
|
hint: 'Install with: npm install rvlite'
|
|
3189
3250
|
}, null, 2) }] };
|
|
3190
3251
|
}
|
|
3252
|
+
const rvlite = rvliteModule.default || rvliteModule;
|
|
3191
3253
|
const safeQuery = sanitizeShellArg(args.query);
|
|
3192
3254
|
const dbOpts = args.db_path ? { path: validateRvfPath(args.db_path) } : {};
|
|
3193
3255
|
const db = new rvlite.Database(dbOpts);
|
|
@@ -3208,9 +3270,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3208
3270
|
|
|
3209
3271
|
case 'rvlite_sparql': {
|
|
3210
3272
|
try {
|
|
3211
|
-
let
|
|
3273
|
+
let rvliteModule;
|
|
3212
3274
|
try {
|
|
3213
|
-
|
|
3275
|
+
rvliteModule = await import('rvlite');
|
|
3214
3276
|
} catch (_e) {
|
|
3215
3277
|
return { content: [{ type: 'text', text: JSON.stringify({
|
|
3216
3278
|
success: false,
|
|
@@ -3218,6 +3280,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3218
3280
|
hint: 'Install with: npm install rvlite'
|
|
3219
3281
|
}, null, 2) }] };
|
|
3220
3282
|
}
|
|
3283
|
+
const rvlite = rvliteModule.default || rvliteModule;
|
|
3221
3284
|
const safeQuery = sanitizeShellArg(args.query);
|
|
3222
3285
|
const dbOpts = args.db_path ? { path: validateRvfPath(args.db_path) } : {};
|
|
3223
3286
|
const db = new rvlite.Database(dbOpts);
|
|
@@ -3247,7 +3310,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3247
3310
|
const results = await client.search(args.query, { limit: args.limit || 10, category: args.category });
|
|
3248
3311
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...results }, null, 2) }] };
|
|
3249
3312
|
} catch (e) {
|
|
3250
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3313
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3251
3314
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3252
3315
|
}
|
|
3253
3316
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3264,7 +3327,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3264
3327
|
const result = await client.share({ title: args.title, content: args.content, category: args.category || 'pattern', tags: args.tags });
|
|
3265
3328
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3266
3329
|
} catch (e) {
|
|
3267
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3330
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3268
3331
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3269
3332
|
}
|
|
3270
3333
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3281,7 +3344,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3281
3344
|
const result = await client.get(args.id);
|
|
3282
3345
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3283
3346
|
} catch (e) {
|
|
3284
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3347
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3285
3348
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3286
3349
|
}
|
|
3287
3350
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3298,7 +3361,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3298
3361
|
const result = await client.vote(args.id, args.direction);
|
|
3299
3362
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3300
3363
|
} catch (e) {
|
|
3301
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3364
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3302
3365
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3303
3366
|
}
|
|
3304
3367
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3315,7 +3378,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3315
3378
|
const results = await client.list({ category: args.category, limit: args.limit || 20 });
|
|
3316
3379
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...results }, null, 2) }] };
|
|
3317
3380
|
} catch (e) {
|
|
3318
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3381
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3319
3382
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3320
3383
|
}
|
|
3321
3384
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3332,7 +3395,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3332
3395
|
const result = await client.delete(args.id);
|
|
3333
3396
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3334
3397
|
} catch (e) {
|
|
3335
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3398
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3336
3399
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3337
3400
|
}
|
|
3338
3401
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3349,7 +3412,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3349
3412
|
const result = await client.status();
|
|
3350
3413
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3351
3414
|
} catch (e) {
|
|
3352
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3415
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3353
3416
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3354
3417
|
}
|
|
3355
3418
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3366,7 +3429,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3366
3429
|
const result = await client.drift({ domain: args.domain });
|
|
3367
3430
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3368
3431
|
} catch (e) {
|
|
3369
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3432
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3370
3433
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3371
3434
|
}
|
|
3372
3435
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3383,7 +3446,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3383
3446
|
const result = await client.partition({ domain: args.domain, min_cluster_size: args.min_cluster_size || 3 });
|
|
3384
3447
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3385
3448
|
} catch (e) {
|
|
3386
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3449
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3387
3450
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3388
3451
|
}
|
|
3389
3452
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3400,7 +3463,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3400
3463
|
const result = await client.transfer(args.source, args.target);
|
|
3401
3464
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3402
3465
|
} catch (e) {
|
|
3403
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3466
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3404
3467
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3405
3468
|
}
|
|
3406
3469
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3417,7 +3480,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
3417
3480
|
const result = await client.sync({ direction: args.direction || 'both' });
|
|
3418
3481
|
return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...result }, null, 2) }] };
|
|
3419
3482
|
} catch (e) {
|
|
3420
|
-
if (e.code === 'MODULE_NOT_FOUND') {
|
|
3483
|
+
if (e.code === 'MODULE_NOT_FOUND' || e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED') {
|
|
3421
3484
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: 'Brain tools require @ruvector/pi-brain', hint: 'npm install @ruvector/pi-brain' }, null, 2) }] };
|
|
3422
3485
|
}
|
|
3423
3486
|
return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: e.message }, null, 2) }], isError: true };
|
|
@@ -3777,6 +3840,15 @@ async function main() {
|
|
|
3777
3840
|
const transport = new StdioServerTransport();
|
|
3778
3841
|
await server.connect(transport);
|
|
3779
3842
|
console.error('RuVector MCP server running on stdio');
|
|
3843
|
+
|
|
3844
|
+
// Exit cleanly when the parent process closes the stdio pipe or sends a
|
|
3845
|
+
// termination signal. Without these handlers, the MCP server can survive
|
|
3846
|
+
// the parent's death (e.g. when the client is killed with SIGKILL) and
|
|
3847
|
+
// accumulate as an orphaned process under PPID=1, consuming RSS for the
|
|
3848
|
+
// lifetime of the user session.
|
|
3849
|
+
process.stdin.on('end', () => process.exit(0));
|
|
3850
|
+
process.on('SIGINT', () => process.exit(0));
|
|
3851
|
+
process.on('SIGTERM', () => process.exit(0));
|
|
3780
3852
|
}
|
|
3781
3853
|
|
|
3782
3854
|
main().catch(console.error);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complexity Analysis Module - Consolidated code complexity metrics
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for cyclomatic complexity and code metrics.
|
|
5
|
+
* Used by native-worker.ts and parallel-workers.ts
|
|
6
|
+
*/
|
|
7
|
+
export interface ComplexityResult {
|
|
8
|
+
file: string;
|
|
9
|
+
lines: number;
|
|
10
|
+
nonEmptyLines: number;
|
|
11
|
+
cyclomaticComplexity: number;
|
|
12
|
+
functions: number;
|
|
13
|
+
avgFunctionSize: number;
|
|
14
|
+
maxFunctionComplexity?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ComplexityThresholds {
|
|
17
|
+
complexity: number;
|
|
18
|
+
functions: number;
|
|
19
|
+
lines: number;
|
|
20
|
+
avgSize: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const DEFAULT_THRESHOLDS: ComplexityThresholds;
|
|
23
|
+
/**
|
|
24
|
+
* Analyze complexity of a single file
|
|
25
|
+
*/
|
|
26
|
+
export declare function analyzeFile(filePath: string, content?: string): ComplexityResult;
|
|
27
|
+
/**
|
|
28
|
+
* Analyze complexity of multiple files
|
|
29
|
+
*/
|
|
30
|
+
export declare function analyzeFiles(files: string[], maxFiles?: number): ComplexityResult[];
|
|
31
|
+
/**
|
|
32
|
+
* Check if complexity exceeds thresholds
|
|
33
|
+
*/
|
|
34
|
+
export declare function exceedsThresholds(result: ComplexityResult, thresholds?: ComplexityThresholds): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Get complexity rating
|
|
37
|
+
*/
|
|
38
|
+
export declare function getComplexityRating(complexity: number): 'low' | 'medium' | 'high' | 'critical';
|
|
39
|
+
/**
|
|
40
|
+
* Filter files exceeding thresholds
|
|
41
|
+
*/
|
|
42
|
+
export declare function filterComplex(results: ComplexityResult[], thresholds?: ComplexityThresholds): ComplexityResult[];
|
|
43
|
+
declare const _default: {
|
|
44
|
+
DEFAULT_THRESHOLDS: ComplexityThresholds;
|
|
45
|
+
analyzeFile: typeof analyzeFile;
|
|
46
|
+
analyzeFiles: typeof analyzeFiles;
|
|
47
|
+
exceedsThresholds: typeof exceedsThresholds;
|
|
48
|
+
getComplexityRating: typeof getComplexityRating;
|
|
49
|
+
filterComplex: typeof filterComplex;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
|
52
|
+
//# sourceMappingURL=complexity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../src/analysis/complexity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,EAAE,oBAKhC,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAsDhF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY,GAAG,gBAAgB,EAAE,CAExF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,UAAU,GAAE,oBAAyC,GACpD,OAAO,CAOT;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAK9F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,gBAAgB,EAAE,EAC3B,UAAU,GAAE,oBAAyC,GACpD,gBAAgB,EAAE,CAEpB;;;;;;;;;AAED,wBAOE"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Complexity Analysis Module - Consolidated code complexity metrics
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for cyclomatic complexity and code metrics.
|
|
6
|
+
* Used by native-worker.ts and parallel-workers.ts
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.DEFAULT_THRESHOLDS = void 0;
|
|
43
|
+
exports.analyzeFile = analyzeFile;
|
|
44
|
+
exports.analyzeFiles = analyzeFiles;
|
|
45
|
+
exports.exceedsThresholds = exceedsThresholds;
|
|
46
|
+
exports.getComplexityRating = getComplexityRating;
|
|
47
|
+
exports.filterComplex = filterComplex;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
exports.DEFAULT_THRESHOLDS = {
|
|
50
|
+
complexity: 10,
|
|
51
|
+
functions: 30,
|
|
52
|
+
lines: 500,
|
|
53
|
+
avgSize: 50,
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Analyze complexity of a single file
|
|
57
|
+
*/
|
|
58
|
+
function analyzeFile(filePath, content) {
|
|
59
|
+
try {
|
|
60
|
+
const fileContent = content ?? (fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf-8') : '');
|
|
61
|
+
if (!fileContent) {
|
|
62
|
+
return { file: filePath, lines: 0, nonEmptyLines: 0, cyclomaticComplexity: 1, functions: 0, avgFunctionSize: 0 };
|
|
63
|
+
}
|
|
64
|
+
const lines = fileContent.split('\n');
|
|
65
|
+
const nonEmptyLines = lines.filter(l => l.trim().length > 0).length;
|
|
66
|
+
// Count branching statements for cyclomatic complexity
|
|
67
|
+
const branches = (fileContent.match(/\bif\b/g)?.length || 0) +
|
|
68
|
+
(fileContent.match(/\belse\b/g)?.length || 0) +
|
|
69
|
+
(fileContent.match(/\bfor\b/g)?.length || 0) +
|
|
70
|
+
(fileContent.match(/\bwhile\b/g)?.length || 0) +
|
|
71
|
+
(fileContent.match(/\bswitch\b/g)?.length || 0) +
|
|
72
|
+
(fileContent.match(/\bcase\b/g)?.length || 0) +
|
|
73
|
+
(fileContent.match(/\bcatch\b/g)?.length || 0) +
|
|
74
|
+
(fileContent.match(/\?\?/g)?.length || 0) +
|
|
75
|
+
(fileContent.match(/&&/g)?.length || 0) +
|
|
76
|
+
(fileContent.match(/\|\|/g)?.length || 0) +
|
|
77
|
+
(fileContent.match(/\?[^:]/g)?.length || 0); // Ternary
|
|
78
|
+
const cyclomaticComplexity = branches + 1;
|
|
79
|
+
// Count functions
|
|
80
|
+
const functionPatterns = [
|
|
81
|
+
/function\s+\w+/g,
|
|
82
|
+
/\w+\s*=\s*(?:async\s*)?\(/g,
|
|
83
|
+
/\w+\s*:\s*(?:async\s*)?\(/g,
|
|
84
|
+
/(?:async\s+)?(?:public|private|protected)?\s+\w+\s*\([^)]*\)\s*[:{]/g,
|
|
85
|
+
];
|
|
86
|
+
let functions = 0;
|
|
87
|
+
for (const pattern of functionPatterns) {
|
|
88
|
+
functions += (fileContent.match(pattern) || []).length;
|
|
89
|
+
}
|
|
90
|
+
// Deduplicate by rough estimate
|
|
91
|
+
functions = Math.ceil(functions / 2);
|
|
92
|
+
const avgFunctionSize = functions > 0 ? Math.round(nonEmptyLines / functions) : nonEmptyLines;
|
|
93
|
+
return {
|
|
94
|
+
file: filePath,
|
|
95
|
+
lines: lines.length,
|
|
96
|
+
nonEmptyLines,
|
|
97
|
+
cyclomaticComplexity,
|
|
98
|
+
functions,
|
|
99
|
+
avgFunctionSize,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return { file: filePath, lines: 0, nonEmptyLines: 0, cyclomaticComplexity: 1, functions: 0, avgFunctionSize: 0 };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Analyze complexity of multiple files
|
|
108
|
+
*/
|
|
109
|
+
function analyzeFiles(files, maxFiles = 100) {
|
|
110
|
+
return files.slice(0, maxFiles).map(f => analyzeFile(f));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check if complexity exceeds thresholds
|
|
114
|
+
*/
|
|
115
|
+
function exceedsThresholds(result, thresholds = exports.DEFAULT_THRESHOLDS) {
|
|
116
|
+
return (result.cyclomaticComplexity > thresholds.complexity ||
|
|
117
|
+
result.functions > thresholds.functions ||
|
|
118
|
+
result.lines > thresholds.lines ||
|
|
119
|
+
result.avgFunctionSize > thresholds.avgSize);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get complexity rating
|
|
123
|
+
*/
|
|
124
|
+
function getComplexityRating(complexity) {
|
|
125
|
+
if (complexity <= 5)
|
|
126
|
+
return 'low';
|
|
127
|
+
if (complexity <= 10)
|
|
128
|
+
return 'medium';
|
|
129
|
+
if (complexity <= 20)
|
|
130
|
+
return 'high';
|
|
131
|
+
return 'critical';
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Filter files exceeding thresholds
|
|
135
|
+
*/
|
|
136
|
+
function filterComplex(results, thresholds = exports.DEFAULT_THRESHOLDS) {
|
|
137
|
+
return results.filter(r => exceedsThresholds(r, thresholds));
|
|
138
|
+
}
|
|
139
|
+
exports.default = {
|
|
140
|
+
DEFAULT_THRESHOLDS: exports.DEFAULT_THRESHOLDS,
|
|
141
|
+
analyzeFile,
|
|
142
|
+
analyzeFiles,
|
|
143
|
+
exceedsThresholds,
|
|
144
|
+
getComplexityRating,
|
|
145
|
+
filterComplex,
|
|
146
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analysis Module - Consolidated code analysis utilities
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for:
|
|
5
|
+
* - Security scanning
|
|
6
|
+
* - Complexity analysis
|
|
7
|
+
* - Pattern extraction
|
|
8
|
+
*/
|
|
9
|
+
export * from './security';
|
|
10
|
+
export * from './complexity';
|
|
11
|
+
export * from './patterns';
|
|
12
|
+
export { default as security } from './security';
|
|
13
|
+
export { default as complexity } from './complexity';
|
|
14
|
+
export { default as patterns } from './patterns';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Analysis Module - Consolidated code analysis utilities
|
|
4
|
+
*
|
|
5
|
+
* Single source of truth for:
|
|
6
|
+
* - Security scanning
|
|
7
|
+
* - Complexity analysis
|
|
8
|
+
* - Pattern extraction
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.patterns = exports.complexity = exports.security = void 0;
|
|
29
|
+
__exportStar(require("./security"), exports);
|
|
30
|
+
__exportStar(require("./complexity"), exports);
|
|
31
|
+
__exportStar(require("./patterns"), exports);
|
|
32
|
+
// Re-export defaults for convenience
|
|
33
|
+
var security_1 = require("./security");
|
|
34
|
+
Object.defineProperty(exports, "security", { enumerable: true, get: function () { return __importDefault(security_1).default; } });
|
|
35
|
+
var complexity_1 = require("./complexity");
|
|
36
|
+
Object.defineProperty(exports, "complexity", { enumerable: true, get: function () { return __importDefault(complexity_1).default; } });
|
|
37
|
+
var patterns_1 = require("./patterns");
|
|
38
|
+
Object.defineProperty(exports, "patterns", { enumerable: true, get: function () { return __importDefault(patterns_1).default; } });
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern Extraction Module - Consolidated code pattern detection
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth for extracting functions, imports, exports, etc.
|
|
5
|
+
* Used by native-worker.ts and parallel-workers.ts
|
|
6
|
+
*/
|
|
7
|
+
export interface PatternMatch {
|
|
8
|
+
type: 'function' | 'class' | 'import' | 'export' | 'todo' | 'variable' | 'type';
|
|
9
|
+
match: string;
|
|
10
|
+
file: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FilePatterns {
|
|
14
|
+
file: string;
|
|
15
|
+
language: string;
|
|
16
|
+
functions: string[];
|
|
17
|
+
classes: string[];
|
|
18
|
+
imports: string[];
|
|
19
|
+
exports: string[];
|
|
20
|
+
todos: string[];
|
|
21
|
+
variables: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Detect language from file extension
|
|
25
|
+
*/
|
|
26
|
+
export declare function detectLanguage(file: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Extract function names from content
|
|
29
|
+
*/
|
|
30
|
+
export declare function extractFunctions(content: string): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Extract class names from content
|
|
33
|
+
*/
|
|
34
|
+
export declare function extractClasses(content: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Extract import statements from content
|
|
37
|
+
*/
|
|
38
|
+
export declare function extractImports(content: string): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Extract export statements from content
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractExports(content: string): string[];
|
|
43
|
+
/**
|
|
44
|
+
* Extract TODO/FIXME comments from content
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractTodos(content: string): string[];
|
|
47
|
+
/**
|
|
48
|
+
* Extract all patterns from a file
|
|
49
|
+
*/
|
|
50
|
+
export declare function extractAllPatterns(filePath: string, content?: string): FilePatterns;
|
|
51
|
+
/**
|
|
52
|
+
* Extract patterns from multiple files
|
|
53
|
+
*/
|
|
54
|
+
export declare function extractFromFiles(files: string[], maxFiles?: number): FilePatterns[];
|
|
55
|
+
/**
|
|
56
|
+
* Convert FilePatterns to PatternMatch array (for native-worker compatibility)
|
|
57
|
+
*/
|
|
58
|
+
export declare function toPatternMatches(patterns: FilePatterns): PatternMatch[];
|
|
59
|
+
declare const _default: {
|
|
60
|
+
detectLanguage: typeof detectLanguage;
|
|
61
|
+
extractFunctions: typeof extractFunctions;
|
|
62
|
+
extractClasses: typeof extractClasses;
|
|
63
|
+
extractImports: typeof extractImports;
|
|
64
|
+
extractExports: typeof extractExports;
|
|
65
|
+
extractTodos: typeof extractTodos;
|
|
66
|
+
extractAllPatterns: typeof extractAllPatterns;
|
|
67
|
+
extractFromFiles: typeof extractFromFiles;
|
|
68
|
+
toPatternMatches: typeof toPatternMatches;
|
|
69
|
+
};
|
|
70
|
+
export default _default;
|
|
71
|
+
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/analysis/patterns.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUnD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CA2B1D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBxD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmBxD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAuBxD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAUtD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CA0BnF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,GAAE,MAAY,GAAG,YAAY,EAAE,CAExF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,EAAE,CAoBvE;;;;;;;;;;;;AAED,wBAUE"}
|