@mastra/playground-ui 5.1.15 → 5.1.16-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.
- package/dist/index.cjs.js +263 -51
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +265 -53
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/assistant-ui/attachments/voice-adapter.d.ts +8 -0
- package/dist/src/components/assistant-ui/hooks/use-adapters.d.ts +9 -0
- package/dist/src/components/assistant-ui/thread.d.ts +2 -1
- package/dist/src/components/ui/playground-tabs.d.ts +4 -2
- package/dist/src/{hooks → domains/voice/hooks}/use-speech-recognition.d.ts +4 -2
- package/dist/src/domains/voice/utils/record-mic-to-file.d.ts +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/services/mastra-runtime-provider.d.ts +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SpeechSynthesisAdapter } from '@assistant-ui/react';
|
|
2
|
+
import { Agent } from '@mastra/core';
|
|
3
|
+
|
|
4
|
+
export declare class VoiceAttachmentAdapter implements SpeechSynthesisAdapter {
|
|
5
|
+
private readonly agent;
|
|
6
|
+
constructor(agent: Agent);
|
|
7
|
+
speak(text: string): SpeechSynthesisAdapter.Utterance;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CompositeAttachmentAdapter, SpeechSynthesisAdapter } from '@assistant-ui/react';
|
|
2
|
+
|
|
3
|
+
export declare const useAdapters: (agentId: string) => {
|
|
4
|
+
isReady: boolean;
|
|
5
|
+
adapters: {
|
|
6
|
+
attachments: CompositeAttachmentAdapter;
|
|
7
|
+
speech: SpeechSynthesisAdapter | undefined;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
@@ -3,10 +3,11 @@ import { ToolCallContentPartComponent } from '@assistant-ui/react';
|
|
|
3
3
|
export interface ThreadProps {
|
|
4
4
|
ToolFallback?: ToolCallContentPartComponent;
|
|
5
5
|
agentName?: string;
|
|
6
|
+
agentId?: string;
|
|
6
7
|
hasMemory?: boolean;
|
|
7
8
|
onInputChange?: (value: string) => void;
|
|
8
9
|
}
|
|
9
|
-
export declare const Thread: ({ ToolFallback, agentName, hasMemory, onInputChange }: ThreadProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const Thread: ({ ToolFallback, agentName, agentId, hasMemory, onInputChange }: ThreadProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export interface ThreadWelcomeProps {
|
|
11
12
|
agentName?: string;
|
|
12
13
|
}
|
|
@@ -3,12 +3,14 @@ export interface PlaygroundTabsProps<T extends string> {
|
|
|
3
3
|
defaultTab: T;
|
|
4
4
|
value?: T;
|
|
5
5
|
onValueChange?: (value: T) => void;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare const PlaygroundTabs: <T extends string>({ children, defaultTab, value, onValueChange, }: PlaygroundTabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const PlaygroundTabs: <T extends string>({ children, defaultTab, value, onValueChange, className, }: PlaygroundTabsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export interface TabListProps {
|
|
9
10
|
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
|
-
export declare const TabList: ({ children }: TabListProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const TabList: ({ children, className }: TabListProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export interface TabProps {
|
|
13
15
|
children: React.ReactNode;
|
|
14
16
|
value: string;
|
|
@@ -5,11 +5,13 @@ export interface SpeechRecognitionState {
|
|
|
5
5
|
}
|
|
6
6
|
export interface UseSpeechRecognitionArgs {
|
|
7
7
|
language?: string;
|
|
8
|
+
agentId?: string;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
type BrowserSpeechRecognition = {
|
|
10
11
|
start: () => void;
|
|
11
12
|
stop: () => void;
|
|
12
13
|
isListening: boolean;
|
|
13
14
|
transcript: string;
|
|
14
|
-
error: string | null;
|
|
15
15
|
};
|
|
16
|
+
export declare const useSpeechRecognition: ({ language, agentId, }: UseSpeechRecognitionArgs) => BrowserSpeechRecognition;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function recordMicrophoneToFile(onFinish: (file: File) => void): Promise<MediaRecorder>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export * from './ds/components/Entity/index';
|
|
|
25
25
|
export * from './ds/components/EmptyState/index';
|
|
26
26
|
export * from './ds/icons/index';
|
|
27
27
|
export * from './lib/polls';
|
|
28
|
-
export * from './hooks/use-speech-recognition';
|
|
28
|
+
export * from './domains/voice/hooks/use-speech-recognition';
|
|
29
29
|
export * from './components/ui/radio-group';
|
|
30
30
|
export * from './components/ui/entry';
|
|
31
31
|
export * from './hooks';
|
|
@@ -3,4 +3,4 @@ import { ChatProps } from '../types';
|
|
|
3
3
|
|
|
4
4
|
export declare function MastraRuntimeProvider({ children, agentId, initialMessages, memory, threadId, refreshThreadList, settings, runtimeContext, }: Readonly<{
|
|
5
5
|
children: ReactNode;
|
|
6
|
-
}> & ChatProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
}> & ChatProps): import("react/jsx-runtime").JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/playground-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.16-alpha.1",
|
|
5
5
|
"description": "Mastra Playground components",
|
|
6
6
|
"main": "dist/index.umd.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
"unified": "^11.0.5",
|
|
95
95
|
"use-debounce": "^10.0.5",
|
|
96
96
|
"zod": "^3.25.67",
|
|
97
|
-
"zustand": "^5.0.
|
|
98
|
-
"@mastra/client-js": "^0.10.
|
|
97
|
+
"zustand": "^5.0.6",
|
|
98
|
+
"@mastra/client-js": "^0.10.17-alpha.1"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"@mastra/core": ">=0.11.0-0 <0.12.0-0",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"vite": "^6.3.5",
|
|
121
121
|
"vite-plugin-dts": "^3.9.1",
|
|
122
122
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
123
|
-
"@mastra/core": "0.
|
|
123
|
+
"@mastra/core": "0.12.0-alpha.1"
|
|
124
124
|
},
|
|
125
125
|
"scripts": {
|
|
126
126
|
"build": "tsc && vite build",
|