@mastra/playground-ui 16.1.3-alpha.0 → 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 +15 -0
- package/dist/index.cjs.js +42 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +43 -12
- 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 +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
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
|
+
|
|
3
18
|
## 16.1.3-alpha.0
|
|
4
19
|
|
|
5
20
|
### 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
|
};
|