mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Split the host into transport-independent execution logic and a VM driver, so the VM can run in a worker thread (CodemodeSandbox, unchanged), on the calling thread (InlineCodemodeSandbox), or in another isolate over RPC (RemoteCodemodeSandbox). Add the /portable entry without Node imports and the /cloudflare entry with CodemodeSandboxDurableObject, meant to be deployed as its own Worker so scripts never block the caller's thread. Scripts that compute without awaiting a tool are bounded by an interrupt budget, now also polled while draining promise jobs. examples/cloudflare shows the setup.
13 lines
586 B
JSON
13 lines
586 B
JSON
{
|
|
"$schema": "node_modules/wrangler/config-schema.json",
|
|
"name": "pi-codemode-sandbox",
|
|
"main": "src/index.ts",
|
|
"compatibility_date": "2026-04-22",
|
|
// Reached only through Durable Object bindings, never over HTTP.
|
|
"workers_dev": false,
|
|
"preview_urls": false,
|
|
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["CodemodeSandbox"] }],
|
|
// Optional. The default is 30 seconds of CPU per request; one execution is one request. Keep it above
|
|
// the time the interrupt budget allows, so scripts fail with a timeout instead of resetting the object.
|
|
"limits": { "cpu_ms": 60000 }
|
|
}
|