@oxvm/cli 0.0.0-stage → 0.0.27
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/LICENSE +202 -0
- package/NOTICE +18 -0
- package/README.md +27 -2
- package/THIRD_PARTY_NOTICES.txt +52056 -0
- package/dist/arguments.d.ts +162 -0
- package/dist/arguments.js +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +2 -0
- package/dist/contracts.d.ts +98 -0
- package/dist/contracts.js +0 -0
- package/dist/environment.d.ts +4 -0
- package/dist/environment.js +1 -0
- package/dist/failure.d.ts +5 -0
- package/dist/failure.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/project-files.d.ts +2 -0
- package/dist/project-files.js +1 -0
- package/dist/project-lock.d.ts +13 -0
- package/dist/project-lock.js +4 -0
- package/dist/report.d.ts +3 -0
- package/dist/report.js +1 -0
- package/dist/run.d.ts +17 -0
- package/dist/run.js +36 -0
- package/dist/snapshot-commands.d.ts +7 -0
- package/dist/snapshot-commands.js +3 -0
- package/dist/snapshot-errors.d.ts +4 -0
- package/dist/snapshot-errors.js +2 -0
- package/dist/snapshot-help.d.ts +3 -0
- package/dist/snapshot-help.js +14 -0
- package/dist/snapshot-templates.d.ts +16 -0
- package/dist/snapshot-templates.js +58 -0
- package/dist/start-application.d.ts +2 -0
- package/dist/start-application.js +3 -0
- package/dist/starter-inputs.d.ts +13 -0
- package/dist/starter-inputs.js +1 -0
- package/dist/starter-release.d.ts +29 -0
- package/dist/starter-release.js +1 -0
- package/dist/starter-template.d.ts +9 -0
- package/dist/starter-template.js +2 -0
- package/dist/starter.generated.d.ts +1 -0
- package/dist/starter.generated.js +1 -0
- package/dist/starter.json +1 -0
- package/dist/template-files.d.ts +2 -0
- package/dist/template-files.js +1 -0
- package/dist/templates.d.ts +27 -0
- package/dist/templates.js +115 -0
- package/dist/validation.d.ts +5 -0
- package/dist/validation.js +1 -0
- package/dist/wasm-commands.d.ts +7 -0
- package/dist/wasm-commands.js +1 -0
- package/dist/wasm-errors.d.ts +2 -0
- package/dist/wasm-errors.js +1 -0
- package/dist/wasm-help.d.ts +3 -0
- package/dist/wasm-help.js +37 -0
- package/dist/wasm-release.d.ts +15 -0
- package/dist/wasm-release.js +8 -0
- package/dist/wasm-template-files.d.ts +50 -0
- package/dist/wasm-template-files.js +350 -0
- package/dist/wasm-template-network.d.ts +15 -0
- package/dist/wasm-template-network.js +91 -0
- package/dist/wasm-templates.d.ts +16 -0
- package/dist/wasm-templates.js +91 -0
- package/dist/wasm-text.d.ts +23 -0
- package/dist/wasm-text.js +40 -0
- package/package.json +56 -3
- package/sbom.cdx.json +8537 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var m=Object.defineProperty;var i=(e,n)=>m(e,"name",{value:n,configurable:!0});import{RESERVED_COMMAND_PREFIX as $,handleName as h}from"./wasm-template-files.js";const l=i(e=>e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,"megabytes"),a=i((e,n)=>{const s=n.filter(r=>r!=="");return s.length===0?[]:[` ${e.padEnd(9)}${s[0]??""}`,...s.slice(1).map(r=>` ${" ".repeat(9)}${r}`)]},"row"),u=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,c=i(e=>`\\u{${(e.codePointAt(0)??0).toString(16)}}`,"spell"),M=i(e=>e.replace(u,n=>n===`
|
|
2
|
+
`?n:c(n)),"printable"),o=i(e=>e.replace(u,c),"field"),g=i(e=>({...e,id:o(e.id),version:o(e.version),source:o(e.source),license:{...e.license,spdx:o(e.license.spdx)},browser:e.browser.map(o),guestExecutables:e.guestExecutables.map(o),mounts:e.mounts.map(o),endpoints:e.endpoints.map(o),guestFiles:e.guestFiles.map(o),durablePaths:e.durablePaths.map(o),options:e.options.map(o),capabilities:e.capabilities.map(o),commands:e.commands.map(n=>({name:o(n.name),path:o(n.path)})),network:{...e.network,hosts:e.network.hosts.map(o),...e.network.purpose===void 0?{}:{purpose:o(e.network.purpose)}}}),"safeCard");function f(e){return[e.reach==="none"?"none: it opens no network connections of its own":e.reach==="vm"?"this VM only: programs in the VM, not the internet":"the internet, through the VM's connection (TCP 80 and 443, and DNS), once your application connects the VM and the user allows it",...e.hosts.length===0?[]:[`contacts by default: ${e.hosts.join(", ")} (disclosed by the module, not enforced)`],...e.purpose===void 0?[]:[`purpose: ${e.purpose}`],...e.children?["programs it starts follow the VM's own network policy, not this reach"]:[]]}i(f,"networkLines");const b=["Your application turns them on per VM; then any program in the VM can run them as /usr/local/bin/<name>,","with its own arguments and input, and the module does that work in the VM's module frame, apart from your page.","/usr/local/bin comes before /usr/bin on PATH: they take the place of image programs with these names,","including scripts that start with #!/usr/bin/env <name>.","A module that runs code it is given (an interpreter such as Python) lets those programs use everything","it declares: its host operations and its network reach. That code runs in the module frame, not in your page."];function x(e){return e==="yes"?"an attestation exists, not verified here":e==="no"?"no attestation":"attestation unknown"}i(x,"attestationText");function T(e){const n=g(e.card),s=[n.signals.commit===void 0?void 0:`commit ${n.signals.commit.slice(0,12)}`,n.signals.immutable===void 0?void 0:`immutable release: ${n.signals.immutable}`,n.signals.attested===void 0?void 0:x(n.signals.attested)].filter(t=>t!==void 0),r=[`${e.status==="added"?"Add":"Update"} module ${n.id} ${n.version}`,...a("from",[`${n.source}${s.length===0?"":` (${s.join(", ")})`}`]),...a("license",[`${n.license.spdx}${n.license.copyleft?" (copyleft: ship its notices and offer its source)":""}`]),...a("host",[n.capabilities.join(", ")||"nothing beyond its own files"]),...a("browser",[n.browser.join(", ")]),...a("guest",n.guestExecutables),...a("mounts",n.mounts),...a("network",f(n.network)),...a("listens",n.endpoints),...a("commands",n.commands.length===0?[]:[n.commands.map(t=>t.name).join(", "),...b]),...a("writes",[...n.guestFiles,...n.durablePaths.map(t=>`${t} (durable)`)]),...a("options",[n.options.join(", ")]),...a("size",[`${l(n.artifacts.reduce((t,d)=>t+d.bytes,0))} in ${String(n.artifacts.length)} file${n.artifacts.length===1?"":"s"}`])];return e.status==="updated"&&(e.added.length>0||e.removed.length>0)&&r.push("","Compared with the installed release:",...e.added.map(t=>` + ${o(t)}`),...e.removed.map(t=>` - ${o(t)}`)),r.push("","This is what the module declares. Its code runs with that authority in the VM's module frame, an opaque origin apart from your page; it is not a sandbox for the programs that run it."),e.consent.reasons.includes("untrusted-source")&&n.source.startsWith("github:")&&r.push('Its source is not in "trusted" in the project module declaration.'),`${r.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`}i(T,"consentText");function v(e){return e.status==="unchanged"?`${e.id} ${e.version} is already installed and up to date.
|
|
5
|
+
`:`${e.status==="added"?"Added":"Updated"} ${e.id} ${e.version} from ${e.source}. Import it from ${e.generatedFile}:
|
|
6
|
+
import { ${h(e.id)} } from "./${e.generatedFile.replace(/^src\//u,"").replace(/\.ts$/u,"")}";
|
|
7
|
+
`}i(v,"addText");function E(e){if(e.modules.length===0)return`No modules are installed. Wrote ${e.generatedFile}.
|
|
8
|
+
`;const n=e.modules.filter(s=>s.rebuilt).length;return`Staged ${String(e.modules.length)} module${e.modules.length===1?"":"s"} (${String(n)} rebuilt) and wrote ${e.generatedFile}.
|
|
9
|
+
`}i(E,"stageText");function A(e){return`${e.checks.map(s=>`${s.status==="passed"?"ok ":s.status==="note"?"note ":"FAIL "}${s.check}${s.status==="passed"?"":`: ${s.message}`}`).join(`
|
|
10
|
+
`)}
|
|
11
|
+
${e.result==="passed"?"All checks passed.":"Some checks failed."}
|
|
12
|
+
`}i(A,"doctorText");function F(e){return`${[`${e.file}: ${e.kind==="component"?"component":"core module"}, ${l(e.bytes)}`,` abi ${e.abi} (${e.evidence.join("; ")})`,` imports ${e.imports.map(s=>`${s.module} (${String(s.names)})`).join(", ")||"none"}`,` exports ${String(e.exports.length)}${e.exports.length===0?"":`, e.g. ${e.exports.slice(0,5).join(", ")}`}`,` memory ${e.memories.map(s=>`${String(s.minPages)}${s.maxPages===null?"+":`-${String(s.maxPages)}`} pages${s.shared?" shared":""}${s.memory64?" 64-bit":""}`).join(", ")||"imported or none defined"}`,` sections ${e.customSections.join(", ")||"none"}${e.targetFeatures?"":" (no target_features: declare requires.browser features yourself)"}`].join(`
|
|
13
|
+
`)}
|
|
14
|
+
`}i(F,"inspectText");const w=i(e=>e.file===void 0?"":`${e.file}${e.line===void 0?"":`:${String(e.line)}${e.column===void 0?"":`:${String(e.column)}`}`} `,"placeOf"),j=i(e=>`${e.severity==="error"?"error ":"warning"} ${w(e)}${e.message} [${e.code}]`,"findingLine");function p(e){const n=e.findings.map(j);if(e.result==="failed"){const t=e.findings.filter(d=>d.severity==="error").length;return`${n.join(`
|
|
15
|
+
`)}
|
|
16
|
+
The build failed with ${String(t)} error${t===1?"":"s"}; nothing was written.
|
|
17
|
+
`}const s=e.result==="built"?`Built ${e.id??""} ${e.version??""} into ${e.directory??""}.`:`Checked ${e.id??""} ${e.version??""}: it builds, and nothing was written.`;return`${[...n,s,...a("release",e.release===null?[]:[e.release]),...a("files",e.files.map(t=>`${t.name} (${l(t.bytes)})`)),...a("bundles",e.bundled.map(t=>`${t.name}@${t.version} (${t.license})`))].join(`
|
|
18
|
+
`)}
|
|
19
|
+
`}i(p,"buildText");function V(e){return e.tag===null?p(e.build):`${p(e.build)}
|
|
20
|
+
To publish ${e.tag} (none of this has been run):
|
|
21
|
+
|
|
22
|
+
${e.steps.join(`
|
|
23
|
+
|
|
24
|
+
`)}
|
|
25
|
+
`}i(V,"releaseText");function y(e){if(e===void 0)return"";if(e.length===0)return`It declares no commands: command names that start with "${$}" are reserved. Add commands: ["<name>"] after process in module.ts to let programs in a VM run it by a name of your own.
|
|
26
|
+
`;const n=e.length===1?"it":"them";return`It declares the command${e.length===1?"":"s"} ${e.join(", ")}: once an application turns ${n} on, programs in a VM run ${n} as ${e.map(s=>`/usr/local/bin/${s}`).join(", ")} (README.md, "Run it from a shell").
|
|
27
|
+
`}i(y,"commandsText");function I(e){return`Created ${e.directory}: a ${e.kind} module named ${e.id} (abi ${e.abi}), ${String(e.files.length)} files.
|
|
28
|
+
${y(e.commands)}
|
|
29
|
+
Next:
|
|
30
|
+
cd ${e.directory}
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm run check && pnpm test
|
|
33
|
+
pnpm run build
|
|
34
|
+
`}i(I,"initText");function P(e){const n=`${e.module.id} ${e.module.version} (${e.module.kind}, release ${e.module.release.slice(0,12)}) in ${e.browser.name} ${e.browser.version}
|
|
35
|
+
`;if(e.refusal!==void 0){const{refusal:t}=e,d="capability"in t?`capability ${t.capability}`:`missing ${t.missing.join(", ")}`;return`${n}REFUSED ${t.reason}, ${d}: ${t.message}
|
|
36
|
+
No property ran: this browser or image cannot run the module.
|
|
37
|
+
`}const s=e.properties.map(t=>`${t.status==="passed"?"ok ":t.status==="failed"?"FAIL ":"n/a "}${t.property}${t.message===void 0?"":`: ${t.message}`}`),r=e.properties.filter(t=>t.status==="failed").length;return`${n}${s.join(`
|
|
38
|
+
`)}
|
|
39
|
+
${r===0?"All applicable properties passed.":`${String(r)} propert${r===1?"y":"ies"} failed.`}
|
|
40
|
+
`}i(P,"testText");export{v as addText,p as buildText,T as consentText,A as doctorText,o as field,I as initText,F as inspectText,M as printable,V as releaseText,E as stageText,P as testText};
|
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxvm/cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.27",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"bin": {
|
|
7
|
+
"oxvm": "./dist/bin.js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"node": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"NOTICE",
|
|
19
|
+
"THIRD_PARTY_NOTICES.txt",
|
|
20
|
+
"sbom.cdx.json"
|
|
21
|
+
],
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=24"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@oxvm/sdk": "0.0.27"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "24.13.3",
|
|
30
|
+
"typescript": "6.0.3",
|
|
31
|
+
"vitest": "5.1.0"
|
|
32
|
+
},
|
|
33
|
+
"description": "Create and verify OXVM browser applications, images, snapshots, and WebAssembly modules.",
|
|
34
|
+
"keywords": [
|
|
35
|
+
"oxvm",
|
|
36
|
+
"linux",
|
|
37
|
+
"webassembly",
|
|
38
|
+
"browser"
|
|
39
|
+
],
|
|
40
|
+
"homepage": "https://oxvm.dev/docs/",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/spacia-ai/oxidevm-sdk-public/issues"
|
|
43
|
+
},
|
|
44
|
+
"private": false,
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "https://registry.npmjs.org/",
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "https://github.com/spacia-ai/oxidevm-sdk-public.git",
|
|
52
|
+
"directory": "packages/cli"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"check": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
56
|
+
"build": "node --input-type=module -e 'import { rmSync } from \"node:fs\"; rmSync(\"dist\", { recursive: true, force: true });' && tsc -p tsconfig.build.json && node ../../scripts/stage-starter.ts && node ../../scripts/minify-distribution.ts packages/cli/dist && node ../../scripts/package-notices.ts cli",
|
|
57
|
+
"test": "node ../../scripts/stage-starter.ts && vitest run --maxWorkers=2"
|
|
58
|
+
}
|
|
6
59
|
}
|