@mastra/playground-ui 6.2.1 → 6.2.2-alpha.2

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.
package/dist/index.es.js CHANGED
@@ -4287,7 +4287,10 @@ const useCodemirrorTheme$2 = () => {
4287
4287
  []
4288
4288
  );
4289
4289
  };
4290
- const SyntaxHighlighter$2 = ({ data, className }) => {
4290
+ const SyntaxHighlighter$2 = ({
4291
+ data,
4292
+ className
4293
+ }) => {
4291
4294
  const formattedCode = JSON.stringify(data, null, 2);
4292
4295
  const theme = useCodemirrorTheme$2();
4293
4296
  return /* @__PURE__ */ jsxs("div", { className: clsx("rounded-md bg-surface4 p-1 font-mono relative", className), children: [
@@ -4460,7 +4463,7 @@ const NetworkChoiceMetadataDialogTrigger = ({
4460
4463
  ] });
4461
4464
  };
4462
4465
 
4463
- const ToolBadge = ({ toolName, args, result, networkMetadata }) => {
4466
+ const ToolBadge = ({ toolName, args, result, networkMetadata, toolOutput }) => {
4464
4467
  let argSlot = null;
4465
4468
  try {
4466
4469
  const { __mastraMetadata: _, ...formattedArgs } = typeof args === "object" ? args : JSON.parse(args);
@@ -4468,7 +4471,7 @@ const ToolBadge = ({ toolName, args, result, networkMetadata }) => {
4468
4471
  } catch {
4469
4472
  argSlot = /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap", children: args });
4470
4473
  }
4471
- let resultSlot = typeof result === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap", children: result }) : /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: result });
4474
+ let resultSlot = typeof result === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap bg-surface4 p-4 rounded-md", children: result }) : /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: result });
4472
4475
  return /* @__PURE__ */ jsx(
4473
4476
  BadgeWrapper,
4474
4477
  {
@@ -4486,9 +4489,13 @@ const ToolBadge = ({ toolName, args, result, networkMetadata }) => {
4486
4489
  /* @__PURE__ */ jsx("p", { className: "font-medium pb-2", children: "Tool arguments" }),
4487
4490
  argSlot
4488
4491
  ] }),
4489
- result !== void 0 && /* @__PURE__ */ jsxs("div", { children: [
4492
+ resultSlot !== void 0 && /* @__PURE__ */ jsxs("div", { children: [
4490
4493
  /* @__PURE__ */ jsx("p", { className: "font-medium pb-2", children: "Tool result" }),
4491
4494
  resultSlot
4495
+ ] }),
4496
+ toolOutput.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
4497
+ /* @__PURE__ */ jsx("p", { className: "font-medium pb-2", children: "Tool output" }),
4498
+ /* @__PURE__ */ jsx("div", { className: "h-40 overflow-y-auto", children: /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: toolOutput }) })
4492
4499
  ] })
4493
4500
  ] })
4494
4501
  }
@@ -8461,10 +8468,24 @@ const ScrollableContainer = ({
8461
8468
  const LinkComponentContext = createContext({
8462
8469
  Link: forwardRef(() => null),
8463
8470
  navigate: () => {
8471
+ },
8472
+ paths: {
8473
+ agentLink: () => "",
8474
+ agentsLink: () => "",
8475
+ agentToolLink: () => "",
8476
+ agentThreadLink: () => "",
8477
+ agentNewThreadLink: () => "",
8478
+ workflowsLink: () => "",
8479
+ workflowLink: () => "",
8480
+ networkLink: () => "",
8481
+ networkNewThreadLink: () => "",
8482
+ networkThreadLink: () => "",
8483
+ scorerLink: () => "",
8484
+ toolLink: () => ""
8464
8485
  }
8465
8486
  });
8466
- const LinkComponentProvider = ({ children, Link, navigate }) => {
8467
- return /* @__PURE__ */ jsx(LinkComponentContext.Provider, { value: { Link, navigate }, children });
8487
+ const LinkComponentProvider = ({ children, Link, navigate, paths }) => {
8488
+ return /* @__PURE__ */ jsx(LinkComponentContext.Provider, { value: { Link, navigate, paths }, children });
8468
8489
  };
8469
8490
  const useLinkComponent = () => {
8470
8491
  const ctx = useContext(LinkComponentContext);
@@ -8509,8 +8530,8 @@ const columns$3 = [
8509
8530
  }
8510
8531
  ];
8511
8532
 
8512
- function WorkflowTable({ workflows, legacyWorkflows, isLoading, computeLink }) {
8513
- const { navigate } = useLinkComponent();
8533
+ function WorkflowTable({ workflows, legacyWorkflows, isLoading }) {
8534
+ const { navigate, paths } = useLinkComponent();
8514
8535
  const workflowData = useMemo(() => {
8515
8536
  const _workflowsData = Object.keys(workflows ?? {}).map((key) => {
8516
8537
  const workflow = workflows?.[key];
@@ -8519,7 +8540,7 @@ function WorkflowTable({ workflows, legacyWorkflows, isLoading, computeLink }) {
8519
8540
  name: workflow?.name || "N/A",
8520
8541
  stepsCount: Object.keys(workflow?.steps ?? {})?.length,
8521
8542
  isLegacy: false,
8522
- link: computeLink(key)
8543
+ link: paths.workflowLink(key)
8523
8544
  };
8524
8545
  });
8525
8546
  const legacyWorkflowsData = Object.keys(legacyWorkflows ?? {}).map((key) => {
@@ -8529,7 +8550,7 @@ function WorkflowTable({ workflows, legacyWorkflows, isLoading, computeLink }) {
8529
8550
  name: workflow?.name || "N/A",
8530
8551
  stepsCount: Object.keys(workflow?.steps ?? {})?.length,
8531
8552
  isLegacy: true,
8532
- link: computeLink(key)
8553
+ link: paths.workflowLink(key)
8533
8554
  };
8534
8555
  });
8535
8556
  return [..._workflowsData, ...legacyWorkflowsData];
@@ -8714,6 +8735,7 @@ const ToolFallbackInner = ({ toolName, result, args }) => {
8714
8735
  toolName,
8715
8736
  args,
8716
8737
  result,
8738
+ toolOutput: args?.__mastraMetadata?.toolOutput || [],
8717
8739
  networkMetadata: args?.__mastraMetadata?.networkMetadata
8718
8740
  }
8719
8741
  );
@@ -9862,6 +9884,34 @@ const handleStreamChunk = async ({
9862
9884
  case "tool-output": {
9863
9885
  if (chunk.payload.output?.type.startsWith("workflow-")) {
9864
9886
  handleWorkflowChunk({ workflowChunk: chunk.payload.output, setMessages, entityName: chunk.payload.toolName });
9887
+ } else {
9888
+ setMessages((currentConversation) => {
9889
+ const lastMessage = currentConversation[currentConversation.length - 1];
9890
+ if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
9891
+ const updatedContent = lastMessage.content.map((part) => {
9892
+ if (typeof part === "object" && part.type === "tool-call" && part.toolCallId === chunk.payload.toolCallId) {
9893
+ const existingToolOutput = part.args?.__mastraMetadata?.toolOutput || [];
9894
+ return {
9895
+ ...part,
9896
+ args: {
9897
+ ...part.args,
9898
+ __mastraMetadata: {
9899
+ ...part.args?.__mastraMetadata,
9900
+ toolOutput: [...existingToolOutput, chunk?.payload?.output]
9901
+ }
9902
+ }
9903
+ };
9904
+ }
9905
+ return part;
9906
+ });
9907
+ const updatedMessage = {
9908
+ ...lastMessage,
9909
+ content: updatedContent
9910
+ };
9911
+ return [...currentConversation.slice(0, -1), updatedMessage];
9912
+ }
9913
+ return currentConversation;
9914
+ });
9865
9915
  }
9866
9916
  break;
9867
9917
  }
@@ -12241,8 +12291,8 @@ const columns$2 = [
12241
12291
  }
12242
12292
  ];
12243
12293
 
12244
- function AgentsTable({ agents, isLoading, computeLink }) {
12245
- const { navigate } = useLinkComponent();
12294
+ function AgentsTable({ agents, isLoading }) {
12295
+ const { navigate, paths } = useLinkComponent();
12246
12296
  const projectData = useMemo(
12247
12297
  () => Object.keys(agents).map((key) => {
12248
12298
  const agent = agents[key];
@@ -12256,7 +12306,7 @@ function AgentsTable({ agents, isLoading, computeLink }) {
12256
12306
  repoUrl: void 0,
12257
12307
  tools: agent.tools,
12258
12308
  modelId: agent.modelId,
12259
- link: computeLink(key)
12309
+ link: paths.agentLink(key)
12260
12310
  };
12261
12311
  }),
12262
12312
  [agents]
@@ -13994,8 +14044,8 @@ const columns$1 = [
13994
14044
  }
13995
14045
  ];
13996
14046
 
13997
- function ScorersTable({ scorers, isLoading, computeScorerLink }) {
13998
- const { navigate } = useLinkComponent();
14047
+ function ScorersTable({ scorers, isLoading }) {
14048
+ const { navigate, paths } = useLinkComponent();
13999
14049
  const scorersData = useMemo(
14000
14050
  () => Object.keys(scorers).map((key) => {
14001
14051
  const scorer = scorers[key];
@@ -14020,7 +14070,7 @@ function ScorersTable({ scorers, isLoading, computeScorerLink }) {
14020
14070
  }
14021
14071
  return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table$1, { children: [
14022
14072
  /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
14023
- /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => navigate(computeScorerLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
14073
+ /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => navigate(paths.scorerLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
14024
14074
  ] }) });
14025
14075
  }
14026
14076
  const ScorersTableSkeleton = () => /* @__PURE__ */ jsxs(Table$1, { children: [
@@ -14305,21 +14355,18 @@ const AgentMetadataModelSwitcher = ({
14305
14355
  ] }) });
14306
14356
  };
14307
14357
 
14308
- const AgentMetadataNetworkList = ({ agents, computeAgentLink }) => {
14309
- const { Link } = useLinkComponent();
14358
+ const AgentMetadataNetworkList = ({ agents }) => {
14359
+ const { Link, paths } = useLinkComponent();
14310
14360
  if (agents.length === 0) {
14311
- return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No tools" });
14361
+ return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No agents" });
14312
14362
  }
14313
- return /* @__PURE__ */ jsx(AgentMetadataList, { children: agents.map((agent) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: computeAgentLink(agent), children: /* @__PURE__ */ jsx(Badge$1, { variant: "success", icon: /* @__PURE__ */ jsx(AgentIcon, {}), children: agent.name }) }) }, agent.id)) });
14363
+ return /* @__PURE__ */ jsx(AgentMetadataList, { children: agents.map((agent) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: paths.agentLink(agent.id), children: /* @__PURE__ */ jsx(Badge$1, { variant: "success", icon: /* @__PURE__ */ jsx(AgentIcon, {}), children: agent.name }) }) }, agent.id)) });
14314
14364
  };
14315
14365
  const AgentMetadata = ({
14366
+ agentId,
14316
14367
  agent,
14317
14368
  promptSlot,
14318
14369
  hasMemoryEnabled,
14319
- computeAgentLink,
14320
- computeToolLink,
14321
- computeWorkflowLink,
14322
- computeScorerLink,
14323
14370
  updateModel,
14324
14371
  modelProviders
14325
14372
  }) => {
@@ -14373,7 +14420,7 @@ const AgentMetadata = ({
14373
14420
  link: "https://mastra.ai/en/docs/agents/overview",
14374
14421
  title: "Agents documentation"
14375
14422
  },
14376
- children: /* @__PURE__ */ jsx(AgentMetadataNetworkList, { agents: networkAgents, computeAgentLink })
14423
+ children: /* @__PURE__ */ jsx(AgentMetadataNetworkList, { agents: networkAgents })
14377
14424
  }
14378
14425
  ),
14379
14426
  /* @__PURE__ */ jsx(
@@ -14384,7 +14431,7 @@ const AgentMetadata = ({
14384
14431
  link: "https://mastra.ai/en/docs/agents/using-tools-and-mcp",
14385
14432
  title: "Using Tools and MCP documentation"
14386
14433
  },
14387
- children: /* @__PURE__ */ jsx(AgentMetadataToolList, { tools, computeToolLink })
14434
+ children: /* @__PURE__ */ jsx(AgentMetadataToolList, { tools, agentId })
14388
14435
  }
14389
14436
  ),
14390
14437
  /* @__PURE__ */ jsx(
@@ -14395,29 +14442,29 @@ const AgentMetadata = ({
14395
14442
  link: "https://mastra.ai/en/docs/workflows/overview",
14396
14443
  title: "Workflows documentation"
14397
14444
  },
14398
- children: /* @__PURE__ */ jsx(AgentMetadataWorkflowList, { workflows, computeWorkflowLink })
14445
+ children: /* @__PURE__ */ jsx(AgentMetadataWorkflowList, { workflows })
14399
14446
  }
14400
14447
  ),
14401
- /* @__PURE__ */ jsx(AgentMetadataSection, { title: "Scorers", children: /* @__PURE__ */ jsx(AgentMetadataScorerList, { entityId: agent.name, entityType: "AGENT", computeScorerLink }) }),
14448
+ /* @__PURE__ */ jsx(AgentMetadataSection, { title: "Scorers", children: /* @__PURE__ */ jsx(AgentMetadataScorerList, { entityId: agent.name, entityType: "AGENT" }) }),
14402
14449
  /* @__PURE__ */ jsx(AgentMetadataSection, { title: "System Prompt", children: promptSlot })
14403
14450
  ] });
14404
14451
  };
14405
- const AgentMetadataToolList = ({ tools, computeToolLink }) => {
14406
- const { Link } = useLinkComponent();
14452
+ const AgentMetadataToolList = ({ tools, agentId }) => {
14453
+ const { Link, paths } = useLinkComponent();
14407
14454
  if (tools.length === 0) {
14408
14455
  return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No tools" });
14409
14456
  }
14410
- return /* @__PURE__ */ jsx(AgentMetadataList, { children: tools.map((tool) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: computeToolLink(tool), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(ToolsIcon, { className: "text-[#ECB047]" }), children: tool.id }) }) }, tool.id)) });
14457
+ return /* @__PURE__ */ jsx(AgentMetadataList, { children: tools.map((tool) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: paths.agentToolLink(agentId, tool.id), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(ToolsIcon, { className: "text-[#ECB047]" }), children: tool.id }) }) }, tool.id)) });
14411
14458
  };
14412
- const AgentMetadataWorkflowList = ({ workflows, computeWorkflowLink }) => {
14413
- const { Link } = useLinkComponent();
14459
+ const AgentMetadataWorkflowList = ({ workflows }) => {
14460
+ const { Link, paths } = useLinkComponent();
14414
14461
  if (workflows.length === 0) {
14415
14462
  return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No workflows" });
14416
14463
  }
14417
- return /* @__PURE__ */ jsx(AgentMetadataList, { children: workflows.map((workflow) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: computeWorkflowLink(workflow.id, workflow), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(WorkflowIcon, { className: "text-accent3" }), children: workflow.name }) }) }, workflow.id)) });
14464
+ return /* @__PURE__ */ jsx(AgentMetadataList, { children: workflows.map((workflow) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: paths.workflowLink(workflow.id), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(WorkflowIcon, { className: "text-accent3" }), children: workflow.name }) }) }, workflow.id)) });
14418
14465
  };
14419
- const AgentMetadataScorerList = ({ entityId, entityType, computeScorerLink }) => {
14420
- const { Link } = useLinkComponent();
14466
+ const AgentMetadataScorerList = ({ entityId, entityType }) => {
14467
+ const { Link, paths } = useLinkComponent();
14421
14468
  const { scorers, isLoading } = useScorers();
14422
14469
  const scorerList = Object.keys(scorers).filter((scorerKey) => {
14423
14470
  const scorer = scorers[scorerKey];
@@ -14432,7 +14479,7 @@ const AgentMetadataScorerList = ({ entityId, entityType, computeScorerLink }) =>
14432
14479
  if (scorerList.length === 0) {
14433
14480
  return /* @__PURE__ */ jsx(AgentMetadataListEmpty, { children: "No Scorers" });
14434
14481
  }
14435
- return /* @__PURE__ */ jsx(AgentMetadataList, { children: scorerList.map((scorer) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: computeScorerLink(scorer.id), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(GaugeIcon, { className: "text-icon3" }), children: scorer.scorer.config.name }) }) }, scorer.id)) });
14482
+ return /* @__PURE__ */ jsx(AgentMetadataList, { children: scorerList.map((scorer) => /* @__PURE__ */ jsx(AgentMetadataListItem, { children: /* @__PURE__ */ jsx(Link, { href: paths.scorerLink(scorer.id), children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(GaugeIcon, { className: "text-icon3" }), children: scorer.scorer.config.name }) }) }, scorer.id)) });
14436
14483
  };
14437
14484
 
14438
14485
  const AgentMetadataPrompt = ({ prompt }) => {
@@ -14565,31 +14612,26 @@ AlertDialog.Description = AlertDialogDescription;
14565
14612
  AlertDialog.Action = AlertDialogAction;
14566
14613
  AlertDialog.Cancel = AlertDialogCancel;
14567
14614
 
14568
- const ChatThreads = ({
14569
- computeNewThreadLink,
14570
- computeThreadLink,
14571
- threads,
14572
- isLoading,
14573
- threadId,
14574
- onDelete
14575
- }) => {
14576
- const { Link } = useLinkComponent();
14615
+ const ChatThreads = ({ threads, isLoading, threadId, onDelete, resourceId, resourceType }) => {
14616
+ const { Link, paths } = useLinkComponent();
14577
14617
  const [deleteId, setDeleteId] = useState(null);
14578
14618
  if (isLoading) {
14579
14619
  return /* @__PURE__ */ jsx(ChatThreadSkeleton, {});
14580
14620
  }
14581
14621
  const reverseThreads = [...threads].reverse();
14622
+ const newThreadLink = resourceType === "agent" ? paths.agentNewThreadLink(resourceId) : paths.networkNewThreadLink(resourceId);
14582
14623
  return /* @__PURE__ */ jsxs("div", { className: "overflow-y-auto h-full w-full", children: [
14583
14624
  /* @__PURE__ */ jsx(Threads, { children: /* @__PURE__ */ jsxs(ThreadList, { children: [
14584
- /* @__PURE__ */ jsx(ThreadItem, { children: /* @__PURE__ */ jsx(ThreadLink, { as: Link, to: computeNewThreadLink(), children: /* @__PURE__ */ jsxs("span", { className: "text-accent1 flex items-center gap-4", children: [
14625
+ /* @__PURE__ */ jsx(ThreadItem, { children: /* @__PURE__ */ jsx(ThreadLink, { as: Link, to: newThreadLink, children: /* @__PURE__ */ jsxs("span", { className: "text-accent1 flex items-center gap-4", children: [
14585
14626
  /* @__PURE__ */ jsx(Icon, { className: "bg-surface4 rounded-lg", size: "lg", children: /* @__PURE__ */ jsx(Plus, {}) }),
14586
14627
  "New Chat"
14587
14628
  ] }) }) }),
14588
14629
  reverseThreads.length === 0 && /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3 py-3 px-5 max-w-[12rem]", children: "Your conversations will appear here once you start chatting!" }),
14589
14630
  reverseThreads.map((thread) => {
14590
14631
  const isActive = thread.id === threadId;
14632
+ const threadLink = resourceType === "agent" ? paths.agentThreadLink(resourceId, thread.id) : paths.networkThreadLink(resourceId, thread.id);
14591
14633
  return /* @__PURE__ */ jsxs(ThreadItem, { isActive, children: [
14592
- /* @__PURE__ */ jsxs(ThreadLink, { as: Link, to: computeThreadLink(thread.id), children: [
14634
+ /* @__PURE__ */ jsxs(ThreadLink, { as: Link, to: threadLink, children: [
14593
14635
  /* @__PURE__ */ jsx(ThreadTitle, { title: thread.title }),
14594
14636
  /* @__PURE__ */ jsx("span", { children: formatDay(thread.createdAt) })
14595
14637
  ] }),
@@ -15639,8 +15681,8 @@ const columns = [
15639
15681
  }
15640
15682
  ];
15641
15683
 
15642
- const NetworkTable = ({ networks, isLoading, computeLink }) => {
15643
- const { navigate } = useLinkComponent();
15684
+ const NetworkTable = ({ networks, isLoading }) => {
15685
+ const { navigate, paths } = useLinkComponent();
15644
15686
  const allNetworks = useMemo(
15645
15687
  () => [
15646
15688
  ...networks?.map((network) => ({
@@ -15666,7 +15708,7 @@ const NetworkTable = ({ networks, isLoading, computeLink }) => {
15666
15708
  }
15667
15709
  return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table$1, { children: [
15668
15710
  /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
15669
- /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => navigate(computeLink(row.original.id)), className: "cursor-pointer", children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
15711
+ /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => navigate(paths.networkLink(row.original.id)), className: "cursor-pointer", children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
15670
15712
  ] }) });
15671
15713
  };
15672
15714
  const NetworkTableEmpty = () => {
@@ -15807,17 +15849,13 @@ const EntityContent = ({ children, className }) => {
15807
15849
  return /* @__PURE__ */ jsx("div", { className, children });
15808
15850
  };
15809
15851
 
15810
- const ToolList = ({ tools, agents, isLoading, computeLink, computeAgentLink }) => {
15852
+ const ToolList = ({ tools, agents, isLoading }) => {
15811
15853
  const toolsWithAgents = useMemo(() => prepareAgents(tools, agents), [tools, agents]);
15812
15854
  if (isLoading)
15813
15855
  return /* @__PURE__ */ jsx("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: /* @__PURE__ */ jsx(ToolListSkeleton, {}) });
15814
- return /* @__PURE__ */ jsx(ToolListInner, { toolsWithAgents, computeLink, computeAgentLink });
15856
+ return /* @__PURE__ */ jsx(ToolListInner, { toolsWithAgents });
15815
15857
  };
15816
- const ToolListInner = ({
15817
- toolsWithAgents,
15818
- computeLink,
15819
- computeAgentLink
15820
- }) => {
15858
+ const ToolListInner = ({ toolsWithAgents }) => {
15821
15859
  const [filteredTools, setFilteredTools] = useState(toolsWithAgents);
15822
15860
  const [value, setValue] = useState("");
15823
15861
  if (filteredTools.length === 0 && !value) return /* @__PURE__ */ jsx(ToolListEmpty, {});
@@ -15838,22 +15876,22 @@ const ToolListInner = ({
15838
15876
  /* @__PURE__ */ jsx(Searchbar, { onSearch: handleSearch, label: "Search for a tool", placeholder: "Search for a tool" }),
15839
15877
  filteredTools.length === 0 && /* @__PURE__ */ jsx(Txt, { as: "p", className: "text-icon3 py-2", children: "No tools found matching your search." })
15840
15878
  ] }),
15841
- /* @__PURE__ */ jsx("div", { className: "grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-5xl mx-auto py-8", children: filteredTools.map((tool) => /* @__PURE__ */ jsx(ToolEntity, { tool, computeLink, computeAgentLink }, tool.id)) })
15879
+ /* @__PURE__ */ jsx("div", { className: "grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-5xl mx-auto py-8", children: filteredTools.map((tool) => /* @__PURE__ */ jsx(ToolEntity, { tool }, tool.id)) })
15842
15880
  ] });
15843
15881
  };
15844
- const ToolEntity = ({ tool, computeLink, computeAgentLink }) => {
15882
+ const ToolEntity = ({ tool }) => {
15845
15883
  const linkRef = useRef(null);
15846
- const { Link } = useLinkComponent();
15884
+ const { Link, paths } = useLinkComponent();
15847
15885
  return /* @__PURE__ */ jsxs(Entity, { onClick: () => linkRef.current?.click(), children: [
15848
15886
  /* @__PURE__ */ jsx(EntityIcon, { children: /* @__PURE__ */ jsx(ToolsIcon, { className: "group-hover/entity:text-[#ECB047]" }) }),
15849
15887
  /* @__PURE__ */ jsxs(EntityContent, { children: [
15850
- /* @__PURE__ */ jsx(EntityName, { children: /* @__PURE__ */ jsx(Link, { ref: linkRef, href: computeLink(tool.id, tool.agents[0]?.id), children: tool.id }) }),
15888
+ /* @__PURE__ */ jsx(EntityName, { children: /* @__PURE__ */ jsx(Link, { ref: linkRef, href: paths.toolLink(tool.id), children: tool.id }) }),
15851
15889
  /* @__PURE__ */ jsx(EntityDescription, { children: tool.description }),
15852
15890
  /* @__PURE__ */ jsx("div", { className: "inline-flex flex-wrap gap-2 pt-4", children: tool.agents.map((agent) => {
15853
15891
  return /* @__PURE__ */ jsx(
15854
15892
  Link,
15855
15893
  {
15856
- href: computeAgentLink(tool.id, agent.id),
15894
+ href: paths.agentToolLink(agent.id, tool.id),
15857
15895
  onClick: (e) => e.stopPropagation(),
15858
15896
  className: "group/link",
15859
15897
  children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(AgentIcon, { className: "group-hover/link:text-accent3" }), className: "bg-surface5 ", children: agent.name })
@@ -17835,14 +17873,15 @@ function TraceSpanUsage({ traceUsage, traceSpans = [], spanUsage, className }) {
17835
17873
  );
17836
17874
  }
17837
17875
 
17838
- function getTraceInfo(trace, computeAgentsLink, computeWorkflowsLink) {
17876
+ function useTraceInfo(trace) {
17877
+ const { paths } = useLinkComponent();
17839
17878
  if (!trace) {
17840
17879
  return [];
17841
17880
  }
17842
- const agentsLink = computeAgentsLink ? computeAgentsLink() : "/agents";
17843
- const workflowsLink = computeWorkflowsLink ? computeWorkflowsLink() : "/workflows";
17844
- const agentLink = computeAgentsLink ? `${agentsLink}/${trace?.metadata?.resourceId}` : `/agents/${trace?.metadata?.resourceId}`;
17845
- const workflowLink = computeWorkflowsLink ? `${workflowsLink}/${trace?.metadata?.resourceId}` : `/workflows/${trace?.metadata?.resourceId}`;
17881
+ const agentsLink = paths.agentsLink();
17882
+ const workflowsLink = paths.workflowsLink();
17883
+ const agentLink = paths.agentLink(trace?.metadata?.resourceId);
17884
+ const workflowLink = paths.workflowLink(trace?.metadata?.resourceId);
17846
17885
  return [
17847
17886
  {
17848
17887
  key: "entityId",
@@ -17991,15 +18030,14 @@ function TraceDialog({
17991
18030
  onClose,
17992
18031
  onNext,
17993
18032
  onPrevious,
17994
- isLoadingSpans,
17995
- computeAgentsLink,
17996
- computeWorkflowsLink
18033
+ isLoadingSpans
17997
18034
  }) {
17998
18035
  const { Link } = useLinkComponent();
17999
18036
  const [dialogIsOpen, setDialogIsOpen] = useState(false);
18000
18037
  const [selectedSpanId, setSelectedSpanId] = useState(void 0);
18001
18038
  const [combinedView, setCombinedView] = useState(false);
18002
18039
  const selectedSpan = traceSpans.find((span) => span.spanId === selectedSpanId);
18040
+ const traceInfo = useTraceInfo(traceDetails);
18003
18041
  const hierarchicalSpans = useMemo(() => {
18004
18042
  return formatHierarchicalSpans(traceSpans);
18005
18043
  }, [traceSpans]);
@@ -18043,7 +18081,6 @@ function TraceDialog({
18043
18081
  const currentIndex = flatSpans.findIndex((span) => span.id === selectedSpanId);
18044
18082
  return currentIndex > 0;
18045
18083
  };
18046
- const traceInfo = getTraceInfo(traceDetails, computeAgentsLink, computeWorkflowsLink);
18047
18084
  const selectedSpanInfo = getSpanInfo({ span: selectedSpan, withTraceId: !combinedView, withSpanId: combinedView });
18048
18085
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18049
18086
  /* @__PURE__ */ jsxs(
@@ -18266,7 +18303,7 @@ function MainContentContent({
18266
18303
  "items-start content-start": !isCentered && !isDivided && !hasLeftServiceColumn,
18267
18304
  "grid place-items-center": isCentered,
18268
18305
  "grid-cols-[1fr_1fr]": isDivided && !hasLeftServiceColumn,
18269
- "grid-cols-[auto_1fr_1fr]": isDivided && hasLeftServiceColumn,
18306
+ "grid-cols-[12rem_1fr_1fr]": isDivided && hasLeftServiceColumn,
18270
18307
  "grid-cols-[auto_1fr]": !isDivided && hasLeftServiceColumn
18271
18308
  },
18272
18309
  className