@mastra/playground-ui 19.0.0-alpha.2 → 19.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/index.cjs.js +1259 -19
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +1237 -22
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/domains/agents/components/agent-metadata/agent-metadata.d.ts +1 -0
  7. package/dist/src/domains/metrics/components/date-range-selector.d.ts +1 -0
  8. package/dist/src/domains/metrics/components/index.d.ts +28 -0
  9. package/dist/src/domains/metrics/components/latency-card.d.ts +1 -0
  10. package/dist/src/domains/metrics/components/metrics-dashboard.d.ts +1 -0
  11. package/dist/src/domains/metrics/components/metrics-kpi-cards.d.ts +4 -0
  12. package/dist/src/domains/metrics/components/metrics-utils.d.ts +14 -0
  13. package/dist/src/domains/metrics/components/model-usage-cost-card.d.ts +1 -0
  14. package/dist/src/domains/metrics/components/scores-card.d.ts +1 -0
  15. package/dist/src/domains/metrics/components/token-usage-by-agent-card.d.ts +1 -0
  16. package/dist/src/domains/metrics/components/traces-volume-card.d.ts +1 -0
  17. package/dist/src/domains/metrics/hooks/use-agent-runs-kpi-metrics.d.ts +10 -0
  18. package/dist/src/domains/metrics/hooks/use-avg-score-kpi-metrics.d.ts +10 -0
  19. package/dist/src/domains/metrics/hooks/use-latency-metrics.d.ts +11 -0
  20. package/dist/src/domains/metrics/hooks/use-metrics-filters.d.ts +9 -0
  21. package/dist/src/domains/metrics/hooks/use-metrics.d.ts +56 -0
  22. package/dist/src/domains/metrics/hooks/use-model-usage-cost-metrics.d.ts +8 -0
  23. package/dist/src/domains/metrics/hooks/use-scores-metrics.d.ts +22 -0
  24. package/dist/src/domains/metrics/hooks/use-token-usage-by-agent-metrics.d.ts +7 -0
  25. package/dist/src/domains/metrics/hooks/use-total-tokens-kpi-metrics.d.ts +6 -0
  26. package/dist/src/domains/metrics/hooks/use-trace-volume-metrics.d.ts +10 -0
  27. package/dist/src/domains/metrics/index.d.ts +1 -0
  28. package/dist/src/domains/workspace/hooks/use-workspace-skills.d.ts +5 -1
  29. package/dist/src/domains/workspace/types.d.ts +1 -1
  30. package/dist/src/ds/components/DashboardCard/dashboard-card.d.ts +6 -0
  31. package/dist/src/ds/components/DashboardCard/dashboard-card.stories.d.ts +8 -0
  32. package/dist/src/ds/components/DashboardCard/index.d.ts +1 -0
  33. package/dist/src/ds/components/EntityList/entity-list-no-match.d.ts +5 -0
  34. package/dist/src/ds/components/EntityList/entity-list.d.ts +2 -0
  35. package/dist/src/ds/components/HorizontalBars/horizontal-bars.d.ts +15 -0
  36. package/dist/src/ds/components/HorizontalBars/horizontal-bars.stories.d.ts +7 -0
  37. package/dist/src/ds/components/HorizontalBars/index.d.ts +1 -0
  38. package/dist/src/ds/components/MetricsCard/index.d.ts +2 -0
  39. package/dist/src/ds/components/MetricsCard/metrics-card-content.d.ts +5 -0
  40. package/dist/src/ds/components/MetricsCard/metrics-card-description.d.ts +4 -0
  41. package/dist/src/ds/components/MetricsCard/metrics-card-error.d.ts +4 -0
  42. package/dist/src/ds/components/MetricsCard/metrics-card-loading.d.ts +3 -0
  43. package/dist/src/ds/components/MetricsCard/metrics-card-no-data.d.ts +4 -0
  44. package/dist/src/ds/components/MetricsCard/metrics-card-root.d.ts +5 -0
  45. package/dist/src/ds/components/MetricsCard/metrics-card-summary.d.ts +5 -0
  46. package/dist/src/ds/components/MetricsCard/metrics-card-title-and-description.d.ts +15 -0
  47. package/dist/src/ds/components/MetricsCard/metrics-card-title.d.ts +4 -0
  48. package/dist/src/ds/components/MetricsCard/metrics-card-top-bar.d.ts +5 -0
  49. package/dist/src/ds/components/MetricsCard/metrics-card.d.ts +31 -0
  50. package/dist/src/ds/components/MetricsCard/metrics-card.stories.d.ts +11 -0
  51. package/dist/src/ds/components/MetricsDataTable/index.d.ts +1 -0
  52. package/dist/src/ds/components/MetricsDataTable/metrics-data-table.d.ts +13 -0
  53. package/dist/src/ds/components/MetricsDataTable/metrics-data-table.stories.d.ts +16 -0
  54. package/dist/src/ds/components/MetricsFlexGrid/index.d.ts +1 -0
  55. package/dist/src/ds/components/MetricsFlexGrid/metrics-flex-grid.d.ts +5 -0
  56. package/dist/src/ds/components/MetricsFlexGrid/metrics-flex-grid.stories.d.ts +7 -0
  57. package/dist/src/ds/components/MetricsKpiCard/index.d.ts +1 -0
  58. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-change.d.ts +6 -0
  59. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-error.d.ts +4 -0
  60. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-label.d.ts +4 -0
  61. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-loading.d.ts +3 -0
  62. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-no-change.d.ts +4 -0
  63. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-no-data.d.ts +4 -0
  64. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-root.d.ts +5 -0
  65. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card-value.d.ts +4 -0
  66. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card.d.ts +17 -0
  67. package/dist/src/ds/components/MetricsKpiCard/metrics-kpi-card.stories.d.ts +10 -0
  68. package/dist/src/ds/components/MetricsLineChart/index.d.ts +2 -0
  69. package/dist/src/ds/components/MetricsLineChart/metrics-line-chart-tooltip.d.ts +10 -0
  70. package/dist/src/ds/components/MetricsLineChart/metrics-line-chart.d.ts +15 -0
  71. package/dist/src/ds/components/Tabs/tabs-list.d.ts +2 -1
  72. package/dist/src/index.d.ts +1 -0
  73. package/dist/src/lib/framework.d.ts +3 -3
  74. package/package.json +11 -10
package/dist/index.es.js CHANGED
@@ -8,7 +8,7 @@ import { useMastraClient, resolveToChildMessages, useCreateWorkflowRun, useStrea
8
8
  import { useQuery, useQueryClient, useMutation, useInfiniteQuery, useQueries, QueryClient, QueryClientProvider } from '@tanstack/react-query';
9
9
  import './index.css';export * from '@tanstack/react-query';
10
10
  import { useComposer, useComposerRuntime, useAttachment, ComposerPrimitive, AttachmentPrimitive, useAuiState, useAssistantState, useMessage, MessagePrimitive, ActionBarPrimitive, ThreadPrimitive, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechSynthesisAdapter, useExternalStoreRuntime, AssistantRuntimeProvider } from '@assistant-ui/react';
11
- import { X, Wand2, Link, CloudUpload, FileText, CircleXIcon, ChevronUpIcon, CircleCheck, CircleX, CircleAlert, Info, CheckIcon as CheckIcon$1, CopyIcon, Share2, Check, FolderTree, HardDrive, Loader2, Brain, ChevronDown, ChevronRight, Unplug, XCircle, CloudCog, TerminalSquare, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, RefreshCw, Repeat, Repeat1, Network, Footprints, Circle, TrashIcon, Brackets, PlusIcon, TriangleAlertIcon, CalendarIcon, CircleAlertIcon, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, Braces, ChevronDownIcon, Plus, EyeOffIcon, EyeIcon, ShieldAlert, PauseIcon, HourglassIcon, CircleDashed, Minus, Maximize, AlertCircleIcon, StopCircle, CirclePause, Tag, ShieldX, SearchIcon, ExternalLinkIcon, CircleSlashIcon, Cpu, ChevronsUpDown, Search, ArrowRight, ArrowLeft, CheckCircleIcon, BrainIcon, AudioLinesIcon, StopCircleIcon, DatabaseIcon, Save, Mic, ArrowUp, SaveIcon, BookOpen, ExternalLink, RotateCcw, GripVertical, ArrowLeftIcon, ArrowRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, ChevronsRightIcon, CalculatorIcon, ChevronRightIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, XIcon, Type, ToggleLeft, Hash, Ban, ListX, ChevronsLeft, ChevronsRight, ChevronLeft, Text, TextSearch, EqualNot, Equal, Component, Trash2, Ruler, Trash, MoveRight, Copy, Folder, Link2, RefreshCcwIcon, AlignLeft, Trash2Icon, FileTextIcon, BookmarkPlus, PenLine, LaptopMinimal, Plug, File as File$1, FolderOpen, Image, FileJson, FileCode, FolderPlus, Drill, Pencil, Eye, Wrench, MessageSquare, AlertTriangleIcon, BracesIcon, ArrowRightToLineIcon, CoinsIcon, CircleGaugeIcon, PanelTopIcon, ChevronsUpIcon, ChevronsDownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ListTreeIcon, PanelLeftIcon, Award, ClipboardCheck, CheckCircle, FormInput, Sparkles, Play, CheckCircle2, FlaskConical, Database, ThumbsUp, ThumbsDown, FileInput, FileOutput, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, Upload, ClockIcon, BanIcon, MoveRightIcon, GitCompare, ChevronLeftIcon, TagIcon, FileCodeIcon, Calendar1Icon, HistoryIcon, History, EllipsisVerticalIcon, AmpersandIcon, GitCompareIcon, Download, FolderOutput, AlertTriangle, MoreVertical, PanelRightIcon, PlayIcon, OctagonAlertIcon, CrosshairIcon, TargetIcon, LayersIcon, EqualIcon, PenIcon, KeyboardIcon, CircleSlash, Cloud, Zap, FileCode2, Code, Server, Home, Package, Github } from 'lucide-react';
11
+ import { X, Wand2, Link, CloudUpload, FileText, CircleXIcon, ChevronUpIcon, CircleCheck, CircleX, CircleAlert, Info, CheckIcon as CheckIcon$1, CopyIcon, Share2, Check, FolderTree, HardDrive, Loader2, Brain, ChevronDown, ChevronRight, Unplug, XCircle, CloudCog, TerminalSquare, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, RefreshCw, Repeat, Repeat1, Network, Footprints, Circle, TrashIcon, Brackets, PlusIcon, TriangleAlertIcon, CalendarIcon, CircleAlertIcon, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, Braces, ChevronDownIcon, Plus, EyeOffIcon, EyeIcon, ShieldAlert, PauseIcon, HourglassIcon, CircleDashed, Minus, Maximize, AlertCircleIcon, StopCircle, CirclePause, Tag, ShieldX, SearchIcon, ExternalLinkIcon, CircleSlashIcon, Cpu, ChevronsUpDown, Search, ArrowRight, ArrowLeft, CheckCircleIcon, BrainIcon, AudioLinesIcon, StopCircleIcon, DatabaseIcon, Save, Mic, ArrowUp, SaveIcon, BookOpen, ExternalLink, RotateCcw, GripVertical, ArrowLeftIcon, ArrowRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, ChevronsRightIcon, CalculatorIcon, ChevronRightIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, XIcon, Type, ToggleLeft, Hash, Ban, ListX, ChevronsLeft, ChevronsRight, ChevronLeft, Text, TextSearch, EqualNot, Equal, Component, Trash2, Ruler, Trash, MoveRight, Copy, Folder, Link2, RefreshCcwIcon, AlignLeft, Trash2Icon, FileTextIcon, BookmarkPlus, PenLine, LaptopMinimal, Plug, File as File$1, FolderOpen, Image, FileJson, FileCode, FolderPlus, Drill, Pencil, Eye, Wrench, MessageSquare, AlertTriangleIcon, BracesIcon, ArrowRightToLineIcon, CoinsIcon, CircleGaugeIcon, PanelTopIcon, ChevronsUpIcon, ChevronsDownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ListTreeIcon, PanelLeftIcon, Award, ClipboardCheck, CheckCircle, FormInput, Sparkles, Play, CheckCircle2, FlaskConical, Database, ThumbsUp, ThumbsDown, FileInput, FileOutput, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, TrendingUpIcon, TrendingDownIcon, Upload, ClockIcon, BanIcon, MoveRightIcon, GitCompare, ChevronLeftIcon, TagIcon, FileCodeIcon, Calendar1Icon, HistoryIcon, History, EllipsisVerticalIcon, AmpersandIcon, GitCompareIcon, Download, FolderOutput, AlertTriangle, MoreVertical, PanelRightIcon, PlayIcon, OctagonAlertIcon, CrosshairIcon, TargetIcon, LayersIcon, EqualIcon, PenIcon, KeyboardIcon, CircleSlash, Cloud, Zap, FileCode2, Code, Server, Home, Package, Github } from 'lucide-react';
12
12
  import { S as Shadows, G as Glows, B as BorderColors, C as Colors, a as Sizes, F as FontSizes, L as LineHeights, b as BorderRadius, c as Spacings } from './spacings-ZtORQo9-.js';
13
13
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
14
14
  import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
@@ -39,7 +39,7 @@ import { z } from 'zod';
39
39
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
40
40
  import * as SelectPrimitive from '@radix-ui/react-select';
41
41
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
42
- import { format, isValid, formatDate, isToday, isYesterday, isThisYear } from 'date-fns';
42
+ import { format, isValid, formatDate, isToday, isYesterday, differenceInDays, isThisYear } from 'date-fns';
43
43
  import { useDebouncedCallback, useThrottledCallback, useDebounce } from 'use-debounce';
44
44
  import * as VisuallyHidden from '@radix-ui/react-visually-hidden';
45
45
  import { VisuallyHidden as VisuallyHidden$1 } from '@radix-ui/react-visually-hidden';
@@ -72,6 +72,7 @@ import semver from 'semver';
72
72
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
73
73
  import { coreFeatures } from '@mastra/core/features';
74
74
  import { EntityType } from '@mastra/core/observability';
75
+ import { ResponsiveContainer, LineChart, CartesianGrid, XAxis, YAxis, Tooltip as Tooltip$1, Line } from 'recharts';
75
76
  import Papa from 'papaparse';
76
77
  import { createPortal } from 'react-dom';
77
78
  import { isToday as isToday$1 } from 'date-fns/isToday';
@@ -12579,6 +12580,10 @@ function EntityListDescriptionCell({ children, className }) {
12579
12580
  return /* @__PURE__ */ jsx(EntityListCell, { className: cn("text-neutral2", className), children: /* @__PURE__ */ jsx("span", { className: "truncate", children }) });
12580
12581
  }
12581
12582
 
12583
+ function EntityListNoMatch({ message = "Nothing matches your search", className }) {
12584
+ return /* @__PURE__ */ jsx("div", { className: cn("col-span-full flex flex-col items-center justify-center gap-2 py-12 text-neutral3", className), children: /* @__PURE__ */ jsx("p", { className: "text-ui-md", children: message }) });
12585
+ }
12586
+
12582
12587
  function EntityListRoot({ children, columns, className }) {
12583
12588
  return /* @__PURE__ */ jsx(
12584
12589
  "div",
@@ -12690,7 +12695,8 @@ const EntityList = Object.assign(EntityListRoot, {
12690
12695
  Cell: EntityListCell,
12691
12696
  TextCell: EntityListTextCell,
12692
12697
  NameCell: EntityListNameCell,
12693
- DescriptionCell: EntityListDescriptionCell
12698
+ DescriptionCell: EntityListDescriptionCell,
12699
+ NoMatch: EntityListNoMatch
12694
12700
  });
12695
12701
 
12696
12702
  const widths$2 = ["75%", "50%", "65%", "90%", "60%", "80%"];
@@ -12764,6 +12770,7 @@ function WorkflowsList({ workflows, isLoading, error, search = "" }) {
12764
12770
  /* @__PURE__ */ jsx(EntityList.TopCell, { children: "Description" }),
12765
12771
  /* @__PURE__ */ jsx(EntityList.TopCell, { children: "Number of steps" })
12766
12772
  ] }),
12773
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Workflows match your search" }) : null,
12767
12774
  filteredData.map((wf) => {
12768
12775
  const name = truncateString(wf.name, 50);
12769
12776
  const description = truncateString(wf.description ?? "", 200);
@@ -13000,7 +13007,7 @@ const Tabs = ({ children, defaultTab, value, onValueChange, className }) => {
13000
13007
  return /* @__PURE__ */ jsx(RadixTabs.Root, { value: currentTab, onValueChange: handleTabChange, className: cn("overflow-y-auto", className), children });
13001
13008
  };
13002
13009
 
13003
- const TabList = ({ children, variant = "default", className }) => {
13010
+ const TabList = ({ children, variant = "default", alignment = "left", className }) => {
13004
13011
  return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsx(
13005
13012
  RadixTabs.List,
13006
13013
  {
@@ -13009,7 +13016,8 @@ const TabList = ({ children, variant = "default", className }) => {
13009
13016
  {
13010
13017
  // variant: default
13011
13018
  "text-ui-lg": variant === "default",
13012
- "[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1": variant === "default",
13019
+ "[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:border-b [&>button]:border-border1": variant === "default",
13020
+ "[&>button]:flex-1": variant === "default" && alignment === "full-width",
13013
13021
  [`[&>button]:${transitions.colors} [&>button]:hover:text-neutral4`]: variant === "default",
13014
13022
  "[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:border-white/50": variant === "default",
13015
13023
  // variant: buttons
@@ -19957,6 +19965,7 @@ function ScorersList({ scorers, isLoading, error, search = "" }) {
19957
19965
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Agents" }),
19958
19966
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Workflows" })
19959
19967
  ] }),
19968
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Scorers match your search" }) : null,
19960
19969
  filteredData.map((scorer) => {
19961
19970
  const name = truncateString(scorer.scorer.config?.name ?? scorer.id, 50);
19962
19971
  const description = truncateString(scorer.scorer.config?.description ?? "", 200);
@@ -21993,9 +22002,16 @@ const AgentMetadataSkillList = ({ skills, agentId, workspaceId }) => {
21993
22002
  }
21994
22003
  );
21995
22004
  return /* @__PURE__ */ jsx(AgentMetadataListItem, { children: isActivated ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
21996
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: paths.agentSkillLink(agentId, skill.name, workspaceId), "data-testid": "skill-badge", children: badge }) }),
22005
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
22006
+ Link,
22007
+ {
22008
+ href: paths.agentSkillLink(agentId, skill.name, skill.path, workspaceId),
22009
+ "data-testid": "skill-badge",
22010
+ children: badge
22011
+ }
22012
+ ) }),
21997
22013
  /* @__PURE__ */ jsx(TooltipContent, { className: "bg-surface3 text-neutral6 border border-border1", children: "Active" })
21998
- ] }) }) : /* @__PURE__ */ jsx(Link, { href: paths.agentSkillLink(agentId, skill.name, workspaceId), "data-testid": "skill-badge", children: badge }) }, skill.name);
22014
+ ] }) }) : /* @__PURE__ */ jsx(Link, { href: paths.agentSkillLink(agentId, skill.name, skill.path, workspaceId), "data-testid": "skill-badge", children: badge }) }, skill.path);
21999
22015
  }) });
22000
22016
  };
22001
22017
  function formatWorkspaceToolName(toolName) {
@@ -22734,6 +22750,8 @@ const AgentMemoryConfig = ({ agentId }) => {
22734
22750
  };
22735
22751
 
22736
22752
  const formatTokens = (n) => {
22753
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
22754
+ if (n >= 1e5) return `${(n / 1e3).toFixed(0)}k`;
22737
22755
  if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
22738
22756
  return Math.round(n).toString();
22739
22757
  };
@@ -22741,6 +22759,11 @@ const getBarColor = (percentage) => {
22741
22759
  if (percentage >= 60) return "bg-blue-500";
22742
22760
  return "bg-green-500";
22743
22761
  };
22762
+ const getModelLabel = (model, modelRouting) => {
22763
+ if (typeof model === "string") return model;
22764
+ if (modelRouting?.length) return "Auto (tiered)";
22765
+ return void 0;
22766
+ };
22744
22767
  const useElapsedTime = (isActive) => {
22745
22768
  const [elapsed, setElapsed] = useState(0);
22746
22769
  const startTimeRef = useRef(null);
@@ -22767,6 +22790,7 @@ const ProgressBar = ({
22767
22790
  label,
22768
22791
  isActive = false,
22769
22792
  model,
22793
+ modelRouting,
22770
22794
  baseThreshold,
22771
22795
  totalBudget
22772
22796
  }) => {
@@ -22799,7 +22823,15 @@ const ProgressBar = ({
22799
22823
  " ",
22800
22824
  /* @__PURE__ */ jsx("span", { className: "text-neutral5", children: model || "not configured" })
22801
22825
  ] }),
22802
- /* @__PURE__ */ jsxs("div", { children: [
22826
+ modelRouting?.length ? /* @__PURE__ */ jsxs("div", { children: [
22827
+ /* @__PURE__ */ jsx("span", { className: "text-neutral4", children: "Routing:" }),
22828
+ /* @__PURE__ */ jsx("div", { className: "mt-0.5 pl-2 space-y-0.5", children: modelRouting.map((route) => /* @__PURE__ */ jsxs("div", { className: "text-neutral5", children: [
22829
+ "≤",
22830
+ formatTokens(route.upTo),
22831
+ " → ",
22832
+ route.model
22833
+ ] }, `${route.upTo}-${route.model}`)) })
22834
+ ] }) : /* @__PURE__ */ jsxs("div", { children: [
22803
22835
  /* @__PURE__ */ jsx("span", { className: "text-neutral4", children: "Threshold:" }),
22804
22836
  " ",
22805
22837
  /* @__PURE__ */ jsxs("span", { className: "text-neutral5", children: [
@@ -22920,8 +22952,16 @@ const AgentObservationalMemory = ({ agentId, resourceId, threadId }) => {
22920
22952
  const history = omData?.history ?? [];
22921
22953
  const omAgentConfig = configData?.config?.observationalMemory;
22922
22954
  const recordConfig = record?.config;
22923
- const observationModel = recordConfig?.observationModel ?? omAgentConfig?.observationModel;
22924
- const reflectionModel = recordConfig?.reflectionModel ?? omAgentConfig?.reflectionModel;
22955
+ const observationModelRouting = recordConfig?.observationModelRouting ?? recordConfig?.observation?.routing ?? omAgentConfig?.observationModelRouting ?? omAgentConfig?.observation?.routing;
22956
+ const reflectionModelRouting = recordConfig?.reflectionModelRouting ?? recordConfig?.reflection?.routing ?? omAgentConfig?.reflectionModelRouting ?? omAgentConfig?.reflection?.routing;
22957
+ const observationModel = getModelLabel(
22958
+ recordConfig?.observationModel ?? recordConfig?.observation?.model ?? omAgentConfig?.observationModel ?? omAgentConfig?.model ?? omAgentConfig?.observation?.model,
22959
+ observationModelRouting
22960
+ );
22961
+ const reflectionModel = getModelLabel(
22962
+ recordConfig?.reflectionModel ?? recordConfig?.reflection?.model ?? omAgentConfig?.reflectionModel ?? omAgentConfig?.model ?? omAgentConfig?.reflection?.model,
22963
+ reflectionModelRouting
22964
+ );
22925
22965
  const getThresholdValue = (threshold, defaultValue) => {
22926
22966
  if (!threshold) return defaultValue;
22927
22967
  if (typeof threshold === "number") return threshold;
@@ -23030,6 +23070,7 @@ const AgentObservationalMemory = ({ agentId, resourceId, threadId }) => {
23030
23070
  label: "Messages",
23031
23071
  isActive: isObserving,
23032
23072
  model: observationModel,
23073
+ modelRouting: observationModelRouting,
23033
23074
  baseThreshold: baseMessageTokens,
23034
23075
  totalBudget
23035
23076
  }
@@ -23043,6 +23084,7 @@ const AgentObservationalMemory = ({ agentId, resourceId, threadId }) => {
23043
23084
  isActive: isReflecting,
23044
23085
  baseThreshold: baseObservationTokens,
23045
23086
  model: reflectionModel,
23087
+ modelRouting: reflectionModelRouting,
23046
23088
  totalBudget
23047
23089
  }
23048
23090
  )
@@ -25086,6 +25128,7 @@ function PromptsList({ promptBlocks, isLoading, error, search = "" }) {
25086
25128
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Has Draft" }),
25087
25129
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Is Published" })
25088
25130
  ] }),
25131
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Prompts match your search" }) : null,
25089
25132
  filteredData.map((block) => {
25090
25133
  const name = truncateString(block.name, 50);
25091
25134
  const description = truncateString(block.description ?? "", 200);
@@ -30594,7 +30637,7 @@ const useWorkspaceSkills = (options) => {
30594
30637
  const useWorkspaceSkill = (skillName, options) => {
30595
30638
  const client = useMastraClient();
30596
30639
  return useQuery({
30597
- queryKey: ["workspace", "skills", skillName, options?.workspaceId],
30640
+ queryKey: ["workspace", "skills", skillName, options?.path, options?.workspaceId],
30598
30641
  queryFn: async () => {
30599
30642
  if (!isWorkspaceV1Supported(client)) {
30600
30643
  throw new Error("Workspace v1 not supported by core or client");
@@ -30603,7 +30646,7 @@ const useWorkspaceSkill = (skillName, options) => {
30603
30646
  throw new Error("workspaceId is required");
30604
30647
  }
30605
30648
  const workspace = client.getWorkspace(options.workspaceId);
30606
- const skill = workspace.getSkill(skillName);
30649
+ const skill = workspace.getSkill(skillName, options?.path);
30607
30650
  return skill.details();
30608
30651
  },
30609
30652
  enabled: options?.enabled !== false && !!skillName && !!options?.workspaceId && isWorkspaceV1Supported(client),
@@ -30613,7 +30656,7 @@ const useWorkspaceSkill = (skillName, options) => {
30613
30656
  const useWorkspaceSkillReferences = (skillName, options) => {
30614
30657
  const client = useMastraClient();
30615
30658
  return useQuery({
30616
- queryKey: ["workspace", "skills", skillName, "references", options?.workspaceId],
30659
+ queryKey: ["workspace", "skills", skillName, options?.path, "references", options?.workspaceId],
30617
30660
  queryFn: async () => {
30618
30661
  if (!isWorkspaceV1Supported(client)) {
30619
30662
  throw new Error("Workspace v1 not supported by core or client");
@@ -30622,7 +30665,7 @@ const useWorkspaceSkillReferences = (skillName, options) => {
30622
30665
  throw new Error("workspaceId is required");
30623
30666
  }
30624
30667
  const workspace = client.getWorkspace(options.workspaceId);
30625
- const skill = workspace.getSkill(skillName);
30668
+ const skill = workspace.getSkill(skillName, options?.path);
30626
30669
  return skill.listReferences();
30627
30670
  },
30628
30671
  enabled: options?.enabled !== false && !!skillName && !!options?.workspaceId && isWorkspaceV1Supported(client),
@@ -30632,7 +30675,7 @@ const useWorkspaceSkillReferences = (skillName, options) => {
30632
30675
  const useWorkspaceSkillReference = (skillName, referencePath, options) => {
30633
30676
  const client = useMastraClient();
30634
30677
  return useQuery({
30635
- queryKey: ["workspace", "skills", skillName, "references", referencePath, options?.workspaceId],
30678
+ queryKey: ["workspace", "skills", skillName, options?.path, "references", referencePath, options?.workspaceId],
30636
30679
  queryFn: async () => {
30637
30680
  if (!isWorkspaceV1Supported(client)) {
30638
30681
  throw new Error("Workspace v1 not supported by core or client");
@@ -30641,7 +30684,7 @@ const useWorkspaceSkillReference = (skillName, referencePath, options) => {
30641
30684
  throw new Error("workspaceId is required");
30642
30685
  }
30643
30686
  const workspace = client.getWorkspace(options.workspaceId);
30644
- const skill = workspace.getSkill(skillName);
30687
+ const skill = workspace.getSkill(skillName, options?.path);
30645
30688
  return skill.getReference(referencePath);
30646
30689
  },
30647
30690
  enabled: options?.enabled !== false && !!skillName && !!referencePath && !!options?.workspaceId && isWorkspaceV1Supported(client),
@@ -30663,7 +30706,7 @@ const useSearchWorkspaceSkills = () => {
30663
30706
  const useAgentSkill = (agentId, skillName, options) => {
30664
30707
  const client = useMastraClient();
30665
30708
  return useQuery({
30666
- queryKey: ["agents", agentId, "skills", skillName, options?.workspaceId],
30709
+ queryKey: ["agents", agentId, "skills", skillName, options?.path, options?.workspaceId],
30667
30710
  queryFn: async () => {
30668
30711
  if (!isWorkspaceV1Supported(client)) {
30669
30712
  throw new Error("Workspace v1 not supported by core or client");
@@ -30672,7 +30715,7 @@ const useAgentSkill = (agentId, skillName, options) => {
30672
30715
  throw new Error("workspaceId is required");
30673
30716
  }
30674
30717
  const workspace = client.getWorkspace(options.workspaceId);
30675
- const skill = workspace.getSkill(skillName);
30718
+ const skill = workspace.getSkill(skillName, options?.path);
30676
30719
  return skill.details();
30677
30720
  },
30678
30721
  enabled: options?.enabled !== false && !!agentId && !!skillName && !!options?.workspaceId && isWorkspaceV1Supported(client),
@@ -39280,6 +39323,7 @@ function AgentsList({ agents, isLoading, error, search = "" }) {
39280
39323
  }
39281
39324
  )
39282
39325
  ] }),
39326
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Agents match your search" }) : null,
39283
39327
  filteredData.map((agent) => {
39284
39328
  const name = truncateString(agent.name, 50);
39285
39329
  const instructions = truncateString(extractPrompt(agent.instructions), 200);
@@ -39551,6 +39595,7 @@ function ProcessorsList({ processors, isLoading, error, search = "" }) {
39551
39595
  ),
39552
39596
  /* @__PURE__ */ jsx(EntityList.TopCellSmart, { short: "Used by", long: "Used by Agents", className: "text-center" })
39553
39597
  ] }),
39598
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Processors match your search" }) : null,
39554
39599
  filteredData.map((processor) => {
39555
39600
  const name = truncateString(processor.name || processor.id, 50);
39556
39601
  const description = truncateString(processor.description ?? "", 200);
@@ -40005,6 +40050,7 @@ function ToolsList({ tools, agents, isLoading, error, search = "" }) {
40005
40050
  }
40006
40051
  )
40007
40052
  ] }),
40053
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Tools match your search" }) : null,
40008
40054
  filteredData.map((tool) => {
40009
40055
  const name = truncateString(tool.id, 50);
40010
40056
  const description = truncateString(tool.description ?? "", 200);
@@ -40827,6 +40873,1173 @@ function TemplateFailure({ errorMsg, validationErrors }) {
40827
40873
  ] });
40828
40874
  }
40829
40875
 
40876
+ const DATE_PRESETS$1 = [
40877
+ { label: "Last 24 hours", value: "24h" },
40878
+ { label: "Last 3 days", value: "3d" },
40879
+ { label: "Last 7 days", value: "7d" },
40880
+ { label: "Last 14 days", value: "14d" },
40881
+ { label: "Last 30 days", value: "30d" }
40882
+ ];
40883
+ const VALID_PRESETS = new Set(DATE_PRESETS$1.map((p) => p.value));
40884
+ function isValidPreset(value) {
40885
+ return typeof value === "string" && (VALID_PRESETS.has(value) || value === "custom");
40886
+ }
40887
+ const PRESET_DAYS = {
40888
+ "24h": 1,
40889
+ "3d": 3,
40890
+ "7d": 7,
40891
+ "14d": 14,
40892
+ "30d": 30
40893
+ };
40894
+ const ENV_PCTS = {
40895
+ "Studio Cloud": 42,
40896
+ Production: 31,
40897
+ Staging: 18,
40898
+ Dev: 7,
40899
+ "CI / Preview": 2
40900
+ };
40901
+ function getMultiplier(preset, customRange, filterGroups) {
40902
+ let dateMul = 1;
40903
+ if (preset !== "custom") {
40904
+ dateMul = PRESET_DAYS[preset] ?? 1;
40905
+ } else if (customRange?.from && customRange?.to) {
40906
+ dateMul = Math.max(1, differenceInDays(customRange.to, customRange.from) + 1);
40907
+ }
40908
+ const envGroups = filterGroups.filter((g) => g.field === "Environment" && g.comparator === "is");
40909
+ const envPct = envGroups.length === 0 ? 100 : envGroups.flatMap((g) => g.values).reduce((s, v) => s + (ENV_PCTS[v] ?? 0), 0);
40910
+ return dateMul * (envPct / 100);
40911
+ }
40912
+ const MetricsContext = createContext({
40913
+ datePreset: "24h",
40914
+ setDatePreset: () => {
40915
+ },
40916
+ customRange: void 0,
40917
+ setCustomRange: () => {
40918
+ },
40919
+ dateRangeLabel: "Last 24 hours",
40920
+ filterGroups: [],
40921
+ setFilterGroups: () => {
40922
+ },
40923
+ multiplier: 1
40924
+ });
40925
+ function useMetrics() {
40926
+ return useContext(MetricsContext);
40927
+ }
40928
+ function getDateRangeLabel(preset, customRange) {
40929
+ if (preset !== "custom") {
40930
+ return DATE_PRESETS$1.find((p) => p.value === preset).label;
40931
+ }
40932
+ if (customRange?.from) {
40933
+ if (customRange.to) {
40934
+ return `${format(customRange.from, "MMM d, yyyy")} – ${format(customRange.to, "MMM d, yyyy")}`;
40935
+ }
40936
+ return format(customRange.from, "MMM d, yyyy");
40937
+ }
40938
+ return "Custom range";
40939
+ }
40940
+ function MetricsProvider({
40941
+ children,
40942
+ initialPreset,
40943
+ onPresetChange
40944
+ }) {
40945
+ const [datePreset, setDatePresetState] = useState(initialPreset ?? "24h");
40946
+ const [customRange, setCustomRange] = useState(void 0);
40947
+ const [filterGroups, setFilterGroups] = useState([]);
40948
+ const dateRangeLabel = getDateRangeLabel(datePreset, customRange);
40949
+ const multiplier = getMultiplier(datePreset, customRange, filterGroups);
40950
+ useEffect(() => {
40951
+ if (initialPreset && initialPreset !== datePreset) {
40952
+ setDatePresetState(initialPreset);
40953
+ }
40954
+ }, [initialPreset]);
40955
+ const setDatePreset = useCallback(
40956
+ (v) => {
40957
+ setDatePresetState(v);
40958
+ onPresetChange?.(v);
40959
+ },
40960
+ [onPresetChange]
40961
+ );
40962
+ return /* @__PURE__ */ jsx(
40963
+ MetricsContext.Provider,
40964
+ {
40965
+ value: {
40966
+ datePreset,
40967
+ setDatePreset,
40968
+ customRange,
40969
+ setCustomRange,
40970
+ dateRangeLabel,
40971
+ filterGroups,
40972
+ setFilterGroups,
40973
+ multiplier
40974
+ },
40975
+ children
40976
+ }
40977
+ );
40978
+ }
40979
+
40980
+ const PRESET_MS = {
40981
+ "24h": 24 * 60 * 60 * 1e3,
40982
+ "3d": 3 * 24 * 60 * 60 * 1e3,
40983
+ "7d": 7 * 24 * 60 * 60 * 1e3,
40984
+ "14d": 14 * 24 * 60 * 60 * 1e3,
40985
+ "30d": 30 * 24 * 60 * 60 * 1e3
40986
+ };
40987
+ function buildTimestamp(preset, customRange) {
40988
+ const now = /* @__PURE__ */ new Date();
40989
+ if (preset !== "custom") {
40990
+ const ms = PRESET_MS[preset] ?? PRESET_MS["24h"];
40991
+ return { start: new Date(now.getTime() - ms), end: now };
40992
+ }
40993
+ return {
40994
+ start: customRange?.from ?? new Date(now.getTime() - PRESET_MS["24h"]),
40995
+ end: customRange?.to ?? now
40996
+ };
40997
+ }
40998
+ function useMetricsFilters() {
40999
+ const { datePreset, customRange } = useMetrics();
41000
+ const timestamp = buildTimestamp(datePreset, customRange);
41001
+ return { datePreset, customRange, timestamp };
41002
+ }
41003
+
41004
+ async function fetchPercentiles(client, metricName, timestamp) {
41005
+ const res = await client.getMetricPercentiles({
41006
+ name: metricName,
41007
+ percentiles: [0.5, 0.95],
41008
+ interval: "1h",
41009
+ filters: { timestamp }
41010
+ });
41011
+ const p50Series = res.series.find((s) => s.percentile === 0.5);
41012
+ const p95Series = res.series.find((s) => s.percentile === 0.95);
41013
+ if (!p50Series || !p95Series) return [];
41014
+ const p95Map = new Map(p95Series.points.map((p) => [new Date(p.timestamp).getTime(), p.value]));
41015
+ return p50Series.points.map((p) => {
41016
+ const ts = new Date(p.timestamp);
41017
+ return {
41018
+ time: ts.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: false }),
41019
+ p50: Math.round(p.value),
41020
+ p95: Math.round(p95Map.get(ts.getTime()) ?? 0)
41021
+ };
41022
+ });
41023
+ }
41024
+ function useLatencyMetrics() {
41025
+ const client = useMastraClient();
41026
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41027
+ return useQuery({
41028
+ queryKey: ["metrics", "latency", datePreset, customRange],
41029
+ queryFn: async () => {
41030
+ const [agentData, workflowData, toolData] = await Promise.all([
41031
+ fetchPercentiles(client, "mastra_agent_duration_ms", timestamp),
41032
+ fetchPercentiles(client, "mastra_workflow_duration_ms", timestamp),
41033
+ fetchPercentiles(client, "mastra_tool_duration_ms", timestamp)
41034
+ ]);
41035
+ return { agentData, workflowData, toolData };
41036
+ }
41037
+ });
41038
+ }
41039
+
41040
+ function formatCompact(n) {
41041
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
41042
+ if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
41043
+ return n.toLocaleString();
41044
+ }
41045
+ const CHART_COLORS = {
41046
+ green: "#22c55e",
41047
+ orange: "#fb923c",
41048
+ pink: "#f472b6",
41049
+ purple: "#8b5cf6",
41050
+ blue: "#4f83f1",
41051
+ blueDark: "#2b5cd9",
41052
+ blueLight: "#6b8fe5",
41053
+ red: "#f87171",
41054
+ greenDark: "#15613a",
41055
+ redDark: "#991b1b",
41056
+ yellow: "#facc15"
41057
+ };
41058
+
41059
+ function MetricsCardContent({ children, className }) {
41060
+ return /* @__PURE__ */ jsx("div", { className: cn("overflow-x-auto ", className), children });
41061
+ }
41062
+
41063
+ function MetricsCardDescription({ children, className }) {
41064
+ return /* @__PURE__ */ jsx("p", { className: cn("text-ui-md text-neutral2 leading-tight mt-0.5", className), children });
41065
+ }
41066
+
41067
+ function MetricsCardError({
41068
+ message = "Failed to load data",
41069
+ className
41070
+ }) {
41071
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-3 items-center justify-center", className), children: /* @__PURE__ */ jsx("p", { className: "text-ui-sm text-accent2", children: message }) });
41072
+ }
41073
+
41074
+ function MetricsCardLoading({ className }) {
41075
+ return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsx(Spinner, { size: "md", color: Colors.neutral1 }) });
41076
+ }
41077
+
41078
+ function MetricsCardNoData({ message = "No data yet", className }) {
41079
+ return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center h-full", className), children: /* @__PURE__ */ jsx("p", { className: "text-neutral1 text-sm", children: message }) });
41080
+ }
41081
+
41082
+ function DashboardCard({ children, className }) {
41083
+ return /* @__PURE__ */ jsx("div", { className: cn("border border-border1 rounded-lg p-6 bg-surface2", className), children });
41084
+ }
41085
+
41086
+ function MetricsCardRoot({ children, className }) {
41087
+ return /* @__PURE__ */ jsx(
41088
+ DashboardCard,
41089
+ {
41090
+ className: cn(
41091
+ "flex-1 grid grid-rows-[4rem_20rem] gap-2 min-w-[20rem] md:min-w-[22rem] lg:min-w-[24rem] xl:min-w-[26rem] 2xl:min-w-[30rem] 3xl:min-w-[32rem]",
41092
+ className
41093
+ ),
41094
+ children
41095
+ }
41096
+ );
41097
+ }
41098
+
41099
+ function MetricsCardSummary({ value, label, className }) {
41100
+ return /* @__PURE__ */ jsxs("div", { className: cn("grid justify-end content-start text-right gap-1", className), children: [
41101
+ /* @__PURE__ */ jsx("span", { className: "text-ui-lg font-semibold text-neutral4 leading-none", children: value }),
41102
+ label && /* @__PURE__ */ jsx("span", { className: "text-ui-md text-neutral2", children: label })
41103
+ ] });
41104
+ }
41105
+
41106
+ function MetricsCardTitle({ children, className }) {
41107
+ return /* @__PURE__ */ jsx("h3", { className: cn("text-ui-md font-normal text-neutral4", className), children });
41108
+ }
41109
+
41110
+ function MetricsCardTitleAndDescription(props) {
41111
+ if ("children" in props) {
41112
+ return /* @__PURE__ */ jsx("div", { className: props.className, children: props.children });
41113
+ }
41114
+ const { title, description } = props;
41115
+ return /* @__PURE__ */ jsxs("div", { className: props.className, children: [
41116
+ /* @__PURE__ */ jsx(MetricsCardTitle, { children: title }),
41117
+ description && /* @__PURE__ */ jsx(MetricsCardDescription, { children: description })
41118
+ ] });
41119
+ }
41120
+
41121
+ function MetricsCardTopBar({ children, className }) {
41122
+ return /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-[1fr_auto] gap-4", className), children });
41123
+ }
41124
+
41125
+ function MetricsKpiCardChange({
41126
+ changePct,
41127
+ prevValue,
41128
+ lowerIsBetter,
41129
+ className
41130
+ }) {
41131
+ const isGood = lowerIsBetter ? changePct < 0 : changePct >= 0;
41132
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1 text-sm text-neutral1 flex-wrap", className), children: [
41133
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
41134
+ /* @__PURE__ */ jsx("span", { className: cn("[&>svg]:w-4 [&>svg]:h-4", isGood ? "text-green-600" : "text-red-600"), children: changePct >= 0 ? /* @__PURE__ */ jsx(TrendingUpIcon, {}) : /* @__PURE__ */ jsx(TrendingDownIcon, {}) }),
41135
+ /* @__PURE__ */ jsx(
41136
+ "span",
41137
+ {
41138
+ className: cn(isGood ? "text-green-600" : "text-red-600"),
41139
+ children: `${changePct >= 0 ? "+" : "-"}${Math.abs(changePct).toFixed(1)}%`
41140
+ }
41141
+ )
41142
+ ] }),
41143
+ prevValue && /* @__PURE__ */ jsxs("div", { children: [
41144
+ "vs previous ",
41145
+ /* @__PURE__ */ jsx("b", { className: "text-neutral2 font-semibold", children: prevValue })
41146
+ ] })
41147
+ ] });
41148
+ }
41149
+
41150
+ function MetricsKpiCardError({
41151
+ message = "Failed to load data",
41152
+ className
41153
+ }) {
41154
+ return /* @__PURE__ */ jsx("span", { className: cn("text-ui-sm text-accent2", className), children: message });
41155
+ }
41156
+
41157
+ function MetricsKpiCardLabel({ children, className }) {
41158
+ return /* @__PURE__ */ jsx("span", { className: cn("text-ui-md text-neutral3 leading-relaxed", className), children });
41159
+ }
41160
+
41161
+ function MetricsKpiCardLoading({ className }) {
41162
+ return /* @__PURE__ */ jsx("span", { className: cn("text-sm", className), children: /* @__PURE__ */ jsx(Spinner, { size: "md", color: Colors.neutral1 }) });
41163
+ }
41164
+
41165
+ function MetricsKpiCardNoChange({
41166
+ message = "No previous value to compare",
41167
+ className
41168
+ }) {
41169
+ return /* @__PURE__ */ jsx("span", { className: cn("text-sm text-neutral1", className), children: message });
41170
+ }
41171
+
41172
+ function MetricsKpiCardNoData({ message = "No data yet", className }) {
41173
+ return /* @__PURE__ */ jsx("span", { className: cn("text-sm text-neutral1", className), children: message });
41174
+ }
41175
+
41176
+ function MetricsKpiCardRoot({ children, className }) {
41177
+ return /* @__PURE__ */ jsx(DashboardCard, { className: cn("flex-1 min-w-[15rem]", className), children: /* @__PURE__ */ jsx("div", { className: "grid gap-1", children }) });
41178
+ }
41179
+
41180
+ function MetricsKpiCardValue({ children, className }) {
41181
+ return /* @__PURE__ */ jsx("strong", { className: cn("text-header-lg text-neutral4 font-semibold", className), children });
41182
+ }
41183
+
41184
+ const MetricsKpiCard = Object.assign(MetricsKpiCardRoot, {
41185
+ Label: MetricsKpiCardLabel,
41186
+ Value: MetricsKpiCardValue,
41187
+ Change: MetricsKpiCardChange,
41188
+ NoChange: MetricsKpiCardNoChange,
41189
+ NoData: MetricsKpiCardNoData,
41190
+ Error: MetricsKpiCardError,
41191
+ Loading: MetricsKpiCardLoading
41192
+ });
41193
+
41194
+ const MetricsCard = Object.assign(MetricsCardRoot, {
41195
+ Root: MetricsCardRoot,
41196
+ Kpi: MetricsKpiCard,
41197
+ TopBar: MetricsCardTopBar,
41198
+ TitleAndDescription: MetricsCardTitleAndDescription,
41199
+ Title: MetricsCardTitle,
41200
+ Description: MetricsCardDescription,
41201
+ Summary: MetricsCardSummary,
41202
+ Loading: MetricsCardLoading,
41203
+ Error: MetricsCardError,
41204
+ Content: MetricsCardContent,
41205
+ NoData: MetricsCardNoData
41206
+ });
41207
+
41208
+ function MetricsLineChartTooltip({
41209
+ active,
41210
+ payload,
41211
+ label,
41212
+ suffix
41213
+ }) {
41214
+ if (!active || !payload?.length) return null;
41215
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-md border border-border1 bg-surface2 px-3 py-2 text-xs shadow-lg", children: [
41216
+ /* @__PURE__ */ jsx("p", { className: "mb-1 font-medium text-icon6", children: label }),
41217
+ payload.map((entry) => /* @__PURE__ */ jsxs("p", { className: "text-icon2", children: [
41218
+ /* @__PURE__ */ jsx("span", { className: "mr-2 inline-block size-2 rounded-full", style: { backgroundColor: entry.color } }),
41219
+ entry.name,
41220
+ ":",
41221
+ " ",
41222
+ /* @__PURE__ */ jsxs("span", { className: "font-mono", children: [
41223
+ entry.value,
41224
+ suffix
41225
+ ] })
41226
+ ] }, entry.name))
41227
+ ] });
41228
+ }
41229
+
41230
+ const LABEL_COLOR = "#a1a1aa";
41231
+ function MetricsLineChart({
41232
+ data,
41233
+ series,
41234
+ height = 210,
41235
+ yDomain
41236
+ }) {
41237
+ return /* @__PURE__ */ jsxs("div", { children: [
41238
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap w-full items-end gap-4 gap-y-1 mb-4", children: series.map((s) => {
41239
+ const aggregated = s.aggregate?.(data);
41240
+ return /* @__PURE__ */ jsxs("div", { className: "inline-flex items-baseline gap-2", children: [
41241
+ /* @__PURE__ */ jsx("div", { className: "size-2 shrink-0 rounded-full translate-y-[-1px]", style: { backgroundColor: s.color } }),
41242
+ /* @__PURE__ */ jsx("span", { className: "text-ui-sm text-neutral3 truncate max-w-24", children: s.label }),
41243
+ aggregated && /* @__PURE__ */ jsxs("span", { className: "text-ui-lg text-neutral4", children: [
41244
+ aggregated.value,
41245
+ aggregated.suffix && /* @__PURE__ */ jsxs("span", { className: "text-ui-sm text-neutral2", children: [
41246
+ " ",
41247
+ aggregated.suffix
41248
+ ] })
41249
+ ] })
41250
+ ] }, s.dataKey);
41251
+ }) }),
41252
+ /* @__PURE__ */ jsx("div", { style: { height }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(LineChart, { data, children: [
41253
+ /* @__PURE__ */ jsx(CartesianGrid, { stroke: "rgba(255,255,255,0.08)", vertical: false }),
41254
+ /* @__PURE__ */ jsx(
41255
+ XAxis,
41256
+ {
41257
+ dataKey: "time",
41258
+ tick: { fontSize: 10, fill: LABEL_COLOR, fontFamily: "var(--font-mono)" },
41259
+ tickLine: false,
41260
+ axisLine: false,
41261
+ interval: 5
41262
+ }
41263
+ ),
41264
+ /* @__PURE__ */ jsx(
41265
+ YAxis,
41266
+ {
41267
+ tick: { fontSize: 10, fill: LABEL_COLOR, fontFamily: "var(--font-mono)" },
41268
+ tickLine: false,
41269
+ axisLine: false,
41270
+ width: 30,
41271
+ domain: yDomain
41272
+ }
41273
+ ),
41274
+ /* @__PURE__ */ jsx(Tooltip$1, { content: /* @__PURE__ */ jsx(MetricsLineChartTooltip, {}) }),
41275
+ series.map((s) => /* @__PURE__ */ jsx(
41276
+ Line,
41277
+ {
41278
+ type: "linear",
41279
+ dataKey: s.dataKey,
41280
+ stroke: s.color,
41281
+ strokeWidth: 2,
41282
+ dot: false,
41283
+ name: s.label
41284
+ },
41285
+ s.dataKey
41286
+ ))
41287
+ ] }) }) })
41288
+ ] });
41289
+ }
41290
+
41291
+ const latencySeries = [
41292
+ {
41293
+ dataKey: "p50",
41294
+ label: "p50",
41295
+ color: CHART_COLORS.blue,
41296
+ aggregate: (data) => ({
41297
+ value: data.length > 0 ? `${Math.round(data.reduce((s, d) => s + d.p50, 0) / data.length)}` : "0",
41298
+ suffix: "avg ms"
41299
+ })
41300
+ },
41301
+ {
41302
+ dataKey: "p95",
41303
+ label: "p95",
41304
+ color: CHART_COLORS.yellow,
41305
+ aggregate: (data) => ({
41306
+ value: data.length > 0 ? `${Math.round(data.reduce((s, d) => s + d.p95, 0) / data.length)}` : "0",
41307
+ suffix: "avg ms"
41308
+ })
41309
+ }
41310
+ ];
41311
+ function LatencyChart({ data }) {
41312
+ if (data.length === 0) {
41313
+ return /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No latency data yet" });
41314
+ }
41315
+ return /* @__PURE__ */ jsx(MetricsLineChart, { data, series: latencySeries });
41316
+ }
41317
+ function LatencyCard() {
41318
+ const { data, isLoading, isError } = useLatencyMetrics();
41319
+ const hasData = !!data && (data.agentData.length > 0 || data.workflowData.length > 0 || data.toolData.length > 0);
41320
+ const avgP50 = data && data.agentData.length > 0 ? `${Math.round(data.agentData.reduce((s, d) => s + d.p50, 0) / data.agentData.length)}ms` : "—";
41321
+ return /* @__PURE__ */ jsxs(MetricsCard, { children: [
41322
+ /* @__PURE__ */ jsxs(MetricsCard.TopBar, { children: [
41323
+ /* @__PURE__ */ jsx(MetricsCard.TitleAndDescription, { title: "Latency", description: "Hourly p50 and p95 latency." }),
41324
+ hasData && /* @__PURE__ */ jsx(MetricsCard.Summary, { value: avgP50, label: "Avg p50" })
41325
+ ] }),
41326
+ isLoading ? /* @__PURE__ */ jsx(MetricsCard.Loading, {}) : isError ? /* @__PURE__ */ jsx(MetricsCard.Error, { message: "Failed to load latency data" }) : /* @__PURE__ */ jsx(MetricsCard.Content, { children: !hasData ? /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No latency data yet" }) : /* @__PURE__ */ jsxs(Tabs, { defaultTab: "agents", className: "overflow-visible", children: [
41327
+ /* @__PURE__ */ jsxs(TabList, { children: [
41328
+ /* @__PURE__ */ jsx(Tab, { value: "agents", children: "Agents" }),
41329
+ /* @__PURE__ */ jsx(Tab, { value: "workflows", children: "Workflows" }),
41330
+ /* @__PURE__ */ jsx(Tab, { value: "tools", children: "Tools" })
41331
+ ] }),
41332
+ /* @__PURE__ */ jsx(TabContent, { value: "agents", children: /* @__PURE__ */ jsx(LatencyChart, { data: data.agentData }) }),
41333
+ /* @__PURE__ */ jsx(TabContent, { value: "workflows", children: /* @__PURE__ */ jsx(LatencyChart, { data: data.workflowData }) }),
41334
+ /* @__PURE__ */ jsx(TabContent, { value: "tools", children: /* @__PURE__ */ jsx(LatencyChart, { data: data.toolData }) })
41335
+ ] }) })
41336
+ ] });
41337
+ }
41338
+
41339
+ function useAgentRunsKpiMetrics() {
41340
+ const client = useMastraClient();
41341
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41342
+ return useQuery({
41343
+ queryKey: ["metrics", "agent-runs-kpi", datePreset, customRange],
41344
+ queryFn: () => client.getMetricAggregate({
41345
+ name: ["mastra_agent_duration_ms"],
41346
+ aggregation: "count",
41347
+ filters: { timestamp },
41348
+ comparePeriod: "previous_period"
41349
+ })
41350
+ });
41351
+ }
41352
+
41353
+ function useAvgScoreKpiMetrics() {
41354
+ const client = useMastraClient();
41355
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41356
+ return useQuery({
41357
+ queryKey: ["metrics", "avg-score-kpi", datePreset, customRange],
41358
+ queryFn: async () => {
41359
+ const scorersMap = await client.listScorers();
41360
+ const scorerIds = Object.keys(scorersMap ?? {});
41361
+ if (scorerIds.length === 0) {
41362
+ return { value: null, previousValue: null, changePercent: null };
41363
+ }
41364
+ const allResults = await Promise.all(
41365
+ scorerIds.map((scorerId) => client.listScoresByScorerId({ scorerId, perPage: 100 }))
41366
+ );
41367
+ const startMs = timestamp.start.getTime();
41368
+ const endMs = timestamp.end.getTime();
41369
+ const allScoreValues = [];
41370
+ for (const result of allResults) {
41371
+ for (const s of result?.scores ?? []) {
41372
+ const ts = new Date(s.createdAt).getTime();
41373
+ if (ts >= startMs && ts <= endMs) {
41374
+ allScoreValues.push(s.score);
41375
+ }
41376
+ }
41377
+ }
41378
+ if (allScoreValues.length === 0) {
41379
+ return { value: null, previousValue: null, changePercent: null };
41380
+ }
41381
+ const avg = allScoreValues.reduce((sum, v) => sum + v, 0) / allScoreValues.length;
41382
+ return { value: Math.round(avg * 100) / 100, previousValue: null, changePercent: null };
41383
+ }
41384
+ });
41385
+ }
41386
+
41387
+ function useTotalTokensKpiMetrics() {
41388
+ const client = useMastraClient();
41389
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41390
+ return useQuery({
41391
+ queryKey: ["metrics", "total-tokens-kpi", datePreset, customRange],
41392
+ queryFn: async () => {
41393
+ const [input, output] = await Promise.all([
41394
+ client.getMetricAggregate({
41395
+ name: ["mastra_model_total_input_tokens"],
41396
+ aggregation: "sum",
41397
+ filters: { timestamp },
41398
+ comparePeriod: "previous_period"
41399
+ }),
41400
+ client.getMetricAggregate({
41401
+ name: ["mastra_model_total_output_tokens"],
41402
+ aggregation: "sum",
41403
+ filters: { timestamp },
41404
+ comparePeriod: "previous_period"
41405
+ })
41406
+ ]);
41407
+ const hasCurrent = input.value != null || output.value != null;
41408
+ const hasPrevious = input.previousValue != null || output.previousValue != null;
41409
+ const value = (input.value ?? 0) + (output.value ?? 0);
41410
+ const previousValue = (input.previousValue ?? 0) + (output.previousValue ?? 0);
41411
+ const changePercent = hasPrevious && previousValue > 0 ? (value - previousValue) / previousValue * 100 : null;
41412
+ return {
41413
+ value: hasCurrent ? value : null,
41414
+ previousValue: hasPrevious ? previousValue : null,
41415
+ changePercent
41416
+ };
41417
+ }
41418
+ });
41419
+ }
41420
+
41421
+ function AgentRunsKpiCard() {
41422
+ const { data: agentRunsKpi, isLoading, isError } = useAgentRunsKpiMetrics();
41423
+ const hasData = agentRunsKpi?.value != null;
41424
+ return /* @__PURE__ */ jsxs(MetricsKpiCard, { children: [
41425
+ /* @__PURE__ */ jsx(MetricsKpiCard.Label, { children: "Total Agent Runs" }),
41426
+ /* @__PURE__ */ jsx(MetricsKpiCard.Value, { className: hasData ? void 0 : "invisible", children: hasData ? agentRunsKpi.value.toLocaleString() : "—" }),
41427
+ isError ? /* @__PURE__ */ jsx(MetricsKpiCard.Error, {}) : isLoading ? /* @__PURE__ */ jsx(MetricsKpiCard.Loading, {}) : hasData ? agentRunsKpi.changePercent != null ? /* @__PURE__ */ jsx(
41428
+ MetricsKpiCard.Change,
41429
+ {
41430
+ changePct: agentRunsKpi.changePercent,
41431
+ prevValue: agentRunsKpi.previousValue?.toLocaleString()
41432
+ }
41433
+ ) : /* @__PURE__ */ jsx(MetricsKpiCard.NoChange, {}) : /* @__PURE__ */ jsx(MetricsKpiCard.NoData, {})
41434
+ ] });
41435
+ }
41436
+ function TotalTokensKpiCard() {
41437
+ const { data: totalTokensKpi, isLoading, isError } = useTotalTokensKpiMetrics();
41438
+ const hasData = totalTokensKpi?.value != null;
41439
+ return /* @__PURE__ */ jsxs(MetricsKpiCard, { children: [
41440
+ /* @__PURE__ */ jsx(MetricsKpiCard.Label, { children: "Total Tokens" }),
41441
+ /* @__PURE__ */ jsx(MetricsKpiCard.Value, { className: hasData ? void 0 : "invisible", children: hasData ? formatCompact(totalTokensKpi.value) : "—" }),
41442
+ isError ? /* @__PURE__ */ jsx(MetricsKpiCard.Error, {}) : isLoading ? /* @__PURE__ */ jsx(MetricsKpiCard.Loading, {}) : hasData ? totalTokensKpi.changePercent != null ? /* @__PURE__ */ jsx(
41443
+ MetricsKpiCard.Change,
41444
+ {
41445
+ changePct: totalTokensKpi.changePercent,
41446
+ prevValue: totalTokensKpi.previousValue != null ? formatCompact(totalTokensKpi.previousValue) : void 0
41447
+ }
41448
+ ) : /* @__PURE__ */ jsx(MetricsKpiCard.NoChange, {}) : /* @__PURE__ */ jsx(MetricsKpiCard.NoData, {})
41449
+ ] });
41450
+ }
41451
+ function AvgScoreKpiCard() {
41452
+ const { data: avgScoreKpi, isLoading, isError } = useAvgScoreKpiMetrics();
41453
+ const hasData = avgScoreKpi?.value != null;
41454
+ return /* @__PURE__ */ jsxs(MetricsKpiCard, { children: [
41455
+ /* @__PURE__ */ jsx(MetricsKpiCard.Label, { children: "Avg Score" }),
41456
+ /* @__PURE__ */ jsx(MetricsKpiCard.Value, { className: hasData ? void 0 : "invisible", children: hasData ? String(avgScoreKpi.value) : "—" }),
41457
+ isError ? /* @__PURE__ */ jsx(MetricsKpiCard.Error, {}) : isLoading ? /* @__PURE__ */ jsx(MetricsKpiCard.Loading, {}) : hasData ? avgScoreKpi.changePercent != null ? /* @__PURE__ */ jsx(
41458
+ MetricsKpiCard.Change,
41459
+ {
41460
+ changePct: avgScoreKpi.changePercent,
41461
+ prevValue: avgScoreKpi.previousValue != null ? String(avgScoreKpi.previousValue) : void 0
41462
+ }
41463
+ ) : /* @__PURE__ */ jsx(MetricsKpiCard.NoChange, {}) : /* @__PURE__ */ jsx(MetricsKpiCard.NoData, {})
41464
+ ] });
41465
+ }
41466
+
41467
+ function useModelUsageCostMetrics() {
41468
+ const client = useMastraClient();
41469
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41470
+ return useQuery({
41471
+ queryKey: ["metrics", "model-usage-cost", datePreset, customRange],
41472
+ queryFn: async () => {
41473
+ const metrics = [
41474
+ "mastra_model_total_input_tokens",
41475
+ "mastra_model_total_output_tokens",
41476
+ "mastra_model_input_cache_read_tokens",
41477
+ "mastra_model_input_cache_write_tokens"
41478
+ ];
41479
+ const [inputRes, outputRes, cacheReadRes, cacheWriteRes] = await Promise.all(
41480
+ metrics.map(
41481
+ (name) => client.getMetricBreakdown({
41482
+ name: [name],
41483
+ groupBy: ["model"],
41484
+ aggregation: "sum",
41485
+ filters: { timestamp }
41486
+ })
41487
+ )
41488
+ );
41489
+ const modelMap = /* @__PURE__ */ new Map();
41490
+ const ensureModel = (model) => {
41491
+ if (!modelMap.has(model)) {
41492
+ modelMap.set(model, { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 });
41493
+ }
41494
+ return modelMap.get(model);
41495
+ };
41496
+ for (const group of inputRes.groups) {
41497
+ const m = group.dimensions.model ?? "unknown";
41498
+ ensureModel(m).input = group.value;
41499
+ }
41500
+ for (const group of outputRes.groups) {
41501
+ const m = group.dimensions.model ?? "unknown";
41502
+ ensureModel(m).output = group.value;
41503
+ }
41504
+ for (const group of cacheReadRes.groups) {
41505
+ const m = group.dimensions.model ?? "unknown";
41506
+ ensureModel(m).cacheRead = group.value;
41507
+ }
41508
+ for (const group of cacheWriteRes.groups) {
41509
+ const m = group.dimensions.model ?? "unknown";
41510
+ ensureModel(m).cacheWrite = group.value;
41511
+ }
41512
+ return Array.from(modelMap.entries()).map(([model, vals]) => ({
41513
+ model,
41514
+ input: formatCompact(vals.input),
41515
+ output: formatCompact(vals.output),
41516
+ cacheRead: formatCompact(vals.cacheRead),
41517
+ cacheWrite: formatCompact(vals.cacheWrite)
41518
+ })).sort((a, b) => a.model.localeCompare(b.model));
41519
+ }
41520
+ });
41521
+ }
41522
+
41523
+ function MetricsDataTable({
41524
+ columns,
41525
+ data,
41526
+ className
41527
+ }) {
41528
+ if (columns.length === 0) return null;
41529
+ return /* @__PURE__ */ jsx(ScrollArea, { className: cn("w-full h-full", className), maxHeight: "20rem", children: /* @__PURE__ */ jsxs(
41530
+ "div",
41531
+ {
41532
+ className: "grid items-center",
41533
+ style: {
41534
+ gridTemplateColumns: `auto ${columns.slice(1).map(() => "1fr").join(" ")}`
41535
+ },
41536
+ children: [
41537
+ columns.map((col, i) => /* @__PURE__ */ jsx(
41538
+ "span",
41539
+ {
41540
+ className: cn(
41541
+ "h-9 py-1 flex items-center border-b border-surface5 uppercase whitespace-nowrap text-neutral2 tracking-widest text-ui-xs sticky top-0 z-10 bg-surface2",
41542
+ i === 0 ? "text-left sticky left-0 z-20 bg-surface2 pr-4 after:absolute after:right-1 after:top-1/2 after:-translate-y-1/2 after:h-3/5 after:w-px after:bg-surface5" : "px-4 text-right"
41543
+ ),
41544
+ children: col.label
41545
+ },
41546
+ `${i}-${col.label}`
41547
+ )),
41548
+ data.map((row, rowIndex) => /* @__PURE__ */ jsx(Fragment$1, { children: columns.map((col, i) => /* @__PURE__ */ jsx(
41549
+ "span",
41550
+ {
41551
+ className: cn(
41552
+ "h-10 flex items-center text-ui-sm whitespace-nowrap border-t border-surface5",
41553
+ rowIndex === 0 && "border-t-transparent",
41554
+ i === 0 ? "text-left text-neutral3 sticky left-0 z-10 bg-surface2 pr-4 after:absolute after:right-1 after:top-1/2 after:-translate-y-1/2 after:h-3/5 after:w-px after:bg-surface5" : cn(
41555
+ "px-4 text-right tabular-nums",
41556
+ col.highlight ? "text-neutral4 font-semibold" : "text-neutral3"
41557
+ )
41558
+ ),
41559
+ children: col.value(row)
41560
+ },
41561
+ `${row.key}-${i}`
41562
+ )) }, row.key))
41563
+ ]
41564
+ }
41565
+ ) });
41566
+ }
41567
+
41568
+ function ModelUsageCostCard() {
41569
+ const { data: rows, isLoading, isError } = useModelUsageCostMetrics();
41570
+ const hasData = !!rows && rows.length > 0;
41571
+ return /* @__PURE__ */ jsxs(MetricsCard, { children: [
41572
+ /* @__PURE__ */ jsx(MetricsCard.TopBar, { children: /* @__PURE__ */ jsx(MetricsCard.TitleAndDescription, { title: "Model Usage", description: "Token consumption by model." }) }),
41573
+ isLoading ? /* @__PURE__ */ jsx(MetricsCard.Loading, {}) : isError ? /* @__PURE__ */ jsx(MetricsCard.Error, { message: "Failed to load model usage data" }) : /* @__PURE__ */ jsx(MetricsCard.Content, { children: !hasData ? /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No model usage data yet" }) : /* @__PURE__ */ jsx(
41574
+ MetricsDataTable,
41575
+ {
41576
+ columns: [
41577
+ { label: "Model", value: (row) => row.model },
41578
+ { label: "Input", value: (row) => row.input },
41579
+ { label: "Output", value: (row) => row.output },
41580
+ { label: "Cache Read", value: (row) => row.cacheRead },
41581
+ { label: "Cache Write", value: (row) => row.cacheWrite }
41582
+ // { label: 'Cost', value: () => '—', highlight: true },
41583
+ ],
41584
+ data: rows.map((row) => ({ ...row, key: row.model }))
41585
+ }
41586
+ ) })
41587
+ ] });
41588
+ }
41589
+
41590
+ function useScoresMetrics() {
41591
+ const client = useMastraClient();
41592
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41593
+ return useQuery({
41594
+ queryKey: ["metrics", "scores-card", datePreset, customRange],
41595
+ queryFn: async () => {
41596
+ const scorersMap = await client.listScorers();
41597
+ const scorerIds = Object.keys(scorersMap ?? {});
41598
+ if (scorerIds.length === 0) {
41599
+ return { summaryData: [], overTimeData: [], scorerNames: [], avgScore: null };
41600
+ }
41601
+ const allResults = await Promise.all(
41602
+ // Limited to 100 most recent scores per scorer; pagination not yet implemented
41603
+ scorerIds.map((scorerId) => client.listScoresByScorerId({ scorerId, perPage: 100 }))
41604
+ );
41605
+ const startMs = timestamp.start.getTime();
41606
+ const endMs = timestamp.end.getTime();
41607
+ const allScores = [];
41608
+ for (let i = 0; i < scorerIds.length; i++) {
41609
+ const scores = allResults[i]?.scores ?? [];
41610
+ for (const s of scores) {
41611
+ const ts = new Date(s.createdAt).getTime();
41612
+ if (ts >= startMs && ts <= endMs) {
41613
+ allScores.push({
41614
+ scorerId: scorerIds[i],
41615
+ score: s.score,
41616
+ createdAt: s.createdAt
41617
+ });
41618
+ }
41619
+ }
41620
+ }
41621
+ if (allScores.length === 0) {
41622
+ return { summaryData: [], overTimeData: [], scorerNames: [], avgScore: null };
41623
+ }
41624
+ const byScorer = /* @__PURE__ */ new Map();
41625
+ for (const s of allScores) {
41626
+ if (!byScorer.has(s.scorerId)) byScorer.set(s.scorerId, []);
41627
+ byScorer.get(s.scorerId).push(s.score);
41628
+ }
41629
+ const summaryData = Array.from(byScorer.entries()).map(([scorer, vals]) => ({
41630
+ scorer,
41631
+ avg: vals.reduce((a, b) => a + b, 0) / vals.length,
41632
+ min: Math.min(...vals),
41633
+ max: Math.max(...vals),
41634
+ count: vals.length
41635
+ }));
41636
+ const scorerNames = summaryData.map((s) => s.scorer);
41637
+ const avgScore = summaryData.reduce((s, d) => s + d.avg, 0) / summaryData.length;
41638
+ const bucketMap = /* @__PURE__ */ new Map();
41639
+ for (const s of allScores) {
41640
+ const ts = new Date(s.createdAt);
41641
+ const bucket = Math.floor(ts.getTime() / 36e5) * 36e5;
41642
+ if (!bucketMap.has(bucket)) bucketMap.set(bucket, /* @__PURE__ */ new Map());
41643
+ const scorerMap = bucketMap.get(bucket);
41644
+ if (!scorerMap.has(s.scorerId)) scorerMap.set(s.scorerId, []);
41645
+ scorerMap.get(s.scorerId).push(s.score);
41646
+ }
41647
+ const overTimeData = Array.from(bucketMap.entries()).sort(([a], [b]) => a - b).map(([bucket, scorerMap]) => {
41648
+ const point = {
41649
+ time: new Date(bucket).toLocaleTimeString("en-US", {
41650
+ hour: "2-digit",
41651
+ minute: "2-digit",
41652
+ hour12: false
41653
+ })
41654
+ };
41655
+ for (const name of scorerNames) {
41656
+ const vals = scorerMap.get(name);
41657
+ if (vals && vals.length > 0) {
41658
+ point[name] = +(vals.reduce((a, b) => a + b, 0) / vals.length).toFixed(2);
41659
+ }
41660
+ }
41661
+ return point;
41662
+ });
41663
+ return {
41664
+ summaryData,
41665
+ overTimeData,
41666
+ scorerNames,
41667
+ avgScore: Math.round(avgScore * 100) / 100
41668
+ };
41669
+ }
41670
+ });
41671
+ }
41672
+
41673
+ const SERIES_COLORS = [
41674
+ CHART_COLORS.green,
41675
+ CHART_COLORS.blue,
41676
+ CHART_COLORS.purple,
41677
+ CHART_COLORS.orange,
41678
+ CHART_COLORS.pink,
41679
+ CHART_COLORS.yellow
41680
+ ];
41681
+ function ScoresCard() {
41682
+ const { data, isLoading, isError } = useScoresMetrics();
41683
+ const hasData = !!data && data.summaryData.length > 0;
41684
+ const series = useMemo(() => {
41685
+ if (!data?.scorerNames) return [];
41686
+ return data.scorerNames.map((name, i) => ({
41687
+ dataKey: name,
41688
+ label: name,
41689
+ color: SERIES_COLORS[i % SERIES_COLORS.length],
41690
+ aggregate: (points) => ({
41691
+ value: points.length > 0 ? (points.reduce((s, d) => s + (d[name] ?? 0), 0) / points.length).toFixed(2) : "0",
41692
+ suffix: "avg"
41693
+ })
41694
+ }));
41695
+ }, [data?.scorerNames]);
41696
+ return /* @__PURE__ */ jsxs(MetricsCard, { children: [
41697
+ /* @__PURE__ */ jsxs(MetricsCard.TopBar, { children: [
41698
+ /* @__PURE__ */ jsx(MetricsCard.TitleAndDescription, { title: "Scores", description: "Evaluation scorer performance." }),
41699
+ hasData && /* @__PURE__ */ jsx(
41700
+ MetricsCard.Summary,
41701
+ {
41702
+ value: data?.avgScore != null ? `avg ${data.avgScore}` : "—",
41703
+ label: "Across all scorers"
41704
+ }
41705
+ )
41706
+ ] }),
41707
+ isLoading ? /* @__PURE__ */ jsx(MetricsCard.Loading, {}) : isError ? /* @__PURE__ */ jsx(MetricsCard.Error, { message: "Failed to load scores data" }) : /* @__PURE__ */ jsx(MetricsCard.Content, { children: !hasData ? /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No scores data yet" }) : /* @__PURE__ */ jsxs(Tabs, { defaultTab: "over-time", className: "overflow-visible", children: [
41708
+ /* @__PURE__ */ jsxs(TabList, { children: [
41709
+ /* @__PURE__ */ jsx(Tab, { value: "over-time", children: "Over Time" }),
41710
+ /* @__PURE__ */ jsx(Tab, { value: "summary", children: "Summary" })
41711
+ ] }),
41712
+ /* @__PURE__ */ jsx(TabContent, { value: "over-time", children: data.overTimeData.length > 0 ? /* @__PURE__ */ jsx(MetricsLineChart, { data: data.overTimeData, series, yDomain: [0, 1] }) : /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No time series data yet" }) }),
41713
+ /* @__PURE__ */ jsx(TabContent, { value: "summary", children: /* @__PURE__ */ jsx(
41714
+ MetricsDataTable,
41715
+ {
41716
+ columns: [
41717
+ { label: "Scorer", value: (row) => row.scorer },
41718
+ { label: "Avg", value: (row) => row.avg.toFixed(2), highlight: true },
41719
+ { label: "Min", value: (row) => row.min.toFixed(2) },
41720
+ { label: "Max", value: (row) => row.max.toFixed(2) },
41721
+ { label: "Count", value: (row) => row.count.toLocaleString() }
41722
+ ],
41723
+ data: data.summaryData.map((row) => ({ ...row, key: row.scorer }))
41724
+ }
41725
+ ) })
41726
+ ] }) })
41727
+ ] });
41728
+ }
41729
+
41730
+ function useTokenUsageByAgentMetrics() {
41731
+ const client = useMastraClient();
41732
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41733
+ return useQuery({
41734
+ queryKey: ["metrics", "token-usage-by-agent", datePreset, customRange],
41735
+ queryFn: async () => {
41736
+ const [inputRes, outputRes] = await Promise.all([
41737
+ client.getMetricBreakdown({
41738
+ name: ["mastra_model_total_input_tokens"],
41739
+ groupBy: ["entityName"],
41740
+ aggregation: "sum",
41741
+ filters: { timestamp }
41742
+ }),
41743
+ client.getMetricBreakdown({
41744
+ name: ["mastra_model_total_output_tokens"],
41745
+ groupBy: ["entityName"],
41746
+ aggregation: "sum",
41747
+ filters: { timestamp }
41748
+ })
41749
+ ]);
41750
+ const agentMap = /* @__PURE__ */ new Map();
41751
+ const ensure = (name) => {
41752
+ if (!agentMap.has(name)) {
41753
+ agentMap.set(name, { input: 0, output: 0 });
41754
+ }
41755
+ return agentMap.get(name);
41756
+ };
41757
+ for (const group of inputRes.groups) {
41758
+ const name = group.dimensions.entityName ?? "unknown";
41759
+ ensure(name).input = group.value;
41760
+ }
41761
+ for (const group of outputRes.groups) {
41762
+ const name = group.dimensions.entityName ?? "unknown";
41763
+ ensure(name).output = group.value;
41764
+ }
41765
+ return Array.from(agentMap.entries()).map(([name, vals]) => ({
41766
+ name,
41767
+ input: vals.input,
41768
+ output: vals.output,
41769
+ total: vals.input + vals.output
41770
+ })).sort((a, b) => b.total - a.total);
41771
+ }
41772
+ });
41773
+ }
41774
+
41775
+ function HorizontalBars({
41776
+ data,
41777
+ segments,
41778
+ maxVal,
41779
+ fmt,
41780
+ className
41781
+ }) {
41782
+ const sorted = [...data].sort((a, b) => {
41783
+ const totalB = b.values.reduce((s, v) => s + v, 0);
41784
+ const totalA = a.values.reduce((s, v) => s + v, 0);
41785
+ return totalB - totalA;
41786
+ });
41787
+ const isStacked = segments.length > 1;
41788
+ return /* @__PURE__ */ jsxs(ScrollArea, { className: cn("w-full h-full", className), children: [
41789
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 mb-4 mt-2", children: [
41790
+ /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center gap-4", children: segments.map((seg) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
41791
+ /* @__PURE__ */ jsx("div", { className: "size-2 rounded-full", style: { backgroundColor: seg.color } }),
41792
+ /* @__PURE__ */ jsx("span", { className: "text-ui-sm text-neutral3", children: seg.label })
41793
+ ] }, seg.label)) }),
41794
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-ui-sm text-neutral2 pr-2", children: "Total" })
41795
+ ] }),
41796
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3.5", children: sorted.map((d) => {
41797
+ const total = d.values.reduce((s, v) => s + v, 0);
41798
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-14 h-6 ", children: [
41799
+ /* @__PURE__ */ jsxs("div", { className: "relative h-full flex-1 min-w-0", children: [
41800
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
41801
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
41802
+ "div",
41803
+ {
41804
+ className: "absolute inset-y-0 left-0 cursor-default",
41805
+ style: { width: `${maxVal > 0 ? total / maxVal * 100 : 0}%` },
41806
+ children: segments.map((seg, si) => {
41807
+ const val = d.values[si] ?? 0;
41808
+ const pct = total > 0 ? val / total * 100 : 0;
41809
+ const left = d.values.slice(0, si).reduce((s, v) => s + (total > 0 ? v / total * 100 : 0), 0);
41810
+ const isLastWithValue = d.values.slice(si + 1).every((v) => !v);
41811
+ if (isStacked) {
41812
+ return /* @__PURE__ */ jsx(
41813
+ "div",
41814
+ {
41815
+ className: cn(
41816
+ "absolute inset-y-0",
41817
+ si === 0 && "rounded-l",
41818
+ isLastWithValue && "rounded-r"
41819
+ ),
41820
+ style: {
41821
+ left: `${left}%`,
41822
+ width: `${pct}%`,
41823
+ backgroundColor: seg.color
41824
+ }
41825
+ },
41826
+ seg.label
41827
+ );
41828
+ }
41829
+ return /* @__PURE__ */ jsx(
41830
+ "div",
41831
+ {
41832
+ className: "absolute inset-y-0 left-0 rounded",
41833
+ style: { width: `${pct}%`, backgroundColor: seg.color }
41834
+ },
41835
+ seg.label
41836
+ );
41837
+ })
41838
+ }
41839
+ ) }),
41840
+ /* @__PURE__ */ jsx(TooltipContent, { side: "top", className: "font-mono", children: /* @__PURE__ */ jsx("div", { className: "grid gap-1", children: segments.map((seg, si) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
41841
+ /* @__PURE__ */ jsx("span", { children: seg.label }),
41842
+ /* @__PURE__ */ jsx("span", { className: "ml-auto pl-3", children: fmt(d.values[si] ?? 0) })
41843
+ ] }, seg.label)) }) })
41844
+ ] }),
41845
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-2.5 flex items-center text-ui-sm text-neutral4 truncate z-10 pointer-events-none", children: d.name })
41846
+ ] }),
41847
+ /* @__PURE__ */ jsx("span", { className: "text-ui-md text-neutral4 tabular-nums shrink-0 pr-3", children: fmt(total) })
41848
+ ] }, d.name);
41849
+ }) })
41850
+ ] });
41851
+ }
41852
+
41853
+ function TokenUsageByAgentCard() {
41854
+ const { data, isLoading, isError } = useTokenUsageByAgentMetrics();
41855
+ const hasData = !!data && data.length > 0;
41856
+ const totalTokens = data?.reduce((s, d) => s + d.total, 0) ?? 0;
41857
+ return /* @__PURE__ */ jsxs(MetricsCard, { children: [
41858
+ /* @__PURE__ */ jsxs(MetricsCard.TopBar, { children: [
41859
+ /* @__PURE__ */ jsx(
41860
+ MetricsCard.TitleAndDescription,
41861
+ {
41862
+ title: "Token Usage by Agent",
41863
+ description: "Token consumption grouped by agent."
41864
+ }
41865
+ ),
41866
+ hasData && /* @__PURE__ */ jsx(MetricsCard.Summary, { value: formatCompact(totalTokens), label: "Total tokens" })
41867
+ ] }),
41868
+ isLoading ? /* @__PURE__ */ jsx(MetricsCard.Loading, {}) : isError ? /* @__PURE__ */ jsx(MetricsCard.Error, { message: "Failed to load token usage data" }) : /* @__PURE__ */ jsx(MetricsCard.Content, { children: !hasData ? /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No token usage data yet" }) : /* @__PURE__ */ jsxs(Tabs, { defaultTab: "tokens", className: "grid grid-rows-[auto_1fr] overflow-y-auto h-full", children: [
41869
+ /* @__PURE__ */ jsx(TabList, { children: /* @__PURE__ */ jsx(Tab, { value: "tokens", children: "Tokens" }) }),
41870
+ /* @__PURE__ */ jsx(TabContent, { value: "tokens", children: /* @__PURE__ */ jsx(
41871
+ HorizontalBars,
41872
+ {
41873
+ data: data.map((d) => ({ name: d.name, values: [d.input, d.output] })),
41874
+ segments: [
41875
+ { label: "Input", color: CHART_COLORS.blueDark },
41876
+ { label: "Output", color: CHART_COLORS.blue }
41877
+ ],
41878
+ maxVal: Math.max(...data.map((d) => d.input + d.output)),
41879
+ fmt: formatCompact
41880
+ }
41881
+ ) })
41882
+ ] }) })
41883
+ ] });
41884
+ }
41885
+
41886
+ async function fetchVolume(client, metricName, timestamp) {
41887
+ const res = await client.getMetricBreakdown({
41888
+ name: [metricName],
41889
+ groupBy: ["entityName", "status"],
41890
+ aggregation: "count",
41891
+ filters: { timestamp }
41892
+ });
41893
+ const map = /* @__PURE__ */ new Map();
41894
+ for (const group of res.groups) {
41895
+ const name = group.dimensions.entityName ?? "unknown";
41896
+ const status = group.dimensions.status ?? "ok";
41897
+ if (!map.has(name)) {
41898
+ map.set(name, { completed: 0, errors: 0 });
41899
+ }
41900
+ const entry = map.get(name);
41901
+ if (status === "error") {
41902
+ entry.errors += group.value;
41903
+ } else {
41904
+ entry.completed += group.value;
41905
+ }
41906
+ }
41907
+ return Array.from(map.entries()).map(([name, vals]) => ({ name, ...vals })).sort((a, b) => b.completed + b.errors - (a.completed + a.errors));
41908
+ }
41909
+ function useTraceVolumeMetrics() {
41910
+ const client = useMastraClient();
41911
+ const { datePreset, customRange, timestamp } = useMetricsFilters();
41912
+ return useQuery({
41913
+ queryKey: ["metrics", "trace-volume", datePreset, customRange],
41914
+ queryFn: async () => {
41915
+ const [agentData, workflowData, toolData] = await Promise.all([
41916
+ fetchVolume(client, "mastra_agent_duration_ms", timestamp),
41917
+ fetchVolume(client, "mastra_workflow_duration_ms", timestamp),
41918
+ fetchVolume(client, "mastra_tool_duration_ms", timestamp)
41919
+ ]);
41920
+ return { agentData, workflowData, toolData };
41921
+ }
41922
+ });
41923
+ }
41924
+
41925
+ function VolumeBars({ data }) {
41926
+ return /* @__PURE__ */ jsx(
41927
+ HorizontalBars,
41928
+ {
41929
+ data: data.map((d) => ({ name: d.name, values: [d.completed, d.errors] })),
41930
+ segments: [
41931
+ { label: "Completed", color: CHART_COLORS.blueDark },
41932
+ { label: "Errors", color: CHART_COLORS.pink }
41933
+ ],
41934
+ maxVal: Math.max(...data.map((d) => d.completed + d.errors)),
41935
+ fmt: formatCompact
41936
+ }
41937
+ );
41938
+ }
41939
+ function TracesVolumeCard() {
41940
+ const { data, isLoading, isError } = useTraceVolumeMetrics();
41941
+ const hasData = !!data && (data.agentData.length > 0 || data.workflowData.length > 0 || data.toolData.length > 0);
41942
+ const total = data ? [...data.agentData, ...data.workflowData, ...data.toolData].reduce((s, d) => s + d.completed + d.errors, 0) : 0;
41943
+ return /* @__PURE__ */ jsxs(MetricsCard, { children: [
41944
+ /* @__PURE__ */ jsxs(MetricsCard.TopBar, { children: [
41945
+ /* @__PURE__ */ jsx(MetricsCard.TitleAndDescription, { title: "Trace Volume", description: "Runs and call counts." }),
41946
+ hasData && /* @__PURE__ */ jsx(MetricsCard.Summary, { value: formatCompact(total), label: "Total runs" })
41947
+ ] }),
41948
+ isLoading ? /* @__PURE__ */ jsx(MetricsCard.Loading, {}) : isError ? /* @__PURE__ */ jsx(MetricsCard.Error, { message: "Failed to load trace volume data" }) : /* @__PURE__ */ jsx(MetricsCard.Content, { children: !hasData ? /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No trace volume data yet" }) : /* @__PURE__ */ jsxs(Tabs, { defaultTab: "agents", className: "grid grid-rows-[auto_1fr] overflow-y-auto h-full", children: [
41949
+ /* @__PURE__ */ jsxs(TabList, { children: [
41950
+ /* @__PURE__ */ jsx(Tab, { value: "agents", children: "Agents" }),
41951
+ /* @__PURE__ */ jsx(Tab, { value: "workflows", children: "Workflows" }),
41952
+ /* @__PURE__ */ jsx(Tab, { value: "tools", children: "Tools" })
41953
+ ] }),
41954
+ /* @__PURE__ */ jsx(TabContent, { value: "agents", children: data.agentData.length > 0 ? /* @__PURE__ */ jsx(VolumeBars, { data: data.agentData }) : /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No agent data yet" }) }),
41955
+ /* @__PURE__ */ jsx(TabContent, { value: "workflows", children: data.workflowData.length > 0 ? /* @__PURE__ */ jsx(VolumeBars, { data: data.workflowData }) : /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No workflow data yet" }) }),
41956
+ /* @__PURE__ */ jsx(TabContent, { value: "tools", children: data.toolData.length > 0 ? /* @__PURE__ */ jsx(VolumeBars, { data: data.toolData }) : /* @__PURE__ */ jsx(MetricsCard.NoData, { message: "No tool data yet" }) })
41957
+ ] }) })
41958
+ ] });
41959
+ }
41960
+
41961
+ function MetricsFlexGrid({ children, className }) {
41962
+ return /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap gap-8", className), children });
41963
+ }
41964
+
41965
+ const ANALYTICS_OBSERVABILITY_TYPES = /* @__PURE__ */ new Set([
41966
+ // 'ObservabilityStorageClickhouse',
41967
+ // 'ObservabilityStorageDuckDB',
41968
+ "ObservabilityInMemory"
41969
+ ]);
41970
+ function MetricsDashboard() {
41971
+ const { data, isLoading } = useMastraPackages();
41972
+ const observabilityType = data?.observabilityStorageType;
41973
+ const supportsMetrics = observabilityType ? ANALYTICS_OBSERVABILITY_TYPES.has(observabilityType) : false;
41974
+ const isInMemory = observabilityType === "ObservabilityInMemory";
41975
+ if (isLoading) {
41976
+ return null;
41977
+ }
41978
+ if (!supportsMetrics) {
41979
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(
41980
+ EmptyState$1,
41981
+ {
41982
+ iconSlot: /* @__PURE__ */ jsx(CircleSlashIcon, {}),
41983
+ titleSlot: "Metrics are not available with your current storage",
41984
+ descriptionSlot: "Metrics currently require in-memory storage for observability. ClickHouse and DuckDB support is coming soon. Relational databases (PostgreSQL, LibSQL) do not support metrics collection. To enable metrics on an existing project, switch the observability storage in the Mastra configuration.",
41985
+ actionSlot: /* @__PURE__ */ jsxs(
41986
+ Button,
41987
+ {
41988
+ variant: "ghost",
41989
+ as: "a",
41990
+ href: "https://mastra.ai/en/docs/observability/metrics",
41991
+ target: "_blank",
41992
+ rel: "noopener noreferrer",
41993
+ children: [
41994
+ "Metrics Documentation ",
41995
+ /* @__PURE__ */ jsx(ExternalLinkIcon, {})
41996
+ ]
41997
+ }
41998
+ )
41999
+ }
42000
+ ) });
42001
+ }
42002
+ return /* @__PURE__ */ jsxs("div", { className: "grid gap-8 content-start pb-10", children: [
42003
+ isInMemory && /* @__PURE__ */ jsxs(Alert, { variant: "info", children: [
42004
+ /* @__PURE__ */ jsx(AlertTitle, { children: "Metrics are not persisted" }),
42005
+ /* @__PURE__ */ jsx(AlertDescription, { as: "p", children: "This project uses in-memory storage for observability. Metrics will be lost on every server restart. For persistent metrics, switch the observability storage to ClickHouse or DuckDB." })
42006
+ ] }),
42007
+ /* @__PURE__ */ jsxs(MetricsFlexGrid, { children: [
42008
+ /* @__PURE__ */ jsx(AgentRunsKpiCard, {}),
42009
+ /* @__PURE__ */ jsx(TotalTokensKpiCard, {}),
42010
+ /* @__PURE__ */ jsx(AvgScoreKpiCard, {})
42011
+ ] }),
42012
+ /* @__PURE__ */ jsxs(MetricsFlexGrid, { children: [
42013
+ /* @__PURE__ */ jsx(ModelUsageCostCard, {}),
42014
+ /* @__PURE__ */ jsx(TokenUsageByAgentCard, {}),
42015
+ /* @__PURE__ */ jsx(ScoresCard, {}),
42016
+ /* @__PURE__ */ jsx(TracesVolumeCard, {}),
42017
+ /* @__PURE__ */ jsx(LatencyCard, {})
42018
+ ] })
42019
+ ] });
42020
+ }
42021
+
42022
+ const DATE_PRESETS = [
42023
+ { label: "Last 24 hours", value: "24h" },
42024
+ { label: "Last 3 days", value: "3d" },
42025
+ { label: "Last 7 days", value: "7d" },
42026
+ { label: "Last 14 days", value: "14d" },
42027
+ { label: "Last 30 days", value: "30d" }
42028
+ ];
42029
+ function DateRangeSelector() {
42030
+ const { datePreset, setDatePreset } = useMetrics();
42031
+ return /* @__PURE__ */ jsx(
42032
+ SelectFieldBlock,
42033
+ {
42034
+ name: "date-range",
42035
+ labelIsHidden: true,
42036
+ value: datePreset,
42037
+ options: DATE_PRESETS,
42038
+ onValueChange: (value) => setDatePreset(value)
42039
+ }
42040
+ );
42041
+ }
42042
+
40830
42043
  function groupTracesByThread(traces) {
40831
42044
  const threadMap = /* @__PURE__ */ new Map();
40832
42045
  const ungrouped = [];
@@ -42028,6 +43241,7 @@ function DatasetsList({ datasets, isLoading, error, search = "" }) {
42028
43241
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Version" }),
42029
43242
  /* @__PURE__ */ jsx(EntityList.TopCell, { className: "text-center", children: "Created" })
42030
43243
  ] }),
43244
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No Datasets match your search" }) : null,
42031
43245
  filteredData.map((ds) => {
42032
43246
  const name = truncateString(ds.name, 50);
42033
43247
  const description = truncateString(ds.description ?? "", 200);
@@ -49025,6 +50239,7 @@ function McpServersList({ mcpServers, isLoading, error, search = "" }) {
49025
50239
  }
49026
50240
  )
49027
50241
  ] }),
50242
+ filteredData.length === 0 && search ? /* @__PURE__ */ jsx(EntityList.NoMatch, { message: "No MCP Servers match your search" }) : null,
49028
50243
  filteredData.map((server) => /* @__PURE__ */ jsx(McpServerRow, { server }, server.id))
49029
50244
  ] });
49030
50245
  }
@@ -49938,7 +51153,7 @@ function SkillsTable({
49938
51153
  /* @__PURE__ */ jsx(EntryList.Header, { columns: effectiveColumns }),
49939
51154
  skills.length > 0 ? /* @__PURE__ */ jsx(EntryList.Entries, { children: skills.map((skill) => {
49940
51155
  const entry = {
49941
- id: skill.name,
51156
+ id: skill.path,
49942
51157
  name: skill.name,
49943
51158
  description: skill.description || "—"
49944
51159
  };
@@ -49949,7 +51164,7 @@ function SkillsTable({
49949
51164
  entry,
49950
51165
  columns: effectiveColumns,
49951
51166
  onClick: () => {
49952
- const url = `${basePath}/${encodeURIComponent(skill.name)}`;
51167
+ const url = `${basePath}/${encodeURIComponent(skill.name)}?path=${encodeURIComponent(skill.path)}`;
49953
51168
  navigate(url);
49954
51169
  },
49955
51170
  children: [
@@ -49984,7 +51199,7 @@ function SkillsTable({
49984
51199
  ] }) })
49985
51200
  ]
49986
51201
  },
49987
- skill.name
51202
+ skill.path
49988
51203
  );
49989
51204
  }) }) : /* @__PURE__ */ jsx(
49990
51205
  EntryList.Message,
@@ -51166,5 +52381,5 @@ const NavigationCommand = () => {
51166
52381
  );
51167
52382
  };
51168
52383
 
51169
- export { AGENT_CMS_SECTIONS, ActionsMenu, ActivatedSkillsProvider, AddField, AddItemDialog, AddItemsToDatasetDialog, AddSkillDialog, AgentCMSBlock, AgentCMSBlocks, AgentCMSRefBlock, AgentChat, AgentCmsBottomBar, AgentCmsFormShell, AgentCmsSidebar, AgentCoinIcon, AgentCombobox, AgentEditFormProvider, AgentEditLayout, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataCombinedProcessorList, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataSkillList, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWorkspaceToolsList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPageTabs, AgentPlaygroundConfig, AgentPlaygroundEvaluate, AgentPlaygroundRequestContext, AgentPlaygroundReview, AgentPlaygroundTestChat, AgentPlaygroundVersionBar, AgentPlaygroundView, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentTopBarControls, AgentTracesPanel, AgentVersionCombobox, AgentVersionPanel, AgentsCmsLayout, AgentsList, AgentsPage, AgentsSection, AgentsTable, AiIcon, Alert, AlertDescription, AlertDialog, AlertTitle, ApiIcon, AuthRequired, AuthStatus, AutoForm, Avatar, Badge, BranchIcon, Breadcrumb$1 as Breadcrumb, Button, ButtonWithTooltip, ButtonsGroup, CODE_AGENT_OVERRIDE_SECTIONS, CSVImportDialog, Cell, ChatThreads, CheckIcon, Checkbox, ChevronIcon, Chip, ChipsGroup, CodeDiff, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Columns, CombinedButtons, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommitIcon, ComposerModelSwitcher, ContentBlock, ContentBlocks, CopyButton, CreateDatasetDialog, CreateDatasetFromItemsDialog, CrossIcon, Crumb, DatasetCombobox, DatasetCompareVersionToolbar, DatasetCompareVersionsList, DatasetExperiments, DatasetExperimentsComparison, DatasetItemContent, DatasetItemHeader, DatasetItemVersionsPanel, DatasetItemsList, DatasetPageContent, DatasetVersionsPanel, DatasetsList, DatasetsTable, DatePicker, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeleteDatasetDialog, DeploymentIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayConditionsDialog, DividerIcon, DocsIcon, DuplicateDatasetDialog, DynamicForm, EditDatasetDialog, EditModeContent, ElementSelect, EmptyDatasetsTable, EmptyState$1 as EmptyState, Entity, EntityAccordionItem, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityList, EntityListPageLayout, EntityListSkeleton, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, ErrorState, ExperimentPageContent, ExperimentPageHeader, ExperimentResultSpanPane, ExperimentResultTracePanel, ExperimentResultsPanel, ExperimentStats, ExperimentTriggerDialog, Field, FieldDescription, FieldList, FieldName, FieldNullable, FieldOptional, FieldRemove, FieldType, FileBrowser, FileViewer, FiltersIcon, FolderIcon, GenerationProvider, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, HoverPopover, Icon, InfoIcon, InformationPage, Input, InstructionBlocksPage, IntegrationToolsSection, ItemList, ItemListSkeleton, ItemPageToolbar, JSONImportDialog, JSONSchemaForm, JudgeIcon, Kbd, KeyValueList, LLMModels, LLMProviders, Label, LatencyIcon, LinkComponentProvider, ListSearch, LoginButton, LoginPage, LogoWithoutText, LogsIcon, MCPClientCreateContent, MCPClientEditLayout, MCPClientFormSidebar, MCPClientList, MCPClientToolPreview, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainHeader, MainSidebar, MainSidebarProvider, MarkdownRenderer, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, McpServersList, MemoryIcon, MemoryPage, MemorySearch, MemorySection, MultiColumn, MultiCombobox, NavigationCommand, NestedFields, Notice, Notification, OPERATORS, OPERATOR_LABELS, ObservationalMemoryProvider, OpenAIIcon, PER_PAGE$2 as PER_PAGE, PageHeader, PermissionDenied, PlaygroundConfigGuard, PlaygroundModelProvider, PlaygroundQueryClient, Popover, PopoverContent, PopoverTrigger, ProcessStepList, ProcessStepListItem, ProcessStepProgressBar, ProcessorCombobox, ProcessorIcon, ProcessorPanel, ProcessorTable, ProcessorsList, PromptBlockCreateContent, PromptBlockEditMain, PromptBlockEditSidebar, PromptBlockPickerDialog, PromptBlockVersionCombobox, PromptBlocksTable, PromptIcon, PromptsList, ProviderLogo, RadioGroup, RadioGroupItem, ReferenceViewerDialog, RepoIcon, RequestContext, RequestContextSchemaForm, RequestContextWrapper, ReviewQueueProvider, Root, Row, RuleBuilder, RuleFieldSelect, RuleOperatorSelect, RuleRow, RuleValueInput, STORED_SCORER_TYPES, SchemaRequestContext, SchemaRequestContextProvider, ScoreAsItemDialog, ScoreDelta, ScoreDialog, ScorerCombobox, ScorerCreateContent, ScorerEditMain, ScorerEditSidebar, ScorerSelector, ScorerVersionCombobox, ScorersList, ScorersPage, ScorersSection, ScorersTable, ScoresList, ScoresTools, ScrollArea, ScrollBar, SearchSkillsPanel, SearchWorkspacePanel, Searchbar, SearchbarWrapper, Section, SectionHeader, Sections, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectTrigger, SelectValue, SettingsIcon, ShadcnAutoFormFieldComponents, SideDialog, Skeleton, SkillDetail, SkillIcon, SkillRemoveButton, SkillUpdateButton, SkillsNotConfigured, SkillsPage, SkillsTable, SlashIcon, Slider, SpanScoreList, SpanScoring, SpanTabs, Spinner, StudioConfigContext, StudioConfigForm, StudioConfigProvider, SubSectionHeader, Switch, Tab, TabContent, TabList, Table, Tabs, TargetSelector, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, TimePicker, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolList, ToolPanel, ToolProviderDialog, ToolTable, ToolkitList, ToolsIcon, ToolsList, ToolsPage, ToolsSection, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceAsItemDialog, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracingSettingsContext, TracingSettingsProvider, Tree, Truncate, TsIcon, Txt, TxtCell, UserAvatar, UserMenu, VARIABLE_PATTERN, VariablesIcon, VariablesPage, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkflowsList, WorkflowsPage, WorkflowsSection, WorkingMemoryContext, WorkingMemoryProvider, WorkspaceNotConfigured, agentFormSchema, arrayToRecord, buildObservationalMemoryForApi, buttonVariants, cleanProviderId, cn, collectMCPClientIds, columns$6 as columns, comboboxStyles, computeAgentInitialValues, convertWorkflowRunStateToStreamResult, countLeafRules, createDefaultRule, createDefaultRuleGroup, createField, createInstructionBlock, createRefInstructionBlock, createVariableAutocomplete, exportItemsToCSV, exportItemsToJSON, extractPrompt, fieldConfig, fieldsToJSONSchema, findProviderById, flattenSchemaToVariables, formatHierarchicalSpans, getChildFieldOptions, getColumnTemplate, getFieldOptionAtPath, getFieldOptionsFromSchema, getItemListColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getStatusIcon, getToNextEntryFn, getToNextItemFn, getToPreviousEntryFn, getToPreviousItemFn, getWorkflowRunsNextPageParam, groupTracesByThread, highlight, inputVariants, is403ForbiddenError, isActive, isAuthenticated, isRule, isRuleGroup, isWorkspaceV1Supported, joinModelId, jsonSchemaToFields, makeAuthCapabilitiesRequest, makeLogoutRequest, makeSSOLoginRequest, mapAgentResponseToDataSource, mapInstructionBlocksFromApi, mapInstructionBlocksToApi, mapScorersToApi, normalizeIntegrationToolsToRecord, normalizeScorersFromApi, normalizeSkillsFromApi, normalizeToolsToRecord, normalizeWorkspaceFromApi, parseError, parseFieldPath, parseJSONCell, parseObservationalMemoryFromApi, parseRow, parseSkillSource, promptBlockFormSchema, providerMapToIcon, removeEmptyValues, resolveSerializedZodOutput, scorerFormSchema, scoresListColumns, selectUniqueRuns, shouldRetryQuery, spanTypePrefixes$1 as spanTypePrefixes, splitModelId, toast, traceScoresListColumns, tracesListColumns, transformIntegrationToolsForApi, useActivateAgentVersion, useActivatePromptBlockVersion, useActivateScorerVersion, useActivatedSkills, useAgent, useAgentCmsForm, useAgentCmsNavigation, useAgentEditForm, useAgentEditFormContext, useAgentExperiments, useAgentInformationTab, useAgentSettings, useAgentSkill, useAgentVersion, useAgentVersions, useAgents, useAllIntegrationTools, useAllModels, useAuthCapabilities, useCSVParser, useCloneThread, useCodemirrorTheme$1 as useCodemirrorTheme, useCompareAgentVersions, useCompareExperiments, useCompareScorerVersions, useCreateAgentVersion, useCreatePromptBlockVersion, useCreateScorerVersion, useCreateSkill, useCreateWorkspaceDirectory, useCredentialsLogin, useCredentialsSignUp, useCurrentRun, useCurrentUser, useDataset, useDatasetExperiment, useDatasetExperimentResults, useDatasetExperiments, useDatasetItem, useDatasetItemVersion, useDatasetItemVersions, useDatasetItems, useDatasetMutations, useDatasetVersions, useDatasets, useDeleteAgentVersion, useDeletePromptBlockVersion, useDeleteScorerVersion, useDeleteThread, useDeleteWorkflowRun, useDeleteWorkspaceFile, useExecuteAgentTool, useExecuteMCPTool, useExecuteProcessor, useExecuteTool, useExperimentalFeatures, useFilteredModels, useFilteredProviders, useGenerationTasks, useHasObservability, useInView, useIndexWorkspaceContent, useInstallSkill, useIsCmsAvailable, useItemSelection, useJSONParser, useJSONSchemaForm, useJSONSchemaFormField, useJSONSchemaFormNestedContext, useLLMProviders, useLinkComponent, useLogout, useMCPServerTool, useMCPServerTools, useMCPServerToolsById, useMCPServers, useMainSidebar, useMastraPackages, useMastraPlatform, useMaybeSidebar, useMemory, useMemoryConfig, useMemorySearch, useMemoryWithOMStatus, useMergedRequestContext, useNavigationCommand, useObservationalMemory, useObservationalMemoryContext, useOptionalAgentEditFormContext, usePackageUpdates, usePermissions, usePlaygroundModel, usePlaygroundStore, usePopularSkillsSh, useProcessor, useProcessors, usePromptBlockEditForm, usePromptBlockVersion, usePromptBlockVersions, useProviderTools, useRemoveSkill, useReorderModelList, useRequestContextPresets, useResetAgentModel, useRestoreAgentVersion, useRestorePromptBlockVersion, useRestoreScorerVersion, useReviewQueue, useSSOLogin, useSchemaRequestContext, useScorer, useScorerEditForm, useScorerVersion, useScorerVersions, useScorers, useScoresByExperimentId, useScoresByScorerId, useSearchSkillsSh, useSearchWorkspace, useSearchWorkspaceSkills, useSkillPreview, useSpeechRecognition, useStoredAgent, useStoredAgentMutations, useStoredAgents, useStoredPromptBlock, useStoredPromptBlockMutations, useStoredPromptBlocks, useStoredScorer, useStoredScorerMutations, useStoredSkills, useStudioConfig, useTableKeyboardNavigation, useThread, useThreadInput, useThreads, useTool, useToolProviders, useToolkits, useTools, useTraceSpanScores, useTracingSettings, useTryConnectMcp, useUpdateAgentModel, useUpdateModelInModelList, useUpdateSkills, useWorkflow, useWorkflowRun, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory, useWorkspaceFile, useWorkspaceFileStat, useWorkspaceFiles, useWorkspaceInfo, useWorkspaceSkill, useWorkspaceSkillReference, useWorkspaceSkillReferences, useWorkspaceSkills, useWorkspaces, useWriteWorkspaceFile, useWriteWorkspaceFileFromFile, validateCsvRows, validateJSONData, validateMappedData, variableHighlight };
52384
+ export { AGENT_CMS_SECTIONS, ActionsMenu, ActivatedSkillsProvider, AddField, AddItemDialog, AddItemsToDatasetDialog, AddSkillDialog, AgentCMSBlock, AgentCMSBlocks, AgentCMSRefBlock, AgentChat, AgentCmsBottomBar, AgentCmsFormShell, AgentCmsSidebar, AgentCoinIcon, AgentCombobox, AgentEditFormProvider, AgentEditLayout, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataCombinedProcessorList, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataSkillList, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWorkspaceToolsList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPageTabs, AgentPlaygroundConfig, AgentPlaygroundEvaluate, AgentPlaygroundRequestContext, AgentPlaygroundReview, AgentPlaygroundTestChat, AgentPlaygroundVersionBar, AgentPlaygroundView, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentTopBarControls, AgentTracesPanel, AgentVersionCombobox, AgentVersionPanel, AgentsCmsLayout, AgentsList, AgentsPage, AgentsSection, AgentsTable, AiIcon, Alert, AlertDescription, AlertDialog, AlertTitle, ApiIcon, AuthRequired, AuthStatus, AutoForm, Avatar, Badge, BranchIcon, Breadcrumb$1 as Breadcrumb, Button, ButtonWithTooltip, ButtonsGroup, CHART_COLORS, CODE_AGENT_OVERRIDE_SECTIONS, CSVImportDialog, Cell, ChatThreads, CheckIcon, Checkbox, ChevronIcon, Chip, ChipsGroup, CodeDiff, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Columns, CombinedButtons, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommitIcon, ComposerModelSwitcher, ContentBlock, ContentBlocks, CopyButton, CreateDatasetDialog, CreateDatasetFromItemsDialog, CrossIcon, Crumb, DatasetCombobox, DatasetCompareVersionToolbar, DatasetCompareVersionsList, DatasetExperiments, DatasetExperimentsComparison, DatasetItemContent, DatasetItemHeader, DatasetItemVersionsPanel, DatasetItemsList, DatasetPageContent, DatasetVersionsPanel, DatasetsList, DatasetsTable, DatePicker, DateRangeSelector, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeleteDatasetDialog, DeploymentIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayConditionsDialog, DividerIcon, DocsIcon, DuplicateDatasetDialog, DynamicForm, EditDatasetDialog, EditModeContent, ElementSelect, EmptyDatasetsTable, EmptyState$1 as EmptyState, Entity, EntityAccordionItem, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityList, EntityListPageLayout, EntityListSkeleton, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, ErrorState, ExperimentPageContent, ExperimentPageHeader, ExperimentResultSpanPane, ExperimentResultTracePanel, ExperimentResultsPanel, ExperimentStats, ExperimentTriggerDialog, Field, FieldDescription, FieldList, FieldName, FieldNullable, FieldOptional, FieldRemove, FieldType, FileBrowser, FileViewer, FiltersIcon, FolderIcon, GenerationProvider, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, HorizontalBars, HoverPopover, Icon, InfoIcon, InformationPage, Input, InstructionBlocksPage, IntegrationToolsSection, ItemList, ItemListSkeleton, ItemPageToolbar, JSONImportDialog, JSONSchemaForm, JudgeIcon, Kbd, KeyValueList, LLMModels, LLMProviders, Label, LatencyCard, LatencyIcon, LinkComponentProvider, ListSearch, LoginButton, LoginPage, LogoWithoutText, LogsIcon, MCPClientCreateContent, MCPClientEditLayout, MCPClientFormSidebar, MCPClientList, MCPClientToolPreview, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainHeader, MainSidebar, MainSidebarProvider, MarkdownRenderer, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, McpServersList, MemoryIcon, MemoryPage, MemorySearch, MemorySection, MetricsCard, MetricsDashboard, MetricsDataTable, MetricsKpiCard, MetricsProvider, ModelUsageCostCard, MultiColumn, MultiCombobox, NavigationCommand, NestedFields, Notice, Notification, OPERATORS, OPERATOR_LABELS, ObservationalMemoryProvider, OpenAIIcon, PER_PAGE$2 as PER_PAGE, PageHeader, PermissionDenied, PlaygroundConfigGuard, PlaygroundModelProvider, PlaygroundQueryClient, Popover, PopoverContent, PopoverTrigger, ProcessStepList, ProcessStepListItem, ProcessStepProgressBar, ProcessorCombobox, ProcessorIcon, ProcessorPanel, ProcessorTable, ProcessorsList, PromptBlockCreateContent, PromptBlockEditMain, PromptBlockEditSidebar, PromptBlockPickerDialog, PromptBlockVersionCombobox, PromptBlocksTable, PromptIcon, PromptsList, ProviderLogo, RadioGroup, RadioGroupItem, ReferenceViewerDialog, RepoIcon, RequestContext, RequestContextSchemaForm, RequestContextWrapper, ReviewQueueProvider, Root, Row, RuleBuilder, RuleFieldSelect, RuleOperatorSelect, RuleRow, RuleValueInput, STORED_SCORER_TYPES, SchemaRequestContext, SchemaRequestContextProvider, ScoreAsItemDialog, ScoreDelta, ScoreDialog, ScorerCombobox, ScorerCreateContent, ScorerEditMain, ScorerEditSidebar, ScorerSelector, ScorerVersionCombobox, ScorersList, ScorersPage, ScorersSection, ScorersTable, ScoresCard, ScoresList, ScoresTools, ScrollArea, ScrollBar, SearchSkillsPanel, SearchWorkspacePanel, Searchbar, SearchbarWrapper, Section, SectionHeader, Sections, Select, SelectContent, SelectField, SelectGroup, SelectItem, SelectTrigger, SelectValue, SettingsIcon, ShadcnAutoFormFieldComponents, SideDialog, Skeleton, SkillDetail, SkillIcon, SkillRemoveButton, SkillUpdateButton, SkillsNotConfigured, SkillsPage, SkillsTable, SlashIcon, Slider, SpanScoreList, SpanScoring, SpanTabs, Spinner, StudioConfigContext, StudioConfigForm, StudioConfigProvider, SubSectionHeader, Switch, Tab, TabContent, TabList, Table, Tabs, TargetSelector, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, TimePicker, TokenUsageByAgentCard, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolList, ToolPanel, ToolProviderDialog, ToolTable, ToolkitList, ToolsIcon, ToolsList, ToolsPage, ToolsSection, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceAsItemDialog, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracesVolumeCard, TracingSettingsContext, TracingSettingsProvider, Tree, Truncate, TsIcon, Txt, TxtCell, UserAvatar, UserMenu, VARIABLE_PATTERN, VariablesIcon, VariablesPage, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkflowsList, WorkflowsPage, WorkflowsSection, WorkingMemoryContext, WorkingMemoryProvider, WorkspaceNotConfigured, agentFormSchema, arrayToRecord, buildObservationalMemoryForApi, buttonVariants, cleanProviderId, cn, collectMCPClientIds, columns$6 as columns, comboboxStyles, computeAgentInitialValues, convertWorkflowRunStateToStreamResult, countLeafRules, createDefaultRule, createDefaultRuleGroup, createField, createInstructionBlock, createRefInstructionBlock, createVariableAutocomplete, exportItemsToCSV, exportItemsToJSON, extractPrompt, fieldConfig, fieldsToJSONSchema, findProviderById, flattenSchemaToVariables, formatCompact, formatHierarchicalSpans, getChildFieldOptions, getColumnTemplate, getFieldOptionAtPath, getFieldOptionsFromSchema, getItemListColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getStatusIcon, getToNextEntryFn, getToNextItemFn, getToPreviousEntryFn, getToPreviousItemFn, getWorkflowRunsNextPageParam, groupTracesByThread, highlight, inputVariants, is403ForbiddenError, isActive, isAuthenticated, isRule, isRuleGroup, isValidPreset, isWorkspaceV1Supported, joinModelId, jsonSchemaToFields, makeAuthCapabilitiesRequest, makeLogoutRequest, makeSSOLoginRequest, mapAgentResponseToDataSource, mapInstructionBlocksFromApi, mapInstructionBlocksToApi, mapScorersToApi, normalizeIntegrationToolsToRecord, normalizeScorersFromApi, normalizeSkillsFromApi, normalizeToolsToRecord, normalizeWorkspaceFromApi, parseError, parseFieldPath, parseJSONCell, parseObservationalMemoryFromApi, parseRow, parseSkillSource, promptBlockFormSchema, providerMapToIcon, removeEmptyValues, resolveSerializedZodOutput, scorerFormSchema, scoresListColumns, selectUniqueRuns, shouldRetryQuery, spanTypePrefixes$1 as spanTypePrefixes, splitModelId, toast, traceScoresListColumns, tracesListColumns, transformIntegrationToolsForApi, useActivateAgentVersion, useActivatePromptBlockVersion, useActivateScorerVersion, useActivatedSkills, useAgent, useAgentCmsForm, useAgentCmsNavigation, useAgentEditForm, useAgentEditFormContext, useAgentExperiments, useAgentInformationTab, useAgentRunsKpiMetrics, useAgentSettings, useAgentSkill, useAgentVersion, useAgentVersions, useAgents, useAllIntegrationTools, useAllModels, useAuthCapabilities, useAvgScoreKpiMetrics, useCSVParser, useCloneThread, useCodemirrorTheme$1 as useCodemirrorTheme, useCompareAgentVersions, useCompareExperiments, useCompareScorerVersions, useCreateAgentVersion, useCreatePromptBlockVersion, useCreateScorerVersion, useCreateSkill, useCreateWorkspaceDirectory, useCredentialsLogin, useCredentialsSignUp, useCurrentRun, useCurrentUser, useDataset, useDatasetExperiment, useDatasetExperimentResults, useDatasetExperiments, useDatasetItem, useDatasetItemVersion, useDatasetItemVersions, useDatasetItems, useDatasetMutations, useDatasetVersions, useDatasets, useDeleteAgentVersion, useDeletePromptBlockVersion, useDeleteScorerVersion, useDeleteThread, useDeleteWorkflowRun, useDeleteWorkspaceFile, useExecuteAgentTool, useExecuteMCPTool, useExecuteProcessor, useExecuteTool, useExperimentalFeatures, useFilteredModels, useFilteredProviders, useGenerationTasks, useHasObservability, useInView, useIndexWorkspaceContent, useInstallSkill, useIsCmsAvailable, useItemSelection, useJSONParser, useJSONSchemaForm, useJSONSchemaFormField, useJSONSchemaFormNestedContext, useLLMProviders, useLatencyMetrics, useLinkComponent, useLogout, useMCPServerTool, useMCPServerTools, useMCPServerToolsById, useMCPServers, useMainSidebar, useMastraPackages, useMastraPlatform, useMaybeSidebar, useMemory, useMemoryConfig, useMemorySearch, useMemoryWithOMStatus, useMergedRequestContext, useMetrics, useMetricsFilters, useModelUsageCostMetrics, useNavigationCommand, useObservationalMemory, useObservationalMemoryContext, useOptionalAgentEditFormContext, usePackageUpdates, usePermissions, usePlaygroundModel, usePlaygroundStore, usePopularSkillsSh, useProcessor, useProcessors, usePromptBlockEditForm, usePromptBlockVersion, usePromptBlockVersions, useProviderTools, useRemoveSkill, useReorderModelList, useRequestContextPresets, useResetAgentModel, useRestoreAgentVersion, useRestorePromptBlockVersion, useRestoreScorerVersion, useReviewQueue, useSSOLogin, useSchemaRequestContext, useScorer, useScorerEditForm, useScorerVersion, useScorerVersions, useScorers, useScoresByExperimentId, useScoresByScorerId, useScoresMetrics, useSearchSkillsSh, useSearchWorkspace, useSearchWorkspaceSkills, useSkillPreview, useSpeechRecognition, useStoredAgent, useStoredAgentMutations, useStoredAgents, useStoredPromptBlock, useStoredPromptBlockMutations, useStoredPromptBlocks, useStoredScorer, useStoredScorerMutations, useStoredSkills, useStudioConfig, useTableKeyboardNavigation, useThread, useThreadInput, useThreads, useTokenUsageByAgentMetrics, useTool, useToolProviders, useToolkits, useTools, useTotalTokensKpiMetrics, useTraceSpanScores, useTraceVolumeMetrics, useTracingSettings, useTryConnectMcp, useUpdateAgentModel, useUpdateModelInModelList, useUpdateSkills, useWorkflow, useWorkflowRun, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory, useWorkspaceFile, useWorkspaceFileStat, useWorkspaceFiles, useWorkspaceInfo, useWorkspaceSkill, useWorkspaceSkillReference, useWorkspaceSkillReferences, useWorkspaceSkills, useWorkspaces, useWriteWorkspaceFile, useWriteWorkspaceFileFromFile, validateCsvRows, validateJSONData, validateMappedData, variableHighlight };
51170
52385
  //# sourceMappingURL=index.es.js.map