virtual-machine 0.0.19 → 0.0.20

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/build/index.d.ts CHANGED
@@ -42,12 +42,22 @@ declare class WasmVm {
42
42
  constructor(kernel: Uint8Array);
43
43
  /**
44
44
  * Execute a single instruction.
45
+ * Returns true if the VM is still running, false if halted.
45
46
  */
46
- step(): void;
47
+ step(): boolean;
47
48
  /**
48
49
  * Push an input byte to the UART.
49
50
  */
50
51
  input(byte: number): void;
52
+ /**
53
+ * Get the halt code if the VM has halted.
54
+ * Code 0x5555 typically means successful shutdown (PASS).
55
+ */
56
+ halt_code(): bigint;
57
+ /**
58
+ * Check if the VM has halted (e.g., due to shutdown command).
59
+ */
60
+ is_halted(): boolean;
51
61
  /**
52
62
  * Load a disk image and attach it as a VirtIO block device.
53
63
  * This should be called before starting execution if the kernel needs a filesystem.
@@ -64,16 +74,18 @@ interface InitOutput {
64
74
  readonly wasmvm_disconnect_network: (a: number) => void;
65
75
  readonly wasmvm_get_memory_usage: (a: number) => bigint;
66
76
  readonly wasmvm_get_output: (a: number) => number;
77
+ readonly wasmvm_halt_code: (a: number) => bigint;
67
78
  readonly wasmvm_input: (a: number, b: number) => void;
79
+ readonly wasmvm_is_halted: (a: number) => number;
68
80
  readonly wasmvm_load_disk: (a: number, b: number, c: number) => void;
69
81
  readonly wasmvm_network_status: (a: number) => number;
70
82
  readonly wasmvm_new: (a: number, b: number) => [number, number, number];
71
- readonly wasmvm_step: (a: number) => void;
83
+ readonly wasmvm_step: (a: number) => number;
84
+ readonly wasm_bindgen__convert__closures_____invoke__hf42da40d1dcec156: (a: number, b: number) => void;
85
+ readonly wasm_bindgen__closure__destroy__h69b64ae87dd7e1f7: (a: number, b: number) => void;
72
86
  readonly wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919: (a: number, b: number, c: any) => void;
73
87
  readonly wasm_bindgen__closure__destroy__hb099e2ae98169675: (a: number, b: number) => void;
74
- readonly wasm_bindgen__convert__closures_____invoke__he79f784db500caf3: (a: number, b: number) => void;
75
- readonly wasm_bindgen__closure__destroy__h1ffb72edd765103d: (a: number, b: number) => void;
76
- readonly wasm_bindgen__convert__closures_____invoke__h0a797a416de56032: (a: number, b: number) => void;
88
+ readonly wasm_bindgen__convert__closures_____invoke__h63aabd61d982f555: (a: number, b: number) => void;
77
89
  readonly __wbindgen_malloc: (a: number, b: number) => number;
78
90
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
79
91
  readonly __wbindgen_exn_store: (a: number) => void;