@@ -3,14 +3,6 @@ import CodeBlock from "../../components/CodeBlock.jsx";
33
44const IMPORT = `import { env, args } from "runtime:process";` ;
55
6- const capabilities = [
7- { cap : "Env" , grants : "Environment, arguments, cwd, platform — backs runtime:process." } ,
8- { cap : "FileRead" , grants : "Read files within the configured root jail." } ,
9- { cap : "FileWrite" , grants : "Write files within the configured root jail." } ,
10- { cap : "Net" , grants : "Open outbound network connections." } ,
11- { cap : "HrTime" , grants : "Access high-resolution timing." } ,
12- ] ;
13-
146const modules = [
157 { name : "runtime:process" , status : "Available" , cap : "Env" , href : "/api/process" } ,
168 { name : "runtime:path" , status : "Planned" , cap : "—" , href : null } ,
@@ -27,8 +19,9 @@ export default function ApiOverview() {
2719 Overview
2820 </ h1 >
2921 < p className = "mt-4 text-lg leading-relaxed text-zinc-600" >
30- ES Runtime is ESM-only, and its embeddable library is deny-by-default.
31- Host functionality is exposed as ES modules under the{ " " }
22+ ES Runtime is ESM-only; the embeddable library is deny-by-default (the
23+ esrun CLI grants all capabilities). Host functionality is exposed as ES
24+ modules under the{ " " }
3225 < code className = "rounded bg-zinc-100 px-1.5 py-0.5 font-mono text-[0.9em]" >
3326 runtime:
3427 </ code > { " " }
@@ -92,58 +85,6 @@ export default function ApiOverview() {
9285 </ tbody >
9386 </ table >
9487 </ div >
95-
96- < h2 className = "mt-12 text-xl font-semibold text-zinc-900" > Capabilities</ h2 >
97- < p className = "mt-3 text-zinc-600" >
98- A fresh runtime can compute but cannot reach the host until the embedder
99- grants the relevant capability. The check lives on the native op, so it
100- cannot be bypassed by reaching a different module path.
101- </ p >
102- < div className = "mt-5 overflow-hidden rounded-xl border border-zinc-200" >
103- < table className = "w-full text-left text-sm" >
104- < thead className = "bg-zinc-50 text-xs uppercase tracking-wider text-zinc-500" >
105- < tr >
106- < th className = "px-4 py-3 font-semibold" > Capability</ th >
107- < th className = "px-4 py-3 font-semibold" > Grants</ th >
108- </ tr >
109- </ thead >
110- < tbody className = "divide-y divide-zinc-100" >
111- { capabilities . map ( ( c ) => (
112- < tr >
113- < td className = "px-4 py-3 font-mono font-medium text-zinc-900" >
114- { c . cap }
115- </ td >
116- < td className = "px-4 py-3 text-zinc-600" > { c . grants } </ td >
117- </ tr >
118- ) ) }
119- </ tbody >
120- </ table >
121- </ div >
122-
123- < div className = "mt-10 grid gap-4 sm:grid-cols-2" >
124- < a
125- href = "/api/cli"
126- className = "flex flex-col rounded-xl border border-zinc-200 p-5 transition-shadow hover:shadow-sm"
127- >
128- < span className = "font-mono font-semibold text-zinc-900" >
129- esrun CLI →
130- </ span >
131- < span className = "mt-1 text-sm text-zinc-600" >
132- Command-line options: run a file, -e, --timeout, --help, --version.
133- </ span >
134- </ a >
135- < a
136- href = "/api/process"
137- className = "flex flex-col rounded-xl border border-zinc-200 p-5 transition-shadow hover:shadow-sm"
138- >
139- < span className = "font-mono font-semibold text-zinc-900" >
140- runtime:process →
141- </ span >
142- < span className = "mt-1 text-sm text-zinc-600" >
143- Environment, arguments, working directory, platform, and exit.
144- </ span >
145- </ a >
146- </ div >
14788 </ ApiShell >
14889 ) ;
14990}
0 commit comments