@beehexa/hexasync-template-worker-flow 2611.5.3 → 2611.8.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.
- package/dist/canonicalGraph.d.ts +7 -6
- package/dist/canonicalGraph.d.ts.map +1 -1
- package/dist/canonicalGraph.js +284 -134
- package/dist/canonicalGraph.js.map +1 -1
- package/dist/declarations.d.ts +47 -0
- package/dist/declarations.d.ts.map +1 -0
- package/dist/declarations.js +136 -0
- package/dist/declarations.js.map +1 -0
- package/dist/flow.d.ts +54 -52
- package/dist/flow.d.ts.map +1 -1
- package/dist/flow.js +45 -155
- package/dist/flow.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/rejections.d.ts +29 -0
- package/dist/rejections.d.ts.map +1 -0
- package/dist/rejections.js +58 -0
- package/dist/rejections.js.map +1 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +24 -14
- package/dist/render.js.map +1 -1
- package/dist/routeGraph.d.ts +12 -2
- package/dist/routeGraph.d.ts.map +1 -1
- package/dist/routeGraph.js +140 -146
- package/dist/routeGraph.js.map +1 -1
- package/dist/routes.d.ts +75 -21
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +115 -95
- package/dist/routes.js.map +1 -1
- package/dist/stages.d.ts +62 -103
- package/dist/stages.d.ts.map +1 -1
- package/dist/stages.js +83 -143
- package/dist/stages.js.map +1 -1
- package/package.json +2 -2
package/dist/routeGraph.js
CHANGED
|
@@ -6,33 +6,42 @@
|
|
|
6
6
|
* ⛔ The first version of this package had `routeEdges` only, and `flow.ts` synthesised a decision node beside it
|
|
7
7
|
* without connecting the two. The Story 4.1 review measured what that produced: a diamond with **zero** edges
|
|
8
8
|
* touching it, while the YES/NO arms left the step — so the diamond was unreachable and undrawable, and the step
|
|
9
|
-
* carried arms it does not have.
|
|
10
|
-
* produced **no** node for the **3,480** with an expression-valued one, which is exactly where both shipped
|
|
11
|
-
* surfaces DO synthesise (`_EXPR_<n>` in `flowChart.ts:145-155`, in the golden baseline for fixture 01).
|
|
9
|
+
* carried arms it does not have.
|
|
12
10
|
*
|
|
13
|
-
* `routeEdges` is kept because it answers a genuinely different question — *"what routes where"*, flat
|
|
14
|
-
*
|
|
15
|
-
* `routeGraph.spec.ts` asserts the two agree about reachability so they cannot drift.
|
|
11
|
+
* `routeEdges` is kept because it answers a genuinely different question — *"what routes where"*, flat. This answers
|
|
12
|
+
* *"how is it drawn"*. Both read the step's route through the same `declaredRoute` / `resolveRouteTarget` semantics,
|
|
13
|
+
* and `routeGraph.spec.ts` asserts the two agree about reachability so they cannot drift.
|
|
16
14
|
*
|
|
17
|
-
* ### The
|
|
15
|
+
* ### The synthesised kinds
|
|
18
16
|
*
|
|
19
|
-
* | kind | when |
|
|
20
|
-
* | --- | --- | --- |
|
|
21
|
-
* | `if` |
|
|
22
|
-
* | `
|
|
23
|
-
* | `
|
|
17
|
+
* | kind | when | label (a controlled caption, never payload) |
|
|
18
|
+
* | --- | --- | --- |
|
|
19
|
+
* | `if` | a conditional `{ if, then, else }` | `If` |
|
|
20
|
+
* | `switch` | an exact `SWITCH` with an object payload | `Switch` |
|
|
21
|
+
* | `expression` | a dynamic route naming ≥1 real step | `Possible route` |
|
|
22
|
+
* | `unknown` | a literal naming no step, a dynamic route naming none, a rejected value, a recursive alias | the literal key, `Unresolved route`, `Invalid route`, `cycle: …` |
|
|
23
|
+
*
|
|
24
|
+
* No condition, expression or description text is copied into a label: those are step payload and are never evaluated.
|
|
25
|
+
*
|
|
26
|
+
* ### Every edge says what it is
|
|
27
|
+
*
|
|
28
|
+
* `role` is the declaring field (`next`, the IF/SWITCH payload `branch`, `onError` `recovery`, `fromStep`
|
|
29
|
+
* `exception`); `arm` says which conditional/switch arm it leaves by; `certainty` is `definite` for a statically
|
|
30
|
+
* declared transition and `possible` for a dynamic candidate or a SWITCH case (zero or several cases may match, so no
|
|
31
|
+
* case is a guaranteed choice). Identical edges are emitted once, so a legal self/back/convergence route appears once.
|
|
24
32
|
*
|
|
25
33
|
* ### Addressed by PATH, per AD-33 rule 4
|
|
26
34
|
*
|
|
27
|
-
* A structural node is *"named by the keys that reach it"
|
|
28
|
-
* `<step>:
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
35
|
+
* A structural node is *"named by the keys that reach it"*: `<step>:next:if`, a nested arm `<step>:next:then:if`, an
|
|
36
|
+
* IF branching through its payload `<step>:data:if` (or `:input:if` for a legacy payload), a switch point
|
|
37
|
+
* `<step>:data:switch`. Paths contain only document keys and the fixed synthetic words above — never a SWITCH arm or
|
|
38
|
+
* route text — so two differently-written targets that normalise alike cannot collapse onto one node. Unresolved
|
|
39
|
+
* SWITCH cases share `<step>:data:switch:unknown` and stay distinct as edges labelled by their exact keys.
|
|
32
40
|
*/
|
|
33
41
|
import { keySegment, entrySegment, nodeAddress, } from '@beehexa/hexasync-template-model';
|
|
34
|
-
import {
|
|
42
|
+
import { declaredRoute, isConditionalRoute, resolveRouteTarget, } from './routes.js';
|
|
35
43
|
const step_ = (key) => ({ kind: 'step', key });
|
|
44
|
+
const CYCLE_LABEL = 'cycle: this branch refers to itself';
|
|
36
45
|
/**
|
|
37
46
|
* Every junction and every edge for the steps of ONE stage.
|
|
38
47
|
*
|
|
@@ -45,160 +54,146 @@ export function routeGraph(steps) {
|
|
|
45
54
|
const edges = [];
|
|
46
55
|
/** Junctions already created, so two routes reaching the same path share one node. */
|
|
47
56
|
const seen = new Set();
|
|
57
|
+
const emitted = new Set();
|
|
58
|
+
const endId = (end) => end.kind === 'step' ? ['step', end.key] : ['junction', end.owner, ...end.path];
|
|
48
59
|
const junction = (owner, path, kind, label) => {
|
|
49
|
-
const id =
|
|
60
|
+
const id = JSON.stringify([owner, ...path]);
|
|
50
61
|
if (!seen.has(id)) {
|
|
51
62
|
seen.add(id);
|
|
52
63
|
junctions.push({ owner, path, kind, label });
|
|
53
64
|
}
|
|
54
65
|
return { kind: 'junction', owner, path };
|
|
55
66
|
};
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
* Identity, not path: the same object reached twice is the cycle, however long the path to it.
|
|
82
|
-
*/
|
|
83
|
-
const entered = new WeakSet();
|
|
84
|
-
/** Work list of routes still to place: where the arrow leaves, the value, the path, the label. */
|
|
85
|
-
const pending = [];
|
|
86
|
-
// ── Which route(s) this step declares, and under which key ──
|
|
87
|
-
//
|
|
88
|
-
// An IF whose `data` is an object but declares NEITHER `then` NOR `else` falls back to `next`. Without the
|
|
89
|
-
// fallback a partly-written IF loses its only edge and its target is orphaned in the diagram — `data:
|
|
90
|
-
// { expression: '…' }` with `next: 'DONE'` drew `CHECK → <diamond>` and nothing else, leaving `DONE` floating.
|
|
91
|
-
//
|
|
92
|
-
// This mirrors `routes.ts`, the flat twin, which has always had the fallback and says why in the same words. The
|
|
93
|
-
// two disagreed until Story 4.7's review measured it; this module's own docblock claimed the case "routed
|
|
94
|
-
// correctly through its `next`", which was aspiration rather than behaviour. `type` comes from `provider`, then
|
|
95
|
-
// `displayType` (`flow.ts` `stepOf`), and every UI-served step carries one, so the divergence was reachable from a
|
|
96
|
-
// real surface.
|
|
97
|
-
const branching = (type === 'IF' || type === 'SWITCH') && isBranchObject(step.data);
|
|
98
|
-
const ifWithoutBranch = type === 'IF' &&
|
|
99
|
-
branching &&
|
|
100
|
-
step.data.then == null &&
|
|
101
|
-
step.data.else == null;
|
|
102
|
-
if (branching && !ifWithoutBranch) {
|
|
103
|
-
pending.push({ from: step_(owner), value: step.data, path: ['data'] });
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
pending.push({ from: step_(owner), value: step.next, path: ['next'] });
|
|
107
|
-
}
|
|
108
|
-
if (step.onError !== null && step.onError !== undefined) {
|
|
109
|
-
pending.push({
|
|
110
|
-
from: step_(owner),
|
|
111
|
-
value: step.onError,
|
|
112
|
-
path: ['onError'],
|
|
113
|
-
label: 'onError',
|
|
114
|
-
});
|
|
115
|
-
}
|
|
67
|
+
const edge = (next) => {
|
|
68
|
+
const id = JSON.stringify([
|
|
69
|
+
endId(next.from), endId(next.to), next.role, next.arm ?? null, next.label ?? null, next.certainty,
|
|
70
|
+
]);
|
|
71
|
+
if (emitted.has(id))
|
|
72
|
+
return;
|
|
73
|
+
emitted.add(id);
|
|
74
|
+
edges.push(next);
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Conditional objects on the CURRENT path, and every conditional already placed with its junction (per owner).
|
|
78
|
+
*
|
|
79
|
+
* ⛔ A recursive YAML anchor (`next: &loop` / `if: x` / `then: *loop`) makes an object its own descendant. An
|
|
80
|
+
* unguarded walk does not merely loop, it **kills the process** (uncatchable V8 heap fatal) — and this package is
|
|
81
|
+
* bundled into the VS Code extension host. Only an object on the ACTIVE path is a cycle, drawn as a labelled dead
|
|
82
|
+
* end. A completed object reached again — a harmless alias such as `then: *x` / `else: *x` — is a convergence
|
|
83
|
+
* edge onto the junction already placed for it: neither a false cycle nor a re-expansion, so repeated aliases
|
|
84
|
+
* stay linear in distinct objects.
|
|
85
|
+
*/
|
|
86
|
+
const active = new Set();
|
|
87
|
+
const placed = new Map();
|
|
88
|
+
const pending = [];
|
|
89
|
+
const walk = (owner, start) => {
|
|
90
|
+
pending.push(start);
|
|
116
91
|
while (pending.length > 0) {
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
92
|
+
const item = pending.pop();
|
|
93
|
+
if ('leave' in item) {
|
|
94
|
+
active.delete(item.leave);
|
|
119
95
|
continue;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
96
|
+
}
|
|
97
|
+
const { from: source, value, path, role, label, arm } = item;
|
|
98
|
+
const base = {
|
|
99
|
+
role,
|
|
100
|
+
...(label !== undefined ? { label } : {}),
|
|
101
|
+
...(arm !== undefined ? { arm } : {}),
|
|
102
|
+
};
|
|
103
|
+
// ── A conditional: a diamond, and its arms leave the DIAMOND, not the step ──
|
|
104
|
+
if (item.conditional && isConditionalRoute(value)) {
|
|
105
|
+
if (active.has(value)) {
|
|
106
|
+
const point = junction(owner, [...path, 'cycle'], 'unknown', CYCLE_LABEL);
|
|
107
|
+
edge({ from: source, to: point, ...base, certainty: 'definite' });
|
|
131
108
|
continue;
|
|
132
109
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
// A SWITCH's arms are its data KEYS. The junction is the switch point itself.
|
|
137
|
-
const point = junction(owner, [...path, 'switch'], 'if', 'SWITCH');
|
|
138
|
-
edges.push({ from, to: point, ...labelled });
|
|
139
|
-
for (const arm of Object.keys(branch)) {
|
|
140
|
-
pending.push({
|
|
141
|
-
from: point,
|
|
142
|
-
value: arm,
|
|
143
|
-
path: [...path, arm],
|
|
144
|
-
label: arm,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
110
|
+
const existing = placed.get(value);
|
|
111
|
+
if (existing !== undefined) {
|
|
112
|
+
edge({ from: source, to: existing, ...base, certainty: 'definite' });
|
|
147
113
|
continue;
|
|
148
114
|
}
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
115
|
+
const point = junction(owner, [...path, 'if'], 'if', 'If');
|
|
116
|
+
placed.set(value, point);
|
|
117
|
+
active.add(value);
|
|
118
|
+
edge({ from: source, to: point, ...base, certainty: 'definite' });
|
|
119
|
+
// Both arms are declared alternatives; an absent arm ends. `else` first so `then` is placed first.
|
|
120
|
+
pending.push({ leave: value });
|
|
155
121
|
pending.push({
|
|
156
|
-
from: point,
|
|
157
|
-
value: branch.else,
|
|
158
|
-
path: [...path, 'else'],
|
|
159
|
-
label: 'NO',
|
|
122
|
+
from: point, value: value.else, path: [...path, 'else'], role, conditional: true, label: 'NO', arm: 'else',
|
|
160
123
|
});
|
|
161
124
|
pending.push({
|
|
162
|
-
from: point,
|
|
163
|
-
value: branch.then,
|
|
164
|
-
path: [...path, 'then'],
|
|
165
|
-
label: 'YES',
|
|
125
|
+
from: point, value: value.then, path: [...path, 'then'], role, conditional: true, label: 'YES', arm: 'then',
|
|
166
126
|
});
|
|
167
127
|
continue;
|
|
168
128
|
}
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
for (const target of targets) {
|
|
183
|
-
edges.push({ from: point, to: step_(target) });
|
|
129
|
+
const target = resolveRouteTarget(value, known);
|
|
130
|
+
switch (target.kind) {
|
|
131
|
+
case 'end':
|
|
132
|
+
break;
|
|
133
|
+
case 'step':
|
|
134
|
+
edge({ from: source, to: step_(target.key), ...base, certainty: 'definite' });
|
|
135
|
+
break;
|
|
136
|
+
case 'dynamic': {
|
|
137
|
+
// Nothing is evaluated: the candidates are possible, and an expression naming none is unresolved.
|
|
138
|
+
if (target.candidates.length === 0) {
|
|
139
|
+
const point = junction(owner, [...path, 'unknown'], 'unknown', 'Unresolved route');
|
|
140
|
+
edge({ from: source, to: point, ...base, certainty: 'possible' });
|
|
141
|
+
break;
|
|
184
142
|
}
|
|
185
|
-
|
|
143
|
+
const point = junction(owner, [...path, 'expression'], 'expression', 'Possible route');
|
|
144
|
+
edge({ from: source, to: point, ...base, certainty: 'possible' });
|
|
145
|
+
for (const candidate of target.candidates) {
|
|
146
|
+
edge({ from: point, to: step_(candidate), role, certainty: 'possible' });
|
|
147
|
+
}
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
case 'missing': {
|
|
151
|
+
// A literal key is not payload: naming it is how the reader finds the typo.
|
|
152
|
+
const point = junction(owner, [...path, 'unknown'], 'unknown', target.text);
|
|
153
|
+
edge({ from: source, to: point, ...base, certainty: 'definite' });
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
case 'invalid': {
|
|
157
|
+
const point = junction(owner, [...path, 'unknown'], 'unknown', 'Invalid route');
|
|
158
|
+
edge({ from: source, to: point, ...base, certainty: 'definite' });
|
|
159
|
+
break;
|
|
186
160
|
}
|
|
187
161
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
for (const step of steps) {
|
|
165
|
+
const owner = String(step.key);
|
|
166
|
+
const from = step_(owner);
|
|
167
|
+
// Junctions are owned by one step: an object shared between two steps' routes is placed once per owner.
|
|
168
|
+
placed.clear();
|
|
169
|
+
if (step.onError !== null && step.onError !== undefined) {
|
|
170
|
+
walk(owner, { from, value: step.onError, path: ['onError'], role: 'recovery', conditional: false, label: 'onError' });
|
|
171
|
+
}
|
|
172
|
+
const route = declaredRoute(step);
|
|
173
|
+
if (route.mode === 'switch') {
|
|
174
|
+
// The arms are the payload KEYS — exact target keys, never rendered, each only a possible choice.
|
|
175
|
+
const point = junction(owner, [route.field, 'switch'], 'switch', 'Switch');
|
|
176
|
+
edge({ from, to: point, role: 'branch', certainty: 'definite' });
|
|
177
|
+
for (const arm of Object.keys(route.value)) {
|
|
178
|
+
const to = known.has(arm)
|
|
179
|
+
? step_(arm)
|
|
180
|
+
: junction(owner, [route.field, 'switch', 'unknown'], 'unknown', 'Unresolved route');
|
|
181
|
+
edge({ from: point, to, role: 'branch', certainty: 'possible', arm: 'case', label: arm });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (route.mode === 'invalid') {
|
|
185
|
+
const point = junction(owner, [route.field, 'unknown'], 'unknown', 'Invalid route');
|
|
186
|
+
edge({ from, to: point, role: route.role, certainty: 'definite' });
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
walk(owner, { from, value: route.value, path: [route.field], role: route.role, conditional: true });
|
|
191
190
|
}
|
|
192
191
|
/**
|
|
193
192
|
* The exception BACK-REFERENCE, which is reversed: an edge INTO this step from the one that threw. No junction —
|
|
194
193
|
* it is a direct edge between two authored steps.
|
|
195
194
|
*/
|
|
196
195
|
if (step.fromStep && known.has(step.fromStep)) {
|
|
197
|
-
|
|
198
|
-
from: step_(step.fromStep),
|
|
199
|
-
to: step_(owner),
|
|
200
|
-
label: 'Exception',
|
|
201
|
-
});
|
|
196
|
+
edge({ from: step_(step.fromStep), to: step_(owner), label: 'Exception', role: 'exception', certainty: 'definite' });
|
|
202
197
|
}
|
|
203
198
|
}
|
|
204
199
|
return { junctions, edges };
|
|
@@ -207,8 +202,7 @@ export function routeGraph(steps) {
|
|
|
207
202
|
export function junctionAddress(ownerAddress, path) {
|
|
208
203
|
return nodeAddress([
|
|
209
204
|
keySegment(ownerAddress),
|
|
210
|
-
//
|
|
211
|
-
// SWITCH arm — `entrySegment` normalises both and refuses a `!`-prefixed one.
|
|
205
|
+
// Path elements are document keys (`next`, `then`, `data`) or fixed synthetic words (`if`, `switch`, `unknown`).
|
|
212
206
|
...path.map((element) => entrySegment(element) ?? keySegment(element)),
|
|
213
207
|
]);
|
|
214
208
|
}
|
package/dist/routeGraph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeGraph.js","sourceRoot":"","sources":["../src/routeGraph.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"routeGraph.js","sourceRoot":"","sources":["../src/routeGraph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH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W,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;QACvH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAC7B,YAAoB,EACpB,IAAuB;IAEvB,OAAO,WAAW,CAAC;QACjB,UAAU,CAAC,YAAY,CAAC;QACxB,iHAAiH;QACjH,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;KACvE,CAAC,CAAC;AACL,CAAC"}
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Where a step goes next — Story 4.1 AC-2, all five kinds, in the MODEL rather than in a renderer.
|
|
3
3
|
*
|
|
4
|
-
* The semantics are the runtime's
|
|
5
|
-
*
|
|
4
|
+
* The semantics are the runtime's (`assets/docs/routing/NEXT.md`, `steps/IF.md`, `steps/SWITCH.md`). This package
|
|
5
|
+
* does not invent them; NFR-1 says the editor invents no semantics the runtime lacks.
|
|
6
6
|
*
|
|
7
|
-
* | kind | where it is declared |
|
|
7
|
+
* | kind | where it is declared | static meaning |
|
|
8
8
|
* | --- | --- | --- |
|
|
9
|
-
* | by step TYPE | `IF`
|
|
10
|
-
* | by step DATA | `{ if, then, else }` on `next` or
|
|
11
|
-
* | an EXPRESSION | a Scriban
|
|
12
|
-
* | an ERROR route | `onError` |
|
|
13
|
-
* | an exception BACK-REFERENCE | `fromStep` → this step |
|
|
9
|
+
* | by step TYPE | exact `IF` routes its WHOLE payload; exact `SWITCH` reads payload KEYS | declared `next` is ignored |
|
|
10
|
+
* | by step DATA | `{ if, then, else }` on `next` or an IF payload | both arms are declared alternatives |
|
|
11
|
+
* | an EXPRESSION | a Scriban/rendered route string | quoted known keys are POSSIBLE candidates only |
|
|
12
|
+
* | an ERROR route | `onError` (`<KEY \| null>`) | recovery |
|
|
13
|
+
* | an exception BACK-REFERENCE | `fromStep` → this step | exception |
|
|
14
14
|
*
|
|
15
|
-
* ###
|
|
15
|
+
* ### IF and SWITCH route through their payload, never through `next`
|
|
16
16
|
*
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* An `IF` evaluates its whole payload as one route node: `null` ends the flow, a string routes to that string, an
|
|
18
|
+
* object is a conditional. The step's own `next` is never a fallback — not when the payload is `null`, and not when a
|
|
19
|
+
* conditional omits both arms. A `SWITCH` payload is a map whose property NAMES are exact target keys (no `cases`
|
|
20
|
+
* wrapper, no list, no default); zero matches end and several matches fail, so every arm is only a possible route.
|
|
21
|
+
* A non-object SWITCH payload fails the step. Step types are exact: `If` and `switch` are ordinary steps.
|
|
22
22
|
*
|
|
23
23
|
* ### An unresolvable route is REPORTED, not dropped
|
|
24
24
|
*
|
|
25
25
|
* A route naming no step in the stage yields an edge with `raw` and no `to`. A reader needs to see the dead end:
|
|
26
26
|
* silently dropping it draws a flow that terminates where the document does not say it terminates, which is the
|
|
27
|
-
* more expensive error. Same for an expression whose quoted keys match nothing.
|
|
27
|
+
* more expensive error. Same for an expression whose quoted keys match nothing, and for a value the grammar rejects.
|
|
28
28
|
*/
|
|
29
29
|
/** A step as routing needs to see it. Deliberately structural — this package reads no schema and no file. */
|
|
30
30
|
export interface RoutableStep {
|
|
31
31
|
readonly key: string;
|
|
32
32
|
/** Raw `next`: a step key, a `{ if, then, else }` branch, a Scriban expression, or absent. */
|
|
33
33
|
readonly next?: unknown;
|
|
34
|
-
/** The
|
|
34
|
+
/** The exact selected executor; case-sensitive, with no trimming. */
|
|
35
35
|
readonly stepType?: string;
|
|
36
|
-
/**
|
|
36
|
+
/** The SELECTED payload (own `data`, even `null`, else legacy `input`); `IF`/`SWITCH` route through it. */
|
|
37
37
|
readonly data?: unknown;
|
|
38
|
+
/** Which authored field supplied `data`, so a branch is addressed where it is written. Defaults to `data`. */
|
|
39
|
+
readonly payloadField?: 'data' | 'input';
|
|
38
40
|
/** A recovery target. */
|
|
39
41
|
readonly onError?: unknown;
|
|
40
42
|
/** An Exception step's back-reference: the step whose failure reaches this one. */
|
|
@@ -46,7 +48,7 @@ export interface RouteEdge {
|
|
|
46
48
|
readonly from: string;
|
|
47
49
|
/** The step it reaches, when that step exists in this stage. */
|
|
48
50
|
readonly to?: string;
|
|
49
|
-
/** `YES`, `NO`, a SWITCH
|
|
51
|
+
/** `YES`, `NO`, a SWITCH target key, `onError`, `Exception`. */
|
|
50
52
|
readonly label?: string;
|
|
51
53
|
/**
|
|
52
54
|
* The route text when it does not name a known step — an expression, or a dead end.
|
|
@@ -55,13 +57,65 @@ export interface RouteEdge {
|
|
|
55
57
|
* a static view cannot know, and showing the expression is how the reader learns that.
|
|
56
58
|
*/
|
|
57
59
|
readonly raw?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The grammar REJECTED the route value — a scalar, list or object where a key is required, or a non-object SWITCH
|
|
62
|
+
* payload — so the run fails if it is taken. `raw` then carries only a flat description (`true`, `7`, `list`,
|
|
63
|
+
* `object`), which is why this marker exists: `data: true` and a literal missing key `'true'` share the same `raw`.
|
|
64
|
+
*/
|
|
65
|
+
readonly invalid?: true;
|
|
58
66
|
}
|
|
59
|
-
/** Every `"QUOTED_KEY"` in an expression. */
|
|
67
|
+
/** Every `"QUOTED_KEY"` in an expression, once each, in first-appearance order. */
|
|
60
68
|
export declare function quotedKeys(expression: string): readonly string[];
|
|
61
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Is this route text DYNAMIC — rendered by Scriban into something other than itself?
|
|
71
|
+
*
|
|
72
|
+
* Scriban (`{{ … }}` / `{% … %}`) or a rendered conditional object (trimmed text beginning with `{`). Plain text,
|
|
73
|
+
* including text with quotes in it, renders to itself and is a literal key.
|
|
74
|
+
*/
|
|
62
75
|
export declare function looksLikeExpression(text: string): boolean;
|
|
76
|
+
/** A `{ if, then, else }` route node. Arrays and scalars are not conditionals. */
|
|
77
|
+
export declare function isConditionalRoute(value: unknown): value is Readonly<Record<string, unknown>>;
|
|
78
|
+
/** What one non-conditional route value statically resolves to. */
|
|
79
|
+
export type RouteTarget =
|
|
80
|
+
/** Absent, `null` or blank: the branch ends normally. */
|
|
81
|
+
{
|
|
82
|
+
readonly kind: 'end';
|
|
83
|
+
}
|
|
84
|
+
/** An exact literal key of a step in this list. */
|
|
85
|
+
| {
|
|
86
|
+
readonly kind: 'step';
|
|
87
|
+
readonly key: string;
|
|
88
|
+
}
|
|
89
|
+
/** Rendered at run time; `candidates` are the known keys it names, which are POSSIBLE, never definite. */
|
|
90
|
+
| {
|
|
91
|
+
readonly kind: 'dynamic';
|
|
92
|
+
readonly text: string;
|
|
93
|
+
readonly candidates: readonly string[];
|
|
94
|
+
}
|
|
95
|
+
/** A literal naming no step in this list: the run fails if it is taken. */
|
|
96
|
+
| {
|
|
97
|
+
readonly kind: 'missing';
|
|
98
|
+
readonly text: string;
|
|
99
|
+
}
|
|
100
|
+
/** A number, boolean, list or object where the grammar does not allow one: the run fails. */
|
|
101
|
+
| {
|
|
102
|
+
readonly kind: 'invalid';
|
|
103
|
+
};
|
|
104
|
+
/** Resolve one route value that is not walked as a conditional. No expression is evaluated. */
|
|
105
|
+
export declare function resolveRouteTarget(value: unknown, known: ReadonlySet<string>): RouteTarget;
|
|
106
|
+
/** The route a step declares for its successful completion, chosen by its exact executor. */
|
|
107
|
+
export interface DeclaredRoute {
|
|
108
|
+
/** The authored field the route is read from: `next`, or the IF/SWITCH payload field. */
|
|
109
|
+
readonly field: 'next' | 'data' | 'input';
|
|
110
|
+
readonly value: unknown;
|
|
111
|
+
/** `next` for a declared successor; `branch` for an IF/SWITCH payload route. */
|
|
112
|
+
readonly role: 'next' | 'branch';
|
|
113
|
+
/** `route` walks the `next` grammar; `switch` reads target KEYS; `invalid` is a payload that fails the step. */
|
|
114
|
+
readonly mode: 'route' | 'switch' | 'invalid';
|
|
115
|
+
}
|
|
116
|
+
export declare function declaredRoute(step: RoutableStep): DeclaredRoute;
|
|
63
117
|
/**
|
|
64
|
-
* Every edge the steps of ONE stage declare.
|
|
118
|
+
* Every edge the steps of ONE stage declare, flat.
|
|
65
119
|
*
|
|
66
120
|
* Iterative, never recursive: `then`/`else` nest without bound and a document is untrusted input, so a deep branch
|
|
67
121
|
* must not be able to exhaust the stack. (The same rule the puller step standards state: *no recursion — stack or
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,6GAA6G;AAC7G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,6GAA6G;AAC7G,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,2GAA2G;IAC3G,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,8GAA8G;IAC9G,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzC,yBAAyB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,mCA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