@mastra/playground-ui 6.1.2 → 6.1.3-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.
@@ -4,9 +4,8 @@ export interface ThreadProps {
4
4
  agentName?: string;
5
5
  agentId?: string;
6
6
  hasMemory?: boolean;
7
- onInputChange?: (value: string) => void;
8
7
  }
9
- export declare const Thread: ({ ToolFallback, agentName, agentId, hasMemory, onInputChange }: ThreadProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Thread: ({ ToolFallback, agentName, agentId, hasMemory }: ThreadProps) => import("react/jsx-runtime").JSX.Element;
10
9
  export interface ThreadWelcomeProps {
11
10
  agentName?: string;
12
11
  }
@@ -0,0 +1,24 @@
1
+ type TextMessage = {
2
+ type: 'text';
3
+ content: string;
4
+ };
5
+ type ToolMessage = {
6
+ type: 'tool';
7
+ toolName: string;
8
+ toolInput?: any;
9
+ toolOutput?: any;
10
+ args?: any;
11
+ toolCallId: string;
12
+ result?: any;
13
+ };
14
+ export type BadgeMessage = TextMessage | ToolMessage;
15
+ export interface AgentBadgeProps {
16
+ agentId: string;
17
+ messages: BadgeMessage[];
18
+ networkMetadata?: {
19
+ selectionReason?: string;
20
+ input?: string | Record<string, unknown>;
21
+ };
22
+ }
23
+ export declare const AgentBadge: ({ agentId, messages, networkMetadata }: AgentBadgeProps) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -4,5 +4,6 @@ export interface BadgeWrapperProps {
4
4
  initialCollapsed?: boolean;
5
5
  icon?: React.ReactNode;
6
6
  collapsible?: boolean;
7
+ extraInfo?: React.ReactNode;
7
8
  }
8
- export declare const BadgeWrapper: ({ children, initialCollapsed, icon, title, collapsible, }: BadgeWrapperProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const BadgeWrapper: ({ children, initialCollapsed, icon, title, collapsible, extraInfo, }: BadgeWrapperProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export interface NetworkChoiceMetadataDialogTriggerProps {
2
+ selectionReason: string;
3
+ input?: string | Record<string, unknown>;
4
+ }
5
+ export declare const NetworkChoiceMetadataDialogTrigger: ({ selectionReason, input, }: NetworkChoiceMetadataDialogTriggerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,10 @@
1
1
  export interface ToolBadgeProps {
2
2
  toolName: string;
3
- argsText: string;
3
+ args: Record<string, unknown> | string;
4
4
  result: any;
5
+ networkMetadata?: {
6
+ input?: string | Record<string, unknown>;
7
+ selectionReason?: string;
8
+ };
5
9
  }
6
- export declare const ToolBadge: ({ toolName, argsText, result }: ToolBadgeProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const ToolBadge: ({ toolName, args, result, networkMetadata }: ToolBadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,13 @@
1
- import { GetWorkflowResponse } from '@mastra/client-js';
2
- import { StreamChunk } from '../../../../types';
1
+ import { GetWorkflowResponse, WorkflowWatchResult } from '@mastra/client-js';
3
2
  export interface WorkflowBadgeProps {
4
3
  workflow: GetWorkflowResponse;
5
4
  workflowId: string;
6
5
  runId?: string;
7
6
  isStreaming?: boolean;
7
+ networkMetadata?: {
8
+ input?: string | Record<string, unknown>;
9
+ selectionReason?: string;
10
+ };
8
11
  }
9
- export declare const WorkflowBadge: ({ workflow, runId, workflowId, isStreaming }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
10
- export declare const useWorkflowStream: (partialWorkflowOutput?: StreamChunk) => void;
12
+ export declare const WorkflowBadge: ({ workflow, runId, workflowId, isStreaming, networkMetadata }: WorkflowBadgeProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const useWorkflowStream: (workflowFullState?: WorkflowWatchResult) => void;
@@ -1,2 +1,2 @@
1
1
  import { ChatProps } from '../../../types';
2
- export declare const AgentChat: ({ agentId, agentName, threadId, initialMessages, memory, refreshThreadList, onInputChange, modelVersion, }: ChatProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const AgentChat: ({ agentId, agentName, threadId, initialMessages, memory, refreshThreadList, modelVersion, }: ChatProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,12 +5,27 @@ export interface AgentMetadataProps {
5
5
  agent: GetAgentResponse;
6
6
  promptSlot: ReactNode;
7
7
  hasMemoryEnabled: boolean;
8
+ computeAgentLink: (agent: {
9
+ id: string;
10
+ name: string;
11
+ }) => string;
8
12
  computeToolLink: (tool: GetToolResponse) => string;
9
13
  computeWorkflowLink: (workflowId: string, workflow: GetWorkflowResponse) => string;
10
14
  modelProviders: string[];
11
15
  updateModel: AgentMetadataModelSwitcherProps['updateModel'];
12
16
  }
13
- export declare const AgentMetadata: ({ agent, promptSlot, hasMemoryEnabled, computeToolLink, computeWorkflowLink, updateModel, modelProviders, }: AgentMetadataProps) => import("react/jsx-runtime").JSX.Element;
17
+ export interface AgentMetadataNetworkListProps {
18
+ agents: {
19
+ id: string;
20
+ name: string;
21
+ }[];
22
+ computeAgentLink: (agent: {
23
+ id: string;
24
+ name: string;
25
+ }) => string;
26
+ }
27
+ export declare const AgentMetadataNetworkList: ({ agents, computeAgentLink }: AgentMetadataNetworkListProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const AgentMetadata: ({ agent, promptSlot, hasMemoryEnabled, computeAgentLink, computeToolLink, computeWorkflowLink, updateModel, modelProviders, }: AgentMetadataProps) => import("react/jsx-runtime").JSX.Element;
14
29
  export interface AgentMetadataToolListProps {
15
30
  tools: GetToolResponse[];
16
31
  computeToolLink: (tool: GetToolResponse) => string;
@@ -0,0 +1 @@
1
+ export declare const useAgent: (agentId: string) => import('@tanstack/react-query').UseQueryResult<import('@mastra/client-js').GetAgentResponse, Error>;
@@ -0,0 +1,7 @@
1
+ export declare const ThreadInputProvider: ({ children }: {
2
+ children: React.ReactNode;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const useThreadInput: () => {
5
+ threadInput: string;
6
+ setThreadInput: React.Dispatch<React.SetStateAction<string>>;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './context/ThreadInputContext';
@@ -41,3 +41,4 @@ export * from './components/ui/alert-dialog';
41
41
  export * from './components/ui/searchbar';
42
42
  export * from './components/ui/kbd';
43
43
  export * from './components/ui/collapsible';
44
+ export * from './domains/conversation/index';
@@ -0,0 +1,2 @@
1
+ import { ThreadMessageLike } from '@assistant-ui/react';
2
+ export declare const handleNetworkMessageFromMemory: (content: any) => ThreadMessageLike;
@@ -0,0 +1,41 @@
1
+ import { ThreadMessageLike } from '@assistant-ui/react';
2
+ import { ChunkType } from '@mastra/core';
3
+ export interface HandleStreamChunkOptions {
4
+ setMessages: React.Dispatch<React.SetStateAction<ThreadMessageLike[]>>;
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
+ }
15
+ export declare const handleStreamChunk: ({ chunk, setMessages, refreshWorkingMemory, _sideEffects, }: HandleStreamChunkOptions) => Promise<void>;
16
+ interface HandleWorkflowChunkOptions {
17
+ workflowChunk: object;
18
+ setMessages: React.Dispatch<React.SetStateAction<ThreadMessageLike[]>>;
19
+ entityName: string;
20
+ }
21
+ export declare const handleWorkflowChunk: ({ workflowChunk, setMessages, entityName }: HandleWorkflowChunkOptions) => void;
22
+ interface HandleAgentChunkOptions {
23
+ agentChunk: any;
24
+ setMessages: React.Dispatch<React.SetStateAction<ThreadMessageLike[]>>;
25
+ entityName: string;
26
+ }
27
+ export declare const handleAgentChunk: ({ agentChunk, setMessages, entityName }: HandleAgentChunkOptions) => void;
28
+ interface CreateRootToolAssistantMessageOptions {
29
+ chunk: any;
30
+ entityName: string;
31
+ setMessages: React.Dispatch<React.SetStateAction<ThreadMessageLike[]>>;
32
+ runId: string;
33
+ _sideEffects: HandleStreamChunkOptions['_sideEffects'];
34
+ from: 'AGENT' | 'WORKFLOW';
35
+ networkMetadata: {
36
+ selectionReason?: string;
37
+ input?: string | Record<string, unknown>;
38
+ };
39
+ }
40
+ export declare const createRootToolAssistantMessage: ({ chunk, entityName, setMessages, runId, _sideEffects, from, networkMetadata, }: CreateRootToolAssistantMessageOptions) => void;
41
+ export {};
@@ -31,6 +31,7 @@ export interface ModelSettings {
31
31
  chatWithGenerate?: boolean;
32
32
  chatWithGenerateVNext?: boolean;
33
33
  chatWithStreamVNext?: boolean;
34
+ chatWithNetwork?: boolean;
34
35
  }
35
36
  export interface AgentSettingsType {
36
37
  modelSettings: ModelSettings;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mastra/playground-ui",
3
3
  "type": "module",
4
- "version": "6.1.2",
4
+ "version": "6.1.3-alpha.1",
5
5
  "description": "Mastra Playground components",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -99,17 +99,17 @@
99
99
  "use-debounce": "^10.0.5",
100
100
  "zod": "^4.1.5",
101
101
  "zustand": "^5.0.7",
102
- "@mastra/client-js": "^0.12.2"
102
+ "@mastra/client-js": "^0.12.3-alpha.1"
103
103
  },
104
104
  "peerDependencies": {
105
- "@mastra/core": ">=0.16.1-0 <0.17.0-0",
105
+ "@mastra/core": ">=0.16.3-0 <0.17.0-0",
106
106
  "lucide-react": "^0.474.0",
107
107
  "react": ">=19.0.0",
108
108
  "react-dom": ">=19.0.0",
109
109
  "tailwindcss": "^3.0.0"
110
110
  },
111
111
  "devDependencies": {
112
- "@storybook/addon-docs": "^9.1.4",
112
+ "@storybook/addon-docs": "^9.1.5",
113
113
  "@storybook/react-vite": "^9.1.2",
114
114
  "@types/node": "^20.19.0",
115
115
  "@types/react": "^19.1.9",
@@ -127,7 +127,7 @@
127
127
  "vite": "^6.3.5",
128
128
  "vite-plugin-dts": "^4.5.4",
129
129
  "vite-plugin-lib-inject-css": "^2.2.2",
130
- "@mastra/core": "0.16.2"
130
+ "@mastra/core": "0.16.3-alpha.1"
131
131
  },
132
132
  "homepage": "https://mastra.ai",
133
133
  "repository": {
@@ -1,3 +0,0 @@
1
- import { WorkflowWatchResult } from '@mastra/client-js';
2
- import { StreamChunk } from '../../../types';
3
- export declare const useHandleAgentWorkflowStream: (workflowOutput?: StreamChunk) => WorkflowWatchResult;