@typeonce/effect-machine 0.31.2 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/README.md +145 -140
  2. package/dist/Machine.d.ts +428 -254
  3. package/dist/Machine.d.ts.map +1 -1
  4. package/dist/Machine.js +91 -111
  5. package/dist/Machine.js.map +1 -1
  6. package/dist/internal/machine/atom.d.ts +3 -4
  7. package/dist/internal/machine/atom.d.ts.map +1 -1
  8. package/dist/internal/machine/atom.js +0 -2
  9. package/dist/internal/machine/atom.js.map +1 -1
  10. package/dist/internal/machine/childRegistry.d.ts +52 -0
  11. package/dist/internal/machine/childRegistry.d.ts.map +1 -0
  12. package/dist/internal/machine/childRegistry.js +74 -0
  13. package/dist/internal/machine/childRegistry.js.map +1 -0
  14. package/dist/internal/machine/cluster.d.ts +2 -3
  15. package/dist/internal/machine/cluster.d.ts.map +1 -1
  16. package/dist/internal/machine/cluster.js.map +1 -1
  17. package/dist/internal/machine/configuration.d.ts.map +1 -1
  18. package/dist/internal/machine/configuration.js +14 -4
  19. package/dist/internal/machine/configuration.js.map +1 -1
  20. package/dist/internal/machine/executionPlan.d.ts +1 -0
  21. package/dist/internal/machine/executionPlan.d.ts.map +1 -1
  22. package/dist/internal/machine/executionPlan.js +97 -53
  23. package/dist/internal/machine/executionPlan.js.map +1 -1
  24. package/dist/internal/machine/invocation.d.ts.map +1 -1
  25. package/dist/internal/machine/invocation.js +4 -2
  26. package/dist/internal/machine/invocation.js.map +1 -1
  27. package/dist/internal/machine/invocationDefinition.d.ts +35 -0
  28. package/dist/internal/machine/invocationDefinition.d.ts.map +1 -0
  29. package/dist/internal/machine/invocationDefinition.js +21 -0
  30. package/dist/internal/machine/invocationDefinition.js.map +1 -0
  31. package/dist/internal/machine/invocationEvent.d.ts +0 -2
  32. package/dist/internal/machine/invocationEvent.d.ts.map +1 -1
  33. package/dist/internal/machine/invocationEvent.js +0 -8
  34. package/dist/internal/machine/invocationEvent.js.map +1 -1
  35. package/dist/internal/machine/machine.d.ts +21 -43
  36. package/dist/internal/machine/machine.d.ts.map +1 -1
  37. package/dist/internal/machine/machine.js +98 -374
  38. package/dist/internal/machine/machine.js.map +1 -1
  39. package/dist/internal/machine/planner.d.ts +13 -19
  40. package/dist/internal/machine/planner.d.ts.map +1 -1
  41. package/dist/internal/machine/planner.js +63 -35
  42. package/dist/internal/machine/planner.js.map +1 -1
  43. package/dist/internal/machine/process.d.ts +6 -8
  44. package/dist/internal/machine/process.d.ts.map +1 -1
  45. package/dist/internal/machine/process.js +1 -0
  46. package/dist/internal/machine/process.js.map +1 -1
  47. package/dist/internal/machine/protocol.d.ts +2 -2
  48. package/dist/internal/machine/protocol.d.ts.map +1 -1
  49. package/dist/internal/machine/protocol.js +4 -18
  50. package/dist/internal/machine/protocol.js.map +1 -1
  51. package/dist/internal/machine/readiness.d.ts +1 -1
  52. package/dist/internal/machine/readiness.d.ts.map +1 -1
  53. package/dist/internal/machine/requirements.d.ts +4 -0
  54. package/dist/internal/machine/requirements.d.ts.map +1 -0
  55. package/dist/internal/machine/requirements.js +2 -0
  56. package/dist/internal/machine/requirements.js.map +1 -0
  57. package/dist/internal/machine/runtime.d.ts +4 -58
  58. package/dist/internal/machine/runtime.d.ts.map +1 -1
  59. package/dist/internal/machine/runtime.js +1 -69
  60. package/dist/internal/machine/runtime.js.map +1 -1
  61. package/dist/internal/machine/serialization.d.ts.map +1 -1
  62. package/dist/internal/machine/serialization.js +16 -0
  63. package/dist/internal/machine/serialization.js.map +1 -1
  64. package/dist/internal/machine/stateDefinition.d.ts +3 -1
  65. package/dist/internal/machine/stateDefinition.d.ts.map +1 -1
  66. package/dist/internal/machine/stateDefinition.js +36 -2
  67. package/dist/internal/machine/stateDefinition.js.map +1 -1
  68. package/dist/internal/machine/targetBuilder.d.ts +16 -0
  69. package/dist/internal/machine/targetBuilder.d.ts.map +1 -0
  70. package/dist/internal/machine/targetBuilder.js +333 -0
  71. package/dist/internal/machine/targetBuilder.js.map +1 -0
  72. package/dist/internal/machine/topology.js +3 -3
  73. package/dist/internal/machine/topology.js.map +1 -1
  74. package/dist/internal/machine/transition.d.ts +16 -0
  75. package/dist/internal/machine/transition.d.ts.map +1 -0
  76. package/dist/internal/machine/transition.js +2 -0
  77. package/dist/internal/machine/transition.js.map +1 -0
  78. package/dist/internal/testing/machine/finiteModel.d.ts.map +1 -1
  79. package/dist/internal/testing/machine/finiteModel.js +10 -12
  80. package/dist/internal/testing/machine/finiteModel.js.map +1 -1
  81. package/dist/internal/testing/machine/format.d.ts +7 -0
  82. package/dist/internal/testing/machine/format.d.ts.map +1 -0
  83. package/dist/internal/testing/machine/format.js +104 -0
  84. package/dist/internal/testing/machine/format.js.map +1 -0
  85. package/dist/internal/testing/machine/probe.d.ts +1 -1
  86. package/dist/internal/testing/machine/probe.d.ts.map +1 -1
  87. package/dist/internal/testing/machine/probe.js +1 -1
  88. package/dist/internal/testing/machine/probe.js.map +1 -1
  89. package/dist/internal/testing/machine/referenceModel.d.ts.map +1 -1
  90. package/dist/internal/testing/machine/referenceModel.js +15 -19
  91. package/dist/internal/testing/machine/referenceModel.js.map +1 -1
  92. package/dist/internal/testing/machine/trace.d.ts +1 -1
  93. package/dist/internal/testing/machine/trace.d.ts.map +1 -1
  94. package/dist/internal/testing/machine/trace.js +3 -3
  95. package/dist/internal/testing/machine/trace.js.map +1 -1
  96. package/dist/internal/testing/machine/value.d.ts +8 -0
  97. package/dist/internal/testing/machine/value.d.ts.map +1 -0
  98. package/dist/internal/testing/machine/value.js +82 -0
  99. package/dist/internal/testing/machine/value.js.map +1 -0
  100. package/dist/internal/testing/machine/verification.d.ts +2 -13
  101. package/dist/internal/testing/machine/verification.d.ts.map +1 -1
  102. package/dist/internal/testing/machine/verification.js +21 -113
  103. package/dist/internal/testing/machine/verification.js.map +1 -1
  104. package/dist/testing/MachineTest.d.ts +89 -104
  105. package/dist/testing/MachineTest.d.ts.map +1 -1
  106. package/dist/testing/MachineTest.js +70 -84
  107. package/dist/testing/MachineTest.js.map +1 -1
  108. package/dist/unstable/cluster/ClusterMachine.d.ts +10 -13
  109. package/dist/unstable/cluster/ClusterMachine.d.ts.map +1 -1
  110. package/dist/unstable/cluster/ClusterMachine.js +5 -8
  111. package/dist/unstable/cluster/ClusterMachine.js.map +1 -1
  112. package/dist/unstable/reactivity/AtomMachine.d.ts +26 -61
  113. package/dist/unstable/reactivity/AtomMachine.d.ts.map +1 -1
  114. package/dist/unstable/reactivity/AtomMachine.js +17 -26
  115. package/dist/unstable/reactivity/AtomMachine.js.map +1 -1
  116. package/docs/agent-guide.md +45 -45
  117. package/docs/effect-atom-react.md +35 -63
  118. package/docs/machine-review.md +7 -7
  119. package/docs/root-api.md +214 -0
  120. package/package.json +1 -1
  121. package/src/Machine.ts +778 -437
  122. package/src/internal/machine/atom.ts +3 -13
  123. package/src/internal/machine/childRegistry.ts +141 -0
  124. package/src/internal/machine/cluster.ts +5 -14
  125. package/src/internal/machine/configuration.ts +20 -4
  126. package/src/internal/machine/executionPlan.ts +109 -52
  127. package/src/internal/machine/invocation.ts +10 -6
  128. package/src/internal/machine/invocationDefinition.ts +52 -0
  129. package/src/internal/machine/invocationEvent.ts +0 -8
  130. package/src/internal/machine/machine.ts +154 -679
  131. package/src/internal/machine/planner.ts +74 -62
  132. package/src/internal/machine/process.ts +14 -21
  133. package/src/internal/machine/protocol.ts +9 -32
  134. package/src/internal/machine/readiness.ts +1 -0
  135. package/src/internal/machine/requirements.ts +11 -0
  136. package/src/internal/machine/runtime.ts +17 -186
  137. package/src/internal/machine/serialization.ts +22 -0
  138. package/src/internal/machine/stateDefinition.ts +36 -3
  139. package/src/internal/machine/targetBuilder.ts +525 -0
  140. package/src/internal/machine/topology.ts +3 -3
  141. package/src/internal/machine/transition.ts +26 -0
  142. package/src/internal/testing/machine/finiteModel.ts +22 -23
  143. package/src/internal/testing/machine/format.ts +120 -0
  144. package/src/internal/testing/machine/probe.ts +4 -4
  145. package/src/internal/testing/machine/referenceModel.ts +25 -17
  146. package/src/internal/testing/machine/trace.ts +4 -4
  147. package/src/internal/testing/machine/value.ts +77 -0
  148. package/src/internal/testing/machine/verification.ts +904 -1109
  149. package/src/testing/MachineTest.ts +103 -114
  150. package/src/unstable/cluster/ClusterMachine.ts +10 -20
  151. package/src/unstable/reactivity/AtomMachine.ts +42 -79
@@ -9,15 +9,19 @@ import type * as Schema from "effect/Schema";
9
9
  import type { FastCheck } from "effect/testing";
10
10
  import type { EnsureExecutable } from "../internal/machine/readiness.js";
11
11
  import type { SchemaArbitraryReport } from "../internal/testing/machine/arbitrary.js";
12
+ import * as ExplorationImpl from "../internal/testing/machine/exploration.js";
12
13
  import type { FiniteModel } from "../internal/testing/machine/finiteModel.js";
13
- import type * as ReferenceModel from "../internal/testing/machine/referenceModel.js";
14
- import * as internal from "../internal/testing/machine/verification.js";
14
+ import * as InvariantTest from "../internal/testing/machine/invariant.js";
15
+ import * as ProbeTest from "../internal/testing/machine/probe.js";
16
+ import * as ReferenceModel from "../internal/testing/machine/referenceModel.js";
17
+ import type * as RuntimeTest from "../internal/testing/machine/runtime.js";
18
+ import * as RuntimeInvariantTest from "../internal/testing/machine/runtimeInvariant.js";
15
19
  import type { VerificationError } from "../internal/testing/machine/verification.js";
16
20
  import type * as Machine from "../Machine.js";
17
- export { advanceCommand, type CausalRuntimeAssertionContext, type CausalRuntimeCommandActual, CausalRuntimeCommandFailure, type CausalRuntimeCommandRecord, type CausalRuntimeCommandResult, type CausalRuntimeInspectionContext, type CausalRuntimeModelOptions, type CausalRuntimeModelStep, type CausalRuntimeTranscript, type CausalVerificationAwaitContext, type CausalVerificationOptions, type CausalVerificationTranscript, checkpointCommand, type EnqueuedRuntimeAssertionContext, type EnqueuedRuntimeCommandActual, type EnqueuedRuntimeCommandRecord, type EnqueuedRuntimeInspectionContext, type EnqueuedRuntimeModelOptions, type EnqueuedRuntimeModelStep, type EnqueuedRuntimeTranscript, formatCausalTranscript, formatEnqueuedTranscript, formatRuntimeTranscript, runCausalCommands, runEnqueuedCommands, runRuntimeCommands, type RuntimeAssertionContext, type RuntimeAwait, type RuntimeCommand, type RuntimeCommandActual, RuntimeCommandFailure, type RuntimeCommandRecord, type RuntimeCommandResult, type RuntimeCommands, runtimeCommands, type RuntimeCommandsDiagnostics, type RuntimeCommandsOptions, type RuntimeInspectionContext, type RuntimeModelOptions, type RuntimeModelStep, RuntimeObservationError, RuntimeSynchronization, type RuntimeTranscript, sendCommand, stopCommand, verifyCausalCommands } from "../internal/testing/machine/verification.js";
18
- export type { SchemaArbitraryOpaqueFilterWarning, SchemaArbitraryReport, SchemaArbitraryWarning } from "../internal/testing/machine/verification.js";
19
- export { compileModel, type FiniteAtomicState, type FiniteAutomaticTransition, type FiniteCompoundState, type FiniteEventTransition, type FiniteFinalState, type FiniteHistoryMutation, type FiniteHistoryScenario, type FiniteHistoryState, type FiniteHistoryTransfer, type FiniteModel, type FiniteModelDiagnostics, type FiniteModelOptions, type FiniteModels, finiteModels, type FiniteParallelState, type FiniteState, type FiniteTransition, type FiniteTransitionTrigger } from "../internal/testing/machine/verification.js";
20
- export { ModelVerificationError, type ModelVerificationField, type ModelVerificationLocation, type ModelVerificationMismatch, type ReferenceCompletion, type ReferenceHistoryRecord, type ReferenceInitialStep, type ReferenceMicrostep, type ReferenceState, type ReferenceStateValue, type ReferenceStep, type ReferenceTrace, type ReferenceTransition } from "../internal/testing/machine/verification.js";
21
+ export { advanceCommand, type CausalRuntimeAssertionContext, type CausalRuntimeCommandActual, CausalRuntimeCommandFailure, type CausalRuntimeCommandRecord, type CausalRuntimeCommandResult, type CausalRuntimeInspectionContext, type CausalRuntimeModelOptions, type CausalRuntimeModelStep, type CausalRuntimeTranscript, type CausalVerificationAwaitContext, type CausalVerificationOptions, type CausalVerificationTranscript, checkpointCommand, type EnqueuedRuntimeAssertionContext, type EnqueuedRuntimeCommandActual, type EnqueuedRuntimeCommandRecord, type EnqueuedRuntimeInspectionContext, type EnqueuedRuntimeModelOptions, type EnqueuedRuntimeModelStep, type EnqueuedRuntimeTranscript, formatCausalTranscript, formatEnqueuedTranscript, formatRuntimeTranscript, runCausalCommands, runEnqueuedCommands, runRuntimeCommands, type RuntimeAssertionContext, type RuntimeAwait, type RuntimeCommand, type RuntimeCommandActual, RuntimeCommandFailure, type RuntimeCommandRecord, type RuntimeCommandResult, type RuntimeCommands, runtimeCommands, type RuntimeCommandsDiagnostics, type RuntimeCommandsOptions, type RuntimeInspectionContext, type RuntimeModelOptions, type RuntimeModelStep, RuntimeObservationError, RuntimeSynchronization, type RuntimeTranscript, sendCommand, stopCommand, verifyCausalCommands } from "../internal/testing/machine/runtime.js";
22
+ export type { SchemaArbitraryOpaqueFilterWarning, SchemaArbitraryReport, SchemaArbitraryWarning } from "../internal/testing/machine/arbitrary.js";
23
+ export { compileModel, type FiniteAtomicState, type FiniteAutomaticTransition, type FiniteCompoundState, type FiniteEventTransition, type FiniteFinalState, type FiniteHistoryMutation, type FiniteHistoryScenario, type FiniteHistoryState, type FiniteHistoryTransfer, type FiniteModel, type FiniteModelDiagnostics, type FiniteModelOptions, type FiniteModels, finiteModels, type FiniteParallelState, type FiniteState, type FiniteTransition, type FiniteTransitionTrigger } from "../internal/testing/machine/finiteModel.js";
24
+ export { ModelVerificationError, type ModelVerificationField, type ModelVerificationLocation, type ModelVerificationMismatch, type ReferenceCompletion, type ReferenceHistoryRecord, type ReferenceInitialStep, type ReferenceMicrostep, type ReferenceState, type ReferenceStateValue, type ReferenceStep, type ReferenceTrace, type ReferenceTransition } from "../internal/testing/machine/referenceModel.js";
21
25
  /**
22
26
  * Purely interprets a finite hierarchical model without compiling a
23
27
  * machine.
@@ -43,10 +47,10 @@ type RootReadyMachine<M extends AnyMachine> = ReadyMachine<M> & Machine.Machine.
43
47
  * @since 0.4.0
44
48
  */
45
49
  export type Scenario<M extends AnyMachine> = Machine.Machine.InputSchema<M> extends typeof Schema.Void ? {
46
- readonly events: ReadonlyArray<Machine.Machine.InputEvent<M>>;
50
+ readonly events: ReadonlyArray<Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>>;
47
51
  } : {
48
52
  readonly input: InputValue<M>;
49
- readonly events: ReadonlyArray<Machine.Machine.InputEvent<M>>;
53
+ readonly events: ReadonlyArray<Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>>;
50
54
  };
51
55
  /**
52
56
  * Options for schema-derived scenario generation.
@@ -113,22 +117,19 @@ export interface Scenarios<M extends AnyMachine> {
113
117
  *
114
118
  * class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
115
119
  * class Reset extends Schema.TaggedClass<Reset>("Reset")("Reset", {}) {}
116
- * const States = Machine.states({ Idle })
120
+ * const States = Machine.state({ initial: "Idle", states: { Idle } })
117
121
  * const machine = Machine.make({
118
- * states: States.states,
119
- * events: Machine.events(Reset),
120
- * initial: {
121
- * target: (to) => to.Idle(),
122
- * resolve: ({ target }) => target.from()
123
- * }
124
- * }).handle({
122
+ * root: States,
123
+ * events: Machine.eventsFromSchemas(Reset),
124
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Idle.from()))
125
+ * }).handle({ states: {
125
126
  * Idle: {
126
127
  * on: {
127
128
  * Reset: (to) =>
128
- * to.full.Idle().resolve(({ target }) => target.from())
129
+ * to.branch.Idle().resolve(({ target }) => target.from())
129
130
  * }
130
131
  * }
131
- * })
132
+ * } })
132
133
  *
133
134
  * const generated = MachineTest.scenarios(machine, { maxEvents: 5 })
134
135
  * ```
@@ -162,7 +163,7 @@ export interface Microstep<M extends AnyMachine, Requirements = Machine.Machine.
162
163
  readonly transitions: ReadonlyArray<Machine.Machine.RetainedTransition<StatePath<M>, Machine.Machine.TagOf<Machine.Machine.Events<M>[number]>, StateNodePath<M>>>;
163
164
  readonly commands: ReadonlyArray<Machine.Command>;
164
165
  readonly raisedEvents: ReadonlyArray<Machine.Machine.Event<M>>;
165
- readonly emittedEvents: ReadonlyArray<Machine.Machine.Emit<M>>;
166
+ readonly emittedEvents: ReadonlyArray<Machine.Machine.EmittedEvent<M>>;
166
167
  readonly exitPaths: ReadonlyArray<string>;
167
168
  readonly entryPaths: ReadonlyArray<string>;
168
169
  readonly changed: boolean;
@@ -178,7 +179,7 @@ export type InitialPlan<M extends AnyMachine> = {
178
179
  readonly initialEntryPaths: ReadonlyArray<StatePath<M>>;
179
180
  readonly state: Machine.Machine.Snapshot<Machine.Machine.States<M>>;
180
181
  readonly commands: ReadonlyArray<Machine.Command>;
181
- readonly emittedEvents: ReadonlyArray<Machine.Machine.Emit<M>>;
182
+ readonly emittedEvents: ReadonlyArray<Machine.Machine.EmittedEvent<M>>;
182
183
  readonly microsteps: ReadonlyArray<Microstep<M, Machine.Machine.InitialServices<M> | Machine.Machine.Services<M>>>;
183
184
  } & PlanCompletion<M>;
184
185
  /**
@@ -188,9 +189,10 @@ export type InitialPlan<M extends AnyMachine> = {
188
189
  * @since 0.4.0
189
190
  */
190
191
  export type EventPlan<M extends AnyMachine> = {
192
+ readonly event: Machine.Machine.InputEvent<M>;
191
193
  readonly next: Machine.Machine.Snapshot<Machine.Machine.States<M>>;
192
194
  readonly commands: ReadonlyArray<Machine.Command>;
193
- readonly emittedEvents: ReadonlyArray<Machine.Machine.Emit<M>>;
195
+ readonly emittedEvents: ReadonlyArray<Machine.Machine.EmittedEvent<M>>;
194
196
  readonly microsteps: ReadonlyArray<Microstep<M>>;
195
197
  } & PlanCompletion<M>;
196
198
  /**
@@ -252,9 +254,10 @@ export type ProbeMicrostep<M extends AnyMachine> = Omit<Microstep<M>, "transitio
252
254
  * @since 0.4.0
253
255
  */
254
256
  export type ProbePlan<M extends AnyMachine> = {
257
+ readonly event: Machine.Machine.InputEvent<M>;
255
258
  readonly next: Machine.Machine.Snapshot<Machine.Machine.States<M>>;
256
259
  readonly commands: ReadonlyArray<Machine.Command>;
257
- readonly emittedEvents: ReadonlyArray<Machine.Machine.Emit<M>>;
260
+ readonly emittedEvents: ReadonlyArray<Machine.Machine.EmittedEvent<M>>;
258
261
  readonly microsteps: ReadonlyArray<ProbeMicrostep<M>>;
259
262
  } & PlanCompletion<M>;
260
263
  /**
@@ -289,12 +292,12 @@ export interface ProbeStep<M extends AnyMachine> {
289
292
  */
290
293
  export interface Probe<M extends AnyMachine, Error = never, Output = never> {
291
294
  readonly machine: M;
292
- readonly ref: Machine.MachineRef<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Machine.Machine.InputEvent<M>, Error, Output>;
293
- readonly sendAndAwait: (event: Machine.Machine.InputEvent<M>) => Effect.Effect<ProbeStep<M>, Error | Machine.StoppedError>;
295
+ readonly ref: Machine.MachineRef<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>, Error, Output>;
296
+ readonly sendAndAwait: (event: Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>) => Effect.Effect<ProbeStep<M>, Error | Machine.MachineSchemaDecodeError | Machine.StoppedError>;
294
297
  /** Constructors for asynchronous observation after a causal command. */
295
298
  readonly await: {
296
- readonly none: internal.RuntimeAwait<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
297
- readonly until: (predicate: (snapshot: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>) => boolean) => internal.RuntimeAwait<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
299
+ readonly none: RuntimeTest.RuntimeAwait<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
300
+ readonly until: (predicate: (snapshot: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>) => boolean) => RuntimeTest.RuntimeAwait<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
298
301
  };
299
302
  }
300
303
  /**
@@ -304,7 +307,7 @@ export interface Probe<M extends AnyMachine, Error = never, Output = never> {
304
307
  * @category errors
305
308
  * @since 0.4.0
306
309
  */
307
- export { ProbeUnavailableError } from "../internal/testing/machine/verification.js";
310
+ export { ProbeUnavailableError } from "../internal/testing/machine/probe.js";
308
311
  /**
309
312
  * Attaches testing-only causal event delivery to a running statechart.
310
313
  *
@@ -320,15 +323,12 @@ export { ProbeUnavailableError } from "../internal/testing/machine/verification.
320
323
  * import { MachineTest } from "@typeonce/effect-machine/testing"
321
324
  *
322
325
  * class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
323
- * const States = Machine.states({ Idle })
326
+ * const States = Machine.state({ initial: "Idle", states: { Idle } })
324
327
  * const machine = Machine.make({
325
- * states: States.states,
326
- * events: Machine.events(),
327
- * initial: {
328
- * target: (to) => to.Idle(),
329
- * resolve: ({ target }) => target.from()
330
- * }
331
- * }).handle({ Idle: {} })
328
+ * root: States,
329
+ * events: Machine.eventsFromSchemas(),
330
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Idle.from()))
331
+ * }).handle({ states: { Idle: {} } })
332
332
  *
333
333
  * const program = Effect.gen(function*() {
334
334
  * const ref = yield* Machine.start(machine)
@@ -339,7 +339,7 @@ export { ProbeUnavailableError } from "../internal/testing/machine/verification.
339
339
  * @category runtime testing
340
340
  * @since 0.4.0
341
341
  */
342
- export declare const probe: <M extends AnyMachine, Error, Output>(machine: ReadyMachine<M>, ref: Machine.MachineRef<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Machine.Machine.InputEvent<M>, Error, Output>) => Effect.Effect<Probe<M, Error, Output>, internal.ProbeUnavailableError>;
342
+ export declare const probe: <M extends AnyMachine, Error, Output>(machine: ReadyMachine<M>, ref: Machine.MachineRef<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>, Error, Output>) => Effect.Effect<Probe<M, Error, Output>, ProbeTest.ProbeUnavailableError>;
343
343
  /**
344
344
  * The runtime error channel exposed by a managed reference for a machine.
345
345
  *
@@ -355,8 +355,8 @@ export type RuntimeInvariantErrorChannel<M extends AnyMachine> = Machine.Machine
355
355
  */
356
356
  export interface CausalRuntimeEvidenceRecord<M extends AnyMachine, Error, Output> {
357
357
  readonly index: number;
358
- readonly command: internal.RuntimeCommand<Machine.Machine.InputEvent<M>>;
359
- readonly actual: internal.CausalRuntimeCommandActual<M, Error, Output, unknown>;
358
+ readonly command: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>;
359
+ readonly actual: RuntimeTest.CausalRuntimeCommandActual<M, Error, Output, unknown>;
360
360
  }
361
361
  /**
362
362
  * The model-independent evidence shared by causal command transcripts.
@@ -365,7 +365,7 @@ export interface CausalRuntimeEvidenceRecord<M extends AnyMachine, Error, Output
365
365
  * @since 0.4.0
366
366
  */
367
367
  export interface CausalRuntimeEvidence<M extends AnyMachine, Error, Output> {
368
- readonly commands: ReadonlyArray<internal.RuntimeCommand<Machine.Machine.InputEvent<M>>>;
368
+ readonly commands: ReadonlyArray<RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>>;
369
369
  readonly initial: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
370
370
  readonly records: ReadonlyArray<CausalRuntimeEvidenceRecord<M, Error, Output>>;
371
371
  readonly final: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, Error, Output>;
@@ -392,8 +392,8 @@ export type RuntimeSnapshotObservation = "initial" | "command" | "awaited" | "fi
392
392
  */
393
393
  export interface RuntimeInvariantRecord<M extends AnyMachine> {
394
394
  readonly index: number;
395
- readonly command: internal.RuntimeCommand<Machine.Machine.InputEvent<M>>;
396
- readonly result: internal.CausalRuntimeCommandResult<M>;
395
+ readonly command: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>;
396
+ readonly result: RuntimeTest.CausalRuntimeCommandResult<M>;
397
397
  readonly snapshot: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, RuntimeInvariantErrorChannel<M>, Machine.Machine.Output<M>>;
398
398
  readonly awaited: ReadonlyArray<Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, RuntimeInvariantErrorChannel<M>, Machine.Machine.Output<M>>>;
399
399
  }
@@ -404,7 +404,7 @@ export interface RuntimeInvariantRecord<M extends AnyMachine> {
404
404
  * @since 0.4.0
405
405
  */
406
406
  export interface RuntimeInvariantTranscript<M extends AnyMachine> {
407
- readonly commands: ReadonlyArray<internal.RuntimeCommand<Machine.Machine.InputEvent<M>>>;
407
+ readonly commands: ReadonlyArray<RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>>;
408
408
  readonly initial: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, RuntimeInvariantErrorChannel<M>, Machine.Machine.Output<M>>;
409
409
  readonly records: ReadonlyArray<RuntimeInvariantRecord<M>>;
410
410
  readonly final: Machine.RuntimeSnapshot<Machine.Machine.Snapshot<Machine.Machine.States<M>>, RuntimeInvariantErrorChannel<M>, Machine.Machine.Output<M>>;
@@ -423,8 +423,8 @@ export interface RuntimeSnapshotInvariantContext<M extends AnyMachine> {
423
423
  readonly phase: RuntimeSnapshotObservation;
424
424
  readonly commandIndex: number | undefined;
425
425
  readonly awaitedIndex: number | undefined;
426
- readonly command: internal.RuntimeCommand<Machine.Machine.InputEvent<M>> | undefined;
427
- readonly result: internal.CausalRuntimeCommandResult<M> | undefined;
426
+ readonly command: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>> | undefined;
427
+ readonly result: RuntimeTest.CausalRuntimeCommandResult<M> | undefined;
428
428
  }
429
429
  /**
430
430
  * Evidence passed to an invariant for one completed causal command.
@@ -438,8 +438,8 @@ export interface RuntimeCommandInvariantContext<M extends AnyMachine> {
438
438
  readonly record: RuntimeInvariantRecord<M>;
439
439
  readonly previous: RuntimeInvariantRecord<M> | undefined;
440
440
  readonly index: number;
441
- readonly command: internal.RuntimeCommand<Machine.Machine.InputEvent<M>>;
442
- readonly result: internal.CausalRuntimeCommandResult<M>;
441
+ readonly command: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>;
442
+ readonly result: RuntimeTest.CausalRuntimeCommandResult<M>;
443
443
  readonly snapshot: RuntimeInvariantRecord<M>["snapshot"];
444
444
  readonly awaited: RuntimeInvariantRecord<M>["awaited"];
445
445
  }
@@ -564,7 +564,7 @@ export interface RuntimeInvariantViolation<M extends AnyMachine = AnyMachine> {
564
564
  readonly commandIndex: number | undefined;
565
565
  readonly awaitedIndex?: number;
566
566
  readonly phase?: RuntimeSnapshotObservation;
567
- readonly command?: internal.RuntimeCommand<Machine.Machine.InputEvent<M>>;
567
+ readonly command?: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>;
568
568
  readonly message: string;
569
569
  }
570
570
  /**
@@ -573,21 +573,21 @@ export interface RuntimeInvariantViolation<M extends AnyMachine = AnyMachine> {
573
573
  * @category errors
574
574
  * @since 0.4.0
575
575
  */
576
- export { RuntimeInvariantError } from "../internal/testing/machine/verification.js";
576
+ export { RuntimeInvariantError } from "../internal/testing/machine/runtimeInvariant.js";
577
577
  /**
578
578
  * Checks runtime invariants and returns their complete non-vacuity report.
579
579
  *
580
580
  * @category verification
581
581
  * @since 0.4.0
582
582
  */
583
- export declare const checkRuntimeInvariants: <M extends AnyMachine, Error, Output>(machine: M, transcript: CausalRuntimeEvidence<M, Error, Output>, invariants: ReadonlyArray<RuntimeInvariant<M>>) => Effect.Effect<RuntimeInvariantReport, internal.RuntimeInvariantError<M>>;
583
+ export declare const checkRuntimeInvariants: <M extends AnyMachine, Error, Output>(machine: M, transcript: CausalRuntimeEvidence<M, Error, Output>, invariants: ReadonlyArray<RuntimeInvariant<M>>) => Effect.Effect<RuntimeInvariantReport, RuntimeInvariantTest.RuntimeInvariantError<M>>;
584
584
  /**
585
585
  * Asserts runtime invariants against an existing causal transcript.
586
586
  *
587
587
  * @category verification
588
588
  * @since 0.4.0
589
589
  */
590
- export declare const assertRuntimeInvariants: <M extends AnyMachine, Error, Output>(machine: M, transcript: CausalRuntimeEvidence<M, Error, Output>, invariants: ReadonlyArray<RuntimeInvariant<M>>) => Effect.Effect<void, internal.RuntimeInvariantError<M>>;
590
+ export declare const assertRuntimeInvariants: <M extends AnyMachine, Error, Output>(machine: M, transcript: CausalRuntimeEvidence<M, Error, Output>, invariants: ReadonlyArray<RuntimeInvariant<M>>) => Effect.Effect<void, RuntimeInvariantTest.RuntimeInvariantError<M>>;
591
591
  /**
592
592
  * One disagreement between pure planning and a causally processed send.
593
593
  *
@@ -596,7 +596,7 @@ export declare const assertRuntimeInvariants: <M extends AnyMachine, Error, Outp
596
596
  */
597
597
  export interface PlannerRuntimeAgreementViolation<M extends AnyMachine = AnyMachine> {
598
598
  readonly commandIndex: number;
599
- readonly command: internal.RuntimeCommand<Machine.Machine.InputEvent<M>>;
599
+ readonly command: RuntimeTest.RuntimeCommand<Machine.Machine.InputEvent<M>>;
600
600
  readonly field: "planning" | "handled" | "configurationChanged" | "planNext" | "after" | "completion" | "commands" | "emittedEvents" | "microsteps";
601
601
  readonly message: string;
602
602
  }
@@ -606,14 +606,14 @@ export interface PlannerRuntimeAgreementViolation<M extends AnyMachine = AnyMach
606
606
  * @category errors
607
607
  * @since 0.4.0
608
608
  */
609
- export { PlannerRuntimeAgreementError } from "../internal/testing/machine/verification.js";
609
+ export { PlannerRuntimeAgreementError } from "../internal/testing/machine/runtimeInvariant.js";
610
610
  /**
611
611
  * Checks that every processed public send agrees with a fresh pure plan.
612
612
  *
613
613
  * @category verification
614
614
  * @since 0.4.0
615
615
  */
616
- export declare const assertPlannerRuntimeAgreement: <M extends AnyMachine, Error, Output>(machine: RootReadyMachine<M>, transcript: CausalRuntimeEvidence<M, Error, Output>) => Effect.Effect<void, internal.PlannerRuntimeAgreementError<M>, RunServices<M>>;
616
+ export declare const assertPlannerRuntimeAgreement: <M extends AnyMachine, Error, Output>(machine: RootReadyMachine<M>, transcript: CausalRuntimeEvidence<M, Error, Output>) => Effect.Effect<void, RuntimeInvariantTest.PlannerRuntimeAgreementError<M>, RunServices<M>>;
617
617
  /**
618
618
  * The result of evaluating one semantic invariant.
619
619
  *
@@ -791,15 +791,12 @@ export declare const Invariant: {
791
791
  * class Count extends Schema.TaggedClass<Count>("Count")("Count", {
792
792
  * value: Schema.Number
793
793
  * }) {}
794
- * const States = Machine.states({ Count })
794
+ * const States = Machine.state({ initial: "Count", states: { Count } })
795
795
  * const machine = Machine.make({
796
- * states: States.states,
797
- * events: Machine.events(),
798
- * initial: {
799
- * target: (to) => to.Count(),
800
- * resolve: ({ target }) => target.decoded(new Count({ value: 0 }))
801
- * }
802
- * }).handle({ Count: {} })
796
+ * root: States,
797
+ * events: Machine.eventsFromSchemas(),
798
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Count.decoded(new Count({ value: 0 }))))
799
+ * }).handle({ states: { Count: {} } })
803
800
  *
804
801
  * const nonNegative = MachineTest.invariants(machine).state(
805
802
  * "count is non-negative",
@@ -875,7 +872,7 @@ export interface InvariantViolation<M extends AnyMachine = AnyMachine> {
875
872
  * @category errors
876
873
  * @since 0.4.0
877
874
  */
878
- export { InvariantError } from "../internal/testing/machine/verification.js";
875
+ export { InvariantError } from "../internal/testing/machine/invariant.js";
879
876
  /**
880
877
  * Checks user-defined semantic invariants against an existing planner trace.
881
878
  *
@@ -886,7 +883,7 @@ export { InvariantError } from "../internal/testing/machine/verification.js";
886
883
  * @category verification
887
884
  * @since 0.4.0
888
885
  */
889
- export declare const checkInvariants: <M extends AnyMachine>(machine: M, trace: Trace<M>, invariants: ReadonlyArray<Invariant<M>>) => Effect.Effect<InvariantReport, internal.InvariantError<M>>;
886
+ export declare const checkInvariants: <M extends AnyMachine>(machine: M, trace: Trace<M>, invariants: ReadonlyArray<Invariant<M>>) => Effect.Effect<InvariantReport, InvariantTest.InvariantError<M>>;
890
887
  /**
891
888
  * Asserts user-defined semantic invariants and discards the success report.
892
889
  *
@@ -897,7 +894,7 @@ export declare const checkInvariants: <M extends AnyMachine>(machine: M, trace:
897
894
  * @category verification
898
895
  * @since 0.4.0
899
896
  */
900
- export declare const assertInvariants: <M extends AnyMachine>(machine: M, trace: Trace<M>, invariants: ReadonlyArray<Invariant<M>>) => Effect.Effect<void, internal.InvariantError<M>>;
897
+ export declare const assertInvariants: <M extends AnyMachine>(machine: M, trace: Trace<M>, invariants: ReadonlyArray<Invariant<M>>) => Effect.Effect<void, InvariantTest.InvariantError<M>>;
901
898
  /**
902
899
  * User-defined identity for a logical exploration state.
903
900
  *
@@ -1083,23 +1080,20 @@ export type ExploreOptions<M extends AnyMachine, Key extends ExplorationKey = Ex
1083
1080
  * value: Schema.Number
1084
1081
  * }) {}
1085
1082
  * class Increment extends Schema.TaggedClass<Increment>("Increment")("Increment", {}) {}
1086
- * const States = Machine.states({ Count })
1083
+ * const States = Machine.state({ initial: "Count", states: { Count } })
1087
1084
  * const machine = Machine.make({
1088
- * states: States.states,
1089
- * events: Machine.events(Increment),
1090
- * initial: {
1091
- * target: (to) => to.Count(),
1092
- * resolve: ({ target }) => target.decoded(new Count({ value: 0 }))
1093
- * }
1094
- * }).handle({
1085
+ * root: States,
1086
+ * events: Machine.eventsFromSchemas(Increment),
1087
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Count.decoded(new Count({ value: 0 }))))
1088
+ * }).handle({ states: {
1095
1089
  * Count: {
1096
1090
  * on: {
1097
1091
  * Increment: (to) =>
1098
- * to.full.Count().resolve(({ state, target }) =>
1092
+ * to.branch.Count().resolve(({ state, target }) =>
1099
1093
  * target.decoded(new Count({ value: state.value + 1 })))
1100
1094
  * }
1101
1095
  * }
1102
- * })
1096
+ * } })
1103
1097
  *
1104
1098
  * const explored = MachineTest.explore(machine, {
1105
1099
  * events: ({ snapshot }) => snapshot.value.value < 2 ? [new Increment({})] : [],
@@ -1110,7 +1104,7 @@ export type ExploreOptions<M extends AnyMachine, Key extends ExplorationKey = Ex
1110
1104
  * @category exploration
1111
1105
  * @since 0.4.0
1112
1106
  */
1113
- export declare const explore: <M extends AnyMachine, Key extends ExplorationKey>(machine: RootReadyMachine<M>, options: ExploreOptions<M, Key>) => Effect.Effect<Exploration<M, Key>, RunFailure<RunError<M>, M> | internal.InvariantError<M>, RunServices<M>>;
1107
+ export declare const explore: <M extends AnyMachine, Key extends ExplorationKey>(machine: RootReadyMachine<M>, options: ExploreOptions<M, Key>) => Effect.Effect<Exploration<M, Key>, RunFailure<RunError<M>, M> | InvariantTest.InvariantError<M>, RunServices<M>>;
1114
1108
  /**
1115
1109
  * A predicate over one explored logical state.
1116
1110
  *
@@ -1131,7 +1125,7 @@ export type ReachabilityFailure = "NotFound" | "UnexpectedMatch" | "Inconclusive
1131
1125
  * @category errors
1132
1126
  * @since 0.4.0
1133
1127
  */
1134
- export { ReachabilityError } from "../internal/testing/machine/verification.js";
1128
+ export { ReachabilityError } from "../internal/testing/machine/exploration.js";
1135
1129
  /**
1136
1130
  * Finds the first, and therefore shortest, explored state matching a
1137
1131
  * predicate.
@@ -1149,7 +1143,7 @@ export declare const findShortest: <M extends AnyMachine, Key extends Exploratio
1149
1143
  * @category exploration
1150
1144
  * @since 0.4.0
1151
1145
  */
1152
- export declare const assertReachable: <M extends AnyMachine, Key extends ExplorationKey>(exploration: Exploration<M, Key>, name: string, predicate: ExplorationPredicate<M, Key>) => Effect.Effect<ExplorationNode<M, Key>, internal.ReachabilityError<M, Key>>;
1146
+ export declare const assertReachable: <M extends AnyMachine, Key extends ExplorationKey>(exploration: Exploration<M, Key>, name: string, predicate: ExplorationPredicate<M, Key>) => Effect.Effect<ExplorationNode<M, Key>, ExplorationImpl.ReachabilityError<M, Key>>;
1153
1147
  /**
1154
1148
  * Requires that no explored state matches a predicate.
1155
1149
  *
@@ -1159,7 +1153,7 @@ export declare const assertReachable: <M extends AnyMachine, Key extends Explora
1159
1153
  * @category exploration
1160
1154
  * @since 0.4.0
1161
1155
  */
1162
- export declare const assertUnreachable: <M extends AnyMachine, Key extends ExplorationKey>(exploration: Exploration<M, Key>, name: string, predicate: ExplorationPredicate<M, Key>) => Effect.Effect<void, internal.ReachabilityError<M, Key>>;
1156
+ export declare const assertUnreachable: <M extends AnyMachine, Key extends ExplorationKey>(exploration: Exploration<M, Key>, name: string, predicate: ExplorationPredicate<M, Key>) => Effect.Effect<void, ExplorationImpl.ReachabilityError<M, Key>>;
1163
1157
  /**
1164
1158
  * Checks a real planner trace against the independent finite statechart model
1165
1159
  * interpreter.
@@ -1193,7 +1187,7 @@ export type RunFailure<Cause, M extends AnyMachine = AnyMachine> = {
1193
1187
  readonly scenario: Scenario<M>;
1194
1188
  readonly phase: "event";
1195
1189
  readonly eventIndex: number;
1196
- readonly event: Machine.Machine.InputEvent<M>;
1190
+ readonly event: Machine.Machine.EventInput<Machine.Machine.InputEvent<M>>;
1197
1191
  readonly initial: InitialTrace<M>;
1198
1192
  readonly steps: ReadonlyArray<TraceStep<M>>;
1199
1193
  readonly cause: Cause;
@@ -1232,15 +1226,12 @@ export type RunServices<M extends AnyMachine> = IsAny<Machine.PlanningServices<M
1232
1226
  * import { MachineTest } from "@typeonce/effect-machine/testing"
1233
1227
  *
1234
1228
  * class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
1235
- * const States = Machine.states({ Idle })
1229
+ * const States = Machine.state({ initial: "Idle", states: { Idle } })
1236
1230
  * const machine = Machine.make({
1237
- * states: States.states,
1238
- * events: Machine.events(),
1239
- * initial: {
1240
- * target: (to) => to.Idle(),
1241
- * resolve: ({ target }) => target.from()
1242
- * }
1243
- * }).handle({ Idle: {} })
1231
+ * root: States,
1232
+ * events: Machine.eventsFromSchemas(),
1233
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Idle.from()))
1234
+ * }).handle({ states: { Idle: {} } })
1244
1235
  *
1245
1236
  * const trace = MachineTest.run(machine, { events: [] })
1246
1237
  * ```
@@ -1465,15 +1456,12 @@ export interface Coverage<M extends AnyMachine> {
1465
1456
  * import { MachineTest } from "@typeonce/effect-machine/testing"
1466
1457
  *
1467
1458
  * class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
1468
- * const States = Machine.states({ Idle })
1459
+ * const States = Machine.state({ initial: "Idle", states: { Idle } })
1469
1460
  * const machine = Machine.make({
1470
- * states: States.states,
1471
- * events: Machine.events(),
1472
- * initial: {
1473
- * target: (to) => to.Idle(),
1474
- * resolve: ({ target }) => target.from()
1475
- * }
1476
- * }).handle({ Idle: {} })
1461
+ * root: States,
1462
+ * events: Machine.eventsFromSchemas(),
1463
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Idle.from()))
1464
+ * }).handle({ states: { Idle: {} } })
1477
1465
  *
1478
1466
  * const report = Effect.map(
1479
1467
  * MachineTest.run(machine, { events: [] }),
@@ -1522,7 +1510,7 @@ export interface ObservedGraphMicrostep<M extends AnyMachine> {
1522
1510
  readonly event: Machine.Machine.Event<M> | Machine.InitialEvent;
1523
1511
  readonly transitions: Microstep<M, any>["transitions"];
1524
1512
  readonly raisedEvents: ReadonlyArray<Machine.Machine.Event<M>>;
1525
- readonly emittedEvents: ReadonlyArray<Machine.Machine.Emit<M>>;
1513
+ readonly emittedEvents: ReadonlyArray<Machine.Machine.EmittedEvent<M>>;
1526
1514
  readonly exitPaths: ReadonlyArray<StatePath<M>>;
1527
1515
  readonly entryPaths: ReadonlyArray<StatePath<M>>;
1528
1516
  readonly changed: boolean;
@@ -1635,15 +1623,12 @@ export interface VerifyOptions {
1635
1623
  * import { MachineTest } from "@typeonce/effect-machine/testing"
1636
1624
  *
1637
1625
  * class Idle extends Schema.TaggedClass<Idle>("Idle")("Idle", {}) {}
1638
- * const States = Machine.states({ Idle })
1626
+ * const States = Machine.state({ initial: "Idle", states: { Idle } })
1639
1627
  * const machine = Machine.make({
1640
- * states: States.states,
1641
- * events: Machine.events(),
1642
- * initial: {
1643
- * target: (to) => to.Idle(),
1644
- * resolve: ({ target }) => target.from()
1645
- * }
1646
- * }).handle({ Idle: {} })
1628
+ * root: States,
1629
+ * events: Machine.eventsFromSchemas(),
1630
+ * initialConfiguration: root => root.resolve(({ target }) => target.from(tree => tree.Idle.from()))
1631
+ * }).handle({ states: { Idle: {} } })
1647
1632
  *
1648
1633
  * const checked = Effect.gen(function*() {
1649
1634
  * const trace = yield* MachineTest.run(machine, { events: [] })