@typeonce/effect-machine-devtools 0.23.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/LICENSE +21 -0
- package/NOTICE +3 -0
- package/README.md +81 -0
- package/dist/DevServer.d.ts +42 -0
- package/dist/DevServer.d.ts.map +1 -0
- package/dist/DevServer.js +28 -0
- package/dist/DevServer.js.map +1 -0
- package/dist/DevToolsProtocol.d.ts +954 -0
- package/dist/DevToolsProtocol.d.ts.map +1 -0
- package/dist/DevToolsProtocol.js +96 -0
- package/dist/DevToolsProtocol.js.map +1 -0
- package/dist/MachineDocument.d.ts +396 -0
- package/dist/MachineDocument.d.ts.map +1 -0
- package/dist/MachineDocument.js +172 -0
- package/dist/MachineDocument.js.map +1 -0
- package/dist/MachineRegistry.d.ts +349 -0
- package/dist/MachineRegistry.d.ts.map +1 -0
- package/dist/MachineRegistry.js +46 -0
- package/dist/MachineRegistry.js.map +1 -0
- package/dist/MachineSimulator.d.ts +169 -0
- package/dist/MachineSimulator.d.ts.map +1 -0
- package/dist/MachineSimulator.js +98 -0
- package/dist/MachineSimulator.js.map +1 -0
- package/dist/ProjectInspector.d.ts +116 -0
- package/dist/ProjectInspector.d.ts.map +1 -0
- package/dist/ProjectInspector.js +82 -0
- package/dist/ProjectInspector.js.map +1 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +23 -0
- package/dist/bin.js.map +1 -0
- package/dist/client/assets/index-BGOhE3Ng.css +1 -0
- package/dist/client/assets/index-DiqGhsGR.js +14 -0
- package/dist/client/index.html +14 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/devServer.d.ts +9 -0
- package/dist/internal/devServer.d.ts.map +1 -0
- package/dist/internal/devServer.js +119 -0
- package/dist/internal/devServer.js.map +1 -0
- package/dist/internal/evaluationWorker.d.ts +3 -0
- package/dist/internal/evaluationWorker.d.ts.map +1 -0
- package/dist/internal/evaluationWorker.js +69 -0
- package/dist/internal/evaluationWorker.js.map +1 -0
- package/dist/internal/evaluationWorkerBootstrap.d.ts +2 -0
- package/dist/internal/evaluationWorkerBootstrap.d.ts.map +1 -0
- package/dist/internal/evaluationWorkerBootstrap.js +21 -0
- package/dist/internal/evaluationWorkerBootstrap.js.map +1 -0
- package/dist/internal/machineDocument.d.ts +4 -0
- package/dist/internal/machineDocument.d.ts.map +1 -0
- package/dist/internal/machineDocument.js +122 -0
- package/dist/internal/machineDocument.js.map +1 -0
- package/dist/internal/machineRegistry.d.ts +12 -0
- package/dist/internal/machineRegistry.d.ts.map +1 -0
- package/dist/internal/machineRegistry.js +97 -0
- package/dist/internal/machineRegistry.js.map +1 -0
- package/dist/internal/machineSimulator.d.ts +5 -0
- package/dist/internal/machineSimulator.d.ts.map +1 -0
- package/dist/internal/machineSimulator.js +156 -0
- package/dist/internal/machineSimulator.js.map +1 -0
- package/dist/internal/projectInspector.d.ts +11 -0
- package/dist/internal/projectInspector.d.ts.map +1 -0
- package/dist/internal/projectInspector.js +150 -0
- package/dist/internal/projectInspector.js.map +1 -0
- package/index.html +13 -0
- package/package.json +69 -0
- package/src/DevServer.ts +45 -0
- package/src/DevToolsProtocol.ts +146 -0
- package/src/MachineDocument.ts +264 -0
- package/src/MachineRegistry.ts +69 -0
- package/src/MachineSimulator.ts +154 -0
- package/src/ProjectInspector.ts +140 -0
- package/src/bin.ts +56 -0
- package/src/index.ts +20 -0
- package/src/internal/browser/example-machine.ts +134 -0
- package/src/internal/browser/machine-index.ts +81 -0
- package/src/internal/browser/main.ts +42 -0
- package/src/internal/browser/styles.css +817 -0
- package/src/internal/browser/text-tree.ts +214 -0
- package/src/internal/browser/visualizer-app.ts +659 -0
- package/src/internal/browser/visualizer-model.ts +173 -0
- package/src/internal/browser/visualizer.ts +31 -0
- package/src/internal/devServer.ts +171 -0
- package/src/internal/evaluationWorker.ts +138 -0
- package/src/internal/evaluationWorkerBootstrap.js +21 -0
- package/src/internal/machineDocument.ts +138 -0
- package/src/internal/machineRegistry.ts +128 -0
- package/src/internal/machineSimulator.ts +199 -0
- package/src/internal/projectInspector.ts +226 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineDocument.js","sourceRoot":"","sources":["../src/MachineDocument.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAA;AAEzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAU,CAAA;AAEvC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;CACzC,CAAC,CAAA;AAQF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClF,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CAC9E,CAAC,CAAA;AAQF;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAA;AAQF;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,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C;YACnB,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;SACxC,CAAC;KACH,CAAC;CACH,CAAC,CAAA;AAQF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CAC7C,CAAC,CAAA;AAQF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC,OAAO;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC,MAAM;IACxB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;CAClC,CAAC,CAAA;AAoBF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GACf,QAAQ,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live registry of machine inspection results for one project.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.23.0
|
|
5
|
+
*/
|
|
6
|
+
import * as Context from "effect/Context";
|
|
7
|
+
import type * as Effect from "effect/Effect";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import type * as Stream from "effect/Stream";
|
|
10
|
+
import type * as ProjectInspector from "./ProjectInspector.js";
|
|
11
|
+
/**
|
|
12
|
+
* Current registry state sent to browser clients.
|
|
13
|
+
*
|
|
14
|
+
* @category schemas
|
|
15
|
+
* @since 0.23.0
|
|
16
|
+
*/
|
|
17
|
+
export declare const Snapshot: Schema.Struct<{
|
|
18
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
19
|
+
readonly revision: Schema.Natural;
|
|
20
|
+
readonly results: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
21
|
+
readonly _tag: Schema.tag<"Ready">;
|
|
22
|
+
readonly document: Schema.Struct<{
|
|
23
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
24
|
+
readonly revision: Schema.Natural;
|
|
25
|
+
readonly source: Schema.NullOr<Schema.Struct<{
|
|
26
|
+
readonly file: Schema.String;
|
|
27
|
+
readonly exportName: Schema.NullOr<Schema.String>;
|
|
28
|
+
}>>;
|
|
29
|
+
readonly machineId: Schema.String;
|
|
30
|
+
readonly initial: Schema.Struct<{
|
|
31
|
+
readonly target: Schema.String;
|
|
32
|
+
readonly selection: Schema.Struct<{
|
|
33
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
34
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
35
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
readonly roots: Schema.$Array<Schema.String>;
|
|
39
|
+
readonly states: Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly path: Schema.String;
|
|
41
|
+
readonly key: Schema.String;
|
|
42
|
+
readonly order: Schema.Natural;
|
|
43
|
+
readonly title: Schema.NullOr<Schema.String>;
|
|
44
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
45
|
+
readonly documentation: Schema.NullOr<Schema.String>;
|
|
46
|
+
readonly type: Schema.Literals<readonly ["atomic", "compound", "parallel", "final", "history", "choice"]>;
|
|
47
|
+
readonly history: Schema.NullOr<Schema.Literals<readonly ["shallow", "deep"]>>;
|
|
48
|
+
readonly parent: Schema.NullOr<Schema.String>;
|
|
49
|
+
readonly children: Schema.$Array<Schema.String>;
|
|
50
|
+
readonly initial: Schema.NullOr<Schema.String>;
|
|
51
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
52
|
+
readonly activityIds: Schema.$Array<Schema.String>;
|
|
53
|
+
}>>;
|
|
54
|
+
readonly transitions: Schema.$Array<Schema.Struct<{
|
|
55
|
+
readonly id: Schema.String;
|
|
56
|
+
readonly source: Schema.String;
|
|
57
|
+
readonly trigger: Schema.Union<readonly [Schema.Struct<{
|
|
58
|
+
readonly type: Schema.tag<"event">;
|
|
59
|
+
readonly event: Schema.String;
|
|
60
|
+
}>, Schema.Struct<{
|
|
61
|
+
readonly type: Schema.tag<"always">;
|
|
62
|
+
}>, Schema.Struct<{
|
|
63
|
+
readonly type: Schema.tag<"done">;
|
|
64
|
+
}>, Schema.Struct<{
|
|
65
|
+
readonly type: Schema.tag<"choice">;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly type: Schema.tag<"invoke">;
|
|
68
|
+
readonly id: Schema.String;
|
|
69
|
+
readonly outcome: Schema.Literals<readonly ["element", "done", "failure", "snapshot"]>;
|
|
70
|
+
}>]>;
|
|
71
|
+
readonly reenter: Schema.Boolean;
|
|
72
|
+
readonly acceptance: Schema.Literals<readonly ["required", "declinable"]>;
|
|
73
|
+
readonly branches: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
74
|
+
readonly type: Schema.tag<"direct">;
|
|
75
|
+
readonly id: Schema.String;
|
|
76
|
+
readonly target: Schema.NullOr<Schema.String>;
|
|
77
|
+
readonly selection: Schema.Struct<{
|
|
78
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
79
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
80
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
81
|
+
}>;
|
|
82
|
+
readonly updates: Schema.$Array<Schema.String>;
|
|
83
|
+
}>, Schema.Struct<{
|
|
84
|
+
readonly type: Schema.tag<"branch">;
|
|
85
|
+
readonly key: Schema.String;
|
|
86
|
+
readonly title: Schema.String;
|
|
87
|
+
readonly id: Schema.String;
|
|
88
|
+
readonly target: Schema.NullOr<Schema.String>;
|
|
89
|
+
readonly selection: Schema.Struct<{
|
|
90
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
91
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
92
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
93
|
+
}>;
|
|
94
|
+
readonly updates: Schema.$Array<Schema.String>;
|
|
95
|
+
}>]>>;
|
|
96
|
+
}>>;
|
|
97
|
+
readonly activities: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
98
|
+
readonly type: Schema.tag<"process">;
|
|
99
|
+
readonly id: Schema.String;
|
|
100
|
+
readonly source: Schema.String;
|
|
101
|
+
readonly lifecycleId: Schema.String;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
readonly type: Schema.tag<"effect">;
|
|
104
|
+
readonly outcomes: Schema.Struct<{
|
|
105
|
+
readonly success: Schema.Literal<"dynamic">;
|
|
106
|
+
readonly failure: Schema.Literals<readonly ["dynamic", "none"]>;
|
|
107
|
+
}>;
|
|
108
|
+
readonly id: Schema.String;
|
|
109
|
+
readonly source: Schema.String;
|
|
110
|
+
readonly lifecycleId: Schema.String;
|
|
111
|
+
}>, Schema.Struct<{
|
|
112
|
+
readonly type: Schema.tag<"timer">;
|
|
113
|
+
readonly duration: Schema.String;
|
|
114
|
+
readonly id: Schema.String;
|
|
115
|
+
readonly source: Schema.String;
|
|
116
|
+
readonly lifecycleId: Schema.String;
|
|
117
|
+
}>, Schema.Struct<{
|
|
118
|
+
readonly type: Schema.tag<"stream">;
|
|
119
|
+
readonly id: Schema.String;
|
|
120
|
+
readonly source: Schema.String;
|
|
121
|
+
readonly lifecycleId: Schema.String;
|
|
122
|
+
}>, Schema.Struct<{
|
|
123
|
+
readonly type: Schema.tag<"machine">;
|
|
124
|
+
readonly child: Schema.Struct<{
|
|
125
|
+
readonly id: Schema.String;
|
|
126
|
+
readonly machineId: Schema.NullOr<Schema.String>;
|
|
127
|
+
}>;
|
|
128
|
+
readonly id: Schema.String;
|
|
129
|
+
readonly source: Schema.String;
|
|
130
|
+
readonly lifecycleId: Schema.String;
|
|
131
|
+
}>]>>;
|
|
132
|
+
readonly snapshot: Schema.NullOr<Schema.Struct<{
|
|
133
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
134
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
135
|
+
}>>;
|
|
136
|
+
}>;
|
|
137
|
+
readonly diagnostics: Schema.$Array<Schema.Struct<{
|
|
138
|
+
readonly severity: Schema.Literals<readonly ["warning", "error"]>;
|
|
139
|
+
readonly code: Schema.String;
|
|
140
|
+
readonly message: Schema.String;
|
|
141
|
+
readonly location: Schema.NullOr<Schema.Struct<{
|
|
142
|
+
readonly file: Schema.String;
|
|
143
|
+
readonly line: Schema.NullOr<Schema.Natural>;
|
|
144
|
+
readonly column: Schema.NullOr<Schema.Natural>;
|
|
145
|
+
}>>;
|
|
146
|
+
readonly statePath: Schema.NullOr<Schema.String>;
|
|
147
|
+
}>>;
|
|
148
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
149
|
+
readonly key: Schema.String;
|
|
150
|
+
}>, Schema.Struct<{
|
|
151
|
+
readonly _tag: Schema.tag<"Partial">;
|
|
152
|
+
readonly document: Schema.Struct<{
|
|
153
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
154
|
+
readonly revision: Schema.Natural;
|
|
155
|
+
readonly source: Schema.NullOr<Schema.Struct<{
|
|
156
|
+
readonly file: Schema.String;
|
|
157
|
+
readonly exportName: Schema.NullOr<Schema.String>;
|
|
158
|
+
}>>;
|
|
159
|
+
readonly machineId: Schema.String;
|
|
160
|
+
readonly initial: Schema.Struct<{
|
|
161
|
+
readonly target: Schema.String;
|
|
162
|
+
readonly selection: Schema.Struct<{
|
|
163
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
164
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
165
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
166
|
+
}>;
|
|
167
|
+
}>;
|
|
168
|
+
readonly roots: Schema.$Array<Schema.String>;
|
|
169
|
+
readonly states: Schema.$Array<Schema.Struct<{
|
|
170
|
+
readonly path: Schema.String;
|
|
171
|
+
readonly key: Schema.String;
|
|
172
|
+
readonly order: Schema.Natural;
|
|
173
|
+
readonly title: Schema.NullOr<Schema.String>;
|
|
174
|
+
readonly description: Schema.NullOr<Schema.String>;
|
|
175
|
+
readonly documentation: Schema.NullOr<Schema.String>;
|
|
176
|
+
readonly type: Schema.Literals<readonly ["atomic", "compound", "parallel", "final", "history", "choice"]>;
|
|
177
|
+
readonly history: Schema.NullOr<Schema.Literals<readonly ["shallow", "deep"]>>;
|
|
178
|
+
readonly parent: Schema.NullOr<Schema.String>;
|
|
179
|
+
readonly children: Schema.$Array<Schema.String>;
|
|
180
|
+
readonly initial: Schema.NullOr<Schema.String>;
|
|
181
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
182
|
+
readonly activityIds: Schema.$Array<Schema.String>;
|
|
183
|
+
}>>;
|
|
184
|
+
readonly transitions: Schema.$Array<Schema.Struct<{
|
|
185
|
+
readonly id: Schema.String;
|
|
186
|
+
readonly source: Schema.String;
|
|
187
|
+
readonly trigger: Schema.Union<readonly [Schema.Struct<{
|
|
188
|
+
readonly type: Schema.tag<"event">;
|
|
189
|
+
readonly event: Schema.String;
|
|
190
|
+
}>, Schema.Struct<{
|
|
191
|
+
readonly type: Schema.tag<"always">;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly type: Schema.tag<"done">;
|
|
194
|
+
}>, Schema.Struct<{
|
|
195
|
+
readonly type: Schema.tag<"choice">;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly type: Schema.tag<"invoke">;
|
|
198
|
+
readonly id: Schema.String;
|
|
199
|
+
readonly outcome: Schema.Literals<readonly ["element", "done", "failure", "snapshot"]>;
|
|
200
|
+
}>]>;
|
|
201
|
+
readonly reenter: Schema.Boolean;
|
|
202
|
+
readonly acceptance: Schema.Literals<readonly ["required", "declinable"]>;
|
|
203
|
+
readonly branches: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
204
|
+
readonly type: Schema.tag<"direct">;
|
|
205
|
+
readonly id: Schema.String;
|
|
206
|
+
readonly target: Schema.NullOr<Schema.String>;
|
|
207
|
+
readonly selection: Schema.Struct<{
|
|
208
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
209
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
210
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
211
|
+
}>;
|
|
212
|
+
readonly updates: Schema.$Array<Schema.String>;
|
|
213
|
+
}>, Schema.Struct<{
|
|
214
|
+
readonly type: Schema.tag<"branch">;
|
|
215
|
+
readonly key: Schema.String;
|
|
216
|
+
readonly title: Schema.String;
|
|
217
|
+
readonly id: Schema.String;
|
|
218
|
+
readonly target: Schema.NullOr<Schema.String>;
|
|
219
|
+
readonly selection: Schema.Struct<{
|
|
220
|
+
readonly path: Schema.NullOr<Schema.String>;
|
|
221
|
+
readonly kind: Schema.Literals<readonly ["state", "initial", "history", "choice", "update", "none"]>;
|
|
222
|
+
readonly scope: Schema.NullOr<Schema.Literals<readonly ["local", "branch", "full", "initial"]>>;
|
|
223
|
+
}>;
|
|
224
|
+
readonly updates: Schema.$Array<Schema.String>;
|
|
225
|
+
}>]>>;
|
|
226
|
+
}>>;
|
|
227
|
+
readonly activities: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
228
|
+
readonly type: Schema.tag<"process">;
|
|
229
|
+
readonly id: Schema.String;
|
|
230
|
+
readonly source: Schema.String;
|
|
231
|
+
readonly lifecycleId: Schema.String;
|
|
232
|
+
}>, Schema.Struct<{
|
|
233
|
+
readonly type: Schema.tag<"effect">;
|
|
234
|
+
readonly outcomes: Schema.Struct<{
|
|
235
|
+
readonly success: Schema.Literal<"dynamic">;
|
|
236
|
+
readonly failure: Schema.Literals<readonly ["dynamic", "none"]>;
|
|
237
|
+
}>;
|
|
238
|
+
readonly id: Schema.String;
|
|
239
|
+
readonly source: Schema.String;
|
|
240
|
+
readonly lifecycleId: Schema.String;
|
|
241
|
+
}>, Schema.Struct<{
|
|
242
|
+
readonly type: Schema.tag<"timer">;
|
|
243
|
+
readonly duration: Schema.String;
|
|
244
|
+
readonly id: Schema.String;
|
|
245
|
+
readonly source: Schema.String;
|
|
246
|
+
readonly lifecycleId: Schema.String;
|
|
247
|
+
}>, Schema.Struct<{
|
|
248
|
+
readonly type: Schema.tag<"stream">;
|
|
249
|
+
readonly id: Schema.String;
|
|
250
|
+
readonly source: Schema.String;
|
|
251
|
+
readonly lifecycleId: Schema.String;
|
|
252
|
+
}>, Schema.Struct<{
|
|
253
|
+
readonly type: Schema.tag<"machine">;
|
|
254
|
+
readonly child: Schema.Struct<{
|
|
255
|
+
readonly id: Schema.String;
|
|
256
|
+
readonly machineId: Schema.NullOr<Schema.String>;
|
|
257
|
+
}>;
|
|
258
|
+
readonly id: Schema.String;
|
|
259
|
+
readonly source: Schema.String;
|
|
260
|
+
readonly lifecycleId: Schema.String;
|
|
261
|
+
}>]>>;
|
|
262
|
+
readonly snapshot: Schema.NullOr<Schema.Struct<{
|
|
263
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
264
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
265
|
+
}>>;
|
|
266
|
+
}>;
|
|
267
|
+
readonly diagnostics: Schema.$Array<Schema.Struct<{
|
|
268
|
+
readonly severity: Schema.Literals<readonly ["warning", "error"]>;
|
|
269
|
+
readonly code: Schema.String;
|
|
270
|
+
readonly message: Schema.String;
|
|
271
|
+
readonly location: Schema.NullOr<Schema.Struct<{
|
|
272
|
+
readonly file: Schema.String;
|
|
273
|
+
readonly line: Schema.NullOr<Schema.Natural>;
|
|
274
|
+
readonly column: Schema.NullOr<Schema.Natural>;
|
|
275
|
+
}>>;
|
|
276
|
+
readonly statePath: Schema.NullOr<Schema.String>;
|
|
277
|
+
}>>;
|
|
278
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
279
|
+
readonly key: Schema.String;
|
|
280
|
+
}>, Schema.Struct<{
|
|
281
|
+
readonly _tag: Schema.tag<"Failed">;
|
|
282
|
+
readonly source: Schema.Struct<{
|
|
283
|
+
readonly file: Schema.String;
|
|
284
|
+
readonly exportName: Schema.NullOr<Schema.String>;
|
|
285
|
+
}>;
|
|
286
|
+
readonly machineId: Schema.NullOr<Schema.String>;
|
|
287
|
+
readonly diagnostics: Schema.$Array<Schema.Struct<{
|
|
288
|
+
readonly severity: Schema.Literals<readonly ["warning", "error"]>;
|
|
289
|
+
readonly code: Schema.String;
|
|
290
|
+
readonly message: Schema.String;
|
|
291
|
+
readonly location: Schema.NullOr<Schema.Struct<{
|
|
292
|
+
readonly file: Schema.String;
|
|
293
|
+
readonly line: Schema.NullOr<Schema.Natural>;
|
|
294
|
+
readonly column: Schema.NullOr<Schema.Natural>;
|
|
295
|
+
}>>;
|
|
296
|
+
readonly statePath: Schema.NullOr<Schema.String>;
|
|
297
|
+
}>>;
|
|
298
|
+
readonly protocolVersion: Schema.Literal<1>;
|
|
299
|
+
readonly key: Schema.String;
|
|
300
|
+
}>]>>;
|
|
301
|
+
}>;
|
|
302
|
+
/**
|
|
303
|
+
* @category models
|
|
304
|
+
* @since 0.23.0
|
|
305
|
+
*/
|
|
306
|
+
export type Snapshot = Schema.Schema.Type<typeof Snapshot>;
|
|
307
|
+
/**
|
|
308
|
+
* @category models
|
|
309
|
+
* @since 0.23.0
|
|
310
|
+
*/
|
|
311
|
+
export interface Options extends ProjectInspector.InspectOptions {
|
|
312
|
+
}
|
|
313
|
+
declare const RegistryError_base: Schema.Class<RegistryError, Schema.Struct<{
|
|
314
|
+
readonly _tag: Schema.tag<"RegistryError">;
|
|
315
|
+
readonly message: Schema.String;
|
|
316
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
317
|
+
}>, import("effect/Cause").YieldableError>;
|
|
318
|
+
/**
|
|
319
|
+
* Failure while starting the initial project inspection.
|
|
320
|
+
*
|
|
321
|
+
* @category errors
|
|
322
|
+
* @since 0.23.0
|
|
323
|
+
*/
|
|
324
|
+
export declare class RegistryError extends RegistryError_base {
|
|
325
|
+
}
|
|
326
|
+
declare const MachineRegistry_base: Context.ServiceClass<MachineRegistry, "@typeonce/effect-machine-devtools/MachineRegistry", {
|
|
327
|
+
readonly get: Effect.Effect<Snapshot>;
|
|
328
|
+
readonly changes: Stream.Stream<Snapshot>;
|
|
329
|
+
readonly refresh: Effect.Effect<Snapshot, RegistryError>;
|
|
330
|
+
}>;
|
|
331
|
+
/**
|
|
332
|
+
* A last-known-good machine registry. Reload failures preserve the previous
|
|
333
|
+
* document as a partial result while exposing the new diagnostics.
|
|
334
|
+
*
|
|
335
|
+
* @category services
|
|
336
|
+
* @since 0.23.0
|
|
337
|
+
*/
|
|
338
|
+
export declare class MachineRegistry extends MachineRegistry_base {
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Builds a scoped registry that scans immediately and refreshes after relevant
|
|
342
|
+
* source file changes.
|
|
343
|
+
*
|
|
344
|
+
* @category layers
|
|
345
|
+
* @since 0.23.0
|
|
346
|
+
*/
|
|
347
|
+
export declare const layer: (options: Options) => import("effect/Layer").Layer<MachineRegistry, RegistryError, ProjectInspector.ProjectInspector>;
|
|
348
|
+
export {};
|
|
349
|
+
//# sourceMappingURL=MachineRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineRegistry.d.ts","sourceRoot":"","sources":["../src/MachineRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAG5C,OAAO,KAAK,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAA;AAEzD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAA;AAE1D;;;GAGG;AACH,MAAM,WAAW,OAAQ,SAAQ,gBAAgB,CAAC,cAAc;CAC/D;;;;;;AAED;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,kBAMjC;CAAG;;kBAUW,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;sBACnB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;sBACvB,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC;;AAV1D;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,oBAIoB;CAAG;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,OAAO,oGAAgE,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live registry of machine inspection results for one project.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.23.0
|
|
5
|
+
*/
|
|
6
|
+
import * as Context from "effect/Context";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
|
+
import * as DevToolsProtocol from "./DevToolsProtocol.js";
|
|
9
|
+
import * as internal from "./internal/machineRegistry.js";
|
|
10
|
+
/**
|
|
11
|
+
* Current registry state sent to browser clients.
|
|
12
|
+
*
|
|
13
|
+
* @category schemas
|
|
14
|
+
* @since 0.23.0
|
|
15
|
+
*/
|
|
16
|
+
export const Snapshot = DevToolsProtocol.RegistrySnapshot;
|
|
17
|
+
/**
|
|
18
|
+
* Failure while starting the initial project inspection.
|
|
19
|
+
*
|
|
20
|
+
* @category errors
|
|
21
|
+
* @since 0.23.0
|
|
22
|
+
*/
|
|
23
|
+
export class RegistryError extends Schema.Error("@typeonce/effect-machine-devtools/MachineRegistry/RegistryError")({
|
|
24
|
+
_tag: Schema.tag("RegistryError"),
|
|
25
|
+
message: Schema.String,
|
|
26
|
+
cause: Schema.optional(Schema.Defect())
|
|
27
|
+
}) {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A last-known-good machine registry. Reload failures preserve the previous
|
|
31
|
+
* document as a partial result while exposing the new diagnostics.
|
|
32
|
+
*
|
|
33
|
+
* @category services
|
|
34
|
+
* @since 0.23.0
|
|
35
|
+
*/
|
|
36
|
+
export class MachineRegistry extends Context.Service()("@typeonce/effect-machine-devtools/MachineRegistry") {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Builds a scoped registry that scans immediately and refreshes after relevant
|
|
40
|
+
* source file changes.
|
|
41
|
+
*
|
|
42
|
+
* @category layers
|
|
43
|
+
* @since 0.23.0
|
|
44
|
+
*/
|
|
45
|
+
export const layer = (options) => internal.layer({ MachineRegistry, RegistryError }, options);
|
|
46
|
+
//# sourceMappingURL=MachineRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineRegistry.js","sourceRoot":"","sources":["../src/MachineRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,QAAQ,MAAM,+BAA+B,CAAA;AAGzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,gBAAgB,CAAA;AAezD;;;;;GAKG;AACH,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,KAAK,CAC7C,iEAAiE,CAClE,CAAC;IACA,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC;CAAG;AAEL;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,OAAO,CAAC,OAAO,EAIhD,CAAC,mDAAmD,CAAC;CAAG;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,CAAA"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Side-effect-free, best-effort simulation over a machine document.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.23.0
|
|
5
|
+
*/
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import type * as MachineDocument from "./MachineDocument.js";
|
|
8
|
+
/**
|
|
9
|
+
* Serializable state of a simulation session.
|
|
10
|
+
*
|
|
11
|
+
* @category schemas
|
|
12
|
+
* @since 0.23.0
|
|
13
|
+
*/
|
|
14
|
+
export declare const Snapshot: Schema.Struct<{
|
|
15
|
+
readonly step: Schema.Natural;
|
|
16
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
17
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* @category models
|
|
21
|
+
* @since 0.23.0
|
|
22
|
+
*/
|
|
23
|
+
export type Snapshot = Schema.Schema.Type<typeof Snapshot>;
|
|
24
|
+
/**
|
|
25
|
+
* Opaque simulation state paired with its source document.
|
|
26
|
+
*
|
|
27
|
+
* @category models
|
|
28
|
+
* @since 0.23.0
|
|
29
|
+
*/
|
|
30
|
+
export interface Session {
|
|
31
|
+
readonly document: MachineDocument.MachineDocument;
|
|
32
|
+
readonly snapshot: Snapshot;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Runtime behavior deliberately skipped by a best-effort step.
|
|
36
|
+
*
|
|
37
|
+
* @category schemas
|
|
38
|
+
* @since 0.23.0
|
|
39
|
+
*/
|
|
40
|
+
export declare const Note: Schema.Literals<readonly ["runtime-effects-skipped", "state-updates-skipped", "reentry-lifecycles-skipped", "automatic-transitions-skipped"]>;
|
|
41
|
+
/**
|
|
42
|
+
* @category models
|
|
43
|
+
* @since 0.23.0
|
|
44
|
+
*/
|
|
45
|
+
export type Note = Schema.Schema.Type<typeof Note>;
|
|
46
|
+
/**
|
|
47
|
+
* A topologically deterministic step.
|
|
48
|
+
*
|
|
49
|
+
* @category schemas
|
|
50
|
+
* @since 0.23.0
|
|
51
|
+
*/
|
|
52
|
+
export declare const Applied: Schema.Struct<{
|
|
53
|
+
readonly _tag: Schema.tag<"Applied">;
|
|
54
|
+
readonly notes: Schema.$Array<Schema.Literals<readonly ["runtime-effects-skipped", "state-updates-skipped", "reentry-lifecycles-skipped", "automatic-transitions-skipped"]>>;
|
|
55
|
+
readonly event: Schema.String;
|
|
56
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
57
|
+
readonly session: Schema.Struct<{
|
|
58
|
+
readonly step: Schema.Natural;
|
|
59
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
60
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
61
|
+
}>;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* @category models
|
|
65
|
+
* @since 0.23.0
|
|
66
|
+
*/
|
|
67
|
+
export type Applied = Schema.Schema.Type<typeof Applied>;
|
|
68
|
+
/**
|
|
69
|
+
* An event with no registration in the current active configuration.
|
|
70
|
+
*
|
|
71
|
+
* @category schemas
|
|
72
|
+
* @since 0.23.0
|
|
73
|
+
*/
|
|
74
|
+
export declare const Blocked: Schema.Struct<{
|
|
75
|
+
readonly _tag: Schema.tag<"Blocked">;
|
|
76
|
+
readonly reason: Schema.Literal<"event-not-enabled">;
|
|
77
|
+
readonly event: Schema.String;
|
|
78
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
79
|
+
readonly session: Schema.Struct<{
|
|
80
|
+
readonly step: Schema.Natural;
|
|
81
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
82
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
83
|
+
}>;
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* @category models
|
|
87
|
+
* @since 0.23.0
|
|
88
|
+
*/
|
|
89
|
+
export type Blocked = Schema.Schema.Type<typeof Blocked>;
|
|
90
|
+
/**
|
|
91
|
+
* A step whose topology depends on runtime behavior the document cannot safely
|
|
92
|
+
* evaluate.
|
|
93
|
+
*
|
|
94
|
+
* @category schemas
|
|
95
|
+
* @since 0.23.0
|
|
96
|
+
*/
|
|
97
|
+
export declare const Indeterminate: Schema.Struct<{
|
|
98
|
+
readonly _tag: Schema.tag<"Indeterminate">;
|
|
99
|
+
readonly reason: Schema.Literals<readonly ["multiple-transitions", "declinable-transition", "conditional-branches", "history-target", "choice-target", "missing-target"]>;
|
|
100
|
+
readonly event: Schema.String;
|
|
101
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
102
|
+
readonly session: Schema.Struct<{
|
|
103
|
+
readonly step: Schema.Natural;
|
|
104
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
105
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
106
|
+
}>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* @category models
|
|
110
|
+
* @since 0.23.0
|
|
111
|
+
*/
|
|
112
|
+
export type Indeterminate = Schema.Schema.Type<typeof Indeterminate>;
|
|
113
|
+
/**
|
|
114
|
+
* @category schemas
|
|
115
|
+
* @since 0.23.0
|
|
116
|
+
*/
|
|
117
|
+
export declare const StepResult: Schema.Union<readonly [Schema.Struct<{
|
|
118
|
+
readonly _tag: Schema.tag<"Applied">;
|
|
119
|
+
readonly notes: Schema.$Array<Schema.Literals<readonly ["runtime-effects-skipped", "state-updates-skipped", "reentry-lifecycles-skipped", "automatic-transitions-skipped"]>>;
|
|
120
|
+
readonly event: Schema.String;
|
|
121
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
122
|
+
readonly session: Schema.Struct<{
|
|
123
|
+
readonly step: Schema.Natural;
|
|
124
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
125
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
126
|
+
}>;
|
|
127
|
+
}>, Schema.Struct<{
|
|
128
|
+
readonly _tag: Schema.tag<"Blocked">;
|
|
129
|
+
readonly reason: Schema.Literal<"event-not-enabled">;
|
|
130
|
+
readonly event: Schema.String;
|
|
131
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
132
|
+
readonly session: Schema.Struct<{
|
|
133
|
+
readonly step: Schema.Natural;
|
|
134
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
135
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
136
|
+
}>;
|
|
137
|
+
}>, Schema.Struct<{
|
|
138
|
+
readonly _tag: Schema.tag<"Indeterminate">;
|
|
139
|
+
readonly reason: Schema.Literals<readonly ["multiple-transitions", "declinable-transition", "conditional-branches", "history-target", "choice-target", "missing-target"]>;
|
|
140
|
+
readonly event: Schema.String;
|
|
141
|
+
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
142
|
+
readonly session: Schema.Struct<{
|
|
143
|
+
readonly step: Schema.Natural;
|
|
144
|
+
readonly activePaths: Schema.$Array<Schema.String>;
|
|
145
|
+
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
146
|
+
}>;
|
|
147
|
+
}>]>;
|
|
148
|
+
/**
|
|
149
|
+
* @category models
|
|
150
|
+
* @since 0.23.0
|
|
151
|
+
*/
|
|
152
|
+
export type StepResult = Schema.Schema.Type<typeof StepResult>;
|
|
153
|
+
/**
|
|
154
|
+
* Starts from the captured snapshot when present, otherwise from the static
|
|
155
|
+
* initial topology.
|
|
156
|
+
*
|
|
157
|
+
* @category constructors
|
|
158
|
+
* @since 0.23.0
|
|
159
|
+
*/
|
|
160
|
+
export declare const start: (document: MachineDocument.MachineDocument) => Session;
|
|
161
|
+
/**
|
|
162
|
+
* Sends an event without running user code. `Applied` means the active topology
|
|
163
|
+
* is statically known; its notes list runtime behavior that was skipped.
|
|
164
|
+
*
|
|
165
|
+
* @category combinators
|
|
166
|
+
* @since 0.23.0
|
|
167
|
+
*/
|
|
168
|
+
export declare const send: (session: Session, event: string) => StepResult;
|
|
169
|
+
//# sourceMappingURL=MachineSimulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineSimulator.d.ts","sourceRoot":"","sources":["../src/MachineSimulator.ts"],"names":[],"mappings":"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