@mastra/playground-ui 5.1.3 → 5.1.4-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { createContext, useContext, forwardRef, useState, useEffect, memo, useMemo, useRef, useCallback, Suspense, Fragment as Fragment$1 } from 'react';
3
+ import React__default, { createContext, useContext, forwardRef, useState, useEffect, memo, useRef, useCallback, useMemo, Suspense, Fragment as Fragment$1, useId } from 'react';
4
4
  import { MastraClient } from '@mastra/client-js';
5
5
  import { useMessage, MessagePrimitive, ActionBarPrimitive, useComposerRuntime, ComposerPrimitive, useAttachment, AttachmentPrimitive, ThreadPrimitive, useExternalStoreRuntime, CompositeAttachmentAdapter, SimpleImageAttachmentAdapter, SimpleTextAttachmentAdapter, AssistantRuntimeProvider } from '@assistant-ui/react';
6
- import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, X, FileText, FileIcon, CircleXIcon, Mic, PlusIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, Check, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Network, PauseIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon, Plus, Minus, Maximize, CirclePause } from 'lucide-react';
6
+ import { CheckIcon as CheckIcon$1, CopyIcon, Check, Copy, ChevronUpIcon, X, FileText, FileIcon, CircleXIcon, Mic, PlusIcon, ArrowUp, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Network, PauseIcon, Loader2, CircleDashed, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, Braces, Brackets, TrashIcon, Plus, Minus, Maximize } from 'lucide-react';
7
7
  import { Slot } from '@radix-ui/react-slot';
8
8
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
9
9
  import { TooltipProvider as TooltipProvider$1 } from '@radix-ui/react-tooltip';
@@ -17,6 +17,7 @@ import { jsonLanguage } from '@codemirror/lang-json';
17
17
  import { tags } from '@lezer/highlight';
18
18
  import { draculaInit } from '@uiw/codemirror-theme-dracula';
19
19
  import CodeMirror from '@uiw/react-codemirror';
20
+ import { toast } from 'sonner';
20
21
  import * as DialogPrimitive from '@radix-ui/react-dialog';
21
22
  import { useShallow } from 'zustand/shallow';
22
23
  import { RuntimeContext } from '@mastra/core/di';
@@ -24,7 +25,6 @@ import { create } from 'zustand';
24
25
  import { persist } from 'zustand/middleware';
25
26
  import { format, formatDistanceToNow, isValid, formatDate } from 'date-fns';
26
27
  import * as TabsPrimitive from '@radix-ui/react-tabs';
27
- import { toast } from 'sonner';
28
28
  import { AnimatePresence } from 'motion/react';
29
29
  import { C as Colors } from './colors-CBG_Mm7P.js';
30
30
  import { processDataStream } from '@ai-sdk/ui-utils';
@@ -539,8 +539,8 @@ const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
539
539
  const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
540
540
  const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
541
541
  const isFraction = value => fractionRegex.test(value);
542
- const isNumber = value => Boolean(value) && !Number.isNaN(Number(value));
543
- const isInteger = value => Boolean(value) && Number.isInteger(Number(value));
542
+ const isNumber = value => !!value && !Number.isNaN(Number(value));
543
+ const isInteger = value => !!value && Number.isInteger(Number(value));
544
544
  const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));
545
545
  const isTshirtSize = value => tshirtUnitRegex.test(value);
546
546
  const isAny = () => true;
@@ -559,7 +559,7 @@ const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isL
559
559
  const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
560
560
  const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
561
561
  const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
562
- const isArbitraryShadow = value => getIsArbitraryValue(value, isNever, isShadow);
562
+ const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
563
563
  const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
564
564
  const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
565
565
  const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
@@ -589,11 +589,9 @@ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) =>
589
589
  return false;
590
590
  };
591
591
  // Labels
592
- const isLabelPosition = label => label === 'position';
593
- const imageLabels = /*#__PURE__*/new Set(['image', 'url']);
594
- const isLabelImage = label => imageLabels.has(label);
595
- const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);
596
- const isLabelSize = label => sizeLabels.has(label);
592
+ const isLabelPosition = label => label === 'position' || label === 'percentage';
593
+ const isLabelImage = label => label === 'image' || label === 'url';
594
+ const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';
597
595
  const isLabelLength = label => label === 'length';
598
596
  const isLabelNumber = label => label === 'number';
599
597
  const isLabelFamilyName = label => label === 'family-name';
@@ -616,6 +614,7 @@ const getDefaultConfig = () => {
616
614
  const themeRadius = fromTheme('radius');
617
615
  const themeShadow = fromTheme('shadow');
618
616
  const themeInsetShadow = fromTheme('inset-shadow');
617
+ const themeTextShadow = fromTheme('text-shadow');
619
618
  const themeDropShadow = fromTheme('drop-shadow');
620
619
  const themeBlur = fromTheme('blur');
621
620
  const themePerspective = fromTheme('perspective');
@@ -630,7 +629,16 @@ const getDefaultConfig = () => {
630
629
  */
631
630
  /***/
632
631
  const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
633
- const scalePosition = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];
632
+ const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',
633
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
634
+ 'left-top', 'top-right',
635
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
636
+ 'right-top', 'bottom-right',
637
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
638
+ 'right-bottom', 'bottom-left',
639
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
640
+ 'left-bottom'];
641
+ const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
634
642
  const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
635
643
  const scaleOverscroll = () => ['auto', 'contain', 'none'];
636
644
  const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
@@ -638,25 +646,34 @@ const getDefaultConfig = () => {
638
646
  const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];
639
647
  const scaleGridColRowStartAndEnd = () => ['auto', {
640
648
  span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]
641
- }, isArbitraryVariable, isArbitraryValue];
649
+ }, isInteger, isArbitraryVariable, isArbitraryValue];
642
650
  const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];
643
651
  const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];
644
- const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline'];
645
- const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch'];
652
+ const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];
653
+ const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
646
654
  const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
647
655
  const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
648
656
  const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
649
- const scaleGradientStopPosition = () => [isPercent, isArbitraryLength];
657
+ const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
658
+ position: [isArbitraryVariable, isArbitraryValue]
659
+ }];
660
+ const scaleBgRepeat = () => ['no-repeat', {
661
+ repeat: ['', 'x', 'y', 'space', 'round']
662
+ }];
663
+ const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {
664
+ size: [isArbitraryVariable, isArbitraryValue]
665
+ }];
666
+ const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
650
667
  const scaleRadius = () => [
651
668
  // Deprecated since Tailwind CSS v4.0.0
652
669
  '', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];
653
670
  const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
654
671
  const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
655
672
  const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
673
+ const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
656
674
  const scaleBlur = () => [
657
675
  // Deprecated since Tailwind CSS v4.0.0
658
676
  '', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
659
- const scaleOrigin = () => ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryVariable, isArbitraryValue];
660
677
  const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
661
678
  const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
662
679
  const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
@@ -681,6 +698,7 @@ const getDefaultConfig = () => {
681
698
  shadow: [isTshirtSize],
682
699
  spacing: ['px', isNumber],
683
700
  text: [isTshirtSize],
701
+ 'text-shadow': [isTshirtSize],
684
702
  tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']
685
703
  },
686
704
  classGroups: {
@@ -783,7 +801,7 @@ const getDefaultConfig = () => {
783
801
  * @see https://tailwindcss.com/docs/object-position
784
802
  */
785
803
  'object-position': [{
786
- object: [...scalePosition(), isArbitraryValue, isArbitraryVariable]
804
+ object: scalePositionWithArbitrary()
787
805
  }],
788
806
  /**
789
807
  * Overflow
@@ -1090,14 +1108,18 @@ const getDefaultConfig = () => {
1090
1108
  * @see https://tailwindcss.com/docs/align-items
1091
1109
  */
1092
1110
  'align-items': [{
1093
- items: [...scaleAlignSecondaryAxis(), 'baseline']
1111
+ items: [...scaleAlignSecondaryAxis(), {
1112
+ baseline: ['', 'last']
1113
+ }]
1094
1114
  }],
1095
1115
  /**
1096
1116
  * Align Self
1097
1117
  * @see https://tailwindcss.com/docs/align-self
1098
1118
  */
1099
1119
  'align-self': [{
1100
- self: ['auto', ...scaleAlignSecondaryAxis(), 'baseline']
1120
+ self: ['auto', ...scaleAlignSecondaryAxis(), {
1121
+ baseline: ['', 'last']
1122
+ }]
1101
1123
  }],
1102
1124
  /**
1103
1125
  * Place Content
@@ -1312,21 +1334,21 @@ const getDefaultConfig = () => {
1312
1334
  * @see https://tailwindcss.com/docs/height
1313
1335
  */
1314
1336
  h: [{
1315
- h: ['screen', ...scaleSizing()]
1337
+ h: ['screen', 'lh', ...scaleSizing()]
1316
1338
  }],
1317
1339
  /**
1318
1340
  * Min-Height
1319
1341
  * @see https://tailwindcss.com/docs/min-height
1320
1342
  */
1321
1343
  'min-h': [{
1322
- 'min-h': ['screen', 'none', ...scaleSizing()]
1344
+ 'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
1323
1345
  }],
1324
1346
  /**
1325
1347
  * Max-Height
1326
1348
  * @see https://tailwindcss.com/docs/max-height
1327
1349
  */
1328
1350
  'max-h': [{
1329
- 'max-h': ['screen', ...scaleSizing()]
1351
+ 'max-h': ['screen', 'lh', ...scaleSizing()]
1330
1352
  }],
1331
1353
  // ------------------
1332
1354
  // --- Typography ---
@@ -1542,6 +1564,13 @@ const getDefaultConfig = () => {
1542
1564
  break: [{
1543
1565
  break: ['normal', 'words', 'all', 'keep']
1544
1566
  }],
1567
+ /**
1568
+ * Overflow Wrap
1569
+ * @see https://tailwindcss.com/docs/overflow-wrap
1570
+ */
1571
+ wrap: [{
1572
+ wrap: ['break-word', 'anywhere', 'normal']
1573
+ }],
1545
1574
  /**
1546
1575
  * Hyphens
1547
1576
  * @see https://tailwindcss.com/docs/hyphens
@@ -1585,23 +1614,21 @@ const getDefaultConfig = () => {
1585
1614
  * @see https://tailwindcss.com/docs/background-position
1586
1615
  */
1587
1616
  'bg-position': [{
1588
- bg: [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition]
1617
+ bg: scaleBgPosition()
1589
1618
  }],
1590
1619
  /**
1591
1620
  * Background Repeat
1592
1621
  * @see https://tailwindcss.com/docs/background-repeat
1593
1622
  */
1594
1623
  'bg-repeat': [{
1595
- bg: ['no-repeat', {
1596
- repeat: ['', 'x', 'y', 'space', 'round']
1597
- }]
1624
+ bg: scaleBgRepeat()
1598
1625
  }],
1599
1626
  /**
1600
1627
  * Background Size
1601
1628
  * @see https://tailwindcss.com/docs/background-size
1602
1629
  */
1603
1630
  'bg-size': [{
1604
- bg: ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize]
1631
+ bg: scaleBgSize()
1605
1632
  }],
1606
1633
  /**
1607
1634
  * Background Image
@@ -1970,7 +1997,7 @@ const getDefaultConfig = () => {
1970
1997
  * @see https://tailwindcss.com/docs/outline-color
1971
1998
  */
1972
1999
  'outline-color': [{
1973
- outline: [themeColor]
2000
+ outline: scaleColor()
1974
2001
  }],
1975
2002
  // ---------------
1976
2003
  // --- Effects ---
@@ -1996,7 +2023,7 @@ const getDefaultConfig = () => {
1996
2023
  * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
1997
2024
  */
1998
2025
  'inset-shadow': [{
1999
- 'inset-shadow': ['none', isArbitraryVariable, isArbitraryValue, themeInsetShadow]
2026
+ 'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
2000
2027
  }],
2001
2028
  /**
2002
2029
  * Inset Box Shadow Color
@@ -2058,6 +2085,20 @@ const getDefaultConfig = () => {
2058
2085
  'inset-ring-color': [{
2059
2086
  'inset-ring': scaleColor()
2060
2087
  }],
2088
+ /**
2089
+ * Text Shadow
2090
+ * @see https://tailwindcss.com/docs/text-shadow
2091
+ */
2092
+ 'text-shadow': [{
2093
+ 'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
2094
+ }],
2095
+ /**
2096
+ * Text Shadow Color
2097
+ * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
2098
+ */
2099
+ 'text-shadow-color': [{
2100
+ 'text-shadow': scaleColor()
2101
+ }],
2061
2102
  /**
2062
2103
  * Opacity
2063
2104
  * @see https://tailwindcss.com/docs/opacity
@@ -2079,6 +2120,202 @@ const getDefaultConfig = () => {
2079
2120
  'bg-blend': [{
2080
2121
  'bg-blend': scaleBlendMode()
2081
2122
  }],
2123
+ /**
2124
+ * Mask Clip
2125
+ * @see https://tailwindcss.com/docs/mask-clip
2126
+ */
2127
+ 'mask-clip': [{
2128
+ 'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
2129
+ }, 'mask-no-clip'],
2130
+ /**
2131
+ * Mask Composite
2132
+ * @see https://tailwindcss.com/docs/mask-composite
2133
+ */
2134
+ 'mask-composite': [{
2135
+ mask: ['add', 'subtract', 'intersect', 'exclude']
2136
+ }],
2137
+ /**
2138
+ * Mask Image
2139
+ * @see https://tailwindcss.com/docs/mask-image
2140
+ */
2141
+ 'mask-image-linear-pos': [{
2142
+ 'mask-linear': [isNumber]
2143
+ }],
2144
+ 'mask-image-linear-from-pos': [{
2145
+ 'mask-linear-from': scaleMaskImagePosition()
2146
+ }],
2147
+ 'mask-image-linear-to-pos': [{
2148
+ 'mask-linear-to': scaleMaskImagePosition()
2149
+ }],
2150
+ 'mask-image-linear-from-color': [{
2151
+ 'mask-linear-from': scaleColor()
2152
+ }],
2153
+ 'mask-image-linear-to-color': [{
2154
+ 'mask-linear-to': scaleColor()
2155
+ }],
2156
+ 'mask-image-t-from-pos': [{
2157
+ 'mask-t-from': scaleMaskImagePosition()
2158
+ }],
2159
+ 'mask-image-t-to-pos': [{
2160
+ 'mask-t-to': scaleMaskImagePosition()
2161
+ }],
2162
+ 'mask-image-t-from-color': [{
2163
+ 'mask-t-from': scaleColor()
2164
+ }],
2165
+ 'mask-image-t-to-color': [{
2166
+ 'mask-t-to': scaleColor()
2167
+ }],
2168
+ 'mask-image-r-from-pos': [{
2169
+ 'mask-r-from': scaleMaskImagePosition()
2170
+ }],
2171
+ 'mask-image-r-to-pos': [{
2172
+ 'mask-r-to': scaleMaskImagePosition()
2173
+ }],
2174
+ 'mask-image-r-from-color': [{
2175
+ 'mask-r-from': scaleColor()
2176
+ }],
2177
+ 'mask-image-r-to-color': [{
2178
+ 'mask-r-to': scaleColor()
2179
+ }],
2180
+ 'mask-image-b-from-pos': [{
2181
+ 'mask-b-from': scaleMaskImagePosition()
2182
+ }],
2183
+ 'mask-image-b-to-pos': [{
2184
+ 'mask-b-to': scaleMaskImagePosition()
2185
+ }],
2186
+ 'mask-image-b-from-color': [{
2187
+ 'mask-b-from': scaleColor()
2188
+ }],
2189
+ 'mask-image-b-to-color': [{
2190
+ 'mask-b-to': scaleColor()
2191
+ }],
2192
+ 'mask-image-l-from-pos': [{
2193
+ 'mask-l-from': scaleMaskImagePosition()
2194
+ }],
2195
+ 'mask-image-l-to-pos': [{
2196
+ 'mask-l-to': scaleMaskImagePosition()
2197
+ }],
2198
+ 'mask-image-l-from-color': [{
2199
+ 'mask-l-from': scaleColor()
2200
+ }],
2201
+ 'mask-image-l-to-color': [{
2202
+ 'mask-l-to': scaleColor()
2203
+ }],
2204
+ 'mask-image-x-from-pos': [{
2205
+ 'mask-x-from': scaleMaskImagePosition()
2206
+ }],
2207
+ 'mask-image-x-to-pos': [{
2208
+ 'mask-x-to': scaleMaskImagePosition()
2209
+ }],
2210
+ 'mask-image-x-from-color': [{
2211
+ 'mask-x-from': scaleColor()
2212
+ }],
2213
+ 'mask-image-x-to-color': [{
2214
+ 'mask-x-to': scaleColor()
2215
+ }],
2216
+ 'mask-image-y-from-pos': [{
2217
+ 'mask-y-from': scaleMaskImagePosition()
2218
+ }],
2219
+ 'mask-image-y-to-pos': [{
2220
+ 'mask-y-to': scaleMaskImagePosition()
2221
+ }],
2222
+ 'mask-image-y-from-color': [{
2223
+ 'mask-y-from': scaleColor()
2224
+ }],
2225
+ 'mask-image-y-to-color': [{
2226
+ 'mask-y-to': scaleColor()
2227
+ }],
2228
+ 'mask-image-radial': [{
2229
+ 'mask-radial': [isArbitraryVariable, isArbitraryValue]
2230
+ }],
2231
+ 'mask-image-radial-from-pos': [{
2232
+ 'mask-radial-from': scaleMaskImagePosition()
2233
+ }],
2234
+ 'mask-image-radial-to-pos': [{
2235
+ 'mask-radial-to': scaleMaskImagePosition()
2236
+ }],
2237
+ 'mask-image-radial-from-color': [{
2238
+ 'mask-radial-from': scaleColor()
2239
+ }],
2240
+ 'mask-image-radial-to-color': [{
2241
+ 'mask-radial-to': scaleColor()
2242
+ }],
2243
+ 'mask-image-radial-shape': [{
2244
+ 'mask-radial': ['circle', 'ellipse']
2245
+ }],
2246
+ 'mask-image-radial-size': [{
2247
+ 'mask-radial': [{
2248
+ closest: ['side', 'corner'],
2249
+ farthest: ['side', 'corner']
2250
+ }]
2251
+ }],
2252
+ 'mask-image-radial-pos': [{
2253
+ 'mask-radial-at': scalePosition()
2254
+ }],
2255
+ 'mask-image-conic-pos': [{
2256
+ 'mask-conic': [isNumber]
2257
+ }],
2258
+ 'mask-image-conic-from-pos': [{
2259
+ 'mask-conic-from': scaleMaskImagePosition()
2260
+ }],
2261
+ 'mask-image-conic-to-pos': [{
2262
+ 'mask-conic-to': scaleMaskImagePosition()
2263
+ }],
2264
+ 'mask-image-conic-from-color': [{
2265
+ 'mask-conic-from': scaleColor()
2266
+ }],
2267
+ 'mask-image-conic-to-color': [{
2268
+ 'mask-conic-to': scaleColor()
2269
+ }],
2270
+ /**
2271
+ * Mask Mode
2272
+ * @see https://tailwindcss.com/docs/mask-mode
2273
+ */
2274
+ 'mask-mode': [{
2275
+ mask: ['alpha', 'luminance', 'match']
2276
+ }],
2277
+ /**
2278
+ * Mask Origin
2279
+ * @see https://tailwindcss.com/docs/mask-origin
2280
+ */
2281
+ 'mask-origin': [{
2282
+ 'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
2283
+ }],
2284
+ /**
2285
+ * Mask Position
2286
+ * @see https://tailwindcss.com/docs/mask-position
2287
+ */
2288
+ 'mask-position': [{
2289
+ mask: scaleBgPosition()
2290
+ }],
2291
+ /**
2292
+ * Mask Repeat
2293
+ * @see https://tailwindcss.com/docs/mask-repeat
2294
+ */
2295
+ 'mask-repeat': [{
2296
+ mask: scaleBgRepeat()
2297
+ }],
2298
+ /**
2299
+ * Mask Size
2300
+ * @see https://tailwindcss.com/docs/mask-size
2301
+ */
2302
+ 'mask-size': [{
2303
+ mask: scaleBgSize()
2304
+ }],
2305
+ /**
2306
+ * Mask Type
2307
+ * @see https://tailwindcss.com/docs/mask-type
2308
+ */
2309
+ 'mask-type': [{
2310
+ 'mask-type': ['alpha', 'luminance']
2311
+ }],
2312
+ /**
2313
+ * Mask Image
2314
+ * @see https://tailwindcss.com/docs/mask-image
2315
+ */
2316
+ 'mask-image': [{
2317
+ mask: ['none', isArbitraryVariable, isArbitraryValue]
2318
+ }],
2082
2319
  // ---------------
2083
2320
  // --- Filters ---
2084
2321
  // ---------------
@@ -2119,7 +2356,14 @@ const getDefaultConfig = () => {
2119
2356
  'drop-shadow': [{
2120
2357
  'drop-shadow': [
2121
2358
  // Deprecated since Tailwind CSS v4.0.0
2122
- '', 'none', themeDropShadow, isArbitraryVariable, isArbitraryValue]
2359
+ '', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]
2360
+ }],
2361
+ /**
2362
+ * Drop Shadow Color
2363
+ * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
2364
+ */
2365
+ 'drop-shadow-color': [{
2366
+ 'drop-shadow': scaleColor()
2123
2367
  }],
2124
2368
  /**
2125
2369
  * Grayscale
@@ -2340,7 +2584,7 @@ const getDefaultConfig = () => {
2340
2584
  * @see https://tailwindcss.com/docs/perspective-origin
2341
2585
  */
2342
2586
  'perspective-origin': [{
2343
- 'perspective-origin': scaleOrigin()
2587
+ 'perspective-origin': scalePositionWithArbitrary()
2344
2588
  }],
2345
2589
  /**
2346
2590
  * Rotate
@@ -2436,7 +2680,7 @@ const getDefaultConfig = () => {
2436
2680
  * @see https://tailwindcss.com/docs/transform-origin
2437
2681
  */
2438
2682
  'transform-origin': [{
2439
- origin: scaleOrigin()
2683
+ origin: scalePositionWithArbitrary()
2440
2684
  }],
2441
2685
  /**
2442
2686
  * Transform Style
@@ -2804,10 +3048,10 @@ const getDefaultConfig = () => {
2804
3048
  'rounded-b': ['rounded-br', 'rounded-bl'],
2805
3049
  'rounded-l': ['rounded-tl', 'rounded-bl'],
2806
3050
  'border-spacing': ['border-spacing-x', 'border-spacing-y'],
2807
- 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
3051
+ 'border-w': ['border-w-x', 'border-w-y', 'border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
2808
3052
  'border-w-x': ['border-w-r', 'border-w-l'],
2809
3053
  'border-w-y': ['border-w-t', 'border-w-b'],
2810
- 'border-color': ['border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
3054
+ 'border-color': ['border-color-x', 'border-color-y', 'border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
2811
3055
  'border-color-x': ['border-color-r', 'border-color-l'],
2812
3056
  'border-color-y': ['border-color-t', 'border-color-b'],
2813
3057
  translate: ['translate-x', 'translate-y', 'translate-none'],
@@ -2826,7 +3070,7 @@ const getDefaultConfig = () => {
2826
3070
  conflictingClassGroupModifiers: {
2827
3071
  'font-size': ['leading']
2828
3072
  },
2829
- orderSensitiveModifiers: ['before', 'after', 'placeholder', 'file', 'marker', 'selection', 'first-line', 'first-letter', 'backdrop', '*', '**']
3073
+ orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']
2830
3074
  };
2831
3075
  };
2832
3076
  const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
@@ -3999,6 +4243,48 @@ const AgentNetworkCoinIcon = (props) => /* @__PURE__ */ jsxs("svg", { width: "12
3999
4243
  ) }) })
4000
4244
  ] });
4001
4245
 
4246
+ function useCopyToClipboard({ text, copyMessage = "Copied to clipboard!" }) {
4247
+ const [isCopied, setIsCopied] = useState(false);
4248
+ const timeoutRef = useRef(null);
4249
+ const handleCopy = useCallback(() => {
4250
+ navigator.clipboard.writeText(text).then(() => {
4251
+ toast.success(copyMessage);
4252
+ setIsCopied(true);
4253
+ if (timeoutRef.current) {
4254
+ clearTimeout(timeoutRef.current);
4255
+ timeoutRef.current = null;
4256
+ }
4257
+ timeoutRef.current = setTimeout(() => {
4258
+ setIsCopied(false);
4259
+ }, 2e3);
4260
+ }).catch(() => {
4261
+ toast.error("Failed to copy to clipboard.");
4262
+ });
4263
+ }, [text, copyMessage]);
4264
+ return { isCopied, handleCopy };
4265
+ }
4266
+
4267
+ function CopyButton({ content, copyMessage, className }) {
4268
+ const { isCopied, handleCopy } = useCopyToClipboard({
4269
+ text: content,
4270
+ copyMessage
4271
+ });
4272
+ return /* @__PURE__ */ jsxs(
4273
+ Button$1,
4274
+ {
4275
+ variant: "ghost",
4276
+ size: "icon",
4277
+ className: cn("relative h-6 w-6", className),
4278
+ "aria-label": "Copy to clipboard",
4279
+ onClick: handleCopy,
4280
+ children: [
4281
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4 transition-transform ease-in-out", isCopied ? "scale-100" : "scale-0") }) }),
4282
+ /* @__PURE__ */ jsx(Copy, { className: cn("h-4 w-4 transition-transform ease-in-out", isCopied ? "scale-0" : "scale-100") })
4283
+ ]
4284
+ }
4285
+ );
4286
+ }
4287
+
4002
4288
  const useCodemirrorTheme$1 = () => {
4003
4289
  return useMemo(
4004
4290
  () => draculaInit({
@@ -4015,10 +4301,13 @@ const useCodemirrorTheme$1 = () => {
4015
4301
  []
4016
4302
  );
4017
4303
  };
4018
- const SyntaxHighlighter$1 = ({ data }) => {
4304
+ const SyntaxHighlighter$1 = ({ data, className }) => {
4019
4305
  const formattedCode = JSON.stringify(data, null, 2);
4020
4306
  const theme = useCodemirrorTheme$1();
4021
- return /* @__PURE__ */ jsx("div", { className: "rounded-md bg-[#1a1a1a] p-1 font-mono", children: /* @__PURE__ */ jsx(CodeMirror, { value: formattedCode, theme, extensions: [jsonLanguage] }) });
4307
+ return /* @__PURE__ */ jsxs("div", { className: clsx("rounded-md bg-surface4 p-1 font-mono relative", className), children: [
4308
+ /* @__PURE__ */ jsx(CopyButton, { content: formattedCode, className: "absolute top-2 right-2" }),
4309
+ /* @__PURE__ */ jsx(CodeMirror, { value: formattedCode, theme, extensions: [jsonLanguage] })
4310
+ ] });
4022
4311
  };
4023
4312
  async function highlight(code, language) {
4024
4313
  const { codeToTokens, bundledLanguages } = await import('shiki');
@@ -4086,7 +4375,7 @@ const AssistantActionBar = () => {
4086
4375
  hideWhenRunning: true,
4087
4376
  autohide: "always",
4088
4377
  autohideFloat: "single-branch",
4089
- className: "flex gap-1 items-center transition-all",
4378
+ className: "flex gap-1 items-center transition-all relative",
4090
4379
  children: /* @__PURE__ */ jsx(ActionBarPrimitive.Copy, { asChild: true, children: /* @__PURE__ */ jsxs(TooltipIconButton, { tooltip: "Copy", className: "bg-transparent text-icon3 hover:text-icon6", children: [
4091
4380
  /* @__PURE__ */ jsx(MessagePrimitive.If, { copied: true, children: /* @__PURE__ */ jsx(CheckIcon$1, {}) }),
4092
4381
  /* @__PURE__ */ jsx(MessagePrimitive.If, { copied: false, children: /* @__PURE__ */ jsx(CopyIcon, {}) })
@@ -4358,37 +4647,25 @@ const Thread = ({ ToolFallback, agentName, hasMemory, showFileSupport }) => {
4358
4647
  return /* @__PURE__ */ jsx(AssistantMessage, { ...props, ToolFallback });
4359
4648
  };
4360
4649
  return /* @__PURE__ */ jsxs(ThreadWrapper, { children: [
4361
- /* @__PURE__ */ jsxs(ThreadPrimitive.Viewport, { className: "py-10 overflow-y-auto scroll-smooth h-full", ref: areaRef, autoScroll: false, children: [
4362
- /* @__PURE__ */ jsxs("div", { children: [
4363
- /* @__PURE__ */ jsx(ThreadWelcome, { agentName }),
4364
- /* @__PURE__ */ jsx(
4365
- ThreadPrimitive.Messages,
4366
- {
4367
- components: {
4368
- UserMessage,
4369
- EditComposer,
4370
- AssistantMessage: WrappedAssistantMessage
4371
- }
4650
+ /* @__PURE__ */ jsxs(ThreadPrimitive.Viewport, { ref: areaRef, autoScroll: false, className: "overflow-y-scroll scroll-smooth h-full", children: [
4651
+ /* @__PURE__ */ jsx(ThreadWelcome, { agentName }),
4652
+ /* @__PURE__ */ jsx("div", { className: "max-w-[568px] w-full mx-auto px-4 pb-7", children: /* @__PURE__ */ jsx(
4653
+ ThreadPrimitive.Messages,
4654
+ {
4655
+ components: {
4656
+ UserMessage,
4657
+ EditComposer,
4658
+ AssistantMessage: WrappedAssistantMessage
4372
4659
  }
4373
- )
4374
- ] }),
4660
+ }
4661
+ ) }),
4375
4662
  /* @__PURE__ */ jsx(ThreadPrimitive.If, { empty: false, children: /* @__PURE__ */ jsx("div", {}) })
4376
4663
  ] }),
4377
4664
  /* @__PURE__ */ jsx(Composer, { hasMemory, showFileSupport })
4378
4665
  ] });
4379
4666
  };
4380
4667
  const ThreadWrapper = ({ children }) => {
4381
- const hasAttachments = useHasAttachments();
4382
- return /* @__PURE__ */ jsx(
4383
- ThreadPrimitive.Root,
4384
- {
4385
- className: clsx(
4386
- "max-w-[568px] w-full mx-auto px-4",
4387
- hasAttachments ? "h-[calc(100%-208px)]" : "h-[calc(100%-112px)]"
4388
- ),
4389
- children
4390
- }
4391
- );
4668
+ return /* @__PURE__ */ jsx(ThreadPrimitive.Root, { className: "grid grid-rows-[1fr_auto] h-full overflow-y-auto", children });
4392
4669
  };
4393
4670
  const ThreadWelcome = ({ agentName }) => {
4394
4671
  const safeAgentName = agentName ?? "";
@@ -4407,10 +4684,10 @@ const ThreadWelcome = ({ agentName }) => {
4407
4684
  ] }) });
4408
4685
  };
4409
4686
  const Composer = ({ hasMemory, showFileSupport }) => {
4410
- return /* @__PURE__ */ jsxs("div", { children: [
4687
+ return /* @__PURE__ */ jsxs("div", { className: "mx-4", children: [
4411
4688
  /* @__PURE__ */ jsxs(ComposerPrimitive.Root, { children: [
4412
- /* @__PURE__ */ jsx(ComposerAttachments, {}),
4413
- /* @__PURE__ */ jsxs("div", { className: "w-full bg-surface3 rounded-lg border-sm border-border1 px-3 py-4 mt-auto h-[100px]", children: [
4689
+ /* @__PURE__ */ jsx("div", { className: "max-w-[568px] w-full mx-auto px-2 py-3", children: /* @__PURE__ */ jsx(ComposerAttachments, {}) }),
4690
+ /* @__PURE__ */ jsxs("div", { className: "bg-surface3 rounded-lg border-sm border-border1 py-4 mt-auto max-w-[568px] w-full mx-auto px-4", children: [
4414
4691
  /* @__PURE__ */ jsx(ComposerPrimitive.Input, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsx(
4415
4692
  "textarea",
4416
4693
  {
@@ -4427,8 +4704,8 @@ const Composer = ({ hasMemory, showFileSupport }) => {
4427
4704
  ] })
4428
4705
  ] })
4429
4706
  ] }),
4430
- !hasMemory && /* @__PURE__ */ jsxs(Txt, { variant: "ui-sm", className: "text-icon3 flex items-center gap-2 pt-0.5", children: [
4431
- /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(InfoIcon, {}) }),
4707
+ !hasMemory && /* @__PURE__ */ jsxs(Txt, { variant: "ui-sm", className: "text-icon3 flex gap-2 pt-1 max-w-[568px] w-full mx-auto border-t items-start", children: [
4708
+ /* @__PURE__ */ jsx(Icon, { className: "transform translate-y-[0.1rem]", children: /* @__PURE__ */ jsx(InfoIcon, {}) }),
4432
4709
  "Memory is not enabled. The conversation will not be persisted."
4433
4710
  ] })
4434
4711
  ] });
@@ -5020,7 +5297,7 @@ const AgentChat = ({
5020
5297
  modelSettings,
5021
5298
  chatWithGenerate,
5022
5299
  runtimeContext,
5023
- children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4 bg-surface1", children: /* @__PURE__ */ jsx(Thread, { agentName: agentName ?? "", hasMemory: memory, showFileSupport }) })
5300
+ children: /* @__PURE__ */ jsx(Thread, { agentName: agentName ?? "", hasMemory: memory, showFileSupport })
5024
5301
  }
5025
5302
  );
5026
5303
  };
@@ -5106,7 +5383,7 @@ const Input = React.forwardRef(
5106
5383
  "input",
5107
5384
  {
5108
5385
  type,
5109
- className: cn(className, inputVariants({ variant, customSize, className })),
5386
+ className: clsx(className, inputVariants({ variant, customSize, className })),
5110
5387
  "data-testid": testId,
5111
5388
  ref,
5112
5389
  ...props
@@ -6424,48 +6701,6 @@ function MastraNetworkRuntimeProvider({
6424
6701
  ] });
6425
6702
  }
6426
6703
 
6427
- function useCopyToClipboard({ text, copyMessage = "Copied to clipboard!" }) {
6428
- const [isCopied, setIsCopied] = useState(false);
6429
- const timeoutRef = useRef(null);
6430
- const handleCopy = useCallback(() => {
6431
- navigator.clipboard.writeText(text).then(() => {
6432
- toast.success(copyMessage);
6433
- setIsCopied(true);
6434
- if (timeoutRef.current) {
6435
- clearTimeout(timeoutRef.current);
6436
- timeoutRef.current = null;
6437
- }
6438
- timeoutRef.current = setTimeout(() => {
6439
- setIsCopied(false);
6440
- }, 2e3);
6441
- }).catch(() => {
6442
- toast.error("Failed to copy to clipboard.");
6443
- });
6444
- }, [text, copyMessage]);
6445
- return { isCopied, handleCopy };
6446
- }
6447
-
6448
- function CopyButton({ content, copyMessage, classname }) {
6449
- const { isCopied, handleCopy } = useCopyToClipboard({
6450
- text: content,
6451
- copyMessage
6452
- });
6453
- return /* @__PURE__ */ jsxs(
6454
- Button$1,
6455
- {
6456
- variant: "ghost",
6457
- size: "icon",
6458
- className: cn("relative h-6 w-6", classname),
6459
- "aria-label": "Copy to clipboard",
6460
- onClick: handleCopy,
6461
- children: [
6462
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: cn("h-4 w-4 transition-transform ease-in-out", isCopied ? "scale-100" : "scale-0") }) }),
6463
- /* @__PURE__ */ jsx(Copy, { className: cn("h-4 w-4 transition-transform ease-in-out", isCopied ? "scale-0" : "scale-100") })
6464
- ]
6465
- }
6466
- );
6467
- }
6468
-
6469
6704
  function MarkdownRenderer({ children }) {
6470
6705
  const processedText = children.replace(/\\n/g, "\n");
6471
6706
  return /* @__PURE__ */ jsx(Markdown, { remarkPlugins: [remarkGfm], components: COMPONENTS, className: "space-y-3", children: processedText });
@@ -6692,7 +6927,7 @@ function NetworkProvider({ children }) {
6692
6927
 
6693
6928
  const NetworkChat = ({ agentId, memory }) => {
6694
6929
  const { modelSettings } = useContext(NetworkContext);
6695
- return /* @__PURE__ */ jsx(MastraNetworkRuntimeProvider, { agentId, memory, modelSettings, children: /* @__PURE__ */ jsx("div", { className: "h-full pb-4", children: /* @__PURE__ */ jsx(Thread, { ToolFallback }) }) });
6930
+ return /* @__PURE__ */ jsx(MastraNetworkRuntimeProvider, { agentId, memory, modelSettings, children: /* @__PURE__ */ jsx(Thread, { ToolFallback }) });
6696
6931
  };
6697
6932
 
6698
6933
  function WorkflowTraces({ traces, error, runId, stepName }) {
@@ -9056,7 +9291,8 @@ function DynamicForm({
9056
9291
  onSubmit,
9057
9292
  defaultValues,
9058
9293
  isSubmitLoading,
9059
- submitButtonLabel
9294
+ submitButtonLabel,
9295
+ className
9060
9296
  }) {
9061
9297
  if (!schema) {
9062
9298
  console.error("no form schema found");
@@ -9074,21 +9310,21 @@ function DynamicForm({
9074
9310
  const formProps = {
9075
9311
  schema: schemaProvider,
9076
9312
  onSubmit: async (values) => {
9077
- await onSubmit(values?.["​"] || {});
9313
+ await onSubmit?.(values?.["​"] || {});
9078
9314
  },
9079
9315
  defaultValues: defaultValues ? { "​": defaultValues } : void 0,
9080
9316
  formProps: {
9081
9317
  className: ""
9082
9318
  },
9083
9319
  uiComponents: {
9084
- SubmitButton: ({ children }) => /* @__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 || children })
9320
+ SubmitButton: ({ children }) => 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 || children }) : null
9085
9321
  },
9086
9322
  formComponents: {
9087
9323
  Label: ({ value }) => /* @__PURE__ */ jsx(Label, { className: "text-sm font-normal", children: value })
9088
9324
  },
9089
9325
  withSubmit: true
9090
9326
  };
9091
- return /* @__PURE__ */ jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ jsx(AutoForm, { ...formProps }) });
9327
+ return /* @__PURE__ */ jsx(AutoForm, { ...formProps });
9092
9328
  }
9093
9329
 
9094
9330
  function resolveSerializedZodOutput(obj) {
@@ -9150,7 +9386,7 @@ const WorkflowResult = ({ jsonResult, sanitizedJsonResult }) => {
9150
9386
  header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 justify-between w-full", children: [
9151
9387
  /* @__PURE__ */ jsxs(Txt, { variant: "ui-lg", className: "text-icon6 flex items-center gap-3 font-medium", children: [
9152
9388
  /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(DeploymentIcon, {}) }),
9153
- "Results"
9389
+ "Workflow Execution (JSON)"
9154
9390
  ] }),
9155
9391
  /* @__PURE__ */ jsxs(Tooltip, { children: [
9156
9392
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
@@ -9639,23 +9875,6 @@ function WorkflowGraph({ workflowId, onShowTrace }) {
9639
9875
  ) }) }, snapshot?.runId ?? workflowId);
9640
9876
  }
9641
9877
 
9642
- const WorkflowStatus = ({ stepId, status }) => {
9643
- return /* @__PURE__ */ jsx(
9644
- WorkflowCard,
9645
- {
9646
- header: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
9647
- /* @__PURE__ */ jsxs(Icon, { children: [
9648
- status === "success" && /* @__PURE__ */ jsx(CheckIcon, { className: "text-accent1" }),
9649
- status === "failed" && /* @__PURE__ */ jsx(CrossIcon, { className: "text-accent2" }),
9650
- status === "suspended" && /* @__PURE__ */ jsx(CirclePause, { className: "text-icon3" }),
9651
- status === "running" && /* @__PURE__ */ jsx(Loader2, { className: "text-icon3 animate-spin" })
9652
- ] }),
9653
- /* @__PURE__ */ jsx(Txt, { as: "span", variant: "ui-lg", className: "text-icon6 font-medium", children: stepId.charAt(0).toUpperCase() + stepId.slice(1) })
9654
- ] })
9655
- }
9656
- );
9657
- };
9658
-
9659
9878
  function WorkflowTrigger({ workflowId, setRunId }) {
9660
9879
  const { runtimeContext } = usePlaygroundStore();
9661
9880
  const { result, setResult, payload, setPayload } = useContext(WorkflowRunContext);
@@ -9694,7 +9913,6 @@ function WorkflowTrigger({ workflowId, setRunId }) {
9694
9913
  });
9695
9914
  };
9696
9915
  const watchResultToUse = result ?? watchResult;
9697
- const workflowActivePaths = watchResultToUse?.payload?.workflowState?.steps ?? {};
9698
9916
  useEffect(() => {
9699
9917
  setIsRunning(isWatchingWorkflow);
9700
9918
  }, [isWatchingWorkflow]);
@@ -9721,81 +9939,134 @@ function WorkflowTrigger({ workflowId, setRunId }) {
9721
9939
  if (!workflow) return null;
9722
9940
  const isSuspendedSteps = suspendedSteps.length > 0;
9723
9941
  const zodInputSchema = triggerSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(triggerSchema))) : null;
9724
- const { sanitizedOutput, ...restResult } = result ?? {};
9725
- const hasWorkflowActivePaths = Object.values(workflowActivePaths).length > 0;
9726
- return /* @__PURE__ */ jsx("div", { className: "h-full px-5 pt-3 pb-12", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
9727
- isResumingWorkflow && /* @__PURE__ */ jsxs("div", { className: "py-2 px-5 flex items-center gap-2 bg-surface5 -mx-5 -mt-5 border-b-sm border-border1", children: [
9728
- /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin text-icon6" }) }),
9729
- /* @__PURE__ */ jsx(Txt, { children: "Resuming workflow" })
9730
- ] }),
9731
- !isSuspendedSteps && /* @__PURE__ */ jsx(Fragment, { children: zodInputSchema ? /* @__PURE__ */ jsx(
9732
- DynamicForm,
9733
- {
9734
- schema: zodInputSchema,
9735
- defaultValues: payload,
9736
- isSubmitLoading: isWatchingWorkflow,
9737
- submitButtonLabel: "Run",
9738
- onSubmit: (data) => {
9739
- setPayload(data);
9740
- handleExecuteWorkflow(data);
9741
- }
9742
- }
9743
- ) : /* @__PURE__ */ jsx(
9744
- Button,
9745
- {
9746
- className: "w-full",
9747
- variant: "light",
9748
- disabled: isRunning,
9749
- onClick: () => handleExecuteWorkflow(null),
9750
- children: isRunning ? /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) }) : "Trigger"
9751
- }
9752
- ) }),
9753
- !isWatchingWorkflow && isSuspendedSteps && suspendedSteps?.map((step) => {
9754
- const stepDefinition = workflow.steps[step.stepId];
9755
- const stepSchema = stepDefinition?.resumeSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.resumeSchema))) : z.record(z.string(), z.any());
9756
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4", children: [
9757
- /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: step.stepId }),
9758
- step.suspendPayload && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
9759
- CodeBlockDemo,
9760
- {
9761
- className: "w-full overflow-x-auto p-2",
9762
- code: JSON.stringify(step.suspendPayload, null, 2),
9763
- language: "json"
9942
+ const { sanitizedOutput, ...restResult } = result || {};
9943
+ return /* @__PURE__ */ jsxs("div", { className: "h-full pt-3 pb-12", children: [
9944
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 px-5 pb-5 border-b-sm border-border1", children: [
9945
+ isResumingWorkflow && /* @__PURE__ */ jsxs("div", { className: "py-2 px-5 flex items-center gap-2 bg-surface5 -mx-5 -mt-5 border-b-sm border-border1", children: [
9946
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin text-icon6" }) }),
9947
+ /* @__PURE__ */ jsx(Txt, { children: "Resuming workflow" })
9948
+ ] }),
9949
+ !isSuspendedSteps && /* @__PURE__ */ jsx(Fragment, { children: zodInputSchema ? /* @__PURE__ */ jsx(
9950
+ DynamicForm,
9951
+ {
9952
+ schema: zodInputSchema,
9953
+ defaultValues: payload,
9954
+ isSubmitLoading: isWatchingWorkflow,
9955
+ submitButtonLabel: "Run",
9956
+ onSubmit: (data) => {
9957
+ setPayload(data);
9958
+ handleExecuteWorkflow(data);
9764
9959
  }
9765
- ) }),
9766
- /* @__PURE__ */ jsx(
9767
- DynamicForm,
9768
- {
9769
- schema: stepSchema,
9770
- isSubmitLoading: isResumingWorkflow,
9771
- submitButtonLabel: "Resume",
9772
- onSubmit: (data) => {
9773
- handleResumeWorkflow({
9774
- stepId: step.stepId,
9775
- runId: step.runId,
9776
- suspendPayload: step.suspendPayload,
9777
- resumeData: data
9778
- });
9960
+ }
9961
+ ) : /* @__PURE__ */ jsx(
9962
+ Button,
9963
+ {
9964
+ className: "w-full",
9965
+ variant: "light",
9966
+ disabled: isRunning,
9967
+ onClick: () => handleExecuteWorkflow(null),
9968
+ children: isRunning ? /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Loader2, { className: "animate-spin" }) }) : "Trigger"
9969
+ }
9970
+ ) }),
9971
+ !isWatchingWorkflow && isSuspendedSteps && suspendedSteps?.map((step) => {
9972
+ const stepDefinition = workflow.steps[step.stepId];
9973
+ const stepSchema = stepDefinition?.resumeSchema ? resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.resumeSchema))) : z.record(z.string(), z.any());
9974
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col px-4", children: [
9975
+ /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "text-mastra-el-3", size: "xs", children: step.stepId }),
9976
+ step.suspendPayload && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
9977
+ CodeBlockDemo,
9978
+ {
9979
+ className: "w-full overflow-x-auto p-2",
9980
+ code: JSON.stringify(step.suspendPayload, null, 2),
9981
+ language: "json"
9779
9982
  }
9780
- }
9781
- )
9782
- ] });
9783
- }),
9784
- hasWorkflowActivePaths && /* @__PURE__ */ jsxs(Fragment, { children: [
9785
- /* @__PURE__ */ jsx("hr", { className: "border-border1 border-sm my-5" }),
9786
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
9787
- /* @__PURE__ */ jsx(Text, { variant: "secondary", className: "px-4 text-mastra-el-3", size: "xs", children: "Status" }),
9788
- /* @__PURE__ */ jsx("div", { className: "px-4 flex flex-col gap-4", children: Object.entries(workflowActivePaths)?.filter(([key, _]) => key !== "input" && !key.endsWith(".input"))?.map(([stepId, { status }]) => {
9789
- return /* @__PURE__ */ jsx(WorkflowStatus, { stepId, status });
9790
- }) })
9791
- ] })
9983
+ ) }),
9984
+ /* @__PURE__ */ jsx(
9985
+ DynamicForm,
9986
+ {
9987
+ schema: stepSchema,
9988
+ isSubmitLoading: isResumingWorkflow,
9989
+ submitButtonLabel: "Resume",
9990
+ onSubmit: (data) => {
9991
+ handleResumeWorkflow({
9992
+ stepId: step.stepId,
9993
+ runId: step.runId,
9994
+ suspendPayload: step.suspendPayload,
9995
+ resumeData: data
9996
+ });
9997
+ }
9998
+ }
9999
+ )
10000
+ ] });
10001
+ })
9792
10002
  ] }),
9793
- result && /* @__PURE__ */ jsxs(Fragment, { children: [
9794
- /* @__PURE__ */ jsx("hr", { className: "border-border1 border-sm my-5" }),
9795
- /* @__PURE__ */ jsx(WorkflowResult, { sanitizedJsonResult: sanitizedOutput, jsonResult: JSON.stringify(restResult, null, 2) })
9796
- ] })
9797
- ] }) });
10003
+ result && /* @__PURE__ */ jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsx(WorkflowJsonDialog, { result: restResult }) }),
10004
+ result && /* @__PURE__ */ jsx(WorkflowResultSection, { result, workflow })
10005
+ ] });
9798
10006
  }
10007
+ const WorkflowResultSection = ({ result, workflow }) => {
10008
+ const workflowState = result.payload.workflowState;
10009
+ if (typeof workflowState.result === "string" || typeof workflowState.result === "number" || typeof workflowState.result === "boolean") {
10010
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 p-5", children: [
10011
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: "string-result", variant: "ui-sm", className: "text-icon3", children: "Workflow Result" }) }),
10012
+ /* @__PURE__ */ jsx(Input, { id: "string-result", defaultValue: String(workflowState.result) })
10013
+ ] });
10014
+ }
10015
+ const hasResult = Object.keys(workflowState.result || {}).length > 0;
10016
+ if (!hasResult) return null;
10017
+ return /* @__PURE__ */ jsxs("div", { className: "p-5", children: [
10018
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Final Output" }),
10019
+ /* @__PURE__ */ jsx("ul", { className: "pt-4", children: Object.entries(workflowState.result || {}).map(([stepId, stepResult]) => {
10020
+ const stepDefinition = workflow.steps[stepId];
10021
+ return /* @__PURE__ */ jsx(
10022
+ "li",
10023
+ {
10024
+ className: "border-b-sm border-dashed border-border1 last:border-b-0 py-4 first:pt-0 last:pb-0",
10025
+ children: /* @__PURE__ */ jsx(WorkflowResultFinishedStep, { stepResult, stepDefinition })
10026
+ },
10027
+ stepId
10028
+ );
10029
+ }) })
10030
+ ] });
10031
+ };
10032
+ const WorkflowResultFinishedStep = ({ stepResult, stepDefinition }) => {
10033
+ const id = useId();
10034
+ try {
10035
+ const zodObjectSchema = resolveSerializedZodOutput(jsonSchemaToZod(parse(stepDefinition.outputSchema)));
10036
+ if (zodObjectSchema?._def?.typeName === "ZodString") {
10037
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
10038
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
10039
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
10040
+ /* @__PURE__ */ jsx(Txt, { as: "label", htmlFor: id, variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
10041
+ ] }),
10042
+ /* @__PURE__ */ jsx(Input, { id, defaultValue: stepResult })
10043
+ ] });
10044
+ }
10045
+ return /* @__PURE__ */ jsxs("div", { children: [
10046
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
10047
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Footprints, { className: "text-icon3" }) }),
10048
+ /* @__PURE__ */ jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: stepDefinition.description })
10049
+ ] }),
10050
+ /* @__PURE__ */ jsx(DynamicForm, { schema: zodObjectSchema, defaultValues: stepResult })
10051
+ ] });
10052
+ } catch (err) {
10053
+ console.error("Error parsing output schema", err);
10054
+ return /* @__PURE__ */ jsx(Txt, { children: "An error occured. Please open an issue on GitHub." });
10055
+ }
10056
+ };
10057
+ const WorkflowJsonDialog = ({ result }) => {
10058
+ const [open, setOpen] = useState(false);
10059
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10060
+ /* @__PURE__ */ jsxs(Button, { variant: "light", onClick: () => setOpen(true), className: "w-full", size: "lg", children: [
10061
+ /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(Braces, { className: "text-icon3" }) }),
10062
+ "Open Workflow Execution (JSON)"
10063
+ ] }),
10064
+ /* @__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: [
10065
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Workflow Execution (JSON)" }),
10066
+ /* @__PURE__ */ jsx("div", { className: "w-full h-full overflow-x-scroll", children: /* @__PURE__ */ jsx(SyntaxHighlighter$1, { data: result, className: "p-4" }) })
10067
+ ] }) }) })
10068
+ ] });
10069
+ };
9799
10070
 
9800
10071
  const WorkflowRuns = ({ workflowId, runId, isLoading, runs, onPressRun }) => {
9801
10072
  if (isLoading) {
@@ -9924,7 +10195,7 @@ const ThreadItem = ({ children, isActive }) => {
9924
10195
  "li",
9925
10196
  {
9926
10197
  className: clsx(
9927
- "border-b-sm border-border1 hover:bg-surface3 group flex h-[54px] items-center justify-between gap-2 px-5 py-2",
10198
+ "border-b-sm border-border1 hover:bg-surface3 group flex h-[54px] items-center justify-between gap-2 pl-5 py-2",
9928
10199
  isActive && "bg-surface4"
9929
10200
  ),
9930
10201
  children