agentic-flow 1.5.11 → 1.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,555 @@
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
4
+ }
5
+
6
+
7
+ let heap = new Array(128).fill(undefined);
8
+
9
+ heap.push(undefined, null, true, false);
10
+
11
+ function getObject(idx) { return heap[idx]; }
12
+
13
+ let heap_next = heap.length;
14
+
15
+ function addHeapObject(obj) {
16
+ if (heap_next === heap.length) heap.push(heap.length + 1);
17
+ const idx = heap_next;
18
+ heap_next = heap[idx];
19
+
20
+ heap[idx] = obj;
21
+ return idx;
22
+ }
23
+
24
+ function handleError(f, args) {
25
+ try {
26
+ return f.apply(this, args);
27
+ } catch (e) {
28
+ wasm.__wbindgen_export_0(addHeapObject(e));
29
+ }
30
+ }
31
+
32
+ let cachedUint8ArrayMemory0 = null;
33
+
34
+ function getUint8ArrayMemory0() {
35
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
36
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
37
+ }
38
+ return cachedUint8ArrayMemory0;
39
+ }
40
+
41
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
42
+
43
+ cachedTextDecoder.decode();
44
+
45
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
46
+ let numBytesDecoded = 0;
47
+ function decodeText(ptr, len) {
48
+ numBytesDecoded += len;
49
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
50
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
51
+ cachedTextDecoder.decode();
52
+ numBytesDecoded = len;
53
+ }
54
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
55
+ }
56
+
57
+ function getStringFromWasm0(ptr, len) {
58
+ ptr = ptr >>> 0;
59
+ return decodeText(ptr, len);
60
+ }
61
+
62
+ function getArrayU8FromWasm0(ptr, len) {
63
+ ptr = ptr >>> 0;
64
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
65
+ }
66
+
67
+ function isLikeNone(x) {
68
+ return x === undefined || x === null;
69
+ }
70
+
71
+ let WASM_VECTOR_LEN = 0;
72
+
73
+ const cachedTextEncoder = new TextEncoder();
74
+
75
+ if (!('encodeInto' in cachedTextEncoder)) {
76
+ cachedTextEncoder.encodeInto = function (arg, view) {
77
+ const buf = cachedTextEncoder.encode(arg);
78
+ view.set(buf);
79
+ return {
80
+ read: arg.length,
81
+ written: buf.length
82
+ };
83
+ }
84
+ }
85
+
86
+ function passStringToWasm0(arg, malloc, realloc) {
87
+
88
+ if (realloc === undefined) {
89
+ const buf = cachedTextEncoder.encode(arg);
90
+ const ptr = malloc(buf.length, 1) >>> 0;
91
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
92
+ WASM_VECTOR_LEN = buf.length;
93
+ return ptr;
94
+ }
95
+
96
+ let len = arg.length;
97
+ let ptr = malloc(len, 1) >>> 0;
98
+
99
+ const mem = getUint8ArrayMemory0();
100
+
101
+ let offset = 0;
102
+
103
+ for (; offset < len; offset++) {
104
+ const code = arg.charCodeAt(offset);
105
+ if (code > 0x7F) break;
106
+ mem[ptr + offset] = code;
107
+ }
108
+
109
+ if (offset !== len) {
110
+ if (offset !== 0) {
111
+ arg = arg.slice(offset);
112
+ }
113
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
114
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
115
+ const ret = cachedTextEncoder.encodeInto(arg, view);
116
+
117
+ offset += ret.written;
118
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
119
+ }
120
+
121
+ WASM_VECTOR_LEN = offset;
122
+ return ptr;
123
+ }
124
+
125
+ let cachedDataViewMemory0 = null;
126
+
127
+ function getDataViewMemory0() {
128
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
129
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
130
+ }
131
+ return cachedDataViewMemory0;
132
+ }
133
+
134
+ function debugString(val) {
135
+ // primitive types
136
+ const type = typeof val;
137
+ if (type == 'number' || type == 'boolean' || val == null) {
138
+ return `${val}`;
139
+ }
140
+ if (type == 'string') {
141
+ return `"${val}"`;
142
+ }
143
+ if (type == 'symbol') {
144
+ const description = val.description;
145
+ if (description == null) {
146
+ return 'Symbol';
147
+ } else {
148
+ return `Symbol(${description})`;
149
+ }
150
+ }
151
+ if (type == 'function') {
152
+ const name = val.name;
153
+ if (typeof name == 'string' && name.length > 0) {
154
+ return `Function(${name})`;
155
+ } else {
156
+ return 'Function';
157
+ }
158
+ }
159
+ // objects
160
+ if (Array.isArray(val)) {
161
+ const length = val.length;
162
+ let debug = '[';
163
+ if (length > 0) {
164
+ debug += debugString(val[0]);
165
+ }
166
+ for(let i = 1; i < length; i++) {
167
+ debug += ', ' + debugString(val[i]);
168
+ }
169
+ debug += ']';
170
+ return debug;
171
+ }
172
+ // Test for built-in
173
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
174
+ let className;
175
+ if (builtInMatches && builtInMatches.length > 1) {
176
+ className = builtInMatches[1];
177
+ } else {
178
+ // Failed to match the standard '[object ClassName]'
179
+ return toString.call(val);
180
+ }
181
+ if (className == 'Object') {
182
+ // we're a user defined class or Object
183
+ // JSON.stringify avoids problems with cycles, and is generally much
184
+ // easier than looping through ownProperties of `val`.
185
+ try {
186
+ return 'Object(' + JSON.stringify(val) + ')';
187
+ } catch (_) {
188
+ return 'Object';
189
+ }
190
+ }
191
+ // errors
192
+ if (val instanceof Error) {
193
+ return `${val.name}: ${val.message}\n${val.stack}`;
194
+ }
195
+ // TODO we could test for more things here, like `Set`s and `Map`s.
196
+ return className;
197
+ }
198
+
199
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
200
+ ? { register: () => {}, unregister: () => {} }
201
+ : new FinalizationRegistry(
202
+ state => {
203
+ wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b);
204
+ }
205
+ );
206
+
207
+ function makeMutClosure(arg0, arg1, dtor, f) {
208
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
209
+ const real = (...args) => {
210
+
211
+ // First up with a closure we increment the internal reference
212
+ // count. This ensures that the Rust closure environment won't
213
+ // be deallocated while we're invoking it.
214
+ state.cnt++;
215
+ const a = state.a;
216
+ state.a = 0;
217
+ try {
218
+ return f(a, state.b, ...args);
219
+ } finally {
220
+ if (--state.cnt === 0) {
221
+ wasm.__wbindgen_export_4.get(state.dtor)(a, state.b);
222
+ CLOSURE_DTORS.unregister(state);
223
+ } else {
224
+ state.a = a;
225
+ }
226
+ }
227
+ };
228
+ real.original = state;
229
+ CLOSURE_DTORS.register(real, state, state);
230
+ return real;
231
+ }
232
+
233
+ function dropObject(idx) {
234
+ if (idx < 132) return;
235
+ heap[idx] = heap_next;
236
+ heap_next = idx;
237
+ }
238
+
239
+ function takeObject(idx) {
240
+ const ret = getObject(idx);
241
+ dropObject(idx);
242
+ return ret;
243
+ }
244
+ /**
245
+ * Initialize logging for WASM
246
+ */
247
+ export function init() {
248
+ wasm.init();
249
+ }
250
+
251
+ /**
252
+ * Log a message to the browser console
253
+ * @param {string} message
254
+ */
255
+ export function log(message) {
256
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
257
+ const len0 = WASM_VECTOR_LEN;
258
+ wasm.log(ptr0, len0);
259
+ }
260
+
261
+ function __wbg_adapter_6(arg0, arg1, arg2) {
262
+ wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
263
+ }
264
+
265
+ function __wbg_adapter_45(arg0, arg1, arg2, arg3) {
266
+ wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
267
+ }
268
+
269
+ const ReasoningBankWasmFinalization = (typeof FinalizationRegistry === 'undefined')
270
+ ? { register: () => {}, unregister: () => {} }
271
+ : new FinalizationRegistry(ptr => wasm.__wbg_reasoningbankwasm_free(ptr >>> 0, 1));
272
+ /**
273
+ * WASM wrapper for ReasoningBank
274
+ */
275
+ export class ReasoningBankWasm {
276
+
277
+ static __wrap(ptr) {
278
+ ptr = ptr >>> 0;
279
+ const obj = Object.create(ReasoningBankWasm.prototype);
280
+ obj.__wbg_ptr = ptr;
281
+ ReasoningBankWasmFinalization.register(obj, obj.__wbg_ptr, obj);
282
+ return obj;
283
+ }
284
+
285
+ __destroy_into_raw() {
286
+ const ptr = this.__wbg_ptr;
287
+ this.__wbg_ptr = 0;
288
+ ReasoningBankWasmFinalization.unregister(this);
289
+ return ptr;
290
+ }
291
+
292
+ free() {
293
+ const ptr = this.__destroy_into_raw();
294
+ wasm.__wbg_reasoningbankwasm_free(ptr, 0);
295
+ }
296
+ /**
297
+ * Create a new ReasoningBank instance
298
+ * @param {string | null} [db_name]
299
+ */
300
+ constructor(db_name) {
301
+ var ptr0 = isLikeNone(db_name) ? 0 : passStringToWasm0(db_name, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
302
+ var len0 = WASM_VECTOR_LEN;
303
+ const ret = wasm.reasoningbankwasm_new(ptr0, len0);
304
+ return takeObject(ret);
305
+ }
306
+ /**
307
+ * Store a reasoning pattern
308
+ * @param {string} pattern_json
309
+ * @returns {Promise<string>}
310
+ */
311
+ storePattern(pattern_json) {
312
+ const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
313
+ const len0 = WASM_VECTOR_LEN;
314
+ const ret = wasm.reasoningbankwasm_storePattern(this.__wbg_ptr, ptr0, len0);
315
+ return takeObject(ret);
316
+ }
317
+ /**
318
+ * Retrieve a pattern by ID
319
+ * @param {string} id
320
+ * @returns {Promise<string>}
321
+ */
322
+ getPattern(id) {
323
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
324
+ const len0 = WASM_VECTOR_LEN;
325
+ const ret = wasm.reasoningbankwasm_getPattern(this.__wbg_ptr, ptr0, len0);
326
+ return takeObject(ret);
327
+ }
328
+ /**
329
+ * Search patterns by category
330
+ * @param {string} category
331
+ * @param {number} limit
332
+ * @returns {Promise<string>}
333
+ */
334
+ searchByCategory(category, limit) {
335
+ const ptr0 = passStringToWasm0(category, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
336
+ const len0 = WASM_VECTOR_LEN;
337
+ const ret = wasm.reasoningbankwasm_searchByCategory(this.__wbg_ptr, ptr0, len0, limit);
338
+ return takeObject(ret);
339
+ }
340
+ /**
341
+ * Find similar patterns
342
+ * @param {string} task_description
343
+ * @param {string} task_category
344
+ * @param {number} top_k
345
+ * @returns {Promise<string>}
346
+ */
347
+ findSimilar(task_description, task_category, top_k) {
348
+ const ptr0 = passStringToWasm0(task_description, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
349
+ const len0 = WASM_VECTOR_LEN;
350
+ const ptr1 = passStringToWasm0(task_category, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
351
+ const len1 = WASM_VECTOR_LEN;
352
+ const ret = wasm.reasoningbankwasm_findSimilar(this.__wbg_ptr, ptr0, len0, ptr1, len1, top_k);
353
+ return takeObject(ret);
354
+ }
355
+ /**
356
+ * Get storage statistics
357
+ * @returns {Promise<string>}
358
+ */
359
+ getStats() {
360
+ const ret = wasm.reasoningbankwasm_getStats(this.__wbg_ptr);
361
+ return takeObject(ret);
362
+ }
363
+ }
364
+ if (Symbol.dispose) ReasoningBankWasm.prototype[Symbol.dispose] = ReasoningBankWasm.prototype.free;
365
+
366
+ export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
367
+ const ret = getObject(arg0).call(getObject(arg1));
368
+ return addHeapObject(ret);
369
+ }, arguments) };
370
+
371
+ export function __wbg_call_a5400b25a865cfd8() { return handleError(function (arg0, arg1, arg2) {
372
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
373
+ return addHeapObject(ret);
374
+ }, arguments) };
375
+
376
+ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
377
+ let deferred0_0;
378
+ let deferred0_1;
379
+ try {
380
+ deferred0_0 = arg0;
381
+ deferred0_1 = arg1;
382
+ console.error(getStringFromWasm0(arg0, arg1));
383
+ } finally {
384
+ wasm.__wbindgen_export_1(deferred0_0, deferred0_1, 1);
385
+ }
386
+ };
387
+
388
+ export function __wbg_getRandomValues_38a1ff1ea09f6cc7() { return handleError(function (arg0, arg1) {
389
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
390
+ }, arguments) };
391
+
392
+ export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
393
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
394
+ return addHeapObject(ret);
395
+ }, arguments) };
396
+
397
+ export function __wbg_indexedDB_1956995e4297311c() { return handleError(function (arg0) {
398
+ const ret = getObject(arg0).indexedDB;
399
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
400
+ }, arguments) };
401
+
402
+ export function __wbg_instanceof_Window_12d20d558ef92592(arg0) {
403
+ let result;
404
+ try {
405
+ result = getObject(arg0) instanceof Window;
406
+ } catch (_) {
407
+ result = false;
408
+ }
409
+ const ret = result;
410
+ return ret;
411
+ };
412
+
413
+ export function __wbg_log_6c7b5f4f00b8ce3f(arg0) {
414
+ console.log(getObject(arg0));
415
+ };
416
+
417
+ export function __wbg_new_2e3c58a15f39f5f9(arg0, arg1) {
418
+ try {
419
+ var state0 = {a: arg0, b: arg1};
420
+ var cb0 = (arg0, arg1) => {
421
+ const a = state0.a;
422
+ state0.a = 0;
423
+ try {
424
+ return __wbg_adapter_45(a, state0.b, arg0, arg1);
425
+ } finally {
426
+ state0.a = a;
427
+ }
428
+ };
429
+ const ret = new Promise(cb0);
430
+ return addHeapObject(ret);
431
+ } finally {
432
+ state0.a = state0.b = 0;
433
+ }
434
+ };
435
+
436
+ export function __wbg_new_8a6f238a6ece86ea() {
437
+ const ret = new Error();
438
+ return addHeapObject(ret);
439
+ };
440
+
441
+ export function __wbg_newnoargs_254190557c45b4ec(arg0, arg1) {
442
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
443
+ return addHeapObject(ret);
444
+ };
445
+
446
+ export function __wbg_open_7281831ed8ff7bd2() { return handleError(function (arg0, arg1, arg2, arg3) {
447
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
448
+ return addHeapObject(ret);
449
+ }, arguments) };
450
+
451
+ export function __wbg_queueMicrotask_25d0739ac89e8c88(arg0) {
452
+ queueMicrotask(getObject(arg0));
453
+ };
454
+
455
+ export function __wbg_queueMicrotask_4488407636f5bf24(arg0) {
456
+ const ret = getObject(arg0).queueMicrotask;
457
+ return addHeapObject(ret);
458
+ };
459
+
460
+ export function __wbg_reasoningbankwasm_new(arg0) {
461
+ const ret = ReasoningBankWasm.__wrap(arg0);
462
+ return addHeapObject(ret);
463
+ };
464
+
465
+ export function __wbg_resolve_4055c623acdd6a1b(arg0) {
466
+ const ret = Promise.resolve(getObject(arg0));
467
+ return addHeapObject(ret);
468
+ };
469
+
470
+ export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
471
+ const ret = getObject(arg1).stack;
472
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
473
+ const len1 = WASM_VECTOR_LEN;
474
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
475
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
476
+ };
477
+
478
+ export function __wbg_static_accessor_GLOBAL_8921f820c2ce3f12() {
479
+ const ret = typeof global === 'undefined' ? null : global;
480
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
481
+ };
482
+
483
+ export function __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184() {
484
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
485
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
486
+ };
487
+
488
+ export function __wbg_static_accessor_SELF_995b214ae681ff99() {
489
+ const ret = typeof self === 'undefined' ? null : self;
490
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
491
+ };
492
+
493
+ export function __wbg_static_accessor_WINDOW_cde3890479c675ea() {
494
+ const ret = typeof window === 'undefined' ? null : window;
495
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
496
+ };
497
+
498
+ export function __wbg_then_e22500defe16819f(arg0, arg1) {
499
+ const ret = getObject(arg0).then(getObject(arg1));
500
+ return addHeapObject(ret);
501
+ };
502
+
503
+ export function __wbg_wbindgencbdrop_eb10308566512b88(arg0) {
504
+ const obj = getObject(arg0).original;
505
+ if (obj.cnt-- == 1) {
506
+ obj.a = 0;
507
+ return true;
508
+ }
509
+ const ret = false;
510
+ return ret;
511
+ };
512
+
513
+ export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
514
+ const ret = debugString(getObject(arg1));
515
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
516
+ const len1 = WASM_VECTOR_LEN;
517
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
518
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
519
+ };
520
+
521
+ export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
522
+ const ret = typeof(getObject(arg0)) === 'function';
523
+ return ret;
524
+ };
525
+
526
+ export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
527
+ const ret = getObject(arg0) === undefined;
528
+ return ret;
529
+ };
530
+
531
+ export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
532
+ throw new Error(getStringFromWasm0(arg0, arg1));
533
+ };
534
+
535
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
536
+ // Cast intrinsic for `Ref(String) -> Externref`.
537
+ const ret = getStringFromWasm0(arg0, arg1);
538
+ return addHeapObject(ret);
539
+ };
540
+
541
+ export function __wbindgen_cast_8eb6fd44e7238d11(arg0, arg1) {
542
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 62, function: Function { arguments: [Externref], shim_idx: 63, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
543
+ const ret = makeMutClosure(arg0, arg1, 62, __wbg_adapter_6);
544
+ return addHeapObject(ret);
545
+ };
546
+
547
+ export function __wbindgen_object_clone_ref(arg0) {
548
+ const ret = getObject(arg0);
549
+ return addHeapObject(ret);
550
+ };
551
+
552
+ export function __wbindgen_object_drop_ref(arg0) {
553
+ takeObject(arg0);
554
+ };
555
+