@mastra/playground-ui 22.0.0-alpha.4 → 22.0.1-alpha.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,72 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 22.0.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Expired sessions now refresh automatically. Requests that previously returned 401 are retried after refreshing, so users stay signed in instead of being logged out. ([#15024](https://github.com/mastra-ai/mastra/pull/15024))
8
+
9
+ - Updated dependencies [[`ed425d7`](https://github.com/mastra-ai/mastra/commit/ed425d78e7c66cbda8209fee910856f98c6c6b82), [`ba6f7e9`](https://github.com/mastra-ai/mastra/commit/ba6f7e9086d8281393f2acae60fda61de3bff1f9), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a)]:
10
+ - @mastra/core@1.23.0-alpha.0
11
+ - @mastra/client-js@1.13.1-alpha.0
12
+ - @mastra/ai-sdk@1.3.1
13
+ - @mastra/react@0.2.23-alpha.0
14
+
15
+ ## 22.0.0
16
+
17
+ ### Minor Changes
18
+
19
+ - Add browser view UI components for agent threads ([#14938](https://github.com/mastra-ai/mastra/pull/14938))
20
+ - Browser thumbnail with expandable preview in chat
21
+ - Full-screen modal and sidebar browser views
22
+ - Real-time screencast display with mouse/keyboard interaction
23
+ - Browser tool call history visualization
24
+ - URL bar and tab information display
25
+
26
+ - Added trajectory support to the playground UI. Expected trajectory is now visible and editable across all dataset views — item list, item detail panels, item dialogs, and standalone item pages. Trajectory scorers are visually distinguished in scorer lists and experiment results. Saving a trace as a dataset item auto-extracts the trajectory. ([#14902](https://github.com/mastra-ai/mastra/pull/14902))
27
+
28
+ ### Patch Changes
29
+
30
+ - Consolidated Tab button styles into the Tab component, removing duplicated child selectors from TabList. Removed unused alignment prop. Active underline now uses the neutral4 design token. ([#15004](https://github.com/mastra-ai/mastra/pull/15004))
31
+
32
+ - Matched tooltip panel background to dropdown and default button surface in Studio. ([#15009](https://github.com/mastra-ai/mastra/pull/15009))
33
+
34
+ - Fixed Scores Over Time chart to always show a 24-hour view by collapsing multi-day ranges into hourly averages across all days in the selected period ([#14981](https://github.com/mastra-ai/mastra/pull/14981))
35
+
36
+ - Added browser tools to the Agent details UI in Playground. Agents configured with browser support now show a "Browser Tools" section in metadata. ([#14998](https://github.com/mastra-ai/mastra/pull/14998))
37
+
38
+ - Added gateway memory indicator in Studio agent memory panel. When an agent uses gateway-backed memory, the panel hides local-only sections (search, working memory, config) and shows a "Memory Gateway" badge instead. ([#14952](https://github.com/mastra-ai/mastra/pull/14952))
39
+
40
+ - Aligned dropdown menu panel background with default button styling in Studio. ([#15009](https://github.com/mastra-ai/mastra/pull/15009))
41
+
42
+ - Updated scores metrics to use aggregate and time series APIs instead of fetching raw scores. Scores Over Time chart now always shows hourly data points regardless of the selected time range. Avg Score KPI uses weighted averages via the aggregate API. Updated metrics card layout to use flexible row heights and refined chart legend styling. ([#14937](https://github.com/mastra-ai/mastra/pull/14937))
43
+
44
+ - Fixed deep links for scorer, observability, and agent trace dialogs. ([#14970](https://github.com/mastra-ai/mastra/pull/14970))
45
+
46
+ Developers can now share and reload URLs that keep the selected trace, scoring tab, span, and score in Studio.
47
+
48
+ **Before**
49
+ `/observability`
50
+ `/agents/chef-agent/traces`
51
+ `/evaluation/scorers/response-quality`
52
+
53
+ **After**
54
+ `/observability?traceId=...&spanId=...&tab=scores&scoreId=...`
55
+ `/agents/chef-agent/traces?traceId=...&spanId=...&tab=scores&scoreId=...`
56
+ `/evaluation/scorers/response-quality?entity=...&scoreId=...`
57
+
58
+ This makes review links reliable across the scorer page, observability, and the agent traces view.
59
+
60
+ - Fixed light theme visibility for metrics charts: CartesianGrid lines now adapt to the current theme, and HorizontalBars use reduced opacity in light mode so labels remain readable. Updated MetricsCard minimum height. ([#14975](https://github.com/mastra-ai/mastra/pull/14975))
61
+
62
+ - Refactored chat error messages to use the Alert design system component instead of inline hardcoded styles, fixing text overflow on long error messages ([#15012](https://github.com/mastra-ai/mastra/pull/15012))
63
+
64
+ - Updated dependencies [[`cb15509`](https://github.com/mastra-ai/mastra/commit/cb15509b58f6a83e11b765c945082afc027db972), [`81e4259`](https://github.com/mastra-ai/mastra/commit/81e425939b4ceeb4f586e9b6d89c3b1c1f2d2fe7), [`951b8a1`](https://github.com/mastra-ai/mastra/commit/951b8a1b5ef7e1474c59dc4f2b9fc1a8b1e508b6), [`80c5668`](https://github.com/mastra-ai/mastra/commit/80c5668e365470d3a96d3e953868fd7a643ff67c), [`3d478c1`](https://github.com/mastra-ai/mastra/commit/3d478c1e13f17b80f330ac49d7aa42ef929b93ff), [`2b4ea10`](https://github.com/mastra-ai/mastra/commit/2b4ea10b053e4ea1ab232d536933a4a3c4cba999), [`d87e6e6`](https://github.com/mastra-ai/mastra/commit/d87e6e61c42475a7b57768e71dfa12964326a632), [`c8c86aa`](https://github.com/mastra-ai/mastra/commit/c8c86aa1458017fbd1c0776fdc0c520d129df8a6), [`a0544f0`](https://github.com/mastra-ai/mastra/commit/a0544f0a1e6bd52ac12676228967c1938e43648d), [`6039f17`](https://github.com/mastra-ai/mastra/commit/6039f176f9c457304825ff1df8c83b8e457376c0), [`06b928d`](https://github.com/mastra-ai/mastra/commit/06b928dfc2f5630d023467476cc5919dfa858d0a), [`8791bb3`](https://github.com/mastra-ai/mastra/commit/8791bb358bef4daaa8a9413560c45b726edbdc66), [`6a8d984`](https://github.com/mastra-ai/mastra/commit/6a8d9841f2933456ee1598099f488d742b600054), [`c8c86aa`](https://github.com/mastra-ai/mastra/commit/c8c86aa1458017fbd1c0776fdc0c520d129df8a6)]:
65
+ - @mastra/core@1.22.0
66
+ - @mastra/client-js@1.13.0
67
+ - @mastra/ai-sdk@1.3.1
68
+ - @mastra/react@0.2.22
69
+
3
70
  ## 22.0.0-alpha.4
4
71
 
5
72
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -59106,12 +59106,59 @@ const useMastraPlatform = () => {
59106
59106
  return { isMastraPlatform, mastraPlatformEndpoint };
59107
59107
  };
59108
59108
 
59109
+ let refreshPromise = null;
59110
+ async function refreshSession(baseUrl, apiPrefix) {
59111
+ try {
59112
+ const res = await fetch(`${baseUrl}${apiPrefix}/auth/refresh`, {
59113
+ method: "POST",
59114
+ credentials: "include"
59115
+ });
59116
+ return res.ok;
59117
+ } catch {
59118
+ return false;
59119
+ }
59120
+ }
59121
+ async function fetchWithRefresh(baseUrl, input, init) {
59122
+ const request = new Request(input, init);
59123
+ const retry = request.clone();
59124
+ const res = await fetch(request);
59125
+ if (res.status !== 401) return res;
59126
+ if (new URL(request.url).pathname.endsWith("/auth/refresh")) return res;
59127
+ if (!refreshPromise) {
59128
+ refreshPromise = refreshSession(baseUrl, "/api").finally(() => {
59129
+ refreshPromise = null;
59130
+ });
59131
+ }
59132
+ const refreshed = await refreshPromise;
59133
+ if (!refreshed) return res;
59134
+ return fetch(retry);
59135
+ }
59136
+ function createFetchWithRefresh(baseUrl, apiPrefix = "/api") {
59137
+ let localRefreshPromise = null;
59138
+ return async (input, init) => {
59139
+ const request = new Request(input, init);
59140
+ const retry = request.clone();
59141
+ const res = await fetch(request);
59142
+ if (res.status !== 401) return res;
59143
+ if (request.url.includes("/auth/refresh")) return res;
59144
+ if (!localRefreshPromise) {
59145
+ localRefreshPromise = refreshSession(baseUrl, apiPrefix).finally(() => {
59146
+ localRefreshPromise = null;
59147
+ });
59148
+ }
59149
+ const refreshed = await localRefreshPromise;
59150
+ if (!refreshed) return res;
59151
+ return fetch(retry);
59152
+ };
59153
+ }
59154
+
59109
59155
  function useCurrentUser() {
59110
59156
  const client = react.useMastraClient();
59157
+ const baseUrl = client.options?.baseUrl || "";
59111
59158
  return reactQuery.useQuery({
59112
59159
  queryKey: ["auth", "me"],
59113
59160
  queryFn: async () => {
59114
- const response = await fetch(`${client.options?.baseUrl || ""}/api/auth/me`, {
59161
+ const response = await fetchWithRefresh(baseUrl, `${baseUrl}/api/auth/me`, {
59115
59162
  credentials: "include",
59116
59163
  headers: {
59117
59164
  "Content-Type": "application/json"
@@ -60222,6 +60269,7 @@ exports.convertWorkflowRunStateToStreamResult = convertWorkflowRunStateToStreamR
60222
60269
  exports.countLeafRules = countLeafRules;
60223
60270
  exports.createDefaultRule = createDefaultRule;
60224
60271
  exports.createDefaultRuleGroup = createDefaultRuleGroup;
60272
+ exports.createFetchWithRefresh = createFetchWithRefresh;
60225
60273
  exports.createField = createField;
60226
60274
  exports.createInstructionBlock = createInstructionBlock;
60227
60275
  exports.createRefInstructionBlock = createRefInstructionBlock;
@@ -60229,6 +60277,7 @@ exports.createVariableAutocomplete = createVariableAutocomplete;
60229
60277
  exports.exportItemsToCSV = exportItemsToCSV;
60230
60278
  exports.exportItemsToJSON = exportItemsToJSON;
60231
60279
  exports.extractPrompt = extractPrompt;
60280
+ exports.fetchWithRefresh = fetchWithRefresh;
60232
60281
  exports.fieldConfig = fieldConfig;
60233
60282
  exports.fieldsToJSONSchema = fieldsToJSONSchema;
60234
60283
  exports.findProviderById = findProviderById;