@mastra/playground-ui 20.0.0-alpha.8 → 20.0.0-alpha.9

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,16 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 20.0.0-alpha.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Improved the default playground tabs so labels size to their content with tighter horizontal padding. ([#14857](https://github.com/mastra-ai/mastra/pull/14857))
8
+
9
+ - 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)]:
10
+ - @mastra/client-js@1.11.0-alpha.8
11
+ - @mastra/react@0.2.18-alpha.8
12
+ - @mastra/core@1.18.0-alpha.5
13
+
3
14
  ## 20.0.0-alpha.8
4
15
 
5
16
  ### 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
  ) }) }) })