@tinyactors/scxmljs 0.1.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/THIRD_PARTY_NOTICES +63 -0
  4. package/dist/bridge.d.ts +44 -0
  5. package/dist/bridge.js +254 -0
  6. package/dist/bridge.js.map +1 -0
  7. package/dist/clock.d.ts +113 -0
  8. package/dist/clock.js +310 -0
  9. package/dist/clock.js.map +1 -0
  10. package/dist/common.d.ts +15 -0
  11. package/dist/common.js +14 -0
  12. package/dist/common.js.map +1 -0
  13. package/dist/datamodel-base.d.ts +122 -0
  14. package/dist/datamodel-base.js +268 -0
  15. package/dist/datamodel-base.js.map +1 -0
  16. package/dist/datamodel-quickjs.d.ts +21 -0
  17. package/dist/datamodel-quickjs.js +286 -0
  18. package/dist/datamodel-quickjs.js.map +1 -0
  19. package/dist/datamodel-trusted.d.ts +1 -0
  20. package/dist/datamodel-trusted.js +149 -0
  21. package/dist/datamodel-trusted.js.map +1 -0
  22. package/dist/diagnostics.d.ts +39 -0
  23. package/dist/diagnostics.js +154 -0
  24. package/dist/diagnostics.js.map +1 -0
  25. package/dist/element-events.d.ts +85 -0
  26. package/dist/element-events.js +129 -0
  27. package/dist/element-events.js.map +1 -0
  28. package/dist/events.d.ts +31 -0
  29. package/dist/events.js +33 -0
  30. package/dist/events.js.map +1 -0
  31. package/dist/explorer/element.d.ts +150 -0
  32. package/dist/explorer/element.js +1791 -0
  33. package/dist/explorer/element.js.map +1 -0
  34. package/dist/explorer/layout.d.ts +43 -0
  35. package/dist/explorer/layout.js +50 -0
  36. package/dist/explorer/layout.js.map +1 -0
  37. package/dist/explorer/strings.d.ts +275 -0
  38. package/dist/explorer/strings.js +135 -0
  39. package/dist/explorer/strings.js.map +1 -0
  40. package/dist/explorer/styles.d.ts +10 -0
  41. package/dist/explorer/styles.js +265 -0
  42. package/dist/explorer/styles.js.map +1 -0
  43. package/dist/explorer/viewmodel.d.ts +284 -0
  44. package/dist/explorer/viewmodel.js +481 -0
  45. package/dist/explorer/viewmodel.js.map +1 -0
  46. package/dist/explorer.d.ts +21 -0
  47. package/dist/explorer.js +22 -0
  48. package/dist/explorer.js.map +1 -0
  49. package/dist/index.d.ts +34 -0
  50. package/dist/index.js +39 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/model.d.ts +157 -0
  53. package/dist/model.js +485 -0
  54. package/dist/model.js.map +1 -0
  55. package/dist/session-events.d.ts +136 -0
  56. package/dist/session-events.js +114 -0
  57. package/dist/session-events.js.map +1 -0
  58. package/dist/session.d.ts +412 -0
  59. package/dist/session.js +1399 -0
  60. package/dist/session.js.map +1 -0
  61. package/dist/themes/tinyactors.css +44 -0
  62. package/dist/trusted.d.ts +15 -0
  63. package/dist/trusted.js +30 -0
  64. package/dist/trusted.js.map +1 -0
  65. package/dist/ui/announcer.d.ts +22 -0
  66. package/dist/ui/announcer.js +31 -0
  67. package/dist/ui/announcer.js.map +1 -0
  68. package/dist/ui/svg.d.ts +8 -0
  69. package/dist/ui/svg.js +29 -0
  70. package/dist/ui/svg.js.map +1 -0
  71. package/dist/ui/theme.d.ts +34 -0
  72. package/dist/ui/theme.js +151 -0
  73. package/dist/ui/theme.js.map +1 -0
  74. package/dist/view/element.d.ts +172 -0
  75. package/dist/view/element.js +1045 -0
  76. package/dist/view/element.js.map +1 -0
  77. package/dist/view/layout.d.ts +154 -0
  78. package/dist/view/layout.js +1122 -0
  79. package/dist/view/layout.js.map +1 -0
  80. package/dist/view/strings.d.ts +72 -0
  81. package/dist/view/strings.js +48 -0
  82. package/dist/view/strings.js.map +1 -0
  83. package/dist/view/styles.d.ts +1 -0
  84. package/dist/view/styles.js +115 -0
  85. package/dist/view/styles.js.map +1 -0
  86. package/dist/view.d.ts +20 -0
  87. package/dist/view.js +21 -0
  88. package/dist/view.js.map +1 -0
  89. package/package.json +87 -0
@@ -0,0 +1,481 @@
1
+ /**
2
+ * Explorer view-model: everything the explorer shows, computed as plain data
3
+ * from compiled models and live sessions. No DOM, no rendering — so it is
4
+ * testable, and any renderer (this prototype, a React one…) can use it.
5
+ *
6
+ * System — machines (the root session and its invoked children, recursively),
7
+ * external services (I/O processors), and who talks to whom.
8
+ * Tree — the state hierarchy of one machine, flattened to visible rows.
9
+ * Focus — one compound state: its children, the transitions between them
10
+ * (merged per pair), and "doors" in and out of the focus.
11
+ * Events — what the machine accepts right now, scoped to the focus.
12
+ *
13
+ * Everything is built for large charts: lists are flattened / grouped so a UI
14
+ * can window or collapse them, and nothing is O(n²) in the chart size.
15
+ */
16
+ import { realClock } from "../clock.js";
17
+ import { nameMatch, SCXML_IOPROCESSOR } from "../events.js";
18
+ import { isAtomic, isCompound, isDescendant } from "../model.js";
19
+ // ───────────────────────────────── helpers ─────────────────────────────────
20
+ /** Is `s` the state `ancestor` or inside it? */
21
+ export function within(s, ancestor) {
22
+ return s === ancestor || isDescendant(s, ancestor);
23
+ }
24
+ /** The child of `focus` that contains `s` (or undefined if `s` is not strictly inside `focus`). */
25
+ export function childContaining(focus, s) {
26
+ let n = s;
27
+ while (n && n.parent !== focus)
28
+ n = n.parent;
29
+ return n ?? undefined;
30
+ }
31
+ /** A display label: anonymous states get a readable stand-in. */
32
+ export function label(s) {
33
+ if (s.kind === "scxml")
34
+ return s.element.getAttribute("name") || "machine";
35
+ return s.generatedId ? `(${s.kind})` : s.id;
36
+ }
37
+ /** Ancestors from the root down to `s` (inclusive), for breadcrumbs. */
38
+ export function pathTo(s) {
39
+ const out = [];
40
+ for (let n = s; n; n = n.parent)
41
+ out.unshift(n);
42
+ return out;
43
+ }
44
+ /** How many states are nested inside `s`, at any depth. */
45
+ export function descendantCount(s) {
46
+ let n = 0;
47
+ const walk = (x) => {
48
+ for (const c of x.children) {
49
+ n++;
50
+ walk(c);
51
+ }
52
+ };
53
+ walk(s);
54
+ return n;
55
+ }
56
+ /** States that can be a focus: the root, compound states and parallel states. */
57
+ export function isContainer(s) {
58
+ return s.kind === "scxml" || s.kind === "parallel" || isCompound(s);
59
+ }
60
+ /**
61
+ * Tracks the whole system of one root session: invoked children (recursively,
62
+ * as they appear), external services, and message traffic between them.
63
+ * Fires "change" (debounced to one per task) whenever something changes.
64
+ * Timestamps come from the session clock, so "recent" stays right when a
65
+ * PlaybackClock is paused, stepped or sped up.
66
+ */
67
+ export class SystemTracker extends EventTarget {
68
+ root;
69
+ /** Macrosteps taken by any machine in the system (for stepping). */
70
+ stepCount = 0;
71
+ /** What the most recent macrostep of any machine did. */
72
+ lastStep;
73
+ /** Every machine seen so far, by session id (terminated ones stay, with status `done`). */
74
+ machines = new Map();
75
+ /** The external services, by type URI. */
76
+ services = new Map();
77
+ /** Links by `from→to` key. */
78
+ links = new Map();
79
+ byAlias = new Map();
80
+ /** The time source for traffic timestamps. */
81
+ clock;
82
+ pending = false;
83
+ stops = [];
84
+ /**
85
+ * @param root the root session; children are tracked as they're invoked
86
+ * @param processors the I/O processors the session was created with
87
+ */
88
+ constructor(
89
+ /** The root session. */
90
+ root, processors = [], opts = {}) {
91
+ super();
92
+ this.root = root;
93
+ this.clock = opts.clock ?? root.clock ?? realClock;
94
+ for (const p of processors) {
95
+ const info = { key: p.type, label: p.aliases?.[0] ?? p.type, processor: p };
96
+ this.services.set(p.type, info);
97
+ for (const k of [p.type, ...(p.aliases ?? [])])
98
+ this.byAlias.set(k, info);
99
+ }
100
+ this.track(root, 0);
101
+ }
102
+ /** Stop listening to every tracked session. */
103
+ dispose() {
104
+ for (const s of this.stops)
105
+ s();
106
+ this.stops = [];
107
+ }
108
+ /** Machines in invoke-tree order (parents before children). */
109
+ machineList() {
110
+ const out = [];
111
+ const walk = (parentKey) => {
112
+ for (const m of this.machines.values()) {
113
+ if (m.parentKey !== parentKey)
114
+ continue;
115
+ out.push(m);
116
+ walk(m.key);
117
+ }
118
+ };
119
+ walk(undefined);
120
+ return out;
121
+ }
122
+ /** Did messages flow over this link within the last `windowMs` of session time? */
123
+ isHot(link, windowMs = 1500) {
124
+ return link.lastAt > 0 && this.clock.now() - link.lastAt < windowMs;
125
+ }
126
+ /** Links touching a node, busiest first. */
127
+ linksOf(key) {
128
+ return [...this.links.values()].filter((l) => l.from === key || l.to === key).sort((a, b) => total(b) - total(a));
129
+ }
130
+ track(session, depth, parentKey, invokeid, invokedFrom) {
131
+ const key = session.sessionId;
132
+ const info = {
133
+ key,
134
+ session,
135
+ name: session.model.name || "machine",
136
+ depth,
137
+ parentKey,
138
+ invokeid,
139
+ invokedFrom,
140
+ status: session.status,
141
+ activeLeaves: [],
142
+ };
143
+ this.machines.set(key, info);
144
+ if (parentKey)
145
+ this.link(parentKey, key, "invoke", invokeid ? `invoke ${invokeid}` : "invoke", false);
146
+ this.declareSends(session);
147
+ let moves = [];
148
+ const onStep = (e) => {
149
+ this.stepCount++;
150
+ this.lastStep = { machine: info.name, event: e?.event?.name, moves };
151
+ moves = [];
152
+ refresh();
153
+ };
154
+ const refresh = () => {
155
+ info.status = session.status;
156
+ info.activeLeaves = session.configuration.filter(isAtomic).map(label);
157
+ this.changed();
158
+ };
159
+ const onSend = (e) => {
160
+ const m = e.message;
161
+ if (m.type === SCXML_IOPROCESSOR) {
162
+ if (m.target === "#_parent" && parentKey)
163
+ this.link(key, parentKey, "message", m.event, true);
164
+ else if (m.target.startsWith("#_") && m.target !== "#_internal") {
165
+ const child = [...this.machines.values()].find((c) => c.parentKey === key && c.invokeid === m.target.slice(2));
166
+ if (child)
167
+ this.link(key, child.key, "message", m.event, true);
168
+ }
169
+ }
170
+ else {
171
+ const svc = this.byAlias.get(m.type);
172
+ if (svc)
173
+ this.link(key, svc.key, "message", m.event, true);
174
+ }
175
+ };
176
+ const onMicro = (e) => {
177
+ for (const t of e.transitions)
178
+ moves.push(`${label(t.source)} → ${t.targets.map(label).join(", ") || "↺"}`);
179
+ const ev = e.event;
180
+ if (!ev?.origintype || ev.origintype === SCXML_IOPROCESSOR)
181
+ return;
182
+ const svc = this.byAlias.get(ev.origintype);
183
+ if (svc)
184
+ this.link(svc.key, key, "message", ev.name, true);
185
+ };
186
+ const onChild = (e) => {
187
+ const from = session.invocations.find((i) => i.invokeid === e.invokeid)?.state;
188
+ this.track(e.child, depth + 1, key, e.invokeid, from ? label(from) : undefined);
189
+ };
190
+ session.addEventListener("macrostep", onStep);
191
+ session.addEventListener("done", refresh);
192
+ session.addEventListener("send", onSend);
193
+ session.addEventListener("microstep", onMicro);
194
+ session.addEventListener("child", onChild);
195
+ this.stops.push(() => {
196
+ session.removeEventListener("macrostep", onStep);
197
+ session.removeEventListener("done", refresh);
198
+ session.removeEventListener("send", onSend);
199
+ session.removeEventListener("microstep", onMicro);
200
+ session.removeEventListener("child", onChild);
201
+ });
202
+ // children that already exist (tracker attached late)
203
+ for (const inv of session.invocations)
204
+ if (inv.session && !this.machines.has(inv.session.sessionId))
205
+ this.track(inv.session, depth + 1, key, inv.invokeid, label(inv.state));
206
+ refresh();
207
+ }
208
+ /** Static knowledge: which services / parents a chart sends to, before anything happened. */
209
+ declareSends(session) {
210
+ const key = session.sessionId;
211
+ for (const el of Array.from(session.model.root.element.getElementsByTagNameNS(session.model.ns, "send"))) {
212
+ const type = el.getAttribute("type");
213
+ const event = el.getAttribute("event") ?? "(dynamic)";
214
+ if (type && type !== "scxml" && type !== SCXML_IOPROCESSOR) {
215
+ const svc = this.byAlias.get(type);
216
+ if (svc)
217
+ this.link(key, svc.key, "message", event, false);
218
+ }
219
+ }
220
+ }
221
+ link(from, to, kind, event, observed) {
222
+ const id = `${from}→${to}`;
223
+ let l = this.links.get(id);
224
+ if (!l) {
225
+ l = { from, to, kind, observed: new Map(), declared: new Set(), lastAt: 0 };
226
+ this.links.set(id, l);
227
+ }
228
+ if (observed) {
229
+ l.observed.set(event, (l.observed.get(event) ?? 0) + 1);
230
+ l.lastAt = this.clock.now();
231
+ }
232
+ else
233
+ l.declared.add(event);
234
+ this.changed();
235
+ }
236
+ changed() {
237
+ if (this.pending)
238
+ return;
239
+ this.pending = true;
240
+ queueMicrotask(() => {
241
+ this.pending = false;
242
+ this.dispatchEvent(new Event("change"));
243
+ });
244
+ }
245
+ }
246
+ /** The number of messages observed on a link. */
247
+ export function total(l) {
248
+ let n = 0;
249
+ for (const c of l.observed.values())
250
+ n += c;
251
+ return n;
252
+ }
253
+ /** Flatten the hierarchy into the rows currently visible (for a windowed list). */
254
+ export function treeRows(model, opts) {
255
+ const q = opts.filter?.trim().toLowerCase();
256
+ const activePath = new Set();
257
+ for (const s of model.states)
258
+ if (opts.isActive(s))
259
+ for (let n = s; n; n = n.parent)
260
+ activePath.add(n);
261
+ // with a filter: keep matches and their ancestors, force-expanded
262
+ let keep;
263
+ const matches = new Set();
264
+ if (q) {
265
+ keep = new Set();
266
+ for (const s of model.states)
267
+ if (s.kind !== "scxml" && s.kind !== "history" && s.id.toLowerCase().includes(q)) {
268
+ matches.add(s);
269
+ for (let n = s; n; n = n.parent)
270
+ keep.add(n);
271
+ }
272
+ }
273
+ const rows = [];
274
+ const walk = (s, depth) => {
275
+ for (const c of s.children) {
276
+ if (keep && !keep.has(c))
277
+ continue;
278
+ if (opts.activeOnly && !activePath.has(c) && !activePath.has(s))
279
+ continue;
280
+ const expandable = c.children.length > 0;
281
+ const expanded = expandable && (keep ? true : opts.expanded.has(c));
282
+ rows.push({
283
+ node: c,
284
+ depth,
285
+ active: opts.isActive(c),
286
+ onActivePath: activePath.has(c),
287
+ expandable,
288
+ expanded,
289
+ childCount: c.children.length,
290
+ match: matches.has(c),
291
+ });
292
+ if (expanded)
293
+ walk(c, depth + 1);
294
+ }
295
+ };
296
+ walk(model.root, 0);
297
+ return rows;
298
+ }
299
+ /** The expansion that shows the active configuration and nothing else ("follow"). */
300
+ export function activeExpansion(model, isActive) {
301
+ const out = new Set();
302
+ for (const s of model.states)
303
+ if (isActive(s) && s.children.length)
304
+ out.add(s);
305
+ return out;
306
+ }
307
+ /**
308
+ * One level of the chart around a container: its children, the transitions
309
+ * between them (merged per pair of children, so the view never shows more
310
+ * than one arrow between two boxes), and "doors" for transitions crossing
311
+ * the boundary. Linear in the size of the chart.
312
+ */
313
+ export function focusScope(model, focus, isActive) {
314
+ const initial = new Set(focus.initial?.targets.map((t) => childContaining(focus, t) ?? t) ?? []);
315
+ const summaries = new Map();
316
+ for (const c of focus.children)
317
+ summaries.set(c, {
318
+ node: c,
319
+ active: isActive(c),
320
+ onActivePath: false,
321
+ initial: initial.has(c),
322
+ descendants: descendantCount(c),
323
+ internal: 0,
324
+ events: [],
325
+ invokes: 0,
326
+ });
327
+ for (const s of model.states) {
328
+ if (!isActive(s))
329
+ continue;
330
+ const c = childContaining(focus, s);
331
+ if (c)
332
+ summaries.get(c).onActivePath = true;
333
+ }
334
+ const edges = new Map();
335
+ const exits = new Map();
336
+ const entries = new Map();
337
+ const frame = [];
338
+ const eventSets = new Map();
339
+ for (const s of model.states) {
340
+ for (const t of s.transitions) {
341
+ const srcInside = within(s, focus);
342
+ const fromChild = s === focus ? undefined : childContaining(focus, s);
343
+ if (srcInside) {
344
+ const bucket = fromChild ? (eventSets.get(fromChild) ?? eventSets.set(fromChild, new Set()).get(fromChild)) : undefined;
345
+ for (const e of t.events)
346
+ bucket?.add(e);
347
+ if (!t.targets.length) {
348
+ if (fromChild)
349
+ summaries.get(fromChild).internal++;
350
+ else
351
+ frame.push(t);
352
+ continue;
353
+ }
354
+ for (const target of t.targets) {
355
+ if (within(target, focus) && target !== focus) {
356
+ const toChild = childContaining(focus, target);
357
+ if (!fromChild)
358
+ frame.push(t);
359
+ else if (toChild === fromChild)
360
+ summaries.get(fromChild).internal++;
361
+ else
362
+ addEdge(edges, fromChild, toChild, t);
363
+ }
364
+ else {
365
+ const door = exits.get(target) ??
366
+ exits.set(target, { other: target, child: fromChild ?? focus, transitions: [], events: [] }).get(target);
367
+ door.transitions.push(t);
368
+ for (const e of t.events.length ? t.events : ["ε"])
369
+ if (!door.events.includes(e))
370
+ door.events.push(e);
371
+ }
372
+ }
373
+ }
374
+ else {
375
+ for (const target of t.targets) {
376
+ if (!within(target, focus) || target === focus)
377
+ continue;
378
+ const toChild = childContaining(focus, target);
379
+ if (!toChild)
380
+ continue;
381
+ const key = `${s.id}→${toChild.id}`;
382
+ const door = entries.get(key) ?? entries.set(key, { other: s, child: toChild, transitions: [], events: [] }).get(key);
383
+ door.transitions.push(t);
384
+ for (const e of t.events.length ? t.events : ["ε"])
385
+ if (!door.events.includes(e))
386
+ door.events.push(e);
387
+ }
388
+ }
389
+ }
390
+ }
391
+ for (const c of focus.children) {
392
+ const sum = summaries.get(c);
393
+ sum.events = [...(eventSets.get(c) ?? [])].sort();
394
+ let inv = 0;
395
+ const walk = (x) => {
396
+ inv += x.invokes.length;
397
+ for (const k of x.children)
398
+ walk(k);
399
+ };
400
+ walk(c);
401
+ sum.invokes = inv;
402
+ }
403
+ const byCount = (a, b) => b.transitions.length - a.transitions.length;
404
+ return {
405
+ focus,
406
+ children: [...summaries.values()],
407
+ edges: [...edges.values()],
408
+ exits: [...exits.values()].sort(byCount),
409
+ entries: [...entries.values()].sort(byCount),
410
+ frame,
411
+ };
412
+ }
413
+ function addEdge(edges, from, to, t) {
414
+ const key = `${from.id}→${to.id}`;
415
+ const e = edges.get(key) ?? edges.set(key, { from, to, transitions: [], events: [] }).get(key);
416
+ e.transitions.push(t);
417
+ for (const ev of t.events.length ? t.events : ["ε"])
418
+ if (!e.events.includes(ev))
419
+ e.events.push(ev);
420
+ }
421
+ /**
422
+ * Where "follow" should look: the lowest container that holds every active
423
+ * leaf. One active leaf → its parent; parallel regions → the parallel state,
424
+ * whose lanes show all of them at once instead of jumping between regions.
425
+ */
426
+ export function followTarget(configuration, current) {
427
+ const leaves = configuration.filter(isAtomic);
428
+ if (!leaves.length)
429
+ return current;
430
+ let lca = leaves[0].parent;
431
+ while (lca && !leaves.every((l) => isDescendant(l, lca)))
432
+ lca = lca.parent;
433
+ return lca && isContainer(lca) ? lca : current;
434
+ }
435
+ /**
436
+ * Events the machine accepts in its current configuration: descriptors on
437
+ * transitions of active states (conditions are shown, not evaluated — that
438
+ * could have side effects). Scoped relative to the focus:
439
+ * here — the source is inside the focus
440
+ * inherited — the source is an ancestor of the focus (it applies here too)
441
+ * elsewhere — other active parts (e.g. parallel regions outside the focus)
442
+ */
443
+ export function acceptedEvents(session, focus) {
444
+ const byKey = new Map();
445
+ const rank = { here: 0, inherited: 1, elsewhere: 2 };
446
+ const active = session.configuration.sort((a, b) => b.depth - a.depth);
447
+ for (const s of active) {
448
+ const scope = within(s, focus) ? "here" : isDescendant(focus, s) ? "inherited" : "elsewhere";
449
+ for (const t of s.transitions) {
450
+ for (const d of t.events) {
451
+ if (d.startsWith("done.") || d.startsWith("error."))
452
+ continue;
453
+ const ev = byKey.get(d) ?? byKey.set(d, { descriptor: d, scope, transitions: [] }).get(d);
454
+ if (rank[scope] < rank[ev.scope])
455
+ ev.scope = scope;
456
+ ev.transitions.push({ transition: t, source: s, guarded: !!t.cond, targets: t.targets });
457
+ }
458
+ }
459
+ }
460
+ return [...byKey.values()].sort((a, b) => rank[a.scope] - rank[b.scope] || a.descriptor.localeCompare(b.descriptor));
461
+ }
462
+ /** Group by the first dotted token ("github.comment.*" → "github"), keeping order. */
463
+ export function groupEvents(events) {
464
+ const groups = new Map();
465
+ for (const e of events) {
466
+ const prefix = e.descriptor.includes(".") ? e.descriptor.split(".")[0] : "·";
467
+ (groups.get(prefix) ?? groups.set(prefix, { prefix, events: [] }).get(prefix)).events.push(e);
468
+ }
469
+ return [...groups.values()];
470
+ }
471
+ /** The concrete name to send for a descriptor ("github.comment.*" → "github.comment.done"; "*" → null). */
472
+ export function sendableName(descriptor) {
473
+ if (descriptor === "*")
474
+ return null;
475
+ return descriptor.endsWith(".*") ? `${descriptor.slice(0, -2)}.done` : descriptor;
476
+ }
477
+ /** Would sending `name` be handled by some active state? (ignores conditions) */
478
+ export function wouldAccept(session, name) {
479
+ return session.configuration.some((s) => s.transitions.some((t) => t.events.length && nameMatch(t.events, name)));
480
+ }
481
+ //# sourceMappingURL=viewmod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,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,IAAI,UAAU,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;AACpF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,IAAY;IACxD,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACpH,CAAC","sourcesContent":["/**\n * Explorer view-model: everything the explorer shows, computed as plain data\n * from compiled models and live sessions. No DOM, no rendering — so it is\n * testable, and any renderer (this prototype, a React one…) can use it.\n *\n * System — machines (the root session and its invoked children, recursively),\n * external services (I/O processors), and who talks to whom.\n * Tree — the state hierarchy of one machine, flattened to visible rows.\n * Focus — one compound state: its children, the transitions between them\n * (merged per pair), and \"doors\" in and out of the focus.\n * Events — what the machine accepts right now, scoped to the focus.\n *\n * Everything is built for large charts: lists are flattened / grouped so a UI\n * can window or collapse them, and nothing is O(n²) in the chart size.\n */\nimport { type Clock, realClock } from \"../clock.ts\";\nimport { nameMatch, SCXML_IOPROCESSOR } from \"../events.ts\";\nimport { isAtomic, isCompound, isDescendant, type Model, type StateNode, type TransitionNode } from \"../model.ts\";\n// types only: the explorer must never pull in a data model (and with it QuickJS)\nimport type { IOProcessor, SCXMLSession as Session } from \"../session.ts\";\n\n// ───────────────────────────────── helpers ─────────────────────────────────\n\n/** Is `s` the state `ancestor` or inside it? */\nexport function within(s: StateNode, ancestor: StateNode): boolean {\n return s === ancestor || isDescendant(s, ancestor);\n}\n\n/** The child of `focus` that contains `s` (or undefined if `s` is not strictly inside `focus`). */\nexport function childContaining(focus: StateNode, s: StateNode): StateNode | undefined {\n let n: StateNode | null = s;\n while (n && n.parent !== focus) n = n.parent;\n return n ?? undefined;\n}\n\n/** A display label: anonymous states get a readable stand-in. */\nexport function label(s: StateNode): string {\n if (s.kind === \"scxml\") return s.element.getAttribute(\"name\") || \"machine\";\n return s.generatedId ? `(${s.kind})` : s.id;\n}\n\n/** Ancestors from the root down to `s` (inclusive), for breadcrumbs. */\nexport function pathTo(s: StateNode): StateNode[] {\n const out: StateNode[] = [];\n for (let n: StateNode | null = s; n; n = n.parent) out.unshift(n);\n return out;\n}\n\n/** How many states are nested inside `s`, at any depth. */\nexport function descendantCount(s: StateNode): number {\n let n = 0;\n const walk = (x: StateNode) => {\n for (const c of x.children) {\n n++;\n walk(c);\n }\n };\n walk(s);\n return n;\n}\n\n/** States that can be a focus: the root, compound states and parallel states. */\nexport function isContainer(s: StateNode) {\n return s.kind === \"scxml\" || s.kind === \"parallel\" || isCompound(s);\n}\n\n// ───────────────────────────────── system ─────────────────────────────────\n\n/** One machine of the system: the root session or an invoked child. */\nexport interface MachineInfo {\n /** The session id (the key in `SystemTracker.machines`). */\n key: string;\n /** The session. */\n session: Session;\n /** The chart's `name` (or a fallback). */\n name: string;\n /** Invoke nesting: 0 for the root. */\n depth: number;\n /** The invoking machine's key, for children. */\n parentKey?: string;\n /** The invocation's id, for children. */\n invokeid?: string;\n /** the state that invoked it */\n invokedFrom?: string;\n /** The session's status. */\n status: \"idle\" | \"running\" | \"done\";\n /** Labels of the active atomic states. */\n activeLeaves: string[];\n}\n\n/** An external service: an I/O processor the system talks to. */\nexport interface ServiceInfo {\n /** The processor's type URI (the key in `SystemTracker.services`). */\n key: string;\n /** Its first alias, or the URI. */\n label: string;\n /** The processor. */\n processor: IOProcessor;\n}\n\n/** A connection between two machines, or a machine and a service. */\nexport interface SystemLink {\n /** Key of the sending side. */\n from: string;\n /** Key of the receiving side. */\n to: string;\n /** `invoke`: parent to child; `message`: events sent along it. */\n kind: \"invoke\" | \"message\";\n /** event name → count observed at run time */\n observed: Map<string, number>;\n /** event names declared in the charts (`<send>` with this target/type) */\n declared: Set<string>;\n /** Session-clock time of the last observed message (0 = never). */\n lastAt: number;\n}\n\n/** What the last macrostep of any machine did (for a playback bar). */\nexport interface StepInfo {\n /** The name of the machine that stepped. */\n machine: string;\n /** the event that triggered the macrostep (undefined for the initial step) */\n event?: string;\n /** \"source → target\" per transition taken */\n moves: string[];\n}\n\n/** Options for `SystemTracker`. */\nexport interface SystemTrackerOptions {\n /** Time source for traffic timestamps; defaults to the root session's clock. */\n clock?: Clock;\n}\n\n/**\n * Tracks the whole system of one root session: invoked children (recursively,\n * as they appear), external services, and message traffic between them.\n * Fires \"change\" (debounced to one per task) whenever something changes.\n * Timestamps come from the session clock, so \"recent\" stays right when a\n * PlaybackClock is paused, stepped or sped up.\n */\nexport class SystemTracker extends EventTarget {\n /** Macrosteps taken by any machine in the system (for stepping). */\n stepCount = 0;\n /** What the most recent macrostep of any machine did. */\n lastStep?: StepInfo;\n /** Every machine seen so far, by session id (terminated ones stay, with status `done`). */\n readonly machines = new Map<string, MachineInfo>();\n /** The external services, by type URI. */\n readonly services = new Map<string, ServiceInfo>();\n /** Links by `from→to` key. */\n readonly links = new Map<string, SystemLink>();\n private byAlias = new Map<string, ServiceInfo>();\n /** The time source for traffic timestamps. */\n readonly clock: Clock;\n private pending = false;\n private stops: (() => void)[] = [];\n\n /**\n * @param root the root session; children are tracked as they're invoked\n * @param processors the I/O processors the session was created with\n */\n constructor(\n /** The root session. */\n readonly root: Session,\n processors: IOProcessor[] = [],\n opts: SystemTrackerOptions = {},\n ) {\n super();\n this.clock = opts.clock ?? root.clock ?? realClock;\n for (const p of processors) {\n const info: ServiceInfo = { key: p.type, label: p.aliases?.[0] ?? p.type, processor: p };\n this.services.set(p.type, info);\n for (const k of [p.type, ...(p.aliases ?? [])]) this.byAlias.set(k, info);\n }\n this.track(root, 0);\n }\n\n /** Stop listening to every tracked session. */\n dispose() {\n for (const s of this.stops) s();\n this.stops = [];\n }\n\n /** Machines in invoke-tree order (parents before children). */\n machineList(): MachineInfo[] {\n const out: MachineInfo[] = [];\n const walk = (parentKey: string | undefined) => {\n for (const m of this.machines.values()) {\n if (m.parentKey !== parentKey) continue;\n out.push(m);\n walk(m.key);\n }\n };\n walk(undefined);\n return out;\n }\n\n /** Did messages flow over this link within the last `windowMs` of session time? */\n isHot(link: SystemLink, windowMs = 1500): boolean {\n return link.lastAt > 0 && this.clock.now() - link.lastAt < windowMs;\n }\n\n /** Links touching a node, busiest first. */\n linksOf(key: string): SystemLink[] {\n return [...this.links.values()].filter((l) => l.from === key || l.to === key).sort((a, b) => total(b) - total(a));\n }\n\n private track(session: Session, depth: number, parentKey?: string, invokeid?: string, invokedFrom?: string) {\n const key = session.sessionId;\n const info: MachineInfo = {\n key,\n session,\n name: session.model.name || \"machine\",\n depth,\n parentKey,\n invokeid,\n invokedFrom,\n status: session.status,\n activeLeaves: [],\n };\n this.machines.set(key, info);\n if (parentKey) this.link(parentKey, key, \"invoke\", invokeid ? `invoke ${invokeid}` : \"invoke\", false);\n this.declareSends(session);\n\n let moves: string[] = [];\n const onStep = (e?: { event?: { name: string } }) => {\n this.stepCount++;\n this.lastStep = { machine: info.name, event: e?.event?.name, moves };\n moves = [];\n refresh();\n };\n const refresh = () => {\n info.status = session.status;\n info.activeLeaves = session.configuration.filter(isAtomic).map(label);\n this.changed();\n };\n const onSend = (e: { message: { event: string; target: string; type: string } }) => {\n const m = e.message;\n if (m.type === SCXML_IOPROCESSOR) {\n if (m.target === \"#_parent\" && parentKey) this.link(key, parentKey, \"message\", m.event, true);\n else if (m.target.startsWith(\"#_\") && m.target !== \"#_internal\") {\n const child = [...this.machines.values()].find((c) => c.parentKey === key && c.invokeid === m.target.slice(2));\n if (child) this.link(key, child.key, \"message\", m.event, true);\n }\n } else {\n const svc = this.byAlias.get(m.type);\n if (svc) this.link(key, svc.key, \"message\", m.event, true);\n }\n };\n const onMicro = (e: { event?: { name: string; origintype?: string }; transitions: { source: StateNode; targets: StateNode[] }[] }) => {\n for (const t of e.transitions) moves.push(`${label(t.source)} → ${t.targets.map(label).join(\", \") || \"↺\"}`);\n const ev = e.event;\n if (!ev?.origintype || ev.origintype === SCXML_IOPROCESSOR) return;\n const svc = this.byAlias.get(ev.origintype);\n if (svc) this.link(svc.key, key, \"message\", ev.name, true);\n };\n const onChild = (e: { invokeid: string; child: Session }) => {\n const from = session.invocations.find((i) => i.invokeid === e.invokeid)?.state;\n this.track(e.child, depth + 1, key, e.invokeid, from ? label(from) : undefined);\n };\n session.addEventListener(\"macrostep\", onStep as never);\n session.addEventListener(\"done\", refresh);\n session.addEventListener(\"send\", onSend as never);\n session.addEventListener(\"microstep\", onMicro as never);\n session.addEventListener(\"child\", onChild as never);\n this.stops.push(() => {\n session.removeEventListener(\"macrostep\", onStep as never);\n session.removeEventListener(\"done\", refresh);\n session.removeEventListener(\"send\", onSend as never);\n session.removeEventListener(\"microstep\", onMicro as never);\n session.removeEventListener(\"child\", onChild as never);\n });\n // children that already exist (tracker attached late)\n for (const inv of session.invocations)\n if (inv.session && !this.machines.has(inv.session.sessionId)) this.track(inv.session, depth + 1, key, inv.invokeid, label(inv.state));\n refresh();\n }\n\n /** Static knowledge: which services / parents a chart sends to, before anything happened. */\n private declareSends(session: Session) {\n const key = session.sessionId;\n for (const el of Array.from(session.model.root.element.getElementsByTagNameNS(session.model.ns, \"send\"))) {\n const type = el.getAttribute(\"type\");\n const event = el.getAttribute(\"event\") ?? \"(dynamic)\";\n if (type && type !== \"scxml\" && type !== SCXML_IOPROCESSOR) {\n const svc = this.byAlias.get(type);\n if (svc) this.link(key, svc.key, \"message\", event, false);\n }\n }\n }\n\n private link(from: string, to: string, kind: SystemLink[\"kind\"], event: string, observed: boolean) {\n const id = `${from}→${to}`;\n let l = this.links.get(id);\n if (!l) {\n l = { from, to, kind, observed: new Map(), declared: new Set(), lastAt: 0 };\n this.links.set(id, l);\n }\n if (observed) {\n l.observed.set(event, (l.observed.get(event) ?? 0) + 1);\n l.lastAt = this.clock.now();\n } else l.declared.add(event);\n this.changed();\n }\n\n private changed() {\n if (this.pending) return;\n this.pending = true;\n queueMicrotask(() => {\n this.pending = false;\n this.dispatchEvent(new Event(\"change\"));\n });\n }\n}\n\n/** The number of messages observed on a link. */\nexport function total(l: SystemLink) {\n let n = 0;\n for (const c of l.observed.values()) n += c;\n return n;\n}\n\n// ────────────────────────────────── tree ──────────────────────────────────\n\n/** One visible row of the state tree. */\nexport interface TreeRow {\n /** the state */\n node: StateNode;\n /** indentation level (children of the root are 0) */\n depth: number;\n /** the state itself is active */\n active: boolean;\n /** some descendant is active */\n onActivePath: boolean;\n /** it has child states */\n expandable: boolean;\n /** its children are shown */\n expanded: boolean;\n /** number of direct child states */\n childCount: number;\n /** matches the search text */\n match: boolean;\n}\n\n/** Input to `treeRows`. */\nexport interface TreeOptions {\n /** containers whose children are shown */\n expanded: Set<StateNode>;\n /** whether a state is active (usually `session.isActiveNode`) */\n isActive: (s: StateNode) => boolean;\n /** case-insensitive substring over ids; shows matches and their ancestors */\n filter?: string;\n /** only rows on the active path (and their direct children) */\n activeOnly?: boolean;\n}\n\n/** Flatten the hierarchy into the rows currently visible (for a windowed list). */\nexport function treeRows(model: Model, opts: TreeOptions): TreeRow[] {\n const q = opts.filter?.trim().toLowerCase();\n const activePath = new Set<StateNode>();\n for (const s of model.states) if (opts.isActive(s)) for (let n: StateNode | null = s; n; n = n.parent) activePath.add(n);\n\n // with a filter: keep matches and their ancestors, force-expanded\n let keep: Set<StateNode> | undefined;\n const matches = new Set<StateNode>();\n if (q) {\n keep = new Set();\n for (const s of model.states)\n if (s.kind !== \"scxml\" && s.kind !== \"history\" && s.id.toLowerCase().includes(q)) {\n matches.add(s);\n for (let n: StateNode | null = s; n; n = n.parent) keep.add(n);\n }\n }\n\n const rows: TreeRow[] = [];\n const walk = (s: StateNode, depth: number) => {\n for (const c of s.children) {\n if (keep && !keep.has(c)) continue;\n if (opts.activeOnly && !activePath.has(c) && !activePath.has(s)) continue;\n const expandable = c.children.length > 0;\n const expanded = expandable && (keep ? true : opts.expanded.has(c));\n rows.push({\n node: c,\n depth,\n active: opts.isActive(c),\n onActivePath: activePath.has(c),\n expandable,\n expanded,\n childCount: c.children.length,\n match: matches.has(c),\n });\n if (expanded) walk(c, depth + 1);\n }\n };\n walk(model.root, 0);\n return rows;\n}\n\n/** The expansion that shows the active configuration and nothing else (\"follow\"). */\nexport function activeExpansion(model: Model, isActive: (s: StateNode) => boolean): Set<StateNode> {\n const out = new Set<StateNode>();\n for (const s of model.states) if (isActive(s) && s.children.length) out.add(s);\n return out;\n}\n\n// ────────────────────────────────── focus ─────────────────────────────────\n\n/** The transitions between two children of the focus, merged into one arrow. */\nexport interface FocusEdge {\n /** the child the transitions start in */\n from: StateNode;\n /** the child they lead into */\n to: StateNode;\n /** every transition merged into this edge */\n transitions: TransitionNode[];\n /** their distinct event descriptors (`ε` for eventless) */\n events: string[];\n}\n\n/** Transitions crossing the focus boundary, grouped by the state outside. */\nexport interface Door {\n /** outside state (exits: target; entries: source) */\n other: StateNode;\n /** the child of the focus involved (exits: source child or the focus itself; entries: target child) */\n child: StateNode;\n /** every transition through this door */\n transitions: TransitionNode[];\n /** their distinct event descriptors */\n events: string[];\n}\n\n/** A child of the focus, as the focus view shows it. */\nexport interface ChildSummary {\n /** the child state */\n node: StateNode;\n /** the child itself is active */\n active: boolean;\n /** it or a descendant is active */\n onActivePath: boolean;\n /** it is (or contains) the focus's initial state */\n initial: boolean;\n /** number of states nested inside it */\n descendants: number;\n /** transitions whose source is inside this child and that stay inside it */\n internal: number;\n /** distinct events this child reacts to (anywhere inside it) */\n events: string[];\n /** `<invoke>`s inside it, at any depth */\n invokes: number;\n}\n\n/** Everything the focus view shows for one container state. */\nexport interface FocusScope {\n /** the focused container (`<scxml>`, compound or parallel) */\n focus: StateNode;\n /** its children, document order */\n children: ChildSummary[];\n /** transitions between children, merged per pair */\n edges: FocusEdge[];\n /** transitions leaving the focus, by target */\n exits: Door[];\n /** transitions entering the focus from outside, by source and target child */\n entries: Door[];\n /** transitions on the focus state itself that keep us inside (targetless or to a child) */\n frame: TransitionNode[];\n}\n\n/**\n * One level of the chart around a container: its children, the transitions\n * between them (merged per pair of children, so the view never shows more\n * than one arrow between two boxes), and \"doors\" for transitions crossing\n * the boundary. Linear in the size of the chart.\n */\nexport function focusScope(model: Model, focus: StateNode, isActive: (s: StateNode) => boolean): FocusScope {\n const initial = new Set(focus.initial?.targets.map((t) => childContaining(focus, t) ?? t) ?? []);\n const summaries = new Map<StateNode, ChildSummary>();\n for (const c of focus.children)\n summaries.set(c, {\n node: c,\n active: isActive(c),\n onActivePath: false,\n initial: initial.has(c),\n descendants: descendantCount(c),\n internal: 0,\n events: [],\n invokes: 0,\n });\n for (const s of model.states) {\n if (!isActive(s)) continue;\n const c = childContaining(focus, s);\n if (c) summaries.get(c)!.onActivePath = true;\n }\n\n const edges = new Map<string, FocusEdge>();\n const exits = new Map<StateNode, Door>();\n const entries = new Map<string, Door>();\n const frame: TransitionNode[] = [];\n const eventSets = new Map<StateNode, Set<string>>();\n\n for (const s of model.states) {\n for (const t of s.transitions) {\n const srcInside = within(s, focus);\n const fromChild = s === focus ? undefined : childContaining(focus, s);\n if (srcInside) {\n const bucket = fromChild ? (eventSets.get(fromChild) ?? eventSets.set(fromChild, new Set()).get(fromChild)!) : undefined;\n for (const e of t.events) bucket?.add(e);\n if (!t.targets.length) {\n if (fromChild) summaries.get(fromChild)!.internal++;\n else frame.push(t);\n continue;\n }\n for (const target of t.targets) {\n if (within(target, focus) && target !== focus) {\n const toChild = childContaining(focus, target)!;\n if (!fromChild) frame.push(t);\n else if (toChild === fromChild) summaries.get(fromChild)!.internal++;\n else addEdge(edges, fromChild, toChild, t);\n } else {\n const door =\n exits.get(target) ??\n exits.set(target, { other: target, child: fromChild ?? focus, transitions: [], events: [] }).get(target)!;\n door.transitions.push(t);\n for (const e of t.events.length ? t.events : [\"ε\"]) if (!door.events.includes(e)) door.events.push(e);\n }\n }\n } else {\n for (const target of t.targets) {\n if (!within(target, focus) || target === focus) continue;\n const toChild = childContaining(focus, target);\n if (!toChild) continue;\n const key = `${s.id}→${toChild.id}`;\n const door = entries.get(key) ?? entries.set(key, { other: s, child: toChild, transitions: [], events: [] }).get(key)!;\n door.transitions.push(t);\n for (const e of t.events.length ? t.events : [\"ε\"]) if (!door.events.includes(e)) door.events.push(e);\n }\n }\n }\n }\n for (const c of focus.children) {\n const sum = summaries.get(c)!;\n sum.events = [...(eventSets.get(c) ?? [])].sort();\n let inv = 0;\n const walk = (x: StateNode) => {\n inv += x.invokes.length;\n for (const k of x.children) walk(k);\n };\n walk(c);\n sum.invokes = inv;\n }\n const byCount = (a: { transitions: unknown[] }, b: { transitions: unknown[] }) => b.transitions.length - a.transitions.length;\n return {\n focus,\n children: [...summaries.values()],\n edges: [...edges.values()],\n exits: [...exits.values()].sort(byCount),\n entries: [...entries.values()].sort(byCount),\n frame,\n };\n}\n\nfunction addEdge(edges: Map<string, FocusEdge>, from: StateNode, to: StateNode, t: TransitionNode) {\n const key = `${from.id}→${to.id}`;\n const e = edges.get(key) ?? edges.set(key, { from, to, transitions: [], events: [] }).get(key)!;\n e.transitions.push(t);\n for (const ev of t.events.length ? t.events : [\"ε\"]) if (!e.events.includes(ev)) e.events.push(ev);\n}\n\n/**\n * Where \"follow\" should look: the lowest container that holds every active\n * leaf. One active leaf → its parent; parallel regions → the parallel state,\n * whose lanes show all of them at once instead of jumping between regions.\n */\nexport function followTarget(configuration: StateNode[], current: StateNode): StateNode {\n const leaves = configuration.filter(isAtomic);\n if (!leaves.length) return current;\n let lca: StateNode | null = leaves[0]!.parent;\n while (lca && !leaves.every((l) => isDescendant(l, lca!))) lca = lca.parent;\n return lca && isContainer(lca) ? lca : current;\n}\n\n// ───────────────────────────── accepted events ─────────────────────────────\n\n/** Where an accepted event's transition is, relative to the focus: inside it, on an ancestor, or elsewhere. */\nexport type EventScope = \"here\" | \"inherited\" | \"elsewhere\";\n\n/** A transition that would handle an accepted event. */\nexport interface AcceptedTransition {\n /** the transition */\n transition: TransitionNode;\n /** its (active) source state */\n source: StateNode;\n /** it has a `cond` (shown, not evaluated) */\n guarded: boolean;\n /** where it leads (empty: targetless) */\n targets: StateNode[];\n}\n\n/** An event descriptor the machine accepts right now. */\nexport interface AcceptedEvent {\n /** the descriptor as written (may end in `.*`) */\n descriptor: string;\n /** the closest scope any of its transitions has */\n scope: EventScope;\n /** in priority order: innermost source first */\n transitions: AcceptedTransition[];\n}\n\n/**\n * Events the machine accepts in its current configuration: descriptors on\n * transitions of active states (conditions are shown, not evaluated — that\n * could have side effects). Scoped relative to the focus:\n * here — the source is inside the focus\n * inherited — the source is an ancestor of the focus (it applies here too)\n * elsewhere — other active parts (e.g. parallel regions outside the focus)\n */\nexport function acceptedEvents(session: Session, focus: StateNode): AcceptedEvent[] {\n const byKey = new Map<string, AcceptedEvent>();\n const rank = { here: 0, inherited: 1, elsewhere: 2 } as const;\n const active = session.configuration.sort((a, b) => b.depth - a.depth);\n for (const s of active) {\n const scope: EventScope = within(s, focus) ? \"here\" : isDescendant(focus, s) ? \"inherited\" : \"elsewhere\";\n for (const t of s.transitions) {\n for (const d of t.events) {\n if (d.startsWith(\"done.\") || d.startsWith(\"error.\")) continue;\n const ev = byKey.get(d) ?? byKey.set(d, { descriptor: d, scope, transitions: [] }).get(d)!;\n if (rank[scope] < rank[ev.scope]) ev.scope = scope;\n ev.transitions.push({ transition: t, source: s, guarded: !!t.cond, targets: t.targets });\n }\n }\n }\n return [...byKey.values()].sort((a, b) => rank[a.scope] - rank[b.scope] || a.descriptor.localeCompare(b.descriptor));\n}\n\n/** Accepted events sharing a first dotted token. */\nexport interface EventGroup {\n /** the first token (`github` for `github.comment.*`), or `·` for names without a dot */\n prefix: string;\n /** the events, in their original order */\n events: AcceptedEvent[];\n}\n\n/** Group by the first dotted token (\"github.comment.*\" → \"github\"), keeping order. */\nexport function groupEvents(events: AcceptedEvent[]): EventGroup[] {\n const groups = new Map<string, EventGroup>();\n for (const e of events) {\n const prefix = e.descriptor.includes(\".\") ? e.descriptor.split(\".\")[0]! : \"·\";\n (groups.get(prefix) ?? groups.set(prefix, { prefix, events: [] }).get(prefix)!).events.push(e);\n }\n return [...groups.values()];\n}\n\n/** The concrete name to send for a descriptor (\"github.comment.*\" → \"github.comment.done\"; \"*\" → null). */\nexport function sendableName(descriptor: string): string | null {\n if (descriptor === \"*\") return null;\n return descriptor.endsWith(\".*\") ? `${descriptor.slice(0, -2)}.done` : descriptor;\n}\n\n/** Would sending `name` be handled by some active state? (ignores conditions) */\nexport function wouldAccept(session: Session, name: string): boolean {\n return session.configuration.some((s) => s.transitions.some((t) => t.events.length && nameMatch(t.events, name)));\n}\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @tinyactors/scxmljs/explorer — the `<scxml-explorer>` custom element and the
3
+ * view-model behind it.
4
+ *
5
+ * Importing this module registers `<scxml-explorer>`. It works with sessions
6
+ * from either entry point (`@tinyactors/scxmljs` or `…/trusted`) and never
7
+ * pulls a data model in itself, so it adds no WebAssembly to your bundle.
8
+ *
9
+ * import { createSession, PlaybackClock } from "@tinyactors/scxmljs/trusted";
10
+ * import "@tinyactors/scxmljs/explorer";
11
+ *
12
+ * const clock = new PlaybackClock();
13
+ * const session = await createSession(source, { clock });
14
+ * document.querySelector("scxml-explorer").attach({ session, clock });
15
+ * session.start();
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ export { type AnnounceMode, type ExplorerAttachOptions, type ExplorerFocusDetail, type ExplorerSelectDetail, type ExplorerSendDetail, ScxmlExplorer, } from "./explorer/element.js";
20
+ export { defaultStrings as defaultExplorerStrings, type ExplorerStrings, type StateKindName } from "./explorer/strings.js";
21
+ export { type AcceptedEvent, type AcceptedTransition, acceptedEvents, activeExpansion, type ChildSummary, childContaining, type Door, descendantCount, type EventGroup, type EventScope, type FocusEdge, type FocusScope, focusScope, followTarget, groupEvents, isContainer, label, type MachineInfo, pathTo, type ServiceInfo, type StepInfo, type SystemLink, SystemTracker, type SystemTrackerOptions, sendableName, type TreeOptions, type TreeRow, total, treeRows, within, wouldAccept, } from "./explorer/viewmodel.js";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @tinyactors/scxmljs/explorer — the `<scxml-explorer>` custom element and the
3
+ * view-model behind it.
4
+ *
5
+ * Importing this module registers `<scxml-explorer>`. It works with sessions
6
+ * from either entry point (`@tinyactors/scxmljs` or `…/trusted`) and never
7
+ * pulls a data model in itself, so it adds no WebAssembly to your bundle.
8
+ *
9
+ * import { createSession, PlaybackClock } from "@tinyactors/scxmljs/trusted";
10
+ * import "@tinyactors/scxmljs/explorer";
11
+ *
12
+ * const clock = new PlaybackClock();
13
+ * const session = await createSession(source, { clock });
14
+ * document.querySelector("scxml-explorer").attach({ session, clock });
15
+ * session.start();
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ export { ScxmlExplorer, } from "./explorer/element.js";
20
+ export { defaultStrings as defaultExplorerStrings } from "./explorer/strings.js";
21
+ export { acceptedEvents, activeExpansion, childContaining, descendantCount, focusScope, followTarget, groupEvents, isContainer, label, pathTo, SystemTracker, sendableName, total, treeRows, within, wouldAccept, } from "./explorer/viewmodel.js";
22
+ //# sourceMappingURL=explorer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explorer.js","sourceRoot":"","sources":["../src/explorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAML,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAA4C,MAAM,uBAAuB,CAAC;AAC3H,OAAO,EAGL,cAAc,EACd,eAAe,EAEf,eAAe,EAEf,eAAe,EAKf,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,EAEL,MAAM,EAIN,aAAa,EAEb,YAAY,EAGZ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,MAAM,yBAAyB,CAAC","sourcesContent":["/**\n * @tinyactors/scxmljs/explorer — the `<scxml-explorer>` custom element and the\n * view-model behind it.\n *\n * Importing this module registers `<scxml-explorer>`. It works with sessions\n * from either entry point (`@tinyactors/scxmljs` or `…/trusted`) and never\n * pulls a data model in itself, so it adds no WebAssembly to your bundle.\n *\n * import { createSession, PlaybackClock } from \"@tinyactors/scxmljs/trusted\";\n * import \"@tinyactors/scxmljs/explorer\";\n *\n * const clock = new PlaybackClock();\n * const session = await createSession(source, { clock });\n * document.querySelector(\"scxml-explorer\").attach({ session, clock });\n * session.start();\n *\n * @packageDocumentation\n */\n\nexport {\n type AnnounceMode,\n type ExplorerAttachOptions,\n type ExplorerFocusDetail,\n type ExplorerSelectDetail,\n type ExplorerSendDetail,\n ScxmlExplorer,\n} from \"./explorer/element.ts\";\nexport { defaultStrings as defaultExplorerStrings, type ExplorerStrings, type StateKindName } from \"./explorer/strings.ts\";\nexport {\n type AcceptedEvent,\n type AcceptedTransition,\n acceptedEvents,\n activeExpansion,\n type ChildSummary,\n childContaining,\n type Door,\n descendantCount,\n type EventGroup,\n type EventScope,\n type FocusEdge,\n type FocusScope,\n focusScope,\n followTarget,\n groupEvents,\n isContainer,\n label,\n type MachineInfo,\n pathTo,\n type ServiceInfo,\n type StepInfo,\n type SystemLink,\n SystemTracker,\n type SystemTrackerOptions,\n sendableName,\n type TreeOptions,\n type TreeRow,\n total,\n treeRows,\n within,\n wouldAccept,\n} from \"./explorer/viewmodel.ts\";\n"]}