@mastra/playground-ui 14.0.0 → 15.0.0

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,43 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 15.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Update peer dependencies to match core package version bump (1.5.0) ([#13323](https://github.com/mastra-ai/mastra/pull/13323))
8
+
9
+ ### Patch Changes
10
+
11
+ - Target type and target ID fields in the experiment dialog are now searchable dropdowns. Scorers can be selected via a multi-select dropdown. All three dropdowns share a consistent searchable style and visual behavior. ([#13463](https://github.com/mastra-ai/mastra/pull/13463))
12
+
13
+ - Show completion result UI for supervisor pattern delegations. Previously, completion check results were only displayed when `metadata.mode === 'network'`. Now they display for any response that includes `completionResult` metadata, supporting the new supervisor pattern. ([#13323](https://github.com/mastra-ai/mastra/pull/13323))
14
+
15
+ - Updated dependencies [[`df170fd`](https://github.com/mastra-ai/mastra/commit/df170fd139b55f845bfd2de8488b16435bd3d0da), [`ae55343`](https://github.com/mastra-ai/mastra/commit/ae5534397fc006fd6eef3e4f80c235bcdc9289ef), [`c290cec`](https://github.com/mastra-ai/mastra/commit/c290cec5bf9107225de42942b56b487107aa9dce), [`f03e794`](https://github.com/mastra-ai/mastra/commit/f03e794630f812b56e95aad54f7b1993dc003add), [`aa4a5ae`](https://github.com/mastra-ai/mastra/commit/aa4a5aedb80d8d6837bab8cbb2e301215d1ba3e9), [`de3f584`](https://github.com/mastra-ai/mastra/commit/de3f58408752a8d80a295275c7f23fc306cf7f4f), [`d3fb010`](https://github.com/mastra-ai/mastra/commit/d3fb010c98f575f1c0614452667396e2653815f6), [`702ee1c`](https://github.com/mastra-ai/mastra/commit/702ee1c41be67cc532b4dbe89bcb62143508f6f0), [`f495051`](https://github.com/mastra-ai/mastra/commit/f495051eb6496a720f637fc85b6d69941c12554c), [`b8f636a`](https://github.com/mastra-ai/mastra/commit/b8f636a83c5260a9817eec97c202b7ca7d613524), [`e622f1d`](https://github.com/mastra-ai/mastra/commit/e622f1d3ab346a8e6aca6d1fe2eac99bd961e50b), [`8d14a59`](https://github.com/mastra-ai/mastra/commit/8d14a591d46fbbbe81baa33c9c267d596f790329), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`861f111`](https://github.com/mastra-ai/mastra/commit/861f11189211b20ddb70d8df81a6b901fc78d11e), [`00f43e8`](https://github.com/mastra-ai/mastra/commit/00f43e8e97a80c82b27d5bd30494f10a715a1df9), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`96a1702`](https://github.com/mastra-ai/mastra/commit/96a1702ce362c50dda20c8b4a228b4ad1a36a17a), [`cb9f921`](https://github.com/mastra-ai/mastra/commit/cb9f921320913975657abb1404855d8c510f7ac5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`72df4a8`](https://github.com/mastra-ai/mastra/commit/72df4a8f9bf1a20cfd3d9006a4fdb597ad56d10a)]:
16
+ - @mastra/core@1.8.0
17
+ - @mastra/ai-sdk@1.1.0
18
+ - @mastra/schema-compat@1.1.3
19
+ - @mastra/react@0.2.7
20
+ - @mastra/client-js@1.7.1
21
+
22
+ ## 15.0.0-alpha.0
23
+
24
+ ### Minor Changes
25
+
26
+ - Update peer dependencies to match core package version bump (1.5.0) ([#13323](https://github.com/mastra-ai/mastra/pull/13323))
27
+
28
+ ### Patch Changes
29
+
30
+ - Target type and target ID fields in the experiment dialog are now searchable dropdowns. Scorers can be selected via a multi-select dropdown. All three dropdowns share a consistent searchable style and visual behavior. ([#13463](https://github.com/mastra-ai/mastra/pull/13463))
31
+
32
+ - Show completion result UI for supervisor pattern delegations. Previously, completion check results were only displayed when `metadata.mode === 'network'`. Now they display for any response that includes `completionResult` metadata, supporting the new supervisor pattern. ([#13323](https://github.com/mastra-ai/mastra/pull/13323))
33
+
34
+ - Updated dependencies [[`df170fd`](https://github.com/mastra-ai/mastra/commit/df170fd139b55f845bfd2de8488b16435bd3d0da), [`ae55343`](https://github.com/mastra-ai/mastra/commit/ae5534397fc006fd6eef3e4f80c235bcdc9289ef), [`c290cec`](https://github.com/mastra-ai/mastra/commit/c290cec5bf9107225de42942b56b487107aa9dce), [`f03e794`](https://github.com/mastra-ai/mastra/commit/f03e794630f812b56e95aad54f7b1993dc003add), [`aa4a5ae`](https://github.com/mastra-ai/mastra/commit/aa4a5aedb80d8d6837bab8cbb2e301215d1ba3e9), [`de3f584`](https://github.com/mastra-ai/mastra/commit/de3f58408752a8d80a295275c7f23fc306cf7f4f), [`d3fb010`](https://github.com/mastra-ai/mastra/commit/d3fb010c98f575f1c0614452667396e2653815f6), [`702ee1c`](https://github.com/mastra-ai/mastra/commit/702ee1c41be67cc532b4dbe89bcb62143508f6f0), [`f495051`](https://github.com/mastra-ai/mastra/commit/f495051eb6496a720f637fc85b6d69941c12554c), [`b8f636a`](https://github.com/mastra-ai/mastra/commit/b8f636a83c5260a9817eec97c202b7ca7d613524), [`e622f1d`](https://github.com/mastra-ai/mastra/commit/e622f1d3ab346a8e6aca6d1fe2eac99bd961e50b), [`8d14a59`](https://github.com/mastra-ai/mastra/commit/8d14a591d46fbbbe81baa33c9c267d596f790329), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`861f111`](https://github.com/mastra-ai/mastra/commit/861f11189211b20ddb70d8df81a6b901fc78d11e), [`00f43e8`](https://github.com/mastra-ai/mastra/commit/00f43e8e97a80c82b27d5bd30494f10a715a1df9), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`96a1702`](https://github.com/mastra-ai/mastra/commit/96a1702ce362c50dda20c8b4a228b4ad1a36a17a), [`cb9f921`](https://github.com/mastra-ai/mastra/commit/cb9f921320913975657abb1404855d8c510f7ac5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`114e7c1`](https://github.com/mastra-ai/mastra/commit/114e7c146ac682925f0fb37376c1be70e5d6e6e5), [`1b6f651`](https://github.com/mastra-ai/mastra/commit/1b6f65127d4a0d6c38d0a1055cb84527db529d6b), [`72df4a8`](https://github.com/mastra-ai/mastra/commit/72df4a8f9bf1a20cfd3d9006a4fdb597ad56d10a)]:
35
+ - @mastra/core@1.8.0-alpha.0
36
+ - @mastra/ai-sdk@1.1.0-alpha.0
37
+ - @mastra/schema-compat@1.1.3-alpha.0
38
+ - @mastra/react@0.2.7-alpha.0
39
+ - @mastra/client-js@1.7.1-alpha.0
40
+
3
41
  ## 14.0.0
4
42
 
5
43
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -4720,7 +4720,8 @@ const ErrorAwareText = () => {
4720
4720
  /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { as: "p", children: text })
4721
4721
  ] });
4722
4722
  }
4723
- if (metadata?.mode === "network" && metadata?.completionResult) {
4723
+ const taskCompleteResult = metadata?.completionResult;
4724
+ if (taskCompleteResult) {
4724
4725
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 space-y-2", children: [
4725
4726
  /* @__PURE__ */ jsxRuntime.jsxs("button", { onClick: () => setCollapsedCompletionCheck((s) => !s), className: "flex items-center gap-2", children: [
4726
4727
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUpIcon, { className: cn("transition-all", collapsedCompletionCheck ? "rotate-90" : "rotate-180") }) }),
@@ -4730,7 +4731,7 @@ const ErrorAwareText = () => {
4730
4731
  ] })
4731
4732
  ] }),
4732
4733
  !collapsedCompletionCheck && /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "info", children: [
4733
- /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { as: "h5", children: metadata.completionResult?.passed ? "Complete" : "Not Complete" }),
4734
+ /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { as: "h5", children: taskCompleteResult?.passed ? "Complete" : "Not Complete" }),
4734
4735
  /* @__PURE__ */ jsxRuntime.jsx(MarkdownText, {})
4735
4736
  ] })
4736
4737
  ] });
@@ -13722,12 +13723,12 @@ const AssistantMessage = ({ hasModelList }) => {
13722
13723
  const data = react.useMessage();
13723
13724
  const messageId = data.id;
13724
13725
  const isNotAssistantTextResponse = data.content.every(
13725
- ({ type, metadata }) => type === "tool-call" || type === "reasoning" || type === "text" && metadata?.mode === "network" && metadata?.completionResult
13726
+ ({ type, metadata }) => type === "tool-call" || type === "reasoning" || type === "text" && (metadata?.completionResult || metadata?.isTaskCompleteResult)
13726
13727
  );
13727
13728
  const modelMetadata = data.metadata?.custom?.modelMetadata;
13728
13729
  const showModelUsed = hasModelList && modelMetadata;
13729
13730
  return /* @__PURE__ */ jsxRuntime.jsxs(react.MessagePrimitive.Root, { className: "max-w-full", "data-message-id": messageId, "data-message-index": data.index, children: [
13730
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral6 text-ui-lg leading-ui-lg", style: { paddingTop: "0.5rem" }, children: /* @__PURE__ */ jsxRuntime.jsx(
13731
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-neutral6 text-ui-lg leading-ui-lg pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
13731
13732
  react.MessagePrimitive.Parts,
13732
13733
  {
13733
13734
  components: {
@@ -18437,7 +18438,7 @@ const EmptyAgentsTable = ({ onCreateClick }) => /* @__PURE__ */ jsxRuntime.jsx("
18437
18438
  size: "lg",
18438
18439
  variant: "outline",
18439
18440
  as: "a",
18440
- href: "https://mastra.ai/docs/agents",
18441
+ href: "https://mastra.ai/docs/agents/overview",
18441
18442
  target: "_blank",
18442
18443
  rel: "noopener noreferrer",
18443
18444
  children: [
@@ -38657,7 +38658,7 @@ const targetTypeOptions = [
38657
38658
  { value: "workflow", label: "Workflow" },
38658
38659
  { value: "scorer", label: "Scorer" }
38659
38660
  ];
38660
- function TargetSelector({ targetType, setTargetType, targetId, setTargetId }) {
38661
+ function TargetSelector({ targetType, setTargetType, targetId, setTargetId, container }) {
38661
38662
  const { data: agents, isLoading: agentsLoading } = useAgents();
38662
38663
  const { data: workflows, isLoading: workflowsLoading } = useWorkflows();
38663
38664
  const { data: scorers, isLoading: scorersLoading } = useScorers();
@@ -38678,85 +38679,70 @@ function TargetSelector({ targetType, setTargetType, targetId, setTargetId }) {
38678
38679
  };
38679
38680
  const targetLabel = targetType === "agent" ? "Agent" : targetType === "workflow" ? "Workflow" : "Scorer";
38680
38681
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-6", children: [
38681
- /* @__PURE__ */ jsxRuntime.jsx(
38682
- SelectField$1,
38683
- {
38684
- label: "Target Type",
38685
- name: "target-type",
38686
- value: targetType,
38687
- onValueChange: handleTypeChange,
38688
- options: targetTypeOptions,
38689
- placeholder: "Select target type",
38690
- variant: "experimental",
38691
- size: "default"
38692
- }
38693
- ),
38694
- targetType && (isTargetsLoading ? /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-10 w-full" }) : /* @__PURE__ */ jsxRuntime.jsx(
38695
- SelectField$1,
38696
- {
38697
- label: targetLabel,
38698
- name: "target-id",
38699
- value: targetId,
38700
- onValueChange: setTargetId,
38701
- options: targetOptions,
38702
- placeholder: `Select ${targetType}`,
38703
- variant: "experimental",
38704
- size: "default"
38705
- }
38706
- ))
38682
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
38683
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "Target Type" }),
38684
+ /* @__PURE__ */ jsxRuntime.jsx(
38685
+ Combobox,
38686
+ {
38687
+ options: targetTypeOptions,
38688
+ value: targetType,
38689
+ onValueChange: handleTypeChange,
38690
+ placeholder: "Select target type",
38691
+ searchPlaceholder: "Search types...",
38692
+ emptyText: "No types available",
38693
+ container
38694
+ }
38695
+ )
38696
+ ] }),
38697
+ targetType && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
38698
+ /* @__PURE__ */ jsxRuntime.jsx(Label, { children: targetLabel }),
38699
+ /* @__PURE__ */ jsxRuntime.jsx(
38700
+ Combobox,
38701
+ {
38702
+ options: targetOptions,
38703
+ value: targetId,
38704
+ onValueChange: setTargetId,
38705
+ placeholder: `Select ${targetType}`,
38706
+ searchPlaceholder: "Search...",
38707
+ emptyText: "No targets available",
38708
+ disabled: isTargetsLoading,
38709
+ container
38710
+ }
38711
+ )
38712
+ ] })
38707
38713
  ] });
38708
38714
  }
38709
38715
 
38710
- function ScorerSelector({ selectedScorers, setSelectedScorers, disabled = false }) {
38716
+ function ScorerSelector({
38717
+ selectedScorers,
38718
+ setSelectedScorers,
38719
+ disabled = false,
38720
+ container
38721
+ }) {
38711
38722
  const { data: scorers, isLoading } = useScorers();
38712
- const scorersList = Object.entries(scorers ?? {}).map(([id, scorer]) => ({
38713
- id,
38714
- name: scorer.scorer?.config?.name ?? id,
38715
- description: scorer.scorer?.config?.description
38716
- }));
38717
- const handleScorerToggle = (scorerId) => {
38718
- if (selectedScorers.includes(scorerId)) {
38719
- setSelectedScorers(selectedScorers.filter((id) => id !== scorerId));
38720
- } else {
38721
- setSelectedScorers([...selectedScorers, scorerId]);
38722
- }
38723
- };
38724
- if (isLoading) {
38725
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
38726
- /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "Scorers (Optional)" }),
38727
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-6 w-full" }, index)) })
38728
- ] });
38729
- }
38730
- if (scorersList.length === 0) {
38731
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
38732
- /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "Scorers (Optional)" }),
38733
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-ui-sm text-neutral3", children: "No scorers configured. Scorers can be added to evaluate the run results." })
38734
- ] });
38735
- }
38723
+ const options = React.useMemo(() => {
38724
+ if (!scorers) return [];
38725
+ return Object.entries(scorers).map(([id, scorer]) => ({
38726
+ value: id,
38727
+ label: scorer.scorer?.config?.name || id,
38728
+ description: scorer.scorer?.config?.description || ""
38729
+ }));
38730
+ }, [scorers]);
38736
38731
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-2", children: [
38737
38732
  /* @__PURE__ */ jsxRuntime.jsx(Label, { children: "Scorers (Optional)" }),
38738
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-ui-sm text-neutral3 mb-2", children: "Select scorers to evaluate the run results." }),
38739
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 max-h-48 overflow-y-auto", children: scorersList.map((scorer) => /* @__PURE__ */ jsxRuntime.jsxs(
38740
- "label",
38733
+ /* @__PURE__ */ jsxRuntime.jsx(
38734
+ MultiCombobox,
38741
38735
  {
38742
- className: "flex items-start gap-3 cursor-pointer hover:bg-surface3 rounded-md p-2 -m-2 transition-colors",
38743
- children: [
38744
- /* @__PURE__ */ jsxRuntime.jsx(
38745
- Checkbox,
38746
- {
38747
- checked: selectedScorers.includes(scorer.id),
38748
- onCheckedChange: () => handleScorerToggle(scorer.id),
38749
- disabled
38750
- }
38751
- ),
38752
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-0.5", children: [
38753
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-sm text-neutral5", children: scorer.name }),
38754
- scorer.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-ui-xs text-neutral3", children: scorer.description })
38755
- ] })
38756
- ]
38757
- },
38758
- scorer.id
38759
- )) })
38736
+ options,
38737
+ value: selectedScorers,
38738
+ onValueChange: setSelectedScorers,
38739
+ placeholder: "Select scorers...",
38740
+ searchPlaceholder: "Search scorers...",
38741
+ emptyText: "No scorers available",
38742
+ disabled: disabled || isLoading,
38743
+ container
38744
+ }
38745
+ )
38760
38746
  ] });
38761
38747
  }
38762
38748
 
@@ -38767,6 +38753,7 @@ function ExperimentTriggerDialog({
38767
38753
  onOpenChange,
38768
38754
  onSuccess
38769
38755
  }) {
38756
+ const contentRef = React.useRef(null);
38770
38757
  const [targetType, setTargetType] = React.useState("");
38771
38758
  const [targetId, setTargetId] = React.useState("");
38772
38759
  const [selectedScorers, setSelectedScorers] = React.useState([]);
@@ -38802,7 +38789,7 @@ function ExperimentTriggerDialog({
38802
38789
  setSelectedScorers([]);
38803
38790
  }
38804
38791
  };
38805
- return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { children: [
38792
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { ref: contentRef, children: [
38806
38793
  /* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
38807
38794
  /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { children: "Run Experiment" }),
38808
38795
  /* @__PURE__ */ jsxRuntime.jsx(DialogDescription, { children: version ? `Execute items from ${dateFns.format(new Date(version), "MMM d, yyyy")} version against a target.` : "Execute all items in this dataset against a target." })
@@ -38814,7 +38801,8 @@ function ExperimentTriggerDialog({
38814
38801
  targetType,
38815
38802
  setTargetType,
38816
38803
  targetId,
38817
- setTargetId
38804
+ setTargetId,
38805
+ container: contentRef
38818
38806
  }
38819
38807
  ),
38820
38808
  targetType && targetType !== "scorer" && /* @__PURE__ */ jsxRuntime.jsx(
@@ -38822,7 +38810,8 @@ function ExperimentTriggerDialog({
38822
38810
  {
38823
38811
  selectedScorers,
38824
38812
  setSelectedScorers,
38825
- disabled: isRunning
38813
+ disabled: isRunning,
38814
+ container: contentRef
38826
38815
  }
38827
38816
  )
38828
38817
  ] }),