@beehexa/hexasync-template-model 2608.21.2 → 2610.3.1

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 (39) hide show
  1. package/dist/canonicalGraph.d.ts +153 -0
  2. package/dist/canonicalGraph.d.ts.map +1 -0
  3. package/dist/canonicalGraph.js +321 -0
  4. package/dist/canonicalGraph.js.map +1 -0
  5. package/dist/collapseRule.d.ts +125 -0
  6. package/dist/collapseRule.d.ts.map +1 -0
  7. package/dist/collapseRule.js +87 -0
  8. package/dist/collapseRule.js.map +1 -0
  9. package/dist/flowRender.d.ts +364 -18
  10. package/dist/flowRender.d.ts.map +1 -1
  11. package/dist/flowRender.js +956 -123
  12. package/dist/flowRender.js.map +1 -1
  13. package/dist/index.d.ts +8 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +10 -3
  16. package/dist/index.js.map +1 -1
  17. package/dist/nodeAddress.d.ts +81 -0
  18. package/dist/nodeAddress.d.ts.map +1 -1
  19. package/dist/nodeAddress.js +70 -0
  20. package/dist/nodeAddress.js.map +1 -1
  21. package/dist/occurrenceExpansion.d.ts +50 -0
  22. package/dist/occurrenceExpansion.d.ts.map +1 -0
  23. package/dist/occurrenceExpansion.js +230 -0
  24. package/dist/occurrenceExpansion.js.map +1 -0
  25. package/dist/stepGlyph.d.ts +242 -29
  26. package/dist/stepGlyph.d.ts.map +1 -1
  27. package/dist/stepGlyph.js +403 -104
  28. package/dist/stepGlyph.js.map +1 -1
  29. package/dist/workerStepVocabularyAudit.d.ts +19 -0
  30. package/dist/workerStepVocabularyAudit.d.ts.map +1 -0
  31. package/dist/workerStepVocabularyAudit.js +134 -0
  32. package/dist/workerStepVocabularyAudit.js.map +1 -0
  33. package/dist/workflowMigration.d.ts +60 -0
  34. package/dist/workflowMigration.d.ts.map +1 -0
  35. package/dist/workflowMigration.js +75 -0
  36. package/dist/workflowMigration.js.map +1 -0
  37. package/manifests/collapse-rule.json +43 -0
  38. package/manifests/worker-step-roster.json +164 -0
  39. package/package.json +6 -2
@@ -0,0 +1,230 @@
1
+ /**
2
+ * One drawn node per retained occurrence, plus one per collapsed range — Story 8.9, FR64, U5 reading **B**.
3
+ *
4
+ * ### What this fixes
5
+ *
6
+ * The drawing had one node per AUTHORED step however many times a run executed it, so a step that ran 1000 times was
7
+ * indistinguishable from one that ran once except for a badge. U5 was answered on 2026-09-28 in favour of reading B:
8
+ * the canvas shows one node per retained occurrence plus one node per collapsed range, mirroring the accumulator's
9
+ * `orderedTimeline` exactly. Nothing in the generator could express that — `workerFlow`'s `addressOf` maps a step key
10
+ * to exactly ONE address, and an address had no occurrence dimension at all.
11
+ *
12
+ * ### Why a transform ABOVE the flow builders, and not a change inside them
13
+ *
14
+ * FR40 requires the no-evidence path to draw byte-identically to today, and `workerFlow` is where the CLI compose
15
+ * report and the VS Code preview both get their graph — neither has a run. Teaching `workerFlow` about evidence would
16
+ * put a conditional address scheme inside the one function that must not have one. A transform above it is conditional
17
+ * by construction: **no plan, no change** — and not merely "no visible change", but the same array references returned,
18
+ * so there is no path by which a no-run surface can gain an occurrence segment.
19
+ *
20
+ * ### Why the chain is the timeline
21
+ *
22
+ * The acceptance criterion names `orderedTimeline` as the artifact the drawing must mirror, and that list is precisely
23
+ * the run's order of retained occurrences and collapsed ranges. Chaining it reproduces the inspector's
24
+ * `1 → ×997 → 999 → 1000` on the canvas, which is what makes the two surfaces one story rather than two. The
25
+ * requirements do not state an edge topology for expanded nodes, so this is an inference — and it is the only reading
26
+ * that uses the artifact the criterion names.
27
+ *
28
+ * ### What this deliberately does NOT do
29
+ *
30
+ * It does not parse an evidence envelope. FR26 gives one internal shape sole ownership of the occurrence facts, so the
31
+ * plan arrives as a typed parameter (`OccurrencePlan`) and a producer — Epic 10's — converts. It also builds neither
32
+ * overlay producer, touches no host, and knows nothing about clickability: a collapsed range is reported back in
33
+ * `collapsedRanges` so a host can keep it out of `clickableNodeIds` (FR75, UX-DR57), which is a decision the host owns.
34
+ */
35
+ import { nodeAddress, occurrenceSegment, occurrenceSegmentText, rangeSegmentText, } from './nodeAddress.js';
36
+ const IDENTITY_OVERLAY = Object.freeze({});
37
+ /**
38
+ * Combine a DERIVED overlay with a CALLER's, per field, with the caller's statement winning.
39
+ *
40
+ * ⛔ One function because three sites needed it and two of them had it backwards. `flowRender` merged
41
+ * `{...caller, ...derived}` and the adapters merged `{...derived, ...caller}`, so the same plan plus the same caller
42
+ * overlay lost the `×N` through one path and lost the caller's `ranFailed` through the other. Worse, both were
43
+ * WHOLE-OBJECT merges, so `{ repeat }` and `{ state }` could never coexist: a failed range could not carry its count.
44
+ *
45
+ * Per field, so a range that the producer says failed keeps both its state and its derived count, while a caller that
46
+ * states its own `repeat` still overrides the derived one.
47
+ */
48
+ export function mergeNodeOverlays(derived, caller) {
49
+ if (derived === undefined || Object.keys(derived).length === 0)
50
+ return caller ?? IDENTITY_OVERLAY;
51
+ if (caller === undefined || Object.keys(caller).length === 0)
52
+ return derived;
53
+ const merged = { ...derived };
54
+ for (const [address, entry] of Object.entries(caller)) {
55
+ const own = merged[address];
56
+ merged[address] = own === undefined ? entry : { ...own, ...entry };
57
+ }
58
+ return merged;
59
+ }
60
+ const NO_RANGES = Object.freeze([]);
61
+ /**
62
+ * The address of one entry in a node's timeline.
63
+ *
64
+ * Throws rather than falling back, and that is the whole point of the function existing. `nodeAddress` DROPS a refused
65
+ * segment, so a silent refusal here would return the AUTHORED address — and every occurrence of the step would collapse
66
+ * back onto it, deduped by `renderMermaid`'s own node dedupe, leaving a 1000-iteration run drawn as one node with no
67
+ * error anywhere. The failure has to be loud because its silent form is indistinguishable from correct output.
68
+ */
69
+ function addressOfEntry(authored, entry) {
70
+ const text = entry.kind === 'range'
71
+ ? rangeSegmentText(entry.rangeId)
72
+ : occurrenceSegmentText(entry.ordinal);
73
+ const segment = occurrenceSegment(text);
74
+ if (segment === undefined) {
75
+ throw new Error(`Occurrence plan for "${authored}" produced the unusable occurrence segment "${text}" (${entry.kind}). ` +
76
+ 'An occurrence segment is a single `:`-delimited segment of word characters joined by single underscores.');
77
+ }
78
+ return nodeAddress([{ kind: 'key', name: authored }, segment]);
79
+ }
80
+ /**
81
+ * Expand the authored graph against a run's occurrence plan.
82
+ *
83
+ * Pure, deterministic and total: the same `(groups, edges, plan)` always produces the same result, nothing consults
84
+ * the clock, and a plan naming a step no group drew is ignored in silence — exactly what an `overlay.nodes` entry does with
85
+ * an unknown address, because a producer that knows about a step the drawing dropped is the normal case, not an error.
86
+ *
87
+ * ⚠️ Call it BEFORE the definition string is built and before the collision check — which is what wiring it into the
88
+ * two flow adapters ahead of `renderFlowMermaid` achieves (FR64: *"collapsed before the definition string is built,
89
+ * not after and not by a host"*).
90
+ */
91
+ export function expandOccurrences(groups, edges, plan) {
92
+ const identity = {
93
+ groups,
94
+ edges,
95
+ nodes: IDENTITY_OVERLAY,
96
+ collapsedRanges: NO_RANGES,
97
+ expanded: false,
98
+ };
99
+ if (plan === undefined)
100
+ return identity;
101
+ /**
102
+ * Only an address a group ACTUALLY DREW can expand, and only with at least one entry.
103
+ *
104
+ * Both halves matter. An undrawn key is the "plan names an undrawn step" row of the matrix. An empty entry list is
105
+ * the more dangerous one: expanding a node into nothing would delete a drawn step and, with it, every edge through
106
+ * it — a diagram that silently describes a different workflow. Nothing is the identity, not the empty set.
107
+ */
108
+ const drawn = new Set();
109
+ for (const group of groups)
110
+ for (const node of group.nodes)
111
+ drawn.add(node.address);
112
+ const expansions = new Map();
113
+ for (const [address, entries] of Object.entries(plan)) {
114
+ if (!drawn.has(address) || entries.length === 0)
115
+ continue;
116
+ expansions.set(address, entries);
117
+ }
118
+ if (expansions.size === 0)
119
+ return identity;
120
+ const addressesOf = new Map();
121
+ /**
122
+ * Every drawn address, expanded or not — the set a new one must not already be in.
123
+ *
124
+ * ⛔ Without this, a plan that repeats an ordinal, repeats a `rangeId`, or arrives unsorted mints the SAME address
125
+ * twice. `assertUniqueRenderedIds`'s escape hatch is exact-address equality, so the duplicate is not a collision to
126
+ * it; it falls through to `renderMermaid`'s node dedupe and a 1000-iteration run draws as one node — precisely the
127
+ * silent failure `addressOfEntry` throws to prevent, reached by a different door.
128
+ */
129
+ const claimed = new Set();
130
+ for (const group of groups) {
131
+ for (const node of group.nodes) {
132
+ if (!expansions.has(node.address))
133
+ claimed.add(node.address);
134
+ }
135
+ }
136
+ for (const [address, entries] of expansions) {
137
+ let previous;
138
+ for (const entry of entries) {
139
+ /**
140
+ * Ordinals ASCEND, strictly. A chain is the run's order, so a backwards or repeated ordinal would draw an arrow
141
+ * through time — the one topology this design rules out — and a repeated one also duplicates an address.
142
+ */
143
+ if (previous !== undefined && entry.ordinal <= previous.ordinal) {
144
+ throw new Error(`Occurrence plan for "${address}" is not in timeline order: ordinal ${entry.ordinal} follows ` +
145
+ `${previous.ordinal}. A chain is the run's order, so ordinals must strictly ascend.`);
146
+ }
147
+ previous = entry;
148
+ }
149
+ const expandedAddresses = entries.map((entry) => addressOfEntry(address, entry));
150
+ for (const expandedAddress of expandedAddresses) {
151
+ if (claimed.has(expandedAddress)) {
152
+ throw new Error(`Occurrence plan for "${address}" mints the address "${expandedAddress}" twice. Two drawn nodes sharing ` +
153
+ 'one address are silently deduped into one, which would draw a repeated step as if it ran once.');
154
+ }
155
+ claimed.add(expandedAddress);
156
+ }
157
+ addressesOf.set(address, expandedAddresses);
158
+ }
159
+ const overlayNodes = {};
160
+ const collapsedRanges = [];
161
+ const expandedGroups = groups.map((group) => ({
162
+ ...group,
163
+ nodes: group.nodes.flatMap((node) => {
164
+ const entries = expansions.get(node.address);
165
+ if (entries === undefined)
166
+ return [node];
167
+ const addresses = addressesOf.get(node.address);
168
+ return entries.map((entry, index) => {
169
+ const address = addresses[index];
170
+ if (entry.kind === 'range') {
171
+ collapsedRanges.push(address);
172
+ // `repeat` is how a `×N` reaches a label (Story 8.8); the range keeps the step's shape and icon so the
173
+ // chain reads as the same step, not as a foreign element spliced into it.
174
+ overlayNodes[address] = { repeat: entry.count };
175
+ }
176
+ return { ...node, address };
177
+ });
178
+ }),
179
+ }));
180
+ /**
181
+ * Edges, in the order the documented expansion draws them: `A → B₁ → Bᵣ → B₉₉₉ → B₁₀₀₀ → C`.
182
+ *
183
+ * An inbound edge lands on the FIRST entry and an outbound edge leaves the LAST, because the chain is the run's
184
+ * order and any other choice would draw an arrow backwards through time. A node's chain is emitted immediately
185
+ * after the first authored edge that arrives at it, which is what puts the statements in timeline order for the
186
+ * ordinary single-entry case; a node with no inbound edge emits its chain up front. Order is deterministic either
187
+ * way, and `linkStyle` indices are assigned from the emitted sequence, so this is a byte-level decision.
188
+ */
189
+ const firstOf = (address) => addressesOf.get(address)?.[0] ?? address;
190
+ const lastOf = (address) => addressesOf.get(address)?.at(-1) ?? address;
191
+ const chainOf = (address) => {
192
+ const addresses = addressesOf.get(address) ?? [];
193
+ return addresses.slice(1).map((to, index) => ({ from: addresses[index], to }));
194
+ };
195
+ const inbound = new Set(edges.filter((edge) => edge.from !== edge.to).map((edge) => edge.to));
196
+ const chained = new Set();
197
+ const expandedEdges = [];
198
+ for (const address of addressesOf.keys()) {
199
+ if (inbound.has(address))
200
+ continue;
201
+ chained.add(address);
202
+ expandedEdges.push(...chainOf(address));
203
+ }
204
+ for (const edge of edges) {
205
+ /**
206
+ * An authored SELF-edge is dropped only where the CHAIN has already replaced it.
207
+ *
208
+ * `B → B` is how a looping step is authored. Once the run's iterations are drawn as a chain, rewriting that edge
209
+ * would emit `B₁₀₀₀ → B₁` — an arrow from the last occurrence back to the first, i.e. a claim that the run ended
210
+ * where it began. But a node that expanded to ONE entry has no chain, so dropping its self-edge would delete the
211
+ * only statement that the step loops at all; there it is rewritten onto that single occurrence, and a node with no
212
+ * plan entry is untouched.
213
+ */
214
+ if (edge.from === edge.to && (addressesOf.get(edge.from)?.length ?? 0) > 1)
215
+ continue;
216
+ expandedEdges.push({ ...edge, from: lastOf(edge.from), to: firstOf(edge.to) });
217
+ if (expansions.has(edge.to) && !chained.has(edge.to)) {
218
+ chained.add(edge.to);
219
+ expandedEdges.push(...chainOf(edge.to));
220
+ }
221
+ }
222
+ return {
223
+ groups: expandedGroups,
224
+ edges: expandedEdges,
225
+ nodes: overlayNodes,
226
+ collapsedRanges,
227
+ expanded: true,
228
+ };
229
+ }
230
+ //# sourceMappingURL=occurrenceExpansion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"occurrenceExpansion.js","sourceRoot":"","sources":["../src/occurrenceExpansion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAiC1B,MAAM,gBAAgB,GAAgD,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAgE,EAChE,MAA+D;IAE/D,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,MAAM,IAAI,gBAAgB,CAAC;IAClG,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IAC7E,MAAM,MAAM,GAAsC,EAAE,GAAG,OAAO,EAAE,CAAC;IACjE,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,C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AAC,OAAO,CAAC,CAAC;QACrB,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB;;;;;;;;WAQG;QACH,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC;YAAE,SAAS;QACrF,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/E,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACrD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACrB,aAAa,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,cAAc;QACtB,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,YAAY;QACnB,eAAe;QACf,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
@@ -15,53 +15,266 @@
15
15
  *
16
16
  * ### Why a glyph and not the SVG set
17
17
  *
18
- * ⚠️ Stated rather than quietly downgraded. `ux/step-icons/` holds 12 authored SVGs, and they cannot go inside
19
- * a mermaid node here: the webview renders with `securityLevel: 'strict'`, which sanitises label HTML through
20
- * DOMPurify (`renderHtml.ts:493` records the same constraint for the report), and an inline `<svg>` does not
21
- * survive that. Raising it to `'loose'` to admit one would also admit mermaid's `click … call fn()` — which is
22
- * precisely why `flowDiagram.ts` chose strict.
18
+ * The authored SVGs cannot go inside a Mermaid node here: Mermaid 12 at `securityLevel: 'strict'` sanitises label
19
+ * HTML through DOMPurify, and an inline `<svg>` does not survive that. Raising strict hosts to `'loose'` would weaken
20
+ * their label boundary.
23
21
  *
24
- * So the icon slot is filled by a per-FAMILY unicode glyph, which survives sanitising, needs no asset
25
- * pipeline, and renders identically in the editor, the report and the browser host. The type name is drawn
26
- * beside it, so the glyph is a hint and never the only signal — that is the "fallback to text", present
27
- * always rather than only when something fails.
22
+ * Strict fidelity therefore keeps the parent-family Unicode glyph and the type text beside it, so the glyph is a
23
+ * hint and never the only signal. Loose fidelity uses a key-only label beside the child-family SVG mask exposed
24
+ * below. The renderer stamps the class hook; no SVG or icon class definition enters the Mermaid source.
25
+ */
26
+ import type { RenderFidelity, RunState } from './flowRender.js';
27
+ /** The ten coarse families whose Unicode glyphs remain usable in strict Mermaid hosts. */
28
+ export type ParentStepFamily = 'call' | 'control' | 'orchestrate' | 'query' | 'state' | 'terminal' | 'transform' | 'ui' | 'wait' | 'write';
29
+ /**
30
+ * Keep authored punctuation literal inside Mermaid 12 Markdown labels.
31
+ *
32
+ * Mermaid's SVG-label path drops Markdown `escape` tokens and does not decode numeric entities. U+FEFF is zero-width
33
+ * whitespace: bracketing authored Markdown punctuation with it makes the lexer keep the punctuation in ordinary text
34
+ * tokens while leaving the visible text unchanged. The renderer-owned bold delimiters are added afterwards.
28
35
  *
29
- * Wiring the real SVG set belongs with the shared step-icon package the toolchain PRD lists under
30
- * *"Unblocks"*, where a `<span class="step-icon step-icon--api">` and CSS can do it without loosening mermaid.
36
+ * It lives HERE, beside the composer, rather than in `flowRender.ts` where it started: the composer and the renderer
37
+ * must escape one heading identically or the same node gets two different labels depending on which surface built it,
38
+ * and the only way to guarantee that is one function. `flowRender.ts` imports it — never the other way round, because
39
+ * that is the dependency direction this package already has.
31
40
  */
41
+ export declare function escapeMarkdownText(value: string): string;
42
+ /** The sole result for absent or unknown worker vocabulary. */
43
+ export declare const UNMAPPED_STEP_ICON: {
44
+ readonly family: 'unmapped';
45
+ readonly glyph: '□';
46
+ };
47
+ /** The approved 32 drawing families, rolled up to the strict-host glyph vocabulary. */
48
+ export declare const STEP_FAMILY_PARENTS: {
49
+ readonly 'call.dialect': 'call';
50
+ readonly 'call.event': 'call';
51
+ readonly 'call.http': 'call';
52
+ readonly 'call.webhook': 'call';
53
+ readonly 'control.if': 'control';
54
+ readonly 'control.switch': 'control';
55
+ readonly 'orchestrate.composite': 'orchestrate';
56
+ readonly 'orchestrate.enqueue': 'orchestrate';
57
+ readonly 'orchestrate.pull': 'orchestrate';
58
+ readonly 'query.dsl': 'query';
59
+ readonly 'query.file': 'query';
60
+ readonly 'query.history': 'query';
61
+ readonly 'query.kv': 'query';
62
+ readonly 'query.metrics': 'query';
63
+ readonly 'query.record': 'query';
64
+ readonly 'query.sql': 'query';
65
+ readonly 'state.cache': 'state';
66
+ readonly 'state.item': 'state';
67
+ readonly 'state.kv': 'state';
68
+ readonly 'state.removal': 'state';
69
+ readonly 'state.task-data': 'state';
70
+ readonly 'terminal.begin': 'terminal';
71
+ readonly 'terminal.end': 'terminal';
72
+ readonly 'terminal.error': 'terminal';
73
+ readonly 'transform.decode': 'transform';
74
+ readonly 'transform.filter': 'transform';
75
+ readonly 'transform.template': 'transform';
76
+ readonly 'wait.sleep': 'wait';
77
+ readonly 'write.delete': 'write';
78
+ readonly 'write.index': 'write';
79
+ readonly 'write.push': 'write';
80
+ readonly 'write.seed': 'write';
81
+ };
82
+ export type WorkerStepFamily = keyof typeof STEP_FAMILY_PARENTS;
83
+ /** Every id in Epic 7's authoritative 51/51 runtime roster, in manifest order. */
84
+ export declare const WORKER_STEP_FAMILIES: {
85
+ readonly API: 'call.http';
86
+ readonly BASE64_TO_MIME_TYPE: 'transform.decode';
87
+ readonly Begin: 'terminal.begin';
88
+ readonly CACHE: 'state.cache';
89
+ readonly CHECK_FORMAT: 'transform.filter';
90
+ readonly Composite: 'orchestrate.composite';
91
+ readonly DIRECT_INDEX: 'write.index';
92
+ readonly DOWNLOAD_CSV: 'query.file';
93
+ readonly ENQUEUER: 'orchestrate.enqueue';
94
+ readonly EXCEL_READER: 'query.file';
95
+ readonly EXCEPTION: 'terminal.error';
96
+ readonly End: 'terminal.end';
97
+ readonly Error: 'terminal.error';
98
+ readonly FORWARD: 'transform.filter';
99
+ readonly GET_KEY_VALUE: 'query.kv';
100
+ readonly GraphQL: 'call.dialect';
101
+ readonly IF: 'control.if';
102
+ readonly IGNORE_ITEM: 'state.item';
103
+ readonly INVALIDATE_CACHE: 'state.cache';
104
+ readonly JSONata: 'transform.template';
105
+ readonly LOOKUP_STEP: 'query.history';
106
+ readonly Liquid: 'transform.template';
107
+ readonly METRIC_QUERY: 'query.metrics';
108
+ readonly OData: 'call.dialect';
109
+ readonly PUBLISH_EVENT: 'call.event';
110
+ readonly PULLER: 'orchestrate.pull';
111
+ readonly PUSHER: 'write.push';
112
+ readonly QUERY_MANY: 'query.record';
113
+ readonly QUERY_METRICS: 'query.metrics';
114
+ readonly QUERY_SINGLE: 'query.record';
115
+ readonly QueryDSL: 'query.dsl';
116
+ readonly REMOVE_DATA: 'write.delete';
117
+ readonly RESET_ITEM: 'state.item';
118
+ readonly RESOLVE_RAW_DATA: 'transform.decode';
119
+ readonly Restful: 'call.dialect';
120
+ readonly SAVE_TASK_DATA: 'state.task-data';
121
+ readonly SEED_DATA: 'write.seed';
122
+ readonly SET_KEY_VALUE: 'state.kv';
123
+ readonly SLEEP: 'wait.sleep';
124
+ readonly SQL: 'query.sql';
125
+ readonly SQL_PROXY: 'query.sql';
126
+ readonly SWITCH: 'control.switch';
127
+ readonly Scriban: 'transform.template';
128
+ readonly TRACK_FOR_REMOVAL: 'state.removal';
129
+ readonly UPDATE_ITEM_STATUS: 'state.item';
130
+ readonly UPDATE_ITEM_SYNC_PROCESS: 'state.item';
131
+ readonly UPDATE_TASK_DATA_STATUS: 'state.task-data';
132
+ readonly VALUES: 'transform.template';
133
+ readonly VERIFY_CACHED: 'state.cache';
134
+ readonly WEBHOOK_FORWARD: 'call.webhook';
135
+ readonly cURL: 'call.dialect';
136
+ };
137
+ export type WorkerStepType = keyof typeof WORKER_STEP_FAMILIES;
138
+ export type StepTypeDomain = 'worker' | 'frontend';
139
+ /** Resolve only the worker runtime domain. Unknown and absent values are deliberately neutral. */
140
+ export declare function familyOfStepType(type: string | undefined): WorkerStepFamily | typeof UNMAPPED_STEP_ICON.family;
32
141
  /**
33
- * Which family a step type belongs to.
142
+ * Retained frontend-domain chain. Its meaningful fallback is existing frontend behavior and must not be used
143
+ * for worker ids.
144
+ */
145
+ export declare function familyOfFrontendStepType(type: string): ParentStepFamily;
146
+ /** Resolve a child or parent family to a strict-host glyph. */
147
+ export declare function glyphOfStepFamily(family: string | undefined): string;
148
+ /** Resolve a worker id through the explicit child-family map and parent rollup. */
149
+ export declare function glyphOfStepType(type: string | undefined): string;
150
+ /** Resolve a frontend id through the retained regex chain. */
151
+ export declare function glyphOfFrontendStepType(type: string | undefined): string;
152
+ export type StepIconAsset = {
153
+ readonly family: WorkerStepFamily | typeof UNMAPPED_STEP_ICON.family;
154
+ readonly parent: ParentStepFamily | typeof UNMAPPED_STEP_ICON.family;
155
+ readonly className: string;
156
+ readonly strictGlyph: string;
157
+ readonly looseMaskImage: string;
158
+ readonly tint: 'currentColor';
159
+ };
160
+ /** The dashboard tile anatomy. Hosts resolve these token names; the vocabulary never bakes in theme colours. */
161
+ export declare const STEP_ICON_TILE: {
162
+ readonly alignment: 'left';
163
+ readonly shape: 'square';
164
+ readonly radiusToken: 'rounded.xl';
165
+ readonly backgroundToken: 'tile-bg';
166
+ readonly glyphToken: 'tile-glyph';
167
+ };
168
+ /** Normalize a family into the asset-backed class Mermaid copies to the rendered node group. */
169
+ export declare function stepIconClassName(family: string | undefined): string;
170
+ type StepIconAssetKey = WorkerStepFamily | typeof UNMAPPED_STEP_ICON.family;
171
+ /**
172
+ * Complete local loose-host assets. Each mask is percent-encoded on first property access, so strict-only rendering
173
+ * pays only for class and glyph lookup.
174
+ */
175
+ export declare const STEP_ICON_ASSETS: Readonly<Record<StepIconAssetKey, StepIconAsset>>;
176
+ /**
177
+ * The in-node error marker: one glyph for a strict host, the approved drawing for a loose one.
178
+ *
179
+ * **Why `⚠` (U+26A0, Miscellaneous Symbols) and not a glyph from the three approved blocks.** `PARENT_GLYPHS`'
180
+ * Arrows / Geometric Shapes / Mathematical Operators rule exists so 32 FAMILY glyphs render in the fonts a webview
181
+ * receives; it does not cover a marker, and none of the three blocks contains an exclamation-in-triangle — the shape
182
+ * DESIGN.md names. U+26A0 was MEASURED surviving a Mermaid 12.0.0 strict-mode render inside a backtick-quoted
183
+ * markdown label on 2026-09-28, alongside `×` and `◆`, and it is the one glyph in the canvas's whole vocabulary whose
184
+ * absence would be obvious rather than silent (a failed node also carries `emphasis` width, a red stroke and a tinted
185
+ * fill, so the marker is never the only signal — `node-failed`'s three channels are independent by design).
34
186
  *
35
- * Matched on the type name because that is what both runtimes carry — a worker step's `displayType` and a
36
- * frontend step's `type` are the same idea spelled twice (AD-21 keeps the vocabularies apart, not the
37
- * concept). Unknown types get the neutral glyph rather than no glyph, so a box never loses its icon slot and
38
- * start shifting the text alignment of its neighbours.
187
+ * **The same glyph is used at BOTH fidelities.** Story 8.3 could split strict glyph from loose mask because the mask
188
+ * arrives through a class the host's own stylesheet paints; a run-state mark cannot, because AD-23 forbids any host
189
+ * CSS rule that carries run state onto a node. `looseMaskImage` is therefore exported for a loose host's LEGEND or
190
+ * inspector chrome — not for the node — and it reuses `terminal.error`'s approved path fragment rather than authoring
191
+ * a second exclamation-in-triangle.
39
192
  */
40
- export declare function familyOfStepType(type: string): string;
193
+ export declare const RUN_STATE_ERROR_MARKER: {
194
+ readonly glyph: '⚠';
195
+ readonly className: string;
196
+ readonly looseMaskImage: string;
197
+ readonly tint: 'currentColor';
198
+ };
199
+ /** The multiplication sign the count badge reads with (`×997`). MEASURED surviving a strict-mode render. */
200
+ export declare const REPEAT_BADGE_GLYPH = "\u00D7";
41
201
  /**
42
- * The glyph for a step type.
202
+ * The largest count the badge will draw.
43
203
  *
44
- * Empty for a step with NO type — there is no icon to stand in for, and a placeholder would render as a
45
- * second separator (`name · · KEY`), which is how this was caught.
204
+ * A bound, not a formatting choice: `Number.isInteger(1e21)` is TRUE, so an unbounded check drew `×1e+21` — the
205
+ * exponent notation JavaScript switches to above 1e20, which is not a count any reader can act on and not a claim
206
+ * about a run that the generator can stand behind. A billion occurrences is already far outside anything the
207
+ * accumulator can produce, so beyond it the honest answer is no badge.
46
208
  */
47
- export declare function glyphOfStepType(type: string | undefined): string;
209
+ export declare const REPEAT_BADGE_MAX = 1000000000;
210
+ /** Is this a count worth drawing? One predicate, so the label and the style pass can never disagree. */
211
+ export declare function isCountableRepeat(repeat: number | undefined): repeat is number;
212
+ /** `×N` for a count worth stating, and nothing at all otherwise. */
213
+ export declare function repeatBadgeText(repeat: number | undefined): string | undefined;
214
+ export declare function runStateAlternativeText(runState: {
215
+ readonly state?: RunState;
216
+ readonly repeat?: number;
217
+ } | undefined): string;
218
+ /** The run-state content one node's label carries. Absent members carry nothing, so a no-overlay label is unchanged. */
219
+ export interface NodeRunStateContent {
220
+ readonly marker?: boolean;
221
+ readonly repeat?: number;
222
+ }
223
+ export interface NodeLabelInput {
224
+ readonly label?: string;
225
+ readonly name?: string;
226
+ readonly stepKey?: string;
227
+ readonly address: string;
228
+ readonly type?: string;
229
+ readonly displayType?: string;
230
+ }
231
+ /** Structured provenance consumed by the Mermaid renderer; arbitrary label bytes cannot impersonate it. */
232
+ export interface NodeLabelAnatomy {
233
+ readonly icon?: string;
234
+ /**
235
+ * The in-node error marker, drawn RIGHT OF THE ICON TILE (DESIGN.md `markers.error`, `node-failed` line 176).
236
+ *
237
+ * A run-state slot on the label rather than a host decoration, because AD-23 makes run-state-carried content
238
+ * stage 1's and forbids stage 3 from carrying run state at all.
239
+ */
240
+ readonly marker?: string;
241
+ readonly heading: string;
242
+ readonly description?: string;
243
+ /** The repeat count as rendered text (`×997`), last in the card's reading order. */
244
+ readonly badge?: string;
245
+ }
246
+ export interface NodeLabelComposition {
247
+ readonly text: string;
248
+ readonly anatomy?: NodeLabelAnatomy;
249
+ }
48
250
  /**
49
- * The three lines a reader needs, in the order the brainstorm asked for: name, then key, then type.
251
+ * Compose the shared node-card anatomy and its structural renderer provenance.
50
252
  *
51
- * ⚠️ ONE LINE, not `<br/>`, and that was measured rather than assumed. The first version used `<br/>`; the
52
- * shared renderer's `escapeLabel` turns `<` into `&lt;` — correctly, it is what stops an authored step name
53
- * injecting markup — so mermaid received `&lt;br/&gt;` and would have drawn it as visible text in every box.
54
- * Weakening `escapeLabel` to admit one tag would trade a real safety property for a cosmetic one.
253
+ * The label has two semantic text roles rather than a two-physical-line limit: the bold heading may wrap, and the
254
+ * upright key/type description follows it. Strict hosts keep a Unicode glyph and explicit type text; loose hosts
255
+ * reserve the icon through the node's family class and keep the key as their description.
55
256
  *
56
- * A junction (START/END) has its own label and no key or type — it returns unchanged, because decorating a
57
- * terminal with an empty key line would put a blank row in every diagram.
257
+ * Boundary whitespace is not visible content. Normalizing it here keeps a blank explicit label from defeating the
258
+ * name/key/address fallback or moving Mermaid's bold delimiters away from the heading.
259
+ */
260
+ export declare function composeNodeLabelModel(node: NodeLabelInput, fidelity: RenderFidelity, domain: StepTypeDomain, iconFamily?: string, runState?: NodeRunStateContent): NodeLabelComposition;
261
+ /** String-only compatibility surface; renderers use `composeNodeLabelModel` so provenance stays structural. */
262
+ export declare function composeNodeLabel(node: NodeLabelInput, fidelity: RenderFidelity, domain: StepTypeDomain, iconFamily?: string): string;
263
+ /**
264
+ * Screen-reader text for a node. The icon is deliberately absent: strict Unicode names are noisy, while loose masks
265
+ * are decorative. Fidelity and domain stay in the signature so callers can compose visual and accessible labels from
266
+ * the same inputs without branching.
58
267
  */
59
- export declare function composeNodeLabel(node: {
268
+ export declare function composeAccessibleNodeLabel(node: {
60
269
  readonly label?: string;
61
270
  readonly name?: string;
62
271
  readonly stepKey?: string;
63
272
  readonly address: string;
64
273
  readonly type?: string;
65
274
  readonly displayType?: string;
275
+ }, _fidelity: RenderFidelity, _domain: StepTypeDomain, runState?: {
276
+ readonly state?: RunState;
277
+ readonly repeat?: number;
66
278
  }): string;
279
+ export {};
67
280
  //# sourceMappingURL=stepGlyph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stepGlyph.d.ts","sourceRoot":"","sources":["../src/stepGlyph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA4CH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4BrD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,MAAM,CAYT"}
1
+ {"version":3,"file":"stepGlyph.d.ts","sourceRoot":"","sources":["../src/stepGlyph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhE,0FAA0F;AAC1F,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,GACT,aAAa,GACb,OAAO,GACP,OAA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