Skip to content

Commit 1a4a68f

Browse files
feat: strengthen typed statechart protocols
1 parent 026cf3e commit 1a4a68f

28 files changed

Lines changed: 4316 additions & 731 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
"@typeonce/effect-machine": minor
3+
---
4+
5+
Separate public commands from machine-local events with typed `events` and
6+
`internalEvents` protocols, unique-tag validation, and public-schema validation
7+
for Cluster delivery.
8+
9+
Move finality entirely into state definitions. This is a breaking API change:
10+
remove `type: "final"` from handlers and declare final states and output schemas
11+
with `Machine.defineStates`. Handler `context.action` is also removed in favor
12+
of the single canonical `Machine.action` staging API. Planning and execution
13+
now require an output implementation for every declared output schema and
14+
expose discriminated, schema-derived terminal results.
15+
16+
Add typed helpers for one-shot Effects, timers, staged actions with a returned
17+
transition value, state retagging, immediate parents, and identity-safe invoked
18+
child addressing. Add bound Atom runtime factories, fail-aware results,
19+
equality-aware selectors, and reactive child bridges, while tightening startup
20+
and protocol error types. Protocol schemas are owned by each machine and rely
21+
on Effect's schema parser memoization instead of package-level cache registries.
22+
Reactive child bridge identity uses Effect's standard `Atom.family` primitive.
23+
Atom selectors now infer exact state paths and values from their bridge snapshot
24+
and no longer require a separate `DefinedStates` argument.
25+
26+
Match child descriptors by id and machine identity, and split the old overloaded
27+
child constructor:
28+
use `Machine.child(id, machine)` for complete statecharts and
29+
`Machine.childAddress<Event>(id)` for lower-level process addresses.
30+
`Machine.invoke` now separates its lifecycle `id` from an explicit typed
31+
`address`. Remove the direct `AtomMachine.make(runtime, machine)` overload in
32+
favor of `AtomMachine.bind(runtime).make(machine)`, and make the default child
33+
Atom startup-error channel `unknown`.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
22
dist/
3+
references/
34
*.tgz
45
.DS_Store

0 commit comments

Comments
 (0)