@elevasis/ui 2.67.0 → 2.69.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 (122) hide show
  1. package/dist/api/index.d.ts +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/app/index.d.ts +575 -370
  4. package/dist/app/index.js +17 -23
  5. package/dist/auth/index.css +149 -149
  6. package/dist/auth/index.d.ts +5 -0
  7. package/dist/auth/index.js +11 -13
  8. package/dist/charts/index.css +208 -208
  9. package/dist/charts/index.js +11 -13
  10. package/dist/{chunk-M535KHLW.js → chunk-26BTE3Z4.js} +1 -1
  11. package/dist/chunk-3KMDHCAR.js +52 -0
  12. package/dist/chunk-3MEXPLWT.js +265 -0
  13. package/dist/chunk-4JHLS234.js +39 -0
  14. package/dist/chunk-6PZFOHJK.js +1764 -0
  15. package/dist/chunk-7WJEPTE7.js +194 -0
  16. package/dist/chunk-AH52XQB7.js +1 -0
  17. package/dist/{chunk-UFTM5SZZ.js → chunk-AKANHRQ5.js} +9 -3
  18. package/dist/chunk-BZZCNLT6.js +12 -0
  19. package/dist/chunk-C75XWBYZ.js +383 -0
  20. package/dist/chunk-DLR4SDZW.js +51 -0
  21. package/dist/{chunk-4OEVLV66.js → chunk-FLECOYUS.js} +113 -148
  22. package/dist/chunk-IRV6KJPV.js +425 -0
  23. package/dist/chunk-IT7GTJCB.js +10 -0
  24. package/dist/chunk-LGKLC5MG.js +44 -0
  25. package/dist/chunk-MFLM7BVC.js +85 -0
  26. package/dist/chunk-MRVGQLWN.js +1595 -0
  27. package/dist/{chunk-4DV4ECMG.js → chunk-N7U24M2J.js} +4 -0
  28. package/dist/{chunk-I7BZVVVU.js → chunk-NM4A63KJ.js} +104 -415
  29. package/dist/chunk-NU3NBXHP.js +1194 -0
  30. package/dist/chunk-PDHTXPSF.js +12 -0
  31. package/dist/chunk-RW64UJWT.js +1934 -0
  32. package/dist/{chunk-JFBZ6XDW.js → chunk-SNZDFCOQ.js} +3 -49
  33. package/dist/chunk-TUMSNGTX.js +35 -0
  34. package/dist/chunk-UD657ICS.js +589 -0
  35. package/dist/{chunk-XNW3O6QW.js → chunk-VDX6DL7Z.js} +1 -1
  36. package/dist/chunk-WXHAHKKI.js +16411 -0
  37. package/dist/chunk-XAZR3T6Y.js +2162 -0
  38. package/dist/chunk-XQ3ILKYN.js +37 -0
  39. package/dist/chunk-YCRINA2D.js +67 -0
  40. package/dist/chunk-YGCMMOY4.js +1484 -0
  41. package/dist/chunk-YNRYIXUT.js +10945 -0
  42. package/dist/chunk-ZD6LM53O.js +4528 -0
  43. package/dist/chunk-ZPTEGGKU.js +631 -0
  44. package/dist/components/chat/index.js +2 -1
  45. package/dist/components/index.css +208 -208
  46. package/dist/components/index.d.ts +1634 -264
  47. package/dist/components/index.js +2774 -14
  48. package/dist/components/navigation/index.css +149 -149
  49. package/dist/components/navigation/index.js +12 -13
  50. package/dist/features/auth/index.css +149 -149
  51. package/dist/features/auth/index.d.ts +457 -167
  52. package/dist/features/auth/index.js +13 -14
  53. package/dist/features/clients/index.css +208 -208
  54. package/dist/features/clients/index.d.ts +39 -1
  55. package/dist/features/clients/index.js +16 -13
  56. package/dist/features/content/index.d.ts +1788 -0
  57. package/dist/features/content/index.js +2180 -0
  58. package/dist/features/crm/index.d.ts +1802 -231
  59. package/dist/features/crm/index.js +16 -13
  60. package/dist/features/dashboard/index.d.ts +1 -8
  61. package/dist/features/dashboard/index.js +17 -13
  62. package/dist/features/delivery/index.d.ts +457 -167
  63. package/dist/features/delivery/index.js +16 -13
  64. package/dist/features/knowledge/index.css +149 -149
  65. package/dist/features/knowledge/index.js +11 -13
  66. package/dist/features/lead-gen/index.d.ts +53 -104
  67. package/dist/features/lead-gen/index.js +17 -13
  68. package/dist/features/monitoring/index.js +16 -13
  69. package/dist/features/monitoring/requests/index.js +15 -20
  70. package/dist/features/operations/index.d.ts +1 -86
  71. package/dist/features/operations/index.js +22 -12
  72. package/dist/features/public-agent-chat/index.js +2 -1
  73. package/dist/features/seo/index.js +2 -1
  74. package/dist/features/settings/index.d.ts +457 -167
  75. package/dist/features/settings/index.js +15 -13
  76. package/dist/hooks/access/index.css +149 -149
  77. package/dist/hooks/access/index.d.ts +5 -0
  78. package/dist/hooks/access/index.js +11 -13
  79. package/dist/hooks/delivery/index.d.ts +457 -167
  80. package/dist/hooks/delivery/index.js +2 -23
  81. package/dist/hooks/index.d.ts +2203 -244
  82. package/dist/hooks/index.js +11 -13
  83. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +1 -8
  84. package/dist/hooks/published.d.ts +2203 -244
  85. package/dist/hooks/published.js +11 -13
  86. package/dist/initialization/index.d.ts +465 -169
  87. package/dist/knowledge/index.css +149 -149
  88. package/dist/knowledge/index.d.ts +5 -90
  89. package/dist/knowledge/index.js +3215 -3203
  90. package/dist/{knowledge-search-index-6EZNBNSR.js → knowledge-search-index-LP2WVSQX.js} +689 -695
  91. package/dist/layout/index.css +149 -149
  92. package/dist/layout/index.js +15 -13
  93. package/dist/organization/index.d.ts +10 -4
  94. package/dist/organization/index.js +1 -21
  95. package/dist/profile/index.d.ts +457 -167
  96. package/dist/provider/index.d.ts +576 -372
  97. package/dist/provider/index.js +11 -13
  98. package/dist/provider/published.css +149 -149
  99. package/dist/provider/published.d.ts +576 -372
  100. package/dist/provider/published.js +11 -13
  101. package/dist/supabase/index.d.ts +906 -347
  102. package/dist/test-utils/index.d.ts +15 -2
  103. package/dist/test-utils/index.js +41 -12
  104. package/dist/test-utils/setup-integration.js +1 -1
  105. package/dist/test-utils/setup.js +1 -1
  106. package/dist/theme/index.js +3 -2
  107. package/dist/theme/presets/index.js +1 -1
  108. package/dist/typeform/index.js +2049 -1
  109. package/dist/types/index.d.ts +477 -177
  110. package/dist/utils/index.d.ts +1 -8
  111. package/dist/utils/index.js +1 -1
  112. package/dist/vite/index.js +2 -2
  113. package/dist/vite-plugin-knowledge/index.js +1 -1
  114. package/package.json +7 -3
  115. package/src/features/README.md +28 -28
  116. package/dist/chunk-5TERYXOO.js +0 -51390
  117. package/dist/chunk-AUDNF2Q7.js +0 -2050
  118. package/dist/index.d.ts +0 -17888
  119. package/dist/index.js +0 -30
  120. package/dist/{chunk-GMXGDO3I.js → chunk-MISHPEJX.js} +1 -1
  121. package/dist/{chunk-RBGVNPA6.js → chunk-XQBURFKM.js} +0 -0
  122. package/dist/{index.css → features/content/index.css} +149 -149
@@ -0,0 +1,1484 @@
1
+ import { ZodFormRenderer } from './chunk-3MEXPLWT.js';
2
+ import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-HENXLGVD.js';
3
+ import { JsonViewer, useExecuteResource, useCyberColors, GlowDot } from './chunk-WXHAHKKI.js';
4
+ import { glassBase } from './chunk-FLECOYUS.js';
5
+ import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-BLXJEIQS.js';
6
+ import { memo, useMemo, useEffect, useState, useCallback, Fragment } from 'react';
7
+ import { Paper, Stack, Text, Group, Badge, Box, useComputedColorScheme, Card, ActionIcon, Loader, SegmentedControl, Collapse, Button, Modal } from '@mantine/core';
8
+ import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
+ import { Position, Handle, getSmoothStepPath, BaseEdge as BaseEdge$1, EdgeLabelRenderer, Panel, useReactFlow, Controls, ReactFlowProvider, ReactFlow } from '@xyflow/react';
10
+ import { IconPlayerPlay, IconPlayerStop, IconArrowsSplit, IconSquare, IconFocus2, IconChevronRight, IconTool, IconWand, IconBrain, IconCheck, IconAlertCircle } from '@tabler/icons-react';
11
+ import '@xyflow/react/dist/style.css';
12
+ import { z } from 'zod';
13
+ import { notifications } from '@mantine/notifications';
14
+
15
+ var DOMAIN_COLORS = {
16
+ primary: "var(--color-primary)",
17
+ agent: "#8b5cf6",
18
+ workflow: "#3b82f6",
19
+ trigger: "#f97316",
20
+ integration: "#14b8a6",
21
+ approval: "#f59e0b"
22
+ };
23
+ function fill(color, isDark) {
24
+ return isDark ? `color-mix(in srgb, ${color} 80%, black)` : `color-mix(in srgb, ${color} 60%, white)`;
25
+ }
26
+ function glow(color) {
27
+ return `color-mix(in srgb, ${color} 40%, transparent)`;
28
+ }
29
+ function useGraphTheme() {
30
+ const isDark = useComputedColorScheme("dark") === "dark";
31
+ return useMemo(
32
+ () => ({
33
+ primary: fill(DOMAIN_COLORS.primary, isDark),
34
+ primaryGlow: glow(DOMAIN_COLORS.primary),
35
+ agent: fill(DOMAIN_COLORS.agent, isDark),
36
+ workflow: fill(DOMAIN_COLORS.workflow, isDark),
37
+ trigger: fill(DOMAIN_COLORS.trigger, isDark),
38
+ integration: fill(DOMAIN_COLORS.integration, isDark),
39
+ approval: fill(DOMAIN_COLORS.approval, isDark),
40
+ agentGlow: glow(DOMAIN_COLORS.agent),
41
+ workflowGlow: glow(DOMAIN_COLORS.workflow),
42
+ triggerGlow: glow(DOMAIN_COLORS.trigger),
43
+ integrationGlow: glow(DOMAIN_COLORS.integration),
44
+ approvalGlow: glow(DOMAIN_COLORS.approval),
45
+ edgeTriggers: fill(DOMAIN_COLORS.workflow, isDark),
46
+ edgeUses: fill(DOMAIN_COLORS.integration, isDark),
47
+ edgeApproval: fill(DOMAIN_COLORS.approval, isDark),
48
+ edgeTriggersGlow: glow(DOMAIN_COLORS.workflow),
49
+ edgeUsesGlow: glow(DOMAIN_COLORS.integration),
50
+ edgeApprovalGlow: glow(DOMAIN_COLORS.approval)
51
+ }),
52
+ [isDark]
53
+ );
54
+ }
55
+ function getGraphBackgroundStyles(isDark) {
56
+ const pct = isDark ? 5 : 3;
57
+ const glowPct = isDark ? 8 : 5;
58
+ const mix = (percent) => `color-mix(in srgb, var(--color-primary) ${percent}%, transparent)`;
59
+ return {
60
+ backgroundImage: `
61
+ linear-gradient(${mix(pct)} 1px, transparent 1px),
62
+ linear-gradient(90deg, ${mix(pct)} 1px, transparent 1px),
63
+ radial-gradient(ellipse at 50% 50%, ${mix(glowPct)} 0%, transparent 70%)
64
+ `,
65
+ backgroundColor: "color-mix(in srgb, var(--color-background) 50%, var(--glass-background))",
66
+ backdropFilter: "var(--glass-blur)",
67
+ backgroundSize: "40px 40px, 40px 40px, 100% 100%"
68
+ };
69
+ }
70
+ function useGraphBackgroundStyles() {
71
+ const isDark = useComputedColorScheme("dark") === "dark";
72
+ return useMemo(() => getGraphBackgroundStyles(isDark), [isDark]);
73
+ }
74
+ function GraphContainer({ children, height = 600 }) {
75
+ const backgroundStyles = useGraphBackgroundStyles();
76
+ return /* @__PURE__ */ jsx(
77
+ Box,
78
+ {
79
+ style: {
80
+ width: "100%",
81
+ height,
82
+ border: "1px solid var(--color-border)",
83
+ borderRadius: "var(--mantine-radius-md)",
84
+ overflow: "hidden",
85
+ position: "relative",
86
+ ...backgroundStyles
87
+ },
88
+ children
89
+ }
90
+ );
91
+ }
92
+ function GraphBackground() {
93
+ return null;
94
+ }
95
+ function LegendDot({ color }) {
96
+ return /* @__PURE__ */ jsx(
97
+ Box,
98
+ {
99
+ style: {
100
+ width: 10,
101
+ height: 10,
102
+ borderRadius: "50%",
103
+ backgroundColor: `var(--mantine-color-${color}-5)`
104
+ }
105
+ }
106
+ );
107
+ }
108
+ function LegendLine({ color }) {
109
+ return /* @__PURE__ */ jsx(
110
+ Box,
111
+ {
112
+ style: {
113
+ width: 20,
114
+ height: 3,
115
+ borderRadius: 2,
116
+ background: `linear-gradient(90deg, var(--mantine-color-${color}-5), var(--mantine-color-${color}-6))`
117
+ }
118
+ }
119
+ );
120
+ }
121
+ function GraphLegend({ title = "Legend", items, position = "bottom-right" }) {
122
+ const margins = {
123
+ marginBottom: position.includes("bottom") ? 12 : void 0,
124
+ marginTop: position.includes("top") ? 12 : void 0,
125
+ marginRight: position.includes("right") ? 60 : 12,
126
+ marginLeft: position.includes("left") ? 12 : void 0
127
+ };
128
+ return /* @__PURE__ */ jsx(Panel, { position, style: margins, children: /* @__PURE__ */ jsx(Card, { p: "xs", className: Graph_module_css_default.legend, children: /* @__PURE__ */ jsxs(Group, { children: [
129
+ /* @__PURE__ */ jsx(
130
+ Text,
131
+ {
132
+ size: "xs",
133
+ fw: 600,
134
+ style: {
135
+ letterSpacing: "0.5px",
136
+ textTransform: "uppercase",
137
+ fontFamily: "var(--mantine-font-family-headings)"
138
+ },
139
+ children: title
140
+ }
141
+ ),
142
+ items.map((item) => /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
143
+ item.type === "line" ? /* @__PURE__ */ jsx(LegendLine, { color: item.color }) : /* @__PURE__ */ jsx(LegendDot, { color: item.color }),
144
+ /* @__PURE__ */ jsx(Text, { size: "xs", children: item.label })
145
+ ] }, item.label))
146
+ ] }) }) });
147
+ }
148
+ function GraphFitViewButton({ padding = 0.2, variant = "reactflow", duration = 300 }) {
149
+ const { fitView } = useReactFlow();
150
+ const handleFitView = () => {
151
+ fitView({ padding, duration });
152
+ };
153
+ if (variant === "mantine") {
154
+ return /* @__PURE__ */ jsx(
155
+ ActionIcon,
156
+ {
157
+ onClick: handleFitView,
158
+ variant: "default",
159
+ size: "lg",
160
+ title: "Fit view",
161
+ style: {
162
+ position: "absolute",
163
+ bottom: 12,
164
+ right: 12,
165
+ zIndex: 5,
166
+ background: "var(--color-surface)",
167
+ border: "1px solid var(--color-border)"
168
+ },
169
+ children: /* @__PURE__ */ jsx(IconFocus2, { size: 18 })
170
+ }
171
+ );
172
+ }
173
+ return /* @__PURE__ */ jsx(Controls, { position: "bottom-right", showZoom: false, showFitView: false, showInteractive: false, children: /* @__PURE__ */ jsx(
174
+ "button",
175
+ {
176
+ className: "react-flow__controls-button react-flow__controls-fitview",
177
+ onClick: handleFitView,
178
+ title: "Fit view",
179
+ children: /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { d: "M8 3H5C3.89 3 3 3.89 3 5V8H5V5H8V3M19 3H16V5H19V8H21V5C21 3.89 20.11 3 19 3M19 19H16V21H19C20.11 21 21 20.11 21 19V16H19V19M5 19H8V21H5C3.89 21 3 20.11 3 19V16H5V19Z" }) })
180
+ }
181
+ ) });
182
+ }
183
+ function GraphFitViewHandler({
184
+ trigger,
185
+ padding = 0.15,
186
+ duration = 300,
187
+ delay = 250
188
+ }) {
189
+ const { fitView } = useReactFlow();
190
+ useEffect(() => {
191
+ if (trigger && trigger > 0) {
192
+ const timeout = setTimeout(() => {
193
+ fitView({ padding, duration });
194
+ }, delay);
195
+ return () => clearTimeout(timeout);
196
+ }
197
+ return void 0;
198
+ }, [trigger, fitView, padding, duration, delay]);
199
+ return null;
200
+ }
201
+ var colorClassMap = {
202
+ violet: Graph_module_css_default.nodeAgent,
203
+ blue: Graph_module_css_default.nodeWorkflow,
204
+ orange: Graph_module_css_default.nodeTrigger,
205
+ teal: Graph_module_css_default.nodeIntegration,
206
+ gray: Graph_module_css_default.nodeExternal,
207
+ yellow: Graph_module_css_default.nodeHuman
208
+ };
209
+ var BaseNode = memo(function BaseNode2({
210
+ children,
211
+ color,
212
+ selected = false,
213
+ highlighted = false,
214
+ width = 220,
215
+ className = "",
216
+ handleDirection = "horizontal",
217
+ showSourceHandle = true,
218
+ showTargetHandle = true
219
+ }) {
220
+ const typeClass = colorClassMap[color] || Graph_module_css_default.nodeAgent;
221
+ const highlightClass = highlighted ? Graph_module_css_default.nodeHighlighted : "";
222
+ const targetPosition = handleDirection === "horizontal" ? Position.Left : Position.Top;
223
+ const sourcePosition = handleDirection === "horizontal" ? Position.Right : Position.Bottom;
224
+ return /* @__PURE__ */ jsxs("div", { className: `${Graph_module_css_default.node} ${typeClass} ${highlightClass} ${className}`, children: [
225
+ showTargetHandle && /* @__PURE__ */ jsx(Handle, { type: "target", position: targetPosition, style: { opacity: 0, pointerEvents: "none" } }),
226
+ showSourceHandle && /* @__PURE__ */ jsx(Handle, { type: "source", position: sourcePosition, style: { opacity: 0, pointerEvents: "none" } }),
227
+ /* @__PURE__ */ jsx(
228
+ Paper,
229
+ {
230
+ p: "sm",
231
+ className: `${Graph_module_css_default.nodeCard} ${selected ? Graph_module_css_default.nodeCardSelected : ""}`,
232
+ style: {
233
+ width,
234
+ ...glassBase,
235
+ border: `1px solid ${selected ? `var(--mantine-color-${color}-5)` : "var(--color-border)"}`,
236
+ backgroundColor: "var(--color-surface)",
237
+ cursor: "pointer",
238
+ boxShadow: selected ? `0 0 15px var(--mantine-color-${color}-5), var(--standard-box-shadow)` : "var(--standard-box-shadow)"
239
+ },
240
+ children
241
+ }
242
+ )
243
+ ] });
244
+ });
245
+ var BaseEdge = memo(function BaseEdge2({
246
+ id,
247
+ sourceX,
248
+ sourceY,
249
+ targetX,
250
+ targetY,
251
+ sourcePosition,
252
+ targetPosition,
253
+ color,
254
+ glowColor,
255
+ label,
256
+ selected,
257
+ animated = true,
258
+ dimmed = false,
259
+ edgeIndex = 0,
260
+ totalEdges = 1
261
+ }) {
262
+ const edgeSpacing = 10;
263
+ const baseOffset = 15;
264
+ const offsetAmount = totalEdges > 1 ? (edgeIndex - (totalEdges - 1) / 2) * edgeSpacing : 0;
265
+ const [edgePath, labelX, labelY] = getSmoothStepPath({
266
+ sourceX,
267
+ sourceY: sourceY + offsetAmount,
268
+ sourcePosition,
269
+ targetX,
270
+ targetY: targetY + offsetAmount,
271
+ targetPosition,
272
+ borderRadius: 8,
273
+ offset: baseOffset + Math.abs(offsetAmount)
274
+ // Stagger the turn points horizontally
275
+ });
276
+ const edgeOpacity = dimmed ? 0.25 : 1;
277
+ return /* @__PURE__ */ jsxs("g", { style: { opacity: edgeOpacity }, children: [
278
+ /* @__PURE__ */ jsx(
279
+ "path",
280
+ {
281
+ d: edgePath,
282
+ fill: "none",
283
+ stroke: color,
284
+ strokeWidth: selected ? 8 : 6,
285
+ strokeOpacity: 0.2,
286
+ style: { filter: "blur(4px)" }
287
+ }
288
+ ),
289
+ animated && !dimmed && /* @__PURE__ */ jsx(
290
+ "path",
291
+ {
292
+ d: edgePath,
293
+ fill: "none",
294
+ stroke: color,
295
+ strokeWidth: selected ? 4 : 3,
296
+ strokeOpacity: 0.3,
297
+ strokeDasharray: "12 6",
298
+ className: Graph_module_css_default.edgeAnimated,
299
+ style: { filter: `drop-shadow(0 0 3px ${glowColor})` }
300
+ }
301
+ ),
302
+ /* @__PURE__ */ jsx(
303
+ BaseEdge$1,
304
+ {
305
+ id,
306
+ path: edgePath,
307
+ style: {
308
+ stroke: color,
309
+ strokeWidth: selected ? 3 : 2,
310
+ filter: dimmed ? "none" : selected ? `drop-shadow(0 0 6px ${glowColor})` : `drop-shadow(0 0 2px ${glowColor})`
311
+ }
312
+ }
313
+ ),
314
+ animated && !dimmed && /* @__PURE__ */ jsx(
315
+ "path",
316
+ {
317
+ d: edgePath,
318
+ fill: "none",
319
+ stroke: "white",
320
+ strokeWidth: 2,
321
+ strokeOpacity: 0.6,
322
+ strokeDasharray: "4 20",
323
+ className: Graph_module_css_default.edgeAnimated,
324
+ style: { filter: "drop-shadow(0 0 2px white)" }
325
+ }
326
+ ),
327
+ label && /* @__PURE__ */ jsx(EdgeLabelRenderer, { children: /* @__PURE__ */ jsx(
328
+ "div",
329
+ {
330
+ className: `${Graph_module_css_default.edgeLabel} ${dimmed ? Graph_module_css_default.edgeLabelDimmed : ""}`,
331
+ style: {
332
+ position: "absolute",
333
+ transform: `translate(-50%, -50%) translate(${labelX}px, ${labelY}px)`,
334
+ pointerEvents: "all",
335
+ fontSize: 10,
336
+ fontWeight: 600,
337
+ textTransform: "uppercase",
338
+ letterSpacing: "0.5px",
339
+ padding: "3px 8px",
340
+ borderRadius: 6,
341
+ background: `linear-gradient(135deg, ${color}, ${color}dd)`,
342
+ color: "var(--color-text)",
343
+ boxShadow: "0 2px 8px rgba(0,0,0,0.2)",
344
+ opacity: dimmed ? 0.25 : 1
345
+ },
346
+ children: label
347
+ }
348
+ ) })
349
+ ] });
350
+ });
351
+ function ExecutionStatusBadge({
352
+ status,
353
+ size = "sm",
354
+ variant = "light",
355
+ showLoader = true
356
+ }) {
357
+ const statusColors = STATUS_COLORS[status];
358
+ const isRunning = status === "running" && showLoader;
359
+ return /* @__PURE__ */ jsx(
360
+ Badge,
361
+ {
362
+ color: statusColors.badge,
363
+ size,
364
+ variant,
365
+ leftSection: isRunning ? /* @__PURE__ */ jsx(Loader, { size: 10, color: statusColors.badge }) : void 0,
366
+ children: status.charAt(0).toUpperCase() + status.slice(1)
367
+ }
368
+ );
369
+ }
370
+ function TimelineAxis({ totalDuration }) {
371
+ const markers = [
372
+ { position: 0, time: 0 },
373
+ { position: 25, time: totalDuration * 0.25 },
374
+ { position: 50, time: totalDuration * 0.5 },
375
+ { position: 75, time: totalDuration * 0.75 },
376
+ { position: 100, time: totalDuration }
377
+ ];
378
+ return /* @__PURE__ */ jsx(
379
+ Box,
380
+ {
381
+ style: {
382
+ position: "relative",
383
+ height: 20
384
+ },
385
+ children: markers.map((marker, idx) => /* @__PURE__ */ jsx(
386
+ Box,
387
+ {
388
+ style: {
389
+ position: "absolute",
390
+ left: `${marker.position}%`,
391
+ transform: marker.position === 100 ? "translateX(-100%)" : marker.position === 0 ? "none" : "translateX(-50%)",
392
+ top: 4
393
+ },
394
+ children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(marker.time) })
395
+ },
396
+ idx
397
+ ))
398
+ }
399
+ );
400
+ }
401
+ function TimelineContainer({ executionStart, executionEnd, children }) {
402
+ const totalDuration = executionEnd - executionStart;
403
+ return /* @__PURE__ */ jsxs(
404
+ Box,
405
+ {
406
+ style: {
407
+ borderBottom: "1px solid var(--color-border)",
408
+ backgroundColor: "var(--color-background)",
409
+ padding: "var(--mantine-spacing-xs)"
410
+ },
411
+ children: [
412
+ /* @__PURE__ */ jsx(
413
+ Box,
414
+ {
415
+ style: {
416
+ position: "relative"
417
+ },
418
+ children: /* @__PURE__ */ jsx(Box, { style: { position: "relative", zIndex: 1 }, children })
419
+ }
420
+ ),
421
+ /* @__PURE__ */ jsx(Box, { style: { paddingLeft: TIMELINE_CONSTANTS.LABEL_WIDTH + 12, paddingRight: 16 }, children: /* @__PURE__ */ jsx(TimelineAxis, { totalDuration }) })
422
+ ]
423
+ }
424
+ );
425
+ }
426
+ function TimelineBar({
427
+ startTime,
428
+ endTime,
429
+ executionStart,
430
+ executionEnd,
431
+ status,
432
+ label,
433
+ onClick,
434
+ isSelected = false,
435
+ hasSelection = false
436
+ }) {
437
+ const colors = getStatusColors(status);
438
+ const { left, width } = calculateBarPosition(startTime, endTime, executionStart, executionEnd);
439
+ const opacity = hasSelection && !isSelected ? 0.5 : 1;
440
+ return /* @__PURE__ */ jsx(
441
+ Box,
442
+ {
443
+ style: {
444
+ position: "absolute",
445
+ left: `${left}%`,
446
+ width: `${width}%`,
447
+ top: 4,
448
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT / 2,
449
+ backgroundColor: colors.color,
450
+ opacity,
451
+ borderRadius: 4,
452
+ cursor: onClick ? "pointer" : "default",
453
+ display: "flex",
454
+ alignItems: "center",
455
+ justifyContent: "center",
456
+ overflow: "hidden"
457
+ },
458
+ onClick,
459
+ children: label && /* @__PURE__ */ jsx(Text, { size: "xs", c: "white", style: { whiteSpace: "nowrap" }, children: label })
460
+ }
461
+ );
462
+ }
463
+ function TimelineRow({
464
+ label,
465
+ bars,
466
+ executionStart,
467
+ executionEnd,
468
+ indent = 0,
469
+ selectedNodeId
470
+ }) {
471
+ const labelMatch = label.match(/^(.+?)\s*\((.+?)\)$/);
472
+ const labelName = labelMatch ? labelMatch[1] : label;
473
+ const labelDuration = labelMatch ? labelMatch[2] : null;
474
+ const statusColor = bars.length > 0 ? getStatusColors(bars[0].status).color : "var(--color-text-dimmed)";
475
+ const hasSelection = selectedNodeId !== null && selectedNodeId !== void 0;
476
+ return /* @__PURE__ */ jsxs(
477
+ Box,
478
+ {
479
+ style: {
480
+ display: "flex",
481
+ gap: 0,
482
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT
483
+ // paddingLeft: indent * TIMELINE_CONSTANTS.INDENT_SIZE
484
+ },
485
+ children: [
486
+ /* @__PURE__ */ jsxs(
487
+ Box,
488
+ {
489
+ style: {
490
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT,
491
+ width: TIMELINE_CONSTANTS.LABEL_WIDTH,
492
+ flexShrink: 0,
493
+ display: "flex",
494
+ alignItems: "center",
495
+ gap: 6,
496
+ paddingRight: 12,
497
+ paddingLeft: 8 + indent * TIMELINE_CONSTANTS.INDENT_SIZE,
498
+ // Indent only the label, not the timeline bars
499
+ overflow: "hidden"
500
+ },
501
+ children: [
502
+ /* @__PURE__ */ jsx(
503
+ Box,
504
+ {
505
+ style: {
506
+ width: 6,
507
+ height: 6,
508
+ borderRadius: "50%",
509
+ backgroundColor: statusColor,
510
+ flexShrink: 0
511
+ }
512
+ }
513
+ ),
514
+ /* @__PURE__ */ jsx(Text, { size: "sm", truncate: true, style: { flexShrink: 1, minWidth: 0 }, children: labelName }),
515
+ labelDuration && /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", ff: "monospace", style: { flexShrink: 0 }, children: [
516
+ "(",
517
+ labelDuration,
518
+ ")"
519
+ ] })
520
+ ]
521
+ }
522
+ ),
523
+ /* @__PURE__ */ jsx(
524
+ Box,
525
+ {
526
+ style: {
527
+ position: "relative",
528
+ flex: 1,
529
+ height: TIMELINE_CONSTANTS.BAR_HEIGHT,
530
+ marginLeft: 12,
531
+ marginRight: 16
532
+ // Right margin to match grid padding
533
+ },
534
+ children: bars.map((bar, idx) => {
535
+ const isSelected = bar.nodeId !== void 0 && bar.nodeId === selectedNodeId;
536
+ return /* @__PURE__ */ jsx(
537
+ TimelineBar,
538
+ {
539
+ ...bar,
540
+ executionStart,
541
+ executionEnd,
542
+ isSelected,
543
+ hasSelection
544
+ },
545
+ idx
546
+ );
547
+ })
548
+ }
549
+ )
550
+ ]
551
+ }
552
+ );
553
+ }
554
+ var VisualizerContainer = ({ children, handleContainerClick, height }) => {
555
+ const containerHeight = height ?? CONTAINER_CONSTANTS.CONTAINER_HEIGHT;
556
+ return /* @__PURE__ */ jsx(Box, { onClick: handleContainerClick, children: /* @__PURE__ */ jsx(
557
+ "div",
558
+ {
559
+ className: `elevasis-graph-root ${Graph_module_css_default.graphContainer}`,
560
+ style: {
561
+ width: "100%",
562
+ height: `${containerHeight}px`,
563
+ overflow: "hidden"
564
+ },
565
+ children
566
+ }
567
+ ) });
568
+ };
569
+ var EmptyVisualizer = ({ message = "Select an execution to view timeline" }) => {
570
+ return /* @__PURE__ */ jsx(
571
+ Box,
572
+ {
573
+ h: CONTAINER_CONSTANTS.CONTAINER_HEIGHT,
574
+ bg: "var(--color-background)",
575
+ style: {
576
+ borderBottom: "1px solid var(--color-border)",
577
+ borderRadius: "var(--mantine-radius-default)",
578
+ display: "flex",
579
+ alignItems: "center",
580
+ justifyContent: "center"
581
+ },
582
+ children: /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: message })
583
+ }
584
+ );
585
+ };
586
+ var UnifiedWorkflowNode = memo(function UnifiedWorkflowNode2({ data }) {
587
+ const selected = data.isSelected ?? false;
588
+ const primaryColor = data.isEntryPoint ? "teal" : data.isEndNode ? "violet" : data.isConditional ? "orange" : "blue";
589
+ const statusColors = data.executionStatus ? STATUS_COLORS[data.executionStatus] : void 0;
590
+ const showExecutionStatus = data.isExecuted && data.executionStatus;
591
+ return /* @__PURE__ */ jsx(
592
+ BaseNode,
593
+ {
594
+ color: primaryColor,
595
+ selected,
596
+ highlighted: Boolean(data.highlighted),
597
+ width: 220,
598
+ className: data.isDimmed ? "dimmed-node" : "",
599
+ showSourceHandle: !data.isEndNode,
600
+ children: /* @__PURE__ */ jsx("div", { style: { opacity: data.isDimmed ? 0.3 : 1 }, children: /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
601
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, lineClamp: 1, style: { fontFamily: "var(--mantine-font-family-headings)" }, children: data.name }),
602
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
603
+ data.isEntryPoint && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "teal", leftSection: /* @__PURE__ */ jsx(IconPlayerPlay, { size: 10 }), children: "Entry" }),
604
+ data.isEndNode && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "violet", leftSection: /* @__PURE__ */ jsx(IconPlayerStop, { size: 10 }), children: "End" }),
605
+ data.isConditional && /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: "orange", leftSection: /* @__PURE__ */ jsx(IconArrowsSplit, { size: 10 }), children: [
606
+ data.routeCount,
607
+ " routes"
608
+ ] }),
609
+ !data.isEntryPoint && !data.isEndNode && !data.isConditional && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", leftSection: /* @__PURE__ */ jsx(IconSquare, { size: 10 }), children: "Step" }),
610
+ /* @__PURE__ */ jsx(Text, { size: "xs", ff: "monospace", c: "dimmed", truncate: true, children: data.id })
611
+ ] }),
612
+ !data.isDimmed && data.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 2, children: data.description }),
613
+ showExecutionStatus && statusColors && /* @__PURE__ */ jsx(Box, { mt: 4, children: /* @__PURE__ */ jsxs(Group, { gap: 8, align: "center", children: [
614
+ /* @__PURE__ */ jsx(Box, { children: getStatusIcon({
615
+ status: data.executionStatus,
616
+ colors: { icon: statusColors.color },
617
+ iconSize: 16,
618
+ spinDuration: "1s"
619
+ }) }),
620
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: statusColors.badge, children: data.executionStatus }),
621
+ data.duration !== void 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(data.duration) })
622
+ ] }) })
623
+ ] }) })
624
+ }
625
+ );
626
+ });
627
+ var UnifiedWorkflowEdge = memo(function UnifiedWorkflowEdge2({
628
+ id,
629
+ sourceX,
630
+ sourceY,
631
+ targetX,
632
+ targetY,
633
+ selected,
634
+ data
635
+ }) {
636
+ const colors = useGraphTheme();
637
+ const edgeType = data?.edgeType || "linear";
638
+ const isDimmed = data?.isDimmed ?? false;
639
+ const isAnimated = data?.isAnimated ?? false;
640
+ let edgeColor;
641
+ let glowColor;
642
+ let label;
643
+ switch (edgeType) {
644
+ case "conditional":
645
+ edgeColor = colors.trigger;
646
+ glowColor = colors.triggerGlow;
647
+ label = data?.label || "route";
648
+ break;
649
+ case "default":
650
+ edgeColor = colors.integration;
651
+ glowColor = colors.integrationGlow;
652
+ label = data?.label || "default";
653
+ break;
654
+ case "linear":
655
+ default:
656
+ edgeColor = colors.workflow;
657
+ glowColor = colors.workflowGlow;
658
+ label = void 0;
659
+ break;
660
+ }
661
+ return /* @__PURE__ */ jsx(
662
+ BaseEdge,
663
+ {
664
+ id,
665
+ sourceX,
666
+ sourceY,
667
+ targetX,
668
+ targetY,
669
+ sourcePosition: Position.Right,
670
+ targetPosition: Position.Left,
671
+ color: edgeColor,
672
+ glowColor,
673
+ label,
674
+ selected,
675
+ animated: isAnimated,
676
+ dimmed: isDimmed
677
+ }
678
+ );
679
+ });
680
+ var nodeTypes = {
681
+ unifiedWorkflowNode: UnifiedWorkflowNode
682
+ };
683
+ var edgeTypes = {
684
+ unifiedWorkflowEdge: UnifiedWorkflowEdge
685
+ };
686
+ var NODE_LEGEND_ITEMS = [
687
+ { color: "teal", label: "Entry" },
688
+ { color: "blue", label: "Step" },
689
+ { color: "orange", label: "Conditional" },
690
+ { color: "violet", label: "End" }
691
+ ];
692
+ var EDGE_LEGEND_ITEMS = [
693
+ { color: "blue", label: "Next", type: "line" },
694
+ { color: "orange", label: "Route", type: "line" },
695
+ { color: "teal", label: "Default", type: "line" }
696
+ ];
697
+ function UnifiedWorkflowGraph({
698
+ resourceDefinition,
699
+ executionLogs,
700
+ selectedStepId,
701
+ onStepSelect,
702
+ fitViewTrigger: externalFitViewTrigger
703
+ }) {
704
+ const hasExecutionData = executionLogs && executionLogs.length > 0;
705
+ const [mode, setMode] = useState(hasExecutionData ? "execution" : "definition");
706
+ useEffect(() => {
707
+ setMode(hasExecutionData ? "execution" : "definition");
708
+ }, [hasExecutionData]);
709
+ const isDefinitionMode = mode === "definition";
710
+ const executionPath = useExecutionPath(
711
+ isDefinitionMode ? void 0 : executionLogs,
712
+ isDefinitionMode ? void 0 : resourceDefinition
713
+ );
714
+ const workflowInput = useMemo(
715
+ () => resourceDefinition ? { entryPoint: resourceDefinition.entryPoint, steps: resourceDefinition.steps } : void 0,
716
+ [resourceDefinition]
717
+ );
718
+ const {
719
+ nodes: layoutNodes,
720
+ edges: layoutEdges,
721
+ graphHeight
722
+ } = useUnifiedWorkflowLayout(workflowInput, executionPath, isDefinitionMode ? null : selectedStepId, mode);
723
+ const {
724
+ nodes: highlightedNodes,
725
+ edges: highlightedEdges,
726
+ handleNodeMouseEnter,
727
+ handleNodeMouseLeave
728
+ } = useDirectedChainHighlighting(layoutNodes, layoutEdges);
729
+ const nodes = isDefinitionMode ? highlightedNodes : layoutNodes;
730
+ const edges = isDefinitionMode ? highlightedEdges : layoutEdges;
731
+ const [internalFitViewTrigger, setInternalFitViewTrigger] = useState(0);
732
+ const executedStepsCount = executionPath?.executedSteps.size ?? 0;
733
+ const nodesCount = nodes.length;
734
+ useEffect(() => {
735
+ if (nodesCount > 0) {
736
+ setInternalFitViewTrigger((prev) => prev + 1);
737
+ }
738
+ }, [nodesCount, executedStepsCount]);
739
+ const fitViewTrigger = (externalFitViewTrigger ?? 0) + internalFitViewTrigger;
740
+ const { handleNodeClick, handlePaneClick, handleContainerClick } = useNodeSelection(
741
+ selectedStepId || null,
742
+ onStepSelect || (() => {
743
+ })
744
+ );
745
+ if (!resourceDefinition || !resourceDefinition.steps.length) {
746
+ return /* @__PURE__ */ jsx(EmptyVisualizer, {});
747
+ }
748
+ return /* @__PURE__ */ jsx(
749
+ VisualizerContainer,
750
+ {
751
+ handleContainerClick: isDefinitionMode ? void 0 : handleContainerClick,
752
+ height: graphHeight,
753
+ children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsxs(
754
+ ReactFlow,
755
+ {
756
+ nodes,
757
+ edges,
758
+ nodeTypes,
759
+ edgeTypes,
760
+ onNodeClick: isDefinitionMode ? void 0 : handleNodeClick,
761
+ onPaneClick: isDefinitionMode ? void 0 : handlePaneClick,
762
+ onNodeMouseEnter: isDefinitionMode ? handleNodeMouseEnter : void 0,
763
+ onNodeMouseLeave: isDefinitionMode ? handleNodeMouseLeave : void 0,
764
+ fitView: true,
765
+ fitViewOptions: {
766
+ padding: WORKFLOW_CONSTANTS.FIT_VIEW_PADDING
767
+ },
768
+ proOptions: { hideAttribution: true },
769
+ minZoom: WORKFLOW_CONSTANTS.MIN_ZOOM,
770
+ maxZoom: WORKFLOW_CONSTANTS.MAX_ZOOM,
771
+ defaultViewport: { x: 0, y: 0, zoom: 1 },
772
+ nodesDraggable: false,
773
+ nodesConnectable: false,
774
+ elementsSelectable: !isDefinitionMode,
775
+ selectNodesOnDrag: false,
776
+ zoomOnScroll: true,
777
+ panOnDrag: true,
778
+ children: [
779
+ /* @__PURE__ */ jsx(GraphBackground, {}),
780
+ /* @__PURE__ */ jsx(Panel, { position: "top-right", style: { marginTop: 12, marginRight: 12 }, children: /* @__PURE__ */ jsx(
781
+ SegmentedControl,
782
+ {
783
+ size: "xs",
784
+ value: mode,
785
+ onChange: (value) => setMode(value),
786
+ data: [
787
+ { label: "Definition", value: "definition" },
788
+ { label: "Execution", value: "execution" }
789
+ ],
790
+ styles: {
791
+ root: {
792
+ backgroundColor: "var(--color-surface)",
793
+ border: "1px solid var(--color-border)"
794
+ }
795
+ }
796
+ }
797
+ ) }),
798
+ /* @__PURE__ */ jsx(GraphLegend, { title: "Legend", items: NODE_LEGEND_ITEMS, position: "bottom-right" }),
799
+ /* @__PURE__ */ jsx(GraphLegend, { title: "Flow", items: EDGE_LEGEND_ITEMS, position: "bottom-left" }),
800
+ /* @__PURE__ */ jsx(GraphFitViewButton, { padding: WORKFLOW_CONSTANTS.FIT_VIEW_PADDING, variant: "mantine" }),
801
+ /* @__PURE__ */ jsx(GraphFitViewHandler, { trigger: fitViewTrigger, padding: WORKFLOW_CONSTANTS.FIT_VIEW_PADDING })
802
+ ]
803
+ }
804
+ ) })
805
+ }
806
+ );
807
+ }
808
+ function WorkflowExecutionTimeline({ timelineData, selectedStepId }) {
809
+ const { steps } = timelineData;
810
+ const executionStart = steps[0]?.startTime || 0;
811
+ const executionEnd = steps[steps.length - 1]?.endTime || executionStart;
812
+ return /* @__PURE__ */ jsx(TimelineContainer, { executionStart, executionEnd, children: steps.map(
813
+ (step) => step.startTime && step.endTime && /* @__PURE__ */ jsx(
814
+ TimelineRow,
815
+ {
816
+ label: step.stepName,
817
+ bars: [
818
+ {
819
+ startTime: step.startTime,
820
+ endTime: step.endTime,
821
+ status: step.status,
822
+ nodeId: step.stepId
823
+ }
824
+ ],
825
+ executionStart,
826
+ executionEnd,
827
+ selectedNodeId: selectedStepId
828
+ },
829
+ step.stepId
830
+ )
831
+ ) });
832
+ }
833
+ var statusColorMap = {
834
+ running: "blue",
835
+ completed: "teal",
836
+ failed: "orange",
837
+ pending: "violet",
838
+ warning: "yellow"
839
+ };
840
+ var AgentIterationNode = memo(function AgentIterationNode2({ data, selected }) {
841
+ const {
842
+ nodeType,
843
+ label,
844
+ iterationNumber,
845
+ status,
846
+ reasoningCount,
847
+ actionCount,
848
+ toolCallCount,
849
+ failedToolCallCount,
850
+ duration,
851
+ isLive
852
+ } = data;
853
+ const colors = getStatusColors(status);
854
+ const nodeColor = statusColorMap[status];
855
+ const hasToolCalls = nodeType === "iteration" && toolCallCount !== void 0 && toolCallCount > 0;
856
+ const hasFailedToolCalls = failedToolCallCount !== void 0 && failedToolCallCount > 0;
857
+ return /* @__PURE__ */ jsxs(BaseNode, { color: nodeColor, selected, width: AGENT_CONSTANTS.NODE_WIDTH, children: [
858
+ /* @__PURE__ */ jsxs(Box, { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
859
+ /* @__PURE__ */ jsx(
860
+ Box,
861
+ {
862
+ style: {
863
+ width: AGENT_CONSTANTS.CIRCLE_SIZE,
864
+ height: AGENT_CONSTANTS.CIRCLE_SIZE,
865
+ borderRadius: "50%",
866
+ border: `2px solid ${colors.color}`,
867
+ display: "flex",
868
+ alignItems: "center",
869
+ justifyContent: "center"
870
+ },
871
+ children: getStatusIcon({
872
+ status,
873
+ colors: { icon: colors.color },
874
+ iconSize: AGENT_CONSTANTS.STATUS_ICON_SIZE,
875
+ spinDuration: "1s"
876
+ })
877
+ }
878
+ ),
879
+ /* @__PURE__ */ jsx(
880
+ Text,
881
+ {
882
+ size: "sm",
883
+ fw: status === "running" ? 500 : 400,
884
+ ta: "center",
885
+ mt: 4,
886
+ style: { maxWidth: 150, fontFamily: "var(--mantine-font-family-headings)" },
887
+ children: nodeType === "iteration" ? `Iteration ${iterationNumber}` : label
888
+ }
889
+ ),
890
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: colors.badge, mt: 4, children: status.toUpperCase() }),
891
+ /* @__PURE__ */ jsxs(Stack, { gap: 2, mt: 2, align: "center", children: [
892
+ nodeType === "iteration" && reasoningCount !== void 0 && reasoningCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
893
+ reasoningCount,
894
+ " reasoning"
895
+ ] }),
896
+ nodeType === "iteration" && actionCount !== void 0 && actionCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
897
+ actionCount,
898
+ " ",
899
+ actionCount === 1 ? "action" : "actions"
900
+ ] }),
901
+ hasToolCalls && /* @__PURE__ */ jsxs(Group, { gap: 4, align: "center", wrap: "nowrap", children: [
902
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
903
+ toolCallCount,
904
+ " ",
905
+ toolCallCount === 1 ? "tool" : "tools"
906
+ ] }),
907
+ hasFailedToolCalls && /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: "red", px: 4, children: [
908
+ failedToolCallCount,
909
+ " failed"
910
+ ] })
911
+ ] }),
912
+ duration !== void 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(duration) })
913
+ ] })
914
+ ] }),
915
+ isLive && /* @__PURE__ */ jsx(
916
+ Badge,
917
+ {
918
+ size: "xs",
919
+ variant: "filled",
920
+ style: {
921
+ position: "absolute",
922
+ top: 4,
923
+ right: 4
924
+ },
925
+ children: /* @__PURE__ */ jsx("span", { className: Graph_module_css_default.livePulse, children: "LIVE" })
926
+ }
927
+ )
928
+ ] });
929
+ });
930
+ var statusEdgeColors = {
931
+ running: {
932
+ color: "var(--mantine-color-blue-5)",
933
+ glow: "rgba(59, 130, 246, 0.5)"
934
+ },
935
+ completed: {
936
+ color: "var(--mantine-color-teal-5)",
937
+ glow: "rgba(20, 184, 166, 0.5)"
938
+ },
939
+ failed: {
940
+ color: "var(--mantine-color-orange-5)",
941
+ glow: "rgba(249, 115, 22, 0.5)"
942
+ },
943
+ pending: {
944
+ color: "var(--mantine-color-gray-5)",
945
+ glow: "rgba(156, 163, 175, 0.3)"
946
+ },
947
+ warning: {
948
+ color: "var(--mantine-color-yellow-5)",
949
+ glow: "rgba(234, 179, 8, 0.5)"
950
+ }
951
+ };
952
+ var AgentIterationEdge = memo(function AgentIterationEdge2({
953
+ id,
954
+ sourceX,
955
+ sourceY,
956
+ targetX,
957
+ targetY,
958
+ data,
959
+ selected
960
+ }) {
961
+ const edgeData = data;
962
+ const sourceStatus = edgeData?.sourceStatus || "pending";
963
+ const targetStatus = edgeData?.targetStatus || "pending";
964
+ const edgeColors = statusEdgeColors[sourceStatus];
965
+ const isAnimated = shouldAnimateEdge(sourceStatus, targetStatus);
966
+ return /* @__PURE__ */ jsx(
967
+ BaseEdge,
968
+ {
969
+ id,
970
+ sourceX,
971
+ sourceY,
972
+ targetX,
973
+ targetY,
974
+ sourcePosition: Position.Right,
975
+ targetPosition: Position.Left,
976
+ color: edgeColors.color,
977
+ glowColor: edgeColors.glow,
978
+ animated: isAnimated,
979
+ selected
980
+ }
981
+ );
982
+ });
983
+ var nodeTypes2 = {
984
+ agentIteration: AgentIterationNode
985
+ };
986
+ var edgeTypes2 = {
987
+ agentIteration: AgentIterationEdge
988
+ };
989
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "warning"]);
990
+ function hasAgentLifecycleLogs(execution) {
991
+ return Boolean(
992
+ execution?.executionLogs?.some((log) => {
993
+ const context = log.context;
994
+ return context?.type === "agent" && "lifecycle" in context;
995
+ })
996
+ );
997
+ }
998
+ function getUnavailableTraceMessage(execution, selectedExecutionId) {
999
+ if (!selectedExecutionId) {
1000
+ return null;
1001
+ }
1002
+ if (execution?.isArchived) {
1003
+ return "Detailed trace unavailable for archived execution. Raw logs can be loaded below, but graph and detail rendering do not hydrate archived logs yet.";
1004
+ }
1005
+ if (execution && execution.executionLogs.length === 0 && TERMINAL_STATUSES.has(execution.status)) {
1006
+ return "Detailed trace unavailable. This terminal execution has no lifecycle logs available for graph rendering.";
1007
+ }
1008
+ if (execution && TERMINAL_STATUSES.has(execution.status) && !hasAgentLifecycleLogs(execution)) {
1009
+ return "Detailed trace unavailable. This run has no agent lifecycle context, so raw logs are shown below instead.";
1010
+ }
1011
+ return null;
1012
+ }
1013
+ function AgentExecutionVisualizer({
1014
+ resourceDefinition,
1015
+ iterationData,
1016
+ execution,
1017
+ selectedExecutionId,
1018
+ liveExecutions,
1019
+ selectedIterationId,
1020
+ onIterationSelect
1021
+ }) {
1022
+ const { nodes, edges } = useReactFlowAgent(
1023
+ iterationData,
1024
+ resourceDefinition,
1025
+ selectedIterationId,
1026
+ liveExecutions,
1027
+ selectedExecutionId
1028
+ );
1029
+ const fitViewTrigger = useFitViewTrigger(iterationData, nodes);
1030
+ const handleIterationSelect = useCallback(
1031
+ (id) => {
1032
+ onIterationSelect(id);
1033
+ },
1034
+ [onIterationSelect]
1035
+ );
1036
+ const { handlePaneClick, handleContainerClick } = useNodeSelection(selectedIterationId, handleIterationSelect);
1037
+ const handleNodeClick = useCallback(
1038
+ (_event, node) => {
1039
+ if (node.id === "initialization" || node.id === "completion") {
1040
+ handleIterationSelect(selectedIterationId === node.id ? null : node.id);
1041
+ return;
1042
+ }
1043
+ const iterationNumber = Number.parseInt(node.id.replace("iteration-", ""), 10);
1044
+ if (!Number.isNaN(iterationNumber)) {
1045
+ handleIterationSelect(iterationNumber === selectedIterationId ? null : iterationNumber);
1046
+ }
1047
+ },
1048
+ [selectedIterationId, handleIterationSelect]
1049
+ );
1050
+ const unavailableTraceMessage = getUnavailableTraceMessage(execution, selectedExecutionId);
1051
+ if (unavailableTraceMessage) {
1052
+ return /* @__PURE__ */ jsx(EmptyVisualizer, { message: unavailableTraceMessage });
1053
+ }
1054
+ if (!iterationData || nodes.length === 0) {
1055
+ return /* @__PURE__ */ jsx(EmptyVisualizer, {});
1056
+ }
1057
+ return /* @__PURE__ */ jsx(VisualizerContainer, { handleContainerClick, children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsxs(
1058
+ ReactFlow,
1059
+ {
1060
+ nodes,
1061
+ edges,
1062
+ nodeTypes: nodeTypes2,
1063
+ edgeTypes: edgeTypes2,
1064
+ onNodeClick: handleNodeClick,
1065
+ onPaneClick: handlePaneClick,
1066
+ fitView: true,
1067
+ fitViewOptions: {
1068
+ padding: AGENT_CONSTANTS.FIT_VIEW_PADDING
1069
+ },
1070
+ proOptions: { hideAttribution: true },
1071
+ minZoom: AGENT_CONSTANTS.MIN_ZOOM,
1072
+ maxZoom: AGENT_CONSTANTS.MAX_ZOOM,
1073
+ nodesDraggable: false,
1074
+ nodesConnectable: false,
1075
+ elementsSelectable: true,
1076
+ selectNodesOnDrag: false,
1077
+ zoomOnScroll: false,
1078
+ panOnDrag: false,
1079
+ children: [
1080
+ /* @__PURE__ */ jsx(GraphBackground, {}),
1081
+ /* @__PURE__ */ jsx(GraphFitViewButton, { padding: AGENT_CONSTANTS.FIT_VIEW_PADDING, variant: "mantine", duration: 300 }),
1082
+ /* @__PURE__ */ jsx(GraphFitViewHandler, { trigger: fitViewTrigger, padding: AGENT_CONSTANTS.FIT_VIEW_PADDING })
1083
+ ]
1084
+ }
1085
+ ) }) });
1086
+ }
1087
+ function getSubActivityLabel(activity) {
1088
+ if (activity.type === "tool-call") {
1089
+ return "toolName" in activity.details && activity.details.toolName ? activity.details.toolName : activity.type;
1090
+ }
1091
+ if (activity.type === "action") {
1092
+ return "actionType" in activity.details && activity.details.actionType ? activity.details.actionType : activity.type;
1093
+ }
1094
+ return activity.type;
1095
+ }
1096
+ function getSubActivityStatus(activity) {
1097
+ if (activity.type === "tool-call" && "success" in activity.details) {
1098
+ return activity.details.success ? "completed" : "failed";
1099
+ }
1100
+ return "completed";
1101
+ }
1102
+ function AgentExecutionTimeline({ iterationData, selectedIterationId }) {
1103
+ const { initialization, iterations, completion } = iterationData;
1104
+ const executionStart = initialization.startTime;
1105
+ const executionEnd = completion.endTime;
1106
+ return /* @__PURE__ */ jsxs(TimelineContainer, { executionStart, executionEnd, children: [
1107
+ initialization.startTime && initialization.endTime && /* @__PURE__ */ jsx(
1108
+ TimelineRow,
1109
+ {
1110
+ label: `Initialization (${formatDuration(initialization.duration || 0)})`,
1111
+ bars: [
1112
+ {
1113
+ startTime: initialization.startTime,
1114
+ endTime: initialization.endTime,
1115
+ status: initialization.status,
1116
+ nodeId: "initialization"
1117
+ }
1118
+ ],
1119
+ executionStart,
1120
+ executionEnd,
1121
+ selectedNodeId: selectedIterationId
1122
+ }
1123
+ ),
1124
+ iterations.map((iteration) => /* @__PURE__ */ jsxs(Fragment, { children: [
1125
+ iteration.startTime && iteration.endTime && /* @__PURE__ */ jsx(
1126
+ TimelineRow,
1127
+ {
1128
+ label: `Iteration ${iteration.iterationNumber} (${formatDuration(iteration.duration || 0)})`,
1129
+ bars: [
1130
+ {
1131
+ startTime: iteration.startTime,
1132
+ endTime: iteration.endTime,
1133
+ status: iteration.status,
1134
+ nodeId: iteration.iterationNumber
1135
+ }
1136
+ ],
1137
+ executionStart,
1138
+ executionEnd,
1139
+ selectedNodeId: selectedIterationId
1140
+ }
1141
+ ),
1142
+ iteration.subActivities.map((activity, activityIndex) => {
1143
+ const activityLabel = getSubActivityLabel(activity);
1144
+ const activityStatus = getSubActivityStatus(activity);
1145
+ return /* @__PURE__ */ jsx(
1146
+ TimelineRow,
1147
+ {
1148
+ label: `${activityLabel} (${formatDuration(activity.duration)})`,
1149
+ bars: [
1150
+ {
1151
+ startTime: activity.startTime,
1152
+ endTime: activity.endTime,
1153
+ status: activityStatus,
1154
+ nodeId: iteration.iterationNumber
1155
+ }
1156
+ ],
1157
+ executionStart,
1158
+ executionEnd,
1159
+ indent: 1,
1160
+ selectedNodeId: selectedIterationId
1161
+ },
1162
+ `${iteration.iterationNumber}-${activity.type}-${activity.startTime}-${activityIndex}`
1163
+ );
1164
+ })
1165
+ ] }, iteration.iterationNumber)),
1166
+ completion.startTime && completion.endTime && /* @__PURE__ */ jsx(
1167
+ TimelineRow,
1168
+ {
1169
+ label: `Completion (${formatDuration(completion.duration || 0)})`,
1170
+ bars: [
1171
+ {
1172
+ startTime: completion.startTime,
1173
+ endTime: completion.endTime,
1174
+ status: completion.status,
1175
+ nodeId: "completion"
1176
+ }
1177
+ ],
1178
+ executionStart,
1179
+ executionEnd,
1180
+ selectedNodeId: selectedIterationId
1181
+ }
1182
+ )
1183
+ ] });
1184
+ }
1185
+ function CollapsibleJsonSection({ title, data, defaultExpanded = false }) {
1186
+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);
1187
+ const [isHovered, setIsHovered] = useState(false);
1188
+ return /* @__PURE__ */ jsxs(
1189
+ "div",
1190
+ {
1191
+ style: {
1192
+ borderRadius: "var(--mantine-radius-default)",
1193
+ backgroundColor: isHovered ? "var(--color-surface-hover, rgba(0,0,0,0.02))" : "transparent",
1194
+ transition: "background-color var(--duration-fast) var(--easing)"
1195
+ },
1196
+ children: [
1197
+ /* @__PURE__ */ jsxs(
1198
+ Group,
1199
+ {
1200
+ gap: 4,
1201
+ onClick: () => setIsExpanded(!isExpanded),
1202
+ onMouseEnter: () => setIsHovered(true),
1203
+ onMouseLeave: () => setIsHovered(false),
1204
+ style: {
1205
+ cursor: "pointer",
1206
+ padding: "0.375rem 0.5rem",
1207
+ userSelect: "none"
1208
+ },
1209
+ wrap: "nowrap",
1210
+ children: [
1211
+ /* @__PURE__ */ jsx(
1212
+ ActionIcon,
1213
+ {
1214
+ variant: "transparent",
1215
+ size: "xs",
1216
+ style: {
1217
+ transition: "transform var(--duration-fast) var(--easing)",
1218
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)"
1219
+ },
1220
+ children: /* @__PURE__ */ jsx(IconChevronRight, { size: 14 })
1221
+ }
1222
+ ),
1223
+ title
1224
+ ]
1225
+ }
1226
+ ),
1227
+ /* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: /* @__PURE__ */ jsx(JsonViewer, { data }) })
1228
+ ]
1229
+ }
1230
+ );
1231
+ }
1232
+ function CollapsibleTextSection({ title, text }) {
1233
+ return /* @__PURE__ */ jsx(
1234
+ CollapsibleJsonSection,
1235
+ {
1236
+ title: /* @__PURE__ */ jsx(Text, { size: "xs", fw: 500, children: title }),
1237
+ data: text
1238
+ }
1239
+ );
1240
+ }
1241
+ function ActivityIcon({ activity }) {
1242
+ if (activity.type === "tool-call") {
1243
+ return /* @__PURE__ */ jsx(IconTool, { size: 16 });
1244
+ }
1245
+ if (activity.type === "action") {
1246
+ return /* @__PURE__ */ jsx(IconWand, { size: 16 });
1247
+ }
1248
+ return /* @__PURE__ */ jsx(IconBrain, { size: 16 });
1249
+ }
1250
+ function getActivityTitle(activity) {
1251
+ if (activity.type === "tool-call") {
1252
+ return "toolName" in activity.details && activity.details.toolName ? activity.details.toolName : "Tool call";
1253
+ }
1254
+ if (activity.type === "action") {
1255
+ return "actionType" in activity.details && activity.details.actionType ? activity.details.actionType : "Action";
1256
+ }
1257
+ return "Reasoning";
1258
+ }
1259
+ function ActivityBadge({ activity }) {
1260
+ if (activity.type !== "tool-call" || !("success" in activity.details)) {
1261
+ return /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "gray", children: activity.type });
1262
+ }
1263
+ return activity.details.success ? /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "green", leftSection: /* @__PURE__ */ jsx(IconCheck, { size: 12 }), children: "Success" }) : /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: "red", leftSection: /* @__PURE__ */ jsx(IconAlertCircle, { size: 12 }), children: "Error" });
1264
+ }
1265
+ function ActivityDetails({ activity }) {
1266
+ if (activity.type === "reasoning" && "output" in activity.details && typeof activity.details.output === "string" && activity.details.output) {
1267
+ return /* @__PURE__ */ jsx(CollapsibleTextSection, { title: "Reasoning", text: activity.details.output });
1268
+ }
1269
+ if (activity.type === "action" && "data" in activity.details && activity.details.data) {
1270
+ return /* @__PURE__ */ jsx(
1271
+ CollapsibleJsonSection,
1272
+ {
1273
+ title: /* @__PURE__ */ jsx(Text, { size: "xs", fw: 500, children: "Data" }),
1274
+ data: activity.details.data
1275
+ }
1276
+ );
1277
+ }
1278
+ if (activity.type !== "tool-call") {
1279
+ return null;
1280
+ }
1281
+ return /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
1282
+ "error" in activity.details && activity.details.error && /* @__PURE__ */ jsx(Text, { size: "xs", c: "var(--color-error)", children: activity.details.error }),
1283
+ "input" in activity.details && activity.details.input !== void 0 && /* @__PURE__ */ jsx(
1284
+ CollapsibleJsonSection,
1285
+ {
1286
+ title: /* @__PURE__ */ jsx(Text, { size: "xs", fw: 500, children: "Input" }),
1287
+ data: activity.details.input
1288
+ }
1289
+ ),
1290
+ "output" in activity.details && activity.details.output !== void 0 && /* @__PURE__ */ jsx(
1291
+ CollapsibleJsonSection,
1292
+ {
1293
+ title: /* @__PURE__ */ jsx(Text, { size: "xs", fw: 500, children: "Output" }),
1294
+ data: activity.details.output
1295
+ }
1296
+ )
1297
+ ] });
1298
+ }
1299
+ function ActivityRow({ activity }) {
1300
+ return /* @__PURE__ */ jsx(Paper, { withBorder: true, p: "xs", bg: "none", children: /* @__PURE__ */ jsxs(Stack, { gap: 6, children: [
1301
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "xs", wrap: "nowrap", children: [
1302
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
1303
+ /* @__PURE__ */ jsx(ActivityIcon, { activity }),
1304
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, truncate: true, children: getActivityTitle(activity) })
1305
+ ] }),
1306
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
1307
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatDuration(activity.duration) }),
1308
+ /* @__PURE__ */ jsx(ActivityBadge, { activity })
1309
+ ] })
1310
+ ] }),
1311
+ /* @__PURE__ */ jsx(ActivityDetails, { activity })
1312
+ ] }) });
1313
+ }
1314
+ function AgentIterationDetailPanel({ iteration, totals }) {
1315
+ return /* @__PURE__ */ jsx(Paper, { withBorder: true, bg: "none", p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1316
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
1317
+ /* @__PURE__ */ jsxs("div", { children: [
1318
+ /* @__PURE__ */ jsx(Text, { fw: 600, children: iteration ? `Iteration ${iteration.iterationNumber} activity` : "Iteration activity" }),
1319
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: iteration ? `${iteration.subActivities.length} ordered sub-activities` : "Select an iteration to inspect activity" })
1320
+ ] }),
1321
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1322
+ /* @__PURE__ */ jsxs(Badge, { variant: "light", color: "blue", children: [
1323
+ totals.totalToolCalls,
1324
+ " tools"
1325
+ ] }),
1326
+ /* @__PURE__ */ jsxs(Badge, { variant: "light", color: totals.toolErrorCount > 0 ? "red" : "green", children: [
1327
+ totals.toolErrorCount,
1328
+ " errors"
1329
+ ] }),
1330
+ totals.totalDuration !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "light", color: "gray", children: formatDuration(totals.totalDuration) })
1331
+ ] })
1332
+ ] }),
1333
+ iteration ? iteration.subActivities.length > 0 ? /* @__PURE__ */ jsx(Stack, { gap: "xs", children: iteration.subActivities.map((activity, index) => /* @__PURE__ */ jsx(
1334
+ ActivityRow,
1335
+ {
1336
+ activity
1337
+ },
1338
+ `${activity.type}-${activity.startTime}-${activity.endTime}-${index}`
1339
+ )) }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "No reasoning, actions, or tool calls were captured for this iteration." }) : /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Select an iteration node to view reasoning, actions, and tool calls." })
1340
+ ] }) });
1341
+ }
1342
+ var isZodSchema = (value) => value instanceof z.ZodType;
1343
+ function RunResourceButton({
1344
+ resourceId,
1345
+ resourceType,
1346
+ getInput,
1347
+ baseInput,
1348
+ label,
1349
+ title,
1350
+ disabled,
1351
+ icon,
1352
+ color,
1353
+ onSuccess,
1354
+ onError
1355
+ }) {
1356
+ const [modalState, setModalState] = useState(null);
1357
+ const { execute, isPending } = useExecuteResource({ resourceId, resourceType });
1358
+ const resolvedLabel = label ?? "Run";
1359
+ const resolvedColor = color ?? void 0;
1360
+ const handleExecute = useCallback(
1361
+ async (input) => {
1362
+ try {
1363
+ const result = await execute({ ...baseInput, ...input });
1364
+ setModalState(null);
1365
+ notifications.show({
1366
+ title: "Execution started",
1367
+ message: `Execution ${result.executionId} started`,
1368
+ color: "green"
1369
+ });
1370
+ onSuccess?.(result);
1371
+ } catch (err) {
1372
+ const error = err instanceof Error ? err : new Error(String(err));
1373
+ notifications.show({
1374
+ title: "Execution failed",
1375
+ message: error.message,
1376
+ color: "red"
1377
+ });
1378
+ onError?.(error);
1379
+ }
1380
+ },
1381
+ [execute, baseInput, onSuccess, onError]
1382
+ );
1383
+ const handleClick = useCallback(() => {
1384
+ const result = getInput();
1385
+ const maybeSchema = result.schema;
1386
+ if (isZodSchema(maybeSchema)) {
1387
+ const defaults = result.defaults;
1388
+ setModalState({ schema: maybeSchema, defaults });
1389
+ } else {
1390
+ void handleExecute(result);
1391
+ }
1392
+ }, [getInput, handleExecute]);
1393
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1394
+ /* @__PURE__ */ jsx(Button, { leftSection: icon, color: resolvedColor, loading: isPending, disabled, onClick: handleClick, children: resolvedLabel }),
1395
+ /* @__PURE__ */ jsx(Modal, { opened: modalState !== null, onClose: () => setModalState(null), title: title ?? resolvedLabel, children: modalState !== null && /* @__PURE__ */ jsx(
1396
+ ZodFormRenderer,
1397
+ {
1398
+ schema: modalState.schema,
1399
+ defaults: modalState.defaults,
1400
+ isPending,
1401
+ submitLabel: resolvedLabel,
1402
+ onSubmit: (data) => handleExecute(data)
1403
+ }
1404
+ ) })
1405
+ ] });
1406
+ }
1407
+ function getRateColor(rate) {
1408
+ if (rate >= 95) return "var(--color-success)";
1409
+ if (rate >= 80) return "var(--color-warning)";
1410
+ return "var(--color-error)";
1411
+ }
1412
+ function getMantineRateColor(rate) {
1413
+ if (rate >= 95) return "green";
1414
+ if (rate >= 80) return "yellow";
1415
+ return "red";
1416
+ }
1417
+ function ExecutionStats({
1418
+ totalExecutions,
1419
+ successCount,
1420
+ failureCount,
1421
+ warningCount,
1422
+ successRate,
1423
+ align = "flex-end",
1424
+ compact = false
1425
+ }) {
1426
+ const cyberColors = useCyberColors();
1427
+ if (totalExecutions === 0 && !compact) {
1428
+ return null;
1429
+ }
1430
+ if (compact && totalExecutions === 0) {
1431
+ return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
1432
+ /* @__PURE__ */ jsx(Text, { size: "md", fw: 700, ff: "monospace", c: "dimmed", style: { minWidth: 42 }, children: "\u2014" }),
1433
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: "No recent executions" })
1434
+ ] });
1435
+ }
1436
+ if (compact) {
1437
+ return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
1438
+ /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", children: [
1439
+ /* @__PURE__ */ jsxs(Text, { size: "md", fw: 700, ff: "monospace", style: { color: getRateColor(successRate), minWidth: 42 }, children: [
1440
+ successRate,
1441
+ "%"
1442
+ ] }),
1443
+ /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
1444
+ /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.green }),
1445
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "green", children: successCount })
1446
+ ] }),
1447
+ failureCount > 0 && /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
1448
+ /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.red }),
1449
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "red", children: failureCount })
1450
+ ] })
1451
+ ] }),
1452
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
1453
+ totalExecutions,
1454
+ " ",
1455
+ totalExecutions === 1 ? "run" : "runs"
1456
+ ] })
1457
+ ] });
1458
+ }
1459
+ return /* @__PURE__ */ jsxs(Stack, { gap: 2, align, style: { whiteSpace: "nowrap" }, children: [
1460
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "blue", children: [
1461
+ totalExecutions,
1462
+ " ",
1463
+ totalExecutions === 1 ? "execution" : "executions"
1464
+ ] }),
1465
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "green", children: [
1466
+ successCount,
1467
+ " success"
1468
+ ] }),
1469
+ warningCount != null && warningCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "yellow", children: [
1470
+ warningCount,
1471
+ " warning"
1472
+ ] }),
1473
+ failureCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "red", children: [
1474
+ failureCount,
1475
+ " failed"
1476
+ ] }),
1477
+ /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 600, c: getMantineRateColor(successRate), children: [
1478
+ successRate,
1479
+ "% Success Rate"
1480
+ ] })
1481
+ ] });
1482
+ }
1483
+
1484
+ export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationDetailPanel, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, CollapsibleJsonSection, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, RunResourceButton, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WorkflowExecutionTimeline, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme };