From d0b2203da914fcda5f9ec5eb7b4b8d1f963a1092 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 16 Aug 2026 16:07:34 +0000 Subject: [PATCH] Version Packages --- .changeset/brave-cats-listen.md | 5 ---- .changeset/curly-effects-invoke.md | 15 ---------- .changeset/initial-entry-builders.md | 9 ------ .changeset/live-machine-inspection.md | 20 ------------- CHANGELOG.md | 41 +++++++++++++++++++++++++++ package.json | 2 +- 6 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 .changeset/brave-cats-listen.md delete mode 100644 .changeset/curly-effects-invoke.md delete mode 100644 .changeset/initial-entry-builders.md delete mode 100644 .changeset/live-machine-inspection.md diff --git a/.changeset/brave-cats-listen.md b/.changeset/brave-cats-listen.md deleted file mode 100644 index 1433fb9..0000000 --- a/.changeset/brave-cats-listen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Upgrade the exact Effect peer dependency and companion Effect packages to `4.0.0-rc.109`. diff --git a/.changeset/curly-effects-invoke.md b/.changeset/curly-effects-invoke.md deleted file mode 100644 index dc662c1..0000000 --- a/.changeset/curly-effects-invoke.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Require every `Machine.invoke` `effect` source to be a factory evaluated when its owning state is entered. This gives lifecycle callbacks immediate output and failure inference while making Effect construction timing explicit. - -Wrap previously direct Effects in a zero-argument function: - -```ts -Machine.invoke({ - id: "load", - effect: () => load, - onDone: ({ output, target }) => target.none() -}) -``` diff --git a/.changeset/initial-entry-builders.md b/.changeset/initial-entry-builders.md deleted file mode 100644 index 34fa8a1..0000000 --- a/.changeset/initial-entry-builders.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Add typed declared-initial entry to compound and parallel transition targets. - -Use `target.full.opened.initial()`, `initial(value)`, or `initial.from(input)` to enter the initial configuration declared by `Machine.defineStates`; the same operation is available through compatible `local` and `branch` target scopes. Schema-valued implicit children are constructed by `initialize: ({ builder }) => ...`, including fluent completion of every valued parallel region. Missing initializers are reported at `handle(...)`, and `.from` validation remains a typed `MachineSchemaDecodeError` during planning. - -State handler `initial` and its `StateInitial*` utility types have been replaced by `initialize` and `StateInitialize*`. Migrate compound initializers from `initial: () => new Child(...)` to `initialize: ({ builder }) => builder(new Child(...))`, and parallel initializers from returned value records to chained region builders. diff --git a/.changeset/live-machine-inspection.md b/.changeset/live-machine-inspection.md deleted file mode 100644 index 074bd9f..0000000 --- a/.changeset/live-machine-inspection.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Add live, root-scoped machine inspection through `Machine.prepare(machine).inspection` and `AtomMachine.inspection(machineAtom)`. - -The hot Effect `Stream` observes ordered creation, initialization, mailbox delivery and processing, state changes, emissions, Effect and timer activities, and termination for a prepared root and all locally owned descendants: - -```ts -const prepared = yield * Machine.prepare(machine) - -yield * prepared.inspection.pipe( - Stream.runForEach((event) => Console.log(event.sequence, event.subject.id, event._tag)), - Effect.forkScoped({ startImmediately: true }) -) - -const ref = yield * prepared.start -``` - -Inspection is non-replayed, never fails, and completes with the root. Its session ids and ordering are local to one prepared ownership tree; distributed identity and delivery remain an Effect Cluster concern. diff --git a/CHANGELOG.md b/CHANGELOG.md index f6707fa..b029b6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,46 @@ # @typeonce/effect-machine +## 0.13.0 + +### Minor Changes + +- 0ca9134: Upgrade the exact Effect peer dependency and companion Effect packages to `4.0.0-rc.109`. +- aa4947f: Require every `Machine.invoke` `effect` source to be a factory evaluated when its owning state is entered. This gives lifecycle callbacks immediate output and failure inference while making Effect construction timing explicit. + + Wrap previously direct Effects in a zero-argument function: + + ```ts + Machine.invoke({ + id: "load", + effect: () => load, + onDone: ({ output, target }) => target.none() + }) + ``` + +- 34a9a26: Add typed declared-initial entry to compound and parallel transition targets. + + Use `target.full.opened.initial()`, `initial(value)`, or `initial.from(input)` to enter the initial configuration declared by `Machine.defineStates`; the same operation is available through compatible `local` and `branch` target scopes. Schema-valued implicit children are constructed by `initialize: ({ builder }) => ...`, including fluent completion of every valued parallel region. Missing initializers are reported at `handle(...)`, and `.from` validation remains a typed `MachineSchemaDecodeError` during planning. + + State handler `initial` and its `StateInitial*` utility types have been replaced by `initialize` and `StateInitialize*`. Migrate compound initializers from `initial: () => new Child(...)` to `initialize: ({ builder }) => builder(new Child(...))`, and parallel initializers from returned value records to chained region builders. + +- c8728e5: Add live, root-scoped machine inspection through `Machine.prepare(machine).inspection` and `AtomMachine.inspection(machineAtom)`. + + The hot Effect `Stream` observes ordered creation, initialization, mailbox delivery and processing, state changes, emissions, Effect and timer activities, and termination for a prepared root and all locally owned descendants: + + ```ts + const prepared = yield * Machine.prepare(machine) + + yield * + prepared.inspection.pipe( + Stream.runForEach((event) => Console.log(event.sequence, event.subject.id, event._tag)), + Effect.forkScoped({ startImmediately: true }) + ) + + const ref = yield * prepared.start + ``` + + Inspection is non-replayed, never fails, and completes with the root. Its session ids and ordering are local to one prepared ownership tree; distributed identity and delivery remain an Effect Cluster concern. + ## 0.12.0 ### Minor Changes diff --git a/package.json b/package.json index e5f076b..4f1e534 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/effect-machine", - "version": "0.12.0", + "version": "0.13.0", "description": "Schema-first state machines and statecharts for Effect", "author": "Sandro Maglione", "repository": {