simple-agents-wasm 0.2.33 → 0.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-agents-wasm",
3
- "version": "0.2.33",
3
+ "version": "0.2.35",
4
4
  "description": "Browser-compatible SimpleAgents client for OpenAI-compatible providers",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -11,7 +11,7 @@
11
11
  "test": "node --test test/*.test.js"
12
12
  },
13
13
  "dependencies": {
14
- "yaml": "^2.5.1"
14
+ "yaml": "2.5.1"
15
15
  },
16
16
  "files": [
17
17
  "index.js",
@@ -27,14 +27,14 @@ export interface InitOutput {
27
27
  readonly wasmclient_runWorkflowYaml: (a: number, b: number, c: number, d: any) => [number, number, number];
28
28
  readonly wasmclient_runWorkflowYamlString: (a: number, b: number, c: number, d: any, e: number) => any;
29
29
  readonly wasmclient_streamEvents: (a: number, b: number, c: number, d: any, e: any, f: number) => any;
30
- readonly wasm_bindgen__closure__destroy__haab24713ba6d07cd: (a: number, b: number) => void;
31
- readonly wasm_bindgen__convert__closures_____invoke__h0653cfab9850c2f3: (a: number, b: number, c: any) => [number, number];
32
- readonly wasm_bindgen__convert__closures_____invoke__h133df7605c346924: (a: number, b: number, c: any, d: any) => void;
30
+ readonly wasm_bindgen__convert__closures_____invoke__h9f53f643b01d7c8e: (a: number, b: number, c: any) => [number, number];
31
+ readonly wasm_bindgen__convert__closures_____invoke__h05acb8c479b21d4b: (a: number, b: number, c: any, d: any) => void;
33
32
  readonly __wbindgen_malloc: (a: number, b: number) => number;
34
33
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
35
34
  readonly __wbindgen_exn_store: (a: number) => void;
36
35
  readonly __externref_table_alloc: () => number;
37
36
  readonly __wbindgen_externrefs: WebAssembly.Table;
37
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
38
38
  readonly __externref_table_dealloc: (a: number) => void;
39
39
  readonly __wbindgen_start: () => void;
40
40
  }
@@ -100,76 +100,76 @@ export function toJsArray(value) {
100
100
  function __wbg_get_imports() {
101
101
  const import0 = {
102
102
  __proto__: null,
103
- __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
103
+ __wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
104
104
  const ret = Error(getStringFromWasm0(arg0, arg1));
105
105
  return ret;
106
106
  },
107
- __wbg_Number_a5a435bd7bbec835: function(arg0) {
107
+ __wbg_Number_e6ffdb596c888833: function(arg0) {
108
108
  const ret = Number(arg0);
109
109
  return ret;
110
110
  },
111
- __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
111
+ __wbg___wbindgen_bigint_get_as_i64_2c5082002e4826e2: function(arg0, arg1) {
112
112
  const v = arg1;
113
113
  const ret = typeof(v) === 'bigint' ? v : undefined;
114
114
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
115
115
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
116
116
  },
117
- __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
117
+ __wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
118
118
  const v = arg0;
119
119
  const ret = typeof(v) === 'boolean' ? v : undefined;
120
120
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
121
121
  },
122
- __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
122
+ __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
123
123
  const ret = debugString(arg1);
124
124
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
125
125
  const len1 = WASM_VECTOR_LEN;
126
126
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
127
127
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
128
128
  },
129
- __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
129
+ __wbg___wbindgen_in_4bd7a57e54337366: function(arg0, arg1) {
130
130
  const ret = arg0 in arg1;
131
131
  return ret;
132
132
  },
133
- __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
133
+ __wbg___wbindgen_is_bigint_6c98f7e945dacdde: function(arg0) {
134
134
  const ret = typeof(arg0) === 'bigint';
135
135
  return ret;
136
136
  },
137
- __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
137
+ __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
138
138
  const ret = typeof(arg0) === 'function';
139
139
  return ret;
140
140
  },
141
- __wbg___wbindgen_is_null_0b605fc6b167c56f: function(arg0) {
141
+ __wbg___wbindgen_is_null_344c8750a8525473: function(arg0) {
142
142
  const ret = arg0 === null;
143
143
  return ret;
144
144
  },
145
- __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
145
+ __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
146
146
  const val = arg0;
147
147
  const ret = typeof(val) === 'object' && val !== null;
148
148
  return ret;
149
149
  },
150
- __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
150
+ __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
151
151
  const ret = typeof(arg0) === 'string';
152
152
  return ret;
153
153
  },
154
- __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
154
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
155
155
  const ret = arg0 === undefined;
156
156
  return ret;
157
157
  },
158
- __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
158
+ __wbg___wbindgen_jsval_eq_7d430e744a913d26: function(arg0, arg1) {
159
159
  const ret = arg0 === arg1;
160
160
  return ret;
161
161
  },
162
- __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
162
+ __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944: function(arg0, arg1) {
163
163
  const ret = arg0 == arg1;
164
164
  return ret;
165
165
  },
166
- __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
166
+ __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
167
167
  const obj = arg1;
168
168
  const ret = typeof(obj) === 'number' ? obj : undefined;
169
169
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
170
170
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
171
171
  },
172
- __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
172
+ __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
173
173
  const obj = arg1;
174
174
  const ret = typeof(obj) === 'string' ? obj : undefined;
175
175
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -177,49 +177,49 @@ function __wbg_get_imports() {
177
177
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
178
178
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
179
179
  },
180
- __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
180
+ __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
181
181
  throw new Error(getStringFromWasm0(arg0, arg1));
182
182
  },
183
- __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
183
+ __wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
184
184
  arg0._wbg_cb_unref();
185
185
  },
186
- __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
187
- const ret = arg0.call(arg1, arg2);
188
- return ret;
189
- }, arguments); },
190
- __wbg_call_dcc2662fa17a72cf: function() { return handleError(function (arg0, arg1, arg2, arg3) {
186
+ __wbg_call_368fa9c372d473ba: function() { return handleError(function (arg0, arg1, arg2, arg3) {
191
187
  const ret = arg0.call(arg1, arg2, arg3);
192
188
  return ret;
193
189
  }, arguments); },
194
- __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
190
+ __wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
195
191
  const ret = arg0.call(arg1);
196
192
  return ret;
197
193
  }, arguments); },
198
- __wbg_construct_526a6dedb187eba9: function() { return handleError(function (arg0, arg1) {
194
+ __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
195
+ const ret = arg0.call(arg1, arg2);
196
+ return ret;
197
+ }, arguments); },
198
+ __wbg_construct_adeb3d5948c3d19a: function() { return handleError(function (arg0, arg1) {
199
199
  const ret = Reflect.construct(arg0, arg1);
200
200
  return ret;
201
201
  }, arguments); },
202
- __wbg_done_08ce71ee07e3bd17: function(arg0) {
202
+ __wbg_done_547d467e97529006: function(arg0) {
203
203
  const ret = arg0.done;
204
204
  return ret;
205
205
  },
206
- __wbg_entries_e8a20ff8c9757101: function(arg0) {
206
+ __wbg_entries_616b1a459b85be0b: function(arg0) {
207
207
  const ret = Object.entries(arg0);
208
208
  return ret;
209
209
  },
210
- __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
210
+ __wbg_get_4848e350b40afc16: function(arg0, arg1) {
211
+ const ret = arg0[arg1 >>> 0];
212
+ return ret;
213
+ },
214
+ __wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
211
215
  const ret = Reflect.get(arg0, arg1);
212
216
  return ret;
213
217
  }, arguments); },
214
- __wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
218
+ __wbg_get_f96702c6245e4ef9: function() { return handleError(function (arg0, arg1) {
215
219
  const ret = Reflect.get(arg0, arg1);
216
220
  return ret;
217
221
  }, arguments); },
218
- __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
219
- const ret = arg0[arg1 >>> 0];
220
- return ret;
221
- },
222
- __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
222
+ __wbg_get_unchecked_7d7babe32e9e6a54: function(arg0, arg1) {
223
223
  const ret = arg0[arg1 >>> 0];
224
224
  return ret;
225
225
  },
@@ -227,7 +227,7 @@ function __wbg_get_imports() {
227
227
  const ret = arg0[arg1];
228
228
  return ret;
229
229
  },
230
- __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
230
+ __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
231
231
  let result;
232
232
  try {
233
233
  result = arg0 instanceof ArrayBuffer;
@@ -237,7 +237,7 @@ function __wbg_get_imports() {
237
237
  const ret = result;
238
238
  return ret;
239
239
  },
240
- __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
240
+ __wbg_instanceof_Map_a10a2795ef4bfe97: function(arg0) {
241
241
  let result;
242
242
  try {
243
243
  result = arg0 instanceof Map;
@@ -247,7 +247,7 @@ function __wbg_get_imports() {
247
247
  const ret = result;
248
248
  return ret;
249
249
  },
250
- __wbg_instanceof_Promise_7c3bdd7805c2c6e6: function(arg0) {
250
+ __wbg_instanceof_Promise_95d523058012a13d: function(arg0) {
251
251
  let result;
252
252
  try {
253
253
  result = arg0 instanceof Promise;
@@ -257,7 +257,7 @@ function __wbg_get_imports() {
257
257
  const ret = result;
258
258
  return ret;
259
259
  },
260
- __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
260
+ __wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
261
261
  let result;
262
262
  try {
263
263
  result = arg0 instanceof Uint8Array;
@@ -267,54 +267,54 @@ function __wbg_get_imports() {
267
267
  const ret = result;
268
268
  return ret;
269
269
  },
270
- __wbg_isArray_33b91feb269ff46e: function(arg0) {
270
+ __wbg_isArray_db61795ad004c139: function(arg0) {
271
271
  const ret = Array.isArray(arg0);
272
272
  return ret;
273
273
  },
274
- __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
274
+ __wbg_isSafeInteger_ea83862ba994770c: function(arg0) {
275
275
  const ret = Number.isSafeInteger(arg0);
276
276
  return ret;
277
277
  },
278
- __wbg_iterator_d8f549ec8fb061b1: function() {
278
+ __wbg_iterator_de403ef31815a3e6: function() {
279
279
  const ret = Symbol.iterator;
280
280
  return ret;
281
281
  },
282
- __wbg_length_b3416cf66a5452c8: function(arg0) {
282
+ __wbg_length_0c32cb8543c8e4c8: function(arg0) {
283
283
  const ret = arg0.length;
284
284
  return ret;
285
285
  },
286
- __wbg_length_ea16607d7b61445b: function(arg0) {
286
+ __wbg_length_6e821edde497a532: function(arg0) {
287
287
  const ret = arg0.length;
288
288
  return ret;
289
289
  },
290
- __wbg_new_49d5571bd3f0c4d4: function() {
291
- const ret = new Map();
290
+ __wbg_new_4f9fafbb3909af72: function() {
291
+ const ret = new Object();
292
292
  return ret;
293
293
  },
294
- __wbg_new_5f486cdf45a04d78: function(arg0) {
295
- const ret = new Uint8Array(arg0);
294
+ __wbg_new_99cabae501c0a8a0: function() {
295
+ const ret = new Map();
296
296
  return ret;
297
297
  },
298
- __wbg_new_a70fbab9066b301f: function() {
299
- const ret = new Array();
298
+ __wbg_new_a560378ea1240b14: function(arg0) {
299
+ const ret = new Uint8Array(arg0);
300
300
  return ret;
301
301
  },
302
- __wbg_new_ab79df5bd7c26067: function() {
303
- const ret = new Object();
302
+ __wbg_new_e3b04b4d53d1b593: function(arg0, arg1) {
303
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
304
304
  return ret;
305
305
  },
306
- __wbg_new_d15cb560a6a0e5f0: function(arg0, arg1) {
307
- const ret = new Error(getStringFromWasm0(arg0, arg1));
306
+ __wbg_new_f3c9df4f38f3f798: function() {
307
+ const ret = new Array();
308
308
  return ret;
309
309
  },
310
- __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
310
+ __wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
311
311
  try {
312
312
  var state0 = {a: arg0, b: arg1};
313
313
  var cb0 = (arg0, arg1) => {
314
314
  const a = state0.a;
315
315
  state0.a = 0;
316
316
  try {
317
- return wasm_bindgen__convert__closures_____invoke__h133df7605c346924(a, state0.b, arg0, arg1);
317
+ return wasm_bindgen__convert__closures_____invoke__h05acb8c479b21d4b(a, state0.b, arg0, arg1);
318
318
  } finally {
319
319
  state0.a = a;
320
320
  }
@@ -322,80 +322,80 @@ function __wbg_get_imports() {
322
322
  const ret = new Promise(cb0);
323
323
  return ret;
324
324
  } finally {
325
- state0.a = state0.b = 0;
325
+ state0.a = 0;
326
326
  }
327
327
  },
328
- __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
329
- const ret = arg0.next();
330
- return ret;
331
- }, arguments); },
332
- __wbg_next_e01a967809d1aa68: function(arg0) {
328
+ __wbg_next_01132ed6134b8ef5: function(arg0) {
333
329
  const ret = arg0.next;
334
330
  return ret;
335
331
  },
336
- __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
332
+ __wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
333
+ const ret = arg0.next();
334
+ return ret;
335
+ }, arguments); },
336
+ __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
337
337
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
338
338
  },
339
- __wbg_push_e87b0e732085a946: function(arg0, arg1) {
339
+ __wbg_push_6bdbc990be5ac37b: function(arg0, arg1) {
340
340
  const ret = arg0.push(arg1);
341
341
  return ret;
342
342
  },
343
- __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
343
+ __wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
344
344
  const ret = arg0.queueMicrotask;
345
345
  return ret;
346
346
  },
347
- __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
347
+ __wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
348
348
  queueMicrotask(arg0);
349
349
  },
350
- __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
350
+ __wbg_resolve_0a79de24e9d2267b: function(arg0) {
351
351
  const ret = Promise.resolve(arg0);
352
352
  return ret;
353
353
  },
354
- __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
355
- arg0[arg1 >>> 0] = arg2;
354
+ __wbg_set_08463b1df38a7e29: function(arg0, arg1, arg2) {
355
+ const ret = arg0.set(arg1, arg2);
356
+ return ret;
356
357
  },
357
358
  __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
358
359
  arg0[arg1] = arg2;
359
360
  },
360
- __wbg_set_7eaa4f96924fd6b3: function() { return handleError(function (arg0, arg1, arg2) {
361
+ __wbg_set_6c60b2e8ad0e9383: function(arg0, arg1, arg2) {
362
+ arg0[arg1 >>> 0] = arg2;
363
+ },
364
+ __wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
361
365
  const ret = Reflect.set(arg0, arg1, arg2);
362
366
  return ret;
363
367
  }, arguments); },
364
- __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
365
- const ret = arg0.set(arg1, arg2);
366
- return ret;
367
- },
368
- __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
369
- const ret = typeof global === 'undefined' ? null : global;
368
+ __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
369
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
370
370
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
371
371
  },
372
- __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
373
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
372
+ __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
373
+ const ret = typeof global === 'undefined' ? null : global;
374
374
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
375
375
  },
376
- __wbg_static_accessor_SELF_f207c857566db248: function() {
376
+ __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
377
377
  const ret = typeof self === 'undefined' ? null : self;
378
378
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
379
379
  },
380
- __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
380
+ __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
381
381
  const ret = typeof window === 'undefined' ? null : window;
382
382
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
383
383
  },
384
- __wbg_then_098abe61755d12f6: function(arg0, arg1) {
385
- const ret = arg0.then(arg1);
384
+ __wbg_then_00eed3ac0b8e82cb: function(arg0, arg1, arg2) {
385
+ const ret = arg0.then(arg1, arg2);
386
386
  return ret;
387
387
  },
388
- __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
389
- const ret = arg0.then(arg1, arg2);
388
+ __wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
389
+ const ret = arg0.then(arg1);
390
390
  return ret;
391
391
  },
392
- __wbg_value_21fc78aab0322612: function(arg0) {
392
+ __wbg_value_7f6052747ccf940f: function(arg0) {
393
393
  const ret = arg0.value;
394
394
  return ret;
395
395
  },
396
396
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
397
- // Cast intrinsic for `Closure(Closure { dtor_idx: 106, function: Function { arguments: [Externref], shim_idx: 107, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
398
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__haab24713ba6d07cd, wasm_bindgen__convert__closures_____invoke__h0653cfab9850c2f3);
397
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 146, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
398
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h9f53f643b01d7c8e);
399
399
  return ret;
400
400
  },
401
401
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -434,15 +434,15 @@ function __wbg_get_imports() {
434
434
  };
435
435
  }
436
436
 
437
- function wasm_bindgen__convert__closures_____invoke__h0653cfab9850c2f3(arg0, arg1, arg2) {
438
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h0653cfab9850c2f3(arg0, arg1, arg2);
437
+ function wasm_bindgen__convert__closures_____invoke__h9f53f643b01d7c8e(arg0, arg1, arg2) {
438
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h9f53f643b01d7c8e(arg0, arg1, arg2);
439
439
  if (ret[1]) {
440
440
  throw takeFromExternrefTable0(ret[0]);
441
441
  }
442
442
  }
443
443
 
444
- function wasm_bindgen__convert__closures_____invoke__h133df7605c346924(arg0, arg1, arg2, arg3) {
445
- wasm.wasm_bindgen__convert__closures_____invoke__h133df7605c346924(arg0, arg1, arg2, arg3);
444
+ function wasm_bindgen__convert__closures_____invoke__h05acb8c479b21d4b(arg0, arg1, arg2, arg3) {
445
+ wasm.wasm_bindgen__convert__closures_____invoke__h05acb8c479b21d4b(arg0, arg1, arg2, arg3);
446
446
  }
447
447
 
448
448
  const WasmClientFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -457,7 +457,7 @@ function addToExternrefTable0(obj) {
457
457
 
458
458
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
459
459
  ? { register: () => {}, unregister: () => {} }
460
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
460
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
461
461
 
462
462
  function debugString(val) {
463
463
  // primitive types
@@ -563,8 +563,8 @@ function isLikeNone(x) {
563
563
  return x === undefined || x === null;
564
564
  }
565
565
 
566
- function makeMutClosure(arg0, arg1, dtor, f) {
567
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
566
+ function makeMutClosure(arg0, arg1, f) {
567
+ const state = { a: arg0, b: arg1, cnt: 1 };
568
568
  const real = (...args) => {
569
569
 
570
570
  // First up with a closure we increment the internal reference
@@ -582,7 +582,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
582
582
  };
583
583
  real._wbg_cb_unref = () => {
584
584
  if (--state.cnt === 0) {
585
- state.dtor(state.a, state.b);
585
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
586
586
  state.a = 0;
587
587
  CLOSURE_DTORS.unregister(state);
588
588
  }
Binary file
@@ -9,13 +9,13 @@ export const wasmclient_new: (a: number, b: number, c: any) => [number, number,
9
9
  export const wasmclient_runWorkflowYaml: (a: number, b: number, c: number, d: any) => [number, number, number];
10
10
  export const wasmclient_runWorkflowYamlString: (a: number, b: number, c: number, d: any, e: number) => any;
11
11
  export const wasmclient_streamEvents: (a: number, b: number, c: number, d: any, e: any, f: number) => any;
12
- export const wasm_bindgen__closure__destroy__haab24713ba6d07cd: (a: number, b: number) => void;
13
- export const wasm_bindgen__convert__closures_____invoke__h0653cfab9850c2f3: (a: number, b: number, c: any) => [number, number];
14
- export const wasm_bindgen__convert__closures_____invoke__h133df7605c346924: (a: number, b: number, c: any, d: any) => void;
12
+ export const wasm_bindgen__convert__closures_____invoke__h9f53f643b01d7c8e: (a: number, b: number, c: any) => [number, number];
13
+ export const wasm_bindgen__convert__closures_____invoke__h05acb8c479b21d4b: (a: number, b: number, c: any, d: any) => void;
15
14
  export const __wbindgen_malloc: (a: number, b: number) => number;
16
15
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
17
16
  export const __wbindgen_exn_store: (a: number) => void;
18
17
  export const __externref_table_alloc: () => number;
19
18
  export const __wbindgen_externrefs: WebAssembly.Table;
19
+ export const __wbindgen_destroy_closure: (a: number, b: number) => void;
20
20
  export const __externref_table_dealloc: (a: number) => void;
21
21
  export const __wbindgen_start: () => void;
@@ -8,7 +8,8 @@ export async function loadRustModule() {
8
8
  const wasmUrl = new URL("../pkg/simple_agents_wasm_bg.wasm", import.meta.url);
9
9
  await moduleValue.default({ module_or_path: wasmUrl });
10
10
  return moduleValue;
11
- } catch {
11
+ } catch (error) {
12
+ console.debug("[simple-agents-wasm] Rust module unavailable, falling back to JS runtime", error);
12
13
  return null;
13
14
  }
14
15
  })();
package/runtime/stream.js CHANGED
@@ -10,20 +10,20 @@ export function createStreamAggregator(model) {
10
10
  }
11
11
 
12
12
  export function applyDeltaToAggregate(state, delta) {
13
- if (!state || !delta) {
13
+ if (state === null || state === undefined || delta === null || delta === undefined) {
14
14
  return;
15
15
  }
16
16
 
17
- if (!state.responseId && delta.id) {
17
+ if (state.responseId === "" && delta.id !== null && delta.id !== undefined) {
18
18
  state.responseId = delta.id;
19
19
  }
20
- if (delta.model) {
20
+ if (delta.model !== null && delta.model !== undefined) {
21
21
  state.responseModel = delta.model;
22
22
  }
23
- if (delta.content) {
23
+ if (delta.content !== null && delta.content !== undefined) {
24
24
  state.aggregate += delta.content;
25
25
  }
26
- if (delta.finishReason) {
26
+ if (delta.finishReason !== null && delta.finishReason !== undefined) {
27
27
  state.finishReason = delta.finishReason;
28
28
  }
29
29
  }
@@ -61,8 +61,8 @@ export function createStreamEventBridge(model, onChunk) {
61
61
  mergeResult(result, started) {
62
62
  return {
63
63
  ...result,
64
- id: result.id || aggregateState.responseId,
65
- model: result.model || aggregateState.responseModel,
64
+ id: result.id ?? aggregateState.responseId,
65
+ model: result.model ?? aggregateState.responseModel,
66
66
  content: result.content ?? aggregateState.aggregate,
67
67
  finishReason: result.finishReason ?? aggregateState.finishReason,
68
68
  latencyMs: Math.max(0, Math.round(performance.now() - started))
@@ -109,28 +109,32 @@ export async function* iterateSse(response) {
109
109
  const decoder = new TextDecoder();
110
110
  let buffer = "";
111
111
 
112
- while (true) {
113
- const { value, done } = await reader.read();
114
- if (done) {
115
- break;
116
- }
112
+ try {
113
+ while (true) {
114
+ const { value, done } = await reader.read();
115
+ if (done) {
116
+ break;
117
+ }
117
118
 
118
- buffer += normalizeSseChunk(decoder.decode(value, { stream: true }));
119
- let delimiterIndex = buffer.indexOf("\n\n");
120
- while (delimiterIndex !== -1) {
121
- const block = buffer.slice(0, delimiterIndex).trim();
122
- buffer = buffer.slice(delimiterIndex + 2);
123
- if (block.length > 0) {
124
- yield block;
119
+ buffer += normalizeSseChunk(decoder.decode(value, { stream: true }));
120
+ let delimiterIndex = buffer.indexOf("\n\n");
121
+ while (delimiterIndex !== -1) {
122
+ const block = buffer.slice(0, delimiterIndex).trim();
123
+ buffer = buffer.slice(delimiterIndex + 2);
124
+ if (block.length > 0) {
125
+ yield block;
126
+ }
127
+ delimiterIndex = buffer.indexOf("\n\n");
125
128
  }
126
- delimiterIndex = buffer.indexOf("\n\n");
127
129
  }
128
- }
129
130
 
130
- buffer += normalizeSseChunk(decoder.decode());
131
+ buffer += normalizeSseChunk(decoder.decode());
131
132
 
132
- const trailing = buffer.trim();
133
- if (trailing.length > 0) {
134
- yield trailing;
133
+ const trailing = buffer.trim();
134
+ if (trailing.length > 0) {
135
+ yield trailing;
136
+ }
137
+ } finally {
138
+ reader.releaseLock();
135
139
  }
136
140
  }
package/rust/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "simple-agents-wasm-rust"
3
- version = "0.2.33"
3
+ version = "0.2.35"
4
4
  edition = "2021"
5
5
  license = "MIT OR Apache-2.0"
6
6