@typeonce/effect-machine-devtools 0.23.0 → 0.24.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 +10 -4
- 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 +731 -17
- package/dist/DevToolsProtocol.d.ts.map +1 -1
- package/dist/DevToolsProtocol.js +191 -1
- package/dist/DevToolsProtocol.js.map +1 -1
- package/dist/MachineDocument.d.ts +78 -2
- package/dist/MachineDocument.d.ts.map +1 -1
- package/dist/MachineDocument.js +33 -1
- package/dist/MachineDocument.js.map +1 -1
- package/dist/MachineRegistry.d.ts +36 -6
- package/dist/MachineRegistry.d.ts.map +1 -1
- package/dist/ProjectInspector.d.ts +2 -0
- package/dist/ProjectInspector.d.ts.map +1 -1
- package/dist/ProjectInspector.js.map +1 -1
- package/dist/client/assets/index-B49Tjawc.js +14 -0
- package/dist/client/assets/index-BKH0cOG2.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/internal/devServer.d.ts +2 -1
- package/dist/internal/devServer.d.ts.map +1 -1
- package/dist/internal/devServer.js +68 -7
- package/dist/internal/devServer.js.map +1 -1
- package/dist/internal/evaluationWorker.d.ts.map +1 -1
- package/dist/internal/evaluationWorker.js +279 -4
- package/dist/internal/evaluationWorker.js.map +1 -1
- package/dist/internal/machineDocument.d.ts.map +1 -1
- package/dist/internal/machineDocument.js +63 -2
- package/dist/internal/machineDocument.js.map +1 -1
- package/dist/internal/projectInspector.d.ts.map +1 -1
- package/dist/internal/projectInspector.js +26 -10
- package/dist/internal/projectInspector.js.map +1 -1
- package/package.json +2 -2
- package/src/DevServer.ts +6 -2
- package/src/DevToolsProtocol.ts +286 -1
- package/src/MachineDocument.ts +54 -1
- package/src/ProjectInspector.ts +5 -0
- package/src/internal/browser/input-form.ts +669 -0
- package/src/internal/browser/planner-example.ts +143 -0
- package/src/internal/browser/simulation-client.ts +20 -0
- package/src/internal/browser/styles.css +323 -3
- package/src/internal/browser/visualizer-app.ts +395 -34
- package/src/internal/browser/visualizer.ts +1 -1
- package/src/internal/devServer.ts +91 -8
- package/src/internal/evaluationWorker.ts +390 -8
- package/src/internal/machineDocument.ts +75 -2
- package/src/internal/projectInspector.ts +58 -15
- package/dist/client/assets/index-BGOhE3Ng.css +0 -1
- package/dist/client/assets/index-DiqGhsGR.js +0 -14
package/README.md
CHANGED
|
@@ -66,16 +66,22 @@ Run the devtools only against code you trust. The server has no authentication a
|
|
|
66
66
|
|
|
67
67
|
The visualizer shows topology, active initial paths, state annotations, events, transitions, branches, state updates, activities, source metadata, and diagnostics. The tree supports pointer and keyboard navigation, subtree expansion, related-state highlighting, and structured detail inspection.
|
|
68
68
|
|
|
69
|
-
Simulation
|
|
69
|
+
Simulation uses the same `Machine.planInitial` and `Machine.plan` semantics as the core package. Machine input and event payload controls are derived from their Effect schemas. Fields show their projected type, description, required or optional status, and constraints such as ranges, lengths, patterns, enum choices, and defaults. Supported controls include strings, numbers, booleans, enums, literals, nested objects, arrays, and unions. Browser constraints provide immediate feedback, then Effect Schema validates the complete value in the worker and reports failures beside the corresponding fields.
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Start a session, send an enabled event, and inspect the resulting macrostep as structured microsteps. Events without payload fields run when clicked; events with input open a form first. The trace includes selected branches, before/after topology, exits, entries, state updates, raised events, emitted events, planned commands, completion, and output.
|
|
72
|
+
|
|
73
|
+
Each plan loads the exported machine in a fresh worker, decodes the portable session snapshot, and evaluates synchronous statechart callbacks. This supports conditional branches, parallel transitions, history, choices, state updates, reentry, and automatic stabilization. It also means synchronous code inside initial, transition, entry, exit, choice, history, and output callbacks runs during planning.
|
|
74
|
+
|
|
75
|
+
The planner does not commit commands, start activities, invoke children, deliver `sendTo` events, or run returned Effects. Commands and emissions are shown in the trace instead. A worker is discarded after every request and a planning request is limited to ten seconds, but the devtools are still intended only for trusted projects.
|
|
76
|
+
|
|
77
|
+
Simulation sessions use encoded snapshots and are tied to one source revision. A file change remounts the latest document; restart the simulation to use the new definition. Schema decoding and planning failures remain visible as diagnostics without discarding the topology.
|
|
72
78
|
|
|
73
79
|
## Programmatic modules
|
|
74
80
|
|
|
75
81
|
The first release publishes three programmatic modules:
|
|
76
82
|
|
|
77
|
-
- `DevToolsProtocol` defines the versioned worker and
|
|
83
|
+
- `DevToolsProtocol` defines the versioned worker, browser, and planner-session messages.
|
|
78
84
|
- `MachineDocument` defines and constructs the serializable inspection document.
|
|
79
|
-
- `MachineSimulator` provides the
|
|
85
|
+
- `MachineSimulator` provides the conservative, document-only simulator for consumers that cannot load project code.
|
|
80
86
|
|
|
81
87
|
The project inspector, registry, worker, and local server remain implementation modules. Their interfaces can change without becoming package-level compatibility commitments.
|
package/dist/DevServer.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
7
7
|
import * as Schema from "effect/Schema";
|
|
8
8
|
import type * as MachineRegistry from "./MachineRegistry.js";
|
|
9
|
+
import type * as ProjectInspector from "./ProjectInspector.js";
|
|
9
10
|
/**
|
|
10
11
|
* @category models
|
|
11
12
|
* @since 0.23.0
|
|
@@ -37,6 +38,6 @@ export declare class DevServerError extends DevServerError_base {
|
|
|
37
38
|
* @category constructors
|
|
38
39
|
* @since 0.23.0
|
|
39
40
|
*/
|
|
40
|
-
export declare const run: (options: Options) => Effect.Effect<never, DevServerError, MachineRegistry.MachineRegistry>;
|
|
41
|
+
export declare const run: (options: Options) => Effect.Effect<never, DevServerError, MachineRegistry.MachineRegistry | ProjectInspector.ProjectInspector>;
|
|
41
42
|
export {};
|
|
42
43
|
//# sourceMappingURL=DevServer.d.ts.map
|
package/dist/DevServer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,eAAe,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C;;;;;;AAED;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,mBAMlC;CAAG;AAEL;;;;;GAKG;AACH,eAAO,MAAM,GAAG,GAAI,SAAS,OAAO,KAAG,MAAM,CAAC,MAAM,CAClD,KAAK,EACL,cAAc,EACd,eAAe,CAAC,eAAe,GAAG,gBAAgB,CAAC,gBAAgB,CAC3B,CAAA"}
|
package/dist/DevServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAiBnD;;;;;GAKG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,KAAK,CAC9C,4DAA4D,CAC7D,CAAC;IACA,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC;CAAG;AAEL;;;;;GAKG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,OAAgB,EAIlC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA"}
|