@diaryx/wasm-node 1.4.1 → 1.4.3-dev.b07751e

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/diaryx_wasm.d.ts CHANGED
@@ -164,12 +164,6 @@ export class DiaryxBackend {
164
164
  * ```
165
165
  */
166
166
  execute(command_json: string): Promise<string>;
167
- /**
168
- * Execute a command from a JavaScript object directly.
169
- *
170
- * This avoids JSON serialization overhead for better performance.
171
- */
172
- executeJs(command: any): Promise<any>;
173
167
  /**
174
168
  * Check if this backend has native sync support.
175
169
  * Always false — sync is handled by the Extism sync plugin loaded at runtime.
@@ -294,7 +288,6 @@ export interface InitOutput {
294
288
  readonly diaryxbackend_emitFileSystemEvent: (a: number, b: number, c: number) => [number, number];
295
289
  readonly diaryxbackend_eventSubscriberCount: (a: number) => number;
296
290
  readonly diaryxbackend_execute: (a: number, b: number, c: number) => any;
297
- readonly diaryxbackend_executeJs: (a: number, b: any) => any;
298
291
  readonly diaryxbackend_hasNativeSync: (a: number) => number;
299
292
  readonly diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
300
293
  readonly diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
@@ -307,14 +300,14 @@ export interface InitOutput {
307
300
  readonly today_formatted: (a: number, b: number) => [number, number];
308
301
  readonly init: () => void;
309
302
  readonly diaryxbackend_isCrdtEnabled: (a: number) => number;
310
- readonly wasm_bindgen__closure__destroy__hc0ecfed3f77ea255: (a: number, b: number) => void;
311
- readonly wasm_bindgen__convert__closures_____invoke__h2b2515b80a4dcf5e: (a: number, b: number, c: any) => [number, number];
312
- readonly wasm_bindgen__convert__closures_____invoke__h229fb34ceaba2930: (a: number, b: number, c: any, d: any) => void;
303
+ readonly wasm_bindgen__convert__closures_____invoke__h31e41fe17a163321: (a: number, b: number, c: any) => [number, number];
304
+ readonly wasm_bindgen__convert__closures_____invoke__h186c6127932ad571: (a: number, b: number, c: any, d: any) => void;
313
305
  readonly __wbindgen_malloc: (a: number, b: number) => number;
314
306
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
315
307
  readonly __wbindgen_exn_store: (a: number) => void;
316
308
  readonly __externref_table_alloc: () => number;
317
309
  readonly __wbindgen_externrefs: WebAssembly.Table;
310
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
318
311
  readonly __externref_table_dealloc: (a: number) => void;
319
312
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
320
313
  readonly __wbindgen_start: () => void;
package/diaryx_wasm.js CHANGED
@@ -126,17 +126,6 @@ export class DiaryxBackend {
126
126
  const ret = wasm.diaryxbackend_execute(this.__wbg_ptr, ptr0, len0);
127
127
  return ret;
128
128
  }
129
- /**
130
- * Execute a command from a JavaScript object directly.
131
- *
132
- * This avoids JSON serialization overhead for better performance.
133
- * @param {any} command
134
- * @returns {Promise<any>}
135
- */
136
- executeJs(command) {
137
- const ret = wasm.diaryxbackend_executeJs(this.__wbg_ptr, command);
138
- return ret;
139
- }
140
129
  /**
141
130
  * Check if this backend has native sync support.
142
131
  * Always false — sync is handled by the Extism sync plugin loaded at runtime.
@@ -340,79 +329,26 @@ export function today_formatted(format) {
340
329
  function __wbg_get_imports() {
341
330
  const import0 = {
342
331
  __proto__: null,
343
- __wbg_Error_83742b46f01ce22d: function(arg0, arg1) {
344
- const ret = Error(getStringFromWasm0(arg0, arg1));
345
- return ret;
346
- },
347
- __wbg_Number_a5a435bd7bbec835: function(arg0) {
348
- const ret = Number(arg0);
349
- return ret;
350
- },
351
- __wbg_String_8564e559799eccda: function(arg0, arg1) {
352
- const ret = String(arg1);
353
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
354
- const len1 = WASM_VECTOR_LEN;
355
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
356
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
357
- },
358
- __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
359
- const v = arg1;
360
- const ret = typeof(v) === 'bigint' ? v : undefined;
361
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
362
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
363
- },
364
- __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
332
+ __wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
365
333
  const v = arg0;
366
334
  const ret = typeof(v) === 'boolean' ? v : undefined;
367
335
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
368
336
  },
369
- __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
370
- const ret = debugString(arg1);
371
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
372
- const len1 = WASM_VECTOR_LEN;
373
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
374
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
375
- },
376
- __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
377
- const ret = arg0 in arg1;
378
- return ret;
379
- },
380
- __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
381
- const ret = typeof(arg0) === 'bigint';
382
- return ret;
383
- },
384
- __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
337
+ __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
385
338
  const ret = typeof(arg0) === 'function';
386
339
  return ret;
387
340
  },
388
- __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
389
- const val = arg0;
390
- const ret = typeof(val) === 'object' && val !== null;
391
- return ret;
392
- },
393
- __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
394
- const ret = typeof(arg0) === 'string';
395
- return ret;
396
- },
397
- __wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
341
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
398
342
  const ret = arg0 === undefined;
399
343
  return ret;
400
344
  },
401
- __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
402
- const ret = arg0 === arg1;
403
- return ret;
404
- },
405
- __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
406
- const ret = arg0 == arg1;
407
- return ret;
408
- },
409
- __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
345
+ __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
410
346
  const obj = arg1;
411
347
  const ret = typeof(obj) === 'number' ? obj : undefined;
412
348
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
413
349
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
414
350
  },
415
- __wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
351
+ __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
416
352
  const obj = arg1;
417
353
  const ret = typeof(obj) === 'string' ? obj : undefined;
418
354
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -420,106 +356,62 @@ function __wbg_get_imports() {
420
356
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
421
357
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
422
358
  },
423
- __wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
359
+ __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
424
360
  throw new Error(getStringFromWasm0(arg0, arg1));
425
361
  },
426
- __wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
362
+ __wbg__wbg_cb_unref_3c3b4f651835fbcb: function(arg0) {
427
363
  arg0._wbg_cb_unref();
428
364
  },
429
- __wbg_apply_ac9afb97ca32f169: function() { return handleError(function (arg0, arg1, arg2) {
365
+ __wbg_apply_fa9bf5e5ce151732: function() { return handleError(function (arg0, arg1, arg2) {
430
366
  const ret = arg0.apply(arg1, arg2);
431
367
  return ret;
432
368
  }, arguments); },
433
- __wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
434
- const ret = arg0.call(arg1, arg2);
435
- return ret;
436
- }, arguments); },
437
- __wbg_call_dcc2662fa17a72cf: function() { return handleError(function (arg0, arg1, arg2, arg3) {
369
+ __wbg_call_368fa9c372d473ba: function() { return handleError(function (arg0, arg1, arg2, arg3) {
438
370
  const ret = arg0.call(arg1, arg2, arg3);
439
371
  return ret;
440
372
  }, arguments); },
441
- __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
373
+ __wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
442
374
  const ret = arg0.call(arg1);
443
375
  return ret;
444
376
  }, arguments); },
445
- __wbg_call_f858478a02f9600f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
377
+ __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {
378
+ const ret = arg0.call(arg1, arg2);
379
+ return ret;
380
+ }, arguments); },
381
+ __wbg_call_f2ac1622600b957f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
446
382
  const ret = arg0.call(arg1, arg2, arg3, arg4);
447
383
  return ret;
448
384
  }, arguments); },
449
- __wbg_debug_271c16e6de0bc226: function(arg0, arg1, arg2, arg3) {
385
+ __wbg_debug_58754cc8dbfec7ec: function(arg0, arg1, arg2, arg3) {
450
386
  console.debug(arg0, arg1, arg2, arg3);
451
387
  },
452
388
  __wbg_diaryxbackend_new: function(arg0) {
453
389
  const ret = DiaryxBackend.__wrap(arg0);
454
390
  return ret;
455
391
  },
456
- __wbg_done_08ce71ee07e3bd17: function(arg0) {
457
- const ret = arg0.done;
458
- return ret;
459
- },
460
- __wbg_entries_e8a20ff8c9757101: function(arg0) {
461
- const ret = Object.entries(arg0);
462
- return ret;
463
- },
464
- __wbg_error_1eece6b0039034ce: function(arg0, arg1, arg2, arg3) {
392
+ __wbg_error_f8d1622cb1d8c53c: function(arg0, arg1, arg2, arg3) {
465
393
  console.error(arg0, arg1, arg2, arg3);
466
394
  },
467
- __wbg_fromCodePoint_4a02c6dcced1d233: function() { return handleError(function (arg0) {
468
- const ret = String.fromCodePoint(arg0 >>> 0);
469
- return ret;
470
- }, arguments); },
471
- __wbg_getTime_1dad7b5386ddd2d9: function(arg0) {
395
+ __wbg_getTime_f6ac312467f7cf09: function(arg0) {
472
396
  const ret = arg0.getTime();
473
397
  return ret;
474
398
  },
475
- __wbg_getTimezoneOffset_639bcf2dde21158b: function(arg0) {
399
+ __wbg_getTimezoneOffset_ac5be603b21a5797: function(arg0) {
476
400
  const ret = arg0.getTimezoneOffset();
477
401
  return ret;
478
402
  },
479
- __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
480
- const ret = Reflect.get(arg0, arg1);
481
- return ret;
482
- }, arguments); },
483
- __wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
484
- const ret = Reflect.get(arg0, arg1);
485
- return ret;
486
- }, arguments); },
487
- __wbg_get_a8ee5c45dabc1b3b: function(arg0, arg1) {
488
- const ret = arg0[arg1 >>> 0];
489
- return ret;
490
- },
491
- __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
403
+ __wbg_get_4848e350b40afc16: function(arg0, arg1) {
492
404
  const ret = arg0[arg1 >>> 0];
493
405
  return ret;
494
406
  },
495
- __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
496
- const ret = arg0[arg1];
407
+ __wbg_get_f96702c6245e4ef9: function() { return handleError(function (arg0, arg1) {
408
+ const ret = Reflect.get(arg0, arg1);
497
409
  return ret;
498
- },
499
- __wbg_info_0194681687b5ab04: function(arg0, arg1, arg2, arg3) {
410
+ }, arguments); },
411
+ __wbg_info_8e80eb6c0f1d9449: function(arg0, arg1, arg2, arg3) {
500
412
  console.info(arg0, arg1, arg2, arg3);
501
413
  },
502
- __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
503
- let result;
504
- try {
505
- result = arg0 instanceof ArrayBuffer;
506
- } catch (_) {
507
- result = false;
508
- }
509
- const ret = result;
510
- return ret;
511
- },
512
- __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
513
- let result;
514
- try {
515
- result = arg0 instanceof Map;
516
- } catch (_) {
517
- result = false;
518
- }
519
- const ret = result;
520
- return ret;
521
- },
522
- __wbg_instanceof_Object_be1962063fcc0c9f: function(arg0) {
414
+ __wbg_instanceof_Object_72ee0c53dd8f0726: function(arg0) {
523
415
  let result;
524
416
  try {
525
417
  result = arg0 instanceof Object;
@@ -529,7 +421,7 @@ function __wbg_get_imports() {
529
421
  const ret = result;
530
422
  return ret;
531
423
  },
532
- __wbg_instanceof_Promise_7c3bdd7805c2c6e6: function(arg0) {
424
+ __wbg_instanceof_Promise_95d523058012a13d: function(arg0) {
533
425
  let result;
534
426
  try {
535
427
  result = arg0 instanceof Promise;
@@ -539,7 +431,7 @@ function __wbg_get_imports() {
539
431
  const ret = result;
540
432
  return ret;
541
433
  },
542
- __wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
434
+ __wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
543
435
  let result;
544
436
  try {
545
437
  result = arg0 instanceof Uint8Array;
@@ -549,65 +441,45 @@ function __wbg_get_imports() {
549
441
  const ret = result;
550
442
  return ret;
551
443
  },
552
- __wbg_isArray_33b91feb269ff46e: function(arg0) {
444
+ __wbg_isArray_db61795ad004c139: function(arg0) {
553
445
  const ret = Array.isArray(arg0);
554
446
  return ret;
555
447
  },
556
- __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
557
- const ret = Number.isSafeInteger(arg0);
558
- return ret;
559
- },
560
- __wbg_iterator_d8f549ec8fb061b1: function() {
561
- const ret = Symbol.iterator;
562
- return ret;
563
- },
564
- __wbg_length_b3416cf66a5452c8: function(arg0) {
448
+ __wbg_length_0c32cb8543c8e4c8: function(arg0) {
565
449
  const ret = arg0.length;
566
450
  return ret;
567
451
  },
568
- __wbg_length_ea16607d7b61445b: function(arg0) {
452
+ __wbg_length_6e821edde497a532: function(arg0) {
569
453
  const ret = arg0.length;
570
454
  return ret;
571
455
  },
572
- __wbg_log_70972330cfc941dd: function(arg0, arg1, arg2, arg3) {
456
+ __wbg_log_dafe9ed5100e3a8c: function(arg0, arg1, arg2, arg3) {
573
457
  console.log(arg0, arg1, arg2, arg3);
574
458
  },
575
- __wbg_new_0_1dcafdf5e786e876: function() {
459
+ __wbg_new_0_bfa2ef4bc447daa2: function() {
576
460
  const ret = new Date();
577
461
  return ret;
578
462
  },
579
- __wbg_new_49d5571bd3f0c4d4: function() {
580
- const ret = new Map();
581
- return ret;
582
- },
583
- __wbg_new_5f486cdf45a04d78: function(arg0) {
584
- const ret = new Uint8Array(arg0);
463
+ __wbg_new_0f6d2ddfe083319b: function(arg0) {
464
+ const ret = new Date(arg0);
585
465
  return ret;
586
466
  },
587
- __wbg_new_a70fbab9066b301f: function() {
467
+ __wbg_new_f3c9df4f38f3f798: function() {
588
468
  const ret = new Array();
589
469
  return ret;
590
470
  },
591
- __wbg_new_ab79df5bd7c26067: function() {
592
- const ret = new Object();
593
- return ret;
594
- },
595
- __wbg_new_fd94ca5c9639abd2: function(arg0) {
596
- const ret = new Date(arg0);
597
- return ret;
598
- },
599
- __wbg_new_from_slice_22da9388ac046e50: function(arg0, arg1) {
471
+ __wbg_new_from_slice_2580ff33d0d10520: function(arg0, arg1) {
600
472
  const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
601
473
  return ret;
602
474
  },
603
- __wbg_new_typed_aaaeaf29cf802876: function(arg0, arg1) {
475
+ __wbg_new_typed_14d7cc391ce53d2c: function(arg0, arg1) {
604
476
  try {
605
477
  var state0 = {a: arg0, b: arg1};
606
478
  var cb0 = (arg0, arg1) => {
607
479
  const a = state0.a;
608
480
  state0.a = 0;
609
481
  try {
610
- return wasm_bindgen__convert__closures_____invoke__h229fb34ceaba2930(a, state0.b, arg0, arg1);
482
+ return wasm_bindgen__convert__closures_____invoke__h186c6127932ad571(a, state0.b, arg0, arg1);
611
483
  } finally {
612
484
  state0.a = a;
613
485
  }
@@ -615,90 +487,68 @@ function __wbg_get_imports() {
615
487
  const ret = new Promise(cb0);
616
488
  return ret;
617
489
  } finally {
618
- state0.a = state0.b = 0;
490
+ state0.a = 0;
619
491
  }
620
492
  },
621
- __wbg_new_with_length_825018a1616e9e55: function(arg0) {
493
+ __wbg_new_with_length_9cedd08484b73942: function(arg0) {
622
494
  const ret = new Uint8Array(arg0 >>> 0);
623
495
  return ret;
624
496
  },
625
- __wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
626
- const ret = arg0.next();
627
- return ret;
628
- }, arguments); },
629
- __wbg_next_e01a967809d1aa68: function(arg0) {
630
- const ret = arg0.next;
631
- return ret;
632
- },
633
- __wbg_prototypesetcall_d62e5099504357e6: function(arg0, arg1, arg2) {
497
+ __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
634
498
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
635
499
  },
636
- __wbg_push_e87b0e732085a946: function(arg0, arg1) {
500
+ __wbg_push_6bdbc990be5ac37b: function(arg0, arg1) {
637
501
  const ret = arg0.push(arg1);
638
502
  return ret;
639
503
  },
640
- __wbg_queueMicrotask_0c399741342fb10f: function(arg0) {
504
+ __wbg_queueMicrotask_abaf92f0bd4e80a4: function(arg0) {
641
505
  const ret = arg0.queueMicrotask;
642
506
  return ret;
643
507
  },
644
- __wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
508
+ __wbg_queueMicrotask_df5a6dac26d818f3: function(arg0) {
645
509
  queueMicrotask(arg0);
646
510
  },
647
- __wbg_resolve_ae8d83246e5bcc12: function(arg0) {
511
+ __wbg_resolve_0a79de24e9d2267b: function(arg0) {
648
512
  const ret = Promise.resolve(arg0);
649
513
  return ret;
650
514
  },
651
- __wbg_set_282384002438957f: function(arg0, arg1, arg2) {
652
- arg0[arg1 >>> 0] = arg2;
653
- },
654
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
655
- arg0[arg1] = arg2;
656
- },
657
- __wbg_set_8c0b3ffcf05d61c2: function(arg0, arg1, arg2) {
515
+ __wbg_set_16a9c1a07b3d38ec: function(arg0, arg1, arg2) {
658
516
  arg0.set(getArrayU8FromWasm0(arg1, arg2));
659
517
  },
660
- __wbg_set_bf7251625df30a02: function(arg0, arg1, arg2) {
661
- const ret = arg0.set(arg1, arg2);
662
- return ret;
663
- },
664
- __wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
665
- const ret = typeof global === 'undefined' ? null : global;
518
+ __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
519
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
666
520
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
667
521
  },
668
- __wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
669
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
522
+ __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
523
+ const ret = typeof global === 'undefined' ? null : global;
670
524
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
671
525
  },
672
- __wbg_static_accessor_SELF_f207c857566db248: function() {
526
+ __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
673
527
  const ret = typeof self === 'undefined' ? null : self;
674
528
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
675
529
  },
676
- __wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
530
+ __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
677
531
  const ret = typeof window === 'undefined' ? null : window;
678
532
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
679
533
  },
680
- __wbg_then_098abe61755d12f6: function(arg0, arg1) {
681
- const ret = arg0.then(arg1);
682
- return ret;
683
- },
684
- __wbg_then_9e335f6dd892bc11: function(arg0, arg1, arg2) {
534
+ __wbg_then_00eed3ac0b8e82cb: function(arg0, arg1, arg2) {
685
535
  const ret = arg0.then(arg1, arg2);
686
536
  return ret;
687
537
  },
688
- __wbg_toString_3272fa0dfd05dd87: function(arg0) {
689
- const ret = arg0.toString();
538
+ __wbg_then_a0c8db0381c8994c: function(arg0, arg1) {
539
+ const ret = arg0.then(arg1);
690
540
  return ret;
691
541
  },
692
- __wbg_value_21fc78aab0322612: function(arg0) {
693
- const ret = arg0.value;
542
+ __wbg_toString_891d991e862e1d44: function(arg0) {
543
+ const ret = arg0.toString();
694
544
  return ret;
695
545
  },
696
- __wbg_warn_809cad1bfc2b3a42: function(arg0, arg1, arg2, arg3) {
546
+ __wbg_warn_b5013c1036317367: function(arg0, arg1, arg2, arg3) {
697
547
  console.warn(arg0, arg1, arg2, arg3);
698
548
  },
699
549
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
700
- // Cast intrinsic for `Closure(Closure { dtor_idx: 439, function: Function { arguments: [Externref], shim_idx: 440, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
701
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hc0ecfed3f77ea255, wasm_bindgen__convert__closures_____invoke__h2b2515b80a4dcf5e);
550
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 504, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
551
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h31e41fe17a163321);
702
552
  return ret;
703
553
  },
704
554
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -706,21 +556,11 @@ function __wbg_get_imports() {
706
556
  const ret = arg0;
707
557
  return ret;
708
558
  },
709
- __wbindgen_cast_0000000000000003: function(arg0) {
710
- // Cast intrinsic for `I64 -> Externref`.
711
- const ret = arg0;
712
- return ret;
713
- },
714
- __wbindgen_cast_0000000000000004: function(arg0, arg1) {
559
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
715
560
  // Cast intrinsic for `Ref(String) -> Externref`.
716
561
  const ret = getStringFromWasm0(arg0, arg1);
717
562
  return ret;
718
563
  },
719
- __wbindgen_cast_0000000000000005: function(arg0) {
720
- // Cast intrinsic for `U64 -> Externref`.
721
- const ret = BigInt.asUintN(64, arg0);
722
- return ret;
723
- },
724
564
  __wbindgen_init_externref_table: function() {
725
565
  const table = wasm.__wbindgen_externrefs;
726
566
  const offset = table.grow(4);
@@ -737,15 +577,15 @@ function __wbg_get_imports() {
737
577
  };
738
578
  }
739
579
 
740
- function wasm_bindgen__convert__closures_____invoke__h2b2515b80a4dcf5e(arg0, arg1, arg2) {
741
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2b2515b80a4dcf5e(arg0, arg1, arg2);
580
+ function wasm_bindgen__convert__closures_____invoke__h31e41fe17a163321(arg0, arg1, arg2) {
581
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h31e41fe17a163321(arg0, arg1, arg2);
742
582
  if (ret[1]) {
743
583
  throw takeFromExternrefTable0(ret[0]);
744
584
  }
745
585
  }
746
586
 
747
- function wasm_bindgen__convert__closures_____invoke__h229fb34ceaba2930(arg0, arg1, arg2, arg3) {
748
- wasm.wasm_bindgen__convert__closures_____invoke__h229fb34ceaba2930(arg0, arg1, arg2, arg3);
587
+ function wasm_bindgen__convert__closures_____invoke__h186c6127932ad571(arg0, arg1, arg2, arg3) {
588
+ wasm.wasm_bindgen__convert__closures_____invoke__h186c6127932ad571(arg0, arg1, arg2, arg3);
749
589
  }
750
590
 
751
591
  const DiaryxBackendFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -763,72 +603,7 @@ function addToExternrefTable0(obj) {
763
603
 
764
604
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
765
605
  ? { register: () => {}, unregister: () => {} }
766
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
767
-
768
- function debugString(val) {
769
- // primitive types
770
- const type = typeof val;
771
- if (type == 'number' || type == 'boolean' || val == null) {
772
- return `${val}`;
773
- }
774
- if (type == 'string') {
775
- return `"${val}"`;
776
- }
777
- if (type == 'symbol') {
778
- const description = val.description;
779
- if (description == null) {
780
- return 'Symbol';
781
- } else {
782
- return `Symbol(${description})`;
783
- }
784
- }
785
- if (type == 'function') {
786
- const name = val.name;
787
- if (typeof name == 'string' && name.length > 0) {
788
- return `Function(${name})`;
789
- } else {
790
- return 'Function';
791
- }
792
- }
793
- // objects
794
- if (Array.isArray(val)) {
795
- const length = val.length;
796
- let debug = '[';
797
- if (length > 0) {
798
- debug += debugString(val[0]);
799
- }
800
- for(let i = 1; i < length; i++) {
801
- debug += ', ' + debugString(val[i]);
802
- }
803
- debug += ']';
804
- return debug;
805
- }
806
- // Test for built-in
807
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
808
- let className;
809
- if (builtInMatches && builtInMatches.length > 1) {
810
- className = builtInMatches[1];
811
- } else {
812
- // Failed to match the standard '[object ClassName]'
813
- return toString.call(val);
814
- }
815
- if (className == 'Object') {
816
- // we're a user defined class or Object
817
- // JSON.stringify avoids problems with cycles, and is generally much
818
- // easier than looping through ownProperties of `val`.
819
- try {
820
- return 'Object(' + JSON.stringify(val) + ')';
821
- } catch (_) {
822
- return 'Object';
823
- }
824
- }
825
- // errors
826
- if (val instanceof Error) {
827
- return `${val.name}: ${val.message}\n${val.stack}`;
828
- }
829
- // TODO we could test for more things here, like `Set`s and `Map`s.
830
- return className;
831
- }
606
+ : new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
832
607
 
833
608
  function getArrayU8FromWasm0(ptr, len) {
834
609
  ptr = ptr >>> 0;
@@ -869,8 +644,8 @@ function isLikeNone(x) {
869
644
  return x === undefined || x === null;
870
645
  }
871
646
 
872
- function makeMutClosure(arg0, arg1, dtor, f) {
873
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
647
+ function makeMutClosure(arg0, arg1, f) {
648
+ const state = { a: arg0, b: arg1, cnt: 1 };
874
649
  const real = (...args) => {
875
650
 
876
651
  // First up with a closure we increment the internal reference
@@ -888,7 +663,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
888
663
  };
889
664
  real._wbg_cb_unref = () => {
890
665
  if (--state.cnt === 0) {
891
- state.dtor(state.a, state.b);
666
+ wasm.__wbindgen_destroy_closure(state.a, state.b);
892
667
  state.a = 0;
893
668
  CLOSURE_DTORS.unregister(state);
894
669
  }
Binary file
@@ -9,7 +9,6 @@ export const diaryxbackend_createInMemory: () => [number, number, number];
9
9
  export const diaryxbackend_emitFileSystemEvent: (a: number, b: number, c: number) => [number, number];
10
10
  export const diaryxbackend_eventSubscriberCount: (a: number) => number;
11
11
  export const diaryxbackend_execute: (a: number, b: number, c: number) => any;
12
- export const diaryxbackend_executeJs: (a: number, b: any) => any;
13
12
  export const diaryxbackend_hasNativeSync: (a: number) => number;
14
13
  export const diaryxbackend_offFileSystemEvent: (a: number, b: bigint) => number;
15
14
  export const diaryxbackend_onFileSystemEvent: (a: number, b: any) => bigint;
@@ -22,14 +21,14 @@ export const now_timestamp: () => [number, number];
22
21
  export const today_formatted: (a: number, b: number) => [number, number];
23
22
  export const init: () => void;
24
23
  export const diaryxbackend_isCrdtEnabled: (a: number) => number;
25
- export const wasm_bindgen__closure__destroy__hc0ecfed3f77ea255: (a: number, b: number) => void;
26
- export const wasm_bindgen__convert__closures_____invoke__h2b2515b80a4dcf5e: (a: number, b: number, c: any) => [number, number];
27
- export const wasm_bindgen__convert__closures_____invoke__h229fb34ceaba2930: (a: number, b: number, c: any, d: any) => void;
24
+ export const wasm_bindgen__convert__closures_____invoke__h31e41fe17a163321: (a: number, b: number, c: any) => [number, number];
25
+ export const wasm_bindgen__convert__closures_____invoke__h186c6127932ad571: (a: number, b: number, c: any, d: any) => void;
28
26
  export const __wbindgen_malloc: (a: number, b: number) => number;
29
27
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
30
28
  export const __wbindgen_exn_store: (a: number) => void;
31
29
  export const __externref_table_alloc: () => number;
32
30
  export const __wbindgen_externrefs: WebAssembly.Table;
31
+ export const __wbindgen_destroy_closure: (a: number, b: number) => void;
33
32
  export const __externref_table_dealloc: (a: number) => void;
34
33
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
35
34
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@diaryx/wasm-node",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for Diaryx core functionality",
5
- "version": "1.4.1",
5
+ "version": "1.4.3-dev.b07751e",
6
6
  "license": "SEE LICENSE IN ../../LICENSE.md",
7
7
  "repository": {
8
8
  "type": "git",