@mastra/react 0.1.0-beta.1 → 0.1.0-beta.11
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 +127 -0
- package/dist/index.cjs +137 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +137 -30
- package/dist/index.js.map +1 -1
- package/dist/react.css +1 -1
- package/dist/src/agent/hooks.d.ts +4 -1
- package/dist/src/lib/ai-sdk/types.d.ts +24 -1
- package/package.json +9 -8
package/dist/react.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties {
|
|
3
3
|
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
4
4
|
*, :before, :after, ::backdrop {
|
|
@@ -4,8 +4,10 @@ import { MastraUIMessage } from '../lib/ai-sdk';
|
|
|
4
4
|
import { CoreUserMessage } from '@mastra/core/llm';
|
|
5
5
|
import { RequestContext } from '@mastra/core/request-context';
|
|
6
6
|
import { ChunkType, NetworkChunkType } from '@mastra/core/stream';
|
|
7
|
+
import { TracingOptions } from '@mastra/core/observability';
|
|
7
8
|
export interface MastraChatProps {
|
|
8
9
|
agentId: string;
|
|
10
|
+
resourceId?: string;
|
|
9
11
|
initializeMessages?: () => MastraUIMessage[];
|
|
10
12
|
}
|
|
11
13
|
interface SharedArgs {
|
|
@@ -14,6 +16,7 @@ interface SharedArgs {
|
|
|
14
16
|
threadId?: string;
|
|
15
17
|
modelSettings?: ModelSettings;
|
|
16
18
|
signal?: AbortSignal;
|
|
19
|
+
tracingOptions?: TracingOptions;
|
|
17
20
|
}
|
|
18
21
|
export type SendMessageArgs = {
|
|
19
22
|
message: string;
|
|
@@ -36,7 +39,7 @@ export type StreamArgs = SharedArgs & {
|
|
|
36
39
|
export type NetworkArgs = SharedArgs & {
|
|
37
40
|
onNetworkChunk?: (chunk: NetworkChunkType) => Promise<void>;
|
|
38
41
|
};
|
|
39
|
-
export declare const useChat: ({ agentId, initializeMessages }: MastraChatProps) => {
|
|
42
|
+
export declare const useChat: ({ agentId, resourceId, initializeMessages }: MastraChatProps) => {
|
|
40
43
|
setMessages: import('react').Dispatch<import('react').SetStateAction<MastraUIMessage[]>>;
|
|
41
44
|
sendMessage: ({ mode, ...args }: SendMessageArgs) => Promise<void>;
|
|
42
45
|
isRunning: boolean;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { UIMessage } from '@ai-sdk/react';
|
|
2
|
+
import { CompleteAttachment } from '@assistant-ui/react';
|
|
3
|
+
/**
|
|
4
|
+
* Tripwire metadata included when a processor triggers a tripwire
|
|
5
|
+
*/
|
|
6
|
+
export type TripwireMetadata = {
|
|
7
|
+
/** Whether the agent should retry with feedback */
|
|
8
|
+
retry?: boolean;
|
|
9
|
+
/** Custom metadata from the processor */
|
|
10
|
+
tripwirePayload?: unknown;
|
|
11
|
+
/** ID of the processor that triggered the tripwire */
|
|
12
|
+
processorId?: string;
|
|
13
|
+
};
|
|
2
14
|
export type MastraUIMessageMetadata = {
|
|
3
|
-
status?: 'warning' | 'error';
|
|
15
|
+
status?: 'warning' | 'error' | 'tripwire';
|
|
16
|
+
/** Tripwire-specific metadata when status is 'tripwire' */
|
|
17
|
+
tripwire?: TripwireMetadata;
|
|
4
18
|
} & ({
|
|
5
19
|
mode: 'generate';
|
|
6
20
|
} | {
|
|
@@ -19,3 +33,12 @@ export type MastraUIMessageMetadata = {
|
|
|
19
33
|
agentInput?: string | object | Array<object>;
|
|
20
34
|
});
|
|
21
35
|
export type MastraUIMessage = UIMessage<MastraUIMessageMetadata, any, any>;
|
|
36
|
+
/**
|
|
37
|
+
* Extended type for MastraUIMessage that may include additional properties
|
|
38
|
+
* from different sources (generate, toUIMessage, toNetworkUIMessage)
|
|
39
|
+
*/
|
|
40
|
+
export type ExtendedMastraUIMessage = MastraUIMessage & {
|
|
41
|
+
createdAt?: Date;
|
|
42
|
+
metadata?: Record<string, unknown>;
|
|
43
|
+
experimental_attachments?: readonly CompleteAttachment[];
|
|
44
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/react",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
@@ -33,12 +33,13 @@
|
|
|
33
33
|
"CHANGELOG.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@lukeed/uuid": "^2.0.1",
|
|
36
37
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
37
38
|
"hast-util-to-jsx-runtime": "^2.3.6",
|
|
38
39
|
"lucide-react": "^0.522.0",
|
|
39
40
|
"shiki": "^1.29.2",
|
|
40
41
|
"tailwind-merge": "^3.3.1",
|
|
41
|
-
"@mastra/client-js": "1.0.0-beta.
|
|
42
|
+
"@mastra/client-js": "1.0.0-beta.11"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
45
|
"react": ">=19.0.0",
|
|
@@ -46,14 +47,14 @@
|
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@ai-sdk/react": "^2.0.57",
|
|
49
|
-
"@assistant-ui/react": "^0.
|
|
50
|
+
"@assistant-ui/react": "^0.11.47",
|
|
50
51
|
"@storybook/react-vite": "^9.1.16",
|
|
51
|
-
"@tailwindcss/vite": "^4.1.
|
|
52
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
52
53
|
"@types/react": "^19.1.13",
|
|
53
54
|
"@types/react-dom": "^19.1.9",
|
|
54
55
|
"@vitejs/plugin-react": "^5.0.4",
|
|
55
|
-
"@vitest/coverage-v8": "
|
|
56
|
-
"@vitest/ui": "
|
|
56
|
+
"@vitest/coverage-v8": "4.0.12",
|
|
57
|
+
"@vitest/ui": "4.0.12",
|
|
57
58
|
"eslint": "^9.37.0",
|
|
58
59
|
"eslint-plugin-storybook": "^9.1.12",
|
|
59
60
|
"react": ">=19.0.0",
|
|
@@ -64,8 +65,8 @@
|
|
|
64
65
|
"typescript": "^5.8.3",
|
|
65
66
|
"vite": "^7.1.9",
|
|
66
67
|
"vite-plugin-dts": "^4.5.4",
|
|
67
|
-
"vitest": "
|
|
68
|
-
"@mastra/core": "1.0.0-beta.
|
|
68
|
+
"vitest": "4.0.12",
|
|
69
|
+
"@mastra/core": "1.0.0-beta.11"
|
|
69
70
|
},
|
|
70
71
|
"eslintConfig": {
|
|
71
72
|
"extends": [
|