Changelog

@tinyactors/node 0.4.0, 19 November 2026

Summary

This release gives both packages, @tinyactors/node and @tinyactors/wasm, an application API, and it breaks every program written for 0.3.0 (6a5e1d4). A Host is now made from its charts and a system name. An I/O processor is an object with receive. Handlers no longer take the host: views and records carry host. spawn takes a chart's name and returns an Actor that you can send to, ask and wait on. A store and a resident bound on the host hibernate the surplus after each turn and load an actor back when it is wanted again (an event, a due delayed send, a migration). A Spawner processor spawns actors by name. compileDir compiles a directory. onDone and onError report how an actor ended, and onHandlerError gets what a handler threw. Errors of the commonest statuses have their own classes (StaleError, StateError, InvalidError, UnsupportedError); any other status stays a TinyactorsError. decodeTraces reads OTLP spans without a host, and version gives the installed version.

The native "ecmascript" datamodel now runs every session in the host's one shared context (2081069). Before, a chart whose scripts declared top-level names got a context of its own per session, which cost about 143 KB a session on node and 60 KB on bun. A chart-level script's functions become helpers that all of the chart's sessions share. A top-level var stays a session variable. A top-level let, const or class is refused, and the compile call warns about each top-level declaration, var included (an error with the warnings-as-errors option).

The README and the guides are grouped as the application API, operating a host and the wire format. A new guide covers sends to an actor that is not there, and the chat-rooms example is rebuilt on the new API.

Upgrading

  • Host (6a5e1d4): new Host(config, options) becomes new Host(charts, options), where charts (Charts) is a compile result, image bytes or an array of them, added when the host is made. Host.restore(snapshot, charts, options) likewise. host.addCharts is removed: use compileCharts and pass the result to new Host (or to the host's addImage method). host.spawnChart is removed: host.spawn takes a chart's name or a ChartRef and returns an Actor (the actor's id is the session). host.actorByName(name) is removed: use host.actor(name), which throws StaleError when no actor has that name, or await host.actors({chart}). send, fail, terminate, hibernate and wake also accept an Actor.
  • HostConfig and HostOptions (6a5e1d4): systemID and ioProcessors move out of the config. Pass system in the options, and the rest of the config as config. A config that holds either of them is a TypeError. The system name "tinyactors-ask" is reserved for ask's replies: a host with that system is refused. IOProcessorConfig is removed, and EffectiveHostConfig.ioProcessors is now a list of {type, location}.
  • I/O processors (6a5e1d4): a handler function becomes an IOProcessor object with receive(send) and an optional location. A plain function is a TypeError.
  • Handlers take no host (6a5e1d4): drop the first parameter of transport, log, telemetry, migrated, migrationDone, a service's handler, Service's receive and stop, and a typed method's OnResult and OnError. Read send.host instead. Send, LogEntry, Migrated and Invocation gain host, and Send gains sender, an Actor.
  • The wake option is removed (6a5e1d4): give the host a store (MemoryStore, SQLiteStore, or your own Store) and a resident bound.
  • compileCharts and compileSystem (6a5e1d4): the resolver moves into the options, so compileCharts(sources, resolver) becomes compileCharts(sources, {resolver}) (CompileOptions gains resolver). directoryResolver and AddChartsOptions are removed: use compileDir.
  • MigrateOptions, SessionParams and SendMessage (6a5e1d4): their session or target may also be an Actor. Nothing to change.
  • Native "ecmascript" charts (2081069): turn a top-level let, const or class into a <data id="..."> that the script assigns. A chart-level function that read session variables by name must take them as arguments. A top-level var keeps working. A function a script of executable content declares is now that run's own, no longer a variable of the session. The compile call now warns about every top-level let, const, class and var, in any chart, quickjs's included, since it cannot know the datamodel: a build that compiles with the warnings-as-errors option fails on them, so move such names into <data> or drop that option. A native-datamodel snapshot taken with 0.3.0 that holds sessions is refused by Host.restore, because a session row now has 7 parts instead of 8.
  • The Spawner (655fe3c) spawns the chart's current version under the requested name and answers spawned with {name, address}. It does not look the name up. This change affects no released version.

Every change in this release

@tinyactors/node 0.3.0, 18 November 2026

Summary

This release replaces the package again. 0.2.0's xstate-style API is removed (70434be), and @tinyactors/node is a new Node-API addon over core's host (387366b, 470d320). Its direct layer mirrors core's C API: a Host with its inputs, handlers and typed methods, compileCharts and compileSystem, encode and decode. A convenience layer adds host.addCharts, host.spawnChart, directoryResolver, and a promise from a typed method given no handler (33fdeab). Charts run on a native "ecmascript" datamodel by default, or in the quickjs sandbox, which stops an evaluation at 1 GiB by default (7b19ec8). Hibernation, migration, snapshots, invoked services, telemetry and other systems are in the API.

@tinyactors/wasm is new: the same API as WebAssembly, for browsers, Workers and platforms with no addon (Windows), and for Node.js and Bun. Both packages share one version and this changelog, and each refuses the other's snapshots.

The package is ESM only. A chart that invokes a type with no service gets error.communication, and the turn no longer throws (eec9515). A config with no system.traceSeed gets a random one (19d8ee2). The addon's functions have the names and lengths index.d.ts declares, and its accessors are not enumerable, as a class's are (307db2f).

Upgrading

  • The package is ESM only. 0.2.0 was CommonJS; 0.3.0 is an ES module and asks for Node.js 22.3 or later, the first with process.getBuiltinModule, which the native datamodel uses (0.2.0 asked for 22.12). From CommonJS, await import('@tinyactors/node') works on every supported version, and require('@tinyactors/node') works on 22.12 and later.
  • The 0.2.0 API is removed, with no compatibility layer (70434be). The concepts map as follows:

- createActor and Actor → host.spawn(host.chart(name)) or host.spawnChart(name), which return a session; send, stop and getSnapshot → host.send, host.terminate, and the typed methods actorState and actorContext. Subscriptions: none.

- createSystem, System and SystemOptions → new Host(config, options): the id is the config's systemID, logger the log handler, clock a SimulatedClock, restore Host.restore. A System's get → host.actorByName, stats → hostStats, flush → host.idle(), sendMany → host.sendMany, snapshot → host.snapshot(), reload → host.addImage of a new image and host.migrate. export and adopt: none.

- HibernationStore, HibernationOptions and createMemoryStore → host.sweep, host.hibernate, the wake handler and host.wake. The store is the application's: no replacement for createMemoryStore.

- Links (createLink, createStoreLink, serveLinks, Envelope, the frames, deliver, ref) → the transport handler for sends to other systems and host.send with an Address for what arrives; parseAddress and formatAddress → Address.

- createMachine, setup, fromSCXML, StateMachine, SCXMLLogic and the action and guard helpers (assign, raise, sendTo, sendParent, log, cancel, stateIn, and, or, not): none. Charts are SCXML, compiled with compileCharts.

- compileSystem keeps its name and takes a manifest Source and a resolver, returning a Compiled; loadImage and SystemImage → host.addImage and host.boot.

- encodeValue and decodeValue (0.2.0's tagged JSON) → encode and decode (CBOR, the value table), which do not read the old encoding; encodeWire, decodeWire and WireValue: none.

  • Names kept with other meanings. SendOptions were the options of the send actions (delay, id); they are now host.send's (sendid, traceparent, origin). MigrateOptions: timeoutMs is now timeout (milliseconds of the host's clock), chart and session choose what moves, wake defaults to false, and an unknown option throws. MigrationResult reaches the migrationDone handler instead of a promise; pending is a list of sessions (bigints), migration names the migration, and failed, a count in 0.2.0, is a list of {session, reason}: read result.failed.length for the number (43deb01). StateValue keeps its shape, read-only, as actorState's value.
  • A stored blob needs a snapshot to survive a restart, as in 0.2.0. A host wakes only a session it knows as hibernated: its record, mailbox and timers stay in the host, not in the blob. A new host refuses another host's blob, even one of the same session number (934d62d). To keep hibernated actors across a restart, store host.snapshot() with the blobs and start with Host.restore. Blobs and snapshots of earlier builds are refused, and images compiled by earlier builds run a <script> in executable content the old way: hibernate, snapshot and compile again with this release (fa0f761).
  • A migration with no timeout fails an actor that runs invocations at once, where it waited for ever; pass a timeout to wait (79bb556).
  • wake refuses a blob older than the session's latest hibernation with TA_ERROR_STALE: keep the latest blob (dcbe4f0).
  • send.answer() and send.fail() return false when the sender has ended, as when it ends while the handler's promise is pending, instead of throwing TA_ERROR_STALE; a closed host, or a second answer or fail, still throws (eec9515).
  • Unreleased builds only: the ...Async methods are gone (33fdeab), and 708bdf9, ceb8adb, cac5ba6, 59d54bc, 3fc0b07, 31a56df, 2b810c6, 309fb66, 5bccb45, ff162e3 and 997706b changed the 0.2.0 code before its removal and need nothing beyond the rewrite.

Every change in this release

@tinyactors/node 0.2.0, 6 October 2026

Summary

This release replaces the package. @tinyactors/node 0.2.0 is the Node.js binding built from tinyactors-core/bindings/node, and its API is a new one (ea4113b). It is xstate-style: machines from createMachine or setup, actors from createActor, SCXML through fromSCXML, compiled systems through compileSystem and loadImage, and links between systems through serveLinks. A few names carry over from 0.1.0 (createSystem, System, SystemOptions, Actor, SendOptions) with new shapes and meanings.

It installs the same way as 0.1.0: a prebuilt addon per platform (darwin-arm64, darwin-x64, linux-x64, linux-arm64) as an optional dependency, with one Linux addon for glibc and musl, so nothing compiles on install. It runs on Node.js 22.12 or later and on Bun.

The commits listed below from before the replacement changed the 0.1.0 addon, which this release no longer contains.

Upgrading

  • The 0.1.0 API is removed, with no compatibility layer: its system API (statechart definitions, post and send with their results, loaders, the debug adapter, and the tracing and metrics helpers) is gone. Rewrite callers against the xstate-style API: createMachine and createActor for a machine, fromSCXML for an SCXML document (ea4113b).
  • createSystem, System, SystemOptions, Actor and SendOptions keep their names but not their shapes: check each use against the new declarations.
  • The changes the 0.1.0 addon went through before it was removed (caf78df, 1d4f458, bb87794, 0bc6cfa, 6a6a1fa, 482417e, 28a0ccb, 19cd181, 904b335, 93c3d46, ccd6d63, bc82ab4, 206cdb4, 3edae90) need nothing beyond that rewrite.

Every change in this release