@mastra/playground-ui 21.0.0 → 21.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/dist/index.es.js CHANGED
@@ -14612,6 +14612,14 @@ const GroqIcon = (props) => /* @__PURE__ */ jsxs(
14612
14612
  }
14613
14613
  );
14614
14614
 
14615
+ const MastraIcon = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 34 21", fill: "none", ...props, children: /* @__PURE__ */ jsx(
14616
+ "path",
14617
+ {
14618
+ d: "M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z",
14619
+ fill: props.fill || "currentColor"
14620
+ }
14621
+ ) });
14622
+
14615
14623
  const MistralIcon = (props) => /* @__PURE__ */ jsxs(
14616
14624
  "svg",
14617
14625
  {
@@ -14846,7 +14854,8 @@ const providerMapToIcon = {
14846
14854
  GROQ: /* @__PURE__ */ jsx(GroqIcon, {}),
14847
14855
  X_GROK: /* @__PURE__ */ jsx(XGroqIcon, {}),
14848
14856
  MISTRAL: /* @__PURE__ */ jsx(MistralIcon, {}),
14849
- netlify: /* @__PURE__ */ jsx(NetlifyIcon, {})
14857
+ netlify: /* @__PURE__ */ jsx(NetlifyIcon, {}),
14858
+ mastra: /* @__PURE__ */ jsx(MastraIcon, {})
14850
14859
  };
14851
14860
 
14852
14861
  const cleanProviderId$1 = (providerId) => {
@@ -14870,12 +14879,13 @@ const ProviderLogo$1 = ({ providerId, className = "", size = 20 }) => {
14870
14879
  perplexity: "perplexity",
14871
14880
  fireworks_ai: "fireworks",
14872
14881
  openrouter: "openrouter",
14873
- netlify: "netlify"
14882
+ netlify: "netlify",
14883
+ mastra: "mastra"
14874
14884
  };
14875
14885
  return iconMap[id] || "DEFAULT";
14876
14886
  };
14877
14887
  const fallbackIcon = getFallbackProviderIcon(cleanedProviderId);
14878
- const isGateway = ["netlify"].includes(cleanProviderId);
14888
+ const isGateway = ["netlify", "mastra"].includes(cleanProviderId);
14879
14889
  if (isGateway || imageError || !providerId) {
14880
14890
  if (providerMapToIcon[fallbackIcon]) {
14881
14891
  return /* @__PURE__ */ jsx(Icon, { children: providerMapToIcon[fallbackIcon] });
@@ -15518,12 +15528,13 @@ const ProviderLogo = ({ providerId, className = "", size = 20 }) => {
15518
15528
  perplexity: "perplexity",
15519
15529
  fireworks_ai: "fireworks",
15520
15530
  openrouter: "openrouter",
15521
- netlify: "netlify"
15531
+ netlify: "netlify",
15532
+ mastra: "mastra"
15522
15533
  };
15523
15534
  return iconMap[id] || "DEFAULT";
15524
15535
  };
15525
15536
  const fallbackIcon = getFallbackProviderIcon(cleanedProviderId);
15526
- const isGateway = ["netlify"].includes(cleanProviderId$1);
15537
+ const isGateway = ["netlify", "mastra"].includes(cleanProviderId$1);
15527
15538
  if (isGateway || imageError || !providerId) {
15528
15539
  if (providerMapToIcon[fallbackIcon]) {
15529
15540
  return /* @__PURE__ */ jsx(Icon, { children: providerMapToIcon[fallbackIcon] });
@@ -23233,11 +23244,11 @@ const AgentObservationalMemory = ({ agentId, resourceId, threadId }) => {
23233
23244
  return threshold.min;
23234
23245
  };
23235
23246
  const isAdaptiveMode = omAgentConfig?.messageTokens !== void 0 && typeof omAgentConfig.messageTokens !== "number";
23236
- const totalBudget = isAdaptiveMode ? getThresholdValue(omAgentConfig?.messageTokens, 1e4) : 0;
23237
- const baseMessageTokens = isAdaptiveMode ? getBaseThresholdValue(omAgentConfig?.messageTokens, 1e4) : void 0;
23238
- const baseObservationTokens = isAdaptiveMode ? getBaseThresholdValue(omAgentConfig?.observationTokens, 3e4) : void 0;
23239
- const messageTokensThreshold = streamProgress?.windows?.active?.messages?.threshold ?? recordConfig?.observation?.messageTokens ?? getThresholdValue(omAgentConfig?.messageTokens, 1e4);
23240
- const configObservationTokens = getThresholdValue(omAgentConfig?.observationTokens, 3e4);
23247
+ const totalBudget = isAdaptiveMode ? getThresholdValue(omAgentConfig?.messageTokens, 3e4) : 0;
23248
+ const baseMessageTokens = isAdaptiveMode ? getBaseThresholdValue(omAgentConfig?.messageTokens, 3e4) : void 0;
23249
+ const baseObservationTokens = isAdaptiveMode ? getBaseThresholdValue(omAgentConfig?.observationTokens, 4e4) : void 0;
23250
+ const messageTokensThreshold = streamProgress?.windows?.active?.messages?.threshold ?? recordConfig?.observation?.messageTokens ?? getThresholdValue(omAgentConfig?.messageTokens, 3e4);
23251
+ const configObservationTokens = getThresholdValue(omAgentConfig?.observationTokens, 4e4);
23241
23252
  const observationTokensThreshold = streamProgress?.windows?.active?.observations?.threshold ?? recordConfig?.reflection?.observationTokens ?? configObservationTokens;
23242
23253
  const pendingMessageTokens = streamProgress?.windows?.active?.messages?.tokens ?? record?.pendingMessageTokens ?? 0;
23243
23254
  const observationTokenCount = streamProgress?.windows?.active?.observations?.tokens ?? record?.observationTokenCount ?? 0;
@@ -23868,7 +23879,8 @@ const MemorySearch = ({
23868
23879
  ] });
23869
23880
  };
23870
23881
 
23871
- function AgentMemory({ agentId, threadId }) {
23882
+ function AgentMemory({ agentId, threadId, memoryType }) {
23883
+ const isGatewayMemory = memoryType === "gateway";
23872
23884
  const { threadInput: chatInputValue } = useThreadInput();
23873
23885
  const { paths, navigate } = useLinkComponent();
23874
23886
  const { data: thread } = useThread({ threadId, agentId });
@@ -23932,7 +23944,7 @@ function AgentMemory({ agentId, threadId }) {
23932
23944
  ] })
23933
23945
  ] }) }),
23934
23946
  isOMEnabled && /* @__PURE__ */ jsx("div", { className: "border-b border-border1 min-w-0 overflow-hidden", children: /* @__PURE__ */ jsx(AgentObservationalMemory, { agentId, resourceId: effectiveResourceId, threadId }) }),
23935
- /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border1", children: [
23947
+ !isGatewayMemory && /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border1", children: [
23936
23948
  /* @__PURE__ */ jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
23937
23949
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-neutral5", children: "Semantic Recall" }),
23938
23950
  searchMemoryData?.searchScope && /* @__PURE__ */ jsx(
@@ -23973,10 +23985,17 @@ function AgentMemory({ agentId, threadId }) {
23973
23985
  )
23974
23986
  ] })
23975
23987
  ] }),
23976
- /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
23988
+ !isGatewayMemory && /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto", children: [
23977
23989
  /* @__PURE__ */ jsx(AgentWorkingMemory, { agentId }),
23978
23990
  /* @__PURE__ */ jsx("div", { className: "border-t border-border1", children: /* @__PURE__ */ jsx(AgentMemoryConfig, { agentId }) })
23979
- ] })
23991
+ ] }),
23992
+ isGatewayMemory && /* @__PURE__ */ jsx("div", { className: "p-4 border-b border-border1", children: /* @__PURE__ */ jsxs("div", { className: "bg-surface3 border border-border1 rounded-lg p-4", children: [
23993
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
23994
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium px-2 py-0.5 rounded bg-green-500/20 text-green-400", children: "Gateway" }),
23995
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-neutral5", children: "Memory Gateway" })
23996
+ ] }),
23997
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-neutral3", children: "Memory is managed by the Memory Gateway. Threads and observations are stored remotely." })
23998
+ ] }) })
23980
23999
  ] });
23981
24000
  }
23982
24001
 
@@ -24001,7 +24020,7 @@ function AgentInformation({ agentId, threadId }) {
24001
24020
  /* @__PURE__ */ jsx(TabContent, { value: "overview", children: /* @__PURE__ */ jsx(AgentMetadata, { agentId }) }),
24002
24021
  /* @__PURE__ */ jsx(TabContent, { value: "model-settings", children: /* @__PURE__ */ jsx(AgentSettings, { agentId }) }),
24003
24022
  agent?.requestContextSchema && /* @__PURE__ */ jsx(TabContent, { value: "request-context", children: /* @__PURE__ */ jsx("div", { className: "p-5", children: /* @__PURE__ */ jsx(RequestContextSchemaForm, { requestContextSchema: agent.requestContextSchema }) }) }),
24004
- hasMemory && /* @__PURE__ */ jsx(TabContent, { value: "memory", children: /* @__PURE__ */ jsx(AgentMemory, { agentId, threadId }) }),
24023
+ hasMemory && /* @__PURE__ */ jsx(TabContent, { value: "memory", children: /* @__PURE__ */ jsx(AgentMemory, { agentId, threadId, memoryType: memory?.memoryType }) }),
24005
24024
  /* @__PURE__ */ jsx(TabContent, { value: "tracing-options", children: /* @__PURE__ */ jsx(TracingRunOptions, {}) })
24006
24025
  ] }) })
24007
24026
  ] });