ruvector 0.1.55 → 0.1.56

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.
@@ -0,0 +1,628 @@
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
4
+ }
5
+
6
+ function addToExternrefTable0(obj) {
7
+ const idx = wasm.__externref_table_alloc();
8
+ wasm.__wbindgen_externrefs.set(idx, obj);
9
+ return idx;
10
+ }
11
+
12
+ function _assertClass(instance, klass) {
13
+ if (!(instance instanceof klass)) {
14
+ throw new Error(`expected instance of ${klass.name}`);
15
+ }
16
+ }
17
+
18
+ function getArrayF32FromWasm0(ptr, len) {
19
+ ptr = ptr >>> 0;
20
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
21
+ }
22
+
23
+ function getArrayU8FromWasm0(ptr, len) {
24
+ ptr = ptr >>> 0;
25
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
26
+ }
27
+
28
+ let cachedDataViewMemory0 = null;
29
+ function getDataViewMemory0() {
30
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
31
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
32
+ }
33
+ return cachedDataViewMemory0;
34
+ }
35
+
36
+ let cachedFloat32ArrayMemory0 = null;
37
+ function getFloat32ArrayMemory0() {
38
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
39
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
40
+ }
41
+ return cachedFloat32ArrayMemory0;
42
+ }
43
+
44
+ function getStringFromWasm0(ptr, len) {
45
+ ptr = ptr >>> 0;
46
+ return decodeText(ptr, len);
47
+ }
48
+
49
+ let cachedUint8ArrayMemory0 = null;
50
+ function getUint8ArrayMemory0() {
51
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
52
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
53
+ }
54
+ return cachedUint8ArrayMemory0;
55
+ }
56
+
57
+ function handleError(f, args) {
58
+ try {
59
+ return f.apply(this, args);
60
+ } catch (e) {
61
+ const idx = addToExternrefTable0(e);
62
+ wasm.__wbindgen_exn_store(idx);
63
+ }
64
+ }
65
+
66
+ function isLikeNone(x) {
67
+ return x === undefined || x === null;
68
+ }
69
+
70
+ function passArray8ToWasm0(arg, malloc) {
71
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
72
+ getUint8ArrayMemory0().set(arg, ptr / 1);
73
+ WASM_VECTOR_LEN = arg.length;
74
+ return ptr;
75
+ }
76
+
77
+ function passArrayF32ToWasm0(arg, malloc) {
78
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
79
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
80
+ WASM_VECTOR_LEN = arg.length;
81
+ return ptr;
82
+ }
83
+
84
+ function passArrayJsValueToWasm0(array, malloc) {
85
+ const ptr = malloc(array.length * 4, 4) >>> 0;
86
+ for (let i = 0; i < array.length; i++) {
87
+ const add = addToExternrefTable0(array[i]);
88
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
89
+ }
90
+ WASM_VECTOR_LEN = array.length;
91
+ return ptr;
92
+ }
93
+
94
+ function passStringToWasm0(arg, malloc, realloc) {
95
+ if (realloc === undefined) {
96
+ const buf = cachedTextEncoder.encode(arg);
97
+ const ptr = malloc(buf.length, 1) >>> 0;
98
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
99
+ WASM_VECTOR_LEN = buf.length;
100
+ return ptr;
101
+ }
102
+
103
+ let len = arg.length;
104
+ let ptr = malloc(len, 1) >>> 0;
105
+
106
+ const mem = getUint8ArrayMemory0();
107
+
108
+ let offset = 0;
109
+
110
+ for (; offset < len; offset++) {
111
+ const code = arg.charCodeAt(offset);
112
+ if (code > 0x7F) break;
113
+ mem[ptr + offset] = code;
114
+ }
115
+ if (offset !== len) {
116
+ if (offset !== 0) {
117
+ arg = arg.slice(offset);
118
+ }
119
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
120
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
121
+ const ret = cachedTextEncoder.encodeInto(arg, view);
122
+
123
+ offset += ret.written;
124
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
125
+ }
126
+
127
+ WASM_VECTOR_LEN = offset;
128
+ return ptr;
129
+ }
130
+
131
+ function takeFromExternrefTable0(idx) {
132
+ const value = wasm.__wbindgen_externrefs.get(idx);
133
+ wasm.__externref_table_dealloc(idx);
134
+ return value;
135
+ }
136
+
137
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
138
+ cachedTextDecoder.decode();
139
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
140
+ let numBytesDecoded = 0;
141
+ function decodeText(ptr, len) {
142
+ numBytesDecoded += len;
143
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
144
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
145
+ cachedTextDecoder.decode();
146
+ numBytesDecoded = len;
147
+ }
148
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
149
+ }
150
+
151
+ const cachedTextEncoder = new TextEncoder();
152
+
153
+ if (!('encodeInto' in cachedTextEncoder)) {
154
+ cachedTextEncoder.encodeInto = function (arg, view) {
155
+ const buf = cachedTextEncoder.encode(arg);
156
+ view.set(buf);
157
+ return {
158
+ read: arg.length,
159
+ written: buf.length
160
+ };
161
+ }
162
+ }
163
+
164
+ let WASM_VECTOR_LEN = 0;
165
+
166
+ const WasmEmbedderFinalization = (typeof FinalizationRegistry === 'undefined')
167
+ ? { register: () => {}, unregister: () => {} }
168
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmembedder_free(ptr >>> 0, 1));
169
+
170
+ const WasmEmbedderConfigFinalization = (typeof FinalizationRegistry === 'undefined')
171
+ ? { register: () => {}, unregister: () => {} }
172
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmembedderconfig_free(ptr >>> 0, 1));
173
+
174
+ /**
175
+ * Strategy for pooling token embeddings into a single sentence embedding
176
+ * @enum {0 | 1 | 2 | 3 | 4}
177
+ */
178
+ export const PoolingStrategy = Object.freeze({
179
+ /**
180
+ * Average all token embeddings (most common)
181
+ */
182
+ Mean: 0, "0": "Mean",
183
+ /**
184
+ * Use only the [CLS] token embedding
185
+ */
186
+ Cls: 1, "1": "Cls",
187
+ /**
188
+ * Take the maximum value across all tokens for each dimension
189
+ */
190
+ Max: 2, "2": "Max",
191
+ /**
192
+ * Mean pooling normalized by sqrt of sequence length
193
+ */
194
+ MeanSqrtLen: 3, "3": "MeanSqrtLen",
195
+ /**
196
+ * Use the last token embedding (for decoder models)
197
+ */
198
+ LastToken: 4, "4": "LastToken",
199
+ });
200
+
201
+ /**
202
+ * WASM-compatible embedder using Tract for inference
203
+ */
204
+ export class WasmEmbedder {
205
+ static __wrap(ptr) {
206
+ ptr = ptr >>> 0;
207
+ const obj = Object.create(WasmEmbedder.prototype);
208
+ obj.__wbg_ptr = ptr;
209
+ WasmEmbedderFinalization.register(obj, obj.__wbg_ptr, obj);
210
+ return obj;
211
+ }
212
+ __destroy_into_raw() {
213
+ const ptr = this.__wbg_ptr;
214
+ this.__wbg_ptr = 0;
215
+ WasmEmbedderFinalization.unregister(this);
216
+ return ptr;
217
+ }
218
+ free() {
219
+ const ptr = this.__destroy_into_raw();
220
+ wasm.__wbg_wasmembedder_free(ptr, 0);
221
+ }
222
+ /**
223
+ * Get maximum sequence length
224
+ * @returns {number}
225
+ */
226
+ maxLength() {
227
+ const ret = wasm.wasmembedder_maxLength(this.__wbg_ptr);
228
+ return ret >>> 0;
229
+ }
230
+ /**
231
+ * Compute similarity between two texts
232
+ * @param {string} text1
233
+ * @param {string} text2
234
+ * @returns {number}
235
+ */
236
+ similarity(text1, text2) {
237
+ const ptr0 = passStringToWasm0(text1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
+ const len0 = WASM_VECTOR_LEN;
239
+ const ptr1 = passStringToWasm0(text2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len1 = WASM_VECTOR_LEN;
241
+ const ret = wasm.wasmembedder_similarity(this.__wbg_ptr, ptr0, len0, ptr1, len1);
242
+ if (ret[2]) {
243
+ throw takeFromExternrefTable0(ret[1]);
244
+ }
245
+ return ret[0];
246
+ }
247
+ /**
248
+ * Generate embeddings for multiple texts
249
+ * @param {string[]} texts
250
+ * @returns {Float32Array}
251
+ */
252
+ embedBatch(texts) {
253
+ const ptr0 = passArrayJsValueToWasm0(texts, wasm.__wbindgen_malloc);
254
+ const len0 = WASM_VECTOR_LEN;
255
+ const ret = wasm.wasmembedder_embedBatch(this.__wbg_ptr, ptr0, len0);
256
+ if (ret[3]) {
257
+ throw takeFromExternrefTable0(ret[2]);
258
+ }
259
+ var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
260
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
261
+ return v2;
262
+ }
263
+ /**
264
+ * Create embedder with custom configuration
265
+ * @param {Uint8Array} model_bytes
266
+ * @param {string} tokenizer_json
267
+ * @param {WasmEmbedderConfig} config
268
+ * @returns {WasmEmbedder}
269
+ */
270
+ static withConfig(model_bytes, tokenizer_json, config) {
271
+ const ptr0 = passArray8ToWasm0(model_bytes, wasm.__wbindgen_malloc);
272
+ const len0 = WASM_VECTOR_LEN;
273
+ const ptr1 = passStringToWasm0(tokenizer_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
274
+ const len1 = WASM_VECTOR_LEN;
275
+ _assertClass(config, WasmEmbedderConfig);
276
+ var ptr2 = config.__destroy_into_raw();
277
+ const ret = wasm.wasmembedder_withConfig(ptr0, len0, ptr1, len1, ptr2);
278
+ if (ret[2]) {
279
+ throw takeFromExternrefTable0(ret[1]);
280
+ }
281
+ return WasmEmbedder.__wrap(ret[0]);
282
+ }
283
+ /**
284
+ * Create a new embedder from model and tokenizer bytes
285
+ *
286
+ * # Arguments
287
+ * * `model_bytes` - ONNX model file bytes
288
+ * * `tokenizer_json` - Tokenizer JSON configuration
289
+ * @param {Uint8Array} model_bytes
290
+ * @param {string} tokenizer_json
291
+ */
292
+ constructor(model_bytes, tokenizer_json) {
293
+ const ptr0 = passArray8ToWasm0(model_bytes, wasm.__wbindgen_malloc);
294
+ const len0 = WASM_VECTOR_LEN;
295
+ const ptr1 = passStringToWasm0(tokenizer_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
296
+ const len1 = WASM_VECTOR_LEN;
297
+ const ret = wasm.wasmembedder_new(ptr0, len0, ptr1, len1);
298
+ if (ret[2]) {
299
+ throw takeFromExternrefTable0(ret[1]);
300
+ }
301
+ this.__wbg_ptr = ret[0] >>> 0;
302
+ WasmEmbedderFinalization.register(this, this.__wbg_ptr, this);
303
+ return this;
304
+ }
305
+ /**
306
+ * Get the embedding dimension
307
+ * @returns {number}
308
+ */
309
+ dimension() {
310
+ const ret = wasm.wasmembedder_dimension(this.__wbg_ptr);
311
+ return ret >>> 0;
312
+ }
313
+ /**
314
+ * Generate embedding for a single text
315
+ * @param {string} text
316
+ * @returns {Float32Array}
317
+ */
318
+ embedOne(text) {
319
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
320
+ const len0 = WASM_VECTOR_LEN;
321
+ const ret = wasm.wasmembedder_embedOne(this.__wbg_ptr, ptr0, len0);
322
+ if (ret[3]) {
323
+ throw takeFromExternrefTable0(ret[2]);
324
+ }
325
+ var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
326
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
327
+ return v2;
328
+ }
329
+ }
330
+ if (Symbol.dispose) WasmEmbedder.prototype[Symbol.dispose] = WasmEmbedder.prototype.free;
331
+
332
+ /**
333
+ * Configuration for the WASM embedder
334
+ */
335
+ export class WasmEmbedderConfig {
336
+ static __wrap(ptr) {
337
+ ptr = ptr >>> 0;
338
+ const obj = Object.create(WasmEmbedderConfig.prototype);
339
+ obj.__wbg_ptr = ptr;
340
+ WasmEmbedderConfigFinalization.register(obj, obj.__wbg_ptr, obj);
341
+ return obj;
342
+ }
343
+ __destroy_into_raw() {
344
+ const ptr = this.__wbg_ptr;
345
+ this.__wbg_ptr = 0;
346
+ WasmEmbedderConfigFinalization.unregister(this);
347
+ return ptr;
348
+ }
349
+ free() {
350
+ const ptr = this.__destroy_into_raw();
351
+ wasm.__wbg_wasmembedderconfig_free(ptr, 0);
352
+ }
353
+ /**
354
+ * Set pooling strategy (0=Mean, 1=Cls, 2=Max, 3=MeanSqrtLen, 4=LastToken)
355
+ * @param {number} pooling
356
+ * @returns {WasmEmbedderConfig}
357
+ */
358
+ setPooling(pooling) {
359
+ const ptr = this.__destroy_into_raw();
360
+ const ret = wasm.wasmembedderconfig_setPooling(ptr, pooling);
361
+ return WasmEmbedderConfig.__wrap(ret);
362
+ }
363
+ /**
364
+ * Set whether to normalize embeddings
365
+ * @param {boolean} normalize
366
+ * @returns {WasmEmbedderConfig}
367
+ */
368
+ setNormalize(normalize) {
369
+ const ptr = this.__destroy_into_raw();
370
+ const ret = wasm.wasmembedderconfig_setNormalize(ptr, normalize);
371
+ return WasmEmbedderConfig.__wrap(ret);
372
+ }
373
+ /**
374
+ * Set maximum sequence length
375
+ * @param {number} max_length
376
+ * @returns {WasmEmbedderConfig}
377
+ */
378
+ setMaxLength(max_length) {
379
+ const ptr = this.__destroy_into_raw();
380
+ const ret = wasm.wasmembedderconfig_setMaxLength(ptr, max_length);
381
+ return WasmEmbedderConfig.__wrap(ret);
382
+ }
383
+ /**
384
+ * Create a new configuration
385
+ */
386
+ constructor() {
387
+ const ret = wasm.wasmembedderconfig_new();
388
+ this.__wbg_ptr = ret >>> 0;
389
+ WasmEmbedderConfigFinalization.register(this, this.__wbg_ptr, this);
390
+ return this;
391
+ }
392
+ }
393
+ if (Symbol.dispose) WasmEmbedderConfig.prototype[Symbol.dispose] = WasmEmbedderConfig.prototype.free;
394
+
395
+ /**
396
+ * Compute cosine similarity between two embedding vectors (JS-friendly)
397
+ * @param {Float32Array} a
398
+ * @param {Float32Array} b
399
+ * @returns {number}
400
+ */
401
+ export function cosineSimilarity(a, b) {
402
+ const ptr0 = passArrayF32ToWasm0(a, wasm.__wbindgen_malloc);
403
+ const len0 = WASM_VECTOR_LEN;
404
+ const ptr1 = passArrayF32ToWasm0(b, wasm.__wbindgen_malloc);
405
+ const len1 = WASM_VECTOR_LEN;
406
+ const ret = wasm.cosineSimilarity(ptr0, len0, ptr1, len1);
407
+ return ret;
408
+ }
409
+
410
+ /**
411
+ * Initialize panic hook for better error messages in WASM
412
+ */
413
+ export function init() {
414
+ wasm.init();
415
+ }
416
+
417
+ /**
418
+ * L2 normalize an embedding vector (JS-friendly)
419
+ * @param {Float32Array} embedding
420
+ * @returns {Float32Array}
421
+ */
422
+ export function normalizeL2(embedding) {
423
+ const ptr0 = passArrayF32ToWasm0(embedding, wasm.__wbindgen_malloc);
424
+ const len0 = WASM_VECTOR_LEN;
425
+ const ret = wasm.normalizeL2(ptr0, len0);
426
+ var v2 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
427
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
428
+ return v2;
429
+ }
430
+
431
+ /**
432
+ * Check if SIMD is available (for performance info)
433
+ * @returns {boolean}
434
+ */
435
+ export function simd_available() {
436
+ const ret = wasm.simd_available();
437
+ return ret !== 0;
438
+ }
439
+
440
+ /**
441
+ * Get the library version
442
+ * @returns {string}
443
+ */
444
+ export function version() {
445
+ let deferred1_0;
446
+ let deferred1_1;
447
+ try {
448
+ const ret = wasm.version();
449
+ deferred1_0 = ret[0];
450
+ deferred1_1 = ret[1];
451
+ return getStringFromWasm0(ret[0], ret[1]);
452
+ } finally {
453
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
454
+ }
455
+ }
456
+
457
+ export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
458
+ const ret = typeof(arg0) === 'function';
459
+ return ret;
460
+ };
461
+
462
+ export function __wbg___wbindgen_is_object_ce774f3490692386(arg0) {
463
+ const val = arg0;
464
+ const ret = typeof(val) === 'object' && val !== null;
465
+ return ret;
466
+ };
467
+
468
+ export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
469
+ const ret = typeof(arg0) === 'string';
470
+ return ret;
471
+ };
472
+
473
+ export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
474
+ const ret = arg0 === undefined;
475
+ return ret;
476
+ };
477
+
478
+ export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
479
+ const obj = arg1;
480
+ const ret = typeof(obj) === 'string' ? obj : undefined;
481
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
482
+ var len1 = WASM_VECTOR_LEN;
483
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
484
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
485
+ };
486
+
487
+ export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
488
+ throw new Error(getStringFromWasm0(arg0, arg1));
489
+ };
490
+
491
+ export function __wbg_call_3020136f7a2d6e44() { return handleError(function (arg0, arg1, arg2) {
492
+ const ret = arg0.call(arg1, arg2);
493
+ return ret;
494
+ }, arguments) };
495
+
496
+ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
497
+ const ret = arg0.call(arg1);
498
+ return ret;
499
+ }, arguments) };
500
+
501
+ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
502
+ const ret = arg0.crypto;
503
+ return ret;
504
+ };
505
+
506
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
507
+ let deferred0_0;
508
+ let deferred0_1;
509
+ try {
510
+ deferred0_0 = arg0;
511
+ deferred0_1 = arg1;
512
+ console.error(getStringFromWasm0(arg0, arg1));
513
+ } finally {
514
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
515
+ }
516
+ };
517
+
518
+ export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
519
+ arg0.getRandomValues(arg1);
520
+ }, arguments) };
521
+
522
+ export function __wbg_length_22ac23eaec9d8053(arg0) {
523
+ const ret = arg0.length;
524
+ return ret;
525
+ };
526
+
527
+ export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
528
+ const ret = arg0.msCrypto;
529
+ return ret;
530
+ };
531
+
532
+ export function __wbg_new_8a6f238a6ece86ea() {
533
+ const ret = new Error();
534
+ return ret;
535
+ };
536
+
537
+ export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
538
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
539
+ return ret;
540
+ };
541
+
542
+ export function __wbg_new_with_length_aa5eaf41d35235e5(arg0) {
543
+ const ret = new Uint8Array(arg0 >>> 0);
544
+ return ret;
545
+ };
546
+
547
+ export function __wbg_node_905d3e251edff8a2(arg0) {
548
+ const ret = arg0.node;
549
+ return ret;
550
+ };
551
+
552
+ export function __wbg_process_dc0fbacc7c1c06f7(arg0) {
553
+ const ret = arg0.process;
554
+ return ret;
555
+ };
556
+
557
+ export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
558
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
559
+ };
560
+
561
+ export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) {
562
+ arg0.randomFillSync(arg1);
563
+ }, arguments) };
564
+
565
+ export function __wbg_require_60cc747a6bc5215a() { return handleError(function () {
566
+ const ret = module.require;
567
+ return ret;
568
+ }, arguments) };
569
+
570
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
571
+ const ret = arg1.stack;
572
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
573
+ const len1 = WASM_VECTOR_LEN;
574
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
575
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
576
+ };
577
+
578
+ export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
579
+ const ret = typeof global === 'undefined' ? null : global;
580
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
581
+ };
582
+
583
+ export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
584
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
585
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
586
+ };
587
+
588
+ export function __wbg_static_accessor_SELF_08f5a74c69739274() {
589
+ const ret = typeof self === 'undefined' ? null : self;
590
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
591
+ };
592
+
593
+ export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
594
+ const ret = typeof window === 'undefined' ? null : window;
595
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
596
+ };
597
+
598
+ export function __wbg_subarray_845f2f5bce7d061a(arg0, arg1, arg2) {
599
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
600
+ return ret;
601
+ };
602
+
603
+ export function __wbg_versions_c01dfd4722a88165(arg0) {
604
+ const ret = arg0.versions;
605
+ return ret;
606
+ };
607
+
608
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
609
+ // Cast intrinsic for `Ref(String) -> Externref`.
610
+ const ret = getStringFromWasm0(arg0, arg1);
611
+ return ret;
612
+ };
613
+
614
+ export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
615
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
616
+ const ret = getArrayU8FromWasm0(arg0, arg1);
617
+ return ret;
618
+ };
619
+
620
+ export function __wbindgen_init_externref_table() {
621
+ const table = wasm.__wbindgen_externrefs;
622
+ const offset = table.grow(4);
623
+ table.set(0, undefined);
624
+ table.set(offset + 0, undefined);
625
+ table.set(offset + 1, null);
626
+ table.set(offset + 2, true);
627
+ table.set(offset + 3, false);
628
+ };
@@ -0,0 +1,29 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_wasmembedder_free: (a: number, b: number) => void;
5
+ export const __wbg_wasmembedderconfig_free: (a: number, b: number) => void;
6
+ export const cosineSimilarity: (a: number, b: number, c: number, d: number) => number;
7
+ export const normalizeL2: (a: number, b: number) => [number, number];
8
+ export const wasmembedder_dimension: (a: number) => number;
9
+ export const wasmembedder_embedBatch: (a: number, b: number, c: number) => [number, number, number, number];
10
+ export const wasmembedder_embedOne: (a: number, b: number, c: number) => [number, number, number, number];
11
+ export const wasmembedder_maxLength: (a: number) => number;
12
+ export const wasmembedder_new: (a: number, b: number, c: number, d: number) => [number, number, number];
13
+ export const wasmembedder_similarity: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
14
+ export const wasmembedder_withConfig: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
15
+ export const wasmembedderconfig_new: () => number;
16
+ export const wasmembedderconfig_setMaxLength: (a: number, b: number) => number;
17
+ export const wasmembedderconfig_setNormalize: (a: number, b: number) => number;
18
+ export const wasmembedderconfig_setPooling: (a: number, b: number) => number;
19
+ export const init: () => void;
20
+ export const simd_available: () => number;
21
+ export const version: () => [number, number];
22
+ export const __wbindgen_malloc: (a: number, b: number) => number;
23
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
24
+ export const __wbindgen_exn_store: (a: number) => void;
25
+ export const __externref_table_alloc: () => number;
26
+ export const __wbindgen_externrefs: WebAssembly.Table;
27
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
28
+ export const __externref_table_dealloc: (a: number) => void;
29
+ export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruvector",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "description": "High-performance vector database for Node.js with automatic native/WASM fallback",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/ruvector.db CHANGED
Binary file