@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,466 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
function addHeapObject(obj) {
|
|
4
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
5
|
+
const idx = heap_next;
|
|
6
|
+
heap_next = heap[idx];
|
|
7
|
+
|
|
8
|
+
heap[idx] = obj;
|
|
9
|
+
return idx;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function dropObject(idx) {
|
|
13
|
+
if (idx < 132) return;
|
|
14
|
+
heap[idx] = heap_next;
|
|
15
|
+
heap_next = idx;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
19
|
+
ptr = ptr >>> 0;
|
|
20
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
24
|
+
ptr = ptr >>> 0;
|
|
25
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
29
|
+
ptr = ptr >>> 0;
|
|
30
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let cachedDataViewMemory0 = null;
|
|
34
|
+
function getDataViewMemory0() {
|
|
35
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
36
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
37
|
+
}
|
|
38
|
+
return cachedDataViewMemory0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
42
|
+
function getFloat32ArrayMemory0() {
|
|
43
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
44
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
45
|
+
}
|
|
46
|
+
return cachedFloat32ArrayMemory0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getStringFromWasm0(ptr, len) {
|
|
50
|
+
ptr = ptr >>> 0;
|
|
51
|
+
return decodeText(ptr, len);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let cachedUint32ArrayMemory0 = null;
|
|
55
|
+
function getUint32ArrayMemory0() {
|
|
56
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
57
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
58
|
+
}
|
|
59
|
+
return cachedUint32ArrayMemory0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let cachedUint8ArrayMemory0 = null;
|
|
63
|
+
function getUint8ArrayMemory0() {
|
|
64
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
65
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
66
|
+
}
|
|
67
|
+
return cachedUint8ArrayMemory0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getObject(idx) { return heap[idx]; }
|
|
71
|
+
|
|
72
|
+
let heap = new Array(128).fill(undefined);
|
|
73
|
+
heap.push(undefined, null, true, false);
|
|
74
|
+
|
|
75
|
+
let heap_next = heap.length;
|
|
76
|
+
|
|
77
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
78
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
79
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
80
|
+
WASM_VECTOR_LEN = arg.length;
|
|
81
|
+
return ptr;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
85
|
+
if (realloc === undefined) {
|
|
86
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
87
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
88
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
89
|
+
WASM_VECTOR_LEN = buf.length;
|
|
90
|
+
return ptr;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
let len = arg.length;
|
|
94
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
95
|
+
|
|
96
|
+
const mem = getUint8ArrayMemory0();
|
|
97
|
+
|
|
98
|
+
let offset = 0;
|
|
99
|
+
|
|
100
|
+
for (; offset < len; offset++) {
|
|
101
|
+
const code = arg.charCodeAt(offset);
|
|
102
|
+
if (code > 0x7F) break;
|
|
103
|
+
mem[ptr + offset] = code;
|
|
104
|
+
}
|
|
105
|
+
if (offset !== len) {
|
|
106
|
+
if (offset !== 0) {
|
|
107
|
+
arg = arg.slice(offset);
|
|
108
|
+
}
|
|
109
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
110
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
111
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
112
|
+
|
|
113
|
+
offset += ret.written;
|
|
114
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
WASM_VECTOR_LEN = offset;
|
|
118
|
+
return ptr;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function takeObject(idx) {
|
|
122
|
+
const ret = getObject(idx);
|
|
123
|
+
dropObject(idx);
|
|
124
|
+
return ret;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
128
|
+
cachedTextDecoder.decode();
|
|
129
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
130
|
+
let numBytesDecoded = 0;
|
|
131
|
+
function decodeText(ptr, len) {
|
|
132
|
+
numBytesDecoded += len;
|
|
133
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
134
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
135
|
+
cachedTextDecoder.decode();
|
|
136
|
+
numBytesDecoded = len;
|
|
137
|
+
}
|
|
138
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const cachedTextEncoder = new TextEncoder();
|
|
142
|
+
|
|
143
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
144
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
145
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
146
|
+
view.set(buf);
|
|
147
|
+
return {
|
|
148
|
+
read: arg.length,
|
|
149
|
+
written: buf.length
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let WASM_VECTOR_LEN = 0;
|
|
155
|
+
|
|
156
|
+
const WasmDagFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
157
|
+
? { register: () => {}, unregister: () => {} }
|
|
158
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdag_free(ptr >>> 0, 1));
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Minimal DAG structure for WASM
|
|
162
|
+
* Self-contained with no external dependencies beyond wasm-bindgen
|
|
163
|
+
*/
|
|
164
|
+
export class WasmDag {
|
|
165
|
+
static __wrap(ptr) {
|
|
166
|
+
ptr = ptr >>> 0;
|
|
167
|
+
const obj = Object.create(WasmDag.prototype);
|
|
168
|
+
obj.__wbg_ptr = ptr;
|
|
169
|
+
WasmDagFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
170
|
+
return obj;
|
|
171
|
+
}
|
|
172
|
+
__destroy_into_raw() {
|
|
173
|
+
const ptr = this.__wbg_ptr;
|
|
174
|
+
this.__wbg_ptr = 0;
|
|
175
|
+
WasmDagFinalization.unregister(this);
|
|
176
|
+
return ptr;
|
|
177
|
+
}
|
|
178
|
+
free() {
|
|
179
|
+
const ptr = this.__destroy_into_raw();
|
|
180
|
+
wasm.__wbg_wasmdag_free(ptr, 0);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get number of edges
|
|
184
|
+
* @returns {number}
|
|
185
|
+
*/
|
|
186
|
+
edge_count() {
|
|
187
|
+
const ret = wasm.wasmdag_edge_count(this.__wbg_ptr);
|
|
188
|
+
return ret >>> 0;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Deserialize from bytes
|
|
192
|
+
* @param {Uint8Array} data
|
|
193
|
+
* @returns {WasmDag}
|
|
194
|
+
*/
|
|
195
|
+
static from_bytes(data) {
|
|
196
|
+
try {
|
|
197
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
198
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
|
|
199
|
+
const len0 = WASM_VECTOR_LEN;
|
|
200
|
+
wasm.wasmdag_from_bytes(retptr, ptr0, len0);
|
|
201
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
202
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
203
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
204
|
+
if (r2) {
|
|
205
|
+
throw takeObject(r1);
|
|
206
|
+
}
|
|
207
|
+
return WasmDag.__wrap(r0);
|
|
208
|
+
} finally {
|
|
209
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get number of nodes
|
|
214
|
+
* @returns {number}
|
|
215
|
+
*/
|
|
216
|
+
node_count() {
|
|
217
|
+
const ret = wasm.wasmdag_node_count(this.__wbg_ptr);
|
|
218
|
+
return ret >>> 0;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Find critical path (longest path by cost)
|
|
222
|
+
* Returns JSON: {"path": [node_ids], "cost": total}
|
|
223
|
+
* @returns {any}
|
|
224
|
+
*/
|
|
225
|
+
critical_path() {
|
|
226
|
+
const ret = wasm.wasmdag_critical_path(this.__wbg_ptr);
|
|
227
|
+
return takeObject(ret);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Create new empty DAG
|
|
231
|
+
*/
|
|
232
|
+
constructor() {
|
|
233
|
+
const ret = wasm.wasmdag_new();
|
|
234
|
+
this.__wbg_ptr = ret >>> 0;
|
|
235
|
+
WasmDagFinalization.register(this, this.__wbg_ptr, this);
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Serialize to JSON
|
|
240
|
+
* @returns {string}
|
|
241
|
+
*/
|
|
242
|
+
to_json() {
|
|
243
|
+
let deferred1_0;
|
|
244
|
+
let deferred1_1;
|
|
245
|
+
try {
|
|
246
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
247
|
+
wasm.wasmdag_to_json(retptr, this.__wbg_ptr);
|
|
248
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
249
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
250
|
+
deferred1_0 = r0;
|
|
251
|
+
deferred1_1 = r1;
|
|
252
|
+
return getStringFromWasm0(r0, r1);
|
|
253
|
+
} finally {
|
|
254
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
255
|
+
wasm.__wbindgen_export2(deferred1_0, deferred1_1, 1);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Add edge from -> to
|
|
260
|
+
* Returns false if creates cycle (simple check)
|
|
261
|
+
* @param {number} from
|
|
262
|
+
* @param {number} to
|
|
263
|
+
* @returns {boolean}
|
|
264
|
+
*/
|
|
265
|
+
add_edge(from, to) {
|
|
266
|
+
const ret = wasm.wasmdag_add_edge(this.__wbg_ptr, from, to);
|
|
267
|
+
return ret !== 0;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Add a node with operator type and cost
|
|
271
|
+
* Returns node ID
|
|
272
|
+
* @param {number} op
|
|
273
|
+
* @param {number} cost
|
|
274
|
+
* @returns {number}
|
|
275
|
+
*/
|
|
276
|
+
add_node(op, cost) {
|
|
277
|
+
const ret = wasm.wasmdag_add_node(this.__wbg_ptr, op, cost);
|
|
278
|
+
return ret >>> 0;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Serialize to bytes (bincode format)
|
|
282
|
+
* @returns {Uint8Array}
|
|
283
|
+
*/
|
|
284
|
+
to_bytes() {
|
|
285
|
+
try {
|
|
286
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
|
+
wasm.wasmdag_to_bytes(retptr, this.__wbg_ptr);
|
|
288
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
289
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
290
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
291
|
+
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
292
|
+
return v1;
|
|
293
|
+
} finally {
|
|
294
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Compute attention scores for nodes
|
|
299
|
+
* mechanism: 0=topological, 1=critical_path, 2=uniform
|
|
300
|
+
* @param {number} mechanism
|
|
301
|
+
* @returns {Float32Array}
|
|
302
|
+
*/
|
|
303
|
+
attention(mechanism) {
|
|
304
|
+
try {
|
|
305
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
306
|
+
wasm.wasmdag_attention(retptr, this.__wbg_ptr, mechanism);
|
|
307
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
308
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
309
|
+
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
310
|
+
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
311
|
+
return v1;
|
|
312
|
+
} finally {
|
|
313
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Deserialize from JSON
|
|
318
|
+
* @param {string} json
|
|
319
|
+
* @returns {WasmDag}
|
|
320
|
+
*/
|
|
321
|
+
static from_json(json) {
|
|
322
|
+
try {
|
|
323
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
324
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_export, wasm.__wbindgen_export3);
|
|
325
|
+
const len0 = WASM_VECTOR_LEN;
|
|
326
|
+
wasm.wasmdag_from_json(retptr, ptr0, len0);
|
|
327
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
328
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
329
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
330
|
+
if (r2) {
|
|
331
|
+
throw takeObject(r1);
|
|
332
|
+
}
|
|
333
|
+
return WasmDag.__wrap(r0);
|
|
334
|
+
} finally {
|
|
335
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Topological sort using Kahn's algorithm
|
|
340
|
+
* Returns node IDs in topological order
|
|
341
|
+
* @returns {Uint32Array}
|
|
342
|
+
*/
|
|
343
|
+
topo_sort() {
|
|
344
|
+
try {
|
|
345
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
346
|
+
wasm.wasmdag_topo_sort(retptr, this.__wbg_ptr);
|
|
347
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
348
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
349
|
+
var v1 = getArrayU32FromWasm0(r0, r1).slice();
|
|
350
|
+
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
351
|
+
return v1;
|
|
352
|
+
} finally {
|
|
353
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (Symbol.dispose) WasmDag.prototype[Symbol.dispose] = WasmDag.prototype.free;
|
|
358
|
+
|
|
359
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
360
|
+
|
|
361
|
+
async function __wbg_load(module, imports) {
|
|
362
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
363
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
364
|
+
try {
|
|
365
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
366
|
+
} catch (e) {
|
|
367
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
368
|
+
|
|
369
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
370
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
371
|
+
|
|
372
|
+
} else {
|
|
373
|
+
throw e;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const bytes = await module.arrayBuffer();
|
|
379
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
380
|
+
} else {
|
|
381
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
382
|
+
|
|
383
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
384
|
+
return { instance, module };
|
|
385
|
+
} else {
|
|
386
|
+
return instance;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function __wbg_get_imports() {
|
|
392
|
+
const imports = {};
|
|
393
|
+
imports.wbg = {};
|
|
394
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
395
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
396
|
+
};
|
|
397
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
398
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
399
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
400
|
+
return addHeapObject(ret);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
return imports;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function __wbg_finalize_init(instance, module) {
|
|
407
|
+
wasm = instance.exports;
|
|
408
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
409
|
+
cachedDataViewMemory0 = null;
|
|
410
|
+
cachedFloat32ArrayMemory0 = null;
|
|
411
|
+
cachedUint32ArrayMemory0 = null;
|
|
412
|
+
cachedUint8ArrayMemory0 = null;
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
return wasm;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function initSync(module) {
|
|
420
|
+
if (wasm !== undefined) return wasm;
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
if (typeof module !== 'undefined') {
|
|
424
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
425
|
+
({module} = module)
|
|
426
|
+
} else {
|
|
427
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const imports = __wbg_get_imports();
|
|
432
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
433
|
+
module = new WebAssembly.Module(module);
|
|
434
|
+
}
|
|
435
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
436
|
+
return __wbg_finalize_init(instance, module);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
async function __wbg_init(module_or_path) {
|
|
440
|
+
if (wasm !== undefined) return wasm;
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
if (typeof module_or_path !== 'undefined') {
|
|
444
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
445
|
+
({module_or_path} = module_or_path)
|
|
446
|
+
} else {
|
|
447
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (typeof module_or_path === 'undefined') {
|
|
452
|
+
module_or_path = new URL('ruvector_dag_wasm_bg.wasm', import.meta.url);
|
|
453
|
+
}
|
|
454
|
+
const imports = __wbg_get_imports();
|
|
455
|
+
|
|
456
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
457
|
+
module_or_path = fetch(module_or_path);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
461
|
+
|
|
462
|
+
return __wbg_finalize_init(instance, module);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export { initSync };
|
|
466
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_wasmdag_free: (a: number, b: number) => void;
|
|
5
|
+
export const wasmdag_add_edge: (a: number, b: number, c: number) => number;
|
|
6
|
+
export const wasmdag_add_node: (a: number, b: number, c: number) => number;
|
|
7
|
+
export const wasmdag_attention: (a: number, b: number, c: number) => void;
|
|
8
|
+
export const wasmdag_critical_path: (a: number) => number;
|
|
9
|
+
export const wasmdag_edge_count: (a: number) => number;
|
|
10
|
+
export const wasmdag_from_bytes: (a: number, b: number, c: number) => void;
|
|
11
|
+
export const wasmdag_from_json: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const wasmdag_new: () => number;
|
|
13
|
+
export const wasmdag_node_count: (a: number) => number;
|
|
14
|
+
export const wasmdag_to_bytes: (a: number, b: number) => void;
|
|
15
|
+
export const wasmdag_to_json: (a: number, b: number) => void;
|
|
16
|
+
export const wasmdag_topo_sort: (a: number, b: number) => void;
|
|
17
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
18
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
19
|
+
export const __wbindgen_export2: (a: number, b: number, c: number) => void;
|
|
20
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|