@elevasis/ui 2.68.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 (98) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +577 -367
  3. package/dist/app/index.js +12 -21
  4. package/dist/auth/index.css +149 -149
  5. package/dist/auth/index.d.ts +5 -0
  6. package/dist/auth/index.js +7 -7
  7. package/dist/charts/index.css +208 -208
  8. package/dist/charts/index.js +7 -7
  9. package/dist/{chunk-JC5W55J3.js → chunk-26BTE3Z4.js} +1 -1
  10. package/dist/{chunk-ZFISGKYW.js → chunk-4JHLS234.js} +1 -1
  11. package/dist/{chunk-76IVMVI3.js → chunk-6PZFOHJK.js} +3 -3
  12. package/dist/{chunk-WPIASV3H.js → chunk-7WJEPTE7.js} +2 -2
  13. package/dist/{chunk-UFTM5SZZ.js → chunk-AKANHRQ5.js} +9 -3
  14. package/dist/{chunk-NDHMZT2G.js → chunk-C75XWBYZ.js} +1 -1
  15. package/dist/{chunk-R6NMRXNO.js → chunk-FLECOYUS.js} +1 -1
  16. package/dist/{chunk-2MTP3H3A.js → chunk-IRV6KJPV.js} +1 -1
  17. package/dist/{chunk-OOACTYRA.js → chunk-IT7GTJCB.js} +1 -1
  18. package/dist/{chunk-QYI5BZKM.js → chunk-MFLM7BVC.js} +1 -1
  19. package/dist/{chunk-TGPJNKDU.js → chunk-MRVGQLWN.js} +4 -4
  20. package/dist/{chunk-L3HFJFYF.js → chunk-NM4A63KJ.js} +30 -48
  21. package/dist/{chunk-SIVUCZXQ.js → chunk-NU3NBXHP.js} +1 -1
  22. package/dist/{chunk-HJVPVS57.js → chunk-RW64UJWT.js} +5 -5
  23. package/dist/{chunk-5NRJ2BLQ.js → chunk-VDX6DL7Z.js} +1 -1
  24. package/dist/{chunk-ZGCWTWBD.js → chunk-WXHAHKKI.js} +6167 -5883
  25. package/dist/{chunk-75NOC536.js → chunk-XAZR3T6Y.js} +5 -5
  26. package/dist/{chunk-GBXTRSAU.js → chunk-XQ3ILKYN.js} +1 -1
  27. package/dist/{chunk-TYKAKJGW.js → chunk-YCRINA2D.js} +1 -1
  28. package/dist/{chunk-FK3K2VK2.js → chunk-YGCMMOY4.js} +80 -699
  29. package/dist/{chunk-ZWS3TCQR.js → chunk-YNRYIXUT.js} +22 -109
  30. package/dist/{chunk-ZNKZMK2E.js → chunk-ZD6LM53O.js} +5 -5
  31. package/dist/chunk-ZPTEGGKU.js +631 -0
  32. package/dist/components/index.css +208 -208
  33. package/dist/components/index.d.ts +1614 -256
  34. package/dist/components/index.js +31 -30
  35. package/dist/components/navigation/index.css +149 -149
  36. package/dist/components/navigation/index.js +8 -8
  37. package/dist/features/auth/index.css +149 -149
  38. package/dist/features/auth/index.d.ts +457 -163
  39. package/dist/features/auth/index.js +9 -9
  40. package/dist/features/clients/index.css +208 -208
  41. package/dist/features/clients/index.d.ts +39 -1
  42. package/dist/features/clients/index.js +8 -7
  43. package/dist/features/content/index.css +659 -0
  44. package/dist/features/content/index.d.ts +1788 -0
  45. package/dist/features/content/index.js +2180 -0
  46. package/dist/features/crm/index.d.ts +584 -369
  47. package/dist/features/crm/index.js +9 -9
  48. package/dist/features/dashboard/index.d.ts +0 -6
  49. package/dist/features/dashboard/index.js +11 -10
  50. package/dist/features/delivery/index.d.ts +457 -163
  51. package/dist/features/delivery/index.js +8 -8
  52. package/dist/features/knowledge/index.css +149 -149
  53. package/dist/features/knowledge/index.js +7 -7
  54. package/dist/features/lead-gen/index.d.ts +20 -91
  55. package/dist/features/lead-gen/index.js +9 -9
  56. package/dist/features/monitoring/index.js +10 -10
  57. package/dist/features/monitoring/requests/index.js +9 -14
  58. package/dist/features/operations/index.d.ts +0 -84
  59. package/dist/features/operations/index.js +14 -13
  60. package/dist/features/settings/index.d.ts +457 -163
  61. package/dist/features/settings/index.js +10 -10
  62. package/dist/hooks/access/index.css +149 -149
  63. package/dist/hooks/access/index.d.ts +5 -0
  64. package/dist/hooks/access/index.js +7 -7
  65. package/dist/hooks/delivery/index.d.ts +457 -163
  66. package/dist/hooks/delivery/index.js +2 -2
  67. package/dist/hooks/index.d.ts +2190 -237
  68. package/dist/hooks/index.js +7 -7
  69. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -6
  70. package/dist/hooks/published.d.ts +2190 -237
  71. package/dist/hooks/published.js +7 -7
  72. package/dist/initialization/index.d.ts +464 -164
  73. package/dist/knowledge/index.css +149 -149
  74. package/dist/knowledge/index.d.ts +4 -88
  75. package/dist/knowledge/index.js +3213 -3203
  76. package/dist/{knowledge-search-index-6EZNBNSR.js → knowledge-search-index-LP2WVSQX.js} +689 -695
  77. package/dist/layout/index.css +149 -149
  78. package/dist/layout/index.js +10 -10
  79. package/dist/organization/index.d.ts +7 -1
  80. package/dist/profile/index.d.ts +457 -163
  81. package/dist/provider/index.d.ts +577 -368
  82. package/dist/provider/index.js +7 -7
  83. package/dist/provider/published.css +149 -149
  84. package/dist/provider/published.d.ts +577 -368
  85. package/dist/provider/published.js +7 -7
  86. package/dist/supabase/index.d.ts +906 -339
  87. package/dist/test-utils/index.d.ts +10 -2
  88. package/dist/test-utils/index.js +39 -10
  89. package/dist/theme/index.js +3 -3
  90. package/dist/theme/presets/index.js +1 -1
  91. package/dist/types/index.d.ts +464 -170
  92. package/dist/utils/index.d.ts +0 -6
  93. package/dist/utils/index.js +1 -1
  94. package/dist/vite/index.js +2 -2
  95. package/dist/vite-plugin-knowledge/index.js +1 -1
  96. package/package.json +9 -5
  97. package/src/features/README.md +28 -28
  98. /package/dist/{chunk-RBGVNPA6.js → chunk-XQBURFKM.js} +0 -0
@@ -1,24 +1,16 @@
1
1
  import { ZodFormRenderer } from './chunk-3MEXPLWT.js';
2
- import { ResourceHealthChart } from './chunk-LGKLC5MG.js';
3
2
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-HENXLGVD.js';
4
- import { AppShellCenteredContainer, AppShellLoader } from './chunk-GBXTRSAU.js';
5
- import { useCyberColors, GlowDot, JsonViewer, useExecuteResource, EmptyState, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, PageTitleCaption, HeroStatsRow, useCommandQueue, useScheduledTasks, TabCountBadge, useResourcesHealth } from './chunk-ZGCWTWBD.js';
6
- import { glassBase } from './chunk-R6NMRXNO.js';
7
- import { CardHeader } from './chunk-62GVNH5U.js';
8
- import { useInitialization } from './chunk-P45GQ3ZW.js';
3
+ import { JsonViewer, useExecuteResource, useCyberColors, GlowDot } from './chunk-WXHAHKKI.js';
4
+ import { glassBase } from './chunk-FLECOYUS.js';
9
5
  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-L3HFJFYF.js';
11
- import { getTimeRangeDates } from './chunk-Y6I3IC45.js';
12
- import { ResourceStatusColors } from './chunk-6SSQGWK7.js';
13
6
  import { memo, useMemo, useEffect, useState, useCallback, Fragment } from 'react';
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';
7
+ import { Paper, Stack, Text, Group, Badge, Box, useComputedColorScheme, Card, ActionIcon, Loader, SegmentedControl, Collapse, Button, Modal } from '@mantine/core';
15
8
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
16
9
  import { Position, Handle, getSmoothStepPath, BaseEdge as BaseEdge$1, EdgeLabelRenderer, Panel, useReactFlow, Controls, ReactFlowProvider, ReactFlow } from '@xyflow/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';
10
+ import { IconPlayerPlay, IconPlayerStop, IconArrowsSplit, IconSquare, IconFocus2, IconChevronRight, IconTool, IconWand, IconBrain, IconCheck, IconAlertCircle } from '@tabler/icons-react';
18
11
  import '@xyflow/react/dist/style.css';
19
12
  import { z } from 'zod';
20
13
  import { notifications } from '@mantine/notifications';
21
- import '@mantine/charts/styles.css';
22
14
 
23
15
  var DOMAIN_COLORS = {
24
16
  primary: "var(--color-primary)",
@@ -375,82 +367,6 @@ function ExecutionStatusBadge({
375
367
  }
376
368
  );
377
369
  }
378
- function getRateColor(rate) {
379
- if (rate >= 95) return "var(--color-success)";
380
- if (rate >= 80) return "var(--color-warning)";
381
- return "var(--color-error)";
382
- }
383
- function getMantineRateColor(rate) {
384
- if (rate >= 95) return "green";
385
- if (rate >= 80) return "yellow";
386
- return "red";
387
- }
388
- function ExecutionStats({
389
- totalExecutions,
390
- successCount,
391
- failureCount,
392
- warningCount,
393
- successRate,
394
- align = "flex-end",
395
- compact = false
396
- }) {
397
- const cyberColors = useCyberColors();
398
- if (totalExecutions === 0 && !compact) {
399
- return null;
400
- }
401
- if (compact && totalExecutions === 0) {
402
- return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
403
- /* @__PURE__ */ jsx(Text, { size: "md", fw: 700, ff: "monospace", c: "dimmed", style: { minWidth: 42 }, children: "\u2014" }),
404
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: "No recent executions" })
405
- ] });
406
- }
407
- if (compact) {
408
- return /* @__PURE__ */ jsxs(Group, { gap: 10, wrap: "nowrap", style: { width: "100%" }, children: [
409
- /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", children: [
410
- /* @__PURE__ */ jsxs(Text, { size: "md", fw: 700, ff: "monospace", style: { color: getRateColor(successRate), minWidth: 42 }, children: [
411
- successRate,
412
- "%"
413
- ] }),
414
- /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
415
- /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.green }),
416
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "green", children: successCount })
417
- ] }),
418
- failureCount > 0 && /* @__PURE__ */ jsxs(Group, { gap: 5, wrap: "nowrap", children: [
419
- /* @__PURE__ */ jsx(GlowDot, { size: "sm", color: cyberColors.red }),
420
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, c: "red", children: failureCount })
421
- ] })
422
- ] }),
423
- /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
424
- totalExecutions,
425
- " ",
426
- totalExecutions === 1 ? "run" : "runs"
427
- ] })
428
- ] });
429
- }
430
- return /* @__PURE__ */ jsxs(Stack, { gap: 2, align, style: { whiteSpace: "nowrap" }, children: [
431
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "blue", children: [
432
- totalExecutions,
433
- " ",
434
- totalExecutions === 1 ? "execution" : "executions"
435
- ] }),
436
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "green", children: [
437
- successCount,
438
- " success"
439
- ] }),
440
- warningCount != null && warningCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "yellow", children: [
441
- warningCount,
442
- " warning"
443
- ] }),
444
- failureCount > 0 && /* @__PURE__ */ jsxs(Text, { size: "xs", c: "red", children: [
445
- failureCount,
446
- " failed"
447
- ] }),
448
- /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 600, c: getMantineRateColor(successRate), children: [
449
- successRate,
450
- "% Success Rate"
451
- ] })
452
- ] });
453
- }
454
370
  function TimelineAxis({ totalDuration }) {
455
371
  const markers = [
456
372
  { position: 0, time: 0 },
@@ -1428,7 +1344,10 @@ function RunResourceButton({
1428
1344
  resourceId,
1429
1345
  resourceType,
1430
1346
  getInput,
1347
+ baseInput,
1431
1348
  label,
1349
+ title,
1350
+ disabled,
1432
1351
  icon,
1433
1352
  color,
1434
1353
  onSuccess,
@@ -1441,7 +1360,7 @@ function RunResourceButton({
1441
1360
  const handleExecute = useCallback(
1442
1361
  async (input) => {
1443
1362
  try {
1444
- const result = await execute(input);
1363
+ const result = await execute({ ...baseInput, ...input });
1445
1364
  setModalState(null);
1446
1365
  notifications.show({
1447
1366
  title: "Execution started",
@@ -1459,7 +1378,7 @@ function RunResourceButton({
1459
1378
  onError?.(error);
1460
1379
  }
1461
1380
  },
1462
- [execute, onSuccess, onError]
1381
+ [execute, baseInput, onSuccess, onError]
1463
1382
  );
1464
1383
  const handleClick = useCallback(() => {
1465
1384
  const result = getInput();
@@ -1472,8 +1391,8 @@ function RunResourceButton({
1472
1391
  }
1473
1392
  }, [getInput, handleExecute]);
1474
1393
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1475
- /* @__PURE__ */ jsx(Button, { leftSection: icon, color: resolvedColor, loading: isPending, onClick: handleClick, children: resolvedLabel }),
1476
- /* @__PURE__ */ jsx(Modal, { opened: modalState !== null, onClose: () => setModalState(null), children: modalState !== null && /* @__PURE__ */ jsx(
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(
1477
1396
  ZodFormRenderer,
1478
1397
  {
1479
1398
  schema: modalState.schema,
@@ -1485,619 +1404,81 @@ function RunResourceButton({
1485
1404
  ) })
1486
1405
  ] });
1487
1406
  }
1488
- var DEFAULT_LIMIT = 6;
1489
- var typeIcons = {
1490
- workflow: IconGitBranch,
1491
- agent: IconBrain
1492
- };
1493
- function ResourceCard({ resource, onClick }) {
1494
- const [hovered, setHovered] = useState(false);
1495
- const Icon = typeIcons[resource.type] ?? IconActivity;
1496
- const cyberColors = useCyberColors();
1497
- return /* @__PURE__ */ jsxs(
1498
- Card,
1499
- {
1500
- withBorder: true,
1501
- style: {
1502
- cursor: "pointer",
1503
- transition: "all 150ms ease",
1504
- borderColor: hovered ? "var(--border-primary-strong)" : "var(--color-border)",
1505
- boxShadow: hovered ? "var(--card-shadow), 0 0 12px color-mix(in srgb, var(--color-primary) 25%, transparent)" : "var(--card-shadow)",
1506
- transform: hovered ? "translateY(-1px)" : "none"
1507
- },
1508
- onMouseEnter: () => setHovered(true),
1509
- onMouseLeave: () => setHovered(false),
1510
- onClick,
1511
- children: [
1512
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: "sm", wrap: "nowrap", align: "flex-start", children: [
1513
- /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", style: { minWidth: 0 }, children: [
1514
- /* @__PURE__ */ jsx(ThemeIcon, { size: 32, radius: "md", variant: "light", children: /* @__PURE__ */ jsx(Icon, { size: 18 }) }),
1515
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, truncate: true, children: resource.name })
1516
- ] }),
1517
- resource.active && resource.execution ? (() => {
1518
- const rate = resource.execution.successRate;
1519
- const color = rate >= 95 ? cyberColors.green : rate >= 80 ? cyberColors.yellow : cyberColors.red;
1520
- return /* @__PURE__ */ jsxs(Group, { gap: 8, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1521
- /* @__PURE__ */ jsxs(Text, { size: "xs", fw: 500, style: { color, letterSpacing: "0.03em" }, children: [
1522
- rate.toFixed(0),
1523
- "%"
1524
- ] }),
1525
- /* @__PURE__ */ jsx(GlowDot, { size: "md", color })
1526
- ] });
1527
- })() : null
1528
- ] }),
1529
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1530
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1531
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: resource.type }),
1532
- /* @__PURE__ */ jsx(
1533
- Badge,
1534
- {
1535
- size: "xs",
1536
- variant: "light",
1537
- color: ResourceStatusColors[resource.status],
1538
- children: resource.status
1539
- }
1540
- )
1541
- ] }),
1542
- resource.active && resource.execution ? /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1543
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1544
- resource.execution.totalExecutions,
1545
- " runs"
1546
- ] }),
1547
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "\xB7" }),
1548
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1549
- "Last run ",
1550
- formatTimeAgo(resource.execution.lastExecution)
1551
- ] })
1552
- ] }) : /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No recent activity" })
1553
- ] })
1554
- ]
1555
- }
1556
- );
1557
- }
1558
- function ResourceOverview({
1559
- recentExecutions,
1560
- allResources,
1561
- isLoading,
1562
- limit = DEFAULT_LIMIT,
1563
- onResourceClick
1564
- }) {
1565
- const { displayResources, totalCount } = useMemo(() => {
1566
- const items = [];
1567
- const seenIds = /* @__PURE__ */ new Set();
1568
- const resourceLookup = /* @__PURE__ */ new Map();
1569
- if (allResources) {
1570
- for (const r of [...allResources.workflows, ...allResources.agents]) {
1571
- resourceLookup.set(r.resourceId, r);
1572
- }
1573
- }
1574
- if (recentExecutions) {
1575
- for (const exec of recentExecutions) {
1576
- const def = resourceLookup.get(exec.resourceId);
1577
- items.push({
1578
- resourceId: exec.resourceId,
1579
- name: def?.name ?? exec.resourceName ?? exec.resourceId,
1580
- type: def?.type ?? exec.resourceType ?? "",
1581
- status: def?.status ?? "dev",
1582
- active: true,
1583
- execution: exec
1584
- });
1585
- seenIds.add(exec.resourceId);
1586
- }
1587
- }
1588
- if (allResources) {
1589
- for (const r of [...allResources.workflows, ...allResources.agents]) {
1590
- if (!seenIds.has(r.resourceId)) {
1591
- items.push({
1592
- resourceId: r.resourceId,
1593
- name: r.name,
1594
- type: r.type,
1595
- status: r.status,
1596
- active: false
1597
- });
1598
- seenIds.add(r.resourceId);
1599
- }
1600
- }
1601
- }
1602
- return { displayResources: items.slice(0, limit), totalCount: items.length };
1603
- }, [recentExecutions, allResources, limit]);
1604
- const handleClick = (resource) => {
1605
- onResourceClick?.(resource);
1606
- };
1607
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
1608
- /* @__PURE__ */ jsx(
1609
- CardHeader,
1610
- {
1611
- icon: /* @__PURE__ */ jsx(IconLayoutDashboard, { size: 18 }),
1612
- title: "Resources",
1613
- subtitle: totalCount > limit ? `Showing ${limit} of ${totalCount}` : void 0,
1614
- rightSection: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1615
- totalCount > 0 && /* @__PURE__ */ jsxs(Badge, { variant: "light", size: "sm", children: [
1616
- totalCount,
1617
- " total"
1618
- ] }),
1619
- /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: () => onResourceClick?.(displayResources[0]), children: /* @__PURE__ */ jsx(IconArrowUpRight, { size: 16 }) })
1620
- ] })
1621
- }
1622
- ),
1623
- 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)) })
1624
- ] });
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)";
1625
1411
  }
1626
- var severityColor = {
1627
- critical: "red",
1628
- warning: "yellow",
1629
- info: "blue"
1630
- };
1631
- function OperationsOverview({
1632
- timeRange,
1633
- onResourceClick,
1634
- onErrorsNavigate,
1635
- onCommandQueueNavigate,
1636
- onScheduledTasksNavigate,
1637
- renderTrendChart,
1638
- renderOperationalOverview
1639
- }) {
1640
- const { organizationReady, error: initError } = useInitialization();
1641
- const { data: dashboardDataRaw, isLoading, error } = useDashboardMetrics(timeRange);
1642
- const dashboardData = dashboardDataRaw;
1643
- const { data: resourcesData, isLoading: resourcesLoading } = useResources();
1644
- const { startDate, endDate } = useTimeRangeDates(timeRange);
1645
- const { data: errorData, isLoading: errorsLoading } = useUnresolvedErrors({ startDate, endDate });
1646
- const { data: recentExecData, isLoading: recentExecLoading } = useRecentExecutionsByResource({
1647
- timeRange,
1648
- limit: 6
1649
- });
1650
- if (initError?.layer === "organization") {
1651
- return /* @__PURE__ */ jsx(AppShellCenteredContainer, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", justify: "center", children: [
1652
- /* @__PURE__ */ jsx(Title, { order: 3, c: "dimmed", children: "No organization detected" }),
1653
- /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: initError?.message })
1654
- ] }) });
1655
- }
1656
- if (!organizationReady || isLoading || resourcesLoading) return /* @__PURE__ */ jsx(AppShellLoader, {});
1657
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1658
- /* @__PURE__ */ jsx(PageTitleCaption, { title: "Overview", caption: "AI Operations Health & Performance" }),
1659
- /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1660
- /* @__PURE__ */ jsx(
1661
- HeroStatsRow,
1662
- {
1663
- resourcesData,
1664
- resourcesLoading,
1665
- dashboardData,
1666
- dashboardLoading: isLoading,
1667
- unresolvedErrorCount: errorData?.total ?? null,
1668
- errorsLoading
1669
- }
1670
- ),
1671
- renderTrendChart?.(dashboardData?.executionHealth, isLoading, error ?? void 0)
1672
- ] }),
1673
- /* @__PURE__ */ jsx(
1674
- ResourceOverview,
1675
- {
1676
- recentExecutions: recentExecData?.resources,
1677
- allResources: resourcesData,
1678
- isLoading: resourcesLoading || recentExecLoading,
1679
- limit: 6,
1680
- onResourceClick: onResourceClick ? (resource) => onResourceClick({
1681
- resourceId: resource.resourceId,
1682
- resourceType: resource.type
1683
- }) : void 0
1684
- }
1685
- ),
1686
- renderOperationalOverview ? renderOperationalOverview({
1687
- timeRange,
1688
- onErrorsNavigate,
1689
- onCommandQueueNavigate,
1690
- onScheduledTasksNavigate
1691
- }) : /* @__PURE__ */ jsx(
1692
- DashboardOperationsOverview,
1693
- {
1694
- timeRange,
1695
- onErrorsNavigate,
1696
- onCommandQueueNavigate,
1697
- onScheduledTasksNavigate
1698
- }
1699
- )
1700
- ] });
1412
+ function getMantineRateColor(rate) {
1413
+ if (rate >= 95) return "green";
1414
+ if (rate >= 80) return "yellow";
1415
+ return "red";
1701
1416
  }
1702
- var Dashboard = OperationsOverview;
1703
- function DashboardOperationsOverview({
1704
- timeRange,
1705
- onErrorsNavigate,
1706
- onCommandQueueNavigate,
1707
- onScheduledTasksNavigate
1417
+ function ExecutionStats({
1418
+ totalExecutions,
1419
+ successCount,
1420
+ failureCount,
1421
+ warningCount,
1422
+ successRate,
1423
+ align = "flex-end",
1424
+ compact = false
1708
1425
  }) {
1709
- const { startDate, endDate } = useTimeRangeDates(timeRange);
1710
- const { data: errorData, isLoading: errorsLoading } = useUnresolvedErrors({ startDate, endDate });
1711
- const errors = errorData?.errors ?? [];
1712
- const errorCount = errorData?.total ?? 0;
1713
- const { data: allCommands } = useCommandQueue({ status: "pending", limit: 100 });
1714
- const commands = allCommands?.tasks ?? [];
1715
- const commandCount = commands.length;
1716
- const { data: allTasks, isLoading: tasksLoading } = useScheduledTasks();
1717
- const tasks = allTasks ?? [];
1718
- const now = /* @__PURE__ */ new Date();
1719
- const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
1720
- const { totalScheduled, upcomingTasks } = useMemo(() => {
1721
- const totalScheduled2 = tasks.filter((t) => t.status === "active").length;
1722
- 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);
1723
- return { totalScheduled: totalScheduled2, upcomingTasks: upcomingTasks2 };
1724
- }, [tasks]);
1725
- const defaultTab = useMemo(() => {
1726
- if (errorCount > 0) return "errors";
1727
- if (commandCount > 0) return "commands";
1728
- if (totalScheduled > 0) return "scheduled";
1729
- return "errors";
1730
- }, [errorCount, commandCount, totalScheduled]);
1731
- const [activeTab, setActiveTab] = useState(null);
1732
- const effectiveTab = activeTab ?? defaultTab;
1733
- const formatDaysUntil = (runAt) => {
1734
- const diffMs = runAt.getTime() - now.getTime();
1735
- const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
1736
- const diffHours = Math.floor(diffMs / (1e3 * 60 * 60));
1737
- if (diffHours < 0) return "Overdue";
1738
- if (diffHours < 1) return "Soon";
1739
- if (diffDays === 0) return "Today";
1740
- if (diffDays === 1) return "Tomorrow";
1741
- if (diffDays <= 7) return `In ${diffDays}d`;
1742
- return `In ${Math.floor(diffDays / 7)}w`;
1743
- };
1744
- return /* @__PURE__ */ jsxs(Paper, { withBorder: true, children: [
1745
- /* @__PURE__ */ jsx(CardHeader, { icon: /* @__PURE__ */ jsx(IconActivity, { size: 18 }), title: "Operational Overview" }),
1746
- /* @__PURE__ */ jsxs(Tabs, { value: effectiveTab, onChange: setActiveTab, variant: "default", children: [
1747
- /* @__PURE__ */ jsxs(Tabs.List, { children: [
1748
- /* @__PURE__ */ jsx(
1749
- Tabs.Tab,
1750
- {
1751
- value: "errors",
1752
- leftSection: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16 }),
1753
- rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: errorCount, isLoading: errorsLoading }),
1754
- children: "Unresolved Errors"
1755
- }
1756
- ),
1757
- /* @__PURE__ */ jsx(
1758
- Tabs.Tab,
1759
- {
1760
- value: "commands",
1761
- leftSection: /* @__PURE__ */ jsx(IconHandStop, { size: 16 }),
1762
- rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: commandCount }),
1763
- children: "Command Queue"
1764
- }
1765
- ),
1766
- /* @__PURE__ */ jsx(
1767
- Tabs.Tab,
1768
- {
1769
- value: "scheduled",
1770
- leftSection: /* @__PURE__ */ jsx(IconCalendarEvent, { size: 16 }),
1771
- rightSection: /* @__PURE__ */ jsx(TabCountBadge, { count: totalScheduled, isLoading: tasksLoading }),
1772
- children: "Scheduled Tasks"
1773
- }
1774
- )
1775
- ] }),
1776
- /* @__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: [
1777
- errors.map((error) => /* @__PURE__ */ jsx(
1778
- Box,
1779
- {
1780
- px: "sm",
1781
- py: 6,
1782
- onClick: onErrorsNavigate,
1783
- style: {
1784
- borderRadius: 4,
1785
- cursor: onErrorsNavigate ? "pointer" : "default"
1786
- },
1787
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1788
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 200, width: 200, flexShrink: 0 }, children: [
1789
- /* @__PURE__ */ jsx(
1790
- Box,
1791
- {
1792
- style: {
1793
- width: 8,
1794
- height: 8,
1795
- borderRadius: "50%",
1796
- backgroundColor: `var(--mantine-color-${severityColor[error.severity]}-6)`,
1797
- flexShrink: 0
1798
- }
1799
- }
1800
- ),
1801
- /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { minWidth: 0 }, children: [
1802
- /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: error.resourceName || error.resourceId }),
1803
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, children: error.errorType })
1804
- ] })
1805
- ] }),
1806
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, style: { flex: "1 1 auto", minWidth: 0 }, children: error.message }),
1807
- /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
1808
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: severityColor[error.severity], children: error.severity }),
1809
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatTimeAgo(error.timestamp) })
1810
- ] })
1811
- ] })
1812
- },
1813
- error.id
1814
- )),
1815
- errorCount > 5 && /* @__PURE__ */ jsx(
1816
- Group,
1817
- {
1818
- gap: 4,
1819
- justify: "center",
1820
- pt: 4,
1821
- onClick: onErrorsNavigate,
1822
- style: { cursor: onErrorsNavigate ? "pointer" : "default" },
1823
- children: /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "See all errors" })
1824
- }
1825
- )
1826
- ] }) }),
1827
- /* @__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(
1828
- Box,
1829
- {
1830
- px: "sm",
1831
- py: 6,
1832
- onClick: onCommandQueueNavigate,
1833
- style: {
1834
- borderRadius: 4,
1835
- cursor: onCommandQueueNavigate ? "pointer" : "default"
1836
- },
1837
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1838
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
1839
- /* @__PURE__ */ jsx(
1840
- Box,
1841
- {
1842
- style: {
1843
- width: 8,
1844
- height: 8,
1845
- borderRadius: "50%",
1846
- backgroundColor: `var(--mantine-color-${task.priority >= 8 ? "red" : task.priority >= 4 ? "yellow" : "blue"}-6)`,
1847
- flexShrink: 0
1848
- }
1849
- }
1850
- ),
1851
- /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: task.description || "No description" })
1852
- ] }),
1853
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: task.status })
1854
- ] })
1855
- },
1856
- task.id
1857
- )) }) }),
1858
- /* @__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) => {
1859
- const runAt = new Date(task.nextRunAt);
1860
- const daysUntilNum = Math.floor((runAt.getTime() - today.getTime()) / (1e3 * 60 * 60 * 24));
1861
- return /* @__PURE__ */ jsx(
1862
- Box,
1863
- {
1864
- px: "sm",
1865
- py: 6,
1866
- onClick: onScheduledTasksNavigate,
1867
- style: {
1868
- borderRadius: 4,
1869
- cursor: onScheduledTasksNavigate ? "pointer" : "default"
1870
- },
1871
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
1872
- /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0 }, children: [
1873
- /* @__PURE__ */ jsx(
1874
- Box,
1875
- {
1876
- style: {
1877
- width: 8,
1878
- height: 8,
1879
- borderRadius: "50%",
1880
- backgroundColor: `var(--mantine-color-${daysUntilNum < 0 ? "red" : daysUntilNum <= 1 ? "yellow" : "blue"}-6)`,
1881
- flexShrink: 0
1882
- }
1883
- }
1884
- ),
1885
- /* @__PURE__ */ jsx(Text, { size: "xs", truncate: true, children: task.name || task.target.resourceId })
1886
- ] }),
1887
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: daysUntilNum <= 1 ? void 0 : "gray", children: formatDaysUntil(runAt) })
1888
- ] })
1889
- },
1890
- task.id
1891
- );
1892
- }) }) })
1893
- ] })
1894
- ] });
1895
- }
1896
- var entityTypeConfig = {
1897
- workflow: { icon: IconGitBranch, hasPath: true },
1898
- agent: { icon: IconBrain, hasPath: true }
1899
- };
1900
- function getEntityConfig(entityType) {
1901
- return entityTypeConfig[entityType] || { icon: IconActivity, hasPath: false };
1902
- }
1903
- function RecentExecutionsByResource({ timeRange, limit = 5, onResourceClick }) {
1904
- const { data, isLoading, isFetching, error } = useRecentExecutionsByResource({
1905
- timeRange,
1906
- limit
1907
- });
1908
- const showLoading = (isLoading || isFetching) && !data;
1909
- const { data: resourcesData } = useResources();
1910
- const resourceDefLookup = useMemo(() => {
1911
- if (!resourcesData) return /* @__PURE__ */ new Map();
1912
- const allResources = [...resourcesData.workflows || [], ...resourcesData.agents || []];
1913
- return new Map(allResources.map((r) => [r.resourceId, r]));
1914
- }, [resourcesData]);
1915
- const enrichedExecutions = useMemo(() => {
1916
- if (!data?.resources) return [];
1917
- return data.resources.map((exec) => {
1918
- const resourceDef = resourceDefLookup.get(exec.resourceId);
1919
- return {
1920
- ...exec,
1921
- resourceType: resourceDef?.type || "",
1922
- resourceName: resourceDef?.name || exec.resourceId
1923
- };
1924
- });
1925
- }, [data, resourceDefLookup]);
1926
- const resourceIds = useMemo(
1927
- () => enrichedExecutions.map((r) => ({
1928
- entityType: r.resourceType,
1929
- entityId: r.resourceId
1930
- })),
1931
- [enrichedExecutions]
1932
- );
1933
- const { startDate, endDate } = useMemo(() => getTimeRangeDates(timeRange), [timeRange]);
1934
- const granularity = timeRange === "1h" || timeRange === "24h" ? "hour" : "day";
1935
- const { data: healthData } = useResourcesHealth({
1936
- resources: resourceIds,
1937
- startDate,
1938
- endDate,
1939
- granularity
1940
- });
1941
- const healthLookup = useMemo(() => {
1942
- if (!healthData?.resources) return /* @__PURE__ */ new Map();
1943
- return new Map(healthData.resources.map((r) => [`${r.entityType}-${r.entityId}`, r]));
1944
- }, [healthData]);
1945
- const handleResourceClick = (resource) => {
1946
- const config = getEntityConfig(resource.resourceType);
1947
- if (config.hasPath) {
1948
- onResourceClick?.({ resourceType: resource.resourceType, resourceId: resource.resourceId });
1949
- }
1950
- };
1951
- if (showLoading) {
1952
- return /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) });
1953
- }
1954
- if (error) {
1955
- return /* @__PURE__ */ jsx(Center, { py: "md", children: /* @__PURE__ */ jsxs(Text, { size: "sm", c: "red.6", children: [
1956
- "Failed to load: ",
1957
- error.message
1958
- ] }) });
1426
+ const cyberColors = useCyberColors();
1427
+ if (totalExecutions === 0 && !compact) {
1428
+ return null;
1959
1429
  }
1960
- if (enrichedExecutions.length === 0) {
1961
- return /* @__PURE__ */ jsx(EmptyState, { icon: IconPlayerPlay, title: "No executions in this time range" });
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
+ ] });
1962
1435
  }
1963
- return /* @__PURE__ */ jsx(Stack, { gap: "sm", children: enrichedExecutions.map((resource) => {
1964
- const config = getEntityConfig(resource.resourceType);
1965
- const Icon = config.icon;
1966
- const resourceKey = `${resource.resourceType}-${resource.resourceId}`;
1967
- const resourceHealth = healthLookup.get(resourceKey);
1968
- const resourceDef = resourceDefLookup.get(resource.resourceId);
1969
- return /* @__PURE__ */ jsx(
1970
- Card,
1971
- {
1972
- withBorder: true,
1973
- style: {
1974
- cursor: config.hasPath ? "pointer" : "default",
1975
- transition: "box-shadow var(--duration-fast) var(--easing)"
1976
- },
1977
- onClick: () => handleResourceClick(resource),
1978
- children: /* @__PURE__ */ jsxs(Grid, { gutter: "sm", align: "center", children: [
1979
- /* @__PURE__ */ jsx(Grid.Col, { span: 8, children: /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
1980
- /* @__PURE__ */ jsx(Icon, { size: 24, color: "var(--color-primary)" }),
1981
- /* @__PURE__ */ jsxs(Stack, { gap: 4, style: { flex: 1, minWidth: 0 }, children: [
1982
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 500, truncate: true, children: resource.resourceName }),
1983
- resourceDef?.description && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", truncate: true, children: resourceDef.description }),
1984
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1985
- resourceDef?.version && /* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "xs", children: [
1986
- "v",
1987
- resourceDef.version
1988
- ] }),
1989
- resourceDef?.status && /* @__PURE__ */ jsx(Badge, { color: ResourceStatusColors[resourceDef.status], variant: "outline", size: "xs", children: resourceDef.status.toUpperCase() })
1990
- ] }),
1991
- /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1992
- "Last run ",
1993
- formatRelativeTime(resource.lastExecution)
1994
- ] })
1995
- ] })
1996
- ] }) }),
1997
- /* @__PURE__ */ jsx(Grid.Col, { span: 4, children: /* @__PURE__ */ jsxs(Group, { justify: "flex-end", gap: "md", wrap: "nowrap", children: [
1998
- /* @__PURE__ */ jsx(
1999
- ExecutionStats,
2000
- {
2001
- totalExecutions: resource.totalExecutions,
2002
- successCount: resource.successCount,
2003
- failureCount: resource.failureCount,
2004
- warningCount: resource.warningCount,
2005
- successRate: resource.successRate
2006
- }
2007
- ),
2008
- /* @__PURE__ */ jsx(
2009
- ResourceHealthChart,
2010
- {
2011
- healthData: resourceHealth,
2012
- hasExecutions: resource.totalExecutions > 0,
2013
- width: 300,
2014
- height: 60
2015
- }
2016
- )
2017
- ] }) })
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 })
2018
1450
  ] })
2019
- },
2020
- resource.resourceId
2021
- );
2022
- }) });
2023
- }
2024
- var severityColor2 = {
2025
- critical: "red",
2026
- warning: "yellow",
2027
- info: "blue"
2028
- };
2029
- function UnresolvedErrorsTeaser({ timeRange, onNavigateToAllErrors }) {
2030
- const { startDate, endDate } = useTimeRangeDates(timeRange);
2031
- const { data, isLoading } = useUnresolvedErrors({ startDate, endDate });
2032
- const errors = data?.errors ?? [];
2033
- const total = data?.total ?? 0;
2034
- if (isLoading) {
2035
- return /* @__PURE__ */ jsx(
2036
- Paper,
2037
- {
2038
- style: {
2039
- background: "var(--glass-background)",
2040
- backdropFilter: "var(--glass-blur)",
2041
- border: "1px solid var(--color-border)",
2042
- borderRadius: 8
2043
- },
2044
- children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) })
2045
- }
2046
- );
1451
+ ] }),
1452
+ /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", style: { whiteSpace: "nowrap" }, children: [
1453
+ totalExecutions,
1454
+ " ",
1455
+ totalExecutions === 1 ? "run" : "runs"
1456
+ ] })
1457
+ ] });
2047
1458
  }
2048
- return /* @__PURE__ */ jsxs(
2049
- Paper,
2050
- {
2051
- style: {
2052
- background: "var(--glass-background)",
2053
- backdropFilter: "var(--glass-blur)",
2054
- border: "1px solid var(--color-border)",
2055
- borderRadius: 8
2056
- },
2057
- children: [
2058
- /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: errors.length > 0 ? "sm" : 0, children: [
2059
- /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
2060
- /* @__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 }) }),
2061
- /* @__PURE__ */ jsx(Text, { size: "sm", fw: 600, children: "Unresolved Errors" })
2062
- ] }),
2063
- /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
2064
- total > 0 && /* @__PURE__ */ jsxs(Badge, { size: "xs", variant: "light", color: "red", children: [
2065
- total,
2066
- " unresolved"
2067
- ] }),
2068
- /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", size: "sm", onClick: onNavigateToAllErrors, children: /* @__PURE__ */ jsx(IconArrowUpRight, { size: 14 }) })
2069
- ] })
2070
- ] }),
2071
- errors.length === 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No unresolved errors" }),
2072
- errors.length > 0 && /* @__PURE__ */ jsx(Stack, { gap: 4, children: errors.map((error) => /* @__PURE__ */ jsx(
2073
- Box,
2074
- {
2075
- px: "sm",
2076
- py: 6,
2077
- onClick: onNavigateToAllErrors,
2078
- style: {
2079
- borderLeft: `2px solid var(--mantine-color-${severityColor2[error.severity]}-6)`,
2080
- borderRadius: 4,
2081
- cursor: onNavigateToAllErrors ? "pointer" : "default",
2082
- textDecoration: "none",
2083
- color: "inherit"
2084
- },
2085
- children: /* @__PURE__ */ jsxs(Group, { justify: "space-between", wrap: "nowrap", children: [
2086
- /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { minWidth: 0 }, children: [
2087
- /* @__PURE__ */ jsx(Text, { size: "xs", lineClamp: 1, children: error.resourceName || error.resourceId }),
2088
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", lineClamp: 1, children: error.errorType })
2089
- ] }),
2090
- /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", style: { flexShrink: 0 }, children: [
2091
- /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: severityColor2[error.severity], children: error.severity }),
2092
- /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: formatTimeAgo(error.timestamp) })
2093
- ] })
2094
- ] })
2095
- },
2096
- error.id
2097
- )) })
2098
- ]
2099
- }
2100
- );
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
+ ] });
2101
1482
  }
2102
1483
 
2103
- 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 };
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 };