@oxvm/cli 0.0.27 → 0.0.30
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/NOTICE +2 -2
- package/README.md +3 -3
- package/THIRD_PARTY_NOTICES.txt +4 -4
- package/dist/start-application.js +1 -1
- package/dist/starter-release.js +1 -1
- package/dist/starter.generated.js +1 -1
- package/dist/starter.json +1 -1
- package/dist/templates.js +2 -2
- package/dist/wasm-template-files.js +4 -4
- package/dist/wasm-template-network.d.ts +1 -1
- package/dist/wasm-template-network.js +1 -1
- package/package.json +5 -5
- package/sbom.cdx.json +10 -10
package/dist/templates.js
CHANGED
|
@@ -31,7 +31,7 @@ Fonts retain their OFL license files in public/fonts.
|
|
|
31
31
|
${n==="userspace"?`
|
|
32
32
|
Python syntax highlighting uses highlight.js under BSD-3-Clause. Its license is in public/licenses/highlight.js.txt.
|
|
33
33
|
`:""}
|
|
34
|
-
The
|
|
34
|
+
The OxVM engine is proprietary and distributed separately. Local
|
|
35
35
|
development also permits work on commercial projects. Commercial production
|
|
36
36
|
requires a Spacia agreement. Non-commercial hosted deployments use the
|
|
37
37
|
registered public-license process. Licensed self-hosting is explicit.
|
|
@@ -77,7 +77,7 @@ export default defineImage(${JSON.stringify(m)});`}
|
|
|
77
77
|
`)}else{await t(e,"vite.config.ts",`import { defineConfig } from "vite";
|
|
78
78
|
const headers = { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp" };
|
|
79
79
|
export default defineConfig({ server: { headers }, preview: { headers }, worker: { format: "es" }, optimizeDeps: { exclude: ["@oxvm/sdk"] } });
|
|
80
|
-
`),await t(e,"index.html",`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="oxvm-assets" content="/oxvm/"><title>
|
|
80
|
+
`),await t(e,"index.html",`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="oxvm-assets" content="/oxvm/"><title>OxVM</title></head><body><h1>Linux in your browser</h1><button id="run">Run Linux command</button><button id="cancel">Cancel startup</button><pre id="output" aria-live="polite"></pre><script type="module" src="/src/main.ts"><\/script></body></html>
|
|
81
81
|
`);const m=o===void 0?"":", defineImage",E=o===void 0?"":`image: defineImage(${JSON.stringify(o)}), `;await t(e,"src/main.ts",`import { createVM, VMError${m} } from "@oxvm/sdk";
|
|
82
82
|
import runtime from "./runtime.ts";
|
|
83
83
|
|
|
@@ -263,12 +263,12 @@ jobs:
|
|
|
263
263
|
`}n(R,"releaseWorkflow");function C(t){return`${t}
|
|
264
264
|
Copyright (c) <year> <copyright holder>
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
An OxVM WebAssembly module. Replace this file with the copyright and attribution notices of this module and of every program
|
|
267
267
|
or library whose code or binaries it ships; the Apache License asks a redistributor to keep the NOTICE files of the works it
|
|
268
268
|
redistributes. Keep the license texts of shipped binaries in this repository too, and name the files in license.notices.
|
|
269
269
|
`}n(C,"noticeFile");const f="\n## Commands that programs in the VM run\n\nEach name in `commands` becomes a program: once an application turns it on for a VM (`enableModuleCommands`), any program there runs the module as `/usr/local/bin/<name>`, in a fresh process with the caller's arguments, environment, directory and standard streams.\n\n- Name the command with `io.invocation.argv0` in usage lines and errors; the caller may have typed a path or a link. `io.args` never contains argv[0].\n- Standard input may be a terminal, a pipe, a file or empty. Read it only when the command's interface says so, and until a read returns no bytes.\n- Use colour or prompts only when `io.terminals` says that descriptor is a terminal.\n- Return 0-119 from `main`, and 2 for a usage error. Never throw for a user's mistake: a throw ends the run with status 123.\n- A signal kills the process at once and `close()` does not run, unless the module declares `process.signals`. If you trap a signal, finish quickly, then `untrap()` and `raise()` it, so the caller sees the process killed by that signal and a shell loop stops.\n- Write results atomically (a temporary file, then a rename), so an interrupted run never leaves half a file.\n- Choose names that do not shadow image programs unless you mean to: `/usr/local/bin` comes before `/usr/bin` on PATH. Adding a name in a later release makes every application consent again.\n- Never list your own command (`/usr/local/bin/<name>`) in `requires.guest.executables`, and never start your own command through PATH.\n- Keep start-up cheap: every run starts a fresh process, which runs the adapter factory again.\n";function H(t,e){return`# ${t}: instructions for coding agents
|
|
270
270
|
|
|
271
|
-
This repository is
|
|
271
|
+
This repository is an OxVM WebAssembly module. \`module.ts\` holds the whole definition: a literal \`manifest\` and the \`adapter\` that runs the WebAssembly inside a Userspace JS process.
|
|
272
272
|
|
|
273
273
|
- Edit \`module.ts\`, \`src/\` and \`test/\`. Never edit \`dist/\`; \`pnpm run build\` writes it.
|
|
274
274
|
- Keep the manifest a literal. The build reads it without running code, so it cannot call functions or use variables.
|
|
@@ -312,11 +312,11 @@ Turning the command on places a stub at \`/usr/local/bin/${e}\`. A shell finds i
|
|
|
312
312
|
| 128+n | the process was killed by signal n (130 for Ctrl+C) |
|
|
313
313
|
`}n(g,"shellSection");function _(t,e,s){const r=e.kind==="command"?'A command module runs once per start, like a program: `spawnModule(vm, handle, { args: ["2", "3"] })`.':"A service module listens on the sockets its manifest declares and serves clients until it is stopped.";return`# ${t}
|
|
314
314
|
|
|
315
|
-
A [
|
|
315
|
+
A [OxVM](https://oxvm.dev) WebAssembly module (${e.kind}). ${r}
|
|
316
316
|
|
|
317
317
|
## Use it
|
|
318
318
|
|
|
319
|
-
In
|
|
319
|
+
In an OxVM application:
|
|
320
320
|
|
|
321
321
|
\`\`\`sh
|
|
322
322
|
oxvm wasm add github:OWNER/REPO@v0.1.0
|
|
@@ -12,4 +12,4 @@ export declare function netTest(reach: "vm" | "internet"): string;
|
|
|
12
12
|
/** The README's "Network" section (N-10): the reach, the disclosure, and what happens offline. */
|
|
13
13
|
export declare function networkSection(reach: TemplateReach): string;
|
|
14
14
|
/** AGENTS.md "Networking rules": ADR 0029, N-1 to N-10, condensed. */
|
|
15
|
-
export declare const NETWORK_RULES = "\n## Networking rules\n\nThe module networking standard (
|
|
15
|
+
export declare const NETWORK_RULES = "\n## Networking rules\n\nThe module networking standard (OxVM engine ADR 0029; the SDK's `docs/wasm-modules.md`, \"Networking\"):\n\n1. Declare one reach in `requires.host`: none, `net.vm` or `net.internet`. Rust enforces it for every process of the module.\n2. With `net.internet`, disclose default hosts and the purpose in `network`; it is shown at install and never an allowlist.\n3. Use only the host's network: `fetch`, `WebSocket`, `host.net`. `XMLHttpRequest`, `EventSource`, `sendBeacon`, WebRTC, WebTransport and remote `import()` or `importScripts` do not exist in module workers.\n4. Adapt a runtime's own network layer with `host.kit.emscripten.network` or `host.kit.tls`; never bypass the host.\n5. Offline or revoked, a command prints one line from `host.kit.net.describe(error, argv0)` and returns `MODULE_EXIT.unavailable` (69); a service fails only the affected request. Never retry in a loop.\n6. Every request carries `host.signal` (or a signal derived from it) and a timeout; read bodies as streams or bounded.\n7. TLS always verifies against the VM's `/etc/ssl/cert.pem`. Credentials come only from options or guest files.\n8. Internet means TCP 80 and 443 plus DNS; nothing connects in. Programs started with `process.spawn` follow the VM's own policy.\n9. Test with `testHost` from `@oxvm/sdk/wasm/testing` (local-only by default); `oxvm wasm test` checks `network-direct`, `network-declared` and `network-offline`.\n10. Keep the README's \"Network\" section true: reach, disclosed hosts, purpose, and behaviour offline.\n";
|
|
@@ -88,4 +88,4 @@ ${o}${s}
|
|
|
88
88
|
## Network
|
|
89
89
|
|
|
90
90
|
${e==="none"?'This module declares no network reach: it opens no connections of its own\nand its `fetch` fails with "network not declared". A service still serves programs in the VM through `expose`.':e==="vm"?"This module reaches programs in its own VM only (`net.vm`): loopback, Unix sockets and the VM's own addresses, with names from the VM's `/etc/hosts`. It works the same whether or not the VM is connected to the internet. A connection beyond the VM fails with `EACCES`.":"This module reaches the internet through the VM's connection (`net.internet`): public hosts on TCP 80 and 443, with DNS through the VM's resolver and TLS verified against the VM's `/etc/ssl/cert.pem`.\n\n- Hosts it contacts by default, and why: see `network` in `module.ts` (shown at install; not an allowlist).\n- Until the application connects the VM (`vm.network.connect`), and after the user revokes it, a request fails. A command then prints one line (`network unavailable: this VM is not connected to the internet`) and exits 69; a service fails only that request and stays ready."}
|
|
91
|
-
`}n(u,"networkSection");const m="\n## Networking rules\n\nThe module networking standard (
|
|
91
|
+
`}n(u,"networkSection");const m="\n## Networking rules\n\nThe module networking standard (OxVM engine ADR 0029; the SDK's `docs/wasm-modules.md`, \"Networking\"):\n\n1. Declare one reach in `requires.host`: none, `net.vm` or `net.internet`. Rust enforces it for every process of the module.\n2. With `net.internet`, disclose default hosts and the purpose in `network`; it is shown at install and never an allowlist.\n3. Use only the host's network: `fetch`, `WebSocket`, `host.net`. `XMLHttpRequest`, `EventSource`, `sendBeacon`, WebRTC, WebTransport and remote `import()` or `importScripts` do not exist in module workers.\n4. Adapt a runtime's own network layer with `host.kit.emscripten.network` or `host.kit.tls`; never bypass the host.\n5. Offline or revoked, a command prints one line from `host.kit.net.describe(error, argv0)` and returns `MODULE_EXIT.unavailable` (69); a service fails only the affected request. Never retry in a loop.\n6. Every request carries `host.signal` (or a signal derived from it) and a timeout; read bodies as streams or bounded.\n7. TLS always verifies against the VM's `/etc/ssl/cert.pem`. Credentials come only from options or guest files.\n8. Internet means TCP 80 and 443 plus DNS; nothing connects in. Programs started with `process.spawn` follow the VM's own policy.\n9. Test with `testHost` from `@oxvm/sdk/wasm/testing` (local-only by default); `oxvm wasm test` checks `network-direct`, `network-declared` and `network-offline`.\n10. Keep the README's \"Network\" section true: reach, disclosed hosts, purpose, and behaviour offline.\n";export{l as NETWORK_DISCLOSURE,m as NETWORK_RULES,d as NET_SOURCE,c as TEMPLATE_REACHES,h as netTest,u as networkSection,a as reachToken};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxvm/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"node": ">=24"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@oxvm/sdk": "0.0.
|
|
26
|
+
"@oxvm/sdk": "0.0.30"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "24.13.3",
|
|
30
30
|
"typescript": "6.0.3",
|
|
31
31
|
"vitest": "5.1.0"
|
|
32
32
|
},
|
|
33
|
-
"description": "Create and verify
|
|
33
|
+
"description": "Create and verify OxVM browser applications, images, snapshots, and WebAssembly modules.",
|
|
34
34
|
"keywords": [
|
|
35
35
|
"oxvm",
|
|
36
36
|
"linux",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"homepage": "https://oxvm.dev/docs/",
|
|
41
41
|
"bugs": {
|
|
42
|
-
"url": "https://github.com/spacia-ai/
|
|
42
|
+
"url": "https://github.com/spacia-ai/oxvm-sdk-public/issues"
|
|
43
43
|
},
|
|
44
44
|
"private": false,
|
|
45
45
|
"publishConfig": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
|
51
|
-
"url": "https://github.com/spacia-ai/
|
|
51
|
+
"url": "https://github.com/spacia-ai/oxvm-sdk-public.git",
|
|
52
52
|
"directory": "packages/cli"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
package/sbom.cdx.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"component": {
|
|
7
7
|
"type": "library",
|
|
8
8
|
"name": "@oxvm/cli",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.30",
|
|
10
10
|
"licenses": [
|
|
11
11
|
{
|
|
12
12
|
"expression": "Apache-2.0"
|
|
@@ -8166,7 +8166,7 @@
|
|
|
8166
8166
|
"hashes": [
|
|
8167
8167
|
{
|
|
8168
8168
|
"alg": "SHA-256",
|
|
8169
|
-
"content": "
|
|
8169
|
+
"content": "ce5c7390a8c78315d9559a445ede38225cfe61df872a291962d8c0c5a9ddb07d"
|
|
8170
8170
|
}
|
|
8171
8171
|
]
|
|
8172
8172
|
},
|
|
@@ -8210,7 +8210,7 @@
|
|
|
8210
8210
|
"hashes": [
|
|
8211
8211
|
{
|
|
8212
8212
|
"alg": "SHA-256",
|
|
8213
|
-
"content": "
|
|
8213
|
+
"content": "14f7def27bf39075f7fc953d1b152c457c151dab85031f11fac9e761a28ad692"
|
|
8214
8214
|
}
|
|
8215
8215
|
]
|
|
8216
8216
|
},
|
|
@@ -8254,7 +8254,7 @@
|
|
|
8254
8254
|
"hashes": [
|
|
8255
8255
|
{
|
|
8256
8256
|
"alg": "SHA-256",
|
|
8257
|
-
"content": "
|
|
8257
|
+
"content": "cfa1e110b27dee5accd523a11015b15681a41db8e2ea96c3491a151842259bce"
|
|
8258
8258
|
}
|
|
8259
8259
|
]
|
|
8260
8260
|
},
|
|
@@ -8265,7 +8265,7 @@
|
|
|
8265
8265
|
"hashes": [
|
|
8266
8266
|
{
|
|
8267
8267
|
"alg": "SHA-256",
|
|
8268
|
-
"content": "
|
|
8268
|
+
"content": "82c3195459905f86b0296b9f211fc65ab4f79bc06a5e71e94332625753c7e5bc"
|
|
8269
8269
|
}
|
|
8270
8270
|
]
|
|
8271
8271
|
},
|
|
@@ -8309,7 +8309,7 @@
|
|
|
8309
8309
|
"hashes": [
|
|
8310
8310
|
{
|
|
8311
8311
|
"alg": "SHA-256",
|
|
8312
|
-
"content": "
|
|
8312
|
+
"content": "5ab8fb0b609ff4fabb7881ebcacf5cd3396fa193038a4ce1a23e56917b97eb0d"
|
|
8313
8313
|
}
|
|
8314
8314
|
]
|
|
8315
8315
|
},
|
|
@@ -8441,7 +8441,7 @@
|
|
|
8441
8441
|
"hashes": [
|
|
8442
8442
|
{
|
|
8443
8443
|
"alg": "SHA-256",
|
|
8444
|
-
"content": "
|
|
8444
|
+
"content": "0302bedaa857abe328954528e1e00b4095f7aec70736f831f8f320b694626486"
|
|
8445
8445
|
}
|
|
8446
8446
|
]
|
|
8447
8447
|
},
|
|
@@ -8452,7 +8452,7 @@
|
|
|
8452
8452
|
"hashes": [
|
|
8453
8453
|
{
|
|
8454
8454
|
"alg": "SHA-256",
|
|
8455
|
-
"content": "
|
|
8455
|
+
"content": "04264f1351a737781baf007b41f6985ddac8fc793714d3fb1c6406388ff2f5f7"
|
|
8456
8456
|
}
|
|
8457
8457
|
]
|
|
8458
8458
|
},
|
|
@@ -8463,7 +8463,7 @@
|
|
|
8463
8463
|
"hashes": [
|
|
8464
8464
|
{
|
|
8465
8465
|
"alg": "SHA-256",
|
|
8466
|
-
"content": "
|
|
8466
|
+
"content": "a826580cc37b086fd9da97b01cfff6fd517cc7cb568bf3905528f5e993e8380f"
|
|
8467
8467
|
}
|
|
8468
8468
|
]
|
|
8469
8469
|
},
|
|
@@ -8529,7 +8529,7 @@
|
|
|
8529
8529
|
"hashes": [
|
|
8530
8530
|
{
|
|
8531
8531
|
"alg": "SHA-256",
|
|
8532
|
-
"content": "
|
|
8532
|
+
"content": "afdc50639d4012cbc3de73a8e40c1e6347004cde954f9eb920ff6584ef50cca3"
|
|
8533
8533
|
}
|
|
8534
8534
|
]
|
|
8535
8535
|
}
|