@elevasis/ui 2.69.0 → 2.71.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 (78) hide show
  1. package/dist/app/index.d.ts +26 -0
  2. package/dist/app/index.js +7 -7
  3. package/dist/auth/index.css +149 -149
  4. package/dist/auth/index.js +3 -3
  5. package/dist/charts/index.css +208 -208
  6. package/dist/charts/index.js +3 -3
  7. package/dist/{chunk-6PZFOHJK.js → chunk-3BLYJT5L.js} +2 -2
  8. package/dist/{chunk-IT7GTJCB.js → chunk-AIOV5NM7.js} +1 -1
  9. package/dist/{chunk-MRVGQLWN.js → chunk-BM2WKRAQ.js} +1 -1
  10. package/dist/{chunk-XAZR3T6Y.js → chunk-CPBT6Z2G.js} +3 -3
  11. package/dist/{chunk-XQ3ILKYN.js → chunk-DCMFNSJ6.js} +1 -1
  12. package/dist/{chunk-NU3NBXHP.js → chunk-DH2MO5DX.js} +1 -1
  13. package/dist/{chunk-ZD6LM53O.js → chunk-H3SDGC5F.js} +2 -2
  14. package/dist/{chunk-YGCMMOY4.js → chunk-JTSNU6KA.js} +695 -73
  15. package/dist/{chunk-7WJEPTE7.js → chunk-LL5H7J4N.js} +1 -1
  16. package/dist/{chunk-FLECOYUS.js → chunk-R6NMRXNO.js} +1 -1
  17. package/dist/{chunk-MFLM7BVC.js → chunk-TB2PM2OU.js} +1 -1
  18. package/dist/{chunk-IRV6KJPV.js → chunk-TCQZ4AJI.js} +1 -1
  19. package/dist/{chunk-YNRYIXUT.js → chunk-TVFSVTRG.js} +6 -6
  20. package/dist/{chunk-WXHAHKKI.js → chunk-UZ7MSORW.js} +16291 -16029
  21. package/dist/{chunk-RW64UJWT.js → chunk-VHPHWTX7.js} +2 -2
  22. package/dist/{chunk-YCRINA2D.js → chunk-VRRIHA3S.js} +1 -1
  23. package/dist/{chunk-4JHLS234.js → chunk-ZFISGKYW.js} +1 -1
  24. package/dist/components/index.css +208 -208
  25. package/dist/components/index.d.ts +59 -3
  26. package/dist/components/index.js +24 -25
  27. package/dist/components/navigation/index.css +149 -149
  28. package/dist/components/navigation/index.js +4 -4
  29. package/dist/features/auth/index.css +149 -149
  30. package/dist/features/auth/index.d.ts +26 -0
  31. package/dist/features/auth/index.js +5 -5
  32. package/dist/features/clients/index.css +208 -208
  33. package/dist/features/clients/index.js +4 -4
  34. package/dist/features/content/index.d.ts +258 -51
  35. package/dist/features/content/index.js +595 -421
  36. package/dist/features/crm/index.d.ts +26 -0
  37. package/dist/features/crm/index.js +5 -5
  38. package/dist/features/dashboard/index.js +6 -7
  39. package/dist/features/delivery/index.css +149 -149
  40. package/dist/features/delivery/index.d.ts +26 -0
  41. package/dist/features/delivery/index.js +4 -4
  42. package/dist/features/knowledge/index.css +149 -149
  43. package/dist/features/knowledge/index.js +3 -3
  44. package/dist/features/lead-gen/index.js +5 -5
  45. package/dist/features/monitoring/index.css +149 -149
  46. package/dist/features/monitoring/index.d.ts +33 -3
  47. package/dist/features/monitoring/index.js +6 -6
  48. package/dist/features/monitoring/requests/index.js +4 -4
  49. package/dist/features/operations/index.js +9 -10
  50. package/dist/features/settings/index.d.ts +26 -0
  51. package/dist/features/settings/index.js +6 -6
  52. package/dist/hooks/access/index.css +149 -149
  53. package/dist/hooks/access/index.js +3 -3
  54. package/dist/hooks/delivery/index.d.ts +26 -0
  55. package/dist/hooks/index.css +149 -149
  56. package/dist/hooks/index.d.ts +296 -65
  57. package/dist/hooks/index.js +3 -3
  58. package/dist/hooks/published.css +149 -149
  59. package/dist/hooks/published.d.ts +296 -65
  60. package/dist/hooks/published.js +3 -3
  61. package/dist/initialization/index.d.ts +26 -0
  62. package/dist/knowledge/index.css +149 -149
  63. package/dist/knowledge/index.js +7 -7
  64. package/dist/layout/index.css +149 -149
  65. package/dist/layout/index.js +6 -6
  66. package/dist/profile/index.d.ts +26 -0
  67. package/dist/provider/index.d.ts +26 -0
  68. package/dist/provider/index.js +3 -3
  69. package/dist/provider/published.css +149 -149
  70. package/dist/provider/published.d.ts +26 -0
  71. package/dist/provider/published.js +3 -3
  72. package/dist/supabase/index.d.ts +50 -0
  73. package/dist/theme/index.js +3 -3
  74. package/dist/theme/presets/index.js +1 -1
  75. package/dist/types/index.d.ts +59 -3
  76. package/package.json +5 -5
  77. package/dist/chunk-ZPTEGGKU.js +0 -631
  78. /package/dist/{chunk-XQBURFKM.js → chunk-RBGVNPA6.js} +0 -0
@@ -1,16 +1,24 @@
1
1
  import { ZodFormRenderer } from './chunk-3MEXPLWT.js';
2
+ import { ResourceHealthChart } from './chunk-LGKLC5MG.js';
2
3
  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';
4
+ import { AppShellCenteredContainer, AppShellLoader } from './chunk-DCMFNSJ6.js';
5
+ import { useCyberColors, GlowDot, JsonViewer, useExecuteResource, EmptyState, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, PageTitleCaption, HeroStatsRow, useCommandQueue, useScheduledTasks, TabCountBadge, useResourcesHealth } from './chunk-UZ7MSORW.js';
6
+ import { glassBase } from './chunk-R6NMRXNO.js';
7
+ import { CardHeader } from './chunk-62GVNH5U.js';
8
+ import { useInitialization } from './chunk-P45GQ3ZW.js';
5
9
  import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-BLXJEIQS.js';
10
+ import { formatTimeAgo, formatRelativeTime } from './chunk-NM4A63KJ.js';
11
+ import { getTimeRangeDates } from './chunk-Y6I3IC45.js';
12
+ import { ResourceStatusColors } from './chunk-6SSQGWK7.js';
6
13
  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';
14
+ import { Paper, Stack, Text, Group, Badge, Box, useComputedColorScheme, Card, ActionIcon, Loader, SegmentedControl, Collapse, Button, Modal, Center, SimpleGrid, Title, Tabs, Grid, ThemeIcon } from '@mantine/core';
8
15
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
16
  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';
17
+ import { IconPlayerPlay, IconPlayerStop, IconArrowsSplit, IconSquare, IconFocus2, IconChevronRight, IconArrowUpRight, IconLayoutDashboard, IconActivity, IconAlertTriangle, IconHandStop, IconCalendarEvent, IconCircleCheck, IconBrain, IconGitBranch, IconTool, IconWand, IconCheck, IconAlertCircle } from '@tabler/icons-react';
11
18
  import '@xyflow/react/dist/style.css';
12
19
  import { z } from 'zod';
13
20
  import { notifications } from '@mantine/notifications';
21
+ import '@mantine/charts/styles.css';
14
22
 
15
23
  var DOMAIN_COLORS = {
16
24
  primary: "var(--color-primary)",
@@ -367,6 +375,82 @@ function ExecutionStatusBadge({
367
375
  }
368
376
  );
369
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
+ }
370
454
  function TimelineAxis({ totalDuration }) {
371
455
  const markers = [
372
456
  { position: 0, time: 0 },
@@ -1404,81 +1488,619 @@ function RunResourceButton({
1404
1488
  ) })
1405
1489
  ] });
1406
1490
  }
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
- }) {
1491
+ var DEFAULT_LIMIT = 6;
1492
+ var typeIcons = {
1493
+ workflow: IconGitBranch,
1494
+ agent: IconBrain
1495
+ };
1496
+ function ResourceCard({ resource, onClick }) {
1497
+ const [hovered, setHovered] = useState(false);
1498
+ const Icon = typeIcons[resource.type] ?? IconActivity;
1426
1499
  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 })
1500
+ return /* @__PURE__ */ jsxs(
1501
+ Card,
1502
+ {
1503
+ withBorder: true,
1504
+ style: {
1505
+ cursor: "pointer",
1506
+ transition: "all 150ms ease",
1507
+ borderColor: hovered ? "var(--border-primary-strong)" : "var(--color-border)",
1508
+ boxShadow: hovered ? "var(--card-shadow), 0 0 12px color-mix(in srgb, var(--color-primary) 25%, transparent)" : "var(--card-shadow)",
1509
+ transform: hovered ? "translateY(-1px)" : "none"
1510
+ },
1511
+ onMouseEnter: () => setHovered(true),
1512
+ onMouseLeave: () => setHovered(false),
1513
+ onClick,
1514
+ children: [
1515
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: "sm", wrap: "nowrap", align: "flex-start", children: [
1516
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", style: { minWidth: 0 }, children: [
1517
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 32, radius: "md", variant: "light", children: /* @__PURE__ */ jsx(Icon, { size: 18 }) }),
1518
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, truncate: true, children: resource.name })
1519
+ ] }),
1520
+ resource.active && resource.execution ? (() => {
1521
+ const rate = resource.execution.successRate;
1522
+ const color = rate >= 95 ? cyberColors.green : rate >= 80 ? cyberColors.yellow : cyberColors.red;
1523
+ return /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1524
+ /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 500, style: { color, letterSpacing: "0.03em" }, children: [
1525
+ rate.toFixed(0),
1526
+ "%"
1527
+ ] }),
1528
+ /* @__PURE__ */ jsx(GlowDot, { size: "md", color })
1529
+ ] });
1530
+ })() : null
1446
1531
  ] }),
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 })
1532
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1533
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1534
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: resource.type }),
1535
+ /* @__PURE__ */ jsx(
1536
+ Badge,
1537
+ {
1538
+ size: "xs",
1539
+ variant: "light",
1540
+ color: ResourceStatusColors[resource.status],
1541
+ children: resource.status
1542
+ }
1543
+ )
1544
+ ] }),
1545
+ resource.active && resource.execution ? /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1546
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1547
+ resource.execution.totalExecutions,
1548
+ " runs"
1549
+ ] }),
1550
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "\xB7" }),
1551
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1552
+ "Last run ",
1553
+ formatTimeAgo(resource.execution.lastExecution)
1554
+ ] })
1555
+ ] }) : /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No recent activity" })
1450
1556
  ] })
1451
- ] }),
1452
- /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
1453
- totalExecutions,
1454
- " ",
1455
- totalExecutions === 1 ? "run" : "runs"
1456
- ] })
1457
- ] });
1557
+ ]
1558
+ }
1559
+ );
1560
+ }
1561
+ function ResourceOverview({
1562
+ recentExecutions,
1563
+ allResources,
1564
+ isLoading,
1565
+ limit = DEFAULT_LIMIT,
1566
+ onResourceClick
1567
+ }) {
1568
+ const { displayResources, totalCount } = useMemo(() => {
1569
+ const items = [];
1570
+ const seenIds = /* @__PURE__ */ new Set();
1571
+ const resourceLookup = /* @__PURE__ */ new Map();
1572
+ if (allResources) {
1573
+ for (const r of [...allResources.workflows, ...allResources.agents]) {
1574
+ resourceLookup.set(r.resourceId, r);
1575
+ }
1576
+ }
1577
+ if (recentExecutions) {
1578
+ for (const exec of recentExecutions) {
1579
+ const def = resourceLookup.get(exec.resourceId);
1580
+ items.push({
1581
+ resourceId: exec.resourceId,
1582
+ name: def?.name ?? exec.resourceName ?? exec.resourceId,
1583
+ type: def?.type ?? exec.resourceType ?? "",
1584
+ status: def?.status ?? "dev",
1585
+ active: true,
1586
+ execution: exec
1587
+ });
1588
+ seenIds.add(exec.resourceId);
1589
+ }
1590
+ }
1591
+ if (allResources) {
1592
+ for (const r of [...allResources.workflows, ...allResources.agents]) {
1593
+ if (!seenIds.has(r.resourceId)) {
1594
+ items.push({
1595
+ resourceId: r.resourceId,
1596
+ name: r.name,
1597
+ type: r.type,
1598
+ status: r.status,
1599
+ active: false
1600
+ });
1601
+ seenIds.add(r.resourceId);
1602
+ }
1603
+ }
1604
+ }
1605
+ return { displayResources: items.slice(0, limit), totalCount: items.length };
1606
+ }, [recentExecutions, allResources, limit]);
1607
+ const handleClick = (resource) => {
1608
+ onResourceClick?.(resource);
1609
+ };
1610
+ return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
1611
+ /* @__PURE__ */ jsx(
1612
+ CardHeader,
1613
+ {
1614
+ icon: /* @__PURE__ */ jsx(IconLayoutDashboard, { size: 18 }),
1615
+ title: "Resources",
1616
+ subtitle: totalCount > limit ? `Showing ${limit} of ${totalCount}` : void 0,
1617
+ rightSection: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1618
+ totalCount > 0 && /* @__PURE__ */ jsxs(Badge, { variant: "light", size: "sm", children: [
1619
+ totalCount,
1620
+ " total"
1621
+ ] }),
1622
+ /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: () => onResourceClick?.(displayResources[0]), children: /* @__PURE__ */ jsx(IconArrowUpRight, { size: 16 }) })
1623
+ ] })
1624
+ }
1625
+ ),
1626
+ isLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : displayResources.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { icon: IconLayoutDashboard, title: "No resources registered" }) : /* @__PURE__ */ jsx(SimpleGrid, { cols: { base: 1, sm: 2, lg: 3 }, children: displayResources.map((resource) => /* @__PURE__ */ jsx(ResourceCard, { resource, onClick: () => handleClick(resource) }, resource.resourceId)) })
1627
+ ] });
1628
+ }
1629
+ var severityColor = {
1630
+ critical: "red",
1631
+ warning: "yellow",
1632
+ info: "blue"
1633
+ };
1634
+ function OperationsOverview({
1635
+ timeRange,
1636
+ onResourceClick,
1637
+ onErrorsNavigate,
1638
+ onCommandQueueNavigate,
1639
+ onScheduledTasksNavigate,
1640
+ renderTrendChart,
1641
+ renderOperationalOverview
1642
+ }) {
1643
+ const { organizationReady, error: initError } = useInitialization();
1644
+ const { data: dashboardDataRaw, isLoading, error } = useDashboardMetrics(timeRange);
1645
+ const dashboardData = dashboardDataRaw;
1646
+ const { data: resourcesData, isLoading: resourcesLoading } = useResources();
1647
+ const { startDate, endDate } = useTimeRangeDates(timeRange);
1648
+ const { data: errorData, isLoading: errorsLoading } = useUnresolvedErrors({ startDate, endDate });
1649
+ const { data: recentExecData, isLoading: recentExecLoading } = useRecentExecutionsByResource({
1650
+ timeRange,
1651
+ limit: 6
1652
+ });
1653
+ if (initError?.layer === "organization") {
1654
+ return /* @__PURE__ */ jsx(AppShellCenteredContainer, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", justify: "center", children: [
1655
+ /* @__PURE__ */ jsx(Title, { order: 3, c: "dimmed", children: "No organization detected" }),
1656
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: initError?.message })
1657
+ ] }) });
1458
1658
  }
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"
1659
+ if (!organizationReady || isLoading || resourcesLoading) return /* @__PURE__ */ jsx(AppShellLoader, {});
1660
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1661
+ /* @__PURE__ */ jsx(PageTitleCaption, { title: "Overview", caption: "AI Operations Health & Performance" }),
1662
+ /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1663
+ /* @__PURE__ */ jsx(
1664
+ HeroStatsRow,
1665
+ {
1666
+ resourcesData,
1667
+ resourcesLoading,
1668
+ dashboardData,
1669
+ dashboardLoading: isLoading,
1670
+ unresolvedErrorCount: errorData?.total ?? null,
1671
+ errorsLoading
1672
+ }
1673
+ ),
1674
+ renderTrendChart?.(dashboardData?.executionHealth, isLoading, error ?? void 0)
1476
1675
  ] }),
1477
- /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 600, c: getMantineRateColor(successRate), children: [
1478
- successRate,
1479
- "% Success Rate"
1676
+ /* @__PURE__ */ jsx(
1677
+ ResourceOverview,
1678
+ {
1679
+ recentExecutions: recentExecData?.resources,
1680
+ allResources: resourcesData,
1681
+ isLoading: resourcesLoading || recentExecLoading,
1682
+ limit: 6,
1683
+ onResourceClick: onResourceClick ? (resource) => onResourceClick({
1684
+ resourceId: resource.resourceId,
1685
+ resourceType: resource.type
1686
+ }) : void 0
1687
+ }
1688
+ ),
1689
+ renderOperationalOverview ? renderOperationalOverview({
1690
+ timeRange,
1691
+ onErrorsNavigate,
1692
+ onCommandQueueNavigate,
1693
+ onScheduledTasksNavigate
1694
+ }) : /* @__PURE__ */ jsx(
1695
+ DashboardOperationsOverview,
1696
+ {
1697
+ timeRange,
1698
+ onErrorsNavigate,
1699
+ onCommandQueueNavigate,
1700
+ onScheduledTasksNavigate
1701
+ }
1702
+ )
1703
+ ] });
1704
+ }
1705
+ var Dashboard = OperationsOverview;
1706
+ function DashboardOperationsOverview({
1707
+ timeRange,
1708
+ onErrorsNavigate,
1709
+ onCommandQueueNavigate,
1710
+ onScheduledTasksNavigate
1711
+ }) {
1712
+ const { startDate, endDate } = useTimeRangeDates(timeRange);
1713
+ const { data: errorData, isLoading: errorsLoading } = useUnresolvedErrors({ startDate, endDate });
1714
+ const errors = errorData?.errors ?? [];
1715
+ const errorCount = errorData?.total ?? 0;
1716
+ const { data: allCommands } = useCommandQueue({ status: "pending", limit: 100 });
1717
+ const commands = allCommands?.tasks ?? [];
1718
+ const commandCount = commands.length;
1719
+ const { data: allTasks, isLoading: tasksLoading } = useScheduledTasks();
1720
+ const tasks = allTasks ?? [];
1721
+ const now = /* @__PURE__ */ new Date();
1722
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
1723
+ const { totalScheduled, upcomingTasks } = useMemo(() => {
1724
+ const totalScheduled2 = tasks.filter((t) => t.status === "active").length;
1725
+ const upcomingTasks2 = tasks.filter((t) => t.status === "active" && t.nextRunAt).sort((a, b) => new Date(a.nextRunAt).getTime() - new Date(b.nextRunAt).getTime()).slice(0, 5);
1726
+ return { totalScheduled: totalScheduled2, upcomingTasks: upcomingTasks2 };
1727
+ }, [tasks]);
1728
+ const defaultTab = useMemo(() => {
1729
+ if (errorCount > 0) return "errors";
1730
+ if (commandCount > 0) return "commands";
1731
+ if (totalScheduled > 0) return "scheduled";
1732
+ return "errors";
1733
+ }, [errorCount, commandCount, totalScheduled]);
1734
+ const [activeTab, setActiveTab] = useState(null);
1735
+ const effectiveTab = activeTab ?? defaultTab;
1736
+ const formatDaysUntil = (runAt) => {
1737
+ const diffMs = runAt.getTime() - now.getTime();
1738
+ const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
1739
+ const diffHours = Math.floor(diffMs / (1e3 * 60 * 60));
1740
+ if (diffHours < 0) return "Overdue";
1741
+ if (diffHours < 1) return "Soon";
1742
+ if (diffDays === 0) return "Today";
1743
+ if (diffDays === 1) return "Tomorrow";
1744
+ if (diffDays <= 7) return `In ${diffDays}d`;
1745
+ return `In ${Math.floor(diffDays / 7)}w`;
1746
+ };
1747
+ return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
1748
+ /* @__PURE__ */ jsx(CardHeader, { icon: /* @__PURE__ */ jsx(IconActivity, { size: 18 }), title: "Operational Overview" }),
1749
+ /* @__PURE__ */ jsxs(Tabs, { value: effectiveTab, onChange: setActiveTab, variant: "default", children: [
1750
+ /* @__PURE__ */ jsxs(Tabs.List, { children: [
1751
+ /* @__PURE__ */ jsx(
1752
+ Tabs.Tab,
1753
+ {
1754
+ value: "errors",
1755
+ leftSection: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16 }),
1756
+ rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: errorCount, isLoading: errorsLoading }),
1757
+ children: "Unresolved Errors"
1758
+ }
1759
+ ),
1760
+ /* @__PURE__ */ jsx(
1761
+ Tabs.Tab,
1762
+ {
1763
+ value: "commands",
1764
+ leftSection: /* @__PURE__ */ jsx(IconHandStop, { size: 16 }),
1765
+ rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: commandCount }),
1766
+ children: "Command Queue"
1767
+ }
1768
+ ),
1769
+ /* @__PURE__ */ jsx(
1770
+ Tabs.Tab,
1771
+ {
1772
+ value: "scheduled",
1773
+ leftSection: /* @__PURE__ */ jsx(IconCalendarEvent, { size: 16 }),
1774
+ rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: totalScheduled, isLoading: tasksLoading }),
1775
+ children: "Scheduled Tasks"
1776
+ }
1777
+ )
1778
+ ] }),
1779
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "errors", pt: "sm", children: errorsLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : errors.length === 0 ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No unresolved errors" }) : /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
1780
+ errors.map((error) => /* @__PURE__ */ jsx(
1781
+ Box,
1782
+ {
1783
+ px: "sm",
1784
+ py: 6,
1785
+ onClick: onErrorsNavigate,
1786
+ style: {
1787
+ borderRadius: 4,
1788
+ cursor: onErrorsNavigate ? "pointer" : "default"
1789
+ },
1790
+ children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1791
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 200, width: 200, flexShrink: 0 }, children: [
1792
+ /* @__PURE__ */ jsx(
1793
+ Box,
1794
+ {
1795
+ style: {
1796
+ width: 8,
1797
+ height: 8,
1798
+ borderRadius: "50%",
1799
+ backgroundColor: `var(--mantine-color-${severityColor[error.severity]}-6)`,
1800
+ flexShrink: 0
1801
+ }
1802
+ }
1803
+ ),
1804
+ /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { minWidth: 0 }, children: [
1805
+ /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: error.resourceName || error.resourceId }),
1806
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, children: error.errorType })
1807
+ ] })
1808
+ ] }),
1809
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, style: { flex: "1 1 auto", minWidth: 0 }, children: error.message }),
1810
+ /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1811
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: severityColor[error.severity], children: error.severity }),
1812
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatTimeAgo(error.timestamp) })
1813
+ ] })
1814
+ ] })
1815
+ },
1816
+ error.id
1817
+ )),
1818
+ errorCount > 5 && /* @__PURE__ */ jsx(
1819
+ Group,
1820
+ {
1821
+ gap: 4,
1822
+ justify: "center",
1823
+ pt: 4,
1824
+ onClick: onErrorsNavigate,
1825
+ style: { cursor: onErrorsNavigate ? "pointer" : "default" },
1826
+ children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "See all errors" })
1827
+ }
1828
+ )
1829
+ ] }) }),
1830
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "commands", pt: "sm", children: commands.length === 0 ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No pending decisions" }) : /* @__PURE__ */ jsx(Stack, { gap: 4, children: commands.slice(0, 5).map((task) => /* @__PURE__ */ jsx(
1831
+ Box,
1832
+ {
1833
+ px: "sm",
1834
+ py: 6,
1835
+ onClick: onCommandQueueNavigate,
1836
+ style: {
1837
+ borderRadius: 4,
1838
+ cursor: onCommandQueueNavigate ? "pointer" : "default"
1839
+ },
1840
+ children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1841
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
1842
+ /* @__PURE__ */ jsx(
1843
+ Box,
1844
+ {
1845
+ style: {
1846
+ width: 8,
1847
+ height: 8,
1848
+ borderRadius: "50%",
1849
+ backgroundColor: `var(--mantine-color-${task.priority >= 8 ? "red" : task.priority >= 4 ? "yellow" : "blue"}-6)`,
1850
+ flexShrink: 0
1851
+ }
1852
+ }
1853
+ ),
1854
+ /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: task.description || "No description" })
1855
+ ] }),
1856
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: task.status })
1857
+ ] })
1858
+ },
1859
+ task.id
1860
+ )) }) }),
1861
+ /* @__PURE__ */ jsx(Tabs.Panel, { value: "scheduled", pt: "sm", children: tasksLoading ? /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) : upcomingTasks.length === 0 ? /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No scheduled tasks" }) : /* @__PURE__ */ jsx(Stack, { gap: 4, children: upcomingTasks.map((task) => {
1862
+ const runAt = new Date(task.nextRunAt);
1863
+ const daysUntilNum = Math.floor((runAt.getTime() - today.getTime()) / (1e3 * 60 * 60 * 24));
1864
+ return /* @__PURE__ */ jsx(
1865
+ Box,
1866
+ {
1867
+ px: "sm",
1868
+ py: 6,
1869
+ onClick: onScheduledTasksNavigate,
1870
+ style: {
1871
+ borderRadius: 4,
1872
+ cursor: onScheduledTasksNavigate ? "pointer" : "default"
1873
+ },
1874
+ children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1875
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
1876
+ /* @__PURE__ */ jsx(
1877
+ Box,
1878
+ {
1879
+ style: {
1880
+ width: 8,
1881
+ height: 8,
1882
+ borderRadius: "50%",
1883
+ backgroundColor: `var(--mantine-color-${daysUntilNum < 0 ? "red" : daysUntilNum <= 1 ? "yellow" : "blue"}-6)`,
1884
+ flexShrink: 0
1885
+ }
1886
+ }
1887
+ ),
1888
+ /* @__PURE__ */ jsx(Text, { size: "xs", truncate: true, children: task.name || task.target.resourceId })
1889
+ ] }),
1890
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: daysUntilNum <= 1 ? void 0 : "gray", children: formatDaysUntil(runAt) })
1891
+ ] })
1892
+ },
1893
+ task.id
1894
+ );
1895
+ }) }) })
1480
1896
  ] })
1481
1897
  ] });
1482
1898
  }
1899
+ var entityTypeConfig = {
1900
+ workflow: { icon: IconGitBranch, hasPath: true },
1901
+ agent: { icon: IconBrain, hasPath: true }
1902
+ };
1903
+ function getEntityConfig(entityType) {
1904
+ return entityTypeConfig[entityType] || { icon: IconActivity, hasPath: false };
1905
+ }
1906
+ function RecentExecutionsByResource({ timeRange, limit = 5, onResourceClick }) {
1907
+ const { data, isLoading, isFetching, error } = useRecentExecutionsByResource({
1908
+ timeRange,
1909
+ limit
1910
+ });
1911
+ const showLoading = (isLoading || isFetching) && !data;
1912
+ const { data: resourcesData } = useResources();
1913
+ const resourceDefLookup = useMemo(() => {
1914
+ if (!resourcesData) return /* @__PURE__ */ new Map();
1915
+ const allResources = [...resourcesData.workflows || [], ...resourcesData.agents || []];
1916
+ return new Map(allResources.map((r) => [r.resourceId, r]));
1917
+ }, [resourcesData]);
1918
+ const enrichedExecutions = useMemo(() => {
1919
+ if (!data?.resources) return [];
1920
+ return data.resources.map((exec) => {
1921
+ const resourceDef = resourceDefLookup.get(exec.resourceId);
1922
+ return {
1923
+ ...exec,
1924
+ resourceType: resourceDef?.type || "",
1925
+ resourceName: resourceDef?.name || exec.resourceId
1926
+ };
1927
+ });
1928
+ }, [data, resourceDefLookup]);
1929
+ const resourceIds = useMemo(
1930
+ () => enrichedExecutions.map((r) => ({
1931
+ entityType: r.resourceType,
1932
+ entityId: r.resourceId
1933
+ })),
1934
+ [enrichedExecutions]
1935
+ );
1936
+ const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
1937
+ const granularity = timeRange === "1h" || timeRange === "24h" ? "hour" : "day";
1938
+ const { data: healthData } = useResourcesHealth({
1939
+ resources: resourceIds,
1940
+ startDate,
1941
+ endDate,
1942
+ granularity
1943
+ });
1944
+ const healthLookup = useMemo(() => {
1945
+ if (!healthData?.resources) return /* @__PURE__ */ new Map();
1946
+ return new Map(healthData.resources.map((r) => [`${r.entityType}-${r.entityId}`, r]));
1947
+ }, [healthData]);
1948
+ const handleResourceClick = (resource) => {
1949
+ const config = getEntityConfig(resource.resourceType);
1950
+ if (config.hasPath) {
1951
+ onResourceClick?.({ resourceType: resource.resourceType, resourceId: resource.resourceId });
1952
+ }
1953
+ };
1954
+ if (showLoading) {
1955
+ return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) });
1956
+ }
1957
+ if (error) {
1958
+ return /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsxs(Text, { size: "sm", c: "red.6", children: [
1959
+ "Failed to load: ",
1960
+ error.message
1961
+ ] }) });
1962
+ }
1963
+ if (enrichedExecutions.length === 0) {
1964
+ return /* @__PURE__ */ jsx(EmptyState, { icon: IconPlayerPlay, title: "No executions in this time range" });
1965
+ }
1966
+ return /* @__PURE__ */ jsx(Stack, { gap: "sm", children: enrichedExecutions.map((resource) => {
1967
+ const config = getEntityConfig(resource.resourceType);
1968
+ const Icon = config.icon;
1969
+ const resourceKey = `${resource.resourceType}-${resource.resourceId}`;
1970
+ const resourceHealth = healthLookup.get(resourceKey);
1971
+ const resourceDef = resourceDefLookup.get(resource.resourceId);
1972
+ return /* @__PURE__ */ jsx(
1973
+ Card,
1974
+ {
1975
+ withBorder: true,
1976
+ style: {
1977
+ cursor: config.hasPath ? "pointer" : "default",
1978
+ transition: "box-shadow var(--duration-fast) var(--easing)"
1979
+ },
1980
+ onClick: () => handleResourceClick(resource),
1981
+ children: /* @__PURE__ */ jsxs(Grid, { gutter: "sm", align: "center", children: [
1982
+ /* @__PURE__ */ jsx(Grid.Col, { span: 8, children: /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
1983
+ /* @__PURE__ */ jsx(Icon, { size: 24, color: "var(--color-primary)" }),
1984
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, style: { flex: 1, minWidth: 0 }, children: [
1985
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, truncate: true, children: resource.resourceName }),
1986
+ resourceDef?.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", truncate: true, children: resourceDef.description }),
1987
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1988
+ resourceDef?.version && /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "xs", children: [
1989
+ "v",
1990
+ resourceDef.version
1991
+ ] }),
1992
+ resourceDef?.status && /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resourceDef.status], variant: "outline", size: "xs", children: resourceDef.status.toUpperCase() })
1993
+ ] }),
1994
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1995
+ "Last run ",
1996
+ formatRelativeTime(resource.lastExecution)
1997
+ ] })
1998
+ ] })
1999
+ ] }) }),
2000
+ /* @__PURE__ */ jsx(Grid.Col, { span: 4, children: /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "md", wrap: "nowrap", children: [
2001
+ /* @__PURE__ */ jsx(
2002
+ ExecutionStats,
2003
+ {
2004
+ totalExecutions: resource.totalExecutions,
2005
+ successCount: resource.successCount,
2006
+ failureCount: resource.failureCount,
2007
+ warningCount: resource.warningCount,
2008
+ successRate: resource.successRate
2009
+ }
2010
+ ),
2011
+ /* @__PURE__ */ jsx(
2012
+ ResourceHealthChart,
2013
+ {
2014
+ healthData: resourceHealth,
2015
+ hasExecutions: resource.totalExecutions > 0,
2016
+ width: 300,
2017
+ height: 60
2018
+ }
2019
+ )
2020
+ ] }) })
2021
+ ] })
2022
+ },
2023
+ resource.resourceId
2024
+ );
2025
+ }) });
2026
+ }
2027
+ var severityColor2 = {
2028
+ critical: "red",
2029
+ warning: "yellow",
2030
+ info: "blue"
2031
+ };
2032
+ function UnresolvedErrorsTeaser({ timeRange, onNavigateToAllErrors }) {
2033
+ const { startDate, endDate } = useTimeRangeDates(timeRange);
2034
+ const { data, isLoading } = useUnresolvedErrors({ startDate, endDate });
2035
+ const errors = data?.errors ?? [];
2036
+ const total = data?.total ?? 0;
2037
+ if (isLoading) {
2038
+ return /* @__PURE__ */ jsx(
2039
+ Paper,
2040
+ {
2041
+ style: {
2042
+ background: "var(--glass-background)",
2043
+ backdropFilter: "var(--glass-blur)",
2044
+ border: "1px solid var(--color-border)",
2045
+ borderRadius: 8
2046
+ },
2047
+ children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) })
2048
+ }
2049
+ );
2050
+ }
2051
+ return /* @__PURE__ */ jsxs(
2052
+ Paper,
2053
+ {
2054
+ style: {
2055
+ background: "var(--glass-background)",
2056
+ backdropFilter: "var(--glass-blur)",
2057
+ border: "1px solid var(--color-border)",
2058
+ borderRadius: 8
2059
+ },
2060
+ children: [
2061
+ /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: errors.length > 0 ? "sm" : 0, children: [
2062
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
2063
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 28, radius: "md", variant: "light", color: total > 0 ? "red" : "green", children: total > 0 ? /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16 }) : /* @__PURE__ */ jsx(IconCircleCheck, { size: 16 }) }),
2064
+ /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: "Unresolved Errors" })
2065
+ ] }),
2066
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2067
+ total > 0 && /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: "red", children: [
2068
+ total,
2069
+ " unresolved"
2070
+ ] }),
2071
+ /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: onNavigateToAllErrors, children: /* @__PURE__ */ jsx(IconArrowUpRight, { size: 14 }) })
2072
+ ] })
2073
+ ] }),
2074
+ errors.length === 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No unresolved errors" }),
2075
+ errors.length > 0 && /* @__PURE__ */ jsx(Stack, { gap: 4, children: errors.map((error) => /* @__PURE__ */ jsx(
2076
+ Box,
2077
+ {
2078
+ px: "sm",
2079
+ py: 6,
2080
+ onClick: onNavigateToAllErrors,
2081
+ style: {
2082
+ borderLeft: `2px solid var(--mantine-color-${severityColor2[error.severity]}-6)`,
2083
+ borderRadius: 4,
2084
+ cursor: onNavigateToAllErrors ? "pointer" : "default",
2085
+ textDecoration: "none",
2086
+ color: "inherit"
2087
+ },
2088
+ children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
2089
+ /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { minWidth: 0 }, children: [
2090
+ /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: error.resourceName || error.resourceId }),
2091
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, children: error.errorType })
2092
+ ] }),
2093
+ /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
2094
+ /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: severityColor2[error.severity], children: error.severity }),
2095
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatTimeAgo(error.timestamp) })
2096
+ ] })
2097
+ ] })
2098
+ },
2099
+ error.id
2100
+ )) })
2101
+ ]
2102
+ }
2103
+ );
2104
+ }
1483
2105
 
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 };
2106
+ export { AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationDetailPanel, AgentIterationEdge, AgentIterationNode, BaseEdge, BaseNode, CollapsibleJsonSection, Dashboard, DashboardOperationsOverview, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, OperationsOverview, RecentExecutionsByResource, ResourceOverview, RunResourceButton, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, UnresolvedErrorsTeaser, VisualizerContainer, WorkflowExecutionTimeline, getGraphBackgroundStyles, useGraphBackgroundStyles, useGraphTheme };