@mastra/react 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256

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 (110) hide show
  1. package/CHANGELOG.md +1172 -3
  2. package/LICENSE.md +15 -0
  3. package/dist/agent/hooks.d.ts +66 -0
  4. package/dist/agent/hooks.d.ts.map +1 -0
  5. package/dist/{src/agent → agent}/types.d.ts +2 -0
  6. package/dist/agent/types.d.ts.map +1 -0
  7. package/dist/index.cjs +1515 -293
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +8 -2
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +1506 -286
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/ai-sdk/index.d.ts +5 -0
  14. package/dist/lib/ai-sdk/index.d.ts.map +1 -0
  15. package/dist/lib/ai-sdk/memory/resolveInitialMessages.d.ts +13 -0
  16. package/dist/lib/ai-sdk/memory/resolveInitialMessages.d.ts.map +1 -0
  17. package/dist/{src/lib → lib}/ai-sdk/transformers/AISdkNetworkTransformer.d.ts +4 -3
  18. package/dist/lib/ai-sdk/transformers/AISdkNetworkTransformer.d.ts.map +1 -0
  19. package/dist/lib/ai-sdk/transformers/types.d.ts +11 -0
  20. package/dist/lib/ai-sdk/transformers/types.d.ts.map +1 -0
  21. package/dist/lib/ai-sdk/types.d.ts +116 -0
  22. package/dist/lib/ai-sdk/types.d.ts.map +1 -0
  23. package/dist/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.d.ts +11 -0
  24. package/dist/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.d.ts.map +1 -0
  25. package/dist/{src/lib → lib}/ai-sdk/utils/toAssistantUIMessage.d.ts +3 -2
  26. package/dist/lib/ai-sdk/utils/toAssistantUIMessage.d.ts.map +1 -0
  27. package/dist/{src/lib → lib}/ai-sdk/utils/toUIMessage.d.ts +4 -3
  28. package/dist/lib/ai-sdk/utils/toUIMessage.d.ts.map +1 -0
  29. package/dist/lib/use-mutation.d.ts +28 -0
  30. package/dist/lib/use-mutation.d.ts.map +1 -0
  31. package/dist/mastra-client-context.d.ts +14 -0
  32. package/dist/mastra-client-context.d.ts.map +1 -0
  33. package/dist/mastra-react-provider.d.ts +5 -0
  34. package/dist/mastra-react-provider.d.ts.map +1 -0
  35. package/dist/react.css +184 -322
  36. package/dist/{src/ui → ui}/Code/Code.d.ts +2 -1
  37. package/dist/ui/Code/Code.d.ts.map +1 -0
  38. package/dist/ui/Code/highlight.d.ts +4 -0
  39. package/dist/ui/Code/highlight.d.ts.map +1 -0
  40. package/dist/ui/Code/index.d.ts +2 -0
  41. package/dist/ui/Code/index.d.ts.map +1 -0
  42. package/dist/{src/ui → ui}/Entity/Entity.d.ts +2 -1
  43. package/dist/ui/Entity/Entity.d.ts.map +1 -0
  44. package/dist/{src/ui → ui}/Entity/Entry.d.ts +2 -1
  45. package/dist/ui/Entity/Entry.d.ts.map +1 -0
  46. package/dist/{src/ui → ui}/Entity/ToolApproval.d.ts +1 -0
  47. package/dist/ui/Entity/ToolApproval.d.ts.map +1 -0
  48. package/dist/{src/ui → ui}/Entity/context.d.ts +4 -3
  49. package/dist/ui/Entity/context.d.ts.map +1 -0
  50. package/dist/ui/Entity/index.d.ts +5 -0
  51. package/dist/ui/Entity/index.d.ts.map +1 -0
  52. package/dist/{src/ui → ui}/Entity/types.d.ts +1 -0
  53. package/dist/ui/Entity/types.d.ts.map +1 -0
  54. package/dist/{src/ui → ui}/Icon/Icon.d.ts +2 -1
  55. package/dist/ui/Icon/Icon.d.ts.map +1 -0
  56. package/dist/ui/Icon/index.d.ts +2 -0
  57. package/dist/ui/Icon/index.d.ts.map +1 -0
  58. package/dist/{src/ui → ui}/IconButton/IconButton.d.ts +2 -1
  59. package/dist/ui/IconButton/IconButton.d.ts.map +1 -0
  60. package/dist/ui/IconButton/index.d.ts +2 -0
  61. package/dist/ui/IconButton/index.d.ts.map +1 -0
  62. package/dist/{src/ui → ui}/Icons/AgentIcon.d.ts +2 -1
  63. package/dist/ui/Icons/AgentIcon.d.ts.map +1 -0
  64. package/dist/{src/ui → ui}/Icons/ToolsIcon.d.ts +2 -1
  65. package/dist/ui/Icons/ToolsIcon.d.ts.map +1 -0
  66. package/dist/{src/ui → ui}/Icons/WorkflowIcon.d.ts +2 -1
  67. package/dist/ui/Icons/WorkflowIcon.d.ts.map +1 -0
  68. package/dist/ui/Icons/index.d.ts +4 -0
  69. package/dist/ui/Icons/index.d.ts.map +1 -0
  70. package/dist/{src/ui → ui}/Message/Message.d.ts +2 -1
  71. package/dist/ui/Message/Message.d.ts.map +1 -0
  72. package/dist/ui/Message/index.d.ts +2 -0
  73. package/dist/ui/Message/index.d.ts.map +1 -0
  74. package/dist/{src/ui → ui}/Tooltip/Tooltip.d.ts +2 -1
  75. package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -0
  76. package/dist/ui/Tooltip/index.d.ts +2 -0
  77. package/dist/ui/Tooltip/index.d.ts.map +1 -0
  78. package/dist/ui/index.d.ts +8 -0
  79. package/dist/ui/index.d.ts.map +1 -0
  80. package/dist/workflows/hooks.d.ts +34 -0
  81. package/dist/workflows/hooks.d.ts.map +1 -0
  82. package/dist/workflows/index.d.ts +3 -0
  83. package/dist/workflows/index.d.ts.map +1 -0
  84. package/dist/workflows/types.d.ts +122 -0
  85. package/dist/workflows/types.d.ts.map +1 -0
  86. package/dist/workflows/use-stream-workflow.d.ts +39 -0
  87. package/dist/workflows/use-stream-workflow.d.ts.map +1 -0
  88. package/package.json +34 -23
  89. package/dist/src/agent/hooks.d.ts +0 -46
  90. package/dist/src/index.d.ts +0 -6
  91. package/dist/src/lib/ai-sdk/index.d.ts +0 -3
  92. package/dist/src/lib/ai-sdk/memory/resolveInitialMessages.d.ts +0 -2
  93. package/dist/src/lib/ai-sdk/transformers/types.d.ts +0 -10
  94. package/dist/src/lib/ai-sdk/types.d.ts +0 -14
  95. package/dist/src/lib/ai-sdk/utils/toAssistantUIMessage.test.d.ts +0 -1
  96. package/dist/src/mastra-client-context.d.ts +0 -10
  97. package/dist/src/mastra-react-provider.d.ts +0 -4
  98. package/dist/src/ui/Code/highlight.d.ts +0 -3
  99. package/dist/src/ui/Code/index.d.ts +0 -1
  100. package/dist/src/ui/Entity/Entity.stories.d.ts +0 -22
  101. package/dist/src/ui/Entity/index.d.ts +0 -4
  102. package/dist/src/ui/Icon/index.d.ts +0 -1
  103. package/dist/src/ui/IconButton/IconButton.stories.d.ts +0 -12
  104. package/dist/src/ui/IconButton/index.d.ts +0 -1
  105. package/dist/src/ui/Icons/index.d.ts +0 -3
  106. package/dist/src/ui/Message/Message.stories.d.ts +0 -13
  107. package/dist/src/ui/Message/index.d.ts +0 -1
  108. package/dist/src/ui/Tooltip/Tooltip.stories.d.ts +0 -12
  109. package/dist/src/ui/Tooltip/index.d.ts +0 -1
  110. package/dist/src/ui/index.d.ts +0 -7
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './utils/toUIMessage.js';
3
+ export * from './utils/toAssistantUIMessage.js';
4
+ export { resolveToChildMessages } from './memory/resolveInitialMessages.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-sdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { MastraUIMessage } from '../types.js';
2
+ interface ChildMessage {
3
+ type: 'tool' | 'text';
4
+ toolCallId?: string;
5
+ toolName?: string;
6
+ args?: Record<string, unknown>;
7
+ toolOutput?: Record<string, unknown>;
8
+ content?: string;
9
+ }
10
+ export declare const resolveInitialMessages: (messages: MastraUIMessage[]) => MastraUIMessage[];
11
+ export declare const resolveToChildMessages: (messages: MastraUIMessage[]) => ChildMessage[];
12
+ export {};
13
+ //# sourceMappingURL=resolveInitialMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveInitialMessages.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/memory/resolveInitialMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,eAAe,EAA2B,MAAM,UAAU,CAAC;AA6ClG,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,GAAI,UAAU,eAAe,EAAE,KAAG,eAAe,EAqKnF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,UAAU,eAAe,EAAE,KAAG,YAAY,EAgChF,CAAC"}
@@ -1,6 +1,6 @@
1
- import { NetworkChunkType } from '@mastra/core/stream';
2
- import { Transformer, TransformerArgs } from './types';
3
- import { MastraUIMessage } from '../types';
1
+ import type { NetworkChunkType } from '@mastra/core/stream';
2
+ import type { MastraUIMessage } from '../types.js';
3
+ import type { Transformer, TransformerArgs } from './types.js';
4
4
  export declare class AISdkNetworkTransformer implements Transformer<NetworkChunkType> {
5
5
  transform({ chunk, conversation, metadata }: TransformerArgs<NetworkChunkType>): MastraUIMessage[];
6
6
  private handleRoutingAgentConversation;
@@ -8,3 +8,4 @@ export declare class AISdkNetworkTransformer implements Transformer<NetworkChunk
8
8
  private handleWorkflowConversation;
9
9
  private handleToolConversation;
10
10
  }
11
+ //# sourceMappingURL=AISdkNetworkTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AISdkNetworkTransformer.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/transformers/AISdkNetworkTransformer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D,qBAAa,uBAAwB,YAAW,WAAW,CAAC,gBAAgB,CAAC;IAC3E,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAAG,eAAe,EAAE;IAmGlG,OAAO,CAAC,8BAA8B,CA4CpC;IAEF,OAAO,CAAC,uBAAuB,CA0O7B;IAEF,OAAO,CAAC,0BAA0B,CAyGhC;IAEF,OAAO,CAAC,sBAAsB,CAkJ5B;CACH"}
@@ -0,0 +1,11 @@
1
+ import type { NetworkChunkType } from '@mastra/core/stream';
2
+ import type { MastraUIMessage, MastraUIMessageMetadata } from '../types.js';
3
+ export interface TransformerArgs<_T> {
4
+ chunk: NetworkChunkType;
5
+ conversation: MastraUIMessage[];
6
+ metadata: MastraUIMessageMetadata;
7
+ }
8
+ export interface Transformer<T> {
9
+ transform: (args: TransformerArgs<T>) => MastraUIMessage[];
10
+ }
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/transformers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEzE,MAAM,WAAW,eAAe,CAAC,EAAE;IACjC,KAAK,EAAE,gBAAgB,CAAC;IACxB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,eAAe,EAAE,CAAC;CAC5D"}
@@ -0,0 +1,116 @@
1
+ import type { UIMessage } from '@ai-sdk/react';
2
+ import type { 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
+ };
14
+ export type MastraUIMessageMetadata = {
15
+ status?: 'warning' | 'error' | 'tripwire';
16
+ /** Tripwire-specific metadata when status is 'tripwire' */
17
+ tripwire?: TripwireMetadata;
18
+ } & ({
19
+ mode: 'generate';
20
+ completionResult?: {
21
+ passed: boolean;
22
+ suppressFeedback?: boolean;
23
+ };
24
+ requireApprovalMetadata?: {
25
+ [toolName: string]: {
26
+ toolCallId: string;
27
+ toolName: string;
28
+ args: Record<string, any>;
29
+ runId?: string;
30
+ };
31
+ };
32
+ suspendedTools?: {
33
+ [toolName: string]: {
34
+ toolCallId: string;
35
+ toolName: string;
36
+ args: Record<string, any>;
37
+ suspendPayload: any;
38
+ };
39
+ };
40
+ } | {
41
+ mode: 'stream';
42
+ completionResult?: {
43
+ passed: boolean;
44
+ suppressFeedback?: boolean;
45
+ };
46
+ requireApprovalMetadata?: {
47
+ [toolName: string]: {
48
+ toolCallId: string;
49
+ toolName: string;
50
+ args: Record<string, any>;
51
+ runId?: string;
52
+ };
53
+ };
54
+ suspendedTools?: {
55
+ [toolName: string]: {
56
+ toolCallId: string;
57
+ toolName: string;
58
+ args: Record<string, any>;
59
+ suspendPayload: any;
60
+ };
61
+ };
62
+ } | {
63
+ mode: 'network';
64
+ from?: 'AGENT' | 'WORKFLOW' | 'TOOL';
65
+ selectionReason?: string;
66
+ agentInput?: string | object | Array<object>;
67
+ hasMoreMessages?: boolean;
68
+ completionResult?: {
69
+ passed: boolean;
70
+ suppressFeedback?: boolean;
71
+ };
72
+ requireApprovalMetadata?: {
73
+ [toolName: string]: {
74
+ toolCallId: string;
75
+ toolName: string;
76
+ args: Record<string, any>;
77
+ runId?: string;
78
+ };
79
+ };
80
+ suspendedTools?: {
81
+ [toolName: string]: {
82
+ toolCallId: string;
83
+ toolName: string;
84
+ args: Record<string, any>;
85
+ suspendPayload: any;
86
+ };
87
+ };
88
+ });
89
+ /**
90
+ * Mastra-extended text part with textId for tracking separate text streams.
91
+ *
92
+ * This follows the same pattern as the existing `state` property which is already
93
+ * added to text parts in the codebase. Both `state` and `textId` are Mastra-specific
94
+ * extensions to the standard AI SDK TextUIPart.
95
+ */
96
+ export type MastraExtendedTextPart = {
97
+ type: 'text';
98
+ text: string;
99
+ /** Unique identifier for this text stream (from chunk.payload.id) */
100
+ textId?: string;
101
+ /** Streaming state - already exists in codebase for text parts */
102
+ state?: 'streaming' | 'done';
103
+ /** Provider-specific metadata */
104
+ providerMetadata?: any;
105
+ };
106
+ export type MastraUIMessage = UIMessage<MastraUIMessageMetadata, any, any>;
107
+ /**
108
+ * Extended type for MastraUIMessage that may include additional properties
109
+ * from different sources (generate, toUIMessage, toNetworkUIMessage)
110
+ */
111
+ export type ExtendedMastraUIMessage = MastraUIMessage & {
112
+ createdAt?: Date;
113
+ metadata?: Record<string, unknown>;
114
+ experimental_attachments?: readonly CompleteAttachment[];
115
+ };
116
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-sdk/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;GA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;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC7B,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG;IACtD,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,wBAAwB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC1D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { CoreUserMessage } from '@mastra/core/llm';
2
+ import type { MastraUIMessage } from '../types.js';
3
+ /**
4
+ * Converts a CoreUserMessage to a MastraUIMessage (UIMessage format).
5
+ *
6
+ * Handles all CoreUserMessage content types:
7
+ * - String content → single text part
8
+ * - Array content with text/image/file parts → corresponding UIMessage parts
9
+ */
10
+ export declare const fromCoreUserMessageToUIMessage: (coreUserMessage: CoreUserMessage) => MastraUIMessage;
11
+ //# sourceMappingURL=fromCoreUserMessageToUIMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fromCoreUserMessageToUIMessage.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,GAAI,iBAAiB,eAAe,KAAG,eAqEjF,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ThreadMessageLike } from '@assistant-ui/react';
2
- import { MastraUIMessage } from '../types';
1
+ import type { ThreadMessageLike } from '@assistant-ui/react';
2
+ import type { MastraUIMessage } from '../types.js';
3
3
  /**
4
4
  * Converts a Mastra UIMessage (from AI SDK) to a ThreadMessageLike format compatible with @assistant-ui/react.
5
5
  *
@@ -12,3 +12,4 @@ import { MastraUIMessage } from '../types';
12
12
  * @returns A ThreadMessageLike compatible with @assistant-ui/react
13
13
  */
14
14
  export declare const toAssistantUIMessage: (message: MastraUIMessage) => ThreadMessageLike;
15
+ //# sourceMappingURL=toAssistantUIMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toAssistantUIMessage.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/utils/toAssistantUIMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EAA2B,eAAe,EAAE,MAAM,UAAU,CAAC;AASzE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,eAAe,KAAG,iBAoN/D,CAAC"}
@@ -1,6 +1,6 @@
1
- import { ChunkType } from '@mastra/core/stream';
2
- import { MastraUIMessage, MastraUIMessageMetadata } from '../types';
3
- import { WorkflowStreamResult } from '@mastra/core/workflows';
1
+ import type { ChunkType } from '@mastra/core/stream';
2
+ import type { WorkflowStreamResult } from '@mastra/core/workflows';
3
+ import type { MastraUIMessage, MastraUIMessageMetadata } from '../types.js';
4
4
  type StreamChunk = {
5
5
  type: string;
6
6
  payload: any;
@@ -15,3 +15,4 @@ export interface ToUIMessageArgs {
15
15
  }
16
16
  export declare const toUIMessage: ({ chunk, conversation, metadata }: ToUIMessageArgs) => MastraUIMessage[];
17
17
  export {};
18
+ //# sourceMappingURL=toUIMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toUIMessage.d.ts","sourceRoot":"","sources":["../../../../src/lib/ai-sdk/utils/toUIMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAc,MAAM,wBAAwB,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAA0B,MAAM,UAAU,CAAC;AAEjG,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;CAC5B,CAAC;AAKF,eAAO,MAAM,mCAAmC,GAC9C,MAAM,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC9C,OAAO,WAAW,KACjB,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CA0GzC,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,QAAQ,EAAE,uBAAuB,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,GAAI,mCAAmC,eAAe,KAAG,eAAe,EAmnB/F,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Represents the state of a mutation operation.
3
+ * Mimics the essential return type of react-query's useMutation.
4
+ */
5
+ export interface MutationState<TData, TError extends Error, TVariables> {
6
+ /** Execute the mutation without waiting for the result */
7
+ mutate: (variables: TVariables) => void;
8
+ /** Execute the mutation and return a promise with the result */
9
+ mutateAsync: (variables: TVariables) => Promise<TData>;
10
+ /** Whether the mutation is currently executing */
11
+ isPending: boolean;
12
+ /** Whether the mutation completed successfully */
13
+ isSuccess: boolean;
14
+ /** Whether the mutation failed with an error */
15
+ isError: boolean;
16
+ /** The error if the mutation failed, null otherwise */
17
+ error: TError | null;
18
+ /** The data returned by the mutation if successful */
19
+ data: TData | undefined;
20
+ /** Reset the mutation state to initial values */
21
+ reset: () => void;
22
+ }
23
+ /**
24
+ * Internal helper hook that provides mutation-like functionality without react-query.
25
+ * Tracks pending, success, and error states for async operations.
26
+ */
27
+ export declare function useMutation<TData, TError extends Error, TVariables>(mutationFn: (variables: TVariables) => Promise<TData>): MutationState<TData, TError, TVariables>;
28
+ //# sourceMappingURL=use-mutation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-mutation.d.ts","sourceRoot":"","sources":["../../src/lib/use-mutation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,EAAE,MAAM,SAAS,KAAK,EAAE,UAAU;IACpE,0DAA0D;IAC1D,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,gEAAgE;IAChE,WAAW,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;IACvD,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sDAAsD;IACtD,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;IACxB,iDAAiD;IACjD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,SAAS,KAAK,EAAE,UAAU,EACjE,UAAU,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,OAAO,CAAC,KAAK,CAAC,GACpD,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CA0D1C"}
@@ -0,0 +1,14 @@
1
+ import { MastraClient } from '@mastra/client-js';
2
+ import type { ReactNode } from 'react';
3
+ export type MastraClientContextType = MastraClient;
4
+ export interface MastraClientProviderProps {
5
+ children: ReactNode;
6
+ baseUrl?: string;
7
+ headers?: Record<string, string>;
8
+ /** API route prefix. Defaults to '/api'. Set this to match your server's apiPrefix configuration. */
9
+ apiPrefix?: string;
10
+ }
11
+ export declare const MastraClientProvider: ({ children, baseUrl, headers, apiPrefix }: MastraClientProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const useMastraClient: () => MastraClient;
13
+ export declare const isLocalUrl: (url?: string) => boolean;
14
+ //# sourceMappingURL=mastra-client-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastra-client-context.d.ts","sourceRoot":"","sources":["../src/mastra-client-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC;AAInD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,qGAAqG;IACrG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,oBAAoB,GAAI,2CAA2C,yBAAyB,4CAIxG,CAAC;AAEF,eAAO,MAAM,eAAe,oBAAwC,CAAC;AAUrE,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,OAczC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { MastraClientProviderProps } from './mastra-client-context';
2
+ type MastraReactProviderProps = MastraClientProviderProps;
3
+ export declare const MastraReactProvider: ({ children, baseUrl, headers, apiPrefix }: MastraReactProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ export {};
5
+ //# sourceMappingURL=mastra-react-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastra-react-provider.d.ts","sourceRoot":"","sources":["../src/mastra-react-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,KAAK,wBAAwB,GAAG,yBAAyB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,GAAI,2CAA2C,wBAAwB,4CAMtG,CAAC"}