ruvector 0.2.27 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +2270 -2270
- package/bin/cli.js +9570 -9479
- package/bin/mcp-server.js +3854 -3854
- package/dist/core/intelligence-engine.d.ts +13 -0
- package/dist/core/intelligence-engine.d.ts.map +1 -1
- package/dist/core/intelligence-engine.js +38 -0
- package/dist/core/onnx/bundled-parallel.mjs +164 -164
- package/dist/core/onnx/embed-worker.mjs +67 -67
- package/dist/core/onnx/loader.js +434 -434
- package/dist/core/onnx/package.json +3 -3
- package/dist/core/onnx/pkg/LICENSE +21 -21
- package/dist/core/onnx/pkg/loader.js +348 -348
- package/dist/core/onnx/pkg/package.json +3 -3
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.d.ts +112 -112
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm.js +5 -5
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.js +638 -638
- package/dist/core/onnx/pkg/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +29 -29
- package/dist/core/onnx-embedder.d.ts.map +1 -1
- package/dist/core/onnx-embedder.js +24 -30
- package/dist/core/parallel-workers.js +439 -439
- package/dist/workers/benchmark.js +15 -15
- package/package.json +122 -122
- package/src/decompiler/api-prober.js +302 -302
- package/src/decompiler/index.js +463 -463
- package/src/decompiler/metrics.js +86 -86
- package/src/decompiler/model-decompiler.js +423 -423
- package/src/decompiler/module-splitter.js +498 -498
- package/src/decompiler/module-tree.js +142 -142
- package/src/decompiler/name-predictor.js +400 -400
- package/src/decompiler/npm-fetch.js +176 -176
- package/src/decompiler/reconstructor.js +499 -499
- package/src/decompiler/reference-tracker.js +285 -285
- package/src/decompiler/statement-parser.js +285 -285
- package/src/decompiler/style-improver.js +438 -438
- package/src/decompiler/subcategories.js +339 -339
- package/src/decompiler/validator.js +379 -379
- package/src/decompiler/witness.js +140 -140
- package/wasm/package.json +26 -26
- package/wasm/ruvector_decompiler_wasm.d.ts +27 -27
- package/wasm/ruvector_decompiler_wasm.js +220 -220
- package/wasm/ruvector_decompiler_wasm_bg.wasm.d.ts +16 -16
- package/dist/core/onnx/pkg/ruvector.db +0 -0
|
@@ -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();
|