@mastra/playground-ui 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 6.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Add @mastra/react to peer deps ([#8857](https://github.com/mastra-ai/mastra/pull/8857))
8
+
9
+ - Updated dependencies [[`ca85c93`](https://github.com/mastra-ai/mastra/commit/ca85c932b232e6ad820c811ec176d98e68c59b0a), [`a1d40f8`](https://github.com/mastra-ai/mastra/commit/a1d40f88d4ce42c4508774ad22e38ac582157af2), [`01c4a25`](https://github.com/mastra-ai/mastra/commit/01c4a2506c514d5e861c004d3d2fb3791c6391f3), [`9ba695e`](https://github.com/mastra-ai/mastra/commit/9ba695e9ff977b8f13cc71df3b452775757361e5), [`cce8aad`](https://github.com/mastra-ai/mastra/commit/cce8aad878a0dd98e5647680f3765caba0b1701c)]:
10
+ - @mastra/core@0.21.1
11
+ - @mastra/react@0.0.7
12
+ - @mastra/client-js@0.16.1
13
+
14
+ ## 6.5.1-alpha.0
15
+
16
+ ### Patch Changes
17
+
18
+ - Add @mastra/react to peer deps ([#8857](https://github.com/mastra-ai/mastra/pull/8857))
19
+
20
+ - Updated dependencies [[`ca85c93`](https://github.com/mastra-ai/mastra/commit/ca85c932b232e6ad820c811ec176d98e68c59b0a), [`a1d40f8`](https://github.com/mastra-ai/mastra/commit/a1d40f88d4ce42c4508774ad22e38ac582157af2), [`01c4a25`](https://github.com/mastra-ai/mastra/commit/01c4a2506c514d5e861c004d3d2fb3791c6391f3), [`9ba695e`](https://github.com/mastra-ai/mastra/commit/9ba695e9ff977b8f13cc71df3b452775757361e5), [`cce8aad`](https://github.com/mastra-ai/mastra/commit/cce8aad878a0dd98e5647680f3765caba0b1701c)]:
21
+ - @mastra/core@0.21.1-alpha.0
22
+ - @mastra/react@0.0.7-alpha.0
23
+ - @mastra/client-js@0.16.1-alpha.0
24
+
3
25
  ## 6.5.0
4
26
 
5
27
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -5446,6 +5446,9 @@ function WorkflowConditionNode({ data }) {
5446
5446
  /* @__PURE__ */ jsxRuntime.jsxs(
5447
5447
  "div",
5448
5448
  {
5449
+ "data-workflow-node": true,
5450
+ "data-workflow-step-status": previousStep?.status,
5451
+ "data-testid": "workflow-condition-node",
5449
5452
  className: cn(
5450
5453
  "bg-surface3 rounded-lg w-[300px] border-sm border-border1",
5451
5454
  previousStep?.status === "success" && nextStep && "bg-accent1Darker",
@@ -5583,6 +5586,9 @@ function WorkflowDefaultNode({
5583
5586
  /* @__PURE__ */ jsxRuntime.jsxs(
5584
5587
  "div",
5585
5588
  {
5589
+ "data-workflow-node": true,
5590
+ "data-workflow-step-status": step?.status ?? "idle",
5591
+ "data-testid": "workflow-default-node",
5586
5592
  className: cn(
5587
5593
  "bg-surface3 rounded-lg w-[274px] border-sm border-border1 pt-2",
5588
5594
  step?.status === "success" && "bg-accent1Darker",
@@ -5688,14 +5694,23 @@ function WorkflowAfterNode({ data }) {
5688
5694
 
5689
5695
  function WorkflowLoopResultNode({ data }) {
5690
5696
  const { result } = data;
5691
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("bg-mastra-bg-8 rounded-md w-[274px]"), children: [
5692
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "target", position: react$1.Position.Top, style: { visibility: "hidden" } }),
5693
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm bg-mastra-bg-9 flex items-center gap-[6px] rounded-sm p-2", children: [
5694
- result ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: "text-current w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { className: "text-current w-4 h-4" }),
5695
- /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", weight: "medium", className: "text-mastra-el-6 capitalize", children: String(result) })
5696
- ] }) }),
5697
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "source", position: react$1.Position.Bottom, style: { visibility: "hidden" } })
5698
- ] });
5697
+ return /* @__PURE__ */ jsxRuntime.jsxs(
5698
+ "div",
5699
+ {
5700
+ "data-testid": "workflow-loop-result-node",
5701
+ "data-workflow-step-status": result ? "success" : "failed",
5702
+ className: cn("bg-mastra-bg-8 rounded-md w-[274px]"),
5703
+ "data-workflow-node": true,
5704
+ children: [
5705
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "target", position: react$1.Position.Top, style: { visibility: "hidden" } }),
5706
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm bg-mastra-bg-9 flex items-center gap-[6px] rounded-sm p-2", children: [
5707
+ result ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, { className: "text-current w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleX, { className: "text-current w-4 h-4" }),
5708
+ /* @__PURE__ */ jsxRuntime.jsx(Text, { size: "xs", weight: "medium", className: "text-mastra-el-6 capitalize", children: String(result) })
5709
+ ] }) }),
5710
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Handle, { type: "source", position: react$1.Position.Bottom, style: { visibility: "hidden" } })
5711
+ ]
5712
+ }
5713
+ );
5699
5714
  }
5700
5715
 
5701
5716
  function Spinner({ color = "#fff", className }) {
@@ -5919,6 +5934,9 @@ function WorkflowNestedNode({
5919
5934
  /* @__PURE__ */ jsxRuntime.jsxs(
5920
5935
  "div",
5921
5936
  {
5937
+ "data-testid": "workflow-nested-node",
5938
+ "data-workflow-node": true,
5939
+ "data-workflow-step-status": step?.status,
5922
5940
  className: cn(
5923
5941
  "bg-surface3 rounded-lg w-[274px] border-sm border-border1 pt-2",
5924
5942
  step?.status === "success" && "bg-accent1Darker",
@@ -7201,7 +7219,7 @@ function WorkflowTrigger({
7201
7219
  const stepSchema = stepDefinition?.resumeSchema ? resolveSerializedZodOutput(jsonSchemaToZod(superjson.parse(stepDefinition.resumeSchema))) : z.z.record(z.z.string(), z.z.any());
7202
7220
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col px-4", children: [
7203
7221
  /* @__PURE__ */ jsxRuntime.jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: step.stepId }),
7204
- step.suspendPayload && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
7222
+ step.suspendPayload && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "suspended-payload", children: /* @__PURE__ */ jsxRuntime.jsx(
7205
7223
  CodeBlockDemo,
7206
7224
  {
7207
7225
  className: "w-full overflow-x-auto p-2",
@@ -7214,7 +7232,7 @@ function WorkflowTrigger({
7214
7232
  {
7215
7233
  schema: stepSchema,
7216
7234
  isSubmitLoading: isStreamingWorkflow,
7217
- submitButtonLabel: "Resume",
7235
+ submitButtonLabel: "Resume workflow",
7218
7236
  onSubmit: (data) => {
7219
7237
  const stepIds = step.stepId?.split(".");
7220
7238
  handleResumeWorkflow({
@@ -17629,6 +17647,48 @@ const parseError = (error) => {
17629
17647
  }
17630
17648
  };
17631
17649
 
17650
+ const WorkflowRunList = ({ workflowId, runId }) => {
17651
+ const { Link, paths } = useLinkComponent();
17652
+ const { isLoading, data: runs } = useWorkflowRuns(workflowId);
17653
+ const actualRuns = runs?.runs || [];
17654
+ if (isLoading) {
17655
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-[600px]" }) });
17656
+ }
17657
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsx(Threads, { children: /* @__PURE__ */ jsxRuntime.jsxs(ThreadList, { children: [
17658
+ /* @__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: [
17659
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "bg-surface4 rounded-lg", size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
17660
+ "New workflow run"
17661
+ ] }) }) }),
17662
+ 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" }),
17663
+ 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: [
17664
+ typeof run?.snapshot === "object" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowRunStatusBadge, { status: run.snapshot.status }) }),
17665
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate max-w-[14rem] text-muted-foreground", children: run.runId }),
17666
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: typeof run?.snapshot === "string" ? "" : run?.snapshot?.timestamp ? dateFns.formatDate(run?.snapshot?.timestamp, "MMM d, yyyy h:mm a") : "" })
17667
+ ] }) }, run.runId))
17668
+ ] }) }) });
17669
+ };
17670
+ const WorkflowRunStatusBadge = ({ status }) => {
17671
+ if (status === "running") {
17672
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}), children: status });
17673
+ }
17674
+ if (status === "failed") {
17675
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "text-accent2" }), children: status });
17676
+ }
17677
+ if (status === "canceled") {
17678
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleSlash, { className: "text-icon3" }), children: status });
17679
+ }
17680
+ if (status === "pending" || status === "waiting") {
17681
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "text-icon3" }), children: status });
17682
+ }
17683
+ if (status === "suspended") {
17684
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CirclePause, { className: "text-accent3" }), children: status });
17685
+ }
17686
+ if (status === "success") {
17687
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "text-accent1" }), children: status });
17688
+ }
17689
+ return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", children: status });
17690
+ };
17691
+
17632
17692
  const useMCPServerTools = (selectedServer) => {
17633
17693
  const client = react$3.useMastraClient();
17634
17694
  return reactQuery.useQuery({
@@ -17757,48 +17817,6 @@ const EmptyMCPTable = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "
17757
17817
  }
17758
17818
  ) });
17759
17819
 
17760
- const WorkflowRunList = ({ workflowId, runId }) => {
17761
- const { Link, paths } = useLinkComponent();
17762
- const { isLoading, data: runs } = useWorkflowRuns(workflowId);
17763
- const actualRuns = runs?.runs || [];
17764
- if (isLoading) {
17765
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-[600px]" }) });
17766
- }
17767
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto h-full w-full", children: /* @__PURE__ */ jsxRuntime.jsx(Threads, { children: /* @__PURE__ */ jsxRuntime.jsxs(ThreadList, { children: [
17768
- /* @__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: [
17769
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "bg-surface4 rounded-lg", size: "lg", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) }),
17770
- "New workflow run"
17771
- ] }) }) }),
17772
- 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" }),
17773
- 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: [
17774
- typeof run?.snapshot === "object" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowRunStatusBadge, { status: run.snapshot.status }) }),
17775
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate max-w-[14rem] text-muted-foreground", children: run.runId }),
17776
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: typeof run?.snapshot === "string" ? "" : run?.snapshot?.timestamp ? dateFns.formatDate(run?.snapshot?.timestamp, "MMM d, yyyy h:mm a") : "" })
17777
- ] }) }, run.runId))
17778
- ] }) }) });
17779
- };
17780
- const WorkflowRunStatusBadge = ({ status }) => {
17781
- if (status === "running") {
17782
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}), children: status });
17783
- }
17784
- if (status === "failed") {
17785
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "text-accent2" }), children: status });
17786
- }
17787
- if (status === "canceled") {
17788
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleSlash, { className: "text-icon3" }), children: status });
17789
- }
17790
- if (status === "pending" || status === "waiting") {
17791
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "text-icon3" }), children: status });
17792
- }
17793
- if (status === "suspended") {
17794
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CirclePause, { className: "text-accent3" }), children: status });
17795
- }
17796
- if (status === "success") {
17797
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "text-accent1" }), children: status });
17798
- }
17799
- return /* @__PURE__ */ jsxRuntime.jsx(Badge$1, { variant: "default", children: status });
17800
- };
17801
-
17802
17820
  exports.AgentChat = AgentChat;
17803
17821
  exports.AgentCoinIcon = AgentCoinIcon;
17804
17822
  exports.AgentEntityHeader = AgentEntityHeader;