@mastra/playground-ui 6.5.0-alpha.0 → 6.5.0-alpha.1

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 (57) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.cjs.js +1266 -880
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +1249 -869
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/assistant-ui/tools/badges/badge-wrapper.d.ts +2 -1
  7. package/dist/src/components/ui/containers/buttons-group.d.ts +6 -0
  8. package/dist/src/components/ui/containers/index.d.ts +2 -0
  9. package/dist/src/components/ui/containers/sections.d.ts +6 -0
  10. package/dist/src/components/ui/elements/index.d.ts +3 -0
  11. package/dist/src/components/ui/elements/main-sidebar/index.d.ts +1 -0
  12. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-bottom.d.ts +6 -0
  13. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-context.d.ts +12 -0
  14. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav-header.d.ts +8 -0
  15. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav-link.d.ts +17 -0
  16. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav-list.d.ts +12 -0
  17. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav-section.d.ts +13 -0
  18. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav-separator.d.ts +5 -0
  19. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-nav.d.ts +6 -0
  20. package/dist/src/components/ui/elements/main-sidebar/main-sidebar-root.d.ts +6 -0
  21. package/dist/src/components/ui/elements/main-sidebar/main-sidebar.d.ts +21 -0
  22. package/dist/src/components/ui/elements/notification/index.d.ts +1 -0
  23. package/dist/src/components/ui/elements/notification/notification.d.ts +9 -0
  24. package/dist/src/components/ui/elements/section/index.d.ts +1 -0
  25. package/dist/src/components/ui/elements/section/section-header.d.ts +7 -0
  26. package/dist/src/components/ui/elements/section/section-heading.d.ts +8 -0
  27. package/dist/src/components/ui/elements/section/section-root.d.ts +5 -0
  28. package/dist/src/components/ui/elements/section/section.d.ts +8 -0
  29. package/dist/src/components/ui/elements/side-dialog/index.d.ts +0 -6
  30. package/dist/src/components/ui/elements/side-dialog/side-dialog-code-section.d.ts +3 -1
  31. package/dist/src/components/ui/elements/side-dialog/side-dialog-content.d.ts +1 -14
  32. package/dist/src/components/ui/elements/side-dialog/side-dialog-nav.d.ts +6 -0
  33. package/dist/src/components/ui/elements/side-dialog/side-dialog-root.d.ts +11 -0
  34. package/dist/src/components/ui/elements/side-dialog/side-dialog-top.d.ts +2 -4
  35. package/dist/src/components/ui/elements/side-dialog/side-dialog.d.ts +16 -12
  36. package/dist/src/components/ui/elements/tabs/tabs-content.d.ts +7 -0
  37. package/dist/src/components/ui/elements/tabs/tabs-list.d.ts +7 -0
  38. package/dist/src/components/ui/elements/tabs/tabs-root.d.ts +9 -0
  39. package/dist/src/components/ui/elements/tabs/tabs-tab.d.ts +8 -0
  40. package/dist/src/components/ui/elements/tabs/tabs.d.ts +20 -36
  41. package/dist/src/domains/agents/utils/__tests__/extractPrompt.test.d.ts +1 -0
  42. package/dist/src/domains/observability/components/index.d.ts +3 -0
  43. package/dist/src/domains/observability/components/span-details.d.ts +1 -2
  44. package/dist/src/domains/observability/components/span-dialog.d.ts +8 -2
  45. package/dist/src/domains/observability/components/span-score-list.d.ts +17 -0
  46. package/dist/src/domains/observability/components/span-scoring.d.ts +6 -0
  47. package/dist/src/domains/observability/components/span-tabs.d.ts +16 -0
  48. package/dist/src/domains/observability/components/trace-dialog.d.ts +4 -2
  49. package/dist/src/domains/observability/components/trace-timeline.d.ts +1 -4
  50. package/dist/src/domains/observability/components/traces-list.d.ts +5 -1
  51. package/dist/src/domains/scores/components/score-dialog.d.ts +5 -3
  52. package/dist/src/domains/scores/hooks/use-trace-span-scores.d.ts +7 -0
  53. package/dist/src/domains/scores/hooks/use-trigger-scorer.d.ts +1 -1
  54. package/dist/src/domains/scores/index.d.ts +1 -0
  55. package/dist/src/index.d.ts +1 -0
  56. package/package.json +9 -7
  57. package/dist/src/domains/scores/components/scorers-dropdown.d.ts +0 -8
package/dist/index.cjs.js CHANGED
@@ -64,7 +64,6 @@ const dnd = require('@hello-pangea/dnd');
64
64
  const SwitchPrimitives = require('@radix-ui/react-switch');
65
65
  const AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
66
66
  const format = require('date-fns/format');
67
- const DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
68
67
 
69
68
  function _interopNamespaceDefault(e) {
70
69
  const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
@@ -100,7 +99,6 @@ const VisuallyHidden__namespace = /*#__PURE__*/_interopNamespaceDefault(Visually
100
99
  const HoverCard__namespace = /*#__PURE__*/_interopNamespaceDefault(HoverCard);
101
100
  const SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespaceDefault(SwitchPrimitives);
102
101
  const AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(AlertDialogPrimitive);
103
- const DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(DropdownMenuPrimitive);
104
102
 
105
103
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
106
104
 
@@ -4428,10 +4426,11 @@ const BadgeWrapper = ({
4428
4426
  icon,
4429
4427
  title,
4430
4428
  collapsible = true,
4431
- extraInfo
4429
+ extraInfo,
4430
+ "data-testid": dataTestId
4432
4431
  }) => {
4433
4432
  const [isCollapsed, setIsCollapsed] = React.useState(initialCollapsed);
4434
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
4433
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", "data-testid": dataTestId, children: [
4435
4434
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-2 items-center justify-between", children: [
4436
4435
  /* @__PURE__ */ jsxRuntime.jsxs(
4437
4436
  "button",
@@ -4561,6 +4560,7 @@ const ToolBadge = ({ toolName, args, result, metadata, toolOutput }) => {
4561
4560
  return /* @__PURE__ */ jsxRuntime.jsx(
4562
4561
  BadgeWrapper,
4563
4562
  {
4563
+ "data-testid": "tool-badge",
4564
4564
  icon: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "text-[#ECB047]" }),
4565
4565
  title: toolName,
4566
4566
  extraInfo: metadata?.mode === "network" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -6938,7 +6938,8 @@ function DynamicForm({
6938
6938
  },
6939
6939
  defaultValues: isNotZodObject ? defaultValues ? { "​": defaultValues } : void 0 : defaultValues,
6940
6940
  formProps: {
6941
- className
6941
+ className,
6942
+ noValidate: true
6942
6943
  },
6943
6944
  uiComponents: {
6944
6945
  SubmitButton: ({ children }) => onSubmit ? /* @__PURE__ */ jsxRuntime.jsx(Button$1, { variant: "light", className: "w-full", size: "lg", disabled: isSubmitLoading, children: isSubmitLoading ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin" }) }) : submitButtonLabel || children }) : null
@@ -7731,7 +7732,7 @@ function WorkflowTable({ workflows, isLoading }) {
7731
7732
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyWorkflowsTable, {});
7732
7733
  }
7733
7734
  const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
7734
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7735
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
7735
7736
  /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search workflows", placeholder: "Search workflows" }) }),
7736
7737
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(WorkflowTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
7737
7738
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
@@ -7785,6 +7786,7 @@ const WorkflowBadge = ({ workflow, runId, workflowId, isStreaming, metadata }) =
7785
7786
  return /* @__PURE__ */ jsxRuntime.jsxs(
7786
7787
  BadgeWrapper,
7787
7788
  {
7789
+ "data-testid": "workflow-badge",
7788
7790
  icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, { className: "text-accent3" }),
7789
7791
  title: workflow.name,
7790
7792
  initialCollapsed: false,
@@ -7850,6 +7852,7 @@ const AgentBadge = ({ agentId, messages = [], metadata }) => {
7850
7852
  return /* @__PURE__ */ jsxRuntime.jsx(
7851
7853
  BadgeWrapper,
7852
7854
  {
7855
+ "data-testid": "agent-badge",
7853
7856
  icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, { className: "text-accent1" }),
7854
7857
  title: agentId,
7855
7858
  initialCollapsed: false,
@@ -9583,13 +9586,11 @@ function MastraRuntimeProvider({
9583
9586
  () => memory ? initializeMessageState(initialLegacyMessages || []) : []
9584
9587
  );
9585
9588
  const {
9586
- setMessages,
9587
9589
  messages,
9588
- generate,
9589
- stream,
9590
- network,
9590
+ sendMessage,
9591
9591
  cancelRun,
9592
- isRunning: isRunningStream
9592
+ isRunning: isRunningStream,
9593
+ setMessages
9593
9594
  } = react$3.useChat({
9594
9595
  agentId,
9595
9596
  initializeMessages: () => initialMessages || []
@@ -9634,9 +9635,7 @@ function MastraRuntimeProvider({
9634
9635
  if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
9635
9636
  const attachments = await convertToAIAttachments(message.attachments);
9636
9637
  const input = message.content[0].text;
9637
- if (isVNext) {
9638
- setMessages((s) => [...s, { role: "user", parts: [{ type: "text", text: input }] }]);
9639
- } else {
9638
+ if (!isVNext) {
9640
9639
  setLegacyMessages((s) => [...s, { role: "user", content: input, attachments: message.attachments }]);
9641
9640
  }
9642
9641
  const controller = new AbortController();
@@ -9649,14 +9648,10 @@ function MastraRuntimeProvider({
9649
9648
  try {
9650
9649
  if (isVNext) {
9651
9650
  if (chatWithNetwork) {
9652
- await network({
9653
- coreUserMessages: [
9654
- {
9655
- role: "user",
9656
- content: input
9657
- },
9658
- ...attachments
9659
- ],
9651
+ await sendMessage({
9652
+ message: input,
9653
+ mode: "network",
9654
+ coreUserMessages: attachments,
9660
9655
  runtimeContext: runtimeContextInstance,
9661
9656
  threadId,
9662
9657
  modelSettings: modelSettingsArgs,
@@ -9669,14 +9664,10 @@ function MastraRuntimeProvider({
9669
9664
  });
9670
9665
  } else {
9671
9666
  if (chatWithGenerate) {
9672
- await generate({
9673
- coreUserMessages: [
9674
- {
9675
- role: "user",
9676
- content: input
9677
- },
9678
- ...attachments
9679
- ],
9667
+ await sendMessage({
9668
+ message: input,
9669
+ mode: "generate",
9670
+ coreUserMessages: attachments,
9680
9671
  runtimeContext: runtimeContextInstance,
9681
9672
  threadId,
9682
9673
  modelSettings: modelSettingsArgs,
@@ -9684,14 +9675,10 @@ function MastraRuntimeProvider({
9684
9675
  });
9685
9676
  return;
9686
9677
  } else {
9687
- await stream({
9688
- coreUserMessages: [
9689
- {
9690
- role: "user",
9691
- content: input
9692
- },
9693
- ...attachments
9694
- ],
9678
+ await sendMessage({
9679
+ message: input,
9680
+ mode: "stream",
9681
+ coreUserMessages: attachments,
9695
9682
  runtimeContext: runtimeContextInstance,
9696
9683
  threadId,
9697
9684
  modelSettings: modelSettingsArgs,
@@ -10229,7 +10216,7 @@ const TableCaption = React__namespace.forwardRef(
10229
10216
  );
10230
10217
  TableCaption.displayName = "TableCaption";
10231
10218
 
10232
- const Tabs = TabsPrimitive__namespace.Root;
10219
+ const Tabs$1 = TabsPrimitive__namespace.Root;
10233
10220
  const TabsList = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
10234
10221
  TabsPrimitive__namespace.List,
10235
10222
  {
@@ -10272,12 +10259,12 @@ const PlaygroundTabs = ({
10272
10259
  setInternalTab(typedValue);
10273
10260
  }
10274
10261
  };
10275
- return /* @__PURE__ */ jsxRuntime.jsx(Tabs, { value: currentTab, onValueChange: handleTabChange, className: cn("h-full", className), children });
10262
+ return /* @__PURE__ */ jsxRuntime.jsx(Tabs$1, { value: currentTab, onValueChange: handleTabChange, className: cn("h-full", className), children });
10276
10263
  };
10277
- const TabList = ({ children, className }) => {
10264
+ const TabList$1 = ({ children, className }) => {
10278
10265
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(TabsList, { className: "border-b border-border1 flex min-w-full shrink-0", children }) });
10279
10266
  };
10280
- const Tab = ({ children, value, onClick }) => {
10267
+ const Tab$1 = ({ children, value, onClick }) => {
10281
10268
  return /* @__PURE__ */ jsxRuntime.jsx(
10282
10269
  TabsTrigger,
10283
10270
  {
@@ -10288,7 +10275,7 @@ const Tab = ({ children, value, onClick }) => {
10288
10275
  }
10289
10276
  );
10290
10277
  };
10291
- const TabContent = ({ children, value }) => {
10278
+ const TabContent$1 = ({ children, value }) => {
10292
10279
  return /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value, className: "h-full overflow-hidden flex flex-col", children });
10293
10280
  };
10294
10281
 
@@ -10313,12 +10300,12 @@ function AgentEvals({ liveEvals, ciEvals, onRefetchLiveEvals, onRefetchCiEvals }
10313
10300
  return onRefetchCiEvals();
10314
10301
  }
10315
10302
  return /* @__PURE__ */ jsxRuntime.jsxs(PlaygroundTabs, { defaultTab: "live", children: [
10316
- /* @__PURE__ */ jsxRuntime.jsxs(TabList, { children: [
10317
- /* @__PURE__ */ jsxRuntime.jsx(Tab, { value: "live", children: "Live" }),
10318
- /* @__PURE__ */ jsxRuntime.jsx(Tab, { value: "ci", children: "CI" })
10303
+ /* @__PURE__ */ jsxRuntime.jsxs(TabList$1, { children: [
10304
+ /* @__PURE__ */ jsxRuntime.jsx(Tab$1, { value: "live", children: "Live" }),
10305
+ /* @__PURE__ */ jsxRuntime.jsx(Tab$1, { value: "ci", children: "CI" })
10319
10306
  ] }),
10320
- /* @__PURE__ */ jsxRuntime.jsx(TabContent, { value: "live", children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: liveEvals, isCIMode: false, onRefresh: handleRefresh }) }),
10321
- /* @__PURE__ */ jsxRuntime.jsx(TabContent, { value: "ci", children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: ciEvals, isCIMode: true, onRefresh: handleRefresh }) })
10307
+ /* @__PURE__ */ jsxRuntime.jsx(TabContent$1, { value: "live", children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: liveEvals, isCIMode: false, onRefresh: handleRefresh }) }),
10308
+ /* @__PURE__ */ jsxRuntime.jsx(TabContent$1, { value: "ci", children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: ciEvals, isCIMode: true, onRefresh: handleRefresh }) })
10322
10309
  ] });
10323
10310
  }
10324
10311
  function EvalTable({ evals, isCIMode = false, onRefresh }) {
@@ -10990,7 +10977,7 @@ function AgentsTable({ agents, isLoading }) {
10990
10977
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyAgentsTable, {});
10991
10978
  }
10992
10979
  const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
10993
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10980
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
10994
10981
  /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search agents", placeholder: "Search agents" }) }),
10995
10982
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(AgentsTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
10996
10983
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(Th, { style: { width: header.column.getSize() ?? "auto" }, children: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
@@ -11615,7 +11602,7 @@ function RelationWrapper({ description, children }) {
11615
11602
  }
11616
11603
 
11617
11604
  function EntryListRoot({ children }) {
11618
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid mb-[3rem]", children });
11605
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid", children });
11619
11606
  }
11620
11607
 
11621
11608
  function getColumnTemplate(columns) {
@@ -11832,30 +11819,29 @@ function getToPreviousEntryFn({ entries, id, update }) {
11832
11819
  return void 0;
11833
11820
  }
11834
11821
 
11835
- function SideDialog({
11822
+ function SideDialogRoot({
11836
11823
  dialogTitle,
11837
11824
  dialogDescription,
11838
11825
  isOpen,
11839
11826
  onClose,
11840
11827
  children,
11841
11828
  variant = "default",
11842
- hasCloseButton = true,
11829
+ level = 1,
11843
11830
  className
11844
11831
  }) {
11845
11832
  const isConfirmation = variant === "confirmation";
11846
11833
  return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
11847
- !isConfirmation && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: cn("bg-black top-0 bottom-0 right-0 left-0 fixed z-50 opacity-[0.25]") }),
11834
+ !isConfirmation && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Overlay, { className: cn("bg-black top-0 bottom-0 right-0 left-0 fixed z-50 opacity-40") }),
11848
11835
  /* @__PURE__ */ jsxRuntime.jsxs(
11849
11836
  DialogPrimitive__namespace.Content,
11850
11837
  {
11851
11838
  className: cn(
11852
- "fixed top-0 bottom-0 right-0 border-l border-border1 z-50 bg-surface4",
11853
- "w-[calc(100vw-20rem)] max-w-[50rem]",
11854
- "3xl:max-w-[60rem]",
11855
- "4xl:max-w-[50%]",
11856
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0",
11839
+ "fixed top-0 bottom-0 right-0 border-l border-border2 z-50 bg-surface2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 ",
11857
11840
  {
11858
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-right-1/4": !isConfirmation,
11841
+ "w-[75vw] 2xl:w-[65vw] 4xl:w-[55vw]": level === 1,
11842
+ "w-[70vw] 2xl:w-[59vw] 4xl:w-[48vw]": level === 2,
11843
+ "w-[65vw] 2xl:w-[53vw] 4xl:w-[41vw]": level === 3,
11844
+ "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-right-1/4 shadow-[-3rem_0_2rem_0_rgba(0,0,0,0.75)]": !isConfirmation,
11859
11845
  "bg-surface2/70": isConfirmation
11860
11846
  },
11861
11847
  className
@@ -11865,15 +11851,15 @@ function SideDialog({
11865
11851
  /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { children: dialogTitle }),
11866
11852
  /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Description, { children: dialogDescription })
11867
11853
  ] }),
11868
- !isConfirmation && hasCloseButton && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
11854
+ !isConfirmation && /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
11869
11855
  "button",
11870
11856
  {
11871
11857
  className: cn(
11872
- "flex appearance-none items-center justify-center rounded-bl-lg h-[3.5rem] w-[3.5rem] absolute too-0 left-[-3.5rem] bg-surface4 text-icon4 border-l border-b border-border1",
11858
+ "flex appearance-none items-center justify-center rounded-bl-lg h-[3.5rem] w-[3.5rem] absolute top-0 left-[-3.5rem] bg-surface2 text-icon4 border-l border-b border-border2",
11873
11859
  "hover:surface5 hover:text-icon5"
11874
11860
  ),
11875
11861
  "aria-label": "Close",
11876
- children: isConfirmation ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRightIcon, {})
11862
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRightIcon, {})
11877
11863
  }
11878
11864
  ) }),
11879
11865
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11891,125 +11877,97 @@ function SideDialog({
11891
11877
  ] }) });
11892
11878
  }
11893
11879
 
11894
- function SideDialogHeader({ children, className }) {
11895
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex justify-between items-center pb-[1rem]", className), children });
11880
+ function MainContentLayout({
11881
+ children,
11882
+ className,
11883
+ style
11884
+ }) {
11885
+ const devStyleRequested = devUIStyleRequested("MainContentLayout");
11886
+ return /* @__PURE__ */ jsxRuntime.jsx(
11887
+ "main",
11888
+ {
11889
+ className: cn(`grid grid-rows-[auto_1fr] h-full items-start content-start`, className),
11890
+ style: { ...style, ...devStyleRequested ? { border: "3px dotted red" } : {} },
11891
+ children
11892
+ }
11893
+ );
11896
11894
  }
11897
-
11898
- function SideDialogFooter({ children, onNext, onPrevious, showInnerNav }) {
11899
- const handleOnNext = () => {
11900
- onNext?.();
11901
- };
11902
- const handleOnPrevious = () => {
11903
- onPrevious?.();
11904
- };
11905
- return /* @__PURE__ */ jsxRuntime.jsxs(
11895
+ function MainContentContent({
11896
+ children,
11897
+ className,
11898
+ isCentered = false,
11899
+ isDivided = false,
11900
+ hasLeftServiceColumn = false,
11901
+ style
11902
+ }) {
11903
+ const devStyleRequested = devUIStyleRequested("MainContentContent");
11904
+ return /* @__PURE__ */ jsxRuntime.jsx(
11906
11905
  "div",
11907
11906
  {
11908
11907
  className: cn(
11909
- "flex items-center justify-end gap-[1rem] px-[1.5rem] py-[1rem] min-h-[4rem] border-t border-border1",
11908
+ `grid overflow-y-auto h-full `,
11909
+ `overflow-x-auto min-w-[min-content]`,
11910
11910
  {
11911
- "justify-between": showInnerNav
11912
- }
11911
+ "items-start content-start": !isCentered && !isDivided && !hasLeftServiceColumn,
11912
+ "grid place-items-center": isCentered,
11913
+ "grid-cols-[1fr_1fr]": isDivided && !hasLeftServiceColumn,
11914
+ "grid-cols-[12rem_1fr_1fr]": isDivided && hasLeftServiceColumn,
11915
+ "grid-cols-[auto_1fr]": !isDivided && hasLeftServiceColumn
11916
+ },
11917
+ className
11913
11918
  ),
11914
- children: [
11915
- (onNext || onPrevious) && showInnerNav && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex gap-[1rem]"), children: [
11916
- /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnNext, disabled: !onNext, variant: "ghost", children: [
11917
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
11918
- "Close"
11919
- ] }) }),
11920
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnNext, disabled: !onNext, variant: "ghost", children: [
11921
- "Next",
11922
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpIcon, {})
11923
- ] }),
11924
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnPrevious, disabled: !onPrevious, variant: "ghost", children: [
11925
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownIcon, {}),
11926
- "Previous"
11927
- ] })
11928
- ] }),
11929
- /* @__PURE__ */ jsxRuntime.jsx("div", { children })
11930
- ]
11919
+ style: { ...style, ...devStyleRequested ? { border: "3px dotted orange" } : {} },
11920
+ children
11931
11921
  }
11932
11922
  );
11933
11923
  }
11934
- function SideDialogFooterGroup({ children }) {
11935
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-[1rem]", children });
11924
+ function devUIStyleRequested(name) {
11925
+ try {
11926
+ const raw = localStorage.getItem("add-dev-style-to-components");
11927
+ if (!raw) return false;
11928
+ const components = raw.split(",").map((c) => c.trim()).filter(Boolean);
11929
+ return components.includes(name);
11930
+ } catch (error) {
11931
+ console.error("Error reading or parsing localStorage:", error);
11932
+ return false;
11933
+ }
11934
+ }
11935
+
11936
+ function ButtonsGroup({ children, className }) {
11937
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(`flex gap-2 items-center`, "[&>button]:flex-grow", className), children });
11936
11938
  }
11937
11939
 
11938
- function SideDialogContent({ children, className, isCentered, isFullHeight, variant }) {
11939
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-[3rem] py-[2rem] overflow-y-scroll", className), children: /* @__PURE__ */ jsxRuntime.jsx(
11940
- "div",
11941
- {
11942
- className: cn("grid gap-[2rem] max-w-[50rem] w-full mx-auto pb-[1rem] ", {
11943
- "items-center justify-center h-full content-center": isCentered,
11944
- "min-h-full": isFullHeight,
11945
- "content-start": !isFullHeight && !isCentered
11946
- }),
11947
- children
11948
- }
11949
- ) });
11940
+ function Sections({ children, className }) {
11941
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-[3rem]", className), children });
11942
+ }
11943
+
11944
+ function SectionRoot({ children, className }) {
11945
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn(`grid gap-[1rem]`, className), children });
11946
+ }
11947
+
11948
+ function SectionHeader({ children, className }) {
11949
+ return /* @__PURE__ */ jsxRuntime.jsx("header", { className: cn("grid items-center grid-cols-[1fr_auto]", className), children });
11950
11950
  }
11951
- function SideDialogSection({ children }) {
11951
+
11952
+ function SectionHeading({ headingLevel = "h2", children, className }) {
11953
+ const HeadingTag = headingLevel;
11952
11954
  return /* @__PURE__ */ jsxRuntime.jsx(
11953
- "div",
11955
+ HeadingTag,
11954
11956
  {
11955
11957
  className: cn(
11956
- "grid text-[0.875rem] text-icon5 gap-[1rem] justify-items-start",
11957
- "[&>h3]:text-icon3 [&>h3]:text-[1rem] [&>h3]:font-semibold [&>h3]:border-b [&>h3]:border-border1 [&>h3]:pb-[1rem] [&>h3]:pr-[1rem] [&>h3]:inline-flex [&>h3]:gap-[.5rem] [&>h3]:items-center",
11958
- "[&>h3>svg]:w-[1em] [&>h3>svg]:h-[1em] [&>h3>svg]:text-icon3"
11958
+ "flex items-center gap-[0.5em] text-[0.9375rem] font-bold text-icon4",
11959
+ "[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50",
11960
+ className
11959
11961
  ),
11960
11962
  children
11961
11963
  }
11962
11964
  );
11963
11965
  }
11964
- function SideDialogKeyValueList({ items, className }) {
11965
- return /* @__PURE__ */ jsxRuntime.jsx("dl", { className: cn("grid grid-cols-[auto_1fr] gap-x-[2rem] gap-y-[.5rem] text-[0.875rem] content-start", className), children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11966
- /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: "text-icon3", children: [
11967
- item.key,
11968
- ":"
11969
- ] }),
11970
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-icon4", children: item.value })
11971
- ] })) });
11972
- }
11973
11966
 
11974
- function SideDialogTop({ children, onNext, onPrevious, showInnerNav, className }) {
11975
- const handleOnNext = () => {
11976
- onNext?.();
11977
- };
11978
- const handleOnPrevious = () => {
11979
- onPrevious?.();
11980
- };
11981
- return /* @__PURE__ */ jsxRuntime.jsx(
11982
- "div",
11983
- {
11984
- className: cn(`flex justify-between h-[3.5rem] items-center text-icon5 text-[.875rem] pl-[1.5rem]`, className),
11985
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-[2rem]", "[&_svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-icon3"), children: [
11986
- children,
11987
- (onNext || onPrevious) && showInnerNav && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11988
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-icon3", children: "|" }),
11989
- /* @__PURE__ */ jsxRuntime.jsxs(
11990
- "div",
11991
- {
11992
- className: cn(
11993
- "flex gap-[1rem] items-baseline"
11994
- // '[&>button]:text-[0.875rem] [&>button]:flex [&>button]:items-center [&>button]:px-[0.5rem] [&>button]:py-[0.8rem] [&>button]:leading-[1]',
11995
- ),
11996
- children: [
11997
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnPrevious, disabled: !onPrevious, variant: "ghost", children: [
11998
- "Previous",
11999
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpIcon, {})
12000
- ] }),
12001
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnNext, disabled: !onNext, variant: "ghost", children: [
12002
- "Next",
12003
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownIcon, {})
12004
- ] })
12005
- ]
12006
- }
12007
- )
12008
- ] })
12009
- ] })
12010
- }
12011
- );
12012
- }
11967
+ const Section = Object.assign(SectionRoot, {
11968
+ Header: SectionHeader,
11969
+ Heading: SectionHeading
11970
+ });
12013
11971
 
12014
11972
  const useCodemirrorTheme = () => {
12015
11973
  return React.useMemo(
@@ -12027,7 +11985,7 @@ const useCodemirrorTheme = () => {
12027
11985
  []
12028
11986
  );
12029
11987
  };
12030
- function SideDialogCodeSection({ codeStr = "", title, simplified = false }) {
11988
+ function SideDialogCodeSection({ codeStr = "", title, icon, simplified = false }) {
12031
11989
  const theme = useCodemirrorTheme();
12032
11990
  const [showAsMultilineText, setShowAsMultilineText] = React.useState(false);
12033
11991
  const hasMultilineText = React.useMemo(() => {
@@ -12039,22 +11997,19 @@ function SideDialogCodeSection({ codeStr = "", title, simplified = false }) {
12039
11997
  }
12040
11998
  }, [codeStr]);
12041
11999
  const finalCodeStr = showAsMultilineText ? codeStr?.replace(/\\n/g, "\n") : codeStr;
12042
- return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "border border-border1 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border1 last:border-b-0 grid", children: [
12043
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-[1rem] px-[1.5rem] border-b border-border1 grid grid-cols-[1fr_auto]", children: [
12044
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: title }),
12045
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center justify-end", children: [
12000
+ return /* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
12001
+ /* @__PURE__ */ jsxRuntime.jsxs(Section.Header, { children: [
12002
+ /* @__PURE__ */ jsxRuntime.jsxs(Section.Heading, { children: [
12003
+ icon,
12004
+ title
12005
+ ] }),
12006
+ /* @__PURE__ */ jsxRuntime.jsxs(ButtonsGroup, { children: [
12046
12007
  /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { content: codeStr || "No content" }),
12047
12008
  hasMultilineText && /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", onClick: () => setShowAsMultilineText(!showAsMultilineText), children: showAsMultilineText ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeftIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignJustifyIcon, {}) })
12048
12009
  ] })
12049
12010
  ] }),
12050
- /* @__PURE__ */ jsxRuntime.jsx(
12051
- "div",
12052
- {
12053
- className: cn("bg-surface3 p-[1rem] overflow-auto text-icon4 text-[0.875rem] [&>div]:border-none break-all"),
12054
- children: codeStr && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: simplified ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-icon4 text-[0.875rem] py-[1rem] font-mono break-all mx-[1.5rem]", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-wrap", children: codeStr }) }) : /* @__PURE__ */ jsxRuntime.jsx(CodeMirror, { extensions: [langJson.json(), CodeMirror.EditorView.lineWrapping], theme, value: finalCodeStr }) })
12055
- }
12056
- )
12057
- ] }) });
12011
+ codeStr && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-black/20 p-[1rem] overflow-hidden rounded-xl border border-white/10 text-icon4 text-[0.875rem] break-all", children: simplified ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-icon4 font-mono break-all px-[0.5rem]", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-wrap", children: codeStr }) }) : /* @__PURE__ */ jsxRuntime.jsx(CodeMirror, { extensions: [langJson.json(), CodeMirror.EditorView.lineWrapping], theme, value: finalCodeStr }) })
12012
+ ] });
12058
12013
  }
12059
12014
  function containsInnerNewline(obj) {
12060
12015
  if (typeof obj === "string") {
@@ -12087,6 +12042,69 @@ function SideDialogHeading({ children, className, as = "h1" }) {
12087
12042
  );
12088
12043
  }
12089
12044
 
12045
+ function SideDialogContent({ children, className }) {
12046
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("p-[1.5rem] pl-[2.25rem] overflow-y-scroll grid gap-[1.5rem] content-start", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("grid gap-[1.5rem] mb-[2rem] "), children }) });
12047
+ }
12048
+
12049
+ function SideDialogHeader({ children, className }) {
12050
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex justify-between items-center pb-[1rem]", className), children });
12051
+ }
12052
+
12053
+ function SideDialogTop({ children, withTopSeparator, className }) {
12054
+ return /* @__PURE__ */ jsxRuntime.jsx(
12055
+ "div",
12056
+ {
12057
+ className: cn(
12058
+ `flex h-[3.5rem] items-center text-icon5 text-[.875rem] pl-[1.5rem] relative gap-[1rem]`,
12059
+ '[&:after]:content-[""] [&:after]:absolute [&:after]:left-[1.5rem] [&:after]:right-[1.5rem] [&:after]:bottom-0 [&:after]:border-b [&:after]:border-border1',
12060
+ {
12061
+ '[&:before]:content-[""] [&:before]:absolute [&:before]:left-[1.5rem] [&:before]:right-[1.5rem] [&:before]:top-0 [&:before]:border-t [&:before]:border-border1': withTopSeparator
12062
+ },
12063
+ className
12064
+ ),
12065
+ children
12066
+ }
12067
+ );
12068
+ }
12069
+
12070
+ function SideDialogNav({ onNext, onPrevious, className }) {
12071
+ const handleOnNext = () => {
12072
+ onNext?.();
12073
+ };
12074
+ const handleOnPrevious = () => {
12075
+ onPrevious?.();
12076
+ };
12077
+ return /* @__PURE__ */ jsxRuntime.jsx(
12078
+ "div",
12079
+ {
12080
+ className: cn(
12081
+ "flex items-center gap-[1rem]",
12082
+ "[&_svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-icon3",
12083
+ className
12084
+ ),
12085
+ children: (onNext || onPrevious) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex gap-[1rem] items-baseline"), children: [
12086
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnPrevious, disabled: !onPrevious, variant: "ghost", children: [
12087
+ "Previous",
12088
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpIcon, {})
12089
+ ] }),
12090
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleOnNext, disabled: !onNext, variant: "ghost", children: [
12091
+ "Next",
12092
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDownIcon, {})
12093
+ ] })
12094
+ ] })
12095
+ }
12096
+ );
12097
+ }
12098
+
12099
+ const SideDialog = Object.assign(SideDialogRoot, {
12100
+ Top: SideDialogTop,
12101
+ Header: SideDialogHeader,
12102
+ Heading: SideDialogHeading,
12103
+ Content: SideDialogContent,
12104
+ CodeSection: SideDialogCodeSection,
12105
+ Nav: SideDialogNav
12106
+ });
12107
+
12090
12108
  function EntityMainHeader({
12091
12109
  title,
12092
12110
  description,
@@ -12501,7 +12519,7 @@ function TextAndIcon({ children, className }) {
12501
12519
  {
12502
12520
  className: cn(
12503
12521
  "flex items-center gap-[0.5em] text-icon4 text-[0.875rem]",
12504
- "[&>svg]:w-[1.2em] [&>svg]:h-[1.2em] [&>svg]:opacity-50 [&_svg]:flex-shrink-0",
12522
+ "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50 [&_svg]:flex-shrink-0",
12505
12523
  className
12506
12524
  ),
12507
12525
  children
@@ -12514,85 +12532,304 @@ function getShortId(id) {
12514
12532
  return id.slice(0, 8);
12515
12533
  }
12516
12534
 
12517
- const scoresListColumns = [
12518
- { name: "date", label: "Date", size: "4.5rem" },
12519
- { name: "time", label: "Time", size: "6.5rem" },
12520
- { name: "input", label: "Input", size: "1fr" },
12521
- { name: "entityId", label: "Entity", size: "10rem" },
12522
- { name: "score", label: "Score", size: "3rem" }
12523
- ];
12524
- function ScoresList({
12525
- scores,
12526
- pagination,
12527
- onScoreClick,
12528
- onPageChange,
12529
- errorMsg,
12530
- selectedScoreId
12531
- }) {
12532
- if (!scores) {
12533
- return null;
12534
- }
12535
- const scoresHasMore = pagination?.hasMore;
12536
- const handleNextPage = () => {
12537
- if (scoresHasMore) {
12538
- onPageChange?.(pagination.page + 1);
12535
+ function Notification({ children, className, isVisible, autoDismiss = true, dismissTime = 5e3 }) {
12536
+ const [localIsVisible, setLocalIsVisible] = React.useState(isVisible);
12537
+ React.useEffect(() => {
12538
+ if (autoDismiss && isVisible) {
12539
+ const timer = setTimeout(() => {
12540
+ setLocalIsVisible(false);
12541
+ }, dismissTime);
12542
+ return () => clearTimeout(timer);
12539
12543
  }
12540
- };
12541
- const handlePrevPage = () => {
12542
- if (pagination?.page && pagination.page > 0) {
12543
- onPageChange?.(pagination.page - 1);
12544
+ }, [autoDismiss, isVisible, dismissTime]);
12545
+ React.useEffect(() => {
12546
+ setLocalIsVisible(isVisible);
12547
+ }, [isVisible]);
12548
+ if (!localIsVisible) return null;
12549
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12550
+ "div",
12551
+ {
12552
+ className: cn(
12553
+ "grid grid-cols-[1fr_auto] gap-[0.5rem] rounded-l bg-white/5 p-[1.5rem] py-[1rem] text-[0.875rem] text-icon3 items-center",
12554
+ "[&>svg]:w-[1.1em] [&>svg]:h-[1.1em] [&>svg]:opacity-50",
12555
+ className
12556
+ ),
12557
+ children: [
12558
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-[0.5rem] items-center", children }),
12559
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "ghost", onClick: () => setLocalIsVisible(false), children: [
12560
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
12561
+ /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: "Dismiss" })
12562
+ ] })
12563
+ ]
12544
12564
  }
12545
- };
12546
- return /* @__PURE__ */ jsxRuntime.jsxs(EntryList, { children: [
12547
- /* @__PURE__ */ jsxRuntime.jsxs(EntryList.Trim, { children: [
12548
- /* @__PURE__ */ jsxRuntime.jsx(EntryList.Header, { columns: scoresListColumns }),
12549
- errorMsg ? /* @__PURE__ */ jsxRuntime.jsx(EntryList.Message, { message: errorMsg, type: "error" }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: scores.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(EntryList.Entries, { children: scores.map((score) => {
12550
- const createdAtDate = new Date(score.createdAt);
12551
- const isTodayDate = dateFns.isToday(createdAtDate);
12552
- const entry = {
12553
- id: score.id,
12554
- date: isTodayDate ? "Today" : dateFns.format(createdAtDate, "MMM dd"),
12555
- time: dateFns.format(createdAtDate, "h:mm:ss aaa"),
12556
- input: JSON.stringify(score?.input),
12557
- entityId: score.entityId,
12558
- score: score.score
12559
- };
12560
- return /* @__PURE__ */ jsxRuntime.jsx(
12561
- EntryList.Entry,
12562
- {
12563
- entry,
12564
- isSelected: selectedScoreId === score.id,
12565
- columns: scoresListColumns,
12566
- onClick: onScoreClick,
12567
- children: scoresListColumns.map((col, index) => {
12568
- const key = `${index}-${score.id}`;
12569
- return /* @__PURE__ */ jsxRuntime.jsx(EntryList.EntryText, { children: entry?.[col.name] }, key);
12570
- })
12571
- },
12572
- entry.id
12573
- );
12574
- }) }) : /* @__PURE__ */ jsxRuntime.jsx(EntryList.Message, { message: "No scores for this scorer yet" }) })
12575
- ] }),
12576
- /* @__PURE__ */ jsxRuntime.jsx(
12577
- EntryList.Pagination,
12578
- {
12579
- currentPage: pagination?.page || 0,
12580
- onNextPage: handleNextPage,
12581
- onPrevPage: handlePrevPage,
12582
- hasMore: scoresHasMore
12583
- }
12584
- )
12585
- ] });
12565
+ );
12586
12566
  }
12587
12567
 
12588
- function ScoreDialog({
12589
- scorer,
12590
- score,
12591
- isOpen,
12568
+ function MainSidebarNavSeparator({ className }) {
12569
+ return /* @__PURE__ */ jsxRuntime.jsx(
12570
+ "div",
12571
+ {
12572
+ className: cn(
12573
+ "min-h-[1.3rem] relative",
12574
+ '[&:after]:content-[""] [&:after]:block [&:after]:absolute [&:after]:h-[0px] [&:after]:border-border1 [&:after]:border-t [&:after]:top-[48%] [&:after]:left-[0.75rem] [&:after]:right-[0.75rem]',
12575
+ className
12576
+ )
12577
+ }
12578
+ );
12579
+ }
12580
+
12581
+ function MainSidebarRoot({ children, className }) {
12582
+ const { state, toggleSidebar } = useMainSidebar();
12583
+ const isCollapsed = state === "collapsed";
12584
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12585
+ "div",
12586
+ {
12587
+ className: cn(
12588
+ "flex flex-col h-full px-[1rem] pb-[1rem] relative overflow-y-auto",
12589
+ {
12590
+ "lg:min-w-[13rem] xl:min-w-[14rem] 2xl:min-w-[15rem] 3xl:min-w-[16rem] 4xl:min-w-[17rem]": !isCollapsed
12591
+ },
12592
+ className
12593
+ ),
12594
+ children: [
12595
+ children,
12596
+ /* @__PURE__ */ jsxRuntime.jsx(MainSidebarNavSeparator, {}),
12597
+ /* @__PURE__ */ jsxRuntime.jsx(
12598
+ "button",
12599
+ {
12600
+ onClick: toggleSidebar,
12601
+ className: cn(
12602
+ "inline-flex w-auto items-center text-icon3 h-[2rem] px-[0.75rem] rounded-md",
12603
+ "hover:bg-surface4",
12604
+ "[&_svg]:w-[1rem] [&_svg]:h-[1rem] [&_svg]:text-icon3",
12605
+ {
12606
+ "ml-auto": !isCollapsed
12607
+ }
12608
+ ),
12609
+ "aria-label": "Toggle sidebar",
12610
+ children: /* @__PURE__ */ jsxRuntime.jsx(
12611
+ lucideReact.PanelRightIcon,
12612
+ {
12613
+ className: cn({
12614
+ "rotate-180": isCollapsed
12615
+ })
12616
+ }
12617
+ )
12618
+ }
12619
+ ),
12620
+ /* @__PURE__ */ jsxRuntime.jsx(
12621
+ "button",
12622
+ {
12623
+ onClick: toggleSidebar,
12624
+ className: cn("w-[.75rem] h-full right-0 top-0 absolute opacity-10", {
12625
+ "cursor-w-resize": !isCollapsed,
12626
+ "cursor-e-resize": isCollapsed
12627
+ }),
12628
+ "aria-label": "Toggle sidebar"
12629
+ }
12630
+ )
12631
+ ]
12632
+ }
12633
+ );
12634
+ }
12635
+
12636
+ function MainSidebarBottom({ children, className }) {
12637
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-auto", className), children });
12638
+ }
12639
+
12640
+ function MainSidebarNav({ children, className }) {
12641
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { className: cn("", className), children });
12642
+ }
12643
+
12644
+ function MainSidebarNavSection({ children, className }) {
12645
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { className: cn("grid items-start content-center relative", className), children });
12646
+ }
12647
+
12648
+ function MainSidebarNavLink({
12649
+ link,
12650
+ state = "default",
12651
+ children,
12652
+ isActive,
12653
+ className
12654
+ }) {
12655
+ const { Link } = useLinkComponent();
12656
+ const isDefaultState = state === "default";
12657
+ const isFeatured = link?.variant === "featured";
12658
+ const linkParams = link?.url?.startsWith("http") ? { target: "_blank", rel: "noreferrer" } : {};
12659
+ return /* @__PURE__ */ jsxRuntime.jsx(
12660
+ "li",
12661
+ {
12662
+ className: cn(
12663
+ "flex ",
12664
+ "[&>a]:flex [&>a]:items-center [&>a]:min-h-[2rem] [&>a]:gap-[10px] [&>a]:text-[0.8125rem] [&>a]:text-icon3 [&>a]:py-[6px] [&>a]:px-[0.75rem] [&>a]:w-full [&>a]:rounded-lg [&>a]:justify-center",
12665
+ "[&_svg]:w-[1rem] [&_svg]:h-[1rem] [&_svg]:text-icon3/60",
12666
+ "[&>a:hover]:bg-surface4 [&>a:hover]:text-icon5 [&>a:hover_svg]:text-icon3",
12667
+ {
12668
+ "[&>a]:text-icon5 [&>a]:bg-surface3": isActive,
12669
+ "[&_svg]:text-icon5": isActive,
12670
+ "[&>a]:justify-start ": isDefaultState,
12671
+ "[&_svg]:text-icon3": !isDefaultState,
12672
+ "[&>a]:rounded-md [&>a]:my-[0.5rem] [&>a]:bg-accent1/75 [&>a:hover]:bg-accent1/85 [&>a]:text-black [&>a:hover]:text-black": isFeatured,
12673
+ "[&_svg]:text-black/75": isFeatured
12674
+ },
12675
+ className
12676
+ ),
12677
+ children: link ? /* @__PURE__ */ jsxRuntime.jsxs(Link, { href: link.url, ...linkParams, children: [
12678
+ isDefaultState ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: link.icon && link.icon }) : /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
12679
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: link.icon && link.icon }),
12680
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center", className: "bg-border1 text-icon6 ml-[1rem]", children: link.name })
12681
+ ] }),
12682
+ isDefaultState ? link.name : /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: link.name }),
12683
+ " ",
12684
+ children
12685
+ ] }) : children
12686
+ }
12687
+ );
12688
+ }
12689
+
12690
+ function MainSidebarNavHeader({ children, className, state = "default" }) {
12691
+ const isDefaultState = state === "default";
12692
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid grid-cols-[auto_1fr] items-center min-h-[2.8rem] ", className), children: [
12693
+ /* @__PURE__ */ jsxRuntime.jsx(
12694
+ "header",
12695
+ {
12696
+ className: cn("text-[0.6875rem] uppercase text-icon3/75 tracking-widest", {
12697
+ "pl-[0.75rem]": isDefaultState
12698
+ }),
12699
+ children: isDefaultState ? children : /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children })
12700
+ }
12701
+ ),
12702
+ /* @__PURE__ */ jsxRuntime.jsx(MainSidebarNavSeparator, {})
12703
+ ] });
12704
+ }
12705
+
12706
+ function MainSidebarNavList({ children, className }) {
12707
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cn("grid gap-[0.25rem] items-start content-center ", className), children });
12708
+ }
12709
+
12710
+ const SIDEBAR_COOKIE_NAME = "sidebar:state";
12711
+ const MainSidebarContext = React.createContext(null);
12712
+ function useMainSidebar() {
12713
+ const context = React.useContext(MainSidebarContext);
12714
+ if (!context) {
12715
+ throw new Error("useMainSidebar must be used within a MainSidebarProvider.");
12716
+ }
12717
+ return context;
12718
+ }
12719
+ function stateInitializer() {
12720
+ const storedState = window.localStorage.getItem(SIDEBAR_COOKIE_NAME);
12721
+ return storedState === "collapsed" ? "collapsed" : "default";
12722
+ }
12723
+ const setLocalStorage = (value) => {
12724
+ window.localStorage.setItem(SIDEBAR_COOKIE_NAME, value.toString());
12725
+ };
12726
+ function MainSidebarProvider({ children }) {
12727
+ const [state, setState] = React.useState(stateInitializer);
12728
+ const toggleSidebar = React.useCallback(() => {
12729
+ setLocalStorage(state === "default" ? "collapsed" : "default");
12730
+ setState(state === "default" ? "collapsed" : "default");
12731
+ }, [state]);
12732
+ const contextValue = React.useMemo(
12733
+ () => ({
12734
+ state,
12735
+ toggleSidebar
12736
+ }),
12737
+ [state, toggleSidebar]
12738
+ );
12739
+ return /* @__PURE__ */ jsxRuntime.jsx(MainSidebarContext.Provider, { value: contextValue, children });
12740
+ }
12741
+
12742
+ const MainSidebar = Object.assign(MainSidebarRoot, {
12743
+ Bottom: MainSidebarBottom,
12744
+ Nav: MainSidebarNav,
12745
+ NavSection: MainSidebarNavSection,
12746
+ NavLink: MainSidebarNavLink,
12747
+ NavHeader: MainSidebarNavHeader,
12748
+ NavList: MainSidebarNavList,
12749
+ NavSeparator: MainSidebarNavSeparator
12750
+ });
12751
+
12752
+ const scoresListColumns = [
12753
+ { name: "date", label: "Date", size: "4.5rem" },
12754
+ { name: "time", label: "Time", size: "6.5rem" },
12755
+ { name: "input", label: "Input", size: "1fr" },
12756
+ { name: "entityId", label: "Entity", size: "10rem" },
12757
+ { name: "score", label: "Score", size: "3rem" }
12758
+ ];
12759
+ function ScoresList({
12760
+ scores,
12761
+ pagination,
12762
+ onScoreClick,
12763
+ onPageChange,
12764
+ errorMsg,
12765
+ selectedScoreId
12766
+ }) {
12767
+ if (!scores) {
12768
+ return null;
12769
+ }
12770
+ const scoresHasMore = pagination?.hasMore;
12771
+ const handleNextPage = () => {
12772
+ if (scoresHasMore) {
12773
+ onPageChange?.(pagination.page + 1);
12774
+ }
12775
+ };
12776
+ const handlePrevPage = () => {
12777
+ if (pagination?.page && pagination.page > 0) {
12778
+ onPageChange?.(pagination.page - 1);
12779
+ }
12780
+ };
12781
+ return /* @__PURE__ */ jsxRuntime.jsxs(EntryList, { children: [
12782
+ /* @__PURE__ */ jsxRuntime.jsxs(EntryList.Trim, { children: [
12783
+ /* @__PURE__ */ jsxRuntime.jsx(EntryList.Header, { columns: scoresListColumns }),
12784
+ errorMsg ? /* @__PURE__ */ jsxRuntime.jsx(EntryList.Message, { message: errorMsg, type: "error" }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: scores.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(EntryList.Entries, { children: scores.map((score) => {
12785
+ const createdAtDate = new Date(score.createdAt);
12786
+ const isTodayDate = dateFns.isToday(createdAtDate);
12787
+ const entry = {
12788
+ id: score.id,
12789
+ date: isTodayDate ? "Today" : dateFns.format(createdAtDate, "MMM dd"),
12790
+ time: dateFns.format(createdAtDate, "h:mm:ss aaa"),
12791
+ input: JSON.stringify(score?.input),
12792
+ entityId: score.entityId,
12793
+ score: score.score
12794
+ };
12795
+ return /* @__PURE__ */ jsxRuntime.jsx(
12796
+ EntryList.Entry,
12797
+ {
12798
+ entry,
12799
+ isSelected: selectedScoreId === score.id,
12800
+ columns: scoresListColumns,
12801
+ onClick: onScoreClick,
12802
+ children: scoresListColumns.map((col, index) => {
12803
+ const key = `${index}-${score.id}`;
12804
+ return /* @__PURE__ */ jsxRuntime.jsx(EntryList.EntryText, { children: entry?.[col.name] }, key);
12805
+ })
12806
+ },
12807
+ entry.id
12808
+ );
12809
+ }) }) : /* @__PURE__ */ jsxRuntime.jsx(EntryList.Message, { message: "No scores for this scorer yet" }) })
12810
+ ] }),
12811
+ /* @__PURE__ */ jsxRuntime.jsx(
12812
+ EntryList.Pagination,
12813
+ {
12814
+ currentPage: pagination?.page || 0,
12815
+ onNextPage: handleNextPage,
12816
+ onPrevPage: handlePrevPage,
12817
+ hasMore: scoresHasMore
12818
+ }
12819
+ )
12820
+ ] });
12821
+ }
12822
+
12823
+ function ScoreDialog({
12824
+ score,
12825
+ scorerName,
12826
+ isOpen,
12592
12827
  onClose,
12593
12828
  onNext,
12594
12829
  onPrevious,
12595
- computeTraceLink
12830
+ computeTraceLink,
12831
+ dialogLevel = 1,
12832
+ usageContext = "scorerPage"
12596
12833
  }) {
12597
12834
  const { Link } = useLinkComponent();
12598
12835
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -12602,77 +12839,144 @@ function ScoreDialog({
12602
12839
  dialogDescription: "View and analyze score details",
12603
12840
  isOpen,
12604
12841
  onClose,
12605
- className: cn("w-[calc(100vw-20rem)] max-w-[80%]", "3xl:max-w-[65%]", "4xl:max-w-[55%]"),
12842
+ level: dialogLevel,
12606
12843
  children: [
12607
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogTop, { onNext, onPrevious, showInnerNav: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[1rem] text-icon4 text-[0.875rem]", children: [
12608
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12844
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Top, { children: [
12845
+ usageContext === "scorerPage" && /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12609
12846
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
12610
12847
  " ",
12611
- scorer?.config?.name
12848
+ scorerName
12849
+ ] }),
12850
+ usageContext === "aiSpanDialog" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12851
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12852
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
12853
+ " ",
12854
+ getShortId(score?.traceId)
12855
+ ] }),
12856
+ score?.spanId && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
12857
+ "›",
12858
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12859
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
12860
+ getShortId(score?.spanId)
12861
+ ] })
12862
+ ] })
12612
12863
  ] }),
12613
12864
  "›",
12614
12865
  /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12615
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
12616
- score?.id
12617
- ] })
12618
- ] }) }),
12619
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-[1.5rem] px-[2.5rem] overflow-y-auto grid gap-[1.5rem] content-start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-[1.5rem] mb-[2rem]", children: [
12620
- score?.traceId && /* @__PURE__ */ jsxRuntime.jsx(
12621
- KeyValueList,
12622
- {
12623
- data: [
12624
- {
12625
- label: "Trace ID",
12626
- value: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: computeTraceLink(score?.traceId), children: score?.traceId }),
12627
- key: "traceId"
12628
- },
12629
- ...score?.spanId ? [
12866
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalculatorIcon, {}),
12867
+ getShortId(score?.id)
12868
+ ] }),
12869
+ "|",
12870
+ /* @__PURE__ */ jsxRuntime.jsx(SideDialog.Nav, { onNext, onPrevious })
12871
+ ] }),
12872
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Content, { children: [
12873
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Header, { children: [
12874
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Heading, { children: [
12875
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalculatorIcon, {}),
12876
+ " Score"
12877
+ ] }),
12878
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
12879
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
12880
+ " ",
12881
+ score?.id
12882
+ ] })
12883
+ ] }),
12884
+ /* @__PURE__ */ jsxRuntime.jsxs(Sections, { children: [
12885
+ /* @__PURE__ */ jsxRuntime.jsx(
12886
+ KeyValueList,
12887
+ {
12888
+ data: [
12889
+ ...usageContext === "aiSpanDialog" ? [
12890
+ {
12891
+ label: "Scorer",
12892
+ value: score?.scorer?.name || "-",
12893
+ key: "scorer-name"
12894
+ }
12895
+ ] : [],
12630
12896
  {
12631
- label: "Span ID",
12632
- value: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: computeTraceLink(score?.traceId, score?.spanId), children: score?.spanId }),
12633
- key: "spanId"
12634
- }
12635
- ] : []
12636
- ],
12637
- LinkComponent: Link
12638
- }
12639
- ),
12640
- /* @__PURE__ */ jsxRuntime.jsx(
12641
- SideDialogCodeSection,
12642
- {
12643
- title: `Score: ${Number.isNaN(score?.score) ? "n/a" : score?.score}`,
12644
- codeStr: score?.reason,
12645
- simplified: true
12646
- }
12647
- ),
12648
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Input", codeStr: JSON.stringify(score?.input || null, null, 2) }),
12649
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Output", codeStr: JSON.stringify(score?.output || null, null, 2) }),
12650
- /* @__PURE__ */ jsxRuntime.jsx(
12651
- SideDialogCodeSection,
12652
- {
12653
- title: "Preprocess Prompt",
12654
- codeStr: score?.preprocessPrompt || "null",
12655
- simplified: true
12656
- }
12657
- ),
12658
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Analyze Prompt", codeStr: score?.analyzePrompt || "null", simplified: true }),
12659
- /* @__PURE__ */ jsxRuntime.jsx(
12660
- SideDialogCodeSection,
12661
- {
12662
- title: "Generate Score Prompt",
12663
- codeStr: score?.generateScorePrompt || "null",
12664
- simplified: true
12665
- }
12666
- ),
12667
- /* @__PURE__ */ jsxRuntime.jsx(
12668
- SideDialogCodeSection,
12669
- {
12670
- title: "Generate Reason Prompt",
12671
- codeStr: score?.generateReasonPrompt || "null",
12672
- simplified: true
12673
- }
12674
- )
12675
- ] }) })
12897
+ label: "Created at",
12898
+ value: score?.createdAt ? format.format(new Date(score?.createdAt), "MMM d, h:mm:ss aaa") : "n/a",
12899
+ key: "date"
12900
+ },
12901
+ ...usageContext !== "aiSpanDialog" ? [
12902
+ {
12903
+ label: "Trace ID",
12904
+ value: score?.traceId ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: computeTraceLink(score?.traceId), children: score?.traceId }) : "n/a",
12905
+ key: "traceId"
12906
+ },
12907
+ {
12908
+ label: "Span ID",
12909
+ value: score?.traceId && score?.spanId ? /* @__PURE__ */ jsxRuntime.jsx(Link, { href: computeTraceLink(score?.traceId, score?.spanId), children: score?.spanId }) : "n/a",
12910
+ key: "spanId"
12911
+ }
12912
+ ] : []
12913
+ ],
12914
+ LinkComponent: Link
12915
+ }
12916
+ ),
12917
+ /* @__PURE__ */ jsxRuntime.jsx(
12918
+ SideDialog.CodeSection,
12919
+ {
12920
+ title: `Score: ${Number.isNaN(score?.score) ? "n/a" : score?.score}`,
12921
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
12922
+ codeStr: score?.reason || "null",
12923
+ simplified: true
12924
+ }
12925
+ ),
12926
+ /* @__PURE__ */ jsxRuntime.jsx(
12927
+ SideDialog.CodeSection,
12928
+ {
12929
+ title: "Input",
12930
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileInputIcon, {}),
12931
+ codeStr: JSON.stringify(score?.input || null, null, 2)
12932
+ }
12933
+ ),
12934
+ /* @__PURE__ */ jsxRuntime.jsx(
12935
+ SideDialog.CodeSection,
12936
+ {
12937
+ title: "Output",
12938
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileOutputIcon, {}),
12939
+ codeStr: JSON.stringify(score?.output || null, null, 2)
12940
+ }
12941
+ ),
12942
+ /* @__PURE__ */ jsxRuntime.jsx(
12943
+ SideDialog.CodeSection,
12944
+ {
12945
+ title: "Preprocess Prompt",
12946
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ReceiptText, {}),
12947
+ codeStr: score?.preprocessPrompt || "null",
12948
+ simplified: true
12949
+ }
12950
+ ),
12951
+ /* @__PURE__ */ jsxRuntime.jsx(
12952
+ SideDialog.CodeSection,
12953
+ {
12954
+ title: "Analyze Prompt",
12955
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ReceiptText, {}),
12956
+ codeStr: score?.analyzePrompt || "null",
12957
+ simplified: true
12958
+ }
12959
+ ),
12960
+ /* @__PURE__ */ jsxRuntime.jsx(
12961
+ SideDialog.CodeSection,
12962
+ {
12963
+ title: "Generate Score Prompt",
12964
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ReceiptText, {}),
12965
+ codeStr: score?.generateScorePrompt || "null",
12966
+ simplified: true
12967
+ }
12968
+ ),
12969
+ /* @__PURE__ */ jsxRuntime.jsx(
12970
+ SideDialog.CodeSection,
12971
+ {
12972
+ title: "Generate Reason Prompt",
12973
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ReceiptText, {}),
12974
+ codeStr: score?.generateReasonPrompt || "null",
12975
+ simplified: true
12976
+ }
12977
+ )
12978
+ ] })
12979
+ ] })
12676
12980
  ]
12677
12981
  }
12678
12982
  );
@@ -12813,7 +13117,7 @@ function ScorersTable({ scorers, isLoading }) {
12813
13117
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyScorersTable, {});
12814
13118
  }
12815
13119
  const filteredRows = rows.filter((row) => row.original.scorer.config.name.toLowerCase().includes(search.toLowerCase()));
12816
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13120
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
12817
13121
  /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search scorers", placeholder: "Search scorers" }) }),
12818
13122
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ScorersTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
12819
13123
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
@@ -12849,6 +13153,18 @@ const EmptyScorersTable = () => /* @__PURE__ */ jsxRuntime.jsx("div", { classNam
12849
13153
  }
12850
13154
  ) });
12851
13155
 
13156
+ const useTraceSpanScores = ({ traceId = "", spanId = "", page }) => {
13157
+ const client = react$3.useMastraClient();
13158
+ return reactQuery.useQuery({
13159
+ queryKey: ["trace-span-scores", traceId, spanId, page],
13160
+ queryFn: () => client.getScoresBySpan({ traceId, spanId, page: page || 0, perPage: 10 }),
13161
+ enabled: !!traceId && !!spanId,
13162
+ refetchInterval: 3e3,
13163
+ gcTime: 0,
13164
+ staleTime: 0
13165
+ });
13166
+ };
13167
+
12852
13168
  const AgentMetadataModelSwitcher = ({
12853
13169
  defaultProvider,
12854
13170
  defaultModel,
@@ -13095,6 +13411,7 @@ const AgentMetadataModelSwitcher = ({
13095
13411
  /* @__PURE__ */ jsxRuntime.jsx(
13096
13412
  Input,
13097
13413
  {
13414
+ "aria-label": "Search providers",
13098
13415
  spellCheck: "false",
13099
13416
  ref: providerInputRef,
13100
13417
  className: `w-full ${!isSearchingProvider && currentModelProvider ? "pl-8 pr-8" : ""}`,
@@ -13133,20 +13450,6 @@ const AgentMetadataModelSwitcher = ({
13133
13450
  handleProviderSelect(provider);
13134
13451
  }
13135
13452
  break;
13136
- case "Tab":
13137
- if (!e.shiftKey) {
13138
- e.preventDefault();
13139
- if (highlightedProviderIndex >= 0 && highlightedProviderIndex < filteredProviders2.length) {
13140
- const provider = filteredProviders2[highlightedProviderIndex];
13141
- handleProviderSelect(provider);
13142
- } else {
13143
- setShowProviderSuggestions(false);
13144
- setIsSearchingProvider(false);
13145
- setProviderSearch("");
13146
- setHighlightedProviderIndex(-1);
13147
- }
13148
- }
13149
- break;
13150
13453
  case "Escape":
13151
13454
  e.preventDefault();
13152
13455
  setIsSearchingProvider(false);
@@ -13155,8 +13458,6 @@ const AgentMetadataModelSwitcher = ({
13155
13458
  setShowProviderSuggestions(false);
13156
13459
  break;
13157
13460
  }
13158
- } else if (e.key === "Tab") {
13159
- return;
13160
13461
  }
13161
13462
  },
13162
13463
  onFocus: () => {
@@ -13248,6 +13549,7 @@ const AgentMetadataModelSwitcher = ({
13248
13549
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
13249
13550
  Input,
13250
13551
  {
13552
+ "aria-label": "Search models",
13251
13553
  spellCheck: "false",
13252
13554
  ref: modelInputRef,
13253
13555
  className: "w-full xl:w-3/5",
@@ -13300,7 +13602,6 @@ const AgentMetadataModelSwitcher = ({
13300
13602
  }, 0);
13301
13603
  break;
13302
13604
  case "Enter":
13303
- case "Tab":
13304
13605
  e.preventDefault();
13305
13606
  if (highlightedModelIndex >= 0 && highlightedModelIndex < filteredModels.length) {
13306
13607
  const model = filteredModels[highlightedModelIndex];
@@ -13545,7 +13846,7 @@ const AgentMetadataNetworkList = ({ agents }) => {
13545
13846
  if (agents.length === 0) {
13546
13847
  return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListEmpty, { children: "No agents" });
13547
13848
  }
13548
- return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.agentLink(agent.id), children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "success", icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, {}), children: agent.name }) }) }, agent.id)) });
13849
+ return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: agents.map((agent) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.agentLink(agent.id), "data-testid": "agent-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "success", icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, {}), children: agent.name }) }) }, agent.id)) });
13549
13850
  };
13550
13851
  const AgentMetadata = ({
13551
13852
  agentId,
@@ -13601,7 +13902,10 @@ const AgentMetadata = ({
13601
13902
  link: "https://mastra.ai/en/docs/agents/agent-memory",
13602
13903
  title: "Agent Memory documentation"
13603
13904
  },
13604
- children: hasMemoryEnabled ? /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(MemoryIcon, {}), variant: "success", className: "font-medium", children: "On" }) : /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "warning", children: [
13905
+ children: hasMemoryEnabled ? /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(MemoryIcon, {}), variant: "success", className: "font-medium", children: [
13906
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Memory is enabled" }),
13907
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "On" })
13908
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "warning", children: [
13605
13909
  /* @__PURE__ */ jsxRuntime.jsx(AlertTitle$1, { as: "h5", children: "Memory not enabled" }),
13606
13910
  /* @__PURE__ */ jsxRuntime.jsxs(AlertDescription$1, { as: "p", children: [
13607
13911
  "Thread messages will not be stored. To activate memory, see the",
@@ -13663,14 +13967,14 @@ const AgentMetadataToolList = ({ tools, agentId }) => {
13663
13967
  if (tools.length === 0) {
13664
13968
  return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListEmpty, { children: "No tools" });
13665
13969
  }
13666
- return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: tools.map((tool) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.agentToolLink(agentId, tool.id), children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "text-[#ECB047]" }), children: tool.id }) }) }, tool.id)) });
13970
+ return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: tools.map((tool) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.agentToolLink(agentId, tool.id), "data-testid": "tool-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "text-[#ECB047]" }), children: tool.id }) }) }, tool.id)) });
13667
13971
  };
13668
13972
  const AgentMetadataWorkflowList = ({ workflows }) => {
13669
13973
  const { Link, paths } = useLinkComponent();
13670
13974
  if (workflows.length === 0) {
13671
13975
  return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListEmpty, { children: "No workflows" });
13672
13976
  }
13673
- return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: workflows.map((workflow) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.workflowLink(workflow.id), children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, { className: "text-accent3" }), children: workflow.name }) }) }, workflow.id)) });
13977
+ return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: workflows.map((workflow) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.workflowLink(workflow.id), "data-testid": "workflow-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, { className: "text-accent3" }), children: workflow.name }) }) }, workflow.id)) });
13674
13978
  };
13675
13979
  const AgentMetadataScorerList = ({ entityId, entityType }) => {
13676
13980
  const { Link, paths } = useLinkComponent();
@@ -13688,7 +13992,7 @@ const AgentMetadataScorerList = ({ entityId, entityType }) => {
13688
13992
  if (scorerList.length === 0) {
13689
13993
  return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListEmpty, { children: "No Scorers" });
13690
13994
  }
13691
- return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: scorerList.map((scorer) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.scorerLink(scorer.id), children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, { className: "text-icon3" }), children: scorer.scorer.config.name }) }) }, scorer.id)) });
13995
+ return /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataList, { children: scorerList.map((scorer) => /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.scorerLink(scorer.id), "data-testid": "scorer-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, { className: "text-icon3" }), children: scorer.scorer.config.name }) }) }, scorer.id)) });
13692
13996
  };
13693
13997
 
13694
13998
  const AgentMetadataPrompt = ({ prompt }) => {
@@ -13983,7 +14287,7 @@ function ToolTable({ tools, agents, isLoading }) {
13983
14287
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyToolsTable, {});
13984
14288
  }
13985
14289
  const filteredRows = rows.filter((row) => row.original.id.toLowerCase().includes(search.toLowerCase()));
13986
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14290
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
13987
14291
  /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search tools", placeholder: "Search tools" }) }),
13988
14292
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ToolTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
13989
14293
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(Th, { style: { width: header.column.getSize() ?? "auto" }, children: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
@@ -15694,6 +15998,45 @@ function TreePositionMark({ isLastChild, hasChildren = false }) {
15694
15998
  );
15695
15999
  }
15696
16000
 
16001
+ function TraceTimeline({ hierarchicalSpans = [], onSpanClick, selectedSpanId, isLoading }) {
16002
+ const overallLatency = hierarchicalSpans?.[0]?.latency || 0;
16003
+ const overallStartTime = hierarchicalSpans?.[0]?.startTime || "";
16004
+ const overallEndTime = hierarchicalSpans?.[0]?.endTime || "";
16005
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(
16006
+ "div",
16007
+ {
16008
+ className: cn(
16009
+ "flex items-center text-[0.875rem] gap-[1rem] bg-surface3/50 rounded-md p-[1.5rem] justify-center text-icon3",
16010
+ "[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"
16011
+ ),
16012
+ children: [
16013
+ /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
16014
+ " Loading Trace Timeline ..."
16015
+ ]
16016
+ }
16017
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
16018
+ "div",
16019
+ {
16020
+ className: cn("grid items-start content-start gap-y-[2px] overflow-hidden", "xl:gap-x-[1rem] xl:py-[1rem]", {
16021
+ "xl:grid-cols-[3fr_auto]": !overallEndTime,
16022
+ "xl:grid-cols-[3fr_2fr]": overallEndTime
16023
+ }),
16024
+ children: hierarchicalSpans?.map((span) => /* @__PURE__ */ jsxRuntime.jsx(
16025
+ TraceTimelineSpan,
16026
+ {
16027
+ span,
16028
+ onSpanClick,
16029
+ selectedSpanId,
16030
+ overallLatency,
16031
+ overallStartTime,
16032
+ overallEndTime
16033
+ },
16034
+ span.id
16035
+ ))
16036
+ }
16037
+ ) });
16038
+ }
16039
+
15697
16040
  function TraceTimelineLegend({ spans = [] }) {
15698
16041
  const activeSpanTypes = spanTypePrefixes.filter(
15699
16042
  (typePrefix) => spans.some((span) => span?.spanType?.startsWith(typePrefix))
@@ -15707,65 +16050,6 @@ function TraceTimelineLegend({ spans = [] }) {
15707
16050
  }) });
15708
16051
  }
15709
16052
 
15710
- function TraceTimeline({
15711
- spans = [],
15712
- hierarchicalSpans = [],
15713
- onSpanClick,
15714
- selectedSpanId,
15715
- isLoading,
15716
- className
15717
- }) {
15718
- const overallLatency = hierarchicalSpans?.[0]?.latency || 0;
15719
- const overallStartTime = hierarchicalSpans?.[0]?.startTime || "";
15720
- const overallEndTime = hierarchicalSpans?.[0]?.endTime || "";
15721
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("grid gap-[1rem]", className), children: [
15722
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full justify-between pr-[2.5rem]", children: [
15723
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { as: "h2", children: [
15724
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListTreeIcon, {}),
15725
- " Timeline"
15726
- ] }),
15727
- /* @__PURE__ */ jsxRuntime.jsx(TraceTimelineLegend, { spans })
15728
- ] }),
15729
- isLoading ? /* @__PURE__ */ jsxRuntime.jsxs(
15730
- "div",
15731
- {
15732
- className: cn(
15733
- "flex items-center text-[0.875rem] gap-[1rem] bg-surface3/50 rounded-md p-[1.5rem] mr-[1.5rem] justify-center text-icon3 mt-[.5rem]",
15734
- "[&_svg]:w-[1.25em] [&_svg]:h-[1.25em] [&_svg]:opacity-50"
15735
- ),
15736
- children: [
15737
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
15738
- " Loading Trace Timeline ..."
15739
- ]
15740
- }
15741
- ) : /* @__PURE__ */ jsxRuntime.jsx(
15742
- "div",
15743
- {
15744
- className: cn(
15745
- "grid items-start content-start gap-y-[2px] bg-surface2 rounded-lg overflow-hidden pl-[1.5rem] py-[1.5rem]",
15746
- "xl:gap-x-[1rem] xl:py-[1rem]",
15747
- {
15748
- "xl:grid-cols-[3fr_auto]": !overallEndTime,
15749
- "xl:grid-cols-[3fr_2fr]": overallEndTime
15750
- }
15751
- ),
15752
- children: hierarchicalSpans?.map((span) => /* @__PURE__ */ jsxRuntime.jsx(
15753
- TraceTimelineSpan,
15754
- {
15755
- span,
15756
- onSpanClick,
15757
- selectedSpanId,
15758
- overallLatency,
15759
- overallStartTime,
15760
- overallEndTime
15761
- },
15762
- span.id
15763
- ))
15764
- }
15765
- )
15766
- ] });
15767
- }
15768
-
15769
16053
  function TraceSpanUsage({ traceUsage, traceSpans = [], spanUsage, className }) {
15770
16054
  if (!traceUsage && !spanUsage) {
15771
16055
  console.warn("No usage data available");
@@ -15878,12 +16162,11 @@ function TraceSpanUsage({ traceUsage, traceSpans = [], spanUsage, className }) {
15878
16162
  icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CoinsIcon, {})
15879
16163
  }
15880
16164
  };
15881
- let tokenPresentations = {};
15882
- if (hasV5Format) {
15883
- tokenPresentations = { ...commonTokenPresentations, ...v5TokenPresentations };
15884
- } else {
15885
- tokenPresentations = { ...commonTokenPresentations, ...legacyTokenPresentations };
15886
- }
16165
+ let tokenPresentations = {
16166
+ ...commonTokenPresentations,
16167
+ ...v5TokenPresentations,
16168
+ ...legacyTokenPresentations
16169
+ };
15887
16170
  let usageKeyOrder = [];
15888
16171
  if (hasV5Format) {
15889
16172
  usageKeyOrder = ["totalTokens", "inputTokens", "outputTokens", "reasoningTokens", "cachedInputTokens"];
@@ -15891,55 +16174,42 @@ function TraceSpanUsage({ traceUsage, traceSpans = [], spanUsage, className }) {
15891
16174
  usageKeyOrder = ["totalTokens", "promptTokens", "completionTokens"];
15892
16175
  }
15893
16176
  const usageAsArray = Object.entries(traceUsage || spanUsage || {}).map(([key, value]) => ({ key, value })).sort((a, b) => usageKeyOrder.indexOf(a.key) - usageKeyOrder.indexOf(b.key));
15894
- return /* @__PURE__ */ jsxRuntime.jsx(
16177
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex gap-[1.5rem] flex-wrap", className), children: usageAsArray.map(({ key, value }) => /* @__PURE__ */ jsxRuntime.jsxs(
15895
16178
  "div",
15896
16179
  {
15897
- className: cn(
15898
- "grid gap-[1.5rem]",
15899
- {
15900
- "xl:grid-cols-3": usageAsArray.length === 3,
15901
- "xl:grid-cols-2": usageAsArray.length === 2
15902
- },
15903
- className
15904
- ),
15905
- children: usageAsArray.map(({ key, value }) => /* @__PURE__ */ jsxRuntime.jsxs(
15906
- "div",
15907
- {
15908
- className: cn("bg-white/5 p-[1rem] px-[1.25rem] rounded-lg text-[0.875rem]", {
15909
- "min-h-[5.5rem]": traceUsage
15910
- }),
15911
- children: [
15912
- /* @__PURE__ */ jsxRuntime.jsxs(
15913
- "div",
15914
- {
15915
- className: cn(
15916
- "grid grid-cols-[1.5rem_1fr_auto] gap-[.5rem] items-center",
15917
- "[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-70"
15918
- ),
15919
- children: [
15920
- tokenPresentations?.[key]?.icon,
15921
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem]", children: tokenPresentations?.[key]?.label }),
15922
- /* @__PURE__ */ jsxRuntime.jsx("b", { className: "text-[1rem]", children: value })
15923
- ]
15924
- }
16180
+ className: cn("bg-white/5 p-[.75rem] px-[1rem] rounded-lg text-[0.875rem] flex-grow", {
16181
+ "min-h-[5.5rem]": traceUsage
16182
+ }),
16183
+ children: [
16184
+ /* @__PURE__ */ jsxRuntime.jsxs(
16185
+ "div",
16186
+ {
16187
+ className: cn(
16188
+ "grid grid-cols-[1.5rem_1fr_auto] gap-[.5rem] items-center",
16189
+ "[&>svg]:w-[1.5em] [&>svg]:h-[1.5em] [&>svg]:opacity-70"
15925
16190
  ),
15926
- tokensByProviderValid && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[0.875rem] mt-[0.5rem] pl-[2rem] ", children: Object.entries(tokensByProvider).map(([provider, providerTokens]) => /* @__PURE__ */ jsxRuntime.jsxs(
15927
- "dl",
15928
- {
15929
- className: "grid grid-cols-[1fr_auto] gap-x-[1rem] gap-y-[.25rem] justify-between text-icon3",
15930
- children: [
15931
- /* @__PURE__ */ jsxRuntime.jsx("dt", { children: provider }),
15932
- /* @__PURE__ */ jsxRuntime.jsx("dd", { children: providerTokens?.[key] })
15933
- ]
15934
- },
15935
- provider
15936
- )) })
15937
- ]
15938
- },
15939
- key
15940
- ))
15941
- }
15942
- );
16191
+ children: [
16192
+ tokenPresentations?.[key]?.icon,
16193
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.875rem]", children: tokenPresentations?.[key]?.label }),
16194
+ /* @__PURE__ */ jsxRuntime.jsx("b", { className: "text-[1rem]", children: value })
16195
+ ]
16196
+ }
16197
+ ),
16198
+ tokensByProviderValid && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[0.875rem] mt-[0.5rem] pl-[2rem]", children: Object.entries(tokensByProvider).map(([provider, providerTokens]) => /* @__PURE__ */ jsxRuntime.jsxs(
16199
+ "dl",
16200
+ {
16201
+ className: "grid grid-cols-[1fr_auto] gap-x-[1rem] gap-y-[.25rem] justify-between text-icon3",
16202
+ children: [
16203
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { children: provider }),
16204
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { children: providerTokens?.[key] })
16205
+ ]
16206
+ },
16207
+ provider
16208
+ )) })
16209
+ ]
16210
+ },
16211
+ key
16212
+ )) });
15943
16213
  }
15944
16214
 
15945
16215
  function useTraceInfo(trace) {
@@ -16022,253 +16292,199 @@ function getSpanInfo({ span, withTraceId = true, withSpanId = true }) {
16022
16292
  return baseInfo;
16023
16293
  }
16024
16294
 
16025
- const ScoreTable = ({ scores, onItemClick }) => {
16026
- return /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
16027
- /* @__PURE__ */ jsxRuntime.jsxs(Thead, { children: [
16028
- /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Type" }),
16029
- /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Scorer" }),
16030
- /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Score" }),
16031
- /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Created At" })
16032
- ] }),
16033
- /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: scores.map((score) => /* @__PURE__ */ jsxRuntime.jsxs(Row, { onClick: () => onItemClick(score.scorerName), children: [
16034
- /* @__PURE__ */ jsxRuntime.jsx(TxtCell, { children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { children: score.type }) }),
16035
- /* @__PURE__ */ jsxRuntime.jsx(TxtCell, { children: score.scorerName }),
16036
- /* @__PURE__ */ jsxRuntime.jsx(TxtCell, { children: score.score }),
16037
- /* @__PURE__ */ jsxRuntime.jsx(DateTimeCell, { dateTime: new Date(score.createdAt) })
16038
- ] }, score.scoreId)) })
16039
- ] });
16295
+ const TabsRoot = ({
16296
+ children,
16297
+ defaultTab,
16298
+ value,
16299
+ onValueChange,
16300
+ className
16301
+ }) => {
16302
+ const [internalTab, setInternalTab] = React.useState(defaultTab);
16303
+ const isControlled = value !== void 0 && onValueChange !== void 0;
16304
+ const currentTab = isControlled ? value : internalTab;
16305
+ const handleTabChange = (newValue) => {
16306
+ const typedValue = newValue;
16307
+ if (isControlled) {
16308
+ onValueChange(typedValue);
16309
+ } else {
16310
+ setInternalTab(typedValue);
16311
+ }
16312
+ };
16313
+ return /* @__PURE__ */ jsxRuntime.jsx(
16314
+ TabsPrimitive__namespace.Root,
16315
+ {
16316
+ value: currentTab,
16317
+ onValueChange: handleTabChange,
16318
+ className: cn("grid gap-[3rem] overflow-y-auto", className),
16319
+ children
16320
+ }
16321
+ );
16040
16322
  };
16041
16323
 
16042
- function SpanDetails({ span, onScorerTriggered }) {
16043
- if (!span) {
16044
- return null;
16045
- }
16046
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-[1.5rem] mb-[2rem]", children: [
16047
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Input", codeStr: JSON.stringify(span.input || null, null, 2) }),
16048
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Output", codeStr: JSON.stringify(span.output || null, null, 2) }),
16049
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Metadata", codeStr: JSON.stringify(span.metadata || null, null, 2) }),
16050
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogCodeSection, { title: "Attributes", codeStr: JSON.stringify(span.attributes || null, null, 2) }),
16051
- span?.links?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-[2.5rem] pr-[2.5rem]", children: [
16052
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { as: "h2", className: "pb-[1rem]", children: [
16053
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
16054
- " Scores"
16055
- ] }),
16056
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface2 rounded-lg overflow-hidden border-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(
16057
- ScoreTable,
16324
+ const TabList = ({ children, variant = "default", className }) => {
16325
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(
16326
+ TabsPrimitive__namespace.List,
16327
+ {
16328
+ className: cn(
16329
+ "flex items-center",
16058
16330
  {
16059
- scores: span?.links,
16060
- onItemClick: (scorerName) => onScorerTriggered(scorerName, span.traceId, span.spanId)
16061
- }
16062
- ) })
16063
- ] })
16064
- ] });
16065
- }
16331
+ // variant: default
16332
+ "text-[0.9375rem]": variant === "default",
16333
+ "[&>button]:py-[0.5rem] [&>button]:px-[1.5rem] [&>button]:font-normal [&>button]:text-icon3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1": variant === "default",
16334
+ "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:transition-colors [&>button[data-state=active]]:duration-200 [&>button[data-state=active]]:border-icon3": variant === "default",
16335
+ // variant: buttons
16336
+ "border border-border1 flex justify-stretch rounded-md overflow-hidden text-[0.875rem] min-h-[2.5rem]": variant === "buttons",
16337
+ "[&>button]:flex-1 [&>button]:py-[0.5rem] [&>button]:px-[1rem] [&>button]:text-icon3": variant === "buttons",
16338
+ "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:bg-[#222]": variant === "buttons"
16339
+ },
16340
+ className
16341
+ ),
16342
+ children
16343
+ }
16344
+ ) });
16345
+ };
16066
16346
 
16067
- const DropdownMenu = DropdownMenuPrimitive__namespace.Root;
16068
- const DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
16069
- const DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
16070
- const DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
16071
- const DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
16072
- const DropdownMenuTrigger = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Trigger, { ref, className: cn("cursor-pointer focus-visible:rounded", className), ...props, children }));
16073
- DropdownMenuTrigger.displayName = DropdownMenuPrimitive__namespace.Trigger.displayName;
16074
- const DropdownMenuSubTrigger = React__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
16075
- DropdownMenuPrimitive__namespace.SubTrigger,
16076
- {
16077
- ref,
16078
- className: cn(
16079
- "focus:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm",
16080
- inset && "pl-8",
16081
- className
16082
- ),
16083
- ...props,
16084
- children: [
16085
- children,
16086
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "ml-auto -rotate-90" })
16087
- ]
16088
- }
16089
- ));
16090
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
16091
- const DropdownMenuSubContent = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
16092
- DropdownMenuPrimitive__namespace.SubContent,
16093
- {
16094
- ref,
16095
- className: cn(
16096
- "popover-background data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-50 min-w-[8rem] overflow-auto overflow-x-hidden rounded-none p-1",
16097
- className
16098
- ),
16099
- ...props
16100
- }
16101
- ));
16102
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
16103
- const DropdownMenuContent = React__namespace.forwardRef(({ className, container, sideOffset = 4, ...props }, ref) => {
16104
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
16105
- DropdownMenuPrimitive__namespace.Content,
16347
+ const Tab = ({ children, value, onClick, className }) => {
16348
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, { value, className: cn("hover:text-icon5", className), onClick, children });
16349
+ };
16350
+
16351
+ const TabContent = ({ children, value, className }) => {
16352
+ return /* @__PURE__ */ jsxRuntime.jsx(
16353
+ TabsPrimitive__namespace.Content,
16106
16354
  {
16107
- ref,
16108
- sideOffset,
16109
- className: clsx(
16110
- "data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 bg-surface2 text-icon3 border-sm border-border1 z-50 min-w-[8rem] overflow-auto rounded-md p-1 shadow-md",
16355
+ value,
16356
+ className: cn(
16357
+ "grid overflow-y-auto ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:none",
16111
16358
  className
16112
16359
  ),
16113
- ...props
16360
+ children
16114
16361
  }
16115
- ) });
16362
+ );
16363
+ };
16364
+
16365
+ const Tabs = Object.assign(TabsRoot, {
16366
+ List: TabList,
16367
+ Tab,
16368
+ Content: TabContent
16116
16369
  });
16117
- DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
16118
- const DropdownMenuItem = React__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
16119
- DropdownMenuPrimitive__namespace.Item,
16120
- {
16121
- ref,
16122
- className: cn(
16123
- "focus:text-accent-foreground relative flex cursor-default cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 font-sans text-[0.8125rem] transition-colors focus:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>span]:truncate",
16124
- inset && "pl-8",
16125
- className
16126
- ),
16127
- ...props
16370
+
16371
+ function SpanDetails({ span }) {
16372
+ if (!span) {
16373
+ return null;
16128
16374
  }
16129
- ));
16130
- DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
16131
- const DropdownMenuCheckboxItem = React__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
16132
- DropdownMenuPrimitive__namespace.CheckboxItem,
16133
- {
16134
- ref,
16135
- className: cn(
16136
- "focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default cursor-pointer select-none items-center gap-4 rounded-sm px-2 py-1.5 text-sm transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
16137
- className
16375
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16376
+ /* @__PURE__ */ jsxRuntime.jsx(
16377
+ SideDialog.CodeSection,
16378
+ {
16379
+ title: "Input",
16380
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileInputIcon, {}),
16381
+ codeStr: JSON.stringify(span.input || null, null, 2)
16382
+ }
16138
16383
  ),
16139
- checked,
16140
- ...props,
16141
- children: [
16142
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-sm border-border1 flex h-4 w-4 items-center justify-center rounded-sm", children: checked && /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, {}) }) }),
16143
- children
16144
- ]
16145
- }
16146
- ));
16147
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
16148
- const DropdownMenuRadioItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
16149
- DropdownMenuPrimitive__namespace.RadioItem,
16150
- {
16151
- ref,
16152
- className: cn(
16153
- "focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm transition-colors focus:bg-[#66686A]/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
16154
- className
16384
+ /* @__PURE__ */ jsxRuntime.jsx(
16385
+ SideDialog.CodeSection,
16386
+ {
16387
+ title: "Output",
16388
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileOutputIcon, {}),
16389
+ codeStr: JSON.stringify(span.output || null, null, 2)
16390
+ }
16155
16391
  ),
16156
- ...props,
16157
- children: [
16158
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-2 w-2 fill-current" }) }) }),
16159
- children
16160
- ]
16161
- }
16162
- ));
16163
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
16164
- const DropdownMenuLabel = React__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
16165
- DropdownMenuPrimitive__namespace.Label,
16166
- {
16167
- ref,
16168
- className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
16169
- ...props
16170
- }
16171
- ));
16172
- DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
16173
- const DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
16174
- DropdownMenuPrimitive__namespace.Separator,
16175
- {
16176
- ref,
16177
- className: cn("popover-dividers-bg -mx-1 my-1 h-px", className),
16178
- ...props
16179
- }
16180
- ));
16181
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
16182
- const DropdownMenuShortcut = ({ className, ...props }) => {
16183
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props });
16184
- };
16185
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
16186
- function Dropdown({
16187
- open,
16188
- onOpenChange,
16189
- children,
16190
- modal
16191
- }) {
16192
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu, { modal, open, onOpenChange, children });
16193
- }
16194
- Dropdown.Trigger = DropdownMenuTrigger;
16195
- Dropdown.Content = DropdownMenuContent;
16196
- Dropdown.Group = DropdownMenuGroup;
16197
- Dropdown.Portal = DropdownMenuPortal;
16198
- Dropdown.Item = DropdownMenuItem;
16199
- Dropdown.CheckboxItem = DropdownMenuCheckboxItem;
16200
- Dropdown.RadioItem = DropdownMenuRadioItem;
16201
- Dropdown.Label = DropdownMenuLabel;
16202
- Dropdown.Separator = DropdownMenuSeparator;
16203
- Dropdown.Shortcut = DropdownMenuShortcut;
16204
- Dropdown.Sub = DropdownMenuSub;
16205
- Dropdown.SubContent = DropdownMenuSubContent;
16206
- Dropdown.SubTrigger = DropdownMenuSubTrigger;
16207
- Dropdown.RadioGroup = DropdownMenuRadioGroup;
16208
-
16209
- const useTriggerScorer = (onScorerTriggered) => {
16210
- const client = react$3.useMastraClient();
16211
- return reactQuery.useMutation({
16212
- mutationFn: async ({ scorerName, traceId, spanId }) => {
16213
- const response = await client.score({
16214
- scorerName,
16215
- targets: [{ traceId, spanId }]
16216
- });
16217
- return response;
16218
- },
16219
- onSuccess: (_, variables) => {
16220
- sonner.toast.success("Scorer triggered successfully");
16221
- onScorerTriggered(variables.scorerName, variables.traceId, variables.spanId);
16222
- },
16223
- onError: () => {
16224
- sonner.toast.error("Error triggering scorer");
16225
- }
16226
- });
16227
- };
16392
+ /* @__PURE__ */ jsxRuntime.jsx(
16393
+ SideDialog.CodeSection,
16394
+ {
16395
+ title: "Metadata",
16396
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BracesIcon, {}),
16397
+ codeStr: JSON.stringify(span.metadata || null, null, 2)
16398
+ }
16399
+ ),
16400
+ /* @__PURE__ */ jsxRuntime.jsx(
16401
+ SideDialog.CodeSection,
16402
+ {
16403
+ title: "Attributes",
16404
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BracesIcon, {}),
16405
+ codeStr: JSON.stringify(span.attributes || null, null, 2)
16406
+ }
16407
+ )
16408
+ ] });
16409
+ }
16228
16410
 
16229
- const ScorersDropdown = ({ trace, spanId, onScorerTriggered, entityType }) => {
16230
- const { data: scorers = {}, isLoading } = useScorers();
16231
- const { mutate: triggerScorer, isPending } = useTriggerScorer(onScorerTriggered);
16232
- let scorerList = Object.entries(scorers).map(([key, scorer]) => ({
16233
- id: key,
16234
- name: scorer.scorer.config.name,
16235
- description: scorer.scorer.config.description,
16236
- isRegistered: scorer.isRegistered,
16237
- type: scorer.scorer.config.type
16238
- })).filter((scorer) => scorer.isRegistered);
16239
- if (entityType !== "Agent" || spanId) {
16240
- scorerList = scorerList.filter((scorer) => scorer.type !== "agent");
16411
+ function SpanTabs({
16412
+ trace,
16413
+ span,
16414
+ spanScoresData,
16415
+ onSpanScoresPageChange,
16416
+ isLoadingSpanScoresData,
16417
+ spanInfo = [],
16418
+ defaultActiveTab = "details",
16419
+ initialScoreId,
16420
+ computeTraceLink
16421
+ }) {
16422
+ const { Link } = useLinkComponent();
16423
+ let entityType;
16424
+ if (span?.attributes?.agentId) {
16425
+ entityType = "Agent";
16426
+ } else if (span?.attributes?.workflowId) {
16427
+ entityType = "Workflow";
16241
16428
  }
16242
- const isWaiting = isPending || isLoading;
16243
- return /* @__PURE__ */ jsxRuntime.jsxs(Dropdown, { children: [
16244
- /* @__PURE__ */ jsxRuntime.jsx(Dropdown.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(Button$1, { variant: "light", disabled: isWaiting, children: [
16245
- isWaiting ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}) }),
16246
- "Run scorer",
16247
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) })
16429
+ return /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultTab: defaultActiveTab, children: [
16430
+ /* @__PURE__ */ jsxRuntime.jsxs(Tabs.List, { children: [
16431
+ /* @__PURE__ */ jsxRuntime.jsx(Tabs.Tab, { value: "details", children: "Details" }),
16432
+ /* @__PURE__ */ jsxRuntime.jsxs(Tabs.Tab, { value: "scores", children: [
16433
+ "Scoring ",
16434
+ spanScoresData?.pagination && `(${spanScoresData.pagination.total || 0})`
16435
+ ] })
16436
+ ] }),
16437
+ /* @__PURE__ */ jsxRuntime.jsx(Tabs.Content, { value: "details", children: /* @__PURE__ */ jsxRuntime.jsxs(Sections, { children: [
16438
+ span?.attributes?.usage && /* @__PURE__ */ jsxRuntime.jsx(TraceSpanUsage, { spanUsage: span.attributes.usage }),
16439
+ /* @__PURE__ */ jsxRuntime.jsx(KeyValueList, { data: spanInfo, LinkComponent: Link }),
16440
+ /* @__PURE__ */ jsxRuntime.jsx(SpanDetails, { span })
16248
16441
  ] }) }),
16249
- /* @__PURE__ */ jsxRuntime.jsx(Dropdown.Content, { children: scorerList.map((scorer) => /* @__PURE__ */ jsxRuntime.jsx(
16250
- Dropdown.Item,
16251
- {
16252
- onClick: () => triggerScorer({ scorerName: scorer.name, traceId: trace.traceId, spanId }),
16253
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: scorer.name })
16254
- },
16255
- scorer.id
16256
- )) })
16442
+ /* @__PURE__ */ jsxRuntime.jsx(Tabs.Content, { value: "scores", children: /* @__PURE__ */ jsxRuntime.jsxs(Sections, { children: [
16443
+ /* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
16444
+ /* @__PURE__ */ jsxRuntime.jsx(Section.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(Section.Heading, { children: [
16445
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleGaugeIcon, {}),
16446
+ " Scoring"
16447
+ ] }) }),
16448
+ /* @__PURE__ */ jsxRuntime.jsx(SpanScoring, { traceId: trace?.traceId, spanId: span?.spanId, entityType })
16449
+ ] }),
16450
+ /* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
16451
+ /* @__PURE__ */ jsxRuntime.jsx(Section.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(Section.Heading, { children: [
16452
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleGaugeIcon, {}),
16453
+ " Scores"
16454
+ ] }) }),
16455
+ /* @__PURE__ */ jsxRuntime.jsx(
16456
+ SpanScoreList,
16457
+ {
16458
+ scoresData: spanScoresData,
16459
+ onPageChange: onSpanScoresPageChange,
16460
+ isLoadingScoresData: isLoadingSpanScoresData,
16461
+ initialScoreId,
16462
+ traceId: trace?.traceId,
16463
+ spanId: span?.spanId,
16464
+ computeTraceLink
16465
+ }
16466
+ )
16467
+ ] })
16468
+ ] }) })
16257
16469
  ] });
16258
- };
16470
+ }
16259
16471
 
16260
16472
  function SpanDialog({
16261
16473
  trace,
16262
16474
  span,
16475
+ spanScoresData,
16476
+ onSpanScoresPageChange,
16477
+ isLoadingSpanScoresData,
16263
16478
  isOpen,
16264
16479
  onClose,
16265
16480
  onNext,
16266
16481
  onPrevious,
16267
16482
  onViewToggle,
16268
16483
  spanInfo = [],
16269
- onScorerTriggered
16484
+ defaultActiveTab = "details",
16485
+ initialScoreId,
16486
+ computeTraceLink
16270
16487
  }) {
16271
- const { Link } = useLinkComponent();
16272
16488
  return /* @__PURE__ */ jsxRuntime.jsxs(
16273
16489
  SideDialog,
16274
16490
  {
@@ -16276,43 +16492,53 @@ function SpanDialog({
16276
16492
  dialogDescription: "View and analyze span details",
16277
16493
  isOpen,
16278
16494
  onClose,
16279
- hasCloseButton: true,
16280
- className: cn("w-[calc(100vw-25rem)] max-w-[65%]", "3xl:max-w-[50%]", "4xl:max-w-[40%]"),
16495
+ level: 2,
16281
16496
  children: [
16282
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between pr-[1.5rem]", children: [
16283
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogTop, { onNext, onPrevious, showInnerNav: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[1rem] text-icon4 text-[0.875rem]", children: [
16284
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16285
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16497
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Top, { children: [
16498
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16499
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16500
+ " ",
16501
+ getShortId(span?.traceId)
16502
+ ] }),
16503
+ "›",
16504
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16505
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16506
+ getShortId(span?.spanId)
16507
+ ] }),
16508
+ "|",
16509
+ /* @__PURE__ */ jsxRuntime.jsx(SideDialog.Nav, { onNext, onPrevious }),
16510
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { className: "ml-auto mr-[2rem]", onClick: onViewToggle, children: [
16511
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelTopIcon, {}),
16512
+ /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: "Switch to dialog view" })
16513
+ ] })
16514
+ ] }),
16515
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Content, { children: [
16516
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Header, { children: [
16517
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Heading, { children: [
16518
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16286
16519
  " ",
16287
- getShortId(span?.traceId)
16520
+ span?.name
16288
16521
  ] }),
16289
- "›",
16290
16522
  /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16291
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16292
- getShortId(span?.spanId)
16523
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
16524
+ " ",
16525
+ span?.spanId
16293
16526
  ] })
16294
- ] }) }),
16295
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: "flex items-center gap-1", onClick: onViewToggle, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelTopIcon, {}) })
16296
- ] }),
16297
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-[1.5rem] px-[2.5rem] overflow-y-auto grid gap-[1.5rem] content-start", children: [
16298
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
16299
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeader, { className: "flex gap-[1rem] items-baseline pr-[2.5rem]", children: [
16300
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { children: [
16301
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16302
- " ",
16303
- span?.name
16304
- ] }),
16305
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16306
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
16307
- " ",
16308
- span?.spanId
16309
- ] })
16310
- ] }),
16311
- span?.traceId && span?.spanId && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(ScorersDropdown, { trace, spanId: span?.spanId, onScorerTriggered }) })
16312
16527
  ] }),
16313
- span?.attributes?.usage && /* @__PURE__ */ jsxRuntime.jsx(TraceSpanUsage, { spanUsage: span.attributes.usage, className: "mt-[1.5rem]" }),
16314
- /* @__PURE__ */ jsxRuntime.jsx(KeyValueList, { data: spanInfo, LinkComponent: Link, className: "mt-[1.5rem]" }),
16315
- /* @__PURE__ */ jsxRuntime.jsx(SpanDetails, { span, onScorerTriggered })
16528
+ /* @__PURE__ */ jsxRuntime.jsx(
16529
+ SpanTabs,
16530
+ {
16531
+ trace,
16532
+ span,
16533
+ spanScoresData,
16534
+ onSpanScoresPageChange,
16535
+ isLoadingSpanScoresData,
16536
+ spanInfo,
16537
+ defaultActiveTab,
16538
+ initialScoreId,
16539
+ computeTraceLink
16540
+ }
16541
+ )
16316
16542
  ] })
16317
16543
  ]
16318
16544
  }
@@ -16330,15 +16556,30 @@ function TraceDialog({
16330
16556
  isLoadingSpans,
16331
16557
  computeAgentsLink,
16332
16558
  computeWorkflowsLink,
16333
- onScorerTriggered,
16334
- initialSpanId
16559
+ computeTraceLink,
16560
+ initialSpanId,
16561
+ initialSpanTab,
16562
+ initialScoreId
16335
16563
  }) {
16336
- const { Link } = useLinkComponent();
16564
+ const { Link, navigate } = useLinkComponent();
16337
16565
  const [dialogIsOpen, setDialogIsOpen] = React.useState(Boolean(initialSpanId));
16338
16566
  const [selectedSpanId, setSelectedSpanId] = React.useState(initialSpanId);
16339
16567
  const [combinedView, setCombinedView] = React.useState(false);
16568
+ const [spanDialogDefaultTab, setSpanDialogDefaultTab] = React.useState(initialSpanTab || "details");
16340
16569
  const selectedSpan = traceSpans.find((span) => span.spanId === selectedSpanId);
16341
16570
  const traceInfo = useTraceInfo(traceDetails);
16571
+ const [spanScoresPage, setSpanScoresPage] = React.useState(0);
16572
+ React.useEffect(() => {
16573
+ if (initialSpanId) {
16574
+ setSelectedSpanId(initialSpanId);
16575
+ setDialogIsOpen(true);
16576
+ }
16577
+ }, [initialSpanId]);
16578
+ React.useEffect(() => {
16579
+ if (spanScoresPage > 0) {
16580
+ setSpanScoresPage(0);
16581
+ }
16582
+ }, [selectedSpanId]);
16342
16583
  const hierarchicalSpans = React.useMemo(() => {
16343
16584
  return formatHierarchicalSpans(traceSpans);
16344
16585
  }, [traceSpans]);
@@ -16356,39 +16597,38 @@ function TraceDialog({
16356
16597
  };
16357
16598
  return flattenSpans(hierarchicalSpans);
16358
16599
  }, [hierarchicalSpans]);
16600
+ const { data: spanScoresData, isLoading: isLoadingSpanScoresData } = useTraceSpanScores({
16601
+ traceId,
16602
+ spanId: selectedSpanId || flatSpans?.[0]?.id,
16603
+ page: spanScoresPage
16604
+ });
16359
16605
  const handleSpanClick = (id) => {
16360
16606
  setSelectedSpanId(id);
16607
+ setSpanDialogDefaultTab("details");
16361
16608
  setDialogIsOpen(true);
16362
16609
  };
16363
- const toNextSpan = () => {
16364
- const currentIndex = flatSpans.findIndex((span) => span.id === selectedSpanId);
16365
- const nextItem = flatSpans[currentIndex + 1];
16366
- if (nextItem) {
16367
- setSelectedSpanId(nextItem.id);
16610
+ const handleToScoring = () => {
16611
+ setSelectedSpanId(hierarchicalSpans[0]?.id);
16612
+ setSpanDialogDefaultTab("scores");
16613
+ if (traceId) {
16614
+ navigate(`${computeTraceLink(traceId, hierarchicalSpans?.[0]?.id)}&tab=scores`);
16368
16615
  }
16369
16616
  };
16370
- const toPreviousSpan = () => {
16371
- const currentIndex = flatSpans.findIndex((span) => span.id === selectedSpanId);
16372
- const previousItem = flatSpans[currentIndex - 1];
16373
- if (previousItem) {
16374
- setSelectedSpanId(previousItem.id);
16617
+ const handleToLastScore = () => {
16618
+ setSelectedSpanId(hierarchicalSpans[0]?.id);
16619
+ setSpanDialogDefaultTab("scores");
16620
+ if (traceId) {
16621
+ navigate(
16622
+ `${computeTraceLink(
16623
+ traceId,
16624
+ hierarchicalSpans?.[0]?.id
16625
+ )}&tab=scores&scoreId=${spanScoresData?.scores?.[0]?.id}`
16626
+ );
16375
16627
  }
16376
16628
  };
16377
- const thereIsNextSpan = () => {
16378
- const currentIndex = flatSpans.findIndex((span) => span.id === selectedSpanId);
16379
- return currentIndex < flatSpans.length - 1;
16380
- };
16381
- const thereIsPreviousSpan = () => {
16382
- const currentIndex = flatSpans.findIndex((span) => span.id === selectedSpanId);
16383
- return currentIndex > 0;
16384
- };
16385
16629
  const selectedSpanInfo = getSpanInfo({ span: selectedSpan, withTraceId: !combinedView, withSpanId: combinedView });
16386
- let entityType;
16387
- if (traceDetails?.attributes?.agentId) {
16388
- entityType = "Agent";
16389
- } else if (traceDetails?.attributes?.workflowId) {
16390
- entityType = "Workflow";
16391
- }
16630
+ const toNextSpan = getToNextEntryFn({ entries: flatSpans, id: selectedSpanId, update: setSelectedSpanId });
16631
+ const toPreviousSpan = getToPreviousEntryFn({ entries: flatSpans, id: selectedSpanId, update: setSelectedSpanId });
16392
16632
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16393
16633
  /* @__PURE__ */ jsxRuntime.jsxs(
16394
16634
  SideDialog,
@@ -16397,111 +16637,100 @@ function TraceDialog({
16397
16637
  dialogDescription: "View and analyze trace details",
16398
16638
  isOpen,
16399
16639
  onClose,
16400
- hasCloseButton: !dialogIsOpen || combinedView,
16401
- className: cn("w-[calc(100vw-20rem)] max-w-[80%]", "3xl:max-w-[65%]", "4xl:max-w-[55%]"),
16640
+ level: 1,
16402
16641
  children: [
16403
- /* @__PURE__ */ jsxRuntime.jsx(SideDialogTop, { onNext, onPrevious, showInnerNav: true, children: /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16404
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16405
- " ",
16406
- getShortId(traceId)
16407
- ] }) }),
16642
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Top, { children: [
16643
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16644
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16645
+ " ",
16646
+ getShortId(traceId)
16647
+ ] }),
16648
+ "|",
16649
+ /* @__PURE__ */ jsxRuntime.jsx(SideDialog.Nav, { onNext, onPrevious })
16650
+ ] }),
16408
16651
  /* @__PURE__ */ jsxRuntime.jsxs(
16409
16652
  "div",
16410
16653
  {
16411
- className: cn("pt-[1.5rem] pl-[2.5rem] grid-rows-[auto_1fr] grid h-full overflow-y-auto", {
16412
- "grid-rows-[auto_1fr_1fr]": selectedSpan && combinedView
16654
+ className: cn("overflow-y-auto", {
16655
+ "grid grid-rows-[2fr_3fr]": Boolean(selectedSpan && combinedView)
16413
16656
  }),
16414
16657
  children: [
16415
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeader, { className: "pr-[2.5rem]", children: [
16416
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { children: [
16417
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16418
- " ",
16419
- traceDetails?.name
16420
- ] }),
16421
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16422
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
16423
- " ",
16424
- traceId
16425
- ] })
16426
- ] }),
16427
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("overflow-y-auto pb-[2.5rem]"), children: [
16428
- traceDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
16429
- ScorersDropdown,
16430
- {
16431
- trace: traceDetails,
16432
- spanId: selectedSpanId,
16433
- onScorerTriggered,
16434
- entityType
16435
- }
16436
- ) }),
16437
- traceDetails?.metadata?.usage && /* @__PURE__ */ jsxRuntime.jsx(
16438
- TraceSpanUsage,
16439
- {
16440
- traceUsage: traceDetails?.metadata?.usage,
16441
- traceSpans,
16442
- className: "mt-[2rem] pr-[1.5rem]"
16443
- }
16444
- ),
16445
- /* @__PURE__ */ jsxRuntime.jsx(KeyValueList, { data: traceInfo, LinkComponent: Link, className: "mt-[2rem]" }),
16446
- /* @__PURE__ */ jsxRuntime.jsx(
16447
- TraceTimeline,
16448
- {
16449
- hierarchicalSpans,
16450
- spans: traceSpans,
16451
- onSpanClick: handleSpanClick,
16452
- selectedSpanId,
16453
- isLoading: isLoadingSpans,
16454
- className: "pr-[2.5rem] pt-[2.5rem]"
16455
- }
16456
- ),
16457
- traceDetails?.links?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-[2.5rem] pr-[2.5rem]", children: [
16458
- /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { as: "h2", className: "pb-[1rem]", children: [
16459
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
16460
- " Scores"
16658
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Content, { children: [
16659
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Header, { children: [
16660
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Heading, { children: [
16661
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16662
+ " ",
16663
+ traceDetails?.name
16461
16664
  ] }),
16462
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface2 rounded-lg overflow-hidden border-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(
16463
- ScoreTable,
16464
- {
16465
- scores: traceDetails?.links,
16466
- onItemClick: (scorerName) => onScorerTriggered(scorerName, traceDetails.traceId, selectedSpanId)
16467
- }
16468
- ) })
16469
- ] })
16470
- ] }),
16471
- selectedSpan && combinedView && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-y-auto grid grid-rows-[auto_1fr] relative", children: [
16472
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 right-[2.5rem] h-[.5rem] bg-surface1 rounded-full top-0" }),
16473
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between pb-[.5rem] pt-[1rem] border-b border-border1 pr-[2.5rem]", children: [
16474
- /* @__PURE__ */ jsxRuntime.jsx(
16475
- SideDialogTop,
16476
- {
16477
- onNext: thereIsNextSpan() ? toNextSpan : void 0,
16478
- onPrevious: thereIsPreviousSpan() ? toPreviousSpan : void 0,
16479
- showInnerNav: true,
16480
- className: "pl-0",
16481
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[1rem] text-icon4 text-[0.875rem]", children: [
16482
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16483
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, {}),
16484
- " ",
16485
- getShortId(traceId)
16665
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16666
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HashIcon, {}),
16667
+ " ",
16668
+ traceId
16669
+ ] })
16670
+ ] }),
16671
+ traceDetails && /* @__PURE__ */ jsxRuntime.jsxs(Sections, { children: [
16672
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid xl:grid-cols-[3fr_2fr] gap-[1rem] items-start", children: [
16673
+ /* @__PURE__ */ jsxRuntime.jsx(KeyValueList, { data: traceInfo, LinkComponent: Link }),
16674
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-surface3 p-[1.5rem] rounded-lg grid gap-[1rem]", children: [
16675
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-[1rem]", children: /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16676
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
16677
+ " Evaluate trace"
16678
+ ] }) }),
16679
+ /* @__PURE__ */ jsxRuntime.jsxs(ButtonsGroup, { className: "w-full", children: [
16680
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleToScoring, children: [
16681
+ "Scoring ",
16682
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleGaugeIcon, {}),
16683
+ " "
16486
16684
  ] }),
16487
- "›",
16488
- /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16489
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16490
- " ",
16491
- getShortId(selectedSpanId)
16685
+ spanScoresData?.scores?.[0] && /* @__PURE__ */ jsxRuntime.jsxs(Button, { onClick: handleToLastScore, children: [
16686
+ "Last score: ",
16687
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: spanScoresData?.scores?.[0]?.score })
16492
16688
  ] })
16493
16689
  ] })
16494
- }
16495
- ),
16496
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-[1rem]", children: /* @__PURE__ */ jsxRuntime.jsx("button", { className: "flex items-center gap-1", onClick: () => setCombinedView(false), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftIcon, {}) }) })
16690
+ ] })
16691
+ ] }),
16692
+ /* @__PURE__ */ jsxRuntime.jsxs(Section, { children: [
16693
+ /* @__PURE__ */ jsxRuntime.jsxs(Section.Header, { children: [
16694
+ /* @__PURE__ */ jsxRuntime.jsxs(Section.Heading, { children: [
16695
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListTreeIcon, {}),
16696
+ " Timeline"
16697
+ ] }),
16698
+ /* @__PURE__ */ jsxRuntime.jsx(TraceTimelineLegend, { spans: traceSpans })
16699
+ ] }),
16700
+ /* @__PURE__ */ jsxRuntime.jsx(
16701
+ TraceTimeline,
16702
+ {
16703
+ hierarchicalSpans,
16704
+ onSpanClick: handleSpanClick,
16705
+ selectedSpanId,
16706
+ isLoading: isLoadingSpans
16707
+ }
16708
+ )
16709
+ ] })
16710
+ ] })
16711
+ ] }),
16712
+ selectedSpan && combinedView && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-rows-[auto_1fr] relative overflow-y-auto", children: [
16713
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Top, { withTopSeparator: true, children: [
16714
+ /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { children: [
16715
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16716
+ " ",
16717
+ getShortId(selectedSpanId)
16718
+ ] }),
16719
+ "|",
16720
+ /* @__PURE__ */ jsxRuntime.jsx(SideDialog.Nav, { onNext: toNextSpan, onPrevious: toPreviousSpan }),
16721
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { className: "ml-auto mr-[2rem]", onClick: () => setCombinedView(false), children: [
16722
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftIcon, {}),
16723
+ " ",
16724
+ /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden.VisuallyHidden, { children: "Switch to dialog view" })
16725
+ ] })
16497
16726
  ] }),
16498
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[20rem_1fr] gap-[1rem] overflow-y-auto", children: [
16499
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-y-auto grid content-start p-[1.5rem] pl-0 gap-[2rem]", children: [
16500
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(SideDialogHeading, { as: "h2", children: [
16727
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("h-full overflow-y-auto grid gap-[2rem] grid-cols-[20rem_1fr]"), children: [
16728
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "overflow-y-auto grid content-start p-[2rem] gap-[2rem]", children: [
16729
+ /* @__PURE__ */ jsxRuntime.jsxs(SideDialog.Heading, { as: "h2", children: [
16501
16730
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeftRightEllipsisIcon, {}),
16502
16731
  " ",
16503
16732
  selectedSpan?.name
16504
- ] }) }),
16733
+ ] }),
16505
16734
  selectedSpan?.attributes?.usage && /* @__PURE__ */ jsxRuntime.jsx(
16506
16735
  TraceSpanUsage,
16507
16736
  {
@@ -16511,7 +16740,20 @@ function TraceDialog({
16511
16740
  ),
16512
16741
  /* @__PURE__ */ jsxRuntime.jsx(KeyValueList, { data: selectedSpanInfo, LinkComponent: Link })
16513
16742
  ] }),
16514
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto pr-[2.5rem] pt-[2rem]", children: /* @__PURE__ */ jsxRuntime.jsx(SpanDetails, { span: selectedSpan, onScorerTriggered }) })
16743
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto pr-[2rem] pt-[2rem] h-full", children: /* @__PURE__ */ jsxRuntime.jsx(
16744
+ SpanTabs,
16745
+ {
16746
+ trace: traceDetails,
16747
+ span: selectedSpan,
16748
+ spanScoresData,
16749
+ onSpanScoresPageChange: setSpanScoresPage,
16750
+ isLoadingSpanScoresData,
16751
+ spanInfo: selectedSpanInfo,
16752
+ defaultActiveTab: spanDialogDefaultTab,
16753
+ initialScoreId,
16754
+ computeTraceLink
16755
+ }
16756
+ ) })
16515
16757
  ] })
16516
16758
  ] })
16517
16759
  ]
@@ -16525,16 +16767,22 @@ function TraceDialog({
16525
16767
  {
16526
16768
  trace: traceDetails,
16527
16769
  span: selectedSpan,
16770
+ spanScoresData,
16771
+ onSpanScoresPageChange: setSpanScoresPage,
16772
+ isLoadingSpanScoresData,
16528
16773
  isOpen: Boolean(dialogIsOpen && selectedSpanId && !combinedView),
16529
16774
  onClose: () => {
16775
+ navigate(computeTraceLink(traceId || ""));
16530
16776
  setDialogIsOpen(false);
16531
16777
  setSelectedSpanId(void 0);
16532
16778
  },
16533
- onNext: thereIsNextSpan() ? toNextSpan : void 0,
16534
- onPrevious: thereIsPreviousSpan() ? toPreviousSpan : void 0,
16779
+ onNext: toNextSpan,
16780
+ onPrevious: toPreviousSpan,
16535
16781
  onViewToggle: () => setCombinedView(!combinedView),
16536
16782
  spanInfo: selectedSpanInfo,
16537
- onScorerTriggered
16783
+ defaultActiveTab: spanDialogDefaultTab,
16784
+ initialScoreId,
16785
+ computeTraceLink
16538
16786
  }
16539
16787
  )
16540
16788
  ] });
@@ -16673,61 +16921,192 @@ function TracesList({
16673
16921
  ] });
16674
16922
  }
16675
16923
 
16676
- function MainContentLayout({
16677
- children,
16678
- className,
16679
- style
16924
+ const traceScoresListColumns = [
16925
+ { name: "shortId", label: "ID", size: "1fr" },
16926
+ { name: "date", label: "Date", size: "1fr" },
16927
+ { name: "time", label: "Time", size: "1fr" },
16928
+ { name: "score", label: "Score", size: "1fr" },
16929
+ { name: "scorer", label: "Scorer", size: "1fr" }
16930
+ ];
16931
+ function SpanScoreList({
16932
+ scoresData,
16933
+ isLoadingScoresData,
16934
+ traceId,
16935
+ spanId,
16936
+ initialScoreId,
16937
+ onPageChange,
16938
+ computeTraceLink
16680
16939
  }) {
16681
- const devStyleRequested = devUIStyleRequested("MainContentLayout");
16682
- return /* @__PURE__ */ jsxRuntime.jsx(
16683
- "main",
16684
- {
16685
- className: cn(`grid grid-rows-[auto_1fr] h-full items-start content-start`, className),
16686
- style: { ...style, ...devStyleRequested ? { border: "3px dotted red" } : {} },
16687
- children
16940
+ const { navigate } = useLinkComponent();
16941
+ const [dialogIsOpen, setDialogIsOpen] = React.useState(false);
16942
+ const [selectedScore, setSelectedScore] = React.useState();
16943
+ React.useEffect(() => {
16944
+ if (initialScoreId) {
16945
+ handleOnScore(initialScoreId);
16688
16946
  }
16689
- );
16690
- }
16691
- function MainContentContent({
16692
- children,
16693
- className,
16694
- isCentered = false,
16695
- isDivided = false,
16696
- hasLeftServiceColumn = false,
16697
- style
16698
- }) {
16699
- const devStyleRequested = devUIStyleRequested("MainContentContent");
16700
- return /* @__PURE__ */ jsxRuntime.jsx(
16701
- "div",
16702
- {
16703
- className: cn(
16704
- `grid overflow-y-auto h-full `,
16705
- `overflow-x-auto min-w-[min-content]`,
16947
+ }, [initialScoreId]);
16948
+ const handleOnScore = (scoreId) => {
16949
+ const score = scoresData?.scores?.find((s) => s?.id === scoreId);
16950
+ setSelectedScore(score);
16951
+ setDialogIsOpen(true);
16952
+ };
16953
+ if (isLoadingScoresData) {
16954
+ return /* @__PURE__ */ jsxRuntime.jsx(EntryListSkeleton, { columns: traceScoresListColumns });
16955
+ }
16956
+ const updateSelectedScore = (scoreId) => {
16957
+ const score = scoresData?.scores?.find((s) => s?.id === scoreId);
16958
+ setSelectedScore(score);
16959
+ };
16960
+ const toNextScore = getToNextEntryFn({
16961
+ entries: scoresData?.scores || [],
16962
+ id: selectedScore?.id,
16963
+ update: updateSelectedScore
16964
+ });
16965
+ const toPreviousScore = getToPreviousEntryFn({
16966
+ entries: scoresData?.scores || [],
16967
+ id: selectedScore?.id,
16968
+ update: updateSelectedScore
16969
+ });
16970
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16971
+ /* @__PURE__ */ jsxRuntime.jsxs(EntryList, { children: [
16972
+ /* @__PURE__ */ jsxRuntime.jsxs(EntryList.Trim, { children: [
16973
+ /* @__PURE__ */ jsxRuntime.jsx(EntryList.Header, { columns: traceScoresListColumns }),
16974
+ scoresData?.scores && scoresData.scores.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(EntryList.Entries, { children: scoresData?.scores?.map((score) => {
16975
+ const createdAtDate = new Date(score.createdAt);
16976
+ const isTodayDate = dateFns.isToday(createdAtDate);
16977
+ const entry = {
16978
+ id: score?.id,
16979
+ shortId: getShortId(score?.id) || "n/a",
16980
+ date: isTodayDate ? "Today" : dateFns.format(createdAtDate, "MMM dd"),
16981
+ time: dateFns.format(createdAtDate, "h:mm:ss aaa"),
16982
+ score: score?.score,
16983
+ scorer: score?.scorer?.name
16984
+ };
16985
+ return /* @__PURE__ */ jsxRuntime.jsx(
16986
+ EntryList.Entry,
16987
+ {
16988
+ columns: traceScoresListColumns,
16989
+ onClick: () => handleOnScore(score.id),
16990
+ entry,
16991
+ children: traceScoresListColumns.map((col) => {
16992
+ const key = `col-${col.name}`;
16993
+ return /* @__PURE__ */ jsxRuntime.jsx(EntryList.EntryText, { children: entry?.[col.name] }, key);
16994
+ })
16995
+ },
16996
+ score.id
16997
+ );
16998
+ }) }) : /* @__PURE__ */ jsxRuntime.jsx(EntryList.Message, { message: "No scores found", type: "info" })
16999
+ ] }),
17000
+ /* @__PURE__ */ jsxRuntime.jsx(
17001
+ EntryList.Pagination,
16706
17002
  {
16707
- "items-start content-start": !isCentered && !isDivided && !hasLeftServiceColumn,
16708
- "grid place-items-center": isCentered,
16709
- "grid-cols-[1fr_1fr]": isDivided && !hasLeftServiceColumn,
16710
- "grid-cols-[12rem_1fr_1fr]": isDivided && hasLeftServiceColumn,
16711
- "grid-cols-[auto_1fr]": !isDivided && hasLeftServiceColumn
17003
+ currentPage: scoresData?.pagination?.page || 0,
17004
+ hasMore: scoresData?.pagination?.hasMore,
17005
+ onNextPage: () => onPageChange && onPageChange((scoresData?.pagination?.page || 0) + 1),
17006
+ onPrevPage: () => onPageChange && onPageChange((scoresData?.pagination?.page || 0) - 1)
17007
+ }
17008
+ )
17009
+ ] }),
17010
+ /* @__PURE__ */ jsxRuntime.jsx(
17011
+ ScoreDialog,
17012
+ {
17013
+ scorerName: selectedScore?.scorer?.name || "",
17014
+ score: selectedScore,
17015
+ isOpen: dialogIsOpen,
17016
+ onClose: () => {
17017
+ if (traceId) {
17018
+ navigate(`${computeTraceLink(traceId, spanId)}&tab=scores`);
17019
+ }
17020
+ setDialogIsOpen(false);
16712
17021
  },
16713
- className
16714
- ),
16715
- style: { ...style, ...devStyleRequested ? { border: "3px dotted orange" } : {} },
16716
- children
16717
- }
16718
- );
17022
+ dialogLevel: 3,
17023
+ onNext: toNextScore,
17024
+ onPrevious: toPreviousScore,
17025
+ computeTraceLink: (traceId2, spanId2) => `/observability?traceId=${traceId2}${spanId2 ? `&spanId=${spanId2}` : ""}`,
17026
+ usageContext: "aiSpanDialog"
17027
+ }
17028
+ )
17029
+ ] });
16719
17030
  }
16720
- function devUIStyleRequested(name) {
16721
- try {
16722
- const raw = localStorage.getItem("add-dev-style-to-components");
16723
- if (!raw) return false;
16724
- const components = raw.split(",").map((c) => c.trim()).filter(Boolean);
16725
- return components.includes(name);
16726
- } catch (error) {
16727
- console.error("Error reading or parsing localStorage:", error);
16728
- return false;
17031
+
17032
+ const useTriggerScorer = () => {
17033
+ const client = react$3.useMastraClient();
17034
+ return reactQuery.useMutation({
17035
+ mutationFn: async ({ scorerName, traceId, spanId }) => {
17036
+ const response = await client.score({
17037
+ scorerName,
17038
+ targets: [{ traceId, spanId }]
17039
+ });
17040
+ return response;
17041
+ }
17042
+ });
17043
+ };
17044
+
17045
+ const SpanScoring = ({ traceId, spanId, entityType }) => {
17046
+ const { data: scorers = {}, isLoading } = useScorers();
17047
+ const [selectedScorer, setSelectedScorer] = React.useState(null);
17048
+ const { mutate: triggerScorer, isPending, isSuccess } = useTriggerScorer();
17049
+ const [notificationIsVisible, setNotificationIsVisible] = React.useState(false);
17050
+ React.useEffect(() => {
17051
+ if (isSuccess) {
17052
+ setNotificationIsVisible(true);
17053
+ }
17054
+ }, [isSuccess]);
17055
+ let scorerList = Object.entries(scorers).map(([key, scorer]) => ({
17056
+ id: key,
17057
+ name: scorer.scorer.config.name,
17058
+ description: scorer.scorer.config.description,
17059
+ isRegistered: scorer.isRegistered,
17060
+ type: scorer.scorer.config.type
17061
+ })).filter((scorer) => scorer.isRegistered);
17062
+ if (entityType !== "Agent" || spanId) {
17063
+ scorerList = scorerList.filter((scorer) => scorer.type !== "agent");
16729
17064
  }
16730
- }
17065
+ const isWaiting = isPending || isLoading;
17066
+ const handleStartScoring = () => {
17067
+ if (selectedScorer) {
17068
+ setNotificationIsVisible(false);
17069
+ triggerScorer({
17070
+ scorerName: selectedScorer,
17071
+ traceId: traceId || "",
17072
+ spanId
17073
+ });
17074
+ }
17075
+ };
17076
+ const handleScorerChange = (val) => {
17077
+ setSelectedScorer(val);
17078
+ setNotificationIsVisible(false);
17079
+ };
17080
+ const selectedScorerDescription = scorerList.find((s) => s.name === selectedScorer)?.description || "";
17081
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
17082
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[3fr_1fr] gap-[1rem] items-start", children: [
17083
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-[0.5rem]", children: [
17084
+ /* @__PURE__ */ jsxRuntime.jsx(
17085
+ SelectField,
17086
+ {
17087
+ name: "select-scorer",
17088
+ placeholder: "Select a scorer...",
17089
+ options: scorerList.map((scorer) => ({ label: scorer.name, value: scorer.name })),
17090
+ onValueChange: handleScorerChange,
17091
+ value: selectedScorer || "",
17092
+ className: "min-w-[20rem]",
17093
+ disabled: isWaiting
17094
+ }
17095
+ ),
17096
+ selectedScorerDescription && /* @__PURE__ */ jsxRuntime.jsxs(TextAndIcon, { className: "text-icon3", children: [
17097
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}),
17098
+ " ",
17099
+ selectedScorerDescription
17100
+ ] })
17101
+ ] }),
17102
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { disabled: !selectedScorer || isWaiting, onClick: handleStartScoring, children: isPending ? "Starting..." : "Start Scoring" })
17103
+ ] }),
17104
+ /* @__PURE__ */ jsxRuntime.jsxs(Notification, { isVisible: notificationIsVisible, className: "mt-[1rem]", children: [
17105
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}),
17106
+ " Scorer triggered! When finished successfully, it will appear in the list below. It could take a moment."
17107
+ ] })
17108
+ ] });
17109
+ };
16731
17110
 
16732
17111
  const Breadcrumb = ({ children, label }) => {
16733
17112
  return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "gap-sm flex items-center", children }) });
@@ -17334,7 +17713,7 @@ function MCPTable({ mcpServers, isLoading }) {
17334
17713
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyMCPTable, {});
17335
17714
  }
17336
17715
  const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
17337
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17716
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
17338
17717
  /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search MCP servers", placeholder: "Search MCP servers" }) }),
17339
17718
  isLoading ? /* @__PURE__ */ jsxRuntime.jsx(MCPTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
17340
17719
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsxRuntime.jsx(Th, { style: { width: header.column.getSize() ?? "auto" }, children: reactTable.flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
@@ -17451,6 +17830,7 @@ exports.Badge = Badge$1;
17451
17830
  exports.BranchIcon = BranchIcon;
17452
17831
  exports.Breadcrumb = Breadcrumb;
17453
17832
  exports.Button = Button$1;
17833
+ exports.ButtonsGroup = ButtonsGroup;
17454
17834
  exports.Cell = Cell;
17455
17835
  exports.ChatThreads = ChatThreads;
17456
17836
  exports.CheckIcon = CheckIcon;
@@ -17509,12 +17889,15 @@ exports.LogsIcon = LogsIcon;
17509
17889
  exports.MCPTable = MCPTable;
17510
17890
  exports.MainContentContent = MainContentContent;
17511
17891
  exports.MainContentLayout = MainContentLayout;
17892
+ exports.MainSidebar = MainSidebar;
17893
+ exports.MainSidebarProvider = MainSidebarProvider;
17512
17894
  exports.MastraResizablePanel = MastraResizablePanel;
17513
17895
  exports.McpCoinIcon = McpCoinIcon;
17514
17896
  exports.McpServerIcon = McpServerIcon;
17515
17897
  exports.MemoryIcon = MemoryIcon;
17516
17898
  exports.MemorySearch = MemorySearch;
17517
17899
  exports.ModelResetProvider = ModelResetProvider;
17900
+ exports.Notification = Notification;
17518
17901
  exports.OpenAIIcon = OpenAIIcon;
17519
17902
  exports.PageHeader = PageHeader;
17520
17903
  exports.PlaygroundQueryClient = PlaygroundQueryClient;
@@ -17535,23 +17918,19 @@ exports.ScoresTools = ScoresTools;
17535
17918
  exports.SearchField = SearchField;
17536
17919
  exports.Searchbar = Searchbar;
17537
17920
  exports.SearchbarWrapper = SearchbarWrapper;
17921
+ exports.Section = Section;
17922
+ exports.Sections = Sections;
17538
17923
  exports.SelectField = SelectField;
17539
17924
  exports.SettingsIcon = SettingsIcon;
17540
17925
  exports.SideDialog = SideDialog;
17541
- exports.SideDialogCodeSection = SideDialogCodeSection;
17542
- exports.SideDialogContent = SideDialogContent;
17543
- exports.SideDialogFooter = SideDialogFooter;
17544
- exports.SideDialogFooterGroup = SideDialogFooterGroup;
17545
- exports.SideDialogHeader = SideDialogHeader;
17546
- exports.SideDialogHeading = SideDialogHeading;
17547
- exports.SideDialogKeyValueList = SideDialogKeyValueList;
17548
- exports.SideDialogSection = SideDialogSection;
17549
- exports.SideDialogTop = SideDialogTop;
17550
17926
  exports.SlashIcon = SlashIcon;
17551
17927
  exports.SliderField = SliderField;
17552
- exports.Tab = Tab;
17553
- exports.TabContent = TabContent;
17554
- exports.TabList = TabList;
17928
+ exports.SpanScoreList = SpanScoreList;
17929
+ exports.SpanScoring = SpanScoring;
17930
+ exports.SpanTabs = SpanTabs;
17931
+ exports.Tab = Tab$1;
17932
+ exports.TabContent = TabContent$1;
17933
+ exports.TabList = TabList$1;
17555
17934
  exports.Table = Table$1;
17556
17935
  exports.Tbody = Tbody;
17557
17936
  exports.TemplateFailure = TemplateFailure;
@@ -17575,6 +17954,10 @@ exports.ToolCoinIcon = ToolCoinIcon;
17575
17954
  exports.ToolFallback = ToolFallback;
17576
17955
  exports.ToolTable = ToolTable;
17577
17956
  exports.ToolsIcon = ToolsIcon;
17957
+ exports.Tooltip = Tooltip;
17958
+ exports.TooltipContent = TooltipContent;
17959
+ exports.TooltipProvider = TooltipProvider;
17960
+ exports.TooltipTrigger = TooltipTrigger;
17578
17961
  exports.TraceDialog = TraceDialog;
17579
17962
  exports.TraceIcon = TraceIcon;
17580
17963
  exports.TraceTimeline = TraceTimeline;
@@ -17617,6 +18000,7 @@ exports.parseError = parseError;
17617
18000
  exports.providerMapToIcon = providerMapToIcon;
17618
18001
  exports.scoresListColumns = scoresListColumns;
17619
18002
  exports.spanTypePrefixes = spanTypePrefixes;
18003
+ exports.traceScoresListColumns = traceScoresListColumns;
17620
18004
  exports.tracesListColumns = tracesListColumns;
17621
18005
  exports.transformKey = transformKey;
17622
18006
  exports.useAgentSettings = useAgentSettings;
@@ -17624,6 +18008,7 @@ exports.useCurrentRun = useCurrentRun;
17624
18008
  exports.useInView = useInView;
17625
18009
  exports.useLinkComponent = useLinkComponent;
17626
18010
  exports.useMCPServerTools = useMCPServerTools;
18011
+ exports.useMainSidebar = useMainSidebar;
17627
18012
  exports.useModelReset = useModelReset;
17628
18013
  exports.usePlaygroundStore = usePlaygroundStore;
17629
18014
  exports.usePolling = usePolling;
@@ -17633,6 +18018,7 @@ exports.useScoresByEntityId = useScoresByEntityId;
17633
18018
  exports.useScoresByScorerId = useScoresByScorerId;
17634
18019
  exports.useSpeechRecognition = useSpeechRecognition;
17635
18020
  exports.useThreadInput = useThreadInput;
18021
+ exports.useTraceSpanScores = useTraceSpanScores;
17636
18022
  exports.useWorkflow = useWorkflow;
17637
18023
  exports.useWorkflowRuns = useWorkflowRuns;
17638
18024
  exports.useWorkingMemory = useWorkingMemory;