@mastra/playground-ui 7.0.0-beta.10 → 7.0.0-beta.13
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 +103 -0
- package/dist/index.cjs.js +898 -495
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +897 -497
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/assistant-ui/messages/tripwire-notice.d.ts +6 -0
- package/dist/src/components/assistant-ui/tools/badges/tool-badge.d.ts +2 -1
- package/dist/src/components/assistant-ui/tools/badges/workflow-badge.d.ts +2 -1
- package/dist/src/components/ui/playground-tabs.d.ts +2 -1
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata-model-list.d.ts +1 -0
- package/dist/src/domains/observability/components/trace-span-usage.d.ts +3 -0
- package/dist/src/domains/workflows/components/workflow-step-detail.d.ts +4 -0
- package/dist/src/domains/workflows/context/use-current-run.d.ts +15 -0
- package/dist/src/domains/workflows/context/workflow-run-context.d.ts +1 -0
- package/dist/src/domains/workflows/context/workflow-step-detail-context.d.ts +34 -0
- package/dist/src/domains/workflows/hooks/use-workflows-actions.d.ts +1 -0
- package/dist/src/domains/workflows/index.d.ts +1 -0
- package/dist/src/domains/workflows/workflow/workflow-code-dialog-content.d.ts +2 -1
- package/dist/src/domains/workflows/workflow/workflow-status.d.ts +8 -1
- package/dist/src/domains/workflows/workflow/workflow-step-action-bar.d.ts +4 -2
- package/dist/src/types.d.ts +1 -0
- package/package.json +11 -10
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TripwireMetadata } from '@mastra/react';
|
|
2
|
+
export interface TripwireNoticeProps {
|
|
3
|
+
reason: string;
|
|
4
|
+
tripwire?: TripwireMetadata;
|
|
5
|
+
}
|
|
6
|
+
export declare const TripwireNotice: ({ reason, tripwire }: TripwireNoticeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,5 +8,6 @@ export interface ToolBadgeProps extends Omit<ToolApprovalButtonsProps, 'toolCall
|
|
|
8
8
|
toolOutput: Array<{
|
|
9
9
|
toolId: string;
|
|
10
10
|
}>;
|
|
11
|
+
suspendPayload?: any;
|
|
11
12
|
}
|
|
12
|
-
export declare const ToolBadge: ({ toolName, args, result, metadata, toolOutput, toolCallId, toolApprovalMetadata, }: ToolBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const ToolBadge: ({ toolName, args, result, metadata, toolOutput, toolCallId, toolApprovalMetadata, suspendPayload, }: ToolBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,7 @@ export interface WorkflowBadgeProps extends Omit<ToolApprovalButtonsProps, 'tool
|
|
|
6
6
|
result?: any;
|
|
7
7
|
isStreaming?: boolean;
|
|
8
8
|
metadata?: MastraUIMessage['metadata'];
|
|
9
|
+
suspendPayload?: any;
|
|
9
10
|
}
|
|
10
|
-
export declare const WorkflowBadge: ({ result, workflowId, isStreaming, metadata, toolCallId, toolApprovalMetadata, }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const WorkflowBadge: ({ result, workflowId, isStreaming, metadata, toolCallId, toolApprovalMetadata, suspendPayload, }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export declare const useWorkflowStream: (workflowFullState?: WorkflowRunStreamResult) => void;
|
|
@@ -15,8 +15,9 @@ export interface TabProps {
|
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
value: string;
|
|
17
17
|
onClick?: () => void;
|
|
18
|
+
onClose?: () => void;
|
|
18
19
|
}
|
|
19
|
-
export declare const Tab: ({ children, value, onClick }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const Tab: ({ children, value, onClick, onClose }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export interface TabContentProps {
|
|
21
22
|
children: React.ReactNode;
|
|
22
23
|
value: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InputTokenDetails, OutputTokenDetails } from '@mastra/core/observability';
|
|
1
2
|
import { SpanRecord } from '@mastra/core/storage';
|
|
2
3
|
type V5TokenUsage = {
|
|
3
4
|
inputTokens: number;
|
|
@@ -5,6 +6,8 @@ type V5TokenUsage = {
|
|
|
5
6
|
reasoningTokens?: number;
|
|
6
7
|
cachedInputTokens?: number;
|
|
7
8
|
totalTokens: number;
|
|
9
|
+
inputDetails?: InputTokenDetails;
|
|
10
|
+
outputDetails?: OutputTokenDetails;
|
|
8
11
|
};
|
|
9
12
|
type LegacyTokenUsage = {
|
|
10
13
|
promptTokens: number;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tripwire data from workflow steps.
|
|
3
|
+
* This matches the core TripwireData schema in packages/core/src/agent/trip-wire.ts
|
|
4
|
+
*/
|
|
5
|
+
export type TripwireData = {
|
|
6
|
+
/** The reason for the tripwire */
|
|
7
|
+
reason: string;
|
|
8
|
+
/** If true, the agent should retry with the tripwire reason as feedback */
|
|
9
|
+
retry?: boolean;
|
|
10
|
+
/** Strongly typed metadata from the processor */
|
|
11
|
+
metadata?: unknown;
|
|
12
|
+
/** The ID of the processor that triggered the tripwire */
|
|
13
|
+
processorId?: string;
|
|
14
|
+
};
|
|
1
15
|
export type Step = {
|
|
2
16
|
error?: any;
|
|
17
|
+
tripwire?: TripwireData;
|
|
3
18
|
startedAt: number;
|
|
4
19
|
endedAt?: number;
|
|
5
20
|
status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
|
|
@@ -22,6 +22,7 @@ type WorkflowRunContextType = {
|
|
|
22
22
|
timeTravelWorkflowStream: (params: {
|
|
23
23
|
workflowId: string;
|
|
24
24
|
requestContext: Record<string, unknown>;
|
|
25
|
+
runId: string;
|
|
25
26
|
} & Omit<TimeTravelParams, 'requestContext'>) => Promise<void>;
|
|
26
27
|
runSnapshot?: WorkflowRunState;
|
|
27
28
|
isLoadingRunExecutionResult?: boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
2
|
+
import { ReactNode } from '../../../../node_modules/@types/react';
|
|
3
|
+
export type StepDetailType = 'map-config' | 'nested-graph' | null;
|
|
4
|
+
export type StepDetailData = {
|
|
5
|
+
type: StepDetailType;
|
|
6
|
+
stepName: string;
|
|
7
|
+
stepId?: string;
|
|
8
|
+
mapConfig?: string;
|
|
9
|
+
nestedGraph?: {
|
|
10
|
+
label: string;
|
|
11
|
+
stepGraph: SerializedStepFlowEntry[];
|
|
12
|
+
fullStep: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type WorkflowStepDetailContextType = {
|
|
16
|
+
stepDetail: StepDetailData | null;
|
|
17
|
+
showMapConfig: (params: {
|
|
18
|
+
stepName: string;
|
|
19
|
+
stepId?: string;
|
|
20
|
+
mapConfig: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
showNestedGraph: (params: {
|
|
23
|
+
label: string;
|
|
24
|
+
stepGraph: SerializedStepFlowEntry[];
|
|
25
|
+
fullStep: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
closeStepDetail: () => void;
|
|
28
|
+
};
|
|
29
|
+
export declare const WorkflowStepDetailContext: import('../../../../node_modules/@types/react').Context<WorkflowStepDetailContextType | null>;
|
|
30
|
+
export declare function useWorkflowStepDetail(): WorkflowStepDetailContextType;
|
|
31
|
+
export declare function WorkflowStepDetailProvider({ children }: {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -44,6 +44,7 @@ export declare const useStreamWorkflow: () => {
|
|
|
44
44
|
requestContext: Record<string, unknown>;
|
|
45
45
|
}, unknown>;
|
|
46
46
|
timeTravelWorkflowStream: import('@tanstack/react-query').UseMutationResult<void, Error, {
|
|
47
|
+
runId: string;
|
|
47
48
|
workflowId: string;
|
|
48
49
|
requestContext: Record<string, unknown>;
|
|
49
50
|
} & Omit<TimeTravelParams, "requestContext">, unknown>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
export interface TripwireInfo {
|
|
2
|
+
reason?: string;
|
|
3
|
+
retry?: boolean;
|
|
4
|
+
metadata?: unknown;
|
|
5
|
+
processorId?: string;
|
|
6
|
+
}
|
|
1
7
|
export interface WorkflowStatusProps {
|
|
2
8
|
stepId: string;
|
|
3
9
|
status: string;
|
|
4
10
|
result: Record<string, unknown>;
|
|
11
|
+
tripwire?: TripwireInfo;
|
|
5
12
|
}
|
|
6
|
-
export declare const WorkflowStatus: ({ stepId, status, result }: WorkflowStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const WorkflowStatus: ({ stepId, status, result, tripwire }: WorkflowStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { TripwireData } from '../context/use-current-run';
|
|
1
2
|
export interface WorkflowStepActionBarProps {
|
|
2
3
|
input?: any;
|
|
3
4
|
output?: any;
|
|
4
5
|
suspendOutput?: any;
|
|
5
6
|
resumeData?: any;
|
|
6
7
|
error?: any;
|
|
8
|
+
tripwire?: TripwireData;
|
|
7
9
|
stepName: string;
|
|
8
10
|
stepId?: string;
|
|
9
11
|
mapConfig?: string;
|
|
10
12
|
onShowNestedGraph?: () => void;
|
|
11
|
-
status?: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
|
|
13
|
+
status?: 'running' | 'success' | 'failed' | 'suspended' | 'waiting' | 'tripwire';
|
|
12
14
|
stepKey?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare const WorkflowStepActionBar: ({ input, output, resumeData, suspendOutput, error, mapConfig, stepName, stepId, onShowNestedGraph, status, stepKey, }: WorkflowStepActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const WorkflowStepActionBar: ({ input, output, resumeData, suspendOutput, error, tripwire, mapConfig, stepName, stepId, onShowNestedGraph, status, stepKey, }: WorkflowStepActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/src/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.13",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@autoform/core": "^3.0.0",
|
|
46
46
|
"@autoform/react": "^4.0.0",
|
|
47
47
|
"@autoform/zod": "^4.0.0",
|
|
48
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
48
49
|
"@codemirror/lang-json": "^6.0.2",
|
|
49
50
|
"@codemirror/lang-markdown": "^6.5.0",
|
|
50
51
|
"@codemirror/language-data": "^6.5.2",
|
|
@@ -111,10 +112,10 @@
|
|
|
111
112
|
"react": ">=19.0.0",
|
|
112
113
|
"react-dom": ">=19.0.0",
|
|
113
114
|
"tailwindcss": "^3.0.0",
|
|
114
|
-
"@mastra/
|
|
115
|
-
"@mastra/
|
|
116
|
-
"@mastra/
|
|
117
|
-
"@mastra/
|
|
115
|
+
"@mastra/client-js": "^1.0.0-beta.13",
|
|
116
|
+
"@mastra/ai-sdk": "^1.0.0-beta.9",
|
|
117
|
+
"@mastra/schema-compat": "1.0.0-beta.3",
|
|
118
|
+
"@mastra/react": "0.1.0-beta.13"
|
|
118
119
|
},
|
|
119
120
|
"devDependencies": {
|
|
120
121
|
"@storybook/addon-docs": "^9.1.16",
|
|
@@ -139,11 +140,11 @@
|
|
|
139
140
|
"vite-plugin-dts": "^4.5.4",
|
|
140
141
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
141
142
|
"vitest": "4.0.12",
|
|
142
|
-
"@mastra/ai-sdk": "^1.0.0-beta.
|
|
143
|
-
"@mastra/
|
|
144
|
-
"@mastra/
|
|
145
|
-
"@mastra/
|
|
146
|
-
"@mastra/schema-compat": "1.0.0-beta.
|
|
143
|
+
"@mastra/ai-sdk": "^1.0.0-beta.9",
|
|
144
|
+
"@mastra/client-js": "^1.0.0-beta.13",
|
|
145
|
+
"@mastra/core": "1.0.0-beta.13",
|
|
146
|
+
"@mastra/react": "0.1.0-beta.13",
|
|
147
|
+
"@mastra/schema-compat": "1.0.0-beta.3"
|
|
147
148
|
},
|
|
148
149
|
"homepage": "https://mastra.ai",
|
|
149
150
|
"repository": {
|