@mastra/playground-ui 29.0.0-alpha.0 → 29.0.0-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/CHANGELOG.md +36 -0
- package/dist/index.cjs.js +178 -107
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +70 -8
- package/dist/index.es.js +180 -108
- package/dist/index.es.js.map +1 -1
- package/dist/src/domains/traces/components/traces-list-view.d.ts +4 -1
- package/dist/src/ds/components/Command/command.d.ts +6 -6
- package/dist/src/ds/components/DataList/TracesDataList/traces-data-list-cells.d.ts +6 -6
- package/dist/src/ds/components/DataList/TracesDataList/traces-data-list.d.ts +1 -2
- package/dist/src/ds/components/MainSidebar/main-sidebar-nav-link.d.ts +1 -1
- package/dist/src/ds/components/PageLayout/page-layout-row.d.ts +8 -2
- package/dist/src/ds/components/ScrollArea/scroll-area.d.ts +2 -2
- package/dist/src/ds/components/Tooltip/tooltip.d.ts +18 -5
- package/dist/src/ds/components/Tooltip/tooltip.stories.d.ts +3 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @mastra/playground-ui
|
|
2
2
|
|
|
3
|
+
## 29.0.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Moved the Level icon from its own column into the Name column, next to the trace name, on the Observability traces list. ([#16712](https://github.com/mastra-ai/mastra/pull/16712))
|
|
8
|
+
|
|
9
|
+
- Added `align` and `stack` variants to `PageLayout.Row`. Use `stack="responsive"` for top bars that should collapse to a vertical stack on narrow viewports, and `align="center"` to vertically center children. Applied the new variants to the Prompts and Workflows top bars so the search field and primary action share a single row on desktop and stack on mobile. ([#16714](https://github.com/mastra-ai/mastra/pull/16714))
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<PageLayout.Row align="center" stack="responsive">
|
|
13
|
+
<ListSearch ... />
|
|
14
|
+
<Button ...>Create</Button>
|
|
15
|
+
</PageLayout.Row>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- Fixed double-counted cache token costs in the Metrics dashboard. The Model Usage & Cost table and the Token Usage by Agent table were summing cache read/write costs on top of the total input cost, which already includes them. ([#16737](https://github.com/mastra-ai/mastra/pull/16737))
|
|
19
|
+
|
|
20
|
+
- Migrated the Tooltip primitive to Base UI while preserving the existing API. The popup explicitly sets `role="tooltip"` so consumers can keep querying it via `getByRole('tooltip')` (Base UI does not add this role automatically). Existing `<TooltipTrigger asChild>` usage continues to work unchanged, and Base UI's native `render` prop is now also supported on `TooltipTrigger` so consumers wrapping anchors, custom router links, or icons can pass the element directly without an `asChild` adapter: ([#16713](https://github.com/mastra-ai/mastra/pull/16713))
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
// Still supported
|
|
24
|
+
<TooltipTrigger asChild>
|
|
25
|
+
<Button>Save</Button>
|
|
26
|
+
</TooltipTrigger>
|
|
27
|
+
|
|
28
|
+
// New: pass the element via Base UI's native API
|
|
29
|
+
<TooltipTrigger render={<Button>Save</Button>} />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Also fixed the arrow rendering so the diagonal stroke meets the popup outline at the exact same pixel center on every side, removing the ~1px seam previously visible where the arrow joined the popup edge.
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [[`8cdb86c`](https://github.com/mastra-ai/mastra/commit/8cdb86ceed1137bc2768e147dce85a0692b9fb26), [`9692d60`](https://github.com/mastra-ai/mastra/commit/9692d60298e8f629d10de54867642a38955fb708), [`eda90c5`](https://github.com/mastra-ai/mastra/commit/eda90c5bfd7de11805ecc9f4552716c895fbaf78), [`afc004f`](https://github.com/mastra-ai/mastra/commit/afc004f5cc7e30697809e7021820b9f5881e6719), [`408be73`](https://github.com/mastra-ai/mastra/commit/408be73449dfab92b51eab8c6623b6c443debc25)]:
|
|
35
|
+
- @mastra/core@1.36.0-alpha.1
|
|
36
|
+
- @mastra/client-js@1.20.0-alpha.1
|
|
37
|
+
- @mastra/react@0.4.0-alpha.1
|
|
38
|
+
|
|
3
39
|
## 29.0.0-alpha.0
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
require('./index.css');const jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
const tokens = require('./tokens.cjs.js');
|
|
7
7
|
const React = require('react');
|
|
8
|
-
const
|
|
8
|
+
const tooltip = require('@base-ui/react/tooltip');
|
|
9
9
|
const langJson = require('@codemirror/lang-json');
|
|
10
10
|
const langMarkdown = require('@codemirror/lang-markdown');
|
|
11
11
|
const language = require('@codemirror/language');
|
|
@@ -73,7 +73,6 @@ function _interopNamespaceDefault(e) {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
76
|
-
const TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TooltipPrimitive);
|
|
77
76
|
const AlertDialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(AlertDialogPrimitive);
|
|
78
77
|
const CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CheckboxPrimitive);
|
|
79
78
|
const CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(CollapsiblePrimitive);
|
|
@@ -3553,26 +3552,88 @@ const cva = (base, config)=>(props)=>{
|
|
|
3553
3552
|
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
3554
3553
|
};
|
|
3555
3554
|
|
|
3556
|
-
|
|
3557
|
-
const
|
|
3558
|
-
const
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3555
|
+
function TooltipProvider({ delay, delayDuration, timeout, skipDelayDuration, ...props }) {
|
|
3556
|
+
const resolvedDelay = delay ?? delayDuration;
|
|
3557
|
+
const resolvedTimeout = timeout ?? skipDelayDuration;
|
|
3558
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3559
|
+
tooltip.Tooltip.Provider,
|
|
3560
|
+
{
|
|
3561
|
+
...resolvedDelay !== void 0 ? { delay: resolvedDelay } : {},
|
|
3562
|
+
...resolvedTimeout !== void 0 ? { timeout: resolvedTimeout } : {},
|
|
3563
|
+
...props
|
|
3564
|
+
}
|
|
3565
|
+
);
|
|
3566
|
+
}
|
|
3567
|
+
const Tooltip = tooltip.Tooltip.Root;
|
|
3568
|
+
const TooltipTrigger = React__namespace.forwardRef(
|
|
3569
|
+
({ asChild, render, children, ...props }, ref) => {
|
|
3570
|
+
if (asChild && React__namespace.isValidElement(children)) {
|
|
3571
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Trigger, { ref, render: children, ...props });
|
|
3572
|
+
}
|
|
3573
|
+
return /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Trigger, { ref, render, ...props, children });
|
|
3573
3574
|
}
|
|
3574
|
-
)
|
|
3575
|
-
|
|
3575
|
+
);
|
|
3576
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
|
3577
|
+
const TooltipContent = React__namespace.forwardRef(
|
|
3578
|
+
({ className, side = "top", sideOffset = 8, align = "center", alignOffset = 0, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3579
|
+
tooltip.Tooltip.Positioner,
|
|
3580
|
+
{
|
|
3581
|
+
side,
|
|
3582
|
+
sideOffset,
|
|
3583
|
+
align,
|
|
3584
|
+
alignOffset,
|
|
3585
|
+
arrowPadding: 10,
|
|
3586
|
+
className: "isolate z-[100]",
|
|
3587
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3588
|
+
tooltip.Tooltip.Popup,
|
|
3589
|
+
{
|
|
3590
|
+
ref,
|
|
3591
|
+
role: "tooltip",
|
|
3592
|
+
className: cn(
|
|
3593
|
+
"relative z-[100] flex flex-col origin-(--transform-origin) rounded-lg border border-border1 bg-surface3 px-2.5 py-1.5 text-ui-sm leading-ui-sm text-neutral5 shadow-dialog transition-[transform,scale,opacity] duration-150",
|
|
3594
|
+
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
|
|
3595
|
+
"data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
3596
|
+
"data-[instant]:transition-none",
|
|
3597
|
+
className
|
|
3598
|
+
),
|
|
3599
|
+
...props,
|
|
3600
|
+
children: [
|
|
3601
|
+
children,
|
|
3602
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3603
|
+
tooltip.Tooltip.Arrow,
|
|
3604
|
+
{
|
|
3605
|
+
className: cn(
|
|
3606
|
+
"flex",
|
|
3607
|
+
"data-[side=top]:-bottom-[8px] data-[side=top]:rotate-180",
|
|
3608
|
+
"data-[side=bottom]:-top-[8px]",
|
|
3609
|
+
"data-[side=left]:-right-[10px] data-[side=left]:rotate-90",
|
|
3610
|
+
"data-[side=right]:-left-[10px] data-[side=right]:-rotate-90"
|
|
3611
|
+
),
|
|
3612
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(TooltipArrowSvg, {})
|
|
3613
|
+
}
|
|
3614
|
+
)
|
|
3615
|
+
]
|
|
3616
|
+
}
|
|
3617
|
+
)
|
|
3618
|
+
}
|
|
3619
|
+
) })
|
|
3620
|
+
);
|
|
3621
|
+
TooltipContent.displayName = "TooltipContent";
|
|
3622
|
+
function TooltipArrowSvg() {
|
|
3623
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", overflow: "visible", children: [
|
|
3624
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z", className: "fill-surface3" }),
|
|
3625
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3626
|
+
"path",
|
|
3627
|
+
{
|
|
3628
|
+
d: "M0 7.5L4 2.5Q6 0.5 8 2.5L12 7.5",
|
|
3629
|
+
className: "fill-none stroke-border1",
|
|
3630
|
+
strokeWidth: "1",
|
|
3631
|
+
strokeLinejoin: "round",
|
|
3632
|
+
strokeLinecap: "round"
|
|
3633
|
+
}
|
|
3634
|
+
)
|
|
3635
|
+
] });
|
|
3636
|
+
}
|
|
3576
3637
|
|
|
3577
3638
|
const formElementSizes = {
|
|
3578
3639
|
sm: "h-form-sm",
|
|
@@ -10820,14 +10881,14 @@ function MainSidebarNavLink({
|
|
|
10820
10881
|
/* @__PURE__ */ jsxRuntime.jsx(MainSidebarNavLabel, { state, children: link.name }),
|
|
10821
10882
|
children,
|
|
10822
10883
|
link.isExperimental && !isCollapsed && !needsTooltip && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
10823
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, {
|
|
10824
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center",
|
|
10884
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleAlertIcon, { className: "ml-auto stroke-accent5" }) }),
|
|
10885
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center", sideOffset: 16, children: "Experimental Feature" })
|
|
10825
10886
|
] })
|
|
10826
10887
|
] });
|
|
10827
10888
|
}
|
|
10828
|
-
return /* @__PURE__ */ jsxRuntime.jsx("li", { ...props, className: cn("flex relative min-w-0", className), children: link && needsTooltip && interactiveEl ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
10829
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, {
|
|
10830
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center",
|
|
10889
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { ...props, className: cn("flex relative min-w-0", className), children: link && needsTooltip && React.isValidElement(interactiveEl) ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
10890
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { render: interactiveEl }),
|
|
10891
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", align: "center", sideOffset: 16, children: link.tooltipMsg ? isCollapsed ? `${link.name} | ${link.tooltipMsg}` : link.tooltipMsg : link.name })
|
|
10831
10892
|
] }) : interactiveEl ?? children });
|
|
10832
10893
|
}
|
|
10833
10894
|
|
|
@@ -11132,39 +11193,42 @@ function MainSidebarTrigger({ className, onClick, ...props }) {
|
|
|
11132
11193
|
const { desktopState, toggleSidebar } = useMainSidebar();
|
|
11133
11194
|
const isCollapsed = desktopState === "collapsed";
|
|
11134
11195
|
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
11135
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11136
|
-
|
|
11196
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11197
|
+
TooltipTrigger,
|
|
11137
11198
|
{
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
"aria-expanded": !isCollapsed,
|
|
11141
|
-
...props,
|
|
11142
|
-
onClick: (event) => {
|
|
11143
|
-
onClick?.(event);
|
|
11144
|
-
if (!event.defaultPrevented) toggleSidebar();
|
|
11145
|
-
},
|
|
11146
|
-
className: cn(
|
|
11147
|
-
"flex items-center justify-center text-neutral3 rounded-md",
|
|
11148
|
-
// Both states share size-9 (36px) — matches NavLink height,
|
|
11149
|
-
// so toggling collapse never shifts surrounding rows.
|
|
11150
|
-
"size-9",
|
|
11151
|
-
isCollapsed ? "mx-auto" : "ml-auto",
|
|
11152
|
-
"hover:bg-sidebar-nav-hover hover:text-neutral6",
|
|
11153
|
-
"transition-all duration-normal ease-out-custom",
|
|
11154
|
-
"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring",
|
|
11155
|
-
"[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&:hover_svg]:text-neutral5 [&_svg]:transition-transform [&_svg]:duration-normal",
|
|
11156
|
-
className
|
|
11157
|
-
),
|
|
11158
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11159
|
-
lucideReact.PanelRightIcon,
|
|
11199
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11200
|
+
"button",
|
|
11160
11201
|
{
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11202
|
+
type: "button",
|
|
11203
|
+
"aria-label": "Toggle sidebar",
|
|
11204
|
+
"aria-expanded": !isCollapsed,
|
|
11205
|
+
...props,
|
|
11206
|
+
onClick: (event) => {
|
|
11207
|
+
onClick?.(event);
|
|
11208
|
+
if (!event.defaultPrevented) toggleSidebar();
|
|
11209
|
+
},
|
|
11210
|
+
className: cn(
|
|
11211
|
+
"flex items-center justify-center text-neutral3 rounded-md",
|
|
11212
|
+
"size-9",
|
|
11213
|
+
isCollapsed ? "mx-auto" : "ml-auto",
|
|
11214
|
+
"hover:bg-sidebar-nav-hover hover:text-neutral6",
|
|
11215
|
+
"transition-all duration-normal ease-out-custom",
|
|
11216
|
+
"focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-accent1 focus-visible:shadow-focus-ring",
|
|
11217
|
+
"[&_svg]:w-4 [&_svg]:h-4 [&_svg]:text-neutral3 [&:hover_svg]:text-neutral5 [&_svg]:transition-transform [&_svg]:duration-normal",
|
|
11218
|
+
className
|
|
11219
|
+
),
|
|
11220
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11221
|
+
lucideReact.PanelRightIcon,
|
|
11222
|
+
{
|
|
11223
|
+
className: cn({
|
|
11224
|
+
"rotate-180": isCollapsed
|
|
11225
|
+
})
|
|
11226
|
+
}
|
|
11227
|
+
)
|
|
11164
11228
|
}
|
|
11165
11229
|
)
|
|
11166
11230
|
}
|
|
11167
|
-
)
|
|
11231
|
+
),
|
|
11168
11232
|
/* @__PURE__ */ jsxRuntime.jsxs(TooltipContent, { children: [
|
|
11169
11233
|
"Toggle Sidebar",
|
|
11170
11234
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 [&>svg]:w-[1em] [&>svg]:h-[1em]", children: [
|
|
@@ -13238,12 +13302,6 @@ function getShortId(id) {
|
|
|
13238
13302
|
function TracesDataListIdCell({ traceId }) {
|
|
13239
13303
|
return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "text-ui-smd font-mono text-neutral3", children: getShortId(traceId) });
|
|
13240
13304
|
}
|
|
13241
|
-
function TracesDataListKindCell({ parentSpanId }) {
|
|
13242
|
-
const isRoot = parentSpanId == null;
|
|
13243
|
-
const Icon = isRoot ? lucideReact.ListTreeIcon : lucideReact.CornerDownRightIcon;
|
|
13244
|
-
const label = isRoot ? "Trace" : "Subtrace";
|
|
13245
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { title: label, "aria-label": label, className: "inline-flex", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: cn("shrink-0", isRoot ? "size-4 text-neutral3" : "size-3 text-neutral3"), "aria-hidden": true }) }) });
|
|
13246
|
-
}
|
|
13247
13305
|
function TracesDataListDateCell({ timestamp }) {
|
|
13248
13306
|
const date = toDate$2(timestamp);
|
|
13249
13307
|
return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "text-ui-smd text-neutral2", children: date ? dateFns.isToday(date) ? "Today" : dateFns.format(date, "MMM dd") : "-" });
|
|
@@ -13258,8 +13316,18 @@ function TracesDataListTimeCell({ timestamp }) {
|
|
|
13258
13316
|
] })
|
|
13259
13317
|
] }) : "-" });
|
|
13260
13318
|
}
|
|
13261
|
-
function TracesDataListNameCell({ name }) {
|
|
13262
|
-
|
|
13319
|
+
function TracesDataListNameCell({ name, parentSpanId, showLevelTooltip }) {
|
|
13320
|
+
const isRoot = parentSpanId == null;
|
|
13321
|
+
const Icon = isRoot ? lucideReact.ListTreeIcon : lucideReact.CornerDownRightIcon;
|
|
13322
|
+
const label = isRoot ? "Trace" : "Subtrace";
|
|
13323
|
+
const icon = /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-label": label, className: "inline-flex shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: cn("size-4 shrink-0", isRoot ? "text-neutral3" : "text-neutral2"), "aria-hidden": true }) });
|
|
13324
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DataListCell, { height: "compact", className: "text-neutral4 text-ui-smd min-w-0 flex items-center gap-2", children: [
|
|
13325
|
+
showLevelTooltip ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
13326
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: icon }),
|
|
13327
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { children: label })
|
|
13328
|
+
] }) : icon,
|
|
13329
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: name || "-" })
|
|
13330
|
+
] });
|
|
13263
13331
|
}
|
|
13264
13332
|
function TracesDataListInputCell({ input }) {
|
|
13265
13333
|
return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-neutral3 text-ui-smd font-mono truncate", children: input || "-" }) });
|
|
@@ -13308,7 +13376,6 @@ const TracesDataList = Object.assign(TracesDataListRoot, {
|
|
|
13308
13376
|
SubHeading: DataListSubHeading,
|
|
13309
13377
|
Spacer: DataListSpacer,
|
|
13310
13378
|
IdCell: TracesDataListIdCell,
|
|
13311
|
-
KindCell: TracesDataListKindCell,
|
|
13312
13379
|
DateCell: TracesDataListDateCell,
|
|
13313
13380
|
TimeCell: TracesDataListTimeCell,
|
|
13314
13381
|
NameCell: TracesDataListNameCell,
|
|
@@ -13691,8 +13758,36 @@ function PageLayoutRoot({
|
|
|
13691
13758
|
);
|
|
13692
13759
|
}
|
|
13693
13760
|
|
|
13694
|
-
|
|
13695
|
-
|
|
13761
|
+
const pageLayoutRowVariants = cva("flex justify-between gap-3", {
|
|
13762
|
+
variants: {
|
|
13763
|
+
align: {
|
|
13764
|
+
start: "items-start",
|
|
13765
|
+
center: "items-center"
|
|
13766
|
+
},
|
|
13767
|
+
stack: {
|
|
13768
|
+
horizontal: "flex-row",
|
|
13769
|
+
responsive: "flex-col items-stretch sm:flex-row"
|
|
13770
|
+
}
|
|
13771
|
+
},
|
|
13772
|
+
compoundVariants: [
|
|
13773
|
+
{
|
|
13774
|
+
stack: "responsive",
|
|
13775
|
+
align: "start",
|
|
13776
|
+
class: "sm:items-start"
|
|
13777
|
+
},
|
|
13778
|
+
{
|
|
13779
|
+
stack: "responsive",
|
|
13780
|
+
align: "center",
|
|
13781
|
+
class: "sm:items-center"
|
|
13782
|
+
}
|
|
13783
|
+
],
|
|
13784
|
+
defaultVariants: {
|
|
13785
|
+
align: "start",
|
|
13786
|
+
stack: "horizontal"
|
|
13787
|
+
}
|
|
13788
|
+
});
|
|
13789
|
+
function PageLayoutRow({ children, className, align, stack }) {
|
|
13790
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(pageLayoutRowVariants({ align, stack }), className), children });
|
|
13696
13791
|
}
|
|
13697
13792
|
|
|
13698
13793
|
function PageLayoutTopArea({ children, className }) {
|
|
@@ -17312,14 +17407,13 @@ function useModelUsageCostMetrics() {
|
|
|
17312
17407
|
return reactQuery.useQuery({
|
|
17313
17408
|
queryKey: ["metrics", "model-usage-cost", filterKey],
|
|
17314
17409
|
queryFn: async () => {
|
|
17315
|
-
const metrics = [
|
|
17316
|
-
"mastra_model_total_input_tokens",
|
|
17317
|
-
"mastra_model_total_output_tokens",
|
|
17318
|
-
"mastra_model_input_cache_read_tokens",
|
|
17319
|
-
"mastra_model_input_cache_write_tokens"
|
|
17320
|
-
];
|
|
17321
17410
|
const [inputRes, outputRes, cacheReadRes, cacheWriteRes] = await Promise.all(
|
|
17322
|
-
|
|
17411
|
+
[
|
|
17412
|
+
"mastra_model_total_input_tokens",
|
|
17413
|
+
"mastra_model_total_output_tokens",
|
|
17414
|
+
"mastra_model_input_cache_read_tokens",
|
|
17415
|
+
"mastra_model_input_cache_write_tokens"
|
|
17416
|
+
].map(
|
|
17323
17417
|
(name) => client.getMetricBreakdown({
|
|
17324
17418
|
name: [name],
|
|
17325
17419
|
groupBy: ["model"],
|
|
@@ -17358,13 +17452,11 @@ function useModelUsageCostMetrics() {
|
|
|
17358
17452
|
const m = group.dimensions.model ?? "unknown";
|
|
17359
17453
|
const entry = ensureModel(m);
|
|
17360
17454
|
entry.cacheRead = group.value;
|
|
17361
|
-
addCost(entry, group);
|
|
17362
17455
|
}
|
|
17363
17456
|
for (const group of cacheWriteRes.groups) {
|
|
17364
17457
|
const m = group.dimensions.model ?? "unknown";
|
|
17365
17458
|
const entry = ensureModel(m);
|
|
17366
17459
|
entry.cacheWrite = group.value;
|
|
17367
|
-
addCost(entry, group);
|
|
17368
17460
|
}
|
|
17369
17461
|
return Array.from(modelMap.entries()).map(([model, vals]) => ({
|
|
17370
17462
|
model,
|
|
@@ -17562,11 +17654,9 @@ function useTokenUsageByAgentMetrics() {
|
|
|
17562
17654
|
orderDirection: "DESC",
|
|
17563
17655
|
filters
|
|
17564
17656
|
};
|
|
17565
|
-
const [inputRes, outputRes
|
|
17657
|
+
const [inputRes, outputRes] = await Promise.all([
|
|
17566
17658
|
client.getMetricBreakdown({ ...breakdownBase, name: ["mastra_model_total_input_tokens"] }),
|
|
17567
|
-
client.getMetricBreakdown({ ...breakdownBase, name: ["mastra_model_total_output_tokens"] })
|
|
17568
|
-
client.getMetricBreakdown({ ...breakdownBase, name: ["mastra_model_input_cache_read_tokens"] }),
|
|
17569
|
-
client.getMetricBreakdown({ ...breakdownBase, name: ["mastra_model_input_cache_write_tokens"] })
|
|
17659
|
+
client.getMetricBreakdown({ ...breakdownBase, name: ["mastra_model_total_output_tokens"] })
|
|
17570
17660
|
]);
|
|
17571
17661
|
const agentMap = /* @__PURE__ */ new Map();
|
|
17572
17662
|
const ensure = (name) => {
|
|
@@ -17593,16 +17683,6 @@ function useTokenUsageByAgentMetrics() {
|
|
|
17593
17683
|
entry.output = group.value;
|
|
17594
17684
|
addCost(entry, group);
|
|
17595
17685
|
}
|
|
17596
|
-
for (const group of cacheReadRes.groups) {
|
|
17597
|
-
const name = group.dimensions.entityName ?? "unknown";
|
|
17598
|
-
const entry = ensure(name);
|
|
17599
|
-
addCost(entry, group);
|
|
17600
|
-
}
|
|
17601
|
-
for (const group of cacheWriteRes.groups) {
|
|
17602
|
-
const name = group.dimensions.entityName ?? "unknown";
|
|
17603
|
-
const entry = ensure(name);
|
|
17604
|
-
addCost(entry, group);
|
|
17605
|
-
}
|
|
17606
17686
|
return Array.from(agentMap.entries()).map(([name, vals]) => ({
|
|
17607
17687
|
name,
|
|
17608
17688
|
input: vals.input,
|
|
@@ -20033,7 +20113,7 @@ function TracesLayout({
|
|
|
20033
20113
|
);
|
|
20034
20114
|
}
|
|
20035
20115
|
|
|
20036
|
-
const COLUMNS$1 = "
|
|
20116
|
+
const COLUMNS$1 = "6rem 9rem 14rem minmax(8rem,1fr) 14rem 6rem";
|
|
20037
20117
|
const ROW_HEIGHT$1 = 36;
|
|
20038
20118
|
const OVERSCAN$1 = 8;
|
|
20039
20119
|
function TracesListView({
|
|
@@ -20045,6 +20125,7 @@ function TracesListView({
|
|
|
20045
20125
|
filtersApplied,
|
|
20046
20126
|
featuredTraceId,
|
|
20047
20127
|
featuredSpanId,
|
|
20128
|
+
isBranchesMode,
|
|
20048
20129
|
onTraceClick
|
|
20049
20130
|
}) {
|
|
20050
20131
|
const scrollRef = React.useRef(null);
|
|
@@ -20070,22 +20151,6 @@ function TracesListView({
|
|
|
20070
20151
|
const paddingBottom = virtualItems.length > 0 ? Math.max(0, totalSize - (virtualItems[virtualItems.length - 1]?.end ?? 0)) : 0;
|
|
20071
20152
|
return /* @__PURE__ */ jsxRuntime.jsxs(TracesDataList, { columns: COLUMNS$1, scrollRef, className: "min-w-0", children: [
|
|
20072
20153
|
/* @__PURE__ */ jsxRuntime.jsxs(TracesDataList.Top, { children: [
|
|
20073
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20074
|
-
TracesDataList.TopCellWithTooltip,
|
|
20075
|
-
{
|
|
20076
|
-
tooltip: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1", children: [
|
|
20077
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
20078
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListTreeIcon, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
20079
|
-
"Trace"
|
|
20080
|
-
] }),
|
|
20081
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
20082
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CornerDownRightIcon, { className: "size-4 shrink-0", "aria-hidden": true }),
|
|
20083
|
-
"Subtrace"
|
|
20084
|
-
] })
|
|
20085
|
-
] }),
|
|
20086
|
-
children: "Level"
|
|
20087
|
-
}
|
|
20088
|
-
),
|
|
20089
20154
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.TopCell, { children: "Date" }),
|
|
20090
20155
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.TopCell, { children: "Time" }),
|
|
20091
20156
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.TopCell, { children: "Name" }),
|
|
@@ -20114,10 +20179,16 @@ function TracesListView({
|
|
|
20114
20179
|
onClick: () => onTraceClick(trace),
|
|
20115
20180
|
className: cn(isFeatured && "bg-surface4"),
|
|
20116
20181
|
children: [
|
|
20117
|
-
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.KindCell, { parentSpanId: trace.parentSpanId }),
|
|
20118
20182
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.DateCell, { timestamp: displayDate }),
|
|
20119
20183
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.TimeCell, { timestamp: displayDate }),
|
|
20120
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20184
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20185
|
+
TracesDataList.NameCell,
|
|
20186
|
+
{
|
|
20187
|
+
name: trace.name,
|
|
20188
|
+
parentSpanId: trace.parentSpanId,
|
|
20189
|
+
showLevelTooltip: isBranchesMode
|
|
20190
|
+
}
|
|
20191
|
+
),
|
|
20121
20192
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.InputCell, { input: getInputPreview(trace.input) }),
|
|
20122
20193
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.EntityCell, { entityType: trace.entityType, entityName }),
|
|
20123
20194
|
/* @__PURE__ */ jsxRuntime.jsx(TracesDataList.StatusCell, { status: trace.attributes?.status })
|