@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;color:#e8eaed;font-synthesis:none;text-rendering:optimizelegibility;--surface:#0f1114;--surface-raised:#14171b;--line:#292d34;--line-soft:#20242a;--muted:#8e949e;--accent:#75a7ff;--accent-bg:#4b7dff2e;--orange:#f0a35b;background:#0b0c0e;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html,body,#app{min-width:320px;height:100%;margin:0}body{background:#0b0c0e}.devtools-shell{flex-direction:column;width:100vw;height:100vh;display:flex;overflow:hidden}.machine-index{border-bottom:1px solid var(--line);scrollbar-width:thin;background:#0d0f12;flex:none;width:100%;min-width:0;min-height:48px;padding:0;display:flex;overflow:auto hidden}.machine-row{border:0;border-right:1px solid var(--line-soft);color:#c9cdd2;text-align:left;cursor:pointer;-webkit-user-select:none;user-select:none;background:0 0;flex:none;align-items:center;gap:8px;width:auto;min-width:148px;max-width:280px;min-height:48px;padding:0 16px;display:flex;position:relative}.machine-row:hover,.machine-row:focus-visible{color:#fff;background:#171a1f;outline:none}.machine-row.is-selected{color:#fff;background:#4b7dff1f}.machine-row.is-selected:after{background:var(--accent);content:"";height:2px;position:absolute;bottom:0;left:0;right:0}.machine-row-status{background:#646b75;border-radius:50%;flex:none;width:6px;height:6px}.machine-row-status.status-ready{background:#67c894}.machine-row-status.status-partial{background:var(--orange)}.machine-row-status.status-error{background:#df6964}.machine-row-label,.machine-row-file{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.machine-row-label{font:600 12px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.machine-row-file{display:none}.machine-index-empty{color:#646b75;padding:16px;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.machine-view{flex:1;min-width:0;min-height:0;overflow:hidden}.registry-empty,.connection-failure{color:#7f8690;align-content:start;gap:7px;min-height:100vh;padding:28px;font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:grid}.registry-empty strong{color:#d4d7dc;font-size:13px}.connection-failure{color:#e4b4b1}button{font:inherit}.app-shell,.workspace{width:100%;height:100%;min-height:0}.workspace{position:relative}.chart-panel{flex-direction:column;width:100%;min-width:0;height:100%;display:flex;position:relative;overflow:hidden}.diagnostics{border-bottom:1px solid var(--line);background:#121418}.diagnostic{color:#aeb4bd;flex-wrap:wrap;align-items:center;gap:8px;min-height:36px;padding:8px 16px;font-size:11px;display:flex}.diagnostic+.diagnostic{border-top:1px solid var(--line-soft)}.badge-warning{color:#e9c89f;background:#f0a35b21}.badge-error{color:#f2aaa7;background:#e0595424}.toolbar{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:2px;min-height:46px;padding:7px 16px;display:flex}.toolbar-actions,.zoom-controls,.runtime-summary{align-items:center;display:flex}.toolbar-actions{gap:2px}.zoom-controls{z-index:5;border:1px solid var(--line-soft);background:#0d0f12f0;border-radius:4px;flex:none;gap:1px;padding:2px;position:absolute;bottom:14px;left:14px;box-shadow:0 8px 28px #00000052}.chart-panel.has-walkthrough .zoom-controls{bottom:88px}.zoom-button{min-width:28px;padding-inline:7px}.zoom-value{color:#aeb4bd;min-width:46px;font:10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.runtime-summary{color:#7f8690;gap:7px;font:11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.runtime-dot{background:#555c65;border-radius:50%;width:6px;height:6px}.runtime-dot.has-snapshot{background:var(--accent)}.toolbar-button{color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:4px;padding:6px 9px;font-size:12px}.toolbar-button:not(:disabled):hover,.toolbar-button:not(:disabled):focus-visible{color:#fff;background:#1b1e23;outline:none}.toolbar-button:disabled{color:#50545c;cursor:default}.topology-chart{flex-direction:column;flex:1;min-height:0;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:flex}.topology-empty{color:#7f8690;gap:7px;max-width:420px;margin:26px 8px;font:12px/1.6 Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:grid}.topology-empty strong{color:#d4d7dc;font:600 13px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.chart-host,.chart-viewport{width:100%;height:100%}.chart-host{flex:1;min-height:0;position:relative}.chart-viewport{overscroll-behavior:contain;cursor:grab;touch-action:pan-x pan-y;overflow:auto}.chart-viewport.is-panning,.chart-viewport.is-panning .chart-state,.chart-viewport.is-panning .chart-edge-hit,.chart-viewport.is-panning .chart-edge-label{cursor:grabbing;-webkit-user-select:none;user-select:none}.chart-stage{min-width:100%;min-height:100%;position:relative}.chart-canvas{transform-origin:0 0;position:absolute;top:0;left:0}.chart-regions,.chart-edges,.chart-nodes,.chart-labels{position:absolute;inset:0}.chart-regions{z-index:0;pointer-events:none}.chart-edges{z-index:1;pointer-events:none;overflow:visible}.chart-nodes{z-index:2;pointer-events:none}.chart-labels{z-index:3;pointer-events:none}.chart-compound{background:#121519b8;border:1px solid #272c33;border-radius:5px;position:absolute}.chart-compound-parallel{background:#14181ebd;border-color:#303845}.chart-state{color:#d9dce1;text-align:left;cursor:pointer;pointer-events:auto;-webkit-user-select:none;user-select:none;background:#14181d;border:1px solid #30363f;border-radius:4px;padding:16px;display:block;position:absolute;overflow:hidden;box-shadow:0 4px 14px #0000002e}.chart-state-compound,.chart-state-parallel{background:#171b21;border-color:#353c47}.chart-state-final{border-color:#445066}.chart-state-history,.chart-state-choice{background:#18171d}.chart-state:not(:disabled):hover,.chart-state:focus-visible{color:#fff;border-color:#596475;outline:none}.chart-state-heading,.chart-state-identity,.chart-field-row,.chart-activity-row{align-items:center;min-width:0;display:flex}.chart-state-heading{justify-content:space-between;gap:12px}.chart-state-identity{gap:8px}.chart-state-status{border:1px solid #686f78;border-radius:50%;flex:none;width:7px;height:7px}.chart-state-status.is-active{border-color:var(--accent);background:var(--accent);box-shadow:0 0 0 3px #75a7ff1a}.chart-state-status.is-initial{background:#d9a441;border-color:#d9a441;box-shadow:0 0 0 3px #d9a4411f}.chart-state-status.is-active.is-initial{box-shadow:0 0 0 2px #14181d, 0 0 0 4px var(--accent)}.chart-state-name,.chart-field-name,.chart-activity-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.chart-state-name{font-size:12px}.chart-section-label,.chart-field-type,.chart-activity-kind,.chart-more{color:#7e8792;font-size:9px;line-height:1.3}.chart-section-label,.chart-activity-kind{text-transform:uppercase}.chart-state-section{border-top:1px solid #242a31;width:min(300px,100%);margin-top:11px;padding-top:8px}.chart-section-label{letter-spacing:.06em;margin-bottom:4px}.chart-field-row,.chart-activity-row{grid-template-columns:minmax(0,1fr) auto;gap:10px;min-height:22px;display:grid}.chart-activity-row{grid-template-columns:auto minmax(0,1fr)}.chart-field-name,.chart-activity-name{color:#c4c9d0;font-size:10px}.chart-field-type,.chart-activity-kind{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;overflow:hidden}.chart-activity-kind{color:#77a990;text-overflow:clip;min-width:max-content;overflow:visible}.chart-more{min-height:18px;padding-top:3px}.chart-initial{pointer-events:none;background:#9ba3ae;border-radius:50%;position:absolute;box-shadow:0 0 0 3px #9ba3ae14}.chart-runtime-target{color:#858d98;letter-spacing:.04em;text-transform:uppercase;pointer-events:none;-webkit-user-select:none;user-select:none;background:#111419;border:1px dashed #555d68;border-radius:3px;place-items:center;font:9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:grid;position:absolute}.chart-edge-line,.chart-edge-hit{fill:none}.chart-edge-line{stroke:#626b77;stroke-width:1.4px;vector-effect:non-scaling-stroke}.chart-edge-initial .chart-edge-line{stroke:#89929e}.chart-edge-hit{stroke:#0000;stroke-width:14px;cursor:pointer;pointer-events:stroke}#chart-arrow path{fill:context-stroke}.chart-edge-label{color:#c0c7d0;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;pointer-events:auto;-webkit-user-select:none;user-select:none;background:#101318;border:1px solid #2c333c;border-radius:3px;padding:4px 7px;font:10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;position:absolute;overflow:hidden}.chart-edge-label:not(:disabled):hover,.chart-edge-label:focus-visible,.chart-edge-group.is-hovered+.chart-edge-label{color:#fff;border-color:#53657e;outline:none}.chart-edge-label-always,.chart-edge-label-choice,.chart-edge-label-done{color:#d4b4e9}.chart-edge-group.is-hovered .chart-edge-line{stroke:#7c9ed2;stroke-width:1.8px}.chart-edge-group.is-walkthrough-unavailable .chart-edge-line{stroke:#6e675b;stroke-dasharray:5 5}.chart-edge-group.chart-transition-runtime .chart-edge-line{stroke-dasharray:5 5}.chart-edge-group.is-incoming .chart-edge-line{stroke:#ed6a70;stroke-width:2px}.chart-edge-group.is-outgoing .chart-edge-line{stroke:#6eb6dc;stroke-width:2px}.chart-edge-group.is-selected .chart-edge-line{stroke:#8ab5ff;stroke-width:2.5px}.chart-edge-group.is-walkthrough-available .chart-edge-line{stroke:#d5aa57;stroke-width:2px}.chart-edge-label.is-hovered{color:#dbe8ff;border-color:#526783}.chart-edge-label.is-walkthrough-unavailable{color:#8d8679;background:#151412;border-color:#4e4a43}.chart-edge-label.is-incoming{color:#ffd0d2;background:#251416;border-color:#a9484e}.chart-edge-label.is-outgoing{color:#c5e8f7;background:#111c22;border-color:#47758d}.chart-edge-label.is-selected{color:#fff;background:#18253a;border-color:#719ce0}.chart-edge-label.is-walkthrough-available{color:#f0d39a;background:#211b12;border-color:#8d713c}.chart-state.is-selected,.chart-compound.is-selected{background:#2c4b7a6b;border-color:#5f88ca}.chart-state.is-related-to,.chart-compound.is-related-to,.chart-state.is-hover-target,.chart-compound.is-hover-target{background:#30708c3d;border-color:#4f829a}.chart-state.is-related-from,.chart-compound.is-related-from,.chart-state.is-hover-source,.chart-compound.is-hover-source{background:#97303942;border-color:#a94b52}.chart-state.is-related-from.is-related-to,.chart-compound.is-related-from.is-related-to{background:linear-gradient(135deg,#97303947 0 50%,#30708c42 50% 100%);border-color:#6e708f}.chart-viewport.is-simulating .chart-state:disabled,.chart-viewport.is-simulating .chart-edge-label:disabled,.chart-viewport.is-simulating .chart-edge-hit{cursor:default}.chart-viewport.is-simulating .chart-edge-label:disabled,.chart-viewport.is-simulating .chart-edge-hit{pointer-events:none}.chart-viewport.is-simulating .chart-edge-label.is-walkthrough-available,.chart-viewport.is-simulating .chart-edge-label.is-walkthrough-unavailable,.chart-viewport.is-simulating .chart-edge-group.is-walkthrough-available .chart-edge-hit,.chart-viewport.is-simulating .chart-edge-group.is-walkthrough-unavailable .chart-edge-hit{cursor:pointer}.chart-viewport.is-simulating .chart-edge-group.is-walkthrough-available .chart-edge-hit,.chart-viewport.is-simulating .chart-edge-group.is-walkthrough-unavailable .chart-edge-hit{pointer-events:stroke}.chart-loading,.chart-layout-error{color:#7f8690;gap:7px;max-width:440px;margin:28px;font:11px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:grid}.chart-layout-error{color:#d58d89}.chart-layout-error strong{color:#efb0ac}.inspector-eyebrow,.card-title,.card-flags,.branch-main{align-items:center;gap:6px;display:flex}.badge{color:#a8afb8;letter-spacing:.02em;white-space:nowrap;background:#20242a;border-radius:3px;align-items:center;min-height:18px;padding:2px 6px;font:600 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:inline-flex}.badge-active{color:#b9d2ff;background:#4b7dff38}.badge-trigger{color:#b9d2ff;background:#4b7dff29}.badge-condition{color:#d9b8ef;background:#ac68e026}.badge-activity{color:#a8ddc4;background:#4eb58324}.badge-count{color:#858c96;background:0 0}.inspector{z-index:10;background:#0f1114f7;border:1px solid #333943;border-radius:6px;width:min(460px,100% - 28px);min-width:0;padding:0;position:absolute;top:14px;bottom:14px;right:14px;overflow:hidden;box-shadow:0 18px 60px #0000007a}.inspector[hidden]{display:none}.inspector-close{z-index:1;color:#8e949e;cursor:pointer;background:0 0;border:0;border-radius:3px;padding:6px 9px;font-size:11px;position:absolute;top:11px;right:12px}.inspector-content{width:100%;height:100%;padding:48px 24px 24px;overflow:auto}.inspector-close:hover,.inspector-close:focus-visible{color:#fff;background:#20242a;outline:none}.failure-shell{color:#d6d8dc;background:#0b0c0e;align-content:start;gap:12px;min-height:100vh;padding:32px;display:grid}.failure-kind{color:#f2aaa7;letter-spacing:.08em;text-transform:uppercase;font:600 10px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.failure-shell h1{margin:0;font:600 18px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.failure-shell pre{color:#e4b4b1;white-space:pre-wrap;background:#151112;border-left:2px solid #a54743;max-width:900px;margin:4px 0 0;padding:14px 16px;font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:auto}.failure-shell p{color:#7f8690;margin:0;font-size:12px}.inspector-empty{max-width:420px;color:var(--muted)}.inspector-empty-kind{color:var(--orange);letter-spacing:.08em;text-transform:uppercase;font:600 10px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.inspector-empty h2,.inspector-header h2{color:#f1f2f4;overflow-wrap:anywhere;margin:9px 0 0;font:600 18px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.inspector-title-row,.inspector-state-title{align-items:center;min-width:0;display:flex}.inspector-title-row{justify-content:space-between;gap:16px}.inspector-state-title{gap:9px}.inspector-title-row h2{min-width:0;margin:0}.inspector-empty p,.section-empty{color:var(--muted);font-size:12px;line-height:1.6}.inspector-header{border-bottom:1px solid var(--line);padding-bottom:24px}.state-annotations{margin-top:18px}.state-annotations p{color:#aeb4bd;margin:7px 0 0;font-size:12px;line-height:1.6}.state-annotations .state-documentation{color:#7f8690;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.breadcrumbs{flex-wrap:wrap;align-items:center;gap:5px;min-width:0;margin-bottom:16px;display:flex}.breadcrumb-separator{color:#555c65}.state-link{color:#9bbfff;overflow-wrap:anywhere;text-align:left;cursor:pointer;background:0 0;border:0;max-width:100%;padding:0;font:11px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.state-link:hover,.state-link:focus-visible{color:#d5e4ff;outline:none;text-decoration:underline}.metadata{grid-template-columns:minmax(74px,max-content) minmax(0,1fr);gap:8px 16px;margin:20px 0 0;font-size:11px;display:grid}.metadata dt{color:#727983}.metadata dd{color:#d2d5da;overflow-wrap:anywhere;min-width:0;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.inspector-section{margin-top:28px}.section-heading{justify-content:space-between;align-items:center;margin-bottom:11px;display:flex}.section-heading h3{color:#c9cdd2;margin:0;font-size:12px;font-weight:650}.section-count{color:#737a84;font:11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.inspection-card{border:1px solid var(--line-soft);background:var(--surface-raised);margin-top:8px}.card-header{justify-content:space-between;align-items:center;gap:12px;min-height:42px;padding:10px 12px;display:flex}.card-title{min-width:0}.card-title strong{color:#e2e4e7;overflow-wrap:anywhere;font:600 12px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.branch-list{border-top:1px solid var(--line-soft)}.branch-row{padding:11px 12px 13px}.branch-row+.branch-row{border-top:1px solid var(--line-soft)}.branch-main{min-width:0}.branch-arrow{color:var(--accent)}.branch-target{color:#d7d9dc;overflow-wrap:anywhere;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.branch-row .metadata,.transition-card .card-metadata,.activity-card .metadata,.incoming-card .metadata{margin-top:10px}.incoming-card{padding-bottom:12px}.incoming-card .metadata{padding:0 12px}.transition-card .card-metadata{padding:0 12px 10px}.branch-updates{grid-template-columns:minmax(74px,max-content) minmax(0,1fr);gap:8px 16px;margin-top:9px;font-size:11px;display:grid}.branch-updates-label{color:#727983}.branch-updates .state-link+.state-link{grid-column:2}.activity-card{padding-bottom:12px}.activity-card .metadata{padding:0 12px}.walkthrough-dock{border-top:1px solid var(--line);background:#0d0f12fa;flex:none;grid-template-rows:auto auto;gap:6px;min-height:0;max-height:76px;padding:8px 14px 10px;font:10px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:grid;box-shadow:0 -12px 32px #0003}.walkthrough-dock[hidden]{display:none}.walkthrough-heading,.walkthrough-identity,.walkthrough-timeline{align-items:center;min-width:0;display:flex}.walkthrough-heading{color:#d4d7dc;justify-content:space-between;gap:12px}.walkthrough-identity{gap:10px}.walkthrough-status,.walkthrough-hint{color:#777f8a}.walkthrough-hint{font-size:9px}.walkthrough-timeline{scrollbar-width:thin;gap:5px;overflow-x:auto}.walkthrough-step{border:1px solid var(--line-soft);color:#aeb4bd;cursor:pointer;white-space:nowrap;background:#14171b;border-radius:3px;flex:none;padding:5px 8px}.walkthrough-step:hover,.walkthrough-step:focus-visible{color:#fff;border-color:#53657e;outline:none}.walkthrough-step.is-current{color:#d8e6ff;background:#2c4b7a61;border-color:#5f88ca}.transition-picker{z-index:20;background:#0f1114fa;border:1px solid #4e4535;border-radius:5px;grid-template-rows:auto minmax(0,1fr);width:min(380px,100vw - 20px);max-height:min(420px,100vh - 68px);display:grid;position:fixed;overflow:hidden;box-shadow:0 18px 60px #00000085}.transition-picker[hidden]{display:none}.transition-picker-header,.transition-picker-choice-main{align-items:center;min-width:0;display:flex}.transition-picker-header{border-bottom:1px solid var(--line-soft);justify-content:space-between;gap:10px;min-height:38px;padding:8px 10px 8px 12px}.transition-picker-header strong{color:#d8dadd;text-overflow:ellipsis;white-space:nowrap;font:600 11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow:hidden}.transition-picker-close{color:#7f8690;cursor:pointer;background:0 0;border:0;border-radius:3px;padding:4px 6px;font-size:10px}.transition-picker-close:hover,.transition-picker-close:focus-visible{color:#fff;background:#20242a;outline:none}.transition-picker-content{gap:5px;padding:7px;display:grid;overflow:auto}.transition-picker-choice{border:1px solid var(--line-soft);color:#aeb4bd;text-align:left;cursor:pointer;background:#14171b;border-radius:3px;gap:4px;min-width:0;padding:8px 9px;font:10px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;display:grid}.transition-picker-choice:hover,.transition-picker-choice:focus-visible{background:#1d1912;border-color:#8d713c;outline:none}.transition-picker-choice-main{gap:7px}.transition-picker-choice-main strong,.transition-picker-choice-title,.transition-picker-choice-route,.transition-picker-choice-contract,.transition-picker-choice-decision,.transition-picker-choice-unavailable{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.transition-picker-choice-main strong{color:#efd18f}.transition-picker-choice-title{color:#d9b8ef}.transition-picker-choice-route{color:#777f8a}.transition-picker-choice-contract{color:#9ebce9}.transition-picker-choice-decision{color:#b69ac9}.transition-picker-choice-unavailable{color:#a38c6f}.transition-picker-choice.is-unavailable{opacity:.68;cursor:default}.input-contract-fields,.input-contract-field,.input-contract-children,.input-contract-alternatives{gap:9px;display:grid}.input-contract-fields{border:1px solid var(--line-soft);background:var(--surface-raised);padding:11px 12px}.input-contract-field+.input-contract-field{border-top:1px solid var(--line-soft);padding-top:9px}.input-contract-children,.input-contract-alternatives{border-top:1px solid var(--line-soft);border-left:1px solid var(--line-soft);margin-top:2px;padding:9px 0 0 12px}.input-contract .section-empty{margin:0}.input-field-heading{justify-content:space-between;align-items:center;gap:12px;display:flex}.input-field-identity,.input-constraints{flex-wrap:wrap;align-items:center;gap:6px;min-width:0;display:flex}.input-label,.input-required,.input-optional{font-size:11px}.input-label{color:#cfd3d9;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.input-field-type,.input-constraints span{color:#8294ad;font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.input-field-type{background:#4b7dff1f;border-radius:3px;padding:2px 5px}.input-constraints{margin-top:-1px}.input-constraints span+span:before{color:#4f5762;content:"·";margin-right:6px}.input-required{color:#737b86}.input-optional{color:#9199a4;align-items:center;gap:6px;display:inline-flex}.input-description,.input-unsupported{margin:0;font-size:11px;line-height:1.55}.input-description{color:#737b86}.input-unsupported{color:#d7a5a2}.trace-topology{gap:10px;display:grid}.trace-topology .section-heading{margin-bottom:1px}.trace-path-group,.trace-values,.trace-transitions{gap:7px;display:grid}.trace-path-group{grid-template-columns:78px minmax(0,1fr);align-items:start}.trace-paths{flex-wrap:wrap;gap:4px 10px;min-width:0;display:flex}.trace-label{color:#747c87;text-transform:uppercase;font-size:10px;line-height:1.5}.trace-card{padding-bottom:12px}.trace-card>.trace-path-group,.trace-card>.trace-values,.trace-card>.trace-transitions{margin:0 12px 10px}.trace-transition{flex-wrap:wrap;align-items:center;gap:6px;min-width:0;display:flex}.trace-transition+.trace-path-group{margin:0 0 4px}.trace-results{padding-bottom:24px}.trace-results>.trace-values{margin-top:12px}@media (width<=900px){.machine-row{min-width:132px;max-width:220px}.inspector{width:min(440px,100% - 16px);top:8px;bottom:8px;right:8px}}@media (width<=600px){.toolbar{align-items:flex-start;padding-inline:10px}.toolbar-actions{flex-wrap:wrap;justify-content:flex-end}.runtime-summary{padding-top:8px}.inspector-content{padding:48px 14px 18px}.zoom-controls{bottom:8px;left:8px}.chart-panel.has-walkthrough .zoom-controls{bottom:88px}}@media (prefers-reduced-motion:no-preference){.chart-state,.chart-edge-label,.toolbar-button{transition:color .12s,background-color .12s,border-color .12s}}
|
package/dist/client/index.html
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<meta name="description" content="Interactive
|
|
7
|
-
<title>Effect Machine ·
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
6
|
+
<meta name="description" content="Interactive statechart visualization for Effect Machine" />
|
|
7
|
+
<title>Effect Machine · Statechart</title>
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BTOAhezX.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cg7xzSkz.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="app"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export * as DevToolsProtocol from "./DevToolsProtocol.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export * as MachineDocument from "./MachineDocument.js";
|
|
14
14
|
/**
|
|
15
|
-
* @since 0.
|
|
15
|
+
* @since 0.25.0
|
|
16
16
|
*/
|
|
17
|
-
export * as
|
|
17
|
+
export * as MachineWalkthrough from "./MachineWalkthrough.js";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export * as DevToolsProtocol from "./DevToolsProtocol.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export * as MachineDocument from "./MachineDocument.js";
|
|
14
14
|
/**
|
|
15
|
-
* @since 0.
|
|
15
|
+
* @since 0.25.0
|
|
16
16
|
*/
|
|
17
|
-
export * as
|
|
17
|
+
export * as MachineWalkthrough from "./MachineWalkthrough.js";
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AAEzD;;GAEG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AAEvD;;GAEG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA"}
|
|
@@ -2,8 +2,9 @@ import { type ChokidarOptions } from "chokidar";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import type * as DevServer from "../DevServer.js";
|
|
4
4
|
import * as MachineRegistry from "../MachineRegistry.js";
|
|
5
|
+
import * as ProjectInspector from "../ProjectInspector.js";
|
|
5
6
|
type DevServerErrorConstructor = typeof DevServer.DevServerError;
|
|
6
7
|
export declare const watcherOptions: (options: DevServer.Options) => ChokidarOptions;
|
|
7
|
-
export declare const run: (ErrorType: DevServerErrorConstructor, options: DevServer.Options) => Effect.Effect<never, DevServer.DevServerError, MachineRegistry.MachineRegistry>;
|
|
8
|
+
export declare const run: (ErrorType: DevServerErrorConstructor, options: DevServer.Options) => Effect.Effect<never, DevServer.DevServerError, MachineRegistry.MachineRegistry | ProjectInspector.ProjectInspector>;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=devServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../../src/internal/devServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAMvC,OAAO,KAAK,KAAK,SAAS,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../../src/internal/devServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAMvC,OAAO,KAAK,KAAK,SAAS,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAE1D,KAAK,yBAAyB,GAAG,OAAO,SAAS,CAAC,cAAc,CAAA;AAuIhE,eAAO,MAAM,cAAc,GAAI,SAAS,SAAS,CAAC,OAAO,KAAG,eAM9B,CAAA;AAE9B,eAAO,MAAM,GAAG,GACd,WAAW,yBAAyB,EACpC,SAAS,SAAS,CAAC,OAAO,KACzB,MAAM,CAAC,MAAM,CACd,KAAK,EACL,SAAS,CAAC,cAAc,EACxB,eAAe,CAAC,eAAe,GAAG,gBAAgB,CAAC,gBAAgB,CAe7C,CAAA"}
|
|
@@ -5,6 +5,7 @@ import { isAbsolute, relative, resolve } from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { createServer } from "vite";
|
|
7
7
|
import * as MachineRegistry from "../MachineRegistry.js";
|
|
8
|
+
import * as ProjectInspector from "../ProjectInspector.js";
|
|
8
9
|
const packageRoot = fileURLToPath(new URL("../..", import.meta.url));
|
|
9
10
|
const sourceExtension = /\.(?:[cm]?[jt]sx?)$/;
|
|
10
11
|
const isProjectSource = (root, file) => {
|
|
@@ -27,8 +28,8 @@ const isIgnored = (file) => file.split(/[\\/]/).some((part) => part === "node_mo
|
|
|
27
28
|
part === "coverage" ||
|
|
28
29
|
part === ".data" ||
|
|
29
30
|
part === "references");
|
|
30
|
-
const writeJson = (response, value) => {
|
|
31
|
-
response.statusCode =
|
|
31
|
+
const writeJson = (response, value, status = 200) => {
|
|
32
|
+
response.statusCode = status;
|
|
32
33
|
response.setHeader("content-type", "application/json; charset=utf-8");
|
|
33
34
|
response.setHeader("cache-control", "no-store");
|
|
34
35
|
response.end(JSON.stringify(value));
|
|
@@ -37,7 +38,7 @@ const apiPlugin = (registry) => ({
|
|
|
37
38
|
name: "effect-machine-devtools-api",
|
|
38
39
|
configureServer(server) {
|
|
39
40
|
server.middlewares.use((request, response, next) => {
|
|
40
|
-
if (request.url === "/api/machines") {
|
|
41
|
+
if (request.method === "GET" && request.url === "/api/machines") {
|
|
41
42
|
void Effect.runPromise(registry.get).then((snapshot) => writeJson(response, snapshot), (cause) => {
|
|
42
43
|
response.statusCode = 500;
|
|
43
44
|
response.end(String(cause));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devServer.js","sourceRoot":"","sources":["../../src/internal/devServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,YAAY,EAAmC,MAAM,MAAM,CAAA;AAEpE,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"devServer.js","sourceRoot":"","sources":["../../src/internal/devServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,EAAE,MAAM,UAAU,CAAA;AACtE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM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AC,CAAC,CAAC,IAAI,UAAU,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,CAAA;IAC1F,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAA;IAC9D,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;AAC5B,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluationWorker.d.ts","sourceRoot":"","sources":["../../src/internal/evaluationWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluationWorker.d.ts","sourceRoot":"","sources":["../../src/internal/evaluationWorker.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AA4IzC,eAAO,MAAM,GAAG,GAAI,QAAQ,aAAa,KAAG,OAAO,CAAC,IAAI,CAQrD,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as NodeWorkerRunner from "@effect/platform-node/NodeWorkerRunner";
|
|
2
|
+
import { Machine } from "@typeonce/effect-machine";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
3
5
|
import * as WorkerRunner from "effect/unstable/workers/WorkerRunner";
|
|
4
6
|
import { resolve } from "node:path";
|
|
5
7
|
import { pathToFileURL } from "node:url";
|
|
@@ -19,7 +21,26 @@ const diagnostic = (file, code, message) => ({
|
|
|
19
21
|
location: { file, line: null, column: null },
|
|
20
22
|
statePath: null
|
|
21
23
|
});
|
|
22
|
-
const messageOf = (cause) =>
|
|
24
|
+
const messageOf = (cause) => {
|
|
25
|
+
if (Schema.isSchemaError(cause))
|
|
26
|
+
return `Invalid machine value: ${cause.message}`;
|
|
27
|
+
if (cause instanceof Error && cause.message.length > 0)
|
|
28
|
+
return cause.message;
|
|
29
|
+
if (typeof cause === "object" && cause !== null && "cause" in cause && Schema.isSchemaError(cause.cause)) {
|
|
30
|
+
const boundary = "boundary" in cause ? String(cause.boundary) : "value";
|
|
31
|
+
return `Invalid machine ${boundary}: ${cause.cause.message}`;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const encoded = JSON.stringify(cause, null, 2);
|
|
35
|
+
if (encoded !== undefined && encoded !== "{}")
|
|
36
|
+
return encoded;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Fall back to the runtime string representation below.
|
|
40
|
+
}
|
|
41
|
+
const rendered = String(cause);
|
|
42
|
+
return rendered.length > 0 ? rendered : "The evaluator failed without a diagnostic message";
|
|
43
|
+
};
|
|
23
44
|
const failed = (candidate, code, message, exportName = candidate.exportNames[0] ?? null) => ({
|
|
24
45
|
_tag: "Failed",
|
|
25
46
|
protocolVersion: DevToolsProtocol.protocolVersion,
|
|
@@ -58,12 +79,10 @@ const evaluateCandidate = (server, request, candidate) => Effect.tryPromise({
|
|
|
58
79
|
}), Effect.catch((cause) => Effect.succeed([failed(candidate, "module-load-failed", messageOf(cause))])));
|
|
59
80
|
const handle = (server, request) => Effect.forEach(request.candidates, (candidate) => evaluateCandidate(server, request, candidate), {
|
|
60
81
|
concurrency: 1
|
|
61
|
-
}).pipe(Effect.map((results) => ({ results: results.flat() })));
|
|
62
|
-
export const run = (server) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}).pipe(Effect.provide(NodeWorkerRunner.layer), Effect.runPromise);
|
|
68
|
-
};
|
|
82
|
+
}).pipe(Effect.map((results) => ({ _tag: "InspectedMachines", results: results.flat() })));
|
|
83
|
+
export const run = (server) => Effect.gen(function* () {
|
|
84
|
+
const platform = yield* WorkerRunner.WorkerRunnerPlatform;
|
|
85
|
+
const runner = yield* platform.start();
|
|
86
|
+
yield* runner.run((_portId, request) => Effect.flatMap(handle(server, request), (value) => runner.send(0, value)));
|
|
87
|
+
}).pipe(Effect.provide(NodeWorkerRunner.layer), Effect.runPromise);
|
|
69
88
|
//# sourceMappingURL=evaluationWorker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluationWorker.js","sourceRoot":"","sources":["../../src/internal/evaluationWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"evaluationWorker.js","sourceRoot":"","sources":["../../src/internal/evaluationWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AAkBxD,MAAM,SAAS,GAAG,CAAC,KAAc,EAAgC,EAAE,CACjE,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,YAAY,IAAI,KAAK;IACrB,UAAU,IAAI,KAAK;IACnB,mBAAmB,IAAI,KAAK;IAC5B,SAAS,IAAI,KAAK,CAAA;AAEpB,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,UAAyB,EAA0B,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;AAE5G,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ,IAAY,EACZ,OAAe,EACc,EAAE,CAAC,CAAC;IACjC,QAAQ,EAAE,OAAO;IACjB,IAAI;IACJ,OAAO;IACP,QAAQ,EAAE,EAAE,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AM,CAAC,UAAU,CAClB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machineDocument.d.ts","sourceRoot":"","sources":["../../src/internal/machineDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"machineDocument.d.ts","sourceRoot":"","sources":["../../src/internal/machineDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAElD,OAAO,KAAK,KAAK,MAAM,MAAM,uBAAuB,CAAA;AAoHpD,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,OAAO,CAAC,OAAO,CAAC,GAAG,EAChD,SAAS,CAAC,EACV,UAAS,MAAM,CAAC,WAAW,CAAC,CAAC,CAAM,KAClC,MAAM,CAAC,eA2FT,CAAA"}
|
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
import { Machine } from "@typeonce/effect-machine";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
2
3
|
const enabled = Machine.enabled;
|
|
4
|
+
const inputEventSchemas = Machine.inputEventSchemas;
|
|
5
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
|
+
const resolveReference = (value, definitions) => {
|
|
7
|
+
if (!isRecord(value))
|
|
8
|
+
return undefined;
|
|
9
|
+
if (typeof value.$ref !== "string" || !value.$ref.startsWith("#/$defs/"))
|
|
10
|
+
return value;
|
|
11
|
+
const name = decodeURIComponent(value.$ref.slice("#/$defs/".length));
|
|
12
|
+
const target = definitions[name];
|
|
13
|
+
return isRecord(target) ? target : undefined;
|
|
14
|
+
};
|
|
15
|
+
const tagsOf = (value, definitions) => {
|
|
16
|
+
const schema = resolveReference(value, definitions);
|
|
17
|
+
if (schema === undefined || !isRecord(schema.properties))
|
|
18
|
+
return [];
|
|
19
|
+
const tag = resolveReference(schema.properties._tag, definitions);
|
|
20
|
+
if (tag === undefined)
|
|
21
|
+
return [];
|
|
22
|
+
if (typeof tag.const === "string" || typeof tag.const === "number")
|
|
23
|
+
return [String(tag.const)];
|
|
24
|
+
return Array.isArray(tag.enum)
|
|
25
|
+
? tag.enum.filter((item) => typeof item === "string" || typeof item === "number").map(String)
|
|
26
|
+
: [];
|
|
27
|
+
};
|
|
28
|
+
const inputSchema = (schema) => {
|
|
29
|
+
const document = Schema.toJsonSchemaDocument(schema);
|
|
30
|
+
return {
|
|
31
|
+
dialect: document.dialect,
|
|
32
|
+
schema: document.schema,
|
|
33
|
+
definitions: document.definitions
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const eventInputs = (machine) => {
|
|
37
|
+
const inputs = [];
|
|
38
|
+
for (const eventSchema of inputEventSchemas(machine)) {
|
|
39
|
+
const document = inputSchema(eventSchema);
|
|
40
|
+
const root = document.schema;
|
|
41
|
+
const record = isRecord(root) ? root : undefined;
|
|
42
|
+
const variants = record !== undefined && Array.isArray(record.anyOf)
|
|
43
|
+
? record.anyOf
|
|
44
|
+
: record !== undefined && Array.isArray(record.oneOf)
|
|
45
|
+
? record.oneOf
|
|
46
|
+
: [root];
|
|
47
|
+
for (const variant of variants) {
|
|
48
|
+
for (const event of tagsOf(variant, document.definitions)) {
|
|
49
|
+
inputs.push({
|
|
50
|
+
event,
|
|
51
|
+
schema: { ...document, schema: variant }
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return inputs;
|
|
57
|
+
};
|
|
3
58
|
const selection = (value) => ({
|
|
4
59
|
path: value.path ?? null,
|
|
5
60
|
kind: value.kind,
|
|
@@ -85,7 +140,7 @@ export const make = (machine, options = {}) => {
|
|
|
85
140
|
});
|
|
86
141
|
const initial = Machine.initialDefinition(machine);
|
|
87
142
|
return {
|
|
88
|
-
schemaVersion:
|
|
143
|
+
schemaVersion: 3,
|
|
89
144
|
revision: options.revision ?? 0,
|
|
90
145
|
source: options.source ?? null,
|
|
91
146
|
machineId: machine.id ?? "Machine",
|
|
@@ -106,16 +161,24 @@ export const make = (machine, options = {}) => {
|
|
|
106
161
|
parent: node.parent ?? null,
|
|
107
162
|
children: [...childPaths.get(node.path) ?? []],
|
|
108
163
|
initial: node.initial ?? null,
|
|
164
|
+
valueSchema: node.schema === undefined ? null : inputSchema(node.schema),
|
|
165
|
+
outputSchema: node.output === undefined ? null : inputSchema(node.output),
|
|
109
166
|
transitionIds: [...transitionIds.get(node.path) ?? []],
|
|
110
167
|
activityIds: [...activityIds.get(node.path) ?? []]
|
|
111
168
|
})),
|
|
112
169
|
transitions,
|
|
113
170
|
activities,
|
|
171
|
+
inputs: {
|
|
172
|
+
machine: machine.input === undefined ? null : inputSchema(machine.input),
|
|
173
|
+
events: eventInputs(machine)
|
|
174
|
+
},
|
|
114
175
|
snapshot: options.snapshot === undefined
|
|
115
176
|
? null
|
|
116
177
|
: {
|
|
117
178
|
activePaths: Machine.configuration(machine, options.snapshot).map((node) => node.path),
|
|
118
|
-
candidateEvents: enabled(machine, options.snapshot)
|
|
179
|
+
candidateEvents: enabled(machine, options.snapshot)
|
|
180
|
+
.map(String)
|
|
181
|
+
.filter((event) => Object.hasOwn(machine.events, event))
|
|
119
182
|
}
|
|
120
183
|
};
|
|
121
184
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machineDocument.js","sourceRoot":"","sources":["../../src/internal/machineDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"machineDocument.js","sourceRoot":"","sources":["../../src/internal/machineDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,MAAM,OAAO,GAAG,OAAO,CAAC,OAGO,CAAA;AAE/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAEc,CAAA;AAEhD,MAAM,QAAQ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AI,EAAE,CAAC;YACtD,WAAW,EAAE,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SACnD,CAAC,CAAC;QACH,WAAW;QACX,UAAU;QACV,MAAM,EAAE;YACN,OAAO,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;YACxE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC;SAC7B;QACD,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,SAAS;YACtC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC;gBACA,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;gBACtF,eAAe,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;qBAChD,GAAG,CAAC,MAAM,CAAC;qBACX,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;aAC3D;KACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Result from "effect/Result";
|
|
2
|
+
import type * as MachineDocument from "../MachineDocument.js";
|
|
3
|
+
import type * as MachineWalkthrough from "../MachineWalkthrough.js";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare const SessionTypeId: "@typeonce/effect-machine-devtools/MachineWalkthrough/Session";
|
|
6
|
+
interface PublicApi {
|
|
7
|
+
readonly ChoiceNotFound: typeof MachineWalkthrough.ChoiceNotFound;
|
|
8
|
+
readonly ChoiceUnavailable: typeof MachineWalkthrough.ChoiceUnavailable;
|
|
9
|
+
readonly StepNotFound: typeof MachineWalkthrough.StepNotFound;
|
|
10
|
+
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const start: (document: MachineDocument.MachineDocument) => MachineWalkthrough.Session;
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const current: (self: MachineWalkthrough.Session) => MachineWalkthrough.Frame;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export declare const timeline: (self: MachineWalkthrough.Session) => ReadonlyArray<MachineWalkthrough.Frame>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const cursor: (self: MachineWalkthrough.Session) => number;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const choices: (self: MachineWalkthrough.Session) => ReadonlyArray<MachineWalkthrough.Choice>;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const take: (api: PublicApi) => (self: MachineWalkthrough.Session, choiceId: string) => Result.Result<MachineWalkthrough.Session, MachineWalkthrough.ChoiceNotFound | MachineWalkthrough.ChoiceUnavailable>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const seek: (api: PublicApi) => (self: MachineWalkthrough.Session, step: number) => Result.Result<MachineWalkthrough.Session, MachineWalkthrough.StepNotFound>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=machineWalkthrough.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machineWalkthrough.d.ts","sourceRoot":"","sources":["../../src/internal/machineWalkthrough.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,eAAe,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,KAAK,kBAAkB,MAAM,0BAA0B,CAAA;AAEnE,gBAAgB;AAChB,eAAO,MAAM,aAAa,EAAG,8DAAuE,CAAA;AA4BpG,UAAU,SAAS;IACjB,QAAQ,CAAC,cAAc,EAAE,OAAO,kBAAkB,CAAC,cAAc,CAAA;IACjE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,kB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