agentic-flow 3.3.1 → 3.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.
@@ -26,12 +26,20 @@ export class ReasoningBankWasm {
26
26
  * @returns {Promise<string>}
27
27
  */
28
28
  findSimilar(task_description, task_category, top_k) {
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);
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;
35
43
  }
36
44
  /**
37
45
  * Retrieve a pattern by ID
@@ -42,7 +50,7 @@ export class ReasoningBankWasm {
42
50
  const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
43
51
  const len0 = WASM_VECTOR_LEN;
44
52
  const ret = wasm.reasoningbankwasm_getPattern(this.__wbg_ptr, ptr0, len0);
45
- return takeObject(ret);
53
+ return ret;
46
54
  }
47
55
  /**
48
56
  * Get storage statistics
@@ -50,7 +58,7 @@ export class ReasoningBankWasm {
50
58
  */
51
59
  getStats() {
52
60
  const ret = wasm.reasoningbankwasm_getStats(this.__wbg_ptr);
53
- return takeObject(ret);
61
+ return ret;
54
62
  }
55
63
  /**
56
64
  * Create a new ReasoningBank instance
@@ -60,7 +68,7 @@ export class ReasoningBankWasm {
60
68
  var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
61
69
  var len0 = WASM_VECTOR_LEN;
62
70
  const ret = wasm.reasoningbankwasm_new(ptr0, len0);
63
- return takeObject(ret);
71
+ return ret;
64
72
  }
65
73
  /**
66
74
  * Search patterns by category
@@ -69,10 +77,11 @@ export class ReasoningBankWasm {
69
77
  * @returns {Promise<string>}
70
78
  */
71
79
  searchByCategory(category, limit) {
80
+ const val2 = +limit;
72
81
  const ptr0 = passStringToWasm0(category, wasm.__wbindgen_export, wasm.__wbindgen_export2);
73
82
  const len0 = WASM_VECTOR_LEN;
74
- const ret = wasm.reasoningbankwasm_searchByCategory(this.__wbg_ptr, ptr0, len0, limit);
75
- return takeObject(ret);
83
+ const ret = wasm.reasoningbankwasm_searchByCategory(this.__wbg_ptr, ptr0, len0, val2);
84
+ return ret;
76
85
  }
77
86
  /**
78
87
  * Store a reasoning pattern
@@ -83,7 +92,7 @@ export class ReasoningBankWasm {
83
92
  const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
84
93
  const len0 = WASM_VECTOR_LEN;
85
94
  const ret = wasm.reasoningbankwasm_storePattern(this.__wbg_ptr, ptr0, len0);
86
- return takeObject(ret);
95
+ return ret;
87
96
  }
88
97
  }
89
98
  if (Symbol.dispose) ReasoningBankWasm.prototype[Symbol.dispose] = ReasoningBankWasm.prototype.free;
@@ -104,32 +113,36 @@ export function log(message) {
104
113
  const len0 = WASM_VECTOR_LEN;
105
114
  wasm.log(ptr0, len0);
106
115
  }
107
- export function __wbg___wbindgen_debug_string_07cb72cfcc952e2b(arg0, arg1) {
108
- const ret = debugString(getObject(arg1));
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);
109
122
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
110
123
  const len1 = WASM_VECTOR_LEN;
111
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
112
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
124
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
125
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
113
126
  }
114
- export function __wbg___wbindgen_is_function_2f0fd7ceb86e64c5(arg0) {
115
- const ret = typeof(getObject(arg0)) === 'function';
127
+ export function __wbg___wbindgen_is_function_741ff2bb612836f5(arg0) {
128
+ const ret = typeof(arg0) === 'function';
116
129
  return ret;
117
130
  }
118
- export function __wbg___wbindgen_is_undefined_244a92c34d3b6ec0(arg0) {
119
- const ret = getObject(arg0) === undefined;
131
+ export function __wbg___wbindgen_is_undefined_be5b34249ff1fc15(arg0) {
132
+ const ret = arg0 === undefined;
120
133
  return ret;
121
134
  }
122
- export function __wbg___wbindgen_throw_9c75d47bf9e7731e(arg0, arg1) {
135
+ export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
123
136
  throw new Error(getStringFromWasm0(arg0, arg1));
124
137
  }
125
- export function __wbg__wbg_cb_unref_158e43e869788cdc(arg0) {
126
- getObject(arg0)._wbg_cb_unref();
138
+ export function __wbg__wbg_cb_unref_09736879a3f67559(arg0) {
139
+ arg0._wbg_cb_unref();
127
140
  }
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);
141
+ export function __wbg_call_a410eb4b59ed5965() { return handleError(function (arg0, arg1, arg2) {
142
+ const ret = arg0.call(arg1, arg2);
143
+ return ret;
131
144
  }, arguments); }
132
- export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
145
+ export function __wbg_error_757e9472f8410341(arg0, arg1) {
133
146
  let deferred0_0;
134
147
  let deferred0_1;
135
148
  try {
@@ -137,222 +150,207 @@ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
137
150
  deferred0_1 = arg1;
138
151
  console.error(getStringFromWasm0(arg0, arg1));
139
152
  } finally {
140
- wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
153
+ wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
141
154
  }
142
155
  }
143
- export function __wbg_getRandomValues_ef12552bf5acd2fe() { return handleError(function (arg0, arg1) {
156
+ export function __wbg_getRandomValues_19b7c67932c07470() { return handleError(function (arg0, arg1) {
144
157
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
145
158
  }, arguments); }
146
- export function __wbg_get_41476db20fef99a8() { return handleError(function (arg0, arg1) {
147
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
148
- return addHeapObject(ret);
159
+ export function __wbg_get_2080c49015e35254() { return handleError(function (arg0, arg1) {
160
+ const ret = Reflect.get(arg0, arg1);
161
+ return ret;
149
162
  }, arguments); }
150
- export function __wbg_indexedDB_06cbacc078ae71b2() { return handleError(function (arg0) {
151
- const ret = getObject(arg0).indexedDB;
152
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
163
+ export function __wbg_indexedDB_26307da63b55488b() { return handleError(function (arg0) {
164
+ const ret = arg0.indexedDB;
165
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
153
166
  }, arguments); }
154
- export function __wbg_instanceof_Window_4153c1818a1c0c0b(arg0) {
167
+ export function __wbg_instanceof_Window_5cf453f5639aa1a2(arg0) {
155
168
  let result;
156
169
  try {
157
- result = getObject(arg0) instanceof Window;
170
+ result = arg0 instanceof Window;
158
171
  } catch (_) {
159
172
  result = false;
160
173
  }
161
174
  const ret = result;
162
175
  return ret;
163
176
  }
164
- export function __wbg_log_72d22df918dcc232(arg0) {
165
- console.log(getObject(arg0));
177
+ export function __wbg_log_ff86bbb34c295e21(arg0) {
178
+ console.log(arg0);
166
179
  }
167
- export function __wbg_new_227d7c05414eb861() {
180
+ export function __wbg_new_bb74001155cb8ca8() {
168
181
  const ret = new Error();
169
- return addHeapObject(ret);
182
+ return ret;
170
183
  }
171
- export function __wbg_new_typed_1137602701dc87d4(arg0, arg1) {
184
+ export function __wbg_new_typed_e09da9dae6ee5935(arg0, arg1) {
172
185
  try {
173
186
  var state0 = {a: arg0, b: arg1};
174
187
  var cb0 = (arg0, arg1) => {
175
188
  const a = state0.a;
176
189
  state0.a = 0;
177
190
  try {
178
- return __wasm_bindgen_func_elem_352(a, state0.b, arg0, arg1);
191
+ return __wasm_bindgen_func_elem_364(a, state0.b, arg0, arg1);
179
192
  } finally {
180
193
  state0.a = a;
181
194
  }
182
195
  };
183
196
  const ret = new Promise(cb0);
184
- return addHeapObject(ret);
197
+ return ret;
185
198
  } finally {
186
199
  state0.a = 0;
187
200
  }
188
201
  }
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);
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;
192
205
  }, arguments); }
193
- export function __wbg_queueMicrotask_40ac6ffc2848ba77(arg0) {
194
- queueMicrotask(getObject(arg0));
206
+ export function __wbg_queueMicrotask_1e8503a8a690f0a3(arg0) {
207
+ const ret = arg0.queueMicrotask;
208
+ return ret;
195
209
  }
196
- export function __wbg_queueMicrotask_74d092439f6494c1(arg0) {
197
- const ret = getObject(arg0).queueMicrotask;
198
- return addHeapObject(ret);
210
+ export function __wbg_queueMicrotask_4a1a4d8dd332373b(arg0) {
211
+ queueMicrotask(arg0);
199
212
  }
200
213
  export function __wbg_reasoningbankwasm_new(arg0) {
201
214
  const ret = ReasoningBankWasm.__wrap(arg0);
202
- return addHeapObject(ret);
215
+ return ret;
203
216
  }
204
- export function __wbg_resolve_9feb5d906ca62419(arg0) {
205
- const ret = Promise.resolve(getObject(arg0));
206
- return addHeapObject(ret);
217
+ export function __wbg_resolve_dbf78ab4942478b0(arg0) {
218
+ const ret = Promise.resolve(arg0);
219
+ return ret;
207
220
  }
208
- export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
209
- const ret = getObject(arg1).stack;
221
+ export function __wbg_stack_575c4e0918581b9c(arg0, arg1) {
222
+ const ret = arg1.stack;
210
223
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
211
224
  const len1 = WASM_VECTOR_LEN;
212
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
213
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
225
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
226
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
214
227
  }
215
- export function __wbg_static_accessor_GLOBAL_THIS_1c7f1bd6c6941fdb() {
216
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
217
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
228
+ export function __wbg_static_accessor_GLOBAL_THIS_003ee833af9699fc() {
229
+ const ret = typeof globalThis === 'undefined' ? undefined : globalThis;
230
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
218
231
  }
219
- export function __wbg_static_accessor_GLOBAL_e039bc914f83e74e() {
220
- const ret = typeof global === 'undefined' ? null : global;
221
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
232
+ export function __wbg_static_accessor_GLOBAL_e4293fb22cbe77da() {
233
+ const ret = typeof global === 'undefined' ? undefined : global;
234
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
222
235
  }
223
- export function __wbg_static_accessor_SELF_8bf8c48c28420ad5() {
224
- const ret = typeof self === 'undefined' ? null : self;
225
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
236
+ export function __wbg_static_accessor_SELF_53bb20457401453d() {
237
+ const ret = typeof self === 'undefined' ? undefined : self;
238
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
226
239
  }
227
- export function __wbg_static_accessor_WINDOW_6aeee9b51652ee0f() {
228
- const ret = typeof window === 'undefined' ? null : window;
229
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
240
+ export function __wbg_static_accessor_WINDOW_b5e0810bfecb7feb() {
241
+ const ret = typeof window === 'undefined' ? undefined : window;
242
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
230
243
  }
231
- export function __wbg_then_20a157d939b514f5(arg0, arg1) {
232
- const ret = getObject(arg0).then(getObject(arg1));
233
- return addHeapObject(ret);
244
+ export function __wbg_then_e3f7f2d365708be8(arg0, arg1) {
245
+ const ret = arg0.then(arg1);
246
+ return ret;
234
247
  }
235
- export function __wbindgen_cast_0000000000000001(arg0, arg1) {
248
+ export function __wbindgen_generic_0000000000000001(arg0, arg1) {
236
249
  // 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`.
237
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_346);
238
- return addHeapObject(ret);
250
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_349);
251
+ return ret;
239
252
  }
240
- export function __wbindgen_cast_0000000000000002(arg0, arg1) {
253
+ export function __wbindgen_generic_0000000000000002(arg0, arg1) {
241
254
  // Cast intrinsic for `Ref(String) -> Externref`.
242
255
  const ret = getStringFromWasm0(arg0, arg1);
243
- return addHeapObject(ret);
256
+ return ret;
244
257
  }
245
- export function __wbindgen_object_clone_ref(arg0) {
246
- const ret = getObject(arg0);
247
- return addHeapObject(ret);
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);
248
265
  }
249
- export function __wbindgen_object_drop_ref(arg0) {
250
- takeObject(arg0);
266
+ function __wasm_bindgen_func_elem_364(arg0, arg1, arg2, arg3) {
267
+ wasm.__wasm_bindgen_func_elem_364(arg0, arg1, arg2, arg3);
251
268
  }
252
- function __wasm_bindgen_func_elem_346(arg0, arg1, arg2) {
269
+
270
+ function __wasm_bindgen_func_elem_349(arg0, arg1, arg2) {
253
271
  try {
254
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
255
- wasm.__wasm_bindgen_func_elem_346(retptr, arg0, arg1, addHeapObject(arg2));
272
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
273
+ wasm.__wasm_bindgen_func_elem_349(retptr, arg0, arg1, arg2);
256
274
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
257
275
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
258
276
  if (r1) {
259
- throw takeObject(r0);
277
+ throw takeFromExternrefTable0(r0);
260
278
  }
261
279
  } finally {
262
280
  wasm.__wbindgen_add_to_stack_pointer(16);
263
281
  }
264
282
  }
265
283
 
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
-
270
284
  const ReasoningBankWasmFinalization = (typeof FinalizationRegistry === 'undefined')
271
285
  ? { register: () => {}, unregister: () => {} }
272
286
  : new FinalizationRegistry(ptr => wasm.__wbg_reasoningbankwasm_free(ptr, 1));
273
287
 
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;
288
+ function addToExternrefTable0(obj) {
289
+ const idx = wasm.__wbindgen_export5();
290
+ wasm.__wbindgen_externrefs.set(idx, obj);
280
291
  return idx;
281
292
  }
282
293
 
283
294
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
284
295
  ? { register: () => {}, unregister: () => {} }
285
- : new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
296
+ : new FinalizationRegistry(state => wasm.__wbindgen_export6(state.a, state.b));
286
297
 
287
298
  function debugString(val) {
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';
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;
342
350
  }
351
+ // Per MDN: 'This list of values is exhaustive.'
352
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
343
353
  }
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;
356
354
  }
357
355
 
358
356
  function getArrayU8FromWasm0(ptr, len) {
@@ -369,7 +367,8 @@ function getDataViewMemory0() {
369
367
  }
370
368
 
371
369
  function getStringFromWasm0(ptr, len) {
372
- return decodeText(ptr >>> 0, len);
370
+ ptr = ptr >>> 0;
371
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
373
372
  }
374
373
 
375
374
  let cachedUint8ArrayMemory0 = null;
@@ -380,21 +379,15 @@ function getUint8ArrayMemory0() {
380
379
  return cachedUint8ArrayMemory0;
381
380
  }
382
381
 
383
- function getObject(idx) { return heap[idx]; }
384
-
385
382
  function handleError(f, args) {
386
383
  try {
387
384
  return f.apply(this, args);
388
385
  } catch (e) {
389
- wasm.__wbindgen_export3(addHeapObject(e));
386
+ const idx = addToExternrefTable0(e);
387
+ wasm.__wbindgen_export4(idx);
390
388
  }
391
389
  }
392
390
 
393
- let heap = new Array(1024).fill(undefined);
394
- heap.push(undefined, null, true, false);
395
-
396
- let heap_next = heap.length;
397
-
398
391
  function isLikeNone(x) {
399
392
  return x === undefined || x === null;
400
393
  }
@@ -418,7 +411,7 @@ function makeMutClosure(arg0, arg1, f) {
418
411
  };
419
412
  real._wbg_cb_unref = () => {
420
413
  if (--state.cnt === 0) {
421
- wasm.__wbindgen_export5(state.a, state.b);
414
+ wasm.__wbindgen_export6(state.a, state.b);
422
415
  state.a = 0;
423
416
  CLOSURE_DTORS.unregister(state);
424
417
  }
@@ -464,24 +457,24 @@ function passStringToWasm0(arg, malloc, realloc) {
464
457
  return ptr;
465
458
  }
466
459
 
467
- function takeObject(idx) {
468
- const ret = getObject(idx);
469
- dropObject(idx);
470
- return ret;
460
+ function takeFromExternrefTable0(idx) {
461
+ const value = wasm.__wbindgen_externrefs.get(idx);
462
+ wasm.__wbindgen_export7(idx);
463
+ return value;
471
464
  }
472
465
 
473
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
466
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
474
467
  cachedTextDecoder.decode();
475
468
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
476
469
  let numBytesDecoded = 0;
477
- function decodeText(ptr, len) {
478
- numBytesDecoded += len;
470
+ function decodeText(bytes) {
471
+ numBytesDecoded += bytes.length;
479
472
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
480
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
473
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
481
474
  cachedTextDecoder.decode();
482
- numBytesDecoded = len;
475
+ numBytesDecoded = bytes.length;
483
476
  }
484
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
477
+ return cachedTextDecoder.decode(bytes);
485
478
  }
486
479
 
487
480
  const cachedTextEncoder = new TextEncoder();
@@ -2,20 +2,23 @@
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 log: (a: number, b: number) => 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
5
  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;
6
+ 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;
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) => void;
18
- export const __wbindgen_export4: (a: number, b: number, c: number) => void;
19
- export const __wbindgen_export5: (a: number, b: number) => void;
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;
20
22
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
23
+ export const __wbindgen_export7: (a: number) => void;
21
24
  export const __wbindgen_start: () => void;