@mastra/playground-ui 6.2.2 → 6.2.3-alpha.0
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/CHANGELOG.md +15 -0
- package/dist/index.cjs.js +1295 -2067
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1297 -2064
- package/dist/index.es.js.map +1 -1
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata-model-list.d.ts +17 -0
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata.d.ts +4 -1
- package/dist/src/domains/agents/components/agent-table/types.d.ts +2 -1
- package/dist/src/domains/agents/components/provider-map-icon.d.ts +1 -0
- package/dist/src/domains/workflows/components/workflow-table/types.d.ts +0 -1
- package/dist/src/domains/workflows/components/workflow-table/workflow-table.d.ts +2 -3
- package/dist/src/domains/workflows/context/workflow-run-context.d.ts +0 -3
- package/dist/src/domains/workflows/index.d.ts +0 -2
- package/dist/src/domains/workflows/workflow/utils.d.ts +0 -10
- package/dist/src/hooks/use-workflows.d.ts +1 -45
- package/dist/src/services/stream-chunk-message.d.ts +9 -18
- package/dist/src/types.d.ts +7 -1
- package/package.json +6 -4
- package/dist/src/domains/workflows/context/legacy-workflow-nested-graph-context.d.ts +0 -13
- package/dist/src/domains/workflows/workflow/legacy-workflow-graph-inner.d.ts +0 -4
- package/dist/src/domains/workflows/workflow/legacy-workflow-graph.d.ts +0 -3
- package/dist/src/domains/workflows/workflow/legacy-workflow-nested-graph.d.ts +0 -5
- package/dist/src/domains/workflows/workflow/legacy-workflow-nested-node.d.ts +0 -11
- package/dist/src/domains/workflows/workflow/legacy-workflow-status.d.ts +0 -6
- package/dist/src/domains/workflows/workflow/legacy-workflow-trigger.d.ts +0 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GetAgentResponse, ReorderModelListParams, UpdateModelInModelListParams } from '@mastra/client-js';
|
|
2
|
+
type AgentMetadataModelListType = NonNullable<GetAgentResponse['modelList']>;
|
|
3
|
+
export interface AgentMetadataModelListProps {
|
|
4
|
+
modelList: AgentMetadataModelListType;
|
|
5
|
+
modelProviders: string[];
|
|
6
|
+
updateModelInModelList: AgentMetadataModelListItemProps['updateModelInModelList'];
|
|
7
|
+
reorderModelList: (params: ReorderModelListParams) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AgentMetadataModelList: ({ modelList, modelProviders, updateModelInModelList, reorderModelList, }: AgentMetadataModelListProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface AgentMetadataModelListItemProps {
|
|
11
|
+
modelConfig: AgentMetadataModelListType[number];
|
|
12
|
+
modelProviders: string[];
|
|
13
|
+
updateModelInModelList: (params: UpdateModelInModelListParams) => Promise<{
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GetAgentResponse, GetToolResponse, GetWorkflowResponse } from '@mastra/client-js';
|
|
2
2
|
import { ReactNode } from '../../../../../node_modules/@types/react';
|
|
3
3
|
import { AgentMetadataModelSwitcherProps } from './agent-metadata-model-switcher';
|
|
4
|
+
import { AgentMetadataModelListProps } from './agent-metadata-model-list';
|
|
4
5
|
export interface AgentMetadataProps {
|
|
5
6
|
agentId: string;
|
|
6
7
|
agent: GetAgentResponse;
|
|
@@ -8,6 +9,8 @@ export interface AgentMetadataProps {
|
|
|
8
9
|
hasMemoryEnabled: boolean;
|
|
9
10
|
modelProviders: string[];
|
|
10
11
|
updateModel: AgentMetadataModelSwitcherProps['updateModel'];
|
|
12
|
+
updateModelInModelList: AgentMetadataModelListProps['updateModelInModelList'];
|
|
13
|
+
reorderModelList: AgentMetadataModelListProps['reorderModelList'];
|
|
11
14
|
}
|
|
12
15
|
export interface AgentMetadataNetworkListProps {
|
|
13
16
|
agents: {
|
|
@@ -16,7 +19,7 @@ export interface AgentMetadataNetworkListProps {
|
|
|
16
19
|
}[];
|
|
17
20
|
}
|
|
18
21
|
export declare const AgentMetadataNetworkList: ({ agents }: AgentMetadataNetworkListProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const AgentMetadata: ({ agentId, agent, promptSlot, hasMemoryEnabled, updateModel, modelProviders, }: AgentMetadataProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const AgentMetadata: ({ agentId, agent, promptSlot, hasMemoryEnabled, updateModel, modelProviders, updateModelInModelList, reorderModelList, }: AgentMetadataProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
23
|
export interface AgentMetadataToolListProps {
|
|
21
24
|
tools: GetToolResponse[];
|
|
22
25
|
agentId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetToolResponse } from '@mastra/client-js';
|
|
1
|
+
import { GetAgentResponse, GetToolResponse } from '@mastra/client-js';
|
|
2
2
|
export type AgentTableData = {
|
|
3
3
|
branch?: string;
|
|
4
4
|
executedAt?: Date;
|
|
@@ -9,4 +9,5 @@ export type AgentTableData = {
|
|
|
9
9
|
instructions: string;
|
|
10
10
|
tools?: Record<string, GetToolResponse>;
|
|
11
11
|
link: string;
|
|
12
|
+
modelList: GetAgentResponse['modelList'];
|
|
12
13
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const providerMapToIcon: {
|
|
2
2
|
'openai.chat': import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
'openai.responses': import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
'anthropic.chat': import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
'anthropic.messages': import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
AZURE: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetWorkflowResponse } from '@mastra/client-js';
|
|
2
2
|
export interface WorkflowTableProps {
|
|
3
3
|
workflows?: Record<string, GetWorkflowResponse>;
|
|
4
|
-
legacyWorkflows?: Record<string, GetLegacyWorkflowResponse>;
|
|
5
4
|
isLoading: boolean;
|
|
6
5
|
}
|
|
7
|
-
export declare function WorkflowTable({ workflows,
|
|
6
|
+
export declare function WorkflowTable({ workflows, isLoading }: WorkflowTableProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export declare const WorkflowTableSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export declare const EmptyWorkflowsTable: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { ExtendedLegacyWorkflowRunResult } from '../../../hooks/use-workflows';
|
|
2
1
|
import { WorkflowRunState } from '@mastra/core/workflows';
|
|
3
2
|
import { WorkflowWatchResult } from '@mastra/client-js';
|
|
4
3
|
type WorkflowRunContextType = {
|
|
5
|
-
legacyResult: ExtendedLegacyWorkflowRunResult | null;
|
|
6
|
-
setLegacyResult: React.Dispatch<React.SetStateAction<any>>;
|
|
7
4
|
result: WorkflowWatchResult | null;
|
|
8
5
|
setResult: React.Dispatch<React.SetStateAction<any>>;
|
|
9
6
|
payload: any;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Workflow } from '@mastra/core/workflows';
|
|
2
|
-
import { StepCondition } from '@mastra/core/workflows/legacy';
|
|
3
2
|
import { Node, Edge } from '@xyflow/react';
|
|
4
3
|
export type ConditionConditionType = 'if' | 'else' | 'when' | 'until' | 'while' | 'dountil' | 'dowhile';
|
|
5
4
|
export type Condition = {
|
|
@@ -21,7 +20,6 @@ export type Condition = {
|
|
|
21
20
|
conj?: never;
|
|
22
21
|
};
|
|
23
22
|
export declare const pathAlphabet: string[];
|
|
24
|
-
export declare function extractConditions(group: StepCondition<any, any>, type: ConditionConditionType): Condition[];
|
|
25
23
|
export type WStep = {
|
|
26
24
|
[key: string]: {
|
|
27
25
|
id: string;
|
|
@@ -31,14 +29,6 @@ export type WStep = {
|
|
|
31
29
|
stepSubscriberGraph?: any;
|
|
32
30
|
};
|
|
33
31
|
};
|
|
34
|
-
export declare const contructLegacyNodesAndEdges: ({ stepGraph, stepSubscriberGraph, steps: mainSteps, }: {
|
|
35
|
-
stepGraph: any;
|
|
36
|
-
stepSubscriberGraph: any;
|
|
37
|
-
steps?: WStep;
|
|
38
|
-
}) => {
|
|
39
|
-
nodes: Node[];
|
|
40
|
-
edges: Edge[];
|
|
41
|
-
};
|
|
42
32
|
export declare const constructNodesAndEdges: ({ stepGraph, }: {
|
|
43
33
|
stepGraph: Workflow["serializedStepGraph"];
|
|
44
34
|
}) => {
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LegacyWorkflow } from '@mastra/core/workflows/legacy';
|
|
3
|
-
export type ExtendedLegacyWorkflowRunResult = LegacyWorkflowRunResult & {
|
|
4
|
-
sanitizedOutput?: string | null;
|
|
5
|
-
sanitizedError?: {
|
|
6
|
-
message: string;
|
|
7
|
-
stack?: string;
|
|
8
|
-
} | null;
|
|
9
|
-
};
|
|
1
|
+
import { WorkflowWatchResult } from '@mastra/client-js';
|
|
10
2
|
export type ExtendedWorkflowWatchResult = WorkflowWatchResult & {
|
|
11
3
|
sanitizedOutput?: string | null;
|
|
12
4
|
sanitizedError?: {
|
|
@@ -15,39 +7,3 @@ export type ExtendedWorkflowWatchResult = WorkflowWatchResult & {
|
|
|
15
7
|
} | null;
|
|
16
8
|
};
|
|
17
9
|
export declare const useWorkflow: (workflowId?: string) => import('@tanstack/react-query').UseQueryResult<import('@mastra/client-js').GetWorkflowResponse | null, Error>;
|
|
18
|
-
export declare const useLegacyWorkflow: (workflowId: string) => {
|
|
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;
|
|
20
|
-
isLoading: boolean;
|
|
21
|
-
};
|
|
22
|
-
export declare const useExecuteWorkflow: () => {
|
|
23
|
-
startLegacyWorkflowRun: ({ workflowId, runId, input, }: {
|
|
24
|
-
workflowId: string;
|
|
25
|
-
runId: string;
|
|
26
|
-
input: any;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
createLegacyWorkflowRun: ({ workflowId, prevRunId }: {
|
|
29
|
-
workflowId: string;
|
|
30
|
-
prevRunId?: string;
|
|
31
|
-
}) => Promise<{
|
|
32
|
-
runId: string;
|
|
33
|
-
}>;
|
|
34
|
-
};
|
|
35
|
-
export declare const useWatchWorkflow: () => {
|
|
36
|
-
watchLegacyWorkflow: ({ workflowId, runId }: {
|
|
37
|
-
workflowId: string;
|
|
38
|
-
runId: string;
|
|
39
|
-
}) => Promise<void>;
|
|
40
|
-
isWatchingLegacyWorkflow: boolean;
|
|
41
|
-
legacyWatchResult: ExtendedLegacyWorkflowRunResult | null;
|
|
42
|
-
};
|
|
43
|
-
export declare const useResumeWorkflow: () => {
|
|
44
|
-
resumeLegacyWorkflow: ({ workflowId, stepId, runId, context, }: {
|
|
45
|
-
workflowId: string;
|
|
46
|
-
stepId: string;
|
|
47
|
-
runId: string;
|
|
48
|
-
context: any;
|
|
49
|
-
}) => Promise<{
|
|
50
|
-
message: string;
|
|
51
|
-
}>;
|
|
52
|
-
isResumingLegacyWorkflow: boolean;
|
|
53
|
-
};
|
|
@@ -1,41 +1,32 @@
|
|
|
1
1
|
import { ThreadMessageLike } from '@assistant-ui/react';
|
|
2
2
|
import { ChunkType } from '@mastra/core';
|
|
3
3
|
export interface HandleStreamChunkOptions {
|
|
4
|
-
|
|
4
|
+
conversation: ThreadMessageLike[];
|
|
5
5
|
chunk: ChunkType;
|
|
6
|
-
refreshWorkingMemory: () => Promise<void>;
|
|
7
|
-
_sideEffects: {
|
|
8
|
-
assistantMessageAdded: boolean;
|
|
9
|
-
assistantToolCallAddedForUpdater: boolean;
|
|
10
|
-
assistantToolCallAddedForContent: boolean;
|
|
11
|
-
content: string;
|
|
12
|
-
toolCallIdToName: React.RefObject<Record<string, string>>;
|
|
13
|
-
};
|
|
14
6
|
}
|
|
15
|
-
export declare const handleStreamChunk: ({ chunk,
|
|
7
|
+
export declare const handleStreamChunk: ({ chunk, conversation }: HandleStreamChunkOptions) => ThreadMessageLike[];
|
|
16
8
|
interface HandleWorkflowChunkOptions {
|
|
17
9
|
workflowChunk: object;
|
|
18
|
-
|
|
19
|
-
entityName
|
|
10
|
+
conversation: ThreadMessageLike[];
|
|
11
|
+
entityName?: string;
|
|
20
12
|
}
|
|
21
|
-
export declare const handleWorkflowChunk: ({ workflowChunk,
|
|
13
|
+
export declare const handleWorkflowChunk: ({ workflowChunk, conversation, entityName, }: HandleWorkflowChunkOptions) => ThreadMessageLike[];
|
|
22
14
|
interface HandleAgentChunkOptions {
|
|
23
15
|
agentChunk: any;
|
|
24
|
-
|
|
16
|
+
conversation: ThreadMessageLike[];
|
|
25
17
|
entityName: string;
|
|
26
18
|
}
|
|
27
|
-
export declare const handleAgentChunk: ({ agentChunk,
|
|
19
|
+
export declare const handleAgentChunk: ({ agentChunk, conversation, entityName, }: HandleAgentChunkOptions) => ThreadMessageLike[];
|
|
28
20
|
interface CreateRootToolAssistantMessageOptions {
|
|
29
21
|
chunk: any;
|
|
30
22
|
entityName: string;
|
|
31
|
-
|
|
23
|
+
conversation: ThreadMessageLike[];
|
|
32
24
|
runId: string;
|
|
33
|
-
_sideEffects: HandleStreamChunkOptions['_sideEffects'];
|
|
34
25
|
from: 'AGENT' | 'WORKFLOW';
|
|
35
26
|
networkMetadata: {
|
|
36
27
|
selectionReason?: string;
|
|
37
28
|
input?: string | Record<string, unknown>;
|
|
38
29
|
};
|
|
39
30
|
}
|
|
40
|
-
export declare const createRootToolAssistantMessage: ({ chunk, entityName,
|
|
31
|
+
export declare const createRootToolAssistantMessage: ({ chunk, entityName, conversation, runId, from, networkMetadata, }: CreateRootToolAssistantMessageOptions) => ThreadMessageLike[];
|
|
41
32
|
export {};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AiMessageType } from '@mastra/core/memory';
|
|
2
|
+
import { LLMStepResult } from '@mastra/core/agent';
|
|
2
3
|
export type Message = AiMessageType;
|
|
3
4
|
export interface AssistantMessage {
|
|
4
5
|
id: string;
|
|
@@ -17,6 +18,11 @@ export interface AssistantMessage {
|
|
|
17
18
|
completionReason: string;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
21
|
+
export type ReadonlyJSONValue = null | string | number | boolean | ReadonlyJSONObject | ReadonlyJSONArray;
|
|
22
|
+
export type ReadonlyJSONObject = {
|
|
23
|
+
readonly [key: string]: ReadonlyJSONValue;
|
|
24
|
+
};
|
|
25
|
+
export type ReadonlyJSONArray = readonly ReadonlyJSONValue[];
|
|
20
26
|
export interface ModelSettings {
|
|
21
27
|
frequencyPenalty?: number;
|
|
22
28
|
presencePenalty?: number;
|
|
@@ -27,7 +33,7 @@ export interface ModelSettings {
|
|
|
27
33
|
topK?: number;
|
|
28
34
|
topP?: number;
|
|
29
35
|
instructions?: string;
|
|
30
|
-
providerOptions?:
|
|
36
|
+
providerOptions?: LLMStepResult['providerMetadata'];
|
|
31
37
|
chatWithGenerate?: boolean;
|
|
32
38
|
chatWithGenerateVNext?: boolean;
|
|
33
39
|
chatWithStreamVNext?: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.
|
|
4
|
+
"version": "6.2.3-alpha.0",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@autoform/zod": "^4.0.0",
|
|
48
48
|
"@codemirror/lang-json": "^6.0.2",
|
|
49
49
|
"@dagrejs/dagre": "^1.1.5",
|
|
50
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
50
51
|
"@hookform/resolvers": "^3.10.0",
|
|
51
52
|
"@lezer/highlight": "^1.2.1",
|
|
52
53
|
"@lukeed/uuid": "^2.0.1",
|
|
@@ -99,10 +100,11 @@
|
|
|
99
100
|
"use-debounce": "^10.0.6",
|
|
100
101
|
"zod": "^4.1.9",
|
|
101
102
|
"zustand": "^5.0.8",
|
|
102
|
-
"@mastra/
|
|
103
|
+
"@mastra/react-hooks": "0.0.1-alpha.1",
|
|
104
|
+
"@mastra/client-js": "^0.14.0-alpha.0"
|
|
103
105
|
},
|
|
104
106
|
"peerDependencies": {
|
|
105
|
-
"@mastra/core": ">=0.18.
|
|
107
|
+
"@mastra/core": ">=0.18.1-0 <0.19.0-0",
|
|
106
108
|
"lucide-react": "^0.474.0",
|
|
107
109
|
"react": ">=19.0.0",
|
|
108
110
|
"react-dom": ">=19.0.0",
|
|
@@ -127,7 +129,7 @@
|
|
|
127
129
|
"vite": "^6.3.6",
|
|
128
130
|
"vite-plugin-dts": "^4.5.4",
|
|
129
131
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
130
|
-
"@mastra/core": "0.18.0"
|
|
132
|
+
"@mastra/core": "0.18.1-alpha.0"
|
|
131
133
|
},
|
|
132
134
|
"homepage": "https://mastra.ai",
|
|
133
135
|
"repository": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type LegacyWorkflowNestedGraphContextType = {
|
|
2
|
-
showNestedGraph: ({ label, stepGraph, stepSubscriberGraph, }: {
|
|
3
|
-
label: string;
|
|
4
|
-
stepGraph: any;
|
|
5
|
-
stepSubscriberGraph: any;
|
|
6
|
-
}) => void;
|
|
7
|
-
closeNestedGraph: () => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const LegacyWorkflowNestedGraphContext: import('../../../../node_modules/@types/react').Context<LegacyWorkflowNestedGraphContextType>;
|
|
10
|
-
export declare function LegacyWorkflowNestedGraphProvider({ children }: {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { NodeProps, Node } from '@xyflow/react';
|
|
2
|
-
type LegacyWorkflowNestedNode = Node<{
|
|
3
|
-
label: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
withoutTopHandle?: boolean;
|
|
6
|
-
withoutBottomHandle?: boolean;
|
|
7
|
-
stepGraph: any;
|
|
8
|
-
stepSubscriberGraph: any;
|
|
9
|
-
}, 'nested-node'>;
|
|
10
|
-
export declare function LegacyWorkflowNestedNode({ data }: NodeProps<LegacyWorkflowNestedNode>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|