@mastra/playground-ui 7.0.0-beta.19 → 7.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/dist/index.cjs.js +536 -847
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +534 -842
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/assistant-ui/tooltip-icon-button.d.ts +2 -7
  7. package/dist/src/components/ui/combobox.d.ts +2 -2
  8. package/dist/src/components/ui/elements/buttons/index.d.ts +0 -1
  9. package/dist/src/components/ui/elements/tabs/index.d.ts +4 -1
  10. package/dist/src/components/ui/elements/tabs/tabs-root.d.ts +1 -1
  11. package/dist/src/components/ui/elements/tabs/tabs-tab.d.ts +2 -1
  12. package/dist/src/components/ui/input.d.ts +1 -1
  13. package/dist/src/components/ui/text.d.ts +2 -2
  14. package/dist/src/domains/memory/hooks/use-memory.d.ts +5 -0
  15. package/dist/src/domains/scores/hooks/use-trace-span-scores.d.ts +3 -3
  16. package/dist/src/domains/templates/template-form.d.ts +2 -1
  17. package/dist/src/domains/workflows/hooks/use-workflows-actions.d.ts +1 -0
  18. package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +2 -1
  19. package/dist/src/ds/components/Avatar/Avatar.d.ts +5 -3
  20. package/dist/src/ds/components/Button/Button.d.ts +6 -2
  21. package/dist/src/ds/components/CodeEditor/code-editor.d.ts +12 -0
  22. package/dist/src/ds/components/CodeEditor/index.d.ts +1 -0
  23. package/dist/src/ds/tokens/sizes.d.ts +3 -1
  24. package/dist/src/hooks/use-workflow-runs.d.ts +1 -1
  25. package/dist/src/index.d.ts +0 -2
  26. package/dist/tokens.cjs.js +3 -1
  27. package/dist/tokens.cjs.js.map +1 -1
  28. package/dist/tokens.es.js +3 -1
  29. package/dist/tokens.es.js.map +1 -1
  30. package/package.json +13 -25
  31. package/dist/src/components/assistant-ui/syntax-highlighter.d.ts +0 -1
  32. package/dist/src/components/syntax-highlighter.d.ts +0 -5
  33. package/dist/src/components/ui/avatar.d.ts +0 -6
  34. package/dist/src/components/ui/badge.d.ts +0 -9
  35. package/dist/src/components/ui/button.d.ts +0 -16
  36. package/dist/src/components/ui/calendar.d.ts +0 -8
  37. package/dist/src/components/ui/card.d.ts +0 -8
  38. package/dist/src/components/ui/command.d.ts +0 -78
  39. package/dist/src/components/ui/date-picker.d.ts +0 -23
  40. package/dist/src/components/ui/elements/buttons/button.d.ts +0 -8
  41. package/dist/src/components/ui/elements/tabs/tabs.d.ts +0 -24
  42. package/dist/src/components/ui/form.d.ts +0 -23
  43. package/dist/src/components/ui/playground-tabs.d.ts +0 -25
  44. package/dist/src/components/ui/syntax-highlighter.d.ts +0 -7
  45. package/dist/src/components/ui/table.d.ts +0 -10
  46. package/dist/src/components/ui/tabs.d.ts +0 -7
  47. package/dist/src/components/ui/textarea.d.ts +0 -5
  48. package/dist/src/ds/components/TraceTree/Span.d.ts +0 -32
  49. package/dist/src/ds/components/TraceTree/Spans.d.ts +0 -5
  50. package/dist/src/ds/components/TraceTree/Time.d.ts +0 -8
  51. package/dist/src/ds/components/TraceTree/Trace.d.ts +0 -13
  52. package/dist/src/ds/components/TraceTree/TraceTree.d.ts +0 -5
  53. package/dist/src/ds/components/TraceTree/index.d.ts +0 -1
  54. package/dist/src/ds/components/types.d.ts +0 -4
package/dist/index.es.js CHANGED
@@ -1,18 +1,17 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useAssistantState, useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, useAttachment, ComposerPrimitive, AttachmentPrimitive, useComposer, ThreadPrimitive, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, WebSpeechSynthesisAdapter, useExternalStoreRuntime, AssistantRuntimeProvider } from '@assistant-ui/react';
3
- import { CheckIcon as CheckIcon$1, CopyIcon, ShieldAlert, ChevronDown, ChevronRight, RefreshCw, Tag, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, X, Share2, Check, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, Repeat, Repeat1, Network, CalendarIcon, Braces, ChevronDownIcon, Brackets, PlusIcon, TrashIcon, Plus, Loader2, Circle, EyeOffIcon, EyeIcon, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Maximize, AlertCircleIcon, CirclePause, StopCircle, Cpu, SearchIcon, ChevronsUpDown, Search, ArrowRight, ArrowLeft, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, ExternalLink, XIcon, TriangleAlertIcon, ChevronRightIcon, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, CircleAlertIcon, PanelRightIcon, KeyboardIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, Info, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, ChevronsUpIcon, ChevronsDownIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, CircleSlash, Trash, Link2, MoveRight, Copy } from 'lucide-react';
3
+ import { CheckIcon as CheckIcon$1, CopyIcon, ShieldAlert, ChevronDown, ChevronRight, RefreshCw, Tag, InfoIcon as InfoIcon$1, AlertCircle, TriangleAlert, ChevronUpIcon, CheckCircleIcon, X, Share2, Check, Clock as Clock$1, PlayCircle, Workflow, Layers, List, CalendarClock, Timer, CornerDownRight, GitBranch, Repeat, Repeat1, Network, CalendarIcon, Braces, ChevronDownIcon, Brackets, PlusIcon, TrashIcon, Plus, Loader2, Circle, EyeOffIcon, EyeIcon, PauseIcon, HourglassIcon, CircleDashed, Footprints, CircleCheck, CircleX, Minus, Maximize, AlertCircleIcon, CirclePause, StopCircle, Cpu, SearchIcon, ChevronsUpDown, Search, ArrowRight, ArrowLeft, BrainIcon, AudioLinesIcon, StopCircleIcon, FileText, CircleXIcon, Link, CloudUpload, Mic, ArrowUp, SaveIcon, ExternalLink, XIcon, TriangleAlertIcon, ChevronRightIcon, ArrowLeftIcon, ArrowRightIcon, ChevronsRightIcon, AlignLeftIcon, AlignJustifyIcon, ArrowUpIcon, ArrowDownIcon, CircleAlertIcon, PanelRightIcon, KeyboardIcon, GaugeIcon, ChevronsLeftRightEllipsisIcon, CalculatorIcon, HashIcon, FileInputIcon, FileOutputIcon, ReceiptText, Info, RotateCcw, GripVertical, RefreshCcwIcon, AlertTriangleIcon, Copy, NetworkIcon, WorkflowIcon as WorkflowIcon$1, PackageIcon, GitBranchIcon, PackageOpenIcon, OctagonXIcon, FrownIcon, CircleChevronUpIcon, CircleChevronDownIcon, FileIcon, ChevronsUpIcon, ChevronsDownIcon, TimerIcon, ChevronsLeftRightIcon, ChevronFirstIcon, ChevronLastIcon, CircleDashedIcon, ArrowRightToLineIcon, CoinsIcon, BracesIcon, CircleGaugeIcon, PanelTopIcon, ListTreeIcon, PanelLeftIcon, CircleSlash, Trash, Link2, MoveRight } from 'lucide-react';
4
4
  import * as React from 'react';
5
5
  import React__default, { forwardRef, memo, useState, useEffect, useRef, useCallback, useMemo, createContext, useContext, Fragment as Fragment$1, useId, Suspense, useLayoutEffect } from 'react';
6
- import { Slot } from '@radix-ui/react-slot';
7
6
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
8
7
  import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
9
- import * as AvatarPrimitive from '@radix-ui/react-avatar';
10
8
  import { unstable_memoizeMarkdownComponents, useIsMarkdownCodeBlock, MarkdownTextPrimitive } from '@assistant-ui/react-markdown';
11
9
  import '@assistant-ui/react-markdown/styles/dot.css';
12
10
  import remarkGfm from 'remark-gfm';
13
- import { makePrismAsyncLightSyntaxHighlighter } from '@assistant-ui/react-syntax-highlighter';
14
11
  import { coldarkDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
12
+ import { makePrismAsyncLightSyntaxHighlighter } from '@assistant-ui/react-syntax-highlighter';
15
13
  import { jsonLanguage, json } from '@codemirror/lang-json';
14
+ import { EditorView } from '@codemirror/view';
16
15
  import { tags } from '@lezer/highlight';
17
16
  import { draculaInit } from '@uiw/codemirror-theme-dracula';
18
17
  import CodeMirror, { EditorView as EditorView$1 } from '@uiw/react-codemirror';
@@ -31,11 +30,9 @@ import Dagre from '@dagrejs/dagre';
31
30
  import { Highlight, themes } from 'prism-react-renderer';
32
31
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
33
32
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
34
- import { EditorView } from '@codemirror/view';
35
33
  import { javascript } from '@codemirror/lang-javascript';
36
34
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
37
- import { format, isValid, formatDate, isToday } from 'date-fns';
38
- import { useDebouncedCallback, useThrottledCallback } from 'use-debounce';
35
+ import { isValid, format, formatDate, isToday } from 'date-fns';
39
36
  import { DayPicker } from 'react-day-picker';
40
37
  import * as PopoverPrimitive from '@radix-ui/react-popover';
41
38
  import * as SelectPrimitive from '@radix-ui/react-select';
@@ -57,6 +54,7 @@ import { parse } from 'superjson';
57
54
  import * as SliderPrimitive from '@radix-ui/react-slider';
58
55
  import { CodeBlock as CodeBlock$1 } from 'react-code-block';
59
56
  import { useReactTable, getCoreRowModel, flexRender } from '@tanstack/react-table';
57
+ import { useDebouncedCallback, useThrottledCallback } from 'use-debounce';
60
58
  import { I as IconColors } from './colors-Br49332d.js';
61
59
  import { toAISdkV5Messages, toAISdkV4Messages } from '@mastra/ai-sdk/ui';
62
60
  import Markdown from 'react-markdown';
@@ -73,52 +71,53 @@ import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
73
71
  import { languages } from '@codemirror/language-data';
74
72
  import { githubDarkInit } from '@uiw/codemirror-theme-github';
75
73
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
76
- import * as TabsPrimitive from '@radix-ui/react-tabs';
74
+ import * as RadixTabs from '@radix-ui/react-tabs';
77
75
  import { Separator, usePanelRef, Panel as Panel$1, useDefaultLayout, Group } from 'react-resizable-panels';
78
76
  import semver from 'semver';
79
77
 
80
78
  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
81
79
 
82
- const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
83
- const cx = clsx;
84
- const cva = (base, config)=>(props)=>{
85
- var _config_compoundVariants;
86
- if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
87
- const { variants, defaultVariants } = config;
88
- const getVariantClassNames = Object.keys(variants).map((variant)=>{
89
- const variantProp = props === null || props === void 0 ? void 0 : props[variant];
90
- const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
91
- if (variantProp === null) return null;
92
- const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
93
- return variants[variant][variantKey];
94
- });
95
- const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
96
- let [key, value] = param;
97
- if (value === undefined) {
98
- return acc;
99
- }
100
- acc[key] = value;
101
- return acc;
102
- }, {});
103
- const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
104
- let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
105
- return Object.entries(compoundVariantOptions).every((param)=>{
106
- let [key, value] = param;
107
- return Array.isArray(value) ? value.includes({
108
- ...defaultVariants,
109
- ...propsWithoutUndefined
110
- }[key]) : ({
111
- ...defaultVariants,
112
- ...propsWithoutUndefined
113
- })[key] === value;
114
- }) ? [
115
- ...acc,
116
- cvClass,
117
- cvClassName
118
- ] : acc;
119
- }, []);
120
- return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
121
- };
80
+ const sizeClasses$1 = {
81
+ md: "h-button-md gap-md",
82
+ lg: "h-button-lg gap-lg"
83
+ };
84
+ const variantClasses$2 = {
85
+ default: "bg-surface2 hover:bg-surface4 text-icon3 hover:text-icon6 disabled:opacity-50",
86
+ light: "bg-surface3 hover:bg-surface5 text-icon6 disabled:opacity-50",
87
+ outline: "bg-transparent hover:bg-surface2 text-icon3 hover:text-icon6 disabled:opacity-50",
88
+ ghost: "bg-transparent border-transparent hover:bg-surface2 text-icon3 hover:text-icon6 disabled:opacity-50"
89
+ };
90
+ function buttonVariants(options) {
91
+ const variant = options?.variant || "default";
92
+ const size = options?.size || "md";
93
+ return clsx(
94
+ "bg-surface2 border-sm border-border1 px-lg text-ui-md inline-flex items-center justify-center rounded-md border",
95
+ variantClasses$2[variant],
96
+ sizeClasses$1[size]
97
+ );
98
+ }
99
+ const Button = React__default.forwardRef(
100
+ ({ className, as, size = "md", variant = "default", ...props }, ref) => {
101
+ const Component = as || "button";
102
+ return /* @__PURE__ */ jsx(
103
+ Component,
104
+ {
105
+ ref,
106
+ className: clsx(
107
+ "bg-surface2 border-sm border-border1 px-lg text-ui-md inline-flex items-center justify-center rounded-md border",
108
+ variantClasses$2[variant],
109
+ sizeClasses$1[size],
110
+ className,
111
+ {
112
+ "cursor-not-allowed": props.disabled
113
+ }
114
+ ),
115
+ ...props
116
+ }
117
+ );
118
+ }
119
+ );
120
+ Button.displayName = "Button";
122
121
 
123
122
  const CLASS_PART_SEPARATOR = '-';
124
123
  const createClassGroupUtils = config => {
@@ -3079,39 +3078,6 @@ function cn(...inputs) {
3079
3078
  return twMerge(clsx(inputs));
3080
3079
  }
3081
3080
 
3082
- const buttonVariants = cva(
3083
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
3084
- {
3085
- variants: {
3086
- variant: {
3087
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
3088
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
3089
- outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
3090
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
3091
- ghost: "hover:bg-accent hover:text-accent-foreground",
3092
- link: "text-primary underline-offset-4 hover:underline"
3093
- },
3094
- size: {
3095
- default: "h-9 px-4 py-2",
3096
- sm: "h-8 rounded-md px-3 text-xs",
3097
- lg: "h-10 rounded-md px-8",
3098
- icon: "h-9 w-9"
3099
- }
3100
- },
3101
- defaultVariants: {
3102
- variant: "default",
3103
- size: "default"
3104
- }
3105
- }
3106
- );
3107
- const Button$2 = React.forwardRef(
3108
- ({ className, variant, size, asChild = false, ...props }, ref) => {
3109
- const Comp = asChild ? Slot : "button";
3110
- return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
3111
- }
3112
- );
3113
- Button$2.displayName = "Button";
3114
-
3115
3081
  const TooltipProvider = TooltipPrimitive.Provider;
3116
3082
  const Tooltip = TooltipPrimitive.Root;
3117
3083
  const TooltipTrigger = TooltipPrimitive.Trigger;
@@ -3132,46 +3098,43 @@ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
3132
3098
  const TooltipIconButton = forwardRef(
3133
3099
  ({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
3134
3100
  return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
3135
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
3136
- Button$2,
3137
- {
3138
- variant: "ghost",
3139
- size: "icon",
3140
- ...rest,
3141
- className: cn("size-6 p-1", className),
3142
- ref,
3143
- "aria-label": tooltip,
3144
- children
3145
- }
3146
- ) }),
3101
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { ...rest, className: cn("size-6 p-1", className), ref, "aria-label": tooltip, children }) }),
3147
3102
  /* @__PURE__ */ jsx(TooltipContent, { side, children: tooltip })
3148
3103
  ] }) });
3149
3104
  }
3150
3105
  );
3151
3106
  TooltipIconButton.displayName = "TooltipIconButton";
3152
3107
 
3153
- const Avatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3154
- AvatarPrimitive.Root,
3155
- {
3156
- ref,
3157
- className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
3158
- ...props
3159
- }
3160
- ));
3161
- Avatar.displayName = AvatarPrimitive.Root.displayName;
3162
- const AvatarImage = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, { ref, className: cn("aspect-square h-full w-full", className), ...props }));
3163
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
3164
- const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3165
- AvatarPrimitive.Fallback,
3166
- {
3167
- ref,
3168
- className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
3169
- ...props
3170
- }
3171
- ));
3172
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
3108
+ const variants = {
3109
+ "header-md": "text-header-md leading-header-md",
3110
+ "ui-lg": "text-ui-lg leading-ui-lg",
3111
+ "ui-md": "text-ui-md leading-ui-md",
3112
+ "ui-sm": "text-ui-sm leading-ui-sm",
3113
+ "ui-xs": "text-ui-xs leading-ui-xs"
3114
+ };
3115
+ const fonts = {
3116
+ mono: "font-mono"
3117
+ };
3118
+ const Txt = ({ as: Root = "p", className, variant = "ui-md", font, ...props }) => {
3119
+ return /* @__PURE__ */ jsx(Root, { className: clsx(variants[variant], font && fonts[font], className), ...props });
3120
+ };
3173
3121
 
3174
- const SyntaxHighlighter$3 = makePrismAsyncLightSyntaxHighlighter({
3122
+ const sizeClasses = {
3123
+ sm: "h-avatar-sm w-avatar-sm",
3124
+ md: "h-avatar-md w-avatar-md",
3125
+ lg: "h-avatar-lg w-avatar-lg"
3126
+ };
3127
+ const Avatar = ({ src, name, size = "sm" }) => {
3128
+ return /* @__PURE__ */ jsx(
3129
+ "div",
3130
+ {
3131
+ className: `${sizeClasses[size]} border-sm border-border1 bg-surface-3 shrink-0 overflow-hidden rounded-full flex items-center justify-center`,
3132
+ children: src ? /* @__PURE__ */ jsx("img", { src, alt: name, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx(Txt, { variant: "ui-md", className: "text-center", children: name[0].toUpperCase() })
3133
+ }
3134
+ );
3135
+ };
3136
+
3137
+ const SyntaxHighlighter = makePrismAsyncLightSyntaxHighlighter({
3175
3138
  style: coldarkDark,
3176
3139
  customStyle: {
3177
3140
  margin: 0,
@@ -3429,7 +3392,7 @@ const defaultComponents = unstable_memoizeMarkdownComponents({
3429
3392
  );
3430
3393
  },
3431
3394
  CodeHeader,
3432
- SyntaxHighlighter: SyntaxHighlighter$3,
3395
+ SyntaxHighlighter,
3433
3396
  img: ImageWithFallback
3434
3397
  });
3435
3398
 
@@ -4230,21 +4193,7 @@ const AgentNetworkCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "12
4230
4193
  ) }) })
4231
4194
  ] });
4232
4195
 
4233
- const variants = {
4234
- "header-md": "text-header-md leading-header-md",
4235
- "ui-lg": "text-ui-lg leading-ui-lg",
4236
- "ui-md": "text-ui-md leading-ui-md",
4237
- "ui-sm": "text-ui-sm leading-ui-sm",
4238
- "ui-xs": "text-ui-xs leading-ui-xs"
4239
- };
4240
- const fonts = {
4241
- mono: "font-mono"
4242
- };
4243
- const Txt = ({ as: Root = "p", className, variant = "ui-md", font, ...props }) => {
4244
- return /* @__PURE__ */ jsx(Root, { className: clsx(variants[variant], font && fonts[font], className), ...props });
4245
- };
4246
-
4247
- const variantClasses$2 = {
4196
+ const variantClasses$1 = {
4248
4197
  warning: "bg-yellow-900/20 border-sm border-yellow-200 text-yellow-200",
4249
4198
  destructive: "bg-red-900/20 border-sm border-red-200 text-red-200",
4250
4199
  info: "bg-blue-900/20 border-sm border-blue-200 text-blue-200"
@@ -4256,7 +4205,7 @@ const variantIcons = {
4256
4205
  };
4257
4206
  const Alert$1 = ({ children, variant = "destructive" }) => {
4258
4207
  const Ico = variantIcons[variant];
4259
- return /* @__PURE__ */ jsx("div", { className: clsx(variantClasses$2[variant], "p-2 rounded-md"), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
4208
+ return /* @__PURE__ */ jsx("div", { className: clsx(variantClasses$1[variant], "p-2 rounded-md"), children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
4260
4209
  /* @__PURE__ */ jsx(Icon, { className: "mt-0.5", children: /* @__PURE__ */ jsx(Ico, {}) }),
4261
4210
  /* @__PURE__ */ jsx("div", { children })
4262
4211
  ] }) });
@@ -4268,8 +4217,34 @@ const AlertDescription$1 = ({ children, as: As = "p" }) => {
4268
4217
  return /* @__PURE__ */ jsx(Txt, { as: As, variant: "ui-sm", children });
4269
4218
  };
4270
4219
 
4220
+ const variantClasses = {
4221
+ default: "text-icon3",
4222
+ success: "text-accent1",
4223
+ error: "text-accent2",
4224
+ info: "text-accent3"
4225
+ };
4226
+ const Badge = ({ icon, variant = "default", className, children, ...props }) => {
4227
+ return /* @__PURE__ */ jsxs(
4228
+ "div",
4229
+ {
4230
+ className: clsx(
4231
+ "font-mono bg-surface4 text-ui-sm gap-md h-badge-default inline-flex items-center rounded-md shrink-0",
4232
+ icon ? "pl-md pr-1.5" : "px-1.5",
4233
+ icon || variant === "default" ? "text-icon5" : variantClasses[variant],
4234
+ className
4235
+ ),
4236
+ ...props,
4237
+ children: [
4238
+ icon && /* @__PURE__ */ jsx("span", { className: variantClasses[variant], children: /* @__PURE__ */ jsx(Icon, { children: icon }) }),
4239
+ children
4240
+ ]
4241
+ }
4242
+ );
4243
+ };
4244
+
4271
4245
  const ErrorAwareText = () => {
4272
4246
  const part = useAssistantState(({ part: part2 }) => part2);
4247
+ const [collapsedCompletionCheck, setCollapsedCompletionCheck] = useState(false);
4273
4248
  const text = part.text || "";
4274
4249
  const metadata = part.metadata || {};
4275
4250
  if (metadata?.status === "tripwire") {
@@ -4287,6 +4262,21 @@ const ErrorAwareText = () => {
4287
4262
  /* @__PURE__ */ jsx(AlertDescription$1, { as: "p", children: text })
4288
4263
  ] });
4289
4264
  }
4265
+ if (metadata?.mode === "network" && metadata?.completionResult) {
4266
+ return /* @__PURE__ */ jsxs("div", { className: "mb-2 space-y-2", children: [
4267
+ /* @__PURE__ */ jsxs("button", { onClick: () => setCollapsedCompletionCheck((s) => !s), className: "flex items-center gap-2", children: [
4268
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: cn("transition-all", collapsedCompletionCheck ? "rotate-90" : "rotate-180") }) }),
4269
+ /* @__PURE__ */ jsxs(Badge, { variant: "info", icon: /* @__PURE__ */ jsx(CheckCircleIcon, {}), children: [
4270
+ collapsedCompletionCheck ? "Show" : "Hide",
4271
+ " completion check"
4272
+ ] })
4273
+ ] }),
4274
+ !collapsedCompletionCheck && /* @__PURE__ */ jsxs(Alert$1, { variant: "info", children: [
4275
+ /* @__PURE__ */ jsx(AlertTitle$1, { as: "h5", children: metadata.completionResult?.passed ? "Complete" : "Not Complete" }),
4276
+ /* @__PURE__ */ jsx(MarkdownText, {})
4277
+ ] })
4278
+ ] });
4279
+ }
4290
4280
  try {
4291
4281
  const trimmedText = text.trim();
4292
4282
  if (trimmedText.startsWith("__ERROR__:")) {
@@ -4357,32 +4347,37 @@ function CopyButton({
4357
4347
  ] });
4358
4348
  }
4359
4349
 
4360
- const useCodemirrorTheme$2 = () => {
4361
- return useMemo(
4362
- () => draculaInit({
4350
+ const useCodemirrorTheme$1 = () => {
4351
+ return useMemo(() => {
4352
+ const baseTheme = draculaInit({
4363
4353
  settings: {
4364
4354
  fontFamily: "var(--geist-mono)",
4365
4355
  fontSize: "0.8rem",
4366
4356
  lineHighlight: "transparent",
4367
4357
  gutterBackground: "transparent",
4368
- background: "transparent",
4369
- gutterForeground: "#939393"
4358
+ gutterForeground: "#939393",
4359
+ background: "transparent"
4370
4360
  },
4371
4361
  styles: [{ tag: [tags.className, tags.propertyName] }]
4372
- }),
4373
- []
4374
- );
4362
+ });
4363
+ const customLineNumberTheme = EditorView.theme({
4364
+ ".cm-editor": {
4365
+ colorScheme: "dark",
4366
+ backgroundColor: "transparent"
4367
+ },
4368
+ ".cm-lineNumbers .cm-gutterElement": {
4369
+ color: "#939393"
4370
+ }
4371
+ });
4372
+ return [baseTheme, customLineNumberTheme];
4373
+ }, []);
4375
4374
  };
4376
- const SyntaxHighlighter$2 = ({
4377
- data,
4378
- className,
4379
- ...props
4380
- }) => {
4381
- const formattedCode = JSON.stringify(data, null, 2);
4382
- const theme = useCodemirrorTheme$2();
4375
+ const CodeEditor = ({ data, value, onChange, showCopyButton = true, className, ...props }) => {
4376
+ const theme = useCodemirrorTheme$1();
4377
+ const formattedCode = data ? JSON.stringify(data, null, 2) : value ?? "";
4383
4378
  return /* @__PURE__ */ jsxs("div", { className: clsx("rounded-md bg-surface4 p-1 font-mono relative", className), ...props, children: [
4384
- /* @__PURE__ */ jsx(CopyButton, { content: formattedCode, className: "absolute top-2 right-2 z-20" }),
4385
- /* @__PURE__ */ jsx(CodeMirror, { value: formattedCode, theme, extensions: [jsonLanguage] })
4379
+ showCopyButton && /* @__PURE__ */ jsx(CopyButton, { content: formattedCode, className: "absolute top-2 right-2 z-20" }),
4380
+ /* @__PURE__ */ jsx(CodeMirror, { value: formattedCode, theme, extensions: [jsonLanguage], onChange })
4386
4381
  ] });
4387
4382
  };
4388
4383
  async function highlight(code, language) {
@@ -4399,31 +4394,6 @@ async function highlight(code, language) {
4399
4394
  return tokens;
4400
4395
  }
4401
4396
 
4402
- const variantClasses$1 = {
4403
- default: "text-icon3",
4404
- success: "text-accent1",
4405
- error: "text-accent2",
4406
- info: "text-accent3"
4407
- };
4408
- const Badge = ({ icon, variant = "default", className, children, ...props }) => {
4409
- return /* @__PURE__ */ jsxs(
4410
- "div",
4411
- {
4412
- className: clsx(
4413
- "font-mono bg-surface4 text-ui-sm gap-md h-badge-default inline-flex items-center rounded-md shrink-0",
4414
- icon ? "pl-md pr-1.5" : "px-1.5",
4415
- icon || variant === "default" ? "text-icon5" : variantClasses$1[variant],
4416
- className
4417
- ),
4418
- ...props,
4419
- children: [
4420
- icon && /* @__PURE__ */ jsx("span", { className: variantClasses$1[variant], children: /* @__PURE__ */ jsx(Icon, { children: icon }) }),
4421
- children
4422
- ]
4423
- }
4424
- );
4425
- };
4426
-
4427
4397
  const BadgeWrapper = ({
4428
4398
  children,
4429
4399
  initialCollapsed = true,
@@ -4513,7 +4483,7 @@ const NetworkChoiceMetadata = ({ selectionReason, open, onOpenChange, input }) =
4513
4483
  let inputSlot = null;
4514
4484
  if (input) {
4515
4485
  try {
4516
- inputSlot = typeof input === "object" ? /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: input }) : /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: JSON.parse(input) });
4486
+ inputSlot = typeof input === "object" ? /* @__PURE__ */ jsx(CodeEditor, { data: input }) : /* @__PURE__ */ jsx(CodeEditor, { data: JSON.parse(input) });
4517
4487
  } catch {
4518
4488
  inputSlot = /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap", children: input });
4519
4489
  }
@@ -4554,33 +4524,6 @@ const NetworkChoiceMetadataDialogTrigger = ({
4554
4524
  ] });
4555
4525
  };
4556
4526
 
4557
- const sizeClasses = {
4558
- md: "h-button-md gap-md",
4559
- lg: "h-button-lg gap-lg"
4560
- };
4561
- const variantClasses = {
4562
- default: "bg-surface2 hover:bg-surface4 text-icon3 hover:text-icon6 disabled:opacity-50",
4563
- light: "bg-surface3 hover:bg-surface5 text-icon6 disabled:opacity-50"
4564
- };
4565
- const Button$1 = ({ className, as, size = "md", variant = "default", ...props }) => {
4566
- const Component = as || "button";
4567
- return /* @__PURE__ */ jsx(
4568
- Component,
4569
- {
4570
- className: clsx(
4571
- "bg-surface2 border-sm border-border1 px-lg text-ui-md inline-flex items-center justify-center rounded-md border",
4572
- variantClasses[variant],
4573
- sizeClasses[size],
4574
- className,
4575
- {
4576
- "cursor-not-allowed": props.disabled
4577
- }
4578
- ),
4579
- ...props
4580
- }
4581
- );
4582
- };
4583
-
4584
4527
  const ToolCallContext = createContext(void 0);
4585
4528
  function ToolCallProvider({
4586
4529
  children,
@@ -4613,7 +4556,7 @@ const ToolApprovalButtons = ({ toolCalled, toolCallId, toolApprovalMetadata }) =
4613
4556
  /* @__PURE__ */ jsx("p", { className: "font-medium pb-2", children: "Approval required" }),
4614
4557
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
4615
4558
  /* @__PURE__ */ jsxs(
4616
- Button$1,
4559
+ Button,
4617
4560
  {
4618
4561
  onClick: handleApprove,
4619
4562
  disabled: isRunning || !!toolCallApprovalStatus,
@@ -4625,7 +4568,7 @@ const ToolApprovalButtons = ({ toolCalled, toolCallId, toolApprovalMetadata }) =
4625
4568
  }
4626
4569
  ),
4627
4570
  /* @__PURE__ */ jsxs(
4628
- Button$1,
4571
+ Button,
4629
4572
  {
4630
4573
  onClick: handleDecline,
4631
4574
  disabled: isRunning || !!toolCallApprovalStatus,
@@ -4655,12 +4598,12 @@ const ToolBadge = ({
4655
4598
  let argSlot = null;
4656
4599
  try {
4657
4600
  const { __mastraMetadata: _, ...formattedArgs } = typeof args === "object" ? args : JSON.parse(args);
4658
- argSlot = /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: formattedArgs, "data-testid": "tool-args" });
4601
+ argSlot = /* @__PURE__ */ jsx(CodeEditor, { data: formattedArgs, "data-testid": "tool-args" });
4659
4602
  } catch {
4660
4603
  argSlot = /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: args });
4661
4604
  }
4662
- let resultSlot = typeof result === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: result }) : /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: result, "data-testid": "tool-result" });
4663
- let suspendPayloadSlot = typeof suspendPayload === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: suspendPayload }) : /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: suspendPayload, "data-testid": "tool-suspend-payload" });
4605
+ let resultSlot = typeof result === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: result }) : /* @__PURE__ */ jsx(CodeEditor, { data: result, "data-testid": "tool-result" });
4606
+ let suspendPayloadSlot = typeof suspendPayload === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: suspendPayload }) : /* @__PURE__ */ jsx(CodeEditor, { data: suspendPayload, "data-testid": "tool-suspend-payload" });
4664
4607
  const selectionReason = metadata?.mode === "network" ? metadata.selectionReason : void 0;
4665
4608
  const agentNetworkInput = metadata?.mode === "network" ? metadata.agentInput : void 0;
4666
4609
  const toolCalled = result || toolOutput.length > 0;
@@ -4693,7 +4636,7 @@ const ToolBadge = ({
4693
4636
  ] }),
4694
4637
  toolOutput.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
4695
4638
  /* @__PURE__ */ jsx("p", { className: "font-medium pb-2", children: "Tool output" }),
4696
- /* @__PURE__ */ jsx("div", { className: "h-40 overflow-y-auto", children: /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: toolOutput, "data-testid": "tool-output" }) })
4639
+ /* @__PURE__ */ jsx("div", { className: "h-40 overflow-y-auto", children: /* @__PURE__ */ jsx(CodeEditor, { data: toolOutput, "data-testid": "tool-output" }) })
4697
4640
  ] }),
4698
4641
  /* @__PURE__ */ jsx(
4699
4642
  ToolApprovalButtons,
@@ -5111,6 +5054,7 @@ const useStreamWorkflow = ({ debugMode }) => {
5111
5054
  workflowId,
5112
5055
  runId,
5113
5056
  inputData,
5057
+ initialState,
5114
5058
  requestContext: playgroundRequestContext,
5115
5059
  perStep
5116
5060
  }) => {
@@ -5126,8 +5070,9 @@ const useStreamWorkflow = ({ debugMode }) => {
5126
5070
  });
5127
5071
  const workflow = client.getWorkflow(workflowId);
5128
5072
  const run = await workflow.createRun({ runId });
5129
- const stream = await run.streamVNext({
5073
+ const stream = await run.stream({
5130
5074
  inputData,
5075
+ initialState,
5131
5076
  requestContext,
5132
5077
  closeOnSuspend: true,
5133
5078
  tracingOptions: settings?.tracingOptions,
@@ -5190,7 +5135,7 @@ const useStreamWorkflow = ({ debugMode }) => {
5190
5135
  }
5191
5136
  const workflow = client.getWorkflow(workflowId);
5192
5137
  const run = await workflow.createRun({ runId });
5193
- const stream = await run.observeStreamVNext();
5138
+ const stream = await run.observeStream();
5194
5139
  if (!stream) {
5195
5140
  return handleStreamError(new Error("No stream returned"), "No stream returned", setIsStreaming);
5196
5141
  }
@@ -5250,7 +5195,7 @@ const useStreamWorkflow = ({ debugMode }) => {
5250
5195
  requestContext.set(key, value);
5251
5196
  });
5252
5197
  const run = await workflow.createRun({ runId });
5253
- const stream = await run.resumeStreamVNext({
5198
+ const stream = await run.resumeStream({
5254
5199
  step,
5255
5200
  resumeData,
5256
5201
  requestContext,
@@ -5477,11 +5422,11 @@ const useWorkflowRuns = (workflowId, { enabled = true } = {}) => {
5477
5422
  }, [isEndOfListInView, query.hasNextPage, query.isFetchingNextPage]);
5478
5423
  return { ...query, setEndOfListElement };
5479
5424
  };
5480
- const useWorkflowRunExecutionResult = (workflowId, runId, refetchInterval) => {
5425
+ const useWorkflowRun = (workflowId, runId, refetchInterval) => {
5481
5426
  const client = useMastraClient();
5482
5427
  return useQuery({
5483
- queryKey: ["workflow-run-execution-result", workflowId, runId],
5484
- queryFn: () => client.getWorkflow(workflowId).runExecutionResult(runId),
5428
+ queryKey: ["workflow-run", workflowId, runId],
5429
+ queryFn: () => client.getWorkflow(workflowId).runById(runId),
5485
5430
  enabled: Boolean(workflowId && runId),
5486
5431
  gcTime: 0,
5487
5432
  staleTime: 0,
@@ -5571,7 +5516,7 @@ function WorkflowRunProvider({
5571
5516
  const [isRunning, setIsRunning] = useState(false);
5572
5517
  const [debugMode, setDebugMode] = useState(false);
5573
5518
  const refetchExecResultInterval = isRunning ? void 0 : ["success", "failed", "canceled", "bailed"].includes(result?.status ?? "") ? void 0 : 5e3;
5574
- const { isLoading: isLoadingRunExecutionResult, data: runExecutionResult } = useWorkflowRunExecutionResult(
5519
+ const { isLoading: isLoadingRunExecutionResult, data: runExecutionResult } = useWorkflowRun(
5575
5520
  workflowId,
5576
5521
  initialRunId ?? "",
5577
5522
  refetchExecResultInterval
@@ -5586,7 +5531,8 @@ function WorkflowRunProvider({
5586
5531
  result: runExecutionResult?.result,
5587
5532
  error: runExecutionResult?.error,
5588
5533
  runId: initialRunId,
5589
- serializedStepGraph: runExecutionResult?.serializedStepGraph
5534
+ serializedStepGraph: runExecutionResult?.serializedStepGraph,
5535
+ value: runExecutionResult?.initialState
5590
5536
  } : void 0;
5591
5537
  }, [runExecutionResult, initialRunId]);
5592
5538
  const { data: workflow, isLoading, error } = useWorkflow(workflowId);
@@ -5611,7 +5557,14 @@ function WorkflowRunProvider({
5611
5557
  useEffect(() => {
5612
5558
  if (runSnapshot?.runId) {
5613
5559
  setResult(convertWorkflowRunStateToStreamResult(runSnapshot));
5614
- setPayload(runSnapshot.context?.input);
5560
+ if (runSnapshot.value && Object.keys(runSnapshot.value).length > 0) {
5561
+ setPayload({
5562
+ initialState: runSnapshot.value,
5563
+ inputData: runSnapshot.context?.input
5564
+ });
5565
+ } else {
5566
+ setPayload(runSnapshot.context?.input);
5567
+ }
5615
5568
  setRunId(runSnapshot.runId);
5616
5569
  }
5617
5570
  }, [runSnapshot]);
@@ -6062,6 +6015,47 @@ const constructNodesAndEdges = ({
6062
6015
  return { nodes: layoutedNodes, edges: layoutedEdges };
6063
6016
  };
6064
6017
 
6018
+ const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
6019
+ const cx = clsx;
6020
+ const cva = (base, config)=>(props)=>{
6021
+ var _config_compoundVariants;
6022
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
6023
+ const { variants, defaultVariants } = config;
6024
+ const getVariantClassNames = Object.keys(variants).map((variant)=>{
6025
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
6026
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
6027
+ if (variantProp === null) return null;
6028
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
6029
+ return variants[variant][variantKey];
6030
+ });
6031
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
6032
+ let [key, value] = param;
6033
+ if (value === undefined) {
6034
+ return acc;
6035
+ }
6036
+ acc[key] = value;
6037
+ return acc;
6038
+ }, {});
6039
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
6040
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
6041
+ return Object.entries(compoundVariantOptions).every((param)=>{
6042
+ let [key, value] = param;
6043
+ return Array.isArray(value) ? value.includes({
6044
+ ...defaultVariants,
6045
+ ...propsWithoutUndefined
6046
+ }[key]) : ({
6047
+ ...defaultVariants,
6048
+ ...propsWithoutUndefined
6049
+ })[key] === value;
6050
+ }) ? [
6051
+ ...acc,
6052
+ cvClass,
6053
+ cvClassName
6054
+ ] : acc;
6055
+ }, []);
6056
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
6057
+ };
6058
+
6065
6059
  const textVariants = cva("block", {
6066
6060
  variants: {
6067
6061
  variant: {
@@ -6285,39 +6279,6 @@ const useCurrentRun = () => {
6285
6279
  return { steps, runId: context.runId };
6286
6280
  };
6287
6281
 
6288
- const useCodemirrorTheme$1 = () => {
6289
- return useMemo(() => {
6290
- const baseTheme = draculaInit({
6291
- settings: {
6292
- fontFamily: "var(--geist-mono)",
6293
- fontSize: "0.8rem",
6294
- lineHighlight: "transparent",
6295
- gutterBackground: "transparent",
6296
- gutterForeground: "#939393",
6297
- background: "transparent"
6298
- },
6299
- styles: [{ tag: [tags.className, tags.propertyName] }]
6300
- });
6301
- const customLineNumberTheme = EditorView.theme({
6302
- ".cm-editor": {
6303
- colorScheme: "dark",
6304
- // ensures color scheme
6305
- backgroundColor: "transparent"
6306
- },
6307
- ".cm-lineNumbers .cm-gutterElement": {
6308
- color: "#939393"
6309
- // ← custom line number color
6310
- }
6311
- });
6312
- return [baseTheme, customLineNumberTheme];
6313
- }, []);
6314
- };
6315
- const SyntaxHighlighter$1 = ({ data }) => {
6316
- const formattedCode = JSON.stringify(data, null, 2);
6317
- const theme = useCodemirrorTheme$1();
6318
- return /* @__PURE__ */ jsx("div", { className: "rounded-md bg-[#1a1a1a] p-1 font-mono", children: /* @__PURE__ */ jsx(CodeMirror, { value: formattedCode, theme, extensions: [jsonLanguage] }) });
6319
- };
6320
-
6321
6282
  const CodeDialogContent = ({
6322
6283
  data,
6323
6284
  language = "auto"
@@ -6408,7 +6369,7 @@ const ErrorMessage = ({ error }) => /* @__PURE__ */ jsxs(Alert, { variant: "dest
6408
6369
  /* @__PURE__ */ jsx(AlertTitle, { children: error })
6409
6370
  ] });
6410
6371
 
6411
- const SubmitButton = ({ children }) => /* @__PURE__ */ jsx(Button$2, { type: "submit", children });
6372
+ const SubmitButton = ({ children }) => /* @__PURE__ */ jsx(Button, { type: "submit", children });
6412
6373
 
6413
6374
  const inputVariants = cva(
6414
6375
  "flex w-full text-icon6 rounded-lg border bg-transparent shadow-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50",
@@ -6520,62 +6481,44 @@ const BooleanField = ({ field, label, id, inputProps, value }) => /* @__PURE__ *
6520
6481
  ] })
6521
6482
  ] });
6522
6483
 
6523
- function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
6484
+ function DatePicker({ className, classNames, showOutsideDays = true, ...props }) {
6524
6485
  return /* @__PURE__ */ jsx(
6525
6486
  DayPicker,
6526
6487
  {
6527
6488
  showOutsideDays,
6528
6489
  className: cn("p-3", className),
6529
6490
  classNames: {
6530
- months: "flex flex-col space-y-4 sm:space-y-0",
6531
- month: "space-y-4",
6532
- // month_caption: 'flex justify-center pt-1 relative items-center',
6533
- caption_label: "text-sm text-text font-medium",
6534
- nav: "space-x-1 flex items-center",
6491
+ months: "flex flex-col space-y-4 sm:space-y-0 ",
6492
+ month: "space-y-4 text-[0.75rem] ",
6493
+ caption: "flex justify-between pt-1 items-center pl-2",
6494
+ caption_label: "text-text font-medium ",
6495
+ nav: "flex items-center",
6535
6496
  nav_button_previous: cn(
6536
- buttonVariants({ variant: "outline" }),
6537
- "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
6538
- "absolute left-4 top-[56px] z-10"
6539
- ),
6540
- nav_button_next: cn(
6541
- buttonVariants({ variant: "outline" }),
6542
- "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",
6543
- "absolute right-4 top-[56px] z-10"
6497
+ "flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
6544
6498
  ),
6499
+ nav_button_next: cn("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
6545
6500
  dropdown_month: "w-full border-collapse space-y-1",
6546
6501
  weeknumber: "flex",
6547
6502
  day: cn(
6548
- buttonVariants({ variant: "ghost" }),
6549
- "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
6503
+ "relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
6550
6504
  props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md",
6551
6505
  "h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"
6552
6506
  ),
6553
6507
  day_range_start: "day-range-start",
6554
6508
  day_range_end: "day-range-end",
6555
- day_selected: "!bg-primary !text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
6556
- day_today: "bg-lightGray-7/50 text-accent-foreground",
6509
+ day_selected: "!bg-primary/50 !text-primary-foreground hover:bg-primary rounded-md hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
6510
+ day_today: "bg-primary/10 text-accent-foreground",
6557
6511
  day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
6558
6512
  day_disabled: "text-muted-foreground opacity-50",
6559
6513
  day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
6560
6514
  day_hidden: "invisible",
6515
+ head_cell: "text-[0.625rem] text-muted-foreground",
6561
6516
  ...classNames
6562
6517
  },
6563
- components: {
6564
- // IconDropdown: ({ }) => (
6565
- // <CalendarIcon
6566
- // className={cn('h-4 w-4', {
6567
- // 'rotate-180': orientation === 'up',
6568
- // 'rotate-90': orientation === 'left',
6569
- // '-rotate-90': orientation === 'right',
6570
- // })}
6571
- // />
6572
- // ),
6573
- },
6574
6518
  ...props
6575
6519
  }
6576
6520
  );
6577
6521
  }
6578
- Calendar.displayName = "Calendar";
6579
6522
 
6580
6523
  const Popover = PopoverPrimitive.Root;
6581
6524
  const PopoverTrigger = PopoverPrimitive.Trigger;
@@ -6595,163 +6538,10 @@ const PopoverContent = React.forwardRef(({ className, align = "center", sideOffs
6595
6538
  ) }));
6596
6539
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
6597
6540
 
6598
- const DatePicker$1 = ({
6599
- value,
6600
- setValue,
6601
- children,
6602
- className,
6603
- placeholder,
6604
- ...props
6605
- }) => {
6606
- const [openPopover, setOpenPopover] = React.useState(false);
6607
- return /* @__PURE__ */ jsxs(Popover, { open: openPopover, onOpenChange: setOpenPopover, children: [
6608
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: children ? children : /* @__PURE__ */ jsx(
6609
- DefaultButton,
6610
- {
6611
- value,
6612
- placeholder,
6613
- className,
6614
- "data-testid": "datepicker-button"
6615
- }
6616
- ) }),
6617
- /* @__PURE__ */ jsx(
6618
- PopoverContent,
6619
- {
6620
- className: "backdrop-blur-4xl w-auto p-0 bg-[#171717]",
6621
- align: "start",
6622
- "data-testid": "datepicker-calendar",
6623
- children: /* @__PURE__ */ jsx(
6624
- DatePickerOnly,
6625
- {
6626
- value,
6627
- setValue,
6628
- clearable: props.clearable,
6629
- setOpenPopover,
6630
- ...props
6631
- }
6632
- )
6633
- }
6634
- )
6635
- ] });
6636
- };
6637
- const DatePickerOnly = ({
6638
- value,
6639
- setValue,
6640
- setOpenPopover,
6641
- clearable,
6642
- placeholder,
6643
- className,
6644
- ...props
6645
- }) => {
6646
- const [inputValue, setInputValue] = React.useState(value ? format(value, "PP") : "");
6647
- const [selected, setSelected] = React.useState(value ? new Date(value) : void 0);
6648
- const debouncedDateUpdate = useDebouncedCallback((date) => {
6649
- if (isValid(date)) {
6650
- setSelected(date);
6651
- setValue?.(date);
6652
- setOpenPopover?.(false);
6653
- }
6654
- }, 2e3);
6655
- const handleInputChange = (e) => {
6656
- setInputValue(e.currentTarget.value);
6657
- const date = new Date(e.target.value);
6658
- debouncedDateUpdate(date);
6659
- };
6660
- const handleDaySelect = (date) => {
6661
- setSelected(date);
6662
- setValue?.(date);
6663
- setOpenPopover?.(false);
6664
- if (date) {
6665
- setInputValue(format(date, "PP"));
6666
- } else {
6667
- setInputValue("");
6668
- }
6669
- };
6670
- const handleMonthSelect = (date) => {
6671
- setSelected(date);
6672
- if (date) {
6673
- setInputValue(format(date, "PP"));
6674
- } else {
6675
- setInputValue("");
6676
- }
6677
- };
6678
- return /* @__PURE__ */ jsxs(
6679
- "div",
6680
- {
6681
- "aria-label": "Choose date",
6682
- className: "relative mt-2 flex flex-col gap-2",
6683
- onKeyDown: (e) => {
6684
- e.stopPropagation();
6685
- if (e.key === "Escape") {
6686
- setOpenPopover?.(false);
6687
- }
6688
- },
6689
- children: [
6690
- /* @__PURE__ */ jsx("div", { className: "w-full px-3", children: /* @__PURE__ */ jsx(
6691
- Input,
6692
- {
6693
- type: "text",
6694
- value: inputValue,
6695
- onChange: handleInputChange,
6696
- placeholder,
6697
- className
6698
- }
6699
- ) }),
6700
- /* @__PURE__ */ jsx(
6701
- Calendar,
6702
- {
6703
- mode: "single",
6704
- month: selected,
6705
- selected,
6706
- onMonthChange: handleMonthSelect,
6707
- onSelect: handleDaySelect,
6708
- ...props
6709
- }
6710
- ),
6711
- /* @__PURE__ */ jsx("div", { className: "px-3 pb-2", children: clearable && /* @__PURE__ */ jsx(
6712
- Button$2,
6713
- {
6714
- variant: "outline",
6715
- tabIndex: 0,
6716
- className: "w-full !opacity-50 duration-200 hover:!opacity-100",
6717
- onClick: () => {
6718
- setValue(null);
6719
- setSelected(void 0);
6720
- setInputValue("");
6721
- setOpenPopover?.(false);
6722
- },
6723
- children: "Clear"
6724
- }
6725
- ) })
6726
- ]
6727
- }
6728
- );
6729
- };
6730
- const DefaultButton = React.forwardRef(
6731
- ({ value, placeholder, className, ...props }, ref) => {
6732
- return /* @__PURE__ */ jsxs(
6733
- Button$2,
6734
- {
6735
- ref,
6736
- variant: "outline",
6737
- className: cn(
6738
- "bg-neutral-825 border-neutral-775 w-full justify-start whitespace-nowrap rounded-md border px-2 py-0 text-left flex items-center gap-1",
6739
- className
6740
- ),
6741
- ...props,
6742
- children: [
6743
- /* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4" }),
6744
- value ? /* @__PURE__ */ jsx("span", { className: "text-white", children: format(value, "PPP") }) : /* @__PURE__ */ jsx("span", { className: "text-gray", children: placeholder ?? "Pick a date" })
6745
- ]
6746
- }
6747
- );
6748
- }
6749
- );
6750
- DefaultButton.displayName = "DefaultButton";
6751
-
6752
6541
  const DateField = ({ inputProps, field, error, id }) => {
6753
6542
  const { key, ...props } = inputProps;
6754
- const [value, setValue] = useState(null);
6543
+ const [value, setValue] = useState(void 0);
6544
+ const [open, setOpen] = useState(false);
6755
6545
  useEffect(() => {
6756
6546
  if (field.default) {
6757
6547
  const date = new Date(field.default);
@@ -6760,24 +6550,32 @@ const DateField = ({ inputProps, field, error, id }) => {
6760
6550
  }
6761
6551
  }
6762
6552
  }, [field]);
6763
- return /* @__PURE__ */ jsx(
6764
- DatePicker$1,
6765
- {
6766
- id,
6767
- className: error ? "border-destructive" : "",
6768
- value,
6769
- setValue: (date) => {
6770
- const newDate = date ? new Date(date).toISOString() : date;
6771
- if (newDate) {
6772
- props.onChange({
6773
- target: { value: newDate?.toString(), name: inputProps.name }
6774
- });
6775
- setValue(new Date(newDate));
6776
- }
6777
- },
6778
- clearable: true
6553
+ const handleSelect = (date) => {
6554
+ setValue(date);
6555
+ if (date) {
6556
+ props.onChange({
6557
+ target: { value: date.toISOString(), name: inputProps.name }
6558
+ });
6779
6559
  }
6780
- );
6560
+ setOpen(false);
6561
+ };
6562
+ const handleClear = () => {
6563
+ setValue(void 0);
6564
+ props.onChange({
6565
+ target: { value: "", name: inputProps.name }
6566
+ });
6567
+ setOpen(false);
6568
+ };
6569
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
6570
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { id, variant: "light", size: "lg", className: cn("w-full", error ? "border-destructive" : ""), children: [
6571
+ /* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4" }),
6572
+ value ? /* @__PURE__ */ jsx("span", { className: "text-white", children: format(value, "PPP") }) : /* @__PURE__ */ jsx("span", { className: "text-gray", children: "Pick a date" })
6573
+ ] }) }),
6574
+ /* @__PURE__ */ jsxs(PopoverContent, { className: "w-auto p-0 bg-surface4", align: "start", children: [
6575
+ /* @__PURE__ */ jsx(DatePicker, { mode: "single", selected: value, onSelect: handleSelect, month: value, onMonthChange: setValue }),
6576
+ value && /* @__PURE__ */ jsx("div", { className: "p-3 pt-0", children: /* @__PURE__ */ jsx(Button, { variant: "light", size: "lg", className: "w-full", onClick: handleClear, children: "Clear" }) })
6577
+ ] })
6578
+ ] });
6781
6579
  };
6782
6580
 
6783
6581
  const Select$1 = SelectPrimitive.Root;
@@ -6872,7 +6670,7 @@ const ObjectWrapper = ({ label, children }) => {
6872
6670
  /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(Braces, {}) }),
6873
6671
  label
6874
6672
  ] }),
6875
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsOpen(!isOpen), type: "button", className: "ml-auto", children: /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("transition-all", isOpen ? "rotate-180" : "rotate-0") }) }) })
6673
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsOpen(!isOpen), type: "button", className: "ml-auto", children: /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("transition-all", isOpen ? "rotate-180" : "rotate-0") }) }) })
6876
6674
  ] }),
6877
6675
  isOpen && /* @__PURE__ */ jsx(
6878
6676
  "div",
@@ -6911,7 +6709,7 @@ const ArrayWrapper = ({ label, children, onAddItem }) => {
6911
6709
  const ArrayElementWrapper = ({ children, onRemove }) => {
6912
6710
  return /* @__PURE__ */ jsxs("div", { className: "pl-4 border-l border-border1", children: [
6913
6711
  children,
6914
- /* @__PURE__ */ jsxs(Button$1, { onClick: onRemove, type: "button", children: [
6712
+ /* @__PURE__ */ jsxs(Button, { onClick: onRemove, type: "button", children: [
6915
6713
  /* @__PURE__ */ jsx(Icon, { size: "sm", children: /* @__PURE__ */ jsx(TrashIcon, {}) }),
6916
6714
  "Delete"
6917
6715
  ] })
@@ -6970,17 +6768,7 @@ const RecordField = ({ inputProps, field, error, id }) => {
6970
6768
  };
6971
6769
  return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
6972
6770
  pairs.map((pair) => /* @__PURE__ */ jsxs("div", { className: "relative space-y-2 rounded-lg border p-4", children: [
6973
- /* @__PURE__ */ jsx(
6974
- Button$2,
6975
- {
6976
- type: "button",
6977
- variant: "ghost",
6978
- size: "icon",
6979
- className: "absolute right-2 top-2",
6980
- onClick: () => removePair(pair.id),
6981
- children: /* @__PURE__ */ jsx(TrashIcon, { className: "h-4 w-4" })
6982
- }
6983
- ),
6771
+ /* @__PURE__ */ jsx(Button, { type: "button", className: "absolute right-2 top-2", onClick: () => removePair(pair.id), children: /* @__PURE__ */ jsx(TrashIcon, { className: "h-4 w-4" }) }),
6984
6772
  /* @__PURE__ */ jsxs("div", { className: "space-y-2 pt-6", children: [
6985
6773
  /* @__PURE__ */ jsx(
6986
6774
  Input,
@@ -7002,7 +6790,7 @@ const RecordField = ({ inputProps, field, error, id }) => {
7002
6790
  )
7003
6791
  ] })
7004
6792
  ] }, pair.id)),
7005
- /* @__PURE__ */ jsxs(Button$2, { type: "button", variant: "outline", size: "sm", className: "w-full", onClick: addPair, children: [
6793
+ /* @__PURE__ */ jsxs(Button, { type: "button", className: "w-full", onClick: addPair, children: [
7006
6794
  /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
7007
6795
  "Add Key-Value Pair"
7008
6796
  ] })
@@ -7547,7 +7335,7 @@ function DynamicForm({
7547
7335
  noValidate: true
7548
7336
  },
7549
7337
  uiComponents: {
7550
- SubmitButton: ({ children: children2 }) => onSubmit ? /* @__PURE__ */ jsx(Button$1, { variant: "light", className: "w-full", size: "lg", disabled: isSubmitLoading, children: isSubmitLoading ? /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) }) : submitButtonLabel || children2 }) : null
7338
+ SubmitButton: ({ children: children2 }) => onSubmit ? /* @__PURE__ */ jsx(Button, { variant: "light", className: "w-full", size: "lg", disabled: isSubmitLoading, children: isSubmitLoading ? /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) }) : submitButtonLabel || children2 }) : null
7551
7339
  },
7552
7340
  formComponents: {
7553
7341
  Label: ({ value }) => /* @__PURE__ */ jsx(Label, { className: "text-sm font-normal", children: value })
@@ -7672,14 +7460,14 @@ const JSONInput = ({
7672
7460
  ] }),
7673
7461
  /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside", children: errors.map((error, idx) => /* @__PURE__ */ jsx("li", { className: "text-ui-sm text-accent2", children: error }, idx)) })
7674
7462
  ] }),
7675
- /* @__PURE__ */ jsx(SyntaxHighlighter, { data: inputData, onChange: setInputData }),
7463
+ /* @__PURE__ */ jsx(JsonEditor, { data: inputData, onChange: setInputData }),
7676
7464
  children,
7677
- withoutSubmit ? null : /* @__PURE__ */ jsx(Button$1, { variant: "light", onClick: handleSubmit, className: "w-full", size: "lg", children: isSubmitLoading ? /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) : submitButtonLabel })
7465
+ withoutSubmit ? null : /* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleSubmit, className: "w-full", size: "lg", children: isSubmitLoading ? /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) : submitButtonLabel })
7678
7466
  ] });
7679
7467
  };
7680
- const SyntaxHighlighter = ({ data, onChange }) => {
7681
- const theme = useCodemirrorTheme$2();
7682
- return /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-[#1a1a1a] p-1 font-mono", children: [
7468
+ const JsonEditor = ({ data, onChange }) => {
7469
+ const theme = useCodemirrorTheme$1();
7470
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-surface4 p-1 font-mono relative", children: [
7683
7471
  /* @__PURE__ */ jsx(CopyButton, { content: data, className: "absolute top-2 right-2 z-10" }),
7684
7472
  /* @__PURE__ */ jsx(CodeMirror, { value: data, theme, extensions: [jsonLanguage], onChange })
7685
7473
  ] });
@@ -7865,12 +7653,18 @@ const WorkflowTimeTravelForm = ({
7865
7653
  }
7866
7654
  try {
7867
7655
  const parsed = parse(stepDefinition.inputSchema);
7868
- return { schema: resolveSerializedZodOutput(jsonSchemaToZod(parsed)), schemaError: null };
7656
+ const zodStateSchema = workflow?.stateSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(workflow.stateSchema))) : null;
7657
+ const zodStepSchema = resolveSerializedZodOutput(jsonSchemaToZod(parsed));
7658
+ const schemaToUse = zodStateSchema ? z.object({
7659
+ inputData: zodStepSchema,
7660
+ initialState: zodStateSchema.optional()
7661
+ }) : zodStepSchema;
7662
+ return { schema: schemaToUse, schemaError: null };
7869
7663
  } catch (err) {
7870
7664
  console.error("Failed to parse step schema", err);
7871
7665
  return { schema: z.record(z.string(), z.any()) };
7872
7666
  }
7873
- }, [stepDefinition?.inputSchema]);
7667
+ }, [stepDefinition?.inputSchema, workflow?.stateSchema]);
7874
7668
  const handleSubmit = async (data) => {
7875
7669
  setFormError(null);
7876
7670
  setIsSubmitting(true);
@@ -7878,11 +7672,14 @@ const WorkflowTimeTravelForm = ({
7878
7672
  const parsedResume = resumeData.trim() ? JSON.parse(resumeData) : {};
7879
7673
  const parsedContext = contextValue.trim() ? JSON.parse(contextValue) : {};
7880
7674
  const parsedNestedContext = nestedContextValue.trim() ? JSON.parse(nestedContextValue) : {};
7675
+ const { initialState, inputData: dataInputData } = data ?? {};
7676
+ const inputData2 = workflow?.stateSchema ? dataInputData : data;
7881
7677
  const payload = {
7882
7678
  runId: prevRunId,
7883
7679
  workflowId,
7884
7680
  step: stepKey,
7885
- inputData: data,
7681
+ inputData: inputData2,
7682
+ initialState,
7886
7683
  resumeData: Object.keys(parsedResume)?.length > 0 ? parsedResume : void 0,
7887
7684
  context: Object.keys(parsedContext)?.length > 0 ? parsedContext : void 0,
7888
7685
  nestedStepsContext: Object.keys(parsedNestedContext)?.length > 0 ? parsedNestedContext : void 0,
@@ -8101,9 +7898,9 @@ const WorkflowStepActionBar = ({
8101
7898
  status === "running" && "bg-accent6Dark"
8102
7899
  ),
8103
7900
  children: [
8104
- onShowNestedGraph && /* @__PURE__ */ jsx(Button$1, { onClick: handleNestedGraphClick, className: cn(isNestedGraphOpen && activeButtonClass), children: "View nested graph" }),
7901
+ onShowNestedGraph && /* @__PURE__ */ jsx(Button, { onClick: handleNestedGraphClick, className: cn(isNestedGraphOpen && activeButtonClass), children: "View nested graph" }),
8105
7902
  showTimeTravel && /* @__PURE__ */ jsxs(Fragment, { children: [
8106
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsTimeTravelOpen(true), children: "Time travel" }),
7903
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsTimeTravelOpen(true), children: "Time travel" }),
8107
7904
  /* @__PURE__ */ jsx(Dialog, { open: isTimeTravelOpen, onOpenChange: setIsTimeTravelOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8108
7905
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8109
7906
  "Time travel to ",
@@ -8114,7 +7911,7 @@ const WorkflowStepActionBar = ({
8114
7911
  ] }),
8115
7912
  showDebugMode && /* @__PURE__ */ jsxs(Fragment, { children: [
8116
7913
  /* @__PURE__ */ jsx(
8117
- Button$1,
7914
+ Button,
8118
7915
  {
8119
7916
  onClick: () => {
8120
7917
  if (mapConfig) {
@@ -8143,7 +7940,7 @@ const WorkflowStepActionBar = ({
8143
7940
  ) })
8144
7941
  ] }) }),
8145
7942
  /* @__PURE__ */ jsx(
8146
- Button$1,
7943
+ Button,
8147
7944
  {
8148
7945
  onClick: () => {
8149
7946
  if (mapConfig) {
@@ -8172,9 +7969,9 @@ const WorkflowStepActionBar = ({
8172
7969
  ) })
8173
7970
  ] }) })
8174
7971
  ] }),
8175
- mapConfig && /* @__PURE__ */ jsx(Button$1, { onClick: handleMapConfigClick, className: cn(isMapConfigOpen && activeButtonClass), children: "Map config" }),
7972
+ mapConfig && /* @__PURE__ */ jsx(Button, { onClick: handleMapConfigClick, className: cn(isMapConfigOpen && activeButtonClass), children: "Map config" }),
8176
7973
  input && /* @__PURE__ */ jsxs(Fragment, { children: [
8177
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsInputOpen(true), children: "Input" }),
7974
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsInputOpen(true), children: "Input" }),
8178
7975
  /* @__PURE__ */ jsx(Dialog, { open: isInputOpen, onOpenChange: setIsInputOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8179
7976
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8180
7977
  stepName,
@@ -8184,7 +7981,7 @@ const WorkflowStepActionBar = ({
8184
7981
  ] }) })
8185
7982
  ] }),
8186
7983
  resumeData && /* @__PURE__ */ jsxs(Fragment, { children: [
8187
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsResumeDataOpen(true), children: "Resume data" }),
7984
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsResumeDataOpen(true), children: "Resume data" }),
8188
7985
  /* @__PURE__ */ jsx(Dialog, { open: isResumeDataOpen, onOpenChange: setIsResumeDataOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8189
7986
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8190
7987
  stepName,
@@ -8194,7 +7991,7 @@ const WorkflowStepActionBar = ({
8194
7991
  ] }) })
8195
7992
  ] }),
8196
7993
  (output ?? suspendOutput) && /* @__PURE__ */ jsxs(Fragment, { children: [
8197
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsOutputOpen(true), children: "Output" }),
7994
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsOutputOpen(true), children: "Output" }),
8198
7995
  /* @__PURE__ */ jsx(Dialog, { open: isOutputOpen, onOpenChange: setIsOutputOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8199
7996
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8200
7997
  stepName,
@@ -8204,7 +8001,7 @@ const WorkflowStepActionBar = ({
8204
8001
  ] }) })
8205
8002
  ] }),
8206
8003
  error && /* @__PURE__ */ jsxs(Fragment, { children: [
8207
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsErrorOpen(true), children: "Error" }),
8004
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsErrorOpen(true), children: "Error" }),
8208
8005
  /* @__PURE__ */ jsx(Dialog, { open: isErrorOpen, onOpenChange: setIsErrorOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8209
8006
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8210
8007
  stepName,
@@ -8214,7 +8011,7 @@ const WorkflowStepActionBar = ({
8214
8011
  ] }) })
8215
8012
  ] }),
8216
8013
  tripwire && /* @__PURE__ */ jsxs(Fragment, { children: [
8217
- /* @__PURE__ */ jsx(Button$1, { onClick: () => setIsTripwireOpen(true), className: "text-amber-400 hover:text-amber-300", children: "Tripwire" }),
8014
+ /* @__PURE__ */ jsx(Button, { onClick: () => setIsTripwireOpen(true), className: "text-amber-400 hover:text-amber-300", children: "Tripwire" }),
8218
8015
  /* @__PURE__ */ jsx(Dialog, { open: isTripwireOpen, onOpenChange: setIsTripwireOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: dialogContentClass, children: [
8219
8016
  /* @__PURE__ */ jsxs(DialogTitle, { className: dialogTitleClass, children: [
8220
8017
  stepName,
@@ -8689,7 +8486,7 @@ const ZoomSlider = forwardRef(({ className, ...props }) => {
8689
8486
  const { zoom } = useViewport();
8690
8487
  const { zoomTo, zoomIn, zoomOut, fitView } = useReactFlow();
8691
8488
  return /* @__PURE__ */ jsxs(Panel, { className: cn("flex gap-1 rounded-md bg-primary-foreground p-1 text-foreground", className), ...props, children: [
8692
- /* @__PURE__ */ jsx(Button$2, { variant: "ghost", size: "icon", onClick: () => zoomOut({ duration: 300 }), children: /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }) }),
8489
+ /* @__PURE__ */ jsx(Button, { onClick: () => zoomOut({ duration: 300 }), children: /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4" }) }),
8693
8490
  /* @__PURE__ */ jsx(
8694
8491
  Slider,
8695
8492
  {
@@ -8703,12 +8500,12 @@ const ZoomSlider = forwardRef(({ className, ...props }) => {
8703
8500
  }
8704
8501
  }
8705
8502
  ),
8706
- /* @__PURE__ */ jsx(Button$2, { variant: "ghost", size: "icon", onClick: () => zoomIn({ duration: 300 }), children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }) }),
8707
- /* @__PURE__ */ jsxs(Button$2, { className: "min-w-20 tabular-nums", variant: "ghost", onClick: () => zoomTo(1, { duration: 300 }), children: [
8503
+ /* @__PURE__ */ jsx(Button, { onClick: () => zoomIn({ duration: 300 }), children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }) }),
8504
+ /* @__PURE__ */ jsxs(Button, { className: "min-w-20 tabular-nums", onClick: () => zoomTo(1, { duration: 300 }), children: [
8708
8505
  (100 * zoom).toFixed(0),
8709
8506
  "%"
8710
8507
  ] }),
8711
- /* @__PURE__ */ jsx(Button$2, { variant: "ghost", size: "icon", onClick: () => fitView({ duration: 300, maxZoom: 1 }), children: /* @__PURE__ */ jsx(Maximize, { className: "h-4 w-4" }) })
8508
+ /* @__PURE__ */ jsx(Button, { onClick: () => fitView({ duration: 300, maxZoom: 1 }), children: /* @__PURE__ */ jsx(Maximize, { className: "h-4 w-4" }) })
8712
8509
  ] });
8713
8510
  });
8714
8511
  ZoomSlider.displayName = "ZoomSlider";
@@ -8879,10 +8676,7 @@ const WorkflowStatus = ({ stepId, status, result, tripwire }) => {
8879
8676
  onToggleExpand: () => setIsTripwireExpanded(!isTripwireExpanded),
8880
8677
  hasMetadata: hasTripwireMetadata
8881
8678
  }
8882
- ) : /* @__PURE__ */ jsxs("div", { className: "rounded-md bg-surface4 p-1 font-mono relative", children: [
8883
- /* @__PURE__ */ jsx(CopyButton, { content: JSON.stringify(result, null, 2), className: "absolute top-2 right-2 z-10" }),
8884
- /* @__PURE__ */ jsx(SyntaxHighlighter$1, { data: result })
8885
- ] })
8679
+ ) : /* @__PURE__ */ jsx(CodeEditor, { data: result })
8886
8680
  }
8887
8681
  );
8888
8682
  };
@@ -8958,6 +8752,7 @@ function WorkflowTrigger({
8958
8752
  const [innerRunId, setInnerRunId] = useState("");
8959
8753
  const [cancelResponse, setCancelResponse] = useState(null);
8960
8754
  const triggerSchema = workflow?.inputSchema;
8755
+ const stateSchema = workflow?.stateSchema;
8961
8756
  const handleExecuteWorkflow = async (data) => {
8962
8757
  try {
8963
8758
  if (!workflow) return;
@@ -8968,7 +8763,9 @@ function WorkflowTrigger({
8968
8763
  setRunId?.(run.runId);
8969
8764
  setInnerRunId(run.runId);
8970
8765
  setContextRunId(run.runId);
8971
- streamWorkflow({ workflowId, runId: run.runId, inputData: data, requestContext });
8766
+ const { initialState, inputData: dataInputData } = data ?? {};
8767
+ const inputData = stateSchema ? dataInputData : data;
8768
+ streamWorkflow({ workflowId, runId: run.runId, inputData, initialState, requestContext });
8972
8769
  } catch (err) {
8973
8770
  setIsRunning(false);
8974
8771
  toast$1.error("Error executing workflow");
@@ -9022,6 +8819,11 @@ function WorkflowTrigger({
9022
8819
  if (!workflow) return null;
9023
8820
  const isSuspendedSteps = suspendedSteps.length > 0;
9024
8821
  const zodInputSchema = triggerSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(triggerSchema))) : null;
8822
+ const zodStateSchema = stateSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(stateSchema))) : null;
8823
+ const zodSchemaToUse = zodStateSchema ? z.object({
8824
+ inputData: zodInputSchema,
8825
+ initialState: zodStateSchema
8826
+ }) : zodInputSchema;
9025
8827
  const workflowActivePaths = streamResultToUse?.steps ?? {};
9026
8828
  const hasWorkflowActivePaths = Object.values(workflowActivePaths).length > 0;
9027
8829
  const doneStatuses = ["success", "failed", "canceled", "tripwire"];
@@ -9031,10 +8833,10 @@ function WorkflowTrigger({
9031
8833
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin text-icon6" }) }),
9032
8834
  /* @__PURE__ */ jsx(Txt, { children: "Resuming workflow" })
9033
8835
  ] }),
9034
- !isSuspendedSteps && /* @__PURE__ */ jsx(Fragment, { children: zodInputSchema ? /* @__PURE__ */ jsx(
8836
+ !isSuspendedSteps && /* @__PURE__ */ jsx(Fragment, { children: zodSchemaToUse ? /* @__PURE__ */ jsx(
9035
8837
  WorkflowInputData,
9036
8838
  {
9037
- schema: zodInputSchema,
8839
+ schema: zodSchemaToUse,
9038
8840
  defaultValues: payload,
9039
8841
  isSubmitLoading: isStreamingWorkflow,
9040
8842
  submitButtonLabel: "Run",
@@ -9045,7 +8847,7 @@ function WorkflowTrigger({
9045
8847
  withoutSubmit: !!paramsRunId
9046
8848
  }
9047
8849
  ) : !!paramsRunId ? null : /* @__PURE__ */ jsx(
9048
- Button$1,
8850
+ Button,
9049
8851
  {
9050
8852
  className: "w-full",
9051
8853
  variant: "light",
@@ -9087,7 +8889,7 @@ function WorkflowTrigger({
9087
8889
  ] }, step.stepId);
9088
8890
  }),
9089
8891
  result?.status === "running" && /* @__PURE__ */ jsxs(
9090
- Button$1,
8892
+ Button,
9091
8893
  {
9092
8894
  variant: "light",
9093
8895
  className: "w-full",
@@ -9145,13 +8947,13 @@ function WorkflowTrigger({
9145
8947
  const WorkflowJsonDialog = ({ result }) => {
9146
8948
  const [open, setOpen] = useState(false);
9147
8949
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9148
- /* @__PURE__ */ jsxs(Button$1, { variant: "light", onClick: () => setOpen(true), className: "w-full", size: "lg", children: [
8950
+ /* @__PURE__ */ jsxs(Button, { variant: "light", onClick: () => setOpen(true), className: "w-full", size: "lg", children: [
9149
8951
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Braces, { className: "text-icon3" }) }),
9150
8952
  "Open Workflow Execution (JSON)"
9151
8953
  ] }),
9152
8954
  /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(DialogPortal, { children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-6xl max-h-[90vh] overflow-y-auto overflow-x-hidden bg-surface2", children: [
9153
8955
  /* @__PURE__ */ jsx(DialogTitle, { children: "Workflow Execution (JSON)" }),
9154
- /* @__PURE__ */ jsx("div", { className: "w-full h-full overflow-x-scroll", children: /* @__PURE__ */ jsx(SyntaxHighlighter$2, { data: result, className: "p-4" }) })
8956
+ /* @__PURE__ */ jsx("div", { className: "w-full h-full overflow-x-scroll", children: /* @__PURE__ */ jsx(CodeEditor, { data: result, className: "p-4" }) })
9155
8957
  ] }) }) })
9156
8958
  ] });
9157
8959
  };
@@ -9613,7 +9415,7 @@ const EmptyWorkflowsTable = () => /* @__PURE__ */ jsx("div", { className: "flex
9613
9415
  titleSlot: "Configure Workflows",
9614
9416
  descriptionSlot: "Mastra workflows are not configured yet. You can find more information in the documentation.",
9615
9417
  actionSlot: /* @__PURE__ */ jsxs(
9616
- Button$1,
9418
+ Button,
9617
9419
  {
9618
9420
  size: "lg",
9619
9421
  className: "w-full",
@@ -9640,38 +9442,7 @@ const EntityHeader = ({ icon, title, isLoading, children }) => {
9640
9442
  ] });
9641
9443
  };
9642
9444
 
9643
- const Tabs$1 = TabsPrimitive.Root;
9644
- const TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
9645
- TabsPrimitive.List,
9646
- {
9647
- ref,
9648
- className: clsx("bg-muted text-muted-foreground inline-flex items-center bg-transparent", className),
9649
- ...props
9650
- }
9651
- ));
9652
- TabsList.displayName = TabsPrimitive.List.displayName;
9653
- const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
9654
- TabsPrimitive.Trigger,
9655
- {
9656
- ref,
9657
- className: cn(
9658
- "-outline-offset-2 data-[state=active]:bg-background data-[state=active]:text-foreground whitespace-nowrap text-ui-lg text-icon3 -mb-[0.5px] inline-flex items-center justify-center border-b-2 border-transparent p-3 font-medium disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-b-2 data-[state=active]:border-white data-[state=active]:shadow",
9659
- className
9660
- ),
9661
- ...props
9662
- }
9663
- ));
9664
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
9665
- const TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsPrimitive.Content, { ref, className: cn("mt-2 -outline-offset-2", className), ...props }));
9666
- TabsContent.displayName = TabsPrimitive.Content.displayName;
9667
-
9668
- const PlaygroundTabs = ({
9669
- children,
9670
- defaultTab,
9671
- value,
9672
- onValueChange,
9673
- className
9674
- }) => {
9445
+ const Tabs = ({ children, defaultTab, value, onValueChange, className }) => {
9675
9446
  const [internalTab, setInternalTab] = useState(defaultTab);
9676
9447
  const isControlled = value !== void 0 && onValueChange !== void 0;
9677
9448
  const currentTab = isControlled ? value : internalTab;
@@ -9683,17 +9454,41 @@ const PlaygroundTabs = ({
9683
9454
  setInternalTab(typedValue);
9684
9455
  }
9685
9456
  };
9686
- return /* @__PURE__ */ jsx(Tabs$1, { value: currentTab, onValueChange: handleTabChange, className: cn("h-full overflow-x-auto", className), children });
9457
+ return /* @__PURE__ */ jsx(RadixTabs.Root, { value: currentTab, onValueChange: handleTabChange, className: cn("overflow-y-auto", className), children });
9687
9458
  };
9688
- const TabList$1 = ({ children, className }) => {
9689
- return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsx(TabsList, { className: "border-b border-border1 flex min-w-full shrink-0", children }) });
9459
+
9460
+ const TabList = ({ children, variant = "default", className }) => {
9461
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsx(
9462
+ RadixTabs.List,
9463
+ {
9464
+ className: cn(
9465
+ "flex items-center",
9466
+ {
9467
+ // variant: default
9468
+ "text-[0.9375rem]": variant === "default",
9469
+ "[&>button]:py-[0.5rem] [&>button]:px-[1.5rem] [&>button]:font-normal [&>button]:text-icon3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1": variant === "default",
9470
+ "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:transition-colors [&>button[data-state=active]]:duration-200 [&>button[data-state=active]]:border-icon3": variant === "default",
9471
+ // variant: buttons
9472
+ "border border-border1 flex justify-stretch rounded-md overflow-hidden text-[0.875rem] min-h-[2.5rem]": variant === "buttons",
9473
+ "[&>button]:flex-1 [&>button]:py-[0.5rem] [&>button]:px-[1rem] [&>button]:text-icon3": variant === "buttons",
9474
+ "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:bg-[#222]": variant === "buttons"
9475
+ },
9476
+ className
9477
+ ),
9478
+ children
9479
+ }
9480
+ ) });
9690
9481
  };
9691
- const Tab$1 = ({ children, value, onClick, onClose }) => {
9482
+
9483
+ const Tab = ({ children, value, onClick, onClose, className }) => {
9692
9484
  return /* @__PURE__ */ jsxs(
9693
- TabsTrigger,
9485
+ RadixTabs.Trigger,
9694
9486
  {
9695
9487
  value,
9696
- className: "text-xs p-3 text-mastra-el-3 data-[state=active]:text-mastra-el-5 data-[state=active]:border-b-2 whitespace-nowrap flex-shrink-0 flex items-center gap-1.5",
9488
+ className: cn(
9489
+ "text-xs p-3 text-mastra-el-3 data-[state=active]:text-mastra-el-5 data-[state=active]:border-b-2 whitespace-nowrap flex-shrink-0 flex items-center justify-center gap-1.5",
9490
+ className
9491
+ ),
9697
9492
  onClick,
9698
9493
  children: [
9699
9494
  children,
@@ -9713,8 +9508,19 @@ const Tab$1 = ({ children, value, onClick, onClose }) => {
9713
9508
  }
9714
9509
  );
9715
9510
  };
9716
- const TabContent$1 = ({ children, value }) => {
9717
- return /* @__PURE__ */ jsx(TabsContent, { value, className: "h-full overflow-auto flex flex-col", children });
9511
+
9512
+ const TabContent = ({ children, value, className }) => {
9513
+ return /* @__PURE__ */ jsx(
9514
+ RadixTabs.Content,
9515
+ {
9516
+ value,
9517
+ className: cn(
9518
+ "grid py-3 overflow-y-auto ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:none",
9519
+ className
9520
+ ),
9521
+ children
9522
+ }
9523
+ );
9718
9524
  };
9719
9525
 
9720
9526
  const WorkflowRunOptions = () => {
@@ -9952,12 +9758,12 @@ function WorkflowInformation({ workflowId, initialRunId }) {
9952
9758
  ] }),
9953
9759
  workflow?.isProcessorWorkflow && /* @__PURE__ */ jsx(Badge, { icon: /* @__PURE__ */ jsx(Cpu, { className: "h-3 w-3" }), className: "bg-violet-500/20 text-violet-400", children: "Processor" })
9954
9760
  ] }) }),
9955
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto border-t-sm border-border1 flex flex-col", children: /* @__PURE__ */ jsxs(PlaygroundTabs, { defaultTab: "current-run", value: tab, onValueChange: handleTabChange, className: "h-full", children: [
9956
- /* @__PURE__ */ jsxs(TabList$1, { children: [
9957
- /* @__PURE__ */ jsx(Tab$1, { value: "current-run", children: "Current Run" }),
9958
- /* @__PURE__ */ jsx(Tab$1, { value: "run-options", children: "Run Options" }),
9761
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto border-t-sm border-border1 flex flex-col", children: /* @__PURE__ */ jsxs(Tabs, { defaultTab: "current-run", value: tab, onValueChange: handleTabChange, className: "h-full", children: [
9762
+ /* @__PURE__ */ jsxs(TabList, { children: [
9763
+ /* @__PURE__ */ jsx(Tab, { value: "current-run", children: "Current Run" }),
9764
+ /* @__PURE__ */ jsx(Tab, { value: "run-options", children: "Run Options" }),
9959
9765
  stepDetail && nodeDetailTabName && /* @__PURE__ */ jsxs(
9960
- Tab$1,
9766
+ Tab,
9961
9767
  {
9962
9768
  value: "node-details",
9963
9769
  onClose: () => {
@@ -9971,7 +9777,7 @@ function WorkflowInformation({ workflowId, initialRunId }) {
9971
9777
  }
9972
9778
  )
9973
9779
  ] }),
9974
- /* @__PURE__ */ jsx(TabContent$1, { value: "current-run", children: workflowId ? initialRunId ? /* @__PURE__ */ jsx(
9780
+ /* @__PURE__ */ jsx(TabContent, { value: "current-run", children: workflowId ? initialRunId ? /* @__PURE__ */ jsx(
9975
9781
  WorkflowRunDetail,
9976
9782
  {
9977
9783
  workflowId,
@@ -10004,8 +9810,8 @@ function WorkflowInformation({ workflowId, initialRunId }) {
10004
9810
  cancelWorkflowRun
10005
9811
  }
10006
9812
  ) : null }),
10007
- /* @__PURE__ */ jsx(TabContent$1, { value: "run-options", children: /* @__PURE__ */ jsx(TracingRunOptions, {}) }),
10008
- stepDetail && /* @__PURE__ */ jsx(TabContent$1, { value: "node-details", children: /* @__PURE__ */ jsx(WorkflowStepDetailContent, {}) })
9813
+ /* @__PURE__ */ jsx(TabContent, { value: "run-options", children: /* @__PURE__ */ jsx(TracingRunOptions, {}) }),
9814
+ stepDetail && /* @__PURE__ */ jsx(TabContent, { value: "node-details", children: /* @__PURE__ */ jsx(WorkflowStepDetailContent, {}) })
10009
9815
  ] }) })
10010
9816
  ] });
10011
9817
  }
@@ -10094,15 +9900,14 @@ function Combobox({
10094
9900
  }, [highlightedIndex]);
10095
9901
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
10096
9902
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
10097
- Button$2,
9903
+ Button,
10098
9904
  {
10099
9905
  ref: triggerRef,
10100
- variant,
10101
9906
  role: "combobox",
10102
9907
  "aria-expanded": open,
9908
+ variant,
10103
9909
  className: cn("w-full justify-between", className),
10104
9910
  disabled,
10105
- size: "sm",
10106
9911
  children: [
10107
9912
  /* @__PURE__ */ jsx("span", { className: "truncate text-ui-lg", children: selectedOption ? selectedOption.label : placeholder }),
10108
9913
  /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
@@ -10203,8 +10008,7 @@ function WorkflowCombobox({
10203
10008
  searchPlaceholder,
10204
10009
  emptyText,
10205
10010
  className,
10206
- disabled: disabled || isLoading || isError,
10207
- variant: "ghost"
10011
+ disabled: disabled || isLoading || isError
10208
10012
  }
10209
10013
  );
10210
10014
  }
@@ -10311,7 +10115,7 @@ const CollapsiblePanel = ({ collapsedSize, children, direction, ...props }) => {
10311
10115
  }
10312
10116
  },
10313
10117
  children: collapsed ? /* @__PURE__ */ jsxs(Tooltip, { children: [
10314
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button$1, { onClick: expand, className: "!h-48 border-none", children: /* @__PURE__ */ jsx(Icon, { children: direction === "left" ? /* @__PURE__ */ jsx(ArrowRight, {}) : /* @__PURE__ */ jsx(ArrowLeft, {}) }) }) }) }),
10118
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { onClick: expand, className: "!h-48 border-none", children: /* @__PURE__ */ jsx(Icon, { children: direction === "left" ? /* @__PURE__ */ jsx(ArrowRight, {}) : /* @__PURE__ */ jsx(ArrowLeft, {}) }) }) }) }),
10315
10119
  /* @__PURE__ */ jsx(TooltipContent, { children: "Expand" })
10316
10120
  ] }) : children
10317
10121
  }
@@ -10395,7 +10199,7 @@ const WorkflowBadge = ({
10395
10199
  const snapshot = typeof run?.snapshot === "object" ? run?.snapshot : void 0;
10396
10200
  const selectionReason = metadata?.mode === "network" ? metadata.selectionReason : void 0;
10397
10201
  const agentNetworkInput = metadata?.mode === "network" ? metadata.agentInput : void 0;
10398
- let suspendPayloadSlot = typeof suspendPayload === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: suspendPayload }) : /* @__PURE__ */ jsx(SyntaxHighlighter$1, { data: suspendPayload, "data-testid": "tool-suspend-payload" });
10202
+ let suspendPayloadSlot = typeof suspendPayload === "string" ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre bg-surface4 p-4 rounded-md overflow-x-auto", children: suspendPayload }) : /* @__PURE__ */ jsx(CodeEditor, { data: suspendPayload, "data-testid": "tool-suspend-payload" });
10399
10203
  if (isWorkflowLoading || !workflow) return /* @__PURE__ */ jsx(LoadingBadge, {});
10400
10204
  return /* @__PURE__ */ jsxs(
10401
10205
  BadgeWrapper,
@@ -10427,8 +10231,8 @@ const WorkflowBadgeExtended = ({ workflowId, workflow, runId }) => {
10427
10231
  const { Link } = useLinkComponent();
10428
10232
  return /* @__PURE__ */ jsxs(Fragment, { children: [
10429
10233
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
10430
- /* @__PURE__ */ jsx(Button$1, { as: Link, href: `/workflows/${workflowId}/graph`, children: "Go to workflow" }),
10431
- runId && /* @__PURE__ */ jsx(Button$1, { as: Link, href: `/workflows/${workflowId}/graph/${runId}`, children: "See run" })
10234
+ /* @__PURE__ */ jsx(Button, { as: Link, href: `/workflows/${workflowId}/graph`, children: "Go to workflow" }),
10235
+ runId && /* @__PURE__ */ jsx(Button, { as: Link, href: `/workflows/${workflowId}/graph/${runId}`, children: "See run" })
10432
10236
  ] }),
10433
10237
  /* @__PURE__ */ jsx("div", { className: "rounded-md overflow-hidden h-[60vh] w-full", children: /* @__PURE__ */ jsx(WorkflowGraph, { workflowId, workflow }) })
10434
10238
  ] });
@@ -10523,11 +10327,14 @@ const AgentBadgeWrapper = ({
10523
10327
  toolCallId,
10524
10328
  toolApprovalMetadata
10525
10329
  }) => {
10526
- const { data } = useAgentMessages({
10330
+ const { data, isLoading } = useAgentMessages({
10527
10331
  threadId: result?.subAgentThreadId,
10528
10332
  agentId,
10529
10333
  memory: true
10530
10334
  });
10335
+ if (isLoading) {
10336
+ return /* @__PURE__ */ jsx(LoadingBadge, {});
10337
+ }
10531
10338
  const convertedMessages = data?.messages ? toAISdkV5Messages(data.messages) : [];
10532
10339
  const childMessages = result?.childMessages ?? resolveToChildMessages(convertedMessages);
10533
10340
  return /* @__PURE__ */ jsx(
@@ -11064,7 +10871,9 @@ const ProviderLogo = ({ providerId, className = "", size = 20 }) => {
11064
10871
  const AssistantMessage = ({ hasModelList }) => {
11065
10872
  const data = useMessage();
11066
10873
  const messageId = data.id;
11067
- const isToolCallAndOrReasoning = data.content.every(({ type }) => type === "tool-call" || type === "reasoning");
10874
+ const isNotAssistantTextResponse = data.content.every(
10875
+ ({ type, metadata }) => type === "tool-call" || type === "reasoning" || type === "text" && metadata?.mode === "network" && metadata?.completionResult
10876
+ );
11068
10877
  const modelMetadata = data.metadata?.custom?.modelMetadata;
11069
10878
  const showModelUsed = hasModelList && modelMetadata;
11070
10879
  return /* @__PURE__ */ jsxs(MessagePrimitive.Root, { className: "max-w-full", "data-message-id": messageId, children: [
@@ -11078,7 +10887,7 @@ const AssistantMessage = ({ hasModelList }) => {
11078
10887
  }
11079
10888
  }
11080
10889
  ) }),
11081
- !isToolCallAndOrReasoning && /* @__PURE__ */ jsxs("div", { className: cn("h-6 pt-4 flex gap-2 items-center", { "pb-1": showModelUsed }), children: [
10890
+ !isNotAssistantTextResponse && /* @__PURE__ */ jsxs("div", { className: cn("h-6 pt-4 flex gap-2 items-center", { "pb-1": showModelUsed }), children: [
11082
10891
  showModelUsed && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
11083
10892
  /* @__PURE__ */ jsx(ProviderLogo, { providerId: modelMetadata.modelProvider, size: 14 }),
11084
10893
  /* @__PURE__ */ jsxs("span", { className: "text-ui-xs leading-ui-xs", children: [
@@ -11592,7 +11401,7 @@ const AttachFileDialog = ({ onOpenChange, open }) => {
11592
11401
  }
11593
11402
  )
11594
11403
  ] }),
11595
- /* @__PURE__ */ jsxs(Button$1, { type: "submit", className: "!h-8", variant: "light", children: [
11404
+ /* @__PURE__ */ jsxs(Button, { type: "submit", className: "!h-8", variant: "light", children: [
11596
11405
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Link, {}) }),
11597
11406
  "Add"
11598
11407
  ] })
@@ -11656,18 +11465,8 @@ const ThreadWrapper = ({ children }) => {
11656
11465
  return /* @__PURE__ */ jsx(ThreadPrimitive.Root, { className: "grid grid-rows-[1fr_auto] h-full overflow-y-auto", "data-testid": "thread-wrapper", children });
11657
11466
  };
11658
11467
  const ThreadWelcome = ({ agentName }) => {
11659
- const safeAgentName = agentName ?? "";
11660
- const words = safeAgentName.split(" ") ?? [];
11661
- let initials = "A";
11662
- if (words.length === 2) {
11663
- initials = `${words[0][0]}${words[1][0]}`;
11664
- } else if (safeAgentName.length > 0) {
11665
- initials = `${safeAgentName[0]}`;
11666
- } else {
11667
- initials = "A";
11668
- }
11669
11468
  return /* @__PURE__ */ jsx(ThreadPrimitive.Empty, { children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-grow flex-col items-center justify-center", children: [
11670
- /* @__PURE__ */ jsx(Avatar, { children: /* @__PURE__ */ jsx(AvatarFallback, { children: initials }) }),
11469
+ /* @__PURE__ */ jsx(Avatar, { name: agentName || "Agent", size: "lg" }),
11671
11470
  /* @__PURE__ */ jsx("p", { className: "mt-4 font-medium", children: "How can I help you today?" })
11672
11471
  ] }) });
11673
11472
  };
@@ -11717,7 +11516,6 @@ const SpeechInput = ({ agentId }) => {
11717
11516
  {
11718
11517
  type: "button",
11719
11518
  tooltip: isListening ? "Stop dictation" : "Start dictation",
11720
- variant: "ghost",
11721
11519
  className: "rounded-full",
11722
11520
  onClick: () => isListening ? stop() : start(),
11723
11521
  children: isListening ? /* @__PURE__ */ jsx(CircleStopIcon, {}) : /* @__PURE__ */ jsx(Mic, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" })
@@ -11732,7 +11530,6 @@ const ComposerAction = () => {
11732
11530
  {
11733
11531
  type: "button",
11734
11532
  tooltip: "Add attachment",
11735
- variant: "ghost",
11736
11533
  className: "rounded-full",
11737
11534
  onClick: () => setIsAddAttachmentDialogOpen(true),
11738
11535
  children: /* @__PURE__ */ jsx(PlusIcon, { className: "h-6 w-6 text-[#898989] hover:text-[#fff]" })
@@ -11755,8 +11552,8 @@ const EditComposer = () => {
11755
11552
  return /* @__PURE__ */ jsxs(ComposerPrimitive.Root, { children: [
11756
11553
  /* @__PURE__ */ jsx(ComposerPrimitive.Input, {}),
11757
11554
  /* @__PURE__ */ jsxs("div", { children: [
11758
- /* @__PURE__ */ jsx(ComposerPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(Button$2, { variant: "ghost", children: "Cancel" }) }),
11759
- /* @__PURE__ */ jsx(ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ jsx(Button$2, { children: "Send" }) })
11555
+ /* @__PURE__ */ jsx(ComposerPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "bg-surface2 border-sm border-border1 px-lg text-ui-md inline-flex items-center justify-center rounded-md border h-button-md gap-md hover:bg-surface4 text-icon3 hover:text-icon6", children: "Cancel" }) }),
11556
+ /* @__PURE__ */ jsx(ComposerPrimitive.Send, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "bg-surface2 border-sm border-border1 px-lg text-ui-md inline-flex items-center justify-center rounded-md border h-button-md gap-md hover:bg-surface4 text-icon3 hover:text-icon6", children: "Send" }) })
11760
11557
  ] })
11761
11558
  ] });
11762
11559
  };
@@ -13119,6 +12916,27 @@ const useMemorySearch = ({
13119
12916
  }
13120
12917
  });
13121
12918
  };
12919
+ const useCloneThread = () => {
12920
+ const client = useMastraClient();
12921
+ const queryClient = useQueryClient();
12922
+ const { requestContext } = usePlaygroundStore();
12923
+ return useMutation({
12924
+ mutationFn: async ({ threadId, agentId, title }) => {
12925
+ const thread = client.getMemoryThread({ threadId, agentId });
12926
+ return thread.clone({ title, requestContext });
12927
+ },
12928
+ onSuccess: (_, variables) => {
12929
+ const { agentId } = variables;
12930
+ if (agentId) {
12931
+ queryClient.invalidateQueries({ queryKey: ["memory", "threads", agentId, agentId] });
12932
+ }
12933
+ toast$1.success("Thread cloned successfully");
12934
+ },
12935
+ onError: () => {
12936
+ toast$1.error("Failed to clone thread");
12937
+ }
12938
+ });
12939
+ };
13122
12940
 
13123
12941
  const NetworkCheckbox = ({ hasMemory, hasSubAgents }) => {
13124
12942
  const isNetworkAvailable = hasMemory && hasSubAgents;
@@ -13260,7 +13078,7 @@ const AgentSettings = ({ agentId }) => {
13260
13078
  ] })
13261
13079
  ] }),
13262
13080
  /* @__PURE__ */ jsx("section", { className: "py-7", children: /* @__PURE__ */ jsx(AgentAdvancedSettings, {}) }),
13263
- /* @__PURE__ */ jsxs(Button$1, { onClick: () => resetAll(), variant: "light", className: "w-full", size: "lg", children: [
13081
+ /* @__PURE__ */ jsxs(Button, { onClick: () => resetAll(), variant: "light", className: "w-full", size: "lg", children: [
13264
13082
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(RefreshCw, {}) }),
13265
13083
  "Reset"
13266
13084
  ] })
@@ -13386,7 +13204,7 @@ const EmptyAgentsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-f
13386
13204
  titleSlot: "Configure Agents",
13387
13205
  descriptionSlot: "Mastra agents are not configured yet. You can find more information in the documentation.",
13388
13206
  actionSlot: /* @__PURE__ */ jsxs(
13389
- Button$1,
13207
+ Button,
13390
13208
  {
13391
13209
  size: "lg",
13392
13210
  className: "w-full",
@@ -13463,7 +13281,7 @@ const RequestContext = () => {
13463
13281
  className: "h-[400px] overflow-y-scroll bg-surface3 rounded-lg overflow-hidden p-3"
13464
13282
  }
13465
13283
  ),
13466
- /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ jsx(Button$1, { onClick: handleSaveRequestContext, children: "Save" }) })
13284
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-2", children: /* @__PURE__ */ jsx(Button, { onClick: handleSaveRequestContext, children: "Save" }) })
13467
13285
  ] }) });
13468
13286
  };
13469
13287
  const RequestContextWrapper = ({ children }) => {
@@ -13471,7 +13289,7 @@ const RequestContextWrapper = ({ children }) => {
13471
13289
  return /* @__PURE__ */ jsxs("div", { className: "max-w-3xl p-5 overflow-y-scroll h-full", children: [
13472
13290
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg p-4 pb-5 bg-surface4 shadow-md space-y-3 border border-border1 mb-5", children: [
13473
13291
  /* @__PURE__ */ jsx(Txt, { as: "p", variant: "ui-lg", className: "text-icon3", children: "Mastra provides request context, which is a system based on dependency injection that enables you to configure your agents and tools with runtime variables. If you find yourself creating several different agents that do very similar things, request context allows you to combine them into one agent." }),
13474
- /* @__PURE__ */ jsxs(Button$1, { as: Link, to: "https://mastra.ai/en/docs/agents/runtime-variables", target: "_blank", children: [
13292
+ /* @__PURE__ */ jsxs(Button, { as: Link, to: "https://mastra.ai/en/docs/agents/runtime-variables", target: "_blank", children: [
13475
13293
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(ExternalLink, {}) }),
13476
13294
  "See documentation"
13477
13295
  ] })
@@ -14021,49 +13839,6 @@ function SideDialogRoot({
14021
13839
  ] }) });
14022
13840
  }
14023
13841
 
14024
- const Button = React__default.forwardRef(
14025
- ({ className, variant = "outline", isFaded, ...props }, ref) => {
14026
- return /* @__PURE__ */ jsx(
14027
- "button",
14028
- {
14029
- ref,
14030
- className: cn(
14031
- "text-[.875rem] inline-flex items-center justify-center rounded-lg px-[1rem] gap-[.75rem] leading-0 border bg-transparent text-[rgba(255,255,255,0.7)] whitespace-nowrap",
14032
- "[&:not(:disabled):hover]:border-[rgba(255,255,255,0.25)] [&:not(:disabled):hover]:text-[rgba(255,255,255,0.9)]",
14033
- "[&>svg]:w-[1em] [&>svg]:h-[1em] [&>svg]:mx-[-0.3em] [&>svg]:opacity-70 [&>svg]:shrink-0",
14034
- "focus:outline-none focus:shadow-[inset_0_0_0_1px_rgba(24,251,111,0.75)]",
14035
- className,
14036
- {
14037
- "cursor-not-allowed opacity-50": props.disabled,
14038
- "bg-ui-primaryBtnBg text-ui-primaryBtnText hover:bg-surface6 leading-[0] font-semibold": variant === "primary",
14039
- "min-h-[2rem]": variant === "ghost",
14040
- "min-h-[2.5rem]": variant !== "ghost",
14041
- "border-[rgba(255,255,255,0.15)]": variant === "outline",
14042
- "opacity-40": isFaded
14043
- }
14044
- ),
14045
- ...props
14046
- }
14047
- );
14048
- }
14049
- );
14050
- Button.displayName = "Button";
14051
-
14052
- const CombinedButtons = ({ className, children }) => {
14053
- return /* @__PURE__ */ jsx(
14054
- "div",
14055
- {
14056
- className: cn(
14057
- "flex items-center text-[0.75rem] border border-border1 rounded-lg overflow-hidden",
14058
- "[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1",
14059
- "[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",
14060
- className
14061
- ),
14062
- children
14063
- }
14064
- );
14065
- };
14066
-
14067
13842
  function ButtonsGroup({ children, className }) {
14068
13843
  return /* @__PURE__ */ jsx("div", { className: cn(`flex gap-2 items-center`, "[&>button]:flex-grow", className), children });
14069
13844
  }
@@ -14136,7 +13911,7 @@ function SideDialogCodeSection({ codeStr = "", title, icon, simplified = false }
14136
13911
  ] }),
14137
13912
  /* @__PURE__ */ jsxs(ButtonsGroup, { children: [
14138
13913
  /* @__PURE__ */ jsx(CopyButton, { content: codeStr || "No content" }),
14139
- hasMultilineText && /* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setShowAsMultilineText(!showAsMultilineText), children: showAsMultilineText ? /* @__PURE__ */ jsx(AlignLeftIcon, {}) : /* @__PURE__ */ jsx(AlignJustifyIcon, {}) })
13914
+ hasMultilineText && /* @__PURE__ */ jsx(Button, { onClick: () => setShowAsMultilineText(!showAsMultilineText), children: showAsMultilineText ? /* @__PURE__ */ jsx(AlignLeftIcon, {}) : /* @__PURE__ */ jsx(AlignJustifyIcon, {}) })
14140
13915
  ] })
14141
13916
  ] }),
14142
13917
  codeStr && /* @__PURE__ */ jsx("div", { className: "bg-black/20 p-[1rem] overflow-hidden rounded-xl border border-white/10 text-icon4 text-[0.875rem] break-all", children: simplified ? /* @__PURE__ */ jsx("div", { className: "text-icon4 font-mono break-all px-[0.5rem]", children: /* @__PURE__ */ jsx("pre", { className: "text-wrap", children: codeStr }) }) : /* @__PURE__ */ jsx(CodeMirror, { extensions: [json(), EditorView$1.lineWrapping], theme, value: finalCodeStr }) })
@@ -14211,11 +13986,11 @@ function SideDialogNav({ onNext, onPrevious, className }) {
14211
13986
  className
14212
13987
  ),
14213
13988
  children: (onNext || onPrevious) && /* @__PURE__ */ jsxs("div", { className: cn("flex gap-[1rem] items-baseline"), children: [
14214
- /* @__PURE__ */ jsxs(Button, { onClick: handleOnPrevious, disabled: !onPrevious, variant: "ghost", children: [
13989
+ /* @__PURE__ */ jsxs(Button, { onClick: handleOnPrevious, disabled: !onPrevious, children: [
14215
13990
  "Previous",
14216
13991
  /* @__PURE__ */ jsx(ArrowUpIcon, {})
14217
13992
  ] }),
14218
- /* @__PURE__ */ jsxs(Button, { onClick: handleOnNext, disabled: !onNext, variant: "ghost", children: [
13993
+ /* @__PURE__ */ jsxs(Button, { onClick: handleOnNext, disabled: !onNext, children: [
14219
13994
  "Next",
14220
13995
  /* @__PURE__ */ jsx(ArrowDownIcon, {})
14221
13996
  ] })
@@ -14266,45 +14041,6 @@ function PageHeader({ title, description, icon, className }) {
14266
14041
  ] });
14267
14042
  }
14268
14043
 
14269
- function DatePicker({ className, classNames, showOutsideDays = true, ...props }) {
14270
- return /* @__PURE__ */ jsx(
14271
- DayPicker,
14272
- {
14273
- showOutsideDays,
14274
- className: cn("p-3", className),
14275
- classNames: {
14276
- months: "flex flex-col space-y-4 sm:space-y-0 ",
14277
- month: "space-y-4 text-[0.75rem] ",
14278
- caption: "flex justify-between pt-1 items-center pl-2",
14279
- caption_label: "text-text font-medium ",
14280
- nav: "flex items-center",
14281
- nav_button_previous: cn(
14282
- "flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
14283
- ),
14284
- nav_button_next: cn("flex justify-center items-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),
14285
- dropdown_month: "w-full border-collapse space-y-1",
14286
- weeknumber: "flex",
14287
- day: cn(
14288
- "relative p-0 text-center focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",
14289
- props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md",
14290
- "h-8 w-8 p-0 hover:bg-lightGray-7/50 font-normal aria-selected:opacity-100"
14291
- ),
14292
- day_range_start: "day-range-start",
14293
- day_range_end: "day-range-end",
14294
- day_selected: "!bg-primary/50 !text-primary-foreground hover:bg-primary rounded-md hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
14295
- day_today: "bg-primary/10 text-accent-foreground",
14296
- day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
14297
- day_disabled: "text-muted-foreground opacity-50",
14298
- day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
14299
- day_hidden: "invisible",
14300
- head_cell: "text-[0.625rem] text-muted-foreground",
14301
- ...classNames
14302
- },
14303
- ...props
14304
- }
14305
- );
14306
- }
14307
-
14308
14044
  function Select({ name, onChange, defaultValue, value, options, placeholder }) {
14309
14045
  return /* @__PURE__ */ jsxs(Select$1, { name, onValueChange: onChange, value, children: [
14310
14046
  /* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: placeholder || "Select..." }) }),
@@ -14585,7 +14321,8 @@ const DateTimePickerContent = ({
14585
14321
  /* @__PURE__ */ jsx(
14586
14322
  Button,
14587
14323
  {
14588
- variant: "primary",
14324
+ variant: "light",
14325
+ size: "lg",
14589
14326
  tabIndex: 0,
14590
14327
  onClick: () => {
14591
14328
  dateInputValueIsValid ? handleApply() : handleCancel();
@@ -14593,7 +14330,7 @@ const DateTimePickerContent = ({
14593
14330
  children: newValueDefined ? `Apply` : `Cancel`
14594
14331
  }
14595
14332
  ),
14596
- newValueDefined && /* @__PURE__ */ jsx(Button, { variant: "outline", tabIndex: 0, onClick: handleClear, children: "Clear" })
14333
+ newValueDefined && /* @__PURE__ */ jsx(Button, { tabIndex: 0, onClick: handleClear, children: "Clear" })
14597
14334
  ] })
14598
14335
  ]
14599
14336
  }
@@ -14601,7 +14338,7 @@ const DateTimePickerContent = ({
14601
14338
  };
14602
14339
  const DefaultTrigger = React.forwardRef(
14603
14340
  ({ value, placeholder, className, ...props }, ref) => {
14604
- return /* @__PURE__ */ jsxs(Button, { ref, variant: "outline", className: cn("justify-start", className), ...props, children: [
14341
+ return /* @__PURE__ */ jsxs(Button, { ref, className: cn("justify-start", className), variant: "light", size: "lg", ...props, children: [
14605
14342
  /* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4" }),
14606
14343
  value ? /* @__PURE__ */ jsx("span", { className: "text-white", children: format(value, "PP p") }) : /* @__PURE__ */ jsx("span", { className: "text-gray", children: placeholder ?? "Pick a date" })
14607
14344
  ] });
@@ -14673,7 +14410,7 @@ function Notification({
14673
14410
  children
14674
14411
  }
14675
14412
  ),
14676
- dismissible && /* @__PURE__ */ jsxs(Button, { variant: "ghost", onClick: () => setLocalIsVisible(false), children: [
14413
+ dismissible && /* @__PURE__ */ jsxs(Button, { onClick: () => setLocalIsVisible(false), children: [
14677
14414
  /* @__PURE__ */ jsx(XIcon, {}),
14678
14415
  /* @__PURE__ */ jsx(VisuallyHidden$1, { children: "Dismiss" })
14679
14416
  ] })
@@ -15153,9 +14890,9 @@ function ScoresTools({ onEntityChange, onReset, selectedEntity, entityOptions, i
15153
14890
  disabled: isLoading
15154
14891
  }
15155
14892
  ),
15156
- /* @__PURE__ */ jsxs(Button, { variant: "primary", onClick: onReset, disabled: isLoading, children: [
15157
- "Reset ",
15158
- /* @__PURE__ */ jsx(XIcon, {})
14893
+ /* @__PURE__ */ jsxs(Button, { variant: "light", size: "lg", className: "min-w-32", onClick: onReset, disabled: isLoading, children: [
14894
+ "Reset",
14895
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(XIcon, {}) })
15159
14896
  ] })
15160
14897
  ] });
15161
14898
  }
@@ -15242,8 +14979,7 @@ function ScorerCombobox({
15242
14979
  searchPlaceholder,
15243
14980
  emptyText,
15244
14981
  className,
15245
- disabled: disabled || isLoading || isError,
15246
- variant: "ghost"
14982
+ disabled: disabled || isLoading || isError
15247
14983
  }
15248
14984
  );
15249
14985
  }
@@ -15312,7 +15048,7 @@ const EmptyScorersTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-
15312
15048
  titleSlot: "Configure Scorers",
15313
15049
  descriptionSlot: "Mastra scorers are not configured yet. You can find more information in the documentation.",
15314
15050
  actionSlot: /* @__PURE__ */ jsxs(
15315
- Button$1,
15051
+ Button,
15316
15052
  {
15317
15053
  size: "lg",
15318
15054
  className: "w-full",
@@ -15866,7 +15602,7 @@ const AgentMetadataModelSwitcher = ({
15866
15602
  }
15867
15603
  ),
15868
15604
  /* @__PURE__ */ jsx(
15869
- Button$1,
15605
+ Button,
15870
15606
  {
15871
15607
  variant: "light",
15872
15608
  size: "md",
@@ -16043,7 +15779,7 @@ const PromptEnhancer = ({ agentId }) => {
16043
15779
  isDirty && /* @__PURE__ */ jsxs(Alert$1, { variant: "info", children: [
16044
15780
  /* @__PURE__ */ jsx(AlertTitle$1, { as: "h5", children: "Experiment mode" }),
16045
15781
  /* @__PURE__ */ jsx(AlertDescription$1, { as: "p", children: "You're editing this agent's instructions. Changes are saved locally in your browser but won't update the agent's code." }),
16046
- /* @__PURE__ */ jsxs(Button$1, { variant: "light", onClick: resetPrompt, children: [
15782
+ /* @__PURE__ */ jsxs(Button, { variant: "light", onClick: resetPrompt, children: [
16047
15783
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(RefreshCcwIcon, {}) }),
16048
15784
  "Reset"
16049
15785
  ] })
@@ -16117,7 +15853,7 @@ const PromptEnhancerTextarea = ({ agentId }) => {
16117
15853
  ),
16118
15854
  /* @__PURE__ */ jsxs("div", { className: "flex justify-end items-center gap-2", children: [
16119
15855
  showWarning && /* @__PURE__ */ jsx("span", { className: "text-xs text-yellow-200", children: "No model with a configured API key found." }),
16120
- /* @__PURE__ */ jsxs(Button$1, { variant: "light", type: "submit", disabled: isDisabled, children: [
15856
+ /* @__PURE__ */ jsxs(Button, { variant: "light", type: "submit", disabled: isDisabled, children: [
16121
15857
  /* @__PURE__ */ jsx(Icon, { children: isPending ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(RefreshCcwIcon, {}) }),
16122
15858
  "Enhance prompt"
16123
15859
  ] })
@@ -16386,7 +16122,7 @@ const ThreadItem = ({ children, isActive, className }) => {
16386
16122
  };
16387
16123
  const ThreadDeleteButton = ({ onClick }) => {
16388
16124
  return /* @__PURE__ */ jsx(
16389
- Button$1,
16125
+ Button,
16390
16126
  {
16391
16127
  className: "shrink-0 border-none bg-transparent opacity-0 transition-all group-focus-within:opacity-100 group-hover:opacity-100",
16392
16128
  onClick,
@@ -16588,8 +16324,7 @@ function AgentCombobox({
16588
16324
  searchPlaceholder,
16589
16325
  emptyText,
16590
16326
  className,
16591
- disabled: disabled || isLoading || isError,
16592
- variant: "ghost"
16327
+ disabled: disabled || isLoading || isError
16593
16328
  }
16594
16329
  );
16595
16330
  }
@@ -16829,9 +16564,12 @@ function CodeDisplay({
16829
16564
 
16830
16565
  const AgentWorkingMemory = ({ agentId }) => {
16831
16566
  const { threadExists, workingMemoryData, workingMemorySource, isLoading, isUpdating, updateWorkingMemory } = useWorkingMemory();
16832
- const { data } = useMemoryConfig(agentId);
16567
+ const { data, isLoading: isConfigLoading } = useMemoryConfig(agentId);
16833
16568
  const config = data?.config;
16834
16569
  const isWorkingMemoryEnabled = Boolean(config?.workingMemory?.enabled);
16570
+ if (isLoading || isConfigLoading) {
16571
+ return /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" });
16572
+ }
16835
16573
  const { isCopied, handleCopy } = useCopyToClipboard({
16836
16574
  text: workingMemoryData ?? "",
16837
16575
  copyMessage: "Working memory copied!"
@@ -16841,9 +16579,6 @@ const AgentWorkingMemory = ({ agentId }) => {
16841
16579
  React__default.useEffect(() => {
16842
16580
  setEditValue(workingMemoryData ?? "");
16843
16581
  }, [workingMemoryData]);
16844
- if (isLoading) {
16845
- return /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" });
16846
- }
16847
16582
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
16848
16583
  /* @__PURE__ */ jsxs("div", { children: [
16849
16584
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
@@ -16893,24 +16628,12 @@ const AgentWorkingMemory = ({ agentId }) => {
16893
16628
  }
16894
16629
  ),
16895
16630
  /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: !isEditing ? /* @__PURE__ */ jsx(Fragment, { children: !threadExists ? /* @__PURE__ */ jsxs(Tooltip, { children: [
16896
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { tabIndex: 0, children: /* @__PURE__ */ jsx(Button$2, { variant: "secondary", size: "sm", disabled: true, className: "text-xs pointer-events-none", children: "Edit Working Memory" }) }) }),
16631
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx("span", { tabIndex: 0, children: /* @__PURE__ */ jsx(Button, { disabled: true, className: "text-xs pointer-events-none", children: "Edit Working Memory" }) }) }),
16897
16632
  /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Working memory will be available after the agent calls updateWorkingMemory" }) })
16898
- ] }) : /* @__PURE__ */ jsx(
16899
- Button$2,
16900
- {
16901
- variant: "secondary",
16902
- size: "sm",
16903
- onClick: () => setIsEditing(true),
16904
- disabled: isUpdating,
16905
- className: "text-xs",
16906
- children: "Edit Working Memory"
16907
- }
16908
- ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16633
+ ] }) : /* @__PURE__ */ jsx(Button, { onClick: () => setIsEditing(true), disabled: isUpdating, className: "text-xs", children: "Edit Working Memory" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
16909
16634
  /* @__PURE__ */ jsx(
16910
- Button$2,
16635
+ Button,
16911
16636
  {
16912
- variant: "default",
16913
- size: "sm",
16914
16637
  onClick: async () => {
16915
16638
  try {
16916
16639
  await updateWorkingMemory(editValue);
@@ -16926,10 +16649,8 @@ const AgentWorkingMemory = ({ agentId }) => {
16926
16649
  }
16927
16650
  ),
16928
16651
  /* @__PURE__ */ jsx(
16929
- Button$2,
16652
+ Button,
16930
16653
  {
16931
- variant: "secondary",
16932
- size: "sm",
16933
16654
  onClick: () => {
16934
16655
  setEditValue(workingMemoryData ?? "");
16935
16656
  setIsEditing(false);
@@ -17247,16 +16968,7 @@ const MemorySearch = ({
17247
16968
  className: "pl-10 pr-10 bg-surface3 border-border1"
17248
16969
  }
17249
16970
  ),
17250
- query && /* @__PURE__ */ jsx(
17251
- Button$2,
17252
- {
17253
- onClick: clearSearch,
17254
- variant: "ghost",
17255
- size: "sm",
17256
- className: "absolute right-1 top-1/2 transform -translate-y-1/2 h-6 w-6 p-0",
17257
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
17258
- }
17259
- )
16971
+ query && /* @__PURE__ */ jsx(Button, { onClick: clearSearch, className: "absolute right-1 top-1/2 transform -translate-y-1/2 h-6 w-6 p-0", children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
17260
16972
  ] }),
17261
16973
  (isOpen || query && (isSearching || results.length === 0)) && /* @__PURE__ */ jsx("div", { className: "mt-2 flex-1 bg-surface3 border border-border1 rounded-lg shadow-lg overflow-y-auto", children: error ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-red-500", children: error }) }) : isSearching && results.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Searching..." }) }) : results.length === 0 ? /* @__PURE__ */ jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsxs(Txt, { variant: "ui-sm", className: "text-icon3", children: [
17262
16974
  'No results found for "',
@@ -17329,7 +17041,7 @@ const MemorySearch = ({
17329
17041
  function AgentMemory({ agentId, threadId }) {
17330
17042
  const { threadInput: chatInputValue } = useThreadInput();
17331
17043
  const { paths, navigate } = useLinkComponent();
17332
- const { data } = useMemoryConfig(agentId);
17044
+ const { data, isLoading: isConfigLoading } = useMemoryConfig(agentId);
17333
17045
  const config = data?.config;
17334
17046
  const isSemanticRecallEnabled = Boolean(config?.semanticRecall);
17335
17047
  const { mutateAsync: searchMemory, data: searchMemoryData } = useMemorySearch({
@@ -17338,6 +17050,14 @@ function AgentMemory({ agentId, threadId }) {
17338
17050
  // In playground, agentId is the resourceId
17339
17051
  threadId
17340
17052
  });
17053
+ const { mutateAsync: cloneThread, isPending: isCloning } = useCloneThread();
17054
+ const handleCloneThread = useCallback(async () => {
17055
+ if (!threadId || !agentId) return;
17056
+ const result = await cloneThread({ threadId, agentId });
17057
+ if (result?.thread?.id) {
17058
+ navigate(paths.agentThreadLink(agentId, result.thread.id));
17059
+ }
17060
+ }, [threadId, agentId, cloneThread, navigate, paths]);
17341
17061
  const handleResultClick = useCallback(
17342
17062
  (messageId, resultThreadId) => {
17343
17063
  if (resultThreadId && resultThreadId !== threadId) {
@@ -17356,7 +17076,24 @@ function AgentMemory({ agentId, threadId }) {
17356
17076
  [agentId, threadId, navigate]
17357
17077
  );
17358
17078
  const searchScope = searchMemoryData?.searchScope;
17079
+ if (isConfigLoading) {
17080
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full p-4 gap-4", children: [
17081
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
17082
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" }),
17083
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full" })
17084
+ ] });
17085
+ }
17359
17086
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
17087
+ threadId && /* @__PURE__ */ jsx("div", { className: "p-4 border-b border-border1", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
17088
+ /* @__PURE__ */ jsxs("div", { children: [
17089
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-icon5", children: "Clone Thread" }),
17090
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-icon3 mt-1", children: "Create a copy of this conversation" })
17091
+ ] }),
17092
+ /* @__PURE__ */ jsxs(Button, { onClick: handleCloneThread, disabled: isCloning, children: [
17093
+ /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4 mr-2" }),
17094
+ isCloning ? "Cloning..." : "Clone"
17095
+ ] })
17096
+ ] }) }),
17360
17097
  /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-border1", children: [
17361
17098
  /* @__PURE__ */ jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
17362
17099
  /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-icon5", children: "Semantic Recall" }),
@@ -17406,21 +17143,21 @@ function AgentMemory({ agentId, threadId }) {
17406
17143
  }
17407
17144
 
17408
17145
  function AgentInformation({ agentId, threadId }) {
17409
- const { data: memory } = useMemory(agentId);
17410
- const hasMemory = Boolean(memory?.result);
17146
+ const { data: memory, isLoading: isMemoryLoading } = useMemory(agentId);
17147
+ const hasMemory = !isMemoryLoading && Boolean(memory?.result);
17411
17148
  return /* @__PURE__ */ jsxs(AgentInformationLayout, { agentId, children: [
17412
17149
  /* @__PURE__ */ jsx(AgentEntityHeader, { agentId }),
17413
17150
  /* @__PURE__ */ jsxs(AgentInformationTabLayout, { agentId, children: [
17414
- /* @__PURE__ */ jsxs(TabList$1, { children: [
17415
- /* @__PURE__ */ jsx(Tab$1, { value: "overview", children: "Overview" }),
17416
- /* @__PURE__ */ jsx(Tab$1, { value: "model-settings", children: "Model Settings" }),
17417
- hasMemory && /* @__PURE__ */ jsx(Tab$1, { value: "memory", children: "Memory" }),
17418
- /* @__PURE__ */ jsx(Tab$1, { value: "tracing-options", children: "Tracing Options" })
17151
+ /* @__PURE__ */ jsxs(TabList, { children: [
17152
+ /* @__PURE__ */ jsx(Tab, { value: "overview", children: "Overview" }),
17153
+ /* @__PURE__ */ jsx(Tab, { value: "model-settings", children: "Model Settings" }),
17154
+ hasMemory && /* @__PURE__ */ jsx(Tab, { value: "memory", children: "Memory" }),
17155
+ /* @__PURE__ */ jsx(Tab, { value: "tracing-options", children: "Tracing Options" })
17419
17156
  ] }),
17420
- /* @__PURE__ */ jsx(TabContent$1, { value: "overview", children: /* @__PURE__ */ jsx(AgentMetadata, { agentId }) }),
17421
- /* @__PURE__ */ jsx(TabContent$1, { value: "model-settings", children: /* @__PURE__ */ jsx(AgentSettings, { agentId }) }),
17422
- hasMemory && /* @__PURE__ */ jsx(TabContent$1, { value: "memory", children: /* @__PURE__ */ jsx(AgentMemory, { agentId, threadId }) }),
17423
- /* @__PURE__ */ jsx(TabContent$1, { value: "tracing-options", children: /* @__PURE__ */ jsx(TracingRunOptions, {}) })
17157
+ /* @__PURE__ */ jsx(TabContent, { value: "overview", children: /* @__PURE__ */ jsx(AgentMetadata, { agentId }) }),
17158
+ /* @__PURE__ */ jsx(TabContent, { value: "model-settings", children: /* @__PURE__ */ jsx(AgentSettings, { agentId }) }),
17159
+ hasMemory && /* @__PURE__ */ jsx(TabContent, { value: "memory", children: /* @__PURE__ */ jsx(AgentMemory, { agentId, threadId }) }),
17160
+ /* @__PURE__ */ jsx(TabContent, { value: "tracing-options", children: /* @__PURE__ */ jsx(TracingRunOptions, {}) })
17424
17161
  ] })
17425
17162
  ] });
17426
17163
  }
@@ -17474,7 +17211,7 @@ const AgentInformationTabLayout = ({ children, agentId }) => {
17474
17211
  isMemoryLoading,
17475
17212
  hasMemory
17476
17213
  });
17477
- return /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden border-t-sm border-border1 flex flex-col", children: /* @__PURE__ */ jsx(PlaygroundTabs, { defaultTab: "overview", value: selectedTab, onValueChange: handleTabChange, children }) });
17214
+ return /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden border-t-sm border-border1 flex flex-col", children: /* @__PURE__ */ jsx(Tabs, { defaultTab: "overview", value: selectedTab, onValueChange: handleTabChange, children }) });
17478
17215
  };
17479
17216
 
17480
17217
  const AgentLayout = ({ agentId, children, leftSlot, rightSlot }) => {
@@ -17636,7 +17373,7 @@ const EmptyToolsTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-fu
17636
17373
  titleSlot: "Configure Tools",
17637
17374
  descriptionSlot: "Mastra tools are not configured yet. You can find more information in the documentation.",
17638
17375
  actionSlot: /* @__PURE__ */ jsxs(
17639
- Button$1,
17376
+ Button,
17640
17377
  {
17641
17378
  size: "lg",
17642
17379
  className: "w-full",
@@ -17728,7 +17465,13 @@ const ToolPanel = ({ toolId }) => {
17728
17465
  });
17729
17466
  };
17730
17467
  const zodInputSchema = tool?.inputSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(tool?.inputSchema))) : z.object({});
17731
- if (isLoading || error) return null;
17468
+ if (isLoading) {
17469
+ return /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
17470
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48 mb-4" }),
17471
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" })
17472
+ ] });
17473
+ }
17474
+ if (error) return null;
17732
17475
  if (!tool)
17733
17476
  return /* @__PURE__ */ jsx("div", { className: "py-12 text-center px-6", children: /* @__PURE__ */ jsx(Txt, { variant: "header-md", className: "text-icon3", children: "Tool not found" }) });
17734
17477
  return /* @__PURE__ */ jsx(
@@ -17804,8 +17547,7 @@ function ToolCombobox({
17804
17547
  searchPlaceholder,
17805
17548
  emptyText,
17806
17549
  className,
17807
- disabled: disabled || isLoadingTools || isLoadingAgents || isErrorTools || isErrorAgents,
17808
- variant: "ghost"
17550
+ disabled: disabled || isLoadingTools || isLoadingAgents || isErrorTools || isErrorAgents
17809
17551
  }
17810
17552
  );
17811
17553
  }
@@ -18093,6 +17835,7 @@ function TemplateForm({
18093
17835
  handleInstallTemplate,
18094
17836
  handleVariableChange,
18095
17837
  isLoadingEnvVars,
17838
+ isInstalling,
18096
17839
  defaultModelProvider,
18097
17840
  defaultModelId,
18098
17841
  onModelUpdate
@@ -18180,7 +17923,7 @@ function TemplateForm({
18180
17923
  )
18181
17924
  ] })
18182
17925
  ] }),
18183
- selectedProvider && !isLoadingEnvVars && /* @__PURE__ */ jsxs(
17926
+ selectedProvider && !isLoadingEnvVars && /* @__PURE__ */ jsx(
18184
17927
  Button,
18185
17928
  {
18186
17929
  className: cn(
@@ -18188,11 +17931,14 @@ function TemplateForm({
18188
17931
  "[&>svg]:w-[1.1em] [&_svg]:h-[1.1em] [&_svg]:text-icon5"
18189
17932
  ),
18190
17933
  onClick: handleInstallTemplate,
18191
- disabled: !selectedProvider || !defaultModelProvider || !defaultModelId || errors.length > 0,
18192
- children: [
17934
+ disabled: !selectedProvider || !defaultModelProvider || !defaultModelId || errors.length > 0 || isInstalling,
17935
+ children: isInstalling ? /* @__PURE__ */ jsxs(Fragment, { children: [
17936
+ /* @__PURE__ */ jsx(Spinner, { className: "w-4 h-4" }),
17937
+ " Installing..."
17938
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
18193
17939
  "Install ",
18194
17940
  /* @__PURE__ */ jsx(ArrowRightIcon, {})
18195
- ]
17941
+ ] })
18196
17942
  }
18197
17943
  )
18198
17944
  ] }) });
@@ -19003,6 +18749,21 @@ function TraceTimeline({
19003
18749
  ) });
19004
18750
  }
19005
18751
 
18752
+ const CombinedButtons = ({ className, children }) => {
18753
+ return /* @__PURE__ */ jsx(
18754
+ "div",
18755
+ {
18756
+ className: cn(
18757
+ "flex items-center text-[0.75rem] border border-border1 rounded-lg overflow-hidden",
18758
+ "[&>button]:border-0 [&>button:not(:first-child)]:border-l [&>button:not(:first-child)]:border-border1",
18759
+ "[&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg",
18760
+ className
18761
+ ),
18762
+ children
18763
+ }
18764
+ );
18765
+ };
18766
+
19006
18767
  function TraceTimelineTools({
19007
18768
  spans = [],
19008
18769
  fadedTypes,
@@ -19050,10 +18811,10 @@ function TraceTimelineTools({
19050
18811
  Button,
19051
18812
  {
19052
18813
  onClick: () => handleToggle(item),
19053
- isFaded,
18814
+ className: isFaded ? "opacity-40" : "",
19054
18815
  style: { color: !isFaded ? spanUI?.color : void 0, backgroundColor: spanUI?.bgColor },
19055
18816
  children: [
19056
- spanUI?.icon && spanUI.icon,
18817
+ spanUI?.icon && /* @__PURE__ */ jsx(Icon, { children: spanUI.icon }),
19057
18818
  spanUI?.label
19058
18819
  ]
19059
18820
  }
@@ -19063,15 +18824,15 @@ function TraceTimelineTools({
19063
18824
  Button,
19064
18825
  {
19065
18826
  onClick: () => handleToggle("other"),
19066
- isFaded: fadedTypes?.includes("other"),
18827
+ className: fadedTypes?.includes("other") ? "opacity-40" : "",
19067
18828
  style: { color: !fadedTypes?.includes("other") ? void 0 : void 0, backgroundColor: void 0 },
19068
18829
  children: [
19069
- /* @__PURE__ */ jsx(CircleDashedIcon, {}),
18830
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(CircleDashedIcon, {}) }),
19070
18831
  "Other"
19071
18832
  ]
19072
18833
  }
19073
18834
  ),
19074
- /* @__PURE__ */ jsx(Button, { onClick: onLegendReset, disabled: fadedTypes?.length === 0, children: /* @__PURE__ */ jsx(XIcon, {}) })
18835
+ /* @__PURE__ */ jsx(Button, { onClick: onLegendReset, disabled: fadedTypes?.length === 0, children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(XIcon, {}) }) })
19075
18836
  ] })
19076
18837
  ] });
19077
18838
  }
@@ -19161,82 +18922,6 @@ function getSpanInfo({ span }) {
19161
18922
  return baseInfo;
19162
18923
  }
19163
18924
 
19164
- const TabsRoot = ({
19165
- children,
19166
- defaultTab,
19167
- value,
19168
- onValueChange,
19169
- className
19170
- }) => {
19171
- const [internalTab, setInternalTab] = useState(defaultTab);
19172
- const isControlled = value !== void 0 && onValueChange !== void 0;
19173
- const currentTab = isControlled ? value : internalTab;
19174
- const handleTabChange = (newValue) => {
19175
- const typedValue = newValue;
19176
- if (isControlled) {
19177
- onValueChange(typedValue);
19178
- } else {
19179
- setInternalTab(typedValue);
19180
- }
19181
- };
19182
- return /* @__PURE__ */ jsx(
19183
- TabsPrimitive.Root,
19184
- {
19185
- value: currentTab,
19186
- onValueChange: handleTabChange,
19187
- className: cn("grid gap-8 overflow-y-auto", className),
19188
- children
19189
- }
19190
- );
19191
- };
19192
-
19193
- const TabList = ({ children, variant = "default", className }) => {
19194
- return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-x-auto", className), children: /* @__PURE__ */ jsx(
19195
- TabsPrimitive.List,
19196
- {
19197
- className: cn(
19198
- "flex items-center",
19199
- {
19200
- // variant: default
19201
- "text-[0.9375rem]": variant === "default",
19202
- "[&>button]:py-[0.5rem] [&>button]:px-[1.5rem] [&>button]:font-normal [&>button]:text-icon3 [&>button]:flex-1 [&>button]:border-b [&>button]:border-border1": variant === "default",
19203
- "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:transition-colors [&>button[data-state=active]]:duration-200 [&>button[data-state=active]]:border-icon3": variant === "default",
19204
- // variant: buttons
19205
- "border border-border1 flex justify-stretch rounded-md overflow-hidden text-[0.875rem] min-h-[2.5rem]": variant === "buttons",
19206
- "[&>button]:flex-1 [&>button]:py-[0.5rem] [&>button]:px-[1rem] [&>button]:text-icon3": variant === "buttons",
19207
- "[&>button[data-state=active]]:text-icon5 [&>button[data-state=active]]:bg-[#222]": variant === "buttons"
19208
- },
19209
- className
19210
- ),
19211
- children
19212
- }
19213
- ) });
19214
- };
19215
-
19216
- const Tab = ({ children, value, onClick, className }) => {
19217
- return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { value, className: cn("hover:text-icon5", className), onClick, children });
19218
- };
19219
-
19220
- const TabContent = ({ children, value, className }) => {
19221
- return /* @__PURE__ */ jsx(
19222
- TabsPrimitive.Content,
19223
- {
19224
- value,
19225
- className: cn(
19226
- "grid overflow-y-auto ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:none",
19227
- className
19228
- ),
19229
- children
19230
- }
19231
- );
19232
- };
19233
-
19234
- const Tabs = Object.assign(TabsRoot, {
19235
- List: TabList,
19236
- Tab,
19237
- Content: TabContent
19238
- });
19239
-
19240
18925
  function isTokenDetailsObject(value) {
19241
18926
  return typeof value === "object" && value !== null;
19242
18927
  }
@@ -19539,19 +19224,19 @@ function SpanTabs({
19539
19224
  entityType = "Workflow";
19540
19225
  }
19541
19226
  return /* @__PURE__ */ jsxs(Tabs, { defaultTab: defaultActiveTab, children: [
19542
- /* @__PURE__ */ jsxs(Tabs.List, { children: [
19543
- /* @__PURE__ */ jsx(Tabs.Tab, { value: "details", children: "Details" }),
19544
- /* @__PURE__ */ jsxs(Tabs.Tab, { value: "scores", children: [
19227
+ /* @__PURE__ */ jsxs(TabList, { children: [
19228
+ /* @__PURE__ */ jsx(Tab, { value: "details", children: "Details" }),
19229
+ /* @__PURE__ */ jsxs(Tab, { value: "scores", children: [
19545
19230
  "Scoring ",
19546
19231
  spanScoresData?.pagination && `(${spanScoresData.pagination.total || 0})`
19547
19232
  ] })
19548
19233
  ] }),
19549
- /* @__PURE__ */ jsx(Tabs.Content, { value: "details", children: /* @__PURE__ */ jsxs(Sections, { children: [
19234
+ /* @__PURE__ */ jsx(TabContent, { value: "details", children: /* @__PURE__ */ jsxs(Sections, { children: [
19550
19235
  span?.attributes?.usage ? /* @__PURE__ */ jsx(TraceSpanUsage, { spanUsage: span.attributes.usage }) : null,
19551
19236
  /* @__PURE__ */ jsx(KeyValueList, { data: spanInfo, LinkComponent: Link }),
19552
19237
  /* @__PURE__ */ jsx(SpanDetails, { span })
19553
19238
  ] }) }),
19554
- /* @__PURE__ */ jsx(Tabs.Content, { value: "scores", children: /* @__PURE__ */ jsxs(Sections, { children: [
19239
+ /* @__PURE__ */ jsx(TabContent, { value: "scores", children: /* @__PURE__ */ jsxs(Sections, { children: [
19555
19240
  /* @__PURE__ */ jsxs(Section, { children: [
19556
19241
  /* @__PURE__ */ jsx(Section.Header, { children: /* @__PURE__ */ jsxs(Section.Heading, { children: [
19557
19242
  /* @__PURE__ */ jsx(CircleGaugeIcon, {}),
@@ -19865,9 +19550,8 @@ function TraceDialog({
19865
19550
  ] }) }),
19866
19551
  /* @__PURE__ */ jsxs(ButtonsGroup, { className: "w-full", children: [
19867
19552
  /* @__PURE__ */ jsxs(Button, { onClick: handleToScoring, children: [
19868
- "Scoring ",
19869
- /* @__PURE__ */ jsx(CircleGaugeIcon, {}),
19870
- " "
19553
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(CircleGaugeIcon, {}) }),
19554
+ "Scoring"
19871
19555
  ] }),
19872
19556
  spanScoresData?.scores?.[0] && /* @__PURE__ */ jsxs(Button, { onClick: handleToLastScore, children: [
19873
19557
  "Last score: ",
@@ -20014,7 +19698,7 @@ function TracesTools({
20014
19698
  disabled: isLoading
20015
19699
  }
20016
19700
  ),
20017
- /* @__PURE__ */ jsxs("div", { className: cn("flex gap-[1rem] items-center flex-wrap mr-auto"), children: [
19701
+ /* @__PURE__ */ jsxs("div", { className: cn("flex gap-[1rem] items-center flex-wrap"), children: [
20018
19702
  /* @__PURE__ */ jsx("span", { className: cn("shrink-0 text-[0.875rem] text-icon3"), children: "Filter by Date & time range" }),
20019
19703
  /* @__PURE__ */ jsx(
20020
19704
  DateTimePicker,
@@ -20023,7 +19707,7 @@ function TracesTools({
20023
19707
  value: selectedDateFrom,
20024
19708
  maxValue: selectedDateTo,
20025
19709
  onValueChange: (date) => onDateChange?.(date, "from"),
20026
- className: "min-w-[13rem]",
19710
+ className: "min-w-32",
20027
19711
  defaultTimeStrValue: "12:00 AM",
20028
19712
  disabled: isLoading
20029
19713
  }
@@ -20035,15 +19719,15 @@ function TracesTools({
20035
19719
  value: selectedDateTo,
20036
19720
  minValue: selectedDateFrom,
20037
19721
  onValueChange: (date) => onDateChange?.(date, "to"),
20038
- className: "min-w-[13rem]",
19722
+ className: "min-w-32",
20039
19723
  defaultTimeStrValue: "11:59 PM",
20040
19724
  disabled: isLoading
20041
19725
  }
20042
- )
20043
- ] }),
20044
- /* @__PURE__ */ jsxs(Button, { variant: "primary", onClick: onReset, disabled: isLoading, children: [
20045
- "Reset ",
20046
- /* @__PURE__ */ jsx(XIcon, {})
19726
+ ),
19727
+ /* @__PURE__ */ jsxs(Button, { variant: "light", size: "lg", className: "min-w-32", onClick: onReset, disabled: isLoading, children: [
19728
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(XIcon, {}) }),
19729
+ "Reset"
19730
+ ] })
20047
19731
  ] })
20048
19732
  ] });
20049
19733
  }
@@ -20642,7 +20326,7 @@ const EmptyMCPTable = () => /* @__PURE__ */ jsx("div", { className: "flex h-full
20642
20326
  titleSlot: "Configure MCP servers",
20643
20327
  descriptionSlot: "MCP servers are not configured yet. You can find more information in the documentation.",
20644
20328
  actionSlot: /* @__PURE__ */ jsxs(
20645
- Button$1,
20329
+ Button,
20646
20330
  {
20647
20331
  size: "lg",
20648
20332
  className: "w-full",
@@ -20706,7 +20390,13 @@ const MCPToolPanel = ({ toolId, serverId }) => {
20706
20390
  if (!tool) return;
20707
20391
  return await executeTool(data);
20708
20392
  };
20709
- if (isLoading || error) return null;
20393
+ if (isLoading) {
20394
+ return /* @__PURE__ */ jsxs("div", { className: "p-6", children: [
20395
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48 mb-4" }),
20396
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full" })
20397
+ ] });
20398
+ }
20399
+ if (error) return null;
20710
20400
  if (!tool)
20711
20401
  return /* @__PURE__ */ jsx("div", { className: "py-12 text-center px-6", children: /* @__PURE__ */ jsx(Txt, { variant: "header-md", className: "text-icon3", children: "Tool not found" }) });
20712
20402
  let zodInputSchema;
@@ -20856,8 +20546,7 @@ function MCPServerCombobox({
20856
20546
  searchPlaceholder,
20857
20547
  emptyText,
20858
20548
  className,
20859
- disabled: disabled || isLoading || isError,
20860
- variant: "ghost"
20549
+ disabled: disabled || isLoading || isError
20861
20550
  }
20862
20551
  );
20863
20552
  }
@@ -20890,13 +20579,16 @@ const useStudioConfig = () => {
20890
20579
  };
20891
20580
  const LOCAL_STORAGE_KEY = "mastra-studio-config";
20892
20581
  const StudioConfigProvider = ({ children, endpoint = "http://localhost:4111" }) => {
20893
- const { data: instanceStatus } = useMastraInstanceStatus(endpoint);
20582
+ const { data: instanceStatus, isLoading: isStatusLoading, error } = useMastraInstanceStatus(endpoint);
20894
20583
  const [config, setConfig] = useState({
20895
20584
  baseUrl: "",
20896
20585
  headers: {},
20897
20586
  isLoading: true
20898
20587
  });
20899
20588
  useLayoutEffect(() => {
20589
+ if (error && !isStatusLoading) {
20590
+ return setConfig({ baseUrl: "", headers: {}, isLoading: false });
20591
+ }
20900
20592
  if (!instanceStatus?.status) return;
20901
20593
  const storedConfig = localStorage.getItem(LOCAL_STORAGE_KEY);
20902
20594
  if (storedConfig) {
@@ -20909,7 +20601,7 @@ const StudioConfigProvider = ({ children, endpoint = "http://localhost:4111" })
20909
20601
  return setConfig((prev) => ({ ...prev, baseUrl: endpoint, isLoading: false }));
20910
20602
  }
20911
20603
  return setConfig({ baseUrl: "", headers: {}, isLoading: false });
20912
- }, [instanceStatus, endpoint]);
20604
+ }, [instanceStatus, endpoint, isStatusLoading, error]);
20913
20605
  const doSetConfig = (partialNewConfig) => {
20914
20606
  setConfig((prev) => {
20915
20607
  const nextConfig = { ...prev, ...partialNewConfig };
@@ -20926,7 +20618,7 @@ const HeaderListForm = ({ headers, onAddHeader, onRemoveHeader }) => {
20926
20618
  /* @__PURE__ */ jsxs("div", { className: "bg-surface4 rounded-lg p-4 border-sm border-border2 space-y-4", children: [
20927
20619
  headers.length > 0 && /* @__PURE__ */ jsx("ul", { className: "space-y-4", children: headers.map((header, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(HeaderListFormItem, { index, header, onRemove: () => onRemoveHeader(index) }) }, index)) }),
20928
20620
  /* @__PURE__ */ jsxs(
20929
- Button$1,
20621
+ Button,
20930
20622
  {
20931
20623
  type: "button",
20932
20624
  variant: "light",
@@ -20969,7 +20661,7 @@ const HeaderListFormItem = ({ index, header, onRemove }) => {
20969
20661
  }
20970
20662
  ),
20971
20663
  /* @__PURE__ */ jsx(
20972
- Button$1,
20664
+ Button,
20973
20665
  {
20974
20666
  type: "button",
20975
20667
  variant: "light",
@@ -21019,7 +20711,7 @@ const StudioConfigForm = ({ initialConfig }) => {
21019
20711
  }
21020
20712
  ),
21021
20713
  /* @__PURE__ */ jsx(HeaderListForm, { headers, onAddHeader: handleAddHeader, onRemoveHeader: handleRemoveHeader }),
21022
- /* @__PURE__ */ jsxs(Button$1, { type: "submit", variant: "light", className: "w-full", size: "lg", children: [
20714
+ /* @__PURE__ */ jsxs(Button, { type: "submit", variant: "light", className: "w-full", size: "lg", children: [
21023
20715
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Link2, {}) }),
21024
20716
  "Set Configuration"
21025
20717
  ] })
@@ -21319,5 +21011,5 @@ const PlaygroundConfigGuard = () => {
21319
21011
  ] }) });
21320
21012
  };
21321
21013
 
21322
- export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert$1 as Alert, AlertDescription$1 as AlertDescription, AlertDialog, AlertTitle$1 as AlertTitle, ApiIcon, Badge, BranchIcon, Breadcrumb, Button$1 as Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, ChevronIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, CommitIcon, CrossIcon, Crumb, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, InputField, JudgeIcon, Kbd, KeyValueList, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, Notification, OpenAIIcon, PageHeader, PlaygroundConfigGuard, PlaygroundQueryClient, PlaygroundTabs, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, SearchField, Searchbar, SearchbarWrapper, Section, Sections, SelectField, SettingsIcon, SideDialog, Skeleton, SlashIcon, SpanScoreList, SpanScoring, SpanTabs, StudioConfigContext, StudioConfigForm, StudioConfigProvider, Tab$1 as Tab, TabContent$1 as TabContent, TabList$1 as TabList, Table, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracingSettingsContext, TracingSettingsProvider, TsIcon, Txt, TxtCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, convertWorkflowRunStateToStreamResult, extractPrompt, formatHierarchicalSpans, getColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getToNextEntryFn, getToPreviousEntryFn, parseError, providerMapToIcon, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentInformationSettings, useAgentInformationTab, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCurrentRun, useDeleteThread, useDeleteWorkflowRun, useExecuteAgentTool, useExecuteMCPTool, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMastraPackages, useMemory, useMemoryConfig, useMemorySearch, usePackageUpdates, usePlaygroundStore, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useStudioConfig, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useTracingSettings, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRunExecutionResult, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory };
21014
+ export { AgentChat, AgentCoinIcon, AgentCombobox, AgentEntityHeader, AgentIcon, AgentInformation, AgentInformationLayout, AgentInformationTabLayout, AgentLayout, AgentMemory, AgentMetadata, AgentMetadataList, AgentMetadataListEmpty, AgentMetadataListItem, AgentMetadataNetworkList, AgentMetadataScorerList, AgentMetadataSection, AgentMetadataToolList, AgentMetadataWorkflowList, AgentMetadataWrapper, AgentNetworkCoinIcon, AgentPromptExperimentProvider, AgentSettings, AgentSettingsContext, AgentSettingsProvider, AgentToolPanel, AgentsTable, AiIcon, Alert$1 as Alert, AlertDescription$1 as AlertDescription, AlertDialog, AlertTitle$1 as AlertTitle, ApiIcon, Badge, BranchIcon, Breadcrumb, Button, ButtonsGroup, Cell, ChatThreads, CheckIcon, ChevronIcon, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, CommitIcon, CrossIcon, Crumb, DateTimeCell, DateTimePicker, DateTimePickerContent, DbIcon, DebugIcon, DefaultTrigger, DeploymentIcon, DividerIcon, DocsIcon, DynamicForm, EmptyState, Entity, EntityContent, EntityDescription, EntityHeader, EntityIcon, EntityName, Entry, EntryCell, EntryList, EntryListSkeleton, EnvIcon, FiltersIcon, FolderIcon, GithubCoinIcon, GithubIcon, GoogleIcon, Header, HeaderAction, HeaderGroup, HeaderTitle, HomeIcon, Icon, InfoIcon, InputField, JudgeIcon, Kbd, KeyValueList, LatencyIcon, LinkComponentProvider, LogoWithoutText, LogsIcon, MCPDetail, MCPServerCombobox, MCPTable, MCPToolPanel, MainContentContent, MainContentLayout, MainSidebar, MainSidebarProvider, MastraPackagesInfo, MastraVersionFooter, McpCoinIcon, McpServerIcon, MemoryIcon, MemorySearch, Notification, OpenAIIcon, PageHeader, PlaygroundConfigGuard, PlaygroundQueryClient, PromptIcon, RadioGroup, RadioGroupItem, RepoIcon, RequestContext, RequestContextWrapper, Row, ScoreDialog, ScorerCombobox, ScorersTable, ScoresList, ScoresTools, SearchField, Searchbar, SearchbarWrapper, Section, Sections, SelectField, SettingsIcon, SideDialog, Skeleton, SlashIcon, SpanScoreList, SpanScoring, SpanTabs, StudioConfigContext, StudioConfigForm, StudioConfigProvider, Table, Tbody, TemplateFailure, TemplateForm, TemplateInfo, TemplateInstallation, TemplateSuccess, TemplatesList, TemplatesTools, TextAndIcon, Th, Thead, ThreadDeleteButton, ThreadInputProvider, ThreadItem, ThreadLink, ThreadList, Threads, ToolCoinIcon, ToolCombobox, ToolFallback, ToolIconMap, ToolInformation, ToolPanel, ToolTable, ToolsIcon, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TraceDialog, TraceIcon, TraceTimeline, TraceTimelineSpan, TraceTimelineTools, TracesList, TracesTools, TracingSettingsContext, TracingSettingsProvider, TsIcon, Txt, TxtCell, VariablesIcon, WorkflowCoinIcon, WorkflowCombobox, WorkflowGraph, WorkflowIcon, WorkflowInformation, WorkflowLayout, WorkflowRunContext, WorkflowRunDetail, WorkflowRunList, WorkflowRunProvider, WorkflowStepDetailContext, WorkflowStepDetailProvider, WorkflowTable, WorkflowTrigger, WorkingMemoryContext, WorkingMemoryProvider, buttonVariants, convertWorkflowRunStateToStreamResult, extractPrompt, formatHierarchicalSpans, getColumnTemplate, getMainContentContentClassName, getShortId, getSpanTypeUi, getToNextEntryFn, getToPreviousEntryFn, parseError, providerMapToIcon, scoresListColumns, spanTypePrefixes, toast, traceScoresListColumns, tracesListColumns, useAgent, useAgentInformationSettings, useAgentInformationTab, useAgentPromptExperiment, useAgentSettings, useAgents, useCancelWorkflowRun, useCloneThread, useCurrentRun, useDeleteThread, useDeleteWorkflowRun, useExecuteAgentTool, useExecuteMCPTool, useExecuteTool, useExecuteWorkflow, useInView, useLinkComponent, useMCPServerTool, useMCPServerTools, useMCPServers, useMainSidebar, useMastraPackages, useMemory, useMemoryConfig, useMemorySearch, usePackageUpdates, usePlaygroundStore, useReorderModelList, useResetAgentModel, useScorer, useScorers, useScoresByScorerId, useSpeechRecognition, useStreamWorkflow, useStudioConfig, useThreadInput, useThreads, useTool, useTools, useTraceSpanScores, useTracingSettings, useUpdateAgentModel, useUpdateModelInModelList, useWorkflow, useWorkflowRun, useWorkflowRuns, useWorkflowStepDetail, useWorkflows, useWorkingMemory };
21323
21015
  //# sourceMappingURL=index.es.js.map