ruvector 0.2.32 → 0.2.34

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 (42) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2303 -2302
  3. package/bin/cli.js +10257 -10237
  4. package/bin/mcp-policy.js +95 -95
  5. package/bin/mcp-server.js +4066 -4054
  6. package/dist/core/onnx/bundled-parallel.mjs +169 -169
  7. package/dist/core/onnx/embed-worker.mjs +67 -67
  8. package/dist/core/onnx/loader.js +485 -461
  9. package/dist/core/onnx/package.json +3 -3
  10. package/dist/core/onnx/pkg/LICENSE +21 -21
  11. package/dist/core/onnx/pkg/loader.js +348 -348
  12. package/dist/core/onnx/pkg/package.json +3 -3
  13. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.d.ts +112 -112
  14. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.js +5 -5
  15. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.js +638 -638
  16. package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +29 -29
  17. package/dist/core/parallel-workers.js +439 -439
  18. package/dist/workers/benchmark.js +15 -15
  19. package/package.json +124 -123
  20. package/src/decompiler/api-prober.js +302 -302
  21. package/src/decompiler/index.js +463 -463
  22. package/src/decompiler/metrics.js +86 -86
  23. package/src/decompiler/model-decompiler.js +423 -423
  24. package/src/decompiler/module-splitter.js +498 -498
  25. package/src/decompiler/module-tree.js +142 -142
  26. package/src/decompiler/name-predictor.js +400 -400
  27. package/src/decompiler/npm-fetch.js +176 -176
  28. package/src/decompiler/reconstructor.js +499 -499
  29. package/src/decompiler/reference-tracker.js +285 -285
  30. package/src/decompiler/statement-parser.js +285 -285
  31. package/src/decompiler/style-improver.js +438 -438
  32. package/src/decompiler/subcategories.js +339 -339
  33. package/src/decompiler/validator.js +379 -379
  34. package/src/decompiler/witness.js +140 -140
  35. package/src/optimizer/context.js +149 -0
  36. package/src/optimizer/index.js +177 -0
  37. package/src/optimizer/settings-generator.js +176 -0
  38. package/src/optimizer/tool-schemas.js +190 -0
  39. package/wasm/package.json +26 -26
  40. package/wasm/ruvector_decompiler_wasm.d.ts +27 -27
  41. package/wasm/ruvector_decompiler_wasm.js +220 -220
  42. package/wasm/ruvector_decompiler_wasm_bg.wasm.d.ts +16 -16
@@ -1,3 +1,3 @@
1
- {
2
- "type": "module"
3
- }
1
+ {
2
+ "type": "module"
3
+ }
@@ -1,112 +1,112 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
-
4
- /**
5
- * Strategy for pooling token embeddings into a single sentence embedding
6
- */
7
- export enum PoolingStrategy {
8
- /**
9
- * Average all token embeddings (most common)
10
- */
11
- Mean = 0,
12
- /**
13
- * Use only the [CLS] token embedding
14
- */
15
- Cls = 1,
16
- /**
17
- * Take the maximum value across all tokens for each dimension
18
- */
19
- Max = 2,
20
- /**
21
- * Mean pooling normalized by sqrt of sequence length
22
- */
23
- MeanSqrtLen = 3,
24
- /**
25
- * Use the last token embedding (for decoder models)
26
- */
27
- LastToken = 4,
28
- }
29
-
30
- export class WasmEmbedder {
31
- free(): void;
32
- [Symbol.dispose](): void;
33
- /**
34
- * Get maximum sequence length
35
- */
36
- maxLength(): number;
37
- /**
38
- * Compute similarity between two texts
39
- */
40
- similarity(text1: string, text2: string): number;
41
- /**
42
- * Generate embeddings for multiple texts
43
- */
44
- embedBatch(texts: string[]): Float32Array;
45
- /**
46
- * Create embedder with custom configuration
47
- */
48
- static withConfig(model_bytes: Uint8Array, tokenizer_json: string, config: WasmEmbedderConfig): WasmEmbedder;
49
- /**
50
- * Create a new embedder from model and tokenizer bytes
51
- *
52
- * # Arguments
53
- * * `model_bytes` - ONNX model file bytes
54
- * * `tokenizer_json` - Tokenizer JSON configuration
55
- */
56
- constructor(model_bytes: Uint8Array, tokenizer_json: string);
57
- /**
58
- * Get the embedding dimension
59
- */
60
- dimension(): number;
61
- /**
62
- * Generate embedding for a single text
63
- */
64
- embedOne(text: string): Float32Array;
65
- }
66
-
67
- export class WasmEmbedderConfig {
68
- free(): void;
69
- [Symbol.dispose](): void;
70
- /**
71
- * Set pooling strategy (0=Mean, 1=Cls, 2=Max, 3=MeanSqrtLen, 4=LastToken)
72
- */
73
- setPooling(pooling: number): WasmEmbedderConfig;
74
- /**
75
- * Set whether to normalize embeddings
76
- */
77
- setNormalize(normalize: boolean): WasmEmbedderConfig;
78
- /**
79
- * Set maximum sequence length
80
- */
81
- setMaxLength(max_length: number): WasmEmbedderConfig;
82
- /**
83
- * Create a new configuration
84
- */
85
- constructor();
86
- }
87
-
88
- /**
89
- * Compute cosine similarity between two embedding vectors (JS-friendly)
90
- */
91
- export function cosineSimilarity(a: Float32Array, b: Float32Array): number;
92
-
93
- /**
94
- * Initialize panic hook for better error messages in WASM
95
- */
96
- export function init(): void;
97
-
98
- /**
99
- * L2 normalize an embedding vector (JS-friendly)
100
- */
101
- export function normalizeL2(embedding: Float32Array): Float32Array;
102
-
103
- /**
104
- * Check if SIMD is available (for performance info)
105
- * Returns true if compiled with WASM SIMD128 support
106
- */
107
- export function simd_available(): boolean;
108
-
109
- /**
110
- * Get the library version
111
- */
112
- export function version(): string;
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ /**
5
+ * Strategy for pooling token embeddings into a single sentence embedding
6
+ */
7
+ export enum PoolingStrategy {
8
+ /**
9
+ * Average all token embeddings (most common)
10
+ */
11
+ Mean = 0,
12
+ /**
13
+ * Use only the [CLS] token embedding
14
+ */
15
+ Cls = 1,
16
+ /**
17
+ * Take the maximum value across all tokens for each dimension
18
+ */
19
+ Max = 2,
20
+ /**
21
+ * Mean pooling normalized by sqrt of sequence length
22
+ */
23
+ MeanSqrtLen = 3,
24
+ /**
25
+ * Use the last token embedding (for decoder models)
26
+ */
27
+ LastToken = 4,
28
+ }
29
+
30
+ export class WasmEmbedder {
31
+ free(): void;
32
+ [Symbol.dispose](): void;
33
+ /**
34
+ * Get maximum sequence length
35
+ */
36
+ maxLength(): number;
37
+ /**
38
+ * Compute similarity between two texts
39
+ */
40
+ similarity(text1: string, text2: string): number;
41
+ /**
42
+ * Generate embeddings for multiple texts
43
+ */
44
+ embedBatch(texts: string[]): Float32Array;
45
+ /**
46
+ * Create embedder with custom configuration
47
+ */
48
+ static withConfig(model_bytes: Uint8Array, tokenizer_json: string, config: WasmEmbedderConfig): WasmEmbedder;
49
+ /**
50
+ * Create a new embedder from model and tokenizer bytes
51
+ *
52
+ * # Arguments
53
+ * * `model_bytes` - ONNX model file bytes
54
+ * * `tokenizer_json` - Tokenizer JSON configuration
55
+ */
56
+ constructor(model_bytes: Uint8Array, tokenizer_json: string);
57
+ /**
58
+ * Get the embedding dimension
59
+ */
60
+ dimension(): number;
61
+ /**
62
+ * Generate embedding for a single text
63
+ */
64
+ embedOne(text: string): Float32Array;
65
+ }
66
+
67
+ export class WasmEmbedderConfig {
68
+ free(): void;
69
+ [Symbol.dispose](): void;
70
+ /**
71
+ * Set pooling strategy (0=Mean, 1=Cls, 2=Max, 3=MeanSqrtLen, 4=LastToken)
72
+ */
73
+ setPooling(pooling: number): WasmEmbedderConfig;
74
+ /**
75
+ * Set whether to normalize embeddings
76
+ */
77
+ setNormalize(normalize: boolean): WasmEmbedderConfig;
78
+ /**
79
+ * Set maximum sequence length
80
+ */
81
+ setMaxLength(max_length: number): WasmEmbedderConfig;
82
+ /**
83
+ * Create a new configuration
84
+ */
85
+ constructor();
86
+ }
87
+
88
+ /**
89
+ * Compute cosine similarity between two embedding vectors (JS-friendly)
90
+ */
91
+ export function cosineSimilarity(a: Float32Array, b: Float32Array): number;
92
+
93
+ /**
94
+ * Initialize panic hook for better error messages in WASM
95
+ */
96
+ export function init(): void;
97
+
98
+ /**
99
+ * L2 normalize an embedding vector (JS-friendly)
100
+ */
101
+ export function normalizeL2(embedding: Float32Array): Float32Array;
102
+
103
+ /**
104
+ * Check if SIMD is available (for performance info)
105
+ * Returns true if compiled with WASM SIMD128 support
106
+ */
107
+ export function simd_available(): boolean;
108
+
109
+ /**
110
+ * Get the library version
111
+ */
112
+ export function version(): string;
@@ -1,5 +1,5 @@
1
- import * as wasm from "./ruvector_onnx_embeddings_wasm_bg.wasm";
2
- export * from "./ruvector_onnx_embeddings_wasm_bg.js";
3
- import { __wbg_set_wasm } from "./ruvector_onnx_embeddings_wasm_bg.js";
4
- __wbg_set_wasm(wasm);
5
- wasm.__wbindgen_start();
1
+ import * as wasm from "./ruvector_onnx_embeddings_wasm_bg.wasm";
2
+ export * from "./ruvector_onnx_embeddings_wasm_bg.js";
3
+ import { __wbg_set_wasm } from "./ruvector_onnx_embeddings_wasm_bg.js";
4
+ __wbg_set_wasm(wasm);
5
+ wasm.__wbindgen_start();