agentic-flow 3.4.1 → 3.4.3

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.
@@ -26,20 +26,12 @@ export class ReasoningBankWasm {
26
26
  * @returns {Promise<string>}
27
27
  */
28
28
  findSimilar(task_description, task_category, top_k) {
29
- const val3 = +top_k;
30
- let ptr0, len0, ptr1, len1;
31
- try {
32
- ptr0 = passStringToWasm0(task_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
33
- len0 = WASM_VECTOR_LEN;
34
- ptr1 = passStringToWasm0(task_category, wasm.__wbindgen_export, wasm.__wbindgen_export2);
35
- len1 = WASM_VECTOR_LEN;
36
- } catch (e) {
37
- if (ptr1) { wasm.__wbindgen_export3(ptr1, len1 * 1, 1); }
38
- if (ptr0) { wasm.__wbindgen_export3(ptr0, len0 * 1, 1); }
39
- throw e;
40
- }
41
- const ret = wasm.reasoningbankwasm_findSimilar(this.__wbg_ptr, ptr0, len0, ptr1, len1, val3);
42
- return ret;
29
+ const ptr0 = passStringToWasm0(task_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
30
+ const len0 = WASM_VECTOR_LEN;
31
+ const ptr1 = passStringToWasm0(task_category, wasm.__wbindgen_export, wasm.__wbindgen_export2);
32
+ const len1 = WASM_VECTOR_LEN;
33
+ const ret = wasm.reasoningbankwasm_findSimilar(this.__wbg_ptr, ptr0, len0, ptr1, len1, top_k);
34
+ return takeObject(ret);
43
35
  }
44
36
  /**
45
37
  * Retrieve a pattern by ID
@@ -50,7 +42,7 @@ export class ReasoningBankWasm {
50
42
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
51
43
  const len0 = WASM_VECTOR_LEN;
52
44
  const ret = wasm.reasoningbankwasm_getPattern(this.__wbg_ptr, ptr0, len0);
53
- return ret;
45
+ return takeObject(ret);
54
46
  }
55
47
  /**
56
48
  * Get storage statistics
@@ -58,7 +50,7 @@ export class ReasoningBankWasm {
58
50
  */
59
51
  getStats() {
60
52
  const ret = wasm.reasoningbankwasm_getStats(this.__wbg_ptr);
61
- return ret;
53
+ return takeObject(ret);
62
54
  }
63
55
  /**
64
56
  * Create a new ReasoningBank instance
@@ -68,7 +60,7 @@ export class ReasoningBankWasm {
68
60
  var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
69
61
  var len0 = WASM_VECTOR_LEN;
70
62
  const ret = wasm.reasoningbankwasm_new(ptr0, len0);
71
- return ret;
63
+ return takeObject(ret);
72
64
  }
73
65
  /**
74
66
  * Search patterns by category
@@ -77,11 +69,10 @@ export class ReasoningBankWasm {
77
69
  * @returns {Promise<string>}
78
70
  */
79
71
  searchByCategory(category, limit) {
80
- const val2 = +limit;
81
72
  const ptr0 = passStringToWasm0(category, wasm.__wbindgen_export, wasm.__wbindgen_export2);
82
73
  const len0 = WASM_VECTOR_LEN;
83
- const ret = wasm.reasoningbankwasm_searchByCategory(this.__wbg_ptr, ptr0, len0, val2);
84
- return ret;
74
+ const ret = wasm.reasoningbankwasm_searchByCategory(this.__wbg_ptr, ptr0, len0, limit);
75
+ return takeObject(ret);
85
76
  }
86
77
  /**
87
78
  * Store a reasoning pattern
@@ -92,7 +83,7 @@ export class ReasoningBankWasm {
92
83
  const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
93
84
  const len0 = WASM_VECTOR_LEN;
94
85
  const ret = wasm.reasoningbankwasm_storePattern(this.__wbg_ptr, ptr0, len0);
95
- return ret;
86
+ return takeObject(ret);
96
87
  }
97
88
  }
98
89
  if (Symbol.dispose) ReasoningBankWasm.prototype[Symbol.dispose] = ReasoningBankWasm.prototype.free;
@@ -113,36 +104,32 @@ export function log(message) {
113
104
  const len0 = WASM_VECTOR_LEN;
114
105
  wasm.log(ptr0, len0);
115
106
  }
116
- export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
117
- const ret = Error(getStringFromWasm0(arg0, arg1));
118
- return ret;
119
- }
120
- export function __wbg___wbindgen_debug_string_f249a2a76caa9a55(arg0, arg1) {
121
- const ret = debugString(arg1);
107
+ export function __wbg___wbindgen_debug_string_07cb72cfcc952e2b(arg0, arg1) {
108
+ const ret = debugString(getObject(arg1));
122
109
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
123
110
  const len1 = WASM_VECTOR_LEN;
124
- getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
125
- getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
111
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
112
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
126
113
  }
127
- export function __wbg___wbindgen_is_function_741ff2bb612836f5(arg0) {
128
- const ret = typeof(arg0) === 'function';
114
+ export function __wbg___wbindgen_is_function_2f0fd7ceb86e64c5(arg0) {
115
+ const ret = typeof(getObject(arg0)) === 'function';
129
116
  return ret;
130
117
  }
131
- export function __wbg___wbindgen_is_undefined_be5b34249ff1fc15(arg0) {
132
- const ret = arg0 === undefined;
118
+ export function __wbg___wbindgen_is_undefined_244a92c34d3b6ec0(arg0) {
119
+ const ret = getObject(arg0) === undefined;
133
120
  return ret;
134
121
  }
135
- export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
122
+ export function __wbg___wbindgen_throw_9c75d47bf9e7731e(arg0, arg1) {
136
123
  throw new Error(getStringFromWasm0(arg0, arg1));
137
124
  }
138
- export function __wbg__wbg_cb_unref_09736879a3f67559(arg0) {
139
- arg0._wbg_cb_unref();
125
+ export function __wbg__wbg_cb_unref_158e43e869788cdc(arg0) {
126
+ getObject(arg0)._wbg_cb_unref();
140
127
  }
141
- export function __wbg_call_a410eb4b59ed5965() { return handleError(function (arg0, arg1, arg2) {
142
- const ret = arg0.call(arg1, arg2);
143
- return ret;
128
+ export function __wbg_call_a41d6421b30a32c5() { return handleError(function (arg0, arg1, arg2) {
129
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
130
+ return addHeapObject(ret);
144
131
  }, arguments); }
145
- export function __wbg_error_757e9472f8410341(arg0, arg1) {
132
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
146
133
  let deferred0_0;
147
134
  let deferred0_1;
148
135
  try {
@@ -150,207 +137,222 @@ export function __wbg_error_757e9472f8410341(arg0, arg1) {
150
137
  deferred0_1 = arg1;
151
138
  console.error(getStringFromWasm0(arg0, arg1));
152
139
  } finally {
153
- wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
140
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
154
141
  }
155
142
  }
156
- export function __wbg_getRandomValues_19b7c67932c07470() { return handleError(function (arg0, arg1) {
143
+ export function __wbg_getRandomValues_ef12552bf5acd2fe() { return handleError(function (arg0, arg1) {
157
144
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
158
145
  }, arguments); }
159
- export function __wbg_get_2080c49015e35254() { return handleError(function (arg0, arg1) {
160
- const ret = Reflect.get(arg0, arg1);
161
- return ret;
146
+ export function __wbg_get_41476db20fef99a8() { return handleError(function (arg0, arg1) {
147
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
148
+ return addHeapObject(ret);
162
149
  }, arguments); }
163
- export function __wbg_indexedDB_26307da63b55488b() { return handleError(function (arg0) {
164
- const ret = arg0.indexedDB;
165
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
150
+ export function __wbg_indexedDB_06cbacc078ae71b2() { return handleError(function (arg0) {
151
+ const ret = getObject(arg0).indexedDB;
152
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
166
153
  }, arguments); }
167
- export function __wbg_instanceof_Window_5cf453f5639aa1a2(arg0) {
154
+ export function __wbg_instanceof_Window_4153c1818a1c0c0b(arg0) {
168
155
  let result;
169
156
  try {
170
- result = arg0 instanceof Window;
157
+ result = getObject(arg0) instanceof Window;
171
158
  } catch (_) {
172
159
  result = false;
173
160
  }
174
161
  const ret = result;
175
162
  return ret;
176
163
  }
177
- export function __wbg_log_ff86bbb34c295e21(arg0) {
178
- console.log(arg0);
164
+ export function __wbg_log_72d22df918dcc232(arg0) {
165
+ console.log(getObject(arg0));
179
166
  }
180
- export function __wbg_new_bb74001155cb8ca8() {
167
+ export function __wbg_new_227d7c05414eb861() {
181
168
  const ret = new Error();
182
- return ret;
169
+ return addHeapObject(ret);
183
170
  }
184
- export function __wbg_new_typed_e09da9dae6ee5935(arg0, arg1) {
171
+ export function __wbg_new_typed_1137602701dc87d4(arg0, arg1) {
185
172
  try {
186
173
  var state0 = {a: arg0, b: arg1};
187
174
  var cb0 = (arg0, arg1) => {
188
175
  const a = state0.a;
189
176
  state0.a = 0;
190
177
  try {
191
- return __wasm_bindgen_func_elem_364(a, state0.b, arg0, arg1);
178
+ return __wasm_bindgen_func_elem_352(a, state0.b, arg0, arg1);
192
179
  } finally {
193
180
  state0.a = a;
194
181
  }
195
182
  };
196
183
  const ret = new Promise(cb0);
197
- return ret;
184
+ return addHeapObject(ret);
198
185
  } finally {
199
186
  state0.a = 0;
200
187
  }
201
188
  }
202
- export function __wbg_open_0b7832f51fde5a5f() { return handleError(function (arg0, arg1, arg2, arg3) {
203
- const ret = arg0.open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
204
- return ret;
189
+ export function __wbg_open_5a9e43bc5e42b3c5() { return handleError(function (arg0, arg1, arg2, arg3) {
190
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
191
+ return addHeapObject(ret);
205
192
  }, arguments); }
206
- export function __wbg_queueMicrotask_1e8503a8a690f0a3(arg0) {
207
- const ret = arg0.queueMicrotask;
208
- return ret;
193
+ export function __wbg_queueMicrotask_40ac6ffc2848ba77(arg0) {
194
+ queueMicrotask(getObject(arg0));
209
195
  }
210
- export function __wbg_queueMicrotask_4a1a4d8dd332373b(arg0) {
211
- queueMicrotask(arg0);
196
+ export function __wbg_queueMicrotask_74d092439f6494c1(arg0) {
197
+ const ret = getObject(arg0).queueMicrotask;
198
+ return addHeapObject(ret);
212
199
  }
213
200
  export function __wbg_reasoningbankwasm_new(arg0) {
214
201
  const ret = ReasoningBankWasm.__wrap(arg0);
215
- return ret;
202
+ return addHeapObject(ret);
216
203
  }
217
- export function __wbg_resolve_dbf78ab4942478b0(arg0) {
218
- const ret = Promise.resolve(arg0);
219
- return ret;
204
+ export function __wbg_resolve_9feb5d906ca62419(arg0) {
205
+ const ret = Promise.resolve(getObject(arg0));
206
+ return addHeapObject(ret);
220
207
  }
221
- export function __wbg_stack_575c4e0918581b9c(arg0, arg1) {
222
- const ret = arg1.stack;
208
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
209
+ const ret = getObject(arg1).stack;
223
210
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
224
211
  const len1 = WASM_VECTOR_LEN;
225
- getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
226
- getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
212
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
213
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
227
214
  }
228
- export function __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc() {
229
- const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
230
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
215
+ export function __wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb() {
216
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
217
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
231
218
  }
232
- export function __wbg_static_accessor_GLOBAL_e4293fb22cbe77da() {
233
- const ret = typeof global === 'undefined' ? undefined : global;
234
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
219
+ export function __wbg_static_accessor_GLOBAL_e039bc914f83e74e() {
220
+ const ret = typeof global === 'undefined' ? null : global;
221
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
235
222
  }
236
- export function __wbg_static_accessor_SELF_53bb20457401453d() {
237
- const ret = typeof self === 'undefined' ? undefined : self;
238
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
223
+ export function __wbg_static_accessor_SELF_8bf8c48c28420ad5() {
224
+ const ret = typeof self === 'undefined' ? null : self;
225
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
239
226
  }
240
- export function __wbg_static_accessor_WINDOW_b5e0810bfecb7feb() {
241
- const ret = typeof window === 'undefined' ? undefined : window;
242
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
227
+ export function __wbg_static_accessor_WINDOW_6aeee9b51652ee0f() {
228
+ const ret = typeof window === 'undefined' ? null : window;
229
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
243
230
  }
244
- export function __wbg_then_e3f7f2d365708be8(arg0, arg1) {
245
- const ret = arg0.then(arg1);
246
- return ret;
231
+ export function __wbg_then_20a157d939b514f5(arg0, arg1) {
232
+ const ret = getObject(arg0).then(getObject(arg1));
233
+ return addHeapObject(ret);
247
234
  }
248
- export function __wbindgen_generic_0000000000000001(arg0, arg1) {
235
+ export function __wbindgen_cast_0000000000000001(arg0, arg1) {
249
236
  // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 95, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
250
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_349);
251
- return ret;
237
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_346);
238
+ return addHeapObject(ret);
252
239
  }
253
- export function __wbindgen_generic_0000000000000002(arg0, arg1) {
240
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
254
241
  // Cast intrinsic for `Ref(String) -> Externref`.
255
242
  const ret = getStringFromWasm0(arg0, arg1);
256
- return ret;
243
+ return addHeapObject(ret);
257
244
  }
258
- export function __wbindgen_init_externref_table() {
259
- const table = wasm.__wbindgen_externrefs;
260
- table.set(0, undefined);
261
- table.set(1024, undefined);
262
- table.set(1025, null);
263
- table.set(1026, true);
264
- table.set(1027, false);
245
+ export function __wbindgen_object_clone_ref(arg0) {
246
+ const ret = getObject(arg0);
247
+ return addHeapObject(ret);
265
248
  }
266
- function __wasm_bindgen_func_elem_364(arg0, arg1, arg2, arg3) {
267
- wasm.__wasm_bindgen_func_elem_364(arg0, arg1, arg2, arg3);
249
+ export function __wbindgen_object_drop_ref(arg0) {
250
+ takeObject(arg0);
268
251
  }
269
-
270
- function __wasm_bindgen_func_elem_349(arg0, arg1, arg2) {
252
+ function __wasm_bindgen_func_elem_346(arg0, arg1, arg2) {
271
253
  try {
272
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
273
- wasm.__wasm_bindgen_func_elem_349(retptr, arg0, arg1, arg2);
254
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
255
+ wasm.__wasm_bindgen_func_elem_346(retptr, arg0, arg1, addHeapObject(arg2));
274
256
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
275
257
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
276
258
  if (r1) {
277
- throw takeFromExternrefTable0(r0);
259
+ throw takeObject(r0);
278
260
  }
279
261
  } finally {
280
262
  wasm.__wbindgen_add_to_stack_pointer(16);
281
263
  }
282
264
  }
283
265
 
266
+ function __wasm_bindgen_func_elem_352(arg0, arg1, arg2, arg3) {
267
+ wasm.__wasm_bindgen_func_elem_352(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
268
+ }
269
+
284
270
  const ReasoningBankWasmFinalization = (typeof FinalizationRegistry === 'undefined')
285
271
  ? { register: () => {}, unregister: () => {} }
286
272
  : new FinalizationRegistry(ptr => wasm.__wbg_reasoningbankwasm_free(ptr, 1));
287
273
 
288
- function addToExternrefTable0(obj) {
289
- const idx = wasm.__wbindgen_export5();
290
- wasm.__wbindgen_externrefs.set(idx, obj);
274
+ function addHeapObject(obj) {
275
+ if (heap_next === heap.length) heap.push(heap.length + 1);
276
+ const idx = heap_next;
277
+ heap_next = heap[idx];
278
+
279
+ heap[idx] = obj;
291
280
  return idx;
292
281
  }
293
282
 
294
283
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
295
284
  ? { register: () => {}, unregister: () => {} }
296
- : new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
285
+ : new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
297
286
 
298
287
  function debugString(val) {
299
- switch (typeof val) {
300
- // primitive types
301
- case 'number':
302
- case 'boolean':
303
- case 'undefined':
304
- return `${val}`;
305
- case 'string':
306
- return JSON.stringify(val);
307
- case 'bigint':
308
- return `${val}n`;
309
- case 'symbol':
310
- return val.description !== undefined
311
- ? `Symbol(${val.description})`
312
- : 'Symbol';
313
- case 'function':
314
- return typeof val.name === 'string' && val.name !== ''
315
- ? `Function(${val.name})`
316
- : 'Function';
317
- case 'object': {
318
- if (val === null) {
319
- return 'null';
320
- }
321
- // objects
322
- if (Array.isArray(val)) {
323
- return '[' + Array.from(val, debugString).join(', ') + ']';
324
- }
325
- // errors
326
- if (val instanceof Error) {
327
- return `${val.name}: ${val.message}\n${val.stack}`;
328
- }
329
-
330
- const toStringOutput = toString.call(val);
331
- // Test for built-in
332
- const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
333
-
334
- // Failed to match the standard '[object ClassName]'
335
- if (className === undefined) {
336
- return toStringOutput;
337
- }
338
- if (className === 'Object') {
339
- // we're a user defined class or Object
340
- // JSON.stringify avoids problems with cycles, and is generally much
341
- // easier than looping through ownProperties of `val`.
342
- try {
343
- return 'Object(' + JSON.stringify(val) + ')';
344
- } catch (_) {
345
- return 'Object';
346
- }
347
- }
348
- // TODO we could test for more things here, like `Set`s and `Map`s.
349
- return className;
288
+ // primitive types
289
+ const type = typeof val;
290
+ if (type == 'number' || type == 'boolean' || val == null) {
291
+ return `${val}`;
292
+ }
293
+ if (type == 'string') {
294
+ return `"${val}"`;
295
+ }
296
+ if (type == 'symbol') {
297
+ const description = val.description;
298
+ if (description == null) {
299
+ return 'Symbol';
300
+ } else {
301
+ return `Symbol(${description})`;
302
+ }
303
+ }
304
+ if (type == 'function') {
305
+ const name = val.name;
306
+ if (typeof name == 'string' && name.length > 0) {
307
+ return `Function(${name})`;
308
+ } else {
309
+ return 'Function';
310
+ }
311
+ }
312
+ // objects
313
+ if (Array.isArray(val)) {
314
+ const length = val.length;
315
+ let debug = '[';
316
+ if (length > 0) {
317
+ debug += debugString(val[0]);
318
+ }
319
+ for(let i = 1; i < length; i++) {
320
+ debug += ', ' + debugString(val[i]);
321
+ }
322
+ debug += ']';
323
+ return debug;
324
+ }
325
+ // Test for built-in
326
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
327
+ let className;
328
+ if (builtInMatches && builtInMatches.length > 1) {
329
+ className = builtInMatches[1];
330
+ } else {
331
+ // Failed to match the standard '[object ClassName]'
332
+ return toString.call(val);
333
+ }
334
+ if (className == 'Object') {
335
+ // we're a user defined class or Object
336
+ // JSON.stringify avoids problems with cycles, and is generally much
337
+ // easier than looping through ownProperties of `val`.
338
+ try {
339
+ return 'Object(' + JSON.stringify(val) + ')';
340
+ } catch (_) {
341
+ return 'Object';
350
342
  }
351
- // Per MDN: 'This list of values is exhaustive.'
352
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
353
343
  }
344
+ // errors
345
+ if (val instanceof Error) {
346
+ return `${val.name}: ${val.message}\n${val.stack}`;
347
+ }
348
+ // TODO we could test for more things here, like `Set`s and `Map`s.
349
+ return className;
350
+ }
351
+
352
+ function dropObject(idx) {
353
+ if (idx < 1028) return;
354
+ heap[idx] = heap_next;
355
+ heap_next = idx;
354
356
  }
355
357
 
356
358
  function getArrayU8FromWasm0(ptr, len) {
@@ -367,8 +369,7 @@ function getDataViewMemory0() {
367
369
  }
368
370
 
369
371
  function getStringFromWasm0(ptr, len) {
370
- ptr = ptr >>> 0;
371
- return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
372
+ return decodeText(ptr >>> 0, len);
372
373
  }
373
374
 
374
375
  let cachedUint8ArrayMemory0 = null;
@@ -379,15 +380,21 @@ function getUint8ArrayMemory0() {
379
380
  return cachedUint8ArrayMemory0;
380
381
  }
381
382
 
383
+ function getObject(idx) { return heap[idx]; }
384
+
382
385
  function handleError(f, args) {
383
386
  try {
384
387
  return f.apply(this, args);
385
388
  } catch (e) {
386
- const idx = addToExternrefTable0(e);
387
- wasm.__wbindgen_export4(idx);
389
+ wasm.__wbindgen_export3(addHeapObject(e));
388
390
  }
389
391
  }
390
392
 
393
+ let heap = new Array(1024).fill(undefined);
394
+ heap.push(undefined, null, true, false);
395
+
396
+ let heap_next = heap.length;
397
+
391
398
  function isLikeNone(x) {
392
399
  return x === undefined || x === null;
393
400
  }
@@ -411,7 +418,7 @@ function makeMutClosure(arg0, arg1, f) {
411
418
  };
412
419
  real._wbg_cb_unref = () => {
413
420
  if (--state.cnt === 0) {
414
- wasm.__wbindgen_export6(state.a, state.b);
421
+ wasm.__wbindgen_export5(state.a, state.b);
415
422
  state.a = 0;
416
423
  CLOSURE_DTORS.unregister(state);
417
424
  }
@@ -457,24 +464,24 @@ function passStringToWasm0(arg, malloc, realloc) {
457
464
  return ptr;
458
465
  }
459
466
 
460
- function takeFromExternrefTable0(idx) {
461
- const value = wasm.__wbindgen_externrefs.get(idx);
462
- wasm.__wbindgen_export7(idx);
463
- return value;
467
+ function takeObject(idx) {
468
+ const ret = getObject(idx);
469
+ dropObject(idx);
470
+ return ret;
464
471
  }
465
472
 
466
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
473
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
467
474
  cachedTextDecoder.decode();
468
475
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
469
476
  let numBytesDecoded = 0;
470
- function decodeText(bytes) {
471
- numBytesDecoded += bytes.length;
477
+ function decodeText(ptr, len) {
478
+ numBytesDecoded += len;
472
479
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
473
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
480
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
474
481
  cachedTextDecoder.decode();
475
- numBytesDecoded = bytes.length;
482
+ numBytesDecoded = len;
476
483
  }
477
- return cachedTextDecoder.decode(bytes);
484
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
478
485
  }
479
486
 
480
487
  const cachedTextEncoder = new TextEncoder();
@@ -2,23 +2,20 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_reasoningbankwasm_free: (a: number, b: number) => void;
5
- export const init: () => void;
6
5
  export const log: (a: number, b: number) => void;
7
- export const reasoningbankwasm_findSimilar: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
8
- export const reasoningbankwasm_getPattern: (a: number, b: number, c: number) => any;
9
- export const reasoningbankwasm_getStats: (a: number) => any;
10
- export const reasoningbankwasm_new: (a: number, b: number) => any;
11
- export const reasoningbankwasm_searchByCategory: (a: number, b: number, c: number, d: number) => any;
12
- export const reasoningbankwasm_storePattern: (a: number, b: number, c: number) => any;
13
- export const __wasm_bindgen_func_elem_349: (a: number, b: number, c: number, d: any) => void;
14
- export const __wasm_bindgen_func_elem_364: (a: number, b: number, c: any, d: any) => void;
6
+ export const reasoningbankwasm_findSimilar: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
7
+ export const reasoningbankwasm_getPattern: (a: number, b: number, c: number) => number;
8
+ export const reasoningbankwasm_getStats: (a: number) => number;
9
+ export const reasoningbankwasm_new: (a: number, b: number) => number;
10
+ export const reasoningbankwasm_searchByCategory: (a: number, b: number, c: number, d: number) => number;
11
+ export const reasoningbankwasm_storePattern: (a: number, b: number, c: number) => number;
12
+ export const init: () => void;
13
+ export const __wasm_bindgen_func_elem_346: (a: number, b: number, c: number, d: number) => void;
14
+ export const __wasm_bindgen_func_elem_352: (a: number, b: number, c: number, d: number) => void;
15
15
  export const __wbindgen_export: (a: number, b: number) => number;
16
16
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
17
- export const __wbindgen_export3: (a: number, b: number, c: number) => void;
18
- export const __wbindgen_export4: (a: number) => void;
19
- export const __wbindgen_export5: () => number;
20
- export const __wbindgen_externrefs: WebAssembly.Table;
21
- export const __wbindgen_export6: (a: number, b: number) => void;
17
+ export const __wbindgen_export3: (a: number) => void;
18
+ export const __wbindgen_export4: (a: number, b: number, c: number) => void;
19
+ export const __wbindgen_export5: (a: number, b: number) => void;
22
20
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
23
- export const __wbindgen_export7: (a: number) => void;
24
21
  export const __wbindgen_start: () => void;