@mastra/playground-ui 5.1.5 → 5.1.6-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +369 -142
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +370 -143
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/dynamic-form/index.d.ts +2 -1
- package/dist/src/components/ui/autoform/AutoForm.d.ts +9 -7
- package/dist/src/components/ui/form.d.ts +1 -1
- package/dist/src/components/ui/resizable.d.ts +1 -1
- package/dist/src/domains/agents/agent/agent-evals.d.ts +9 -3
- package/dist/src/{hooks/use-evals.d.ts → domains/evals/types.d.ts} +8 -3
- package/dist/src/domains/workflows/workflow/workflow-graph.d.ts +4 -1
- package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +5 -1
- package/dist/src/hooks/use-workflows.d.ts +1 -5
- package/package.json +46 -46
- package/dist/src/components/syntax-highlighter.d.ts +0 -4
- package/dist/src/components/ui/syntax-highlighter.d.ts +0 -6
package/dist/index.cjs.js
CHANGED
|
@@ -566,13 +566,13 @@ const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
|
566
566
|
const fractionRegex = /^\d+\/\d+$/;
|
|
567
567
|
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
568
568
|
const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
569
|
-
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
|
|
569
|
+
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
570
570
|
// Shadow always begins with x and y offset separated by underscore optionally prepended by inset
|
|
571
571
|
const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
572
572
|
const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
573
573
|
const isFraction = value => fractionRegex.test(value);
|
|
574
|
-
const isNumber = value =>
|
|
575
|
-
const isInteger = value =>
|
|
574
|
+
const isNumber = value => !!value && !Number.isNaN(Number(value));
|
|
575
|
+
const isInteger = value => !!value && Number.isInteger(Number(value));
|
|
576
576
|
const isPercent = value => value.endsWith('%') && isNumber(value.slice(0, -1));
|
|
577
577
|
const isTshirtSize = value => tshirtUnitRegex.test(value);
|
|
578
578
|
const isAny = () => true;
|
|
@@ -591,7 +591,7 @@ const isArbitraryLength = value => getIsArbitraryValue(value, isLabelLength, isL
|
|
|
591
591
|
const isArbitraryNumber = value => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
592
592
|
const isArbitraryPosition = value => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
593
593
|
const isArbitraryImage = value => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
594
|
-
const isArbitraryShadow = value => getIsArbitraryValue(value,
|
|
594
|
+
const isArbitraryShadow = value => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
595
595
|
const isArbitraryVariable = value => arbitraryVariableRegex.test(value);
|
|
596
596
|
const isArbitraryVariableLength = value => getIsArbitraryVariable(value, isLabelLength);
|
|
597
597
|
const isArbitraryVariableFamilyName = value => getIsArbitraryVariable(value, isLabelFamilyName);
|
|
@@ -621,11 +621,9 @@ const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) =>
|
|
|
621
621
|
return false;
|
|
622
622
|
};
|
|
623
623
|
// Labels
|
|
624
|
-
const isLabelPosition = label => label === 'position';
|
|
625
|
-
const
|
|
626
|
-
const
|
|
627
|
-
const sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);
|
|
628
|
-
const isLabelSize = label => sizeLabels.has(label);
|
|
624
|
+
const isLabelPosition = label => label === 'position' || label === 'percentage';
|
|
625
|
+
const isLabelImage = label => label === 'image' || label === 'url';
|
|
626
|
+
const isLabelSize = label => label === 'length' || label === 'size' || label === 'bg-size';
|
|
629
627
|
const isLabelLength = label => label === 'length';
|
|
630
628
|
const isLabelNumber = label => label === 'number';
|
|
631
629
|
const isLabelFamilyName = label => label === 'family-name';
|
|
@@ -648,6 +646,7 @@ const getDefaultConfig = () => {
|
|
|
648
646
|
const themeRadius = fromTheme('radius');
|
|
649
647
|
const themeShadow = fromTheme('shadow');
|
|
650
648
|
const themeInsetShadow = fromTheme('inset-shadow');
|
|
649
|
+
const themeTextShadow = fromTheme('text-shadow');
|
|
651
650
|
const themeDropShadow = fromTheme('drop-shadow');
|
|
652
651
|
const themeBlur = fromTheme('blur');
|
|
653
652
|
const themePerspective = fromTheme('perspective');
|
|
@@ -662,7 +661,16 @@ const getDefaultConfig = () => {
|
|
|
662
661
|
*/
|
|
663
662
|
/***/
|
|
664
663
|
const scaleBreak = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];
|
|
665
|
-
const scalePosition = () => ['
|
|
664
|
+
const scalePosition = () => ['center', 'top', 'bottom', 'left', 'right', 'top-left',
|
|
665
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
666
|
+
'left-top', 'top-right',
|
|
667
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
668
|
+
'right-top', 'bottom-right',
|
|
669
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
670
|
+
'right-bottom', 'bottom-left',
|
|
671
|
+
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
672
|
+
'left-bottom'];
|
|
673
|
+
const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
|
|
666
674
|
const scaleOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];
|
|
667
675
|
const scaleOverscroll = () => ['auto', 'contain', 'none'];
|
|
668
676
|
const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
|
|
@@ -670,25 +678,34 @@ const getDefaultConfig = () => {
|
|
|
670
678
|
const scaleGridTemplateColsRows = () => [isInteger, 'none', 'subgrid', isArbitraryVariable, isArbitraryValue];
|
|
671
679
|
const scaleGridColRowStartAndEnd = () => ['auto', {
|
|
672
680
|
span: ['full', isInteger, isArbitraryVariable, isArbitraryValue]
|
|
673
|
-
}, isArbitraryVariable, isArbitraryValue];
|
|
681
|
+
}, isInteger, isArbitraryVariable, isArbitraryValue];
|
|
674
682
|
const scaleGridColRowStartOrEnd = () => [isInteger, 'auto', isArbitraryVariable, isArbitraryValue];
|
|
675
683
|
const scaleGridAutoColsRows = () => ['auto', 'min', 'max', 'fr', isArbitraryVariable, isArbitraryValue];
|
|
676
|
-
const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline'];
|
|
677
|
-
const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch'];
|
|
684
|
+
const scaleAlignPrimaryAxis = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch', 'baseline', 'center-safe', 'end-safe'];
|
|
685
|
+
const scaleAlignSecondaryAxis = () => ['start', 'end', 'center', 'stretch', 'center-safe', 'end-safe'];
|
|
678
686
|
const scaleMargin = () => ['auto', ...scaleUnambiguousSpacing()];
|
|
679
687
|
const scaleSizing = () => [isFraction, 'auto', 'full', 'dvw', 'dvh', 'lvw', 'lvh', 'svw', 'svh', 'min', 'max', 'fit', ...scaleUnambiguousSpacing()];
|
|
680
688
|
const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
|
|
681
|
-
const
|
|
689
|
+
const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
|
|
690
|
+
position: [isArbitraryVariable, isArbitraryValue]
|
|
691
|
+
}];
|
|
692
|
+
const scaleBgRepeat = () => ['no-repeat', {
|
|
693
|
+
repeat: ['', 'x', 'y', 'space', 'round']
|
|
694
|
+
}];
|
|
695
|
+
const scaleBgSize = () => ['auto', 'cover', 'contain', isArbitraryVariableSize, isArbitrarySize, {
|
|
696
|
+
size: [isArbitraryVariable, isArbitraryValue]
|
|
697
|
+
}];
|
|
698
|
+
const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
|
|
682
699
|
const scaleRadius = () => [
|
|
683
700
|
// Deprecated since Tailwind CSS v4.0.0
|
|
684
701
|
'', 'none', 'full', themeRadius, isArbitraryVariable, isArbitraryValue];
|
|
685
702
|
const scaleBorderWidth = () => ['', isNumber, isArbitraryVariableLength, isArbitraryLength];
|
|
686
703
|
const scaleLineStyle = () => ['solid', 'dashed', 'dotted', 'double'];
|
|
687
704
|
const scaleBlendMode = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity'];
|
|
705
|
+
const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
|
|
688
706
|
const scaleBlur = () => [
|
|
689
707
|
// Deprecated since Tailwind CSS v4.0.0
|
|
690
708
|
'', 'none', themeBlur, isArbitraryVariable, isArbitraryValue];
|
|
691
|
-
const scaleOrigin = () => ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryVariable, isArbitraryValue];
|
|
692
709
|
const scaleRotate = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
|
|
693
710
|
const scaleScale = () => ['none', isNumber, isArbitraryVariable, isArbitraryValue];
|
|
694
711
|
const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
|
|
@@ -713,6 +730,7 @@ const getDefaultConfig = () => {
|
|
|
713
730
|
shadow: [isTshirtSize],
|
|
714
731
|
spacing: ['px', isNumber],
|
|
715
732
|
text: [isTshirtSize],
|
|
733
|
+
'text-shadow': [isTshirtSize],
|
|
716
734
|
tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest']
|
|
717
735
|
},
|
|
718
736
|
classGroups: {
|
|
@@ -815,7 +833,7 @@ const getDefaultConfig = () => {
|
|
|
815
833
|
* @see https://tailwindcss.com/docs/object-position
|
|
816
834
|
*/
|
|
817
835
|
'object-position': [{
|
|
818
|
-
object:
|
|
836
|
+
object: scalePositionWithArbitrary()
|
|
819
837
|
}],
|
|
820
838
|
/**
|
|
821
839
|
* Overflow
|
|
@@ -1122,14 +1140,18 @@ const getDefaultConfig = () => {
|
|
|
1122
1140
|
* @see https://tailwindcss.com/docs/align-items
|
|
1123
1141
|
*/
|
|
1124
1142
|
'align-items': [{
|
|
1125
|
-
items: [...scaleAlignSecondaryAxis(),
|
|
1143
|
+
items: [...scaleAlignSecondaryAxis(), {
|
|
1144
|
+
baseline: ['', 'last']
|
|
1145
|
+
}]
|
|
1126
1146
|
}],
|
|
1127
1147
|
/**
|
|
1128
1148
|
* Align Self
|
|
1129
1149
|
* @see https://tailwindcss.com/docs/align-self
|
|
1130
1150
|
*/
|
|
1131
1151
|
'align-self': [{
|
|
1132
|
-
self: ['auto', ...scaleAlignSecondaryAxis(),
|
|
1152
|
+
self: ['auto', ...scaleAlignSecondaryAxis(), {
|
|
1153
|
+
baseline: ['', 'last']
|
|
1154
|
+
}]
|
|
1133
1155
|
}],
|
|
1134
1156
|
/**
|
|
1135
1157
|
* Place Content
|
|
@@ -1344,21 +1366,21 @@ const getDefaultConfig = () => {
|
|
|
1344
1366
|
* @see https://tailwindcss.com/docs/height
|
|
1345
1367
|
*/
|
|
1346
1368
|
h: [{
|
|
1347
|
-
h: ['screen', ...scaleSizing()]
|
|
1369
|
+
h: ['screen', 'lh', ...scaleSizing()]
|
|
1348
1370
|
}],
|
|
1349
1371
|
/**
|
|
1350
1372
|
* Min-Height
|
|
1351
1373
|
* @see https://tailwindcss.com/docs/min-height
|
|
1352
1374
|
*/
|
|
1353
1375
|
'min-h': [{
|
|
1354
|
-
'min-h': ['screen', 'none', ...scaleSizing()]
|
|
1376
|
+
'min-h': ['screen', 'lh', 'none', ...scaleSizing()]
|
|
1355
1377
|
}],
|
|
1356
1378
|
/**
|
|
1357
1379
|
* Max-Height
|
|
1358
1380
|
* @see https://tailwindcss.com/docs/max-height
|
|
1359
1381
|
*/
|
|
1360
1382
|
'max-h': [{
|
|
1361
|
-
'max-h': ['screen', ...scaleSizing()]
|
|
1383
|
+
'max-h': ['screen', 'lh', ...scaleSizing()]
|
|
1362
1384
|
}],
|
|
1363
1385
|
// ------------------
|
|
1364
1386
|
// --- Typography ---
|
|
@@ -1574,6 +1596,13 @@ const getDefaultConfig = () => {
|
|
|
1574
1596
|
break: [{
|
|
1575
1597
|
break: ['normal', 'words', 'all', 'keep']
|
|
1576
1598
|
}],
|
|
1599
|
+
/**
|
|
1600
|
+
* Overflow Wrap
|
|
1601
|
+
* @see https://tailwindcss.com/docs/overflow-wrap
|
|
1602
|
+
*/
|
|
1603
|
+
wrap: [{
|
|
1604
|
+
wrap: ['break-word', 'anywhere', 'normal']
|
|
1605
|
+
}],
|
|
1577
1606
|
/**
|
|
1578
1607
|
* Hyphens
|
|
1579
1608
|
* @see https://tailwindcss.com/docs/hyphens
|
|
@@ -1617,23 +1646,21 @@ const getDefaultConfig = () => {
|
|
|
1617
1646
|
* @see https://tailwindcss.com/docs/background-position
|
|
1618
1647
|
*/
|
|
1619
1648
|
'bg-position': [{
|
|
1620
|
-
bg:
|
|
1649
|
+
bg: scaleBgPosition()
|
|
1621
1650
|
}],
|
|
1622
1651
|
/**
|
|
1623
1652
|
* Background Repeat
|
|
1624
1653
|
* @see https://tailwindcss.com/docs/background-repeat
|
|
1625
1654
|
*/
|
|
1626
1655
|
'bg-repeat': [{
|
|
1627
|
-
bg:
|
|
1628
|
-
repeat: ['', 'x', 'y', 'space', 'round']
|
|
1629
|
-
}]
|
|
1656
|
+
bg: scaleBgRepeat()
|
|
1630
1657
|
}],
|
|
1631
1658
|
/**
|
|
1632
1659
|
* Background Size
|
|
1633
1660
|
* @see https://tailwindcss.com/docs/background-size
|
|
1634
1661
|
*/
|
|
1635
1662
|
'bg-size': [{
|
|
1636
|
-
bg:
|
|
1663
|
+
bg: scaleBgSize()
|
|
1637
1664
|
}],
|
|
1638
1665
|
/**
|
|
1639
1666
|
* Background Image
|
|
@@ -2002,7 +2029,7 @@ const getDefaultConfig = () => {
|
|
|
2002
2029
|
* @see https://tailwindcss.com/docs/outline-color
|
|
2003
2030
|
*/
|
|
2004
2031
|
'outline-color': [{
|
|
2005
|
-
outline:
|
|
2032
|
+
outline: scaleColor()
|
|
2006
2033
|
}],
|
|
2007
2034
|
// ---------------
|
|
2008
2035
|
// --- Effects ---
|
|
@@ -2028,7 +2055,7 @@ const getDefaultConfig = () => {
|
|
|
2028
2055
|
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
|
|
2029
2056
|
*/
|
|
2030
2057
|
'inset-shadow': [{
|
|
2031
|
-
'inset-shadow': ['none',
|
|
2058
|
+
'inset-shadow': ['none', themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
|
|
2032
2059
|
}],
|
|
2033
2060
|
/**
|
|
2034
2061
|
* Inset Box Shadow Color
|
|
@@ -2090,6 +2117,20 @@ const getDefaultConfig = () => {
|
|
|
2090
2117
|
'inset-ring-color': [{
|
|
2091
2118
|
'inset-ring': scaleColor()
|
|
2092
2119
|
}],
|
|
2120
|
+
/**
|
|
2121
|
+
* Text Shadow
|
|
2122
|
+
* @see https://tailwindcss.com/docs/text-shadow
|
|
2123
|
+
*/
|
|
2124
|
+
'text-shadow': [{
|
|
2125
|
+
'text-shadow': ['none', themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
|
|
2126
|
+
}],
|
|
2127
|
+
/**
|
|
2128
|
+
* Text Shadow Color
|
|
2129
|
+
* @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
|
|
2130
|
+
*/
|
|
2131
|
+
'text-shadow-color': [{
|
|
2132
|
+
'text-shadow': scaleColor()
|
|
2133
|
+
}],
|
|
2093
2134
|
/**
|
|
2094
2135
|
* Opacity
|
|
2095
2136
|
* @see https://tailwindcss.com/docs/opacity
|
|
@@ -2111,6 +2152,202 @@ const getDefaultConfig = () => {
|
|
|
2111
2152
|
'bg-blend': [{
|
|
2112
2153
|
'bg-blend': scaleBlendMode()
|
|
2113
2154
|
}],
|
|
2155
|
+
/**
|
|
2156
|
+
* Mask Clip
|
|
2157
|
+
* @see https://tailwindcss.com/docs/mask-clip
|
|
2158
|
+
*/
|
|
2159
|
+
'mask-clip': [{
|
|
2160
|
+
'mask-clip': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
|
|
2161
|
+
}, 'mask-no-clip'],
|
|
2162
|
+
/**
|
|
2163
|
+
* Mask Composite
|
|
2164
|
+
* @see https://tailwindcss.com/docs/mask-composite
|
|
2165
|
+
*/
|
|
2166
|
+
'mask-composite': [{
|
|
2167
|
+
mask: ['add', 'subtract', 'intersect', 'exclude']
|
|
2168
|
+
}],
|
|
2169
|
+
/**
|
|
2170
|
+
* Mask Image
|
|
2171
|
+
* @see https://tailwindcss.com/docs/mask-image
|
|
2172
|
+
*/
|
|
2173
|
+
'mask-image-linear-pos': [{
|
|
2174
|
+
'mask-linear': [isNumber]
|
|
2175
|
+
}],
|
|
2176
|
+
'mask-image-linear-from-pos': [{
|
|
2177
|
+
'mask-linear-from': scaleMaskImagePosition()
|
|
2178
|
+
}],
|
|
2179
|
+
'mask-image-linear-to-pos': [{
|
|
2180
|
+
'mask-linear-to': scaleMaskImagePosition()
|
|
2181
|
+
}],
|
|
2182
|
+
'mask-image-linear-from-color': [{
|
|
2183
|
+
'mask-linear-from': scaleColor()
|
|
2184
|
+
}],
|
|
2185
|
+
'mask-image-linear-to-color': [{
|
|
2186
|
+
'mask-linear-to': scaleColor()
|
|
2187
|
+
}],
|
|
2188
|
+
'mask-image-t-from-pos': [{
|
|
2189
|
+
'mask-t-from': scaleMaskImagePosition()
|
|
2190
|
+
}],
|
|
2191
|
+
'mask-image-t-to-pos': [{
|
|
2192
|
+
'mask-t-to': scaleMaskImagePosition()
|
|
2193
|
+
}],
|
|
2194
|
+
'mask-image-t-from-color': [{
|
|
2195
|
+
'mask-t-from': scaleColor()
|
|
2196
|
+
}],
|
|
2197
|
+
'mask-image-t-to-color': [{
|
|
2198
|
+
'mask-t-to': scaleColor()
|
|
2199
|
+
}],
|
|
2200
|
+
'mask-image-r-from-pos': [{
|
|
2201
|
+
'mask-r-from': scaleMaskImagePosition()
|
|
2202
|
+
}],
|
|
2203
|
+
'mask-image-r-to-pos': [{
|
|
2204
|
+
'mask-r-to': scaleMaskImagePosition()
|
|
2205
|
+
}],
|
|
2206
|
+
'mask-image-r-from-color': [{
|
|
2207
|
+
'mask-r-from': scaleColor()
|
|
2208
|
+
}],
|
|
2209
|
+
'mask-image-r-to-color': [{
|
|
2210
|
+
'mask-r-to': scaleColor()
|
|
2211
|
+
}],
|
|
2212
|
+
'mask-image-b-from-pos': [{
|
|
2213
|
+
'mask-b-from': scaleMaskImagePosition()
|
|
2214
|
+
}],
|
|
2215
|
+
'mask-image-b-to-pos': [{
|
|
2216
|
+
'mask-b-to': scaleMaskImagePosition()
|
|
2217
|
+
}],
|
|
2218
|
+
'mask-image-b-from-color': [{
|
|
2219
|
+
'mask-b-from': scaleColor()
|
|
2220
|
+
}],
|
|
2221
|
+
'mask-image-b-to-color': [{
|
|
2222
|
+
'mask-b-to': scaleColor()
|
|
2223
|
+
}],
|
|
2224
|
+
'mask-image-l-from-pos': [{
|
|
2225
|
+
'mask-l-from': scaleMaskImagePosition()
|
|
2226
|
+
}],
|
|
2227
|
+
'mask-image-l-to-pos': [{
|
|
2228
|
+
'mask-l-to': scaleMaskImagePosition()
|
|
2229
|
+
}],
|
|
2230
|
+
'mask-image-l-from-color': [{
|
|
2231
|
+
'mask-l-from': scaleColor()
|
|
2232
|
+
}],
|
|
2233
|
+
'mask-image-l-to-color': [{
|
|
2234
|
+
'mask-l-to': scaleColor()
|
|
2235
|
+
}],
|
|
2236
|
+
'mask-image-x-from-pos': [{
|
|
2237
|
+
'mask-x-from': scaleMaskImagePosition()
|
|
2238
|
+
}],
|
|
2239
|
+
'mask-image-x-to-pos': [{
|
|
2240
|
+
'mask-x-to': scaleMaskImagePosition()
|
|
2241
|
+
}],
|
|
2242
|
+
'mask-image-x-from-color': [{
|
|
2243
|
+
'mask-x-from': scaleColor()
|
|
2244
|
+
}],
|
|
2245
|
+
'mask-image-x-to-color': [{
|
|
2246
|
+
'mask-x-to': scaleColor()
|
|
2247
|
+
}],
|
|
2248
|
+
'mask-image-y-from-pos': [{
|
|
2249
|
+
'mask-y-from': scaleMaskImagePosition()
|
|
2250
|
+
}],
|
|
2251
|
+
'mask-image-y-to-pos': [{
|
|
2252
|
+
'mask-y-to': scaleMaskImagePosition()
|
|
2253
|
+
}],
|
|
2254
|
+
'mask-image-y-from-color': [{
|
|
2255
|
+
'mask-y-from': scaleColor()
|
|
2256
|
+
}],
|
|
2257
|
+
'mask-image-y-to-color': [{
|
|
2258
|
+
'mask-y-to': scaleColor()
|
|
2259
|
+
}],
|
|
2260
|
+
'mask-image-radial': [{
|
|
2261
|
+
'mask-radial': [isArbitraryVariable, isArbitraryValue]
|
|
2262
|
+
}],
|
|
2263
|
+
'mask-image-radial-from-pos': [{
|
|
2264
|
+
'mask-radial-from': scaleMaskImagePosition()
|
|
2265
|
+
}],
|
|
2266
|
+
'mask-image-radial-to-pos': [{
|
|
2267
|
+
'mask-radial-to': scaleMaskImagePosition()
|
|
2268
|
+
}],
|
|
2269
|
+
'mask-image-radial-from-color': [{
|
|
2270
|
+
'mask-radial-from': scaleColor()
|
|
2271
|
+
}],
|
|
2272
|
+
'mask-image-radial-to-color': [{
|
|
2273
|
+
'mask-radial-to': scaleColor()
|
|
2274
|
+
}],
|
|
2275
|
+
'mask-image-radial-shape': [{
|
|
2276
|
+
'mask-radial': ['circle', 'ellipse']
|
|
2277
|
+
}],
|
|
2278
|
+
'mask-image-radial-size': [{
|
|
2279
|
+
'mask-radial': [{
|
|
2280
|
+
closest: ['side', 'corner'],
|
|
2281
|
+
farthest: ['side', 'corner']
|
|
2282
|
+
}]
|
|
2283
|
+
}],
|
|
2284
|
+
'mask-image-radial-pos': [{
|
|
2285
|
+
'mask-radial-at': scalePosition()
|
|
2286
|
+
}],
|
|
2287
|
+
'mask-image-conic-pos': [{
|
|
2288
|
+
'mask-conic': [isNumber]
|
|
2289
|
+
}],
|
|
2290
|
+
'mask-image-conic-from-pos': [{
|
|
2291
|
+
'mask-conic-from': scaleMaskImagePosition()
|
|
2292
|
+
}],
|
|
2293
|
+
'mask-image-conic-to-pos': [{
|
|
2294
|
+
'mask-conic-to': scaleMaskImagePosition()
|
|
2295
|
+
}],
|
|
2296
|
+
'mask-image-conic-from-color': [{
|
|
2297
|
+
'mask-conic-from': scaleColor()
|
|
2298
|
+
}],
|
|
2299
|
+
'mask-image-conic-to-color': [{
|
|
2300
|
+
'mask-conic-to': scaleColor()
|
|
2301
|
+
}],
|
|
2302
|
+
/**
|
|
2303
|
+
* Mask Mode
|
|
2304
|
+
* @see https://tailwindcss.com/docs/mask-mode
|
|
2305
|
+
*/
|
|
2306
|
+
'mask-mode': [{
|
|
2307
|
+
mask: ['alpha', 'luminance', 'match']
|
|
2308
|
+
}],
|
|
2309
|
+
/**
|
|
2310
|
+
* Mask Origin
|
|
2311
|
+
* @see https://tailwindcss.com/docs/mask-origin
|
|
2312
|
+
*/
|
|
2313
|
+
'mask-origin': [{
|
|
2314
|
+
'mask-origin': ['border', 'padding', 'content', 'fill', 'stroke', 'view']
|
|
2315
|
+
}],
|
|
2316
|
+
/**
|
|
2317
|
+
* Mask Position
|
|
2318
|
+
* @see https://tailwindcss.com/docs/mask-position
|
|
2319
|
+
*/
|
|
2320
|
+
'mask-position': [{
|
|
2321
|
+
mask: scaleBgPosition()
|
|
2322
|
+
}],
|
|
2323
|
+
/**
|
|
2324
|
+
* Mask Repeat
|
|
2325
|
+
* @see https://tailwindcss.com/docs/mask-repeat
|
|
2326
|
+
*/
|
|
2327
|
+
'mask-repeat': [{
|
|
2328
|
+
mask: scaleBgRepeat()
|
|
2329
|
+
}],
|
|
2330
|
+
/**
|
|
2331
|
+
* Mask Size
|
|
2332
|
+
* @see https://tailwindcss.com/docs/mask-size
|
|
2333
|
+
*/
|
|
2334
|
+
'mask-size': [{
|
|
2335
|
+
mask: scaleBgSize()
|
|
2336
|
+
}],
|
|
2337
|
+
/**
|
|
2338
|
+
* Mask Type
|
|
2339
|
+
* @see https://tailwindcss.com/docs/mask-type
|
|
2340
|
+
*/
|
|
2341
|
+
'mask-type': [{
|
|
2342
|
+
'mask-type': ['alpha', 'luminance']
|
|
2343
|
+
}],
|
|
2344
|
+
/**
|
|
2345
|
+
* Mask Image
|
|
2346
|
+
* @see https://tailwindcss.com/docs/mask-image
|
|
2347
|
+
*/
|
|
2348
|
+
'mask-image': [{
|
|
2349
|
+
mask: ['none', isArbitraryVariable, isArbitraryValue]
|
|
2350
|
+
}],
|
|
2114
2351
|
// ---------------
|
|
2115
2352
|
// --- Filters ---
|
|
2116
2353
|
// ---------------
|
|
@@ -2151,7 +2388,14 @@ const getDefaultConfig = () => {
|
|
|
2151
2388
|
'drop-shadow': [{
|
|
2152
2389
|
'drop-shadow': [
|
|
2153
2390
|
// Deprecated since Tailwind CSS v4.0.0
|
|
2154
|
-
'', 'none', themeDropShadow,
|
|
2391
|
+
'', 'none', themeDropShadow, isArbitraryVariableShadow, isArbitraryShadow]
|
|
2392
|
+
}],
|
|
2393
|
+
/**
|
|
2394
|
+
* Drop Shadow Color
|
|
2395
|
+
* @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
|
|
2396
|
+
*/
|
|
2397
|
+
'drop-shadow-color': [{
|
|
2398
|
+
'drop-shadow': scaleColor()
|
|
2155
2399
|
}],
|
|
2156
2400
|
/**
|
|
2157
2401
|
* Grayscale
|
|
@@ -2372,7 +2616,7 @@ const getDefaultConfig = () => {
|
|
|
2372
2616
|
* @see https://tailwindcss.com/docs/perspective-origin
|
|
2373
2617
|
*/
|
|
2374
2618
|
'perspective-origin': [{
|
|
2375
|
-
'perspective-origin':
|
|
2619
|
+
'perspective-origin': scalePositionWithArbitrary()
|
|
2376
2620
|
}],
|
|
2377
2621
|
/**
|
|
2378
2622
|
* Rotate
|
|
@@ -2468,7 +2712,7 @@ const getDefaultConfig = () => {
|
|
|
2468
2712
|
* @see https://tailwindcss.com/docs/transform-origin
|
|
2469
2713
|
*/
|
|
2470
2714
|
'transform-origin': [{
|
|
2471
|
-
origin:
|
|
2715
|
+
origin: scalePositionWithArbitrary()
|
|
2472
2716
|
}],
|
|
2473
2717
|
/**
|
|
2474
2718
|
* Transform Style
|
|
@@ -2836,10 +3080,10 @@ const getDefaultConfig = () => {
|
|
|
2836
3080
|
'rounded-b': ['rounded-br', 'rounded-bl'],
|
|
2837
3081
|
'rounded-l': ['rounded-tl', 'rounded-bl'],
|
|
2838
3082
|
'border-spacing': ['border-spacing-x', 'border-spacing-y'],
|
|
2839
|
-
'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],
|
|
3083
|
+
'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'],
|
|
2840
3084
|
'border-w-x': ['border-w-r', 'border-w-l'],
|
|
2841
3085
|
'border-w-y': ['border-w-t', 'border-w-b'],
|
|
2842
|
-
'border-color': ['border-color-s', 'border-color-e', 'border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],
|
|
3086
|
+
'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'],
|
|
2843
3087
|
'border-color-x': ['border-color-r', 'border-color-l'],
|
|
2844
3088
|
'border-color-y': ['border-color-t', 'border-color-b'],
|
|
2845
3089
|
translate: ['translate-x', 'translate-y', 'translate-none'],
|
|
@@ -2858,7 +3102,7 @@ const getDefaultConfig = () => {
|
|
|
2858
3102
|
conflictingClassGroupModifiers: {
|
|
2859
3103
|
'font-size': ['leading']
|
|
2860
3104
|
},
|
|
2861
|
-
orderSensitiveModifiers: ['
|
|
3105
|
+
orderSensitiveModifiers: ['*', '**', 'after', 'backdrop', 'before', 'details-content', 'file', 'first-letter', 'first-line', 'marker', 'placeholder', 'selection']
|
|
2862
3106
|
};
|
|
2863
3107
|
};
|
|
2864
3108
|
const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
@@ -5185,10 +5429,6 @@ function ScoreIndicator({ score }) {
|
|
|
5185
5429
|
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", children: score.toFixed(2) });
|
|
5186
5430
|
}
|
|
5187
5431
|
|
|
5188
|
-
function Skeleton({ className, ...props }) {
|
|
5189
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
|
|
5190
|
-
}
|
|
5191
|
-
|
|
5192
5432
|
const Table$1 = React__namespace.forwardRef(
|
|
5193
5433
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("table", { ref, className: cn("w-full caption-bottom text-sm border-spacing-0", className), ...props })
|
|
5194
5434
|
);
|
|
@@ -5260,32 +5500,6 @@ const TabsContent = React__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
5260
5500
|
));
|
|
5261
5501
|
TabsContent.displayName = TabsPrimitive__namespace.Content.displayName;
|
|
5262
5502
|
|
|
5263
|
-
const useEvalsByAgentId = (agentId, type) => {
|
|
5264
|
-
const [evals, setEvals] = React.useState([]);
|
|
5265
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
5266
|
-
const client = useMastraClient();
|
|
5267
|
-
const fetchEvals = async (_agentId) => {
|
|
5268
|
-
setIsLoading(true);
|
|
5269
|
-
const activeAgentId = _agentId ?? agentId;
|
|
5270
|
-
try {
|
|
5271
|
-
const res = type === "live" ? await client.getAgent(activeAgentId).liveEvals() : await client.getAgent(activeAgentId).evals();
|
|
5272
|
-
setEvals(res.evals);
|
|
5273
|
-
} catch (error) {
|
|
5274
|
-
setEvals([]);
|
|
5275
|
-
console.error("Error fetching evals", error);
|
|
5276
|
-
sonner.toast.error("Error fetching evals");
|
|
5277
|
-
} finally {
|
|
5278
|
-
setIsLoading(false);
|
|
5279
|
-
}
|
|
5280
|
-
};
|
|
5281
|
-
React.useEffect(() => {
|
|
5282
|
-
fetchEvals(agentId);
|
|
5283
|
-
}, [agentId]);
|
|
5284
|
-
return { evals, isLoading, refetchEvals: fetchEvals };
|
|
5285
|
-
};
|
|
5286
|
-
|
|
5287
|
-
const AgentEvalsContext = React.createContext({ handleRefresh: () => {
|
|
5288
|
-
}, isLoading: true });
|
|
5289
5503
|
const scrollableContentClass = cn(
|
|
5290
5504
|
"relative overflow-y-auto overflow-x-hidden invisible hover:visible focus:visible",
|
|
5291
5505
|
"[&::-webkit-scrollbar]:w-1",
|
|
@@ -5301,26 +5515,13 @@ const tabIndicatorClass = cn(
|
|
|
5301
5515
|
"focus-visible:outline-none"
|
|
5302
5516
|
);
|
|
5303
5517
|
const tabContentClass = cn("data-[state=inactive]:mt-0 min-h-0 h-full grid grid-rows-[1fr]");
|
|
5304
|
-
function AgentEvals({
|
|
5518
|
+
function AgentEvals({ liveEvals, ciEvals, onRefetchLiveEvals, onRefetchCiEvals }) {
|
|
5305
5519
|
const [activeTab, setActiveTab] = React.useState("live");
|
|
5306
|
-
const {
|
|
5307
|
-
evals: liveEvals,
|
|
5308
|
-
isLoading: isLiveLoading,
|
|
5309
|
-
refetchEvals: refetchLiveEvals
|
|
5310
|
-
} = useEvalsByAgentId(agentId, "live");
|
|
5311
|
-
const { evals: ciEvals, isLoading: isCiLoading, refetchEvals: refetchCiEvals } = useEvalsByAgentId(agentId, "ci");
|
|
5312
|
-
const contextValue = {
|
|
5313
|
-
handleRefresh,
|
|
5314
|
-
isLoading: activeTab === "live" ? isLiveLoading : isCiLoading
|
|
5315
|
-
};
|
|
5316
5520
|
function handleRefresh() {
|
|
5317
|
-
if (activeTab === "live")
|
|
5318
|
-
|
|
5319
|
-
} else {
|
|
5320
|
-
refetchCiEvals();
|
|
5321
|
-
}
|
|
5521
|
+
if (activeTab === "live") return onRefetchLiveEvals();
|
|
5522
|
+
return onRefetchCiEvals();
|
|
5322
5523
|
}
|
|
5323
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
5524
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5324
5525
|
Tabs,
|
|
5325
5526
|
{
|
|
5326
5527
|
value: activeTab,
|
|
@@ -5331,14 +5532,13 @@ function AgentEvals({ agentId }) {
|
|
|
5331
5532
|
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "live", className: tabIndicatorClass, children: "Live" }),
|
|
5332
5533
|
/* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: "ci", className: tabIndicatorClass, children: "CI" })
|
|
5333
5534
|
] }) }),
|
|
5334
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "live", className: tabContentClass, children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: liveEvals, isCIMode: false }) }),
|
|
5335
|
-
/* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "ci", className: tabContentClass, children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: ciEvals, isCIMode: true }) })
|
|
5535
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "live", className: tabContentClass, children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: liveEvals, isCIMode: false, onRefresh: handleRefresh }) }),
|
|
5536
|
+
/* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "ci", className: tabContentClass, children: /* @__PURE__ */ jsxRuntime.jsx(EvalTable, { evals: ciEvals, isCIMode: true, onRefresh: handleRefresh }) })
|
|
5336
5537
|
]
|
|
5337
5538
|
}
|
|
5338
|
-
)
|
|
5539
|
+
);
|
|
5339
5540
|
}
|
|
5340
|
-
function EvalTable({ evals, isCIMode = false }) {
|
|
5341
|
-
const { handleRefresh, isLoading: isTableLoading } = React.useContext(AgentEvalsContext);
|
|
5541
|
+
function EvalTable({ evals, isCIMode = false, onRefresh }) {
|
|
5342
5542
|
const [expandedMetrics, setExpandedMetrics] = React.useState(/* @__PURE__ */ new Set());
|
|
5343
5543
|
const [searchTerm, setSearchTerm] = React.useState("");
|
|
5344
5544
|
const [sortConfig, setSortConfig] = React.useState({ field: "metricName", direction: "asc" });
|
|
@@ -5361,7 +5561,7 @@ function EvalTable({ evals, isCIMode = false }) {
|
|
|
5361
5561
|
evals.length,
|
|
5362
5562
|
" Total Evaluations"
|
|
5363
5563
|
] }),
|
|
5364
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button$1, { variant: "ghost", size: "icon", onClick:
|
|
5564
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button$1, { variant: "ghost", size: "icon", onClick: onRefresh, className: "h-9 w-9", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCcwIcon, { className: "h-4 w-4" }) })
|
|
5365
5565
|
] }),
|
|
5366
5566
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsxs(Table$1, { className: "w-full", children: [
|
|
5367
5567
|
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { className: "bg-mastra-bg-2 h-[var(--table-header-height)] sticky top-0 z-10", children: /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { className: "border-gray-6 border-b-[0.1px] text-[0.8125rem]", children: [
|
|
@@ -5384,13 +5584,7 @@ function EvalTable({ evals, isCIMode = false }) {
|
|
|
5384
5584
|
] }) }),
|
|
5385
5585
|
/* @__PURE__ */ jsxRuntime.jsx(TableHead, { className: "w-48 text-mastra-el-3", children: "Evaluations" })
|
|
5386
5586
|
] }) }),
|
|
5387
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { className: "border-b border-gray-6 relative", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { mode: "wait", presenceAffectsLayout: false, children:
|
|
5388
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-12 h-12", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-8 rounded-full" }) }),
|
|
5389
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "min-w-[200px] max-w-[30%]", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-3/4" }) }),
|
|
5390
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-full" }) }),
|
|
5391
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-48", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-20" }) }),
|
|
5392
|
-
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "w-48", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-4 w-20" }) })
|
|
5393
|
-
] }, i)) : groupEvals(evals).length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { children: [
|
|
5587
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { className: "border-b border-gray-6 relative", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { mode: "wait", presenceAffectsLayout: false, children: groupEvals(evals).length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(TableRow, { children: [
|
|
5394
5588
|
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { className: "h-12 w-16" }),
|
|
5395
5589
|
/* @__PURE__ */ jsxRuntime.jsx(TableCell, { colSpan: 4, className: "h-32 px-4 text-center text-mastra-el-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
5396
5590
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-5" }),
|
|
@@ -6743,6 +6937,10 @@ function WorkflowTracesInner({ traces, error, runId, stepName }) {
|
|
|
6743
6937
|
] });
|
|
6744
6938
|
}
|
|
6745
6939
|
|
|
6940
|
+
function Skeleton({ className, ...props }) {
|
|
6941
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
|
|
6942
|
+
}
|
|
6943
|
+
|
|
6746
6944
|
const sanitizeWorkflowWatchResult = (record) => {
|
|
6747
6945
|
const formattedResults = Object.entries(record.payload.workflowState.steps || {}).reduce(
|
|
6748
6946
|
(acc, [key, value]) => {
|
|
@@ -6823,33 +7021,6 @@ const useLegacyWorkflow = (workflowId) => {
|
|
|
6823
7021
|
}, [workflowId]);
|
|
6824
7022
|
return { legacyWorkflow, isLoading };
|
|
6825
7023
|
};
|
|
6826
|
-
const useWorkflow = (workflowId) => {
|
|
6827
|
-
const [workflow, setWorkflow] = React.useState(null);
|
|
6828
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
6829
|
-
const client = useMastraClient();
|
|
6830
|
-
React.useEffect(() => {
|
|
6831
|
-
const fetchWorkflow = async () => {
|
|
6832
|
-
setIsLoading(true);
|
|
6833
|
-
try {
|
|
6834
|
-
if (!workflowId) {
|
|
6835
|
-
setWorkflow(null);
|
|
6836
|
-
setIsLoading(false);
|
|
6837
|
-
return;
|
|
6838
|
-
}
|
|
6839
|
-
const res = await client.getWorkflow(workflowId).details();
|
|
6840
|
-
setWorkflow(res);
|
|
6841
|
-
} catch (error) {
|
|
6842
|
-
setWorkflow(null);
|
|
6843
|
-
console.error("Error fetching workflow", error);
|
|
6844
|
-
sonner.toast.error("Error fetching workflow");
|
|
6845
|
-
} finally {
|
|
6846
|
-
setIsLoading(false);
|
|
6847
|
-
}
|
|
6848
|
-
};
|
|
6849
|
-
fetchWorkflow();
|
|
6850
|
-
}, [workflowId]);
|
|
6851
|
-
return { workflow, isLoading };
|
|
6852
|
-
};
|
|
6853
7024
|
const useExecuteWorkflow = () => {
|
|
6854
7025
|
const client = useMastraClient();
|
|
6855
7026
|
const createLegacyWorkflowRun = async ({ workflowId, prevRunId }) => {
|
|
@@ -8467,7 +8638,8 @@ const BooleanField = ({ field, label, id, inputProps, value }) => /* @__PURE__ *
|
|
|
8467
8638
|
};
|
|
8468
8639
|
inputProps.onChange(event);
|
|
8469
8640
|
},
|
|
8470
|
-
defaultChecked: field.default
|
|
8641
|
+
defaultChecked: field.default,
|
|
8642
|
+
disabled: inputProps.disabled || inputProps.readOnly
|
|
8471
8643
|
}
|
|
8472
8644
|
),
|
|
8473
8645
|
/* @__PURE__ */ jsxRuntime.jsxs(Txt, { as: "label", variant: "ui-sm", className: "text-icon3", htmlFor: id, children: [
|
|
@@ -8969,21 +9141,26 @@ const ShadcnUIComponents = {
|
|
|
8969
9141
|
ArrayWrapper,
|
|
8970
9142
|
ArrayElementWrapper
|
|
8971
9143
|
};
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
record: RecordField
|
|
8979
|
-
};
|
|
8980
|
-
function AutoForm({ uiComponents, formComponents, ...props }) {
|
|
9144
|
+
function AutoForm({
|
|
9145
|
+
uiComponents,
|
|
9146
|
+
formComponents,
|
|
9147
|
+
readOnly,
|
|
9148
|
+
...props
|
|
9149
|
+
}) {
|
|
8981
9150
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8982
9151
|
react$3.AutoForm,
|
|
8983
9152
|
{
|
|
8984
9153
|
...props,
|
|
8985
9154
|
uiComponents: { ...ShadcnUIComponents, ...uiComponents },
|
|
8986
|
-
formComponents: {
|
|
9155
|
+
formComponents: {
|
|
9156
|
+
string: (props2) => /* @__PURE__ */ jsxRuntime.jsx(StringField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9157
|
+
number: (props2) => /* @__PURE__ */ jsxRuntime.jsx(NumberField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9158
|
+
boolean: (props2) => /* @__PURE__ */ jsxRuntime.jsx(BooleanField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9159
|
+
date: (props2) => /* @__PURE__ */ jsxRuntime.jsx(DateField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9160
|
+
select: (props2) => /* @__PURE__ */ jsxRuntime.jsx(SelectField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9161
|
+
record: (props2) => /* @__PURE__ */ jsxRuntime.jsx(RecordField, { ...props2, inputProps: { ...props2.inputProps, readOnly } }),
|
|
9162
|
+
...formComponents
|
|
9163
|
+
}
|
|
8987
9164
|
}
|
|
8988
9165
|
);
|
|
8989
9166
|
}
|
|
@@ -9080,7 +9257,8 @@ function DynamicForm({
|
|
|
9080
9257
|
defaultValues,
|
|
9081
9258
|
isSubmitLoading,
|
|
9082
9259
|
submitButtonLabel,
|
|
9083
|
-
className
|
|
9260
|
+
className,
|
|
9261
|
+
readOnly
|
|
9084
9262
|
}) {
|
|
9085
9263
|
if (!schema) {
|
|
9086
9264
|
console.error("no form schema found");
|
|
@@ -9112,7 +9290,7 @@ function DynamicForm({
|
|
|
9112
9290
|
},
|
|
9113
9291
|
withSubmit: true
|
|
9114
9292
|
};
|
|
9115
|
-
return /* @__PURE__ */ jsxRuntime.jsx(AutoForm, { ...formProps });
|
|
9293
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AutoForm, { ...formProps, readOnly });
|
|
9116
9294
|
}
|
|
9117
9295
|
|
|
9118
9296
|
function resolveSerializedZodOutput(obj) {
|
|
@@ -9638,8 +9816,7 @@ function WorkflowGraphInner({ workflow, onShowTrace }) {
|
|
|
9638
9816
|
) });
|
|
9639
9817
|
}
|
|
9640
9818
|
|
|
9641
|
-
function WorkflowGraph({ workflowId, onShowTrace }) {
|
|
9642
|
-
const { workflow, isLoading } = useWorkflow(workflowId);
|
|
9819
|
+
function WorkflowGraph({ workflowId, onShowTrace, workflow, isLoading }) {
|
|
9643
9820
|
const { snapshot } = React.useContext(WorkflowRunContext);
|
|
9644
9821
|
if (isLoading) {
|
|
9645
9822
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-full" }) });
|
|
@@ -9663,10 +9840,14 @@ function WorkflowGraph({ workflowId, onShowTrace }) {
|
|
|
9663
9840
|
) }) }, snapshot?.runId ?? workflowId);
|
|
9664
9841
|
}
|
|
9665
9842
|
|
|
9666
|
-
function WorkflowTrigger({
|
|
9843
|
+
function WorkflowTrigger({
|
|
9844
|
+
workflowId,
|
|
9845
|
+
setRunId,
|
|
9846
|
+
workflow,
|
|
9847
|
+
isLoading
|
|
9848
|
+
}) {
|
|
9667
9849
|
const { runtimeContext } = usePlaygroundStore();
|
|
9668
9850
|
const { result, setResult, payload, setPayload } = React.useContext(WorkflowRunContext);
|
|
9669
|
-
const { isLoading, workflow } = useWorkflow(workflowId);
|
|
9670
9851
|
const { createWorkflowRun, startWorkflowRun } = useExecuteWorkflow();
|
|
9671
9852
|
const { watchWorkflow, watchResult, isWatchingWorkflow } = useWatchWorkflow();
|
|
9672
9853
|
const { resumeWorkflow, isResumingWorkflow } = useResumeWorkflow();
|
|
@@ -9709,7 +9890,8 @@ function WorkflowTrigger({ workflowId, setRunId }) {
|
|
|
9709
9890
|
const suspended = Object.entries(watchResultToUse.payload.workflowState.steps).filter(([_, { status }]) => status === "suspended").map(([stepId, { payload: payload2 }]) => ({
|
|
9710
9891
|
stepId,
|
|
9711
9892
|
runId: result.runId,
|
|
9712
|
-
suspendPayload: payload2
|
|
9893
|
+
suspendPayload: payload2,
|
|
9894
|
+
isLoading: false
|
|
9713
9895
|
}));
|
|
9714
9896
|
setSuspendedSteps(suspended);
|
|
9715
9897
|
}, [watchResultToUse, result]);
|
|
@@ -9780,17 +9962,62 @@ function WorkflowTrigger({ workflowId, setRunId }) {
|
|
|
9780
9962
|
stepId: step.stepId,
|
|
9781
9963
|
runId: step.runId,
|
|
9782
9964
|
suspendPayload: step.suspendPayload,
|
|
9783
|
-
resumeData: data
|
|
9784
|
-
});
|
|
9965
|
+
resumeData: data});
|
|
9785
9966
|
}
|
|
9786
9967
|
}
|
|
9787
9968
|
)
|
|
9788
9969
|
] });
|
|
9789
9970
|
})
|
|
9790
9971
|
] }),
|
|
9791
|
-
result && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowJsonDialog, { result: restResult }) })
|
|
9972
|
+
result && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 border-b-sm border-border1", children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowJsonDialog, { result: restResult }) }),
|
|
9973
|
+
result && /* @__PURE__ */ jsxRuntime.jsx(WorkflowResultSection, { result, workflow })
|
|
9792
9974
|
] });
|
|
9793
9975
|
}
|
|
9976
|
+
const WorkflowResultSection = ({ result, workflow }) => {
|
|
9977
|
+
const workflowState = result.payload.workflowState;
|
|
9978
|
+
const hasResult = Object.keys(workflowState.steps || {}).length > 0;
|
|
9979
|
+
if (!hasResult) return null;
|
|
9980
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-5", children: [
|
|
9981
|
+
/* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: "Final Output" }),
|
|
9982
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "pt-4", children: Object.entries(workflowState.steps || {}).map(([stepId, stepResult]) => {
|
|
9983
|
+
const stepDefinition = workflow.steps[stepId];
|
|
9984
|
+
if (!stepDefinition) return null;
|
|
9985
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9986
|
+
"li",
|
|
9987
|
+
{
|
|
9988
|
+
className: "border-b-sm border-dashed border-border1 last:border-b-0 py-4 first:pt-0 last:pb-0",
|
|
9989
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(WorkflowResultFinishedStep, { stepResult: stepResult.output, stepDefinition })
|
|
9990
|
+
},
|
|
9991
|
+
stepId
|
|
9992
|
+
);
|
|
9993
|
+
}) })
|
|
9994
|
+
] });
|
|
9995
|
+
};
|
|
9996
|
+
const WorkflowResultFinishedStep = ({ stepResult, stepDefinition }) => {
|
|
9997
|
+
const id = React.useId();
|
|
9998
|
+
try {
|
|
9999
|
+
const zodObjectSchema = resolveSerializedZodOutput(jsonSchemaToZod(superjson.parse(stepDefinition.outputSchema)));
|
|
10000
|
+
if (zodObjectSchema?._def?.typeName === "ZodString") {
|
|
10001
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
10002
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10003
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, { className: "text-icon3" }) }),
|
|
10004
|
+
/* @__PURE__ */ jsxRuntime.jsx(Txt, { as: "label", htmlFor: id, variant: "ui-sm", className: "text-icon3", children: stepDefinition.description || stepDefinition.id })
|
|
10005
|
+
] }),
|
|
10006
|
+
/* @__PURE__ */ jsxRuntime.jsx(Input, { id, defaultValue: stepResult, readOnly: true })
|
|
10007
|
+
] });
|
|
10008
|
+
}
|
|
10009
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10010
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pb-2", children: [
|
|
10011
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Footprints, { className: "text-icon3" }) }),
|
|
10012
|
+
/* @__PURE__ */ jsxRuntime.jsx(Txt, { variant: "ui-sm", className: "text-icon3", children: stepDefinition.description || stepDefinition.id })
|
|
10013
|
+
] }),
|
|
10014
|
+
/* @__PURE__ */ jsxRuntime.jsx(DynamicForm, { schema: zodObjectSchema, defaultValues: stepResult, readOnly: true })
|
|
10015
|
+
] });
|
|
10016
|
+
} catch (err) {
|
|
10017
|
+
console.error("Error parsing output schema", err);
|
|
10018
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Txt, { children: "An error occured. Please open an issue on GitHub." });
|
|
10019
|
+
}
|
|
10020
|
+
};
|
|
9794
10021
|
const WorkflowJsonDialog = ({ result }) => {
|
|
9795
10022
|
const [open, setOpen] = React.useState(false);
|
|
9796
10023
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|