@mastra/playground-ui 7.0.0-beta.14 → 7.0.0-beta.15

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 (35) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/index.cjs.js +835 -180
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.es.js +831 -183
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/ui/containers/MainContent.d.ts +7 -0
  7. package/dist/src/domains/agents/components/agent-layout.d.ts +7 -0
  8. package/dist/src/domains/agents/index.d.ts +1 -0
  9. package/dist/src/domains/configuration/components/mastra-version-footer.d.ts +17 -0
  10. package/dist/src/domains/configuration/hooks/use-mastra-packages.d.ts +1 -0
  11. package/dist/src/domains/configuration/hooks/use-package-updates.d.ts +18 -0
  12. package/dist/src/domains/configuration/index.d.ts +3 -0
  13. package/dist/src/domains/observability/components/helpers.d.ts +11 -3
  14. package/dist/src/domains/observability/components/span-dialog.d.ts +2 -1
  15. package/dist/src/domains/observability/components/span-score-list.d.ts +1 -1
  16. package/dist/src/domains/observability/components/span-tabs.d.ts +2 -1
  17. package/dist/src/domains/observability/components/trace-span-usage.d.ts +1 -1
  18. package/dist/src/domains/observability/components/traces-list.d.ts +1 -1
  19. package/dist/src/domains/observability/context/tracing-settings-context.d.ts +1 -0
  20. package/dist/src/domains/observability/hooks/use-tracing-settings-state.d.ts +1 -0
  21. package/dist/src/domains/scores/components/score-dialog.d.ts +2 -2
  22. package/dist/src/domains/scores/hooks/use-trace-span-scores.d.ts +41 -1
  23. package/dist/src/domains/workflows/components/workflow-layout.d.ts +7 -0
  24. package/dist/src/domains/workflows/context/workflow-run-context.d.ts +3 -1
  25. package/dist/src/domains/workflows/hooks/use-workflows-actions.d.ts +6 -2
  26. package/dist/src/domains/workflows/index.d.ts +1 -0
  27. package/dist/src/domains/workflows/workflow/workflow-default-node.d.ts +2 -1
  28. package/dist/src/domains/workflows/workflow/workflow-nested-node.d.ts +2 -1
  29. package/dist/src/domains/workflows/workflow/workflow-run-options.d.ts +1 -0
  30. package/dist/src/domains/workflows/workflow/workflow-step-action-bar.d.ts +4 -2
  31. package/dist/src/domains/workflows/workflow/workflow-time-travel-form.d.ts +5 -1
  32. package/dist/src/domains/workflows/workflow/workflow-trigger.d.ts +4 -2
  33. package/dist/src/lib/resize/collapsible-panel.d.ts +5 -0
  34. package/dist/src/lib/resize/separator.d.ts +1 -0
  35. package/package.json +13 -11
@@ -11,3 +11,10 @@ export declare function MainContentContent({ children, className, isCentered, is
11
11
  isDivided?: boolean;
12
12
  hasLeftServiceColumn?: boolean;
13
13
  }): import("react/jsx-runtime").JSX.Element;
14
+ export type GetMainContentContentClassNameArgs = {
15
+ isCentered: boolean;
16
+ isDivided: boolean;
17
+ hasLeftServiceColumn: boolean;
18
+ className?: string;
19
+ };
20
+ export declare const getMainContentContentClassName: ({ isCentered, isDivided, hasLeftServiceColumn, className, }: GetMainContentContentClassNameArgs) => string;
@@ -0,0 +1,7 @@
1
+ export interface AgentLayoutProps {
2
+ agentId: string;
3
+ children: React.ReactNode;
4
+ leftSlot?: React.ReactNode;
5
+ rightSlot?: React.ReactNode;
6
+ }
7
+ export declare const AgentLayout: ({ agentId, children, leftSlot, rightSlot }: AgentLayoutProps) => import("react/jsx-runtime").JSX.Element;
@@ -16,3 +16,4 @@ export * from './components/AgentToolPanel';
16
16
  export * from './components/agent-information/agent-information';
17
17
  export * from './components/agent-entity-header';
18
18
  export * from './components/agent-information/agent-memory';
19
+ export * from './components/agent-layout';
@@ -0,0 +1,17 @@
1
+ import { PackageUpdateInfo } from '../hooks/use-package-updates';
2
+ export interface MastraVersionFooterProps {
3
+ collapsed?: boolean;
4
+ }
5
+ type PackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun';
6
+ export declare const MastraVersionFooter: ({ collapsed }: MastraVersionFooterProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export interface PackagesModalContentProps {
8
+ packages: PackageUpdateInfo[];
9
+ isLoadingUpdates: boolean;
10
+ outdatedCount: number;
11
+ deprecatedCount: number;
12
+ updateCommand: string | null;
13
+ packageManager: PackageManager;
14
+ onPackageManagerChange: (pm: PackageManager) => void;
15
+ }
16
+ export declare const MastraPackagesInfo: ({ collapsed }: MastraVersionFooterProps) => import("react/jsx-runtime").JSX.Element | null;
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useMastraPackages: () => import('@tanstack/react-query').UseQueryResult<import('@mastra/client-js').GetSystemPackagesResponse, Error>;
@@ -0,0 +1,18 @@
1
+ export interface PackageInfo {
2
+ name: string;
3
+ version: string;
4
+ }
5
+ export interface PackageUpdateInfo extends PackageInfo {
6
+ latestVersion: string | null;
7
+ isOutdated: boolean;
8
+ isDeprecated: boolean;
9
+ prereleaseTag: string | null;
10
+ targetPrereleaseTag: string | null;
11
+ deprecationMessage?: string;
12
+ }
13
+ export declare function usePackageUpdates(packages: PackageInfo[]): {
14
+ packages: PackageUpdateInfo[];
15
+ isLoading: boolean;
16
+ outdatedCount: number;
17
+ deprecatedCount: number;
18
+ };
@@ -1,4 +1,7 @@
1
1
  export * from './context/studio-config-context';
2
2
  export * from './components/studio-config-form';
3
+ export * from './components/mastra-version-footer';
3
4
  export * from './types';
4
5
  export * from './components/playground-config-guard';
6
+ export * from './hooks/use-mastra-packages';
7
+ export * from './hooks/use-package-updates';
@@ -1,9 +1,17 @@
1
1
  import { SpanRecord } from '@mastra/core/storage';
2
- export declare function useTraceInfo(trace: SpanRecord | undefined): {
2
+ export declare function useTraceInfo(trace: SpanRecord | undefined): ({
3
3
  key: string;
4
4
  label: string;
5
- value: any;
6
- }[];
5
+ value: {
6
+ id: string;
7
+ name: string;
8
+ path: string | undefined;
9
+ }[];
10
+ } | {
11
+ key: string;
12
+ label: string;
13
+ value: string;
14
+ })[];
7
15
  type getSpanInfoProps = {
8
16
  span: SpanRecord | undefined;
9
17
  };
@@ -1,6 +1,7 @@
1
1
  import { KeyValueListItemData } from '../../../components/ui/elements';
2
2
  import { SpanRecord } from '@mastra/core/storage';
3
- import { ListScoresResponse, GetScorerResponse } from '@mastra/client-js';
3
+ import { ListScoresResponse } from '@mastra/core/evals';
4
+ import { GetScorerResponse } from '@mastra/client-js';
4
5
  type SpanDialogProps = {
5
6
  trace: SpanRecord;
6
7
  span?: SpanRecord;
@@ -1,4 +1,4 @@
1
- import { ListScoresResponse } from '@mastra/client-js';
1
+ import { ListScoresResponse } from '@mastra/core/evals';
2
2
  export declare const traceScoresListColumns: {
3
3
  name: string;
4
4
  label: string;
@@ -1,5 +1,6 @@
1
1
  import { KeyValueListItemData } from '../../../index';
2
- import { ListScoresResponse, GetScorerResponse } from '@mastra/client-js';
2
+ import { ListScoresResponse } from '@mastra/core/evals';
3
+ import { GetScorerResponse } from '@mastra/client-js';
3
4
  import { SpanRecord } from '@mastra/core/storage';
4
5
  type SpanTabsProps = {
5
6
  trace?: SpanRecord;
@@ -14,7 +14,7 @@ type LegacyTokenUsage = {
14
14
  completionTokens: number;
15
15
  totalTokens: number;
16
16
  };
17
- type TokenUsage = V5TokenUsage | LegacyTokenUsage;
17
+ export type TokenUsage = V5TokenUsage | LegacyTokenUsage;
18
18
  type TraceSpanUsageProps = {
19
19
  traceUsage?: TokenUsage;
20
20
  traceSpans?: SpanRecord[];
@@ -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
  };
@@ -7,6 +7,7 @@ export type TracingSettingsContextType = {
7
7
  setSettings: (settings: TracingSettings) => void;
8
8
  resetAll: () => void;
9
9
  settings?: TracingSettings;
10
+ entityType?: 'workflow' | 'agent';
10
11
  };
11
12
  export declare const TracingSettingsContext: import('../../../../node_modules/@types/react').Context<TracingSettingsContextType>;
12
13
  export interface TracingSettingsProviderProps {
@@ -7,4 +7,5 @@ export declare function useTracingSettingsState({ entityId, entityType }: Tracin
7
7
  settings: TracingSettings | undefined;
8
8
  setSettings: (settingsValue: TracingSettings) => void;
9
9
  resetAll: () => void;
10
+ entityType: "workflow" | "agent";
10
11
  };
@@ -1,7 +1,7 @@
1
1
  import { SideDialogRootProps } from '../../../components/ui/elements';
2
- import { ClientScoreRowData } from '@mastra/client-js';
2
+ import { ScoreRowData } from '@mastra/core/evals';
3
3
  type ScoreDialogProps = {
4
- score?: ClientScoreRowData;
4
+ score?: ScoreRowData;
5
5
  scorerName?: string;
6
6
  isOpen: boolean;
7
7
  onClose: () => void;
@@ -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<import('@mastra/client-js').ListScoresResponse, Error>;
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
+ output?: unknown;
26
+ additionalContext?: Record<string, unknown> | undefined;
27
+ requestContext?: Record<string, unknown> | undefined;
28
+ metadata?: Record<string, unknown> | undefined;
29
+ entityType?: string | undefined;
30
+ structuredOutput?: boolean | undefined;
31
+ traceId?: string | undefined;
32
+ spanId?: string | undefined;
33
+ resourceId?: string | undefined;
34
+ threadId?: 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 {};
@@ -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;
@@ -22,11 +22,13 @@ type WorkflowRunContextType = {
22
22
  timeTravelWorkflowStream: (params: {
23
23
  workflowId: string;
24
24
  requestContext: Record<string, unknown>;
25
- runId: string;
25
+ runId?: string;
26
26
  } & Omit<TimeTravelParams, 'requestContext'>) => Promise<void>;
27
27
  runSnapshot?: WorkflowRunState;
28
28
  isLoadingRunExecutionResult?: boolean;
29
29
  withoutTimeTravel?: boolean;
30
+ debugMode: boolean;
31
+ setDebugMode: Dispatch<SetStateAction<boolean>>;
30
32
  } & Omit<WorkflowTriggerProps, 'paramsRunId' | 'setRunId' | 'observeWorkflowStream'>;
31
33
  export declare const WorkflowRunContext: import('../../../../node_modules/@types/react').Context<WorkflowRunContextType>;
32
34
  export declare function WorkflowRunProvider({ children, snapshot, workflowId, initialRunId, withoutTimeTravel, }: {
@@ -21,12 +21,15 @@ export declare const useExecuteWorkflow: () => {
21
21
  }, unknown>;
22
22
  };
23
23
  type WorkflowStreamResult = CoreWorkflowStreamResult<any, any, any, any>;
24
- export declare const useStreamWorkflow: () => {
24
+ export declare const useStreamWorkflow: ({ debugMode }: {
25
+ debugMode: boolean;
26
+ }) => {
25
27
  streamWorkflow: import('@tanstack/react-query').UseMutationResult<void, Error, {
26
28
  workflowId: string;
27
29
  runId: string;
28
30
  inputData: Record<string, unknown>;
29
31
  requestContext: Record<string, unknown>;
32
+ perStep?: boolean;
30
33
  }, unknown>;
31
34
  streamResult: WorkflowStreamResult;
32
35
  isStreaming: boolean;
@@ -42,9 +45,10 @@ export declare const useStreamWorkflow: () => {
42
45
  runId: string;
43
46
  resumeData: Record<string, unknown>;
44
47
  requestContext: Record<string, unknown>;
48
+ perStep?: boolean;
45
49
  }, unknown>;
46
50
  timeTravelWorkflowStream: import('@tanstack/react-query').UseMutationResult<void, Error, {
47
- runId: string;
51
+ runId?: string;
48
52
  workflowId: string;
49
53
  requestContext: Record<string, unknown>;
50
54
  } & Omit<TimeTravelParams, "requestContext">, unknown>;
@@ -9,3 +9,4 @@ export * from './components/workflow-information';
9
9
  export * from './components/workflow-combobox';
10
10
  export * from './utils';
11
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;
@@ -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,4 +1,5 @@
1
1
  import { TripwireData } from '../context/use-current-run';
2
+ import { WorkflowRunStatus } from '@mastra/core/workflows';
2
3
  export interface WorkflowStepActionBarProps {
3
4
  input?: any;
4
5
  output?: any;
@@ -10,7 +11,8 @@ export interface WorkflowStepActionBarProps {
10
11
  stepId?: string;
11
12
  mapConfig?: string;
12
13
  onShowNestedGraph?: () => void;
13
- status?: 'running' | 'success' | 'failed' | 'suspended' | 'waiting' | 'tripwire';
14
+ status?: WorkflowRunStatus;
14
15
  stepKey?: string;
16
+ stepsFlow?: Record<string, string[]>;
15
17
  }
16
- export declare const WorkflowStepActionBar: ({ input, output, resumeData, suspendOutput, error, tripwire, mapConfig, stepName, stepId, onShowNestedGraph, status, stepKey, }: 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;
@@ -1,5 +1,9 @@
1
1
  export type WorkflowTimeTravelFormProps = {
2
2
  stepKey: string;
3
3
  closeModal: () => void;
4
+ isPerStepRun?: boolean;
5
+ isContinueRun?: boolean;
6
+ buttonText?: string;
7
+ inputData?: unknown;
4
8
  };
5
- export declare const WorkflowTimeTravelForm: ({ stepKey, closeModal }: WorkflowTimeTravelFormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const WorkflowTimeTravelForm: ({ stepKey, closeModal, isPerStepRun, isContinueRun, buttonText, inputData, }: WorkflowTimeTravelFormProps) => import("react/jsx-runtime").JSX.Element;
@@ -13,22 +13,24 @@ export interface WorkflowTriggerProps {
13
13
  runId: string;
14
14
  }>;
15
15
  isStreamingWorkflow: boolean;
16
- streamWorkflow: ({ workflowId, runId, inputData, requestContext, }: {
16
+ streamWorkflow: ({ workflowId, runId, inputData, requestContext, perStep, }: {
17
17
  workflowId: string;
18
18
  runId: string;
19
19
  inputData: Record<string, unknown>;
20
20
  requestContext: Record<string, unknown>;
21
+ perStep?: boolean;
21
22
  }) => Promise<void>;
22
23
  observeWorkflowStream?: ({ workflowId, runId }: {
23
24
  workflowId: string;
24
25
  runId: string;
25
26
  }) => void;
26
- resumeWorkflow: ({ workflowId, step, runId, resumeData, requestContext, }: {
27
+ resumeWorkflow: ({ workflowId, step, runId, resumeData, requestContext, perStep, }: {
27
28
  workflowId: string;
28
29
  step: string | string[];
29
30
  runId: string;
30
31
  resumeData: Record<string, unknown>;
31
32
  requestContext: Record<string, unknown>;
33
+ perStep?: boolean;
32
34
  }) => Promise<void>;
33
35
  streamResult: WorkflowRunStreamResult | null;
34
36
  isCancellingWorkflowRun: boolean;
@@ -0,0 +1,5 @@
1
+ import { PanelProps } from 'react-resizable-panels';
2
+ export interface CollapsiblePanelProps extends PanelProps {
3
+ direction: 'left' | 'right';
4
+ }
5
+ export declare const CollapsiblePanel: ({ collapsedSize, children, direction, ...props }: CollapsiblePanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const PanelSeparator: () => import("react/jsx-runtime").JSX.Element;
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.14",
4
+ "version": "7.0.0-beta.15",
5
5
  "description": "Mastra Playground components",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -90,12 +90,13 @@
90
90
  "react-day-picker": "^8.10.1",
91
91
  "react-hook-form": "^7.59.0",
92
92
  "react-markdown": "^9.1.0",
93
- "react-resizable-panels": "^2.1.9",
93
+ "react-resizable-panels": "^4.0.15",
94
94
  "react-syntax-highlighter": "^15.6.6",
95
95
  "rehype-stringify": "^10.0.1",
96
96
  "remark-gfm": "^4.0.1",
97
97
  "remark-parse": "^11.0.0",
98
98
  "remark-rehype": "^11.1.2",
99
+ "semver": "^7.7.2",
99
100
  "shiki": "^1.29.2",
100
101
  "sonner": "^2.0.5",
101
102
  "superjson": "^2.2.2",
@@ -112,10 +113,10 @@
112
113
  "react": ">=19.0.0",
113
114
  "react-dom": ">=19.0.0",
114
115
  "tailwindcss": "^3.0.0",
115
- "@mastra/ai-sdk": "^1.0.0-beta.10",
116
- "@mastra/react": "0.1.0-beta.14",
117
- "@mastra/client-js": "^1.0.0-beta.14",
118
- "@mastra/schema-compat": "1.0.0-beta.3"
116
+ "@mastra/client-js": "^1.0.0-beta.15",
117
+ "@mastra/schema-compat": "1.0.0-beta.3",
118
+ "@mastra/react": "0.1.0-beta.15",
119
+ "@mastra/ai-sdk": "^1.0.0-beta.11"
119
120
  },
120
121
  "devDependencies": {
121
122
  "@storybook/addon-docs": "^9.1.16",
@@ -124,6 +125,7 @@
124
125
  "@types/node": "22.13.17",
125
126
  "@types/react": "^19.1.9",
126
127
  "@types/react-dom": "^19.1.7",
128
+ "@types/semver": "^7.7.1",
127
129
  "@vitejs/plugin-react": "^5.0.4",
128
130
  "@vitest/coverage-v8": "4.0.12",
129
131
  "@vitest/ui": "4.0.12",
@@ -140,11 +142,11 @@
140
142
  "vite-plugin-dts": "^4.5.4",
141
143
  "vite-plugin-lib-inject-css": "^2.2.2",
142
144
  "vitest": "4.0.12",
143
- "@mastra/ai-sdk": "^1.0.0-beta.10",
144
- "@mastra/client-js": "^1.0.0-beta.14",
145
- "@mastra/core": "1.0.0-beta.14",
146
- "@mastra/schema-compat": "1.0.0-beta.3",
147
- "@mastra/react": "0.1.0-beta.14"
145
+ "@mastra/ai-sdk": "^1.0.0-beta.11",
146
+ "@mastra/core": "1.0.0-beta.15",
147
+ "@mastra/react": "0.1.0-beta.15",
148
+ "@mastra/client-js": "^1.0.0-beta.15",
149
+ "@mastra/schema-compat": "1.0.0-beta.3"
148
150
  },
149
151
  "homepage": "https://mastra.ai",
150
152
  "repository": {