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.
- package/CHANGELOG.md +18 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/config/claudeFlow.d.ts +1 -1
- package/dist/core/agentdb-fast.d.ts +9 -0
- package/dist/core/agentdb-fast.d.ts.map +1 -1
- package/dist/core/agentdb-fast.js +62 -31
- package/dist/core/agentdb-fast.js.map +1 -1
- package/dist/core/agentdb-filtered-search.d.ts +54 -0
- package/dist/core/agentdb-filtered-search.d.ts.map +1 -0
- package/dist/core/agentdb-filtered-search.js +111 -0
- package/dist/core/agentdb-filtered-search.js.map +1 -0
- package/dist/optimizations/configuration-tuning.d.ts +1 -1
- package/dist/services/agentdb-service.d.ts +17 -0
- package/dist/services/agentdb-service.d.ts.map +1 -1
- package/dist/services/agentdb-service.js +55 -4
- package/dist/services/agentdb-service.js.map +1 -1
- package/package.json +5 -5
- package/wasm/reasoningbank/reasoningbank_wasm_bg.js +186 -179
- package/wasm/reasoningbank/reasoningbank_wasm_bg.wasm +0 -0
- package/wasm/reasoningbank/reasoningbank_wasm_bg.wasm.d.ts +12 -15
|
@@ -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
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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,
|
|
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
|
|
117
|
-
const ret =
|
|
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(
|
|
125
|
-
getDataViewMemory0().setInt32(
|
|
111
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
112
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
126
113
|
}
|
|
127
|
-
export function
|
|
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
|
|
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
|
|
122
|
+
export function __wbg___wbindgen_throw_9c75d47bf9e7731e(arg0, arg1) {
|
|
136
123
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
137
124
|
}
|
|
138
|
-
export function
|
|
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
|
|
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
|
|
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.
|
|
140
|
+
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
154
141
|
}
|
|
155
142
|
}
|
|
156
|
-
export function
|
|
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
|
|
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
|
|
164
|
-
const ret = arg0.indexedDB;
|
|
165
|
-
return isLikeNone(ret) ? 0 :
|
|
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
|
|
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
|
|
178
|
-
console.log(arg0);
|
|
164
|
+
export function __wbg_log_72d22df918dcc232(arg0) {
|
|
165
|
+
console.log(getObject(arg0));
|
|
179
166
|
}
|
|
180
|
-
export function
|
|
167
|
+
export function __wbg_new_227d7c05414eb861() {
|
|
181
168
|
const ret = new Error();
|
|
182
|
-
return ret;
|
|
169
|
+
return addHeapObject(ret);
|
|
183
170
|
}
|
|
184
|
-
export function
|
|
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
|
|
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
|
|
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
|
|
207
|
-
|
|
208
|
-
return ret;
|
|
193
|
+
export function __wbg_queueMicrotask_40ac6ffc2848ba77(arg0) {
|
|
194
|
+
queueMicrotask(getObject(arg0));
|
|
209
195
|
}
|
|
210
|
-
export function
|
|
211
|
-
|
|
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
|
|
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
|
|
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(
|
|
226
|
-
getDataViewMemory0().setInt32(
|
|
212
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
213
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
227
214
|
}
|
|
228
|
-
export function
|
|
229
|
-
const ret = typeof globalThis === 'undefined' ?
|
|
230
|
-
return isLikeNone(ret) ? 0 :
|
|
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
|
|
233
|
-
const ret = typeof global === 'undefined' ?
|
|
234
|
-
return isLikeNone(ret) ? 0 :
|
|
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
|
|
237
|
-
const ret = typeof self === 'undefined' ?
|
|
238
|
-
return isLikeNone(ret) ? 0 :
|
|
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
|
|
241
|
-
const ret = typeof window === 'undefined' ?
|
|
242
|
-
return isLikeNone(ret) ? 0 :
|
|
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
|
|
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
|
|
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,
|
|
251
|
-
return ret;
|
|
237
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_346);
|
|
238
|
+
return addHeapObject(ret);
|
|
252
239
|
}
|
|
253
|
-
export function
|
|
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
|
|
259
|
-
const
|
|
260
|
-
|
|
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
|
|
267
|
-
|
|
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)
|
|
273
|
-
wasm.
|
|
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
|
|
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
|
|
289
|
-
|
|
290
|
-
|
|
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.
|
|
285
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
|
|
297
286
|
|
|
298
287
|
function debugString(val) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
return
|
|
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(
|
|
471
|
-
numBytesDecoded +=
|
|
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 =
|
|
482
|
+
numBytesDecoded = len;
|
|
476
483
|
}
|
|
477
|
-
return cachedTextDecoder.decode(
|
|
484
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
478
485
|
}
|
|
479
486
|
|
|
480
487
|
const cachedTextEncoder = new TextEncoder();
|
|
Binary file
|
|
@@ -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) =>
|
|
8
|
-
export const reasoningbankwasm_getPattern: (a: number, b: number, c: number) =>
|
|
9
|
-
export const reasoningbankwasm_getStats: (a: number) =>
|
|
10
|
-
export const reasoningbankwasm_new: (a: number, b: number) =>
|
|
11
|
-
export const reasoningbankwasm_searchByCategory: (a: number, b: number, c: number, d: number) =>
|
|
12
|
-
export const reasoningbankwasm_storePattern: (a: number, b: number, c: number) =>
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
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
|
|
18
|
-
export const __wbindgen_export4: (a: number) => void;
|
|
19
|
-
export const __wbindgen_export5: () =>
|
|
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;
|