@mastra/playground-ui 5.0.0 → 5.0.1-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/dist/components/assistant-ui/assistant-modal.d.ts +1 -3
- package/dist/components/assistant-ui/thread.d.ts +3 -4
- package/dist/components/assistant-ui/user-message.d.ts +1 -3
- package/dist/domains/workflows/context/v-next-workflow-nested-graph-context.d.ts +14 -0
- package/dist/domains/workflows/context/workflow-run-context.d.ts +3 -1
- package/dist/domains/workflows/index.d.ts +2 -0
- package/dist/domains/workflows/workflow/utils.d.ts +8 -1
- package/dist/domains/workflows/workflow/v-next-workflow-graph-inner.d.ts +5 -0
- package/dist/domains/workflows/workflow/v-next-workflow-graph.d.ts +5 -0
- package/dist/domains/workflows/workflow/v-next-workflow-nested-graph.d.ts +6 -0
- package/dist/domains/workflows/workflow/v-next-workflow-nested-node.d.ts +11 -0
- package/dist/domains/workflows/workflow/v-next-workflow-trigger.d.ts +5 -0
- package/dist/hooks/use-workflows.d.ts +45 -2
- package/dist/index.cjs.js +5361 -4861
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5362 -4864
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/assistant-ui/assistant-sidebar.d.ts +0 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ToolCallContentPartComponent } from '@assistant-ui/react';
|
|
2
|
-
import { FC } from '../../../node_modules/@types/react';
|
|
3
2
|
|
|
4
|
-
export
|
|
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;
|
|
@@ -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,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;
|
|
@@ -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
|
-
|
|
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
|
};
|