@mantaq/viz 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{embed-QX7vRXoL.mjs → embed-D3r1M511.mjs} +5 -0
- package/dist/page.mjs +1 -1
- package/dist/viewer.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,9 @@ The viewer keeps a cursor on one state, starting at the initial one. The panel l
|
|
|
18
18
|
|
|
19
19
|
Take a step with a panel button, by clicking a pulsing edge, or by clicking a state that exactly one next step reaches. An undetermined edge (`to: null`) offers each target its AST explanation names. Without one, it cannot be taken. A final state ends the walk. **Back** (or ←), **Reset** and the path list undo steps. The standalone page keeps the walk in the URL: `?step=` holds one edge id per step, plus `~target` for an undetermined edge.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
**Static walk** (standalone HTML, `mantaq-inspect --out`): nothing runs. The walk follows declarations, so guards are not evaluated, and a path may not happen at runtime. The logic is in `src/moves.ts`: `movesFrom`, `unhandledSends`, `decodePath`.
|
|
22
|
+
|
|
23
|
+
**Live** (the Vite plugin page, or `mountViewer(root, doc, { driver })`): steps run the real actor through `createDriver` from `@mantaq/inspect/drive`, so guards are evaluated. Timers advance by button, and **Back** replays the path from a fresh actor.
|
|
22
24
|
|
|
23
25
|
## Schema (v8)
|
|
24
26
|
|
|
@@ -33,7 +35,7 @@ Nothing runs. The walk follows declarations, so guards are not evaluated, and a
|
|
|
33
35
|
| `edge.to` | `null` = **undetermined**: only for actors that carry no `to` declarations |
|
|
34
36
|
| `edge.origin` | `declared` (builder `to`, vouched for by the type checker) · `probe` (synthetic traversal, undeclared actors) · `fuzz` (observed only while fuzzing) |
|
|
35
37
|
| `edge.explanation` | `null` (no handler: initial/effect, or AST not run) · `{ status: "analyzed", location, registration, branches, payloadReads, contextReads, contextWrites, readsActorState, comparisons, literals }` · `{ status: "not_analyzed", location, reason, snippet }` |
|
|
36
|
-
| `edge.doc` | leading JSDoc of the `m.on` / `m.onAny` call behind the edge; `null` = undocumented, no handler, or AST not run
|
|
38
|
+
| `edge.doc` | leading JSDoc of the `m.on` / `m.onAny` call behind the edge, or of the `m.effect` calls of the state for an `effect` edge (joined in order); `null` = undocumented, no handler, or AST not run |
|
|
37
39
|
| `machine.fuzz` | `null` or `{ seed, iterations, corpus: [{ steps, discovered }], errors: [{ from, event, message, steps }] }`; every sequence is shrunk and replayable from a fresh actor |
|
|
38
40
|
|
|
39
41
|
Bump `VIZ_SCHEMA_VERSION` on any breaking change. The validator accepts only the current version.
|
|
@@ -765,8 +765,13 @@ function effectsSection(doc, machine, current) {
|
|
|
765
765
|
if (effects.length === 0) return null;
|
|
766
766
|
const unhandled = unhandledSends(machine, current);
|
|
767
767
|
const isUnhandled = (effect, event) => unhandled.some((each) => each.effect === effect && each.event === event);
|
|
768
|
+
const effectDoc = machine.edges.find((edge) => edge.kind === "effect" && edge.from === current)?.doc;
|
|
768
769
|
return html(doc, "div", { class: "explore-effects" }, [
|
|
769
770
|
html(doc, "p", {}, [`Entering ${current} runs:`]),
|
|
771
|
+
docNote(doc, {
|
|
772
|
+
text: effectDoc ?? null,
|
|
773
|
+
scope: "edge"
|
|
774
|
+
}),
|
|
770
775
|
html(doc, "ul", {}, effects.map((effect) => {
|
|
771
776
|
const sends = effect.sends ?? [];
|
|
772
777
|
const summary = effect.sends === null ? html(doc, "span", { class: "muted" }, [" (sends not declared)"]) : sends.length === 0 ? " sends nothing" : " sends ";
|
package/dist/page.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./html-BfvuzJs6.mjs";
|
|
2
|
-
import { n as showIssues, t as mountVizText } from "./embed-
|
|
2
|
+
import { n as showIssues, t as mountVizText } from "./embed-D3r1M511.mjs";
|
|
3
3
|
// src/viewer/page.ts
|
|
4
4
|
/**
|
|
5
5
|
* Whole-page entries: a self-contained HTML file (`mountEmbedded`) and a live
|
package/dist/viewer.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as FUZZ_NOTE, i as STRUCTURE_BANNER, a as mountViewer, t as mountVizText, n as showIssues } from "./embed-
|
|
1
|
+
export { r as FUZZ_NOTE, i as STRUCTURE_BANNER, a as mountViewer, t as mountVizText, n as showIssues } from "./embed-D3r1M511.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantaq/viz",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Draw and walk a Mantaq machine in the browser, from a versioned, deterministic JSON document.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@dagrejs/dagre": "^3.1.2",
|
|
32
|
-
"@mantaq/utils": "0.0.
|
|
32
|
+
"@mantaq/utils": "0.0.5"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|