E(vatAdmin).makeIngress(labels) reserves a mount and returns an ingress; whoever holds it serves requests carrying those labels by calling E(ingress).serve(handler). A vat gets one in its params, like any other remote object; nothing in a vat's module is an entrypoint. A request reaches the handler as passable data (method, path, labels, body), and the response comes back as data (status, headers, body). The handler is a live reference for now: after a restart its mount answers 503. vats/hello.js serves hello, world; pnpm hello creates it on a running toybox (client.js is the Node OCapN client, shared with the tests). pnpm start and pnpm switchboard never ran: systemd-socket-activate wants absolute paths for unix sockets. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
1.0 KiB
JSON
25 lines
1.0 KiB
JSON
{
|
|
"name": "toybox",
|
|
"version": "0.0.1",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"start": "node build.js && mkdir -p state && rm -f admin.sock && systemd-socket-activate -l 127.0.0.1:8787 -l \"$PWD/admin.sock\" -- node_modules/workerd/bin/workerd serve --experimental config.capnp -S http=3 -S admin=4 -d state=state -e \"switchboard=unix:$PWD/switchboard-public.sock\"",
|
|
"switchboard": "rm -f switchboard-public.sock switchboard-local.sock && systemd-socket-activate -l \"$PWD/switchboard-public.sock\" -l \"$PWD/switchboard-local.sock\" -- node_modules/workerd/bin/workerd serve --experimental switchboard.capnp -S public=3 -S local=4",
|
|
"test": "node build.js && node --import ./test/lockdown.js --test test/*.test.js",
|
|
"build": "node build.js",
|
|
"hello": "node --import ./test/lockdown.js scripts/hello.js"
|
|
},
|
|
"devDependencies": {
|
|
"esbuild": "^0.28.2",
|
|
"workerd": "1.20261006.1",
|
|
"ws": "8.22.0"
|
|
},
|
|
"dependencies": {
|
|
"@endo/far": "^1.1.14",
|
|
"@endo/init": "^1.1.13",
|
|
"@endo/ocapn": "1.1.1",
|
|
"capnweb": "0.12.0"
|
|
}
|
|
}
|