@typeonce/effect-machine-devtools 0.23.0 → 0.25.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/NOTICE +4 -0
- package/README.md +14 -8
- package/dist/DevServer.d.ts +2 -1
- package/dist/DevServer.d.ts.map +1 -1
- package/dist/DevServer.js.map +1 -1
- package/dist/DevToolsProtocol.d.ts +167 -17
- package/dist/DevToolsProtocol.d.ts.map +1 -1
- package/dist/DevToolsProtocol.js +1 -1
- package/dist/MachineDocument.d.ts +98 -2
- package/dist/MachineDocument.d.ts.map +1 -1
- package/dist/MachineDocument.js +35 -1
- package/dist/MachineDocument.js.map +1 -1
- package/dist/MachineRegistry.d.ts +56 -6
- package/dist/MachineRegistry.d.ts.map +1 -1
- package/dist/MachineWalkthrough.d.ts +171 -0
- package/dist/MachineWalkthrough.d.ts.map +1 -0
- package/dist/MachineWalkthrough.js +98 -0
- package/dist/MachineWalkthrough.js.map +1 -0
- package/dist/client/assets/index-BTOAhezX.js +37 -0
- package/dist/client/assets/index-Cg7xzSkz.css +1 -0
- package/dist/client/index.html +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/devServer.d.ts +2 -1
- package/dist/internal/devServer.d.ts.map +1 -1
- package/dist/internal/devServer.js +4 -3
- package/dist/internal/devServer.js.map +1 -1
- package/dist/internal/evaluationWorker.d.ts.map +1 -1
- package/dist/internal/evaluationWorker.js +28 -9
- package/dist/internal/evaluationWorker.js.map +1 -1
- package/dist/internal/machineDocument.d.ts.map +1 -1
- package/dist/internal/machineDocument.js +65 -2
- package/dist/internal/machineDocument.js.map +1 -1
- package/dist/internal/machineWalkthrough.d.ts +26 -0
- package/dist/internal/machineWalkthrough.d.ts.map +1 -0
- package/dist/internal/machineWalkthrough.js +256 -0
- package/dist/internal/machineWalkthrough.js.map +1 -0
- package/dist/internal/projectInspector.d.ts.map +1 -1
- package/dist/internal/projectInspector.js +15 -9
- package/dist/internal/projectInspector.js.map +1 -1
- package/index.html +2 -2
- package/package.json +4 -3
- package/src/DevServer.ts +6 -2
- package/src/DevToolsProtocol.ts +1 -1
- package/src/MachineDocument.ts +56 -1
- package/src/MachineWalkthrough.ts +199 -0
- package/src/index.ts +2 -2
- package/src/internal/browser/chart-layout.ts +433 -0
- package/src/internal/browser/chart-model.ts +234 -0
- package/src/internal/browser/chart-renderer.ts +661 -0
- package/src/internal/browser/example-machine.ts +15 -6
- package/src/internal/browser/input-form.ts +252 -0
- package/src/internal/browser/invoke-outcomes-example.ts +231 -0
- package/src/internal/browser/parallel-completion-example.ts +199 -0
- package/src/internal/browser/planner-example.ts +145 -0
- package/src/internal/browser/protocol-events-example.ts +200 -0
- package/src/internal/browser/styles.css +959 -185
- package/src/internal/browser/transition-semantics-example.ts +236 -0
- package/src/internal/browser/visualizer-app.ts +818 -389
- package/src/internal/browser/visualizer-model.ts +104 -0
- package/src/internal/browser/visualizer.ts +1 -1
- package/src/internal/devServer.ts +9 -4
- package/src/internal/evaluationWorker.ts +28 -10
- package/src/internal/machineDocument.ts +77 -2
- package/src/internal/machineWalkthrough.ts +355 -0
- package/src/internal/projectInspector.ts +29 -14
- package/dist/MachineSimulator.d.ts +0 -169
- package/dist/MachineSimulator.d.ts.map +0 -1
- package/dist/MachineSimulator.js +0 -98
- package/dist/MachineSimulator.js.map +0 -1
- package/dist/client/assets/index-BGOhE3Ng.css +0 -1
- package/dist/client/assets/index-DiqGhsGR.js +0 -14
- package/dist/internal/machineSimulator.d.ts +0 -5
- package/dist/internal/machineSimulator.d.ts.map +0 -1
- package/dist/internal/machineSimulator.js +0 -156
- package/dist/internal/machineSimulator.js.map +0 -1
- package/src/MachineSimulator.ts +0 -154
- package/src/internal/machineSimulator.ts +0 -199
package/dist/MachineDocument.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as internal from "./internal/machineDocument.js";
|
|
|
6
6
|
* @category models
|
|
7
7
|
* @since 0.23.0
|
|
8
8
|
*/
|
|
9
|
-
export const schemaVersion =
|
|
9
|
+
export const schemaVersion = 3;
|
|
10
10
|
/**
|
|
11
11
|
* Source module and export that produced a machine.
|
|
12
12
|
*
|
|
@@ -36,6 +36,17 @@ export const Initial = Schema.Struct({
|
|
|
36
36
|
target: Schema.String,
|
|
37
37
|
selection: Selection
|
|
38
38
|
});
|
|
39
|
+
/**
|
|
40
|
+
* Canonical JSON Schema retained for machine contracts.
|
|
41
|
+
*
|
|
42
|
+
* @category schemas
|
|
43
|
+
* @since 0.24.0
|
|
44
|
+
*/
|
|
45
|
+
export const InputSchema = Schema.Struct({
|
|
46
|
+
dialect: Schema.Literal("draft-2020-12"),
|
|
47
|
+
schema: Schema.Json,
|
|
48
|
+
definitions: Schema.Record(Schema.String, Schema.Json)
|
|
49
|
+
});
|
|
39
50
|
/**
|
|
40
51
|
* @category schemas
|
|
41
52
|
* @since 0.23.0
|
|
@@ -52,6 +63,8 @@ export const State = Schema.Struct({
|
|
|
52
63
|
parent: Schema.NullOr(Schema.String),
|
|
53
64
|
children: Schema.Array(Schema.String),
|
|
54
65
|
initial: Schema.NullOr(Schema.String),
|
|
66
|
+
valueSchema: Schema.NullOr(InputSchema),
|
|
67
|
+
outputSchema: Schema.NullOr(InputSchema),
|
|
55
68
|
transitionIds: Schema.Array(Schema.String),
|
|
56
69
|
activityIds: Schema.Array(Schema.String)
|
|
57
70
|
});
|
|
@@ -143,6 +156,26 @@ export const Snapshot = Schema.Struct({
|
|
|
143
156
|
activePaths: Schema.Array(Schema.String),
|
|
144
157
|
candidateEvents: Schema.Array(Schema.String)
|
|
145
158
|
});
|
|
159
|
+
/**
|
|
160
|
+
* Public event input paired with the schema for its payload.
|
|
161
|
+
*
|
|
162
|
+
* @category schemas
|
|
163
|
+
* @since 0.24.0
|
|
164
|
+
*/
|
|
165
|
+
export const EventInput = Schema.Struct({
|
|
166
|
+
event: Schema.String,
|
|
167
|
+
schema: InputSchema
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* Machine and public event inputs available to devtools forms.
|
|
171
|
+
*
|
|
172
|
+
* @category schemas
|
|
173
|
+
* @since 0.24.0
|
|
174
|
+
*/
|
|
175
|
+
export const Inputs = Schema.Struct({
|
|
176
|
+
machine: Schema.NullOr(InputSchema),
|
|
177
|
+
events: Schema.Array(EventInput)
|
|
178
|
+
});
|
|
146
179
|
/**
|
|
147
180
|
* Complete, versioned, JSON-safe machine inspection document.
|
|
148
181
|
*
|
|
@@ -159,6 +192,7 @@ export const MachineDocument = Schema.Struct({
|
|
|
159
192
|
states: Schema.Array(State),
|
|
160
193
|
transitions: Schema.Array(Transition),
|
|
161
194
|
activities: Schema.Array(Activity),
|
|
195
|
+
inputs: Inputs,
|
|
162
196
|
snapshot: Schema.NullOr(Snapshot)
|
|
163
197
|
});
|
|
164
198
|
/**
|
|
@@ -1 +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,EA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C;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,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;CAClC,CAAC,CAAA;AAoBF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GACf,QAAQ,CAAC,IAAI,CAAA"}
|
|
@@ -15,12 +15,12 @@ import type * as ProjectInspector from "./ProjectInspector.js";
|
|
|
15
15
|
* @since 0.23.0
|
|
16
16
|
*/
|
|
17
17
|
export declare const Snapshot: Schema.Struct<{
|
|
18
|
-
readonly protocolVersion: Schema.Literal<
|
|
18
|
+
readonly protocolVersion: Schema.Literal<2>;
|
|
19
19
|
readonly revision: Schema.Natural;
|
|
20
20
|
readonly results: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
21
21
|
readonly _tag: Schema.tag<"Ready">;
|
|
22
22
|
readonly document: Schema.Struct<{
|
|
23
|
-
readonly schemaVersion: Schema.Literal<
|
|
23
|
+
readonly schemaVersion: Schema.Literal<3>;
|
|
24
24
|
readonly revision: Schema.Natural;
|
|
25
25
|
readonly source: Schema.NullOr<Schema.Struct<{
|
|
26
26
|
readonly file: Schema.String;
|
|
@@ -48,6 +48,16 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
48
48
|
readonly parent: Schema.NullOr<Schema.String>;
|
|
49
49
|
readonly children: Schema.$Array<Schema.String>;
|
|
50
50
|
readonly initial: Schema.NullOr<Schema.String>;
|
|
51
|
+
readonly valueSchema: Schema.NullOr<Schema.Struct<{
|
|
52
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
53
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
54
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly outputSchema: Schema.NullOr<Schema.Struct<{
|
|
57
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
58
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
59
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
60
|
+
}>>;
|
|
51
61
|
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
52
62
|
readonly activityIds: Schema.$Array<Schema.String>;
|
|
53
63
|
}>>;
|
|
@@ -129,6 +139,21 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
129
139
|
readonly source: Schema.String;
|
|
130
140
|
readonly lifecycleId: Schema.String;
|
|
131
141
|
}>]>>;
|
|
142
|
+
readonly inputs: Schema.Struct<{
|
|
143
|
+
readonly machine: Schema.NullOr<Schema.Struct<{
|
|
144
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
145
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
146
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
147
|
+
}>>;
|
|
148
|
+
readonly events: Schema.$Array<Schema.Struct<{
|
|
149
|
+
readonly event: Schema.String;
|
|
150
|
+
readonly schema: Schema.Struct<{
|
|
151
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
152
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
153
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
154
|
+
}>;
|
|
155
|
+
}>>;
|
|
156
|
+
}>;
|
|
132
157
|
readonly snapshot: Schema.NullOr<Schema.Struct<{
|
|
133
158
|
readonly activePaths: Schema.$Array<Schema.String>;
|
|
134
159
|
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
@@ -145,12 +170,12 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
145
170
|
}>>;
|
|
146
171
|
readonly statePath: Schema.NullOr<Schema.String>;
|
|
147
172
|
}>>;
|
|
148
|
-
readonly protocolVersion: Schema.Literal<
|
|
173
|
+
readonly protocolVersion: Schema.Literal<2>;
|
|
149
174
|
readonly key: Schema.String;
|
|
150
175
|
}>, Schema.Struct<{
|
|
151
176
|
readonly _tag: Schema.tag<"Partial">;
|
|
152
177
|
readonly document: Schema.Struct<{
|
|
153
|
-
readonly schemaVersion: Schema.Literal<
|
|
178
|
+
readonly schemaVersion: Schema.Literal<3>;
|
|
154
179
|
readonly revision: Schema.Natural;
|
|
155
180
|
readonly source: Schema.NullOr<Schema.Struct<{
|
|
156
181
|
readonly file: Schema.String;
|
|
@@ -178,6 +203,16 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
178
203
|
readonly parent: Schema.NullOr<Schema.String>;
|
|
179
204
|
readonly children: Schema.$Array<Schema.String>;
|
|
180
205
|
readonly initial: Schema.NullOr<Schema.String>;
|
|
206
|
+
readonly valueSchema: Schema.NullOr<Schema.Struct<{
|
|
207
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
208
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
209
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
210
|
+
}>>;
|
|
211
|
+
readonly outputSchema: Schema.NullOr<Schema.Struct<{
|
|
212
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
213
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
214
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
215
|
+
}>>;
|
|
181
216
|
readonly transitionIds: Schema.$Array<Schema.String>;
|
|
182
217
|
readonly activityIds: Schema.$Array<Schema.String>;
|
|
183
218
|
}>>;
|
|
@@ -259,6 +294,21 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
259
294
|
readonly source: Schema.String;
|
|
260
295
|
readonly lifecycleId: Schema.String;
|
|
261
296
|
}>]>>;
|
|
297
|
+
readonly inputs: Schema.Struct<{
|
|
298
|
+
readonly machine: Schema.NullOr<Schema.Struct<{
|
|
299
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
300
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
301
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
302
|
+
}>>;
|
|
303
|
+
readonly events: Schema.$Array<Schema.Struct<{
|
|
304
|
+
readonly event: Schema.String;
|
|
305
|
+
readonly schema: Schema.Struct<{
|
|
306
|
+
readonly dialect: Schema.Literal<"draft-2020-12">;
|
|
307
|
+
readonly schema: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
308
|
+
readonly definitions: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
309
|
+
}>;
|
|
310
|
+
}>>;
|
|
311
|
+
}>;
|
|
262
312
|
readonly snapshot: Schema.NullOr<Schema.Struct<{
|
|
263
313
|
readonly activePaths: Schema.$Array<Schema.String>;
|
|
264
314
|
readonly candidateEvents: Schema.$Array<Schema.String>;
|
|
@@ -275,7 +325,7 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
275
325
|
}>>;
|
|
276
326
|
readonly statePath: Schema.NullOr<Schema.String>;
|
|
277
327
|
}>>;
|
|
278
|
-
readonly protocolVersion: Schema.Literal<
|
|
328
|
+
readonly protocolVersion: Schema.Literal<2>;
|
|
279
329
|
readonly key: Schema.String;
|
|
280
330
|
}>, Schema.Struct<{
|
|
281
331
|
readonly _tag: Schema.tag<"Failed">;
|
|
@@ -295,7 +345,7 @@ export declare const Snapshot: Schema.Struct<{
|
|
|
295
345
|
}>>;
|
|
296
346
|
readonly statePath: Schema.NullOr<Schema.String>;
|
|
297
347
|
}>>;
|
|
298
|
-
readonly protocolVersion: Schema.Literal<
|
|
348
|
+
readonly protocolVersion: Schema.Literal<2>;
|
|
299
349
|
readonly key: Schema.String;
|
|
300
350
|
}>]>>;
|
|
301
351
|
}>;
|
|
@@ -1 +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
|
|
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,171 @@
|
|
|
1
|
+
import * as Result from "effect/Result";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import type * as MachineDocument from "./MachineDocument.js";
|
|
4
|
+
declare const TypeId: "@typeonce/effect-machine-devtools/MachineWalkthrough/Session";
|
|
5
|
+
/**
|
|
6
|
+
* An immutable walkthrough session. Its timeline can be inspected and its
|
|
7
|
+
* cursor can move without evaluating machine callbacks.
|
|
8
|
+
*
|
|
9
|
+
* @category models
|
|
10
|
+
* @since 0.25.0
|
|
11
|
+
*/
|
|
12
|
+
export interface Session {
|
|
13
|
+
readonly [TypeId]: typeof TypeId;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Why taking a documented branch requires an explicit human decision.
|
|
17
|
+
*
|
|
18
|
+
* @category models
|
|
19
|
+
* @since 0.25.0
|
|
20
|
+
*/
|
|
21
|
+
export type Decision = "conditional-branch" | "declinable-transition" | "automatic-trigger" | "invoke-outcome";
|
|
22
|
+
/**
|
|
23
|
+
* Why a documented branch cannot advance topology without runtime data.
|
|
24
|
+
*
|
|
25
|
+
* @category models
|
|
26
|
+
* @since 0.25.0
|
|
27
|
+
*/
|
|
28
|
+
export type UnavailableReason = "history-unavailable" | "runtime-target";
|
|
29
|
+
/**
|
|
30
|
+
* One branch that can be explored from the current active configuration.
|
|
31
|
+
*
|
|
32
|
+
* @category models
|
|
33
|
+
* @since 0.25.0
|
|
34
|
+
*/
|
|
35
|
+
export interface Choice {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly transitionId: string;
|
|
38
|
+
readonly branchId: string;
|
|
39
|
+
readonly branchIndex: number;
|
|
40
|
+
readonly branchKey: string | null;
|
|
41
|
+
readonly title: string | null;
|
|
42
|
+
readonly source: string;
|
|
43
|
+
readonly trigger: MachineDocument.Trigger;
|
|
44
|
+
readonly target: string | null;
|
|
45
|
+
readonly selection: MachineDocument.Selection;
|
|
46
|
+
readonly updates: ReadonlyArray<string>;
|
|
47
|
+
readonly decisions: ReadonlyArray<Decision>;
|
|
48
|
+
readonly unavailableReason: UnavailableReason | null;
|
|
49
|
+
readonly input: MachineDocument.InputSchema | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The active state paths at one point in a walkthrough.
|
|
53
|
+
*
|
|
54
|
+
* @category models
|
|
55
|
+
* @since 0.25.0
|
|
56
|
+
*/
|
|
57
|
+
export interface Snapshot {
|
|
58
|
+
readonly activePaths: ReadonlyArray<string>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* One initial or manually selected topology step.
|
|
62
|
+
*
|
|
63
|
+
* @category models
|
|
64
|
+
* @since 0.25.0
|
|
65
|
+
*/
|
|
66
|
+
export interface Frame {
|
|
67
|
+
readonly step: number;
|
|
68
|
+
readonly choice: Choice | null;
|
|
69
|
+
readonly before: Snapshot;
|
|
70
|
+
readonly after: Snapshot;
|
|
71
|
+
readonly exitPaths: ReadonlyArray<string>;
|
|
72
|
+
readonly entryPaths: ReadonlyArray<string>;
|
|
73
|
+
readonly changed: boolean;
|
|
74
|
+
}
|
|
75
|
+
declare const ChoiceNotFound_base: Schema.Class<ChoiceNotFound, Schema.Struct<{
|
|
76
|
+
readonly _tag: Schema.tag<"ChoiceNotFound">;
|
|
77
|
+
readonly choiceId: Schema.String;
|
|
78
|
+
}>, import("effect/Cause").YieldableError>;
|
|
79
|
+
/**
|
|
80
|
+
* A requested choice is not available from the cursor's configuration.
|
|
81
|
+
*
|
|
82
|
+
* @category errors
|
|
83
|
+
* @since 0.25.0
|
|
84
|
+
*/
|
|
85
|
+
export declare class ChoiceNotFound extends ChoiceNotFound_base {
|
|
86
|
+
}
|
|
87
|
+
declare const ChoiceUnavailable_base: Schema.Class<ChoiceUnavailable, Schema.Struct<{
|
|
88
|
+
readonly _tag: Schema.tag<"ChoiceUnavailable">;
|
|
89
|
+
readonly choiceId: Schema.String;
|
|
90
|
+
readonly reason: Schema.Literals<readonly ["history-unavailable", "runtime-target"]>;
|
|
91
|
+
}>, import("effect/Cause").YieldableError>;
|
|
92
|
+
/**
|
|
93
|
+
* A choice depends on runtime information absent from the machine document.
|
|
94
|
+
*
|
|
95
|
+
* @category errors
|
|
96
|
+
* @since 0.25.0
|
|
97
|
+
*/
|
|
98
|
+
export declare class ChoiceUnavailable extends ChoiceUnavailable_base {
|
|
99
|
+
}
|
|
100
|
+
declare const StepNotFound_base: Schema.Class<StepNotFound, Schema.Struct<{
|
|
101
|
+
readonly _tag: Schema.tag<"StepNotFound">;
|
|
102
|
+
readonly step: Schema.Number;
|
|
103
|
+
}>, import("effect/Cause").YieldableError>;
|
|
104
|
+
/**
|
|
105
|
+
* A requested timeline step does not exist.
|
|
106
|
+
*
|
|
107
|
+
* @category errors
|
|
108
|
+
* @since 0.25.0
|
|
109
|
+
*/
|
|
110
|
+
export declare class StepNotFound extends StepNotFound_base {
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Starts at the document's captured snapshot when present, otherwise at its
|
|
114
|
+
* statically declared initial configuration.
|
|
115
|
+
*
|
|
116
|
+
* @category constructors
|
|
117
|
+
* @since 0.25.0
|
|
118
|
+
*/
|
|
119
|
+
export declare const start: (document: MachineDocument.MachineDocument) => Session;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the frame selected by the session cursor.
|
|
122
|
+
*
|
|
123
|
+
* @category getters
|
|
124
|
+
* @since 0.25.0
|
|
125
|
+
*/
|
|
126
|
+
export declare const current: (self: Session) => Frame;
|
|
127
|
+
/**
|
|
128
|
+
* Returns every retained frame, including frames after the current cursor.
|
|
129
|
+
*
|
|
130
|
+
* @category getters
|
|
131
|
+
* @since 0.25.0
|
|
132
|
+
*/
|
|
133
|
+
export declare const timeline: (self: Session) => ReadonlyArray<Frame>;
|
|
134
|
+
/**
|
|
135
|
+
* Returns the current zero-based timeline position.
|
|
136
|
+
*
|
|
137
|
+
* @category getters
|
|
138
|
+
* @since 0.25.0
|
|
139
|
+
*/
|
|
140
|
+
export declare const cursor: (self: Session) => number;
|
|
141
|
+
/**
|
|
142
|
+
* Lists documented branches whose sources are active at the current cursor.
|
|
143
|
+
* Runtime-dependent choices remain visible with an unavailable reason.
|
|
144
|
+
*
|
|
145
|
+
* @category getters
|
|
146
|
+
* @since 0.25.0
|
|
147
|
+
*/
|
|
148
|
+
export declare const choices: (self: Session) => ReadonlyArray<Choice>;
|
|
149
|
+
/**
|
|
150
|
+
* Takes one documented branch. Taking a branch from the past truncates the
|
|
151
|
+
* future timeline before appending the new frame.
|
|
152
|
+
*
|
|
153
|
+
* @category combinators
|
|
154
|
+
* @since 0.25.0
|
|
155
|
+
*/
|
|
156
|
+
export declare const take: {
|
|
157
|
+
(choiceId: string): (self: Session) => Result.Result<Session, ChoiceNotFound | ChoiceUnavailable>;
|
|
158
|
+
(self: Session, choiceId: string): Result.Result<Session, ChoiceNotFound | ChoiceUnavailable>;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Moves the cursor to an existing frame without changing the timeline.
|
|
162
|
+
*
|
|
163
|
+
* @category combinators
|
|
164
|
+
* @since 0.25.0
|
|
165
|
+
*/
|
|
166
|
+
export declare const seek: {
|
|
167
|
+
(step: number): (self: Session) => Result.Result<Session, StepNotFound>;
|
|
168
|
+
(self: Session, step: number): Result.Result<Session, StepNotFound>;
|
|
169
|
+
};
|
|
170
|
+
export {};
|
|
171
|
+
//# sourceMappingURL=MachineWalkthrough.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineWalkthrough.d.ts","sourceRoot":"","sources":["../src/MachineWalkthrough.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAE5D,QAAA,MAAM,MAAM,gEAAyB,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;CACjC;AAED;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,gBAAgB,CAAA;AAEpB;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG,gBAAgB,CAAA;AAExE;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAA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AAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;CACtC,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Side-effect-free topology walkthroughs over machine documents.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.25.0
|
|
5
|
+
*/
|
|
6
|
+
import { dual } from "effect/Function";
|
|
7
|
+
import * as Result from "effect/Result";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as internal from "./internal/machineWalkthrough.js";
|
|
10
|
+
const TypeId = internal.SessionTypeId;
|
|
11
|
+
/**
|
|
12
|
+
* A requested choice is not available from the cursor's configuration.
|
|
13
|
+
*
|
|
14
|
+
* @category errors
|
|
15
|
+
* @since 0.25.0
|
|
16
|
+
*/
|
|
17
|
+
export class ChoiceNotFound extends Schema.Error("@typeonce/effect-machine-devtools/MachineWalkthrough/ChoiceNotFound")({
|
|
18
|
+
_tag: Schema.tag("ChoiceNotFound"),
|
|
19
|
+
choiceId: Schema.String
|
|
20
|
+
}) {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A choice depends on runtime information absent from the machine document.
|
|
24
|
+
*
|
|
25
|
+
* @category errors
|
|
26
|
+
* @since 0.25.0
|
|
27
|
+
*/
|
|
28
|
+
export class ChoiceUnavailable extends Schema.Error("@typeonce/effect-machine-devtools/MachineWalkthrough/ChoiceUnavailable")({
|
|
29
|
+
_tag: Schema.tag("ChoiceUnavailable"),
|
|
30
|
+
choiceId: Schema.String,
|
|
31
|
+
reason: Schema.Literals(["history-unavailable", "runtime-target"])
|
|
32
|
+
}) {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A requested timeline step does not exist.
|
|
36
|
+
*
|
|
37
|
+
* @category errors
|
|
38
|
+
* @since 0.25.0
|
|
39
|
+
*/
|
|
40
|
+
export class StepNotFound extends Schema.Error("@typeonce/effect-machine-devtools/MachineWalkthrough/StepNotFound")({
|
|
41
|
+
_tag: Schema.tag("StepNotFound"),
|
|
42
|
+
step: Schema.Number
|
|
43
|
+
}) {
|
|
44
|
+
}
|
|
45
|
+
const api = { ChoiceNotFound, ChoiceUnavailable, StepNotFound };
|
|
46
|
+
/**
|
|
47
|
+
* Starts at the document's captured snapshot when present, otherwise at its
|
|
48
|
+
* statically declared initial configuration.
|
|
49
|
+
*
|
|
50
|
+
* @category constructors
|
|
51
|
+
* @since 0.25.0
|
|
52
|
+
*/
|
|
53
|
+
export const start = internal.start;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the frame selected by the session cursor.
|
|
56
|
+
*
|
|
57
|
+
* @category getters
|
|
58
|
+
* @since 0.25.0
|
|
59
|
+
*/
|
|
60
|
+
export const current = internal.current;
|
|
61
|
+
/**
|
|
62
|
+
* Returns every retained frame, including frames after the current cursor.
|
|
63
|
+
*
|
|
64
|
+
* @category getters
|
|
65
|
+
* @since 0.25.0
|
|
66
|
+
*/
|
|
67
|
+
export const timeline = internal.timeline;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the current zero-based timeline position.
|
|
70
|
+
*
|
|
71
|
+
* @category getters
|
|
72
|
+
* @since 0.25.0
|
|
73
|
+
*/
|
|
74
|
+
export const cursor = internal.cursor;
|
|
75
|
+
/**
|
|
76
|
+
* Lists documented branches whose sources are active at the current cursor.
|
|
77
|
+
* Runtime-dependent choices remain visible with an unavailable reason.
|
|
78
|
+
*
|
|
79
|
+
* @category getters
|
|
80
|
+
* @since 0.25.0
|
|
81
|
+
*/
|
|
82
|
+
export const choices = internal.choices;
|
|
83
|
+
/**
|
|
84
|
+
* Takes one documented branch. Taking a branch from the past truncates the
|
|
85
|
+
* future timeline before appending the new frame.
|
|
86
|
+
*
|
|
87
|
+
* @category combinators
|
|
88
|
+
* @since 0.25.0
|
|
89
|
+
*/
|
|
90
|
+
export const take = dual(2, internal.take(api));
|
|
91
|
+
/**
|
|
92
|
+
* Moves the cursor to an existing frame without changing the timeline.
|
|
93
|
+
*
|
|
94
|
+
* @category combinators
|
|
95
|
+
* @since 0.25.0
|
|
96
|
+
*/
|
|
97
|
+
export const seek = dual(2, internal.seek(api));
|
|
98
|
+
//# sourceMappingURL=MachineWalkthrough.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MachineWalkthrough.js","sourceRoot":"","sources":["../src/MachineWalkthrough.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,kCAAkC,CAAA;AAG5D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAA;AAkFrC;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,KAAK,CAC9C,qEAAqE,CACtE,CAAC;IACA,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM;CACxB,CAAC;CAAG;AAEL;;;;;GAKG;AACH,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,KAAK,CACjD,wEAAwE,CACzE,CAAC;IACA,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC,MAAM;IACvB,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;CACnE,CAAC;CAAG;AAEL;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,KAAK,CAC5C,mEAAmE,CACpE,CAAC;IACA,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM;CACpB,CAAC;CAAG;AAEL,MAAM,GAAG,GAAG,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAA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