@elevasis/ui 1.20.1 → 1.22.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 (66) hide show
  1. package/dist/charts/index.js +3 -2
  2. package/dist/chunk-3KMDHCAR.js +52 -0
  3. package/dist/{chunk-4SY4EQSK.js → chunk-5266RV46.js} +3 -3
  4. package/dist/{chunk-UMFPUM7Q.js → chunk-7TLPKXC2.js} +12 -12
  5. package/dist/{chunk-OFAXUZPZ.js → chunk-AJPFSMEH.js} +528 -336
  6. package/dist/chunk-AWT255UH.js +255 -0
  7. package/dist/{chunk-EMN755L5.js → chunk-CTF6FS2M.js} +10 -216
  8. package/dist/{chunk-C7AD6N23.js → chunk-DLI3F5IV.js} +364 -364
  9. package/dist/{chunk-AQ5MQDSS.js → chunk-EDAYKRPJ.js} +404 -2
  10. package/dist/{chunk-XOTN3X3Z.js → chunk-FATKFO7X.js} +3 -54
  11. package/dist/{chunk-JZEXFQ6N.js → chunk-HOYZWSNV.js} +91 -80
  12. package/dist/{chunk-AWMZCYKH.js → chunk-IAZT3VO6.js} +158 -82
  13. package/dist/{chunk-ERVB3QJQ.js → chunk-N5SDJP44.js} +1 -1
  14. package/dist/{chunk-3DIU726S.js → chunk-NVSKJG3L.js} +25 -4
  15. package/dist/{chunk-VLTVZXP6.js → chunk-QZS5FOIR.js} +2 -2
  16. package/dist/chunk-ROSMICXG.js +668 -0
  17. package/dist/{chunk-JIABC3AE.js → chunk-WAEKXBP3.js} +516 -266
  18. package/dist/{chunk-COTI2QPO.js → chunk-ZHJGTOXP.js} +4 -3
  19. package/dist/components/chat/index.d.ts +202 -0
  20. package/dist/components/chat/index.js +2 -0
  21. package/dist/components/index.css +0 -3
  22. package/dist/components/index.d.ts +37 -37
  23. package/dist/components/index.js +2652 -2902
  24. package/dist/features/auth/index.css +0 -3
  25. package/dist/features/dashboard/index.css +0 -3
  26. package/dist/features/dashboard/index.js +9 -9
  27. package/dist/features/monitoring/index.css +0 -3
  28. package/dist/features/monitoring/index.js +10 -10
  29. package/dist/features/operations/index.css +0 -3
  30. package/dist/features/operations/index.d.ts +245 -10
  31. package/dist/features/operations/index.js +1115 -170
  32. package/dist/features/settings/index.css +0 -3
  33. package/dist/features/settings/index.js +9 -9
  34. package/dist/hooks/index.css +68 -3
  35. package/dist/hooks/index.d.ts +1165 -4
  36. package/dist/hooks/index.js +5 -6
  37. package/dist/hooks/published.css +68 -3
  38. package/dist/hooks/published.d.ts +1165 -4
  39. package/dist/hooks/published.js +4 -5
  40. package/dist/index.css +68 -3
  41. package/dist/index.d.ts +1166 -5
  42. package/dist/index.js +6 -7
  43. package/dist/layout/index.d.ts +4 -4
  44. package/dist/layout/index.js +3 -4
  45. package/dist/provider/index.css +0 -3
  46. package/dist/provider/index.d.ts +1 -1
  47. package/dist/provider/index.js +3 -4
  48. package/dist/provider/published.d.ts +1 -1
  49. package/dist/theme/index.d.ts +1 -1
  50. package/dist/theme/index.js +3 -3
  51. package/dist/types/index.d.ts +1 -1
  52. package/package.json +7 -2
  53. package/dist/chunk-JFRG2JJE.js +0 -47
  54. package/dist/chunk-R3R367QY.js +0 -14
  55. package/dist/theme/presets/__tests__/getPreset.test.d.ts +0 -2
  56. package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +0 -1
  57. package/dist/theme/presets/__tests__/getPreset.test.js +0 -92
  58. package/dist/theme/presets/cyber-volt.d.ts +0 -12
  59. package/dist/theme/presets/cyber-volt.d.ts.map +0 -1
  60. package/dist/theme/presets/cyber-volt.js +0 -70
  61. package/dist/theme/presets/regal.d.ts +0 -8
  62. package/dist/theme/presets/regal.d.ts.map +0 -1
  63. package/dist/theme/presets/regal.js +0 -69
  64. package/dist/theme/presets/rose-gold.d.ts +0 -12
  65. package/dist/theme/presets/rose-gold.d.ts.map +0 -1
  66. package/dist/theme/presets/rose-gold.js +0 -76
@@ -1,397 +1,118 @@
1
- import { useCyberColors } from './chunk-ERVB3QJQ.js';
2
- import { GlowDot } from './chunk-AWMZCYKH.js';
1
+ import { useCyberColors } from './chunk-N5SDJP44.js';
2
+ import { GlowDot } from './chunk-IAZT3VO6.js';
3
3
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-F6RBK7NJ.js';
4
4
  import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-XA34RETF.js';
5
- import { glassBase } from './chunk-OFAXUZPZ.js';
6
- import { Paper, Stack, Text, Group, Badge, Box, useComputedColorScheme, Loader, Card, ActionIcon, SegmentedControl } from '@mantine/core';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
5
+ import { glassBase } from './chunk-AJPFSMEH.js';
8
6
  import { memo, useMemo, useEffect, useState, useCallback, Fragment } from 'react';
7
+ import { Paper, Stack, Text, Group, Badge, Box, useComputedColorScheme, Card, ActionIcon, Loader, SegmentedControl } from '@mantine/core';
8
+ import { jsxs, jsx } from 'react/jsx-runtime';
9
9
  import { Position, Handle, getSmoothStepPath, BaseEdge as BaseEdge$1, EdgeLabelRenderer, Panel, useReactFlow, Controls, ReactFlowProvider, ReactFlow } from '@xyflow/react';
10
10
  import { IconPlayerPlay, IconPlayerStop, IconArrowsSplit, IconSquare, IconFocus2 } from '@tabler/icons-react';
11
11
  import '@xyflow/react/dist/style.css';
12
12
 
13
- function ExecutionStatusBadge({
14
- status,
15
- size = "sm",
16
- variant = "light",
17
- showLoader = true
18
- }) {
19
- const statusColors = STATUS_COLORS[status];
20
- const isRunning = status === "running" && showLoader;
21
- return /* @__PURE__ */ jsx(
22
- Badge,
23
- {
24
- color: statusColors.badge,
25
- size,
26
- variant,
27
- leftSection: isRunning ? /* @__PURE__ */ jsx(Loader, { size: 10, color: statusColors.badge }) : void 0,
28
- children: status.charAt(0).toUpperCase() + status.slice(1)
29
- }
30
- );
13
+ var DOMAIN_COLORS = {
14
+ primary: "var(--color-primary)",
15
+ agent: "#8b5cf6",
16
+ workflow: "#3b82f6",
17
+ trigger: "#f97316",
18
+ integration: "#14b8a6",
19
+ approval: "#f59e0b"
20
+ };
21
+ function fill(color, isDark) {
22
+ return isDark ? `color-mix(in srgb, ${color} 80%, black)` : `color-mix(in srgb, ${color} 60%, white)`;
31
23
  }
32
- function getRateColor(rate) {
33
- if (rate >= 95) return "var(--color-success)";
34
- if (rate >= 80) return "var(--color-warning)";
35
- return "var(--color-error)";
24
+ function glow(color) {
25
+ return `color-mix(in srgb, ${color} 40%, transparent)`;
36
26
  }
37
- function getMantineRateColor(rate) {
38
- if (rate >= 95) return "green";
39
- if (rate >= 80) return "yellow";
40
- return "red";
27
+ function useGraphTheme() {
28
+ const isDark = useComputedColorScheme("dark") === "dark";
29
+ return useMemo(
30
+ () => ({
31
+ primary: fill(DOMAIN_COLORS.primary, isDark),
32
+ primaryGlow: glow(DOMAIN_COLORS.primary),
33
+ agent: fill(DOMAIN_COLORS.agent, isDark),
34
+ workflow: fill(DOMAIN_COLORS.workflow, isDark),
35
+ trigger: fill(DOMAIN_COLORS.trigger, isDark),
36
+ integration: fill(DOMAIN_COLORS.integration, isDark),
37
+ approval: fill(DOMAIN_COLORS.approval, isDark),
38
+ agentGlow: glow(DOMAIN_COLORS.agent),
39
+ workflowGlow: glow(DOMAIN_COLORS.workflow),
40
+ triggerGlow: glow(DOMAIN_COLORS.trigger),
41
+ integrationGlow: glow(DOMAIN_COLORS.integration),
42
+ approvalGlow: glow(DOMAIN_COLORS.approval),
43
+ edgeTriggers: fill(DOMAIN_COLORS.workflow, isDark),
44
+ edgeUses: fill(DOMAIN_COLORS.integration, isDark),
45
+ edgeApproval: fill(DOMAIN_COLORS.approval, isDark),
46
+ edgeTriggersGlow: glow(DOMAIN_COLORS.workflow),
47
+ edgeUsesGlow: glow(DOMAIN_COLORS.integration),
48
+ edgeApprovalGlow: glow(DOMAIN_COLORS.approval)
49
+ }),
50
+ [isDark]
51
+ );
41
52
  }
42
- function ExecutionStats({
43
- totalExecutions,
44
- successCount,
45
- failureCount,
46
- warningCount,
47
- successRate,
48
- align = "flex-end",
49
- compact = false
50
- }) {
51
- const cyberColors = useCyberColors();
52
- if (totalExecutions === 0 && !compact) {
53
- return null;
54
- }
55
- if (compact && totalExecutions === 0) {
56
- return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
57
- /* @__PURE__ */ jsx(Text, { size: "md", fw: 700, ff: "monospace", c: "dimmed", style: { minWidth: 42 }, children: "\u2014" }),
58
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: "No recent executions" })
59
- ] });
60
- }
61
- if (compact) {
62
- return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
63
- /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", children: [
64
- /* @__PURE__ */ jsxs(Text, { size: "md", fw: 700, ff: "monospace", style: { color: getRateColor(successRate), minWidth: 42 }, children: [
65
- successRate,
66
- "%"
67
- ] }),
68
- /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
69
- /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.green }),
70
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "green", children: successCount })
71
- ] }),
72
- failureCount > 0 && /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
73
- /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.red }),
74
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "red", children: failureCount })
75
- ] })
76
- ] }),
77
- /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
78
- totalExecutions,
79
- " ",
80
- totalExecutions === 1 ? "run" : "runs"
81
- ] })
82
- ] });
83
- }
84
- return /* @__PURE__ */ jsxs(Stack, { gap: 2, align, style: { whiteSpace: "nowrap" }, children: [
85
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "blue", children: [
86
- totalExecutions,
87
- " ",
88
- totalExecutions === 1 ? "execution" : "executions"
89
- ] }),
90
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "green", children: [
91
- successCount,
92
- " success"
93
- ] }),
94
- warningCount != null && warningCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "yellow", children: [
95
- warningCount,
96
- " warning"
97
- ] }),
98
- failureCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "red", children: [
99
- failureCount,
100
- " failed"
101
- ] }),
102
- /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 600, c: getMantineRateColor(successRate), children: [
103
- successRate,
104
- "% Success Rate"
105
- ] })
106
- ] });
53
+ function getGraphBackgroundStyles(isDark) {
54
+ const pct = isDark ? 5 : 3;
55
+ const glowPct = isDark ? 8 : 5;
56
+ const mix = (percent) => `color-mix(in srgb, var(--color-primary) ${percent}%, transparent)`;
57
+ return {
58
+ backgroundImage: `
59
+ linear-gradient(${mix(pct)} 1px, transparent 1px),
60
+ linear-gradient(90deg, ${mix(pct)} 1px, transparent 1px),
61
+ radial-gradient(ellipse at 50% 50%, ${mix(glowPct)} 0%, transparent 70%)
62
+ `,
63
+ backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--glass-background))",
64
+ backdropFilter: "var(--glass-blur)",
65
+ backgroundSize: "40px 40px, 40px 40px, 100% 100%"
66
+ };
107
67
  }
108
- function TimelineAxis({ totalDuration }) {
109
- const markers = [
110
- { position: 0, time: 0 },
111
- { position: 25, time: totalDuration * 0.25 },
112
- { position: 50, time: totalDuration * 0.5 },
113
- { position: 75, time: totalDuration * 0.75 },
114
- { position: 100, time: totalDuration }
115
- ];
68
+ function useGraphBackgroundStyles() {
69
+ const isDark = useComputedColorScheme("dark") === "dark";
70
+ return useMemo(() => getGraphBackgroundStyles(isDark), [isDark]);
71
+ }
72
+ function GraphContainer({ children, height = 600 }) {
73
+ const backgroundStyles = useGraphBackgroundStyles();
116
74
  return /* @__PURE__ */ jsx(
117
75
  Box,
118
76
  {
119
77
  style: {
78
+ width: "100%",
79
+ height,
80
+ border: "1px solid var(--color-border)",
81
+ borderRadius: "var(--mantine-radius-md)",
82
+ overflow: "hidden",
120
83
  position: "relative",
121
- height: 20
84
+ ...backgroundStyles
122
85
  },
123
- children: markers.map((marker, idx) => /* @__PURE__ */ jsx(
124
- Box,
125
- {
126
- style: {
127
- position: "absolute",
128
- left: `${marker.position}%`,
129
- transform: marker.position === 100 ? "translateX(-100%)" : marker.position === 0 ? "none" : "translateX(-50%)",
130
- top: 4
131
- },
132
- children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(marker.time) })
133
- },
134
- idx
135
- ))
86
+ children
136
87
  }
137
88
  );
138
89
  }
139
- function TimelineContainer({ executionStart, executionEnd, children }) {
140
- const totalDuration = executionEnd - executionStart;
141
- return /* @__PURE__ */ jsxs(
90
+ function GraphBackground() {
91
+ return null;
92
+ }
93
+ function LegendDot({ color }) {
94
+ return /* @__PURE__ */ jsx(
142
95
  Box,
143
96
  {
144
97
  style: {
145
- borderBottom: "1px solid var(--color-border)",
146
- backgroundColor: "var(--color-background)",
147
- padding: "var(--mantine-spacing-xs)"
148
- },
149
- children: [
150
- /* @__PURE__ */ jsx(
151
- Box,
152
- {
153
- style: {
154
- position: "relative"
155
- },
156
- children: /* @__PURE__ */ jsx(Box, { style: { position: "relative", zIndex: 1 }, children })
157
- }
158
- ),
159
- /* @__PURE__ */ jsx(Box, { style: { paddingLeft: TIMELINE_CONSTANTS.LABEL_WIDTH + 12, paddingRight: 16 }, children: /* @__PURE__ */ jsx(TimelineAxis, { totalDuration }) })
160
- ]
98
+ width: 10,
99
+ height: 10,
100
+ borderRadius: "50%",
101
+ backgroundColor: `var(--mantine-color-${color}-5)`
102
+ }
161
103
  }
162
104
  );
163
105
  }
164
- function TimelineBar({
165
- startTime,
166
- endTime,
167
- executionStart,
168
- executionEnd,
169
- status,
170
- label,
171
- onClick,
172
- isSelected = false,
173
- hasSelection = false
174
- }) {
175
- const colors = getStatusColors(status);
176
- const { left, width } = calculateBarPosition(startTime, endTime, executionStart, executionEnd);
177
- const opacity = hasSelection && !isSelected ? 0.5 : 1;
106
+ function LegendLine({ color }) {
178
107
  return /* @__PURE__ */ jsx(
179
108
  Box,
180
109
  {
181
110
  style: {
182
- position: "absolute",
183
- left: `${left}%`,
184
- width: `${width}%`,
185
- top: 4,
186
- height: TIMELINE_CONSTANTS.BAR_HEIGHT / 2,
187
- backgroundColor: colors.color,
188
- opacity,
189
- borderRadius: 4,
190
- cursor: onClick ? "pointer" : "default",
191
- display: "flex",
192
- alignItems: "center",
193
- justifyContent: "center",
194
- overflow: "hidden"
195
- },
196
- onClick,
197
- children: label && /* @__PURE__ */ jsx(Text, { size: "xs", c: "white", style: { whiteSpace: "nowrap" }, children: label })
198
- }
199
- );
200
- }
201
- function TimelineRow({
202
- label,
203
- bars,
204
- executionStart,
205
- executionEnd,
206
- indent = 0,
207
- selectedNodeId
208
- }) {
209
- const labelMatch = label.match(/^(.+?)\s*\((.+?)\)$/);
210
- const labelName = labelMatch ? labelMatch[1] : label;
211
- const labelDuration = labelMatch ? labelMatch[2] : null;
212
- const statusColor = bars.length > 0 ? getStatusColors(bars[0].status).color : "var(--color-text-dimmed)";
213
- const hasSelection = selectedNodeId !== null && selectedNodeId !== void 0;
214
- return /* @__PURE__ */ jsxs(
215
- Box,
216
- {
217
- style: {
218
- display: "flex",
219
- gap: 0,
220
- height: TIMELINE_CONSTANTS.BAR_HEIGHT
221
- // paddingLeft: indent * TIMELINE_CONSTANTS.INDENT_SIZE
222
- },
223
- children: [
224
- /* @__PURE__ */ jsxs(
225
- Box,
226
- {
227
- style: {
228
- height: TIMELINE_CONSTANTS.BAR_HEIGHT,
229
- width: TIMELINE_CONSTANTS.LABEL_WIDTH,
230
- flexShrink: 0,
231
- display: "flex",
232
- alignItems: "center",
233
- gap: 6,
234
- paddingRight: 12,
235
- paddingLeft: 8 + indent * TIMELINE_CONSTANTS.INDENT_SIZE,
236
- // Indent only the label, not the timeline bars
237
- overflow: "hidden"
238
- },
239
- children: [
240
- /* @__PURE__ */ jsx(
241
- Box,
242
- {
243
- style: {
244
- width: 6,
245
- height: 6,
246
- borderRadius: "50%",
247
- backgroundColor: statusColor,
248
- flexShrink: 0
249
- }
250
- }
251
- ),
252
- /* @__PURE__ */ jsx(Text, { size: "sm", truncate: true, style: { flexShrink: 1, minWidth: 0 }, children: labelName }),
253
- labelDuration && /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", ff: "monospace", style: { flexShrink: 0 }, children: [
254
- "(",
255
- labelDuration,
256
- ")"
257
- ] })
258
- ]
259
- }
260
- ),
261
- /* @__PURE__ */ jsx(
262
- Box,
263
- {
264
- style: {
265
- position: "relative",
266
- flex: 1,
267
- height: TIMELINE_CONSTANTS.BAR_HEIGHT,
268
- marginLeft: 12,
269
- marginRight: 16
270
- // Right margin to match grid padding
271
- },
272
- children: bars.map((bar, idx) => {
273
- const isSelected = bar.nodeId !== void 0 && bar.nodeId === selectedNodeId;
274
- return /* @__PURE__ */ jsx(
275
- TimelineBar,
276
- {
277
- ...bar,
278
- executionStart,
279
- executionEnd,
280
- isSelected,
281
- hasSelection
282
- },
283
- idx
284
- );
285
- })
286
- }
287
- )
288
- ]
289
- }
290
- );
291
- }
292
- var DOMAIN_COLORS = {
293
- primary: "var(--color-primary)",
294
- agent: "#8b5cf6",
295
- workflow: "#3b82f6",
296
- trigger: "#f97316",
297
- integration: "#14b8a6",
298
- approval: "#f59e0b"
299
- };
300
- function fill(color, isDark) {
301
- return isDark ? `color-mix(in srgb, ${color} 80%, black)` : `color-mix(in srgb, ${color} 60%, white)`;
302
- }
303
- function glow(color) {
304
- return `color-mix(in srgb, ${color} 40%, transparent)`;
305
- }
306
- function useGraphTheme() {
307
- const isDark = useComputedColorScheme("dark") === "dark";
308
- return useMemo(
309
- () => ({
310
- primary: fill(DOMAIN_COLORS.primary, isDark),
311
- primaryGlow: glow(DOMAIN_COLORS.primary),
312
- agent: fill(DOMAIN_COLORS.agent, isDark),
313
- workflow: fill(DOMAIN_COLORS.workflow, isDark),
314
- trigger: fill(DOMAIN_COLORS.trigger, isDark),
315
- integration: fill(DOMAIN_COLORS.integration, isDark),
316
- approval: fill(DOMAIN_COLORS.approval, isDark),
317
- agentGlow: glow(DOMAIN_COLORS.agent),
318
- workflowGlow: glow(DOMAIN_COLORS.workflow),
319
- triggerGlow: glow(DOMAIN_COLORS.trigger),
320
- integrationGlow: glow(DOMAIN_COLORS.integration),
321
- approvalGlow: glow(DOMAIN_COLORS.approval),
322
- edgeTriggers: fill(DOMAIN_COLORS.workflow, isDark),
323
- edgeUses: fill(DOMAIN_COLORS.integration, isDark),
324
- edgeApproval: fill(DOMAIN_COLORS.approval, isDark),
325
- edgeTriggersGlow: glow(DOMAIN_COLORS.workflow),
326
- edgeUsesGlow: glow(DOMAIN_COLORS.integration),
327
- edgeApprovalGlow: glow(DOMAIN_COLORS.approval)
328
- }),
329
- [isDark]
330
- );
331
- }
332
- function getGraphBackgroundStyles(isDark) {
333
- const pct = isDark ? 5 : 3;
334
- const glowPct = isDark ? 8 : 5;
335
- const mix = (percent) => `color-mix(in srgb, var(--color-primary) ${percent}%, transparent)`;
336
- return {
337
- backgroundImage: `
338
- linear-gradient(${mix(pct)} 1px, transparent 1px),
339
- linear-gradient(90deg, ${mix(pct)} 1px, transparent 1px),
340
- radial-gradient(ellipse at 50% 50%, ${mix(glowPct)} 0%, transparent 70%)
341
- `,
342
- backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--glass-background))",
343
- backdropFilter: "var(--glass-blur)",
344
- backgroundSize: "40px 40px, 40px 40px, 100% 100%"
345
- };
346
- }
347
- function useGraphBackgroundStyles() {
348
- const isDark = useComputedColorScheme("dark") === "dark";
349
- return useMemo(() => getGraphBackgroundStyles(isDark), [isDark]);
350
- }
351
- function GraphContainer({ children, height = 600 }) {
352
- const backgroundStyles = useGraphBackgroundStyles();
353
- return /* @__PURE__ */ jsx(
354
- Box,
355
- {
356
- style: {
357
- width: "100%",
358
- height,
359
- border: "1px solid var(--color-border)",
360
- borderRadius: "var(--mantine-radius-md)",
361
- overflow: "hidden",
362
- position: "relative",
363
- ...backgroundStyles
364
- },
365
- children
366
- }
367
- );
368
- }
369
- function GraphBackground() {
370
- return null;
371
- }
372
- function LegendDot({ color }) {
373
- return /* @__PURE__ */ jsx(
374
- Box,
375
- {
376
- style: {
377
- width: 10,
378
- height: 10,
379
- borderRadius: "50%",
380
- backgroundColor: `var(--mantine-color-${color}-5)`
381
- }
382
- }
383
- );
384
- }
385
- function LegendLine({ color }) {
386
- return /* @__PURE__ */ jsx(
387
- Box,
388
- {
389
- style: {
390
- width: 20,
391
- height: 3,
392
- borderRadius: 2,
393
- background: `linear-gradient(90deg, var(--mantine-color-${color}-5), var(--mantine-color-${color}-6))`
394
- }
111
+ width: 20,
112
+ height: 3,
113
+ borderRadius: 2,
114
+ background: `linear-gradient(90deg, var(--mantine-color-${color}-5), var(--mantine-color-${color}-6))`
115
+ }
395
116
  }
396
117
  );
397
118
  }
@@ -635,6 +356,285 @@ var BaseEdge = memo(function BaseEdge2({
635
356
  ) })
636
357
  ] });
637
358
  });
359
+ function ExecutionStatusBadge({
360
+ status,
361
+ size = "sm",
362
+ variant = "light",
363
+ showLoader = true
364
+ }) {
365
+ const statusColors = STATUS_COLORS[status];
366
+ const isRunning = status === "running" && showLoader;
367
+ return /* @__PURE__ */ jsx(
368
+ Badge,
369
+ {
370
+ color: statusColors.badge,
371
+ size,
372
+ variant,
373
+ leftSection: isRunning ? /* @__PURE__ */ jsx(Loader, { size: 10, color: statusColors.badge }) : void 0,
374
+ children: status.charAt(0).toUpperCase() + status.slice(1)
375
+ }
376
+ );
377
+ }
378
+ function getRateColor(rate) {
379
+ if (rate >= 95) return "var(--color-success)";
380
+ if (rate >= 80) return "var(--color-warning)";
381
+ return "var(--color-error)";
382
+ }
383
+ function getMantineRateColor(rate) {
384
+ if (rate >= 95) return "green";
385
+ if (rate >= 80) return "yellow";
386
+ return "red";
387
+ }
388
+ function ExecutionStats({
389
+ totalExecutions,
390
+ successCount,
391
+ failureCount,
392
+ warningCount,
393
+ successRate,
394
+ align = "flex-end",
395
+ compact = false
396
+ }) {
397
+ const cyberColors = useCyberColors();
398
+ if (totalExecutions === 0 && !compact) {
399
+ return null;
400
+ }
401
+ if (compact && totalExecutions === 0) {
402
+ return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
403
+ /* @__PURE__ */ jsx(Text, { size: "md", fw: 700, ff: "monospace", c: "dimmed", style: { minWidth: 42 }, children: "\u2014" }),
404
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: "No recent executions" })
405
+ ] });
406
+ }
407
+ if (compact) {
408
+ return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
409
+ /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", children: [
410
+ /* @__PURE__ */ jsxs(Text, { size: "md", fw: 700, ff: "monospace", style: { color: getRateColor(successRate), minWidth: 42 }, children: [
411
+ successRate,
412
+ "%"
413
+ ] }),
414
+ /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
415
+ /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.green }),
416
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "green", children: successCount })
417
+ ] }),
418
+ failureCount > 0 && /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
419
+ /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.red }),
420
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "red", children: failureCount })
421
+ ] })
422
+ ] }),
423
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
424
+ totalExecutions,
425
+ " ",
426
+ totalExecutions === 1 ? "run" : "runs"
427
+ ] })
428
+ ] });
429
+ }
430
+ return /* @__PURE__ */ jsxs(Stack, { gap: 2, align, style: { whiteSpace: "nowrap" }, children: [
431
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "blue", children: [
432
+ totalExecutions,
433
+ " ",
434
+ totalExecutions === 1 ? "execution" : "executions"
435
+ ] }),
436
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "green", children: [
437
+ successCount,
438
+ " success"
439
+ ] }),
440
+ warningCount != null && warningCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "yellow", children: [
441
+ warningCount,
442
+ " warning"
443
+ ] }),
444
+ failureCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "red", children: [
445
+ failureCount,
446
+ " failed"
447
+ ] }),
448
+ /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 600, c: getMantineRateColor(successRate), children: [
449
+ successRate,
450
+ "% Success Rate"
451
+ ] })
452
+ ] });
453
+ }
454
+ function TimelineAxis({ totalDuration }) {
455
+ const markers = [
456
+ { position: 0, time: 0 },
457
+ { position: 25, time: totalDuration * 0.25 },
458
+ { position: 50, time: totalDuration * 0.5 },
459
+ { position: 75, time: totalDuration * 0.75 },
460
+ { position: 100, time: totalDuration }
461
+ ];
462
+ return /* @__PURE__ */ jsx(
463
+ Box,
464
+ {
465
+ style: {
466
+ position: "relative",
467
+ height: 20
468
+ },
469
+ children: markers.map((marker, idx) => /* @__PURE__ */ jsx(
470
+ Box,
471
+ {
472
+ style: {
473
+ position: "absolute",
474
+ left: `${marker.position}%`,
475
+ transform: marker.position === 100 ? "translateX(-100%)" : marker.position === 0 ? "none" : "translateX(-50%)",
476
+ top: 4
477
+ },
478
+ children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(marker.time) })
479
+ },
480
+ idx
481
+ ))
482
+ }
483
+ );
484
+ }
485
+ function TimelineContainer({ executionStart, executionEnd, children }) {
486
+ const totalDuration = executionEnd - executionStart;
487
+ return /* @__PURE__ */ jsxs(
488
+ Box,
489
+ {
490
+ style: {
491
+ borderBottom: "1px solid var(--color-border)",
492
+ backgroundColor: "var(--color-background)",
493
+ padding: "var(--mantine-spacing-xs)"
494
+ },
495
+ children: [
496
+ /* @__PURE__ */ jsx(
497
+ Box,
498
+ {
499
+ style: {
500
+ position: "relative"
501
+ },
502
+ children: /* @__PURE__ */ jsx(Box, { style: { position: "relative", zIndex: 1 }, children })
503
+ }
504
+ ),
505
+ /* @__PURE__ */ jsx(Box, { style: { paddingLeft: TIMELINE_CONSTANTS.LABEL_WIDTH + 12, paddingRight: 16 }, children: /* @__PURE__ */ jsx(TimelineAxis, { totalDuration }) })
506
+ ]
507
+ }
508
+ );
509
+ }
510
+ function TimelineBar({
511
+ startTime,
512
+ endTime,
513
+ executionStart,
514
+ executionEnd,
515
+ status,
516
+ label,
517
+ onClick,
518
+ isSelected = false,
519
+ hasSelection = false
520
+ }) {
521
+ const colors = getStatusColors(status);
522
+ const { left, width } = calculateBarPosition(startTime, endTime, executionStart, executionEnd);
523
+ const opacity = hasSelection && !isSelected ? 0.5 : 1;
524
+ return /* @__PURE__ */ jsx(
525
+ Box,
526
+ {
527
+ style: {
528
+ position: "absolute",
529
+ left: `${left}%`,
530
+ width: `${width}%`,
531
+ top: 4,
532
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT / 2,
533
+ backgroundColor: colors.color,
534
+ opacity,
535
+ borderRadius: 4,
536
+ cursor: onClick ? "pointer" : "default",
537
+ display: "flex",
538
+ alignItems: "center",
539
+ justifyContent: "center",
540
+ overflow: "hidden"
541
+ },
542
+ onClick,
543
+ children: label && /* @__PURE__ */ jsx(Text, { size: "xs", c: "white", style: { whiteSpace: "nowrap" }, children: label })
544
+ }
545
+ );
546
+ }
547
+ function TimelineRow({
548
+ label,
549
+ bars,
550
+ executionStart,
551
+ executionEnd,
552
+ indent = 0,
553
+ selectedNodeId
554
+ }) {
555
+ const labelMatch = label.match(/^(.+?)\s*\((.+?)\)$/);
556
+ const labelName = labelMatch ? labelMatch[1] : label;
557
+ const labelDuration = labelMatch ? labelMatch[2] : null;
558
+ const statusColor = bars.length > 0 ? getStatusColors(bars[0].status).color : "var(--color-text-dimmed)";
559
+ const hasSelection = selectedNodeId !== null && selectedNodeId !== void 0;
560
+ return /* @__PURE__ */ jsxs(
561
+ Box,
562
+ {
563
+ style: {
564
+ display: "flex",
565
+ gap: 0,
566
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT
567
+ // paddingLeft: indent * TIMELINE_CONSTANTS.INDENT_SIZE
568
+ },
569
+ children: [
570
+ /* @__PURE__ */ jsxs(
571
+ Box,
572
+ {
573
+ style: {
574
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT,
575
+ width: TIMELINE_CONSTANTS.LABEL_WIDTH,
576
+ flexShrink: 0,
577
+ display: "flex",
578
+ alignItems: "center",
579
+ gap: 6,
580
+ paddingRight: 12,
581
+ paddingLeft: 8 + indent * TIMELINE_CONSTANTS.INDENT_SIZE,
582
+ // Indent only the label, not the timeline bars
583
+ overflow: "hidden"
584
+ },
585
+ children: [
586
+ /* @__PURE__ */ jsx(
587
+ Box,
588
+ {
589
+ style: {
590
+ width: 6,
591
+ height: 6,
592
+ borderRadius: "50%",
593
+ backgroundColor: statusColor,
594
+ flexShrink: 0
595
+ }
596
+ }
597
+ ),
598
+ /* @__PURE__ */ jsx(Text, { size: "sm", truncate: true, style: { flexShrink: 1, minWidth: 0 }, children: labelName }),
599
+ labelDuration && /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", ff: "monospace", style: { flexShrink: 0 }, children: [
600
+ "(",
601
+ labelDuration,
602
+ ")"
603
+ ] })
604
+ ]
605
+ }
606
+ ),
607
+ /* @__PURE__ */ jsx(
608
+ Box,
609
+ {
610
+ style: {
611
+ position: "relative",
612
+ flex: 1,
613
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT,
614
+ marginLeft: 12,
615
+ marginRight: 16
616
+ // Right margin to match grid padding
617
+ },
618
+ children: bars.map((bar, idx) => {
619
+ const isSelected = bar.nodeId !== void 0 && bar.nodeId === selectedNodeId;
620
+ return /* @__PURE__ */ jsx(
621
+ TimelineBar,
622
+ {
623
+ ...bar,
624
+ executionStart,
625
+ executionEnd,
626
+ isSelected,
627
+ hasSelection
628
+ },
629
+ idx
630
+ );
631
+ })
632
+ }
633
+ )
634
+ ]
635
+ }
636
+ );
637
+ }
638
638
  var VisualizerContainer = ({ children, handleContainerClick, height }) => {
639
639
  const containerHeight = height ?? CONTAINER_CONSTANTS.CONTAINER_HEIGHT;
640
640
  return /* @__PURE__ */ jsx(Box, { onClick: handleContainerClick, children: /* @__PURE__ */ jsx(