@wiscale/velesdb-wasm 1.3.0 → 1.4.1
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/README.md +76 -0
- package/package.json +1 -1
- package/velesdb_wasm.d.ts +388 -5
- package/velesdb_wasm.js +1007 -61
- package/velesdb_wasm_bg.wasm +0 -0
package/velesdb_wasm.js
CHANGED
|
@@ -280,16 +280,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
280
280
|
|
|
281
281
|
let WASM_VECTOR_LEN = 0;
|
|
282
282
|
|
|
283
|
-
function
|
|
284
|
-
wasm.
|
|
283
|
+
function __wasm_bindgen_func_elem_265(arg0, arg1, arg2) {
|
|
284
|
+
wasm.__wasm_bindgen_func_elem_265(arg0, arg1, addHeapObject(arg2));
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
function
|
|
288
|
-
wasm.
|
|
287
|
+
function __wasm_bindgen_func_elem_1176(arg0, arg1, arg2) {
|
|
288
|
+
wasm.__wasm_bindgen_func_elem_1176(arg0, arg1, addHeapObject(arg2));
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
function
|
|
292
|
-
wasm.
|
|
291
|
+
function __wasm_bindgen_func_elem_1217(arg0, arg1, arg2, arg3) {
|
|
292
|
+
wasm.__wasm_bindgen_func_elem_1217(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
@@ -302,14 +302,38 @@ const GraphNodeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
302
302
|
? { register: () => {}, unregister: () => {} }
|
|
303
303
|
: new FinalizationRegistry(ptr => wasm.__wbg_graphnode_free(ptr >>> 0, 1));
|
|
304
304
|
|
|
305
|
+
const GraphPersistenceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
306
|
+
? { register: () => {}, unregister: () => {} }
|
|
307
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_graphpersistence_free(ptr >>> 0, 1));
|
|
308
|
+
|
|
305
309
|
const GraphStoreFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
306
310
|
? { register: () => {}, unregister: () => {} }
|
|
307
311
|
: new FinalizationRegistry(ptr => wasm.__wbg_graphstore_free(ptr >>> 0, 1));
|
|
308
312
|
|
|
313
|
+
const GraphWorkerConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
314
|
+
? { register: () => {}, unregister: () => {} }
|
|
315
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_graphworkerconfig_free(ptr >>> 0, 1));
|
|
316
|
+
|
|
317
|
+
const ParsedQueryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
318
|
+
? { register: () => {}, unregister: () => {} }
|
|
319
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedquery_free(ptr >>> 0, 1));
|
|
320
|
+
|
|
321
|
+
const SemanticMemoryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
322
|
+
? { register: () => {}, unregister: () => {} }
|
|
323
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_semanticmemory_free(ptr >>> 0, 1));
|
|
324
|
+
|
|
325
|
+
const TraversalProgressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
326
|
+
? { register: () => {}, unregister: () => {} }
|
|
327
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_traversalprogress_free(ptr >>> 0, 1));
|
|
328
|
+
|
|
309
329
|
const VectorStoreFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
310
330
|
? { register: () => {}, unregister: () => {} }
|
|
311
331
|
: new FinalizationRegistry(ptr => wasm.__wbg_vectorstore_free(ptr >>> 0, 1));
|
|
312
332
|
|
|
333
|
+
const VelesQLFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
334
|
+
? { register: () => {}, unregister: () => {} }
|
|
335
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_velesql_free(ptr >>> 0, 1));
|
|
336
|
+
|
|
313
337
|
/**
|
|
314
338
|
* A graph edge representing a relationship between nodes.
|
|
315
339
|
*/
|
|
@@ -590,12 +614,111 @@ export class GraphNode {
|
|
|
590
614
|
}
|
|
591
615
|
if (Symbol.dispose) GraphNode.prototype[Symbol.dispose] = GraphNode.prototype.free;
|
|
592
616
|
|
|
617
|
+
/**
|
|
618
|
+
* `IndexedDB` persistence manager for `GraphStore`.
|
|
619
|
+
*/
|
|
620
|
+
export class GraphPersistence {
|
|
621
|
+
__destroy_into_raw() {
|
|
622
|
+
const ptr = this.__wbg_ptr;
|
|
623
|
+
this.__wbg_ptr = 0;
|
|
624
|
+
GraphPersistenceFinalization.unregister(this);
|
|
625
|
+
return ptr;
|
|
626
|
+
}
|
|
627
|
+
free() {
|
|
628
|
+
const ptr = this.__destroy_into_raw();
|
|
629
|
+
wasm.__wbg_graphpersistence_free(ptr, 0);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Lists all saved graph names.
|
|
633
|
+
* @returns {Promise<Array<any>>}
|
|
634
|
+
*/
|
|
635
|
+
list_graphs() {
|
|
636
|
+
const ret = wasm.graphpersistence_list_graphs(this.__wbg_ptr);
|
|
637
|
+
return takeObject(ret);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Deletes a saved graph by name.
|
|
641
|
+
*
|
|
642
|
+
* BUG-7 FIX: Also deletes all nodes and edges with the graph prefix.
|
|
643
|
+
* @param {string} graph_name
|
|
644
|
+
* @returns {Promise<void>}
|
|
645
|
+
*/
|
|
646
|
+
delete_graph(graph_name) {
|
|
647
|
+
const ptr0 = passStringToWasm0(graph_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
648
|
+
const len0 = WASM_VECTOR_LEN;
|
|
649
|
+
const ret = wasm.graphpersistence_delete_graph(this.__wbg_ptr, ptr0, len0);
|
|
650
|
+
return takeObject(ret);
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Gets metadata for a saved graph.
|
|
654
|
+
* @param {string} graph_name
|
|
655
|
+
* @returns {Promise<any>}
|
|
656
|
+
*/
|
|
657
|
+
get_metadata(graph_name) {
|
|
658
|
+
const ptr0 = passStringToWasm0(graph_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
659
|
+
const len0 = WASM_VECTOR_LEN;
|
|
660
|
+
const ret = wasm.graphpersistence_get_metadata(this.__wbg_ptr, ptr0, len0);
|
|
661
|
+
return takeObject(ret);
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Creates a new `GraphPersistence` instance (call `init()` to open database).
|
|
665
|
+
*/
|
|
666
|
+
constructor() {
|
|
667
|
+
const ret = wasm.graphpersistence_new();
|
|
668
|
+
this.__wbg_ptr = ret >>> 0;
|
|
669
|
+
GraphPersistenceFinalization.register(this, this.__wbg_ptr, this);
|
|
670
|
+
return this;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Initializes the database connection. Must be called before save/load.
|
|
674
|
+
* @returns {Promise<void>}
|
|
675
|
+
*/
|
|
676
|
+
init() {
|
|
677
|
+
const ret = wasm.graphpersistence_init(this.__wbg_ptr);
|
|
678
|
+
return takeObject(ret);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Loads a graph from `IndexedDB` by name.
|
|
682
|
+
*
|
|
683
|
+
* BUG-6 FIX: Only loads nodes/edges with keys prefixed by `{graph_name}:`
|
|
684
|
+
* @param {string} graph_name
|
|
685
|
+
* @returns {Promise<GraphStore>}
|
|
686
|
+
*/
|
|
687
|
+
load(graph_name) {
|
|
688
|
+
const ptr0 = passStringToWasm0(graph_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
689
|
+
const len0 = WASM_VECTOR_LEN;
|
|
690
|
+
const ret = wasm.graphpersistence_load(this.__wbg_ptr, ptr0, len0);
|
|
691
|
+
return takeObject(ret);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Saves a graph to `IndexedDB` with the given name.
|
|
695
|
+
* @param {string} graph_name
|
|
696
|
+
* @param {GraphStore} store
|
|
697
|
+
* @returns {Promise<void>}
|
|
698
|
+
*/
|
|
699
|
+
save(graph_name, store) {
|
|
700
|
+
const ptr0 = passStringToWasm0(graph_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
701
|
+
const len0 = WASM_VECTOR_LEN;
|
|
702
|
+
_assertClass(store, GraphStore);
|
|
703
|
+
const ret = wasm.graphpersistence_save(this.__wbg_ptr, ptr0, len0, store.__wbg_ptr);
|
|
704
|
+
return takeObject(ret);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
if (Symbol.dispose) GraphPersistence.prototype[Symbol.dispose] = GraphPersistence.prototype.free;
|
|
708
|
+
|
|
593
709
|
/**
|
|
594
710
|
* In-memory graph store for browser-based knowledge graphs.
|
|
595
711
|
*
|
|
596
712
|
* Stores nodes and edges with bidirectional indexing for efficient traversal.
|
|
597
713
|
*/
|
|
598
714
|
export class GraphStore {
|
|
715
|
+
static __wrap(ptr) {
|
|
716
|
+
ptr = ptr >>> 0;
|
|
717
|
+
const obj = Object.create(GraphStore.prototype);
|
|
718
|
+
obj.__wbg_ptr = ptr;
|
|
719
|
+
GraphStoreFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
720
|
+
return obj;
|
|
721
|
+
}
|
|
599
722
|
__destroy_into_raw() {
|
|
600
723
|
const ptr = this.__wbg_ptr;
|
|
601
724
|
this.__wbg_ptr = 0;
|
|
@@ -884,88 +1007,591 @@ export class GraphStore {
|
|
|
884
1007
|
return this;
|
|
885
1008
|
}
|
|
886
1009
|
/**
|
|
887
|
-
* Clears all nodes and edges.
|
|
1010
|
+
* Clears all nodes and edges.
|
|
1011
|
+
*/
|
|
1012
|
+
clear() {
|
|
1013
|
+
wasm.graphstore_clear(this.__wbg_ptr);
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Adds an edge to the graph.
|
|
1017
|
+
*
|
|
1018
|
+
* Returns an error if an edge with the same ID already exists.
|
|
1019
|
+
* @param {GraphEdge} edge
|
|
1020
|
+
*/
|
|
1021
|
+
add_edge(edge) {
|
|
1022
|
+
try {
|
|
1023
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1024
|
+
_assertClass(edge, GraphEdge);
|
|
1025
|
+
var ptr0 = edge.__destroy_into_raw();
|
|
1026
|
+
wasm.graphstore_add_edge(retptr, this.__wbg_ptr, ptr0);
|
|
1027
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1028
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1029
|
+
if (r1) {
|
|
1030
|
+
throw takeObject(r0);
|
|
1031
|
+
}
|
|
1032
|
+
} finally {
|
|
1033
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Adds a node to the graph.
|
|
1038
|
+
* @param {GraphNode} node
|
|
1039
|
+
*/
|
|
1040
|
+
add_node(node) {
|
|
1041
|
+
_assertClass(node, GraphNode);
|
|
1042
|
+
var ptr0 = node.__destroy_into_raw();
|
|
1043
|
+
wasm.graphstore_add_node(this.__wbg_ptr, ptr0);
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Gets an edge by ID.
|
|
1047
|
+
* @param {bigint} id
|
|
1048
|
+
* @returns {GraphEdge | undefined}
|
|
1049
|
+
*/
|
|
1050
|
+
get_edge(id) {
|
|
1051
|
+
const ret = wasm.graphstore_get_edge(this.__wbg_ptr, id);
|
|
1052
|
+
return ret === 0 ? undefined : GraphEdge.__wrap(ret);
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Gets a node by ID.
|
|
1056
|
+
* @param {bigint} id
|
|
1057
|
+
* @returns {GraphNode | undefined}
|
|
1058
|
+
*/
|
|
1059
|
+
get_node(id) {
|
|
1060
|
+
const ret = wasm.graphstore_get_node(this.__wbg_ptr, id);
|
|
1061
|
+
return ret === 0 ? undefined : GraphNode.__wrap(ret);
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Checks if an edge exists.
|
|
1065
|
+
* @param {bigint} id
|
|
1066
|
+
* @returns {boolean}
|
|
1067
|
+
*/
|
|
1068
|
+
has_edge(id) {
|
|
1069
|
+
const ret = wasm.graphstore_has_edge(this.__wbg_ptr, id);
|
|
1070
|
+
return ret !== 0;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Checks if a node exists.
|
|
1074
|
+
* @param {bigint} id
|
|
1075
|
+
* @returns {boolean}
|
|
1076
|
+
*/
|
|
1077
|
+
has_node(id) {
|
|
1078
|
+
const ret = wasm.graphstore_has_node(this.__wbg_ptr, id);
|
|
1079
|
+
return ret !== 0;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Gets the in-degree (number of incoming edges) of a node.
|
|
1083
|
+
* @param {bigint} node_id
|
|
1084
|
+
* @returns {number}
|
|
1085
|
+
*/
|
|
1086
|
+
in_degree(node_id) {
|
|
1087
|
+
const ret = wasm.graphstore_in_degree(this.__wbg_ptr, node_id);
|
|
1088
|
+
return ret >>> 0;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
if (Symbol.dispose) GraphStore.prototype[Symbol.dispose] = GraphStore.prototype.free;
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Configuration for Web Worker traversal decisions.
|
|
1095
|
+
*/
|
|
1096
|
+
export class GraphWorkerConfig {
|
|
1097
|
+
static __wrap(ptr) {
|
|
1098
|
+
ptr = ptr >>> 0;
|
|
1099
|
+
const obj = Object.create(GraphWorkerConfig.prototype);
|
|
1100
|
+
obj.__wbg_ptr = ptr;
|
|
1101
|
+
GraphWorkerConfigFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1102
|
+
return obj;
|
|
1103
|
+
}
|
|
1104
|
+
__destroy_into_raw() {
|
|
1105
|
+
const ptr = this.__wbg_ptr;
|
|
1106
|
+
this.__wbg_ptr = 0;
|
|
1107
|
+
GraphWorkerConfigFinalization.unregister(this);
|
|
1108
|
+
return ptr;
|
|
1109
|
+
}
|
|
1110
|
+
free() {
|
|
1111
|
+
const ptr = this.__destroy_into_raw();
|
|
1112
|
+
wasm.__wbg_graphworkerconfig_free(ptr, 0);
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Creates a configuration optimized for large graphs.
|
|
1116
|
+
* @returns {GraphWorkerConfig}
|
|
1117
|
+
*/
|
|
1118
|
+
static for_large_graphs() {
|
|
1119
|
+
const ret = wasm.graphworkerconfig_for_large_graphs();
|
|
1120
|
+
return GraphWorkerConfig.__wrap(ret);
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Creates a configuration optimized for responsive UI.
|
|
1124
|
+
* @returns {GraphWorkerConfig}
|
|
1125
|
+
*/
|
|
1126
|
+
static for_responsive_ui() {
|
|
1127
|
+
const ret = wasm.graphworkerconfig_for_responsive_ui();
|
|
1128
|
+
return GraphWorkerConfig.__wrap(ret);
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Creates a new configuration with default values.
|
|
1132
|
+
*/
|
|
1133
|
+
constructor() {
|
|
1134
|
+
const ret = wasm.graphworkerconfig_new();
|
|
1135
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1136
|
+
GraphWorkerConfigFinalization.register(this, this.__wbg_ptr, this);
|
|
1137
|
+
return this;
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Minimum node count to trigger worker offload.
|
|
1141
|
+
* @returns {number}
|
|
1142
|
+
*/
|
|
1143
|
+
get node_threshold() {
|
|
1144
|
+
const ret = wasm.__wbg_get_graphworkerconfig_node_threshold(this.__wbg_ptr);
|
|
1145
|
+
return ret >>> 0;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Minimum node count to trigger worker offload.
|
|
1149
|
+
* @param {number} arg0
|
|
1150
|
+
*/
|
|
1151
|
+
set node_threshold(arg0) {
|
|
1152
|
+
wasm.__wbg_set_graphworkerconfig_node_threshold(this.__wbg_ptr, arg0);
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Minimum depth to trigger worker offload.
|
|
1156
|
+
* @returns {number}
|
|
1157
|
+
*/
|
|
1158
|
+
get depth_threshold() {
|
|
1159
|
+
const ret = wasm.__wbg_get_graphworkerconfig_depth_threshold(this.__wbg_ptr);
|
|
1160
|
+
return ret >>> 0;
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Minimum depth to trigger worker offload.
|
|
1164
|
+
* @param {number} arg0
|
|
1165
|
+
*/
|
|
1166
|
+
set depth_threshold(arg0) {
|
|
1167
|
+
wasm.__wbg_set_graphworkerconfig_depth_threshold(this.__wbg_ptr, arg0);
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Progress callback interval in milliseconds.
|
|
1171
|
+
* @returns {number}
|
|
1172
|
+
*/
|
|
1173
|
+
get progress_interval_ms() {
|
|
1174
|
+
const ret = wasm.__wbg_get_graphworkerconfig_progress_interval_ms(this.__wbg_ptr);
|
|
1175
|
+
return ret >>> 0;
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Progress callback interval in milliseconds.
|
|
1179
|
+
* @param {number} arg0
|
|
1180
|
+
*/
|
|
1181
|
+
set progress_interval_ms(arg0) {
|
|
1182
|
+
wasm.__wbg_set_graphworkerconfig_progress_interval_ms(this.__wbg_ptr, arg0);
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Whether to use `SharedArrayBuffer` for result transfer (if available).
|
|
1186
|
+
* @returns {boolean}
|
|
1187
|
+
*/
|
|
1188
|
+
get use_shared_buffer() {
|
|
1189
|
+
const ret = wasm.__wbg_get_graphworkerconfig_use_shared_buffer(this.__wbg_ptr);
|
|
1190
|
+
return ret !== 0;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* Whether to use `SharedArrayBuffer` for result transfer (if available).
|
|
1194
|
+
* @param {boolean} arg0
|
|
1195
|
+
*/
|
|
1196
|
+
set use_shared_buffer(arg0) {
|
|
1197
|
+
wasm.__wbg_set_graphworkerconfig_use_shared_buffer(this.__wbg_ptr, arg0);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
if (Symbol.dispose) GraphWorkerConfig.prototype[Symbol.dispose] = GraphWorkerConfig.prototype.free;
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* A parsed `VelesQL` statement with introspection methods.
|
|
1204
|
+
*/
|
|
1205
|
+
export class ParsedQuery {
|
|
1206
|
+
static __wrap(ptr) {
|
|
1207
|
+
ptr = ptr >>> 0;
|
|
1208
|
+
const obj = Object.create(ParsedQuery.prototype);
|
|
1209
|
+
obj.__wbg_ptr = ptr;
|
|
1210
|
+
ParsedQueryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1211
|
+
return obj;
|
|
1212
|
+
}
|
|
1213
|
+
__destroy_into_raw() {
|
|
1214
|
+
const ptr = this.__wbg_ptr;
|
|
1215
|
+
this.__wbg_ptr = 0;
|
|
1216
|
+
ParsedQueryFinalization.unregister(this);
|
|
1217
|
+
return ptr;
|
|
1218
|
+
}
|
|
1219
|
+
free() {
|
|
1220
|
+
const ptr = this.__destroy_into_raw();
|
|
1221
|
+
wasm.__wbg_parsedquery_free(ptr, 0);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Check if the query uses FUSION (hybrid search).
|
|
1225
|
+
* @returns {boolean}
|
|
1226
|
+
*/
|
|
1227
|
+
get hasFusion() {
|
|
1228
|
+
const ret = wasm.parsedquery_hasFusion(this.__wbg_ptr);
|
|
1229
|
+
return ret !== 0;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Get the number of JOIN clauses.
|
|
1233
|
+
* @returns {number}
|
|
1234
|
+
*/
|
|
1235
|
+
get joinCount() {
|
|
1236
|
+
const ret = wasm.parsedquery_joinCount(this.__wbg_ptr);
|
|
1237
|
+
return ret >>> 0;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Get the table name from the FROM clause.
|
|
1241
|
+
* @returns {string | undefined}
|
|
1242
|
+
*/
|
|
1243
|
+
get tableName() {
|
|
1244
|
+
try {
|
|
1245
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1246
|
+
wasm.parsedquery_tableName(retptr, this.__wbg_ptr);
|
|
1247
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1248
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1249
|
+
let v1;
|
|
1250
|
+
if (r0 !== 0) {
|
|
1251
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1252
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1253
|
+
}
|
|
1254
|
+
return v1;
|
|
1255
|
+
} finally {
|
|
1256
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* Get the LIMIT from the MATCH RETURN clause.
|
|
1261
|
+
* @returns {bigint | undefined}
|
|
1262
|
+
*/
|
|
1263
|
+
get matchLimit() {
|
|
1264
|
+
try {
|
|
1265
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1266
|
+
wasm.parsedquery_matchLimit(retptr, this.__wbg_ptr);
|
|
1267
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1268
|
+
var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
|
|
1269
|
+
return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
|
|
1270
|
+
} finally {
|
|
1271
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Check if DISTINCT modifier is present.
|
|
1276
|
+
* @returns {boolean}
|
|
1277
|
+
*/
|
|
1278
|
+
get hasDistinct() {
|
|
1279
|
+
const ret = wasm.parsedquery_hasDistinct(this.__wbg_ptr);
|
|
1280
|
+
return ret !== 0;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Check if the query has a GROUP BY clause.
|
|
1284
|
+
* @returns {boolean}
|
|
1285
|
+
*/
|
|
1286
|
+
get hasGroupBy() {
|
|
1287
|
+
const ret = wasm.parsedquery_hasGroupBy(this.__wbg_ptr);
|
|
1288
|
+
return ret !== 0;
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Check if the query has an ORDER BY clause.
|
|
1292
|
+
* @returns {boolean}
|
|
1293
|
+
*/
|
|
1294
|
+
get hasOrderBy() {
|
|
1295
|
+
const ret = wasm.parsedquery_hasOrderBy(this.__wbg_ptr);
|
|
1296
|
+
return ret !== 0;
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Check if the MATCH clause has a WHERE condition.
|
|
1300
|
+
* @returns {boolean}
|
|
1301
|
+
*/
|
|
1302
|
+
get matchHasWhere() {
|
|
1303
|
+
const ret = wasm.parsedquery_matchHasWhere(this.__wbg_ptr);
|
|
1304
|
+
return ret !== 0;
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Check if the query has a WHERE clause.
|
|
1308
|
+
* @returns {boolean}
|
|
1309
|
+
*/
|
|
1310
|
+
get hasWhereClause() {
|
|
1311
|
+
const ret = wasm.parsedquery_hasWhereClause(this.__wbg_ptr);
|
|
1312
|
+
return ret !== 0;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Get the number of node patterns in the MATCH clause.
|
|
1316
|
+
* @returns {number}
|
|
1317
|
+
*/
|
|
1318
|
+
get matchNodeCount() {
|
|
1319
|
+
const ret = wasm.parsedquery_matchNodeCount(this.__wbg_ptr);
|
|
1320
|
+
return ret >>> 0;
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* Check if the query contains vector search (NEAR clause).
|
|
1324
|
+
* @returns {boolean}
|
|
1325
|
+
*/
|
|
1326
|
+
get hasVectorSearch() {
|
|
1327
|
+
const ret = wasm.parsedquery_hasVectorSearch(this.__wbg_ptr);
|
|
1328
|
+
return ret !== 0;
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Get node labels from the MATCH clause as JSON array of arrays.
|
|
1332
|
+
* Each inner array contains the labels for one node pattern.
|
|
1333
|
+
* @returns {any}
|
|
1334
|
+
*/
|
|
1335
|
+
get matchNodeLabels() {
|
|
1336
|
+
const ret = wasm.parsedquery_matchNodeLabels(this.__wbg_ptr);
|
|
1337
|
+
return takeObject(ret);
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Get RETURN items from the MATCH clause as JSON array.
|
|
1341
|
+
* @returns {any}
|
|
1342
|
+
*/
|
|
1343
|
+
get matchReturnItems() {
|
|
1344
|
+
const ret = wasm.parsedquery_matchReturnItems(this.__wbg_ptr);
|
|
1345
|
+
return takeObject(ret);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Get the number of relationship patterns in the MATCH clause.
|
|
1349
|
+
* @returns {number}
|
|
1350
|
+
*/
|
|
1351
|
+
get matchRelationshipCount() {
|
|
1352
|
+
const ret = wasm.parsedquery_matchRelationshipCount(this.__wbg_ptr);
|
|
1353
|
+
return ret >>> 0;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Get relationship types from the MATCH clause as JSON array of arrays.
|
|
1357
|
+
* Each inner array contains the types for one relationship pattern.
|
|
1358
|
+
* @returns {any}
|
|
1359
|
+
*/
|
|
1360
|
+
get matchRelationshipTypes() {
|
|
1361
|
+
const ret = wasm.parsedquery_matchRelationshipTypes(this.__wbg_ptr);
|
|
1362
|
+
return takeObject(ret);
|
|
1363
|
+
}
|
|
1364
|
+
/**
|
|
1365
|
+
* Get the LIMIT value if present.
|
|
1366
|
+
* @returns {bigint | undefined}
|
|
1367
|
+
*/
|
|
1368
|
+
get limit() {
|
|
1369
|
+
try {
|
|
1370
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1371
|
+
wasm.parsedquery_limit(retptr, this.__wbg_ptr);
|
|
1372
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1373
|
+
var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
|
|
1374
|
+
return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
|
|
1375
|
+
} finally {
|
|
1376
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Get the OFFSET value if present.
|
|
1381
|
+
* @returns {bigint | undefined}
|
|
1382
|
+
*/
|
|
1383
|
+
get offset() {
|
|
1384
|
+
try {
|
|
1385
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1386
|
+
wasm.parsedquery_offset(retptr, this.__wbg_ptr);
|
|
1387
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1388
|
+
var r2 = getDataViewMemory0().getBigInt64(retptr + 8 * 1, true);
|
|
1389
|
+
return r0 === 0 ? undefined : BigInt.asUintN(64, r2);
|
|
1390
|
+
} finally {
|
|
1391
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Get the list of selected columns as JSON array.
|
|
1396
|
+
* @returns {any}
|
|
1397
|
+
*/
|
|
1398
|
+
get columns() {
|
|
1399
|
+
const ret = wasm.parsedquery_columns(this.__wbg_ptr);
|
|
1400
|
+
return takeObject(ret);
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Get the GROUP BY columns as JSON array.
|
|
1404
|
+
* @returns {any}
|
|
1405
|
+
*/
|
|
1406
|
+
get groupBy() {
|
|
1407
|
+
const ret = wasm.parsedquery_groupBy(this.__wbg_ptr);
|
|
1408
|
+
return takeObject(ret);
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* Check if this is a MATCH (graph) query.
|
|
1412
|
+
* @returns {boolean}
|
|
1413
|
+
*/
|
|
1414
|
+
get isMatch() {
|
|
1415
|
+
const ret = wasm.parsedquery_isMatch(this.__wbg_ptr);
|
|
1416
|
+
return ret !== 0;
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Check if the query is valid (always true for successfully parsed queries).
|
|
1420
|
+
* @returns {boolean}
|
|
1421
|
+
*/
|
|
1422
|
+
get isValid() {
|
|
1423
|
+
const ret = wasm.parsedquery_isValid(this.__wbg_ptr);
|
|
1424
|
+
return ret !== 0;
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* Get the ORDER BY columns and directions as JSON array.
|
|
1428
|
+
* @returns {any}
|
|
1429
|
+
*/
|
|
1430
|
+
get orderBy() {
|
|
1431
|
+
const ret = wasm.parsedquery_orderBy(this.__wbg_ptr);
|
|
1432
|
+
return takeObject(ret);
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Check if the query has JOINs.
|
|
1436
|
+
* @returns {boolean}
|
|
1437
|
+
*/
|
|
1438
|
+
get hasJoins() {
|
|
1439
|
+
const ret = wasm.parsedquery_hasJoins(this.__wbg_ptr);
|
|
1440
|
+
return ret !== 0;
|
|
1441
|
+
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Check if this is a SELECT query.
|
|
1444
|
+
* @returns {boolean}
|
|
1445
|
+
*/
|
|
1446
|
+
get isSelect() {
|
|
1447
|
+
const ret = wasm.parsedquery_isSelect(this.__wbg_ptr);
|
|
1448
|
+
return ret !== 0;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
if (Symbol.dispose) ParsedQuery.prototype[Symbol.dispose] = ParsedQuery.prototype.free;
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Semantic Memory for AI agents in WASM.
|
|
1455
|
+
*
|
|
1456
|
+
* Stores knowledge facts as vectors with similarity search.
|
|
1457
|
+
*
|
|
1458
|
+
* # Example (JavaScript)
|
|
1459
|
+
*
|
|
1460
|
+
* ```javascript
|
|
1461
|
+
* import { SemanticMemory } from 'velesdb-wasm';
|
|
1462
|
+
*
|
|
1463
|
+
* const memory = new SemanticMemory(384);
|
|
1464
|
+
* memory.store(1, "Paris is the capital of France", embedding);
|
|
1465
|
+
* const results = memory.query(queryEmbedding, 5);
|
|
1466
|
+
* ```
|
|
1467
|
+
*/
|
|
1468
|
+
export class SemanticMemory {
|
|
1469
|
+
__destroy_into_raw() {
|
|
1470
|
+
const ptr = this.__wbg_ptr;
|
|
1471
|
+
this.__wbg_ptr = 0;
|
|
1472
|
+
SemanticMemoryFinalization.unregister(this);
|
|
1473
|
+
return ptr;
|
|
1474
|
+
}
|
|
1475
|
+
free() {
|
|
1476
|
+
const ptr = this.__destroy_into_raw();
|
|
1477
|
+
wasm.__wbg_semanticmemory_free(ptr, 0);
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Returns the number of stored knowledge facts.
|
|
1481
|
+
* @returns {number}
|
|
1482
|
+
*/
|
|
1483
|
+
len() {
|
|
1484
|
+
const ret = wasm.graphstore_node_count(this.__wbg_ptr);
|
|
1485
|
+
return ret >>> 0;
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Creates a new `SemanticMemory` with the given embedding dimension.
|
|
1489
|
+
* @param {number} dimension
|
|
1490
|
+
*/
|
|
1491
|
+
constructor(dimension) {
|
|
1492
|
+
try {
|
|
1493
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1494
|
+
wasm.semanticmemory_new(retptr, dimension);
|
|
1495
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1496
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1497
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1498
|
+
if (r2) {
|
|
1499
|
+
throw takeObject(r1);
|
|
1500
|
+
}
|
|
1501
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1502
|
+
SemanticMemoryFinalization.register(this, this.__wbg_ptr, this);
|
|
1503
|
+
return this;
|
|
1504
|
+
} finally {
|
|
1505
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Clears all knowledge facts.
|
|
888
1510
|
*/
|
|
889
1511
|
clear() {
|
|
890
|
-
wasm.
|
|
1512
|
+
wasm.semanticmemory_clear(this.__wbg_ptr);
|
|
891
1513
|
}
|
|
892
1514
|
/**
|
|
893
|
-
*
|
|
1515
|
+
* Queries semantic memory by similarity search.
|
|
894
1516
|
*
|
|
895
|
-
* Returns
|
|
896
|
-
* @param {
|
|
1517
|
+
* Returns a JSON array of {id, score, content} objects.
|
|
1518
|
+
* @param {Float32Array} embedding
|
|
1519
|
+
* @param {number} top_k
|
|
1520
|
+
* @returns {any}
|
|
897
1521
|
*/
|
|
898
|
-
|
|
1522
|
+
query(embedding, top_k) {
|
|
899
1523
|
try {
|
|
900
1524
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
wasm.
|
|
1525
|
+
const ptr0 = passArrayF32ToWasm0(embedding, wasm.__wbindgen_export);
|
|
1526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1527
|
+
wasm.semanticmemory_query(retptr, this.__wbg_ptr, ptr0, len0, top_k);
|
|
904
1528
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
905
1529
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
906
|
-
|
|
907
|
-
|
|
1530
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1531
|
+
if (r2) {
|
|
1532
|
+
throw takeObject(r1);
|
|
908
1533
|
}
|
|
1534
|
+
return takeObject(r0);
|
|
909
1535
|
} finally {
|
|
910
1536
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
911
1537
|
}
|
|
912
1538
|
}
|
|
913
1539
|
/**
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* Gets an edge by ID.
|
|
924
|
-
* @param {bigint} id
|
|
925
|
-
* @returns {GraphEdge | undefined}
|
|
926
|
-
*/
|
|
927
|
-
get_edge(id) {
|
|
928
|
-
const ret = wasm.graphstore_get_edge(this.__wbg_ptr, id);
|
|
929
|
-
return ret === 0 ? undefined : GraphEdge.__wrap(ret);
|
|
930
|
-
}
|
|
931
|
-
/**
|
|
932
|
-
* Gets a node by ID.
|
|
1540
|
+
* Stores a knowledge fact with its embedding vector.
|
|
1541
|
+
*
|
|
1542
|
+
* # Arguments
|
|
1543
|
+
*
|
|
1544
|
+
* * `id` - Unique identifier for this fact
|
|
1545
|
+
* * `content` - Text content of the knowledge
|
|
1546
|
+
* * `embedding` - Vector representation (`Float32Array`)
|
|
933
1547
|
* @param {bigint} id
|
|
934
|
-
* @
|
|
1548
|
+
* @param {string} content
|
|
1549
|
+
* @param {Float32Array} embedding
|
|
935
1550
|
*/
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1551
|
+
store(id, content, embedding) {
|
|
1552
|
+
try {
|
|
1553
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1554
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1555
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1556
|
+
const ptr1 = passArrayF32ToWasm0(embedding, wasm.__wbindgen_export);
|
|
1557
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1558
|
+
wasm.semanticmemory_store(retptr, this.__wbg_ptr, id, ptr0, len0, ptr1, len1);
|
|
1559
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1560
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1561
|
+
if (r1) {
|
|
1562
|
+
throw takeObject(r0);
|
|
1563
|
+
}
|
|
1564
|
+
} finally {
|
|
1565
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1566
|
+
}
|
|
939
1567
|
}
|
|
940
1568
|
/**
|
|
941
|
-
*
|
|
1569
|
+
* Removes a knowledge fact by ID.
|
|
942
1570
|
* @param {bigint} id
|
|
943
1571
|
* @returns {boolean}
|
|
944
1572
|
*/
|
|
945
|
-
|
|
946
|
-
const ret = wasm.
|
|
1573
|
+
remove(id) {
|
|
1574
|
+
const ret = wasm.semanticmemory_remove(this.__wbg_ptr, id);
|
|
947
1575
|
return ret !== 0;
|
|
948
1576
|
}
|
|
949
1577
|
/**
|
|
950
|
-
*
|
|
951
|
-
* @param {bigint} id
|
|
1578
|
+
* Returns true if no knowledge facts are stored.
|
|
952
1579
|
* @returns {boolean}
|
|
953
1580
|
*/
|
|
954
|
-
|
|
955
|
-
const ret = wasm.
|
|
1581
|
+
is_empty() {
|
|
1582
|
+
const ret = wasm.semanticmemory_is_empty(this.__wbg_ptr);
|
|
956
1583
|
return ret !== 0;
|
|
957
1584
|
}
|
|
958
1585
|
/**
|
|
959
|
-
*
|
|
960
|
-
* @param {bigint} node_id
|
|
1586
|
+
* Returns the embedding dimension.
|
|
961
1587
|
* @returns {number}
|
|
962
1588
|
*/
|
|
963
|
-
|
|
964
|
-
const ret = wasm.
|
|
1589
|
+
dimension() {
|
|
1590
|
+
const ret = wasm.semanticmemory_dimension(this.__wbg_ptr);
|
|
965
1591
|
return ret >>> 0;
|
|
966
1592
|
}
|
|
967
1593
|
}
|
|
968
|
-
if (Symbol.dispose)
|
|
1594
|
+
if (Symbol.dispose) SemanticMemory.prototype[Symbol.dispose] = SemanticMemory.prototype.free;
|
|
969
1595
|
|
|
970
1596
|
/**
|
|
971
1597
|
* Storage mode for vector quantization.
|
|
@@ -986,6 +1612,137 @@ export const StorageMode = Object.freeze({
|
|
|
986
1612
|
Binary: 2, "2": "Binary",
|
|
987
1613
|
});
|
|
988
1614
|
|
|
1615
|
+
/**
|
|
1616
|
+
* Progress information for long-running traversals.
|
|
1617
|
+
*/
|
|
1618
|
+
export class TraversalProgress {
|
|
1619
|
+
__destroy_into_raw() {
|
|
1620
|
+
const ptr = this.__wbg_ptr;
|
|
1621
|
+
this.__wbg_ptr = 0;
|
|
1622
|
+
TraversalProgressFinalization.unregister(this);
|
|
1623
|
+
return ptr;
|
|
1624
|
+
}
|
|
1625
|
+
free() {
|
|
1626
|
+
const ptr = this.__destroy_into_raw();
|
|
1627
|
+
wasm.__wbg_traversalprogress_free(ptr, 0);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* Returns the completion percentage (0-100).
|
|
1631
|
+
* @returns {number}
|
|
1632
|
+
*/
|
|
1633
|
+
get percentage() {
|
|
1634
|
+
const ret = wasm.traversalprogress_percentage(this.__wbg_ptr);
|
|
1635
|
+
return ret;
|
|
1636
|
+
}
|
|
1637
|
+
/**
|
|
1638
|
+
* Creates a new progress report.
|
|
1639
|
+
* @param {number} visited
|
|
1640
|
+
* @param {number} estimated
|
|
1641
|
+
* @param {number} depth
|
|
1642
|
+
*/
|
|
1643
|
+
constructor(visited, estimated, depth) {
|
|
1644
|
+
const ret = wasm.traversalprogress_new(visited, estimated, depth);
|
|
1645
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1646
|
+
TraversalProgressFinalization.register(this, this.__wbg_ptr, this);
|
|
1647
|
+
return this;
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Converts to JSON for postMessage.
|
|
1651
|
+
* @returns {any}
|
|
1652
|
+
*/
|
|
1653
|
+
to_json() {
|
|
1654
|
+
try {
|
|
1655
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1656
|
+
wasm.traversalprogress_to_json(retptr, this.__wbg_ptr);
|
|
1657
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1658
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1659
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1660
|
+
if (r2) {
|
|
1661
|
+
throw takeObject(r1);
|
|
1662
|
+
}
|
|
1663
|
+
return takeObject(r0);
|
|
1664
|
+
} finally {
|
|
1665
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Number of nodes visited so far.
|
|
1670
|
+
* @returns {number}
|
|
1671
|
+
*/
|
|
1672
|
+
get visited_count() {
|
|
1673
|
+
const ret = wasm.__wbg_get_graphworkerconfig_node_threshold(this.__wbg_ptr);
|
|
1674
|
+
return ret >>> 0;
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* Number of nodes visited so far.
|
|
1678
|
+
* @param {number} arg0
|
|
1679
|
+
*/
|
|
1680
|
+
set visited_count(arg0) {
|
|
1681
|
+
wasm.__wbg_set_graphworkerconfig_node_threshold(this.__wbg_ptr, arg0);
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Estimated total nodes to visit (heuristic).
|
|
1685
|
+
* @returns {number}
|
|
1686
|
+
*/
|
|
1687
|
+
get estimated_total() {
|
|
1688
|
+
const ret = wasm.__wbg_get_graphworkerconfig_depth_threshold(this.__wbg_ptr);
|
|
1689
|
+
return ret >>> 0;
|
|
1690
|
+
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Estimated total nodes to visit (heuristic).
|
|
1693
|
+
* @param {number} arg0
|
|
1694
|
+
*/
|
|
1695
|
+
set estimated_total(arg0) {
|
|
1696
|
+
wasm.__wbg_set_graphworkerconfig_depth_threshold(this.__wbg_ptr, arg0);
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Current traversal depth.
|
|
1700
|
+
* @returns {number}
|
|
1701
|
+
*/
|
|
1702
|
+
get current_depth() {
|
|
1703
|
+
const ret = wasm.__wbg_get_graphworkerconfig_progress_interval_ms(this.__wbg_ptr);
|
|
1704
|
+
return ret >>> 0;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Current traversal depth.
|
|
1708
|
+
* @param {number} arg0
|
|
1709
|
+
*/
|
|
1710
|
+
set current_depth(arg0) {
|
|
1711
|
+
wasm.__wbg_set_graphworkerconfig_progress_interval_ms(this.__wbg_ptr, arg0);
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* Whether the traversal is complete.
|
|
1715
|
+
* @returns {boolean}
|
|
1716
|
+
*/
|
|
1717
|
+
get is_complete() {
|
|
1718
|
+
const ret = wasm.__wbg_get_graphworkerconfig_use_shared_buffer(this.__wbg_ptr);
|
|
1719
|
+
return ret !== 0;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Whether the traversal is complete.
|
|
1723
|
+
* @param {boolean} arg0
|
|
1724
|
+
*/
|
|
1725
|
+
set is_complete(arg0) {
|
|
1726
|
+
wasm.__wbg_set_graphworkerconfig_use_shared_buffer(this.__wbg_ptr, arg0);
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Whether the traversal was cancelled.
|
|
1730
|
+
* @returns {boolean}
|
|
1731
|
+
*/
|
|
1732
|
+
get is_cancelled() {
|
|
1733
|
+
const ret = wasm.__wbg_get_traversalprogress_is_cancelled(this.__wbg_ptr);
|
|
1734
|
+
return ret !== 0;
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Whether the traversal was cancelled.
|
|
1738
|
+
* @param {boolean} arg0
|
|
1739
|
+
*/
|
|
1740
|
+
set is_cancelled(arg0) {
|
|
1741
|
+
wasm.__wbg_set_traversalprogress_is_cancelled(this.__wbg_ptr, arg0);
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
if (Symbol.dispose) TraversalProgress.prototype[Symbol.dispose] = TraversalProgress.prototype.free;
|
|
1745
|
+
|
|
989
1746
|
/**
|
|
990
1747
|
* A vector store for in-memory vector search.
|
|
991
1748
|
*
|
|
@@ -1442,6 +2199,39 @@ export class VectorStore {
|
|
|
1442
2199
|
clear() {
|
|
1443
2200
|
wasm.vectorstore_clear(this.__wbg_ptr);
|
|
1444
2201
|
}
|
|
2202
|
+
/**
|
|
2203
|
+
* VelesQL-style query returning multi-model results (EPIC-031 US-009).
|
|
2204
|
+
*
|
|
2205
|
+
* Returns results in `HybridResult` format with `node_id`, `vector_score`,
|
|
2206
|
+
* `graph_score`, `fused_score`, `bindings`, and `column_data`.
|
|
2207
|
+
*
|
|
2208
|
+
* # Arguments
|
|
2209
|
+
* * `query_vector` - Query vector for similarity search
|
|
2210
|
+
* * `k` - Number of results to return
|
|
2211
|
+
*
|
|
2212
|
+
* # Returns
|
|
2213
|
+
* Array of `{nodeId, vectorScore, graphScore, fusedScore, bindings, columnData}`
|
|
2214
|
+
* @param {Float32Array} query_vector
|
|
2215
|
+
* @param {number} k
|
|
2216
|
+
* @returns {any}
|
|
2217
|
+
*/
|
|
2218
|
+
query(query_vector, k) {
|
|
2219
|
+
try {
|
|
2220
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2221
|
+
const ptr0 = passArrayF32ToWasm0(query_vector, wasm.__wbindgen_export);
|
|
2222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2223
|
+
wasm.vectorstore_query(retptr, this.__wbg_ptr, ptr0, len0, k);
|
|
2224
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2225
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2226
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2227
|
+
if (r2) {
|
|
2228
|
+
throw takeObject(r1);
|
|
2229
|
+
}
|
|
2230
|
+
return takeObject(r0);
|
|
2231
|
+
} finally {
|
|
2232
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
1445
2235
|
/**
|
|
1446
2236
|
* Inserts a vector with the given ID.
|
|
1447
2237
|
* @param {bigint} id
|
|
@@ -1520,6 +2310,114 @@ export class VectorStore {
|
|
|
1520
2310
|
}
|
|
1521
2311
|
if (Symbol.dispose) VectorStore.prototype[Symbol.dispose] = VectorStore.prototype.free;
|
|
1522
2312
|
|
|
2313
|
+
/**
|
|
2314
|
+
* `VelesQL` query parser for browser use.
|
|
2315
|
+
*
|
|
2316
|
+
* # Example (JavaScript)
|
|
2317
|
+
*
|
|
2318
|
+
* ```javascript
|
|
2319
|
+
* import { VelesQL } from 'velesdb-wasm';
|
|
2320
|
+
*
|
|
2321
|
+
* // Parse a query
|
|
2322
|
+
* const parsed = VelesQL.parse("SELECT * FROM docs WHERE category = 'tech' LIMIT 10");
|
|
2323
|
+
* console.log(parsed.tableName); // "docs"
|
|
2324
|
+
* console.log(parsed.isValid); // true
|
|
2325
|
+
*
|
|
2326
|
+
* // Validate without parsing
|
|
2327
|
+
* const valid = VelesQL.isValid("SELECT * FROM docs"); // true
|
|
2328
|
+
* ```
|
|
2329
|
+
*/
|
|
2330
|
+
export class VelesQL {
|
|
2331
|
+
__destroy_into_raw() {
|
|
2332
|
+
const ptr = this.__wbg_ptr;
|
|
2333
|
+
this.__wbg_ptr = 0;
|
|
2334
|
+
VelesQLFinalization.unregister(this);
|
|
2335
|
+
return ptr;
|
|
2336
|
+
}
|
|
2337
|
+
free() {
|
|
2338
|
+
const ptr = this.__destroy_into_raw();
|
|
2339
|
+
wasm.__wbg_velesql_free(ptr, 0);
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Parse a `VelesQL` query string.
|
|
2343
|
+
*
|
|
2344
|
+
* Returns a `ParsedQuery` object with query introspection methods.
|
|
2345
|
+
* Throws an error if the query has syntax errors.
|
|
2346
|
+
* @param {string} query
|
|
2347
|
+
* @returns {ParsedQuery}
|
|
2348
|
+
*/
|
|
2349
|
+
static parse(query) {
|
|
2350
|
+
try {
|
|
2351
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2352
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2353
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2354
|
+
wasm.velesql_parse(retptr, ptr0, len0);
|
|
2355
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2356
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2357
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2358
|
+
if (r2) {
|
|
2359
|
+
throw takeObject(r1);
|
|
2360
|
+
}
|
|
2361
|
+
return ParsedQuery.__wrap(r0);
|
|
2362
|
+
} finally {
|
|
2363
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* Validate a `VelesQL` query without full parsing.
|
|
2368
|
+
*
|
|
2369
|
+
* This is faster than `parse()` when you only need to check validity.
|
|
2370
|
+
* @param {string} query
|
|
2371
|
+
* @returns {boolean}
|
|
2372
|
+
*/
|
|
2373
|
+
static isValid(query) {
|
|
2374
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2375
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2376
|
+
const ret = wasm.velesql_isValid(ptr0, len0);
|
|
2377
|
+
return ret !== 0;
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
if (Symbol.dispose) VelesQL.prototype[Symbol.dispose] = VelesQL.prototype.free;
|
|
2381
|
+
|
|
2382
|
+
/**
|
|
2383
|
+
* Estimates the number of nodes that will be visited during traversal.
|
|
2384
|
+
*
|
|
2385
|
+
* Uses a heuristic based on graph density and max depth.
|
|
2386
|
+
* @param {number} node_count
|
|
2387
|
+
* @param {number} edge_count
|
|
2388
|
+
* @param {number} max_depth
|
|
2389
|
+
* @returns {number}
|
|
2390
|
+
*/
|
|
2391
|
+
export function estimate_traversal_size(node_count, edge_count, max_depth) {
|
|
2392
|
+
const ret = wasm.estimate_traversal_size(node_count, edge_count, max_depth);
|
|
2393
|
+
return ret >>> 0;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* Determines whether a traversal should be offloaded to a Web Worker.
|
|
2398
|
+
*
|
|
2399
|
+
* # Arguments
|
|
2400
|
+
* * `node_count` - Total nodes in the graph
|
|
2401
|
+
* * `max_depth` - Maximum traversal depth requested
|
|
2402
|
+
* * `config` - Optional configuration (uses defaults if None)
|
|
2403
|
+
*
|
|
2404
|
+
* # Returns
|
|
2405
|
+
* `true` if the operation should use a Web Worker
|
|
2406
|
+
* @param {number} node_count
|
|
2407
|
+
* @param {number} max_depth
|
|
2408
|
+
* @param {GraphWorkerConfig | null} [config]
|
|
2409
|
+
* @returns {boolean}
|
|
2410
|
+
*/
|
|
2411
|
+
export function should_use_worker(node_count, max_depth, config) {
|
|
2412
|
+
let ptr0 = 0;
|
|
2413
|
+
if (!isLikeNone(config)) {
|
|
2414
|
+
_assertClass(config, GraphWorkerConfig);
|
|
2415
|
+
ptr0 = config.__destroy_into_raw();
|
|
2416
|
+
}
|
|
2417
|
+
const ret = wasm.should_use_worker(node_count, max_depth, ptr0);
|
|
2418
|
+
return ret !== 0;
|
|
2419
|
+
}
|
|
2420
|
+
|
|
1523
2421
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
1524
2422
|
|
|
1525
2423
|
async function __wbg_load(module, imports) {
|
|
@@ -1645,6 +2543,10 @@ function __wbg_get_imports() {
|
|
|
1645
2543
|
imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
|
|
1646
2544
|
getObject(arg0)._wbg_cb_unref();
|
|
1647
2545
|
};
|
|
2546
|
+
imports.wbg.__wbg_bound_dd83af44245de95e = function() { return handleError(function (arg0, arg1) {
|
|
2547
|
+
const ret = IDBKeyRange.bound(getObject(arg0), getObject(arg1));
|
|
2548
|
+
return addHeapObject(ret);
|
|
2549
|
+
}, arguments) };
|
|
1648
2550
|
imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1649
2551
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1650
2552
|
return addHeapObject(ret);
|
|
@@ -1661,6 +2563,10 @@ function __wbg_get_imports() {
|
|
|
1661
2563
|
const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
|
|
1662
2564
|
return addHeapObject(ret);
|
|
1663
2565
|
}, arguments) };
|
|
2566
|
+
imports.wbg.__wbg_delete_a8cf58aab29e18d2 = function() { return handleError(function (arg0, arg1) {
|
|
2567
|
+
const ret = getObject(arg0).delete(getObject(arg1));
|
|
2568
|
+
return addHeapObject(ret);
|
|
2569
|
+
}, arguments) };
|
|
1664
2570
|
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
1665
2571
|
const ret = getObject(arg0).done;
|
|
1666
2572
|
return ret;
|
|
@@ -1669,6 +2575,14 @@ function __wbg_get_imports() {
|
|
|
1669
2575
|
const ret = Object.entries(getObject(arg0));
|
|
1670
2576
|
return addHeapObject(ret);
|
|
1671
2577
|
};
|
|
2578
|
+
imports.wbg.__wbg_getAllKeys_925405ffbd671e86 = function() { return handleError(function (arg0) {
|
|
2579
|
+
const ret = getObject(arg0).getAllKeys();
|
|
2580
|
+
return addHeapObject(ret);
|
|
2581
|
+
}, arguments) };
|
|
2582
|
+
imports.wbg.__wbg_getAll_48e288420773a079 = function() { return handleError(function (arg0, arg1) {
|
|
2583
|
+
const ret = getObject(arg0).getAll(getObject(arg1));
|
|
2584
|
+
return addHeapObject(ret);
|
|
2585
|
+
}, arguments) };
|
|
1672
2586
|
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
1673
2587
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1674
2588
|
return addHeapObject(ret);
|
|
@@ -1688,6 +2602,10 @@ function __wbg_get_imports() {
|
|
|
1688
2602
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1689
2603
|
return addHeapObject(ret);
|
|
1690
2604
|
}, arguments) };
|
|
2605
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
2606
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
2607
|
+
return addHeapObject(ret);
|
|
2608
|
+
};
|
|
1691
2609
|
imports.wbg.__wbg_graphedge_new = function(arg0) {
|
|
1692
2610
|
const ret = GraphEdge.__wrap(arg0);
|
|
1693
2611
|
return addHeapObject(ret);
|
|
@@ -1696,6 +2614,10 @@ function __wbg_get_imports() {
|
|
|
1696
2614
|
const ret = GraphNode.__wrap(arg0);
|
|
1697
2615
|
return addHeapObject(ret);
|
|
1698
2616
|
};
|
|
2617
|
+
imports.wbg.__wbg_graphstore_new = function(arg0) {
|
|
2618
|
+
const ret = GraphStore.__wrap(arg0);
|
|
2619
|
+
return addHeapObject(ret);
|
|
2620
|
+
};
|
|
1699
2621
|
imports.wbg.__wbg_indexedDB_23c232e00a1e28ad = function() { return handleError(function (arg0) {
|
|
1700
2622
|
const ret = getObject(arg0).indexedDB;
|
|
1701
2623
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
@@ -1787,7 +2709,7 @@ function __wbg_get_imports() {
|
|
|
1787
2709
|
const a = state0.a;
|
|
1788
2710
|
state0.a = 0;
|
|
1789
2711
|
try {
|
|
1790
|
-
return
|
|
2712
|
+
return __wasm_bindgen_func_elem_1217(a, state0.b, arg0, arg1);
|
|
1791
2713
|
} finally {
|
|
1792
2714
|
state0.a = a;
|
|
1793
2715
|
}
|
|
@@ -1814,6 +2736,10 @@ function __wbg_get_imports() {
|
|
|
1814
2736
|
const ret = getObject(arg0).next();
|
|
1815
2737
|
return addHeapObject(ret);
|
|
1816
2738
|
}, arguments) };
|
|
2739
|
+
imports.wbg.__wbg_now_69d776cd24f5215b = function() {
|
|
2740
|
+
const ret = Date.now();
|
|
2741
|
+
return ret;
|
|
2742
|
+
};
|
|
1817
2743
|
imports.wbg.__wbg_objectStoreNames_90900f9a531513ac = function(arg0) {
|
|
1818
2744
|
const ret = getObject(arg0).objectStoreNames;
|
|
1819
2745
|
return addHeapObject(ret);
|
|
@@ -1822,6 +2748,10 @@ function __wbg_get_imports() {
|
|
|
1822
2748
|
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
|
1823
2749
|
return addHeapObject(ret);
|
|
1824
2750
|
}, arguments) };
|
|
2751
|
+
imports.wbg.__wbg_open_0d7b85f4c0a38ffe = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
2752
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
2753
|
+
return addHeapObject(ret);
|
|
2754
|
+
}, arguments) };
|
|
1825
2755
|
imports.wbg.__wbg_open_2a2740c93beabe29 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1826
2756
|
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
|
|
1827
2757
|
return addHeapObject(ret);
|
|
@@ -1829,6 +2759,10 @@ function __wbg_get_imports() {
|
|
|
1829
2759
|
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1830
2760
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1831
2761
|
};
|
|
2762
|
+
imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
2763
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
2764
|
+
return ret;
|
|
2765
|
+
};
|
|
1832
2766
|
imports.wbg.__wbg_put_d40a68e5a8902a46 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1833
2767
|
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
|
1834
2768
|
return addHeapObject(ret);
|
|
@@ -1891,10 +2825,22 @@ function __wbg_get_imports() {
|
|
|
1891
2825
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
1892
2826
|
return addHeapObject(ret);
|
|
1893
2827
|
};
|
|
2828
|
+
imports.wbg.__wbg_transaction_257422def49a0094 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2829
|
+
const ret = getObject(arg0).transaction(getObject(arg1), __wbindgen_enum_IdbTransactionMode[arg2]);
|
|
2830
|
+
return addHeapObject(ret);
|
|
2831
|
+
}, arguments) };
|
|
2832
|
+
imports.wbg.__wbg_transaction_754344c3ae25fdcf = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2833
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2));
|
|
2834
|
+
return addHeapObject(ret);
|
|
2835
|
+
}, arguments) };
|
|
1894
2836
|
imports.wbg.__wbg_transaction_790ec170b8fbc74b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1895
2837
|
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
|
|
1896
2838
|
return addHeapObject(ret);
|
|
1897
2839
|
}, arguments) };
|
|
2840
|
+
imports.wbg.__wbg_transaction_f32b8e1d5f304f61 = function() { return handleError(function (arg0, arg1) {
|
|
2841
|
+
const ret = getObject(arg0).transaction(getObject(arg1));
|
|
2842
|
+
return addHeapObject(ret);
|
|
2843
|
+
}, arguments) };
|
|
1898
2844
|
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
1899
2845
|
const ret = getObject(arg0).value;
|
|
1900
2846
|
return addHeapObject(ret);
|
|
@@ -1913,11 +2859,6 @@ function __wbg_get_imports() {
|
|
|
1913
2859
|
const ret = BigInt.asUintN(64, arg0);
|
|
1914
2860
|
return addHeapObject(ret);
|
|
1915
2861
|
};
|
|
1916
|
-
imports.wbg.__wbindgen_cast_59e89726c7c5a9af = function(arg0, arg1) {
|
|
1917
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 8, function: Function { arguments: [NamedExternref("Event")], shim_idx: 9, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1918
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_197, __wasm_bindgen_func_elem_198);
|
|
1919
|
-
return addHeapObject(ret);
|
|
1920
|
-
};
|
|
1921
2862
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
1922
2863
|
// Cast intrinsic for `I64 -> Externref`.
|
|
1923
2864
|
const ret = arg0;
|
|
@@ -1928,9 +2869,14 @@ function __wbg_get_imports() {
|
|
|
1928
2869
|
const ret = arg0;
|
|
1929
2870
|
return addHeapObject(ret);
|
|
1930
2871
|
};
|
|
1931
|
-
imports.wbg.
|
|
1932
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1933
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2872
|
+
imports.wbg.__wbindgen_cast_f1c9170db27db6a8 = function(arg0, arg1) {
|
|
2873
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 125, function: Function { arguments: [Externref], shim_idx: 126, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2874
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1175, __wasm_bindgen_func_elem_1176);
|
|
2875
|
+
return addHeapObject(ret);
|
|
2876
|
+
};
|
|
2877
|
+
imports.wbg.__wbindgen_cast_fdfac116b4bf22c8 = function(arg0, arg1) {
|
|
2878
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 9, function: Function { arguments: [NamedExternref("Event")], shim_idx: 10, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2879
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_264, __wasm_bindgen_func_elem_265);
|
|
1934
2880
|
return addHeapObject(ret);
|
|
1935
2881
|
};
|
|
1936
2882
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|