virtual-machine 0.1.4 → 0.1.5
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/{chunk-IMQM5K6V.mjs → chunk-JU756VDZ.mjs} +54 -11
- package/build/cli.js +55 -12
- package/build/index.d.ts +32 -4
- package/build/index.js +55 -12
- package/build/index.mjs +3 -3
- package/build/{riscv_vm-L5R6KUXO.mjs → riscv_vm-TWECKOQY.mjs} +1 -1
- package/build/worker.js +12 -12
- package/native/riscv-vm-native.darwin-arm64.node +0 -0
- package/native/riscv-vm-native.darwin-x64.node +0 -0
- package/native/riscv-vm-native.linux-arm64-gnu.node +0 -0
- package/native/riscv-vm-native.linux-arm64-musl.node +0 -0
- package/native/riscv-vm-native.linux-x64-gnu.node +0 -0
- package/native/riscv-vm-native.linux-x64-musl.node +0 -0
- package/native/riscv-vm-native.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ declare class WasmVm {
|
|
|
30
30
|
* Print a status message to UART output (visible in browser).
|
|
31
31
|
*/
|
|
32
32
|
print_status(message: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Get CPU count (from kernel-reported value).
|
|
35
|
+
*/
|
|
36
|
+
get_cpu_count(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get system uptime in milliseconds (from kernel-reported value).
|
|
39
|
+
*/
|
|
40
|
+
get_uptime_ms(): bigint;
|
|
33
41
|
/**
|
|
34
42
|
* Start worker threads for secondary harts (1..num_harts).
|
|
35
43
|
*
|
|
@@ -40,6 +48,16 @@ declare class WasmVm {
|
|
|
40
48
|
* * `worker_url` - URL to the worker script (e.g., "/worker.js")
|
|
41
49
|
*/
|
|
42
50
|
start_workers(worker_url: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Get disk usage from the guest kernel.
|
|
53
|
+
* Returns (used_bytes, total_bytes).
|
|
54
|
+
*/
|
|
55
|
+
get_disk_usage(): Array<any>;
|
|
56
|
+
/**
|
|
57
|
+
* Get heap memory usage from the guest kernel.
|
|
58
|
+
* Returns (used_bytes, total_bytes).
|
|
59
|
+
*/
|
|
60
|
+
get_heap_usage(): Array<any>;
|
|
43
61
|
/**
|
|
44
62
|
* Get the current network connection status.
|
|
45
63
|
* This checks the actual connection state by seeing if an IP was assigned.
|
|
@@ -57,6 +75,11 @@ declare class WasmVm {
|
|
|
57
75
|
* Get current memory usage (DRAM size) in bytes.
|
|
58
76
|
*/
|
|
59
77
|
get_memory_usage(): bigint;
|
|
78
|
+
/**
|
|
79
|
+
* Get the total disk capacity from attached VirtIO block devices.
|
|
80
|
+
* Returns total bytes across all block devices.
|
|
81
|
+
*/
|
|
82
|
+
get_disk_capacity(): bigint;
|
|
60
83
|
/**
|
|
61
84
|
* Get the SharedArrayBuffer for external worker management.
|
|
62
85
|
* Returns None if not in SMP mode.
|
|
@@ -271,9 +294,14 @@ interface InitOutput {
|
|
|
271
294
|
readonly wasmvm_external_network_tx_pending: (a: number) => number;
|
|
272
295
|
readonly wasmvm_extract_all_network_packets: (a: number) => any;
|
|
273
296
|
readonly wasmvm_extract_network_packet: (a: number) => any;
|
|
297
|
+
readonly wasmvm_get_cpu_count: (a: number) => number;
|
|
298
|
+
readonly wasmvm_get_disk_capacity: (a: number) => bigint;
|
|
299
|
+
readonly wasmvm_get_disk_usage: (a: number) => any;
|
|
300
|
+
readonly wasmvm_get_heap_usage: (a: number) => any;
|
|
274
301
|
readonly wasmvm_get_memory_usage: (a: number) => bigint;
|
|
275
302
|
readonly wasmvm_get_output: (a: number) => number;
|
|
276
303
|
readonly wasmvm_get_shared_buffer: (a: number) => any;
|
|
304
|
+
readonly wasmvm_get_uptime_ms: (a: number) => bigint;
|
|
277
305
|
readonly wasmvm_halt_code: (a: number) => bigint;
|
|
278
306
|
readonly wasmvm_inject_network_packet: (a: number, b: any) => number;
|
|
279
307
|
readonly wasmvm_input: (a: number, b: number) => void;
|
|
@@ -300,12 +328,12 @@ interface InitOutput {
|
|
|
300
328
|
readonly workerstate_new: (a: number, b: any, c: bigint) => number;
|
|
301
329
|
readonly workerstate_step_batch: (a: number, b: number) => number;
|
|
302
330
|
readonly workerstate_step_count: (a: number) => bigint;
|
|
303
|
-
readonly
|
|
304
|
-
readonly
|
|
331
|
+
readonly wasm_bindgen__convert__closures_____invoke__h585740b37ab67ddc: (a: number, b: number) => void;
|
|
332
|
+
readonly wasm_bindgen__closure__destroy__h37d1b5fcb52cb1b9: (a: number, b: number) => void;
|
|
305
333
|
readonly wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765: (a: number, b: number, c: any) => void;
|
|
306
334
|
readonly wasm_bindgen__closure__destroy__hf225e18fc5ab9bc1: (a: number, b: number) => void;
|
|
307
|
-
readonly
|
|
308
|
-
readonly
|
|
335
|
+
readonly wasm_bindgen__convert__closures_____invoke__hc7b58d5dcf05d71f: (a: number, b: number, c: any) => void;
|
|
336
|
+
readonly wasm_bindgen__convert__closures_____invoke__he5e8d2a2af985b7e: (a: number, b: number) => void;
|
|
309
337
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
310
338
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
311
339
|
readonly __wbindgen_exn_store: (a: number) => void;
|