npm / @earendil-works/pi-codemode
@earendil-works/pi-codemode
What changed in @earendil-works/pi-codemode 0.99 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-11.
9 breaking1 security20 new APIs and options4 behavior and defaults6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@earendil-works/pi-codemode 136 changes
Breaking changes 8
Worker-backed results and close now settle after requesting shutdown rather than waiting for worker exit; hosts needing actual exit must track onWorkerStarted(exited) or retain capacity through acquireWorker()'s release callback.
Removed this export.
Removed this API.
No longer ignores a
// @options:line that is not first; it now throwsCodemodeSourceErrorinstead of silently missing itstimeout_ms.Renders every output schema as its own type and no longer turns MCP
CallToolResultschemas intoCallToolResult<T>; describe MCP results in the output schema instead.Built-ins are frozen and built-in globals are read-only before scripts run; patches to built-ins have no effect, while specified instance overrides remain possible.
Script output is limited to MAX_OUTPUT_CHARS (16 Mi) characters and MAX_OUTPUT_ITEMS (100000) items; exceeding either limit fails with a RangeError.
Reading a nonexistent member of tools or a global namespace now throws an error naming close matches instead of returning undefined; check for a tool with "name" in tools.
Security 1
Scripts that patch built-ins no longer crash the host or leave
execute()unsettled; malformed worker payloads now fail execution with a sandbox error.
New APIs and options 18
Added a helper that resolves a local $ref to its subschema, including URI-decoded and JSON Pointer unescaped segments.
CodemodeSandbox adds an acquireWorker() hook to reserve shared capacity before starting a worker and release it only on actual exit or constructor failure.
CodemodeSandbox adds an onWorkerStarted(exited) callback so hosts can count a worker against concurrency limits until it actually exits, independently of its script result.
Provides the API shared by all three sandboxes.
Adds a Cloudflare entry whose
CodemodeSandboxDurableObjectis the remote end forRemoteCodemodeSandbox, deployed as its own Cloudflare Worker.Adds an entry with no Node imports.
Runs the VM on the calling thread for runtimes without worker threads.
Limits scripts that compute without awaiting a tool in
InlineCodemodeSandbox.Provides a host callback for calls made during a deterministic
sandbox.start()run.Reports the calls issued after each result during a deterministic run.
Provides the VM's fingerprint during a deterministic run.
Runs each script's VM in another isolate while tools run in the caller.
Lets the host deliver results during a deterministic
sandbox.start()run.Indicates whether a deterministic run has its outcome.
Adds deterministic runs whose calls the host answers itself, allowing a host to replay a script after a restart;
execute()is unchanged.Sets randomness for deterministic runs.
Sets the virtual clock for deterministic runs.
Added the type a tool call resolves to.
Behavior and default changes 3
Shows property constraints that TypeScript cannot express as tags on the property's comment line; retries rendering without tags before rendering an oversized type as
unknown.The VM polls for interrupts while draining promise jobs, stopping scripts such as
while (true) await nullat the same points as a synchronous loop.Text output items produced by console.* now include console: true, allowing hosts to distinguish them from text() output.
Fixes and other changes 6
Console output and thrown non-Error values in scripts now print NaN, Infinity, and -Infinity as text() does, rather than as null.
Malformed percent escapes in local references no longer throw while rendering schemas, declarations, tool signatures, or samples; the reference renders as unknown.
On Bun, aborts, timeouts, and close no longer wait for worker termination while a non-interruptible built-in runs; shutdown requests termination without waiting for exit.
Fixes a broken bridge error when the host runs under
node --watchon Node 24 or 26, which postswatch:import/watch:requiremessages on the worker channel.Errors describe the accepted image block as
{ type: "image", data, mimeType }instead of an MCP image block.Store size errors now explain what the store is for.
@earendil-works/pi-codemode 0.994 changes
Breaking changes 1
image() rejects malformed base64 and unsupported image types, derives MIME type from the image signature, and strips line breaks from wrapped base64.
New APIs and options 2
Introduces CodemodeSandbox, which runs model-written JavaScript in a worker thread and exposes injected tools as async functions.
Injected tools are exposed to model-written JavaScript as async functions called with args.
Behavior and default changes 1
CodemodeSandbox.workerUrl now accepts a string, enabling embedded worker entrypoints in Bun compiled executables.