ruvector 0.2.21 → 0.2.23

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.
Files changed (123) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.js +160 -0
  3. package/package.json +9 -5
  4. package/src/decompiler/api-prober.js +302 -0
  5. package/src/decompiler/model-decompiler.js +423 -0
  6. package/dist/analysis/complexity.d.ts +0 -52
  7. package/dist/analysis/complexity.d.ts.map +0 -1
  8. package/dist/analysis/complexity.js +0 -146
  9. package/dist/analysis/index.d.ts +0 -15
  10. package/dist/analysis/index.d.ts.map +0 -1
  11. package/dist/analysis/index.js +0 -38
  12. package/dist/analysis/patterns.d.ts +0 -71
  13. package/dist/analysis/patterns.d.ts.map +0 -1
  14. package/dist/analysis/patterns.js +0 -243
  15. package/dist/analysis/security.d.ts +0 -51
  16. package/dist/analysis/security.d.ts.map +0 -1
  17. package/dist/analysis/security.js +0 -139
  18. package/dist/core/adaptive-embedder.d.ts +0 -156
  19. package/dist/core/adaptive-embedder.d.ts.map +0 -1
  20. package/dist/core/adaptive-embedder.js +0 -838
  21. package/dist/core/agentdb-fast.d.ts +0 -149
  22. package/dist/core/agentdb-fast.d.ts.map +0 -1
  23. package/dist/core/agentdb-fast.js +0 -301
  24. package/dist/core/ast-parser.d.ts +0 -108
  25. package/dist/core/ast-parser.d.ts.map +0 -1
  26. package/dist/core/ast-parser.js +0 -602
  27. package/dist/core/attention-fallbacks.d.ts +0 -321
  28. package/dist/core/attention-fallbacks.d.ts.map +0 -1
  29. package/dist/core/attention-fallbacks.js +0 -552
  30. package/dist/core/cluster-wrapper.d.ts +0 -148
  31. package/dist/core/cluster-wrapper.d.ts.map +0 -1
  32. package/dist/core/cluster-wrapper.js +0 -271
  33. package/dist/core/coverage-router.d.ts +0 -88
  34. package/dist/core/coverage-router.d.ts.map +0 -1
  35. package/dist/core/coverage-router.js +0 -315
  36. package/dist/core/diff-embeddings.d.ts +0 -93
  37. package/dist/core/diff-embeddings.d.ts.map +0 -1
  38. package/dist/core/diff-embeddings.js +0 -334
  39. package/dist/core/gnn-wrapper.d.ts +0 -143
  40. package/dist/core/gnn-wrapper.d.ts.map +0 -1
  41. package/dist/core/gnn-wrapper.js +0 -213
  42. package/dist/core/graph-algorithms.d.ts +0 -83
  43. package/dist/core/graph-algorithms.d.ts.map +0 -1
  44. package/dist/core/graph-algorithms.js +0 -514
  45. package/dist/core/graph-wrapper.d.ts +0 -147
  46. package/dist/core/graph-wrapper.d.ts.map +0 -1
  47. package/dist/core/graph-wrapper.js +0 -299
  48. package/dist/core/index.d.ts +0 -48
  49. package/dist/core/index.d.ts.map +0 -1
  50. package/dist/core/index.js +0 -89
  51. package/dist/core/intelligence-engine.d.ts +0 -258
  52. package/dist/core/intelligence-engine.d.ts.map +0 -1
  53. package/dist/core/intelligence-engine.js +0 -1030
  54. package/dist/core/learning-engine.d.ts +0 -160
  55. package/dist/core/learning-engine.d.ts.map +0 -1
  56. package/dist/core/learning-engine.js +0 -589
  57. package/dist/core/neural-embeddings.d.ts +0 -393
  58. package/dist/core/neural-embeddings.d.ts.map +0 -1
  59. package/dist/core/neural-embeddings.js +0 -1091
  60. package/dist/core/neural-perf.d.ts +0 -331
  61. package/dist/core/neural-perf.d.ts.map +0 -1
  62. package/dist/core/neural-perf.js +0 -704
  63. package/dist/core/onnx/loader.js +0 -348
  64. package/dist/core/onnx/pkg/LICENSE +0 -21
  65. package/dist/core/onnx/pkg/loader.js +0 -348
  66. package/dist/core/onnx/pkg/package.json +0 -3
  67. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.d.ts +0 -112
  68. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.js +0 -5
  69. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.js +0 -638
  70. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm +0 -0
  71. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +0 -29
  72. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_cjs.js +0 -127
  73. package/dist/core/onnx-embedder.d.ts +0 -105
  74. package/dist/core/onnx-embedder.d.ts.map +0 -1
  75. package/dist/core/onnx-embedder.js +0 -410
  76. package/dist/core/onnx-llm.d.ts +0 -206
  77. package/dist/core/onnx-llm.d.ts.map +0 -1
  78. package/dist/core/onnx-llm.js +0 -430
  79. package/dist/core/onnx-optimized.d.ts +0 -109
  80. package/dist/core/onnx-optimized.d.ts.map +0 -1
  81. package/dist/core/onnx-optimized.js +0 -419
  82. package/dist/core/parallel-intelligence.d.ts +0 -109
  83. package/dist/core/parallel-intelligence.d.ts.map +0 -1
  84. package/dist/core/parallel-intelligence.js +0 -340
  85. package/dist/core/parallel-workers.d.ts +0 -177
  86. package/dist/core/parallel-workers.d.ts.map +0 -1
  87. package/dist/core/parallel-workers.js +0 -671
  88. package/dist/core/router-wrapper.d.ts +0 -62
  89. package/dist/core/router-wrapper.d.ts.map +0 -1
  90. package/dist/core/router-wrapper.js +0 -209
  91. package/dist/core/rvf-wrapper.d.ts +0 -86
  92. package/dist/core/rvf-wrapper.d.ts.map +0 -1
  93. package/dist/core/rvf-wrapper.js +0 -102
  94. package/dist/core/sona-wrapper.d.ts +0 -226
  95. package/dist/core/sona-wrapper.d.ts.map +0 -1
  96. package/dist/core/sona-wrapper.js +0 -282
  97. package/dist/core/tensor-compress.d.ts +0 -134
  98. package/dist/core/tensor-compress.d.ts.map +0 -1
  99. package/dist/core/tensor-compress.js +0 -432
  100. package/dist/index.d.ts +0 -105
  101. package/dist/index.d.ts.map +0 -1
  102. package/dist/index.js +0 -221
  103. package/dist/services/embedding-service.d.ts +0 -136
  104. package/dist/services/embedding-service.d.ts.map +0 -1
  105. package/dist/services/embedding-service.js +0 -294
  106. package/dist/services/index.d.ts +0 -6
  107. package/dist/services/index.d.ts.map +0 -1
  108. package/dist/services/index.js +0 -26
  109. package/dist/types.d.ts +0 -145
  110. package/dist/types.d.ts.map +0 -1
  111. package/dist/types.js +0 -2
  112. package/dist/workers/benchmark.d.ts +0 -44
  113. package/dist/workers/benchmark.d.ts.map +0 -1
  114. package/dist/workers/benchmark.js +0 -230
  115. package/dist/workers/index.d.ts +0 -10
  116. package/dist/workers/index.d.ts.map +0 -1
  117. package/dist/workers/index.js +0 -25
  118. package/dist/workers/native-worker.d.ts +0 -76
  119. package/dist/workers/native-worker.d.ts.map +0 -1
  120. package/dist/workers/native-worker.js +0 -490
  121. package/dist/workers/types.d.ts +0 -69
  122. package/dist/workers/types.d.ts.map +0 -1
  123. package/dist/workers/types.js +0 -7
@@ -1,490 +0,0 @@
1
- "use strict";
2
- /**
3
- * Native Worker Runner for RuVector
4
- *
5
- * Direct integration with:
6
- * - ONNX embedder (384d, SIMD-accelerated)
7
- * - VectorDB (HNSW indexing)
8
- * - Intelligence engine (Q-learning, memory)
9
- *
10
- * No delegation to external tools - pure ruvector execution.
11
- */
12
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- var desc = Object.getOwnPropertyDescriptor(m, k);
15
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
16
- desc = { enumerable: true, get: function() { return m[k]; } };
17
- }
18
- Object.defineProperty(o, k2, desc);
19
- }) : (function(o, m, k, k2) {
20
- if (k2 === undefined) k2 = k;
21
- o[k2] = m[k];
22
- }));
23
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
24
- Object.defineProperty(o, "default", { enumerable: true, value: v });
25
- }) : function(o, v) {
26
- o["default"] = v;
27
- });
28
- var __importStar = (this && this.__importStar) || (function () {
29
- var ownKeys = function(o) {
30
- ownKeys = Object.getOwnPropertyNames || function (o) {
31
- var ar = [];
32
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
- return ar;
34
- };
35
- return ownKeys(o);
36
- };
37
- return function (mod) {
38
- if (mod && mod.__esModule) return mod;
39
- var result = {};
40
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
- __setModuleDefault(result, mod);
42
- return result;
43
- };
44
- })();
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.NativeWorker = void 0;
47
- exports.createSecurityWorker = createSecurityWorker;
48
- exports.createAnalysisWorker = createAnalysisWorker;
49
- exports.createLearningWorker = createLearningWorker;
50
- const fs = __importStar(require("fs"));
51
- const path = __importStar(require("path"));
52
- let cachedGlob = null;
53
- // Fallback glob implementation using fs
54
- function createFallbackGlob() {
55
- return async (pattern, options) => {
56
- const cwd = options?.cwd || process.cwd();
57
- const results = [];
58
- const walk = (dir) => {
59
- try {
60
- const entries = fs.readdirSync(dir, { withFileTypes: true });
61
- for (const entry of entries) {
62
- const fullPath = path.join(dir, entry.name);
63
- if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
64
- walk(fullPath);
65
- }
66
- else if (entry.isFile()) {
67
- results.push(path.relative(cwd, fullPath));
68
- }
69
- }
70
- }
71
- catch { /* ignore permission errors */ }
72
- };
73
- walk(cwd);
74
- // Simple pattern matching for *.ext patterns
75
- const ext = pattern.match(/\*\.(\w+)$/)?.[1];
76
- return ext ? results.filter(f => f.endsWith('.' + ext)) : results;
77
- };
78
- }
79
- async function getGlob() {
80
- if (cachedGlob)
81
- return cachedGlob;
82
- try {
83
- // Dynamic import - may fail if glob not installed
84
- const mod = await Function('return import("glob")')();
85
- if (mod && typeof mod.glob === 'function') {
86
- cachedGlob = mod.glob;
87
- return cachedGlob;
88
- }
89
- }
90
- catch { /* glob not available */ }
91
- // Fallback to simple implementation
92
- cachedGlob = createFallbackGlob();
93
- return cachedGlob;
94
- }
95
- const onnx_embedder_1 = require("../core/onnx-embedder");
96
- const security_1 = require("../analysis/security");
97
- const complexity_1 = require("../analysis/complexity");
98
- const patterns_1 = require("../analysis/patterns");
99
- // Lazy imports for optional dependencies
100
- let VectorDb = null;
101
- let intelligence = null;
102
- async function loadOptionalDeps() {
103
- try {
104
- const core = await Promise.resolve().then(() => __importStar(require('@ruvector/core')));
105
- VectorDb = core.VectorDb;
106
- }
107
- catch {
108
- // VectorDB not available
109
- }
110
- try {
111
- const intel = await Promise.resolve().then(() => __importStar(require('../core/intelligence-engine')));
112
- intelligence = intel;
113
- }
114
- catch {
115
- // Intelligence not available
116
- }
117
- }
118
- /**
119
- * Native Worker Runner
120
- */
121
- class NativeWorker {
122
- constructor(config) {
123
- this.vectorDb = null;
124
- this.findings = [];
125
- this.stats = {
126
- filesAnalyzed: 0,
127
- patternsFound: 0,
128
- embeddingsGenerated: 0,
129
- vectorsStored: 0,
130
- };
131
- this.config = config;
132
- }
133
- /**
134
- * Initialize worker with capabilities
135
- */
136
- async init() {
137
- await loadOptionalDeps();
138
- // Initialize ONNX embedder if needed
139
- if (this.config.capabilities?.onnxEmbeddings) {
140
- await (0, onnx_embedder_1.initOnnxEmbedder)();
141
- }
142
- // Initialize VectorDB if needed
143
- if (this.config.capabilities?.vectorDb && VectorDb) {
144
- const dbPath = path.join(process.cwd(), '.ruvector', 'workers', `${this.config.name}.db`);
145
- fs.mkdirSync(path.dirname(dbPath), { recursive: true });
146
- this.vectorDb = new VectorDb({
147
- dimensions: 384,
148
- storagePath: dbPath,
149
- });
150
- }
151
- }
152
- /**
153
- * Run all phases in sequence
154
- */
155
- async run(targetPath = '.') {
156
- const startTime = performance.now();
157
- const phaseResults = [];
158
- await this.init();
159
- let context = { targetPath, files: [], patterns: [], embeddings: [] };
160
- for (const phaseConfig of this.config.phases) {
161
- const phaseStart = performance.now();
162
- try {
163
- context = await this.executePhase(phaseConfig.type, context, phaseConfig.config);
164
- phaseResults.push({
165
- phase: phaseConfig.type,
166
- success: true,
167
- data: this.summarizePhaseData(phaseConfig.type, context),
168
- timeMs: performance.now() - phaseStart,
169
- });
170
- }
171
- catch (error) {
172
- phaseResults.push({
173
- phase: phaseConfig.type,
174
- success: false,
175
- data: null,
176
- timeMs: performance.now() - phaseStart,
177
- error: error.message,
178
- });
179
- // Continue to next phase on error (fault-tolerant)
180
- }
181
- }
182
- const totalTimeMs = performance.now() - startTime;
183
- return {
184
- worker: this.config.name,
185
- success: phaseResults.every(p => p.success),
186
- phases: phaseResults,
187
- totalTimeMs,
188
- summary: {
189
- filesAnalyzed: this.stats.filesAnalyzed,
190
- patternsFound: this.stats.patternsFound,
191
- embeddingsGenerated: this.stats.embeddingsGenerated,
192
- vectorsStored: this.stats.vectorsStored,
193
- findings: this.findings,
194
- },
195
- };
196
- }
197
- /**
198
- * Execute a single phase
199
- */
200
- async executePhase(type, context, config) {
201
- switch (type) {
202
- case 'file-discovery':
203
- return this.phaseFileDiscovery(context, config);
204
- case 'pattern-extraction':
205
- return this.phasePatternExtraction(context, config);
206
- case 'embedding-generation':
207
- return this.phaseEmbeddingGeneration(context, config);
208
- case 'vector-storage':
209
- return this.phaseVectorStorage(context, config);
210
- case 'similarity-search':
211
- return this.phaseSimilaritySearch(context, config);
212
- case 'security-scan':
213
- return this.phaseSecurityScan(context, config);
214
- case 'complexity-analysis':
215
- return this.phaseComplexityAnalysis(context, config);
216
- case 'summarization':
217
- return this.phaseSummarization(context, config);
218
- default:
219
- throw new Error(`Unknown phase: ${type}`);
220
- }
221
- }
222
- /**
223
- * Phase: File Discovery
224
- */
225
- async phaseFileDiscovery(context, config) {
226
- const patterns = config?.patterns || ['**/*.ts', '**/*.js', '**/*.tsx', '**/*.jsx'];
227
- const exclude = config?.exclude || ['**/node_modules/**', '**/dist/**', '**/.git/**'];
228
- const files = [];
229
- const glob = await getGlob();
230
- for (const pattern of patterns) {
231
- const matches = await glob(pattern, {
232
- cwd: context.targetPath,
233
- ignore: exclude,
234
- nodir: true,
235
- });
236
- files.push(...matches.map((f) => path.join(context.targetPath, f)));
237
- }
238
- this.stats.filesAnalyzed = files.length;
239
- return { ...context, files };
240
- }
241
- /**
242
- * Phase: Pattern Extraction (uses shared analysis module)
243
- */
244
- async phasePatternExtraction(context, config) {
245
- const patterns = [];
246
- const patternTypes = config?.types || ['function', 'class', 'import', 'export', 'todo'];
247
- for (const file of context.files.slice(0, 100)) {
248
- try {
249
- const filePatterns = (0, patterns_1.extractAllPatterns)(file);
250
- const matches = (0, patterns_1.toPatternMatches)(filePatterns);
251
- // Filter by requested pattern types
252
- for (const match of matches) {
253
- if (patternTypes.includes(match.type)) {
254
- patterns.push(match);
255
- // Add findings for TODOs
256
- if (match.type === 'todo') {
257
- this.findings.push({
258
- type: 'info',
259
- message: match.match,
260
- file,
261
- });
262
- }
263
- }
264
- }
265
- }
266
- catch {
267
- // Skip unreadable files
268
- }
269
- }
270
- this.stats.patternsFound = patterns.length;
271
- return { ...context, patterns };
272
- }
273
- /**
274
- * Phase: Embedding Generation (ONNX)
275
- */
276
- async phaseEmbeddingGeneration(context, config) {
277
- if (!(0, onnx_embedder_1.isReady)()) {
278
- await (0, onnx_embedder_1.initOnnxEmbedder)();
279
- }
280
- const embeddings = [];
281
- const batchSize = config?.batchSize || 32;
282
- // Collect texts to embed
283
- const texts = [];
284
- // Embed file content summaries
285
- for (const file of context.files.slice(0, 50)) {
286
- try {
287
- const content = fs.readFileSync(file, 'utf-8');
288
- const summary = content.slice(0, 512); // First 512 chars
289
- texts.push({ text: summary, file });
290
- }
291
- catch {
292
- // Skip
293
- }
294
- }
295
- // Embed patterns
296
- for (const pattern of context.patterns.slice(0, 100)) {
297
- texts.push({ text: pattern.match, file: pattern.file });
298
- }
299
- // Batch embed
300
- for (let i = 0; i < texts.length; i += batchSize) {
301
- const batch = texts.slice(i, i + batchSize);
302
- const results = await (0, onnx_embedder_1.embedBatch)(batch.map(t => t.text));
303
- for (let j = 0; j < results.length; j++) {
304
- embeddings.push({
305
- text: batch[j].text,
306
- embedding: results[j].embedding,
307
- file: batch[j].file,
308
- });
309
- }
310
- }
311
- this.stats.embeddingsGenerated = embeddings.length;
312
- return { ...context, embeddings };
313
- }
314
- /**
315
- * Phase: Vector Storage
316
- */
317
- async phaseVectorStorage(context, config) {
318
- if (!this.vectorDb) {
319
- return context;
320
- }
321
- let stored = 0;
322
- for (const item of context.embeddings) {
323
- try {
324
- await this.vectorDb.insert({
325
- vector: new Float32Array(item.embedding),
326
- metadata: {
327
- text: item.text.slice(0, 200),
328
- file: item.file,
329
- worker: this.config.name,
330
- timestamp: Date.now(),
331
- },
332
- });
333
- stored++;
334
- }
335
- catch {
336
- // Skip duplicates/errors
337
- }
338
- }
339
- this.stats.vectorsStored = stored;
340
- return context;
341
- }
342
- /**
343
- * Phase: Similarity Search
344
- */
345
- async phaseSimilaritySearch(context, config) {
346
- if (!this.vectorDb || context.embeddings.length === 0) {
347
- return context;
348
- }
349
- const query = config?.query || context.embeddings[0]?.text;
350
- if (!query)
351
- return context;
352
- const queryResult = await (0, onnx_embedder_1.embed)(query);
353
- const results = await this.vectorDb.search({
354
- vector: new Float32Array(queryResult.embedding),
355
- k: config?.k || 5,
356
- });
357
- return { ...context, searchResults: results };
358
- }
359
- /**
360
- * Phase: Security Scan (uses shared analysis module)
361
- */
362
- async phaseSecurityScan(context, config) {
363
- // Use consolidated security scanner
364
- const findings = (0, security_1.scanFiles)(context.files, undefined, 100);
365
- // Convert to worker findings format
366
- for (const finding of findings) {
367
- this.findings.push({
368
- type: 'security',
369
- message: `${finding.rule}: ${finding.message}`,
370
- file: finding.file,
371
- line: finding.line,
372
- severity: finding.severity === 'critical' ? 4 :
373
- finding.severity === 'high' ? 3 :
374
- finding.severity === 'medium' ? 2 : 1,
375
- });
376
- }
377
- return context;
378
- }
379
- /**
380
- * Phase: Complexity Analysis (uses shared analysis module)
381
- */
382
- async phaseComplexityAnalysis(context, config) {
383
- const complexityThreshold = config?.threshold || 10;
384
- const complexFiles = [];
385
- for (const file of context.files.slice(0, 50)) {
386
- // Use consolidated complexity analyzer
387
- const result = (0, complexity_1.analyzeFile)(file);
388
- if (result.cyclomaticComplexity > complexityThreshold) {
389
- complexFiles.push(result);
390
- const rating = (0, complexity_1.getComplexityRating)(result.cyclomaticComplexity);
391
- this.findings.push({
392
- type: 'warning',
393
- message: `High complexity: ${result.cyclomaticComplexity} (threshold: ${complexityThreshold})`,
394
- file,
395
- severity: rating === 'critical' ? 4 : rating === 'high' ? 3 : 2,
396
- });
397
- }
398
- }
399
- return { ...context, complexFiles };
400
- }
401
- /**
402
- * Phase: Summarization
403
- */
404
- async phaseSummarization(context, config) {
405
- const summary = {
406
- filesAnalyzed: context.files?.length || 0,
407
- patternsFound: context.patterns?.length || 0,
408
- embeddingsGenerated: context.embeddings?.length || 0,
409
- findingsCount: this.findings.length,
410
- findingsByType: {
411
- info: this.findings.filter(f => f.type === 'info').length,
412
- warning: this.findings.filter(f => f.type === 'warning').length,
413
- error: this.findings.filter(f => f.type === 'error').length,
414
- security: this.findings.filter(f => f.type === 'security').length,
415
- },
416
- topFindings: this.findings.slice(0, 10),
417
- };
418
- return { ...context, summary };
419
- }
420
- /**
421
- * Summarize phase data for results
422
- */
423
- summarizePhaseData(type, context) {
424
- switch (type) {
425
- case 'file-discovery':
426
- return { filesFound: context.files?.length || 0 };
427
- case 'pattern-extraction':
428
- return { patternsFound: context.patterns?.length || 0 };
429
- case 'embedding-generation':
430
- return { embeddingsGenerated: context.embeddings?.length || 0 };
431
- case 'vector-storage':
432
- return { vectorsStored: this.stats.vectorsStored };
433
- case 'similarity-search':
434
- return { resultsFound: context.searchResults?.length || 0 };
435
- case 'security-scan':
436
- return { securityFindings: this.findings.filter(f => f.type === 'security').length };
437
- case 'complexity-analysis':
438
- return { complexFiles: context.complexFiles?.length || 0 };
439
- case 'summarization':
440
- return context.summary;
441
- default:
442
- return {};
443
- }
444
- }
445
- }
446
- exports.NativeWorker = NativeWorker;
447
- /**
448
- * Quick worker factory functions
449
- */
450
- function createSecurityWorker(name = 'security-scanner') {
451
- return new NativeWorker({
452
- name,
453
- description: 'Security vulnerability scanner',
454
- phases: [
455
- { type: 'file-discovery', config: { patterns: ['**/*.ts', '**/*.js', '**/*.tsx', '**/*.jsx'] } },
456
- { type: 'security-scan' },
457
- { type: 'summarization' },
458
- ],
459
- capabilities: { onnxEmbeddings: false, vectorDb: false },
460
- });
461
- }
462
- function createAnalysisWorker(name = 'code-analyzer') {
463
- return new NativeWorker({
464
- name,
465
- description: 'Code analysis with embeddings',
466
- phases: [
467
- { type: 'file-discovery' },
468
- { type: 'pattern-extraction' },
469
- { type: 'embedding-generation' },
470
- { type: 'vector-storage' },
471
- { type: 'complexity-analysis' },
472
- { type: 'summarization' },
473
- ],
474
- capabilities: { onnxEmbeddings: true, vectorDb: true },
475
- });
476
- }
477
- function createLearningWorker(name = 'pattern-learner') {
478
- return new NativeWorker({
479
- name,
480
- description: 'Pattern learning with vector storage',
481
- phases: [
482
- { type: 'file-discovery' },
483
- { type: 'pattern-extraction' },
484
- { type: 'embedding-generation' },
485
- { type: 'vector-storage' },
486
- { type: 'summarization' },
487
- ],
488
- capabilities: { onnxEmbeddings: true, vectorDb: true, intelligenceMemory: true },
489
- });
490
- }
@@ -1,69 +0,0 @@
1
- /**
2
- * Native Worker Types for RuVector
3
- *
4
- * Deep integration with ONNX embeddings, VectorDB, and intelligence engine.
5
- */
6
- export interface WorkerConfig {
7
- name: string;
8
- description?: string;
9
- phases: PhaseConfig[];
10
- capabilities?: WorkerCapabilities;
11
- timeout?: number;
12
- parallel?: boolean;
13
- }
14
- export interface PhaseConfig {
15
- type: PhaseType;
16
- config?: Record<string, any>;
17
- }
18
- export type PhaseType = 'file-discovery' | 'pattern-extraction' | 'embedding-generation' | 'vector-storage' | 'similarity-search' | 'security-scan' | 'complexity-analysis' | 'summarization';
19
- export interface WorkerCapabilities {
20
- onnxEmbeddings?: boolean;
21
- vectorDb?: boolean;
22
- intelligenceMemory?: boolean;
23
- parallelProcessing?: boolean;
24
- }
25
- export interface PhaseResult {
26
- phase: PhaseType;
27
- success: boolean;
28
- data: any;
29
- timeMs: number;
30
- error?: string;
31
- }
32
- export interface WorkerResult {
33
- worker: string;
34
- success: boolean;
35
- phases: PhaseResult[];
36
- totalTimeMs: number;
37
- summary?: WorkerSummary;
38
- }
39
- export interface WorkerSummary {
40
- filesAnalyzed: number;
41
- patternsFound: number;
42
- embeddingsGenerated: number;
43
- vectorsStored: number;
44
- findings: Finding[];
45
- }
46
- export interface Finding {
47
- type: 'info' | 'warning' | 'error' | 'security';
48
- message: string;
49
- file?: string;
50
- line?: number;
51
- severity?: number;
52
- }
53
- export interface BenchmarkResult {
54
- name: string;
55
- iterations: number;
56
- results: {
57
- min: number;
58
- max: number;
59
- avg: number;
60
- p50: number;
61
- p95: number;
62
- p99: number;
63
- };
64
- throughput?: {
65
- itemsPerSecond: number;
66
- mbPerSecond?: number;
67
- };
68
- }
69
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/workers/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,oBAAoB,GACpB,sBAAsB,GACtB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,qBAAqB,GACrB,eAAe,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,UAAU,CAAC,EAAE;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * Native Worker Types for RuVector
4
- *
5
- * Deep integration with ONNX embeddings, VectorDB, and intelligence engine.
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });