@mastra/playground-ui 5.1.12 → 5.1.13-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.
Files changed (39) hide show
  1. package/dist/index.cjs.js +1612 -172
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.es.js +1600 -179
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/src/components/assistant-ui/messages/reasoning.d.ts +3 -0
  6. package/dist/src/components/scrollable-container.d.ts +9 -0
  7. package/dist/src/domains/agents/components/agent-table/agent-table.d.ts +10 -0
  8. package/dist/src/domains/agents/components/agent-table/columns.d.ts +22 -0
  9. package/dist/src/domains/agents/components/agent-table/types.d.ts +12 -0
  10. package/dist/src/domains/agents/components/runtime-context.d.ts +6 -0
  11. package/dist/src/domains/agents/context/agent-working-memory-context.d.ts +21 -0
  12. package/dist/src/domains/agents/context/index.d.ts +2 -0
  13. package/dist/src/domains/agents/hooks/use-agent-working-memory.d.ts +10 -0
  14. package/dist/src/domains/agents/index.d.ts +3 -1
  15. package/dist/src/domains/networks/components/network-table/columns.d.ts +4 -0
  16. package/dist/src/domains/networks/components/network-table/network-table.d.ts +11 -0
  17. package/dist/src/domains/networks/components/network-table/types.d.ts +10 -0
  18. package/dist/src/domains/networks/index.d.ts +1 -0
  19. package/dist/src/domains/tools/components/tool-list.d.ts +10 -0
  20. package/dist/src/domains/tools/index.d.ts +1 -0
  21. package/dist/src/domains/workflows/components/workflow-table/columns.d.ts +4 -0
  22. package/dist/src/domains/workflows/components/workflow-table/types.d.ts +7 -0
  23. package/dist/src/domains/workflows/components/workflow-table/workflow-table.d.ts +11 -0
  24. package/dist/src/domains/workflows/index.d.ts +1 -0
  25. package/dist/src/ds/components/Button/Button.d.ts +1 -0
  26. package/dist/src/ds/icons/AmazonIcon.d.ts +3 -0
  27. package/dist/src/ds/icons/AnthropicChatIcon.d.ts +3 -0
  28. package/dist/src/ds/icons/AnthropicMessagesIcon.d.ts +3 -0
  29. package/dist/src/ds/icons/AzureIcon.d.ts +3 -0
  30. package/dist/src/ds/icons/CohereIcon.d.ts +3 -0
  31. package/dist/src/ds/icons/GroqIcon.d.ts +3 -0
  32. package/dist/src/ds/icons/MistralIcon.d.ts +3 -0
  33. package/dist/src/ds/icons/OpenaiChatIcon.d.ts +3 -0
  34. package/dist/src/ds/icons/XGroqIcon.d.ts +3 -0
  35. package/dist/src/index.d.ts +2 -0
  36. package/dist/src/lib/framework.d.ts +12 -0
  37. package/dist/src/services/vnext-network-runtime-provider.d.ts +1 -1
  38. package/dist/src/types.d.ts +12 -2
  39. package/package.json +6 -5
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { createContext, useContext, forwardRef, memo, useState, useEffect, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1 } from 'react';
3
+ import React__default, { createContext, useContext, forwardRef, memo, useState, useEffect, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1, startTransition } from 'react';
4
4
  import { MastraClient } from '@mastra/client-js';
5
5
  import { useMessage, MessagePrimitive, ActionBarPrimitive, useAttachment, AttachmentPrimitive, useComposerRuntime, ComposerPrimitive, ThreadPrimitive, useExternalStoreRuntime, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, AssistantRuntimeProvider } from '@assistant-ui/react';
6
- import { CheckIcon as CheckIcon$1, CopyIcon, Check, Copy, ChevronUpIcon, X, FileText, CircleXIcon, Mic, PlusIcon, ArrowUp, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, ChevronUp, ChevronDown, Circle, RefreshCw, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Braces, Loader2, Network, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Plus, Maximize, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Brackets, TrashIcon, CirclePause, StopCircle } from 'lucide-react';
6
+ import { CheckIcon as CheckIcon$1, CopyIcon, Check, Copy, ChevronUpIcon, BrainIcon, X, FileText, CircleXIcon, Mic, PlusIcon, ArrowUp, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, ChevronUp, ChevronDown, Circle, Braces, SaveIcon, RefreshCw, ExternalLink, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Loader2, Network, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Plus, Maximize, Workflow, AlertCircleIcon, Users, Brain, NetworkIcon, SearchIcon, AlertCircle, CalendarIcon, Brackets, TrashIcon, CirclePause, StopCircle } from 'lucide-react';
7
7
  import { Slot } from '@radix-ui/react-slot';
8
8
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
9
9
  import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
@@ -20,7 +20,7 @@ import CodeMirror from '@uiw/react-codemirror';
20
20
  import { toast } from 'sonner';
21
21
  import { useShallow } from 'zustand/shallow';
22
22
  import * as DialogPrimitive from '@radix-ui/react-dialog';
23
- import { RuntimeContext } from '@mastra/core/di';
23
+ import { RuntimeContext as RuntimeContext$1 } from '@mastra/core/di';
24
24
  import { create } from 'zustand';
25
25
  import { persist } from 'zustand/middleware';
26
26
  import { format, formatDistanceToNow, isValid, formatDate } from 'date-fns';
@@ -31,6 +31,10 @@ import * as SliderPrimitive from '@radix-ui/react-slider';
31
31
  import * as LabelPrimitive from '@radix-ui/react-label';
32
32
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
33
33
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
34
+ import prettier from 'prettier';
35
+ import prettierPluginBabel from 'prettier/plugins/babel';
36
+ import prettierPluginEstree from 'prettier/plugins/estree';
37
+ import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
34
38
  import { processDataStream } from '@ai-sdk/ui-utils';
35
39
  import Markdown from 'react-markdown';
36
40
  import { MarkerType, Handle, Position, useViewport, useReactFlow, Panel, useNodesState, useEdgesState, ReactFlow, MiniMap, Background, BackgroundVariant, ReactFlowProvider, Controls } from '@xyflow/react';
@@ -38,11 +42,9 @@ import '@xyflow/react/dist/style.css';
38
42
  import Dagre from '@dagrejs/dagre';
39
43
  import { Highlight, themes } from 'prism-react-renderer';
40
44
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
41
- import prettier from 'prettier';
42
- import prettierPluginBabel from 'prettier/plugins/babel';
43
- import prettierPluginEstree from 'prettier/plugins/estree';
44
45
  import { useDebouncedCallback } from 'use-debounce';
45
46
  import { v4 } from '@lukeed/uuid';
47
+ import { RuntimeContext as RuntimeContext$2 } from '@mastra/core/runtime-context';
46
48
  import jsonSchemaToZod from 'json-schema-to-zod';
47
49
  import { parse } from 'superjson';
48
50
  import z$1, { z, ZodObject } from 'zod';
@@ -53,7 +55,6 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
53
55
  import * as SelectPrimitive from '@radix-ui/react-select';
54
56
  import { ZodProvider, getFieldConfigInZodStack, getDefaultValueInZodStack } from '@autoform/zod';
55
57
  import { CodeBlock as CodeBlock$1 } from 'react-code-block';
56
- import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
57
58
 
58
59
  import './index.css';const createMastraClient = (baseUrl, mastraClientHeaders = {}) => {
59
60
  return new MastraClient({
@@ -4334,7 +4335,7 @@ const ToolFallback$1 = ({ toolName, argsText, result }) => {
4334
4335
  } catch {
4335
4336
  argSlot = /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap", children: argsText });
4336
4337
  }
4337
- return /* @__PURE__ */ jsxs("div", { children: [
4338
+ return /* @__PURE__ */ jsxs("div", { className: "mb-2", children: [
4338
4339
  /* @__PURE__ */ jsxs("button", { onClick: () => setIsCollapsed((s) => !s), className: "flex items-center gap-2", children: [
4339
4340
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: cn("transition-all", isCollapsed ? "rotate-90" : "rotate-180") }) }),
4340
4341
  /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(ToolsIcon, { className: "text-[#ECB047]" }), children: toolName })
@@ -4352,20 +4353,35 @@ const ToolFallback$1 = ({ toolName, argsText, result }) => {
4352
4353
  ] });
4353
4354
  };
4354
4355
 
4356
+ const Reasoning = ({ text }) => {
4357
+ const [isCollapsed, setIsCollapsed] = useState(false);
4358
+ return /* @__PURE__ */ jsxs("div", { className: "mb-2 space-y-2", children: [
4359
+ /* @__PURE__ */ jsxs("button", { onClick: () => setIsCollapsed((s) => !s), className: "flex items-center gap-2", children: [
4360
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: cn("transition-all", isCollapsed ? "rotate-90" : "rotate-180") }) }),
4361
+ /* @__PURE__ */ jsxs(Badge$1, { icon: /* @__PURE__ */ jsx(BrainIcon, {}), children: [
4362
+ isCollapsed ? "Show" : "Hide",
4363
+ " reasoning"
4364
+ ] })
4365
+ ] }),
4366
+ !isCollapsed ? /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-surface4 p-2 border-sm border-border-1", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap text-ui-sm leading-ui-sm text-icon6", children: text }) }) : null
4367
+ ] });
4368
+ };
4369
+
4355
4370
  const AssistantMessage = ({ ToolFallback: ToolFallbackCustom }) => {
4356
4371
  const data = useMessage();
4357
- const isSolelyToolCall = data.content.length === 1 && data.content[0].type === "tool-call";
4372
+ const isToolCallAndOrReasoning = data.content.every(({ type }) => type === "tool-call" || type === "reasoning");
4358
4373
  return /* @__PURE__ */ jsxs(MessagePrimitive.Root, { className: "max-w-full", children: [
4359
4374
  /* @__PURE__ */ jsx("div", { className: "text-icon6 text-ui-lg leading-ui-lg", children: /* @__PURE__ */ jsx(
4360
4375
  MessagePrimitive.Content,
4361
4376
  {
4362
4377
  components: {
4363
4378
  Text: MarkdownText,
4364
- tools: { Fallback: ToolFallbackCustom || ToolFallback$1 }
4379
+ tools: { Fallback: ToolFallbackCustom || ToolFallback$1 },
4380
+ Reasoning
4365
4381
  }
4366
4382
  }
4367
4383
  ) }),
4368
- /* @__PURE__ */ jsx("div", { className: "h-6 pt-1", children: !isSolelyToolCall && /* @__PURE__ */ jsx(AssistantActionBar$1, {}) })
4384
+ !isToolCallAndOrReasoning && /* @__PURE__ */ jsx("div", { className: "h-6 pt-1", children: /* @__PURE__ */ jsx(AssistantActionBar$1, {}) })
4369
4385
  ] });
4370
4386
  };
4371
4387
  const AssistantActionBar$1 = () => {
@@ -4932,6 +4948,108 @@ const CircleStopIcon$1 = () => {
4932
4948
  return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", width: "16", height: "16", children: /* @__PURE__ */ jsx("rect", { width: "10", height: "10", x: "3", y: "3", rx: "2" }) });
4933
4949
  };
4934
4950
 
4951
+ function parseJsonString(jsonString) {
4952
+ try {
4953
+ return JSON.stringify(JSON.parse(jsonString), null, 2);
4954
+ } catch {
4955
+ return jsonString;
4956
+ }
4957
+ }
4958
+ function useAgentWorkingMemory(agentId, threadId, resourceId) {
4959
+ const client = useMastraClient();
4960
+ const [threadExists, setThreadExists] = useState(false);
4961
+ const [workingMemoryData, setWorkingMemoryData] = useState(null);
4962
+ const [workingMemorySource, setWorkingMemorySource] = useState("thread");
4963
+ const [workingMemoryFormat, setWorkingMemoryFormat] = useState("markdown");
4964
+ const [isLoading, setIsLoading] = useState(true);
4965
+ const [isUpdating, setIsUpdating] = useState(false);
4966
+ const refetch = useCallback(async () => {
4967
+ setIsLoading(true);
4968
+ try {
4969
+ if (!agentId || !threadId) {
4970
+ setWorkingMemoryData(null);
4971
+ setIsLoading(false);
4972
+ return;
4973
+ }
4974
+ const res = await client.getWorkingMemory({ agentId, threadId, resourceId });
4975
+ const { workingMemory, source, workingMemoryTemplate, threadExists: threadExists2 } = res;
4976
+ setThreadExists(threadExists2);
4977
+ setWorkingMemoryData(workingMemory);
4978
+ setWorkingMemorySource(source);
4979
+ setWorkingMemoryFormat(workingMemoryTemplate?.format || "markdown");
4980
+ if (workingMemoryTemplate?.format === "json") {
4981
+ let dataToSet = "";
4982
+ if (workingMemory) {
4983
+ dataToSet = parseJsonString(workingMemory);
4984
+ } else if (workingMemoryTemplate?.content) {
4985
+ dataToSet = parseJsonString(workingMemoryTemplate.content);
4986
+ } else {
4987
+ dataToSet = "";
4988
+ }
4989
+ setWorkingMemoryData(dataToSet);
4990
+ } else {
4991
+ setWorkingMemoryData(workingMemory || workingMemoryTemplate?.content || "");
4992
+ }
4993
+ } catch (error) {
4994
+ setWorkingMemoryData(null);
4995
+ console.error("Error fetching working memory", error);
4996
+ } finally {
4997
+ setIsLoading(false);
4998
+ }
4999
+ }, [agentId, threadId, resourceId]);
5000
+ useEffect(() => {
5001
+ refetch();
5002
+ }, [refetch]);
5003
+ const updateWorkingMemory = async (newMemory) => {
5004
+ setIsUpdating(true);
5005
+ try {
5006
+ if (workingMemoryFormat === "json") {
5007
+ try {
5008
+ JSON.parse(newMemory);
5009
+ } catch (e) {
5010
+ throw new Error("Invalid JSON working memory");
5011
+ }
5012
+ }
5013
+ await client.updateWorkingMemory({ agentId, threadId, workingMemory: newMemory, resourceId });
5014
+ refetch();
5015
+ } catch (error) {
5016
+ console.error("Error updating working memory", error);
5017
+ throw error;
5018
+ } finally {
5019
+ setIsUpdating(false);
5020
+ }
5021
+ };
5022
+ return {
5023
+ threadExists,
5024
+ workingMemoryData,
5025
+ workingMemorySource,
5026
+ workingMemoryFormat,
5027
+ isLoading,
5028
+ isUpdating,
5029
+ refetch,
5030
+ updateWorkingMemory
5031
+ };
5032
+ }
5033
+
5034
+ const WorkingMemoryContext = createContext({
5035
+ threadExists: false,
5036
+ workingMemoryData: null,
5037
+ workingMemorySource: "thread",
5038
+ isLoading: false,
5039
+ isUpdating: false,
5040
+ updateWorkingMemory: () => Promise.resolve(),
5041
+ refetch: () => Promise.resolve()
5042
+ });
5043
+ function WorkingMemoryProvider({ agentId, threadId, resourceId, children }) {
5044
+ const value = useAgentWorkingMemory(agentId, threadId, resourceId);
5045
+ return /* @__PURE__ */ jsx(WorkingMemoryContext.Provider, { value, children });
5046
+ }
5047
+ function useWorkingMemory() {
5048
+ const ctx = useContext(WorkingMemoryContext);
5049
+ if (!ctx) throw new Error("useWorkingMemory must be used within a WorkingMemoryProvider");
5050
+ return ctx;
5051
+ }
5052
+
4935
5053
  class PDFAttachmentAdapter {
4936
5054
  accept = "application/pdf";
4937
5055
  async add({ file }) {
@@ -5043,6 +5161,7 @@ function MastraRuntimeProvider({
5043
5161
  const [isRunning, setIsRunning] = useState(false);
5044
5162
  const [messages, setMessages] = useState([]);
5045
5163
  const [currentThreadId, setCurrentThreadId] = useState(threadId);
5164
+ const { refetch: refreshWorkingMemory } = useWorkingMemory();
5046
5165
  const {
5047
5166
  frequencyPenalty,
5048
5167
  presencePenalty,
@@ -5053,9 +5172,11 @@ function MastraRuntimeProvider({
5053
5172
  topK,
5054
5173
  topP,
5055
5174
  instructions,
5056
- chatWithGenerate
5175
+ chatWithGenerate,
5176
+ providerOptions
5057
5177
  } = settings?.modelSettings ?? {};
5058
- const runtimeContextInstance = new RuntimeContext();
5178
+ const toolCallIdToName = useRef({});
5179
+ const runtimeContextInstance = new RuntimeContext$1();
5059
5180
  Object.entries(runtimeContext ?? {}).forEach(([key, value]) => {
5060
5181
  runtimeContextInstance.set(key, value);
5061
5182
  });
@@ -5076,9 +5197,11 @@ function MastraRuntimeProvider({
5076
5197
  mimeType: image.contentType,
5077
5198
  image: image.url
5078
5199
  }));
5200
+ const reasoning = message?.parts?.find(({ type }) => type === "reasoning")?.details?.map((detail) => detail?.text)?.join(" ");
5079
5201
  return {
5080
5202
  ...message,
5081
5203
  content: [
5204
+ ...reasoning ? [{ type: "reasoning", text: reasoning }] : [],
5082
5205
  ...typeof message.content === "string" ? [{ type: "text", text: message.content }] : [],
5083
5206
  ...toolInvocationsAsContentParts,
5084
5207
  ...attachmentsAsContentParts
@@ -5122,7 +5245,8 @@ function MastraRuntimeProvider({
5122
5245
  topP,
5123
5246
  instructions,
5124
5247
  runtimeContext: runtimeContextInstance,
5125
- ...memory ? { threadId, resourceId: agentId } : {}
5248
+ ...memory ? { threadId, resourceId: agentId } : {},
5249
+ providerOptions
5126
5250
  });
5127
5251
  if (generateResponse.response) {
5128
5252
  const latestMessage = generateResponse.response.messages.reduce(
@@ -5133,6 +5257,7 @@ function MastraRuntimeProvider({
5133
5257
  ...acc,
5134
5258
  content: [
5135
5259
  ..._content,
5260
+ ...generateResponse.reasoning ? [{ type: "reasoning", text: generateResponse.reasoning }] : [],
5136
5261
  {
5137
5262
  type: "text",
5138
5263
  text: message2.content
@@ -5142,6 +5267,7 @@ function MastraRuntimeProvider({
5142
5267
  }
5143
5268
  if (message2.role === "assistant") {
5144
5269
  const toolCallContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "tool-call") : void 0;
5270
+ const reasoningContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "reasoning") : void 0;
5145
5271
  if (toolCallContent) {
5146
5272
  const newContent = _content.map((c) => {
5147
5273
  if (c.type === "tool-call" && c.toolCallId === toolCallContent?.toolCallId) {
@@ -5152,14 +5278,14 @@ function MastraRuntimeProvider({
5152
5278
  const containsToolCall = newContent.some((c) => c.type === "tool-call");
5153
5279
  return {
5154
5280
  ...acc,
5155
- content: containsToolCall ? newContent : [..._content, toolCallContent]
5281
+ content: containsToolCall ? [...reasoningContent ? [reasoningContent] : [], ...newContent] : [..._content, ...reasoningContent ? [reasoningContent] : [], toolCallContent]
5156
5282
  };
5157
5283
  }
5158
5284
  const textContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "text" && content.text) : void 0;
5159
5285
  if (textContent) {
5160
5286
  return {
5161
5287
  ...acc,
5162
- content: [..._content, textContent]
5288
+ content: [..._content, ...reasoningContent ? [reasoningContent] : [], textContent]
5163
5289
  };
5164
5290
  }
5165
5291
  }
@@ -5233,7 +5359,8 @@ function MastraRuntimeProvider({
5233
5359
  topP,
5234
5360
  instructions,
5235
5361
  runtimeContext: runtimeContextInstance,
5236
- ...memory ? { threadId, resourceId: agentId } : {}
5362
+ ...memory ? { threadId, resourceId: agentId } : {},
5363
+ providerOptions
5237
5364
  });
5238
5365
  if (!response.body) {
5239
5366
  throw new Error("No response body");
@@ -5296,6 +5423,7 @@ function MastraRuntimeProvider({
5296
5423
  assistantToolCallAddedForContent = true;
5297
5424
  return [...currentConversation, newMessage];
5298
5425
  });
5426
+ toolCallIdToName.current[value.toolCallId] = value.toolName;
5299
5427
  },
5300
5428
  async onToolResultPart(value) {
5301
5429
  setMessages((currentConversation) => {
@@ -5318,12 +5446,52 @@ function MastraRuntimeProvider({
5318
5446
  }
5319
5447
  return currentConversation;
5320
5448
  });
5449
+ try {
5450
+ const toolName = toolCallIdToName.current[value.toolCallId];
5451
+ if (toolName === "updateWorkingMemory" && value.result?.success) {
5452
+ await refreshWorkingMemory?.();
5453
+ }
5454
+ } finally {
5455
+ delete toolCallIdToName.current[value.toolCallId];
5456
+ }
5321
5457
  },
5322
5458
  onErrorPart(error) {
5323
5459
  throw new Error(error);
5324
5460
  },
5325
5461
  onFinishMessagePart({ finishReason }) {
5326
5462
  handleFinishReason(finishReason);
5463
+ },
5464
+ onReasoningPart(value) {
5465
+ setMessages((currentConversation) => {
5466
+ const lastMessage = currentConversation[currentConversation.length - 1];
5467
+ if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
5468
+ const updatedContent = lastMessage.content.map((part) => {
5469
+ if (typeof part === "object" && part.type === "reasoning") {
5470
+ return {
5471
+ ...part,
5472
+ text: part.text + value
5473
+ };
5474
+ }
5475
+ return part;
5476
+ });
5477
+ const updatedMessage = {
5478
+ ...lastMessage,
5479
+ content: updatedContent
5480
+ };
5481
+ return [...currentConversation.slice(0, -1), updatedMessage];
5482
+ }
5483
+ const newMessage = {
5484
+ role: "assistant",
5485
+ content: [
5486
+ {
5487
+ type: "reasoning",
5488
+ text: value
5489
+ },
5490
+ { type: "text", text: content }
5491
+ ]
5492
+ };
5493
+ return [...currentConversation, newMessage];
5494
+ });
5327
5495
  }
5328
5496
  });
5329
5497
  }
@@ -6676,13 +6844,79 @@ const Collapsible = CollapsiblePrimitive.Root;
6676
6844
  const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
6677
6845
  const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
6678
6846
 
6847
+ const formatJSON = async (code) => {
6848
+ const formatted = await prettier.format(code, {
6849
+ semi: false,
6850
+ parser: "json",
6851
+ printWidth: 80,
6852
+ tabWidth: 2,
6853
+ plugins: [prettierPluginBabel, prettierPluginEstree]
6854
+ });
6855
+ return formatted;
6856
+ };
6857
+ const isValidJson = (str) => {
6858
+ try {
6859
+ const obj = JSON.parse(str);
6860
+ return !!obj && typeof obj === "object";
6861
+ } catch (e) {
6862
+ return false;
6863
+ }
6864
+ };
6865
+
6679
6866
  const AgentAdvancedSettings = () => {
6680
6867
  const { settings, setSettings } = useAgentSettings();
6681
6868
  const [isOpen, setIsOpen] = useState(false);
6869
+ const [providerOptionsValue, setProviderOptionsValue] = useState("");
6870
+ const [saved, setSaved] = useState(false);
6871
+ const [error, setError] = useState(null);
6872
+ const theme = useCodemirrorTheme();
6873
+ const { handleCopy } = useCopyToClipboard({ text: providerOptionsValue });
6874
+ const providerOptionsStr = JSON.stringify(settings?.modelSettings?.providerOptions ?? {});
6875
+ useEffect(() => {
6876
+ const run = async () => {
6877
+ if (!isValidJson(providerOptionsStr)) {
6878
+ setError("Invalid JSON");
6879
+ return;
6880
+ }
6881
+ const formatted = await formatJSON(providerOptionsStr);
6882
+ setProviderOptionsValue(formatted);
6883
+ };
6884
+ run();
6885
+ }, [providerOptionsStr]);
6886
+ const formatProviderOptions = async () => {
6887
+ setError(null);
6888
+ if (!isValidJson(providerOptionsValue)) {
6889
+ setError("Invalid JSON");
6890
+ return;
6891
+ }
6892
+ const formatted = await formatJSON(providerOptionsValue);
6893
+ setProviderOptionsValue(formatted);
6894
+ };
6895
+ const saveProviderOptions = async () => {
6896
+ try {
6897
+ setError(null);
6898
+ const parsedContext = JSON.parse(providerOptionsValue);
6899
+ setSettings({
6900
+ ...settings,
6901
+ modelSettings: {
6902
+ ...settings?.modelSettings,
6903
+ providerOptions: parsedContext
6904
+ }
6905
+ });
6906
+ setSaved(true);
6907
+ setTimeout(() => {
6908
+ setSaved(false);
6909
+ }, 1e3);
6910
+ } catch (error2) {
6911
+ console.error("error", error2);
6912
+ setError("Invalid JSON");
6913
+ }
6914
+ };
6682
6915
  const collapsibleClassName = "rounded-lg border-sm border-border1 bg-surface3 overflow-clip";
6683
6916
  const collapsibleTriggerClassName = "text-icon3 text-ui-lg font-medium flex items-center gap-2 w-full p-[10px] justify-between";
6684
6917
  const collapsibleContentClassName = "bg-surface2 p-[10px] grid grid-cols-2 gap-[10px]";
6685
- return /* @__PURE__ */ jsxs(Collapsible, { className: collapsibleClassName, open: isOpen, onOpenChange: setIsOpen, children: [
6918
+ const buttonClass = "text-icon3 hover:text-icon6";
6919
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Collapsible, { className: collapsibleClassName, open: isOpen, onOpenChange: setIsOpen, children: [
6686
6920
  /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: collapsibleTriggerClassName, children: [
6687
6921
  "Advanced Settings",
6688
6922
  /* @__PURE__ */ jsx(Icon, { className: cn("transition-transform", isOpen ? "rotate-0" : "-rotate-90"), children: /* @__PURE__ */ jsx(ChevronDown, {}) })
@@ -6795,9 +7029,39 @@ const AgentAdvancedSettings = () => {
6795
7029
  })
6796
7030
  }
6797
7031
  )
7032
+ ] }),
7033
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 col-span-2", children: [
7034
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
7035
+ /* @__PURE__ */ jsx(Txt, { as: "label", className: "text-icon3", variant: "ui-sm", htmlFor: "provider-options", children: "Provider Options" }),
7036
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7037
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
7038
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { onClick: formatProviderOptions, className: buttonClass, children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Braces, {}) }) }) }),
7039
+ /* @__PURE__ */ jsx(TooltipContent, { children: "Format the Provider Options JSON" })
7040
+ ] }),
7041
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
7042
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { onClick: handleCopy, className: buttonClass, children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(CopyIcon, {}) }) }) }),
7043
+ /* @__PURE__ */ jsx(TooltipContent, { children: "Copy Provider Options" })
7044
+ ] }),
7045
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
7046
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { onClick: saveProviderOptions, className: buttonClass, children: /* @__PURE__ */ jsx(Icon, { children: saved ? /* @__PURE__ */ jsx(CheckIcon$1, {}) : /* @__PURE__ */ jsx(SaveIcon, {}) }) }) }),
7047
+ /* @__PURE__ */ jsx(TooltipContent, { children: saved ? "Saved" : "Save Provider Options" })
7048
+ ] })
7049
+ ] })
7050
+ ] }),
7051
+ /* @__PURE__ */ jsx(
7052
+ CodeMirror,
7053
+ {
7054
+ value: providerOptionsValue,
7055
+ onChange: setProviderOptionsValue,
7056
+ theme,
7057
+ extensions: [jsonLanguage],
7058
+ className: "h-[300px] overflow-scroll rounded-lg border bg-transparent shadow-sm focus-visible:ring-ring transition-colors focus-visible:outline-none focus-visible:ring-1 p-2"
7059
+ }
7060
+ ),
7061
+ error && /* @__PURE__ */ jsx(Txt, { variant: "ui-md", className: "text-accent2", children: error })
6798
7062
  ] })
6799
7063
  ] })
6800
- ] });
7064
+ ] }) });
6801
7065
  };
6802
7066
 
6803
7067
  const AgentSettings = () => {
@@ -6869,93 +7133,899 @@ const AgentSettings = () => {
6869
7133
  ] });
6870
7134
  };
6871
7135
 
6872
- const convertMessage$1 = (message) => {
6873
- return message;
7136
+ const EmptyState = ({
7137
+ iconSlot,
7138
+ titleSlot,
7139
+ descriptionSlot,
7140
+ actionSlot,
7141
+ as: Component = "div"
7142
+ }) => {
7143
+ return /* @__PURE__ */ jsxs("div", { className: "flex w-[340px] flex-col items-center justify-center text-center", children: [
7144
+ /* @__PURE__ */ jsx("div", { className: "h-auto [&>svg]:w-[126px]", children: iconSlot }),
7145
+ /* @__PURE__ */ jsx(Component, { className: "text-icon6 pt-[34px] font-serif text-[1.75rem] font-semibold", children: titleSlot }),
7146
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-lg", className: "text-icon3 pb-[34px]", children: descriptionSlot }),
7147
+ actionSlot
7148
+ ] });
6874
7149
  };
6875
- function MastraNetworkRuntimeProvider({
7150
+
7151
+ const INDICATOR_WIDTH = 40;
7152
+ const INDICATOR_HEIGHT = 150;
7153
+ const INDICATOR_SPACE = 10;
7154
+ const ScrollableContainer = ({
7155
+ className,
6876
7156
  children,
6877
- agentId,
6878
- initialMessages,
6879
- memory,
6880
- threadId,
6881
- modelSettings
6882
- }) {
6883
- const [isRunning, setIsRunning] = useState(false);
6884
- const [messages, setMessages] = useState(initialMessages || []);
6885
- const [currentThreadId, setCurrentThreadId] = useState(threadId);
6886
- const { frequencyPenalty, presencePenalty, maxRetries, maxSteps, maxTokens, temperature, topK, topP, instructions } = modelSettings;
7157
+ scrollSpeed = 100,
7158
+ scrollIntervalTime = 20
7159
+ }) => {
7160
+ const containerRef = useRef(null);
7161
+ const scrollInterval = useRef(null);
7162
+ const [containerHeight, setContainerHeight] = useState(0);
7163
+ const [containerRight, setContainerRight] = useState(0);
7164
+ const [containerTop, setContainerTop] = useState(0);
7165
+ const [containerLeft, setContainerLeft] = useState(0);
7166
+ const [showRightIndicator, setShowRightIndicator] = useState(false);
7167
+ const [showLeftIndicator, setShowLeftIndicator] = useState(false);
6887
7168
  useEffect(() => {
6888
- if (messages.length === 0 || currentThreadId !== threadId) {
6889
- if (initialMessages && threadId && memory) {
6890
- setMessages(initialMessages);
6891
- setCurrentThreadId(threadId);
7169
+ const updatePositions = () => {
7170
+ if (!containerRef.current) return;
7171
+ const canScrollRight = containerRef.current.scrollLeft < containerRef.current.scrollWidth - containerRef.current.clientWidth;
7172
+ setShowRightIndicator(canScrollRight);
7173
+ setContainerHeight(containerRef.current.clientHeight);
7174
+ const rect = containerRef.current.getBoundingClientRect();
7175
+ setContainerRight(rect.right);
7176
+ setContainerLeft(rect.left);
7177
+ setContainerTop(rect.top);
7178
+ };
7179
+ updatePositions();
7180
+ const resizeObserver = new ResizeObserver(updatePositions);
7181
+ if (containerRef.current) {
7182
+ resizeObserver.observe(containerRef.current);
7183
+ }
7184
+ const handleScroll = () => {
7185
+ if (!containerRef.current) return;
7186
+ const canScrollLeft = containerRef.current.scrollLeft > 0;
7187
+ const canScrollRight = containerRef.current.scrollLeft < containerRef.current.scrollWidth - containerRef.current.clientWidth;
7188
+ setShowLeftIndicator(canScrollLeft);
7189
+ setShowRightIndicator(canScrollRight);
7190
+ updatePositions();
7191
+ };
7192
+ containerRef?.current?.addEventListener("scroll", handleScroll);
7193
+ const container = containerRef.current;
7194
+ return () => {
7195
+ if (container) {
7196
+ resizeObserver.unobserve(container);
7197
+ container.removeEventListener("scroll", handleScroll);
6892
7198
  }
6893
- }
6894
- }, [initialMessages, threadId, memory, messages]);
6895
- const mastra = useMastraClient();
6896
- const network = mastra.getNetwork(agentId);
6897
- const onNew = async (message) => {
6898
- if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
6899
- const input = message.content[0].text;
6900
- setMessages((currentConversation) => [...currentConversation, { role: "user", content: input }]);
6901
- setIsRunning(true);
6902
- try {
6903
- let updater = function() {
6904
- setMessages((currentConversation) => {
6905
- const message2 = {
6906
- role: "assistant",
6907
- content: [{ type: "text", text: content }]
6908
- };
6909
- if (!assistantMessageAdded) {
6910
- assistantMessageAdded = true;
6911
- return [...currentConversation, message2];
6912
- }
6913
- return [...currentConversation.slice(0, -1), message2];
7199
+ };
7200
+ }, []);
7201
+ const ScrollIndicator = ({
7202
+ isVisible,
7203
+ position,
7204
+ containerHeight: containerHeight2,
7205
+ containerTop: containerTop2,
7206
+ containerRight: containerRight2,
7207
+ onStartScrolling,
7208
+ onStopScrolling
7209
+ }) => {
7210
+ if (!isVisible) return null;
7211
+ const styles = {
7212
+ top: containerHeight2 < INDICATOR_HEIGHT ? containerTop2 : containerTop2 + (containerHeight2 - INDICATOR_HEIGHT) / 2,
7213
+ width: INDICATOR_WIDTH,
7214
+ height: containerHeight2 < INDICATOR_HEIGHT ? `${containerHeight2}px` : `${INDICATOR_HEIGHT}px`
7215
+ };
7216
+ return /* @__PURE__ */ jsxs(
7217
+ "button",
7218
+ {
7219
+ onMouseDown: onStartScrolling,
7220
+ onTouchStart: onStartScrolling,
7221
+ onMouseUp: onStopScrolling,
7222
+ onTouchEnd: onStopScrolling,
7223
+ onTouchCancel: onStopScrolling,
7224
+ className: "bg-surface4 text-muted-foreground border-surface5 hover:border-muted-foreground fixed z-10 flex items-center justify-center rounded-lg border text-2xl hover:text-white",
7225
+ style: {
7226
+ ...styles,
7227
+ left: position === "left" ? containerLeft + INDICATOR_SPACE : containerRight2 - INDICATOR_WIDTH - INDICATOR_SPACE
7228
+ },
7229
+ children: [
7230
+ " ",
7231
+ position === "left" ? "«" : "»"
7232
+ ]
7233
+ }
7234
+ );
7235
+ };
7236
+ const startScrolling = useCallback(
7237
+ (direction, e) => {
7238
+ e?.preventDefault();
7239
+ e?.stopPropagation();
7240
+ if (scrollInterval.current) {
7241
+ clearInterval(scrollInterval.current);
7242
+ scrollInterval.current = null;
7243
+ }
7244
+ if (containerRef.current) {
7245
+ containerRef.current.scrollBy({
7246
+ left: direction === "right" ? scrollSpeed * 2 : -scrollSpeed * 2,
7247
+ behavior: "smooth"
6914
7248
  });
6915
- };
6916
- const response = await network.stream({
6917
- messages: [
6918
- {
6919
- role: "user",
6920
- content: input
6921
- }
6922
- ],
6923
- runId: agentId,
6924
- frequencyPenalty,
6925
- presencePenalty,
6926
- maxRetries,
6927
- maxSteps,
6928
- maxTokens,
6929
- temperature,
6930
- topK,
6931
- topP,
6932
- instructions,
6933
- ...memory ? { threadId, resourceId: agentId } : {}
6934
- });
6935
- if (!response.body) {
6936
- throw new Error("No response body");
6937
7249
  }
6938
- const parts = [];
6939
- let content = "";
6940
- let currentTextPart = null;
6941
- let assistantMessageAdded = false;
6942
- await processDataStream({
6943
- stream: response.body,
6944
- onTextPart(value) {
6945
- if (currentTextPart == null) {
6946
- currentTextPart = {
6947
- type: "text",
6948
- text: value
6949
- };
6950
- parts.push(currentTextPart);
6951
- } else {
6952
- currentTextPart.text += value;
6953
- }
6954
- content += value;
6955
- updater();
6956
- },
6957
- async onToolCallPart(value) {
6958
- console.log("Tool call received:", value);
7250
+ scrollInterval.current = setInterval(() => {
7251
+ if (containerRef.current) {
7252
+ containerRef.current.scrollBy({
7253
+ left: direction === "right" ? scrollSpeed : -scrollSpeed,
7254
+ behavior: "smooth"
7255
+ });
7256
+ }
7257
+ }, scrollIntervalTime);
7258
+ },
7259
+ [scrollSpeed, scrollIntervalTime]
7260
+ );
7261
+ const stopScrolling = useCallback(() => {
7262
+ if (scrollInterval.current) {
7263
+ clearInterval(scrollInterval.current);
7264
+ scrollInterval.current = null;
7265
+ }
7266
+ }, []);
7267
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: clsx("relative max-h-full overflow-auto", className), children: [
7268
+ children,
7269
+ /* @__PURE__ */ jsx(
7270
+ ScrollIndicator,
7271
+ {
7272
+ isVisible: showLeftIndicator,
7273
+ position: "left",
7274
+ containerHeight,
7275
+ containerTop,
7276
+ containerRight,
7277
+ onStartScrolling: (e) => startScrolling("left", e),
7278
+ onStopScrolling: stopScrolling
7279
+ }
7280
+ ),
7281
+ /* @__PURE__ */ jsx(
7282
+ ScrollIndicator,
7283
+ {
7284
+ isVisible: showRightIndicator,
7285
+ position: "right",
7286
+ containerHeight,
7287
+ containerTop,
7288
+ containerRight,
7289
+ onStartScrolling: (e) => startScrolling("right", e),
7290
+ onStopScrolling: stopScrolling
7291
+ }
7292
+ )
7293
+ ] });
7294
+ };
7295
+
7296
+ function Skeleton({ className, ...props }) {
7297
+ return /* @__PURE__ */ jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
7298
+ }
7299
+
7300
+ const OpenaiChatIcon = (props) => /* @__PURE__ */ jsx("svg", { className: "h-3 w-3", viewBox: "0 0 320 320", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", ...props, children: /* @__PURE__ */ jsx("path", { d: "m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z" }) });
7301
+
7302
+ const AnthropicChatIcon = (props) => /* @__PURE__ */ jsx("svg", { className: "h-3 w-3", viewBox: "0 0 320 320", xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", ...props, children: /* @__PURE__ */ jsx("path", { d: "m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z" }) });
7303
+
7304
+ const AnthropicMessagesIcon = (props) => /* @__PURE__ */ jsx(
7305
+ "svg",
7306
+ {
7307
+ className: "h-3 w-3",
7308
+ fill: "white",
7309
+ height: "78",
7310
+ strokeLinejoin: "round",
7311
+ viewBox: "0 0 16 16",
7312
+ width: "78",
7313
+ style: { color: "currentcolor" },
7314
+ ...props,
7315
+ children: /* @__PURE__ */ jsx("g", { transform: "translate(0,2)", children: /* @__PURE__ */ jsx(
7316
+ "path",
7317
+ {
7318
+ d: "M11.375 0h-2.411L13.352 11.13h2.411L11.375 0ZM4.4 0 0 11.13h2.46l0.9-2.336h4.604l0.9 2.336h2.46L6.924 0H4.4Zm-0.244 6.723 1.506-3.909 1.506 3.909H4.156Z",
7319
+ fill: "currentColor"
7320
+ }
7321
+ ) })
7322
+ }
7323
+ );
7324
+
7325
+ const AzureIcon = (props) => /* @__PURE__ */ jsx(
7326
+ "svg",
7327
+ {
7328
+ className: "h-3 w-3",
7329
+ xmlns: "http://www.w3.org/2000/svg",
7330
+ width: "16",
7331
+ height: "16",
7332
+ viewBox: "0 0 16 16",
7333
+ fill: "none",
7334
+ ...props,
7335
+ children: /* @__PURE__ */ jsx(
7336
+ "path",
7337
+ {
7338
+ d: "M7.402 13.8777C9.45763 13.4674 11.1555 13.128 11.175 13.1233L11.2104 13.1148L9.2697 10.507C8.2023 9.07276 7.32898 7.8937 7.32898 7.88691C7.32898 7.87404 9.33293 1.63997 9.3442 1.61779C9.34797 1.61037 10.7117 4.27017 12.65 8.06532C14.4647 11.6184 15.9608 14.5479 15.9747 14.5754L16 14.6253L9.83224 14.6244L3.66449 14.6235L7.402 13.8777ZM0 13.0824C0 13.0787 0.914457 11.2855 2.03212 9.09735L4.06425 5.11896L6.43245 2.87384C7.73497 1.63902 8.80417 0.627201 8.80845 0.625356C8.81274 0.623511 8.79561 0.672228 8.77038 0.733617C8.74515 0.795006 7.58796 3.59893 6.19884 6.96455L3.67317 13.0839L1.83659 13.0865C0.826464 13.0879 0 13.0861 0 13.0824Z",
7339
+ fill: "#0089D6",
7340
+ style: { fill: "#0089D6", fillOpacity: 1 }
7341
+ }
7342
+ )
7343
+ }
7344
+ );
7345
+
7346
+ const AmazonIcon = (props) => /* @__PURE__ */ jsxs(
7347
+ "svg",
7348
+ {
7349
+ className: "h-3 w-3",
7350
+ width: "16",
7351
+ height: "16",
7352
+ viewBox: "0 0 181 108",
7353
+ fill: "none",
7354
+ xmlns: "http://www.w3.org/2000/svg",
7355
+ ...props,
7356
+ children: [
7357
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_1480_1723)", children: [
7358
+ /* @__PURE__ */ jsx(
7359
+ "path",
7360
+ {
7361
+ d: "M51.2203 39.3158C51.2203 41.5066 51.4572 43.2829 51.8717 44.5856C52.3453 45.8882 52.9374 47.3093 53.7664 48.8487C54.0624 49.3224 54.1809 49.7961 54.1809 50.2106C54.1809 50.8027 53.8256 51.3948 53.0559 51.9869L49.3256 54.4737C48.7927 54.829 48.2598 55.0066 47.7861 55.0066C47.194 55.0066 46.6019 54.7106 46.0098 54.1777C45.1809 53.2895 44.4703 52.3422 43.8782 51.3948C43.2861 50.3882 42.694 49.2632 42.0427 47.9014C37.4243 53.3487 31.6217 56.0724 24.6348 56.0724C19.6611 56.0724 15.694 54.6514 12.7927 51.8093C9.8914 48.9672 8.41113 45.1777 8.41113 40.4408C8.41113 35.4079 10.1874 31.3224 13.7993 28.2435C17.4111 25.1645 22.2072 23.6251 28.3059 23.6251C30.319 23.6251 32.3914 23.8027 34.5822 24.0987C36.773 24.3948 39.023 24.8685 41.3914 25.4014V21.079C41.3914 16.579 40.444 13.4408 38.6085 11.6053C36.7138 9.76979 33.5164 8.88163 28.9572 8.88163C26.8848 8.88163 24.7532 9.11847 22.5624 9.65137C20.3717 10.1843 18.2401 10.8356 16.1677 11.6645C15.2203 12.079 14.5098 12.3158 14.0953 12.4343C13.6809 12.5527 13.3848 12.6119 13.148 12.6119C12.319 12.6119 11.9046 12.0198 11.9046 10.7764V7.87505C11.9046 6.92768 12.023 6.21716 12.319 5.80268C12.6151 5.38821 13.148 4.97374 13.9769 4.55926C16.0493 3.49347 18.5361 2.60531 21.4374 1.89479C24.3388 1.12505 27.4177 0.769788 30.6743 0.769788C37.7203 0.769788 42.8717 2.36847 46.1875 5.56584C49.444 8.76321 51.1019 13.6185 51.1019 20.1316V39.3158H51.2203ZM27.1809 48.3158C29.1348 48.3158 31.148 47.9606 33.2796 47.2501C35.4111 46.5395 37.3059 45.2369 38.9046 43.4606C39.8519 42.3356 40.5625 41.0922 40.9177 39.6711C41.273 38.2501 41.5098 36.5329 41.5098 34.5198V32.0329C39.7927 31.6185 37.9572 31.2632 36.0624 31.0264C34.1677 30.7895 32.3322 30.6711 30.4967 30.6711C26.5296 30.6711 23.6282 31.4408 21.6743 33.0395C19.7203 34.6382 18.773 36.8882 18.773 39.8487C18.773 42.6316 19.4835 44.704 20.9638 46.1251C22.3848 47.6053 24.4572 48.3158 27.1809 48.3158ZM74.7269 54.7106C73.6611 54.7106 72.9506 54.5329 72.4769 54.1185C72.0032 53.7632 71.5888 52.9343 71.2335 51.8093L57.319 6.03953C56.9638 4.85531 56.7861 4.08558 56.7861 3.6711C56.7861 2.72374 57.2598 2.19084 58.2072 2.19084H64.0098C65.1348 2.19084 65.9046 2.36847 66.319 2.78295C66.7927 3.13821 67.148 3.96716 67.5032 5.09216L77.4506 44.2895L86.6874 5.09216C86.9835 3.90795 87.3388 3.13821 87.8124 2.78295C88.2861 2.42768 89.1151 2.19084 90.1809 2.19084H94.9177C96.0427 2.19084 96.8124 2.36847 97.2861 2.78295C97.7598 3.13821 98.1743 3.96716 98.4111 5.09216L107.766 44.7632L118.01 5.09216C118.365 3.90795 118.78 3.13821 119.194 2.78295C119.668 2.42768 120.437 2.19084 121.503 2.19084H127.01C127.957 2.19084 128.49 2.66453 128.49 3.6711C128.49 3.96716 128.431 4.26321 128.372 4.61847C128.312 4.97374 128.194 5.44742 127.957 6.09874L113.687 51.8685C113.332 53.0527 112.918 53.8224 112.444 54.1777C111.97 54.5329 111.201 54.7698 110.194 54.7698H105.102C103.977 54.7698 103.207 54.5922 102.733 54.1777C102.26 53.7632 101.845 52.9935 101.608 51.8093L92.4309 13.6185L83.3125 51.7501C83.0164 52.9343 82.6611 53.704 82.1874 54.1185C81.7138 54.5329 80.8848 54.7106 79.819 54.7106H74.7269ZM150.812 56.3093C147.734 56.3093 144.655 55.954 141.694 55.2435C138.733 54.5329 136.424 53.7632 134.885 52.8751C133.937 52.3422 133.286 51.7501 133.049 51.2172C132.812 50.6843 132.694 50.0922 132.694 49.5593V46.5395C132.694 45.2961 133.168 44.704 134.056 44.704C134.411 44.704 134.766 44.7632 135.122 44.8816C135.477 45.0001 136.01 45.2369 136.602 45.4737C138.615 46.3619 140.806 47.0724 143.115 47.5461C145.484 48.0198 147.793 48.2566 150.161 48.2566C153.891 48.2566 156.793 47.6053 158.806 46.3027C160.819 45 161.885 43.1053 161.885 40.6777C161.885 39.0198 161.352 37.6579 160.286 36.5329C159.22 35.4079 157.207 34.4014 154.306 33.454L145.72 30.7895C141.398 29.4277 138.201 27.4145 136.247 24.7501C134.293 22.1448 133.286 19.2435 133.286 16.1645C133.286 13.6777 133.819 11.4869 134.885 9.59216C135.951 7.69742 137.372 6.03953 139.148 4.73689C140.924 3.37505 142.937 2.36847 145.306 1.65795C147.674 0.94742 150.161 0.651367 152.766 0.651367C154.069 0.651367 155.431 0.710578 156.734 0.888209C158.095 1.06584 159.339 1.30268 160.582 1.53953C161.766 1.83558 162.891 2.13163 163.957 2.48689C165.023 2.84216 165.852 3.19742 166.444 3.55268C167.273 4.02637 167.865 4.50005 168.22 5.03295C168.576 5.50663 168.753 6.15795 168.753 6.98689V9.76979C168.753 11.0132 168.28 11.6645 167.391 11.6645C166.918 11.6645 166.148 11.4277 165.141 10.954C161.766 9.41453 157.977 8.64479 153.773 8.64479C150.398 8.64479 147.734 9.17768 145.898 10.3027C144.062 11.4277 143.115 13.1448 143.115 15.5724C143.115 17.2303 143.707 18.6514 144.891 19.7764C146.076 20.9014 148.266 22.0264 151.405 23.0329L159.812 25.6974C164.076 27.0593 167.155 28.954 168.99 31.3816C170.826 33.8093 171.714 36.5922 171.714 39.6711C171.714 42.2172 171.181 44.5264 170.174 46.5395C169.108 48.5527 167.687 50.329 165.852 51.7501C164.016 53.2303 161.826 54.2961 159.28 55.0658C156.615 55.8948 153.832 56.3093 150.812 56.3093Z",
7362
+ fill: "currentColor"
7363
+ }
7364
+ ),
7365
+ /* @__PURE__ */ jsx(
7366
+ "path",
7367
+ {
7368
+ fillRule: "evenodd",
7369
+ clipRule: "evenodd",
7370
+ d: "M162.004 85.0856C142.524 99.4738 114.221 107.112 89.8855 107.112C55.7803 107.112 25.05 94.5001 1.83948 73.5396C0.00394917 71.8817 1.66184 69.6317 3.85263 70.9343C28.9579 85.5001 59.925 94.3225 91.9579 94.3225C113.57 94.3225 137.313 89.8225 159.162 80.5856C162.418 79.1054 165.201 82.7172 162.004 85.0856Z",
7371
+ fill: "#FF9900"
7372
+ }
7373
+ ),
7374
+ /* @__PURE__ */ jsx(
7375
+ "path",
7376
+ {
7377
+ fillRule: "evenodd",
7378
+ clipRule: "evenodd",
7379
+ d: "M170.115 75.8487C167.628 72.6513 153.654 74.3092 147.319 75.079C145.424 75.3158 145.128 73.6579 146.845 72.4145C157.976 64.5987 176.272 66.8487 178.404 69.454C180.536 72.1184 177.812 90.4145 167.391 99.1776C165.792 100.539 164.253 99.8289 164.963 98.0526C167.332 92.1908 172.601 78.9868 170.115 75.8487Z",
7380
+ fill: "#FF9900"
7381
+ }
7382
+ )
7383
+ ] }),
7384
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_1480_1723", children: /* @__PURE__ */ jsx("rect", { width: "180", height: "107.763", fill: "white", transform: "translate(0.0625)" }) }) })
7385
+ ]
7386
+ }
7387
+ );
7388
+
7389
+ const CohereIcon = (props) => /* @__PURE__ */ jsxs("svg", { className: "h-3 w-3", xmlns: "http://www.w3.org/2000/svg", width: "17", height: "18", fill: "none", ...props, children: [
7390
+ /* @__PURE__ */ jsx("mask", { id: "mask0_174_2406", maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "17", height: "18", children: /* @__PURE__ */ jsx("path", { d: "M17 0.5H0V17.5H17V0.5Z", fill: "white" }) }),
7391
+ /* @__PURE__ */ jsxs("g", { mask: "url(#mask0_174_2406)", children: [
7392
+ /* @__PURE__ */ jsx(
7393
+ "path",
7394
+ {
7395
+ fillRule: "evenodd",
7396
+ clipRule: "evenodd",
7397
+ d: "M5.50773 10.6219C5.9653 10.6219 6.8755 10.5968 8.13362 10.0788C9.59973 9.47518 12.5166 8.37942 14.6208 7.2539C16.0924 6.46668 16.7375 5.42553 16.7375 4.02344C16.7375 2.07751 15.16 0.5 13.2141 0.5H5.06095C2.26586 0.5 0 2.76586 0 5.56095C0 8.35604 2.12151 10.6219 5.50773 10.6219Z",
7398
+ fill: "#39594D"
7399
+ }
7400
+ ),
7401
+ /* @__PURE__ */ jsx(
7402
+ "path",
7403
+ {
7404
+ fillRule: "evenodd",
7405
+ clipRule: "evenodd",
7406
+ d: "M6.88672 14.107C6.88672 12.7369 7.71155 11.5016 8.97699 10.9764L11.5446 9.9108C14.1417 8.83294 17.0003 10.7415 17.0003 13.5535C17.0003 15.732 15.2339 17.4979 13.0553 17.4973L10.2754 17.4966C8.40372 17.4961 6.88672 15.9787 6.88672 14.107Z",
7407
+ fill: "#D18EE2"
7408
+ }
7409
+ ),
7410
+ /* @__PURE__ */ jsx(
7411
+ "path",
7412
+ {
7413
+ d: "M2.91749 11.2891C1.30623 11.2891 0 12.5952 0 14.2065V14.5844C0 16.1956 1.30618 17.5018 2.91744 17.5018C4.5287 17.5018 5.83493 16.1956 5.83493 14.5844V14.2065C5.83493 12.5952 4.52875 11.2891 2.91749 11.2891Z",
7414
+ fill: "#FF7759"
7415
+ }
7416
+ )
7417
+ ] })
7418
+ ] });
7419
+
7420
+ const GroqIcon = (props) => /* @__PURE__ */ jsxs(
7421
+ "svg",
7422
+ {
7423
+ className: "h-3 w-3",
7424
+ "data-testid": "geist-icon",
7425
+ height: "78",
7426
+ strokeLinejoin: "round",
7427
+ viewBox: "0 0 160 59",
7428
+ width: "104",
7429
+ style: {
7430
+ color: "currentcolor"
7431
+ },
7432
+ ...props,
7433
+ children: [
7434
+ /* @__PURE__ */ jsx(
7435
+ "mask",
7436
+ {
7437
+ id: "mask0_4345_1846",
7438
+ maskUnits: "userSpaceOnUse",
7439
+ x: "0",
7440
+ y: "0",
7441
+ width: "160",
7442
+ height: "59",
7443
+ style: {
7444
+ maskType: "luminance"
7445
+ },
7446
+ children: /* @__PURE__ */ jsx("path", { d: "M0.273438 0.219727H159.216V58.1817H0.273438V0.219727Z", fill: "white" })
7447
+ }
7448
+ ),
7449
+ /* @__PURE__ */ jsx("g", { mask: "url(#mask0_4345_1846)", children: /* @__PURE__ */ jsx(
7450
+ "path",
7451
+ {
7452
+ d: "M95.4635 0.314595C84.4822 0.314595 75.5599 9.19525 75.5599 20.1677C75.5599 31.1402 84.4632 40.0208 95.4635 40.0208C106.464 40.0208 115.367 31.1402 115.367 20.1677C115.348 9.21427 106.445 0.333611 95.4635 0.314595ZM95.4635 32.5664C88.6002 32.5664 83.0333 27.0136 83.0333 20.1677C83.0333 13.3218 88.6002 7.76902 95.4635 7.76902C102.327 7.76902 107.894 13.3218 107.894 20.1677C107.894 27.0136 102.327 32.5664 95.4635 32.5664ZM67.9912 0.39066C67.3049 0.314595 66.6376 0.276562 65.9513 0.276562C65.6081 0.276562 65.284 0.276562 64.9599 0.295578C64.6358 0.314595 64.2926 0.333611 63.9685 0.352628C62.634 0.44771 61.2995 0.675906 60.0031 1.03722C57.3531 1.74082 54.8556 2.99591 52.7013 4.68836C50.4898 6.43787 48.7358 8.68181 47.5347 11.23C46.9437 12.5041 46.5052 13.8543 46.2193 15.2234C46.0858 15.908 45.9905 16.5926 45.9142 17.2772C45.8952 17.6195 45.857 17.9618 45.857 18.3041L45.838 18.8175V19.293L45.8761 32.5854L45.9142 39.2221H53.3685L53.4067 32.5854L53.4448 19.293V18.5893C53.4448 18.3802 53.4829 18.171 53.4829 17.9618C53.5211 17.5434 53.5973 17.1441 53.6736 16.7257C53.8452 15.9271 54.093 15.1474 54.4362 14.4057C55.1225 12.9225 56.152 11.6293 57.4293 10.6025C58.7639 9.53755 60.3081 8.75787 61.9477 8.3205C62.7865 8.0923 63.6635 7.94017 64.5405 7.8641C64.7693 7.84509 64.979 7.82607 65.2078 7.82607C65.4365 7.82607 65.6653 7.80705 65.875 7.80705C66.2944 7.80705 66.7329 7.82607 67.1524 7.8641C68.8491 8.03525 70.4887 8.54869 71.9948 9.38541L75.7124 2.93886C73.3484 1.56968 70.7175 0.694923 67.9912 0.39066ZM20.3484 0.219513C9.36711 0.124431 0.36855 8.92902 0.273226 19.8825C0.177902 30.8359 9.00488 39.8116 19.9862 39.9067H26.8876V32.4713H20.3484C13.4851 32.5474 7.84193 27.0707 7.76567 20.2057C7.68941 13.3408 13.1801 7.73099 20.0624 7.65492H20.3484C27.2117 7.65492 32.7786 13.2077 32.8167 20.0536V38.3284C32.8167 45.1172 27.2689 50.651 20.4819 50.7271C17.2218 50.708 14.1142 49.3959 11.8265 47.0949L6.54553 52.3625C10.206 56.0326 15.1628 58.1244 20.3484 58.1625H20.6153C31.4632 58.0103 40.1757 49.2248 40.2329 38.4044V19.5592C39.966 8.81492 31.1391 0.238529 20.3484 0.219513ZM139.389 0.314595C128.407 0.314595 119.485 9.19525 119.504 20.1677C119.504 31.1212 128.407 40.0018 139.389 40.0018H146.195V32.5664H139.389C132.525 32.5664 126.958 27.0136 126.958 20.1677C126.958 13.3218 132.525 7.76902 139.389 7.76902C145.833 7.76902 151.209 12.6943 151.781 19.1028H151.762V57.2116H159.216V20.1677C159.216 9.21427 150.351 0.314595 139.389 0.314595Z",
7453
+ fill: "currentColor"
7454
+ }
7455
+ ) })
7456
+ ]
7457
+ }
7458
+ );
7459
+
7460
+ const XGroqIcon = (props) => /* @__PURE__ */ jsx(
7461
+ "svg",
7462
+ {
7463
+ className: "h-3 w-3",
7464
+ xmlns: "http://www.w3.org/2000/svg",
7465
+ viewBox: "0 0 1000 1000",
7466
+ width: "78",
7467
+ height: "78",
7468
+ style: {
7469
+ color: "currentcolor"
7470
+ },
7471
+ ...props,
7472
+ children: /* @__PURE__ */ jsxs("g", { children: [
7473
+ /* @__PURE__ */ jsx(
7474
+ "polygon",
7475
+ {
7476
+ fill: "currentColor",
7477
+ points: "226.83 411.15 501.31 803.15 623.31 803.15 348.82 411.15 226.83 411.15"
7478
+ }
7479
+ ),
7480
+ /* @__PURE__ */ jsx(
7481
+ "polygon",
7482
+ {
7483
+ fill: "currentColor",
7484
+ points: "348.72 628.87 226.69 803.15 348.77 803.15 409.76 716.05 348.72 628.87"
7485
+ }
7486
+ ),
7487
+ /* @__PURE__ */ jsx(
7488
+ "polygon",
7489
+ {
7490
+ fill: "currentColor",
7491
+ points: "651.23 196.85 440.28 498.12 501.32 585.29 773.31 196.85 651.23 196.85"
7492
+ }
7493
+ ),
7494
+ /* @__PURE__ */ jsx(
7495
+ "polygon",
7496
+ {
7497
+ fill: "currentColor",
7498
+ points: "673.31 383.25 673.31 803.15 773.31 803.15 773.31 240.44 673.31 383.25"
7499
+ }
7500
+ )
7501
+ ] })
7502
+ }
7503
+ );
7504
+
7505
+ const MistralIcon = (props) => /* @__PURE__ */ jsxs(
7506
+ "svg",
7507
+ {
7508
+ className: "h-3 w-3",
7509
+ xmlns: "http://www.w3.org/2000/svg",
7510
+ width: "176",
7511
+ height: "162",
7512
+ viewBox: "0 0 176 162",
7513
+ fill: "none",
7514
+ ...props,
7515
+ children: [
7516
+ /* @__PURE__ */ jsx("rect", { x: "15", y: "1", width: "32", height: "32", fill: "#FFCD00", stroke: "#636363", "stroke-opacity": "0.2", "stroke-width": "0.5" }),
7517
+ /* @__PURE__ */ jsx(
7518
+ "rect",
7519
+ {
7520
+ x: "143",
7521
+ y: "1",
7522
+ width: "32",
7523
+ height: "32",
7524
+ fill: "#FFCD00",
7525
+ stroke: "#636363",
7526
+ "stroke-opacity": "0.2",
7527
+ "stroke-width": "0.5"
7528
+ }
7529
+ ),
7530
+ /* @__PURE__ */ jsx(
7531
+ "rect",
7532
+ {
7533
+ x: "15",
7534
+ y: "33",
7535
+ width: "32",
7536
+ height: "32",
7537
+ fill: "#FFA400",
7538
+ stroke: "#636363",
7539
+ "stroke-opacity": "0.2",
7540
+ "stroke-width": "0.5"
7541
+ }
7542
+ ),
7543
+ /* @__PURE__ */ jsx(
7544
+ "rect",
7545
+ {
7546
+ x: "47",
7547
+ y: "33",
7548
+ width: "32",
7549
+ height: "32",
7550
+ fill: "#FFA400",
7551
+ stroke: "#636363",
7552
+ "stroke-opacity": "0.2",
7553
+ "stroke-width": "0.5"
7554
+ }
7555
+ ),
7556
+ /* @__PURE__ */ jsx(
7557
+ "rect",
7558
+ {
7559
+ x: "111",
7560
+ y: "33",
7561
+ width: "32",
7562
+ height: "32",
7563
+ fill: "#FFA400",
7564
+ stroke: "#636363",
7565
+ "stroke-opacity": "0.2",
7566
+ "stroke-width": "0.5"
7567
+ }
7568
+ ),
7569
+ /* @__PURE__ */ jsx(
7570
+ "rect",
7571
+ {
7572
+ x: "143",
7573
+ y: "33",
7574
+ width: "32",
7575
+ height: "32",
7576
+ fill: "#FFA400",
7577
+ stroke: "#636363",
7578
+ "stroke-opacity": "0.2",
7579
+ "stroke-width": "0.5"
7580
+ }
7581
+ ),
7582
+ /* @__PURE__ */ jsx(
7583
+ "rect",
7584
+ {
7585
+ x: "15",
7586
+ y: "65",
7587
+ width: "32",
7588
+ height: "32",
7589
+ fill: "#FF7100",
7590
+ stroke: "#636363",
7591
+ "stroke-opacity": "0.2",
7592
+ "stroke-width": "0.5"
7593
+ }
7594
+ ),
7595
+ /* @__PURE__ */ jsx(
7596
+ "rect",
7597
+ {
7598
+ x: "47",
7599
+ y: "65",
7600
+ width: "32",
7601
+ height: "32",
7602
+ fill: "#FF7100",
7603
+ stroke: "#636363",
7604
+ "stroke-opacity": "0.2",
7605
+ "stroke-width": "0.5"
7606
+ }
7607
+ ),
7608
+ /* @__PURE__ */ jsx(
7609
+ "rect",
7610
+ {
7611
+ x: "79",
7612
+ y: "65",
7613
+ width: "32",
7614
+ height: "32",
7615
+ fill: "#FF7100",
7616
+ stroke: "#636363",
7617
+ "stroke-opacity": "0.2",
7618
+ "stroke-width": "0.5"
7619
+ }
7620
+ ),
7621
+ /* @__PURE__ */ jsx(
7622
+ "rect",
7623
+ {
7624
+ x: "111",
7625
+ y: "65",
7626
+ width: "32",
7627
+ height: "32",
7628
+ fill: "#FF7100",
7629
+ stroke: "#636363",
7630
+ "stroke-opacity": "0.2",
7631
+ "stroke-width": "0.5"
7632
+ }
7633
+ ),
7634
+ /* @__PURE__ */ jsx(
7635
+ "rect",
7636
+ {
7637
+ x: "143",
7638
+ y: "65",
7639
+ width: "32",
7640
+ height: "32",
7641
+ fill: "#FF7100",
7642
+ stroke: "#636363",
7643
+ "stroke-opacity": "0.2",
7644
+ "stroke-width": "0.5"
7645
+ }
7646
+ ),
7647
+ /* @__PURE__ */ jsx(
7648
+ "rect",
7649
+ {
7650
+ x: "15",
7651
+ y: "97",
7652
+ width: "32",
7653
+ height: "32",
7654
+ fill: "#FF4902",
7655
+ stroke: "#636363",
7656
+ "stroke-opacity": "0.2",
7657
+ "stroke-width": "0.5"
7658
+ }
7659
+ ),
7660
+ /* @__PURE__ */ jsx(
7661
+ "rect",
7662
+ {
7663
+ x: "79",
7664
+ y: "97",
7665
+ width: "32",
7666
+ height: "32",
7667
+ fill: "#FF4902",
7668
+ stroke: "#636363",
7669
+ "stroke-opacity": "0.2",
7670
+ "stroke-width": "0.5"
7671
+ }
7672
+ ),
7673
+ /* @__PURE__ */ jsx(
7674
+ "rect",
7675
+ {
7676
+ x: "143",
7677
+ y: "97",
7678
+ width: "32",
7679
+ height: "32",
7680
+ fill: "#FF4902",
7681
+ stroke: "#636363",
7682
+ "stroke-opacity": "0.2",
7683
+ "stroke-width": "0.5"
7684
+ }
7685
+ ),
7686
+ /* @__PURE__ */ jsx(
7687
+ "rect",
7688
+ {
7689
+ x: "15",
7690
+ y: "129",
7691
+ width: "32",
7692
+ height: "32",
7693
+ fill: "#FF0006",
7694
+ stroke: "#636363",
7695
+ "stroke-opacity": "0.2",
7696
+ "stroke-width": "0.5"
7697
+ }
7698
+ ),
7699
+ /* @__PURE__ */ jsx(
7700
+ "rect",
7701
+ {
7702
+ x: "143",
7703
+ y: "129",
7704
+ width: "32",
7705
+ height: "32",
7706
+ fill: "#FF0006",
7707
+ stroke: "#636363",
7708
+ "stroke-opacity": "0.2",
7709
+ "stroke-width": "0.5"
7710
+ }
7711
+ ),
7712
+ /* @__PURE__ */ jsx("rect", { y: "1", width: "16", height: "160", fill: "black" }),
7713
+ /* @__PURE__ */ jsx("rect", { x: "63", y: "97", width: "16", height: "32", fill: "black" }),
7714
+ /* @__PURE__ */ jsx("rect", { x: "95", y: "33", width: "16", height: "32", fill: "black" }),
7715
+ /* @__PURE__ */ jsx("rect", { x: "127", y: "1", width: "16", height: "32", fill: "black" }),
7716
+ /* @__PURE__ */ jsx("rect", { x: "127", y: "97", width: "16", height: "64", fill: "black" })
7717
+ ]
7718
+ }
7719
+ );
7720
+
7721
+ const LinkComponentContext = createContext({
7722
+ Link: forwardRef(() => null)
7723
+ });
7724
+ const LinkComponentProvider = ({ children, Link }) => {
7725
+ return /* @__PURE__ */ jsx(LinkComponentContext.Provider, { value: { Link }, children });
7726
+ };
7727
+ const useLinkComponent = () => {
7728
+ const ctx = useContext(LinkComponentContext);
7729
+ if (!ctx) {
7730
+ throw new Error("useLinkComponent must be used within a LinkComponentProvider");
7731
+ }
7732
+ return ctx;
7733
+ };
7734
+
7735
+ const providerMapToIcon = {
7736
+ "openai.chat": /* @__PURE__ */ jsx(OpenaiChatIcon, {}),
7737
+ "anthropic.chat": /* @__PURE__ */ jsx(AnthropicChatIcon, {}),
7738
+ "anthropic.messages": /* @__PURE__ */ jsx(AnthropicMessagesIcon, {}),
7739
+ AZURE: /* @__PURE__ */ jsx(AzureIcon, {}),
7740
+ AMAZON: /* @__PURE__ */ jsx(AmazonIcon, {}),
7741
+ GOOGLE: /* @__PURE__ */ jsx(GoogleIcon, {}),
7742
+ COHERE: /* @__PURE__ */ jsx(CohereIcon, {}),
7743
+ GROQ: /* @__PURE__ */ jsx(GroqIcon, {}),
7744
+ X_GROK: /* @__PURE__ */ jsx(XGroqIcon, {}),
7745
+ MISTRAL: /* @__PURE__ */ jsx(MistralIcon, {})
7746
+ };
7747
+ const NameCell = ({ row }) => {
7748
+ const { Link } = useLinkComponent();
7749
+ return /* @__PURE__ */ jsx(
7750
+ EntryCell,
7751
+ {
7752
+ icon: /* @__PURE__ */ jsx(AgentIcon, {}),
7753
+ name: /* @__PURE__ */ jsx(Link, { className: "w-full space-y-0", href: row.original.link, children: row.original.name }),
7754
+ description: row.original.instructions
7755
+ }
7756
+ );
7757
+ };
7758
+ const columns$2 = [
7759
+ {
7760
+ header: "Name",
7761
+ accessorKey: "name",
7762
+ cell: NameCell
7763
+ },
7764
+ {
7765
+ header: "Model",
7766
+ accessorKey: "model",
7767
+ size: 160,
7768
+ cell: ({ row }) => {
7769
+ return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(
7770
+ Badge$1,
7771
+ {
7772
+ variant: "default",
7773
+ icon: providerMapToIcon[row.original.provider] || /* @__PURE__ */ jsx(OpenAIIcon, {}),
7774
+ children: row.original.modelId || "N/A"
7775
+ }
7776
+ ) });
7777
+ }
7778
+ },
7779
+ {
7780
+ size: 160,
7781
+ header: "Tools",
7782
+ accessorKey: "tools",
7783
+ cell: ({ row }) => {
7784
+ const toolsCount = row.original.tools ? Object.keys(row.original.tools).length : 0;
7785
+ return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsx(ApiIcon, {}), children: [
7786
+ toolsCount,
7787
+ " tool",
7788
+ toolsCount > 1 ? "s" : ""
7789
+ ] }) });
7790
+ }
7791
+ }
7792
+ ];
7793
+
7794
+ function AgentsTable({ agents, isLoading, onClickRow }) {
7795
+ const projectData = useMemo(
7796
+ () => Object.keys(agents).map((key) => {
7797
+ const agent = agents[key];
7798
+ return {
7799
+ id: key,
7800
+ name: agent.name,
7801
+ instructions: agent.instructions,
7802
+ provider: agent.provider,
7803
+ branch: void 0,
7804
+ executedAt: void 0,
7805
+ repoUrl: void 0,
7806
+ tools: agent.tools,
7807
+ modelId: agent.modelId,
7808
+ link: `/agents/${key}/chat/new`
7809
+ };
7810
+ }),
7811
+ [agents]
7812
+ );
7813
+ const table = useReactTable({
7814
+ data: projectData,
7815
+ columns: columns$2,
7816
+ getCoreRowModel: getCoreRowModel()
7817
+ });
7818
+ if (isLoading) return /* @__PURE__ */ jsx(AgentsTableSkeleton, {});
7819
+ const ths = table.getHeaderGroups()[0];
7820
+ const rows = table.getRowModel().rows.concat();
7821
+ if (rows.length === 0) {
7822
+ return /* @__PURE__ */ jsx(EmptyAgentsTable, {});
7823
+ }
7824
+ return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table, { children: [
7825
+ /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
7826
+ /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => onClickRow(row.original.id), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
7827
+ ] }) });
7828
+ }
7829
+ const AgentsTableSkeleton = () => /* @__PURE__ */ jsxs(Table, { children: [
7830
+ /* @__PURE__ */ jsxs(Thead, { children: [
7831
+ /* @__PURE__ */ jsx(Th, { children: "Name" }),
7832
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Model" }),
7833
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Tools" })
7834
+ ] }),
7835
+ /* @__PURE__ */ jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxs(Row, { children: [
7836
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
7837
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
7838
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) })
7839
+ ] }, index)) })
7840
+ ] });
7841
+ const EmptyAgentsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(
7842
+ EmptyState,
7843
+ {
7844
+ iconSlot: /* @__PURE__ */ jsx(AgentCoinIcon, {}),
7845
+ titleSlot: "Configure Agents",
7846
+ descriptionSlot: "Mastra agents are not configured yet. You can find more information in the documentation.",
7847
+ actionSlot: /* @__PURE__ */ jsxs(
7848
+ Button,
7849
+ {
7850
+ size: "lg",
7851
+ className: "w-full",
7852
+ variant: "light",
7853
+ as: "a",
7854
+ href: "https://mastra.ai/en/docs/agents/overview",
7855
+ target: "_blank",
7856
+ children: [
7857
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(AgentIcon, {}) }),
7858
+ "Docs"
7859
+ ]
7860
+ }
7861
+ )
7862
+ }
7863
+ ) });
7864
+
7865
+ const RuntimeContext = () => {
7866
+ const { runtimeContext, setRuntimeContext } = usePlaygroundStore();
7867
+ const [runtimeContextValue, setRuntimeContextValue] = useState("");
7868
+ const theme = useCodemirrorTheme();
7869
+ const { handleCopy } = useCopyToClipboard({ text: runtimeContextValue });
7870
+ const runtimeContextStr = JSON.stringify(runtimeContext);
7871
+ useEffect(() => {
7872
+ const run = async () => {
7873
+ if (!isValidJson(runtimeContextStr)) {
7874
+ toast.error("Invalid JSON");
7875
+ return;
7876
+ }
7877
+ const formatted = await formatJSON(runtimeContextStr);
7878
+ setRuntimeContextValue(formatted);
7879
+ };
7880
+ run();
7881
+ }, [runtimeContextStr]);
7882
+ const handleSaveRuntimeContext = () => {
7883
+ try {
7884
+ const parsedContext = JSON.parse(runtimeContextValue);
7885
+ setRuntimeContext(parsedContext);
7886
+ toast.success("Runtime context saved successfully");
7887
+ } catch (error) {
7888
+ console.error("error", error);
7889
+ toast.error("Invalid JSON");
7890
+ }
7891
+ };
7892
+ const buttonClass = "text-icon3 hover:text-icon6";
7893
+ const formatRuntimeContext = async () => {
7894
+ if (!isValidJson(runtimeContextValue)) {
7895
+ toast.error("Invalid JSON");
7896
+ return;
7897
+ }
7898
+ const formatted = await formatJSON(runtimeContextValue);
7899
+ setRuntimeContextValue(formatted);
7900
+ };
7901
+ return /* @__PURE__ */ jsxs("div", { children: [
7902
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pb-2", children: [
7903
+ /* @__PURE__ */ jsx(Txt, { as: "label", variant: "ui-md", className: "text-icon3", children: "Runtime Context (JSON)" }),
7904
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
7905
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
7906
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { onClick: formatRuntimeContext, className: buttonClass, children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Braces, {}) }) }) }),
7907
+ /* @__PURE__ */ jsx(TooltipContent, { children: "Format the Runtime Context JSON" })
7908
+ ] }),
7909
+ /* @__PURE__ */ jsxs(Tooltip, { children: [
7910
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { onClick: handleCopy, className: buttonClass, children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(CopyIcon, {}) }) }) }),
7911
+ /* @__PURE__ */ jsx(TooltipContent, { children: "Copy Runtime Context" })
7912
+ ] })
7913
+ ] })
7914
+ ] }),
7915
+ /* @__PURE__ */ jsx(
7916
+ CodeMirror,
7917
+ {
7918
+ value: runtimeContextValue,
7919
+ onChange: setRuntimeContextValue,
7920
+ theme,
7921
+ extensions: [jsonLanguage],
7922
+ className: "h-[400px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"
7923
+ }
7924
+ ),
7925
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ jsx(Button, { onClick: handleSaveRuntimeContext, children: "Save" }) })
7926
+ ] });
7927
+ };
7928
+ const RuntimeContextWrapper = ({ children }) => {
7929
+ const { Link } = useLinkComponent();
7930
+ return /* @__PURE__ */ jsxs("div", { className: "max-w-3xl p-5 overflow-y-scroll h-full", children: [
7931
+ /* @__PURE__ */ jsxs("div", { className: "rounded-lg p-4 pb-5 bg-surface4 shadow-md space-y-3 border border-border1 mb-5", children: [
7932
+ /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-lg", className: "text-icon3", children: "Mastra provides runtime context, which is a system based on dependency injection that enables you to configure your agents and tools with runtime variables. If you find yourself creating several different agents that do very similar things, runtime context allows you to combine them into one agent." }),
7933
+ /* @__PURE__ */ jsxs(Button, { as: Link, to: "https://mastra.ai/en/docs/agents/runtime-variables", target: "_blank", children: [
7934
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ExternalLink, {}) }),
7935
+ "See documentation"
7936
+ ] })
7937
+ ] }),
7938
+ children
7939
+ ] });
7940
+ };
7941
+
7942
+ const convertMessage$1 = (message) => {
7943
+ return message;
7944
+ };
7945
+ function MastraNetworkRuntimeProvider({
7946
+ children,
7947
+ agentId,
7948
+ initialMessages,
7949
+ memory,
7950
+ threadId,
7951
+ modelSettings
7952
+ }) {
7953
+ const [isRunning, setIsRunning] = useState(false);
7954
+ const [messages, setMessages] = useState(initialMessages || []);
7955
+ const [currentThreadId, setCurrentThreadId] = useState(threadId);
7956
+ const { frequencyPenalty, presencePenalty, maxRetries, maxSteps, maxTokens, temperature, topK, topP, instructions } = modelSettings;
7957
+ useEffect(() => {
7958
+ if (messages.length === 0 || currentThreadId !== threadId) {
7959
+ if (initialMessages && threadId && memory) {
7960
+ setMessages(initialMessages);
7961
+ setCurrentThreadId(threadId);
7962
+ }
7963
+ }
7964
+ }, [initialMessages, threadId, memory, messages]);
7965
+ const mastra = useMastraClient();
7966
+ const network = mastra.getNetwork(agentId);
7967
+ const onNew = async (message) => {
7968
+ if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
7969
+ const input = message.content[0].text;
7970
+ setMessages((currentConversation) => [...currentConversation, { role: "user", content: input }]);
7971
+ setIsRunning(true);
7972
+ try {
7973
+ let updater = function() {
7974
+ setMessages((currentConversation) => {
7975
+ const message2 = {
7976
+ role: "assistant",
7977
+ content: [{ type: "text", text: content }]
7978
+ };
7979
+ if (!assistantMessageAdded) {
7980
+ assistantMessageAdded = true;
7981
+ return [...currentConversation, message2];
7982
+ }
7983
+ return [...currentConversation.slice(0, -1), message2];
7984
+ });
7985
+ };
7986
+ const response = await network.stream({
7987
+ messages: [
7988
+ {
7989
+ role: "user",
7990
+ content: input
7991
+ }
7992
+ ],
7993
+ runId: agentId,
7994
+ frequencyPenalty,
7995
+ presencePenalty,
7996
+ maxRetries,
7997
+ maxSteps,
7998
+ maxTokens,
7999
+ temperature,
8000
+ topK,
8001
+ topP,
8002
+ instructions,
8003
+ ...memory ? { threadId, resourceId: agentId } : {}
8004
+ });
8005
+ if (!response.body) {
8006
+ throw new Error("No response body");
8007
+ }
8008
+ const parts = [];
8009
+ let content = "";
8010
+ let currentTextPart = null;
8011
+ let assistantMessageAdded = false;
8012
+ await processDataStream({
8013
+ stream: response.body,
8014
+ onTextPart(value) {
8015
+ if (currentTextPart == null) {
8016
+ currentTextPart = {
8017
+ type: "text",
8018
+ text: value
8019
+ };
8020
+ parts.push(currentTextPart);
8021
+ } else {
8022
+ currentTextPart.text += value;
8023
+ }
8024
+ content += value;
8025
+ updater();
8026
+ },
8027
+ async onToolCallPart(value) {
8028
+ console.log("Tool call received:", value);
6959
8029
  setMessages((currentConversation) => {
6960
8030
  const lastMessage = currentConversation[currentConversation.length - 1];
6961
8031
  if (lastMessage && lastMessage.role === "assistant") {
@@ -7345,12 +8415,8 @@ const Clock = ({ startedAt, endedAt }) => {
7345
8415
  return /* @__PURE__ */ jsxs("span", { className: "text-xs text-icon3", children: [
7346
8416
  toSigFigs(timeDiff, 3),
7347
8417
  "ms"
7348
- ] });
7349
- };
7350
-
7351
- function Skeleton({ className, ...props }) {
7352
- return /* @__PURE__ */ jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
7353
- }
8418
+ ] });
8419
+ };
7354
8420
 
7355
8421
  const lodashTitleCase = (str) => {
7356
8422
  const camelCased = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "").replace(/^(.)/, (char) => char.toLowerCase());
@@ -8234,25 +9300,6 @@ const CodeDialogContent = ({ data }) => {
8234
9300
  }
8235
9301
  };
8236
9302
 
8237
- const formatJSON = async (code) => {
8238
- const formatted = await prettier.format(code, {
8239
- semi: false,
8240
- parser: "json",
8241
- printWidth: 80,
8242
- tabWidth: 2,
8243
- plugins: [prettierPluginBabel, prettierPluginEstree]
8244
- });
8245
- return formatted;
8246
- };
8247
- const isValidJson = (str) => {
8248
- try {
8249
- const obj = JSON.parse(str);
8250
- return !!obj && typeof obj === "object";
8251
- } catch (e) {
8252
- return false;
8253
- }
8254
- };
8255
-
8256
9303
  const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
8257
9304
  const [eventData, setEventData] = useState("");
8258
9305
  const [isLoading, setIsLoading] = useState(false);
@@ -8264,6 +9311,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
8264
9311
  setIsLoading(true);
8265
9312
  setError(null);
8266
9313
  try {
9314
+ setError(null);
8267
9315
  data = JSON.parse(eventData);
8268
9316
  } catch (error2) {
8269
9317
  setError("Invalid JSON");
@@ -8271,6 +9319,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
8271
9319
  return;
8272
9320
  }
8273
9321
  try {
9322
+ setError(null);
8274
9323
  const result = await onSendEvent({ event, data, runId });
8275
9324
  toast.success(result.message);
8276
9325
  } catch (error2) {
@@ -8282,6 +9331,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
8282
9331
  };
8283
9332
  const buttonClass = "text-icon3 hover:text-icon6";
8284
9333
  const formatEventData = async () => {
9334
+ setError(null);
8285
9335
  if (!isValidJson(eventData)) {
8286
9336
  setError("Invalid JSON");
8287
9337
  return;
@@ -9520,7 +10570,8 @@ function VNextMastraNetworkRuntimeProvider({
9520
10570
  memory,
9521
10571
  threadId,
9522
10572
  refreshThreadList,
9523
- initialMessages
10573
+ initialMessages,
10574
+ runtimeContext
9524
10575
  }) {
9525
10576
  const runIdRef = useRef(void 0);
9526
10577
  const [isRunning, setIsRunning] = useState(false);
@@ -9530,6 +10581,10 @@ function VNextMastraNetworkRuntimeProvider({
9530
10581
  const { chatWithLoop, maxIterations } = useContext(NetworkContext);
9531
10582
  const id = runIdRef.current;
9532
10583
  const currentState = id ? state[id] : void 0;
10584
+ const runtimeContextInstance = new RuntimeContext$2();
10585
+ Object.entries(runtimeContext ?? {}).forEach(([key, value]) => {
10586
+ runtimeContextInstance.set(key, value);
10587
+ });
9533
10588
  useEffect(() => {
9534
10589
  if (!currentState) return;
9535
10590
  const hasFinished = Boolean(currentState?.steps?.["finish"]);
@@ -9821,7 +10876,8 @@ ${formatted}\`\`\``;
9821
10876
  message: input,
9822
10877
  threadId,
9823
10878
  resourceId: networkId,
9824
- maxIterations
10879
+ maxIterations,
10880
+ runtimeContext: runtimeContextInstance
9825
10881
  },
9826
10882
  async (record) => {
9827
10883
  if (record.type === "step-start" && record.payload?.id === "Agent-Network-Outer-Workflow") {
@@ -9915,7 +10971,8 @@ ${formatted}\`\`\``;
9915
10971
  {
9916
10972
  message: input,
9917
10973
  threadId,
9918
- resourceId: networkId
10974
+ resourceId: networkId,
10975
+ runtimeContext: runtimeContextInstance
9919
10976
  },
9920
10977
  (record) => {
9921
10978
  if (runIdRef.current) {
@@ -10000,6 +11057,7 @@ const VNextNetworkChat = ({
10000
11057
  memory,
10001
11058
  refreshThreadList
10002
11059
  }) => {
11060
+ const { runtimeContext } = usePlaygroundStore();
10003
11061
  return /* @__PURE__ */ jsx(MessagesProvider, { children: /* @__PURE__ */ jsx(VNextNetworkChatProvider, { children: /* @__PURE__ */ jsx(
10004
11062
  VNextMastraNetworkRuntimeProvider,
10005
11063
  {
@@ -10008,12 +11066,316 @@ const VNextNetworkChat = ({
10008
11066
  threadId,
10009
11067
  memory,
10010
11068
  refreshThreadList,
11069
+ runtimeContext,
10011
11070
  children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4", children: /* @__PURE__ */ jsx(NetworkThread, { hasMemory: memory, networkName }) })
10012
11071
  },
10013
11072
  threadId
10014
11073
  ) }, threadId) }, threadId);
10015
11074
  };
10016
11075
 
11076
+ const columns$1 = [
11077
+ {
11078
+ id: "name",
11079
+ header: "Name",
11080
+ cell: ({ row }) => {
11081
+ const { Link } = useLinkComponent();
11082
+ return /* @__PURE__ */ jsx(
11083
+ EntryCell,
11084
+ {
11085
+ icon: /* @__PURE__ */ jsx(AgentIcon, {}),
11086
+ name: /* @__PURE__ */ jsx(
11087
+ Link,
11088
+ {
11089
+ className: "w-full space-y-0",
11090
+ href: `/networks${row.original.isVNext ? "/v-next" : ""}/${row.original.id}/chat`,
11091
+ children: row.original.name
11092
+ }
11093
+ ),
11094
+ description: row.original.instructions
11095
+ }
11096
+ );
11097
+ },
11098
+ meta: {
11099
+ width: "auto"
11100
+ }
11101
+ },
11102
+ {
11103
+ id: "agents",
11104
+ header: "Agents",
11105
+ cell: ({ row }) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(Users, {}), children: row.original.agentsSize }) })
11106
+ },
11107
+ {
11108
+ id: "workflows",
11109
+ header: "Workflows",
11110
+ cell: ({ row }) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(WorkflowIcon, {}), children: row.original.workflowsSize }) })
11111
+ },
11112
+ {
11113
+ id: "tools",
11114
+ header: "Tools",
11115
+ cell: ({ row }) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(ToolsIcon, {}), children: row.original.toolsSize }) })
11116
+ },
11117
+ {
11118
+ id: "model",
11119
+ header: "Routing Models",
11120
+ cell: ({ row }) => /* @__PURE__ */ jsxs(Cell, { children: [
11121
+ /* @__PURE__ */ jsx(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsx(Brain, {}), children: row.original.routingModel }),
11122
+ row.original.isVNext ? /* @__PURE__ */ jsx(Badge$1, { className: "!text-accent1 ml-2", children: "vNext" }) : null
11123
+ ] })
11124
+ }
11125
+ ];
11126
+
11127
+ const NetworkTable = ({ legacyNetworks, networks, isLoading, onClickRow }) => {
11128
+ const allNetworks = useMemo(
11129
+ () => [
11130
+ ...legacyNetworks?.map((network) => ({
11131
+ ...network,
11132
+ routingModel: network.routingModel.modelId,
11133
+ agentsSize: network.agents.length,
11134
+ isVNext: false
11135
+ })) ?? [],
11136
+ ...networks?.map((network) => ({
11137
+ ...network,
11138
+ routingModel: network.routingModel.modelId,
11139
+ agentsSize: network.agents.length,
11140
+ workflowsSize: network.workflows.length,
11141
+ toolsSize: network.tools.length,
11142
+ isVNext: true
11143
+ })) ?? []
11144
+ ],
11145
+ [networks, legacyNetworks]
11146
+ );
11147
+ const table = useReactTable({
11148
+ data: allNetworks,
11149
+ columns: columns$1,
11150
+ getCoreRowModel: getCoreRowModel()
11151
+ });
11152
+ if (isLoading) return /* @__PURE__ */ jsx(NetworkTableSkeleton, {});
11153
+ const ths = table.getHeaderGroups()[0];
11154
+ const rows = table.getRowModel().rows.concat();
11155
+ if (rows.length === 0) {
11156
+ return /* @__PURE__ */ jsx(NetworkTableEmpty, {});
11157
+ }
11158
+ return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table, { children: [
11159
+ /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
11160
+ /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => onClickRow(row.original.id), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
11161
+ ] }) });
11162
+ };
11163
+ const NetworkTableEmpty = () => {
11164
+ return /* @__PURE__ */ jsx(
11165
+ EmptyState,
11166
+ {
11167
+ iconSlot: /* @__PURE__ */ jsx(AgentNetworkCoinIcon, {}),
11168
+ titleSlot: "Configure Agent Networks",
11169
+ descriptionSlot: "Mastra agent networks are not configured yet. You can find more information in the documentation.",
11170
+ actionSlot: /* @__PURE__ */ jsxs(
11171
+ Button,
11172
+ {
11173
+ size: "lg",
11174
+ className: "w-full",
11175
+ variant: "light",
11176
+ as: "a",
11177
+ href: "https://mastra.ai/en/reference/networks/agent-network",
11178
+ target: "_blank",
11179
+ children: [
11180
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(NetworkIcon, {}) }),
11181
+ "Docs"
11182
+ ]
11183
+ }
11184
+ )
11185
+ }
11186
+ );
11187
+ };
11188
+ const NetworkTableSkeleton = () => {
11189
+ return /* @__PURE__ */ jsxs(Table, { children: [
11190
+ /* @__PURE__ */ jsxs(Thead, { children: [
11191
+ /* @__PURE__ */ jsx(Th, { children: "Name" }),
11192
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Agents" }),
11193
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Workflows" }),
11194
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Tools" }),
11195
+ /* @__PURE__ */ jsx(Th, { width: 160, children: "Routing Models" })
11196
+ ] }),
11197
+ /* @__PURE__ */ jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxs(Row, { children: [
11198
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11199
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11200
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11201
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
11202
+ /* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) })
11203
+ ] }, index)) })
11204
+ ] });
11205
+ };
11206
+
11207
+ const Entity = ({ children, className, onClick }) => {
11208
+ return /* @__PURE__ */ jsx(
11209
+ "div",
11210
+ {
11211
+ tabIndex: onClick ? 0 : void 0,
11212
+ onKeyDown: (e) => {
11213
+ if (!onClick) return;
11214
+ if (e.key === "Enter" || e.key === " ") {
11215
+ e.preventDefault();
11216
+ onClick?.();
11217
+ }
11218
+ },
11219
+ className: clsx(
11220
+ "flex gap-3 group/entity bg-surface3 rounded-lg border-sm border-border1 py-3 px-4",
11221
+ onClick && "cursor-pointer hover:bg-surface4 transition-all",
11222
+ className
11223
+ ),
11224
+ onClick,
11225
+ children
11226
+ }
11227
+ );
11228
+ };
11229
+ const EntityIcon = ({ children, className }) => {
11230
+ return /* @__PURE__ */ jsx(Icon, { size: "lg", className: clsx("text-icon3 mt-1", className), children });
11231
+ };
11232
+ const EntityName = ({ children, className }) => {
11233
+ return /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-lg", className: clsx("text-icon6 font-medium", className), children });
11234
+ };
11235
+ const EntityDescription = ({ children, className }) => {
11236
+ return /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-sm", className: clsx("text-icon3", className), children });
11237
+ };
11238
+ const EntityContent = ({ children, className }) => {
11239
+ return /* @__PURE__ */ jsx("div", { className, children });
11240
+ };
11241
+
11242
+ const ToolList = ({ tools, agents, isLoading }) => {
11243
+ const toolsWithAgents = useMemo(() => prepareAgents(tools, agents), [tools, agents]);
11244
+ if (isLoading)
11245
+ return /* @__PURE__ */ jsx("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: /* @__PURE__ */ jsx(ToolListSkeleton, {}) });
11246
+ return /* @__PURE__ */ jsx(ToolListInner, { toolsWithAgents });
11247
+ };
11248
+ const ToolListInner = ({ toolsWithAgents }) => {
11249
+ const [filteredTools, setFilteredTools] = useState(toolsWithAgents);
11250
+ const [value, setValue] = useState("");
11251
+ if (filteredTools.length === 0 && !value) return /* @__PURE__ */ jsx(ToolListEmpty, {});
11252
+ const handleSearch = (e) => {
11253
+ const value2 = e.target.value;
11254
+ setValue(value2);
11255
+ startTransition(() => {
11256
+ setFilteredTools(
11257
+ toolsWithAgents.filter(
11258
+ (tool) => tool.id.toLowerCase().includes(value2.toLowerCase()) || tool.description.toLowerCase().includes(value2.toLowerCase()) || tool.agents.some(
11259
+ (agent) => agent.name.toLowerCase().includes(value2.toLowerCase()) || agent.id.toLowerCase().includes(value2.toLowerCase())
11260
+ )
11261
+ )
11262
+ );
11263
+ });
11264
+ };
11265
+ return /* @__PURE__ */ jsxs("div", { children: [
11266
+ /* @__PURE__ */ jsxs("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: [
11267
+ /* @__PURE__ */ jsxs("div", { className: "px-4 flex items-center gap-2 rounded-lg bg-surface5 focus-within:ring-2 focus-within:ring-accent3", children: [
11268
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(SearchIcon, {}) }),
11269
+ /* @__PURE__ */ jsx(
11270
+ "input",
11271
+ {
11272
+ type: "text",
11273
+ placeholder: "Search for a tool",
11274
+ className: "w-full py-2 bg-transparent text-icon3 focus:text-icon6 placeholder:text-icon3 outline-none",
11275
+ value,
11276
+ onChange: handleSearch
11277
+ }
11278
+ )
11279
+ ] }),
11280
+ filteredTools.length === 0 && /* @__PURE__ */ jsx(Txt, { as: "p", className: "text-icon3 py-2", children: "No tools found matching your search." })
11281
+ ] }),
11282
+ /* @__PURE__ */ jsx("div", { className: "grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-5xl mx-auto py-8", children: filteredTools.map((tool) => /* @__PURE__ */ jsx(ToolEntity, { tool }, tool.id)) })
11283
+ ] });
11284
+ };
11285
+ const ToolEntity = ({ tool }) => {
11286
+ const linkRef = useRef(null);
11287
+ const { Link } = useLinkComponent();
11288
+ return /* @__PURE__ */ jsxs(Entity, { onClick: () => linkRef.current?.click(), children: [
11289
+ /* @__PURE__ */ jsx(EntityIcon, { children: /* @__PURE__ */ jsx(ToolsIcon, { className: "group-hover/entity:text-[#ECB047]" }) }),
11290
+ /* @__PURE__ */ jsxs(EntityContent, { children: [
11291
+ /* @__PURE__ */ jsx(EntityName, { children: /* @__PURE__ */ jsx(
11292
+ Link,
11293
+ {
11294
+ ref: linkRef,
11295
+ href: tool.agents.length > 0 ? `/tools/${tool.agents[0].id}/${tool.id}` : `/tools/all/${tool.id}`,
11296
+ children: tool.id
11297
+ }
11298
+ ) }),
11299
+ /* @__PURE__ */ jsx(EntityDescription, { children: tool.description }),
11300
+ /* @__PURE__ */ jsx("div", { className: "inline-flex flex-wrap gap-2 pt-4", children: tool.agents.map((agent) => {
11301
+ return /* @__PURE__ */ jsx(
11302
+ Link,
11303
+ {
11304
+ href: `/agents/${agent.id}/chat`,
11305
+ onClick: (e) => e.stopPropagation(),
11306
+ className: "group/link",
11307
+ children: /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(AgentIcon, { className: "group-hover/link:text-accent3" }), className: "bg-surface5 ", children: agent.name })
11308
+ },
11309
+ agent.id
11310
+ );
11311
+ }) })
11312
+ ] })
11313
+ ] });
11314
+ };
11315
+ const ToolListSkeleton = () => {
11316
+ return /* @__PURE__ */ jsxs("div", { children: [
11317
+ /* @__PURE__ */ jsx("div", { className: "max-w-5xl w-full mx-auto px-4 pt-8", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }) }),
11318
+ /* @__PURE__ */ jsxs("div", { className: "grid md:grid-cols-2 xl:grid-cols-3 gap-4 max-w-5xl mx-auto py-8", children: [
11319
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full" }),
11320
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full" }),
11321
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-40 w-full" })
11322
+ ] })
11323
+ ] });
11324
+ };
11325
+ const ToolListEmpty = () => {
11326
+ return /* @__PURE__ */ jsx(
11327
+ EmptyState,
11328
+ {
11329
+ iconSlot: /* @__PURE__ */ jsx(ToolCoinIcon, {}),
11330
+ titleSlot: "Configure Tools",
11331
+ descriptionSlot: "Mastra tools are not configured yet. You can find more information in the documentation.",
11332
+ actionSlot: /* @__PURE__ */ jsxs(
11333
+ Button,
11334
+ {
11335
+ size: "lg",
11336
+ className: "w-full",
11337
+ variant: "light",
11338
+ as: "a",
11339
+ href: "https://mastra.ai/en/docs/agents/using-tools-and-mcp",
11340
+ target: "_blank",
11341
+ children: [
11342
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ToolsIcon, {}) }),
11343
+ "Docs"
11344
+ ]
11345
+ }
11346
+ )
11347
+ }
11348
+ );
11349
+ };
11350
+ const prepareAgents = (tools, agents) => {
11351
+ const toolsWithAgents = /* @__PURE__ */ new Map();
11352
+ const agentsKeys = Object.keys(agents);
11353
+ for (const k of agentsKeys) {
11354
+ const agent = agents[k];
11355
+ const agentToolsDict = agent.tools;
11356
+ const agentToolsKeys = Object.keys(agentToolsDict);
11357
+ for (const key of agentToolsKeys) {
11358
+ const tool = agentToolsDict[key];
11359
+ if (!toolsWithAgents.has(tool.id)) {
11360
+ toolsWithAgents.set(tool.id, {
11361
+ ...tool,
11362
+ agents: []
11363
+ });
11364
+ }
11365
+ toolsWithAgents.get(tool.id).agents.push({ id: k, name: agent.name });
11366
+ }
11367
+ }
11368
+ for (const [_, tool] of Object.entries(tools)) {
11369
+ if (!toolsWithAgents.has(tool.id)) {
11370
+ toolsWithAgents.set(tool.id, {
11371
+ ...tool,
11372
+ agents: []
11373
+ });
11374
+ }
11375
+ }
11376
+ return Array.from(toolsWithAgents.values());
11377
+ };
11378
+
10017
11379
  function WorkflowTraces({ traces, error, runId, stepName }) {
10018
11380
  return /* @__PURE__ */ jsx(TraceProvider, { initialTraces: traces || [], children: /* @__PURE__ */ jsx(WorkflowTracesInner, { traces, error, runId, stepName }) });
10019
11381
  }
@@ -11517,6 +12879,115 @@ const WorkflowRuns = ({ workflowId, runId, isLoading, runs, onPressRun }) => {
11517
12879
  ) }, run.runId)) });
11518
12880
  };
11519
12881
 
12882
+ const columns = [
12883
+ {
12884
+ id: "name",
12885
+ header: "Name",
12886
+ cell: ({ row }) => {
12887
+ const { Link } = useLinkComponent();
12888
+ return /* @__PURE__ */ jsx(
12889
+ EntryCell,
12890
+ {
12891
+ icon: /* @__PURE__ */ jsx(WorkflowIcon, {}),
12892
+ name: /* @__PURE__ */ jsx(Link, { href: row.original.link, children: row.original.name }),
12893
+ description: void 0,
12894
+ meta: void 0
12895
+ }
12896
+ );
12897
+ },
12898
+ meta: {
12899
+ width: "auto"
12900
+ }
12901
+ },
12902
+ {
12903
+ id: "stepsCount",
12904
+ header: "Steps",
12905
+ size: 300,
12906
+ cell: ({ row }) => /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center gap-2", children: [
12907
+ /* @__PURE__ */ jsxs(Badge$1, { icon: /* @__PURE__ */ jsx(Footprints, {}), className: "!h-button-md", children: [
12908
+ row.original.stepsCount,
12909
+ " step",
12910
+ row.original.stepsCount > 1 ? "s" : ""
12911
+ ] }),
12912
+ row.original.isLegacy ? /* @__PURE__ */ jsx(Badge$1, { className: "!text-foreground/80 !h-button-md", children: "Legacy" }) : null
12913
+ ] }) })
12914
+ }
12915
+ ];
12916
+
12917
+ function WorkflowTable({ workflows, legacyWorkflows, isLoading, onClickRow }) {
12918
+ const workflowData = useMemo(() => {
12919
+ const _workflowsData = Object.keys(workflows ?? {}).map((key) => {
12920
+ const workflow = workflows?.[key];
12921
+ return {
12922
+ id: key,
12923
+ name: workflow?.name || "N/A",
12924
+ stepsCount: Object.keys(workflow?.steps ?? {})?.length,
12925
+ isLegacy: false,
12926
+ link: `/workflows/${key}/graph`
12927
+ };
12928
+ });
12929
+ const legacyWorkflowsData = Object.keys(legacyWorkflows ?? {}).map((key) => {
12930
+ const workflow = legacyWorkflows?.[key];
12931
+ return {
12932
+ id: key,
12933
+ name: workflow?.name || "N/A",
12934
+ stepsCount: Object.keys(workflow?.steps ?? {})?.length,
12935
+ isLegacy: true,
12936
+ link: `/workflows/legacy/${key}/graph`
12937
+ };
12938
+ });
12939
+ return [..._workflowsData, ...legacyWorkflowsData];
12940
+ }, [workflows, legacyWorkflows]);
12941
+ const table = useReactTable({
12942
+ data: workflowData,
12943
+ columns,
12944
+ getCoreRowModel: getCoreRowModel()
12945
+ });
12946
+ if (isLoading) return /* @__PURE__ */ jsx(WorkflowTableSkeleton, {});
12947
+ const ths = table.getHeaderGroups()[0];
12948
+ const rows = table.getRowModel().rows.concat();
12949
+ if (rows.length === 0) {
12950
+ return /* @__PURE__ */ jsx(EmptyWorkflowsTable, {});
12951
+ }
12952
+ return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table, { children: [
12953
+ /* @__PURE__ */ jsx(Thead, { className: "sticky top-0", children: ths.headers.map((header) => /* @__PURE__ */ jsx(Th, { style: { width: header.index === 0 ? "auto" : header.column.getSize() }, children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id)) }),
12954
+ /* @__PURE__ */ jsx(Tbody, { children: rows.map((row) => /* @__PURE__ */ jsx(Row, { onClick: () => onClickRow(row.original.id), children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(React__default.Fragment, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
12955
+ ] }) });
12956
+ }
12957
+ const WorkflowTableSkeleton = () => /* @__PURE__ */ jsxs(Table, { children: [
12958
+ /* @__PURE__ */ jsxs(Thead, { children: [
12959
+ /* @__PURE__ */ jsx(Th, { children: "Name" }),
12960
+ /* @__PURE__ */ jsx(Th, { width: 300, children: "Steps" })
12961
+ ] }),
12962
+ /* @__PURE__ */ jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxs(Row, { children: [
12963
+ /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
12964
+ /* @__PURE__ */ jsx(Cell, { width: 300, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) })
12965
+ ] }, index)) })
12966
+ ] });
12967
+ const EmptyWorkflowsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(
12968
+ EmptyState,
12969
+ {
12970
+ iconSlot: /* @__PURE__ */ jsx(WorkflowCoinIcon, {}),
12971
+ titleSlot: "Configure Workflows",
12972
+ descriptionSlot: "Mastra workflows are not configured yet. You can find more information in the documentation.",
12973
+ actionSlot: /* @__PURE__ */ jsxs(
12974
+ Button,
12975
+ {
12976
+ size: "lg",
12977
+ className: "w-full",
12978
+ variant: "light",
12979
+ as: "a",
12980
+ href: "https://mastra.ai/en/docs/workflows/overview",
12981
+ target: "_blank",
12982
+ children: [
12983
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(WorkflowIcon, {}) }),
12984
+ "Docs"
12985
+ ]
12986
+ }
12987
+ )
12988
+ }
12989
+ ) });
12990
+
11520
12991
  const DataTable = ({
11521
12992
  columns,
11522
12993
  data,
@@ -11771,56 +13242,6 @@ const DarkLogo = (props) => /* @__PURE__ */ jsxs("svg", { width: "100", height:
11771
13242
  )
11772
13243
  ] });
11773
13244
 
11774
- const Entity = ({ children, className, onClick }) => {
11775
- return /* @__PURE__ */ jsx(
11776
- "div",
11777
- {
11778
- tabIndex: onClick ? 0 : void 0,
11779
- onKeyDown: (e) => {
11780
- if (!onClick) return;
11781
- if (e.key === "Enter" || e.key === " ") {
11782
- e.preventDefault();
11783
- onClick?.();
11784
- }
11785
- },
11786
- className: clsx(
11787
- "flex gap-3 group/entity bg-surface3 rounded-lg border-sm border-border1 py-3 px-4",
11788
- onClick && "cursor-pointer hover:bg-surface4 transition-all",
11789
- className
11790
- ),
11791
- onClick,
11792
- children
11793
- }
11794
- );
11795
- };
11796
- const EntityIcon = ({ children, className }) => {
11797
- return /* @__PURE__ */ jsx(Icon, { size: "lg", className: clsx("text-icon3 mt-1", className), children });
11798
- };
11799
- const EntityName = ({ children, className }) => {
11800
- return /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-lg", className: clsx("text-icon6 font-medium", className), children });
11801
- };
11802
- const EntityDescription = ({ children, className }) => {
11803
- return /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-sm", className: clsx("text-icon3", className), children });
11804
- };
11805
- const EntityContent = ({ children, className }) => {
11806
- return /* @__PURE__ */ jsx("div", { className, children });
11807
- };
11808
-
11809
- const EmptyState = ({
11810
- iconSlot,
11811
- titleSlot,
11812
- descriptionSlot,
11813
- actionSlot,
11814
- as: Component = "div"
11815
- }) => {
11816
- return /* @__PURE__ */ jsxs("div", { className: "flex w-[340px] flex-col items-center justify-center text-center", children: [
11817
- /* @__PURE__ */ jsx("div", { className: "h-auto [&>svg]:w-[126px]", children: iconSlot }),
11818
- /* @__PURE__ */ jsx(Component, { className: "text-icon6 pt-[34px] font-serif text-[1.75rem] font-semibold", children: titleSlot }),
11819
- /* @__PURE__ */ jsx(Txt, { variant: "ui-lg", className: "text-icon3 pb-[34px]", children: descriptionSlot }),
11820
- actionSlot
11821
- ] });
11822
- };
11823
-
11824
13245
  function usePolling({
11825
13246
  fetchFn,
11826
13247
  interval = 3e3,
@@ -11928,5 +13349,5 @@ function usePolling({
11928
13349
  };
11929
13350
  }
11930
13351
 
11931
- export { AgentChat, AgentCoinIcon, AgentEvals, AgentIcon, AgentNetworkCoinIcon, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentTraces, AiIcon, ApiIcon, Badge$1 as Badge, BranchIcon, Breadcrumb, Button, Cell, CheckIcon, ChevronIcon, CommitIcon, CrossIcon, Crumb, DarkLogo, DataTable, DateTimeCell, DbIcon, DebugIcon, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityIcon, EntityName, Entry, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LogsIcon, MainContentContent, MainContentLayout, MastraClientProvider, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VNextNetworkChat, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowRuns, WorkflowTraces, WorkflowTrigger, useAgentSettings, useCurrentRun, useMastraClient, usePlaygroundStore, usePolling, useSpeechRecognition };
13352
+ export { AgentChat, AgentCoinIcon, AgentEvals, AgentIcon, AgentNetworkCoinIcon, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentTraces, AgentsTable, AgentsTableSkeleton, AiIcon, ApiIcon, Badge$1 as Badge, BranchIcon, Breadcrumb, Button, Cell, CheckIcon, ChevronIcon, CommitIcon, CrossIcon, Crumb, DarkLogo, DataTable, DateTimeCell, DbIcon, DebugIcon, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyAgentsTable, EmptyState, EmptyWorkflowsTable, Entity, EntityContent, EntityDescription, EntityIcon, EntityName, Entry, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LinkComponentProvider, LogsIcon, MainContentContent, MainContentLayout, MastraClientProvider, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, NetworkTable, NetworkTableEmpty, NetworkTableSkeleton, OpenAIIcon, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, Row, RuntimeContext, RuntimeContextWrapper, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolList, ToolListEmpty, ToolListSkeleton, ToolsIcon, TraceIcon, TsIcon, Txt, TxtCell, UnitCell, VNextNetworkChat, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowRuns, WorkflowTable, WorkflowTableSkeleton, WorkflowTraces, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, useAgentSettings, useCurrentRun, useLinkComponent, useMastraClient, usePlaygroundStore, usePolling, useSpeechRecognition, useWorkingMemory };
11932
13353
  //# sourceMappingURL=index.es.js.map