@mastra/playground-ui 5.0.2-alpha.4 → 5.0.2-alpha.6

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.
@@ -1,6 +1,6 @@
1
1
  import { Span, RefinedTrace } from '../types';
2
2
 
3
- type TraceContextType = {
3
+ export type TraceContextType = {
4
4
  isOpen: boolean;
5
5
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
6
6
  trace: Span[] | null;
@@ -16,7 +16,7 @@ type TraceContextType = {
16
16
  clearData: () => void;
17
17
  };
18
18
  export declare const TraceContext: import('../../../../node_modules/@types/react').Context<TraceContextType>;
19
- export declare function TraceProvider({ children }: {
19
+ export declare function TraceProvider({ children, initialTraces, }: {
20
20
  children: React.ReactNode;
21
+ initialTraces?: RefinedTrace[];
21
22
  }): import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -3,7 +3,7 @@ import { RefinedTrace } from './types';
3
3
  export interface TracesTableProps {
4
4
  traces: RefinedTrace[];
5
5
  isLoading: boolean;
6
- error?: {
6
+ error: {
7
7
  message: string;
8
8
  } | null;
9
9
  }
package/dist/index.cjs.js CHANGED
@@ -4828,10 +4828,13 @@ function EvalTable({ evals, isCIMode = false }) {
4828
4828
  }
4829
4829
 
4830
4830
  const TraceContext = React.createContext({});
4831
- function TraceProvider({ children }) {
4831
+ function TraceProvider({
4832
+ children,
4833
+ initialTraces
4834
+ }) {
4832
4835
  const [open, setOpen] = React.useState(false);
4833
4836
  const [trace, setTrace] = React.useState(null);
4834
- const [traces, setTraces] = React.useState([]);
4837
+ const [traces, setTraces] = React.useState(initialTraces || []);
4835
4838
  const [currentTraceIndex, setCurrentTraceIndex] = React.useState(0);
4836
4839
  const [span, setSpan] = React.useState(null);
4837
4840
  const nextTrace = () => {
@@ -5042,7 +5045,7 @@ const TracesTable = ({ traces, isLoading, error }) => {
5042
5045
  /* @__PURE__ */ jsxRuntime.jsx(Th, { width: 120, children: "Spans" }),
5043
5046
  /* @__PURE__ */ jsxRuntime.jsx(Th, { width: 120, children: "Status" })
5044
5047
  ] }),
5045
- isLoading ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableSkeleton, { colsCount }) : error ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableError, { error, colsCount }) : hasNoTraces ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableEmpty, { colsCount }) : /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: traces.map((trace, index) => /* @__PURE__ */ jsxRuntime.jsx(TraceRow, { trace, index, isActive: index === currentTraceIndex }, trace.traceId)) })
5048
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableSkeleton, { colsCount }) : error ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableError, { error, colsCount }) : hasNoTraces ? /* @__PURE__ */ jsxRuntime.jsx(TracesTableEmpty, { colsCount }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(Tbody, { children: traces.map((trace, index) => /* @__PURE__ */ jsxRuntime.jsx(TraceRow, { trace, index, isActive: index === currentTraceIndex }, trace.traceId)) }) })
5046
5049
  ] });
5047
5050
  };
5048
5051
 
@@ -9081,5 +9084,6 @@ exports.WorkflowRunProvider = WorkflowRunProvider;
9081
9084
  exports.WorkflowTraces = WorkflowTraces;
9082
9085
  exports.WorkflowTrigger = WorkflowTrigger;
9083
9086
  exports.refineTraces = refineTraces;
9087
+ exports.usePolling = usePolling;
9084
9088
  exports.useTraces = useTraces;
9085
9089
  //# sourceMappingURL=index.cjs.js.map