@mastra/playground-ui 7.0.0-beta.2 → 7.0.0-beta.20
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 +584 -0
- package/dist/index.cjs.js +6788 -4688
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.es.js +7082 -5003
- 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/assistant-ui/tooltip-icon-button.d.ts +2 -7
- package/dist/src/components/dynamic-form/index.d.ts +2 -1
- package/dist/src/components/ui/autoform/CustomAutoForm.d.ts +2 -0
- package/dist/src/components/ui/combobox.d.ts +3 -3
- package/dist/src/components/ui/containers/MainContent.d.ts +7 -0
- package/dist/src/components/ui/elements/buttons/combined-buttons.d.ts +6 -0
- package/dist/src/components/ui/elements/buttons/index.d.ts +1 -1
- package/dist/src/components/ui/elements/form-fields/search-field.d.ts +4 -1
- package/dist/src/components/ui/elements/notification/notification.d.ts +3 -1
- package/dist/src/components/ui/elements/side-dialog/side-dialog-top.d.ts +1 -2
- package/dist/src/components/ui/elements/tabs/index.d.ts +4 -1
- package/dist/src/components/ui/elements/tabs/tabs-root.d.ts +1 -1
- package/dist/src/components/ui/elements/tabs/tabs-tab.d.ts +2 -1
- package/dist/src/components/ui/input.d.ts +2 -2
- package/dist/src/components/ui/searchbar.d.ts +2 -1
- package/dist/src/components/ui/text.d.ts +2 -2
- package/dist/src/domains/agents/components/agent-chat.d.ts +2 -1
- package/dist/src/domains/agents/components/agent-combobox.d.ts +1 -3
- package/dist/src/domains/agents/components/agent-entity-header.d.ts +1 -3
- package/dist/src/domains/agents/components/agent-information/agent-information.d.ts +25 -0
- package/dist/src/domains/agents/components/agent-layout.d.ts +7 -0
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata-model-list.d.ts +1 -0
- package/dist/src/domains/agents/components/agent-metadata/agent-metadata.d.ts +2 -11
- package/dist/src/domains/agents/components/agent-settings.d.ts +2 -4
- package/dist/src/domains/agents/index.d.ts +3 -0
- package/dist/src/domains/configuration/components/header-list-form.d.ts +10 -0
- package/dist/src/domains/configuration/components/mastra-version-footer.d.ts +17 -0
- package/dist/src/domains/configuration/components/playground-config-guard.d.ts +1 -0
- package/dist/src/domains/configuration/components/studio-config-form.d.ts +5 -0
- package/dist/src/domains/configuration/context/studio-config-context.d.ts +12 -0
- package/dist/src/domains/configuration/hooks/use-mastra-instance-status.d.ts +4 -0
- package/dist/src/domains/configuration/hooks/use-mastra-packages.d.ts +1 -0
- package/dist/src/domains/configuration/hooks/use-package-updates.d.ts +18 -0
- package/dist/src/domains/configuration/index.d.ts +7 -0
- package/dist/src/domains/configuration/types.d.ts +4 -0
- package/dist/src/domains/mcps/components/mcp-server-combobox.d.ts +1 -3
- package/dist/src/domains/memory/hooks/use-memory.d.ts +5 -0
- package/dist/src/domains/observability/components/helpers.d.ts +12 -6
- package/dist/src/domains/observability/components/index.d.ts +1 -1
- package/dist/src/domains/observability/components/shared.d.ts +2 -5
- package/dist/src/domains/observability/components/span-dialog.d.ts +5 -2
- package/dist/src/domains/observability/components/span-score-list.d.ts +1 -1
- package/dist/src/domains/observability/components/span-scoring.d.ts +5 -1
- package/dist/src/domains/observability/components/span-tabs.d.ts +5 -2
- package/dist/src/domains/observability/components/span-type-icon.d.ts +6 -0
- package/dist/src/domains/observability/components/timeline-expand-col.d.ts +13 -0
- package/dist/src/domains/observability/components/timeline-name-col.d.ts +16 -0
- package/dist/src/domains/observability/components/timeline-structure-sign.d.ts +7 -0
- package/dist/src/domains/observability/components/timeline-timing-col.d.ts +12 -0
- package/dist/src/domains/observability/components/trace-dialog.d.ts +4 -1
- package/dist/src/domains/observability/components/trace-span-usage.d.ts +4 -1
- package/dist/src/domains/observability/components/trace-timeline-span.d.ts +6 -1
- package/dist/src/domains/observability/components/trace-timeline-tools.d.ts +12 -0
- package/dist/src/domains/observability/components/trace-timeline.d.ts +5 -1
- package/dist/src/domains/observability/components/traces-list.d.ts +1 -1
- package/dist/src/domains/observability/components/traces-tools.d.ts +10 -1
- package/dist/src/domains/observability/components/tracing-run-options.d.ts +1 -0
- package/dist/src/domains/observability/context/tracing-settings-context.d.ts +19 -0
- package/dist/src/domains/observability/hooks/use-tracing-settings-state.d.ts +11 -0
- package/dist/src/domains/observability/index.d.ts +1 -0
- package/dist/src/domains/observability/types.d.ts +13 -0
- package/dist/src/domains/observability/utils/__tests__/span-utils.test.d.ts +1 -0
- package/dist/src/domains/observability/utils/get-descendant-ids.d.ts +2 -0
- package/dist/src/domains/observability/utils/span-utils.d.ts +9 -0
- package/dist/src/domains/scores/components/score-dialog.d.ts +2 -2
- package/dist/src/domains/scores/components/scorer-combobox.d.ts +1 -3
- package/dist/src/domains/scores/hooks/use-trace-span-scores.d.ts +41 -1
- package/dist/src/domains/templates/template-form.d.ts +2 -1
- package/dist/src/domains/tools/components/tool-combobox.d.ts +1 -3
- package/dist/src/domains/workflows/components/workflow-combobox.d.ts +1 -3
- package/dist/src/domains/workflows/components/workflow-layout.d.ts +7 -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 +29 -6
- 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 +12 -1
- package/dist/src/domains/workflows/index.d.ts +2 -0
- package/dist/src/domains/workflows/workflow/workflow-code-dialog-content.d.ts +2 -1
- package/dist/src/domains/workflows/workflow/workflow-default-node.d.ts +2 -1
- package/dist/src/domains/workflows/workflow/workflow-input-data.d.ts +2 -1
- package/dist/src/domains/workflows/workflow/workflow-nested-node.d.ts +2 -1
- package/dist/src/domains/workflows/workflow/workflow-run-options.d.ts +1 -0
- package/dist/src/domains/workflows/workflow/workflow-status.d.ts +8 -1
- package/dist/src/domains/workflows/workflow/workflow-step-action-bar.d.ts +7 -2
- package/dist/src/domains/workflows/workflow/workflow-time-travel-form.d.ts +9 -0
- package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +5 -2
- package/dist/src/ds/components/Avatar/Avatar.d.ts +5 -3
- package/dist/src/ds/components/Button/Button.d.ts +7 -2
- package/dist/src/ds/components/CodeEditor/code-editor.d.ts +12 -0
- package/dist/src/ds/components/CodeEditor/index.d.ts +1 -0
- package/dist/src/ds/tokens/sizes.d.ts +4 -1
- package/dist/src/hooks/use-agent-messages.d.ts +4 -3
- package/dist/src/hooks/use-workflow-runs.d.ts +223 -2
- package/dist/src/index.d.ts +1 -2
- package/dist/src/lib/resize/collapsible-panel.d.ts +5 -0
- package/dist/src/lib/resize/separator.d.ts +1 -0
- package/dist/src/lib/tanstack-query.d.ts +5 -2
- package/dist/src/types.d.ts +3 -2
- package/dist/tokens.cjs.js +4 -1
- package/dist/tokens.cjs.js.map +1 -1
- package/dist/tokens.es.js +4 -1
- package/dist/tokens.es.js.map +1 -1
- package/package.json +30 -34
- package/dist/src/components/assistant-ui/syntax-highlighter.d.ts +0 -1
- package/dist/src/components/syntax-highlighter.d.ts +0 -5
- package/dist/src/components/ui/avatar.d.ts +0 -6
- package/dist/src/components/ui/badge.d.ts +0 -9
- package/dist/src/components/ui/button.d.ts +0 -16
- package/dist/src/components/ui/calendar.d.ts +0 -8
- package/dist/src/components/ui/card.d.ts +0 -8
- package/dist/src/components/ui/command.d.ts +0 -78
- package/dist/src/components/ui/date-picker.d.ts +0 -23
- package/dist/src/components/ui/elements/buttons/button.d.ts +0 -7
- package/dist/src/components/ui/elements/tabs/tabs.d.ts +0 -24
- package/dist/src/components/ui/form.d.ts +0 -23
- package/dist/src/components/ui/playground-tabs.d.ts +0 -24
- package/dist/src/components/ui/syntax-highlighter.d.ts +0 -7
- package/dist/src/components/ui/table.d.ts +0 -10
- package/dist/src/components/ui/tabs.d.ts +0 -7
- package/dist/src/components/ui/textarea.d.ts +0 -5
- package/dist/src/domains/observability/components/trace-timeline-legend.d.ts +0 -6
- package/dist/src/ds/components/TraceTree/Span.d.ts +0 -32
- package/dist/src/ds/components/TraceTree/Spans.d.ts +0 -5
- package/dist/src/ds/components/TraceTree/Time.d.ts +0 -8
- package/dist/src/ds/components/TraceTree/Trace.d.ts +0 -13
- package/dist/src/ds/components/TraceTree/TraceTree.d.ts +0 -5
- package/dist/src/ds/components/TraceTree/index.d.ts +0 -1
- package/dist/src/ds/components/types.d.ts +0 -4
|
@@ -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,13 +6,15 @@ 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;
|
|
11
14
|
completionTokens: number;
|
|
12
15
|
totalTokens: number;
|
|
13
16
|
};
|
|
14
|
-
type TokenUsage = V5TokenUsage | LegacyTokenUsage;
|
|
17
|
+
export type TokenUsage = V5TokenUsage | LegacyTokenUsage;
|
|
15
18
|
type TraceSpanUsageProps = {
|
|
16
19
|
traceUsage?: TokenUsage;
|
|
17
20
|
traceSpans?: SpanRecord[];
|
|
@@ -8,6 +8,11 @@ type TraceTimelineSpanProps = {
|
|
|
8
8
|
overallLatency?: number;
|
|
9
9
|
overallStartTime?: string;
|
|
10
10
|
overallEndTime?: string;
|
|
11
|
+
fadedTypes?: string[];
|
|
12
|
+
searchPhrase?: string;
|
|
13
|
+
featuredSpanIds?: string[];
|
|
14
|
+
expandedSpanIds?: string[];
|
|
15
|
+
setExpandedSpanIds?: React.Dispatch<React.SetStateAction<string[]>>;
|
|
11
16
|
};
|
|
12
|
-
export declare function TraceTimelineSpan({ span, depth, onSpanClick, selectedSpanId, isLastChild, overallLatency, overallStartTime, overallEndTime, }: TraceTimelineSpanProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function TraceTimelineSpan({ span, depth, onSpanClick, selectedSpanId, isLastChild, overallLatency, overallStartTime, overallEndTime, fadedTypes, searchPhrase, featuredSpanIds, expandedSpanIds, setExpandedSpanIds, }: TraceTimelineSpanProps): import("react/jsx-runtime").JSX.Element;
|
|
13
18
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SpanRecord } from '@mastra/core/storage';
|
|
2
|
+
type TraceTimelineLegendProps = {
|
|
3
|
+
spans?: SpanRecord[];
|
|
4
|
+
fadedTypes?: string[];
|
|
5
|
+
onLegendClick?: (val: string) => void;
|
|
6
|
+
onLegendReset?: () => void;
|
|
7
|
+
searchPhrase?: string;
|
|
8
|
+
onSearchPhraseChange?: (val: string) => void;
|
|
9
|
+
traceId?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function TraceTimelineTools({ spans, fadedTypes, onLegendClick, onLegendReset, onSearchPhraseChange, traceId, }: TraceTimelineLegendProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -4,6 +4,10 @@ type TraceTimelineProps = {
|
|
|
4
4
|
onSpanClick: (id: string) => void;
|
|
5
5
|
selectedSpanId?: string;
|
|
6
6
|
isLoading?: boolean;
|
|
7
|
+
fadedTypes?: string[];
|
|
8
|
+
expandedSpanIds?: string[];
|
|
9
|
+
setExpandedSpanIds?: React.Dispatch<React.SetStateAction<string[]>>;
|
|
10
|
+
featuredSpanIds?: string[];
|
|
7
11
|
};
|
|
8
|
-
export declare function TraceTimeline({ hierarchicalSpans, onSpanClick, selectedSpanId, isLoading }: TraceTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function TraceTimeline({ hierarchicalSpans, onSpanClick, selectedSpanId, isLoading, fadedTypes, expandedSpanIds, setExpandedSpanIds, featuredSpanIds, }: TraceTimelineProps): import("react/jsx-runtime").JSX.Element;
|
|
9
13
|
export {};
|
|
@@ -4,7 +4,7 @@ export declare const tracesListColumns: {
|
|
|
4
4
|
label: string;
|
|
5
5
|
size: string;
|
|
6
6
|
}[];
|
|
7
|
-
type Trace = Pick<SpanRecord, 'traceId' | 'name'> & {
|
|
7
|
+
type Trace = Pick<SpanRecord, 'traceId' | 'name' | 'entityType' | 'entityId' | 'entityName'> & {
|
|
8
8
|
attributes?: Record<string, any> | null;
|
|
9
9
|
createdAt: Date | string;
|
|
10
10
|
};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { EntityType } from '@mastra/core/observability';
|
|
1
2
|
export type EntityOptions = {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
4
|
-
type:
|
|
5
|
+
type: EntityType.AGENT;
|
|
6
|
+
} | {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
type: EntityType.WORKFLOW_RUN;
|
|
10
|
+
} | {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
type: 'all';
|
|
5
14
|
};
|
|
6
15
|
type TracesToolsProps = {
|
|
7
16
|
selectedEntity?: EntityOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TracingRunOptions: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TracingOptions } from '@mastra/core/observability';
|
|
2
|
+
import { ReactNode } from '../../../../node_modules/@types/react';
|
|
3
|
+
export type TracingSettings = {
|
|
4
|
+
tracingOptions?: TracingOptions;
|
|
5
|
+
};
|
|
6
|
+
export type TracingSettingsContextType = {
|
|
7
|
+
setSettings: (settings: TracingSettings) => void;
|
|
8
|
+
resetAll: () => void;
|
|
9
|
+
settings?: TracingSettings;
|
|
10
|
+
entityType?: 'workflow' | 'agent';
|
|
11
|
+
};
|
|
12
|
+
export declare const TracingSettingsContext: import('../../../../node_modules/@types/react').Context<TracingSettingsContextType>;
|
|
13
|
+
export interface TracingSettingsProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
entityId: string;
|
|
16
|
+
entityType: 'workflow' | 'agent';
|
|
17
|
+
}
|
|
18
|
+
export declare const TracingSettingsProvider: ({ children, entityId, entityType }: TracingSettingsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const useTracingSettings: () => TracingSettingsContextType;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TracingSettings } from '../context/tracing-settings-context';
|
|
2
|
+
export interface TracingSettingsStateProps {
|
|
3
|
+
entityId: string;
|
|
4
|
+
entityType: 'workflow' | 'agent';
|
|
5
|
+
}
|
|
6
|
+
export declare function useTracingSettingsState({ entityId, entityType }: TracingSettingsStateProps): {
|
|
7
|
+
settings: TracingSettings | undefined;
|
|
8
|
+
setSettings: (settingsValue: TracingSettings) => void;
|
|
9
|
+
resetAll: () => void;
|
|
10
|
+
entityType: "workflow" | "agent";
|
|
11
|
+
};
|
|
@@ -6,4 +6,17 @@ export type UISpan = {
|
|
|
6
6
|
startTime: string;
|
|
7
7
|
endTime?: string;
|
|
8
8
|
spans?: UISpan[];
|
|
9
|
+
parentSpanId?: string | null;
|
|
9
10
|
};
|
|
11
|
+
export type UISpanStyle = {
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
color?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
bgColor?: string;
|
|
16
|
+
typePrefix: string;
|
|
17
|
+
};
|
|
18
|
+
export type UISpanState = {
|
|
19
|
+
spanId: string;
|
|
20
|
+
expanded: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type UISpanType = 'agent' | 'workflow' | 'tool' | 'model' | 'other';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SpanRecord } from '@mastra/core/storage';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a span indicates that the token limit was exceeded
|
|
4
|
+
*/
|
|
5
|
+
export declare function isTokenLimitExceeded(span?: SpanRecord): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Get a human-readable message for token limit exceeded
|
|
8
|
+
*/
|
|
9
|
+
export declare function getTokenLimitMessage(span?: SpanRecord): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SideDialogRootProps } from '../../../components/ui/elements';
|
|
2
|
-
import {
|
|
2
|
+
import { ScoreRowData } from '@mastra/core/evals';
|
|
3
3
|
type ScoreDialogProps = {
|
|
4
|
-
score?:
|
|
4
|
+
score?: ScoreRowData;
|
|
5
5
|
scorerName?: string;
|
|
6
6
|
isOpen: boolean;
|
|
7
7
|
onClose: () => void;
|
|
@@ -6,7 +6,5 @@ export interface ScorerComboboxProps {
|
|
|
6
6
|
emptyText?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
buttonClassName?: string;
|
|
10
|
-
contentClassName?: string;
|
|
11
9
|
}
|
|
12
|
-
export declare function ScorerCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled,
|
|
10
|
+
export declare function ScorerCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, }: ScorerComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,45 @@ type useTraceSpanScoresProps = {
|
|
|
3
3
|
spanId?: string;
|
|
4
4
|
page?: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const useTraceSpanScores: ({ traceId, spanId, page }: useTraceSpanScoresProps) => import('@tanstack/react-query').UseQueryResult<
|
|
6
|
+
export declare const useTraceSpanScores: ({ traceId, spanId, page }: useTraceSpanScoresProps) => import('@tanstack/react-query').UseQueryResult<{
|
|
7
|
+
pagination: {
|
|
8
|
+
total: number;
|
|
9
|
+
hasMore: boolean;
|
|
10
|
+
page: number;
|
|
11
|
+
perPage: number | false;
|
|
12
|
+
};
|
|
13
|
+
scores: {
|
|
14
|
+
runId: string;
|
|
15
|
+
source: "LIVE" | "TEST";
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date | null;
|
|
19
|
+
scorer: Record<string, unknown>;
|
|
20
|
+
entity: Record<string, unknown>;
|
|
21
|
+
score: number;
|
|
22
|
+
scorerId: string;
|
|
23
|
+
entityId: string;
|
|
24
|
+
input?: unknown;
|
|
25
|
+
threadId?: string | undefined;
|
|
26
|
+
resourceId?: string | undefined;
|
|
27
|
+
metadata?: Record<string, unknown> | undefined;
|
|
28
|
+
output?: unknown;
|
|
29
|
+
additionalContext?: Record<string, unknown> | undefined;
|
|
30
|
+
requestContext?: Record<string, unknown> | undefined;
|
|
31
|
+
entityType?: string | undefined;
|
|
32
|
+
structuredOutput?: boolean | undefined;
|
|
33
|
+
traceId?: string | undefined;
|
|
34
|
+
spanId?: string | undefined;
|
|
35
|
+
extractStepResult?: Record<string, unknown> | undefined;
|
|
36
|
+
extractPrompt?: string | undefined;
|
|
37
|
+
analyzeStepResult?: Record<string, unknown> | undefined;
|
|
38
|
+
analyzePrompt?: string | undefined;
|
|
39
|
+
reason?: string | undefined;
|
|
40
|
+
reasonPrompt?: string | undefined;
|
|
41
|
+
preprocessStepResult?: Record<string, unknown> | undefined;
|
|
42
|
+
preprocessPrompt?: string | undefined;
|
|
43
|
+
generateScorePrompt?: string | undefined;
|
|
44
|
+
generateReasonPrompt?: string | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
}, Error>;
|
|
7
47
|
export {};
|
|
@@ -12,6 +12,7 @@ type TemplateFormProps = {
|
|
|
12
12
|
handleInstallTemplate: () => void;
|
|
13
13
|
handleVariableChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
14
|
isLoadingEnvVars?: boolean;
|
|
15
|
+
isInstalling?: boolean;
|
|
15
16
|
defaultModelProvider?: string;
|
|
16
17
|
defaultModelId?: string;
|
|
17
18
|
onModelUpdate?: (params: {
|
|
@@ -21,5 +22,5 @@ type TemplateFormProps = {
|
|
|
21
22
|
message: string;
|
|
22
23
|
}>;
|
|
23
24
|
};
|
|
24
|
-
export declare function TemplateForm({ providerOptions, selectedProvider, onProviderChange, variables, errors, handleInstallTemplate, handleVariableChange, isLoadingEnvVars, defaultModelProvider, defaultModelId, onModelUpdate, }: TemplateFormProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function TemplateForm({ providerOptions, selectedProvider, onProviderChange, variables, errors, handleInstallTemplate, handleVariableChange, isLoadingEnvVars, isInstalling, defaultModelProvider, defaultModelId, onModelUpdate, }: TemplateFormProps): import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -6,7 +6,5 @@ export interface ToolComboboxProps {
|
|
|
6
6
|
emptyText?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
buttonClassName?: string;
|
|
10
|
-
contentClassName?: string;
|
|
11
9
|
}
|
|
12
|
-
export declare function ToolCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled,
|
|
10
|
+
export declare function ToolCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, }: ToolComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,5 @@ export interface WorkflowComboboxProps {
|
|
|
6
6
|
emptyText?: string;
|
|
7
7
|
className?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
-
buttonClassName?: string;
|
|
10
|
-
contentClassName?: string;
|
|
11
9
|
}
|
|
12
|
-
export declare function WorkflowCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled,
|
|
10
|
+
export declare function WorkflowCombobox({ value, onValueChange, placeholder, searchPlaceholder, emptyText, className, disabled, }: WorkflowComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface WorkflowLayoutProps {
|
|
2
|
+
workflowId: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
leftSlot?: React.ReactNode;
|
|
5
|
+
rightSlot?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const WorkflowLayout: ({ workflowId, children, leftSlot, rightSlot }: WorkflowLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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';
|
|
@@ -1,18 +1,41 @@
|
|
|
1
1
|
import { WorkflowRunState, WorkflowStreamResult } from '@mastra/core/workflows';
|
|
2
|
+
import { Dispatch, SetStateAction, ReactNode } from '../../../../node_modules/@types/react';
|
|
3
|
+
import { WorkflowTriggerProps } from '../workflow/workflow-trigger';
|
|
4
|
+
import { TimeTravelParams } from '@mastra/client-js';
|
|
2
5
|
export type WorkflowRunStreamResult = WorkflowStreamResult<any, any, any, any>;
|
|
3
6
|
type WorkflowRunContextType = {
|
|
4
7
|
result: WorkflowRunStreamResult | null;
|
|
5
|
-
setResult:
|
|
8
|
+
setResult: Dispatch<SetStateAction<WorkflowRunStreamResult | null>>;
|
|
6
9
|
payload: any;
|
|
7
|
-
setPayload:
|
|
10
|
+
setPayload: Dispatch<SetStateAction<any>>;
|
|
8
11
|
clearData: () => void;
|
|
9
12
|
snapshot?: WorkflowRunState;
|
|
10
13
|
runId?: string;
|
|
11
|
-
setRunId:
|
|
12
|
-
|
|
14
|
+
setRunId: Dispatch<SetStateAction<string>>;
|
|
15
|
+
workflowError: Error | null;
|
|
16
|
+
observeWorkflowStream?: ({ workflowId, runId, storeRunResult, }: {
|
|
17
|
+
workflowId: string;
|
|
18
|
+
runId: string;
|
|
19
|
+
storeRunResult: WorkflowRunStreamResult | null;
|
|
20
|
+
}) => void;
|
|
21
|
+
closeStreamsAndReset: () => void;
|
|
22
|
+
timeTravelWorkflowStream: (params: {
|
|
23
|
+
workflowId: string;
|
|
24
|
+
requestContext: Record<string, unknown>;
|
|
25
|
+
runId?: string;
|
|
26
|
+
} & Omit<TimeTravelParams, 'requestContext'>) => Promise<void>;
|
|
27
|
+
runSnapshot?: WorkflowRunState;
|
|
28
|
+
isLoadingRunExecutionResult?: boolean;
|
|
29
|
+
withoutTimeTravel?: boolean;
|
|
30
|
+
debugMode: boolean;
|
|
31
|
+
setDebugMode: Dispatch<SetStateAction<boolean>>;
|
|
32
|
+
} & Omit<WorkflowTriggerProps, 'paramsRunId' | 'setRunId' | 'observeWorkflowStream'>;
|
|
13
33
|
export declare const WorkflowRunContext: import('../../../../node_modules/@types/react').Context<WorkflowRunContextType>;
|
|
14
|
-
export declare function WorkflowRunProvider({ children, snapshot, }: {
|
|
15
|
-
children:
|
|
34
|
+
export declare function WorkflowRunProvider({ children, snapshot, workflowId, initialRunId, withoutTimeTravel, }: {
|
|
35
|
+
children: ReactNode;
|
|
16
36
|
snapshot?: WorkflowRunState;
|
|
37
|
+
workflowId: string;
|
|
38
|
+
initialRunId?: string;
|
|
39
|
+
withoutTimeTravel?: boolean;
|
|
17
40
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
41
|
export {};
|
|
@@ -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 {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TimeTravelParams } from '@mastra/client-js';
|
|
1
2
|
import { WorkflowStreamResult as CoreWorkflowStreamResult } from '@mastra/core/workflows';
|
|
2
3
|
export declare const useExecuteWorkflow: () => {
|
|
3
4
|
startWorkflowRun: import('@tanstack/react-query').UseMutationResult<void, Error, {
|
|
@@ -20,12 +21,16 @@ export declare const useExecuteWorkflow: () => {
|
|
|
20
21
|
}, unknown>;
|
|
21
22
|
};
|
|
22
23
|
type WorkflowStreamResult = CoreWorkflowStreamResult<any, any, any, any>;
|
|
23
|
-
export declare const useStreamWorkflow: (
|
|
24
|
+
export declare const useStreamWorkflow: ({ debugMode }: {
|
|
25
|
+
debugMode: boolean;
|
|
26
|
+
}) => {
|
|
24
27
|
streamWorkflow: import('@tanstack/react-query').UseMutationResult<void, Error, {
|
|
25
28
|
workflowId: string;
|
|
26
29
|
runId: string;
|
|
27
30
|
inputData: Record<string, unknown>;
|
|
31
|
+
initialState?: Record<string, unknown>;
|
|
28
32
|
requestContext: Record<string, unknown>;
|
|
33
|
+
perStep?: boolean;
|
|
29
34
|
}, unknown>;
|
|
30
35
|
streamResult: WorkflowStreamResult;
|
|
31
36
|
isStreaming: boolean;
|
|
@@ -41,7 +46,13 @@ export declare const useStreamWorkflow: () => {
|
|
|
41
46
|
runId: string;
|
|
42
47
|
resumeData: Record<string, unknown>;
|
|
43
48
|
requestContext: Record<string, unknown>;
|
|
49
|
+
perStep?: boolean;
|
|
44
50
|
}, unknown>;
|
|
51
|
+
timeTravelWorkflowStream: import('@tanstack/react-query').UseMutationResult<void, Error, {
|
|
52
|
+
runId?: string;
|
|
53
|
+
workflowId: string;
|
|
54
|
+
requestContext: Record<string, unknown>;
|
|
55
|
+
} & Omit<TimeTravelParams, "requestContext">, unknown>;
|
|
45
56
|
};
|
|
46
57
|
export declare const useCancelWorkflowRun: () => import('@tanstack/react-query').UseMutationResult<{
|
|
47
58
|
message: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './context/workflow-run-context';
|
|
2
|
+
export * from './context/workflow-step-detail-context';
|
|
2
3
|
export * from './workflow/workflow-graph';
|
|
3
4
|
export * from './workflow/workflow-trigger';
|
|
4
5
|
export * from './context/use-current-run';
|
|
@@ -8,3 +9,4 @@ export * from './components/workflow-information';
|
|
|
8
9
|
export * from './components/workflow-combobox';
|
|
9
10
|
export * from './utils';
|
|
10
11
|
export * from './hooks';
|
|
12
|
+
export * from './components/workflow-layout';
|
|
@@ -14,5 +14,6 @@ export type DefaultNode = Node<{
|
|
|
14
14
|
}, 'default-node'>;
|
|
15
15
|
export interface WorkflowDefaultNodeProps {
|
|
16
16
|
parentWorkflowName?: string;
|
|
17
|
+
stepsFlow: Record<string, string[]>;
|
|
17
18
|
}
|
|
18
|
-
export declare function WorkflowDefaultNode({ data, parentWorkflowName }: NodeProps<DefaultNode> & WorkflowDefaultNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function WorkflowDefaultNode({ data, parentWorkflowName, stepsFlow, }: NodeProps<DefaultNode> & WorkflowDefaultNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,6 @@ export interface WorkflowInputDataProps {
|
|
|
6
6
|
submitButtonLabel: string;
|
|
7
7
|
onSubmit: (data: any) => void;
|
|
8
8
|
withoutSubmit?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
9
10
|
}
|
|
10
|
-
export declare const WorkflowInputData: ({ schema, defaultValues, withoutSubmit, isSubmitLoading, submitButtonLabel, onSubmit, }: WorkflowInputDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const WorkflowInputData: ({ schema, defaultValues, withoutSubmit, isSubmitLoading, submitButtonLabel, onSubmit, children, }: WorkflowInputDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,5 +14,6 @@ export type NestedNode = Node<{
|
|
|
14
14
|
}, 'nested-node'>;
|
|
15
15
|
export interface WorkflowNestedNodeProps {
|
|
16
16
|
parentWorkflowName?: string;
|
|
17
|
+
stepsFlow: Record<string, string[]>;
|
|
17
18
|
}
|
|
18
|
-
export declare function WorkflowNestedNode({ data, parentWorkflowName }: NodeProps<NestedNode> & WorkflowNestedNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function WorkflowNestedNode({ data, parentWorkflowName, stepsFlow, }: NodeProps<NestedNode> & WorkflowNestedNodeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WorkflowRunOptions: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,13 +1,18 @@
|
|
|
1
|
+
import { TripwireData } from '../context/use-current-run';
|
|
2
|
+
import { WorkflowRunStatus } from '@mastra/core/workflows';
|
|
1
3
|
export interface WorkflowStepActionBarProps {
|
|
2
4
|
input?: any;
|
|
3
5
|
output?: any;
|
|
4
6
|
suspendOutput?: any;
|
|
5
7
|
resumeData?: any;
|
|
6
8
|
error?: any;
|
|
9
|
+
tripwire?: TripwireData;
|
|
7
10
|
stepName: string;
|
|
8
11
|
stepId?: string;
|
|
9
12
|
mapConfig?: string;
|
|
10
13
|
onShowNestedGraph?: () => void;
|
|
11
|
-
status?:
|
|
14
|
+
status?: WorkflowRunStatus;
|
|
15
|
+
stepKey?: string;
|
|
16
|
+
stepsFlow?: Record<string, string[]>;
|
|
12
17
|
}
|
|
13
|
-
export declare const WorkflowStepActionBar: ({ input, output, resumeData, suspendOutput, error, mapConfig, stepName, stepId, onShowNestedGraph, status, }: WorkflowStepActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const WorkflowStepActionBar: ({ input, output, resumeData, suspendOutput, error, tripwire, mapConfig, stepName, stepId, onShowNestedGraph, status, stepKey, stepsFlow, }: WorkflowStepActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type WorkflowTimeTravelFormProps = {
|
|
2
|
+
stepKey: string;
|
|
3
|
+
closeModal: () => void;
|
|
4
|
+
isPerStepRun?: boolean;
|
|
5
|
+
isContinueRun?: boolean;
|
|
6
|
+
buttonText?: string;
|
|
7
|
+
inputData?: unknown;
|
|
8
|
+
};
|
|
9
|
+
export declare const WorkflowTimeTravelForm: ({ stepKey, closeModal, isPerStepRun, isContinueRun, buttonText, inputData, }: WorkflowTimeTravelFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,22 +13,25 @@ export interface WorkflowTriggerProps {
|
|
|
13
13
|
runId: string;
|
|
14
14
|
}>;
|
|
15
15
|
isStreamingWorkflow: boolean;
|
|
16
|
-
streamWorkflow: ({ workflowId, runId, inputData, requestContext, }: {
|
|
16
|
+
streamWorkflow: ({ workflowId, runId, inputData, initialState, requestContext, perStep, }: {
|
|
17
17
|
workflowId: string;
|
|
18
18
|
runId: string;
|
|
19
19
|
inputData: Record<string, unknown>;
|
|
20
|
+
initialState?: Record<string, unknown>;
|
|
20
21
|
requestContext: Record<string, unknown>;
|
|
22
|
+
perStep?: boolean;
|
|
21
23
|
}) => Promise<void>;
|
|
22
24
|
observeWorkflowStream?: ({ workflowId, runId }: {
|
|
23
25
|
workflowId: string;
|
|
24
26
|
runId: string;
|
|
25
27
|
}) => void;
|
|
26
|
-
resumeWorkflow: ({ workflowId, step, runId, resumeData, requestContext, }: {
|
|
28
|
+
resumeWorkflow: ({ workflowId, step, runId, resumeData, requestContext, perStep, }: {
|
|
27
29
|
workflowId: string;
|
|
28
30
|
step: string | string[];
|
|
29
31
|
runId: string;
|
|
30
32
|
resumeData: Record<string, unknown>;
|
|
31
33
|
requestContext: Record<string, unknown>;
|
|
34
|
+
perStep?: boolean;
|
|
32
35
|
}) => Promise<void>;
|
|
33
36
|
streamResult: WorkflowRunStreamResult | null;
|
|
34
37
|
isCancellingWorkflowRun: boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type AvatarSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export type AvatarProps = {
|
|
2
3
|
src?: string;
|
|
3
4
|
name: string;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
size?: AvatarSize;
|
|
6
|
+
};
|
|
7
|
+
export declare const Avatar: ({ src, name, size }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,12 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
7
7
|
prefetch?: boolean | null;
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
size?: 'md' | 'lg';
|
|
10
|
-
variant?: 'default' | 'light';
|
|
10
|
+
variant?: 'default' | 'light' | 'outline' | 'ghost';
|
|
11
11
|
target?: string;
|
|
12
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
13
|
}
|
|
13
|
-
export declare
|
|
14
|
+
export declare function buttonVariants(options?: {
|
|
15
|
+
variant?: ButtonProps['variant'];
|
|
16
|
+
size?: ButtonProps['size'];
|
|
17
|
+
}): string;
|
|
18
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes } from '../../../../node_modules/@types/react';
|
|
2
|
+
import { Extension } from '@codemirror/state';
|
|
3
|
+
export declare const useCodemirrorTheme: () => Extension;
|
|
4
|
+
export type CodeEditorProps = {
|
|
5
|
+
data?: Record<string, unknown> | Array<Record<string, unknown>>;
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
showCopyButton?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>;
|
|
11
|
+
export declare const CodeEditor: ({ data, value, onChange, showCopyButton, className, ...props }: CodeEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function highlight(code: string, language: string): Promise<import('shiki').ThemedToken[][] | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './code-editor';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
threadId
|
|
1
|
+
export interface UseAgentMessagesProps {
|
|
2
|
+
threadId?: string;
|
|
3
3
|
agentId: string;
|
|
4
4
|
memory: boolean;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export declare const useAgentMessages: ({ threadId, agentId, memory }: UseAgentMessagesProps) => import('@tanstack/react-query').UseQueryResult<import('@mastra/client-js').ListMemoryThreadMessagesResponse | null, Error>;
|