@mastra/playground-ui 5.0.0 → 5.0.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.
Files changed (34) hide show
  1. package/dist/components/assistant-ui/assistant-modal.d.ts +1 -3
  2. package/dist/components/assistant-ui/thread.d.ts +3 -4
  3. package/dist/components/assistant-ui/user-message.d.ts +1 -3
  4. package/dist/domains/agents/agent/agent-traces.d.ts +1 -4
  5. package/dist/domains/traces/context/trace-context.d.ts +0 -2
  6. package/dist/domains/traces/trace-details.d.ts +1 -1
  7. package/dist/domains/traces/trace-span-details.d.ts +1 -1
  8. package/dist/domains/traces/trace-span-view.d.ts +4 -6
  9. package/dist/domains/traces/traces-sidebar.d.ts +1 -4
  10. package/dist/domains/traces/utils/getSpanVariant.d.ts +4 -0
  11. package/dist/domains/traces/utils.d.ts +1 -1
  12. package/dist/domains/workflows/context/v-next-workflow-nested-graph-context.d.ts +14 -0
  13. package/dist/domains/workflows/context/workflow-run-context.d.ts +3 -1
  14. package/dist/domains/workflows/index.d.ts +2 -0
  15. package/dist/domains/workflows/workflow/utils.d.ts +8 -1
  16. package/dist/domains/workflows/workflow/v-next-workflow-graph-inner.d.ts +5 -0
  17. package/dist/domains/workflows/workflow/v-next-workflow-graph.d.ts +5 -0
  18. package/dist/domains/workflows/workflow/v-next-workflow-nested-graph.d.ts +6 -0
  19. package/dist/domains/workflows/workflow/v-next-workflow-nested-node.d.ts +11 -0
  20. package/dist/domains/workflows/workflow/v-next-workflow-trigger.d.ts +5 -0
  21. package/dist/domains/workflows/workflow/workflow-traces.d.ts +1 -4
  22. package/dist/ds/components/TraceTree/Span.d.ts +22 -1
  23. package/dist/ds/components/TraceTree/Trace.d.ts +4 -1
  24. package/dist/ds/icons/LatencyIcon.d.ts +3 -0
  25. package/dist/ds/icons/index.d.ts +1 -0
  26. package/dist/hooks/use-workflows.d.ts +45 -2
  27. package/dist/index.cjs.js +5374 -4913
  28. package/dist/index.cjs.js.map +1 -1
  29. package/dist/index.es.js +5374 -4916
  30. package/dist/index.es.js.map +1 -1
  31. package/dist/lib/mastra-client.d.ts +3 -0
  32. package/package.json +4 -4
  33. package/dist/components/assistant-ui/assistant-sidebar.d.ts +0 -3
  34. package/dist/domains/traces/trace-tree-view.d.ts +0 -6
@@ -1,3 +1 @@
1
- import { FC } from '../../../node_modules/@types/react';
2
-
3
- export declare const AssistantModal: FC;
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { ToolCallContentPartComponent } from '@assistant-ui/react';
2
- import { FC } from '../../../node_modules/@types/react';
3
2
 
4
- export declare const Thread: FC<{
5
- memory?: boolean;
3
+ export interface ThreadProps {
6
4
  ToolFallback?: ToolCallContentPartComponent;
7
- }>;
5
+ }
6
+ export declare const Thread: ({ ToolFallback }: ThreadProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1 @@
1
- import { FC } from '../../../node_modules/@types/react';
2
-
3
- export declare const UserMessage: FC;
1
+ export declare const UserMessage: () => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,5 @@
1
- import { ReactNode } from '../../../../node_modules/@types/react';
2
-
3
1
  export interface AgentTracesProps {
4
2
  agentName: string;
5
3
  baseUrl: string;
6
- sidebarChild: ReactNode;
7
4
  }
8
- export declare function AgentTraces({ agentName, baseUrl, sidebarChild }: AgentTracesProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function AgentTraces({ agentName, baseUrl }: AgentTracesProps): import("react/jsx-runtime").JSX.Element;
@@ -13,8 +13,6 @@ type TraceContextType = {
13
13
  prevTrace: () => void;
14
14
  span: Span | null;
15
15
  setSpan: React.Dispatch<React.SetStateAction<Span | null>>;
16
- openDetail: boolean;
17
- setOpenDetail: React.Dispatch<React.SetStateAction<boolean>>;
18
16
  clearData: () => void;
19
17
  };
20
18
  export declare const TraceContext: import('../../../../node_modules/@types/react').Context<TraceContextType>;
@@ -1 +1 @@
1
- export declare function TraceDetails(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function TraceDetails(): import("react/jsx-runtime").JSX.Element | null;
@@ -1 +1 @@
1
- export declare function SpanDetail(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SpanDetail(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,6 @@
1
- import { Span, SpanNode } from './types';
1
+ import { Span } from './types';
2
2
 
3
- export declare function TreeView({ tree }: {
4
- tree: SpanNode[];
5
- }): import("react/jsx-runtime").JSX.Element;
6
- export default function SpanView({ trace }: {
3
+ export interface SpanViewProps {
7
4
  trace: Span[];
8
- }): import("react/jsx-runtime").JSX.Element;
5
+ }
6
+ export default function SpanView({ trace }: SpanViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
- import { ReactNode } from '../../../node_modules/@types/react';
2
-
3
1
  export interface TracesSidebarProps {
4
2
  className?: string;
5
3
  onResize?: (width: number) => void;
6
4
  width: number;
7
- children: ReactNode;
8
5
  }
9
- export declare const TracesSidebar: ({ className, onResize, width, children }: TracesSidebarProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const TracesSidebar: ({ onResize }: TracesSidebarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { SpanProps } from '../../../ds/components/TraceTree/Span';
2
+ import { Span } from '../types';
3
+
4
+ export declare const getSpanVariant: (span: Span) => SpanProps["variant"];
@@ -9,7 +9,7 @@ import { RefinedTrace, Span } from './types';
9
9
  export declare function formatDuration(duration: number, fixedPoint?: number): string;
10
10
  export declare function formatOtelTimestamp(otelTimestamp: number): string;
11
11
  export declare function formatOtelTimestamp2(otelTimestamp: number): string;
12
- export declare function transformKey(key: string): string[] | "Input" | "Output";
12
+ export declare function transformKey(key: string): string;
13
13
  export declare function cleanString(string: string): string;
14
14
  export declare const refineTraces: (traces: Span[], isWorkflow?: boolean) => RefinedTrace[];
15
15
  export declare const allowedAiSpanAttributes: string[];
@@ -0,0 +1,14 @@
1
+ import { StepFlowEntry } from '@mastra/core/workflows/vNext';
2
+
3
+ type VNextWorkflowNestedGraphContextType = {
4
+ showNestedGraph: ({ label, stepGraph }: {
5
+ label: string;
6
+ stepGraph: StepFlowEntry[];
7
+ }) => void;
8
+ closeNestedGraph: () => void;
9
+ };
10
+ export declare const VNextWorkflowNestedGraphContext: import('../../../../node_modules/@types/react').Context<VNextWorkflowNestedGraphContextType>;
11
+ export declare function VNextWorkflowNestedGraphProvider({ children }: {
12
+ children: React.ReactNode;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -1,8 +1,10 @@
1
- import { ExtendedWorkflowRunResult } from '../../../hooks/use-workflows';
1
+ import { ExtendedVNextWorkflowWatchResult, ExtendedWorkflowRunResult } from '../../../hooks/use-workflows';
2
2
 
3
3
  type WorkflowRunContextType = {
4
4
  result: ExtendedWorkflowRunResult | null;
5
5
  setResult: React.Dispatch<React.SetStateAction<any>>;
6
+ vNextResult: ExtendedVNextWorkflowWatchResult | null;
7
+ setVNextResult: React.Dispatch<React.SetStateAction<any>>;
6
8
  payload: any;
7
9
  setPayload: React.Dispatch<React.SetStateAction<any>>;
8
10
  clearData: () => void;
@@ -2,3 +2,5 @@ export * from './workflow/workflow-traces';
2
2
  export * from './workflow/workflow-graph';
3
3
  export * from './workflow/workflow-trigger';
4
4
  export * from './context/workflow-run-context';
5
+ export * from './workflow/v-next-workflow-graph';
6
+ export * from './workflow/v-next-workflow-trigger';
@@ -1,7 +1,8 @@
1
1
  import { StepCondition } from '@mastra/core/workflows';
2
+ import { NewWorkflow } from '@mastra/core/workflows/vNext';
2
3
  import { Node, Edge } from '@xyflow/react';
3
4
 
4
- export type ConditionConditionType = 'if' | 'else' | 'when' | 'until' | 'while';
5
+ export type ConditionConditionType = 'if' | 'else' | 'when' | 'until' | 'while' | 'dountil' | 'dowhile';
5
6
  export type Condition = {
6
7
  type: ConditionConditionType;
7
8
  ref: {
@@ -39,3 +40,9 @@ export declare const contructNodesAndEdges: ({ stepGraph, stepSubscriberGraph, s
39
40
  nodes: Node[];
40
41
  edges: Edge[];
41
42
  };
43
+ export declare const constructVNextNodesAndEdges: ({ stepGraph, }: {
44
+ stepGraph: NewWorkflow["stepGraph"];
45
+ }) => {
46
+ nodes: Node[];
47
+ edges: Edge[];
48
+ };
@@ -0,0 +1,5 @@
1
+ import { GetVNextWorkflowResponse } from '@mastra/client-js';
2
+
3
+ export declare function VNextWorkflowGraphInner({ workflow }: {
4
+ workflow: GetVNextWorkflowResponse;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+
2
+ export declare function VNextWorkflowGraph({ workflowId, baseUrl }: {
3
+ workflowId: string;
4
+ baseUrl: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { StepFlowEntry } from '@mastra/core/workflows/vNext';
2
+
3
+ export declare function VNextWorkflowNestedGraph({ stepGraph, open }: {
4
+ stepGraph: StepFlowEntry[];
5
+ open: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+ import { StepFlowEntry } from '@mastra/core/workflows/vNext';
3
+
4
+ export type NestedNode = Node<{
5
+ label: string;
6
+ description?: string;
7
+ withoutTopHandle?: boolean;
8
+ withoutBottomHandle?: boolean;
9
+ stepGraph: StepFlowEntry[];
10
+ }, 'nested-node'>;
11
+ export declare function VNextWorkflowNestedNode({ data }: NodeProps<NestedNode>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function VNextWorkflowTrigger({ workflowId, baseUrl, setRunId, }: {
2
+ workflowId: string;
3
+ baseUrl: string;
4
+ setRunId?: (runId: string) => void;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,8 +1,5 @@
1
- import { ReactNode } from '../../../../node_modules/@types/react';
2
-
3
1
  export interface WorkflowTracesProps {
4
2
  workflowName: string;
5
3
  baseUrl: string;
6
- sidebarChild: ReactNode;
7
4
  }
8
- export declare function WorkflowTraces({ workflowName, baseUrl, sidebarChild }: WorkflowTracesProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function WorkflowTraces({ workflowName, baseUrl }: WorkflowTracesProps): import("react/jsx-runtime").JSX.Element;
@@ -8,5 +8,26 @@ export interface SpanProps {
8
8
  spans?: React.ReactNode;
9
9
  isRoot?: boolean;
10
10
  onClick?: () => void;
11
+ isActive?: boolean;
11
12
  }
12
- export declare const Span: ({ children, durationMs, variant, tokenCount, spans, isRoot, onClick }: SpanProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const spanIconMap: {
14
+ tool: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
15
+ agent: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
16
+ workflow: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
17
+ memory: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
18
+ rag: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
19
+ storage: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
20
+ eval: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
21
+ other: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
22
+ };
23
+ export declare const spanVariantClasses: {
24
+ tool: string;
25
+ agent: string;
26
+ workflow: string;
27
+ memory: string;
28
+ rag: string;
29
+ storage: string;
30
+ eval: string;
31
+ other: string;
32
+ };
33
+ export declare const Span: ({ children, durationMs, variant, tokenCount, spans, isRoot, onClick, isActive }: SpanProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from '../../../../node_modules/@types/react';
2
+ import { SpanProps } from './Span';
2
3
 
3
4
  export interface TraceProps {
4
5
  name: string;
@@ -6,5 +7,7 @@ export interface TraceProps {
6
7
  durationMs: number;
7
8
  tokenCount?: number;
8
9
  onClick?: () => void;
10
+ variant: SpanProps['variant'];
11
+ isActive?: boolean;
9
12
  }
10
- export declare const Trace: ({ name, spans, durationMs, tokenCount, onClick }: TraceProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Trace: ({ name, spans, durationMs, tokenCount, onClick, variant, isActive }: TraceProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { default as React } from '../../../node_modules/@types/react';
2
+
3
+ export declare const LatencyIcon: (props: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
@@ -36,3 +36,4 @@ export * from './TsIcon';
36
36
  export * from './VariablesIcon';
37
37
  export * from './WorkflowIcon';
38
38
  export * from './WorkflowCoinIcon';
39
+ export * from './LatencyIcon';
@@ -1,5 +1,6 @@
1
1
  import { Workflow } from '@mastra/core/workflows';
2
- import { WorkflowRunResult as BaseWorkflowRunResult } from '@mastra/client-js';
2
+ import { WorkflowRunResult as BaseWorkflowRunResult, VNextWorkflowWatchResult, GetVNextWorkflowResponse } from '@mastra/client-js';
3
+ import { RuntimeContext } from '@mastra/core/runtime-context';
3
4
 
4
5
  export type ExtendedWorkflowRunResult = BaseWorkflowRunResult & {
5
6
  sanitizedOutput?: string | null;
@@ -8,10 +9,21 @@ export type ExtendedWorkflowRunResult = BaseWorkflowRunResult & {
8
9
  stack?: string;
9
10
  } | null;
10
11
  };
12
+ export type ExtendedVNextWorkflowWatchResult = VNextWorkflowWatchResult & {
13
+ sanitizedOutput?: string | null;
14
+ sanitizedError?: {
15
+ message: string;
16
+ stack?: string;
17
+ } | null;
18
+ };
11
19
  export declare const useWorkflow: (workflowId: string, baseUrl: string) => {
12
20
  workflow: Workflow<import('@mastra/core').Step<string, any, any, import('@mastra/core').StepExecutionContext<any, import('@mastra/core').WorkflowContext<any, import('@mastra/core').Step<string, any, any, any>[], Record<string, any>>>>[], string, any, any> | null;
13
21
  isLoading: boolean;
14
22
  };
23
+ export declare const useVNextWorkflow: (workflowId: string, baseUrl: string) => {
24
+ vNextWorkflow: GetVNextWorkflowResponse | null;
25
+ isLoading: boolean;
26
+ };
15
27
  export declare const useExecuteWorkflow: (baseUrl: string) => {
16
28
  startWorkflowRun: ({ workflowId, runId, input }: {
17
29
  workflowId: string;
@@ -24,7 +36,22 @@ export declare const useExecuteWorkflow: (baseUrl: string) => {
24
36
  }) => Promise<{
25
37
  runId: string;
26
38
  }>;
27
- isExecutingWorkflow: boolean;
39
+ startVNextWorkflowRun: ({ workflowId, runId, input, }: {
40
+ workflowId: string;
41
+ runId: string;
42
+ input: any;
43
+ }) => Promise<void>;
44
+ createVNextWorkflowRun: ({ workflowId, prevRunId }: {
45
+ workflowId: string;
46
+ prevRunId?: string;
47
+ }) => Promise<{
48
+ runId: string;
49
+ }>;
50
+ startAsyncVNextWorkflowRun: ({ workflowId, runId, input, }: {
51
+ workflowId: string;
52
+ runId?: string;
53
+ input: any;
54
+ }) => Promise<import('@mastra/client-js').VNextWorkflowRunResult>;
28
55
  };
29
56
  export declare const useWatchWorkflow: (baseUrl: string) => {
30
57
  watchWorkflow: ({ workflowId, runId }: {
@@ -33,6 +60,12 @@ export declare const useWatchWorkflow: (baseUrl: string) => {
33
60
  }) => Promise<void>;
34
61
  isWatchingWorkflow: boolean;
35
62
  watchResult: ExtendedWorkflowRunResult | null;
63
+ watchVNextWorkflow: ({ workflowId, runId }: {
64
+ workflowId: string;
65
+ runId: string;
66
+ }) => Promise<void>;
67
+ isWatchingVNextWorkflow: boolean;
68
+ watchVNextResult: ExtendedVNextWorkflowWatchResult | null;
36
69
  };
37
70
  export declare const useResumeWorkflow: (baseUrl: string) => {
38
71
  resumeWorkflow: ({ workflowId, stepId, runId, context, }: {
@@ -44,4 +77,14 @@ export declare const useResumeWorkflow: (baseUrl: string) => {
44
77
  message: string;
45
78
  }>;
46
79
  isResumingWorkflow: boolean;
80
+ resumeVNextWorkflow: ({ workflowId, step, runId, resumeData, runtimeContext, }: {
81
+ workflowId: string;
82
+ step: string | string[];
83
+ runId: string;
84
+ resumeData: any;
85
+ runtimeContext?: RuntimeContext;
86
+ }) => Promise<{
87
+ message: string;
88
+ }>;
89
+ isResumingVNextWorkflow: boolean;
47
90
  };