From e8b46f8e680d4305a35269208c46116aed43bc98 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:26:23 +0000 Subject: [PATCH] Version Packages --- .changeset/bright-event-protocols.md | 19 ------- .changeset/explicit-targetless-transitions.md | 12 ----- .changeset/fresh-actors-emit.md | 27 ---------- CHANGELOG.md | 53 +++++++++++++++++++ package.json | 2 +- 5 files changed, 54 insertions(+), 59 deletions(-) delete mode 100644 .changeset/bright-event-protocols.md delete mode 100644 .changeset/explicit-targetless-transitions.md delete mode 100644 .changeset/fresh-actors-emit.md diff --git a/.changeset/bright-event-protocols.md b/.changeset/bright-event-protocols.md deleted file mode 100644 index 9cb72d5..0000000 --- a/.changeset/bright-event-protocols.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Make `Machine.events` and `Machine.internalEvents` definition-time protocol descriptors that are passed directly to `Machine.make`. The descriptors expose type-safe deferred constructors while retaining their schemas privately, so applications can export the event API without exporting schemas or reaching for throwing schema `.make` methods. - -```ts -const Events = Machine.events(PublicEvent) -const InternalEvents = Machine.internalEvents(InternalEvent) - -const machine = Machine.make({ - states: States.states, - events: Events, - internalEvents: InternalEvents, - initial: () => States.initial.Idle.from() -}) -``` - -Remove the eager schema-based `Machine.event` constructor. Pass complete decoded event objects directly to APIs that intentionally retain values, such as manual model-testing scenarios or transport messages. diff --git a/.changeset/explicit-targetless-transitions.md b/.changeset/explicit-targetless-transitions.md deleted file mode 100644 index 1bf0e4c..0000000 --- a/.changeset/explicit-targetless-transitions.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Add `target.none()` for explicit targetless transitions. Every installed transition handler now returns a concrete target or `target.none()`; declared `targets` remain an upper bound on concrete destinations and never exclude `target.none()`. - -Remove `Machine.retag`. To reuse compatible fields across sibling states, destructure away the source discriminator and construct the destination through its target builder: - -```ts -const { _tag: _, ...fields } = state -return target.local.Saving.from({ ...fields, attempt: 1 }) -``` diff --git a/.changeset/fresh-actors-emit.md b/.changeset/fresh-actors-emit.md deleted file mode 100644 index 1147043..0000000 --- a/.changeset/fresh-actors-emit.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@typeonce/effect-machine": minor ---- - -Separate actor inputs from outward notifications. Declare emissions with `Machine.emittedEvents`, publish them with `emit`, and observe the hot, non-replaying `MachineRef.emissions` stream. Children declare the public inputs they expect from their owner through `parentEvents`, then communicate explicitly with the typed, optional `parent` actor reference: - -```ts -const Emissions = Machine.emittedEvents(Progress) -const ParentEvents = Machine.events(Completed) - -const worker = Machine.make({ - // ... - emittedEvents: Emissions, - parentEvents: ParentEvents -}).handle({ - Working: { - entry: ({ parent }, enqueue) => { - enqueue.emit(Emissions.Progress({ value: 0.5 })) - if (parent !== undefined) { - enqueue.sendTo(parent, ParentEvents.Completed({ value: 42 })) - } - } - } -}) -``` - -Handler contexts also expose typed `self`; invoked-child composition checks that every `parentEvents` case is accepted by the parent. This release renames structural handler ancestry to `containingState` and `ancestors`, supports zero-payload event and emission constructors with `()`, and exposes root and child emission streams through AtomMachine. diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cd36a..314da52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,58 @@ # @typeonce/effect-machine +## 0.10.0 + +### Minor Changes + +- b7004c2: Make `Machine.events` and `Machine.internalEvents` definition-time protocol descriptors that are passed directly to `Machine.make`. The descriptors expose type-safe deferred constructors while retaining their schemas privately, so applications can export the event API without exporting schemas or reaching for throwing schema `.make` methods. + + ```ts + const Events = Machine.events(PublicEvent) + const InternalEvents = Machine.internalEvents(InternalEvent) + + const machine = Machine.make({ + states: States.states, + events: Events, + internalEvents: InternalEvents, + initial: () => States.initial.Idle.from() + }) + ``` + + Remove the eager schema-based `Machine.event` constructor. Pass complete decoded event objects directly to APIs that intentionally retain values, such as manual model-testing scenarios or transport messages. + +- cb137a7: Add `target.none()` for explicit targetless transitions. Every installed transition handler now returns a concrete target or `target.none()`; declared `targets` remain an upper bound on concrete destinations and never exclude `target.none()`. + + Remove `Machine.retag`. To reuse compatible fields across sibling states, destructure away the source discriminator and construct the destination through its target builder: + + ```ts + const { _tag: _, ...fields } = state + return target.local.Saving.from({ ...fields, attempt: 1 }) + ``` + +- 62e2281: Separate actor inputs from outward notifications. Declare emissions with `Machine.emittedEvents`, publish them with `emit`, and observe the hot, non-replaying `MachineRef.emissions` stream. Children declare the public inputs they expect from their owner through `parentEvents`, then communicate explicitly with the typed, optional `parent` actor reference: + + ```ts + const Emissions = Machine.emittedEvents(Progress) + const ParentEvents = Machine.events(Completed) + + const worker = Machine.make({ + // ... + emittedEvents: Emissions, + parentEvents: ParentEvents + }).handle({ + Working: { + entry: ({ parent }, enqueue) => { + enqueue.emit(Emissions.Progress({ value: 0.5 })) + if (parent !== undefined) { + enqueue.sendTo(parent, ParentEvents.Completed({ value: 42 })) + } + } + } + }) + ``` + + Handler contexts also expose typed `self`; invoked-child composition checks that every `parentEvents` case is accepted by the parent. This release renames structural handler ancestry to `containingState` and `ancestors`, supports zero-payload event and emission constructors with `()`, and exposes root and child emission streams through AtomMachine. + ## 0.9.0 ### Minor Changes diff --git a/package.json b/package.json index 0827ce4..09b1d23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@typeonce/effect-machine", - "version": "0.9.0", + "version": "0.10.0", "description": "Schema-first state machines and statecharts for Effect", "author": "Sandro Maglione", "repository": {