@sparkleideas/ruv-swarm 1.0.18-patch.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.
Files changed (87) hide show
  1. package/README.md +1565 -0
  2. package/bin/ruv-swarm-clean.js +1872 -0
  3. package/bin/ruv-swarm-memory.js +119 -0
  4. package/bin/ruv-swarm-secure-heartbeat.js +1549 -0
  5. package/bin/ruv-swarm-secure.js +1689 -0
  6. package/package.json +221 -0
  7. package/src/agent.ts +342 -0
  8. package/src/benchmark.js +267 -0
  9. package/src/claude-flow-enhanced.js +839 -0
  10. package/src/claude-integration/advanced-commands.js +561 -0
  11. package/src/claude-integration/core.js +112 -0
  12. package/src/claude-integration/docs.js +1548 -0
  13. package/src/claude-integration/env-template.js +39 -0
  14. package/src/claude-integration/index.js +209 -0
  15. package/src/claude-integration/remote.js +408 -0
  16. package/src/cli-diagnostics.js +364 -0
  17. package/src/cognitive-pattern-evolution.js +1317 -0
  18. package/src/daa-cognition.js +977 -0
  19. package/src/daa-service.d.ts +298 -0
  20. package/src/daa-service.js +1116 -0
  21. package/src/diagnostics.js +533 -0
  22. package/src/errors.js +528 -0
  23. package/src/github-coordinator/README.md +193 -0
  24. package/src/github-coordinator/claude-hooks.js +162 -0
  25. package/src/github-coordinator/gh-cli-coordinator.js +260 -0
  26. package/src/hooks/cli.js +82 -0
  27. package/src/hooks/index.js +1900 -0
  28. package/src/index-enhanced.d.ts +371 -0
  29. package/src/index-enhanced.js +734 -0
  30. package/src/index.d.ts +287 -0
  31. package/src/index.js +405 -0
  32. package/src/index.ts +457 -0
  33. package/src/logger.js +182 -0
  34. package/src/logging-config.js +179 -0
  35. package/src/mcp-daa-tools.js +735 -0
  36. package/src/mcp-tools-benchmarks.js +328 -0
  37. package/src/mcp-tools-enhanced.js +2863 -0
  38. package/src/memory-config.js +42 -0
  39. package/src/meta-learning-framework.js +1359 -0
  40. package/src/neural-agent.js +830 -0
  41. package/src/neural-coordination-protocol.js +1363 -0
  42. package/src/neural-models/README.md +118 -0
  43. package/src/neural-models/autoencoder.js +543 -0
  44. package/src/neural-models/base.js +269 -0
  45. package/src/neural-models/cnn.js +497 -0
  46. package/src/neural-models/gnn.js +447 -0
  47. package/src/neural-models/gru.js +536 -0
  48. package/src/neural-models/index.js +273 -0
  49. package/src/neural-models/lstm.js +551 -0
  50. package/src/neural-models/neural-presets-complete.js +1306 -0
  51. package/src/neural-models/presets/graph.js +392 -0
  52. package/src/neural-models/presets/index.js +279 -0
  53. package/src/neural-models/presets/nlp.js +328 -0
  54. package/src/neural-models/presets/timeseries.js +368 -0
  55. package/src/neural-models/presets/vision.js +387 -0
  56. package/src/neural-models/resnet.js +534 -0
  57. package/src/neural-models/transformer.js +515 -0
  58. package/src/neural-models/vae.js +489 -0
  59. package/src/neural-network-manager.js +1938 -0
  60. package/src/neural-network.ts +296 -0
  61. package/src/neural.js +574 -0
  62. package/src/performance-benchmarks.js +898 -0
  63. package/src/performance.js +458 -0
  64. package/src/persistence-pooled.js +695 -0
  65. package/src/persistence.js +480 -0
  66. package/src/schemas.js +864 -0
  67. package/src/security.js +218 -0
  68. package/src/singleton-container.js +183 -0
  69. package/src/sqlite-pool.js +587 -0
  70. package/src/sqlite-worker.js +141 -0
  71. package/src/types.ts +164 -0
  72. package/src/utils.ts +286 -0
  73. package/src/wasm-loader.js +601 -0
  74. package/src/wasm-loader2.js +404 -0
  75. package/src/wasm-memory-optimizer.js +783 -0
  76. package/src/wasm-types.d.ts +63 -0
  77. package/wasm/README.md +347 -0
  78. package/wasm/neuro-divergent.wasm +0 -0
  79. package/wasm/package.json +18 -0
  80. package/wasm/ruv-fann.wasm +0 -0
  81. package/wasm/ruv_swarm_simd.wasm +0 -0
  82. package/wasm/ruv_swarm_wasm.d.ts +391 -0
  83. package/wasm/ruv_swarm_wasm.js +2164 -0
  84. package/wasm/ruv_swarm_wasm_bg.wasm +0 -0
  85. package/wasm/ruv_swarm_wasm_bg.wasm.d.ts +123 -0
  86. package/wasm/wasm-bindings-loader.mjs +435 -0
  87. package/wasm/wasm-updates.md +684 -0
@@ -0,0 +1,2164 @@
1
+ let wasm;
2
+
3
+ const heap = new Array(128).fill(undefined);
4
+
5
+ heap.push(undefined, null, true, false);
6
+
7
+ function getObject(idx) { return heap[idx]; }
8
+
9
+ let heap_next = heap.length;
10
+
11
+ function addHeapObject(obj) {
12
+ if (heap_next === heap.length) heap.push(heap.length + 1);
13
+ const idx = heap_next;
14
+ heap_next = heap[idx];
15
+
16
+ heap[idx] = obj;
17
+ return idx;
18
+ }
19
+
20
+ function handleError(f, args) {
21
+ try {
22
+ return f.apply(this, args);
23
+ } catch (e) {
24
+ wasm.__wbindgen_export_0(addHeapObject(e));
25
+ }
26
+ }
27
+
28
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
29
+
30
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
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
+ function getStringFromWasm0(ptr, len) {
42
+ ptr = ptr >>> 0;
43
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
44
+ }
45
+
46
+ let WASM_VECTOR_LEN = 0;
47
+
48
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
49
+
50
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
51
+ ? function (arg, view) {
52
+ return cachedTextEncoder.encodeInto(arg, view);
53
+ }
54
+ : function (arg, view) {
55
+ const buf = cachedTextEncoder.encode(arg);
56
+ view.set(buf);
57
+ return {
58
+ read: arg.length,
59
+ written: buf.length
60
+ };
61
+ });
62
+
63
+ function passStringToWasm0(arg, malloc, realloc) {
64
+
65
+ if (realloc === undefined) {
66
+ const buf = cachedTextEncoder.encode(arg);
67
+ const ptr = malloc(buf.length, 1) >>> 0;
68
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
69
+ WASM_VECTOR_LEN = buf.length;
70
+ return ptr;
71
+ }
72
+
73
+ let len = arg.length;
74
+ let ptr = malloc(len, 1) >>> 0;
75
+
76
+ const mem = getUint8ArrayMemory0();
77
+
78
+ let offset = 0;
79
+
80
+ for (; offset < len; offset++) {
81
+ const code = arg.charCodeAt(offset);
82
+ if (code > 0x7F) break;
83
+ mem[ptr + offset] = code;
84
+ }
85
+
86
+ if (offset !== len) {
87
+ if (offset !== 0) {
88
+ arg = arg.slice(offset);
89
+ }
90
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
91
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
92
+ const ret = encodeString(arg, view);
93
+
94
+ offset += ret.written;
95
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
96
+ }
97
+
98
+ WASM_VECTOR_LEN = offset;
99
+ return ptr;
100
+ }
101
+
102
+ let cachedDataViewMemory0 = null;
103
+
104
+ function getDataViewMemory0() {
105
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
106
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
107
+ }
108
+ return cachedDataViewMemory0;
109
+ }
110
+
111
+ function isLikeNone(x) {
112
+ return x === undefined || x === null;
113
+ }
114
+
115
+ function debugString(val) {
116
+ // primitive types
117
+ const type = typeof val;
118
+ if (type == 'number' || type == 'boolean' || val == null) {
119
+ return `${val}`;
120
+ }
121
+ if (type == 'string') {
122
+ return `"${val}"`;
123
+ }
124
+ if (type == 'symbol') {
125
+ const description = val.description;
126
+ if (description == null) {
127
+ return 'Symbol';
128
+ } else {
129
+ return `Symbol(${description})`;
130
+ }
131
+ }
132
+ if (type == 'function') {
133
+ const name = val.name;
134
+ if (typeof name == 'string' && name.length > 0) {
135
+ return `Function(${name})`;
136
+ } else {
137
+ return 'Function';
138
+ }
139
+ }
140
+ // objects
141
+ if (Array.isArray(val)) {
142
+ const length = val.length;
143
+ let debug = '[';
144
+ if (length > 0) {
145
+ debug += debugString(val[0]);
146
+ }
147
+ for(let i = 1; i < length; i++) {
148
+ debug += ', ' + debugString(val[i]);
149
+ }
150
+ debug += ']';
151
+ return debug;
152
+ }
153
+ // Test for built-in
154
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
155
+ let className;
156
+ if (builtInMatches && builtInMatches.length > 1) {
157
+ className = builtInMatches[1];
158
+ } else {
159
+ // Failed to match the standard '[object ClassName]'
160
+ return toString.call(val);
161
+ }
162
+ if (className == 'Object') {
163
+ // we're a user defined class or Object
164
+ // JSON.stringify avoids problems with cycles, and is generally much
165
+ // easier than looping through ownProperties of `val`.
166
+ try {
167
+ return 'Object(' + JSON.stringify(val) + ')';
168
+ } catch (_) {
169
+ return 'Object';
170
+ }
171
+ }
172
+ // errors
173
+ if (val instanceof Error) {
174
+ return `${val.name}: ${val.message}\n${val.stack}`;
175
+ }
176
+ // TODO we could test for more things here, like `Set`s and `Map`s.
177
+ return className;
178
+ }
179
+
180
+ function dropObject(idx) {
181
+ if (idx < 132) return;
182
+ heap[idx] = heap_next;
183
+ heap_next = idx;
184
+ }
185
+
186
+ function takeObject(idx) {
187
+ const ret = getObject(idx);
188
+ dropObject(idx);
189
+ return ret;
190
+ }
191
+
192
+ function getArrayU8FromWasm0(ptr, len) {
193
+ ptr = ptr >>> 0;
194
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
195
+ }
196
+
197
+ function passArray8ToWasm0(arg, malloc) {
198
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
199
+ getUint8ArrayMemory0().set(arg, ptr / 1);
200
+ WASM_VECTOR_LEN = arg.length;
201
+ return ptr;
202
+ }
203
+
204
+ let cachedFloat32ArrayMemory0 = null;
205
+
206
+ function getFloat32ArrayMemory0() {
207
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
208
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
209
+ }
210
+ return cachedFloat32ArrayMemory0;
211
+ }
212
+
213
+ function passArrayF32ToWasm0(arg, malloc) {
214
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
215
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
216
+ WASM_VECTOR_LEN = arg.length;
217
+ return ptr;
218
+ }
219
+
220
+ function getArrayF32FromWasm0(ptr, len) {
221
+ ptr = ptr >>> 0;
222
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
223
+ }
224
+ /**
225
+ * SIMD feature detection and runtime capabilities
226
+ * @returns {string}
227
+ */
228
+ export function detect_simd_capabilities() {
229
+ let deferred1_0;
230
+ let deferred1_1;
231
+ try {
232
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
233
+ wasm.detect_simd_capabilities(retptr);
234
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
235
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
236
+ deferred1_0 = r0;
237
+ deferred1_1 = r1;
238
+ return getStringFromWasm0(r0, r1);
239
+ } finally {
240
+ wasm.__wbindgen_add_to_stack_pointer(16);
241
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
242
+ }
243
+ }
244
+
245
+ /**
246
+ * @returns {string}
247
+ */
248
+ export function run_simd_verification_suite() {
249
+ let deferred1_0;
250
+ let deferred1_1;
251
+ try {
252
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
253
+ wasm.run_simd_verification_suite(retptr);
254
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
255
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
256
+ deferred1_0 = r0;
257
+ deferred1_1 = r1;
258
+ return getStringFromWasm0(r0, r1);
259
+ } finally {
260
+ wasm.__wbindgen_add_to_stack_pointer(16);
261
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
262
+ }
263
+ }
264
+
265
+ /**
266
+ * @param {number} size
267
+ * @param {number} iterations
268
+ * @returns {string}
269
+ */
270
+ export function simd_performance_report(size, iterations) {
271
+ let deferred1_0;
272
+ let deferred1_1;
273
+ try {
274
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
275
+ wasm.simd_performance_report(retptr, size, iterations);
276
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
277
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
278
+ deferred1_0 = r0;
279
+ deferred1_1 = r1;
280
+ return getStringFromWasm0(r0, r1);
281
+ } finally {
282
+ wasm.__wbindgen_add_to_stack_pointer(16);
283
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
284
+ }
285
+ }
286
+
287
+ /**
288
+ * Comprehensive SIMD feature validation
289
+ * @returns {boolean}
290
+ */
291
+ export function validate_simd_implementation() {
292
+ const ret = wasm.validate_simd_implementation();
293
+ return ret !== 0;
294
+ }
295
+
296
+ let stack_pointer = 128;
297
+
298
+ function addBorrowedObject(obj) {
299
+ if (stack_pointer == 1) throw new Error('out of js stack');
300
+ heap[--stack_pointer] = obj;
301
+ return stack_pointer;
302
+ }
303
+ /**
304
+ * @param {any} array
305
+ * @returns {Float32Array}
306
+ */
307
+ export function js_array_to_vec_f32(array) {
308
+ try {
309
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
310
+ wasm.js_array_to_vec_f32(retptr, addBorrowedObject(array));
311
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
312
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
313
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
314
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
315
+ if (r3) {
316
+ throw takeObject(r2);
317
+ }
318
+ var v1 = getArrayF32FromWasm0(r0, r1).slice();
319
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
320
+ return v1;
321
+ } finally {
322
+ wasm.__wbindgen_add_to_stack_pointer(16);
323
+ heap[stack_pointer++] = undefined;
324
+ }
325
+ }
326
+
327
+ /**
328
+ * @param {Float32Array} vec
329
+ * @returns {Float32Array}
330
+ */
331
+ export function vec_f32_to_js_array(vec) {
332
+ const ptr0 = passArrayF32ToWasm0(vec, wasm.__wbindgen_export_2);
333
+ const len0 = WASM_VECTOR_LEN;
334
+ const ret = wasm.vec_f32_to_js_array(ptr0, len0);
335
+ return takeObject(ret);
336
+ }
337
+
338
+ /**
339
+ * @returns {bigint}
340
+ */
341
+ export function get_wasm_memory_usage() {
342
+ const ret = wasm.get_wasm_memory_usage();
343
+ return BigInt.asUintN(64, ret);
344
+ }
345
+
346
+ /**
347
+ * @param {string} message
348
+ */
349
+ export function console_log(message) {
350
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
351
+ const len0 = WASM_VECTOR_LEN;
352
+ wasm.console_log(ptr0, len0);
353
+ }
354
+
355
+ /**
356
+ * @param {string} message
357
+ */
358
+ export function console_error(message) {
359
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
360
+ const len0 = WASM_VECTOR_LEN;
361
+ wasm.console_error(ptr0, len0);
362
+ }
363
+
364
+ /**
365
+ * @param {string} message
366
+ */
367
+ export function console_warn(message) {
368
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
369
+ const len0 = WASM_VECTOR_LEN;
370
+ wasm.console_warn(ptr0, len0);
371
+ }
372
+
373
+ /**
374
+ * @param {any} error
375
+ * @returns {string}
376
+ */
377
+ export function format_js_error(error) {
378
+ let deferred1_0;
379
+ let deferred1_1;
380
+ try {
381
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
382
+ wasm.format_js_error(retptr, addHeapObject(error));
383
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
384
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
385
+ deferred1_0 = r0;
386
+ deferred1_1 = r1;
387
+ return getStringFromWasm0(r0, r1);
388
+ } finally {
389
+ wasm.__wbindgen_add_to_stack_pointer(16);
390
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
391
+ }
392
+ }
393
+
394
+ export function init() {
395
+ wasm.init();
396
+ }
397
+
398
+ let cachedUint32ArrayMemory0 = null;
399
+
400
+ function getUint32ArrayMemory0() {
401
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
402
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
403
+ }
404
+ return cachedUint32ArrayMemory0;
405
+ }
406
+
407
+ function passArray32ToWasm0(arg, malloc) {
408
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
409
+ getUint32ArrayMemory0().set(arg, ptr / 4);
410
+ WASM_VECTOR_LEN = arg.length;
411
+ return ptr;
412
+ }
413
+
414
+ let cachedFloat64ArrayMemory0 = null;
415
+
416
+ function getFloat64ArrayMemory0() {
417
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
418
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
419
+ }
420
+ return cachedFloat64ArrayMemory0;
421
+ }
422
+
423
+ function passArrayF64ToWasm0(arg, malloc) {
424
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
425
+ getFloat64ArrayMemory0().set(arg, ptr / 8);
426
+ WASM_VECTOR_LEN = arg.length;
427
+ return ptr;
428
+ }
429
+
430
+ function getArrayF64FromWasm0(ptr, len) {
431
+ ptr = ptr >>> 0;
432
+ return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
433
+ }
434
+
435
+ function getArrayJsValueFromWasm0(ptr, len) {
436
+ ptr = ptr >>> 0;
437
+ const mem = getDataViewMemory0();
438
+ const result = [];
439
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
440
+ result.push(takeObject(mem.getUint32(i, true)));
441
+ }
442
+ return result;
443
+ }
444
+ /**
445
+ * @param {Uint32Array} layers
446
+ * @param {ActivationFunction} activation
447
+ * @returns {WasmNeuralNetwork}
448
+ */
449
+ export function create_neural_network(layers, activation) {
450
+ const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_export_2);
451
+ const len0 = WASM_VECTOR_LEN;
452
+ const ret = wasm.create_neural_network(ptr0, len0, activation);
453
+ return WasmNeuralNetwork.__wrap(ret);
454
+ }
455
+
456
+ /**
457
+ * @param {string} topology
458
+ * @returns {WasmSwarmOrchestrator}
459
+ */
460
+ export function create_swarm_orchestrator(topology) {
461
+ const ptr0 = passStringToWasm0(topology, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
462
+ const len0 = WASM_VECTOR_LEN;
463
+ const ret = wasm.create_swarm_orchestrator(ptr0, len0);
464
+ return WasmSwarmOrchestrator.__wrap(ret);
465
+ }
466
+
467
+ /**
468
+ * @param {string} model_type
469
+ * @returns {WasmForecastingModel}
470
+ */
471
+ export function create_forecasting_model(model_type) {
472
+ const ptr0 = passStringToWasm0(model_type, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
473
+ const len0 = WASM_VECTOR_LEN;
474
+ const ret = wasm.create_forecasting_model(ptr0, len0);
475
+ return WasmForecastingModel.__wrap(ret);
476
+ }
477
+
478
+ /**
479
+ * @returns {string}
480
+ */
481
+ export function get_version() {
482
+ let deferred1_0;
483
+ let deferred1_1;
484
+ try {
485
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
486
+ wasm.get_version(retptr);
487
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
488
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
489
+ deferred1_0 = r0;
490
+ deferred1_1 = r1;
491
+ return getStringFromWasm0(r0, r1);
492
+ } finally {
493
+ wasm.__wbindgen_add_to_stack_pointer(16);
494
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
495
+ }
496
+ }
497
+
498
+ /**
499
+ * @returns {string}
500
+ */
501
+ export function get_features() {
502
+ let deferred1_0;
503
+ let deferred1_1;
504
+ try {
505
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
506
+ wasm.get_features(retptr);
507
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
508
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
509
+ deferred1_0 = r0;
510
+ deferred1_1 = r1;
511
+ return getStringFromWasm0(r0, r1);
512
+ } finally {
513
+ wasm.__wbindgen_add_to_stack_pointer(16);
514
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
515
+ }
516
+ }
517
+
518
+ /**
519
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17}
520
+ */
521
+ export const ActivationFunction = Object.freeze({
522
+ Linear: 0, "0": "Linear",
523
+ Sigmoid: 1, "1": "Sigmoid",
524
+ SymmetricSigmoid: 2, "2": "SymmetricSigmoid",
525
+ Tanh: 3, "3": "Tanh",
526
+ ReLU: 4, "4": "ReLU",
527
+ LeakyReLU: 5, "5": "LeakyReLU",
528
+ Swish: 6, "6": "Swish",
529
+ Gaussian: 7, "7": "Gaussian",
530
+ Elliot: 8, "8": "Elliot",
531
+ SymmetricElliot: 9, "9": "SymmetricElliot",
532
+ Sine: 10, "10": "Sine",
533
+ Cosine: 11, "11": "Cosine",
534
+ SinSymmetric: 12, "12": "SinSymmetric",
535
+ CosSymmetric: 13, "13": "CosSymmetric",
536
+ ThresholdSymmetric: 14, "14": "ThresholdSymmetric",
537
+ Threshold: 15, "15": "Threshold",
538
+ StepSymmetric: 16, "16": "StepSymmetric",
539
+ Step: 17, "17": "Step",
540
+ });
541
+
542
+ const AgentMemoryPoolFinalization = (typeof FinalizationRegistry === 'undefined')
543
+ ? { register: () => {}, unregister: () => {} }
544
+ : new FinalizationRegistry(ptr => wasm.__wbg_agentmemorypool_free(ptr >>> 0, 1));
545
+ /**
546
+ * Agent memory pool specifically optimized for neural network agents
547
+ */
548
+ export class AgentMemoryPool {
549
+
550
+ __destroy_into_raw() {
551
+ const ptr = this.__wbg_ptr;
552
+ this.__wbg_ptr = 0;
553
+ AgentMemoryPoolFinalization.unregister(this);
554
+ return ptr;
555
+ }
556
+
557
+ free() {
558
+ const ptr = this.__destroy_into_raw();
559
+ wasm.__wbg_agentmemorypool_free(ptr, 0);
560
+ }
561
+ constructor() {
562
+ const ret = wasm.agentmemorypool_new();
563
+ this.__wbg_ptr = ret >>> 0;
564
+ AgentMemoryPoolFinalization.register(this, this.__wbg_ptr, this);
565
+ return this;
566
+ }
567
+ /**
568
+ * Allocate memory for an agent based on complexity
569
+ * @param {string} complexity
570
+ * @returns {Uint8Array | undefined}
571
+ */
572
+ allocate_for_agent(complexity) {
573
+ try {
574
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
575
+ const ptr0 = passStringToWasm0(complexity, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
576
+ const len0 = WASM_VECTOR_LEN;
577
+ wasm.agentmemorypool_allocate_for_agent(retptr, this.__wbg_ptr, ptr0, len0);
578
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
579
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
580
+ let v2;
581
+ if (r0 !== 0) {
582
+ v2 = getArrayU8FromWasm0(r0, r1).slice();
583
+ wasm.__wbindgen_export_1(r0, r1 * 1, 1);
584
+ }
585
+ return v2;
586
+ } finally {
587
+ wasm.__wbindgen_add_to_stack_pointer(16);
588
+ }
589
+ }
590
+ /**
591
+ * Return agent memory to the appropriate pool
592
+ * @param {Uint8Array} memory
593
+ */
594
+ deallocate_agent_memory(memory) {
595
+ const ptr0 = passArray8ToWasm0(memory, wasm.__wbindgen_export_2);
596
+ const len0 = WASM_VECTOR_LEN;
597
+ wasm.agentmemorypool_deallocate_agent_memory(this.__wbg_ptr, ptr0, len0);
598
+ }
599
+ /**
600
+ * Get total memory usage across all pools
601
+ * @returns {number}
602
+ */
603
+ total_memory_usage_mb() {
604
+ const ret = wasm.agentmemorypool_total_memory_usage_mb(this.__wbg_ptr);
605
+ return ret;
606
+ }
607
+ /**
608
+ * Check if memory usage is within target (< 50MB for 10 agents)
609
+ * @returns {boolean}
610
+ */
611
+ is_within_memory_target() {
612
+ const ret = wasm.agentmemorypool_is_within_memory_target(this.__wbg_ptr);
613
+ return ret !== 0;
614
+ }
615
+ }
616
+
617
+ const MemoryPoolFinalization = (typeof FinalizationRegistry === 'undefined')
618
+ ? { register: () => {}, unregister: () => {} }
619
+ : new FinalizationRegistry(ptr => wasm.__wbg_memorypool_free(ptr >>> 0, 1));
620
+ /**
621
+ * Memory pool for efficient memory management
622
+ */
623
+ export class MemoryPool {
624
+
625
+ __destroy_into_raw() {
626
+ const ptr = this.__wbg_ptr;
627
+ this.__wbg_ptr = 0;
628
+ MemoryPoolFinalization.unregister(this);
629
+ return ptr;
630
+ }
631
+
632
+ free() {
633
+ const ptr = this.__destroy_into_raw();
634
+ wasm.__wbg_memorypool_free(ptr, 0);
635
+ }
636
+ /**
637
+ * Create a new memory pool with specified block size and maximum blocks
638
+ * @param {number} block_size
639
+ * @param {number} max_blocks
640
+ */
641
+ constructor(block_size, max_blocks) {
642
+ const ret = wasm.memorypool_new(block_size, max_blocks);
643
+ this.__wbg_ptr = ret >>> 0;
644
+ MemoryPoolFinalization.register(this, this.__wbg_ptr, this);
645
+ return this;
646
+ }
647
+ /**
648
+ * Allocate a memory block from the pool
649
+ * @returns {Uint8Array | undefined}
650
+ */
651
+ allocate() {
652
+ try {
653
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
654
+ wasm.memorypool_allocate(retptr, this.__wbg_ptr);
655
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
656
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
657
+ let v1;
658
+ if (r0 !== 0) {
659
+ v1 = getArrayU8FromWasm0(r0, r1).slice();
660
+ wasm.__wbindgen_export_1(r0, r1 * 1, 1);
661
+ }
662
+ return v1;
663
+ } finally {
664
+ wasm.__wbindgen_add_to_stack_pointer(16);
665
+ }
666
+ }
667
+ /**
668
+ * Return a memory block to the pool for reuse
669
+ * @param {Uint8Array} block
670
+ */
671
+ deallocate(block) {
672
+ const ptr0 = passArray8ToWasm0(block, wasm.__wbindgen_export_2);
673
+ const len0 = WASM_VECTOR_LEN;
674
+ wasm.memorypool_deallocate(this.__wbg_ptr, ptr0, len0);
675
+ }
676
+ /**
677
+ * Get the number of available blocks in the pool
678
+ * @returns {number}
679
+ */
680
+ available_blocks() {
681
+ const ret = wasm.memorypool_available_blocks(this.__wbg_ptr);
682
+ return ret >>> 0;
683
+ }
684
+ /**
685
+ * Get total memory usage in bytes
686
+ * @returns {number}
687
+ */
688
+ memory_usage() {
689
+ const ret = wasm.memorypool_memory_usage(this.__wbg_ptr);
690
+ return ret >>> 0;
691
+ }
692
+ /**
693
+ * Get pool efficiency metrics
694
+ * @returns {PoolMetrics}
695
+ */
696
+ get_metrics() {
697
+ const ret = wasm.memorypool_get_metrics(this.__wbg_ptr);
698
+ return PoolMetrics.__wrap(ret);
699
+ }
700
+ }
701
+
702
+ const OptimizedAgentFinalization = (typeof FinalizationRegistry === 'undefined')
703
+ ? { register: () => {}, unregister: () => {} }
704
+ : new FinalizationRegistry(ptr => wasm.__wbg_optimizedagent_free(ptr >>> 0, 1));
705
+
706
+ export class OptimizedAgent {
707
+
708
+ __destroy_into_raw() {
709
+ const ptr = this.__wbg_ptr;
710
+ this.__wbg_ptr = 0;
711
+ OptimizedAgentFinalization.unregister(this);
712
+ return ptr;
713
+ }
714
+
715
+ free() {
716
+ const ptr = this.__destroy_into_raw();
717
+ wasm.__wbg_optimizedagent_free(ptr, 0);
718
+ }
719
+ }
720
+
721
+ const OptimizedAgentSpawnerFinalization = (typeof FinalizationRegistry === 'undefined')
722
+ ? { register: () => {}, unregister: () => {} }
723
+ : new FinalizationRegistry(ptr => wasm.__wbg_optimizedagentspawner_free(ptr >>> 0, 1));
724
+
725
+ export class OptimizedAgentSpawner {
726
+
727
+ __destroy_into_raw() {
728
+ const ptr = this.__wbg_ptr;
729
+ this.__wbg_ptr = 0;
730
+ OptimizedAgentSpawnerFinalization.unregister(this);
731
+ return ptr;
732
+ }
733
+
734
+ free() {
735
+ const ptr = this.__destroy_into_raw();
736
+ wasm.__wbg_optimizedagentspawner_free(ptr, 0);
737
+ }
738
+ constructor() {
739
+ const ret = wasm.optimizedagentspawner_new();
740
+ this.__wbg_ptr = ret >>> 0;
741
+ OptimizedAgentSpawnerFinalization.register(this, this.__wbg_ptr, this);
742
+ return this;
743
+ }
744
+ /**
745
+ * @param {string} agent_type
746
+ * @param {string} complexity
747
+ * @returns {string}
748
+ */
749
+ spawn_agent(agent_type, complexity) {
750
+ let deferred4_0;
751
+ let deferred4_1;
752
+ try {
753
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
754
+ const ptr0 = passStringToWasm0(agent_type, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
755
+ const len0 = WASM_VECTOR_LEN;
756
+ const ptr1 = passStringToWasm0(complexity, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
757
+ const len1 = WASM_VECTOR_LEN;
758
+ wasm.optimizedagentspawner_spawn_agent(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
759
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
760
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
761
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
762
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
763
+ var ptr3 = r0;
764
+ var len3 = r1;
765
+ if (r3) {
766
+ ptr3 = 0; len3 = 0;
767
+ throw takeObject(r2);
768
+ }
769
+ deferred4_0 = ptr3;
770
+ deferred4_1 = len3;
771
+ return getStringFromWasm0(ptr3, len3);
772
+ } finally {
773
+ wasm.__wbindgen_add_to_stack_pointer(16);
774
+ wasm.__wbindgen_export_1(deferred4_0, deferred4_1, 1);
775
+ }
776
+ }
777
+ /**
778
+ * @param {string} agent_id
779
+ */
780
+ release_agent(agent_id) {
781
+ try {
782
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
783
+ const ptr0 = passStringToWasm0(agent_id, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
784
+ const len0 = WASM_VECTOR_LEN;
785
+ wasm.optimizedagentspawner_release_agent(retptr, this.__wbg_ptr, ptr0, len0);
786
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
787
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
788
+ if (r1) {
789
+ throw takeObject(r0);
790
+ }
791
+ } finally {
792
+ wasm.__wbindgen_add_to_stack_pointer(16);
793
+ }
794
+ }
795
+ /**
796
+ * @returns {string}
797
+ */
798
+ get_performance_report() {
799
+ let deferred1_0;
800
+ let deferred1_1;
801
+ try {
802
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
803
+ wasm.optimizedagentspawner_get_performance_report(retptr, this.__wbg_ptr);
804
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
805
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
806
+ deferred1_0 = r0;
807
+ deferred1_1 = r1;
808
+ return getStringFromWasm0(r0, r1);
809
+ } finally {
810
+ wasm.__wbindgen_add_to_stack_pointer(16);
811
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
812
+ }
813
+ }
814
+ /**
815
+ * @returns {number}
816
+ */
817
+ get_active_agent_count() {
818
+ const ret = wasm.optimizedagentspawner_get_active_agent_count(this.__wbg_ptr);
819
+ return ret >>> 0;
820
+ }
821
+ /**
822
+ * @returns {boolean}
823
+ */
824
+ is_within_memory_target() {
825
+ const ret = wasm.optimizedagentspawner_is_within_memory_target(this.__wbg_ptr);
826
+ return ret !== 0;
827
+ }
828
+ }
829
+
830
+ const PerformanceMonitorFinalization = (typeof FinalizationRegistry === 'undefined')
831
+ ? { register: () => {}, unregister: () => {} }
832
+ : new FinalizationRegistry(ptr => wasm.__wbg_performancemonitor_free(ptr >>> 0, 1));
833
+
834
+ export class PerformanceMonitor {
835
+
836
+ __destroy_into_raw() {
837
+ const ptr = this.__wbg_ptr;
838
+ this.__wbg_ptr = 0;
839
+ PerformanceMonitorFinalization.unregister(this);
840
+ return ptr;
841
+ }
842
+
843
+ free() {
844
+ const ptr = this.__destroy_into_raw();
845
+ wasm.__wbg_performancemonitor_free(ptr, 0);
846
+ }
847
+ constructor() {
848
+ const ret = wasm.performancemonitor_new();
849
+ this.__wbg_ptr = ret >>> 0;
850
+ PerformanceMonitorFinalization.register(this, this.__wbg_ptr, this);
851
+ return this;
852
+ }
853
+ /**
854
+ * @param {number} time
855
+ */
856
+ record_load_time(time) {
857
+ wasm.performancemonitor_record_load_time(this.__wbg_ptr, time);
858
+ }
859
+ /**
860
+ * @param {number} time
861
+ */
862
+ record_spawn_time(time) {
863
+ wasm.performancemonitor_record_spawn_time(this.__wbg_ptr, time);
864
+ }
865
+ /**
866
+ * @param {number} bytes
867
+ */
868
+ update_memory_usage(bytes) {
869
+ wasm.performancemonitor_update_memory_usage(this.__wbg_ptr, bytes);
870
+ }
871
+ /**
872
+ * @returns {number}
873
+ */
874
+ get_average_spawn_time() {
875
+ const ret = wasm.performancemonitor_get_average_spawn_time(this.__wbg_ptr);
876
+ return ret;
877
+ }
878
+ /**
879
+ * @returns {number}
880
+ */
881
+ get_memory_usage_mb() {
882
+ const ret = wasm.performancemonitor_get_memory_usage_mb(this.__wbg_ptr);
883
+ return ret;
884
+ }
885
+ /**
886
+ * @returns {boolean}
887
+ */
888
+ meets_performance_targets() {
889
+ const ret = wasm.performancemonitor_meets_performance_targets(this.__wbg_ptr);
890
+ return ret !== 0;
891
+ }
892
+ /**
893
+ * @returns {string}
894
+ */
895
+ get_report() {
896
+ let deferred1_0;
897
+ let deferred1_1;
898
+ try {
899
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
900
+ wasm.performancemonitor_get_report(retptr, this.__wbg_ptr);
901
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
902
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
903
+ deferred1_0 = r0;
904
+ deferred1_1 = r1;
905
+ return getStringFromWasm0(r0, r1);
906
+ } finally {
907
+ wasm.__wbindgen_add_to_stack_pointer(16);
908
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
909
+ }
910
+ }
911
+ }
912
+
913
+ const PerformanceTimerFinalization = (typeof FinalizationRegistry === 'undefined')
914
+ ? { register: () => {}, unregister: () => {} }
915
+ : new FinalizationRegistry(ptr => wasm.__wbg_performancetimer_free(ptr >>> 0, 1));
916
+
917
+ export class PerformanceTimer {
918
+
919
+ __destroy_into_raw() {
920
+ const ptr = this.__wbg_ptr;
921
+ this.__wbg_ptr = 0;
922
+ PerformanceTimerFinalization.unregister(this);
923
+ return ptr;
924
+ }
925
+
926
+ free() {
927
+ const ptr = this.__destroy_into_raw();
928
+ wasm.__wbg_performancetimer_free(ptr, 0);
929
+ }
930
+ /**
931
+ * @param {string} name
932
+ */
933
+ constructor(name) {
934
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
935
+ const len0 = WASM_VECTOR_LEN;
936
+ const ret = wasm.performancetimer_new(ptr0, len0);
937
+ this.__wbg_ptr = ret >>> 0;
938
+ PerformanceTimerFinalization.register(this, this.__wbg_ptr, this);
939
+ return this;
940
+ }
941
+ /**
942
+ * @returns {number}
943
+ */
944
+ elapsed() {
945
+ const ret = wasm.performancetimer_elapsed(this.__wbg_ptr);
946
+ return ret;
947
+ }
948
+ log() {
949
+ wasm.performancetimer_log(this.__wbg_ptr);
950
+ }
951
+ }
952
+
953
+ const PoolMetricsFinalization = (typeof FinalizationRegistry === 'undefined')
954
+ ? { register: () => {}, unregister: () => {} }
955
+ : new FinalizationRegistry(ptr => wasm.__wbg_poolmetrics_free(ptr >>> 0, 1));
956
+ /**
957
+ * Pool metrics for monitoring
958
+ */
959
+ export class PoolMetrics {
960
+
961
+ static __wrap(ptr) {
962
+ ptr = ptr >>> 0;
963
+ const obj = Object.create(PoolMetrics.prototype);
964
+ obj.__wbg_ptr = ptr;
965
+ PoolMetricsFinalization.register(obj, obj.__wbg_ptr, obj);
966
+ return obj;
967
+ }
968
+
969
+ __destroy_into_raw() {
970
+ const ptr = this.__wbg_ptr;
971
+ this.__wbg_ptr = 0;
972
+ PoolMetricsFinalization.unregister(this);
973
+ return ptr;
974
+ }
975
+
976
+ free() {
977
+ const ptr = this.__destroy_into_raw();
978
+ wasm.__wbg_poolmetrics_free(ptr, 0);
979
+ }
980
+ /**
981
+ * @returns {number}
982
+ */
983
+ get total_blocks() {
984
+ const ret = wasm.__wbg_get_poolmetrics_total_blocks(this.__wbg_ptr);
985
+ return ret >>> 0;
986
+ }
987
+ /**
988
+ * @param {number} arg0
989
+ */
990
+ set total_blocks(arg0) {
991
+ wasm.__wbg_set_poolmetrics_total_blocks(this.__wbg_ptr, arg0);
992
+ }
993
+ /**
994
+ * @returns {number}
995
+ */
996
+ get free_blocks() {
997
+ const ret = wasm.__wbg_get_poolmetrics_free_blocks(this.__wbg_ptr);
998
+ return ret >>> 0;
999
+ }
1000
+ /**
1001
+ * @param {number} arg0
1002
+ */
1003
+ set free_blocks(arg0) {
1004
+ wasm.__wbg_set_poolmetrics_free_blocks(this.__wbg_ptr, arg0);
1005
+ }
1006
+ /**
1007
+ * @returns {number}
1008
+ */
1009
+ get block_size() {
1010
+ const ret = wasm.__wbg_get_poolmetrics_block_size(this.__wbg_ptr);
1011
+ return ret >>> 0;
1012
+ }
1013
+ /**
1014
+ * @param {number} arg0
1015
+ */
1016
+ set block_size(arg0) {
1017
+ wasm.__wbg_set_poolmetrics_block_size(this.__wbg_ptr, arg0);
1018
+ }
1019
+ /**
1020
+ * @returns {number}
1021
+ */
1022
+ get reuse_count() {
1023
+ const ret = wasm.__wbg_get_poolmetrics_reuse_count(this.__wbg_ptr);
1024
+ return ret >>> 0;
1025
+ }
1026
+ /**
1027
+ * @param {number} arg0
1028
+ */
1029
+ set reuse_count(arg0) {
1030
+ wasm.__wbg_set_poolmetrics_reuse_count(this.__wbg_ptr, arg0);
1031
+ }
1032
+ /**
1033
+ * @returns {number}
1034
+ */
1035
+ get memory_usage_mb() {
1036
+ const ret = wasm.__wbg_get_poolmetrics_memory_usage_mb(this.__wbg_ptr);
1037
+ return ret;
1038
+ }
1039
+ /**
1040
+ * @param {number} arg0
1041
+ */
1042
+ set memory_usage_mb(arg0) {
1043
+ wasm.__wbg_set_poolmetrics_memory_usage_mb(this.__wbg_ptr, arg0);
1044
+ }
1045
+ }
1046
+
1047
+ const RuntimeFeaturesFinalization = (typeof FinalizationRegistry === 'undefined')
1048
+ ? { register: () => {}, unregister: () => {} }
1049
+ : new FinalizationRegistry(ptr => wasm.__wbg_runtimefeatures_free(ptr >>> 0, 1));
1050
+
1051
+ export class RuntimeFeatures {
1052
+
1053
+ __destroy_into_raw() {
1054
+ const ptr = this.__wbg_ptr;
1055
+ this.__wbg_ptr = 0;
1056
+ RuntimeFeaturesFinalization.unregister(this);
1057
+ return ptr;
1058
+ }
1059
+
1060
+ free() {
1061
+ const ptr = this.__destroy_into_raw();
1062
+ wasm.__wbg_runtimefeatures_free(ptr, 0);
1063
+ }
1064
+ constructor() {
1065
+ const ret = wasm.runtimefeatures_new();
1066
+ this.__wbg_ptr = ret >>> 0;
1067
+ RuntimeFeaturesFinalization.register(this, this.__wbg_ptr, this);
1068
+ return this;
1069
+ }
1070
+ /**
1071
+ * @returns {boolean}
1072
+ */
1073
+ get simd_available() {
1074
+ const ret = wasm.runtimefeatures_simd_available(this.__wbg_ptr);
1075
+ return ret !== 0;
1076
+ }
1077
+ /**
1078
+ * @returns {boolean}
1079
+ */
1080
+ get threads_available() {
1081
+ const ret = wasm.runtimefeatures_threads_available(this.__wbg_ptr);
1082
+ return ret !== 0;
1083
+ }
1084
+ /**
1085
+ * @returns {bigint}
1086
+ */
1087
+ get memory_limit() {
1088
+ const ret = wasm.runtimefeatures_memory_limit(this.__wbg_ptr);
1089
+ return BigInt.asUintN(64, ret);
1090
+ }
1091
+ /**
1092
+ * @returns {string}
1093
+ */
1094
+ get_features_json() {
1095
+ let deferred1_0;
1096
+ let deferred1_1;
1097
+ try {
1098
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1099
+ wasm.runtimefeatures_get_features_json(retptr, this.__wbg_ptr);
1100
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1101
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1102
+ deferred1_0 = r0;
1103
+ deferred1_1 = r1;
1104
+ return getStringFromWasm0(r0, r1);
1105
+ } finally {
1106
+ wasm.__wbindgen_add_to_stack_pointer(16);
1107
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1108
+ }
1109
+ }
1110
+ }
1111
+
1112
+ const SimdBenchmarkFinalization = (typeof FinalizationRegistry === 'undefined')
1113
+ ? { register: () => {}, unregister: () => {} }
1114
+ : new FinalizationRegistry(ptr => wasm.__wbg_simdbenchmark_free(ptr >>> 0, 1));
1115
+ /**
1116
+ * Performance benchmarking utilities
1117
+ */
1118
+ export class SimdBenchmark {
1119
+
1120
+ __destroy_into_raw() {
1121
+ const ptr = this.__wbg_ptr;
1122
+ this.__wbg_ptr = 0;
1123
+ SimdBenchmarkFinalization.unregister(this);
1124
+ return ptr;
1125
+ }
1126
+
1127
+ free() {
1128
+ const ptr = this.__destroy_into_raw();
1129
+ wasm.__wbg_simdbenchmark_free(ptr, 0);
1130
+ }
1131
+ constructor() {
1132
+ const ret = wasm.simdbenchmark_new();
1133
+ this.__wbg_ptr = ret >>> 0;
1134
+ SimdBenchmarkFinalization.register(this, this.__wbg_ptr, this);
1135
+ return this;
1136
+ }
1137
+ /**
1138
+ * Benchmark SIMD vs scalar dot product
1139
+ * @param {number} size
1140
+ * @param {number} iterations
1141
+ * @returns {string}
1142
+ */
1143
+ benchmark_dot_product(size, iterations) {
1144
+ let deferred1_0;
1145
+ let deferred1_1;
1146
+ try {
1147
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1148
+ wasm.simdbenchmark_benchmark_dot_product(retptr, this.__wbg_ptr, size, iterations);
1149
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1150
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1151
+ deferred1_0 = r0;
1152
+ deferred1_1 = r1;
1153
+ return getStringFromWasm0(r0, r1);
1154
+ } finally {
1155
+ wasm.__wbindgen_add_to_stack_pointer(16);
1156
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1157
+ }
1158
+ }
1159
+ /**
1160
+ * Benchmark SIMD vs scalar activation functions
1161
+ * @param {number} size
1162
+ * @param {number} iterations
1163
+ * @param {string} activation
1164
+ * @returns {string}
1165
+ */
1166
+ benchmark_activation(size, iterations, activation) {
1167
+ let deferred2_0;
1168
+ let deferred2_1;
1169
+ try {
1170
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1171
+ const ptr0 = passStringToWasm0(activation, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1172
+ const len0 = WASM_VECTOR_LEN;
1173
+ wasm.simdbenchmark_benchmark_activation(retptr, this.__wbg_ptr, size, iterations, ptr0, len0);
1174
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1175
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1176
+ deferred2_0 = r0;
1177
+ deferred2_1 = r1;
1178
+ return getStringFromWasm0(r0, r1);
1179
+ } finally {
1180
+ wasm.__wbindgen_add_to_stack_pointer(16);
1181
+ wasm.__wbindgen_export_1(deferred2_0, deferred2_1, 1);
1182
+ }
1183
+ }
1184
+ }
1185
+
1186
+ const SimdMatrixOpsFinalization = (typeof FinalizationRegistry === 'undefined')
1187
+ ? { register: () => {}, unregister: () => {} }
1188
+ : new FinalizationRegistry(ptr => wasm.__wbg_simdmatrixops_free(ptr >>> 0, 1));
1189
+ /**
1190
+ * SIMD-accelerated matrix operations
1191
+ */
1192
+ export class SimdMatrixOps {
1193
+
1194
+ __destroy_into_raw() {
1195
+ const ptr = this.__wbg_ptr;
1196
+ this.__wbg_ptr = 0;
1197
+ SimdMatrixOpsFinalization.unregister(this);
1198
+ return ptr;
1199
+ }
1200
+
1201
+ free() {
1202
+ const ptr = this.__destroy_into_raw();
1203
+ wasm.__wbg_simdmatrixops_free(ptr, 0);
1204
+ }
1205
+ constructor() {
1206
+ const ret = wasm.simdbenchmark_new();
1207
+ this.__wbg_ptr = ret >>> 0;
1208
+ SimdMatrixOpsFinalization.register(this, this.__wbg_ptr, this);
1209
+ return this;
1210
+ }
1211
+ /**
1212
+ * SIMD-optimized matrix-vector multiplication
1213
+ * @param {Float32Array} matrix
1214
+ * @param {Float32Array} vector
1215
+ * @param {number} rows
1216
+ * @param {number} cols
1217
+ * @returns {Float32Array}
1218
+ */
1219
+ matrix_vector_multiply(matrix, vector, rows, cols) {
1220
+ try {
1221
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1222
+ const ptr0 = passArrayF32ToWasm0(matrix, wasm.__wbindgen_export_2);
1223
+ const len0 = WASM_VECTOR_LEN;
1224
+ const ptr1 = passArrayF32ToWasm0(vector, wasm.__wbindgen_export_2);
1225
+ const len1 = WASM_VECTOR_LEN;
1226
+ wasm.simdmatrixops_matrix_vector_multiply(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, rows, cols);
1227
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1228
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1229
+ var v3 = getArrayF32FromWasm0(r0, r1).slice();
1230
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1231
+ return v3;
1232
+ } finally {
1233
+ wasm.__wbindgen_add_to_stack_pointer(16);
1234
+ }
1235
+ }
1236
+ /**
1237
+ * SIMD-optimized matrix-matrix multiplication (small matrices)
1238
+ * @param {Float32Array} a
1239
+ * @param {Float32Array} b
1240
+ * @param {number} a_rows
1241
+ * @param {number} a_cols
1242
+ * @param {number} b_cols
1243
+ * @returns {Float32Array}
1244
+ */
1245
+ matrix_multiply(a, b, a_rows, a_cols, b_cols) {
1246
+ try {
1247
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1248
+ const ptr0 = passArrayF32ToWasm0(a, wasm.__wbindgen_export_2);
1249
+ const len0 = WASM_VECTOR_LEN;
1250
+ const ptr1 = passArrayF32ToWasm0(b, wasm.__wbindgen_export_2);
1251
+ const len1 = WASM_VECTOR_LEN;
1252
+ wasm.simdmatrixops_matrix_multiply(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, a_rows, a_cols, b_cols);
1253
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1254
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1255
+ var v3 = getArrayF32FromWasm0(r0, r1).slice();
1256
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1257
+ return v3;
1258
+ } finally {
1259
+ wasm.__wbindgen_add_to_stack_pointer(16);
1260
+ }
1261
+ }
1262
+ }
1263
+
1264
+ const SimdVectorOpsFinalization = (typeof FinalizationRegistry === 'undefined')
1265
+ ? { register: () => {}, unregister: () => {} }
1266
+ : new FinalizationRegistry(ptr => wasm.__wbg_simdvectorops_free(ptr >>> 0, 1));
1267
+ /**
1268
+ * SIMD-accelerated vector operations
1269
+ */
1270
+ export class SimdVectorOps {
1271
+
1272
+ __destroy_into_raw() {
1273
+ const ptr = this.__wbg_ptr;
1274
+ this.__wbg_ptr = 0;
1275
+ SimdVectorOpsFinalization.unregister(this);
1276
+ return ptr;
1277
+ }
1278
+
1279
+ free() {
1280
+ const ptr = this.__destroy_into_raw();
1281
+ wasm.__wbg_simdvectorops_free(ptr, 0);
1282
+ }
1283
+ constructor() {
1284
+ const ret = wasm.simdbenchmark_new();
1285
+ this.__wbg_ptr = ret >>> 0;
1286
+ SimdVectorOpsFinalization.register(this, this.__wbg_ptr, this);
1287
+ return this;
1288
+ }
1289
+ /**
1290
+ * SIMD-optimized vector dot product
1291
+ * @param {Float32Array} a
1292
+ * @param {Float32Array} b
1293
+ * @returns {number}
1294
+ */
1295
+ dot_product(a, b) {
1296
+ const ptr0 = passArrayF32ToWasm0(a, wasm.__wbindgen_export_2);
1297
+ const len0 = WASM_VECTOR_LEN;
1298
+ const ptr1 = passArrayF32ToWasm0(b, wasm.__wbindgen_export_2);
1299
+ const len1 = WASM_VECTOR_LEN;
1300
+ const ret = wasm.simdvectorops_dot_product(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1301
+ return ret;
1302
+ }
1303
+ /**
1304
+ * SIMD-optimized vector addition
1305
+ * @param {Float32Array} a
1306
+ * @param {Float32Array} b
1307
+ * @returns {Float32Array}
1308
+ */
1309
+ vector_add(a, b) {
1310
+ try {
1311
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1312
+ const ptr0 = passArrayF32ToWasm0(a, wasm.__wbindgen_export_2);
1313
+ const len0 = WASM_VECTOR_LEN;
1314
+ const ptr1 = passArrayF32ToWasm0(b, wasm.__wbindgen_export_2);
1315
+ const len1 = WASM_VECTOR_LEN;
1316
+ wasm.simdvectorops_vector_add(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1317
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1318
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1319
+ var v3 = getArrayF32FromWasm0(r0, r1).slice();
1320
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1321
+ return v3;
1322
+ } finally {
1323
+ wasm.__wbindgen_add_to_stack_pointer(16);
1324
+ }
1325
+ }
1326
+ /**
1327
+ * SIMD-optimized vector scaling
1328
+ * @param {Float32Array} vec
1329
+ * @param {number} scalar
1330
+ * @returns {Float32Array}
1331
+ */
1332
+ vector_scale(vec, scalar) {
1333
+ try {
1334
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1335
+ const ptr0 = passArrayF32ToWasm0(vec, wasm.__wbindgen_export_2);
1336
+ const len0 = WASM_VECTOR_LEN;
1337
+ wasm.simdvectorops_vector_scale(retptr, this.__wbg_ptr, ptr0, len0, scalar);
1338
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1339
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1340
+ var v2 = getArrayF32FromWasm0(r0, r1).slice();
1341
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1342
+ return v2;
1343
+ } finally {
1344
+ wasm.__wbindgen_add_to_stack_pointer(16);
1345
+ }
1346
+ }
1347
+ /**
1348
+ * SIMD-optimized activation function application
1349
+ * @param {Float32Array} vec
1350
+ * @param {string} activation
1351
+ * @returns {Float32Array}
1352
+ */
1353
+ apply_activation(vec, activation) {
1354
+ try {
1355
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1356
+ const ptr0 = passArrayF32ToWasm0(vec, wasm.__wbindgen_export_2);
1357
+ const len0 = WASM_VECTOR_LEN;
1358
+ const ptr1 = passStringToWasm0(activation, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1359
+ const len1 = WASM_VECTOR_LEN;
1360
+ wasm.simdvectorops_apply_activation(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
1361
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1362
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1363
+ var v3 = getArrayF32FromWasm0(r0, r1).slice();
1364
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1365
+ return v3;
1366
+ } finally {
1367
+ wasm.__wbindgen_add_to_stack_pointer(16);
1368
+ }
1369
+ }
1370
+ }
1371
+
1372
+ const WasmAgentFinalization = (typeof FinalizationRegistry === 'undefined')
1373
+ ? { register: () => {}, unregister: () => {} }
1374
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmagent_free(ptr >>> 0, 1));
1375
+
1376
+ export class WasmAgent {
1377
+
1378
+ __destroy_into_raw() {
1379
+ const ptr = this.__wbg_ptr;
1380
+ this.__wbg_ptr = 0;
1381
+ WasmAgentFinalization.unregister(this);
1382
+ return ptr;
1383
+ }
1384
+
1385
+ free() {
1386
+ const ptr = this.__destroy_into_raw();
1387
+ wasm.__wbg_wasmagent_free(ptr, 0);
1388
+ }
1389
+ /**
1390
+ * @param {string} id
1391
+ * @param {string} agent_type
1392
+ */
1393
+ constructor(id, agent_type) {
1394
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1395
+ const len0 = WASM_VECTOR_LEN;
1396
+ const ptr1 = passStringToWasm0(agent_type, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1397
+ const len1 = WASM_VECTOR_LEN;
1398
+ const ret = wasm.wasmagent_new(ptr0, len0, ptr1, len1);
1399
+ this.__wbg_ptr = ret >>> 0;
1400
+ WasmAgentFinalization.register(this, this.__wbg_ptr, this);
1401
+ return this;
1402
+ }
1403
+ /**
1404
+ * @returns {string}
1405
+ */
1406
+ get id() {
1407
+ let deferred1_0;
1408
+ let deferred1_1;
1409
+ try {
1410
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1411
+ wasm.wasmagent_id(retptr, this.__wbg_ptr);
1412
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1413
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1414
+ deferred1_0 = r0;
1415
+ deferred1_1 = r1;
1416
+ return getStringFromWasm0(r0, r1);
1417
+ } finally {
1418
+ wasm.__wbindgen_add_to_stack_pointer(16);
1419
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1420
+ }
1421
+ }
1422
+ /**
1423
+ * @returns {string}
1424
+ */
1425
+ get agent_type() {
1426
+ let deferred1_0;
1427
+ let deferred1_1;
1428
+ try {
1429
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1430
+ wasm.wasmagent_agent_type(retptr, this.__wbg_ptr);
1431
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1432
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1433
+ deferred1_0 = r0;
1434
+ deferred1_1 = r1;
1435
+ return getStringFromWasm0(r0, r1);
1436
+ } finally {
1437
+ wasm.__wbindgen_add_to_stack_pointer(16);
1438
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1439
+ }
1440
+ }
1441
+ /**
1442
+ * @returns {string}
1443
+ */
1444
+ get status() {
1445
+ let deferred1_0;
1446
+ let deferred1_1;
1447
+ try {
1448
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1449
+ wasm.wasmagent_status(retptr, this.__wbg_ptr);
1450
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1451
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1452
+ deferred1_0 = r0;
1453
+ deferred1_1 = r1;
1454
+ return getStringFromWasm0(r0, r1);
1455
+ } finally {
1456
+ wasm.__wbindgen_add_to_stack_pointer(16);
1457
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1458
+ }
1459
+ }
1460
+ /**
1461
+ * @param {string} status
1462
+ */
1463
+ set_status(status) {
1464
+ const ptr0 = passStringToWasm0(status, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1465
+ const len0 = WASM_VECTOR_LEN;
1466
+ wasm.wasmagent_set_status(this.__wbg_ptr, ptr0, len0);
1467
+ }
1468
+ /**
1469
+ * @param {string} capability
1470
+ */
1471
+ add_capability(capability) {
1472
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1473
+ const len0 = WASM_VECTOR_LEN;
1474
+ wasm.wasmagent_add_capability(this.__wbg_ptr, ptr0, len0);
1475
+ }
1476
+ /**
1477
+ * @param {string} capability
1478
+ * @returns {boolean}
1479
+ */
1480
+ has_capability(capability) {
1481
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1482
+ const len0 = WASM_VECTOR_LEN;
1483
+ const ret = wasm.wasmagent_has_capability(this.__wbg_ptr, ptr0, len0);
1484
+ return ret !== 0;
1485
+ }
1486
+ }
1487
+
1488
+ const WasmForecastingModelFinalization = (typeof FinalizationRegistry === 'undefined')
1489
+ ? { register: () => {}, unregister: () => {} }
1490
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmforecastingmodel_free(ptr >>> 0, 1));
1491
+
1492
+ export class WasmForecastingModel {
1493
+
1494
+ static __wrap(ptr) {
1495
+ ptr = ptr >>> 0;
1496
+ const obj = Object.create(WasmForecastingModel.prototype);
1497
+ obj.__wbg_ptr = ptr;
1498
+ WasmForecastingModelFinalization.register(obj, obj.__wbg_ptr, obj);
1499
+ return obj;
1500
+ }
1501
+
1502
+ __destroy_into_raw() {
1503
+ const ptr = this.__wbg_ptr;
1504
+ this.__wbg_ptr = 0;
1505
+ WasmForecastingModelFinalization.unregister(this);
1506
+ return ptr;
1507
+ }
1508
+
1509
+ free() {
1510
+ const ptr = this.__destroy_into_raw();
1511
+ wasm.__wbg_wasmforecastingmodel_free(ptr, 0);
1512
+ }
1513
+ /**
1514
+ * @param {string} model_type
1515
+ */
1516
+ constructor(model_type) {
1517
+ const ptr0 = passStringToWasm0(model_type, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1518
+ const len0 = WASM_VECTOR_LEN;
1519
+ const ret = wasm.create_forecasting_model(ptr0, len0);
1520
+ this.__wbg_ptr = ret >>> 0;
1521
+ WasmForecastingModelFinalization.register(this, this.__wbg_ptr, this);
1522
+ return this;
1523
+ }
1524
+ /**
1525
+ * @param {Float64Array} input
1526
+ * @returns {Float64Array}
1527
+ */
1528
+ predict(input) {
1529
+ try {
1530
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1531
+ const ptr0 = passArrayF64ToWasm0(input, wasm.__wbindgen_export_2);
1532
+ const len0 = WASM_VECTOR_LEN;
1533
+ wasm.wasmforecastingmodel_predict(retptr, this.__wbg_ptr, ptr0, len0);
1534
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1535
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1536
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
1537
+ wasm.__wbindgen_export_1(r0, r1 * 8, 8);
1538
+ return v2;
1539
+ } finally {
1540
+ wasm.__wbindgen_add_to_stack_pointer(16);
1541
+ }
1542
+ }
1543
+ /**
1544
+ * @returns {string}
1545
+ */
1546
+ get_model_type() {
1547
+ let deferred1_0;
1548
+ let deferred1_1;
1549
+ try {
1550
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1551
+ wasm.wasmforecastingmodel_get_model_type(retptr, this.__wbg_ptr);
1552
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1553
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1554
+ deferred1_0 = r0;
1555
+ deferred1_1 = r1;
1556
+ return getStringFromWasm0(r0, r1);
1557
+ } finally {
1558
+ wasm.__wbindgen_add_to_stack_pointer(16);
1559
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1560
+ }
1561
+ }
1562
+ }
1563
+
1564
+ const WasmNeuralNetworkFinalization = (typeof FinalizationRegistry === 'undefined')
1565
+ ? { register: () => {}, unregister: () => {} }
1566
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmneuralnetwork_free(ptr >>> 0, 1));
1567
+
1568
+ export class WasmNeuralNetwork {
1569
+
1570
+ static __wrap(ptr) {
1571
+ ptr = ptr >>> 0;
1572
+ const obj = Object.create(WasmNeuralNetwork.prototype);
1573
+ obj.__wbg_ptr = ptr;
1574
+ WasmNeuralNetworkFinalization.register(obj, obj.__wbg_ptr, obj);
1575
+ return obj;
1576
+ }
1577
+
1578
+ __destroy_into_raw() {
1579
+ const ptr = this.__wbg_ptr;
1580
+ this.__wbg_ptr = 0;
1581
+ WasmNeuralNetworkFinalization.unregister(this);
1582
+ return ptr;
1583
+ }
1584
+
1585
+ free() {
1586
+ const ptr = this.__destroy_into_raw();
1587
+ wasm.__wbg_wasmneuralnetwork_free(ptr, 0);
1588
+ }
1589
+ /**
1590
+ * @param {Uint32Array} layers
1591
+ * @param {ActivationFunction} activation
1592
+ */
1593
+ constructor(layers, activation) {
1594
+ const ptr0 = passArray32ToWasm0(layers, wasm.__wbindgen_export_2);
1595
+ const len0 = WASM_VECTOR_LEN;
1596
+ const ret = wasm.wasmneuralnetwork_new(ptr0, len0, activation);
1597
+ this.__wbg_ptr = ret >>> 0;
1598
+ WasmNeuralNetworkFinalization.register(this, this.__wbg_ptr, this);
1599
+ return this;
1600
+ }
1601
+ /**
1602
+ * @param {number} min
1603
+ * @param {number} max
1604
+ */
1605
+ randomize_weights(min, max) {
1606
+ wasm.wasmneuralnetwork_randomize_weights(this.__wbg_ptr, min, max);
1607
+ }
1608
+ /**
1609
+ * @param {Float64Array} weights
1610
+ */
1611
+ set_weights(weights) {
1612
+ const ptr0 = passArrayF64ToWasm0(weights, wasm.__wbindgen_export_2);
1613
+ const len0 = WASM_VECTOR_LEN;
1614
+ wasm.wasmneuralnetwork_set_weights(this.__wbg_ptr, ptr0, len0);
1615
+ }
1616
+ /**
1617
+ * @returns {Float64Array}
1618
+ */
1619
+ get_weights() {
1620
+ try {
1621
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1622
+ wasm.wasmneuralnetwork_get_weights(retptr, this.__wbg_ptr);
1623
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1624
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1625
+ var v1 = getArrayF64FromWasm0(r0, r1).slice();
1626
+ wasm.__wbindgen_export_1(r0, r1 * 8, 8);
1627
+ return v1;
1628
+ } finally {
1629
+ wasm.__wbindgen_add_to_stack_pointer(16);
1630
+ }
1631
+ }
1632
+ /**
1633
+ * @param {Float64Array} inputs
1634
+ * @returns {Float64Array}
1635
+ */
1636
+ run(inputs) {
1637
+ try {
1638
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1639
+ const ptr0 = passArrayF64ToWasm0(inputs, wasm.__wbindgen_export_2);
1640
+ const len0 = WASM_VECTOR_LEN;
1641
+ wasm.wasmneuralnetwork_run(retptr, this.__wbg_ptr, ptr0, len0);
1642
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1643
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1644
+ var v2 = getArrayF64FromWasm0(r0, r1).slice();
1645
+ wasm.__wbindgen_export_1(r0, r1 * 8, 8);
1646
+ return v2;
1647
+ } finally {
1648
+ wasm.__wbindgen_add_to_stack_pointer(16);
1649
+ }
1650
+ }
1651
+ }
1652
+
1653
+ const WasmSwarmOrchestratorFinalization = (typeof FinalizationRegistry === 'undefined')
1654
+ ? { register: () => {}, unregister: () => {} }
1655
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmswarmorchestrator_free(ptr >>> 0, 1));
1656
+
1657
+ export class WasmSwarmOrchestrator {
1658
+
1659
+ static __wrap(ptr) {
1660
+ ptr = ptr >>> 0;
1661
+ const obj = Object.create(WasmSwarmOrchestrator.prototype);
1662
+ obj.__wbg_ptr = ptr;
1663
+ WasmSwarmOrchestratorFinalization.register(obj, obj.__wbg_ptr, obj);
1664
+ return obj;
1665
+ }
1666
+
1667
+ __destroy_into_raw() {
1668
+ const ptr = this.__wbg_ptr;
1669
+ this.__wbg_ptr = 0;
1670
+ WasmSwarmOrchestratorFinalization.unregister(this);
1671
+ return ptr;
1672
+ }
1673
+
1674
+ free() {
1675
+ const ptr = this.__destroy_into_raw();
1676
+ wasm.__wbg_wasmswarmorchestrator_free(ptr, 0);
1677
+ }
1678
+ /**
1679
+ * @param {string} topology
1680
+ */
1681
+ constructor(topology) {
1682
+ const ptr0 = passStringToWasm0(topology, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1683
+ const len0 = WASM_VECTOR_LEN;
1684
+ const ret = wasm.create_swarm_orchestrator(ptr0, len0);
1685
+ this.__wbg_ptr = ret >>> 0;
1686
+ WasmSwarmOrchestratorFinalization.register(this, this.__wbg_ptr, this);
1687
+ return this;
1688
+ }
1689
+ /**
1690
+ * @param {string} config
1691
+ * @returns {string}
1692
+ */
1693
+ spawn(config) {
1694
+ let deferred2_0;
1695
+ let deferred2_1;
1696
+ try {
1697
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1698
+ const ptr0 = passStringToWasm0(config, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1699
+ const len0 = WASM_VECTOR_LEN;
1700
+ wasm.wasmswarmorchestrator_spawn(retptr, this.__wbg_ptr, ptr0, len0);
1701
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1702
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1703
+ deferred2_0 = r0;
1704
+ deferred2_1 = r1;
1705
+ return getStringFromWasm0(r0, r1);
1706
+ } finally {
1707
+ wasm.__wbindgen_add_to_stack_pointer(16);
1708
+ wasm.__wbindgen_export_1(deferred2_0, deferred2_1, 1);
1709
+ }
1710
+ }
1711
+ /**
1712
+ * @param {string} config
1713
+ * @returns {WasmTaskResult}
1714
+ */
1715
+ orchestrate(config) {
1716
+ const ptr0 = passStringToWasm0(config, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1717
+ const len0 = WASM_VECTOR_LEN;
1718
+ const ret = wasm.wasmswarmorchestrator_orchestrate(this.__wbg_ptr, ptr0, len0);
1719
+ return WasmTaskResult.__wrap(ret);
1720
+ }
1721
+ /**
1722
+ * @param {string} agent_id
1723
+ */
1724
+ add_agent(agent_id) {
1725
+ const ptr0 = passStringToWasm0(agent_id, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
1726
+ const len0 = WASM_VECTOR_LEN;
1727
+ wasm.wasmswarmorchestrator_add_agent(this.__wbg_ptr, ptr0, len0);
1728
+ }
1729
+ /**
1730
+ * @returns {number}
1731
+ */
1732
+ get_agent_count() {
1733
+ const ret = wasm.wasmswarmorchestrator_get_agent_count(this.__wbg_ptr);
1734
+ return ret >>> 0;
1735
+ }
1736
+ /**
1737
+ * @returns {string}
1738
+ */
1739
+ get_topology() {
1740
+ let deferred1_0;
1741
+ let deferred1_1;
1742
+ try {
1743
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1744
+ wasm.wasmswarmorchestrator_get_topology(retptr, this.__wbg_ptr);
1745
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1746
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1747
+ deferred1_0 = r0;
1748
+ deferred1_1 = r1;
1749
+ return getStringFromWasm0(r0, r1);
1750
+ } finally {
1751
+ wasm.__wbindgen_add_to_stack_pointer(16);
1752
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1753
+ }
1754
+ }
1755
+ /**
1756
+ * @param {boolean} detailed
1757
+ * @returns {string}
1758
+ */
1759
+ get_status(detailed) {
1760
+ let deferred1_0;
1761
+ let deferred1_1;
1762
+ try {
1763
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1764
+ wasm.wasmswarmorchestrator_get_status(retptr, this.__wbg_ptr, detailed);
1765
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1766
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1767
+ deferred1_0 = r0;
1768
+ deferred1_1 = r1;
1769
+ return getStringFromWasm0(r0, r1);
1770
+ } finally {
1771
+ wasm.__wbindgen_add_to_stack_pointer(16);
1772
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1773
+ }
1774
+ }
1775
+ }
1776
+
1777
+ const WasmTaskResultFinalization = (typeof FinalizationRegistry === 'undefined')
1778
+ ? { register: () => {}, unregister: () => {} }
1779
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmtaskresult_free(ptr >>> 0, 1));
1780
+
1781
+ export class WasmTaskResult {
1782
+
1783
+ static __wrap(ptr) {
1784
+ ptr = ptr >>> 0;
1785
+ const obj = Object.create(WasmTaskResult.prototype);
1786
+ obj.__wbg_ptr = ptr;
1787
+ WasmTaskResultFinalization.register(obj, obj.__wbg_ptr, obj);
1788
+ return obj;
1789
+ }
1790
+
1791
+ __destroy_into_raw() {
1792
+ const ptr = this.__wbg_ptr;
1793
+ this.__wbg_ptr = 0;
1794
+ WasmTaskResultFinalization.unregister(this);
1795
+ return ptr;
1796
+ }
1797
+
1798
+ free() {
1799
+ const ptr = this.__destroy_into_raw();
1800
+ wasm.__wbg_wasmtaskresult_free(ptr, 0);
1801
+ }
1802
+ /**
1803
+ * @returns {string}
1804
+ */
1805
+ get task_id() {
1806
+ let deferred1_0;
1807
+ let deferred1_1;
1808
+ try {
1809
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1810
+ wasm.wasmtaskresult_task_id(retptr, this.__wbg_ptr);
1811
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1812
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1813
+ deferred1_0 = r0;
1814
+ deferred1_1 = r1;
1815
+ return getStringFromWasm0(r0, r1);
1816
+ } finally {
1817
+ wasm.__wbindgen_add_to_stack_pointer(16);
1818
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1819
+ }
1820
+ }
1821
+ /**
1822
+ * @returns {string}
1823
+ */
1824
+ get description() {
1825
+ let deferred1_0;
1826
+ let deferred1_1;
1827
+ try {
1828
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1829
+ wasm.wasmtaskresult_description(retptr, this.__wbg_ptr);
1830
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1831
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1832
+ deferred1_0 = r0;
1833
+ deferred1_1 = r1;
1834
+ return getStringFromWasm0(r0, r1);
1835
+ } finally {
1836
+ wasm.__wbindgen_add_to_stack_pointer(16);
1837
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1838
+ }
1839
+ }
1840
+ /**
1841
+ * @returns {string}
1842
+ */
1843
+ get status() {
1844
+ let deferred1_0;
1845
+ let deferred1_1;
1846
+ try {
1847
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1848
+ wasm.wasmtaskresult_status(retptr, this.__wbg_ptr);
1849
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1850
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1851
+ deferred1_0 = r0;
1852
+ deferred1_1 = r1;
1853
+ return getStringFromWasm0(r0, r1);
1854
+ } finally {
1855
+ wasm.__wbindgen_add_to_stack_pointer(16);
1856
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1857
+ }
1858
+ }
1859
+ /**
1860
+ * @returns {string[]}
1861
+ */
1862
+ get assigned_agents() {
1863
+ try {
1864
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1865
+ wasm.wasmtaskresult_assigned_agents(retptr, this.__wbg_ptr);
1866
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1867
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1868
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
1869
+ wasm.__wbindgen_export_1(r0, r1 * 4, 4);
1870
+ return v1;
1871
+ } finally {
1872
+ wasm.__wbindgen_add_to_stack_pointer(16);
1873
+ }
1874
+ }
1875
+ /**
1876
+ * @returns {string}
1877
+ */
1878
+ get priority() {
1879
+ let deferred1_0;
1880
+ let deferred1_1;
1881
+ try {
1882
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1883
+ wasm.wasmtaskresult_priority(retptr, this.__wbg_ptr);
1884
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1885
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1886
+ deferred1_0 = r0;
1887
+ deferred1_1 = r1;
1888
+ return getStringFromWasm0(r0, r1);
1889
+ } finally {
1890
+ wasm.__wbindgen_add_to_stack_pointer(16);
1891
+ wasm.__wbindgen_export_1(deferred1_0, deferred1_1, 1);
1892
+ }
1893
+ }
1894
+ }
1895
+
1896
+ async function __wbg_load(module, imports) {
1897
+ if (typeof Response === 'function' && module instanceof Response) {
1898
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1899
+ try {
1900
+ return await WebAssembly.instantiateStreaming(module, imports);
1901
+
1902
+ } catch (e) {
1903
+ if (module.headers.get('Content-Type') != 'application/wasm') {
1904
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1905
+
1906
+ } else {
1907
+ throw e;
1908
+ }
1909
+ }
1910
+ }
1911
+
1912
+ const bytes = await module.arrayBuffer();
1913
+ return await WebAssembly.instantiate(bytes, imports);
1914
+
1915
+ } else {
1916
+ const instance = await WebAssembly.instantiate(module, imports);
1917
+
1918
+ if (instance instanceof WebAssembly.Instance) {
1919
+ return { instance, module };
1920
+
1921
+ } else {
1922
+ return instance;
1923
+ }
1924
+ }
1925
+ }
1926
+
1927
+ function __wbg_get_imports() {
1928
+ const imports = {};
1929
+ imports.wbg = {};
1930
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
1931
+ const ret = getObject(arg0).buffer;
1932
+ return addHeapObject(ret);
1933
+ };
1934
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
1935
+ const ret = getObject(arg0).call(getObject(arg1));
1936
+ return addHeapObject(ret);
1937
+ }, arguments) };
1938
+ imports.wbg.__wbg_error_524f506f44df1645 = function(arg0) {
1939
+ console.error(getObject(arg0));
1940
+ };
1941
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1942
+ let deferred0_0;
1943
+ let deferred0_1;
1944
+ try {
1945
+ deferred0_0 = arg0;
1946
+ deferred0_1 = arg1;
1947
+ console.error(getStringFromWasm0(arg0, arg1));
1948
+ } finally {
1949
+ wasm.__wbindgen_export_1(deferred0_0, deferred0_1, 1);
1950
+ }
1951
+ };
1952
+ imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
1953
+ const ret = Array.from(getObject(arg0));
1954
+ return addHeapObject(ret);
1955
+ };
1956
+ imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
1957
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
1958
+ return addHeapObject(ret);
1959
+ }, arguments) };
1960
+ imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
1961
+ const ret = getObject(arg0)[arg1 >>> 0];
1962
+ return addHeapObject(ret);
1963
+ };
1964
+ imports.wbg.__wbg_instanceof_Error_4d54113b22d20306 = function(arg0) {
1965
+ let result;
1966
+ try {
1967
+ result = getObject(arg0) instanceof Error;
1968
+ } catch (_) {
1969
+ result = false;
1970
+ }
1971
+ const ret = result;
1972
+ return ret;
1973
+ };
1974
+ imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) {
1975
+ let result;
1976
+ try {
1977
+ result = getObject(arg0) instanceof Window;
1978
+ } catch (_) {
1979
+ result = false;
1980
+ }
1981
+ const ret = result;
1982
+ return ret;
1983
+ };
1984
+ imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
1985
+ const ret = getObject(arg0).length;
1986
+ return ret;
1987
+ };
1988
+ imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
1989
+ console.log(getObject(arg0));
1990
+ };
1991
+ imports.wbg.__wbg_message_97a2af9b89d693a3 = function(arg0) {
1992
+ const ret = getObject(arg0).message;
1993
+ return addHeapObject(ret);
1994
+ };
1995
+ imports.wbg.__wbg_new_780abee5c1739fd7 = function(arg0) {
1996
+ const ret = new Float32Array(getObject(arg0));
1997
+ return addHeapObject(ret);
1998
+ };
1999
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
2000
+ const ret = new Error();
2001
+ return addHeapObject(ret);
2002
+ };
2003
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
2004
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
2005
+ return addHeapObject(ret);
2006
+ };
2007
+ imports.wbg.__wbg_newwithbyteoffsetandlength_e6b7e69acd4c7354 = function(arg0, arg1, arg2) {
2008
+ const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2009
+ return addHeapObject(ret);
2010
+ };
2011
+ imports.wbg.__wbg_now_807e54c39636c349 = function() {
2012
+ const ret = Date.now();
2013
+ return ret;
2014
+ };
2015
+ imports.wbg.__wbg_random_3ad904d98382defe = function() {
2016
+ const ret = Math.random();
2017
+ return ret;
2018
+ };
2019
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
2020
+ const ret = getObject(arg1).stack;
2021
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
2022
+ const len1 = WASM_VECTOR_LEN;
2023
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2024
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2025
+ };
2026
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2027
+ const ret = typeof global === 'undefined' ? null : global;
2028
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2029
+ };
2030
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
2031
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
2032
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2033
+ };
2034
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
2035
+ const ret = typeof self === 'undefined' ? null : self;
2036
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2037
+ };
2038
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
2039
+ const ret = typeof window === 'undefined' ? null : window;
2040
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2041
+ };
2042
+ imports.wbg.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
2043
+ console.warn(getObject(arg0));
2044
+ };
2045
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
2046
+ const ret = debugString(getObject(arg1));
2047
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
2048
+ const len1 = WASM_VECTOR_LEN;
2049
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2050
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2051
+ };
2052
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
2053
+ const ret = getObject(arg0) === undefined;
2054
+ return ret;
2055
+ };
2056
+ imports.wbg.__wbindgen_memory = function() {
2057
+ const ret = wasm.memory;
2058
+ return addHeapObject(ret);
2059
+ };
2060
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
2061
+ const obj = getObject(arg1);
2062
+ const ret = typeof(obj) === 'number' ? obj : undefined;
2063
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2064
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2065
+ };
2066
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
2067
+ const ret = getObject(arg0);
2068
+ return addHeapObject(ret);
2069
+ };
2070
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2071
+ takeObject(arg0);
2072
+ };
2073
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
2074
+ const obj = getObject(arg1);
2075
+ const ret = typeof(obj) === 'string' ? obj : undefined;
2076
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_2, wasm.__wbindgen_export_3);
2077
+ var len1 = WASM_VECTOR_LEN;
2078
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2079
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2080
+ };
2081
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
2082
+ const ret = getStringFromWasm0(arg0, arg1);
2083
+ return addHeapObject(ret);
2084
+ };
2085
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
2086
+ throw new Error(getStringFromWasm0(arg0, arg1));
2087
+ };
2088
+
2089
+ return imports;
2090
+ }
2091
+
2092
+ function __wbg_init_memory(imports, memory) {
2093
+
2094
+ }
2095
+
2096
+ function __wbg_finalize_init(instance, module) {
2097
+ wasm = instance.exports;
2098
+ __wbg_init.__wbindgen_wasm_module = module;
2099
+ cachedDataViewMemory0 = null;
2100
+ cachedFloat32ArrayMemory0 = null;
2101
+ cachedFloat64ArrayMemory0 = null;
2102
+ cachedUint32ArrayMemory0 = null;
2103
+ cachedUint8ArrayMemory0 = null;
2104
+
2105
+
2106
+ wasm.__wbindgen_start();
2107
+ return wasm;
2108
+ }
2109
+
2110
+ function initSync(module) {
2111
+ if (wasm !== undefined) return wasm;
2112
+
2113
+
2114
+ if (typeof module !== 'undefined') {
2115
+ if (Object.getPrototypeOf(module) === Object.prototype) {
2116
+ ({module} = module)
2117
+ } else {
2118
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
2119
+ }
2120
+ }
2121
+
2122
+ const imports = __wbg_get_imports();
2123
+
2124
+ __wbg_init_memory(imports);
2125
+
2126
+ if (!(module instanceof WebAssembly.Module)) {
2127
+ module = new WebAssembly.Module(module);
2128
+ }
2129
+
2130
+ const instance = new WebAssembly.Instance(module, imports);
2131
+
2132
+ return __wbg_finalize_init(instance, module);
2133
+ }
2134
+
2135
+ async function __wbg_init(module_or_path) {
2136
+ if (wasm !== undefined) return wasm;
2137
+
2138
+
2139
+ if (typeof module_or_path !== 'undefined') {
2140
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
2141
+ ({module_or_path} = module_or_path)
2142
+ } else {
2143
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
2144
+ }
2145
+ }
2146
+
2147
+ if (typeof module_or_path === 'undefined') {
2148
+ module_or_path = new URL('ruv_swarm_wasm_bg.wasm', import.meta.url);
2149
+ }
2150
+ const imports = __wbg_get_imports();
2151
+
2152
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
2153
+ module_or_path = fetch(module_or_path);
2154
+ }
2155
+
2156
+ __wbg_init_memory(imports);
2157
+
2158
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
2159
+
2160
+ return __wbg_finalize_init(instance, module);
2161
+ }
2162
+
2163
+ export { initSync };
2164
+ export default __wbg_init;