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