@mastra/playground-ui 5.0.1-alpha.3 → 5.0.1-alpha.4
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/ds/components/Table/Table.d.ts +2 -1
- package/dist/index.cjs.js +33 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +34 -11
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useMessage, MessagePrimitive, ActionBarPrimitive, ThreadPrimitive, ComposerPrimitive, useExternalStoreRuntime, AssistantRuntimeProvider } from '@assistant-ui/react';
|
|
3
|
-
import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, ChevronUp, ChevronDown,
|
|
3
|
+
import { CheckIcon as CheckIcon$1, CopyIcon, ChevronUpIcon, ArrowUp, Copy, Search, RefreshCcwIcon, ChevronRight, SortAsc, SortDesc, X, Check, ChevronUp, ChevronDown, LoaderCircle, ChevronDownIcon, ExternalLinkIcon, Footprints, CircleCheck, CircleX, Workflow, AlertCircleIcon, AlertCircle, CalendarIcon, PlusIcon, TrashIcon, Plus, Loader2 } from 'lucide-react';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import React__default, { forwardRef, memo, useState, useMemo, useRef, useEffect, createContext, useContext, useCallback, Suspense, Fragment as Fragment$1 } from 'react';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
@@ -5093,8 +5093,20 @@ const Th = ({ className, children, ...props }) => {
|
|
|
5093
5093
|
const Tbody = ({ className, children }) => {
|
|
5094
5094
|
return /* @__PURE__ */ jsx("tbody", { className: clsx("", className), children });
|
|
5095
5095
|
};
|
|
5096
|
-
const Row = ({ className, children, selected = false }) => {
|
|
5097
|
-
return /* @__PURE__ */ jsx(
|
|
5096
|
+
const Row = ({ className, children, selected = false, onClick }) => {
|
|
5097
|
+
return /* @__PURE__ */ jsx(
|
|
5098
|
+
"tr",
|
|
5099
|
+
{
|
|
5100
|
+
className: clsx(
|
|
5101
|
+
"border-b-sm border-border1 hover:bg-surface3",
|
|
5102
|
+
selected && "bg-surface4",
|
|
5103
|
+
onClick && "cursor-pointer",
|
|
5104
|
+
className
|
|
5105
|
+
),
|
|
5106
|
+
onClick,
|
|
5107
|
+
children
|
|
5108
|
+
}
|
|
5109
|
+
);
|
|
5098
5110
|
};
|
|
5099
5111
|
|
|
5100
5112
|
const variants = {
|
|
@@ -5187,7 +5199,8 @@ const TracesTableError = ({ error, colsCount }) => {
|
|
|
5187
5199
|
};
|
|
5188
5200
|
const TraceRow = ({ trace, index, isActive }) => {
|
|
5189
5201
|
const { openTrace } = useOpenTrace();
|
|
5190
|
-
|
|
5202
|
+
const hasFailure = trace.trace.some((span) => span.status.code !== 0);
|
|
5203
|
+
return /* @__PURE__ */ jsxs(Row, { className: isActive ? "bg-surface4" : "", onClick: () => openTrace(trace.trace, index), children: [
|
|
5191
5204
|
/* @__PURE__ */ jsx(DateTimeCell, { dateTime: new Date(trace.started / 1e3) }),
|
|
5192
5205
|
/* @__PURE__ */ jsx(TxtCell, { children: trace.traceId }),
|
|
5193
5206
|
/* @__PURE__ */ jsx(UnitCell, { unit: "ms", children: trace.duration / 1e3 }),
|
|
@@ -5195,7 +5208,8 @@ const TraceRow = ({ trace, index, isActive }) => {
|
|
|
5195
5208
|
trace.trace.length,
|
|
5196
5209
|
" span",
|
|
5197
5210
|
trace.trace.length > 1 ? "s" : ""
|
|
5198
|
-
] }) }) })
|
|
5211
|
+
] }) }) }),
|
|
5212
|
+
/* @__PURE__ */ jsx(Cell, { children: hasFailure ? /* @__PURE__ */ jsx(Badge$1, { variant: "error", icon: /* @__PURE__ */ jsx(X, {}), children: "Failed" }) : /* @__PURE__ */ jsx(Badge$1, { icon: /* @__PURE__ */ jsx(Check, {}), variant: "success", children: "Success" }) })
|
|
5199
5213
|
] });
|
|
5200
5214
|
};
|
|
5201
5215
|
const TracesTable = ({ traces, isLoading, error }) => {
|
|
@@ -5207,7 +5221,8 @@ const TracesTable = ({ traces, isLoading, error }) => {
|
|
|
5207
5221
|
/* @__PURE__ */ jsx(Th, { width: 160, children: "Time" }),
|
|
5208
5222
|
/* @__PURE__ */ jsx(Th, { width: "auto", children: "Trace Id" }),
|
|
5209
5223
|
/* @__PURE__ */ jsx(Th, { width: 160, children: "Duration" }),
|
|
5210
|
-
/* @__PURE__ */ jsx(Th, { width: 160, children: "Spans" })
|
|
5224
|
+
/* @__PURE__ */ jsx(Th, { width: 160, children: "Spans" }),
|
|
5225
|
+
/* @__PURE__ */ jsx(Th, { width: 160, children: "Status" })
|
|
5211
5226
|
] }),
|
|
5212
5227
|
isLoading ? /* @__PURE__ */ jsx(TracesTableSkeleton, { colsCount }) : error ? /* @__PURE__ */ jsx(TracesTableError, { error, colsCount }) : hasNoTraces ? /* @__PURE__ */ jsx(TracesTableEmpty, { colsCount }) : /* @__PURE__ */ jsx(Tbody, { children: traces.map((trace, index) => /* @__PURE__ */ jsx(TraceRow, { trace, index, isActive: index === currentTraceIndex }, trace.traceId)) })
|
|
5213
5228
|
] });
|
|
@@ -5519,6 +5534,7 @@ function TraceDetails() {
|
|
|
5519
5534
|
const { trace, currentTraceIndex, prevTrace, nextTrace, traces, clearData } = useContext(TraceContext);
|
|
5520
5535
|
const actualTrace = traces[currentTraceIndex];
|
|
5521
5536
|
if (!actualTrace || !trace) return null;
|
|
5537
|
+
const hasFailure = trace.some((span) => span.status.code !== 0);
|
|
5522
5538
|
return /* @__PURE__ */ jsxs("aside", { children: [
|
|
5523
5539
|
/* @__PURE__ */ jsxs(Header, { children: [
|
|
5524
5540
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
@@ -5533,10 +5549,13 @@ function TraceDetails() {
|
|
|
5533
5549
|
}
|
|
5534
5550
|
)
|
|
5535
5551
|
] }),
|
|
5536
|
-
/* @__PURE__ */
|
|
5537
|
-
"
|
|
5538
|
-
|
|
5539
|
-
|
|
5552
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 justify-between w-full", children: [
|
|
5553
|
+
/* @__PURE__ */ jsxs(Txt, { variant: "ui-lg", className: "font-medium text-icon5 shrink-0", children: [
|
|
5554
|
+
"Trace ",
|
|
5555
|
+
/* @__PURE__ */ jsx("span", { className: "ml-2 text-icon3", children: actualTrace.traceId.substring(0, 5) })
|
|
5556
|
+
] }),
|
|
5557
|
+
hasFailure && /* @__PURE__ */ jsx(Badge$1, { variant: "error", icon: /* @__PURE__ */ jsx(X, {}), children: "Failed" })
|
|
5558
|
+
] })
|
|
5540
5559
|
] }),
|
|
5541
5560
|
/* @__PURE__ */ jsx("div", { className: "p-5", children: /* @__PURE__ */ jsx(SpanView, { trace }) })
|
|
5542
5561
|
] });
|
|
@@ -5597,7 +5616,11 @@ function SpanDetail() {
|
|
|
5597
5616
|
/* @__PURE__ */ jsx(Icon, { size: "lg", className: "bg-surface4 p-1 rounded-md", children: /* @__PURE__ */ jsx(SpanIcon, { className: variantClass }) }),
|
|
5598
5617
|
span.name
|
|
5599
5618
|
] }),
|
|
5600
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2 items-center", children: /* @__PURE__ */ jsxs(Badge$1, { icon: /* @__PURE__ */ jsx(LatencyIcon, {}), children: [
|
|
5619
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-row gap-2 items-center", children: span.status.code === 0 ? /* @__PURE__ */ jsxs(Badge$1, { icon: /* @__PURE__ */ jsx(LatencyIcon, {}), variant: "success", children: [
|
|
5620
|
+
formatDuration(span.duration),
|
|
5621
|
+
"ms"
|
|
5622
|
+
] }) : /* @__PURE__ */ jsxs(Badge$1, { variant: "error", icon: /* @__PURE__ */ jsx(X, {}), children: [
|
|
5623
|
+
"Failed in ",
|
|
5601
5624
|
formatDuration(span.duration),
|
|
5602
5625
|
"ms"
|
|
5603
5626
|
] }) }),
|