@mastra/playground-ui 0.0.0-zod-v4-compat-part-2-20250820135355 → 0.0.0-zod-v4-stuff-20250825154219
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 +1000 -298
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1006 -304
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/ui/autoform/zodProvider/field-type-inference.d.ts +3 -0
- package/dist/src/components/ui/autoform/zodProvider/index.d.ts +10 -0
- package/dist/src/components/ui/elements/buttons/button.d.ts +12 -0
- package/dist/src/components/ui/elements/buttons/button.stories.d.ts +13 -0
- package/dist/src/components/ui/elements/buttons/index.d.ts +1 -0
- package/dist/src/components/ui/elements/entry-list/entry-list-cell.d.ts +3 -0
- package/dist/src/components/ui/elements/entry-list/entry-list-item.d.ts +8 -0
- package/dist/src/components/ui/elements/entry-list/entry-list-page-header.d.ts +8 -0
- package/dist/src/components/ui/elements/entry-list/entry-list-toolbar.d.ts +6 -0
- package/dist/src/components/ui/elements/entry-list/entry-list.d.ts +15 -0
- package/dist/src/components/ui/elements/entry-list/index.d.ts +6 -0
- package/dist/src/components/ui/elements/entry-list/shared.d.ts +6 -0
- package/dist/src/components/ui/elements/form-fields/form-actions.d.ts +12 -0
- package/dist/src/components/ui/elements/form-fields/index.d.ts +7 -0
- package/dist/src/components/ui/elements/form-fields/input-field.d.ts +14 -0
- package/dist/src/components/ui/elements/form-fields/input-field.stories.d.ts +15 -0
- package/dist/src/components/ui/elements/form-fields/radio-group-field.d.ts +21 -0
- package/dist/src/components/ui/elements/form-fields/search-field.d.ts +2 -0
- package/dist/src/components/ui/elements/form-fields/select-field.d.ts +19 -0
- package/dist/src/components/ui/elements/form-fields/select-field.stories.d.ts +13 -0
- package/dist/src/components/ui/elements/form-fields/slider-field.d.ts +15 -0
- package/dist/src/components/ui/elements/form-fields/textarea-field.d.ts +11 -0
- package/dist/src/components/ui/elements/headers/entity-main-header.d.ts +11 -0
- package/dist/src/components/ui/elements/headers/index.d.ts +1 -0
- package/dist/src/components/ui/elements/index.d.ts +2 -0
- package/dist/src/components/ui/elements/key-value-list/index.d.ts +1 -0
- package/dist/src/components/ui/elements/key-value-list/key-value-list.d.ts +24 -0
- package/dist/src/components/ui/elements/key-value-list/key-value-list.stories.d.ts +12 -0
- package/dist/src/components/ui/elements/select/index.d.ts +1 -0
- package/dist/src/components/ui/elements/select/select.d.ts +10 -0
- package/dist/src/components/ui/elements/side-dialog/index.d.ts +5 -0
- package/dist/src/components/ui/elements/side-dialog/side-dialog-content.d.ts +21 -0
- package/dist/src/components/ui/elements/side-dialog/side-dialog-footer.d.ts +10 -0
- package/dist/src/components/ui/elements/side-dialog/side-dialog-header.d.ts +5 -0
- package/dist/src/components/ui/elements/side-dialog/side-dialog-top.d.ts +7 -0
- package/dist/src/components/ui/elements/side-dialog/side-dialog.d.ts +10 -0
- package/dist/src/components/ui/elements/tabs/index.d.ts +1 -0
- package/dist/src/components/ui/elements/tabs/tabs.d.ts +40 -0
- package/dist/src/domains/agents/components/agent-chat.d.ts +1 -1
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata-model-switcher.d.ts +11 -0
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata.d.ts +4 -1
- package/dist/src/domains/agents/components/agent-metadata/models.d.ts +5 -0
- package/dist/src/domains/agents/components/agent-settings.d.ts +3 -1
- package/dist/src/services/mastra-runtime-provider.d.ts +1 -1
- package/dist/src/types.d.ts +5 -19
- package/package.json +18 -11
package/dist/index.cjs.js
CHANGED
|
@@ -37,6 +37,8 @@ const prettierPluginBabel = require('prettier/plugins/babel');
|
|
|
37
37
|
const prettierPluginEstree = require('prettier/plugins/estree');
|
|
38
38
|
const colors = require('./colors-DLwJ7rFA.cjs');
|
|
39
39
|
const reactTable = require('@tanstack/react-table');
|
|
40
|
+
const SelectPrimitive = require('@radix-ui/react-select');
|
|
41
|
+
const PopoverPrimitive = require('@radix-ui/react-popover');
|
|
40
42
|
const AlertDialogPrimitive = require('@radix-ui/react-alert-dialog');
|
|
41
43
|
const uiUtils = require('@ai-sdk/ui-utils');
|
|
42
44
|
const Markdown = require('react-markdown');
|
|
@@ -54,9 +56,8 @@ const z = require('zod');
|
|
|
54
56
|
const react$3 = require('@autoform/react');
|
|
55
57
|
const CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
56
58
|
const reactDayPicker = require('react-day-picker');
|
|
57
|
-
const PopoverPrimitive = require('@radix-ui/react-popover');
|
|
58
|
-
const SelectPrimitive = require('@radix-ui/react-select');
|
|
59
59
|
const v4 = require('@autoform/zod/v4');
|
|
60
|
+
const v3 = require('zod/v3');
|
|
60
61
|
const reactCodeBlock = require('react-code-block');
|
|
61
62
|
const reactQuery = require('@tanstack/react-query');
|
|
62
63
|
|
|
@@ -86,11 +87,11 @@ const SliderPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SliderP
|
|
|
86
87
|
const LabelPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(LabelPrimitive);
|
|
87
88
|
const RadioGroupPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(RadioGroupPrimitive);
|
|
88
89
|
const CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CollapsiblePrimitive);
|
|
90
|
+
const SelectPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SelectPrimitive);
|
|
91
|
+
const PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(PopoverPrimitive);
|
|
89
92
|
const AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(AlertDialogPrimitive);
|
|
90
93
|
const ScrollAreaPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(ScrollAreaPrimitive);
|
|
91
94
|
const CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CheckboxPrimitive);
|
|
92
|
-
const PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(PopoverPrimitive);
|
|
93
|
-
const SelectPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(SelectPrimitive);
|
|
94
95
|
|
|
95
96
|
const createMastraClient = (baseUrl, mastraClientHeaders = {}) => {
|
|
96
97
|
return new clientJs.MastraClient({
|
|
@@ -5394,7 +5395,8 @@ function MastraRuntimeProvider({
|
|
|
5394
5395
|
threadId,
|
|
5395
5396
|
refreshThreadList,
|
|
5396
5397
|
settings,
|
|
5397
|
-
runtimeContext
|
|
5398
|
+
runtimeContext,
|
|
5399
|
+
modelVersion
|
|
5398
5400
|
}) {
|
|
5399
5401
|
const [isRunning, setIsRunning] = React.useState(false);
|
|
5400
5402
|
const [messages, setMessages] = React.useState([]);
|
|
@@ -5412,6 +5414,8 @@ function MastraRuntimeProvider({
|
|
|
5412
5414
|
topP,
|
|
5413
5415
|
instructions,
|
|
5414
5416
|
chatWithGenerate,
|
|
5417
|
+
chatWithGenerateVNext,
|
|
5418
|
+
chatWithStreamVNext,
|
|
5415
5419
|
providerOptions
|
|
5416
5420
|
} = settings?.modelSettings ?? {};
|
|
5417
5421
|
const toolCallIdToName = React.useRef({});
|
|
@@ -5424,27 +5428,46 @@ function MastraRuntimeProvider({
|
|
|
5424
5428
|
if (messages.length === 0 || currentThreadId !== threadId || hasNewInitialMessages && currentThreadId === threadId) {
|
|
5425
5429
|
if (initialMessages && threadId && memory) {
|
|
5426
5430
|
const convertedMessages = initialMessages?.map((message) => {
|
|
5427
|
-
const toolInvocationsAsContentParts = (message.toolInvocations || []).map((toolInvocation) => ({
|
|
5428
|
-
type: "tool-call",
|
|
5429
|
-
toolCallId: toolInvocation?.toolCallId,
|
|
5430
|
-
toolName: toolInvocation?.toolName,
|
|
5431
|
-
args: toolInvocation?.args,
|
|
5432
|
-
result: toolInvocation?.result
|
|
5433
|
-
}));
|
|
5434
5431
|
const attachmentsAsContentParts = (message.experimental_attachments || []).map((image) => ({
|
|
5435
5432
|
type: image.contentType.startsWith(`image/`) ? "image" : image.contentType.startsWith(`audio/`) ? "audio" : "file",
|
|
5436
5433
|
mimeType: image.contentType,
|
|
5437
5434
|
image: image.url
|
|
5438
5435
|
}));
|
|
5439
|
-
const
|
|
5436
|
+
const formattedParts = (message.parts || []).map((part) => {
|
|
5437
|
+
if (part.type === "reasoning") {
|
|
5438
|
+
return {
|
|
5439
|
+
type: "reasoning",
|
|
5440
|
+
text: part.reasoning || part?.details?.filter((detail) => detail.type === "text")?.map((detail) => detail.text).join(" ")
|
|
5441
|
+
};
|
|
5442
|
+
}
|
|
5443
|
+
if (part.type === "tool-invocation") {
|
|
5444
|
+
if (part.toolInvocation.state === "result") {
|
|
5445
|
+
return {
|
|
5446
|
+
type: "tool-call",
|
|
5447
|
+
toolCallId: part.toolInvocation.toolCallId,
|
|
5448
|
+
toolName: part.toolInvocation.toolName,
|
|
5449
|
+
args: part.toolInvocation.args,
|
|
5450
|
+
result: part.toolInvocation.result
|
|
5451
|
+
};
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5454
|
+
if (part.type === "file") {
|
|
5455
|
+
return {
|
|
5456
|
+
type: "file",
|
|
5457
|
+
mimeType: part.mimeType,
|
|
5458
|
+
data: part.data
|
|
5459
|
+
};
|
|
5460
|
+
}
|
|
5461
|
+
if (part.type === "text") {
|
|
5462
|
+
return {
|
|
5463
|
+
type: "text",
|
|
5464
|
+
text: part.text
|
|
5465
|
+
};
|
|
5466
|
+
}
|
|
5467
|
+
}).filter(Boolean);
|
|
5440
5468
|
return {
|
|
5441
5469
|
...message,
|
|
5442
|
-
content: [
|
|
5443
|
-
...reasoning ? [{ type: "reasoning", text: reasoning }] : [],
|
|
5444
|
-
...typeof message.content === "string" ? [{ type: "text", text: message.content }] : [],
|
|
5445
|
-
...toolInvocationsAsContentParts,
|
|
5446
|
-
...attachmentsAsContentParts
|
|
5447
|
-
]
|
|
5470
|
+
content: [...formattedParts, ...attachmentsAsContentParts]
|
|
5448
5471
|
};
|
|
5449
5472
|
}).filter(Boolean);
|
|
5450
5473
|
setMessages(convertedMessages);
|
|
@@ -5470,31 +5493,9 @@ function MastraRuntimeProvider({
|
|
|
5470
5493
|
});
|
|
5471
5494
|
const agent = clientWithAbort.getAgent(agentId);
|
|
5472
5495
|
try {
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
messages
|
|
5476
|
-
{
|
|
5477
|
-
role: "user",
|
|
5478
|
-
content: input
|
|
5479
|
-
},
|
|
5480
|
-
...attachments
|
|
5481
|
-
],
|
|
5482
|
-
runId: agentId,
|
|
5483
|
-
frequencyPenalty,
|
|
5484
|
-
presencePenalty,
|
|
5485
|
-
maxRetries,
|
|
5486
|
-
maxSteps,
|
|
5487
|
-
maxTokens,
|
|
5488
|
-
temperature,
|
|
5489
|
-
topK,
|
|
5490
|
-
topP,
|
|
5491
|
-
instructions,
|
|
5492
|
-
runtimeContext: runtimeContextInstance,
|
|
5493
|
-
...memory ? { threadId, resourceId: agentId } : {},
|
|
5494
|
-
providerOptions
|
|
5495
|
-
});
|
|
5496
|
-
if (generateResponse.response && "messages" in generateResponse.response) {
|
|
5497
|
-
const latestMessage = generateResponse.response.messages.reduce(
|
|
5496
|
+
let handleGenerateResponse = function(generatedResponse) {
|
|
5497
|
+
if (generatedResponse.response && "messages" in generatedResponse.response) {
|
|
5498
|
+
const latestMessage = generatedResponse.response.messages.reduce(
|
|
5498
5499
|
(acc, message2) => {
|
|
5499
5500
|
const _content = Array.isArray(acc.content) ? acc.content : [];
|
|
5500
5501
|
if (typeof message2.content === "string") {
|
|
@@ -5502,7 +5503,7 @@ function MastraRuntimeProvider({
|
|
|
5502
5503
|
...acc,
|
|
5503
5504
|
content: [
|
|
5504
5505
|
..._content,
|
|
5505
|
-
...
|
|
5506
|
+
...generatedResponse.reasoning ? [{ type: "reasoning", text: generatedResponse.reasoning }] : [],
|
|
5506
5507
|
{
|
|
5507
5508
|
type: "text",
|
|
5508
5509
|
text: message2.content
|
|
@@ -5514,9 +5515,14 @@ function MastraRuntimeProvider({
|
|
|
5514
5515
|
const toolCallContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "tool-call") : void 0;
|
|
5515
5516
|
const reasoningContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "reasoning") : void 0;
|
|
5516
5517
|
if (toolCallContent) {
|
|
5517
|
-
const newContent =
|
|
5518
|
+
const newContent = message2.content.map((c) => {
|
|
5518
5519
|
if (c.type === "tool-call" && c.toolCallId === toolCallContent?.toolCallId) {
|
|
5519
|
-
return {
|
|
5520
|
+
return {
|
|
5521
|
+
...c,
|
|
5522
|
+
toolCallId: toolCallContent.toolCallId,
|
|
5523
|
+
toolName: toolCallContent.toolName,
|
|
5524
|
+
args: toolCallContent.input
|
|
5525
|
+
};
|
|
5520
5526
|
}
|
|
5521
5527
|
return c;
|
|
5522
5528
|
});
|
|
@@ -5539,7 +5545,7 @@ function MastraRuntimeProvider({
|
|
|
5539
5545
|
if (toolResult) {
|
|
5540
5546
|
const newContent = _content.map((c) => {
|
|
5541
5547
|
if (c.type === "tool-call" && c.toolCallId === toolResult?.toolCallId) {
|
|
5542
|
-
return { ...c, result: toolResult.
|
|
5548
|
+
return { ...c, result: toolResult.output?.value };
|
|
5543
5549
|
}
|
|
5544
5550
|
return c;
|
|
5545
5551
|
});
|
|
@@ -5548,7 +5554,7 @@ function MastraRuntimeProvider({
|
|
|
5548
5554
|
...acc,
|
|
5549
5555
|
content: containsToolCall ? newContent : [
|
|
5550
5556
|
..._content,
|
|
5551
|
-
{ type: "tool-result", toolCallId: toolResult.toolCallId, result: toolResult.
|
|
5557
|
+
{ type: "tool-result", toolCallId: toolResult.toolCallId, result: toolResult.output?.value }
|
|
5552
5558
|
]
|
|
5553
5559
|
};
|
|
5554
5560
|
}
|
|
@@ -5562,84 +5568,418 @@ function MastraRuntimeProvider({
|
|
|
5562
5568
|
{ role: "assistant", content: [] }
|
|
5563
5569
|
);
|
|
5564
5570
|
setMessages((currentConversation) => [...currentConversation, latestMessage]);
|
|
5565
|
-
|
|
5571
|
+
if (generatedResponse.finishReason) {
|
|
5572
|
+
handleFinishReason(generatedResponse.finishReason);
|
|
5573
|
+
}
|
|
5566
5574
|
}
|
|
5567
|
-
}
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5575
|
+
};
|
|
5576
|
+
if (modelVersion === "v2") {
|
|
5577
|
+
if (chatWithGenerateVNext) {
|
|
5578
|
+
const response = await agent.generateVNext({
|
|
5579
|
+
messages: [
|
|
5580
|
+
{
|
|
5581
|
+
role: "user",
|
|
5582
|
+
content: input
|
|
5583
|
+
},
|
|
5584
|
+
...attachments
|
|
5585
|
+
],
|
|
5586
|
+
runId: agentId,
|
|
5587
|
+
modelSettings: {
|
|
5588
|
+
frequencyPenalty,
|
|
5589
|
+
presencePenalty,
|
|
5590
|
+
maxRetries,
|
|
5591
|
+
temperature,
|
|
5592
|
+
topK,
|
|
5593
|
+
topP,
|
|
5594
|
+
maxOutputTokens: maxTokens
|
|
5595
|
+
},
|
|
5596
|
+
providerOptions,
|
|
5597
|
+
instructions,
|
|
5598
|
+
runtimeContext: runtimeContextInstance,
|
|
5599
|
+
...memory ? { threadId, resourceId: agentId } : {}
|
|
5600
|
+
});
|
|
5601
|
+
handleGenerateResponse(response);
|
|
5602
|
+
setIsRunning(false);
|
|
5603
|
+
return;
|
|
5604
|
+
} else {
|
|
5605
|
+
let updater = function() {
|
|
5606
|
+
setMessages((currentConversation) => {
|
|
5607
|
+
const message2 = {
|
|
5608
|
+
role: "assistant",
|
|
5609
|
+
content: [{ type: "text", text: content }]
|
|
5610
|
+
};
|
|
5611
|
+
if (!assistantMessageAdded) {
|
|
5612
|
+
assistantMessageAdded = true;
|
|
5613
|
+
if (assistantToolCallAddedForUpdater) {
|
|
5614
|
+
assistantToolCallAddedForUpdater = false;
|
|
5615
|
+
}
|
|
5616
|
+
return [...currentConversation, message2];
|
|
5617
|
+
}
|
|
5576
5618
|
if (assistantToolCallAddedForUpdater) {
|
|
5577
5619
|
assistantToolCallAddedForUpdater = false;
|
|
5620
|
+
return [...currentConversation, message2];
|
|
5621
|
+
}
|
|
5622
|
+
return [...currentConversation.slice(0, -1), message2];
|
|
5623
|
+
});
|
|
5624
|
+
};
|
|
5625
|
+
const response = await agent.streamVNext({
|
|
5626
|
+
messages: [
|
|
5627
|
+
{
|
|
5628
|
+
role: "user",
|
|
5629
|
+
content: input
|
|
5630
|
+
},
|
|
5631
|
+
...attachments
|
|
5632
|
+
],
|
|
5633
|
+
runId: agentId,
|
|
5634
|
+
modelSettings: {
|
|
5635
|
+
frequencyPenalty,
|
|
5636
|
+
presencePenalty,
|
|
5637
|
+
maxRetries,
|
|
5638
|
+
maxOutputTokens: maxTokens,
|
|
5639
|
+
temperature,
|
|
5640
|
+
topK,
|
|
5641
|
+
topP
|
|
5642
|
+
},
|
|
5643
|
+
instructions,
|
|
5644
|
+
runtimeContext: runtimeContextInstance,
|
|
5645
|
+
...memory ? { threadId, resourceId: agentId } : {},
|
|
5646
|
+
providerOptions
|
|
5647
|
+
});
|
|
5648
|
+
if (!response.body) {
|
|
5649
|
+
throw new Error("No response body");
|
|
5650
|
+
}
|
|
5651
|
+
let content = "";
|
|
5652
|
+
let assistantMessageAdded = false;
|
|
5653
|
+
let assistantToolCallAddedForUpdater = false;
|
|
5654
|
+
let assistantToolCallAddedForContent = false;
|
|
5655
|
+
await response.processDataStream({
|
|
5656
|
+
onChunk: async (chunk) => {
|
|
5657
|
+
switch (chunk.type) {
|
|
5658
|
+
case "text-delta": {
|
|
5659
|
+
if (assistantToolCallAddedForContent) {
|
|
5660
|
+
assistantToolCallAddedForContent = false;
|
|
5661
|
+
content = chunk.payload.text;
|
|
5662
|
+
} else {
|
|
5663
|
+
content += chunk.payload.text;
|
|
5664
|
+
}
|
|
5665
|
+
console.log(chunk.payload.text, "VALUE");
|
|
5666
|
+
updater();
|
|
5667
|
+
break;
|
|
5668
|
+
}
|
|
5669
|
+
case "tool-call": {
|
|
5670
|
+
setMessages((currentConversation) => {
|
|
5671
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
5672
|
+
if (lastMessage && lastMessage.role === "assistant") {
|
|
5673
|
+
const updatedMessage = {
|
|
5674
|
+
...lastMessage,
|
|
5675
|
+
content: Array.isArray(lastMessage.content) ? [
|
|
5676
|
+
...lastMessage.content,
|
|
5677
|
+
{
|
|
5678
|
+
type: "tool-call",
|
|
5679
|
+
toolCallId: chunk.payload.toolCallId,
|
|
5680
|
+
toolName: chunk.payload.toolName,
|
|
5681
|
+
args: chunk.payload.args
|
|
5682
|
+
}
|
|
5683
|
+
] : [
|
|
5684
|
+
...typeof lastMessage.content === "string" ? [{ type: "text", text: lastMessage.content }] : [],
|
|
5685
|
+
{
|
|
5686
|
+
type: "tool-call",
|
|
5687
|
+
toolCallId: chunk.payload.toolCallId,
|
|
5688
|
+
toolName: chunk.payload.toolName,
|
|
5689
|
+
args: chunk.payload.args
|
|
5690
|
+
}
|
|
5691
|
+
]
|
|
5692
|
+
};
|
|
5693
|
+
assistantToolCallAddedForUpdater = true;
|
|
5694
|
+
assistantToolCallAddedForContent = true;
|
|
5695
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
5696
|
+
}
|
|
5697
|
+
const newMessage = {
|
|
5698
|
+
role: "assistant",
|
|
5699
|
+
content: [
|
|
5700
|
+
{ type: "text", text: content },
|
|
5701
|
+
{
|
|
5702
|
+
type: "tool-call",
|
|
5703
|
+
toolCallId: chunk.payload.toolCallId,
|
|
5704
|
+
toolName: chunk.payload.toolName,
|
|
5705
|
+
args: chunk.payload.args
|
|
5706
|
+
}
|
|
5707
|
+
]
|
|
5708
|
+
};
|
|
5709
|
+
assistantToolCallAddedForUpdater = true;
|
|
5710
|
+
assistantToolCallAddedForContent = true;
|
|
5711
|
+
return [...currentConversation, newMessage];
|
|
5712
|
+
});
|
|
5713
|
+
toolCallIdToName.current[chunk.payload.toolCallId] = chunk.payload.toolName;
|
|
5714
|
+
break;
|
|
5715
|
+
}
|
|
5716
|
+
case "tool-result": {
|
|
5717
|
+
setMessages((currentConversation) => {
|
|
5718
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
5719
|
+
if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
|
|
5720
|
+
const updatedContent = lastMessage.content.map((part) => {
|
|
5721
|
+
if (typeof part === "object" && part.type === "tool-call" && part.toolCallId === chunk.payload.toolCallId) {
|
|
5722
|
+
return {
|
|
5723
|
+
...part,
|
|
5724
|
+
result: chunk.payload.result
|
|
5725
|
+
};
|
|
5726
|
+
}
|
|
5727
|
+
return part;
|
|
5728
|
+
});
|
|
5729
|
+
const updatedMessage = {
|
|
5730
|
+
...lastMessage,
|
|
5731
|
+
content: updatedContent
|
|
5732
|
+
};
|
|
5733
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
5734
|
+
}
|
|
5735
|
+
return currentConversation;
|
|
5736
|
+
});
|
|
5737
|
+
try {
|
|
5738
|
+
const toolName = toolCallIdToName.current[chunk.payload.toolCallId];
|
|
5739
|
+
if (toolName === "updateWorkingMemory" && chunk.payload.result?.success) {
|
|
5740
|
+
await refreshWorkingMemory?.();
|
|
5741
|
+
}
|
|
5742
|
+
} finally {
|
|
5743
|
+
delete toolCallIdToName.current[chunk.payload.toolCallId];
|
|
5744
|
+
}
|
|
5745
|
+
break;
|
|
5746
|
+
}
|
|
5747
|
+
case "error": {
|
|
5748
|
+
if (typeof chunk.payload.error === "string") {
|
|
5749
|
+
throw new Error(chunk.payload.error);
|
|
5750
|
+
}
|
|
5751
|
+
break;
|
|
5752
|
+
}
|
|
5753
|
+
case "finish": {
|
|
5754
|
+
handleFinishReason(chunk.payload.finishReason);
|
|
5755
|
+
break;
|
|
5756
|
+
}
|
|
5757
|
+
case "reasoning-delta": {
|
|
5758
|
+
setMessages((currentConversation) => {
|
|
5759
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
5760
|
+
if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
|
|
5761
|
+
const updatedContent = lastMessage.content.map((part) => {
|
|
5762
|
+
if (typeof part === "object" && part.type === "reasoning") {
|
|
5763
|
+
return {
|
|
5764
|
+
...part,
|
|
5765
|
+
text: part.text + chunk.payload.text
|
|
5766
|
+
};
|
|
5767
|
+
}
|
|
5768
|
+
return part;
|
|
5769
|
+
});
|
|
5770
|
+
const updatedMessage = {
|
|
5771
|
+
...lastMessage,
|
|
5772
|
+
content: updatedContent
|
|
5773
|
+
};
|
|
5774
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
5775
|
+
}
|
|
5776
|
+
const newMessage = {
|
|
5777
|
+
role: "assistant",
|
|
5778
|
+
content: [
|
|
5779
|
+
{
|
|
5780
|
+
type: "reasoning",
|
|
5781
|
+
text: chunk.payload.text
|
|
5782
|
+
},
|
|
5783
|
+
{ type: "text", text: content }
|
|
5784
|
+
]
|
|
5785
|
+
};
|
|
5786
|
+
return [...currentConversation, newMessage];
|
|
5787
|
+
});
|
|
5788
|
+
break;
|
|
5789
|
+
}
|
|
5578
5790
|
}
|
|
5579
|
-
return [...currentConversation, message2];
|
|
5580
|
-
}
|
|
5581
|
-
if (assistantToolCallAddedForUpdater) {
|
|
5582
|
-
assistantToolCallAddedForUpdater = false;
|
|
5583
|
-
return [...currentConversation, message2];
|
|
5584
5791
|
}
|
|
5585
|
-
return [...currentConversation.slice(0, -1), message2];
|
|
5586
5792
|
});
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
messages: [
|
|
5590
|
-
{
|
|
5591
|
-
role: "user",
|
|
5592
|
-
content: input
|
|
5593
|
-
},
|
|
5594
|
-
...attachments
|
|
5595
|
-
],
|
|
5596
|
-
runId: agentId,
|
|
5597
|
-
frequencyPenalty,
|
|
5598
|
-
presencePenalty,
|
|
5599
|
-
maxRetries,
|
|
5600
|
-
maxSteps,
|
|
5601
|
-
maxTokens,
|
|
5602
|
-
temperature,
|
|
5603
|
-
topK,
|
|
5604
|
-
topP,
|
|
5605
|
-
instructions,
|
|
5606
|
-
runtimeContext: runtimeContextInstance,
|
|
5607
|
-
...memory ? { threadId, resourceId: agentId } : {},
|
|
5608
|
-
providerOptions
|
|
5609
|
-
});
|
|
5610
|
-
if (!response.body) {
|
|
5611
|
-
throw new Error("No response body");
|
|
5793
|
+
setIsRunning(false);
|
|
5794
|
+
return;
|
|
5612
5795
|
}
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5796
|
+
} else {
|
|
5797
|
+
if (chatWithGenerate) {
|
|
5798
|
+
const generateResponse = await agent.generate({
|
|
5799
|
+
messages: [
|
|
5800
|
+
{
|
|
5801
|
+
role: "user",
|
|
5802
|
+
content: input
|
|
5803
|
+
},
|
|
5804
|
+
...attachments
|
|
5805
|
+
],
|
|
5806
|
+
runId: agentId,
|
|
5807
|
+
frequencyPenalty,
|
|
5808
|
+
presencePenalty,
|
|
5809
|
+
maxRetries,
|
|
5810
|
+
maxSteps,
|
|
5811
|
+
maxTokens,
|
|
5812
|
+
temperature,
|
|
5813
|
+
topK,
|
|
5814
|
+
topP,
|
|
5815
|
+
instructions,
|
|
5816
|
+
runtimeContext: runtimeContextInstance,
|
|
5817
|
+
...memory ? { threadId, resourceId: agentId } : {},
|
|
5818
|
+
providerOptions
|
|
5819
|
+
});
|
|
5820
|
+
if (generateResponse.response && "messages" in generateResponse.response) {
|
|
5821
|
+
const latestMessage = generateResponse.response.messages.reduce(
|
|
5822
|
+
(acc, message2) => {
|
|
5823
|
+
const _content = Array.isArray(acc.content) ? acc.content : [];
|
|
5824
|
+
if (typeof message2.content === "string") {
|
|
5825
|
+
return {
|
|
5826
|
+
...acc,
|
|
5827
|
+
content: [
|
|
5828
|
+
..._content,
|
|
5829
|
+
...generateResponse.reasoning ? [{ type: "reasoning", text: generateResponse.reasoning }] : [],
|
|
5830
|
+
{
|
|
5831
|
+
type: "text",
|
|
5832
|
+
text: message2.content
|
|
5833
|
+
}
|
|
5834
|
+
]
|
|
5835
|
+
};
|
|
5836
|
+
}
|
|
5837
|
+
if (message2.role === "assistant") {
|
|
5838
|
+
const toolCallContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "tool-call") : void 0;
|
|
5839
|
+
const reasoningContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "reasoning") : void 0;
|
|
5840
|
+
if (toolCallContent) {
|
|
5841
|
+
const newContent = _content.map((c) => {
|
|
5842
|
+
if (c.type === "tool-call" && c.toolCallId === toolCallContent?.toolCallId) {
|
|
5843
|
+
return { ...c, ...toolCallContent };
|
|
5844
|
+
}
|
|
5845
|
+
return c;
|
|
5846
|
+
});
|
|
5847
|
+
const containsToolCall = newContent.some((c) => c.type === "tool-call");
|
|
5848
|
+
return {
|
|
5849
|
+
...acc,
|
|
5850
|
+
content: containsToolCall ? [...reasoningContent ? [reasoningContent] : [], ...newContent] : [..._content, ...reasoningContent ? [reasoningContent] : [], toolCallContent]
|
|
5851
|
+
};
|
|
5852
|
+
}
|
|
5853
|
+
const textContent = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "text" && content.text) : void 0;
|
|
5854
|
+
if (textContent) {
|
|
5855
|
+
return {
|
|
5856
|
+
...acc,
|
|
5857
|
+
content: [..._content, ...reasoningContent ? [reasoningContent] : [], textContent]
|
|
5858
|
+
};
|
|
5859
|
+
}
|
|
5860
|
+
}
|
|
5861
|
+
if (message2.role === "tool") {
|
|
5862
|
+
const toolResult = Array.isArray(message2.content) ? message2.content.find((content) => content.type === "tool-result") : void 0;
|
|
5863
|
+
if (toolResult) {
|
|
5864
|
+
const newContent = _content.map((c) => {
|
|
5865
|
+
if (c.type === "tool-call" && c.toolCallId === toolResult?.toolCallId) {
|
|
5866
|
+
return { ...c, result: toolResult.result };
|
|
5867
|
+
}
|
|
5868
|
+
return c;
|
|
5869
|
+
});
|
|
5870
|
+
const containsToolCall = newContent.some((c) => c.type === "tool-call");
|
|
5871
|
+
return {
|
|
5872
|
+
...acc,
|
|
5873
|
+
content: containsToolCall ? newContent : [
|
|
5874
|
+
..._content,
|
|
5875
|
+
{ type: "tool-result", toolCallId: toolResult.toolCallId, result: toolResult.result }
|
|
5876
|
+
]
|
|
5877
|
+
};
|
|
5878
|
+
}
|
|
5879
|
+
return {
|
|
5880
|
+
...acc,
|
|
5881
|
+
content: [..._content, toolResult]
|
|
5882
|
+
};
|
|
5883
|
+
}
|
|
5884
|
+
return acc;
|
|
5885
|
+
},
|
|
5886
|
+
{ role: "assistant", content: [] }
|
|
5887
|
+
);
|
|
5888
|
+
setMessages((currentConversation) => [...currentConversation, latestMessage]);
|
|
5889
|
+
handleFinishReason(generateResponse.finishReason);
|
|
5890
|
+
}
|
|
5891
|
+
} else {
|
|
5892
|
+
let updater = function() {
|
|
5628
5893
|
setMessages((currentConversation) => {
|
|
5629
|
-
const
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5894
|
+
const message2 = {
|
|
5895
|
+
role: "assistant",
|
|
5896
|
+
content: [{ type: "text", text: content }]
|
|
5897
|
+
};
|
|
5898
|
+
if (!assistantMessageAdded) {
|
|
5899
|
+
assistantMessageAdded = true;
|
|
5900
|
+
if (assistantToolCallAddedForUpdater) {
|
|
5901
|
+
assistantToolCallAddedForUpdater = false;
|
|
5902
|
+
}
|
|
5903
|
+
return [...currentConversation, message2];
|
|
5904
|
+
}
|
|
5905
|
+
if (assistantToolCallAddedForUpdater) {
|
|
5906
|
+
assistantToolCallAddedForUpdater = false;
|
|
5907
|
+
return [...currentConversation, message2];
|
|
5908
|
+
}
|
|
5909
|
+
return [...currentConversation.slice(0, -1), message2];
|
|
5910
|
+
});
|
|
5911
|
+
};
|
|
5912
|
+
const response = await agent.stream({
|
|
5913
|
+
messages: [
|
|
5914
|
+
{
|
|
5915
|
+
role: "user",
|
|
5916
|
+
content: input
|
|
5917
|
+
},
|
|
5918
|
+
...attachments
|
|
5919
|
+
],
|
|
5920
|
+
runId: agentId,
|
|
5921
|
+
frequencyPenalty,
|
|
5922
|
+
presencePenalty,
|
|
5923
|
+
maxRetries,
|
|
5924
|
+
maxSteps,
|
|
5925
|
+
maxTokens,
|
|
5926
|
+
temperature,
|
|
5927
|
+
topK,
|
|
5928
|
+
topP,
|
|
5929
|
+
instructions,
|
|
5930
|
+
runtimeContext: runtimeContextInstance,
|
|
5931
|
+
...memory ? { threadId, resourceId: agentId } : {},
|
|
5932
|
+
providerOptions
|
|
5933
|
+
});
|
|
5934
|
+
if (!response.body) {
|
|
5935
|
+
throw new Error("No response body");
|
|
5936
|
+
}
|
|
5937
|
+
let content = "";
|
|
5938
|
+
let assistantMessageAdded = false;
|
|
5939
|
+
let assistantToolCallAddedForUpdater = false;
|
|
5940
|
+
let assistantToolCallAddedForContent = false;
|
|
5941
|
+
await response.processDataStream({
|
|
5942
|
+
onTextPart(value) {
|
|
5943
|
+
if (assistantToolCallAddedForContent) {
|
|
5944
|
+
assistantToolCallAddedForContent = false;
|
|
5945
|
+
content = value;
|
|
5946
|
+
} else {
|
|
5947
|
+
content += value;
|
|
5948
|
+
}
|
|
5949
|
+
updater();
|
|
5950
|
+
},
|
|
5951
|
+
async onToolCallPart(value) {
|
|
5952
|
+
setMessages((currentConversation) => {
|
|
5953
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
5954
|
+
if (lastMessage && lastMessage.role === "assistant") {
|
|
5955
|
+
const updatedMessage = {
|
|
5956
|
+
...lastMessage,
|
|
5957
|
+
content: Array.isArray(lastMessage.content) ? [
|
|
5958
|
+
...lastMessage.content,
|
|
5959
|
+
{
|
|
5960
|
+
type: "tool-call",
|
|
5961
|
+
toolCallId: value.toolCallId,
|
|
5962
|
+
toolName: value.toolName,
|
|
5963
|
+
args: value.args
|
|
5964
|
+
}
|
|
5965
|
+
] : [
|
|
5966
|
+
...typeof lastMessage.content === "string" ? [{ type: "text", text: lastMessage.content }] : [],
|
|
5967
|
+
{
|
|
5968
|
+
type: "tool-call",
|
|
5969
|
+
toolCallId: value.toolCallId,
|
|
5970
|
+
toolName: value.toolName,
|
|
5971
|
+
args: value.args
|
|
5972
|
+
}
|
|
5973
|
+
]
|
|
5974
|
+
};
|
|
5975
|
+
assistantToolCallAddedForUpdater = true;
|
|
5976
|
+
assistantToolCallAddedForContent = true;
|
|
5977
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
5978
|
+
}
|
|
5979
|
+
const newMessage = {
|
|
5980
|
+
role: "assistant",
|
|
5981
|
+
content: [
|
|
5982
|
+
{ type: "text", text: content },
|
|
5643
5983
|
{
|
|
5644
5984
|
type: "tool-call",
|
|
5645
5985
|
toolCallId: value.toolCallId,
|
|
@@ -5650,95 +5990,80 @@ function MastraRuntimeProvider({
|
|
|
5650
5990
|
};
|
|
5651
5991
|
assistantToolCallAddedForUpdater = true;
|
|
5652
5992
|
assistantToolCallAddedForContent = true;
|
|
5653
|
-
return [...currentConversation
|
|
5993
|
+
return [...currentConversation, newMessage];
|
|
5994
|
+
});
|
|
5995
|
+
toolCallIdToName.current[value.toolCallId] = value.toolName;
|
|
5996
|
+
},
|
|
5997
|
+
async onToolResultPart(value) {
|
|
5998
|
+
setMessages((currentConversation) => {
|
|
5999
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
6000
|
+
if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
|
|
6001
|
+
const updatedContent = lastMessage.content.map((part) => {
|
|
6002
|
+
if (typeof part === "object" && part.type === "tool-call" && part.toolCallId === value.toolCallId) {
|
|
6003
|
+
return {
|
|
6004
|
+
...part,
|
|
6005
|
+
result: value.result
|
|
6006
|
+
};
|
|
6007
|
+
}
|
|
6008
|
+
return part;
|
|
6009
|
+
});
|
|
6010
|
+
const updatedMessage = {
|
|
6011
|
+
...lastMessage,
|
|
6012
|
+
content: updatedContent
|
|
6013
|
+
};
|
|
6014
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
6015
|
+
}
|
|
6016
|
+
return currentConversation;
|
|
6017
|
+
});
|
|
6018
|
+
try {
|
|
6019
|
+
const toolName = toolCallIdToName.current[value.toolCallId];
|
|
6020
|
+
if (toolName === "updateWorkingMemory" && value.result?.success) {
|
|
6021
|
+
await refreshWorkingMemory?.();
|
|
6022
|
+
}
|
|
6023
|
+
} finally {
|
|
6024
|
+
delete toolCallIdToName.current[value.toolCallId];
|
|
5654
6025
|
}
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
6026
|
+
},
|
|
6027
|
+
onErrorPart(error) {
|
|
6028
|
+
throw new Error(error);
|
|
6029
|
+
},
|
|
6030
|
+
onFinishMessagePart({ finishReason }) {
|
|
6031
|
+
handleFinishReason(finishReason);
|
|
6032
|
+
},
|
|
6033
|
+
onReasoningPart(value) {
|
|
6034
|
+
setMessages((currentConversation) => {
|
|
6035
|
+
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
6036
|
+
if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
|
|
6037
|
+
const updatedContent = lastMessage.content.map((part) => {
|
|
6038
|
+
if (typeof part === "object" && part.type === "reasoning") {
|
|
6039
|
+
return {
|
|
6040
|
+
...part,
|
|
6041
|
+
text: part.text + value
|
|
6042
|
+
};
|
|
6043
|
+
}
|
|
6044
|
+
return part;
|
|
6045
|
+
});
|
|
6046
|
+
const updatedMessage = {
|
|
6047
|
+
...lastMessage,
|
|
6048
|
+
content: updatedContent
|
|
6049
|
+
};
|
|
6050
|
+
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
6051
|
+
}
|
|
6052
|
+
const newMessage = {
|
|
6053
|
+
role: "assistant",
|
|
6054
|
+
content: [
|
|
6055
|
+
{
|
|
6056
|
+
type: "reasoning",
|
|
6057
|
+
text: value
|
|
6058
|
+
},
|
|
6059
|
+
{ type: "text", text: content }
|
|
6060
|
+
]
|
|
5689
6061
|
};
|
|
5690
|
-
return [...currentConversation
|
|
5691
|
-
}
|
|
5692
|
-
return currentConversation;
|
|
5693
|
-
});
|
|
5694
|
-
try {
|
|
5695
|
-
const toolName = toolCallIdToName.current[value.toolCallId];
|
|
5696
|
-
if (toolName === "updateWorkingMemory" && value.result?.success) {
|
|
5697
|
-
await refreshWorkingMemory?.();
|
|
5698
|
-
}
|
|
5699
|
-
} finally {
|
|
5700
|
-
delete toolCallIdToName.current[value.toolCallId];
|
|
6062
|
+
return [...currentConversation, newMessage];
|
|
6063
|
+
});
|
|
5701
6064
|
}
|
|
5702
|
-
}
|
|
5703
|
-
|
|
5704
|
-
throw new Error(error);
|
|
5705
|
-
},
|
|
5706
|
-
onFinishMessagePart({ finishReason }) {
|
|
5707
|
-
handleFinishReason(finishReason);
|
|
5708
|
-
},
|
|
5709
|
-
onReasoningPart(value) {
|
|
5710
|
-
setMessages((currentConversation) => {
|
|
5711
|
-
const lastMessage = currentConversation[currentConversation.length - 1];
|
|
5712
|
-
if (lastMessage && lastMessage.role === "assistant" && Array.isArray(lastMessage.content)) {
|
|
5713
|
-
const updatedContent = lastMessage.content.map((part) => {
|
|
5714
|
-
if (typeof part === "object" && part.type === "reasoning") {
|
|
5715
|
-
return {
|
|
5716
|
-
...part,
|
|
5717
|
-
text: part.text + value
|
|
5718
|
-
};
|
|
5719
|
-
}
|
|
5720
|
-
return part;
|
|
5721
|
-
});
|
|
5722
|
-
const updatedMessage = {
|
|
5723
|
-
...lastMessage,
|
|
5724
|
-
content: updatedContent
|
|
5725
|
-
};
|
|
5726
|
-
return [...currentConversation.slice(0, -1), updatedMessage];
|
|
5727
|
-
}
|
|
5728
|
-
const newMessage = {
|
|
5729
|
-
role: "assistant",
|
|
5730
|
-
content: [
|
|
5731
|
-
{
|
|
5732
|
-
type: "reasoning",
|
|
5733
|
-
text: value
|
|
5734
|
-
},
|
|
5735
|
-
{ type: "text", text: content }
|
|
5736
|
-
]
|
|
5737
|
-
};
|
|
5738
|
-
return [...currentConversation, newMessage];
|
|
5739
|
-
});
|
|
5740
|
-
}
|
|
5741
|
-
});
|
|
6065
|
+
});
|
|
6066
|
+
}
|
|
5742
6067
|
}
|
|
5743
6068
|
setIsRunning(false);
|
|
5744
6069
|
setTimeout(() => {
|
|
@@ -5788,7 +6113,8 @@ const defaultSettings = {
|
|
|
5788
6113
|
maxSteps: 5,
|
|
5789
6114
|
temperature: 0.5,
|
|
5790
6115
|
topP: 1,
|
|
5791
|
-
chatWithGenerate: false
|
|
6116
|
+
chatWithGenerate: false,
|
|
6117
|
+
chatWithGenerateVNext: false
|
|
5792
6118
|
}
|
|
5793
6119
|
};
|
|
5794
6120
|
function useAgentSettingsState({ agentId }) {
|
|
@@ -5860,7 +6186,8 @@ const AgentChat = ({
|
|
|
5860
6186
|
initialMessages,
|
|
5861
6187
|
memory,
|
|
5862
6188
|
refreshThreadList,
|
|
5863
|
-
onInputChange
|
|
6189
|
+
onInputChange,
|
|
6190
|
+
modelVersion
|
|
5864
6191
|
}) => {
|
|
5865
6192
|
const { settings } = useAgentSettings();
|
|
5866
6193
|
const { runtimeContext } = usePlaygroundStore();
|
|
@@ -5869,6 +6196,7 @@ const AgentChat = ({
|
|
|
5869
6196
|
{
|
|
5870
6197
|
agentId,
|
|
5871
6198
|
agentName,
|
|
6199
|
+
modelVersion,
|
|
5872
6200
|
threadId,
|
|
5873
6201
|
initialMessages,
|
|
5874
6202
|
memory,
|
|
@@ -6636,28 +6964,47 @@ const AgentAdvancedSettings = () => {
|
|
|
6636
6964
|
] }) });
|
|
6637
6965
|
};
|
|
6638
6966
|
|
|
6639
|
-
const AgentSettings = () => {
|
|
6967
|
+
const AgentSettings = ({ modelVersion }) => {
|
|
6640
6968
|
const { settings, setSettings, resetAll } = useAgentSettings();
|
|
6969
|
+
let radioValue;
|
|
6970
|
+
if (modelVersion === "v2") {
|
|
6971
|
+
radioValue = settings?.modelSettings?.chatWithGenerateVNext ? "generateVNext" : "streamVNext";
|
|
6972
|
+
} else {
|
|
6973
|
+
radioValue = settings?.modelSettings?.chatWithGenerate ? "generate" : "stream";
|
|
6974
|
+
}
|
|
6641
6975
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-5 text-xs py-2 pb-4", children: [
|
|
6642
6976
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "space-y-7", children: [
|
|
6643
6977
|
/* @__PURE__ */ jsxRuntime.jsx(Entry, { label: "Chat Method", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6644
6978
|
RadioGroup,
|
|
6645
6979
|
{
|
|
6646
6980
|
orientation: "horizontal",
|
|
6647
|
-
value:
|
|
6981
|
+
value: radioValue,
|
|
6648
6982
|
onValueChange: (value) => setSettings({
|
|
6649
6983
|
...settings,
|
|
6650
|
-
modelSettings: {
|
|
6984
|
+
modelSettings: {
|
|
6985
|
+
...settings?.modelSettings,
|
|
6986
|
+
chatWithGenerate: value === "generate",
|
|
6987
|
+
chatWithGenerateVNext: value === "generateVNext",
|
|
6988
|
+
chatWithStreamVNext: value === "streamVNext"
|
|
6989
|
+
}
|
|
6651
6990
|
}),
|
|
6652
6991
|
className: "flex flex-row gap-4",
|
|
6653
6992
|
children: [
|
|
6654
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6993
|
+
modelVersion !== "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6655
6994
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "generate", id: "generate", className: "text-icon6" }),
|
|
6656
6995
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "generate", children: "Generate" })
|
|
6657
6996
|
] }),
|
|
6658
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6997
|
+
modelVersion === "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6998
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "generateVNext", id: "generateVNext", className: "text-icon6" }),
|
|
6999
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "generateVNext", children: "Generate vNext" })
|
|
7000
|
+
] }),
|
|
7001
|
+
modelVersion !== "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6659
7002
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "stream", id: "stream", className: "text-icon6" }),
|
|
6660
7003
|
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "stream", children: "Stream" })
|
|
7004
|
+
] }),
|
|
7005
|
+
modelVersion === "v2" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
7006
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { value: "streamVNext", id: "streamVNext", className: "text-icon6" }),
|
|
7007
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { className: "text-icon6 text-ui-md", htmlFor: "streamVNext", children: "Stream vNext" })
|
|
6661
7008
|
] })
|
|
6662
7009
|
]
|
|
6663
7010
|
}
|
|
@@ -7794,8 +8141,8 @@ const ScorerEntity = ({ scorer }) => {
|
|
|
7794
8141
|
return /* @__PURE__ */ jsxRuntime.jsxs(Entity, { onClick: () => linkRef.current?.click(), children: [
|
|
7795
8142
|
/* @__PURE__ */ jsxRuntime.jsx(EntityIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GaugeIcon, { className: "group-hover/entity:text-accent3" }) }),
|
|
7796
8143
|
/* @__PURE__ */ jsxRuntime.jsxs(EntityContent, { children: [
|
|
7797
|
-
/* @__PURE__ */ jsxRuntime.jsx(EntityName, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { ref: linkRef, href: `/scorers/${scorer.id}`, children: scorer.scorer.name }) }),
|
|
7798
|
-
/* @__PURE__ */ jsxRuntime.jsx(EntityDescription, { children: scorer.scorer.description }),
|
|
8144
|
+
/* @__PURE__ */ jsxRuntime.jsx(EntityName, { children: /* @__PURE__ */ jsxRuntime.jsx(Link, { ref: linkRef, href: `/scorers/${scorer.id}`, children: scorer.scorer.config.name }) }),
|
|
8145
|
+
/* @__PURE__ */ jsxRuntime.jsx(EntityDescription, { children: scorer.scorer.config.description }),
|
|
7799
8146
|
scorer.sampling?.type === "ratio" && /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { children: [
|
|
7800
8147
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-icon3", children: "Sample rate:" }),
|
|
7801
8148
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-icon6", children: scorer.sampling.rate })
|
|
@@ -7804,20 +8151,365 @@ const ScorerEntity = ({ scorer }) => {
|
|
|
7804
8151
|
] });
|
|
7805
8152
|
};
|
|
7806
8153
|
|
|
8154
|
+
const openaiModels = [
|
|
8155
|
+
"o1",
|
|
8156
|
+
"o1-2024-12-17",
|
|
8157
|
+
"o3-mini",
|
|
8158
|
+
"o3-mini-2025-01-31",
|
|
8159
|
+
"o3",
|
|
8160
|
+
"o3-2025-04-16",
|
|
8161
|
+
"o4-mini",
|
|
8162
|
+
"o4-mini-2025-04-16",
|
|
8163
|
+
"codex-mini-latest",
|
|
8164
|
+
"computer-use-preview",
|
|
8165
|
+
"gpt-4.1",
|
|
8166
|
+
"gpt-4.1-2025-04-14",
|
|
8167
|
+
"gpt-4.1-mini",
|
|
8168
|
+
"gpt-4.1-mini-2025-04-14",
|
|
8169
|
+
"gpt-4.1-nano",
|
|
8170
|
+
"gpt-4.1-nano-2025-04-14",
|
|
8171
|
+
"gpt-4o",
|
|
8172
|
+
"gpt-4o-2024-05-13",
|
|
8173
|
+
"gpt-4o-2024-08-06",
|
|
8174
|
+
"gpt-4o-2024-11-20",
|
|
8175
|
+
"gpt-4o-audio-preview",
|
|
8176
|
+
"gpt-4o-audio-preview-2024-10-01",
|
|
8177
|
+
"gpt-4o-audio-preview-2024-12-17",
|
|
8178
|
+
"gpt-4o-search-preview",
|
|
8179
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
8180
|
+
"gpt-4o-mini-search-preview",
|
|
8181
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
8182
|
+
"gpt-4o-mini",
|
|
8183
|
+
"gpt-4o-mini-2024-07-18",
|
|
8184
|
+
"gpt-4-turbo",
|
|
8185
|
+
"gpt-4-turbo-2024-04-09",
|
|
8186
|
+
"gpt-4-turbo-preview",
|
|
8187
|
+
"gpt-4-0125-preview",
|
|
8188
|
+
"gpt-4-1106-preview",
|
|
8189
|
+
"gpt-4",
|
|
8190
|
+
"gpt-4-0613",
|
|
8191
|
+
"gpt-4.5-preview",
|
|
8192
|
+
"gpt-4.5-preview-2025-02-27",
|
|
8193
|
+
"gpt-3.5-turbo-0125",
|
|
8194
|
+
"gpt-3.5-turbo",
|
|
8195
|
+
"gpt-3.5-turbo-1106",
|
|
8196
|
+
"chatgpt-4o-latest",
|
|
8197
|
+
"gpt-5",
|
|
8198
|
+
"gpt-5-2025-08-07",
|
|
8199
|
+
"gpt-5-mini",
|
|
8200
|
+
"gpt-5-mini-2025-08-07",
|
|
8201
|
+
"gpt-5-nano",
|
|
8202
|
+
"gpt-5-nano-2025-08-07",
|
|
8203
|
+
"gpt-5-chat-latest"
|
|
8204
|
+
];
|
|
8205
|
+
const anthropicModels = [
|
|
8206
|
+
"claude-opus-4-20250514",
|
|
8207
|
+
"claude-sonnet-4-20250514",
|
|
8208
|
+
"claude-3-7-sonnet-20250219",
|
|
8209
|
+
"claude-3-5-sonnet-latest",
|
|
8210
|
+
"claude-3-5-sonnet-20241022",
|
|
8211
|
+
"claude-3-5-sonnet-20240620",
|
|
8212
|
+
"claude-3-5-haiku-latest",
|
|
8213
|
+
"claude-3-5-haiku-20241022",
|
|
8214
|
+
"claude-3-opus-latest",
|
|
8215
|
+
"claude-3-opus-20240229",
|
|
8216
|
+
"claude-3-sonnet-20240229",
|
|
8217
|
+
"claude-3-haiku-20240307"
|
|
8218
|
+
];
|
|
8219
|
+
const googleModels = [
|
|
8220
|
+
"gemini-1.5-flash",
|
|
8221
|
+
"gemini-1.5-flash-latest",
|
|
8222
|
+
"gemini-1.5-flash-001",
|
|
8223
|
+
"gemini-1.5-flash-002",
|
|
8224
|
+
"gemini-1.5-flash-8b",
|
|
8225
|
+
"gemini-1.5-flash-8b-latest",
|
|
8226
|
+
"gemini-1.5-flash-8b-001",
|
|
8227
|
+
"gemini-1.5-pro",
|
|
8228
|
+
"gemini-1.5-pro-latest",
|
|
8229
|
+
"gemini-1.5-pro-001",
|
|
8230
|
+
"gemini-1.5-pro-002",
|
|
8231
|
+
"gemini-2.0-flash",
|
|
8232
|
+
"gemini-2.0-flash-001",
|
|
8233
|
+
"gemini-2.0-flash-live-001",
|
|
8234
|
+
"gemini-2.0-flash-lite",
|
|
8235
|
+
"gemini-2.0-pro-exp-02-05",
|
|
8236
|
+
"gemini-2.0-flash-thinking-exp-01-21",
|
|
8237
|
+
"gemini-2.0-flash-exp",
|
|
8238
|
+
"gemini-2.5-pro",
|
|
8239
|
+
"gemini-2.5-flash",
|
|
8240
|
+
"gemini-2.5-flash-lite",
|
|
8241
|
+
"gemini-2.5-pro-exp-03-25",
|
|
8242
|
+
"gemini-2.5-flash-preview-04-17",
|
|
8243
|
+
"gemini-exp-1206",
|
|
8244
|
+
"gemma-3-12b-it",
|
|
8245
|
+
"gemma-3-27b-it"
|
|
8246
|
+
];
|
|
8247
|
+
const xAIModels = [
|
|
8248
|
+
"grok-4",
|
|
8249
|
+
"grok-4-0709",
|
|
8250
|
+
"grok-4-latest",
|
|
8251
|
+
"grok-3",
|
|
8252
|
+
"grok-3-latest",
|
|
8253
|
+
"grok-3-fast",
|
|
8254
|
+
"grok-3-fast-latest",
|
|
8255
|
+
"grok-3-mini",
|
|
8256
|
+
"grok-3-mini-latest",
|
|
8257
|
+
"grok-3-mini-fast",
|
|
8258
|
+
"grok-3-mini-fast-latest",
|
|
8259
|
+
"grok-2-vision-1212",
|
|
8260
|
+
"grok-2-vision",
|
|
8261
|
+
"grok-2-vision-latest",
|
|
8262
|
+
"grok-2-image-1212",
|
|
8263
|
+
"grok-2-image",
|
|
8264
|
+
"grok-2-image-latest",
|
|
8265
|
+
"grok-2-1212",
|
|
8266
|
+
"grok-2",
|
|
8267
|
+
"grok-2-latest",
|
|
8268
|
+
"grok-vision-beta",
|
|
8269
|
+
"grok-beta"
|
|
8270
|
+
];
|
|
8271
|
+
const groqModels = [
|
|
8272
|
+
"gemma2-9b-it",
|
|
8273
|
+
"llama-3.1-8b-instant",
|
|
8274
|
+
"llama-3.3-70b-versatile",
|
|
8275
|
+
"meta-llama/llama-guard-4-12b",
|
|
8276
|
+
"openai/gpt-oss-120b",
|
|
8277
|
+
"openai/gpt-oss-20b",
|
|
8278
|
+
"deepseek-r1-distill-llama-70b",
|
|
8279
|
+
"meta-llama/llama-4-maverick-17b-128e-instruct",
|
|
8280
|
+
"meta-llama/llama-4-scout-17b-16e-instruct",
|
|
8281
|
+
"meta-llama/llama-prompt-guard-2-22m",
|
|
8282
|
+
"meta-llama/llama-prompt-guard-2-86m",
|
|
8283
|
+
"mistral-saba-24b",
|
|
8284
|
+
"moonshotai/kimi-k2-instruct",
|
|
8285
|
+
"qwen/qwen3-32b",
|
|
8286
|
+
"llama-guard-3-8b",
|
|
8287
|
+
"llama3-70b-8192",
|
|
8288
|
+
"llama3-8b-8192",
|
|
8289
|
+
"mixtral-8x7b-32768",
|
|
8290
|
+
"qwen-qwq-32b",
|
|
8291
|
+
"qwen-2.5-32b",
|
|
8292
|
+
"deepseek-r1-distill-qwen-32b"
|
|
8293
|
+
];
|
|
8294
|
+
|
|
8295
|
+
const Select = SelectPrimitive__namespace.Root;
|
|
8296
|
+
const SelectValue = SelectPrimitive__namespace.Value;
|
|
8297
|
+
const SelectTrigger = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8298
|
+
SelectPrimitive__namespace.Trigger,
|
|
8299
|
+
{
|
|
8300
|
+
ref,
|
|
8301
|
+
className: cn(
|
|
8302
|
+
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
8303
|
+
className
|
|
8304
|
+
),
|
|
8305
|
+
...props,
|
|
8306
|
+
children: [
|
|
8307
|
+
children,
|
|
8308
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
8309
|
+
]
|
|
8310
|
+
}
|
|
8311
|
+
));
|
|
8312
|
+
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
8313
|
+
const SelectContent = React__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8314
|
+
SelectPrimitive__namespace.Content,
|
|
8315
|
+
{
|
|
8316
|
+
ref,
|
|
8317
|
+
className: cn(
|
|
8318
|
+
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8319
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
8320
|
+
className
|
|
8321
|
+
),
|
|
8322
|
+
position,
|
|
8323
|
+
...props,
|
|
8324
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8325
|
+
SelectPrimitive__namespace.Viewport,
|
|
8326
|
+
{
|
|
8327
|
+
className: cn(
|
|
8328
|
+
"p-1",
|
|
8329
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
8330
|
+
),
|
|
8331
|
+
children
|
|
8332
|
+
}
|
|
8333
|
+
)
|
|
8334
|
+
}
|
|
8335
|
+
) }));
|
|
8336
|
+
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
8337
|
+
const SelectItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8338
|
+
SelectPrimitive__namespace.Item,
|
|
8339
|
+
{
|
|
8340
|
+
ref,
|
|
8341
|
+
className: cn(
|
|
8342
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-mastra-el-5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
8343
|
+
className
|
|
8344
|
+
),
|
|
8345
|
+
...props,
|
|
8346
|
+
children: [
|
|
8347
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
8348
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
8349
|
+
]
|
|
8350
|
+
}
|
|
8351
|
+
));
|
|
8352
|
+
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
8353
|
+
|
|
8354
|
+
const Popover = PopoverPrimitive__namespace.Root;
|
|
8355
|
+
const PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
8356
|
+
const PopoverContent = React__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8357
|
+
PopoverPrimitive__namespace.Content,
|
|
8358
|
+
{
|
|
8359
|
+
ref,
|
|
8360
|
+
align,
|
|
8361
|
+
sideOffset,
|
|
8362
|
+
className: cn(
|
|
8363
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8364
|
+
className
|
|
8365
|
+
),
|
|
8366
|
+
...props
|
|
8367
|
+
}
|
|
8368
|
+
) }));
|
|
8369
|
+
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
8370
|
+
|
|
8371
|
+
const Models = {
|
|
8372
|
+
openai: {
|
|
8373
|
+
models: openaiModels?.map((model) => ({ provider: "openai", model, icon: "openai.chat" })),
|
|
8374
|
+
icon: "openai.chat"
|
|
8375
|
+
},
|
|
8376
|
+
anthropic: {
|
|
8377
|
+
models: anthropicModels?.map((model) => ({ provider: "anthropic", model, icon: "anthropic.messages" })),
|
|
8378
|
+
icon: "anthropic.messages"
|
|
8379
|
+
},
|
|
8380
|
+
google: {
|
|
8381
|
+
models: googleModels?.map((model) => ({ provider: "google", model, icon: "GOOGLE" })),
|
|
8382
|
+
icon: "GOOGLE"
|
|
8383
|
+
},
|
|
8384
|
+
xAi: {
|
|
8385
|
+
models: xAIModels?.map((model) => ({ provider: "xai", model, icon: "X_GROK" })),
|
|
8386
|
+
icon: "X_GROK"
|
|
8387
|
+
},
|
|
8388
|
+
groq: {
|
|
8389
|
+
models: groqModels?.map((model) => ({ provider: "groq", model, icon: "GROQ" })),
|
|
8390
|
+
icon: "GROQ"
|
|
8391
|
+
}
|
|
8392
|
+
};
|
|
8393
|
+
const AgentMetadataModelSwitcher = ({
|
|
8394
|
+
defaultProvider,
|
|
8395
|
+
defaultModel,
|
|
8396
|
+
updateModel,
|
|
8397
|
+
closeEditor,
|
|
8398
|
+
modelProviders
|
|
8399
|
+
}) => {
|
|
8400
|
+
const [selectedModel, setSelectedModel] = React.useState(defaultModel);
|
|
8401
|
+
const [showSuggestions, setShowSuggestions] = React.useState(false);
|
|
8402
|
+
const [selectedProvider, setSelectedProvider] = React.useState(() => {
|
|
8403
|
+
if (defaultProvider) {
|
|
8404
|
+
const providerOnly = defaultProvider.split(".")[0];
|
|
8405
|
+
return providerOnly;
|
|
8406
|
+
}
|
|
8407
|
+
return "";
|
|
8408
|
+
});
|
|
8409
|
+
const [loading, setLoading] = React.useState(false);
|
|
8410
|
+
const modelsList = Object.entries(Models).filter(([provider]) => modelProviders.includes(provider));
|
|
8411
|
+
const allModels = modelsList.flatMap(([_, { models }]) => models);
|
|
8412
|
+
const providersList = modelsList.map(([provider, { icon }]) => ({ provider, icon }));
|
|
8413
|
+
const model = allModels.find((model2) => model2.model === selectedModel);
|
|
8414
|
+
const handleSave = async () => {
|
|
8415
|
+
setLoading(true);
|
|
8416
|
+
const providerToUse = model?.provider ?? selectedProvider;
|
|
8417
|
+
await updateModel({ provider: providerToUse, modelId: selectedModel });
|
|
8418
|
+
setLoading(false);
|
|
8419
|
+
closeEditor();
|
|
8420
|
+
};
|
|
8421
|
+
const filteredModels = allModels.filter((model2) => model2.model.includes(selectedModel));
|
|
8422
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8423
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8424
|
+
Select,
|
|
8425
|
+
{
|
|
8426
|
+
value: model?.provider ?? selectedProvider,
|
|
8427
|
+
onValueChange: setSelectedProvider,
|
|
8428
|
+
disabled: !!model?.provider,
|
|
8429
|
+
children: [
|
|
8430
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "max-w-[150px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { placeholder: "Select provider" }) }),
|
|
8431
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: providersList.map((provider) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: provider.provider, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8432
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: providerMapToIcon[provider.icon] }),
|
|
8433
|
+
provider.provider
|
|
8434
|
+
] }) }, provider.provider)) })
|
|
8435
|
+
]
|
|
8436
|
+
}
|
|
8437
|
+
),
|
|
8438
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: showSuggestions, children: [
|
|
8439
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8440
|
+
Input,
|
|
8441
|
+
{
|
|
8442
|
+
id: "model-input",
|
|
8443
|
+
list: "model-suggestions",
|
|
8444
|
+
className: "flex-1",
|
|
8445
|
+
type: "text",
|
|
8446
|
+
value: selectedModel,
|
|
8447
|
+
onChange: (e) => {
|
|
8448
|
+
setSelectedModel(e.target.value);
|
|
8449
|
+
setShowSuggestions(true);
|
|
8450
|
+
},
|
|
8451
|
+
placeholder: "Enter model name or select from suggestions..."
|
|
8452
|
+
}
|
|
8453
|
+
) }),
|
|
8454
|
+
filteredModels.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8455
|
+
PopoverContent,
|
|
8456
|
+
{
|
|
8457
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
8458
|
+
className: "flex flex-col gap-2 w-[var(--radix-popover-trigger-width)] max-h-[calc(var(--radix-popover-content-available-height)-50px)] overflow-y-auto",
|
|
8459
|
+
children: filteredModels.map((model2) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8460
|
+
"div",
|
|
8461
|
+
{
|
|
8462
|
+
className: "flex items-center gap-2 cursor-pointer hover:bg-surface5 p-2",
|
|
8463
|
+
onClick: () => {
|
|
8464
|
+
setSelectedModel(model2.model);
|
|
8465
|
+
setShowSuggestions(false);
|
|
8466
|
+
},
|
|
8467
|
+
children: [
|
|
8468
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: providerMapToIcon[model2.icon] }),
|
|
8469
|
+
model2.model
|
|
8470
|
+
]
|
|
8471
|
+
},
|
|
8472
|
+
model2.provider + model2.model
|
|
8473
|
+
))
|
|
8474
|
+
}
|
|
8475
|
+
)
|
|
8476
|
+
] }),
|
|
8477
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
8478
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleSave, className: "text-icon3 hover:text-icon6", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, {}) }) }) }),
|
|
8479
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: loading ? "Saving..." : "Save new model" })
|
|
8480
|
+
] })
|
|
8481
|
+
] }) });
|
|
8482
|
+
};
|
|
8483
|
+
|
|
7807
8484
|
const AgentMetadata = ({
|
|
7808
8485
|
agent,
|
|
7809
8486
|
promptSlot,
|
|
7810
8487
|
hasMemoryEnabled,
|
|
7811
8488
|
computeToolLink,
|
|
7812
|
-
computeWorkflowLink
|
|
8489
|
+
computeWorkflowLink,
|
|
8490
|
+
updateModel,
|
|
8491
|
+
modelProviders
|
|
7813
8492
|
}) => {
|
|
8493
|
+
const [isEditingModel, setIsEditingModel] = React.useState(false);
|
|
7814
8494
|
const providerIcon = providerMapToIcon[agent.provider || "openai.chat"];
|
|
7815
8495
|
const agentTools = agent.tools ?? {};
|
|
7816
8496
|
const tools = Object.keys(agentTools).map((key) => agentTools[key]);
|
|
7817
8497
|
const agentWorkflows = agent.workflows ?? {};
|
|
7818
8498
|
const workflows = Object.keys(agentWorkflows).map((key) => agentWorkflows[key]);
|
|
7819
8499
|
return /* @__PURE__ */ jsxRuntime.jsxs(AgentMetadataWrapper, { children: [
|
|
7820
|
-
/* @__PURE__ */ jsxRuntime.jsx(AgentMetadataSection, { title: "Model", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8500
|
+
/* @__PURE__ */ jsxRuntime.jsx(AgentMetadataSection, { title: "Model", children: isEditingModel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8501
|
+
AgentMetadataModelSwitcher,
|
|
8502
|
+
{
|
|
8503
|
+
defaultProvider: agent.provider,
|
|
8504
|
+
defaultModel: agent.modelId,
|
|
8505
|
+
updateModel,
|
|
8506
|
+
closeEditor: () => setIsEditingModel(false),
|
|
8507
|
+
modelProviders
|
|
8508
|
+
}
|
|
8509
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
8510
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge$1, { icon: providerIcon, className: "font-medium", children: agent.modelId || "N/A" }),
|
|
8511
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setIsEditingModel(true), className: "text-icon3 hover:text-icon6", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EditIcon, {}) }) })
|
|
8512
|
+
] }) }),
|
|
7821
8513
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7822
8514
|
AgentMetadataSection,
|
|
7823
8515
|
{
|
|
@@ -11888,23 +12580,6 @@ function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
|
11888
12580
|
}
|
|
11889
12581
|
Calendar.displayName = "Calendar";
|
|
11890
12582
|
|
|
11891
|
-
const Popover = PopoverPrimitive__namespace.Root;
|
|
11892
|
-
const PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
11893
|
-
const PopoverContent = React__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11894
|
-
PopoverPrimitive__namespace.Content,
|
|
11895
|
-
{
|
|
11896
|
-
ref,
|
|
11897
|
-
align,
|
|
11898
|
-
sideOffset,
|
|
11899
|
-
className: cn(
|
|
11900
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
11901
|
-
className
|
|
11902
|
-
),
|
|
11903
|
-
...props
|
|
11904
|
-
}
|
|
11905
|
-
) }));
|
|
11906
|
-
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
11907
|
-
|
|
11908
12583
|
const DatePicker = ({
|
|
11909
12584
|
value,
|
|
11910
12585
|
setValue,
|
|
@@ -12089,65 +12764,6 @@ const DateField = ({ inputProps, field, error, id }) => {
|
|
|
12089
12764
|
);
|
|
12090
12765
|
};
|
|
12091
12766
|
|
|
12092
|
-
const Select = SelectPrimitive__namespace.Root;
|
|
12093
|
-
const SelectValue = SelectPrimitive__namespace.Value;
|
|
12094
|
-
const SelectTrigger = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12095
|
-
SelectPrimitive__namespace.Trigger,
|
|
12096
|
-
{
|
|
12097
|
-
ref,
|
|
12098
|
-
className: cn(
|
|
12099
|
-
"flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
12100
|
-
className
|
|
12101
|
-
),
|
|
12102
|
-
...props,
|
|
12103
|
-
children: [
|
|
12104
|
-
children,
|
|
12105
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-50" }) })
|
|
12106
|
-
]
|
|
12107
|
-
}
|
|
12108
|
-
));
|
|
12109
|
-
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
12110
|
-
const SelectContent = React__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12111
|
-
SelectPrimitive__namespace.Content,
|
|
12112
|
-
{
|
|
12113
|
-
ref,
|
|
12114
|
-
className: cn(
|
|
12115
|
-
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
12116
|
-
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
12117
|
-
className
|
|
12118
|
-
),
|
|
12119
|
-
position,
|
|
12120
|
-
...props,
|
|
12121
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12122
|
-
SelectPrimitive__namespace.Viewport,
|
|
12123
|
-
{
|
|
12124
|
-
className: cn(
|
|
12125
|
-
"p-1",
|
|
12126
|
-
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
12127
|
-
),
|
|
12128
|
-
children
|
|
12129
|
-
}
|
|
12130
|
-
)
|
|
12131
|
-
}
|
|
12132
|
-
) }));
|
|
12133
|
-
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
12134
|
-
const SelectItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12135
|
-
SelectPrimitive__namespace.Item,
|
|
12136
|
-
{
|
|
12137
|
-
ref,
|
|
12138
|
-
className: cn(
|
|
12139
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-mastra-el-5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
12140
|
-
className
|
|
12141
|
-
),
|
|
12142
|
-
...props,
|
|
12143
|
-
children: [
|
|
12144
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
|
|
12145
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children })
|
|
12146
|
-
]
|
|
12147
|
-
}
|
|
12148
|
-
));
|
|
12149
|
-
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
12150
|
-
|
|
12151
12767
|
const SelectField = ({ field, inputProps, error, id, value }) => {
|
|
12152
12768
|
const { key, ...props } = inputProps;
|
|
12153
12769
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -12349,6 +12965,92 @@ function AutoForm({
|
|
|
12349
12965
|
|
|
12350
12966
|
react$3.buildZodFieldConfig();
|
|
12351
12967
|
|
|
12968
|
+
function inferFieldType(schema, fieldConfig) {
|
|
12969
|
+
if (fieldConfig?.fieldType) {
|
|
12970
|
+
return fieldConfig.fieldType;
|
|
12971
|
+
}
|
|
12972
|
+
if (schema instanceof z.z.ZodObject) return "object";
|
|
12973
|
+
if (schema instanceof z.z.ZodNumber) return "number";
|
|
12974
|
+
if (schema instanceof z.z.ZodBoolean) return "boolean";
|
|
12975
|
+
if (schema instanceof z.z.ZodString) {
|
|
12976
|
+
const checks = schema._zod.def.checks || [];
|
|
12977
|
+
const hasDateTimeCheck = checks.some(
|
|
12978
|
+
//@ts-expect-error - zod string_format check has format property
|
|
12979
|
+
(check) => check._zod.def.check === "string_format" && check._zod.def.format === "datetime"
|
|
12980
|
+
);
|
|
12981
|
+
if (hasDateTimeCheck) return "date";
|
|
12982
|
+
return "string";
|
|
12983
|
+
}
|
|
12984
|
+
if (schema instanceof z.z.ZodEnum) return "select";
|
|
12985
|
+
if (schema instanceof v3.z.ZodNativeEnum) return "select";
|
|
12986
|
+
if (schema instanceof z.z.ZodArray) return "array";
|
|
12987
|
+
if (schema instanceof z.z.ZodRecord) return "record";
|
|
12988
|
+
return "string";
|
|
12989
|
+
}
|
|
12990
|
+
|
|
12991
|
+
function parseField(key, schema) {
|
|
12992
|
+
const baseSchema = getBaseSchema(schema);
|
|
12993
|
+
const fieldConfig = v4.getFieldConfigInZodStack(schema);
|
|
12994
|
+
const type = inferFieldType(baseSchema, fieldConfig);
|
|
12995
|
+
const defaultValue = v4.getDefaultValueInZodStack(schema);
|
|
12996
|
+
console.log({ baseSchema });
|
|
12997
|
+
const options = baseSchema._zod.def?.entries;
|
|
12998
|
+
let optionValues = [];
|
|
12999
|
+
if (options) {
|
|
13000
|
+
if (!Array.isArray(options)) {
|
|
13001
|
+
optionValues = Object.entries(options);
|
|
13002
|
+
} else {
|
|
13003
|
+
optionValues = options.map((value) => [value, value]);
|
|
13004
|
+
}
|
|
13005
|
+
}
|
|
13006
|
+
let subSchema = [];
|
|
13007
|
+
if (baseSchema instanceof v3.z.ZodObject || baseSchema instanceof z.z.ZodObject) {
|
|
13008
|
+
subSchema = Object.entries(baseSchema.shape).map(([key2, field]) => parseField(key2, field));
|
|
13009
|
+
}
|
|
13010
|
+
if (baseSchema instanceof v3.z.ZodArray || baseSchema instanceof z.z.ZodArray) {
|
|
13011
|
+
subSchema = [parseField("0", baseSchema._zod.def.element)];
|
|
13012
|
+
}
|
|
13013
|
+
return {
|
|
13014
|
+
key,
|
|
13015
|
+
type,
|
|
13016
|
+
required: !schema.optional(),
|
|
13017
|
+
default: defaultValue,
|
|
13018
|
+
description: baseSchema.description,
|
|
13019
|
+
fieldConfig,
|
|
13020
|
+
options: optionValues,
|
|
13021
|
+
schema: subSchema
|
|
13022
|
+
};
|
|
13023
|
+
}
|
|
13024
|
+
function getBaseSchema(schema) {
|
|
13025
|
+
if ("innerType" in schema._zod.def) {
|
|
13026
|
+
return getBaseSchema(schema._zod.def.innerType);
|
|
13027
|
+
}
|
|
13028
|
+
if ("schema" in schema._zod.def) {
|
|
13029
|
+
return getBaseSchema(schema._zod.def.schema);
|
|
13030
|
+
}
|
|
13031
|
+
return schema;
|
|
13032
|
+
}
|
|
13033
|
+
function parseSchema(schema) {
|
|
13034
|
+
const shape = schema.shape;
|
|
13035
|
+
const fields = Object.entries(shape).map(([key, field]) => parseField(key, field));
|
|
13036
|
+
return { fields };
|
|
13037
|
+
}
|
|
13038
|
+
class CustomZodProvider extends v4.ZodProvider {
|
|
13039
|
+
_schema;
|
|
13040
|
+
constructor(schema) {
|
|
13041
|
+
super(schema);
|
|
13042
|
+
this._schema = schema;
|
|
13043
|
+
}
|
|
13044
|
+
validateSchema(values) {
|
|
13045
|
+
const result = super.validateSchema(values);
|
|
13046
|
+
console.log({ result });
|
|
13047
|
+
return result;
|
|
13048
|
+
}
|
|
13049
|
+
parseSchema() {
|
|
13050
|
+
return parseSchema(this._schema);
|
|
13051
|
+
}
|
|
13052
|
+
}
|
|
13053
|
+
|
|
12352
13054
|
function isEmptyZodObject(schema) {
|
|
12353
13055
|
if (schema instanceof z.ZodObject) {
|
|
12354
13056
|
return Object.keys(schema.shape).length === 0;
|
|
@@ -12380,7 +13082,7 @@ function DynamicForm({
|
|
|
12380
13082
|
}
|
|
12381
13083
|
return schema2;
|
|
12382
13084
|
};
|
|
12383
|
-
const schemaProvider = new
|
|
13085
|
+
const schemaProvider = new CustomZodProvider(normalizedSchema(schema));
|
|
12384
13086
|
const formProps = {
|
|
12385
13087
|
schema: schemaProvider,
|
|
12386
13088
|
onSubmit: async (values) => {
|
|
@@ -13152,7 +13854,7 @@ const TracesTableError = ({ error, colsCount }) => {
|
|
|
13152
13854
|
};
|
|
13153
13855
|
const TraceRow = ({ trace, index, isActive }) => {
|
|
13154
13856
|
const { openTrace } = useOpenTrace();
|
|
13155
|
-
const hasFailure = trace.trace.some((span) => span.status.code
|
|
13857
|
+
const hasFailure = trace.trace.some((span) => span.status.code === 2);
|
|
13156
13858
|
return /* @__PURE__ */ jsxRuntime.jsxs(Row, { className: isActive ? "bg-surface4" : "", onClick: () => openTrace(trace.trace, index), children: [
|
|
13157
13859
|
/* @__PURE__ */ jsxRuntime.jsx(DateTimeCell, { dateTime: new Date(trace.started / 1e3) }),
|
|
13158
13860
|
/* @__PURE__ */ jsxRuntime.jsxs(TxtCell, { title: trace.traceId, children: [
|
|
@@ -13523,7 +14225,7 @@ function TraceDetails() {
|
|
|
13523
14225
|
const { trace, currentTraceIndex, prevTrace, nextTrace, traces } = React.useContext(TraceContext);
|
|
13524
14226
|
const actualTrace = traces[currentTraceIndex];
|
|
13525
14227
|
if (!actualTrace || !trace) return null;
|
|
13526
|
-
const hasFailure = trace.some((span) => span.status.code
|
|
14228
|
+
const hasFailure = trace.some((span) => span.status.code === 2);
|
|
13527
14229
|
return /* @__PURE__ */ jsxRuntime.jsxs("aside", { children: [
|
|
13528
14230
|
/* @__PURE__ */ jsxRuntime.jsxs(Header, { children: [
|
|
13529
14231
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -13645,11 +14347,11 @@ function SpanDetail() {
|
|
|
13645
14347
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { size: "lg", className: "bg-surface4 p-1 rounded-md", children: /* @__PURE__ */ jsxRuntime.jsx(SpanIcon, { className: variantClass }) }),
|
|
13646
14348
|
span.name
|
|
13647
14349
|
] }),
|
|
13648
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 items-center", children: span.status.code ===
|
|
14350
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2 items-center", children: span.status.code === 2 ? /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { variant: "error", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}), children: [
|
|
14351
|
+
"Failed in ",
|
|
13649
14352
|
toSigFigs(span.duration, 3),
|
|
13650
14353
|
"ms"
|
|
13651
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, {
|
|
13652
|
-
"Failed in ",
|
|
14354
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(Badge$1, { icon: /* @__PURE__ */ jsxRuntime.jsx(LatencyIcon, {}), variant: "success", children: [
|
|
13653
14355
|
toSigFigs(span.duration, 3),
|
|
13654
14356
|
"ms"
|
|
13655
14357
|
] }) }),
|