@mastra/playground-ui 6.1.1-alpha.0 → 6.1.1-alpha.2

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.
@@ -0,0 +1,8 @@
1
+ export interface BadgeWrapperProps {
2
+ children?: React.ReactNode;
3
+ title?: React.ReactNode;
4
+ initialCollapsed?: boolean;
5
+ icon?: React.ReactNode;
6
+ collapsible?: boolean;
7
+ }
8
+ export declare const BadgeWrapper: ({ children, initialCollapsed, icon, title, collapsible, }: BadgeWrapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const LoadingBadge: () => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
1
  import { GetWorkflowResponse } from '@mastra/client-js';
2
- import { WorkflowResult } from '@mastra/core';
2
+ import { StreamChunk } from '../../../../types';
3
3
  export interface WorkflowBadgeProps {
4
4
  workflow: GetWorkflowResponse;
5
5
  workflowId: string;
6
- result?: {
7
- result: WorkflowResult<any, any>;
8
- runId: string;
9
- };
6
+ runId?: string;
7
+ isStreaming?: boolean;
10
8
  }
11
- export declare const WorkflowBadge: ({ workflow, result, workflowId }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const WorkflowBadge: ({ workflow, runId, workflowId, isStreaming }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const useWorkflowStream: (partialWorkflowOutput?: StreamChunk) => void;
@@ -1,5 +1,5 @@
1
1
  import { Column } from './shared';
2
- export declare function EntryList({ items: dataItems, selectedItemId, onItemClick, isLoading, isLoadingNextPage, total, page, hasMore, onNextPage, onPrevPage, perPage, columns, searchTerm, setEndOfListElement, }: {
2
+ export declare function EntryList({ items: dataItems, selectedItemId, onItemClick, isLoading, isLoadingNextPage, total, page, hasMore, onNextPage, onPrevPage, perPage, columns, searchTerm, setEndOfListElement, errorMsg, }: {
3
3
  items: Record<string, any>[];
4
4
  selectedItemId?: string;
5
5
  onItemClick?: (item: string) => void;
@@ -14,4 +14,5 @@ export declare function EntryList({ items: dataItems, selectedItemId, onItemClic
14
14
  columns?: Column[];
15
15
  searchTerm?: string;
16
16
  setEndOfListElement: (element: HTMLDivElement | null) => void;
17
+ errorMsg?: string;
17
18
  }): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,7 @@ type TraceTimelineSpanProps = {
7
7
  isLastChild?: boolean;
8
8
  overallLatency?: number;
9
9
  overallStartTime?: string;
10
+ overallEndTime?: string;
10
11
  };
11
- export declare function TraceTimelineSpan({ span, depth, onSpanClick, selectedSpanId, isLastChild, overallLatency, overallStartTime, }: TraceTimelineSpanProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function TraceTimelineSpan({ span, depth, onSpanClick, selectedSpanId, isLastChild, overallLatency, overallStartTime, overallEndTime, }: TraceTimelineSpanProps): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
@@ -0,0 +1,3 @@
1
+ import { WorkflowWatchResult } from '@mastra/client-js';
2
+ import { StreamChunk } from '../../../types';
3
+ export declare const useHandleAgentWorkflowStream: (workflowOutput?: StreamChunk) => WorkflowWatchResult;
@@ -6,3 +6,4 @@ export * from './workflow/workflow-trigger';
6
6
  export * from './context/use-current-run';
7
7
  export * from './runs/workflow-runs';
8
8
  export * from './components/workflow-table/workflow-table';
9
+ export * from './utils';
@@ -1,3 +1,5 @@
1
1
  import { WorkflowRunState } from '@mastra/core/workflows';
2
2
  import { WorkflowWatchResult } from '@mastra/client-js';
3
+ import { StreamChunk } from '../../types';
3
4
  export declare function convertWorkflowRunStateToWatchResult(runState: WorkflowRunState): WorkflowWatchResult;
5
+ export declare const mapWorkflowStreamChunkToWatchResult: (prev: WorkflowWatchResult, chunk: StreamChunk) => WorkflowWatchResult;
@@ -1,6 +1,3 @@
1
1
  export declare const useWorkflowRuns: (workflowId: string, { enabled }?: {
2
2
  enabled?: boolean;
3
- }) => {
4
- runs: import('@mastra/core').WorkflowRuns | null;
5
- isLoading: boolean;
6
- };
3
+ }) => import('@tanstack/react-query').UseQueryResult<import('@mastra/core').WorkflowRuns, Error>;
@@ -14,10 +14,7 @@ export type ExtendedWorkflowWatchResult = WorkflowWatchResult & {
14
14
  stack?: string;
15
15
  } | null;
16
16
  };
17
- export declare const useWorkflow: (workflowId: string) => {
18
- workflow: GetWorkflowResponse | null;
19
- isLoading: boolean;
20
- };
17
+ export declare const useWorkflow: (workflowId: string) => import('@tanstack/react-query').UseQueryResult<GetWorkflowResponse, Error>;
21
18
  export declare const useLegacyWorkflow: (workflowId: string) => {
22
19
  legacyWorkflow: LegacyWorkflow<import('@mastra/core/workflows/legacy').LegacyStep<string, any, any, import('@mastra/core/workflows/legacy').StepExecutionContext<any, import('@mastra/core/workflows/legacy').WorkflowContext<any, import('@mastra/core/workflows/legacy').LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any> | null;
23
20
  isLoading: boolean;
@@ -87,4 +87,10 @@ export type RefinedTrace = {
87
87
  trace: Span[];
88
88
  runId?: string;
89
89
  };
90
+ export type StreamChunk = {
91
+ type: string;
92
+ payload: any;
93
+ runId: string;
94
+ from: 'AGENT' | 'WORKFLOW';
95
+ };
90
96
  export * from './domains/traces/types';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/playground-ui",
3
3
  "type": "module",
4
- "version": "6.1.1-alpha.0",
4
+ "version": "6.1.1-alpha.2",
5
5
  "description": "Mastra Playground components",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -99,10 +99,10 @@
99
99
  "use-debounce": "^10.0.5",
100
100
  "zod": "^4.1.5",
101
101
  "zustand": "^5.0.7",
102
- "@mastra/client-js": "^0.12.1-alpha.0"
102
+ "@mastra/client-js": "^0.12.1-alpha.3"
103
103
  },
104
104
  "peerDependencies": {
105
- "@mastra/core": ">=0.16.0-0 <0.17.0-0",
105
+ "@mastra/core": ">=0.16.1-0 <0.17.0-0",
106
106
  "lucide-react": "^0.474.0",
107
107
  "react": ">=19.0.0",
108
108
  "react-dom": ">=19.0.0",
@@ -127,7 +127,7 @@
127
127
  "vite": "^6.3.5",
128
128
  "vite-plugin-dts": "^4.5.4",
129
129
  "vite-plugin-lib-inject-css": "^2.2.2",
130
- "@mastra/core": "0.16.1-alpha.0"
130
+ "@mastra/core": "0.16.1-alpha.3"
131
131
  },
132
132
  "homepage": "https://mastra.ai",
133
133
  "repository": {
@@ -1,12 +0,0 @@
1
- import { GetAgentResponse } from '@mastra/client-js';
2
- type AgentContextType = {
3
- isLoading: boolean;
4
- agentDetails: GetAgentResponse | null;
5
- };
6
- export interface AgentProviderProps {
7
- agentId?: string;
8
- children: React.ReactNode;
9
- }
10
- export declare function AgentProvider({ agentId, children }: AgentProviderProps): import("react/jsx-runtime").JSX.Element;
11
- export declare function useAgent(): AgentContextType;
12
- export {};