virtual-machine 0.0.24 → 0.0.26

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
@@ -18,6 +18,15 @@ declare class WasmVm {
18
18
  * Get a byte from the UART output buffer, if available.
19
19
  */
20
20
  get_output(): number | undefined;
21
+ /**
22
+ * Print the VM banner to UART output (visible in browser).
23
+ * Call this after creating the VM to show a boot banner.
24
+ */
25
+ print_banner(): void;
26
+ /**
27
+ * Print a status message to UART output (visible in browser).
28
+ */
29
+ print_status(message: string): void;
21
30
  /**
22
31
  * Get the current network connection status.
23
32
  * This checks the actual connection state by seeing if an IP was assigned.
@@ -31,6 +40,11 @@ declare class WasmVm {
31
40
  * Disconnect from the network.
32
41
  */
33
42
  disconnect_network(): void;
43
+ /**
44
+ * Check how many bytes are pending in the UART output buffer.
45
+ * Useful for debugging output issues.
46
+ */
47
+ uart_output_pending(): number;
34
48
  /**
35
49
  * Connect to a WebTransport relay server.
36
50
  * Note: Connection is asynchronous. Check network_status() to monitor connection state.
@@ -49,6 +63,13 @@ declare class WasmVm {
49
63
  * Push an input byte to the UART.
50
64
  */
51
65
  input(byte: number): void;
66
+ /**
67
+ * Execute up to N instructions in a batch.
68
+ * Returns the number of instructions actually executed.
69
+ * This is more efficient than calling step() N times due to reduced
70
+ * JS-WASM boundary crossings.
71
+ */
72
+ step_n(count: number): number;
52
73
  /**
53
74
  * Get the halt code if the VM has halted.
54
75
  * Code 0x5555 typically means successful shutdown (PASS).
@@ -80,12 +101,16 @@ interface InitOutput {
80
101
  readonly wasmvm_load_disk: (a: number, b: number, c: number) => void;
81
102
  readonly wasmvm_network_status: (a: number) => number;
82
103
  readonly wasmvm_new: (a: number, b: number) => [number, number, number];
104
+ readonly wasmvm_print_banner: (a: number) => void;
105
+ readonly wasmvm_print_status: (a: number, b: number, c: number) => void;
83
106
  readonly wasmvm_step: (a: number) => number;
84
- readonly wasm_bindgen__convert__closures_____invoke__hfd5f343960464841: (a: number, b: number) => void;
85
- readonly wasm_bindgen__closure__destroy__h1c3a9ff1d3f255ed: (a: number, b: number) => void;
107
+ readonly wasmvm_step_n: (a: number, b: number) => number;
108
+ readonly wasmvm_uart_output_pending: (a: number) => number;
86
109
  readonly wasm_bindgen__convert__closures_____invoke__h6709295d3f31b919: (a: number, b: number, c: any) => void;
87
110
  readonly wasm_bindgen__closure__destroy__hb099e2ae98169675: (a: number, b: number) => void;
88
- readonly wasm_bindgen__convert__closures_____invoke__h7c611e26ba1ee3d4: (a: number, b: number) => void;
111
+ readonly wasm_bindgen__convert__closures_____invoke__h7db8350a65138a75: (a: number, b: number) => void;
112
+ readonly wasm_bindgen__closure__destroy__h31964876cb87df28: (a: number, b: number) => void;
113
+ readonly wasm_bindgen__convert__closures_____invoke__h214e37a833ce8d11: (a: number, b: number) => void;
89
114
  readonly __wbindgen_malloc: (a: number, b: number) => number;
90
115
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
91
116
  readonly __wbindgen_exn_store: (a: number) => void;