@mastra/playground-ui 6.3.0 → 6.3.1-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.
Files changed (45) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/{colors-DLwJ7rFA.cjs → colors-B_l6leHd.cjs} +2 -2
  3. package/dist/{colors-DLwJ7rFA.cjs.map → colors-B_l6leHd.cjs.map} +1 -1
  4. package/dist/{colors-DrbbnW3f.js → colors-Br49332d.js} +2 -2
  5. package/dist/{colors-DrbbnW3f.js.map → colors-Br49332d.js.map} +1 -1
  6. package/dist/index.cjs.js +606 -539
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.es.js +602 -530
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/src/components/assistant-ui/tools/badges/workflow-badge.d.ts +3 -2
  11. package/dist/src/components/threads.d.ts +2 -1
  12. package/dist/src/components/ui/searchbar.d.ts +3 -0
  13. package/dist/src/domains/agents/components/agent-metadata/agent-metadata-section.d.ts +2 -1
  14. package/dist/src/domains/agents/components/agent-metadata/agent-metadata.d.ts +2 -1
  15. package/dist/src/domains/agents/components/agent-table/agent-table.d.ts +0 -2
  16. package/dist/src/domains/agents/components/agent-table/columns.d.ts +1 -4
  17. package/dist/src/domains/agents/components/agent-table/types.d.ts +2 -11
  18. package/dist/src/domains/mcps/components/mcp-table/columns.d.ts +3 -0
  19. package/dist/src/domains/mcps/components/mcp-table/mcp-table.d.ts +6 -0
  20. package/dist/src/domains/mcps/components/mcp-table/types.d.ts +2 -0
  21. package/dist/src/domains/mcps/hooks/useMCPServerTools.d.ts +3 -0
  22. package/dist/src/domains/mcps/index.d.ts +2 -0
  23. package/dist/src/domains/scores/components/scorers-table/scorers-table.d.ts +0 -2
  24. package/dist/src/domains/scores/components/scorers-table/types.d.ts +2 -3
  25. package/dist/src/domains/tools/components/tool-table/columns.d.ts +3 -0
  26. package/dist/src/domains/tools/components/tool-table/tool-table.d.ts +7 -0
  27. package/dist/src/domains/tools/components/tool-table/types.d.ts +2 -0
  28. package/dist/src/domains/tools/index.d.ts +1 -1
  29. package/dist/src/domains/tools/utils/prepareToolsTable.d.ts +7 -0
  30. package/dist/src/domains/workflows/components/workflow-table/types.d.ts +2 -4
  31. package/dist/src/domains/workflows/components/workflow-table/workflow-table.d.ts +1 -3
  32. package/dist/src/domains/workflows/context/workflow-run-context.d.ts +6 -4
  33. package/dist/src/domains/workflows/index.d.ts +1 -1
  34. package/dist/src/domains/workflows/runs/workflow-run-details.d.ts +12 -0
  35. package/dist/src/domains/workflows/runs/workflow-run-list.d.ts +5 -0
  36. package/dist/src/domains/workflows/utils.d.ts +2 -4
  37. package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +3 -2
  38. package/dist/src/ds/components/Table/Cells.d.ts +1 -1
  39. package/dist/src/index.d.ts +2 -0
  40. package/dist/src/lib/framework.d.ts +2 -0
  41. package/dist/tokens.cjs.js +1 -1
  42. package/dist/tokens.es.js +1 -1
  43. package/package.json +7 -7
  44. package/dist/src/domains/tools/components/tool-list.d.ts +0 -9
  45. package/dist/src/domains/workflows/runs/workflow-runs.d.ts +0 -11
package/dist/index.cjs.js CHANGED
@@ -26,7 +26,7 @@ const Dagre = require('@dagrejs/dagre');
26
26
  const prismReactRenderer = require('prism-react-renderer');
27
27
  const CollapsiblePrimitive = require('@radix-ui/react-collapsible');
28
28
  const ScrollAreaPrimitive = require('@radix-ui/react-scroll-area');
29
- const colors = require('./colors-DLwJ7rFA.cjs');
29
+ const colors = require('./colors-B_l6leHd.cjs');
30
30
  const prettier = require('prettier');
31
31
  const prettierPluginBabel = require('prettier/plugins/babel');
32
32
  const prettierPluginEstree = require('prettier/plugins/estree');
@@ -4359,7 +4359,7 @@ const Badge$1 = ({ icon, variant = "default", className, children, ...props }) =
4359
4359
  "div",
4360
4360
  {
4361
4361
  className: clsx(
4362
- "bg-surface4 text-ui-sm gap-md h-badge-default inline-flex items-center rounded-md",
4362
+ "font-mono bg-surface4 text-ui-sm gap-md h-badge-default inline-flex items-center rounded-md shrink-0",
4363
4363
  icon ? "pl-md pr-1.5" : "px-1.5",
4364
4364
  icon || variant === "default" ? "text-icon5" : variantClasses$3[variant],
4365
4365
  className
@@ -4551,8 +4551,7 @@ const ToolBadge = ({ toolName, args, result, networkMetadata, toolOutput }) => {
4551
4551
  );
4552
4552
  };
4553
4553
 
4554
- function convertWorkflowRunStateToWatchResult(runState) {
4555
- const runId = runState.runId;
4554
+ function convertWorkflowRunStateToStreamResult(runState) {
4556
4555
  const steps = {};
4557
4556
  const context = runState.context || {};
4558
4557
  Object.entries(context).forEach(([stepId, stepResult]) => {
@@ -4571,190 +4570,26 @@ function convertWorkflowRunStateToWatchResult(runState) {
4571
4570
  };
4572
4571
  }
4573
4572
  });
4574
- const status = determineWorkflowStatus(steps);
4575
- return {
4576
- type: "watch",
4577
- payload: {
4578
- workflowState: {
4579
- status,
4580
- steps,
4581
- result: runState.value,
4582
- payload: context.input,
4583
- error: void 0
4573
+ const suspendedStepIds = Object.entries(steps).flatMap(
4574
+ ([stepId, stepResult]) => {
4575
+ if (stepResult?.status === "suspended") {
4576
+ const nestedPath = stepResult?.suspendPayload?.__workflow_meta?.path;
4577
+ return nestedPath ? [[stepId, ...nestedPath]] : [[stepId]];
4584
4578
  }
4585
- },
4586
- eventTimestamp: new Date(runState.timestamp),
4587
- runId
4579
+ return [];
4580
+ }
4581
+ );
4582
+ const suspendedStep = suspendedStepIds?.[0]?.[0];
4583
+ const suspendPayload = suspendedStep ? steps[suspendedStep]?.suspendPayload : void 0;
4584
+ return {
4585
+ input: context.input,
4586
+ steps,
4587
+ status: runState.status,
4588
+ ...runState.status === "success" ? { result: runState.result } : {},
4589
+ ...runState.status === "failed" ? { error: runState.error } : {},
4590
+ ...runState.status === "suspended" ? { suspended: suspendedStepIds, suspendPayload } : {}
4588
4591
  };
4589
4592
  }
4590
- function determineWorkflowStatus(steps) {
4591
- const stepStatuses = Object.values(steps).map((step) => step.status);
4592
- if (stepStatuses.includes("failed")) {
4593
- return "failed";
4594
- }
4595
- if (stepStatuses.includes("suspended")) {
4596
- return "suspended";
4597
- }
4598
- if (stepStatuses.every((status) => status === "success")) {
4599
- return "success";
4600
- }
4601
- return "running";
4602
- }
4603
- const mapWorkflowStreamChunkToWatchResult = (prev, chunk) => {
4604
- if (chunk.type === "workflow-start") {
4605
- return {
4606
- ...prev,
4607
- runId: chunk.runId,
4608
- eventTimestamp: /* @__PURE__ */ new Date(),
4609
- payload: {
4610
- ...prev?.payload || {},
4611
- workflowState: {
4612
- ...prev?.payload?.workflowState,
4613
- status: "running",
4614
- steps: prev?.runId === chunk.runId ? prev?.payload?.workflowState?.steps ?? {} : {}
4615
- }
4616
- }
4617
- };
4618
- }
4619
- if (chunk.type === "workflow-step-start") {
4620
- const current = prev?.payload?.workflowState?.steps?.[chunk.payload.id] || {};
4621
- return {
4622
- ...prev,
4623
- runId: chunk.runId,
4624
- payload: {
4625
- ...prev.payload,
4626
- currentStep: {
4627
- id: chunk.payload.id,
4628
- ...chunk.payload
4629
- },
4630
- workflowState: {
4631
- ...prev?.payload?.workflowState,
4632
- steps: {
4633
- ...prev?.payload?.workflowState?.steps,
4634
- [chunk.payload.id]: {
4635
- ...current || {},
4636
- ...chunk.payload
4637
- }
4638
- }
4639
- }
4640
- },
4641
- eventTimestamp: /* @__PURE__ */ new Date()
4642
- };
4643
- }
4644
- if (chunk.type === "workflow-step-suspended") {
4645
- const current = prev?.payload?.workflowState?.steps?.[chunk.payload.id] || {};
4646
- return {
4647
- ...prev,
4648
- runId: chunk.runId,
4649
- payload: {
4650
- ...prev?.payload,
4651
- currentStep: {
4652
- id: chunk.payload.id,
4653
- ...prev?.payload?.currentStep,
4654
- ...chunk.payload
4655
- },
4656
- workflowState: {
4657
- ...prev?.payload?.workflowState,
4658
- status: "suspended",
4659
- steps: {
4660
- ...prev?.payload?.workflowState?.steps,
4661
- [chunk.payload.id]: {
4662
- ...current || {},
4663
- ...chunk.payload
4664
- }
4665
- }
4666
- }
4667
- },
4668
- eventTimestamp: /* @__PURE__ */ new Date()
4669
- };
4670
- }
4671
- if (chunk.type === "workflow-step-waiting") {
4672
- const current = prev?.payload?.workflowState?.steps?.[chunk.payload.id] || {};
4673
- return {
4674
- ...prev,
4675
- runId: chunk.runId,
4676
- payload: {
4677
- ...prev?.payload,
4678
- currentStep: {
4679
- id: chunk.payload.id,
4680
- ...prev?.payload?.currentStep || {},
4681
- ...chunk.payload
4682
- },
4683
- workflowState: {
4684
- ...prev?.payload?.workflowState,
4685
- status: "waiting",
4686
- steps: {
4687
- ...prev?.payload?.workflowState?.steps,
4688
- [chunk.payload.id]: {
4689
- ...current,
4690
- ...chunk.payload
4691
- }
4692
- }
4693
- }
4694
- },
4695
- eventTimestamp: /* @__PURE__ */ new Date()
4696
- };
4697
- }
4698
- if (chunk.type === "workflow-step-result") {
4699
- const status = chunk.payload.status;
4700
- const current = prev?.payload?.workflowState?.steps?.[chunk.payload.id] || {};
4701
- const next = {
4702
- ...prev,
4703
- runId: chunk.runId,
4704
- payload: {
4705
- ...prev?.payload,
4706
- currentStep: {
4707
- id: chunk.payload.id,
4708
- ...prev?.payload?.currentStep || {},
4709
- ...chunk.payload
4710
- },
4711
- workflowState: {
4712
- ...prev?.payload?.workflowState,
4713
- status,
4714
- steps: {
4715
- ...prev?.payload?.workflowState?.steps,
4716
- [chunk.payload.id]: {
4717
- ...current,
4718
- ...chunk.payload
4719
- }
4720
- }
4721
- }
4722
- },
4723
- eventTimestamp: /* @__PURE__ */ new Date()
4724
- };
4725
- return next;
4726
- }
4727
- if (chunk.type === "workflow-canceled") {
4728
- return {
4729
- ...prev,
4730
- runId: chunk.runId,
4731
- payload: {
4732
- ...prev?.payload,
4733
- workflowState: {
4734
- ...prev?.payload?.workflowState,
4735
- status: "canceled"
4736
- }
4737
- },
4738
- eventTimestamp: /* @__PURE__ */ new Date()
4739
- };
4740
- }
4741
- if (chunk.type === "workflow-finish") {
4742
- return {
4743
- ...prev,
4744
- runId: chunk.runId,
4745
- payload: {
4746
- ...prev?.payload,
4747
- currentStep: void 0,
4748
- workflowState: {
4749
- ...prev?.payload?.workflowState,
4750
- status: chunk.payload.workflowStatus
4751
- }
4752
- },
4753
- eventTimestamp: /* @__PURE__ */ new Date()
4754
- };
4755
- }
4756
- return prev;
4757
- };
4758
4593
 
4759
4594
  const WorkflowRunContext = React.createContext({});
4760
4595
  function WorkflowRunProvider({
@@ -4762,17 +4597,19 @@ function WorkflowRunProvider({
4762
4597
  snapshot
4763
4598
  }) {
4764
4599
  const [result, setResult] = React.useState(
4765
- () => snapshot ? convertWorkflowRunStateToWatchResult(snapshot) : null
4600
+ () => snapshot ? convertWorkflowRunStateToStreamResult(snapshot) : null
4766
4601
  );
4767
4602
  const [payload, setPayload] = React.useState(() => snapshot?.context?.input ?? null);
4603
+ const [runId, setRunId] = React.useState(() => snapshot?.runId ?? "");
4768
4604
  const clearData = () => {
4769
4605
  setResult(null);
4770
4606
  setPayload(null);
4771
4607
  };
4772
4608
  React.useEffect(() => {
4773
4609
  if (snapshot?.runId) {
4774
- setResult(convertWorkflowRunStateToWatchResult(snapshot));
4610
+ setResult(convertWorkflowRunStateToStreamResult(snapshot));
4775
4611
  setPayload(snapshot.context?.input);
4612
+ setRunId(snapshot.runId);
4776
4613
  }
4777
4614
  }, [snapshot]);
4778
4615
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4784,7 +4621,9 @@ function WorkflowRunProvider({
4784
4621
  payload,
4785
4622
  setPayload,
4786
4623
  clearData,
4787
- snapshot
4624
+ snapshot,
4625
+ runId,
4626
+ setRunId
4788
4627
  },
4789
4628
  children
4790
4629
  }
@@ -5275,22 +5114,22 @@ ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displ
5275
5114
 
5276
5115
  const useCurrentRun = () => {
5277
5116
  const context = React.useContext(WorkflowRunContext);
5278
- const workflowCurrentSteps = context.result?.payload?.workflowState?.steps ?? {};
5117
+ const workflowCurrentSteps = context.result?.steps ?? {};
5279
5118
  const steps = Object.entries(workflowCurrentSteps).reduce((acc, [key, value]) => {
5280
5119
  return {
5281
5120
  ...acc,
5282
5121
  [key]: {
5283
- error: value.error,
5122
+ error: "error" in value ? value.error : void 0,
5284
5123
  startedAt: value.startedAt,
5285
- endedAt: value.endedAt,
5124
+ endedAt: "endedAt" in value ? value.endedAt : void 0,
5286
5125
  status: value.status,
5287
- output: value.output,
5126
+ output: "output" in value ? value.output : void 0,
5288
5127
  input: value.payload,
5289
- resumeData: value.resumePayload
5128
+ resumeData: "resumePayload" in value ? value.resumePayload : void 0
5290
5129
  }
5291
5130
  };
5292
5131
  }, {});
5293
- return { steps, runId: context.result?.runId };
5132
+ return { steps, runId: context.runId };
5294
5133
  };
5295
5134
 
5296
5135
  const sizeClasses = {
@@ -7217,7 +7056,7 @@ function WorkflowTrigger({
7217
7056
  cancelWorkflowRun
7218
7057
  }) {
7219
7058
  const { runtimeContext } = usePlaygroundStore();
7220
- const { result, setResult, payload, setPayload } = React.useContext(WorkflowRunContext);
7059
+ const { result, setResult, payload, setPayload, setRunId: setContextRunId } = React.useContext(WorkflowRunContext);
7221
7060
  const [isRunning, setIsRunning] = React.useState(false);
7222
7061
  const [innerRunId, setInnerRunId] = React.useState("");
7223
7062
  const [cancelResponse, setCancelResponse] = React.useState(null);
@@ -7231,6 +7070,7 @@ function WorkflowTrigger({
7231
7070
  const { runId } = await createWorkflowRun({ workflowId });
7232
7071
  setRunId?.(runId);
7233
7072
  setInnerRunId(runId);
7073
+ setContextRunId(runId);
7234
7074
  streamWorkflow({ workflowId, runId, inputData: data, runtimeContext });
7235
7075
  } catch (err) {
7236
7076
  setIsRunning(false);
@@ -7255,9 +7095,9 @@ function WorkflowTrigger({
7255
7095
  setCancelResponse(response);
7256
7096
  };
7257
7097
  const streamResultToUse = result ?? streamResult;
7258
- const suspendedSteps = Object.entries(streamResultToUse?.payload?.workflowState?.steps || {}).filter(([_, { status }]) => status === "suspended").map(([stepId, { payload: payload2 }]) => ({
7098
+ const suspendedSteps = Object.entries(streamResultToUse?.steps || {}).filter(([_, { status }]) => status === "suspended").map(([stepId, { payload: payload2 }]) => ({
7259
7099
  stepId,
7260
- runId: streamResultToUse?.runId ?? "",
7100
+ runId: innerRunId,
7261
7101
  suspendPayload: payload2,
7262
7102
  isLoading: false
7263
7103
  }));
@@ -7265,6 +7105,7 @@ function WorkflowTrigger({
7265
7105
  if (paramsRunId && observeWorkflowStream) {
7266
7106
  observeWorkflowStream({ workflowId, runId: paramsRunId });
7267
7107
  setInnerRunId(paramsRunId);
7108
+ setContextRunId(paramsRunId);
7268
7109
  }
7269
7110
  }, [paramsRunId]);
7270
7111
  React.useEffect(() => {
@@ -7284,7 +7125,7 @@ function WorkflowTrigger({
7284
7125
  if (!workflow) return null;
7285
7126
  const isSuspendedSteps = suspendedSteps.length > 0;
7286
7127
  const zodInputSchema = triggerSchema ? resolveSerializedZodOutput(jsonSchemaToZod(superjson.parse(triggerSchema))) : null;
7287
- const workflowActivePaths = streamResultToUse?.payload?.workflowState?.steps ?? {};
7128
+ const workflowActivePaths = streamResultToUse?.steps ?? {};
7288
7129
  const hasWorkflowActivePaths = Object.values(workflowActivePaths).length > 0;
7289
7130
  const doneStatuses = ["success", "failed", "canceled"];
7290
7131
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full pt-3 pb-12", children: [
@@ -7348,14 +7189,14 @@ function WorkflowTrigger({
7348
7189
  )
7349
7190
  ] }, step.stepId);
7350
7191
  }),
7351
- result?.runId && /* @__PURE__ */ jsxRuntime.jsxs(
7192
+ result?.status === "running" && /* @__PURE__ */ jsxRuntime.jsxs(
7352
7193
  Button$1,
7353
7194
  {
7354
7195
  variant: "light",
7355
7196
  className: "w-full",
7356
7197
  size: "lg",
7357
7198
  onClick: handleCancelWorkflowRun,
7358
- disabled: !!cancelResponse?.message || isCancellingWorkflowRun || result?.payload?.workflowState?.status && doneStatuses.includes(result?.payload?.workflowState?.status),
7199
+ disabled: !!cancelResponse?.message || isCancellingWorkflowRun || result?.status && doneStatuses.includes(result?.status),
7359
7200
  children: [
7360
7201
  isCancellingWorkflowRun ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin" }) }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.StopCircle, {}) }),
7361
7202
  cancelResponse?.message || "Cancel Workflow Run"
@@ -7366,8 +7207,13 @@ function WorkflowTrigger({
7366
7207
  /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "border-border1 border-sm my-5" }),
7367
7208
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
7368
7209
  /* @__PURE__ */ jsxRuntime.jsx(Text, { variant: "secondary", className: "px-4 text-mastra-el-3", size: "xs", children: "Status" }),
7369
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 flex flex-col gap-4", children: Object.entries(workflowActivePaths).filter(([key, _]) => key !== "input" && !key.endsWith(".input")).map(([stepId, { status, output }]) => {
7370
- return /* @__PURE__ */ jsxRuntime.jsx(WorkflowStatus, { stepId, status, result: output ?? {} }, stepId);
7210
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 flex flex-col gap-4", children: Object.entries(workflowActivePaths).filter(([key, _]) => key !== "input" && !key.endsWith(".input")).map(([stepId, step]) => {
7211
+ const { status } = step;
7212
+ let output = {};
7213
+ if (step.status === "success") {
7214
+ output = step.output;
7215
+ }
7216
+ return /* @__PURE__ */ jsxRuntime.jsx(WorkflowStatus, { stepId, status, result: output }, stepId);
7371
7217
  }) })
7372
7218
  ] })
7373
7219
  ] })
@@ -7395,16 +7241,15 @@ const useWorkflowRuns = (workflowId, { enabled = true } = {}) => {
7395
7241
  queryKey: ["workflow-runs", workflowId],
7396
7242
  queryFn: () => client.getWorkflow(workflowId).runs({ limit: 50 }),
7397
7243
  enabled,
7244
+ refetchInterval: 5e3,
7398
7245
  gcTime: 0,
7399
7246
  staleTime: 0
7400
7247
  });
7401
7248
  };
7402
7249
 
7403
- const WorkflowRuns = ({
7250
+ const WorkflowRunDetail = ({
7404
7251
  workflowId,
7405
7252
  runId,
7406
- onPressRun,
7407
- onPressBackToRuns,
7408
7253
  observeWorkflowStream,
7409
7254
  ...triggerProps
7410
7255
  }) => {
@@ -7418,43 +7263,23 @@ const WorkflowRuns = ({
7418
7263
  }
7419
7264
  const run = actualRuns.find((run2) => run2.runId === runId);
7420
7265
  const runSnapshot = run?.snapshot;
7421
- const runResult = runSnapshot && typeof runSnapshot === "object" ? convertWorkflowRunStateToWatchResult(runSnapshot) : null;
7422
- const runStatus = runResult?.payload?.workflowState?.status;
7266
+ const runResult = runSnapshot && typeof runSnapshot === "object" ? convertWorkflowRunStateToStreamResult(runSnapshot) : null;
7267
+ const runStatus = runResult?.status;
7423
7268
  if (runId) {
7424
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full grid grid-rows-[1fr_auto]", children: [
7425
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-5 space-y-2", children: /* @__PURE__ */ jsxRuntime.jsxs(Button$1, { onClick: onPressBackToRuns, variant: "light", children: [
7426
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, {}) }),
7427
- "Back to runs"
7428
- ] }) }),
7429
- /* @__PURE__ */ jsxRuntime.jsx(
7430
- WorkflowTrigger,
7431
- {
7432
- ...triggerProps,
7433
- streamResult: isObjectEmpty(triggerProps.streamResult ?? {}) ? runResult : triggerProps.streamResult,
7434
- paramsRunId: runId,
7435
- workflowId,
7436
- observeWorkflowStream: () => {
7437
- if (runStatus !== "success" && runStatus !== "failed" && runStatus !== "canceled") {
7438
- observeWorkflowStream?.({ workflowId, runId });
7439
- }
7269
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full grid grid-rows-[1fr_auto]", children: /* @__PURE__ */ jsxRuntime.jsx(
7270
+ WorkflowTrigger,
7271
+ {
7272
+ ...triggerProps,
7273
+ paramsRunId: runId,
7274
+ workflowId,
7275
+ observeWorkflowStream: () => {
7276
+ if (runStatus !== "success" && runStatus !== "failed" && runStatus !== "canceled") {
7277
+ observeWorkflowStream?.({ workflowId, runId, storeRunResult: runResult });
7440
7278
  }
7441
7279
  }
7442
- )
7443
- ] });
7280
+ }
7281
+ ) });
7444
7282
  }
7445
- return /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "pb-10", children: actualRuns.map((run2) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
7446
- "button",
7447
- {
7448
- onClick: () => onPressRun({ workflowId, runId: run2.runId }),
7449
- className: clsx("px-3 py-2 border-b-sm border-border1 block w-full hover:bg-surface4 text-left", {
7450
- "bg-surface4": run2.runId === runId
7451
- }),
7452
- children: [
7453
- /* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-lg", className: "font-medium text-icon6 truncate", as: "p", children: run2.runId }),
7454
- /* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-sm", className: "font-medium text-icon3 truncate", as: "p", children: typeof run2?.snapshot === "string" ? "" : run2?.snapshot?.timestamp ? dateFns.formatDate(run2?.snapshot?.timestamp, "MMM d, yyyy h:mm a") : "" })
7455
- ]
7456
- }
7457
- ) }, run2.runId)) });
7458
7283
  };
7459
7284
 
7460
7285
  const EmptyState = ({
@@ -7509,7 +7334,7 @@ const Row = React.forwardRef(
7509
7334
  "tr",
7510
7335
  {
7511
7336
  className: clsx(
7512
- "border-b-sm border-border1 hover:bg-surface3 focus:bg-surface3 -outline-offset-2 last:border-b-0",
7337
+ "border-b-sm border-border1 hover:bg-surface3 focus:bg-surface3 -outline-offset-2",
7513
7338
  selected && "bg-surface4",
7514
7339
  onClick && "cursor-pointer",
7515
7340
  className
@@ -7562,7 +7387,7 @@ const DateTimeCell = ({ dateTime, ...props }) => {
7562
7387
  };
7563
7388
  const EntryCell = ({ name, description, icon, meta, ...props }) => {
7564
7389
  return /* @__PURE__ */ jsxRuntime.jsx(Cell, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-[14px]", children: [
7565
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", className: "text-icon5", children: icon }),
7390
+ icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", className: "text-icon5", children: icon }),
7566
7391
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-0", children: [
7567
7392
  /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "span", variant: "ui-md", className: "text-icon6 font-medium !leading-tight", children: name }),
7568
7393
  description && /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "span", variant: "ui-xs", className: "text-icon3 w-full max-w-[300px] truncate !leading-tight", children: description })
@@ -7732,7 +7557,9 @@ const LinkComponentContext = React.createContext({
7732
7557
  networkNewThreadLink: () => "",
7733
7558
  networkThreadLink: () => "",
7734
7559
  scorerLink: () => "",
7735
- toolLink: () => ""
7560
+ toolLink: () => "",
7561
+ mcpServerLink: () => "",
7562
+ workflowRunLink: () => ""
7736
7563
  }
7737
7564
  });
7738
7565
  const LinkComponentProvider = ({ children, Link, navigate, paths }) => {
@@ -7746,17 +7573,16 @@ const useLinkComponent = () => {
7746
7573
  return ctx;
7747
7574
  };
7748
7575
 
7749
- const columns$2 = [
7576
+ const columns$4 = [
7750
7577
  {
7751
7578
  id: "name",
7752
7579
  header: "Name",
7753
7580
  cell: ({ row }) => {
7754
- const { Link } = useLinkComponent();
7581
+ const { Link, paths } = useLinkComponent();
7755
7582
  return /* @__PURE__ */ jsxRuntime.jsx(
7756
7583
  EntryCell,
7757
7584
  {
7758
- icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, {}),
7759
- name: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: row.original.link, children: row.original.name }),
7585
+ name: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: paths.workflowLink(row.original.id), children: row.original.name }),
7760
7586
  description: void 0,
7761
7587
  meta: void 0
7762
7588
  }
@@ -7770,43 +7596,111 @@ const columns$2 = [
7770
7596
  id: "stepsCount",
7771
7597
  header: "Steps",
7772
7598
  size: 300,
7773
- cell: ({ row }) => /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, {}), className: "!h-button-md", children: [
7774
- row.original.stepsCount,
7775
- " step",
7776
- row.original.stepsCount > 1 ? "s" : ""
7777
- ] }) }) })
7599
+ cell: ({ row }) => {
7600
+ const workflow = row.original;
7601
+ const stepsCount = Object.keys(workflow.steps ?? {}).length;
7602
+ return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, {}), className: "!h-button-md", children: [
7603
+ stepsCount,
7604
+ " step",
7605
+ stepsCount > 1 ? "s" : ""
7606
+ ] }) }) });
7607
+ }
7778
7608
  }
7779
7609
  ];
7780
7610
 
7611
+ const themeClasses = {
7612
+ light: "bg-gray-100 border-gray-300 text-gray-700",
7613
+ dark: "bg-surface4 border-border1 text-icon6"
7614
+ };
7615
+ const Kbd = ({ children, theme = "dark" }) => {
7616
+ const themeClass = themeClasses[theme];
7617
+ return /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: clsx("border-sm rounded-md px-1 py-0.5 font-mono", themeClass), children });
7618
+ };
7619
+
7620
+ const Searchbar = ({ onSearch, label, placeholder }) => {
7621
+ const id = React.useId();
7622
+ const inputRef = React.useRef(null);
7623
+ React.useEffect(() => {
7624
+ const input = inputRef.current;
7625
+ if (!input) return;
7626
+ const handleKeyDown = (event) => {
7627
+ if (event.key.toLowerCase() === "f" && event.shiftKey && (event.ctrlKey || event.metaKey)) {
7628
+ event.preventDefault();
7629
+ input.focus();
7630
+ }
7631
+ };
7632
+ window.addEventListener("keydown", handleKeyDown);
7633
+ return () => {
7634
+ window.removeEventListener("keydown", handleKeyDown);
7635
+ };
7636
+ }, []);
7637
+ const handleSubmit = (e) => {
7638
+ e.preventDefault();
7639
+ const formData = new FormData(e.target);
7640
+ const search = formData.get(id);
7641
+ onSearch(search);
7642
+ };
7643
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7644
+ "form",
7645
+ {
7646
+ onSubmit: handleSubmit,
7647
+ className: "focus-within:outline focus-within:outline-accent1 -outline-offset-2 border-sm border-icon-3 flex h-8 w-full items-center gap-2 overflow-hidden rounded-lg pl-2 pr-1",
7648
+ children: [
7649
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "text-icon3 h-4 w-4" }),
7650
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
7651
+ /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "sr-only", children: label }),
7652
+ /* @__PURE__ */ jsxRuntime.jsx(
7653
+ "input",
7654
+ {
7655
+ id,
7656
+ type: "text",
7657
+ placeholder,
7658
+ className: "bg-surface2 text-ui-md placeholder:text-icon-3 block h-8 w-full px-2 outline-none",
7659
+ name: id,
7660
+ ref: inputRef
7661
+ }
7662
+ )
7663
+ ] }),
7664
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", className: "text-ui-sm text-icon3 flex flex-row items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(Kbd, { children: "↵ Enter" }) })
7665
+ ]
7666
+ }
7667
+ );
7668
+ };
7669
+ const SearchbarWrapper = ({ children }) => {
7670
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 border-b-sm border-border1", children });
7671
+ };
7672
+
7781
7673
  function WorkflowTable({ workflows, isLoading }) {
7674
+ const [search, setSearch] = React.useState("");
7782
7675
  const { navigate, paths } = useLinkComponent();
7783
7676
  const workflowData = React.useMemo(() => {
7784
7677
  const _workflowsData = Object.keys(workflows ?? {}).map((key) => {
7785
- const workflow = workflows?.[key];
7678
+ const workflow = workflows[key];
7786
7679
  return {
7787
7680
  id: key,
7788
- name: workflow?.name || "N/A",
7789
- stepsCount: Object.keys(workflow?.steps ?? {})?.length,
7790
- link: paths.workflowLink(key)
7681
+ ...workflow
7791
7682
  };
7792
7683
  });
7793
7684
  return _workflowsData;
7794
7685
  }, [workflows]);
7795
7686
  const table = reactTable.useReactTable({
7796
7687
  data: workflowData,
7797
- columns: columns$2,
7688
+ columns: columns$4,
7798
7689
  getCoreRowModel: reactTable.getCoreRowModel()
7799
7690
  });
7800
- if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(WorkflowTableSkeleton, {});
7801
7691
  const ths = table.getHeaderGroups()[0];
7802
7692
  const rows = table.getRowModel().rows.concat();
7803
- if (rows.length === 0) {
7693
+ if (rows.length === 0 && !isLoading) {
7804
7694
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyWorkflowsTable, {});
7805
7695
  }
7806
- return /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
7807
- /* @__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)) }),
7808
- /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(row.original.link), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
7809
- ] }) });
7696
+ const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
7697
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7698
+ /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search workflows", placeholder: "Search workflows" }) }),
7699
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(WorkflowTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
7700
+ /* @__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)) }),
7701
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: filteredRows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(paths.workflowLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
7702
+ ] }) })
7703
+ ] });
7810
7704
  }
7811
7705
  const WorkflowTableSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
7812
7706
  /* @__PURE__ */ jsxRuntime.jsxs(Thead, { children: [
@@ -8427,7 +8321,7 @@ const MistralIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs(
8427
8321
  );
8428
8322
 
8429
8323
  const NetlifyIcon = (props) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "128", height: "113", viewBox: "0 0 128 113", children: [
8430
- /* @__PURE__ */ jsxRuntime.jsxs("g", { "clip-path": "url(#clip0_236_138)", ...props, children: [
8324
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { clipPath: "url(#clip0_236_138)", ...props, children: [
8431
8325
  /* @__PURE__ */ jsxRuntime.jsx(
8432
8326
  "path",
8433
8327
  {
@@ -8551,23 +8445,32 @@ const ProviderLogo = ({ providerId, className = "", size = 20 }) => {
8551
8445
  );
8552
8446
  };
8553
8447
 
8448
+ const statusClasses = {
8449
+ warning: "bg-yellow-900/20 border-sm border-yellow-200 text-yellow-200 rounded-lg px-4 py-2 flex gap-4 items-center",
8450
+ default: ""
8451
+ };
8554
8452
  const AssistantMessage = ({ ToolFallback: ToolFallbackCustom, hasModelList }) => {
8555
8453
  const data = react.useMessage();
8556
8454
  const messageId = data.id;
8557
8455
  const isToolCallAndOrReasoning = data.content.every(({ type }) => type === "tool-call" || type === "reasoning");
8558
8456
  const modelMetadata = data.metadata?.custom?.modelMetadata;
8457
+ const messageStatus = data.metadata?.custom?.status;
8458
+ const statusClass = statusClasses[messageStatus || "default"];
8559
8459
  const showModelUsed = hasModelList && modelMetadata;
8560
8460
  return /* @__PURE__ */ jsxRuntime.jsxs(react.MessagePrimitive.Root, { className: "max-w-full", "data-message-id": messageId, children: [
8561
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-icon6 text-ui-lg leading-ui-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
8562
- react.MessagePrimitive.Parts,
8563
- {
8564
- components: {
8565
- Text: ErrorAwareText,
8566
- tools: { Fallback: ToolFallbackCustom || ToolFallback },
8567
- Reasoning
8461
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx("text-icon6 text-ui-lg leading-ui-lg", statusClass), children: [
8462
+ messageStatus === "warning" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, {}) }),
8463
+ /* @__PURE__ */ jsxRuntime.jsx(
8464
+ react.MessagePrimitive.Parts,
8465
+ {
8466
+ components: {
8467
+ Text: ErrorAwareText,
8468
+ tools: { Fallback: ToolFallbackCustom || ToolFallback },
8469
+ Reasoning
8470
+ }
8568
8471
  }
8569
- }
8570
- ) }),
8472
+ )
8473
+ ] }),
8571
8474
  !isToolCallAndOrReasoning && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("h-6 pt-4 flex gap-2 items-center", { "pb-1": showModelUsed }), children: [
8572
8475
  showModelUsed && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
8573
8476
  /* @__PURE__ */ jsxRuntime.jsx(ProviderLogo, { providerId: modelMetadata.modelProvider, size: 14 }),
@@ -9648,6 +9551,25 @@ const handleNetworkMessageFromMemory = (content) => {
9648
9551
 
9649
9552
  const handleStreamChunk = ({ chunk, conversation }) => {
9650
9553
  switch (chunk.type) {
9554
+ case "tripwire": {
9555
+ return [
9556
+ ...conversation,
9557
+ {
9558
+ role: "assistant",
9559
+ metadata: {
9560
+ custom: {
9561
+ status: "warning"
9562
+ }
9563
+ },
9564
+ content: [
9565
+ {
9566
+ type: "text",
9567
+ text: chunk.payload.tripwireReason
9568
+ }
9569
+ ]
9570
+ }
9571
+ ];
9572
+ }
9651
9573
  case "start": {
9652
9574
  const newMessage = {
9653
9575
  role: "assistant",
@@ -9881,7 +9803,7 @@ const handleWorkflowChunk = ({
9881
9803
  ...part.args,
9882
9804
  __mastraMetadata: {
9883
9805
  ...part.args?.__mastraMetadata,
9884
- workflowFullState: mapWorkflowStreamChunkToWatchResult(
9806
+ workflowFullState: react$3.mapWorkflowStreamChunkToWatchResult(
9885
9807
  part.args?.__mastraMetadata?.workflowFullState || {},
9886
9808
  workflowChunk
9887
9809
  ),
@@ -10027,7 +9949,7 @@ const handleAgentChunk = ({
10027
9949
  ...agentChunk.payload.args,
10028
9950
  __mastraMetadata: {
10029
9951
  ...agentChunk.payload.args?.__mastraMetadata,
10030
- workflowFullState: mapWorkflowStreamChunkToWatchResult(
9952
+ workflowFullState: react$3.mapWorkflowStreamChunkToWatchResult(
10031
9953
  lastMastraMessage.args?.__mastraMetadata?.workflowFullState || {},
10032
9954
  agentChunk.payload.output
10033
9955
  ),
@@ -10364,8 +10286,16 @@ function MastraRuntimeProvider({
10364
10286
  threadId,
10365
10287
  modelSettings: modelSettingsArgs,
10366
10288
  signal: controller.signal,
10367
- onFinish: (messages2) => {
10368
- return messages2.map((message2) => react$3.toAssistantUIMessage(message2));
10289
+ onFinish: ({ messages: messages2, tripwireReason }) => {
10290
+ const next = messages2.length > 0 ? messages2.map((message2) => react$3.toAssistantUIMessage(message2)) : [];
10291
+ if (tripwireReason) {
10292
+ next.push({
10293
+ role: "assistant",
10294
+ content: [{ type: "text", text: tripwireReason }],
10295
+ metadata: { custom: { status: "warning" } }
10296
+ });
10297
+ }
10298
+ return next;
10369
10299
  }
10370
10300
  });
10371
10301
  return;
@@ -11495,7 +11425,7 @@ const AgentSettings = ({ modelVersion, hasMemory = false, hasSubAgents = false }
11495
11425
  children: [
11496
11426
  modelVersion !== "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11497
11427
  /* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "generateLegacy", id: "generateLegacy", className: "text-icon6" }),
11498
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "generateLegacy", children: "Generate" })
11428
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "generateLegacy", children: "Generate (Legacy)" })
11499
11429
  ] }),
11500
11430
  modelVersion === "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11501
11431
  /* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "generate", id: "generate", className: "text-icon6" }),
@@ -11503,7 +11433,7 @@ const AgentSettings = ({ modelVersion, hasMemory = false, hasSubAgents = false }
11503
11433
  ] }),
11504
11434
  modelVersion !== "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11505
11435
  /* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "streamLegacy", id: "streamLegacy", className: "text-icon6" }),
11506
- /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "streamLegacy", children: "Stream" })
11436
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "streamLegacy", children: "Stream (Legacy)" })
11507
11437
  ] }),
11508
11438
  modelVersion === "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11509
11439
  /* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "stream", id: "stream", className: "text-icon6" }),
@@ -11556,27 +11486,25 @@ const AgentSettings = ({ modelVersion, hasMemory = false, hasSubAgents = false }
11556
11486
  ] });
11557
11487
  };
11558
11488
 
11559
- const NameCell$1 = ({ row }) => {
11560
- const { Link } = useLinkComponent();
11489
+ const NameCell$3 = ({ row }) => {
11490
+ const { Link, paths } = useLinkComponent();
11561
11491
  return /* @__PURE__ */ jsxRuntime.jsx(
11562
11492
  EntryCell,
11563
11493
  {
11564
- icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, {}),
11565
- name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: row.original.link, children: row.original.name }),
11494
+ name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: paths.agentLink(row.original.id), children: row.original.name }),
11566
11495
  description: row.original.instructions
11567
11496
  }
11568
11497
  );
11569
11498
  };
11570
- const columns$1 = [
11499
+ const columns$3 = [
11571
11500
  {
11572
11501
  header: "Name",
11573
11502
  accessorKey: "name",
11574
- cell: NameCell$1
11503
+ cell: NameCell$3
11575
11504
  },
11576
11505
  {
11577
11506
  header: "Model",
11578
11507
  accessorKey: "model",
11579
- size: 300,
11580
11508
  cell: ({ row }) => {
11581
11509
  return /* @__PURE__ */ jsxRuntime.jsxs(Cell, { children: [
11582
11510
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -11607,67 +11535,76 @@ const columns$1 = [
11607
11535
  }
11608
11536
  },
11609
11537
  {
11610
- size: 160,
11611
- header: "Tools",
11612
- accessorKey: "tools",
11538
+ header: "Attached entities",
11539
+ accessorKey: "attachedEntities",
11613
11540
  cell: ({ row }) => {
11614
- const toolsCount = row.original.tools ? Object.keys(row.original.tools).length : 0;
11615
- return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(ApiIcon, {}), children: [
11616
- toolsCount,
11617
- " tool",
11618
- toolsCount > 1 ? "s" : ""
11541
+ const agent = row.original;
11542
+ const agentsCount = Object.keys(agent.agents || {}).length;
11543
+ const toolsCount = Object.keys(agent.tools || {}).length;
11544
+ const workflowsCount = Object.keys(agent.workflows || {}).length;
11545
+ return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-row gap-2 w-full items-center", children: [
11546
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, { className: "text-accent1" }), children: [
11547
+ agentsCount,
11548
+ " agent",
11549
+ agentsCount > 1 ? "s" : ""
11550
+ ] }),
11551
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "text-accent6" }), children: [
11552
+ toolsCount,
11553
+ " tool",
11554
+ toolsCount > 1 ? "s" : ""
11555
+ ] }),
11556
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, { className: "text-accent3" }), children: [
11557
+ workflowsCount,
11558
+ " workflow",
11559
+ workflowsCount > 1 ? "s" : ""
11560
+ ] })
11619
11561
  ] }) });
11620
11562
  }
11621
11563
  }
11622
11564
  ];
11623
11565
 
11624
11566
  function AgentsTable({ agents, isLoading }) {
11567
+ const [search, setSearch] = React.useState("");
11625
11568
  const { navigate, paths } = useLinkComponent();
11626
11569
  const projectData = React.useMemo(
11627
11570
  () => Object.keys(agents).map((key) => {
11628
11571
  const agent = agents[key];
11629
11572
  return {
11630
11573
  id: key,
11631
- name: agent.name,
11632
- instructions: agent.instructions,
11633
- provider: agent.provider,
11634
- branch: void 0,
11635
- executedAt: void 0,
11636
- repoUrl: void 0,
11637
- tools: agent.tools,
11638
- modelId: agent.modelId,
11639
- link: paths.agentLink(key),
11640
- modelList: agent.modelList
11574
+ ...agent
11641
11575
  };
11642
11576
  }),
11643
11577
  [agents]
11644
11578
  );
11645
11579
  const table = reactTable.useReactTable({
11646
11580
  data: projectData,
11647
- columns: columns$1,
11581
+ columns: columns$3,
11648
11582
  getCoreRowModel: reactTable.getCoreRowModel()
11649
11583
  });
11650
- if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(AgentsTableSkeleton, {});
11651
11584
  const ths = table.getHeaderGroups()[0];
11652
11585
  const rows = table.getRowModel().rows.concat();
11653
- if (rows.length === 0) {
11586
+ if (rows.length === 0 && !isLoading) {
11654
11587
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyAgentsTable, {});
11655
11588
  }
11656
- return /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
11657
- /* @__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)) }),
11658
- /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(row.original.link), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
11659
- ] }) }) });
11589
+ const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
11590
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11591
+ /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search agents", placeholder: "Search agents" }) }),
11592
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(AgentsTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
11593
+ /* @__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)) }),
11594
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: filteredRows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(paths.agentLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
11595
+ ] }) }) })
11596
+ ] });
11660
11597
  }
11661
11598
  const AgentsTableSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
11662
11599
  /* @__PURE__ */ jsxRuntime.jsxs(Thead, { children: [
11663
11600
  /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Name" }),
11664
- /* @__PURE__ */ jsxRuntime.jsx(Th, { width: 160, children: "Model" }),
11665
- /* @__PURE__ */ jsxRuntime.jsx(Th, { width: 160, children: "Tools" })
11601
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Model" }),
11602
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Attached entities" })
11666
11603
  ] }),
11667
11604
  /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs(Row, { children: [
11668
11605
  /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11669
- /* @__PURE__ */ jsxRuntime.jsx(Cell, { width: 160, children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11670
- /* @__PURE__ */ jsxRuntime.jsx(Cell, { width: 160, children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) })
11606
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11607
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) })
11671
11608
  ] }, index)) })
11672
11609
  ] });
11673
11610
  const EmptyAgentsTable = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -11777,7 +11714,7 @@ const AgentMetadataSection = ({ title, children, hint }) => {
11777
11714
  /* @__PURE__ */ jsxRuntime.jsxs(Txt, { as: "h3", variant: "ui-md", className: "text-icon3 flex items-center gap-1", children: [
11778
11715
  title,
11779
11716
  hint && /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
11780
- /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: hint.link, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "text-icon3", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}) }) }) }),
11717
+ /* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: hint.link, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "text-icon3", size: "sm", children: hint.icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, {}) }) }) }),
11781
11718
  /* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: hint.title })
11782
11719
  ] }) })
11783
11720
  ] }),
@@ -13354,53 +13291,56 @@ const useScorers = () => {
13354
13291
  });
13355
13292
  };
13356
13293
 
13357
- const NameCell = ({ row }) => {
13358
- const { Link } = useLinkComponent();
13294
+ const NameCell$2 = ({ row }) => {
13295
+ const { Link, paths } = useLinkComponent();
13296
+ const scorer = row.original;
13359
13297
  return /* @__PURE__ */ jsxRuntime.jsx(
13360
13298
  EntryCell,
13361
13299
  {
13362
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, {}),
13363
- name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: row.original.id, children: row.original.name }),
13364
- description: row.original.description
13300
+ name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: paths.scorerLink(scorer.id), children: scorer.scorer.config.name }),
13301
+ description: scorer.scorer.config.description
13365
13302
  }
13366
13303
  );
13367
13304
  };
13368
- const columns = [
13305
+ const columns$2 = [
13369
13306
  {
13370
13307
  header: "Name",
13371
13308
  accessorKey: "name",
13372
- cell: NameCell
13309
+ cell: NameCell$2
13373
13310
  }
13374
13311
  ];
13375
13312
 
13376
13313
  function ScorersTable({ scorers, isLoading }) {
13377
13314
  const { navigate, paths } = useLinkComponent();
13315
+ const [search, setSearch] = React.useState("");
13378
13316
  const scorersData = React.useMemo(
13379
13317
  () => Object.keys(scorers).map((key) => {
13380
13318
  const scorer = scorers[key];
13381
13319
  return {
13382
- id: key,
13383
- name: scorer.scorer.config.name,
13384
- description: scorer.scorer.config.description
13320
+ ...scorer,
13321
+ id: key
13385
13322
  };
13386
13323
  }),
13387
13324
  [scorers]
13388
13325
  );
13389
13326
  const table = reactTable.useReactTable({
13390
13327
  data: scorersData,
13391
- columns,
13328
+ columns: columns$2,
13392
13329
  getCoreRowModel: reactTable.getCoreRowModel()
13393
13330
  });
13394
- if (isLoading) return /* @__PURE__ */ jsxRuntime.jsx(ScorersTableSkeleton, {});
13395
13331
  const ths = table.getHeaderGroups()[0];
13396
13332
  const rows = table.getRowModel().rows.concat();
13397
- if (rows.length === 0) {
13333
+ if (rows.length === 0 && !isLoading) {
13398
13334
  return /* @__PURE__ */ jsxRuntime.jsx(EmptyScorersTable, {});
13399
13335
  }
13400
- return /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
13401
- /* @__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)) }),
13402
- /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(paths.scorerLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
13403
- ] }) });
13336
+ const filteredRows = rows.filter((row) => row.original.scorer.config.name.toLowerCase().includes(search.toLowerCase()));
13337
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13338
+ /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search scorers", placeholder: "Search scorers" }) }),
13339
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ScorersTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
13340
+ /* @__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)) }),
13341
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: filteredRows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(paths.scorerLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
13342
+ ] }) })
13343
+ ] });
13404
13344
  }
13405
13345
  const ScorersTableSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
13406
13346
  /* @__PURE__ */ jsxRuntime.jsx(Thead, { children: /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Name" }) }),
@@ -13497,7 +13437,7 @@ const AgentMetadataModelSwitcher = ({
13497
13437
  };
13498
13438
  fetchProviders();
13499
13439
  }, [apiUrl]);
13500
- const currentModelProvider = selectedProvider;
13440
+ const currentModelProvider = cleanProviderId(selectedProvider);
13501
13441
  const allModels = React.useMemo(() => {
13502
13442
  return providers.flatMap(
13503
13443
  (provider) => provider.models.map((model) => ({
@@ -13566,7 +13506,7 @@ const AgentMetadataModelSwitcher = ({
13566
13506
  }
13567
13507
  };
13568
13508
  const handleProviderSelect = async (provider) => {
13569
- setSelectedProvider(provider.id);
13509
+ setSelectedProvider(cleanProviderId(provider.id));
13570
13510
  setProviderSearch("");
13571
13511
  setIsSearchingProvider(false);
13572
13512
  setShowProviderSuggestions(false);
@@ -13591,7 +13531,7 @@ const AgentMetadataModelSwitcher = ({
13591
13531
  const providerChanged = currentModelProvider && currentModelProvider !== defaultProvider;
13592
13532
  const modelEmpty = !selectedModel || selectedModel === "";
13593
13533
  if (providerChanged && modelEmpty) {
13594
- setSelectedProvider(defaultProvider);
13534
+ setSelectedProvider(cleanProviderId(defaultProvider));
13595
13535
  setSelectedModel(defaultModel);
13596
13536
  if (defaultProvider && defaultModel) {
13597
13537
  updateModel({
@@ -14123,7 +14063,8 @@ const AgentMetadata = ({
14123
14063
  updateModel,
14124
14064
  modelProviders,
14125
14065
  updateModelInModelList,
14126
- reorderModelList
14066
+ reorderModelList,
14067
+ modelVersion
14127
14068
  }) => {
14128
14069
  const networkAgentsMap = agent.agents ?? {};
14129
14070
  const networkAgents = Object.values(networkAgentsMap);
@@ -14140,15 +14081,26 @@ const AgentMetadata = ({
14140
14081
  updateModelInModelList,
14141
14082
  reorderModelList
14142
14083
  }
14143
- ) }) : /* @__PURE__ */ jsxRuntime.jsx(AgentMetadataSection, { title: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
14144
- AgentMetadataModelSwitcher,
14084
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(
14085
+ AgentMetadataSection,
14145
14086
  {
14146
- defaultProvider: agent.provider,
14147
- defaultModel: agent.modelId,
14148
- updateModel,
14149
- modelProviders
14087
+ title: "Model",
14088
+ hint: modelVersion === "v2" ? void 0 : {
14089
+ link: "https://mastra.ai/en/reference/agents/migration-guide",
14090
+ title: "You are using a legacy v1 model",
14091
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { fontSize: 14, className: "mb-0.5" })
14092
+ },
14093
+ children: /* @__PURE__ */ jsxRuntime.jsx(
14094
+ AgentMetadataModelSwitcher,
14095
+ {
14096
+ defaultProvider: agent.provider,
14097
+ defaultModel: agent.modelId,
14098
+ updateModel,
14099
+ modelProviders
14100
+ }
14101
+ )
14150
14102
  }
14151
- ) }),
14103
+ ),
14152
14104
  /* @__PURE__ */ jsxRuntime.jsx(
14153
14105
  AgentMetadataSection,
14154
14106
  {
@@ -14287,13 +14239,14 @@ const ThreadLink = ({ children, as: Component = "a", href, className, prefetch,
14287
14239
  const ThreadList = ({ children }) => {
14288
14240
  return /* @__PURE__ */ jsxRuntime.jsx("ol", { children });
14289
14241
  };
14290
- const ThreadItem = ({ children, isActive }) => {
14242
+ const ThreadItem = ({ children, isActive, className }) => {
14291
14243
  return /* @__PURE__ */ jsxRuntime.jsx(
14292
14244
  "li",
14293
14245
  {
14294
14246
  className: clsx(
14295
14247
  "border-b-sm border-border1 hover:bg-surface3 group flex h-[54px] items-center justify-between gap-2 px-3 py-2",
14296
- isActive && "bg-surface4"
14248
+ isActive && "bg-surface4",
14249
+ className
14297
14250
  ),
14298
14251
  children
14299
14252
  }
@@ -14390,7 +14343,7 @@ const ChatThreads = ({ threads, isLoading, threadId, onDelete, resourceId, resou
14390
14343
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "bg-surface4 rounded-lg", size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
14391
14344
  "New Chat"
14392
14345
  ] }) }) }),
14393
- threads.length === 0 && /* @__PURE__ */ jsxRuntime.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!" }),
14346
+ threads.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: "text-icon3 py-3 px-5", children: "Your conversations will appear here once you start chatting!" }),
14394
14347
  threads.map((thread) => {
14395
14348
  const isActive = thread.id === threadId;
14396
14349
  const threadLink = resourceType === "agent" ? paths.agentThreadLink(resourceId, thread.id) : paths.networkThreadLink(resourceId, thread.id);
@@ -14462,190 +14415,39 @@ const formatDay = (date) => {
14462
14415
  return new Date(date).toLocaleString("en-us", options).replace(",", " at");
14463
14416
  };
14464
14417
 
14465
- const themeClasses = {
14466
- light: "bg-gray-100 border-gray-300 text-gray-700",
14467
- dark: "bg-surface4 border-border1 text-icon6"
14468
- };
14469
- const Kbd = ({ children, theme = "dark" }) => {
14470
- const themeClass = themeClasses[theme];
14471
- return /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: clsx("border-sm rounded-md px-1 py-0.5 font-mono", themeClass), children });
14472
- };
14473
-
14474
- const Searchbar = ({ onSearch, label, placeholder }) => {
14475
- const id = React.useId();
14476
- const inputRef = React.useRef(null);
14477
- React.useEffect(() => {
14478
- const input = inputRef.current;
14479
- if (!input) return;
14480
- const handleKeyDown = (event) => {
14481
- if (event.key.toLowerCase() === "f" && event.shiftKey && (event.ctrlKey || event.metaKey)) {
14482
- event.preventDefault();
14483
- input.focus();
14484
- }
14485
- };
14486
- window.addEventListener("keydown", handleKeyDown);
14487
- return () => {
14488
- window.removeEventListener("keydown", handleKeyDown);
14489
- };
14490
- }, []);
14491
- const handleSubmit = (e) => {
14492
- e.preventDefault();
14493
- const formData = new FormData(e.target);
14494
- const search = formData.get(id);
14495
- onSearch(search);
14496
- };
14497
- return /* @__PURE__ */ jsxRuntime.jsxs(
14498
- "form",
14499
- {
14500
- onSubmit: handleSubmit,
14501
- className: "border-sm border-icon-3 flex h-8 w-full items-center gap-2 overflow-hidden rounded-lg pl-2 pr-1",
14502
- children: [
14503
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "text-icon3 h-4 w-4" }),
14504
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1", children: [
14505
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "sr-only", children: label }),
14506
- /* @__PURE__ */ jsxRuntime.jsx(
14507
- "input",
14508
- {
14509
- id,
14510
- type: "text",
14511
- placeholder,
14512
- className: "bg-surface2 text-ui-md placeholder:text-icon-3 block h-8 w-full px-2 -outline-offset-2",
14513
- name: id,
14514
- ref: inputRef
14515
- }
14516
- )
14517
- ] }),
14518
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "submit", className: "text-ui-sm text-icon3 flex flex-row items-center gap-1", children: /* @__PURE__ */ jsxRuntime.jsx(Kbd, { children: "Enter" }) })
14519
- ]
14520
- }
14521
- );
14522
- };
14523
-
14524
- const Entity = ({ children, className, onClick }) => {
14525
- return /* @__PURE__ */ jsxRuntime.jsx(
14526
- "div",
14527
- {
14528
- tabIndex: onClick ? 0 : void 0,
14529
- onKeyDown: (e) => {
14530
- if (!onClick) return;
14531
- if (e.key === "Enter" || e.key === " ") {
14532
- e.preventDefault();
14533
- onClick?.();
14534
- }
14535
- },
14536
- className: clsx(
14537
- "flex gap-3 group/entity bg-surface3 rounded-lg border-sm border-border1 py-3 px-4",
14538
- onClick && "cursor-pointer hover:bg-surface4 transition-all",
14539
- className
14540
- ),
14541
- onClick,
14542
- children
14543
- }
14544
- );
14545
- };
14546
- const EntityIcon = ({ children, className }) => {
14547
- return /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", className: clsx("text-icon3 mt-1", className), children });
14548
- };
14549
- const EntityName = ({ children, className }) => {
14550
- return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-lg", className: clsx("text-icon6 font-medium", className), children });
14551
- };
14552
- const EntityDescription = ({ children, className }) => {
14553
- return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: clsx("text-icon3", className), children });
14554
- };
14555
- const EntityContent = ({ children, className }) => {
14556
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
14557
- };
14558
-
14559
- const ToolList = ({ tools, agents, isLoading }) => {
14560
- const toolsWithAgents = React.useMemo(() => prepareAgents(tools, agents), [tools, agents]);
14561
- if (isLoading)
14562
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: /* @__PURE__ */ jsxRuntime.jsx(ToolListSkeleton, {}) });
14563
- return /* @__PURE__ */ jsxRuntime.jsx(ToolListInner, { toolsWithAgents });
14564
- };
14565
- const ToolListInner = ({ toolsWithAgents }) => {
14566
- const [filteredTools, setFilteredTools] = React.useState(toolsWithAgents);
14567
- const [value, setValue] = React.useState("");
14568
- if (filteredTools.length === 0 && !value) return /* @__PURE__ */ jsxRuntime.jsx(ToolListEmpty, {});
14569
- const handleSearch = (value2) => {
14570
- setValue(value2);
14571
- React.startTransition(() => {
14572
- setFilteredTools(
14573
- toolsWithAgents.filter(
14574
- (tool) => tool.id.toLowerCase().includes(value2.toLowerCase()) || tool.description.toLowerCase().includes(value2.toLowerCase()) || tool.agents.some(
14575
- (agent) => agent.name.toLowerCase().includes(value2.toLowerCase()) || agent.id.toLowerCase().includes(value2.toLowerCase())
14576
- )
14577
- )
14578
- );
14579
- });
14580
- };
14581
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
14582
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: [
14583
- /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: handleSearch, label: "Search for a tool", placeholder: "Search for a tool" }),
14584
- filteredTools.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", className: "text-icon3 py-2", children: "No tools found matching your search." })
14585
- ] }),
14586
- /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(ToolEntity, { tool }, tool.id)) })
14587
- ] });
14588
- };
14589
- const ToolEntity = ({ tool }) => {
14590
- const linkRef = React.useRef(null);
14418
+ const NameCell$1 = ({ row }) => {
14591
14419
  const { Link, paths } = useLinkComponent();
14592
- const toolLink = tool.agents.length > 0 ? paths.agentToolLink(tool.agents[0].id, tool.id) : paths.toolLink(tool.id);
14593
- return /* @__PURE__ */ jsxRuntime.jsxs(Entity, { onClick: () => linkRef.current?.click(), children: [
14594
- /* @__PURE__ */ jsxRuntime.jsx(EntityIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "group-hover/entity:text-[#ECB047]" }) }),
14595
- /* @__PURE__ */ jsxRuntime.jsxs(EntityContent, { children: [
14596
- /* @__PURE__ */ jsxRuntime.jsx(EntityName, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { ref: linkRef, href: toolLink, children: tool.id }) }),
14597
- /* @__PURE__ */ jsxRuntime.jsx(EntityDescription, { children: tool.description }),
14598
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex flex-wrap gap-2 pt-4", children: tool.agents.map((agent) => {
14599
- return /* @__PURE__ */ jsxRuntime.jsx(
14600
- Link,
14601
- {
14602
- href: paths.agentToolLink(agent.id, tool.id),
14603
- onClick: (e) => e.stopPropagation(),
14604
- className: "group/link",
14605
- children: /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, { className: "group-hover/link:text-accent3" }), className: "bg-surface5 ", children: agent.name })
14606
- },
14607
- agent.id
14608
- );
14609
- }) })
14610
- ] })
14611
- ] });
14612
- };
14613
- const ToolListSkeleton = () => {
14614
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
14615
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-10 w-full" }) }),
14616
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-5xl mx-auto py-8", children: [
14617
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-40 w-full" }),
14618
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-40 w-full" }),
14619
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-40 w-full" })
14620
- ] })
14621
- ] });
14622
- };
14623
- const ToolListEmpty = () => {
14420
+ const tool = row.original;
14624
14421
  return /* @__PURE__ */ jsxRuntime.jsx(
14625
- EmptyState,
14422
+ EntryCell,
14626
14423
  {
14627
- iconSlot: /* @__PURE__ */ jsxRuntime.jsx(ToolCoinIcon, {}),
14628
- titleSlot: "Configure Tools",
14629
- descriptionSlot: "Mastra tools are not configured yet. You can find more information in the documentation.",
14630
- actionSlot: /* @__PURE__ */ jsxRuntime.jsxs(
14631
- Button$1,
14632
- {
14633
- size: "lg",
14634
- className: "w-full",
14635
- variant: "light",
14636
- as: "a",
14637
- href: "https://mastra.ai/en/docs/agents/using-tools-and-mcp",
14638
- target: "_blank",
14639
- children: [
14640
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, {}) }),
14641
- "Docs"
14642
- ]
14643
- }
14644
- )
14424
+ name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: paths.toolLink(tool.id), children: tool.id }),
14425
+ description: tool.description
14645
14426
  }
14646
14427
  );
14647
14428
  };
14648
- const prepareAgents = (tools, agents) => {
14429
+ const columns$1 = [
14430
+ {
14431
+ header: "Name",
14432
+ accessorKey: "name",
14433
+ cell: NameCell$1
14434
+ },
14435
+ {
14436
+ header: "Attached entities",
14437
+ accessorKey: "attachedEntities",
14438
+ cell: ({ row }) => {
14439
+ const tool = row.original;
14440
+ const agentsCount = tool.agents.length;
14441
+ return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, { className: "text-accent1" }), children: [
14442
+ agentsCount,
14443
+ " agent",
14444
+ agentsCount > 1 ? "s" : ""
14445
+ ] }) });
14446
+ }
14447
+ }
14448
+ ];
14449
+
14450
+ const prepareToolsTable = (tools, agents) => {
14649
14451
  const toolsWithAgents = /* @__PURE__ */ new Map();
14650
14452
  const agentsKeys = Object.keys(agents);
14651
14453
  for (const k of agentsKeys) {
@@ -14660,7 +14462,7 @@ const prepareAgents = (tools, agents) => {
14660
14462
  agents: []
14661
14463
  });
14662
14464
  }
14663
- toolsWithAgents.get(tool.id).agents.push({ id: k, name: agent.name });
14465
+ toolsWithAgents.get(tool.id).agents.push({ ...agent, id: k });
14664
14466
  }
14665
14467
  }
14666
14468
  for (const [_, tool] of Object.entries(tools)) {
@@ -14674,6 +14476,67 @@ const prepareAgents = (tools, agents) => {
14674
14476
  return Array.from(toolsWithAgents.values());
14675
14477
  };
14676
14478
 
14479
+ function ToolTable({ tools, agents, isLoading }) {
14480
+ const [search, setSearch] = React.useState("");
14481
+ const { navigate, paths } = useLinkComponent();
14482
+ const toolData = React.useMemo(() => prepareToolsTable(tools, agents), [tools, agents]);
14483
+ const table = reactTable.useReactTable({
14484
+ data: toolData,
14485
+ columns: columns$1,
14486
+ getCoreRowModel: reactTable.getCoreRowModel()
14487
+ });
14488
+ const ths = table.getHeaderGroups()[0];
14489
+ const rows = table.getRowModel().rows.concat();
14490
+ if (rows.length === 0 && !isLoading) {
14491
+ return /* @__PURE__ */ jsxRuntime.jsx(EmptyToolsTable, {});
14492
+ }
14493
+ const filteredRows = rows.filter((row) => row.original.id.toLowerCase().includes(search.toLowerCase()));
14494
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14495
+ /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search tools", placeholder: "Search tools" }) }),
14496
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(ToolTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
14497
+ /* @__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)) }),
14498
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: filteredRows.map((row) => {
14499
+ const firstAgent = row.original.agents[0];
14500
+ const link = firstAgent ? paths.agentToolLink(firstAgent.id, row.original.id) : paths.toolLink(row.original.id);
14501
+ return /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(link), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id);
14502
+ }) })
14503
+ ] }) }) })
14504
+ ] });
14505
+ }
14506
+ const ToolTableSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
14507
+ /* @__PURE__ */ jsxRuntime.jsxs(Thead, { children: [
14508
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Name" }),
14509
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Used by" })
14510
+ ] }),
14511
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs(Row, { children: [
14512
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
14513
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) })
14514
+ ] }, index)) })
14515
+ ] });
14516
+ const EmptyToolsTable = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
14517
+ EmptyState,
14518
+ {
14519
+ iconSlot: /* @__PURE__ */ jsxRuntime.jsx(ToolCoinIcon, {}),
14520
+ titleSlot: "Configure Tools",
14521
+ descriptionSlot: "Mastra tools are not configured yet. You can find more information in the documentation.",
14522
+ actionSlot: /* @__PURE__ */ jsxRuntime.jsxs(
14523
+ Button$1,
14524
+ {
14525
+ size: "lg",
14526
+ className: "w-full",
14527
+ variant: "light",
14528
+ as: "a",
14529
+ href: "https://mastra.ai/en/docs/agents/using-tools-and-mcp",
14530
+ target: "_blank",
14531
+ children: [
14532
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, {}) }),
14533
+ "Docs"
14534
+ ]
14535
+ }
14536
+ )
14537
+ }
14538
+ ) });
14539
+
14677
14540
  function TemplatesTools({
14678
14541
  tagOptions,
14679
14542
  selectedTag,
@@ -15765,10 +15628,10 @@ const Header = ({ children, border = true }) => {
15765
15628
  );
15766
15629
  };
15767
15630
  const HeaderTitle = ({ children }) => {
15768
- return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "h1", variant: "ui-lg", className: "font-medium text-white", children });
15631
+ return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "h1", variant: "ui-lg", className: "font-medium text-white flex items-center gap-2", children });
15769
15632
  };
15770
15633
  const HeaderAction = ({ children }) => {
15771
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto", children });
15634
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex items-center gap-2", children });
15772
15635
  };
15773
15636
  const HeaderGroup = ({ children }) => {
15774
15637
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "gap-lg flex items-center", children });
@@ -17314,7 +17177,11 @@ const Crumb = ({ className, as, isCurrent, ...props }) => {
17314
17177
  Root,
17315
17178
  {
17316
17179
  "aria-current": isCurrent ? "page" : void 0,
17317
- className: clsx("text-ui-lg leading-ui-lg font-medium", isCurrent ? "text-white" : "text-icon3", className),
17180
+ className: clsx(
17181
+ "text-ui-lg leading-ui-lg font-medium flex items-center gap-2",
17182
+ isCurrent ? "text-white" : "text-icon3",
17183
+ className
17184
+ ),
17318
17185
  ...props
17319
17186
  }
17320
17187
  ) }),
@@ -17379,6 +17246,41 @@ const DarkLogo = (props) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "100
17379
17246
  )
17380
17247
  ] });
17381
17248
 
17249
+ const Entity = ({ children, className, onClick }) => {
17250
+ return /* @__PURE__ */ jsxRuntime.jsx(
17251
+ "div",
17252
+ {
17253
+ tabIndex: onClick ? 0 : void 0,
17254
+ onKeyDown: (e) => {
17255
+ if (!onClick) return;
17256
+ if (e.key === "Enter" || e.key === " ") {
17257
+ e.preventDefault();
17258
+ onClick?.();
17259
+ }
17260
+ },
17261
+ className: clsx(
17262
+ "flex gap-3 group/entity bg-surface3 rounded-lg border-sm border-border1 py-3 px-4",
17263
+ onClick && "cursor-pointer hover:bg-surface4 transition-all",
17264
+ className
17265
+ ),
17266
+ onClick,
17267
+ children
17268
+ }
17269
+ );
17270
+ };
17271
+ const EntityIcon = ({ children, className }) => {
17272
+ return /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", className: clsx("text-icon3 mt-1", className), children });
17273
+ };
17274
+ const EntityName = ({ children, className }) => {
17275
+ return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-lg", className: clsx("text-icon6 font-medium", className), children });
17276
+ };
17277
+ const EntityDescription = ({ children, className }) => {
17278
+ return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "p", variant: "ui-sm", className: clsx("text-icon3", className), children });
17279
+ };
17280
+ const EntityContent = ({ children, className }) => {
17281
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
17282
+ };
17283
+
17382
17284
  function usePolling({
17383
17285
  fetchFn,
17384
17286
  interval = 3e3,
@@ -17786,6 +17688,176 @@ const parseError = (error) => {
17786
17688
  }
17787
17689
  };
17788
17690
 
17691
+ const useMCPServerTools = (selectedServer) => {
17692
+ const client = react$3.useMastraClient();
17693
+ return reactQuery.useQuery({
17694
+ queryKey: ["mcpserver-tools", selectedServer?.id],
17695
+ queryFn: async () => {
17696
+ const response = await client.getMcpServerTools(selectedServer?.id);
17697
+ const fetchedToolsArray = response.tools;
17698
+ const transformedTools = {};
17699
+ fetchedToolsArray.forEach((sdkToolInfo) => {
17700
+ transformedTools[sdkToolInfo.id] = sdkToolInfo;
17701
+ });
17702
+ return transformedTools;
17703
+ },
17704
+ retry: false,
17705
+ refetchOnWindowFocus: false
17706
+ });
17707
+ };
17708
+
17709
+ const NameCell = ({ row }) => {
17710
+ const client = react$3.useMastraClient();
17711
+ const mcp = row.original;
17712
+ const { Link, paths } = useLinkComponent();
17713
+ const effectiveBaseUrl = client.options.baseUrl || "http://localhost:4111";
17714
+ const sseUrl = `${effectiveBaseUrl}/api/mcp/${mcp.id}/sse`;
17715
+ return /* @__PURE__ */ jsxRuntime.jsx(
17716
+ EntryCell,
17717
+ {
17718
+ name: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "w-full space-y-0", href: paths.mcpServerLink(row.original.id), children: row.original.name }),
17719
+ description: sseUrl
17720
+ }
17721
+ );
17722
+ };
17723
+ const columns = [
17724
+ {
17725
+ header: "Name",
17726
+ accessorKey: "name",
17727
+ cell: NameCell
17728
+ },
17729
+ {
17730
+ header: "Attached tools",
17731
+ accessorKey: "attachedTools",
17732
+ cell: ({ row }) => {
17733
+ const mcpServer = row.original;
17734
+ const { data: tools, isLoading } = useMCPServerTools(mcpServer);
17735
+ if (isLoading)
17736
+ return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-24" }) });
17737
+ const toolsCount = Object.keys(tools || {}).length;
17738
+ const agentToolsCount = Object.keys(tools || {}).filter((tool) => tools?.[tool]?.toolType === "agent").length;
17739
+ const workflowToolsCount = Object.keys(tools || {}).filter((tool) => tools?.[tool]?.toolType === "workflow").length;
17740
+ return /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-row gap-2 w-full items-center", children: [
17741
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, { className: "text-accent1" }), children: [
17742
+ agentToolsCount,
17743
+ " agent",
17744
+ agentToolsCount > 1 ? "s" : ""
17745
+ ] }),
17746
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(ToolsIcon, { className: "text-accent6" }), children: [
17747
+ toolsCount,
17748
+ " tool",
17749
+ toolsCount > 1 ? "s" : ""
17750
+ ] }),
17751
+ /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(WorkflowIcon, { className: "text-accent3" }), children: [
17752
+ workflowToolsCount,
17753
+ " workflow",
17754
+ workflowToolsCount > 1 ? "s" : ""
17755
+ ] })
17756
+ ] }) });
17757
+ }
17758
+ }
17759
+ ];
17760
+
17761
+ function MCPTable({ mcpServers, isLoading }) {
17762
+ const { navigate, paths } = useLinkComponent();
17763
+ const [search, setSearch] = React.useState("");
17764
+ const table = reactTable.useReactTable({
17765
+ data: mcpServers,
17766
+ columns,
17767
+ getCoreRowModel: reactTable.getCoreRowModel()
17768
+ });
17769
+ const ths = table.getHeaderGroups()[0];
17770
+ const rows = table.getRowModel().rows.concat();
17771
+ if (rows.length === 0 && !isLoading) {
17772
+ return /* @__PURE__ */ jsxRuntime.jsx(EmptyMCPTable, {});
17773
+ }
17774
+ const filteredRows = rows.filter((row) => row.original.name.toLowerCase().includes(search.toLowerCase()));
17775
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17776
+ /* @__PURE__ */ jsxRuntime.jsx(SearchbarWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(Searchbar, { onSearch: setSearch, label: "Search MCP servers", placeholder: "Search MCP servers" }) }),
17777
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(MCPTableSkeleton, {}) : /* @__PURE__ */ jsxRuntime.jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
17778
+ /* @__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)) }),
17779
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: filteredRows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(Row, { onClick: () => navigate(paths.mcpServerLink(row.original.id)), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
17780
+ ] }) }) })
17781
+ ] });
17782
+ }
17783
+ const MCPTableSkeleton = () => /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { children: [
17784
+ /* @__PURE__ */ jsxRuntime.jsxs(Thead, { children: [
17785
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Name" }),
17786
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Model" }),
17787
+ /* @__PURE__ */ jsxRuntime.jsx(Th, { children: "Attached entities" })
17788
+ ] }),
17789
+ /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsxs(Row, { children: [
17790
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
17791
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) }),
17792
+ /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-1/2" }) })
17793
+ ] }, index)) })
17794
+ ] });
17795
+ const EmptyMCPTable = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
17796
+ EmptyState,
17797
+ {
17798
+ iconSlot: /* @__PURE__ */ jsxRuntime.jsx(McpCoinIcon, {}),
17799
+ titleSlot: "Configure MCP servers",
17800
+ descriptionSlot: "MCP servers are not configured yet. You can find more information in the documentation.",
17801
+ actionSlot: /* @__PURE__ */ jsxRuntime.jsxs(
17802
+ Button$1,
17803
+ {
17804
+ size: "lg",
17805
+ className: "w-full",
17806
+ variant: "light",
17807
+ as: "a",
17808
+ href: "https://mastra.ai/en/docs/getting-started/mcp-docs-server",
17809
+ target: "_blank",
17810
+ children: [
17811
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(McpServerIcon, {}) }),
17812
+ "Docs"
17813
+ ]
17814
+ }
17815
+ )
17816
+ }
17817
+ ) });
17818
+
17819
+ const WorkflowRunList = ({ workflowId, runId }) => {
17820
+ const { Link, paths } = useLinkComponent();
17821
+ const { isLoading, data: runs } = useWorkflowRuns(workflowId);
17822
+ const actualRuns = runs?.runs || [];
17823
+ if (isLoading) {
17824
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-[600px]" }) });
17825
+ }
17826
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsx(Threads, { children: /* @__PURE__ */ jsxRuntime.jsxs(ThreadList, { children: [
17827
+ /* @__PURE__ */ jsxRuntime.jsx(ThreadItem, { children: /* @__PURE__ */ jsxRuntime.jsx(ThreadLink, { as: Link, to: paths.workflowLink(workflowId), children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-accent1 flex items-center gap-4", children: [
17828
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "bg-surface4 rounded-lg", size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
17829
+ "New workflow run"
17830
+ ] }) }) }),
17831
+ actualRuns.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-md", className: "text-icon3 py-3 px-5", children: "Your run history will appear here once you run the workflow" }),
17832
+ actualRuns.map((run) => /* @__PURE__ */ jsxRuntime.jsx(ThreadItem, { isActive: run.runId === runId, className: "h-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(ThreadLink, { as: Link, to: paths.workflowRunLink(workflowId, run.runId), children: [
17833
+ typeof run?.snapshot === "object" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowRunStatusBadge, { status: run.snapshot.status }) }),
17834
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate max-w-[14rem] text-muted-foreground", children: run.runId }),
17835
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: typeof run?.snapshot === "string" ? "" : run?.snapshot?.timestamp ? dateFns.formatDate(run?.snapshot?.timestamp, "MMM d, yyyy h:mm a") : "" })
17836
+ ] }) }, run.runId))
17837
+ ] }) }) });
17838
+ };
17839
+ const WorkflowRunStatusBadge = ({ status }) => {
17840
+ if (status === "running") {
17841
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}), children: status });
17842
+ }
17843
+ if (status === "failed") {
17844
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "text-accent2" }), children: status });
17845
+ }
17846
+ if (status === "canceled") {
17847
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleSlash, { className: "text-icon3" }), children: status });
17848
+ }
17849
+ if (status === "pending" || status === "waiting") {
17850
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "text-icon3" }), children: status });
17851
+ }
17852
+ if (status === "suspended") {
17853
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CirclePause, { className: "text-accent3" }), children: status });
17854
+ }
17855
+ if (status === "success") {
17856
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "text-accent1" }), children: status });
17857
+ }
17858
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", children: status });
17859
+ };
17860
+
17789
17861
  exports.AgentChat = AgentChat;
17790
17862
  exports.AgentCoinIcon = AgentCoinIcon;
17791
17863
  exports.AgentEntityHeader = AgentEntityHeader;
@@ -17807,7 +17879,6 @@ exports.AgentSettings = AgentSettings;
17807
17879
  exports.AgentSettingsContext = AgentSettingsContext;
17808
17880
  exports.AgentSettingsProvider = AgentSettingsProvider;
17809
17881
  exports.AgentsTable = AgentsTable;
17810
- exports.AgentsTableSkeleton = AgentsTableSkeleton;
17811
17882
  exports.AiIcon = AiIcon;
17812
17883
  exports.Alert = Alert;
17813
17884
  exports.AlertDescription = AlertDescription;
@@ -17839,10 +17910,7 @@ exports.DeploymentIcon = DeploymentIcon;
17839
17910
  exports.DividerIcon = DividerIcon;
17840
17911
  exports.DocsIcon = DocsIcon;
17841
17912
  exports.DynamicForm = DynamicForm;
17842
- exports.EmptyAgentsTable = EmptyAgentsTable;
17843
- exports.EmptyScorersTable = EmptyScorersTable;
17844
17913
  exports.EmptyState = EmptyState;
17845
- exports.EmptyWorkflowsTable = EmptyWorkflowsTable;
17846
17914
  exports.Entity = Entity;
17847
17915
  exports.EntityContent = EntityContent;
17848
17916
  exports.EntityDescription = EntityDescription;
@@ -17880,6 +17948,7 @@ exports.KeyValueList = KeyValueList;
17880
17948
  exports.LatencyIcon = LatencyIcon;
17881
17949
  exports.LinkComponentProvider = LinkComponentProvider;
17882
17950
  exports.LogsIcon = LogsIcon;
17951
+ exports.MCPTable = MCPTable;
17883
17952
  exports.MainContentContent = MainContentContent;
17884
17953
  exports.MainContentLayout = MainContentLayout;
17885
17954
  exports.MastraResizablePanel = MastraResizablePanel;
@@ -17903,10 +17972,10 @@ exports.RuntimeContextWrapper = RuntimeContextWrapper;
17903
17972
  exports.ScoreDialog = ScoreDialog;
17904
17973
  exports.ScoreIcon = ScoreIcon;
17905
17974
  exports.ScorersTable = ScorersTable;
17906
- exports.ScorersTableSkeleton = ScorersTableSkeleton;
17907
17975
  exports.ScoresTools = ScoresTools;
17908
17976
  exports.SearchField = SearchField;
17909
17977
  exports.Searchbar = Searchbar;
17978
+ exports.SearchbarWrapper = SearchbarWrapper;
17910
17979
  exports.SelectField = SelectField;
17911
17980
  exports.SettingsIcon = SettingsIcon;
17912
17981
  exports.SideDialog = SideDialog;
@@ -17945,9 +18014,7 @@ exports.ThreadList = ThreadList;
17945
18014
  exports.Threads = Threads;
17946
18015
  exports.ToolCoinIcon = ToolCoinIcon;
17947
18016
  exports.ToolFallback = ToolFallback;
17948
- exports.ToolList = ToolList;
17949
- exports.ToolListEmpty = ToolListEmpty;
17950
- exports.ToolListSkeleton = ToolListSkeleton;
18017
+ exports.ToolTable = ToolTable;
17951
18018
  exports.ToolsIcon = ToolsIcon;
17952
18019
  exports.TraceDialog = TraceDialog;
17953
18020
  exports.TraceIcon = TraceIcon;
@@ -17966,16 +18033,16 @@ exports.WorkflowCoinIcon = WorkflowCoinIcon;
17966
18033
  exports.WorkflowGraph = WorkflowGraph;
17967
18034
  exports.WorkflowIcon = WorkflowIcon;
17968
18035
  exports.WorkflowRunContext = WorkflowRunContext;
18036
+ exports.WorkflowRunDetail = WorkflowRunDetail;
18037
+ exports.WorkflowRunList = WorkflowRunList;
17969
18038
  exports.WorkflowRunProvider = WorkflowRunProvider;
17970
- exports.WorkflowRuns = WorkflowRuns;
17971
18039
  exports.WorkflowTable = WorkflowTable;
17972
- exports.WorkflowTableSkeleton = WorkflowTableSkeleton;
17973
18040
  exports.WorkflowTrigger = WorkflowTrigger;
17974
18041
  exports.WorkingMemoryContext = WorkingMemoryContext;
17975
18042
  exports.WorkingMemoryProvider = WorkingMemoryProvider;
17976
18043
  exports.allowedAiSpanAttributes = allowedAiSpanAttributes;
17977
18044
  exports.cleanString = cleanString;
17978
- exports.convertWorkflowRunStateToWatchResult = convertWorkflowRunStateToWatchResult;
18045
+ exports.convertWorkflowRunStateToStreamResult = convertWorkflowRunStateToStreamResult;
17979
18046
  exports.formatDuration = formatDuration;
17980
18047
  exports.formatHierarchicalSpans = formatHierarchicalSpans;
17981
18048
  exports.formatOtelTimestamp = formatOtelTimestamp;
@@ -17983,7 +18050,6 @@ exports.formatOtelTimestamp2 = formatOtelTimestamp2;
17983
18050
  exports.getColumnTemplate = getColumnTemplate;
17984
18051
  exports.getShortId = getShortId;
17985
18052
  exports.getSpanTypeUi = getSpanTypeUi;
17986
- exports.mapWorkflowStreamChunkToWatchResult = mapWorkflowStreamChunkToWatchResult;
17987
18053
  exports.parseError = parseError;
17988
18054
  exports.providerMapToIcon = providerMapToIcon;
17989
18055
  exports.spanTypePrefixes = spanTypePrefixes;
@@ -17992,6 +18058,7 @@ exports.useAgentSettings = useAgentSettings;
17992
18058
  exports.useCurrentRun = useCurrentRun;
17993
18059
  exports.useInView = useInView;
17994
18060
  exports.useLinkComponent = useLinkComponent;
18061
+ exports.useMCPServerTools = useMCPServerTools;
17995
18062
  exports.useModelReset = useModelReset;
17996
18063
  exports.usePlaygroundStore = usePlaygroundStore;
17997
18064
  exports.usePolling = usePolling;