@mastra/playground-ui 20.0.0-alpha.8 → 20.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,112 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 20.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Redesigned the Agent Traces tab with improved layout and new filtering capabilities: ([#14644](https://github.com/mastra-ai/mastra/pull/14644))
8
+ - Added sortable columns for Timestamp and Duration
9
+ - Inline score display when a scorer is selected, with a threshold filter to surface low-scoring traces
10
+ - Status and date-range filters for narrowing traces
11
+ - Client-side search across trace inputs and outputs
12
+ - Bulk checkbox selection with "Add to dataset" action
13
+ - Improved text truncation to prevent horizontal scrolling
14
+
15
+ - Added comprehensive filtering and search to the observability traces view. Traces can now be filtered by entity type, status, tags, metadata key-value pairs, date range (with presets and custom ranges), and context fields (environment, service name, user ID, session ID, and more). Also added full-text search across trace names and metadata, thread grouping with a toggle, and a new traces list with collapsible thread groups. ([#14564](https://github.com/mastra-ai/mastra/pull/14564))
16
+
17
+ - Redesigned the Evaluation dashboard with new list views, review pipeline, and dataset-level review tab. ([#14649](https://github.com/mastra-ai/mastra/pull/14649))
18
+
19
+ **Evaluation dashboard**
20
+ - Replaced table-based list views with the new `EntityList` design system for Scorers, Datasets, and Experiments tabs.
21
+ - Moved charts to an Overview tab and list views to dedicated tabs (Scorers, Datasets, Experiments). Tabs are now driven by sidebar navigation instead of an in-page tab bar.
22
+ - Added per-tab filter toolbars with search, status filters, and tag filters.
23
+ - Added "Create Dataset" button to Datasets tab.
24
+ - Added "Needs Review" KPI card and "Review Pipeline" chart to the Overview tab.
25
+
26
+ **Dataset review tab**
27
+ - New "Review" tab on the dataset detail page for reviewing experiment results across all agents targeting that dataset.
28
+ - Extracted shared review components (`ReviewItemCard`, `TagPicker`, `BulkTagPicker`, `ProposalTag`) into a reusable `review` domain.
29
+ - LLM-powered failure clustering and tag proposal integrated into dataset-level review.
30
+ - Tag-based filtering, bulk operations, ratings, and comments.
31
+
32
+ **Other improvements**
33
+ - Dataset tags displayed in a dedicated column with truncation and hover tooltip.
34
+ - Experiment result panel now shows review status badge and tags.
35
+ - Scores-over-time chart uses adaptive time bucketing (minute/hour/day) and shows date labels for multi-day ranges.
36
+ - Bar chart labels repositioned above bars for better contrast.
37
+ - Breadcrumbs across dataset and experiment pages updated to use `/evaluation/` prefix.
38
+
39
+ **Sidebar design system**
40
+ - `MainSidebarNavHeader` now supports an optional `href` prop for clickable section headers, and an `isActive` prop for header highlighting.
41
+ - `MainSidebarNavLink` now supports an optional `indent` prop for sub-link indentation.
42
+
43
+ - Finished light mode support for Mastra Studio. Theme selector is now always visible in settings — no environment variable needed. CodeMirror editors (instructions, trace view, code diff) render with proper syntax highlighting and cursor visibility in both light and dark modes. Dropdown menus now have correct hover/focus states in light mode. ([#14796](https://github.com/mastra-ai/mastra/pull/14796))
44
+
45
+ ### Patch Changes
46
+
47
+ - dependencies updates: ([#14584](https://github.com/mastra-ai/mastra/pull/14584))
48
+ - Updated dependency [`@assistant-ui/react@^0.12.19` ↗︎](https://www.npmjs.com/package/@assistant-ui/react/v/0.12.19) (from `^0.12.17`, in `dependencies`)
49
+ - Updated dependency [`@assistant-ui/react-markdown@^0.12.6` ↗︎](https://www.npmjs.com/package/@assistant-ui/react-markdown/v/0.12.6) (from `^0.12.5`, in `dependencies`)
50
+ - Updated dependency [`@assistant-ui/react-syntax-highlighter@^0.12.7` ↗︎](https://www.npmjs.com/package/@assistant-ui/react-syntax-highlighter/v/0.12.7) (from `^0.12.6`, in `dependencies`)
51
+
52
+ - dependencies updates: ([#14826](https://github.com/mastra-ai/mastra/pull/14826))
53
+ - Updated dependency [`@assistant-ui/react@^0.12.21` ↗︎](https://www.npmjs.com/package/@assistant-ui/react/v/0.12.21) (from `^0.12.19`, in `dependencies`)
54
+ - Updated dependency [`@assistant-ui/react-markdown@^0.12.7` ↗︎](https://www.npmjs.com/package/@assistant-ui/react-markdown/v/0.12.7) (from `^0.12.6`, in `dependencies`)
55
+
56
+ - dependencies updates: ([#14827](https://github.com/mastra-ai/mastra/pull/14827))
57
+ - Updated dependency [`@uiw/codemirror-theme-dracula@^4.25.9` ↗︎](https://www.npmjs.com/package/@uiw/codemirror-theme-dracula/v/4.25.9) (from `^4.25.8`, in `dependencies`)
58
+ - Updated dependency [`@uiw/codemirror-theme-github@^4.25.9` ↗︎](https://www.npmjs.com/package/@uiw/codemirror-theme-github/v/4.25.9) (from `^4.25.8`, in `dependencies`)
59
+ - Updated dependency [`@uiw/react-codemirror@^4.25.9` ↗︎](https://www.npmjs.com/package/@uiw/react-codemirror/v/4.25.9) (from `^4.25.8`, in `dependencies`)
60
+
61
+ - Added a Scorers section to the dataset detail view for attaching and detaching scorers. Fixed a crash on page refresh in the evaluate tab caused by `ReviewQueueProvider` not being mounted during loading states. ([#14783](https://github.com/mastra-ai/mastra/pull/14783))
62
+
63
+ - Added `as` prop to `MetricsCardTitle` and `titleAs` prop to `MetricsCardTitleAndDescription` to customize the heading level (h2, h3, h4). Defaults to h2. ([#14718](https://github.com/mastra-ai/mastra/pull/14718))
64
+
65
+ - Changed the Editor tab URL from /agents/:agentId/playground to /agents/:agentId/editor in Mastra Studio ([#14795](https://github.com/mastra-ai/mastra/pull/14795))
66
+
67
+ - Added DuckDB to supported observability storage types for metrics dashboard. Unhid ModelCostKpiCard. Updated empty state description to reflect DuckDB and ClickHouse support status. ([#14670](https://github.com/mastra-ai/mastra/pull/14670))
68
+
69
+ - Improved the default playground tabs so labels size to their content with tighter horizontal padding. ([#14857](https://github.com/mastra-ai/mastra/pull/14857))
70
+
71
+ - updated `playground-ui` to send both new and legacy `feedbackSource` fields ([#14856](https://github.com/mastra-ai/mastra/pull/14856))
72
+
73
+ - Added cost metrics to the Metrics dashboard. ([#14716](https://github.com/mastra-ai/mastra/pull/14716))
74
+ - Added a **Total Model Cost** KPI card.
75
+ - Added a **Cost** column in the **Model Usage** table.
76
+ - Added a **Cost** view in **Token Usage by Agent**.
77
+ - Improved `ScrollArea` to support horizontal and vertical scrolling together.
78
+
79
+ **Example**
80
+
81
+ ```tsx
82
+ <ScrollArea orientation="both" maxHeight="20rem">
83
+ <MetricsDataTable ... />
84
+ </ScrollArea>
85
+ ```
86
+
87
+ - Fix restored subagent tool results so approval cards and nested tool state appear correctly in the dev server. ([#14348](https://github.com/mastra-ai/mastra/pull/14348))
88
+
89
+ - Correct link to metrics ([#14854](https://github.com/mastra-ai/mastra/pull/14854))
90
+
91
+ - Added 'Create Agent' and 'Edit Agent' buttons to the playground, gated behind the MASTRA_EXPERIMENTAL_UI environment variable. When enabled, a 'Create Agent' button appears on the agents list page and an 'Edit' button appears on the agent detail header for stored agents. ([#14694](https://github.com/mastra-ai/mastra/pull/14694))
92
+
93
+ - Updated dependencies [[`dc514a8`](https://github.com/mastra-ai/mastra/commit/dc514a83dba5f719172dddfd2c7b858e4943d067), [`e333b77`](https://github.com/mastra-ai/mastra/commit/e333b77e2d76ba57ccec1818e08cebc1993469ff), [`dc9fc19`](https://github.com/mastra-ai/mastra/commit/dc9fc19da4437f6b508cc355f346a8856746a76b), [`60a224d`](https://github.com/mastra-ai/mastra/commit/60a224dd497240e83698cfa5bfd02e3d1d854844), [`fbf22a7`](https://github.com/mastra-ai/mastra/commit/fbf22a7ad86bcb50dcf30459f0d075e51ddeb468), [`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`f16d92c`](https://github.com/mastra-ai/mastra/commit/f16d92c677a119a135cebcf7e2b9f51ada7a9df4), [`949b7bf`](https://github.com/mastra-ai/mastra/commit/949b7bfd4e40f2b2cba7fef5eb3f108a02cfe938), [`404fea1`](https://github.com/mastra-ai/mastra/commit/404fea13042181f0b0c73a101392ac87c79ceae2), [`ebf5047`](https://github.com/mastra-ai/mastra/commit/ebf5047e825c38a1a356f10b214c1d4260dfcd8d), [`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`eef4a26`](https://github.com/mastra-ai/mastra/commit/eef4a2657cb14343e302e3f310ada86a2013f6cf), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a), [`fbf22a7`](https://github.com/mastra-ai/mastra/commit/fbf22a7ad86bcb50dcf30459f0d075e51ddeb468), [`d084b66`](https://github.com/mastra-ai/mastra/commit/d084b6692396057e83c086b954c1857d20b58a14), [`79c699a`](https://github.com/mastra-ai/mastra/commit/79c699acf3cd8a77e11c55530431f48eb48456e9), [`62757b6`](https://github.com/mastra-ai/mastra/commit/62757b6db6e8bb86569d23ad0b514178f57053f8), [`675f15b`](https://github.com/mastra-ai/mastra/commit/675f15b7eaeea649158d228ea635be40480c584d), [`b174c63`](https://github.com/mastra-ai/mastra/commit/b174c63a093108d4e53b9bc89a078d9f66202b3f), [`7e86302`](https://github.com/mastra-ai/mastra/commit/7e86302a77f16adbb771af43f72472872d13593e), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a), [`8812997`](https://github.com/mastra-ai/mastra/commit/8812997791f546ae6c64921bac6f65d3f4b5832e), [`04160ee`](https://github.com/mastra-ai/mastra/commit/04160eedf3130003cf842ad08428c8ff69af4cc1), [`2c27503`](https://github.com/mastra-ai/mastra/commit/2c275032510d131d2cde47f99953abf0fe02c081), [`424a1df`](https://github.com/mastra-ai/mastra/commit/424a1df7bee59abb5c83717a54807fdd674a6224), [`3d70b0b`](https://github.com/mastra-ai/mastra/commit/3d70b0b3524d817173ad870768f259c06d61bd23), [`bbfd3c0`](https://github.com/mastra-ai/mastra/commit/bbfd3c0302ac10be63e5fca93b5068690f472dea), [`eef7cb2`](https://github.com/mastra-ai/mastra/commit/eef7cb2abe7ef15951e2fdf792a5095c6c643333), [`260fe12`](https://github.com/mastra-ai/mastra/commit/260fe1295fe7354e39d6def2775e0797a7a277f0), [`260fe12`](https://github.com/mastra-ai/mastra/commit/260fe1295fe7354e39d6def2775e0797a7a277f0), [`197daf0`](https://github.com/mastra-ai/mastra/commit/197daf03a33e4650bd90391eef0ec7d0392a6c9c), [`12c88a6`](https://github.com/mastra-ai/mastra/commit/12c88a6e32bf982c2fe0c6af62e65a3414519a75), [`43595bf`](https://github.com/mastra-ai/mastra/commit/43595bf7b8df1a6edce7a23b445b5124d2a0b473), [`78670e9`](https://github.com/mastra-ai/mastra/commit/78670e97e76d7422cf7025faf371b2aeafed860d), [`e8a5b0b`](https://github.com/mastra-ai/mastra/commit/e8a5b0b9bc94d12dee4150095512ca27a288d778), [`3b45a13`](https://github.com/mastra-ai/mastra/commit/3b45a138d09d040779c0aba1edbbfc1b57442d23), [`d400e7c`](https://github.com/mastra-ai/mastra/commit/d400e7c8b8d7afa6ba2c71769eace4048e3cef8e), [`f58d1a7`](https://github.com/mastra-ai/mastra/commit/f58d1a7a457588a996c3ecb53201a68f3d28c432), [`a49a929`](https://github.com/mastra-ai/mastra/commit/a49a92904968b4fc67e01effee8c7c8d0464ba85), [`8127d96`](https://github.com/mastra-ai/mastra/commit/8127d96280492e335d49b244501088dfdd59a8f1)]:
94
+ - @mastra/core@1.18.0
95
+ - @mastra/client-js@1.11.0
96
+ - @mastra/react@0.2.18
97
+ - @mastra/ai-sdk@1.3.0
98
+
99
+ ## 20.0.0-alpha.9
100
+
101
+ ### Patch Changes
102
+
103
+ - Improved the default playground tabs so labels size to their content with tighter horizontal padding. ([#14857](https://github.com/mastra-ai/mastra/pull/14857))
104
+
105
+ - Updated dependencies [[`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`12c647c`](https://github.com/mastra-ai/mastra/commit/12c647cf3a26826eb72d40b42e3c8356ceae16ed), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a), [`819f03c`](https://github.com/mastra-ai/mastra/commit/819f03c25823373b32476413bd76be28a5d8705a)]:
106
+ - @mastra/client-js@1.11.0-alpha.8
107
+ - @mastra/react@0.2.18-alpha.8
108
+ - @mastra/core@1.18.0-alpha.5
109
+
3
110
  ## 20.0.0-alpha.8
4
111
 
5
112
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -13216,16 +13216,16 @@ const Tabs = ({ children, defaultTab, value, onValueChange, className }) => {
13216
13216
  return /* @__PURE__ */ jsxRuntime.jsx(RadixTabs__namespace.Root, { value: currentTab, onValueChange: handleTabChange, className: cn("overflow-y-auto", className), children });
13217
13217
  };
13218
13218
 
13219
- const TabList = ({ children, variant = "default", alignment = "full-width", className }) => {
13219
+ const TabList = ({ children, variant = "default", alignment = "left", className }) => {
13220
13220
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsxRuntime.jsx(
13221
13221
  RadixTabs__namespace.List,
13222
13222
  {
13223
13223
  className: cn(
13224
- "flex items-center relative",
13224
+ "flex items-center relative w-max min-w-full",
13225
13225
  {
13226
13226
  // variant: default
13227
- "text-ui-lg": variant === "default",
13228
- "[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:border-b [&>button]:border-border1": variant === "default",
13227
+ "text-ui-lg border-b border-border1": variant === "default",
13228
+ "[&>button]:py-2 [&>button]:px-6 [&>button]:font-normal [&>button]:text-neutral3 [&>button]:border-b-2 [&>button]:border-transparent": variant === "default",
13229
13229
  "[&>button]:flex-1": variant === "default" && alignment === "full-width",
13230
13230
  [`[&>button]:${transitions.colors} [&>button]:hover:text-neutral4`]: variant === "default",
13231
13231
  "[&>button[data-state=active]]:text-neutral5 [&>button[data-state=active]]:border-black/50 [&>button[data-state=active]]:dark:border-white/50": variant === "default",
@@ -13248,7 +13248,7 @@ const Tab = ({ children, value, onClick, onClose, className }) => {
13248
13248
  {
13249
13249
  value,
13250
13250
  className: cn(
13251
- "text-sm p-3 text-neutral3 whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5",
13251
+ "text-sm py-3 px-2 text-neutral3 whitespace-nowrap shrink-0 flex items-center justify-center gap-1.5 outline-none",
13252
13252
  transitions.all,
13253
13253
  focusRing.visible,
13254
13254
  "hover:text-neutral4",
@@ -17071,7 +17071,8 @@ function MastraRuntimeProvider({
17071
17071
  refreshThreadList,
17072
17072
  settings,
17073
17073
  requestContext,
17074
- modelVersion
17074
+ modelVersion,
17075
+ agentVersionId
17075
17076
  }) {
17076
17077
  const { settings: tracingSettings } = useTracingSettings();
17077
17078
  const [isLegacyRunning, setIsLegacyRunning] = React.useState(false);
@@ -17079,6 +17080,12 @@ function MastraRuntimeProvider({
17079
17080
  React.useEffect(() => {
17080
17081
  setLegacyMessages(initializeMessageState(initialLegacyMessages || []));
17081
17082
  }, [initialLegacyMessages]);
17083
+ const chatRequestContext = React.useMemo(() => {
17084
+ if (!agentVersionId) return void 0;
17085
+ const ctx = new di.RequestContext();
17086
+ ctx.set("agentVersionId", agentVersionId);
17087
+ return ctx;
17088
+ }, [agentVersionId]);
17082
17089
  const {
17083
17090
  messages,
17084
17091
  sendMessage,
@@ -17095,7 +17102,8 @@ function MastraRuntimeProvider({
17095
17102
  networkToolCallApprovals
17096
17103
  } = react.useChat({
17097
17104
  agentId,
17098
- initialMessages
17105
+ initialMessages,
17106
+ requestContext: chatRequestContext
17099
17107
  });
17100
17108
  const { refetch: refreshWorkingMemory } = useWorkingMemory();
17101
17109
  const abortControllerRef = React.useRef(null);
@@ -17305,6 +17313,9 @@ function MastraRuntimeProvider({
17305
17313
  Object.entries(requestContext ?? {}).forEach(([key, value]) => {
17306
17314
  requestContextInstance.set(key, value);
17307
17315
  });
17316
+ if (agentVersionId) {
17317
+ requestContextInstance.set("agentVersionId", agentVersionId);
17318
+ }
17308
17319
  try {
17309
17320
  if (isSupportedModel) {
17310
17321
  if (chatWithNetwork) {
@@ -17772,6 +17783,7 @@ const AgentChat = ({
17772
17783
  memory,
17773
17784
  refreshThreadList,
17774
17785
  modelVersion,
17786
+ agentVersionId,
17775
17787
  modelList,
17776
17788
  messageId,
17777
17789
  isNewThread,
@@ -17809,6 +17821,7 @@ const AgentChat = ({
17809
17821
  agentId,
17810
17822
  agentName,
17811
17823
  modelVersion,
17824
+ agentVersionId,
17812
17825
  threadId,
17813
17826
  initialMessages: v5Messages,
17814
17827
  initialLegacyMessages: v4Messages,
@@ -32714,7 +32727,13 @@ function AgentPlaygroundConfig({ agentId, selectedVersionId, latestVersionId })
32714
32727
  ] });
32715
32728
  }
32716
32729
 
32717
- function AgentPlaygroundTestChat({ agentId, agentName, modelVersion, hasMemory }) {
32730
+ function AgentPlaygroundTestChat({
32731
+ agentId,
32732
+ agentName,
32733
+ modelVersion,
32734
+ agentVersionId,
32735
+ hasMemory
32736
+ }) {
32718
32737
  const testThreadId = React.useMemo(() => uuid.v4(), [agentId]);
32719
32738
  const mergedRequestContext = useMergedRequestContext();
32720
32739
  const hasRequestContext = Object.keys(mergedRequestContext).length > 0;
@@ -32731,6 +32750,7 @@ function AgentPlaygroundTestChat({ agentId, agentName, modelVersion, hasMemory }
32731
32750
  agentId,
32732
32751
  agentName,
32733
32752
  modelVersion,
32753
+ agentVersionId,
32734
32754
  threadId: testThreadId,
32735
32755
  memory: hasMemory,
32736
32756
  refreshThreadList: async () => {
@@ -32965,6 +32985,7 @@ function AgentPlaygroundView({
32965
32985
  agentId,
32966
32986
  agentName,
32967
32987
  modelVersion,
32988
+ agentVersionId,
32968
32989
  hasMemory,
32969
32990
  activeVersionId,
32970
32991
  selectedVersionId,
@@ -33007,6 +33028,7 @@ function AgentPlaygroundView({
33007
33028
  agentId,
33008
33029
  agentName,
33009
33030
  modelVersion,
33031
+ agentVersionId,
33010
33032
  hasMemory
33011
33033
  }
33012
33034
  ) }) }) })