@mastra/playground-ui 5.1.1-alpha.1 → 5.1.1-alpha.2
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 +385 -74
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +385 -76
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/assistant-ui/thread.d.ts +2 -1
- package/dist/src/components/assistant-ui/use-has-attachments.d.ts +1 -0
- package/dist/src/domains/agents/agent/agent-chat.d.ts +1 -1
- package/dist/src/ds/icons/AgentNetworkCoinIcon.d.ts +1 -0
- package/dist/src/ds/icons/ToolCoinIcon.d.ts +3 -0
- package/dist/src/ds/icons/index.d.ts +2 -0
- package/dist/src/hooks/use-speech-recognition.d.ts +15 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/file.d.ts +1 -0
- package/dist/src/types.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useMessage, MessagePrimitive, ActionBarPrimitive,
|
|
3
|
-
import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc,
|
|
2
|
+
import { useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, ComposerPrimitive, useAttachment, AttachmentPrimitive, ThreadPrimitive, useExternalStoreRuntime, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, AssistantRuntimeProvider } from '@assistant-ui/react';
|
|
3
|
+
import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, X, FileIcon, CircleXIcon, Mic, PlusIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, Check, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon, Plus, Loader2, CirclePause } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { forwardRef, useState, useEffect, memo, useMemo, useRef, createContext, useContext, useCallback, Suspense, Fragment as Fragment$1 } from 'react';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
7
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
8
|
+
import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
|
|
8
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
9
10
|
import { unstable_memoizeMarkdownComponents, useIsMarkdownCodeBlock, MarkdownTextPrimitive } from '@assistant-ui/react-markdown';
|
|
10
11
|
import '@assistant-ui/react-markdown/styles/dot.css';
|
|
@@ -15,6 +16,8 @@ import { jsonLanguage } from '@codemirror/lang-json';
|
|
|
15
16
|
import { tags } from '@lezer/highlight';
|
|
16
17
|
import { draculaInit } from '@uiw/codemirror-theme-dracula';
|
|
17
18
|
import CodeMirror from '@uiw/react-codemirror';
|
|
19
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
20
|
+
import { useShallow } from 'zustand/shallow';
|
|
18
21
|
import { RuntimeContext } from '@mastra/core/di';
|
|
19
22
|
import { MastraClient } from '@mastra/client-js';
|
|
20
23
|
import { create } from 'zustand';
|
|
@@ -32,7 +35,6 @@ import '@xyflow/react/dist/style.css';
|
|
|
32
35
|
import Dagre from '@dagrejs/dagre';
|
|
33
36
|
import { Highlight, themes } from 'prism-react-renderer';
|
|
34
37
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
35
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
36
38
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
37
39
|
import jsonSchemaToZod from 'json-schema-to-zod';
|
|
38
40
|
import { parse } from 'superjson';
|
|
@@ -3893,6 +3895,83 @@ const McpCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "126", heigh
|
|
|
3893
3895
|
)
|
|
3894
3896
|
] });
|
|
3895
3897
|
|
|
3898
|
+
const ToolCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "126", height: "85", viewBox: "0 0 126 85", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
3899
|
+
/* @__PURE__ */ jsx(
|
|
3900
|
+
"path",
|
|
3901
|
+
{
|
|
3902
|
+
d: "M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",
|
|
3903
|
+
fill: "#2E2E2E",
|
|
3904
|
+
fillOpacity: "0.9"
|
|
3905
|
+
}
|
|
3906
|
+
),
|
|
3907
|
+
/* @__PURE__ */ jsx(
|
|
3908
|
+
"path",
|
|
3909
|
+
{
|
|
3910
|
+
d: "M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",
|
|
3911
|
+
stroke: "#424242"
|
|
3912
|
+
}
|
|
3913
|
+
),
|
|
3914
|
+
/* @__PURE__ */ jsx(
|
|
3915
|
+
"path",
|
|
3916
|
+
{
|
|
3917
|
+
d: "M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",
|
|
3918
|
+
stroke: "#707070"
|
|
3919
|
+
}
|
|
3920
|
+
),
|
|
3921
|
+
/* @__PURE__ */ jsx(
|
|
3922
|
+
"path",
|
|
3923
|
+
{
|
|
3924
|
+
fillRule: "evenodd",
|
|
3925
|
+
clipRule: "evenodd",
|
|
3926
|
+
d: "M95.8997 32.6647C98.4806 33.9355 98.4744 36.0012 95.8997 37.2689L89.6657 40.3384C87.0848 41.6091 82.8892 41.6061 80.3146 40.3384L74.0805 37.2689C71.4996 35.9981 71.5059 33.9324 74.0805 32.6647L80.3146 29.5952C82.8955 28.3244 87.091 28.3275 89.6657 29.5952L95.8997 32.6647ZM74.0805 21.9215C76.6614 23.1923 76.6552 25.258 74.0805 26.5257L67.8465 29.5952C65.2656 30.866 61.0701 30.8629 58.4954 29.5952L52.2613 26.5257C49.6804 25.255 49.6867 23.1892 52.2613 21.9215L58.4954 18.852C61.0763 17.5813 65.2718 17.5843 67.8465 18.852L74.0805 21.9215ZM74.0805 43.4079C76.6614 44.6786 76.6552 46.7444 74.0805 48.0121L67.8465 51.0816C65.2656 52.3523 61.0701 52.3493 58.4954 51.0816L52.2613 48.0121C49.6804 46.7413 49.6867 44.6756 52.2613 43.4079L58.4954 40.3384C61.0763 39.0676 65.2718 39.0707 67.8465 40.3384L74.0805 43.4079ZM52.2613 32.6647C54.8422 33.9355 54.836 36.0012 52.2613 37.2689L46.0273 40.3384C43.4464 41.6091 39.2509 41.6061 36.6762 40.3384L30.4422 37.2689C27.8613 35.9981 27.8675 33.9324 30.4422 32.6647L36.6762 29.5952C39.2571 28.3244 43.4526 28.3275 46.0273 29.5952L52.2613 32.6647Z",
|
|
3927
|
+
fill: "#A9A9A9"
|
|
3928
|
+
}
|
|
3929
|
+
)
|
|
3930
|
+
] });
|
|
3931
|
+
|
|
3932
|
+
const AgentNetworkCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "126", height: "85", viewBox: "0 0 126 85", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
3933
|
+
/* @__PURE__ */ jsx(
|
|
3934
|
+
"path",
|
|
3935
|
+
{
|
|
3936
|
+
d: "M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641V49.8368C6.67773 65.0327 31.894 77.3514 62.9998 77.3514C94.1055 77.3514 119.322 65.0327 119.322 49.8368V35.1641Z",
|
|
3937
|
+
fill: "#2E2E2E",
|
|
3938
|
+
fillOpacity: "0.9"
|
|
3939
|
+
}
|
|
3940
|
+
),
|
|
3941
|
+
/* @__PURE__ */ jsx(
|
|
3942
|
+
"path",
|
|
3943
|
+
{
|
|
3944
|
+
d: "M119.322 35.1641C119.322 50.36 94.1055 62.6787 62.9998 62.6787C31.894 62.6787 6.67773 50.36 6.67773 35.1641M119.322 35.1641C119.322 19.9681 94.1055 7.64941 62.9998 7.64941C31.894 7.64941 6.67773 19.9681 6.67773 35.1641M119.322 35.1641V49.8368C119.322 65.0327 94.1055 77.3514 62.9998 77.3514C31.894 77.3514 6.67773 65.0327 6.67773 49.8368V35.1641",
|
|
3945
|
+
stroke: "#424242"
|
|
3946
|
+
}
|
|
3947
|
+
),
|
|
3948
|
+
/* @__PURE__ */ jsx(
|
|
3949
|
+
"path",
|
|
3950
|
+
{
|
|
3951
|
+
d: "M63.0002 0.96875C28.5152 0.96875 0.55957 15.6489 0.55957 33.7578V51.2433C0.55957 69.3522 28.5152 84.0323 63.0002 84.0323C97.4853 84.0323 125.441 69.3522 125.441 51.2433V33.7578C125.441 15.6489 97.4853 0.96875 63.0002 0.96875Z",
|
|
3952
|
+
stroke: "#707070"
|
|
3953
|
+
}
|
|
3954
|
+
),
|
|
3955
|
+
/* @__PURE__ */ jsx("g", { clipPath: "url(#clip0_23333_14744)", children: /* @__PURE__ */ jsx(
|
|
3956
|
+
"path",
|
|
3957
|
+
{
|
|
3958
|
+
fillRule: "evenodd",
|
|
3959
|
+
clipRule: "evenodd",
|
|
3960
|
+
d: "M79.2946 17.9539C83.0143 19.7854 83.016 22.7559 79.2979 24.5879C77.0214 25.7087 73.8794 26.1385 70.9301 25.8878L67.5296 30.2202C68.0944 30.3987 68.6321 30.6075 69.1262 30.8507C71.0847 31.815 72.0009 33.0948 71.8979 34.3581L77.2504 35.1977C77.6452 34.8727 78.1174 34.5635 78.6856 34.2835C82.4066 32.4514 88.4403 32.4485 92.1623 34.2803C95.8842 36.1128 95.8805 39.0851 92.159 40.9175C88.4373 42.7488 82.4002 42.7513 78.679 40.9191C76.7415 39.9647 75.8248 38.7009 75.9073 37.4506L70.5219 36.6045C70.1354 36.9168 69.6777 37.2145 69.1295 37.4846C68.345 37.8708 67.4527 38.1705 66.5059 38.3939L67.9312 41.984C70.1507 42.0573 72.3276 42.5087 74.0244 43.3438C77.7444 45.1754 77.7467 48.1458 74.0277 49.9778C70.3071 51.8092 64.2712 51.8095 60.551 49.9778C56.8323 48.1459 56.8351 45.1755 60.5543 43.3438C61.3581 42.9482 62.2741 42.6414 63.247 42.4167L61.8282 38.8428C59.5803 38.7777 57.3696 38.3299 55.6527 37.4846C54.1264 36.7327 53.2395 35.7882 52.9666 34.8103L43.924 34.0469C43.4596 34.6259 42.7547 35.1702 41.8041 35.6385C38.0834 37.4696 32.0473 37.4701 28.3273 35.6385C24.6089 33.8068 24.6123 30.8363 28.3306 29.0046C32.0508 27.1737 38.0806 27.1737 41.8008 29.0046C43.3459 29.7653 44.2412 30.7224 44.5033 31.7129L53.5098 32.4747C53.9742 31.8832 54.6868 31.3279 55.656 30.8507C57.6687 29.8601 60.357 29.4079 62.9902 29.4892L66.5783 24.9218C66.3174 24.8179 66.0637 24.7073 65.8212 24.5879C62.1022 22.7559 62.1045 19.7856 65.8245 17.9539C69.5447 16.1235 75.5747 16.1232 79.2946 17.9539ZM38.4299 30.6643C36.5715 29.75 33.5599 29.75 31.7015 30.6643C29.8447 31.5793 29.8414 33.0638 31.6982 33.9788C33.5565 34.8938 36.5742 34.8933 38.4332 33.9788C40.2906 33.0635 40.2883 31.5793 38.4299 30.6643ZM70.6536 45.0035C68.7951 44.0893 65.7836 44.0893 63.9251 45.0035C62.0676 45.9185 62.0647 47.4029 63.9218 48.318C65.7804 49.2332 68.7979 49.2329 70.6569 48.3181C72.5142 47.4027 72.5119 45.9185 70.6536 45.0035ZM65.7553 32.5104C63.8969 31.5961 60.8853 31.5961 59.0269 32.5104C57.1685 33.4254 57.1662 34.9096 59.0236 35.8249C60.8824 36.7402 63.8998 36.7402 65.7586 35.8249C67.616 34.9096 67.6137 33.4254 65.7553 32.5104ZM88.7915 35.94C86.9338 35.0261 83.9184 35.0264 82.0564 35.9432C80.1965 36.8601 80.1945 38.3451 82.0498 39.2594C83.9067 40.1736 86.9255 40.1738 88.7882 39.2578C90.6507 38.3407 90.649 36.8546 88.7915 35.94ZM75.9238 19.6136C74.0656 18.6995 71.0538 18.6998 69.1953 19.6136C67.3369 20.5286 67.3347 22.0129 69.192 22.9282C71.0509 23.8434 74.0682 23.8434 75.9271 22.9282C77.7836 22.0128 77.7818 20.5285 75.9238 19.6136Z",
|
|
3961
|
+
fill: "#A9A9A9"
|
|
3962
|
+
}
|
|
3963
|
+
) }),
|
|
3964
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_23333_14744", children: /* @__PURE__ */ jsx(
|
|
3965
|
+
"rect",
|
|
3966
|
+
{
|
|
3967
|
+
width: "59.3185",
|
|
3968
|
+
height: "59.3185",
|
|
3969
|
+
fill: "white",
|
|
3970
|
+
transform: "matrix(0.897148 0.441731 -0.897148 0.441731 65.3042 6.51953)"
|
|
3971
|
+
}
|
|
3972
|
+
) }) })
|
|
3973
|
+
] });
|
|
3974
|
+
|
|
3896
3975
|
const useCodemirrorTheme$1 = () => {
|
|
3897
3976
|
return useMemo(
|
|
3898
3977
|
() => draculaInit({
|
|
@@ -3989,8 +4068,156 @@ const AssistantActionBar = () => {
|
|
|
3989
4068
|
);
|
|
3990
4069
|
};
|
|
3991
4070
|
|
|
4071
|
+
const Dialog = DialogPrimitive.Root;
|
|
4072
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
4073
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
4074
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4075
|
+
DialogPrimitive.Overlay,
|
|
4076
|
+
{
|
|
4077
|
+
ref,
|
|
4078
|
+
className: cn(
|
|
4079
|
+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
4080
|
+
className
|
|
4081
|
+
),
|
|
4082
|
+
...props
|
|
4083
|
+
}
|
|
4084
|
+
));
|
|
4085
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
4086
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
4087
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
4088
|
+
/* @__PURE__ */ jsxs(
|
|
4089
|
+
DialogPrimitive.Content,
|
|
4090
|
+
{
|
|
4091
|
+
ref,
|
|
4092
|
+
className: cn(
|
|
4093
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
4094
|
+
className
|
|
4095
|
+
),
|
|
4096
|
+
...props,
|
|
4097
|
+
children: [
|
|
4098
|
+
children,
|
|
4099
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
4100
|
+
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
4101
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
4102
|
+
] })
|
|
4103
|
+
]
|
|
4104
|
+
}
|
|
4105
|
+
)
|
|
4106
|
+
] }));
|
|
4107
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
4108
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4109
|
+
DialogPrimitive.Title,
|
|
4110
|
+
{
|
|
4111
|
+
ref,
|
|
4112
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
4113
|
+
...props
|
|
4114
|
+
}
|
|
4115
|
+
));
|
|
4116
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
4117
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
4118
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
4119
|
+
|
|
4120
|
+
const useHasAttachments = () => {
|
|
4121
|
+
const composer = useComposerRuntime();
|
|
4122
|
+
const [hasAttachments, setHasAttachments] = useState(false);
|
|
4123
|
+
useEffect(() => {
|
|
4124
|
+
composer.subscribe(() => {
|
|
4125
|
+
const attachments = composer.getState().attachments;
|
|
4126
|
+
setHasAttachments(attachments.length > 0);
|
|
4127
|
+
});
|
|
4128
|
+
}, [composer]);
|
|
4129
|
+
return hasAttachments;
|
|
4130
|
+
};
|
|
4131
|
+
|
|
4132
|
+
const useFileSrc = (file) => {
|
|
4133
|
+
const [src, setSrc] = useState(void 0);
|
|
4134
|
+
useEffect(() => {
|
|
4135
|
+
if (!file) {
|
|
4136
|
+
setSrc(void 0);
|
|
4137
|
+
return;
|
|
4138
|
+
}
|
|
4139
|
+
const objectUrl = URL.createObjectURL(file);
|
|
4140
|
+
setSrc(objectUrl);
|
|
4141
|
+
return () => {
|
|
4142
|
+
URL.revokeObjectURL(objectUrl);
|
|
4143
|
+
};
|
|
4144
|
+
}, [file]);
|
|
4145
|
+
return src;
|
|
4146
|
+
};
|
|
4147
|
+
const useAttachmentSrc = () => {
|
|
4148
|
+
const { file, src } = useAttachment(
|
|
4149
|
+
useShallow((a) => {
|
|
4150
|
+
if (a.type !== "image") return {};
|
|
4151
|
+
if (a.file) return { file: a.file };
|
|
4152
|
+
const src2 = a.content?.filter((c) => c.type === "image")[0]?.image;
|
|
4153
|
+
if (!src2) return {};
|
|
4154
|
+
return { src: src2 };
|
|
4155
|
+
})
|
|
4156
|
+
);
|
|
4157
|
+
return useFileSrc(file) ?? src;
|
|
4158
|
+
};
|
|
4159
|
+
const AttachmentPreview = ({ src }) => {
|
|
4160
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-hidden w-full", children: /* @__PURE__ */ jsx("img", { src, className: "object-contain aspect-ratio h-full w-full", alt: "Preview" }) });
|
|
4161
|
+
};
|
|
4162
|
+
const AttachmentPreviewDialog = ({ children }) => {
|
|
4163
|
+
const src = useAttachmentSrc();
|
|
4164
|
+
if (!src) return children;
|
|
4165
|
+
return /* @__PURE__ */ jsxs(Dialog, { children: [
|
|
4166
|
+
/* @__PURE__ */ jsx(DialogTrigger, { className: "hover:bg-accent/50 cursor-pointer transition-colors", asChild: true, children }),
|
|
4167
|
+
/* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
4168
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
4169
|
+
/* @__PURE__ */ jsxs(DialogContent, { className: "max-w-5xl w-full max-h-[80%]", children: [
|
|
4170
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "aui-sr-only", children: "Image Attachment Preview" }),
|
|
4171
|
+
/* @__PURE__ */ jsx(AttachmentPreview, { src })
|
|
4172
|
+
] })
|
|
4173
|
+
] })
|
|
4174
|
+
] });
|
|
4175
|
+
};
|
|
4176
|
+
const AttachmentThumbnail = () => {
|
|
4177
|
+
const isImage = useAttachment((a) => a.type === "image");
|
|
4178
|
+
const src = useAttachmentSrc();
|
|
4179
|
+
const canRemove = useAttachment((a) => a.source !== "message");
|
|
4180
|
+
return /* @__PURE__ */ jsx(TooltipProvider$1, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
4181
|
+
/* @__PURE__ */ jsxs(AttachmentPrimitive.Root, { className: "relative", children: [
|
|
4182
|
+
/* @__PURE__ */ jsx(AttachmentPreviewDialog, { children: /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "h-full w-full aspect-ratio overflow-hidden rounded-lg", children: isImage ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border-sm border-border1 overflow-hidden", children: /* @__PURE__ */ jsx("img", { src, className: "object-cover aspect-ratio size-16", alt: "Preview", height: 64, width: 64 }) }) : /* @__PURE__ */ jsx("div", { className: "rounded-lg border-sm border-border1 flex items-center justify-center", children: /* @__PURE__ */ jsx(FileIcon, { className: "text-icon3" }) }) }) }) }),
|
|
4183
|
+
canRemove && /* @__PURE__ */ jsx(AttachmentRemove, {})
|
|
4184
|
+
] }),
|
|
4185
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", children: /* @__PURE__ */ jsx(AttachmentPrimitive.Name, {}) })
|
|
4186
|
+
] }) });
|
|
4187
|
+
};
|
|
4188
|
+
const AttachmentRemove = () => {
|
|
4189
|
+
return /* @__PURE__ */ jsx(AttachmentPrimitive.Remove, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
4190
|
+
TooltipIconButton,
|
|
4191
|
+
{
|
|
4192
|
+
tooltip: "Remove file",
|
|
4193
|
+
className: "absolute -right-3 -top-3 hover:bg-transparent rounded-full bg-surface1 rounded-full p-1",
|
|
4194
|
+
side: "top",
|
|
4195
|
+
children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(CircleXIcon, {}) })
|
|
4196
|
+
}
|
|
4197
|
+
) });
|
|
4198
|
+
};
|
|
4199
|
+
const UserMessageAttachments = () => {
|
|
4200
|
+
return /* @__PURE__ */ jsx(MessagePrimitive.Attachments, { components: { Attachment: InMessageAttachment } });
|
|
4201
|
+
};
|
|
4202
|
+
const InMessageAttachment = () => {
|
|
4203
|
+
const isImage = useAttachment((a) => a.type === "image");
|
|
4204
|
+
const src = useAttachmentSrc();
|
|
4205
|
+
return /* @__PURE__ */ jsx(TooltipProvider$1, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
4206
|
+
/* @__PURE__ */ jsx(AttachmentPrimitive.Root, { className: "relative pt-4", children: /* @__PURE__ */ jsx(AttachmentPreviewDialog, { children: /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "h-full w-full aspect-ratio overflow-hidden rounded-lg", children: isImage ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border-sm border-border1 overflow-hidden", children: /* @__PURE__ */ jsx("img", { src, className: "object-cover aspect-ratio max-h-[140px] max-w-[320px]", alt: "Preview" }) }) : /* @__PURE__ */ jsx("div", { className: "rounded-lg border-sm border-border1 flex items-center justify-center", children: /* @__PURE__ */ jsx(FileIcon, { className: "text-icon3" }) }) }) }) }) }),
|
|
4207
|
+
/* @__PURE__ */ jsx(TooltipContent, { side: "top", children: /* @__PURE__ */ jsx(AttachmentPrimitive.Name, {}) })
|
|
4208
|
+
] }) });
|
|
4209
|
+
};
|
|
4210
|
+
const ComposerAttachments = () => {
|
|
4211
|
+
const hasAttachments = useHasAttachments();
|
|
4212
|
+
if (!hasAttachments) return null;
|
|
4213
|
+
return /* @__PURE__ */ jsx("div", { className: "flex w-full flex-row items-center gap-4 h-24", children: /* @__PURE__ */ jsx(ComposerPrimitive.Attachments, { components: { Attachment: AttachmentThumbnail } }) });
|
|
4214
|
+
};
|
|
4215
|
+
|
|
3992
4216
|
const UserMessage = () => {
|
|
3993
|
-
return /* @__PURE__ */
|
|
4217
|
+
return /* @__PURE__ */ jsxs(MessagePrimitive.Root, { className: "w-full flex items-end pb-4 flex-col", children: [
|
|
4218
|
+
/* @__PURE__ */ jsx("div", { className: "max-w-[366px] px-5 py-3 text-icon6 text-ui-lg leading-ui-lg rounded-lg bg-surface3", children: /* @__PURE__ */ jsx(MessagePrimitive.Content, {}) }),
|
|
4219
|
+
/* @__PURE__ */ jsx(UserMessageAttachments, {})
|
|
4220
|
+
] });
|
|
3994
4221
|
};
|
|
3995
4222
|
|
|
3996
4223
|
const useAutoscroll = (ref, { enabled = true }) => {
|
|
@@ -4045,13 +4272,63 @@ const Txt = ({ as: Root = "p", className, variant = "ui-md", font, ...props }) =
|
|
|
4045
4272
|
return /* @__PURE__ */ jsx(Root, { className: clsx(variants[variant], font && fonts[font], className), ...props });
|
|
4046
4273
|
};
|
|
4047
4274
|
|
|
4048
|
-
const
|
|
4275
|
+
const useSpeechRecognition = ({ language = "en-US" } = {}) => {
|
|
4276
|
+
const speechRecognitionRef = useRef(null);
|
|
4277
|
+
const [state, setState] = useState({
|
|
4278
|
+
isListening: false,
|
|
4279
|
+
transcript: "",
|
|
4280
|
+
error: null
|
|
4281
|
+
});
|
|
4282
|
+
const start = () => {
|
|
4283
|
+
if (!speechRecognitionRef.current) return;
|
|
4284
|
+
speechRecognitionRef.current.start();
|
|
4285
|
+
};
|
|
4286
|
+
const stop = () => {
|
|
4287
|
+
if (!speechRecognitionRef.current) return;
|
|
4288
|
+
speechRecognitionRef.current.stop();
|
|
4289
|
+
};
|
|
4290
|
+
useEffect(() => {
|
|
4291
|
+
if (!("webkitSpeechRecognition" in window) && !("SpeechRecognition" in window)) {
|
|
4292
|
+
setState((prev) => ({ ...prev, error: "Speech Recognition not supported in this browser" }));
|
|
4293
|
+
return;
|
|
4294
|
+
}
|
|
4295
|
+
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
4296
|
+
const recognition = new SpeechRecognition();
|
|
4297
|
+
speechRecognitionRef.current = recognition;
|
|
4298
|
+
recognition.continuous = true;
|
|
4299
|
+
recognition.lang = language;
|
|
4300
|
+
recognition.onstart = () => {
|
|
4301
|
+
setState((prev) => ({ ...prev, isListening: true }));
|
|
4302
|
+
};
|
|
4303
|
+
recognition.onresult = (event) => {
|
|
4304
|
+
let finalTranscript = "";
|
|
4305
|
+
for (let i = event.resultIndex; i < event.results.length; i++) {
|
|
4306
|
+
const transcript = event.results[i][0].transcript;
|
|
4307
|
+
if (event.results[i].isFinal) {
|
|
4308
|
+
finalTranscript += transcript + " ";
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
setState((prev) => ({ ...prev, transcript: finalTranscript }));
|
|
4312
|
+
};
|
|
4313
|
+
recognition.onerror = (event) => {
|
|
4314
|
+
setState((prev) => ({ ...prev, error: `Error: ${event.error}` }));
|
|
4315
|
+
};
|
|
4316
|
+
recognition.onend = () => setState((prev) => ({ ...prev, isListening: false }));
|
|
4317
|
+
}, [language]);
|
|
4318
|
+
return {
|
|
4319
|
+
...state,
|
|
4320
|
+
start,
|
|
4321
|
+
stop
|
|
4322
|
+
};
|
|
4323
|
+
};
|
|
4324
|
+
|
|
4325
|
+
const Thread = ({ ToolFallback, agentName, hasMemory, showFileSupport }) => {
|
|
4049
4326
|
const areaRef = useRef(null);
|
|
4050
4327
|
useAutoscroll(areaRef, { enabled: true });
|
|
4051
4328
|
const WrappedAssistantMessage = (props) => {
|
|
4052
4329
|
return /* @__PURE__ */ jsx(AssistantMessage, { ...props, ToolFallback });
|
|
4053
4330
|
};
|
|
4054
|
-
return /* @__PURE__ */ jsxs(
|
|
4331
|
+
return /* @__PURE__ */ jsxs(ThreadWrapper, { children: [
|
|
4055
4332
|
/* @__PURE__ */ jsxs(ThreadPrimitive.Viewport, { className: "py-10 overflow-y-auto scroll-smooth h-full", ref: areaRef, autoScroll: false, children: [
|
|
4056
4333
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
4057
4334
|
/* @__PURE__ */ jsx(ThreadWelcome, { agentName }),
|
|
@@ -4068,9 +4345,22 @@ const Thread = ({ ToolFallback, agentName, hasMemory }) => {
|
|
|
4068
4345
|
] }),
|
|
4069
4346
|
/* @__PURE__ */ jsx(ThreadPrimitive.If, { empty: false, children: /* @__PURE__ */ jsx("div", {}) })
|
|
4070
4347
|
] }),
|
|
4071
|
-
/* @__PURE__ */ jsx(Composer, { hasMemory })
|
|
4348
|
+
/* @__PURE__ */ jsx(Composer, { hasMemory, showFileSupport })
|
|
4072
4349
|
] });
|
|
4073
4350
|
};
|
|
4351
|
+
const ThreadWrapper = ({ children }) => {
|
|
4352
|
+
const hasAttachments = useHasAttachments();
|
|
4353
|
+
return /* @__PURE__ */ jsx(
|
|
4354
|
+
ThreadPrimitive.Root,
|
|
4355
|
+
{
|
|
4356
|
+
className: clsx(
|
|
4357
|
+
"max-w-[568px] w-full mx-auto px-4",
|
|
4358
|
+
hasAttachments ? "h-[calc(100%-208px)]" : "h-[calc(100%-112px)]"
|
|
4359
|
+
),
|
|
4360
|
+
children
|
|
4361
|
+
}
|
|
4362
|
+
);
|
|
4363
|
+
};
|
|
4074
4364
|
const ThreadWelcome = ({ agentName }) => {
|
|
4075
4365
|
const safeAgentName = agentName ?? "";
|
|
4076
4366
|
const words = safeAgentName.split(" ") ?? [];
|
|
@@ -4087,20 +4377,26 @@ const ThreadWelcome = ({ agentName }) => {
|
|
|
4087
4377
|
/* @__PURE__ */ jsx("p", { className: "mt-4 font-medium", children: "How can I help you today?" })
|
|
4088
4378
|
] }) });
|
|
4089
4379
|
};
|
|
4090
|
-
const Composer = ({ hasMemory }) => {
|
|
4380
|
+
const Composer = ({ hasMemory, showFileSupport }) => {
|
|
4091
4381
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
4092
|
-
/* @__PURE__ */ jsxs(ComposerPrimitive.Root, {
|
|
4093
|
-
/* @__PURE__ */ jsx(
|
|
4094
|
-
|
|
4095
|
-
{
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4382
|
+
/* @__PURE__ */ jsxs(ComposerPrimitive.Root, { children: [
|
|
4383
|
+
/* @__PURE__ */ jsx(ComposerAttachments, {}),
|
|
4384
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full bg-surface3 rounded-lg border-sm border-border1 px-3 py-4 mt-auto h-[100px]", children: [
|
|
4385
|
+
/* @__PURE__ */ jsx(ComposerPrimitive.Input, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsx(
|
|
4386
|
+
"textarea",
|
|
4387
|
+
{
|
|
4388
|
+
className: "text-ui-lg leading-ui-lg placeholder:text-icon3 text-icon6 bg-transparent focus:outline-none resize-none",
|
|
4389
|
+
autoFocus: true,
|
|
4390
|
+
placeholder: "Enter your message...",
|
|
4391
|
+
name: "",
|
|
4392
|
+
id: ""
|
|
4393
|
+
}
|
|
4394
|
+
) }),
|
|
4395
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
4396
|
+
/* @__PURE__ */ jsx(SpeechInput, {}),
|
|
4397
|
+
/* @__PURE__ */ jsx(ComposerAction, { showFileSupport })
|
|
4398
|
+
] })
|
|
4399
|
+
] })
|
|
4104
4400
|
] }),
|
|
4105
4401
|
!hasMemory && /* @__PURE__ */ jsxs(Txt, { variant: "ui-sm", className: "text-icon3 flex items-center gap-2 pt-0.5", children: [
|
|
4106
4402
|
/* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(InfoIcon, {}) }),
|
|
@@ -4108,8 +4404,28 @@ const Composer = ({ hasMemory }) => {
|
|
|
4108
4404
|
] })
|
|
4109
4405
|
] });
|
|
4110
4406
|
};
|
|
4111
|
-
const
|
|
4407
|
+
const SpeechInput = () => {
|
|
4408
|
+
const composerRuntime = useComposerRuntime();
|
|
4409
|
+
const { start, stop, isListening, transcript } = useSpeechRecognition();
|
|
4410
|
+
useEffect(() => {
|
|
4411
|
+
if (!transcript) return;
|
|
4412
|
+
composerRuntime.setText(transcript);
|
|
4413
|
+
}, [composerRuntime, transcript]);
|
|
4414
|
+
return /* @__PURE__ */ jsx(
|
|
4415
|
+
TooltipIconButton,
|
|
4416
|
+
{
|
|
4417
|
+
type: "button",
|
|
4418
|
+
tooltip: isListening ? "Stop dictation" : "Start dictation",
|
|
4419
|
+
variant: "ghost",
|
|
4420
|
+
className: "rounded-full",
|
|
4421
|
+
onClick: () => isListening ? stop() : start(),
|
|
4422
|
+
children: isListening ? /* @__PURE__ */ jsx(CircleStopIcon, {}) : /* @__PURE__ */ jsx(Mic, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" })
|
|
4423
|
+
}
|
|
4424
|
+
);
|
|
4425
|
+
};
|
|
4426
|
+
const ComposerAction = ({ showFileSupport }) => {
|
|
4112
4427
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4428
|
+
showFileSupport && /* @__PURE__ */ jsx(ComposerPrimitive.AddAttachment, { asChild: true, children: /* @__PURE__ */ jsx(TooltipIconButton, { tooltip: "Add attachment", variant: "ghost", className: "rounded-full", children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" }) }) }),
|
|
4113
4429
|
/* @__PURE__ */ jsx(ThreadPrimitive.If, { running: false, children: /* @__PURE__ */ jsx(ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
4114
4430
|
TooltipIconButton,
|
|
4115
4431
|
{
|
|
@@ -4143,9 +4459,40 @@ const createMastraClient = (baseUrl) => {
|
|
|
4143
4459
|
});
|
|
4144
4460
|
};
|
|
4145
4461
|
|
|
4462
|
+
const fileToBase64 = async (file) => {
|
|
4463
|
+
return new Promise((resolve, reject) => {
|
|
4464
|
+
const reader = new FileReader();
|
|
4465
|
+
reader.onload = () => {
|
|
4466
|
+
const result = reader.result;
|
|
4467
|
+
if (typeof result === "string") {
|
|
4468
|
+
resolve(result);
|
|
4469
|
+
} else {
|
|
4470
|
+
reject(new Error("Failed to convert file to base64."));
|
|
4471
|
+
}
|
|
4472
|
+
};
|
|
4473
|
+
reader.onerror = (error) => {
|
|
4474
|
+
reject(error);
|
|
4475
|
+
};
|
|
4476
|
+
reader.readAsDataURL(file);
|
|
4477
|
+
});
|
|
4478
|
+
};
|
|
4479
|
+
|
|
4146
4480
|
const convertMessage$1 = (message) => {
|
|
4147
4481
|
return message;
|
|
4148
4482
|
};
|
|
4483
|
+
const convertToAIAttachments = async (attachments) => {
|
|
4484
|
+
const promises = attachments.filter((attachment) => attachment.file).map(async (attachment) => ({
|
|
4485
|
+
role: "user",
|
|
4486
|
+
content: [
|
|
4487
|
+
{
|
|
4488
|
+
type: "image",
|
|
4489
|
+
image: await fileToBase64(attachment.file),
|
|
4490
|
+
mimeType: attachment.file.type
|
|
4491
|
+
}
|
|
4492
|
+
]
|
|
4493
|
+
}));
|
|
4494
|
+
return Promise.all(promises);
|
|
4495
|
+
};
|
|
4149
4496
|
function MastraRuntimeProvider({
|
|
4150
4497
|
children,
|
|
4151
4498
|
agentId,
|
|
@@ -4198,8 +4545,12 @@ function MastraRuntimeProvider({
|
|
|
4198
4545
|
const agent = mastra.getAgent(agentId);
|
|
4199
4546
|
const onNew = async (message) => {
|
|
4200
4547
|
if (message.content[0]?.type !== "text") throw new Error("Only text messages are supported");
|
|
4548
|
+
const attachments = await convertToAIAttachments(message.attachments);
|
|
4201
4549
|
const input = message.content[0].text;
|
|
4202
|
-
setMessages((currentConversation) => [
|
|
4550
|
+
setMessages((currentConversation) => [
|
|
4551
|
+
...currentConversation,
|
|
4552
|
+
{ role: "user", content: input, attachments: message.attachments }
|
|
4553
|
+
]);
|
|
4203
4554
|
setIsRunning(true);
|
|
4204
4555
|
try {
|
|
4205
4556
|
if (chatWithGenerate) {
|
|
@@ -4208,7 +4559,8 @@ function MastraRuntimeProvider({
|
|
|
4208
4559
|
{
|
|
4209
4560
|
role: "user",
|
|
4210
4561
|
content: input
|
|
4211
|
-
}
|
|
4562
|
+
},
|
|
4563
|
+
...attachments
|
|
4212
4564
|
],
|
|
4213
4565
|
runId: agentId,
|
|
4214
4566
|
frequencyPenalty,
|
|
@@ -4317,7 +4669,8 @@ function MastraRuntimeProvider({
|
|
|
4317
4669
|
{
|
|
4318
4670
|
role: "user",
|
|
4319
4671
|
content: input
|
|
4320
|
-
}
|
|
4672
|
+
},
|
|
4673
|
+
...attachments
|
|
4321
4674
|
],
|
|
4322
4675
|
runId: agentId,
|
|
4323
4676
|
frequencyPenalty,
|
|
@@ -4438,7 +4791,10 @@ function MastraRuntimeProvider({
|
|
|
4438
4791
|
isRunning,
|
|
4439
4792
|
messages,
|
|
4440
4793
|
convertMessage: convertMessage$1,
|
|
4441
|
-
onNew
|
|
4794
|
+
onNew,
|
|
4795
|
+
adapters: {
|
|
4796
|
+
attachments: new CompositeAttachmentAdapter([new SimpleImageAttachmentAdapter()])
|
|
4797
|
+
}
|
|
4442
4798
|
});
|
|
4443
4799
|
return /* @__PURE__ */ jsxs(AssistantRuntimeProvider, { runtime, children: [
|
|
4444
4800
|
" ",
|
|
@@ -4520,7 +4876,8 @@ const AgentChat = ({
|
|
|
4520
4876
|
initialMessages,
|
|
4521
4877
|
memory,
|
|
4522
4878
|
baseUrl,
|
|
4523
|
-
refreshThreadList
|
|
4879
|
+
refreshThreadList,
|
|
4880
|
+
showFileSupport
|
|
4524
4881
|
}) => {
|
|
4525
4882
|
const { modelSettings, chatWithGenerate } = useContext(AgentContext);
|
|
4526
4883
|
const { runtimeContext } = usePlaygroundStore();
|
|
@@ -4537,7 +4894,7 @@ const AgentChat = ({
|
|
|
4537
4894
|
modelSettings,
|
|
4538
4895
|
chatWithGenerate,
|
|
4539
4896
|
runtimeContext,
|
|
4540
|
-
children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4 bg-surface1", children: /* @__PURE__ */ jsx(Thread, { agentName: agentName ?? "", hasMemory: memory }) })
|
|
4897
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4 bg-surface1", children: /* @__PURE__ */ jsx(Thread, { agentName: agentName ?? "", hasMemory: memory, showFileSupport }) })
|
|
4541
4898
|
}
|
|
4542
4899
|
);
|
|
4543
4900
|
};
|
|
@@ -7199,54 +7556,6 @@ const Collapsible = CollapsiblePrimitive.Root;
|
|
|
7199
7556
|
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
7200
7557
|
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
7201
7558
|
|
|
7202
|
-
const Dialog = DialogPrimitive.Root;
|
|
7203
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
7204
|
-
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7205
|
-
DialogPrimitive.Overlay,
|
|
7206
|
-
{
|
|
7207
|
-
ref,
|
|
7208
|
-
className: cn(
|
|
7209
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
7210
|
-
className
|
|
7211
|
-
),
|
|
7212
|
-
...props
|
|
7213
|
-
}
|
|
7214
|
-
));
|
|
7215
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
7216
|
-
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
7217
|
-
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
7218
|
-
/* @__PURE__ */ jsxs(
|
|
7219
|
-
DialogPrimitive.Content,
|
|
7220
|
-
{
|
|
7221
|
-
ref,
|
|
7222
|
-
className: cn(
|
|
7223
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
7224
|
-
className
|
|
7225
|
-
),
|
|
7226
|
-
...props,
|
|
7227
|
-
children: [
|
|
7228
|
-
children,
|
|
7229
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
7230
|
-
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
7231
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
7232
|
-
] })
|
|
7233
|
-
]
|
|
7234
|
-
}
|
|
7235
|
-
)
|
|
7236
|
-
] }));
|
|
7237
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
7238
|
-
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7239
|
-
DialogPrimitive.Title,
|
|
7240
|
-
{
|
|
7241
|
-
ref,
|
|
7242
|
-
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
7243
|
-
...props
|
|
7244
|
-
}
|
|
7245
|
-
));
|
|
7246
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7247
|
-
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
7248
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
7249
|
-
|
|
7250
7559
|
const ScrollArea = React.forwardRef(
|
|
7251
7560
|
({ className, children, viewPortClassName, maxHeight, autoScroll = false, ...props }, ref) => {
|
|
7252
7561
|
const areaRef = React.useRef(null);
|
|
@@ -9391,5 +9700,5 @@ const useTraces = (componentName, baseUrl, isWorkflow = false) => {
|
|
|
9391
9700
|
return { traces, firstCallLoading, error };
|
|
9392
9701
|
};
|
|
9393
9702
|
|
|
9394
|
-
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, AgentProvider, 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, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LogsIcon, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolsIcon, TraceContext, TraceIcon, TraceProvider, TsIcon, Txt, TxtCell, UnitCell, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger, refineTraces, usePlaygroundStore, usePolling, useTraces };
|
|
9703
|
+
export { AgentChat, AgentCoinIcon, AgentContext, AgentEvals, AgentIcon, AgentNetworkCoinIcon, AgentProvider, 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, EntryCell, EnvIcon, EvaluatorCoinIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, JudgeIcon, LatencyIcon, LegacyWorkflowGraph, LegacyWorkflowTrigger, LogsIcon, MastraResizablePanel, McpCoinIcon, McpServerIcon, MemoryIcon, NetworkChat, NetworkContext, NetworkProvider, OpenAIIcon, PromptIcon, RepoIcon, Row, ScoreIcon, SettingsIcon, SlashIcon, Table, Tbody, Th, Thead, ThreadDeleteButton, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolsIcon, TraceContext, TraceIcon, TraceProvider, TsIcon, Txt, TxtCell, UnitCell, VariablesIcon, WorkflowCoinIcon, WorkflowGraph, WorkflowIcon, WorkflowRunContext, WorkflowRunProvider, WorkflowTraces, WorkflowTrigger, refineTraces, usePlaygroundStore, usePolling, useSpeechRecognition, useTraces };
|
|
9395
9704
|
//# sourceMappingURL=index.es.js.map
|