@mastra/playground-ui 16.1.2 → 16.2.0-alpha.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 +30 -0
- package/dist/index.cjs.js +47 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +48 -16
- package/dist/index.es.js.map +1 -1
- package/dist/src/domains/agents/components/agent-chat.d.ts +2 -1
- package/dist/src/lib/ai-ui/thread.d.ts +2 -1
- package/package.json +45 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @mastra/playground-ui
|
|
2
2
|
|
|
3
|
+
## 16.2.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added dedicated session page for agents at `/agents/<agentId>/session`. This minimal view shows only the chat interface without the sidebar or information pane, making it ideal for quick internal testing or sharing with non-technical team members. If request context presets are configured, a preset dropdown appears in the header. ([#13754](https://github.com/mastra-ai/mastra/pull/13754))
|
|
8
|
+
|
|
9
|
+
Added `hideModelSwitcher` prop to `AgentChat` and `Thread` components to allow hiding the model picker in the composer.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`b77aa19`](https://github.com/mastra-ai/mastra/commit/b77aa1981361c021f2c881bee8f0c703687f00da), [`dd6ca1c`](https://github.com/mastra-ai/mastra/commit/dd6ca1cdea3b8b6182f4cf61df41070ba0cc0deb), [`4cb4edf`](https://github.com/mastra-ai/mastra/commit/4cb4edf3c909d197ec356c1790d13270514ffef6)]:
|
|
14
|
+
- @mastra/core@1.13.3-alpha.1
|
|
15
|
+
- @mastra/client-js@1.8.5-alpha.1
|
|
16
|
+
- @mastra/react@0.2.15-alpha.1
|
|
17
|
+
|
|
18
|
+
## 16.1.3-alpha.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Fixed crash during template installation by ensuring error values from stream events are converted to strings before being passed to the UI. This prevents the 'e?.includes is not a function' TypeError when the server returns non-string error payloads. ([#14267](https://github.com/mastra-ai/mastra/pull/14267))
|
|
23
|
+
|
|
24
|
+
- Fixed crash when template installation errors are non-string values (e.g. objects). The error is now safely converted to a string before calling .includes(), preventing the 'e?.includes is not a function' TypeError in the studio. ([#14267](https://github.com/mastra-ai/mastra/pull/14267))
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`51970b3`](https://github.com/mastra-ai/mastra/commit/51970b3828494d59a8dd4df143b194d37d31e3f5), [`4a7ce05`](https://github.com/mastra-ai/mastra/commit/4a7ce05125b8d3d260f68f1fc4a6c6866d22ba24), [`7a167db`](https://github.com/mastra-ai/mastra/commit/7a167db025e63a616123dee5855ff572c91264c5), [`085e371`](https://github.com/mastra-ai/mastra/commit/085e3718a7d0fe9a210fe7dd1c867b9bdfe8d16b), [`ce26fe2`](https://github.com/mastra-ai/mastra/commit/ce26fe2166dd90254f8bee5776e55977143e97de), [`b26307f`](https://github.com/mastra-ai/mastra/commit/b26307f050df39629511b0e831b8fc26973ce8b1)]:
|
|
27
|
+
- @mastra/core@1.13.3-alpha.0
|
|
28
|
+
- @mastra/schema-compat@1.2.5-alpha.0
|
|
29
|
+
- @mastra/ai-sdk@1.1.4-alpha.0
|
|
30
|
+
- @mastra/client-js@1.8.5-alpha.0
|
|
31
|
+
- @mastra/react@0.2.15-alpha.0
|
|
32
|
+
|
|
3
33
|
## 16.1.2
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -15471,7 +15471,7 @@ function getStateColor(state) {
|
|
|
15471
15471
|
}
|
|
15472
15472
|
}
|
|
15473
15473
|
|
|
15474
|
-
const Thread = ({ agentName, agentId, hasMemory, hasModelList }) => {
|
|
15474
|
+
const Thread = ({ agentName, agentId, hasMemory, hasModelList, hideModelSwitcher }) => {
|
|
15475
15475
|
const areaRef = React.useRef(null);
|
|
15476
15476
|
const messagesContainerRef = React.useRef(null);
|
|
15477
15477
|
useAutoscroll(areaRef, { enabled: true });
|
|
@@ -15499,7 +15499,15 @@ const Thread = ({ agentName, agentId, hasMemory, hasModelList }) => {
|
|
|
15499
15499
|
/* @__PURE__ */ jsxRuntime.jsx("div", {})
|
|
15500
15500
|
] })
|
|
15501
15501
|
] }),
|
|
15502
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15502
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
15503
|
+
Composer,
|
|
15504
|
+
{
|
|
15505
|
+
hasMemory,
|
|
15506
|
+
agentId,
|
|
15507
|
+
hasModelList,
|
|
15508
|
+
hideModelSwitcher
|
|
15509
|
+
}
|
|
15510
|
+
)
|
|
15503
15511
|
] });
|
|
15504
15512
|
};
|
|
15505
15513
|
const ThreadWrapper = ({ children }) => {
|
|
@@ -15511,7 +15519,7 @@ const ThreadWelcome = ({ agentName }) => {
|
|
|
15511
15519
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 font-medium", children: "How can I help you today?" })
|
|
15512
15520
|
] }) });
|
|
15513
15521
|
};
|
|
15514
|
-
const Composer = ({ hasMemory, agentId, hasModelList }) => {
|
|
15522
|
+
const Composer = ({ hasMemory, agentId, hasModelList, hideModelSwitcher }) => {
|
|
15515
15523
|
const { setThreadInput } = useThreadInput();
|
|
15516
15524
|
const textareaRef = React.useRef(null);
|
|
15517
15525
|
const { canExecute } = usePermissions();
|
|
@@ -15523,7 +15531,7 @@ const Composer = ({ hasMemory, agentId, hasModelList }) => {
|
|
|
15523
15531
|
"textarea",
|
|
15524
15532
|
{
|
|
15525
15533
|
ref: textareaRef,
|
|
15526
|
-
autoFocus:
|
|
15534
|
+
autoFocus: false,
|
|
15527
15535
|
className: "text-ui-lg leading-ui-lg placeholder:text-neutral3 text-neutral6 bg-transparent focus:outline-none resize-none outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
15528
15536
|
placeholder: canExecuteAgent ? "Enter your message..." : "You don't have permission to execute agents",
|
|
15529
15537
|
name: "",
|
|
@@ -15533,7 +15541,7 @@ const Composer = ({ hasMemory, agentId, hasModelList }) => {
|
|
|
15533
15541
|
}
|
|
15534
15542
|
) }),
|
|
15535
15543
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
15536
|
-
agentId && !hasModelList && /* @__PURE__ */ jsxRuntime.jsx(ComposerModelSwitcher, { agentId }),
|
|
15544
|
+
agentId && !hasModelList && !hideModelSwitcher && /* @__PURE__ */ jsxRuntime.jsx(ComposerModelSwitcher, { agentId }),
|
|
15537
15545
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 ml-auto", children: [
|
|
15538
15546
|
canExecuteAgent && /* @__PURE__ */ jsxRuntime.jsx(SpeechInput, { agentId }),
|
|
15539
15547
|
/* @__PURE__ */ jsxRuntime.jsx(ComposerAction, { canExecute: canExecuteAgent })
|
|
@@ -17138,7 +17146,8 @@ const AgentChat = ({
|
|
|
17138
17146
|
modelVersion,
|
|
17139
17147
|
modelList,
|
|
17140
17148
|
messageId,
|
|
17141
|
-
isNewThread
|
|
17149
|
+
isNewThread,
|
|
17150
|
+
hideModelSwitcher
|
|
17142
17151
|
}) => {
|
|
17143
17152
|
const { settings } = useAgentSettings();
|
|
17144
17153
|
const requestContext = useMergedRequestContext();
|
|
@@ -17179,7 +17188,16 @@ const AgentChat = ({
|
|
|
17179
17188
|
refreshThreadList,
|
|
17180
17189
|
settings,
|
|
17181
17190
|
requestContext,
|
|
17182
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17191
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17192
|
+
Thread,
|
|
17193
|
+
{
|
|
17194
|
+
agentName: agentName ?? "",
|
|
17195
|
+
hasMemory: memory,
|
|
17196
|
+
agentId,
|
|
17197
|
+
hasModelList: Boolean(modelList),
|
|
17198
|
+
hideModelSwitcher
|
|
17199
|
+
}
|
|
17200
|
+
)
|
|
17183
17201
|
}
|
|
17184
17202
|
);
|
|
17185
17203
|
};
|
|
@@ -21985,6 +22003,11 @@ function AuthRequired({ children, loginUrl = "/login", signupUrl = "/signup" })
|
|
|
21985
22003
|
const AgentEntityHeader = ({ agentId }) => {
|
|
21986
22004
|
const { data: agent, isLoading } = useAgent(agentId);
|
|
21987
22005
|
const { handleCopy } = useCopyToClipboard({ text: agentId });
|
|
22006
|
+
const sessionUrl = `${window.location.origin}/agents/${agentId}/session`;
|
|
22007
|
+
const { handleCopy: handleShareLink, isCopied: isShareCopied } = useCopyToClipboard({
|
|
22008
|
+
text: sessionUrl,
|
|
22009
|
+
copyMessage: "Session URL copied to clipboard!"
|
|
22010
|
+
});
|
|
21988
22011
|
const { isCmsAvailable } = useIsCmsAvailable();
|
|
21989
22012
|
const { navigate } = useLinkComponent();
|
|
21990
22013
|
const { cloneAgent, isCloning } = useCloneAgent();
|
|
@@ -21999,22 +22022,30 @@ const AgentEntityHeader = ({ agentId }) => {
|
|
|
21999
22022
|
navigate(`/agents/${clonedAgent.id}/chat`);
|
|
22000
22023
|
}
|
|
22001
22024
|
};
|
|
22002
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.
|
|
22025
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22003
22026
|
EntityHeader,
|
|
22004
22027
|
{
|
|
22005
22028
|
icon: isCmsAvailable ? /* @__PURE__ */ jsxRuntime.jsx(AgentSourceIcon, { source: agent?.source }) : /* @__PURE__ */ jsxRuntime.jsx(AgentIcon, {}),
|
|
22006
22029
|
title: agentName,
|
|
22007
22030
|
isLoading,
|
|
22008
|
-
children: [
|
|
22031
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-3", children: [
|
|
22009
22032
|
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
22010
22033
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleCopy, className: "h-badge-default shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, {}), variant: "default", children: showStoredAgentBadge ? /* @__PURE__ */ jsxRuntime.jsx(Truncate, { untilChar: "-", withTooltip: false, children: agentId }) : agentId }) }) }),
|
|
22011
22034
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Copy Agent ID for use in code" })
|
|
22012
22035
|
] }),
|
|
22013
22036
|
canWriteAgents && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
22014
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick:
|
|
22037
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => navigate(`/cms/agents/${agentId}/edit`), className: "h-badge-default shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, {}), variant: "default", children: "Edit" }) }) }),
|
|
22038
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: isStoredAgent ? "Edit agent configuration" : "Edit agent overrides" })
|
|
22039
|
+
] }),
|
|
22040
|
+
canWriteAgents && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
22041
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleClone, disabled: isCloning, className: "h-badge-default shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyPlus, {}), variant: "default", children: isCloning ? "Cloning..." : "Clone" }) }) }),
|
|
22015
22042
|
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Clone agent to a new stored agent" })
|
|
22043
|
+
] }),
|
|
22044
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
22045
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleShareLink, className: "h-badge-default shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { icon: isShareCopied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, {}), variant: "default", children: "Share" }) }) }),
|
|
22046
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: "Copy session URL to share with your team" })
|
|
22016
22047
|
] })
|
|
22017
|
-
]
|
|
22048
|
+
] })
|
|
22018
22049
|
}
|
|
22019
22050
|
) });
|
|
22020
22051
|
};
|
|
@@ -36332,8 +36363,9 @@ function TemplateSuccess({ name, installedEntities, linkComponent }) {
|
|
|
36332
36363
|
}
|
|
36333
36364
|
|
|
36334
36365
|
function TemplateFailure({ errorMsg, validationErrors }) {
|
|
36335
|
-
const
|
|
36336
|
-
const
|
|
36366
|
+
const errorString = typeof errorMsg === "string" ? errorMsg : errorMsg != null ? String(errorMsg) : void 0;
|
|
36367
|
+
const isSchemaError = errorString?.includes("Invalid schema for function");
|
|
36368
|
+
const isValidationError = errorString?.includes("validation issue") || validationErrors && validationErrors.length > 0;
|
|
36337
36369
|
const getUserFriendlyMessage = () => {
|
|
36338
36370
|
if (isValidationError) {
|
|
36339
36371
|
return "Template installation completed but some validation issues remain. The template may still be functional, but you should review and fix these issues.";
|
|
@@ -36375,9 +36407,9 @@ function TemplateFailure({ errorMsg, validationErrors }) {
|
|
|
36375
36407
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-mono text-gray-700 dark:text-gray-300 mt-1 whitespace-pre-wrap break-words", children: error.message })
|
|
36376
36408
|
] }, index)) })
|
|
36377
36409
|
] }),
|
|
36378
|
-
|
|
36410
|
+
errorString && !isValidationError && /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "text-xs", children: [
|
|
36379
36411
|
/* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer text-neutral3 hover:text-neutral4 select-none text-center", children: "Show Details" }),
|
|
36380
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap break-words", children:
|
|
36412
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 p-3 bg-gray-100 dark:bg-gray-800 rounded text-xs font-mono overflow-auto max-h-60 text-left", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "whitespace-pre-wrap break-words", children: errorString }) })
|
|
36381
36413
|
] })
|
|
36382
36414
|
] });
|
|
36383
36415
|
}
|