@ruvector/edge-full 0.1.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/LICENSE +21 -0
- package/README.md +390 -0
- package/dag/ruvector_dag_wasm.d.ts +105 -0
- package/dag/ruvector_dag_wasm.js +466 -0
- package/dag/ruvector_dag_wasm_bg.wasm +0 -0
- package/dag/ruvector_dag_wasm_bg.wasm.d.ts +20 -0
- package/edge/ruvector_edge.d.ts +351 -0
- package/edge/ruvector_edge.js +1452 -0
- package/edge/ruvector_edge_bg.wasm +0 -0
- package/edge/ruvector_edge_bg.wasm.d.ts +71 -0
- package/generator.html +2009 -0
- package/graph/ruvector_graph_wasm.d.ts +380 -0
- package/graph/ruvector_graph_wasm.js +1787 -0
- package/graph/ruvector_graph_wasm_bg.wasm +0 -0
- package/graph/ruvector_graph_wasm_bg.wasm.d.ts +80 -0
- package/index.d.ts +64 -0
- package/index.js +182 -0
- package/onnx/ruvector_onnx_embeddings_wasm.d.ts +112 -0
- package/onnx/ruvector_onnx_embeddings_wasm.js +635 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.js +629 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.wasm +0 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +29 -0
- package/package.json +86 -0
- package/rvlite/rvlite.d.ts +556 -0
- package/rvlite/rvlite.js +2366 -0
- package/rvlite/rvlite_bg.wasm +0 -0
- package/rvlite/rvlite_bg.wasm.d.ts +128 -0
- package/sona/ruvector_sona.d.ts +513 -0
- package/sona/ruvector_sona.js +1290 -0
- package/sona/ruvector_sona_bg.wasm +0 -0
- package/sona/ruvector_sona_bg.wasm.d.ts +53 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class WasmAdaptiveCompressor {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
/**
|
|
8
|
+
* Update network metrics (bandwidth in Mbps, latency in ms)
|
|
9
|
+
*/
|
|
10
|
+
updateMetrics(bandwidth_mbps: number, latency_ms: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Create new adaptive compressor
|
|
13
|
+
*/
|
|
14
|
+
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Compress vector based on network conditions
|
|
17
|
+
*/
|
|
18
|
+
compress(data: Float32Array): any;
|
|
19
|
+
/**
|
|
20
|
+
* Get current network condition
|
|
21
|
+
*/
|
|
22
|
+
condition(): string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class WasmCrypto {
|
|
26
|
+
private constructor();
|
|
27
|
+
free(): void;
|
|
28
|
+
[Symbol.dispose](): void;
|
|
29
|
+
/**
|
|
30
|
+
* Generate a local CID for data
|
|
31
|
+
*/
|
|
32
|
+
static generateCid(data: Uint8Array): string;
|
|
33
|
+
/**
|
|
34
|
+
* SHA-256 hash of string as hex
|
|
35
|
+
*/
|
|
36
|
+
static sha256String(text: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* SHA-256 hash as hex string
|
|
39
|
+
*/
|
|
40
|
+
static sha256(data: Uint8Array): string;
|
|
41
|
+
/**
|
|
42
|
+
* Decrypt data with AES-256-GCM
|
|
43
|
+
*/
|
|
44
|
+
static decrypt(encrypted: any, key_hex: string): Uint8Array;
|
|
45
|
+
/**
|
|
46
|
+
* Encrypt data with AES-256-GCM (key as hex)
|
|
47
|
+
*/
|
|
48
|
+
static encrypt(data: Uint8Array, key_hex: string): any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class WasmHnswIndex {
|
|
52
|
+
free(): void;
|
|
53
|
+
[Symbol.dispose](): void;
|
|
54
|
+
/**
|
|
55
|
+
* Create with custom parameters (m = connections per node, ef = search width)
|
|
56
|
+
*/
|
|
57
|
+
static withParams(m: number, ef_construction: number): WasmHnswIndex;
|
|
58
|
+
/**
|
|
59
|
+
* Get number of vectors in index
|
|
60
|
+
*/
|
|
61
|
+
len(): number;
|
|
62
|
+
/**
|
|
63
|
+
* Create new HNSW index with default parameters
|
|
64
|
+
*/
|
|
65
|
+
constructor();
|
|
66
|
+
/**
|
|
67
|
+
* Insert a vector with an ID
|
|
68
|
+
*/
|
|
69
|
+
insert(id: string, vector: Float32Array): void;
|
|
70
|
+
/**
|
|
71
|
+
* Search for k nearest neighbors, returns JSON array of {id, distance}
|
|
72
|
+
*/
|
|
73
|
+
search(query: Float32Array, k: number): any;
|
|
74
|
+
/**
|
|
75
|
+
* Check if index is empty
|
|
76
|
+
*/
|
|
77
|
+
isEmpty(): boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export class WasmHybridKeyPair {
|
|
81
|
+
free(): void;
|
|
82
|
+
[Symbol.dispose](): void;
|
|
83
|
+
/**
|
|
84
|
+
* Get public key bytes as hex
|
|
85
|
+
*/
|
|
86
|
+
publicKeyHex(): string;
|
|
87
|
+
/**
|
|
88
|
+
* Generate new hybrid keypair
|
|
89
|
+
*/
|
|
90
|
+
constructor();
|
|
91
|
+
/**
|
|
92
|
+
* Sign message with hybrid signature
|
|
93
|
+
*/
|
|
94
|
+
sign(message: Uint8Array): string;
|
|
95
|
+
/**
|
|
96
|
+
* Verify hybrid signature (pubkey and signature both as JSON)
|
|
97
|
+
*/
|
|
98
|
+
static verify(public_key_json: string, message: Uint8Array, signature_json: string): boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export class WasmIdentity {
|
|
102
|
+
free(): void;
|
|
103
|
+
[Symbol.dispose](): void;
|
|
104
|
+
/**
|
|
105
|
+
* Sign raw bytes and return signature as hex
|
|
106
|
+
*/
|
|
107
|
+
signBytes(data: Uint8Array): string;
|
|
108
|
+
/**
|
|
109
|
+
* Generate a random nonce
|
|
110
|
+
*/
|
|
111
|
+
static generateNonce(): string;
|
|
112
|
+
/**
|
|
113
|
+
* Get Ed25519 public key as hex string
|
|
114
|
+
*/
|
|
115
|
+
publicKeyHex(): string;
|
|
116
|
+
/**
|
|
117
|
+
* Create a signed registration for this identity
|
|
118
|
+
*/
|
|
119
|
+
createRegistration(agent_id: string, capabilities: any): any;
|
|
120
|
+
/**
|
|
121
|
+
* Get X25519 public key as hex string (for key exchange)
|
|
122
|
+
*/
|
|
123
|
+
x25519PublicKeyHex(): string;
|
|
124
|
+
/**
|
|
125
|
+
* Create a new identity with generated keys
|
|
126
|
+
*/
|
|
127
|
+
constructor();
|
|
128
|
+
/**
|
|
129
|
+
* Sign a message and return signature as hex
|
|
130
|
+
*/
|
|
131
|
+
sign(message: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* Verify a signature (static method)
|
|
134
|
+
*/
|
|
135
|
+
static verify(public_key_hex: string, message: string, signature_hex: string): boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class WasmQuantizer {
|
|
139
|
+
private constructor();
|
|
140
|
+
free(): void;
|
|
141
|
+
[Symbol.dispose](): void;
|
|
142
|
+
/**
|
|
143
|
+
* Binary quantize a vector (32x compression)
|
|
144
|
+
*/
|
|
145
|
+
static binaryQuantize(vector: Float32Array): Uint8Array;
|
|
146
|
+
/**
|
|
147
|
+
* Scalar quantize a vector (4x compression)
|
|
148
|
+
*/
|
|
149
|
+
static scalarQuantize(vector: Float32Array): any;
|
|
150
|
+
/**
|
|
151
|
+
* Compute hamming distance between binary quantized vectors
|
|
152
|
+
*/
|
|
153
|
+
static hammingDistance(a: Uint8Array, b: Uint8Array): number;
|
|
154
|
+
/**
|
|
155
|
+
* Reconstruct from scalar quantized
|
|
156
|
+
*/
|
|
157
|
+
static scalarDequantize(quantized: any): Float32Array;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export class WasmRaftNode {
|
|
161
|
+
free(): void;
|
|
162
|
+
[Symbol.dispose](): void;
|
|
163
|
+
/**
|
|
164
|
+
* Append entry to log (leader only), returns log index or null
|
|
165
|
+
*/
|
|
166
|
+
appendEntry(data: Uint8Array): any;
|
|
167
|
+
/**
|
|
168
|
+
* Get log length
|
|
169
|
+
*/
|
|
170
|
+
getLogLength(): number;
|
|
171
|
+
/**
|
|
172
|
+
* Start an election (returns vote request as JSON)
|
|
173
|
+
*/
|
|
174
|
+
startElection(): any;
|
|
175
|
+
/**
|
|
176
|
+
* Get commit index
|
|
177
|
+
*/
|
|
178
|
+
getCommitIndex(): bigint;
|
|
179
|
+
/**
|
|
180
|
+
* Handle a vote request (returns vote response as JSON)
|
|
181
|
+
*/
|
|
182
|
+
handleVoteRequest(request: any): any;
|
|
183
|
+
/**
|
|
184
|
+
* Handle a vote response (returns true if we became leader)
|
|
185
|
+
*/
|
|
186
|
+
handleVoteResponse(response: any): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Create new Raft node with cluster members
|
|
189
|
+
*/
|
|
190
|
+
constructor(node_id: string, members: any);
|
|
191
|
+
/**
|
|
192
|
+
* Get current term
|
|
193
|
+
*/
|
|
194
|
+
term(): bigint;
|
|
195
|
+
/**
|
|
196
|
+
* Get current state (Follower, Candidate, Leader)
|
|
197
|
+
*/
|
|
198
|
+
state(): string;
|
|
199
|
+
/**
|
|
200
|
+
* Check if this node is the leader
|
|
201
|
+
*/
|
|
202
|
+
isLeader(): boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export class WasmSemanticMatcher {
|
|
206
|
+
free(): void;
|
|
207
|
+
[Symbol.dispose](): void;
|
|
208
|
+
/**
|
|
209
|
+
* Get number of registered agents
|
|
210
|
+
*/
|
|
211
|
+
agentCount(): number;
|
|
212
|
+
/**
|
|
213
|
+
* Find best matching agent for a task, returns {agentId, score} or null
|
|
214
|
+
*/
|
|
215
|
+
matchAgent(task_description: string): any;
|
|
216
|
+
/**
|
|
217
|
+
* Register an agent with capability description
|
|
218
|
+
*/
|
|
219
|
+
registerAgent(agent_id: string, capabilities: string): void;
|
|
220
|
+
/**
|
|
221
|
+
* Create new semantic matcher
|
|
222
|
+
*/
|
|
223
|
+
constructor();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export class WasmSpikingNetwork {
|
|
227
|
+
free(): void;
|
|
228
|
+
[Symbol.dispose](): void;
|
|
229
|
+
/**
|
|
230
|
+
* Apply STDP learning rule
|
|
231
|
+
*/
|
|
232
|
+
stdpUpdate(pre: Uint8Array, post: Uint8Array, learning_rate: number): void;
|
|
233
|
+
/**
|
|
234
|
+
* Create new spiking network
|
|
235
|
+
*/
|
|
236
|
+
constructor(input_size: number, hidden_size: number, output_size: number);
|
|
237
|
+
/**
|
|
238
|
+
* Reset network state
|
|
239
|
+
*/
|
|
240
|
+
reset(): void;
|
|
241
|
+
/**
|
|
242
|
+
* Process input spikes and return output spikes
|
|
243
|
+
*/
|
|
244
|
+
forward(inputs: Uint8Array): Uint8Array;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Initialize the WASM module (call once on load)
|
|
249
|
+
*/
|
|
250
|
+
export function init(): void;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get library version
|
|
254
|
+
*/
|
|
255
|
+
export function version(): string;
|
|
256
|
+
|
|
257
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
258
|
+
|
|
259
|
+
export interface InitOutput {
|
|
260
|
+
readonly memory: WebAssembly.Memory;
|
|
261
|
+
readonly __wbg_wasmadaptivecompressor_free: (a: number, b: number) => void;
|
|
262
|
+
readonly __wbg_wasmcrypto_free: (a: number, b: number) => void;
|
|
263
|
+
readonly __wbg_wasmhnswindex_free: (a: number, b: number) => void;
|
|
264
|
+
readonly __wbg_wasmhybridkeypair_free: (a: number, b: number) => void;
|
|
265
|
+
readonly __wbg_wasmidentity_free: (a: number, b: number) => void;
|
|
266
|
+
readonly __wbg_wasmquantizer_free: (a: number, b: number) => void;
|
|
267
|
+
readonly __wbg_wasmraftnode_free: (a: number, b: number) => void;
|
|
268
|
+
readonly __wbg_wasmsemanticmatcher_free: (a: number, b: number) => void;
|
|
269
|
+
readonly __wbg_wasmspikingnetwork_free: (a: number, b: number) => void;
|
|
270
|
+
readonly version: () => [number, number];
|
|
271
|
+
readonly wasmadaptivecompressor_compress: (a: number, b: number, c: number) => any;
|
|
272
|
+
readonly wasmadaptivecompressor_condition: (a: number) => [number, number];
|
|
273
|
+
readonly wasmadaptivecompressor_new: () => number;
|
|
274
|
+
readonly wasmadaptivecompressor_updateMetrics: (a: number, b: number, c: number) => void;
|
|
275
|
+
readonly wasmcrypto_decrypt: (a: any, b: number, c: number) => [number, number, number, number];
|
|
276
|
+
readonly wasmcrypto_encrypt: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
277
|
+
readonly wasmcrypto_generateCid: (a: number, b: number) => [number, number];
|
|
278
|
+
readonly wasmcrypto_sha256: (a: number, b: number) => [number, number];
|
|
279
|
+
readonly wasmhnswindex_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
280
|
+
readonly wasmhnswindex_isEmpty: (a: number) => number;
|
|
281
|
+
readonly wasmhnswindex_len: (a: number) => number;
|
|
282
|
+
readonly wasmhnswindex_new: () => number;
|
|
283
|
+
readonly wasmhnswindex_search: (a: number, b: number, c: number, d: number) => any;
|
|
284
|
+
readonly wasmhnswindex_withParams: (a: number, b: number) => number;
|
|
285
|
+
readonly wasmhybridkeypair_new: () => number;
|
|
286
|
+
readonly wasmhybridkeypair_publicKeyHex: (a: number) => [number, number];
|
|
287
|
+
readonly wasmhybridkeypair_sign: (a: number, b: number, c: number) => [number, number];
|
|
288
|
+
readonly wasmhybridkeypair_verify: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
289
|
+
readonly wasmidentity_createRegistration: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
290
|
+
readonly wasmidentity_generateNonce: () => [number, number];
|
|
291
|
+
readonly wasmidentity_new: () => number;
|
|
292
|
+
readonly wasmidentity_publicKeyHex: (a: number) => [number, number];
|
|
293
|
+
readonly wasmidentity_sign: (a: number, b: number, c: number) => [number, number];
|
|
294
|
+
readonly wasmidentity_verify: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
295
|
+
readonly wasmidentity_x25519PublicKeyHex: (a: number) => [number, number];
|
|
296
|
+
readonly wasmquantizer_binaryQuantize: (a: number, b: number) => [number, number];
|
|
297
|
+
readonly wasmquantizer_hammingDistance: (a: number, b: number, c: number, d: number) => number;
|
|
298
|
+
readonly wasmquantizer_scalarDequantize: (a: any) => [number, number, number, number];
|
|
299
|
+
readonly wasmquantizer_scalarQuantize: (a: number, b: number) => any;
|
|
300
|
+
readonly wasmraftnode_appendEntry: (a: number, b: number, c: number) => any;
|
|
301
|
+
readonly wasmraftnode_getCommitIndex: (a: number) => bigint;
|
|
302
|
+
readonly wasmraftnode_getLogLength: (a: number) => number;
|
|
303
|
+
readonly wasmraftnode_handleVoteRequest: (a: number, b: any) => [number, number, number];
|
|
304
|
+
readonly wasmraftnode_handleVoteResponse: (a: number, b: any) => [number, number, number];
|
|
305
|
+
readonly wasmraftnode_isLeader: (a: number) => number;
|
|
306
|
+
readonly wasmraftnode_new: (a: number, b: number, c: any) => [number, number, number];
|
|
307
|
+
readonly wasmraftnode_startElection: (a: number) => any;
|
|
308
|
+
readonly wasmraftnode_state: (a: number) => [number, number];
|
|
309
|
+
readonly wasmraftnode_term: (a: number) => bigint;
|
|
310
|
+
readonly wasmsemanticmatcher_agentCount: (a: number) => number;
|
|
311
|
+
readonly wasmsemanticmatcher_matchAgent: (a: number, b: number, c: number) => any;
|
|
312
|
+
readonly wasmsemanticmatcher_new: () => number;
|
|
313
|
+
readonly wasmsemanticmatcher_registerAgent: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
314
|
+
readonly wasmspikingnetwork_forward: (a: number, b: number, c: number) => [number, number];
|
|
315
|
+
readonly wasmspikingnetwork_new: (a: number, b: number, c: number) => number;
|
|
316
|
+
readonly wasmspikingnetwork_reset: (a: number) => void;
|
|
317
|
+
readonly wasmspikingnetwork_stdpUpdate: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
318
|
+
readonly init: () => void;
|
|
319
|
+
readonly wasmidentity_signBytes: (a: number, b: number, c: number) => [number, number];
|
|
320
|
+
readonly wasmcrypto_sha256String: (a: number, b: number) => [number, number];
|
|
321
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
322
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
323
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
324
|
+
readonly __externref_table_alloc: () => number;
|
|
325
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
326
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
327
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
328
|
+
readonly __wbindgen_start: () => void;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
335
|
+
* a precompiled `WebAssembly.Module`.
|
|
336
|
+
*
|
|
337
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
338
|
+
*
|
|
339
|
+
* @returns {InitOutput}
|
|
340
|
+
*/
|
|
341
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
345
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
346
|
+
*
|
|
347
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
348
|
+
*
|
|
349
|
+
* @returns {Promise<InitOutput>}
|
|
350
|
+
*/
|
|
351
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|