opencode spins codemode runtime into NormalScript, a tiny embeddable JS VM that can pause and resume
natesiggard · x · 2026-11-26
opencode extracted the runtime powering codemode into a standalone project: NormalScript, a small bytecode VM for a strict-mode JavaScript subset that embeds into Node ≥24 or Bun ≥1.4 with no WASM, native addons, or workers.
- Runs small scripts (agent codemode) and can pause mid-execution, save state to bytes, and resume anywhere
- Promise-first API supporting async/await, classes, and generators, with timeoutMs and AbortSignal
- Deliberately omits timers, the event loop, ambient I/O, and module loading — capabilities are passed in as host functions; no eval, Proxy, or TS syntax
- A Rust implementation is in the works so native apps can use JS as a scripting language
A lightweight, controllable option for embedding script execution in agent sandboxes.
More from coding & agent
- Hermes agent running a custom Monograph UI autonomously fixes its own CSS misalignment — EXM7777 · 2026-11-26
- Matt Shumer ships a MAGI-2 prompt skill that lets Claude call the video model API directly — mattshumer_ · 2026-11-26
- Counterintuitive tip: MAGI-2 follows Chinese prompts much better than English ones — mattshumer_ · 2026-11-26
- Matt Shumer releases free Claude skill that writes structured MAGI-2 video prompts — mattshumer_ · 2026-11-26
- Migrating a 1.6M-line OpenEdge ERP to web with Claude agents: fastest path? — juanver · 2026-11-26
- Thariq Shihipar on coding agents: where human taste goes when software gets cheap — Latent Space · 2026-11-26