virtual-machine 0.6.0 → 0.7.0

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.
@@ -217,17 +217,17 @@ if (!("encodeInto" in cachedTextEncoder)) {
217
217
  };
218
218
  }
219
219
  var WASM_VECTOR_LEN = 0;
220
- function wasm_bindgen__convert__closures_____invoke__h57e3fb0fd98a5ae3(arg0, arg1, arg2) {
221
- wasm.wasm_bindgen__convert__closures_____invoke__h57e3fb0fd98a5ae3(arg0, arg1, arg2);
220
+ function wasm_bindgen__convert__closures_____invoke__h57b08f5a8a60b843(arg0, arg1, arg2) {
221
+ wasm.wasm_bindgen__convert__closures_____invoke__h57b08f5a8a60b843(arg0, arg1, arg2);
222
+ }
223
+ function wasm_bindgen__convert__closures_____invoke__h0c216eecf043a2f0(arg0, arg1) {
224
+ wasm.wasm_bindgen__convert__closures_____invoke__h0c216eecf043a2f0(arg0, arg1);
222
225
  }
223
226
  function wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2) {
224
227
  wasm.wasm_bindgen__convert__closures_____invoke__h260170fb96639bcf(arg0, arg1, arg2);
225
228
  }
226
- function wasm_bindgen__convert__closures_____invoke__h12016712892368ef(arg0, arg1) {
227
- wasm.wasm_bindgen__convert__closures_____invoke__h12016712892368ef(arg0, arg1);
228
- }
229
- function wasm_bindgen__convert__closures_____invoke__h8472358ea4cd61c0(arg0, arg1) {
230
- wasm.wasm_bindgen__convert__closures_____invoke__h8472358ea4cd61c0(arg0, arg1);
229
+ function wasm_bindgen__convert__closures_____invoke__h87848837c965c34e(arg0, arg1) {
230
+ wasm.wasm_bindgen__convert__closures_____invoke__h87848837c965c34e(arg0, arg1);
231
231
  }
232
232
  var __wbindgen_enum_WorkerType = ["classic", "module"];
233
233
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
@@ -304,6 +304,14 @@ var WasmVm = class _WasmVm {
304
304
  enable_emac() {
305
305
  wasm.wasmvm_enable_emac(this.__wbg_ptr);
306
306
  }
307
+ /**
308
+ * Clear the cancellation flag.
309
+ *
310
+ * Call this when a new command starts to reset the cancellation state.
311
+ */
312
+ clear_cancel() {
313
+ wasm.wasmvm_clear_cancel(this.__wbg_ptr);
314
+ }
307
315
  /**
308
316
  * Enable D1 Audio Codec device for audio playback.
309
317
  *
@@ -474,6 +482,20 @@ var WasmVm = class _WasmVm {
474
482
  }
475
483
  return _WasmVm.__wrap(ret[0]);
476
484
  }
485
+ /**
486
+ * Request cancellation of running command.
487
+ *
488
+ * This sets a flag in SharedArrayBuffer that all workers can see.
489
+ * The kernel checks this flag in the should_cancel() syscall.
490
+ *
491
+ * Call this when:
492
+ * - User clicks Cancel button
493
+ * - User presses 'q' or ESC during a command
494
+ * - User presses Ctrl+C
495
+ */
496
+ request_cancel() {
497
+ wasm.wasmvm_request_cancel(this.__wbg_ptr);
498
+ }
477
499
  /**
478
500
  * Send a keyboard event to the guest.
479
501
  *
@@ -625,6 +647,14 @@ var WasmVm = class _WasmVm {
625
647
  const ret = wasm.wasmvm_get_gpu_dirty_rect(this.__wbg_ptr);
626
648
  return ret;
627
649
  }
650
+ /**
651
+ * Check if cancellation has been requested.
652
+ * @returns {boolean}
653
+ */
654
+ is_cancel_requested() {
655
+ const ret = wasm.wasmvm_is_cancel_requested(this.__wbg_ptr);
656
+ return ret !== 0;
657
+ }
628
658
  /**
629
659
  * Check how many bytes are pending in the UART output buffer.
630
660
  * Useful for debugging output issues.
@@ -1501,21 +1531,21 @@ function __wbg_get_imports() {
1501
1531
  return ret;
1502
1532
  };
1503
1533
  imports.wbg.__wbindgen_cast_6c14e8b8f1971d0e = function(arg0, arg1) {
1504
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h6f966a895a6e39d8, wasm_bindgen__convert__closures_____invoke__h8472358ea4cd61c0);
1505
- return ret;
1506
- };
1507
- imports.wbg.__wbindgen_cast_739a255c24fa507c = function(arg0, arg1) {
1508
- const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h6f966a895a6e39d8, wasm_bindgen__convert__closures_____invoke__h12016712892368ef);
1534
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h331b8edc4ffb1a76, wasm_bindgen__convert__closures_____invoke__h0c216eecf043a2f0);
1509
1535
  return ret;
1510
1536
  };
1511
- imports.wbg.__wbindgen_cast_a524b4c2847f5c8a = function(arg0, arg1) {
1512
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h6f966a895a6e39d8, wasm_bindgen__convert__closures_____invoke__h57e3fb0fd98a5ae3);
1537
+ imports.wbg.__wbindgen_cast_986f6aeb1042b2fc = function(arg0, arg1) {
1538
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h331b8edc4ffb1a76, wasm_bindgen__convert__closures_____invoke__h57b08f5a8a60b843);
1513
1539
  return ret;
1514
1540
  };
1515
1541
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1516
1542
  const ret = arg0;
1517
1543
  return ret;
1518
1544
  };
1545
+ imports.wbg.__wbindgen_cast_f68bb92101f7c0ce = function(arg0, arg1) {
1546
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h331b8edc4ffb1a76, wasm_bindgen__convert__closures_____invoke__h87848837c965c34e);
1547
+ return ret;
1548
+ };
1519
1549
  imports.wbg.__wbindgen_init_externref_table = function() {
1520
1550
  const table = wasm.__wbindgen_externrefs;
1521
1551
  const offset = table.grow(4);