@mastra/playground-ui 5.1.12 → 5.1.13-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1024 -56
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1018 -58
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/assistant-ui/messages/reasoning.d.ts +3 -0
- package/dist/src/components/scrollable-container.d.ts +9 -0
- package/dist/src/domains/agents/components/agent-table/agent-table.d.ts +10 -0
- package/dist/src/domains/agents/components/agent-table/columns.d.ts +22 -0
- package/dist/src/domains/agents/components/agent-table/types.d.ts +12 -0
- package/dist/src/domains/agents/context/agent-working-memory-context.d.ts +21 -0
- package/dist/src/domains/agents/context/index.d.ts +2 -0
- package/dist/src/domains/agents/hooks/use-agent-working-memory.d.ts +10 -0
- package/dist/src/domains/agents/index.d.ts +2 -1
- package/dist/src/ds/components/Button/Button.d.ts +1 -0
- package/dist/src/ds/icons/AmazonIcon.d.ts +3 -0
- package/dist/src/ds/icons/AnthropicChatIcon.d.ts +3 -0
- package/dist/src/ds/icons/AnthropicMessagesIcon.d.ts +3 -0
- package/dist/src/ds/icons/AzureIcon.d.ts +3 -0
- package/dist/src/ds/icons/CohereIcon.d.ts +3 -0
- package/dist/src/ds/icons/GroqIcon.d.ts +3 -0
- package/dist/src/ds/icons/MistralIcon.d.ts +3 -0
- package/dist/src/ds/icons/OpenaiChatIcon.d.ts +3 -0
- package/dist/src/ds/icons/XGroqIcon.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/framework.d.ts +12 -0
- package/dist/src/services/vnext-network-runtime-provider.d.ts +1 -1
- package/dist/src/types.d.ts +12 -2
- package/package.json +6 -5
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { createContext, useContext, forwardRef, memo, useState, useEffect, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1 } 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,
|
|
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, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Loader2, Network, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Plus, Maximize, Workflow, AlertCircleIcon, 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';
|
|
@@ -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$1 } 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
|
|
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:
|
|
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,8 +5172,10 @@ function MastraRuntimeProvider({
|
|
|
5053
5172
|
topK,
|
|
5054
5173
|
topP,
|
|
5055
5174
|
instructions,
|
|
5056
|
-
chatWithGenerate
|
|
5175
|
+
chatWithGenerate,
|
|
5176
|
+
providerOptions
|
|
5057
5177
|
} = settings?.modelSettings ?? {};
|
|
5178
|
+
const toolCallIdToName = useRef({});
|
|
5058
5179
|
const runtimeContextInstance = new RuntimeContext();
|
|
5059
5180
|
Object.entries(runtimeContext ?? {}).forEach(([key, value]) => {
|
|
5060
5181
|
runtimeContextInstance.set(key, value);
|
|
@@ -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
|
-
|
|
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,6 +7133,728 @@ const AgentSettings = () => {
|
|
|
6869
7133
|
] });
|
|
6870
7134
|
};
|
|
6871
7135
|
|
|
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
|
+
] });
|
|
7149
|
+
};
|
|
7150
|
+
|
|
7151
|
+
const INDICATOR_WIDTH = 40;
|
|
7152
|
+
const INDICATOR_HEIGHT = 150;
|
|
7153
|
+
const INDICATOR_SPACE = 10;
|
|
7154
|
+
const ScrollableContainer = ({
|
|
7155
|
+
className,
|
|
7156
|
+
children,
|
|
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);
|
|
7168
|
+
useEffect(() => {
|
|
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);
|
|
7198
|
+
}
|
|
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"
|
|
7248
|
+
});
|
|
7249
|
+
}
|
|
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
|
+
return useContext(LinkComponentContext);
|
|
7729
|
+
};
|
|
7730
|
+
|
|
7731
|
+
const providerMapToIcon = {
|
|
7732
|
+
"openai.chat": /* @__PURE__ */ jsx(OpenaiChatIcon, {}),
|
|
7733
|
+
"anthropic.chat": /* @__PURE__ */ jsx(AnthropicChatIcon, {}),
|
|
7734
|
+
"anthropic.messages": /* @__PURE__ */ jsx(AnthropicMessagesIcon, {}),
|
|
7735
|
+
AZURE: /* @__PURE__ */ jsx(AzureIcon, {}),
|
|
7736
|
+
AMAZON: /* @__PURE__ */ jsx(AmazonIcon, {}),
|
|
7737
|
+
GOOGLE: /* @__PURE__ */ jsx(GoogleIcon, {}),
|
|
7738
|
+
COHERE: /* @__PURE__ */ jsx(CohereIcon, {}),
|
|
7739
|
+
GROQ: /* @__PURE__ */ jsx(GroqIcon, {}),
|
|
7740
|
+
X_GROK: /* @__PURE__ */ jsx(XGroqIcon, {}),
|
|
7741
|
+
MISTRAL: /* @__PURE__ */ jsx(MistralIcon, {})
|
|
7742
|
+
};
|
|
7743
|
+
const NameCell = ({ row }) => {
|
|
7744
|
+
const { Link } = useLinkComponent();
|
|
7745
|
+
return /* @__PURE__ */ jsx(
|
|
7746
|
+
EntryCell,
|
|
7747
|
+
{
|
|
7748
|
+
icon: /* @__PURE__ */ jsx(AgentIcon, {}),
|
|
7749
|
+
name: /* @__PURE__ */ jsx(Link, { className: "w-full space-y-0", href: row.original.link, children: row.original.name }),
|
|
7750
|
+
description: row.original.instructions
|
|
7751
|
+
}
|
|
7752
|
+
);
|
|
7753
|
+
};
|
|
7754
|
+
const columns = [
|
|
7755
|
+
{
|
|
7756
|
+
header: "Name",
|
|
7757
|
+
accessorKey: "name",
|
|
7758
|
+
cell: NameCell
|
|
7759
|
+
},
|
|
7760
|
+
{
|
|
7761
|
+
header: "Model",
|
|
7762
|
+
accessorKey: "model",
|
|
7763
|
+
size: 160,
|
|
7764
|
+
cell: ({ row }) => {
|
|
7765
|
+
return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(
|
|
7766
|
+
Badge$1,
|
|
7767
|
+
{
|
|
7768
|
+
variant: "default",
|
|
7769
|
+
icon: providerMapToIcon[row.original.provider] || /* @__PURE__ */ jsx(OpenAIIcon, {}),
|
|
7770
|
+
children: row.original.modelId || "N/A"
|
|
7771
|
+
}
|
|
7772
|
+
) });
|
|
7773
|
+
}
|
|
7774
|
+
},
|
|
7775
|
+
{
|
|
7776
|
+
size: 160,
|
|
7777
|
+
header: "Tools",
|
|
7778
|
+
accessorKey: "tools",
|
|
7779
|
+
cell: ({ row }) => {
|
|
7780
|
+
const toolsCount = row.original.tools ? Object.keys(row.original.tools).length : 0;
|
|
7781
|
+
return /* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsxs(Badge$1, { variant: "default", icon: /* @__PURE__ */ jsx(ApiIcon, {}), children: [
|
|
7782
|
+
toolsCount,
|
|
7783
|
+
" tool",
|
|
7784
|
+
toolsCount > 1 ? "s" : ""
|
|
7785
|
+
] }) });
|
|
7786
|
+
}
|
|
7787
|
+
}
|
|
7788
|
+
];
|
|
7789
|
+
|
|
7790
|
+
function AgentsTable({ agents, isLoading, onClickRow }) {
|
|
7791
|
+
const _agents = agents || {};
|
|
7792
|
+
const projectData = Object.keys(_agents).map((key) => {
|
|
7793
|
+
const agent = _agents[key];
|
|
7794
|
+
return {
|
|
7795
|
+
id: key,
|
|
7796
|
+
name: agent.name,
|
|
7797
|
+
instructions: agent.instructions,
|
|
7798
|
+
provider: agent.provider,
|
|
7799
|
+
branch: void 0,
|
|
7800
|
+
executedAt: void 0,
|
|
7801
|
+
repoUrl: void 0,
|
|
7802
|
+
tools: agent.tools,
|
|
7803
|
+
modelId: agent.modelId
|
|
7804
|
+
};
|
|
7805
|
+
});
|
|
7806
|
+
const table = useReactTable({
|
|
7807
|
+
data: projectData,
|
|
7808
|
+
columns,
|
|
7809
|
+
getCoreRowModel: getCoreRowModel()
|
|
7810
|
+
});
|
|
7811
|
+
if (isLoading) return /* @__PURE__ */ jsx(AgentsTableSkeleton, {});
|
|
7812
|
+
const ths = table.getHeaderGroups()[0];
|
|
7813
|
+
const rows = table.getRowModel().rows.concat();
|
|
7814
|
+
if (rows.length === 0) {
|
|
7815
|
+
return /* @__PURE__ */ jsx(EmptyAgentsTable, {});
|
|
7816
|
+
}
|
|
7817
|
+
return /* @__PURE__ */ jsx(ScrollableContainer, { children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
7818
|
+
/* @__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)) }),
|
|
7819
|
+
/* @__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)) })
|
|
7820
|
+
] }) });
|
|
7821
|
+
}
|
|
7822
|
+
const AgentsTableSkeleton = () => /* @__PURE__ */ jsxs(Table, { children: [
|
|
7823
|
+
/* @__PURE__ */ jsxs(Thead, { children: [
|
|
7824
|
+
/* @__PURE__ */ jsx(Th, { children: "Name" }),
|
|
7825
|
+
/* @__PURE__ */ jsx(Th, { width: 160, children: "Model" }),
|
|
7826
|
+
/* @__PURE__ */ jsx(Th, { width: 160, children: "Tools" })
|
|
7827
|
+
] }),
|
|
7828
|
+
/* @__PURE__ */ jsx(Tbody, { children: Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxs(Row, { children: [
|
|
7829
|
+
/* @__PURE__ */ jsx(Cell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
|
|
7830
|
+
/* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) }),
|
|
7831
|
+
/* @__PURE__ */ jsx(Cell, { width: 160, children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }) })
|
|
7832
|
+
] }, index)) })
|
|
7833
|
+
] });
|
|
7834
|
+
const EmptyAgentsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
7835
|
+
EmptyState,
|
|
7836
|
+
{
|
|
7837
|
+
iconSlot: /* @__PURE__ */ jsx(AgentCoinIcon, {}),
|
|
7838
|
+
titleSlot: "Configure Agents",
|
|
7839
|
+
descriptionSlot: "Mastra agents are not configured yet. You can find more information in the documentation.",
|
|
7840
|
+
actionSlot: /* @__PURE__ */ jsxs(
|
|
7841
|
+
Button,
|
|
7842
|
+
{
|
|
7843
|
+
size: "lg",
|
|
7844
|
+
className: "w-full",
|
|
7845
|
+
variant: "light",
|
|
7846
|
+
as: "a",
|
|
7847
|
+
href: "https://mastra.ai/en/docs/agents/overview",
|
|
7848
|
+
target: "_blank",
|
|
7849
|
+
children: [
|
|
7850
|
+
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(AgentIcon, {}) }),
|
|
7851
|
+
"Docs"
|
|
7852
|
+
]
|
|
7853
|
+
}
|
|
7854
|
+
)
|
|
7855
|
+
}
|
|
7856
|
+
) });
|
|
7857
|
+
|
|
6872
7858
|
const convertMessage$1 = (message) => {
|
|
6873
7859
|
return message;
|
|
6874
7860
|
};
|
|
@@ -7348,10 +8334,6 @@ const Clock = ({ startedAt, endedAt }) => {
|
|
|
7348
8334
|
] });
|
|
7349
8335
|
};
|
|
7350
8336
|
|
|
7351
|
-
function Skeleton({ className, ...props }) {
|
|
7352
|
-
return /* @__PURE__ */ jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
|
|
7353
|
-
}
|
|
7354
|
-
|
|
7355
8337
|
const lodashTitleCase = (str) => {
|
|
7356
8338
|
const camelCased = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "").replace(/^(.)/, (char) => char.toLowerCase());
|
|
7357
8339
|
return camelCased.replace(/([A-Z])/g, " $1").replace(/^./, (str2) => str2.toUpperCase()).trim();
|
|
@@ -8234,25 +9216,6 @@ const CodeDialogContent = ({ data }) => {
|
|
|
8234
9216
|
}
|
|
8235
9217
|
};
|
|
8236
9218
|
|
|
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
9219
|
const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
|
|
8257
9220
|
const [eventData, setEventData] = useState("");
|
|
8258
9221
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -8264,6 +9227,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
|
|
|
8264
9227
|
setIsLoading(true);
|
|
8265
9228
|
setError(null);
|
|
8266
9229
|
try {
|
|
9230
|
+
setError(null);
|
|
8267
9231
|
data = JSON.parse(eventData);
|
|
8268
9232
|
} catch (error2) {
|
|
8269
9233
|
setError("Invalid JSON");
|
|
@@ -8271,6 +9235,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
|
|
|
8271
9235
|
return;
|
|
8272
9236
|
}
|
|
8273
9237
|
try {
|
|
9238
|
+
setError(null);
|
|
8274
9239
|
const result = await onSendEvent({ event, data, runId });
|
|
8275
9240
|
toast.success(result.message);
|
|
8276
9241
|
} catch (error2) {
|
|
@@ -8282,6 +9247,7 @@ const WorkflowRunEventForm = ({ event, runId, onSendEvent }) => {
|
|
|
8282
9247
|
};
|
|
8283
9248
|
const buttonClass = "text-icon3 hover:text-icon6";
|
|
8284
9249
|
const formatEventData = async () => {
|
|
9250
|
+
setError(null);
|
|
8285
9251
|
if (!isValidJson(eventData)) {
|
|
8286
9252
|
setError("Invalid JSON");
|
|
8287
9253
|
return;
|
|
@@ -9520,7 +10486,8 @@ function VNextMastraNetworkRuntimeProvider({
|
|
|
9520
10486
|
memory,
|
|
9521
10487
|
threadId,
|
|
9522
10488
|
refreshThreadList,
|
|
9523
|
-
initialMessages
|
|
10489
|
+
initialMessages,
|
|
10490
|
+
runtimeContext
|
|
9524
10491
|
}) {
|
|
9525
10492
|
const runIdRef = useRef(void 0);
|
|
9526
10493
|
const [isRunning, setIsRunning] = useState(false);
|
|
@@ -9530,6 +10497,10 @@ function VNextMastraNetworkRuntimeProvider({
|
|
|
9530
10497
|
const { chatWithLoop, maxIterations } = useContext(NetworkContext);
|
|
9531
10498
|
const id = runIdRef.current;
|
|
9532
10499
|
const currentState = id ? state[id] : void 0;
|
|
10500
|
+
const runtimeContextInstance = new RuntimeContext$1();
|
|
10501
|
+
Object.entries(runtimeContext ?? {}).forEach(([key, value]) => {
|
|
10502
|
+
runtimeContextInstance.set(key, value);
|
|
10503
|
+
});
|
|
9533
10504
|
useEffect(() => {
|
|
9534
10505
|
if (!currentState) return;
|
|
9535
10506
|
const hasFinished = Boolean(currentState?.steps?.["finish"]);
|
|
@@ -9821,7 +10792,8 @@ ${formatted}\`\`\``;
|
|
|
9821
10792
|
message: input,
|
|
9822
10793
|
threadId,
|
|
9823
10794
|
resourceId: networkId,
|
|
9824
|
-
maxIterations
|
|
10795
|
+
maxIterations,
|
|
10796
|
+
runtimeContext: runtimeContextInstance
|
|
9825
10797
|
},
|
|
9826
10798
|
async (record) => {
|
|
9827
10799
|
if (record.type === "step-start" && record.payload?.id === "Agent-Network-Outer-Workflow") {
|
|
@@ -9915,7 +10887,8 @@ ${formatted}\`\`\``;
|
|
|
9915
10887
|
{
|
|
9916
10888
|
message: input,
|
|
9917
10889
|
threadId,
|
|
9918
|
-
resourceId: networkId
|
|
10890
|
+
resourceId: networkId,
|
|
10891
|
+
runtimeContext: runtimeContextInstance
|
|
9919
10892
|
},
|
|
9920
10893
|
(record) => {
|
|
9921
10894
|
if (runIdRef.current) {
|
|
@@ -10000,6 +10973,7 @@ const VNextNetworkChat = ({
|
|
|
10000
10973
|
memory,
|
|
10001
10974
|
refreshThreadList
|
|
10002
10975
|
}) => {
|
|
10976
|
+
const { runtimeContext } = usePlaygroundStore();
|
|
10003
10977
|
return /* @__PURE__ */ jsx(MessagesProvider, { children: /* @__PURE__ */ jsx(VNextNetworkChatProvider, { children: /* @__PURE__ */ jsx(
|
|
10004
10978
|
VNextMastraNetworkRuntimeProvider,
|
|
10005
10979
|
{
|
|
@@ -10008,6 +10982,7 @@ const VNextNetworkChat = ({
|
|
|
10008
10982
|
threadId,
|
|
10009
10983
|
memory,
|
|
10010
10984
|
refreshThreadList,
|
|
10985
|
+
runtimeContext,
|
|
10011
10986
|
children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4", children: /* @__PURE__ */ jsx(NetworkThread, { hasMemory: memory, networkName }) })
|
|
10012
10987
|
},
|
|
10013
10988
|
threadId
|
|
@@ -11806,21 +12781,6 @@ const EntityContent = ({ children, className }) => {
|
|
|
11806
12781
|
return /* @__PURE__ */ jsx("div", { className, children });
|
|
11807
12782
|
};
|
|
11808
12783
|
|
|
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
12784
|
function usePolling({
|
|
11825
12785
|
fetchFn,
|
|
11826
12786
|
interval = 3e3,
|
|
@@ -11928,5 +12888,5 @@ function usePolling({
|
|
|
11928
12888
|
};
|
|
11929
12889
|
}
|
|
11930
12890
|
|
|
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 };
|
|
12891
|
+
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, 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, 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, WorkingMemoryContext, WorkingMemoryProvider, useAgentSettings, useCurrentRun, useLinkComponent, useMastraClient, usePlaygroundStore, usePolling, useSpeechRecognition, useWorkingMemory };
|
|
11932
12892
|
//# sourceMappingURL=index.es.js.map
|