@typeonce/effect-machine 0.6.0 → 0.7.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.
- package/README.md +4 -3
- package/dist/Machine.d.ts +24 -6
- package/dist/Machine.d.ts.map +1 -1
- package/dist/Machine.js.map +1 -1
- package/dist/internal/machine/atom.d.ts +5 -0
- package/dist/internal/machine/atom.d.ts.map +1 -1
- package/dist/internal/machine/atom.js +6 -3
- package/dist/internal/machine/atom.js.map +1 -1
- package/dist/internal/machine/machine.d.ts.map +1 -1
- package/dist/internal/machine/machine.js +1 -1
- package/dist/internal/machine/machine.js.map +1 -1
- package/dist/unstable/reactivity/AtomMachine.d.ts +26 -0
- package/dist/unstable/reactivity/AtomMachine.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomMachine.js +23 -0
- package/dist/unstable/reactivity/AtomMachine.js.map +1 -1
- package/docs/agent-guide.md +14 -0
- package/package.json +5 -5
- package/src/Machine.ts +6909 -0
- package/src/index.ts +1 -0
- package/src/internal/machine/activities.ts +108 -0
- package/src/internal/machine/atom.ts +684 -0
- package/src/internal/machine/cluster.ts +394 -0
- package/src/internal/machine/command.ts +58 -0
- package/src/internal/machine/commandRuntime.ts +43 -0
- package/src/internal/machine/configuration.ts +1331 -0
- package/src/internal/machine/errors.ts +87 -0
- package/src/internal/machine/executionPlan.ts +996 -0
- package/src/internal/machine/invocation.ts +119 -0
- package/src/internal/machine/machine.ts +1750 -0
- package/src/internal/machine/planner.ts +1933 -0
- package/src/internal/machine/process.ts +906 -0
- package/src/internal/machine/protocol.ts +322 -0
- package/src/internal/machine/readiness.ts +10 -0
- package/src/internal/machine/runtime.ts +2512 -0
- package/src/internal/machine/serialization.ts +498 -0
- package/src/internal/machine/stateDefinition.ts +270 -0
- package/src/internal/machine/symbols.ts +2 -0
- package/src/internal/machine/topology.ts +479 -0
- package/src/internal/testing/machine/arbitrary.ts +102 -0
- package/src/internal/testing/machine/exploration.ts +331 -0
- package/src/internal/testing/machine/finiteModel.ts +1498 -0
- package/src/internal/testing/machine/invariant.ts +372 -0
- package/src/internal/testing/machine/probe.ts +79 -0
- package/src/internal/testing/machine/referenceModel.ts +1505 -0
- package/src/internal/testing/machine/runtime.ts +1710 -0
- package/src/internal/testing/machine/runtimeInvariant.ts +486 -0
- package/src/internal/testing/machine/trace.ts +150 -0
- package/src/internal/testing/machine/verification.ts +1890 -0
- package/src/testing/MachineTest.ts +2067 -0
- package/src/testing/index.ts +7 -0
- package/src/unstable/cluster/ClusterMachine.ts +390 -0
- package/src/unstable/cluster/index.ts +1 -0
- package/src/unstable/reactivity/AtomMachine.ts +696 -0
- package/src/unstable/reactivity/index.ts +1 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type * as Cause from "effect/Cause"
|
|
2
|
+
import * as Data from "effect/Data"
|
|
3
|
+
import type * as Schema from "effect/Schema"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Error returned when a decoded machine snapshot cannot be encoded through its
|
|
7
|
+
* declared state or output schemas.
|
|
8
|
+
*
|
|
9
|
+
* @category errors
|
|
10
|
+
* @since 0.4.0
|
|
11
|
+
*/
|
|
12
|
+
export class MachineSchemaEncodeError extends Data.TaggedError("MachineSchemaEncodeError")<{
|
|
13
|
+
readonly machineId: string | undefined
|
|
14
|
+
readonly boundary: "state" | "output" | "history" | "configuration"
|
|
15
|
+
readonly state?: string
|
|
16
|
+
readonly cause: Schema.SchemaError | Cause.Cause<unknown>
|
|
17
|
+
}> {}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Error returned when a machine contract value does not match the schema or
|
|
21
|
+
* structural configuration declared for a machine boundary.
|
|
22
|
+
*
|
|
23
|
+
* @category errors
|
|
24
|
+
* @since 0.4.0
|
|
25
|
+
*/
|
|
26
|
+
export class MachineSchemaDecodeError extends Data.TaggedError("MachineSchemaDecodeError")<{
|
|
27
|
+
readonly machineId: string | undefined
|
|
28
|
+
readonly boundary: "input" | "event" | "emit" | "state" | "output" | "history" | "configuration"
|
|
29
|
+
readonly state?: string
|
|
30
|
+
readonly event?: string
|
|
31
|
+
readonly cause: Schema.SchemaError | Cause.Cause<unknown>
|
|
32
|
+
}> {}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Error returned when a machine does not stabilize within the maximum
|
|
36
|
+
* number of macrostep iterations.
|
|
37
|
+
*
|
|
38
|
+
* @category errors
|
|
39
|
+
* @since 0.4.0
|
|
40
|
+
*/
|
|
41
|
+
export class InfiniteTransitionError extends Data.TaggedError("InfiniteTransitionError")<{
|
|
42
|
+
readonly machineId: string | undefined
|
|
43
|
+
readonly state: string
|
|
44
|
+
readonly maxIterations: number
|
|
45
|
+
}> {}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Error returned when a machine fails while running startup lifecycle
|
|
49
|
+
* logic after the initial state has been computed.
|
|
50
|
+
*
|
|
51
|
+
* @category errors
|
|
52
|
+
* @since 0.4.0
|
|
53
|
+
*/
|
|
54
|
+
export class StartupError extends Data.TaggedError("StartupError")<{
|
|
55
|
+
readonly cause: Cause.Cause<unknown>
|
|
56
|
+
}> {}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Error returned by `spawn` when a child process with the same id already
|
|
60
|
+
* exists for the current machine.
|
|
61
|
+
*
|
|
62
|
+
* @category errors
|
|
63
|
+
* @since 0.4.0
|
|
64
|
+
*/
|
|
65
|
+
export class ChildAlreadyExistsError extends Data.TaggedError("ChildAlreadyExistsError")<{
|
|
66
|
+
readonly id: string
|
|
67
|
+
}> {}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Error returned when standalone action execution attempts an operation that
|
|
71
|
+
* requires a managed machine process.
|
|
72
|
+
*
|
|
73
|
+
* @category errors
|
|
74
|
+
* @since 0.4.0
|
|
75
|
+
*/
|
|
76
|
+
export class ProcessLocalError extends Data.TaggedError("ProcessLocalError")<{
|
|
77
|
+
readonly operation: string
|
|
78
|
+
}> {}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Error returned by `join` when a running machine is stopped before
|
|
82
|
+
* producing an output.
|
|
83
|
+
*
|
|
84
|
+
* @category errors
|
|
85
|
+
* @since 0.4.0
|
|
86
|
+
*/
|
|
87
|
+
export class StoppedError extends Data.TaggedError("StoppedError") {}
|