@xxrandr/conecta-diagram 0.0.0-stage → 0.1.4
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/LICENSE +21 -0
- package/README.md +319 -2
- package/dist/chunk-3QGSCPWL.cjs +663 -0
- package/dist/chunk-43VYPB4U.js +2136 -0
- package/dist/chunk-6ADTOXBT.cjs +626 -0
- package/dist/chunk-B2RLLFGC.js +0 -0
- package/dist/chunk-GXOBW2BK.js +290 -0
- package/dist/chunk-HZER5BPR.js +1122 -0
- package/dist/chunk-IT5H6WO2.js +626 -0
- package/dist/chunk-LKOWNTPR.cjs +1 -0
- package/dist/chunk-Q62JPMJH.js +663 -0
- package/dist/chunk-QI4NNFRQ.cjs +290 -0
- package/dist/chunk-VD32JNDO.cjs +2136 -0
- package/dist/chunk-ZMSQTBVW.cjs +1122 -0
- package/dist/core/index.cjs +56 -0
- package/dist/core/index.d.cts +65 -0
- package/dist/core/index.d.ts +65 -0
- package/dist/core/index.js +56 -0
- package/dist/d3/index.cjs +8 -0
- package/dist/d3/index.d.cts +46 -0
- package/dist/d3/index.d.ts +46 -0
- package/dist/d3/index.js +8 -0
- package/dist/index.cjs +71 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +71 -0
- package/dist/photon.css +339 -0
- package/dist/runner-display-BkBJpBY-.d.ts +151 -0
- package/dist/runner-display-DHHtavSX.d.cts +151 -0
- package/dist/store-CtOInpPu.d.cts +242 -0
- package/dist/store-CtOInpPu.d.ts +242 -0
- package/dist/svg/index.cjs +15 -0
- package/dist/svg/index.d.cts +172 -0
- package/dist/svg/index.d.ts +172 -0
- package/dist/svg/index.js +15 -0
- package/docs/devtools-refactor.md +93 -0
- package/docs/java-runtime-integration.md +268 -0
- package/docs/photon-template.html +547 -0
- package/docs/presentation-architecture.md +30 -0
- package/docs/runner-display.md +109 -0
- package/package.json +130 -4
package/dist/photon.css
ADDED
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/* src/svg/photon.css */
|
|
2
|
+
:root {
|
|
3
|
+
color-scheme: light;
|
|
4
|
+
--font-sans:
|
|
5
|
+
-apple-system,
|
|
6
|
+
BlinkMacSystemFont,
|
|
7
|
+
"Segoe UI",
|
|
8
|
+
Inter,
|
|
9
|
+
Roboto,
|
|
10
|
+
Helvetica,
|
|
11
|
+
Arial,
|
|
12
|
+
sans-serif;
|
|
13
|
+
--font-mono:
|
|
14
|
+
ui-monospace,
|
|
15
|
+
"SF Mono",
|
|
16
|
+
"Fira Code",
|
|
17
|
+
Menlo,
|
|
18
|
+
Consolas,
|
|
19
|
+
monospace;
|
|
20
|
+
--app-bg: #ededf0;
|
|
21
|
+
--canvas-bg: #f9f9fa;
|
|
22
|
+
--dot: #d7d7db;
|
|
23
|
+
--surface: #ffffff;
|
|
24
|
+
--border: #d7d7db;
|
|
25
|
+
--border-strong: #b1b1b3;
|
|
26
|
+
--text: #0c0c0d;
|
|
27
|
+
--text-secondary: #4a4a4f;
|
|
28
|
+
--text-muted: #737373;
|
|
29
|
+
--icon-bg: #ededf0;
|
|
30
|
+
--chip-bg: #ededf0;
|
|
31
|
+
--accent: #0060df;
|
|
32
|
+
--selection-glow: rgba(0, 96, 223, 0.16);
|
|
33
|
+
--shadow-card: 0 1px 2px rgba(12, 12, 13, 0.06);
|
|
34
|
+
--shadow-card-hover: 0 2px 8px rgba(12, 12, 13, 0.1);
|
|
35
|
+
}
|
|
36
|
+
html[data-theme=dark] {
|
|
37
|
+
color-scheme: dark;
|
|
38
|
+
--app-bg: #0c0c0d;
|
|
39
|
+
--canvas-bg: #141414;
|
|
40
|
+
--dot: #2a2a2e;
|
|
41
|
+
--surface: #1c1c1f;
|
|
42
|
+
--border: #35353a;
|
|
43
|
+
--border-strong: #4a4a4f;
|
|
44
|
+
--text: #f9f9fa;
|
|
45
|
+
--text-secondary: #d7d7db;
|
|
46
|
+
--text-muted: #9a9aa2;
|
|
47
|
+
--icon-bg: #2a2a2e;
|
|
48
|
+
--chip-bg: #2a2a2e;
|
|
49
|
+
--accent: #0a84ff;
|
|
50
|
+
--selection-glow: rgba(10, 132, 255, 0.24);
|
|
51
|
+
--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
|
|
52
|
+
--shadow-card-hover: 0 2px 10px rgba(0, 0, 0, 0.5);
|
|
53
|
+
}
|
|
54
|
+
.flow-node {
|
|
55
|
+
position: relative;
|
|
56
|
+
width: 300px;
|
|
57
|
+
padding: 14px 16px 12px;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
border: 1px solid var(--border);
|
|
60
|
+
border-radius: 8px;
|
|
61
|
+
background: var(--surface);
|
|
62
|
+
box-shadow: var(--shadow-card);
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
transition:
|
|
65
|
+
border-color 0.12s ease,
|
|
66
|
+
box-shadow 0.12s ease,
|
|
67
|
+
background-color 0.12s ease;
|
|
68
|
+
color: var(--text);
|
|
69
|
+
font-family: var(--font-sans);
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
}
|
|
72
|
+
.flow-node::before {
|
|
73
|
+
content: "";
|
|
74
|
+
position: absolute;
|
|
75
|
+
inset: 0 auto 0 0;
|
|
76
|
+
width: 3px;
|
|
77
|
+
background: var(--node-accent);
|
|
78
|
+
opacity: 0.9;
|
|
79
|
+
}
|
|
80
|
+
.flow-node:hover {
|
|
81
|
+
border-color: var(--border-strong);
|
|
82
|
+
box-shadow: var(--shadow-card-hover);
|
|
83
|
+
}
|
|
84
|
+
.flow-node.selected {
|
|
85
|
+
border-color: var(--accent);
|
|
86
|
+
box-shadow: 0 0 0 3px var(--selection-glow), var(--shadow-card-hover);
|
|
87
|
+
}
|
|
88
|
+
.flow-node:focus-visible,
|
|
89
|
+
[data-node-id]:focus-visible .flow-node {
|
|
90
|
+
outline: 2px solid var(--accent);
|
|
91
|
+
outline-offset: 2px;
|
|
92
|
+
}
|
|
93
|
+
.flow-node[data-kind=process] {
|
|
94
|
+
--node-accent: #0060df;
|
|
95
|
+
--node-accent-soft: rgba(0, 96, 223, 0.1);
|
|
96
|
+
}
|
|
97
|
+
.flow-node[data-kind=service] {
|
|
98
|
+
--node-accent: #008eaa;
|
|
99
|
+
--node-accent-soft: rgba(0, 142, 170, 0.12);
|
|
100
|
+
}
|
|
101
|
+
html[data-theme=dark] .flow-node[data-kind=process] {
|
|
102
|
+
--node-accent: #0a84ff;
|
|
103
|
+
--node-accent-soft: rgba(10, 132, 255, 0.16);
|
|
104
|
+
}
|
|
105
|
+
html[data-theme=dark] .flow-node[data-kind=service] {
|
|
106
|
+
--node-accent: #00c2d1;
|
|
107
|
+
--node-accent-soft: rgba(0, 194, 209, 0.16);
|
|
108
|
+
}
|
|
109
|
+
.flow-node:is([data-kind=task], [data-kind=decision], [data-kind=wait], [data-kind=fork], [data-kind=join], [data-kind=start], [data-kind=end], [data-kind=generic], [data-kind=cancel]) {
|
|
110
|
+
--node-accent: var(--accent);
|
|
111
|
+
--node-accent-soft: var(--selection-glow);
|
|
112
|
+
}
|
|
113
|
+
.flow-node:is([data-kind=api], [data-kind=database], [data-kind=file], [data-kind=ssh], [data-kind=sftp], [data-kind=mail], [data-kind=messaging], [data-kind=event]) {
|
|
114
|
+
--node-accent: #008eaa;
|
|
115
|
+
--node-accent-soft: rgba(0, 142, 170, 0.12);
|
|
116
|
+
}
|
|
117
|
+
html[data-theme=dark] .flow-node:is([data-kind=api], [data-kind=database], [data-kind=file], [data-kind=ssh], [data-kind=sftp], [data-kind=mail], [data-kind=messaging], [data-kind=event]) {
|
|
118
|
+
--node-accent: #00c2d1;
|
|
119
|
+
--node-accent-soft: rgba(0, 194, 209, 0.16);
|
|
120
|
+
}
|
|
121
|
+
.node-header {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
gap: 10px;
|
|
125
|
+
}
|
|
126
|
+
.node-icon {
|
|
127
|
+
display: grid;
|
|
128
|
+
place-items: center;
|
|
129
|
+
width: 32px;
|
|
130
|
+
height: 32px;
|
|
131
|
+
flex: 0 0 32px;
|
|
132
|
+
border-radius: 6px;
|
|
133
|
+
background: var(--icon-bg);
|
|
134
|
+
color: var(--node-accent);
|
|
135
|
+
transition: background-color 0.12s ease;
|
|
136
|
+
}
|
|
137
|
+
.flow-node.selected .node-icon {
|
|
138
|
+
background: var(--node-accent-soft);
|
|
139
|
+
}
|
|
140
|
+
.node-icon svg {
|
|
141
|
+
width: 18px;
|
|
142
|
+
height: 18px;
|
|
143
|
+
fill: none;
|
|
144
|
+
stroke: currentColor;
|
|
145
|
+
stroke-width: 1.7;
|
|
146
|
+
stroke-linecap: round;
|
|
147
|
+
stroke-linejoin: round;
|
|
148
|
+
}
|
|
149
|
+
.node-title {
|
|
150
|
+
font-size: 13.5px;
|
|
151
|
+
font-weight: 600;
|
|
152
|
+
line-height: 18px;
|
|
153
|
+
letter-spacing: -0.01em;
|
|
154
|
+
}
|
|
155
|
+
.node-subtitle {
|
|
156
|
+
margin-top: 1px;
|
|
157
|
+
font-size: 11px;
|
|
158
|
+
line-height: 15px;
|
|
159
|
+
color: var(--text-muted);
|
|
160
|
+
}
|
|
161
|
+
.signals {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-wrap: wrap;
|
|
164
|
+
gap: 6px;
|
|
165
|
+
margin: 12px 0 10px;
|
|
166
|
+
}
|
|
167
|
+
.signal {
|
|
168
|
+
display: inline-flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
gap: 5px;
|
|
171
|
+
padding: 2px 8px 2px 6px;
|
|
172
|
+
border-radius: 20px;
|
|
173
|
+
background: var(--chip-bg);
|
|
174
|
+
color: var(--text-secondary);
|
|
175
|
+
font-family: var(--font-mono);
|
|
176
|
+
font-size: 10px;
|
|
177
|
+
line-height: 16px;
|
|
178
|
+
white-space: nowrap;
|
|
179
|
+
}
|
|
180
|
+
.signal svg {
|
|
181
|
+
width: 12px;
|
|
182
|
+
height: 12px;
|
|
183
|
+
flex: 0 0 12px;
|
|
184
|
+
fill: none;
|
|
185
|
+
stroke: var(--text-muted);
|
|
186
|
+
stroke-width: 1.7;
|
|
187
|
+
stroke-linecap: round;
|
|
188
|
+
stroke-linejoin: round;
|
|
189
|
+
}
|
|
190
|
+
.action-preview {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
gap: 6px;
|
|
194
|
+
margin: 0 0 12px;
|
|
195
|
+
}
|
|
196
|
+
.preview-label {
|
|
197
|
+
font-size: 9.5px;
|
|
198
|
+
font-weight: 600;
|
|
199
|
+
letter-spacing: 0.08em;
|
|
200
|
+
text-transform: uppercase;
|
|
201
|
+
color: var(--text-muted);
|
|
202
|
+
}
|
|
203
|
+
.preview-value {
|
|
204
|
+
padding: 1px 5px;
|
|
205
|
+
border-radius: 3px;
|
|
206
|
+
background: var(--chip-bg);
|
|
207
|
+
color: var(--text-secondary);
|
|
208
|
+
font-family: var(--font-mono);
|
|
209
|
+
font-size: 10.5px;
|
|
210
|
+
line-height: 16px;
|
|
211
|
+
}
|
|
212
|
+
.node-divider {
|
|
213
|
+
height: 1px;
|
|
214
|
+
margin: 0 0 9px;
|
|
215
|
+
background: var(--border);
|
|
216
|
+
}
|
|
217
|
+
.node-footer {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: space-between;
|
|
221
|
+
gap: 10px;
|
|
222
|
+
}
|
|
223
|
+
.execution {
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 6px;
|
|
227
|
+
font-size: 11px;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
color: var(--text-secondary);
|
|
230
|
+
}
|
|
231
|
+
.status-dot {
|
|
232
|
+
width: 6px;
|
|
233
|
+
height: 6px;
|
|
234
|
+
border-radius: 50%;
|
|
235
|
+
background: var(--text-muted);
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
}
|
|
238
|
+
.action-type {
|
|
239
|
+
font-family: var(--font-mono);
|
|
240
|
+
font-size: 10px;
|
|
241
|
+
color: var(--text-muted);
|
|
242
|
+
}
|
|
243
|
+
.theme-toggle {
|
|
244
|
+
display: inline-flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
gap: 6px;
|
|
247
|
+
padding: 5px 10px;
|
|
248
|
+
border: 1px solid var(--border);
|
|
249
|
+
border-radius: 4px;
|
|
250
|
+
background: var(--surface);
|
|
251
|
+
color: var(--text-secondary);
|
|
252
|
+
font: inherit;
|
|
253
|
+
font-size: 12px;
|
|
254
|
+
font-weight: 500;
|
|
255
|
+
line-height: 18px;
|
|
256
|
+
cursor: pointer;
|
|
257
|
+
transition:
|
|
258
|
+
background-color 0.12s ease,
|
|
259
|
+
border-color 0.12s ease,
|
|
260
|
+
color 0.12s ease;
|
|
261
|
+
}
|
|
262
|
+
.theme-toggle:hover {
|
|
263
|
+
background: var(--chip-bg);
|
|
264
|
+
border-color: var(--border-strong);
|
|
265
|
+
color: var(--text);
|
|
266
|
+
}
|
|
267
|
+
.theme-toggle:focus-visible {
|
|
268
|
+
outline: 2px solid var(--accent);
|
|
269
|
+
outline-offset: 2px;
|
|
270
|
+
}
|
|
271
|
+
.flow-node--embedded {
|
|
272
|
+
height: calc(100% - 8px);
|
|
273
|
+
margin: 4px;
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
}
|
|
277
|
+
.node-header > div:last-child {
|
|
278
|
+
min-width: 0;
|
|
279
|
+
}
|
|
280
|
+
.flow-node--embedded .node-title,
|
|
281
|
+
.flow-node--embedded .node-subtitle,
|
|
282
|
+
.flow-node--embedded .preview-value,
|
|
283
|
+
.flow-node--embedded .action-type {
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
text-overflow: ellipsis;
|
|
286
|
+
white-space: nowrap;
|
|
287
|
+
}
|
|
288
|
+
.flow-node--embedded .signals {
|
|
289
|
+
min-height: 20px;
|
|
290
|
+
max-height: 46px;
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
flex-shrink: 0;
|
|
293
|
+
}
|
|
294
|
+
.flow-node--embedded .signal {
|
|
295
|
+
max-width: 100%;
|
|
296
|
+
overflow: hidden;
|
|
297
|
+
text-overflow: ellipsis;
|
|
298
|
+
box-sizing: border-box;
|
|
299
|
+
}
|
|
300
|
+
.flow-node--embedded .node-divider {
|
|
301
|
+
margin-top: auto;
|
|
302
|
+
flex-shrink: 0;
|
|
303
|
+
}
|
|
304
|
+
.flow-node--embedded .execution {
|
|
305
|
+
min-width: 0;
|
|
306
|
+
max-width: 160px;
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
white-space: nowrap;
|
|
309
|
+
}
|
|
310
|
+
.flow-node--embedded .action-type {
|
|
311
|
+
max-width: 125px;
|
|
312
|
+
}
|
|
313
|
+
.signal[data-observed=true] svg,
|
|
314
|
+
.flow-node:is([data-state=active], [data-state=running], [data-state=streaming], [data-state=succeeded], [data-state=completed]) .status-dot {
|
|
315
|
+
color: var(--accent);
|
|
316
|
+
stroke: var(--accent);
|
|
317
|
+
background: var(--accent);
|
|
318
|
+
}
|
|
319
|
+
.flow-node:is([data-state=failed], [data-state=timed_out], [data-state=rejected], [data-state=cancelled]) .status-dot {
|
|
320
|
+
border-radius: 0;
|
|
321
|
+
background: var(--text-secondary);
|
|
322
|
+
}
|
|
323
|
+
.flow-node--embedded .execution-detail {
|
|
324
|
+
position: absolute;
|
|
325
|
+
width: 1px;
|
|
326
|
+
height: 1px;
|
|
327
|
+
overflow: hidden;
|
|
328
|
+
clip-path: inset(50%);
|
|
329
|
+
white-space: nowrap;
|
|
330
|
+
}
|
|
331
|
+
[data-node-id]:focus-visible {
|
|
332
|
+
outline: none;
|
|
333
|
+
}
|
|
334
|
+
@media (prefers-reduced-motion: reduce) {
|
|
335
|
+
.flow-node,
|
|
336
|
+
.theme-toggle {
|
|
337
|
+
transition: none;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { F as FlowDocument, d as Context } from './store-CtOInpPu.js';
|
|
2
|
+
|
|
3
|
+
interface ForkFrame {
|
|
4
|
+
group: string;
|
|
5
|
+
fork: string;
|
|
6
|
+
join: string;
|
|
7
|
+
branch: string;
|
|
8
|
+
expected: number;
|
|
9
|
+
}
|
|
10
|
+
interface SimulationToken {
|
|
11
|
+
id: string;
|
|
12
|
+
nodeId: string;
|
|
13
|
+
status: "ready" | "async" | "signal" | "joining";
|
|
14
|
+
frames: ForkFrame[];
|
|
15
|
+
}
|
|
16
|
+
interface SimulationEvent {
|
|
17
|
+
sequence: number;
|
|
18
|
+
type: "entered" | "completed" | "traversed" | "waiting" | "failed" | "cancelled";
|
|
19
|
+
nodeId?: string;
|
|
20
|
+
tokenId?: string;
|
|
21
|
+
edgeId?: string;
|
|
22
|
+
message?: string;
|
|
23
|
+
}
|
|
24
|
+
interface SimulationSnapshot {
|
|
25
|
+
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
26
|
+
context: Context;
|
|
27
|
+
tokens: SimulationToken[];
|
|
28
|
+
completedNodes: string[];
|
|
29
|
+
traversedEdges: string[];
|
|
30
|
+
events: SimulationEvent[];
|
|
31
|
+
steps: number;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
interface SimulationOptions {
|
|
35
|
+
traceLimit?: number;
|
|
36
|
+
maxTokens?: number;
|
|
37
|
+
}
|
|
38
|
+
interface RunResult {
|
|
39
|
+
reason: SimulationSnapshot["status"] | "step-limit";
|
|
40
|
+
snapshot: SimulationSnapshot;
|
|
41
|
+
}
|
|
42
|
+
/** Deterministic token simulation. Never invokes handlers, evaluates code or creates timers. */
|
|
43
|
+
declare class FlowSimulator {
|
|
44
|
+
private readonly document;
|
|
45
|
+
private state;
|
|
46
|
+
private nextId;
|
|
47
|
+
private sequence;
|
|
48
|
+
private readonly traceLimit;
|
|
49
|
+
private readonly maxTokens;
|
|
50
|
+
constructor(document: FlowDocument, context?: Context, options?: SimulationOptions);
|
|
51
|
+
getSnapshot(): SimulationSnapshot;
|
|
52
|
+
/** Process one ready token, using stable FIFO order. */
|
|
53
|
+
step(): SimulationSnapshot;
|
|
54
|
+
run(maxSteps?: number): RunResult;
|
|
55
|
+
/** Complete one async activation, not every activation of the same node. */
|
|
56
|
+
complete(tokenId: string, patch?: Context): SimulationSnapshot;
|
|
57
|
+
/** External applications collect user input and explicitly deliver it here. */
|
|
58
|
+
signal(tokenId: string, signal: string, patch?: Context): SimulationSnapshot;
|
|
59
|
+
fail(tokenId: string, message: string): SimulationSnapshot;
|
|
60
|
+
cancel(): SimulationSnapshot;
|
|
61
|
+
private resume;
|
|
62
|
+
private findWaiting;
|
|
63
|
+
private advance;
|
|
64
|
+
private traverse;
|
|
65
|
+
private completed;
|
|
66
|
+
private failToken;
|
|
67
|
+
private remove;
|
|
68
|
+
private id;
|
|
69
|
+
private terminal;
|
|
70
|
+
private refresh;
|
|
71
|
+
private event;
|
|
72
|
+
private checkContext;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type RunnerStatus = "ACCEPTED" | "RUNNING" | "STREAMING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "TIMED_OUT" | "REJECTED";
|
|
76
|
+
type DisplayStatus = "idle" | "active" | "waiting" | "accepted" | "running" | "streaming" | "completed" | "succeeded" | "failed" | "cancelled" | "timed_out" | "rejected";
|
|
77
|
+
interface DisplayProgress {
|
|
78
|
+
current: string;
|
|
79
|
+
total?: string;
|
|
80
|
+
unit: "bytes" | "rows" | "items";
|
|
81
|
+
}
|
|
82
|
+
interface TransferObservation {
|
|
83
|
+
id: string;
|
|
84
|
+
offset: string;
|
|
85
|
+
chunkSequence: string;
|
|
86
|
+
size: string;
|
|
87
|
+
totalSize?: string;
|
|
88
|
+
final: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface NodeExecution {
|
|
91
|
+
status: DisplayStatus;
|
|
92
|
+
detail?: string;
|
|
93
|
+
commandId?: string;
|
|
94
|
+
sequence?: string;
|
|
95
|
+
final?: boolean;
|
|
96
|
+
progress?: DisplayProgress;
|
|
97
|
+
transfer?: TransferObservation;
|
|
98
|
+
}
|
|
99
|
+
interface SignalObservation {
|
|
100
|
+
id: string;
|
|
101
|
+
nodeId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
direction: "in" | "out";
|
|
104
|
+
summary?: string;
|
|
105
|
+
}
|
|
106
|
+
interface DecisionObservation {
|
|
107
|
+
id: string;
|
|
108
|
+
nodeId: string;
|
|
109
|
+
edgeId: string;
|
|
110
|
+
reason: string;
|
|
111
|
+
}
|
|
112
|
+
interface ExecutionOverlay {
|
|
113
|
+
nodes: Record<string, NodeExecution>;
|
|
114
|
+
edges?: Record<string, "taken" | "skipped">;
|
|
115
|
+
decisions?: Record<string, DecisionObservation>;
|
|
116
|
+
signals?: SignalObservation[];
|
|
117
|
+
}
|
|
118
|
+
/** A redacted presentation DTO, not a generated protobuf codec or executor. */
|
|
119
|
+
interface RunnerResultPreview {
|
|
120
|
+
commandId: string;
|
|
121
|
+
status: RunnerStatus | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
122
|
+
sequence: string;
|
|
123
|
+
success: boolean;
|
|
124
|
+
final: boolean;
|
|
125
|
+
summary?: string;
|
|
126
|
+
error?: string;
|
|
127
|
+
progress?: DisplayProgress;
|
|
128
|
+
transfer?: TransferObservation;
|
|
129
|
+
}
|
|
130
|
+
declare function simulationOverlay(snapshot: SimulationSnapshot): ExecutionOverlay;
|
|
131
|
+
/** Correlates observed runner results with plan nodes. Does not send or run commands. */
|
|
132
|
+
declare class RunnerDisplay {
|
|
133
|
+
private readonly observationLimit;
|
|
134
|
+
private readonly document;
|
|
135
|
+
private readonly commands;
|
|
136
|
+
private readonly latest;
|
|
137
|
+
private readonly decisions;
|
|
138
|
+
private readonly signals;
|
|
139
|
+
private readonly seen;
|
|
140
|
+
constructor(document: FlowDocument, observationLimit?: number);
|
|
141
|
+
/** Register correlation only. This does not dispatch, accept or execute a command. */
|
|
142
|
+
track(commandId: string, nodeId: string): void;
|
|
143
|
+
applyResult(input: RunnerResultPreview): boolean;
|
|
144
|
+
observeSignal(observation: SignalObservation): void;
|
|
145
|
+
observeDecision(observation: DecisionObservation): void;
|
|
146
|
+
getOverlay(): ExecutionOverlay;
|
|
147
|
+
private remember;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { FlowSimulator as F, RunnerDisplay as d, simulationOverlay as s };
|
|
151
|
+
export type { DecisionObservation as D, ExecutionOverlay as E, NodeExecution as N, RunResult as R, SignalObservation as S, TransferObservation as T, DisplayProgress as a, DisplayStatus as b, ForkFrame as c, RunnerResultPreview as e, RunnerStatus as f, SimulationEvent as g, SimulationOptions as h, SimulationSnapshot as i, SimulationToken as j };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { F as FlowDocument, d as Context } from './store-CtOInpPu.cjs';
|
|
2
|
+
|
|
3
|
+
interface ForkFrame {
|
|
4
|
+
group: string;
|
|
5
|
+
fork: string;
|
|
6
|
+
join: string;
|
|
7
|
+
branch: string;
|
|
8
|
+
expected: number;
|
|
9
|
+
}
|
|
10
|
+
interface SimulationToken {
|
|
11
|
+
id: string;
|
|
12
|
+
nodeId: string;
|
|
13
|
+
status: "ready" | "async" | "signal" | "joining";
|
|
14
|
+
frames: ForkFrame[];
|
|
15
|
+
}
|
|
16
|
+
interface SimulationEvent {
|
|
17
|
+
sequence: number;
|
|
18
|
+
type: "entered" | "completed" | "traversed" | "waiting" | "failed" | "cancelled";
|
|
19
|
+
nodeId?: string;
|
|
20
|
+
tokenId?: string;
|
|
21
|
+
edgeId?: string;
|
|
22
|
+
message?: string;
|
|
23
|
+
}
|
|
24
|
+
interface SimulationSnapshot {
|
|
25
|
+
status: "running" | "waiting" | "completed" | "failed" | "cancelled";
|
|
26
|
+
context: Context;
|
|
27
|
+
tokens: SimulationToken[];
|
|
28
|
+
completedNodes: string[];
|
|
29
|
+
traversedEdges: string[];
|
|
30
|
+
events: SimulationEvent[];
|
|
31
|
+
steps: number;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
interface SimulationOptions {
|
|
35
|
+
traceLimit?: number;
|
|
36
|
+
maxTokens?: number;
|
|
37
|
+
}
|
|
38
|
+
interface RunResult {
|
|
39
|
+
reason: SimulationSnapshot["status"] | "step-limit";
|
|
40
|
+
snapshot: SimulationSnapshot;
|
|
41
|
+
}
|
|
42
|
+
/** Deterministic token simulation. Never invokes handlers, evaluates code or creates timers. */
|
|
43
|
+
declare class FlowSimulator {
|
|
44
|
+
private readonly document;
|
|
45
|
+
private state;
|
|
46
|
+
private nextId;
|
|
47
|
+
private sequence;
|
|
48
|
+
private readonly traceLimit;
|
|
49
|
+
private readonly maxTokens;
|
|
50
|
+
constructor(document: FlowDocument, context?: Context, options?: SimulationOptions);
|
|
51
|
+
getSnapshot(): SimulationSnapshot;
|
|
52
|
+
/** Process one ready token, using stable FIFO order. */
|
|
53
|
+
step(): SimulationSnapshot;
|
|
54
|
+
run(maxSteps?: number): RunResult;
|
|
55
|
+
/** Complete one async activation, not every activation of the same node. */
|
|
56
|
+
complete(tokenId: string, patch?: Context): SimulationSnapshot;
|
|
57
|
+
/** External applications collect user input and explicitly deliver it here. */
|
|
58
|
+
signal(tokenId: string, signal: string, patch?: Context): SimulationSnapshot;
|
|
59
|
+
fail(tokenId: string, message: string): SimulationSnapshot;
|
|
60
|
+
cancel(): SimulationSnapshot;
|
|
61
|
+
private resume;
|
|
62
|
+
private findWaiting;
|
|
63
|
+
private advance;
|
|
64
|
+
private traverse;
|
|
65
|
+
private completed;
|
|
66
|
+
private failToken;
|
|
67
|
+
private remove;
|
|
68
|
+
private id;
|
|
69
|
+
private terminal;
|
|
70
|
+
private refresh;
|
|
71
|
+
private event;
|
|
72
|
+
private checkContext;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type RunnerStatus = "ACCEPTED" | "RUNNING" | "STREAMING" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "TIMED_OUT" | "REJECTED";
|
|
76
|
+
type DisplayStatus = "idle" | "active" | "waiting" | "accepted" | "running" | "streaming" | "completed" | "succeeded" | "failed" | "cancelled" | "timed_out" | "rejected";
|
|
77
|
+
interface DisplayProgress {
|
|
78
|
+
current: string;
|
|
79
|
+
total?: string;
|
|
80
|
+
unit: "bytes" | "rows" | "items";
|
|
81
|
+
}
|
|
82
|
+
interface TransferObservation {
|
|
83
|
+
id: string;
|
|
84
|
+
offset: string;
|
|
85
|
+
chunkSequence: string;
|
|
86
|
+
size: string;
|
|
87
|
+
totalSize?: string;
|
|
88
|
+
final: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface NodeExecution {
|
|
91
|
+
status: DisplayStatus;
|
|
92
|
+
detail?: string;
|
|
93
|
+
commandId?: string;
|
|
94
|
+
sequence?: string;
|
|
95
|
+
final?: boolean;
|
|
96
|
+
progress?: DisplayProgress;
|
|
97
|
+
transfer?: TransferObservation;
|
|
98
|
+
}
|
|
99
|
+
interface SignalObservation {
|
|
100
|
+
id: string;
|
|
101
|
+
nodeId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
direction: "in" | "out";
|
|
104
|
+
summary?: string;
|
|
105
|
+
}
|
|
106
|
+
interface DecisionObservation {
|
|
107
|
+
id: string;
|
|
108
|
+
nodeId: string;
|
|
109
|
+
edgeId: string;
|
|
110
|
+
reason: string;
|
|
111
|
+
}
|
|
112
|
+
interface ExecutionOverlay {
|
|
113
|
+
nodes: Record<string, NodeExecution>;
|
|
114
|
+
edges?: Record<string, "taken" | "skipped">;
|
|
115
|
+
decisions?: Record<string, DecisionObservation>;
|
|
116
|
+
signals?: SignalObservation[];
|
|
117
|
+
}
|
|
118
|
+
/** A redacted presentation DTO, not a generated protobuf codec or executor. */
|
|
119
|
+
interface RunnerResultPreview {
|
|
120
|
+
commandId: string;
|
|
121
|
+
status: RunnerStatus | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
122
|
+
sequence: string;
|
|
123
|
+
success: boolean;
|
|
124
|
+
final: boolean;
|
|
125
|
+
summary?: string;
|
|
126
|
+
error?: string;
|
|
127
|
+
progress?: DisplayProgress;
|
|
128
|
+
transfer?: TransferObservation;
|
|
129
|
+
}
|
|
130
|
+
declare function simulationOverlay(snapshot: SimulationSnapshot): ExecutionOverlay;
|
|
131
|
+
/** Correlates observed runner results with plan nodes. Does not send or run commands. */
|
|
132
|
+
declare class RunnerDisplay {
|
|
133
|
+
private readonly observationLimit;
|
|
134
|
+
private readonly document;
|
|
135
|
+
private readonly commands;
|
|
136
|
+
private readonly latest;
|
|
137
|
+
private readonly decisions;
|
|
138
|
+
private readonly signals;
|
|
139
|
+
private readonly seen;
|
|
140
|
+
constructor(document: FlowDocument, observationLimit?: number);
|
|
141
|
+
/** Register correlation only. This does not dispatch, accept or execute a command. */
|
|
142
|
+
track(commandId: string, nodeId: string): void;
|
|
143
|
+
applyResult(input: RunnerResultPreview): boolean;
|
|
144
|
+
observeSignal(observation: SignalObservation): void;
|
|
145
|
+
observeDecision(observation: DecisionObservation): void;
|
|
146
|
+
getOverlay(): ExecutionOverlay;
|
|
147
|
+
private remember;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export { FlowSimulator as F, RunnerDisplay as d, simulationOverlay as s };
|
|
151
|
+
export type { DecisionObservation as D, ExecutionOverlay as E, NodeExecution as N, RunResult as R, SignalObservation as S, TransferObservation as T, DisplayProgress as a, DisplayStatus as b, ForkFrame as c, RunnerResultPreview as e, RunnerStatus as f, SimulationEvent as g, SimulationOptions as h, SimulationSnapshot as i, SimulationToken as j };
|