@mastra/ai-sdk 0.0.0-fix-backport-setserver-20251201151948 → 0.0.0-fix-request-context-as-query-key-20251209093005
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 +332 -145
- package/README.md +60 -0
- package/dist/chat-route.d.ts +42 -5
- package/dist/chat-route.d.ts.map +1 -1
- package/dist/convert-messages.d.ts +10 -0
- package/dist/convert-messages.d.ts.map +1 -0
- package/dist/convert-streams.d.ts +81 -0
- package/dist/convert-streams.d.ts.map +1 -0
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.cjs +646 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +644 -89
- package/dist/index.js.map +1 -1
- package/dist/middleware.d.ts +157 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/network-route.d.ts +63 -2
- package/dist/network-route.d.ts.map +1 -1
- package/dist/to-ai-sdk-format.d.ts +11 -78
- package/dist/to-ai-sdk-format.d.ts.map +1 -1
- package/dist/transformers.d.ts.map +1 -1
- package/dist/ui.cjs +16 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +13 -0
- package/dist/ui.js.map +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/workflow-route.d.ts +65 -0
- package/dist/workflow-route.d.ts.map +1 -1
- package/package.json +22 -12
package/README.md
CHANGED
|
@@ -93,6 +93,64 @@ export const mastra = new Mastra({
|
|
|
93
93
|
});
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
## Framework-agnostic handlers
|
|
97
|
+
|
|
98
|
+
For use outside of the Mastra server (e.g., Next.js App Router, Express), you can use the standalone handler functions directly. These handlers return a `ReadableStream` that you can wrap with `createUIMessageStreamResponse`:
|
|
99
|
+
|
|
100
|
+
### handleChatStream
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { handleChatStream } from '@mastra/ai-sdk';
|
|
104
|
+
import { createUIMessageStreamResponse } from 'ai';
|
|
105
|
+
import { mastra } from '@/src/mastra';
|
|
106
|
+
|
|
107
|
+
export async function POST(req: Request) {
|
|
108
|
+
const params = await req.json();
|
|
109
|
+
const stream = await handleChatStream({
|
|
110
|
+
mastra,
|
|
111
|
+
agentId: 'weatherAgent',
|
|
112
|
+
params,
|
|
113
|
+
});
|
|
114
|
+
return createUIMessageStreamResponse({ stream });
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### handleWorkflowStream
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
import { handleWorkflowStream } from '@mastra/ai-sdk';
|
|
122
|
+
import { createUIMessageStreamResponse } from 'ai';
|
|
123
|
+
import { mastra } from '@/src/mastra';
|
|
124
|
+
|
|
125
|
+
export async function POST(req: Request) {
|
|
126
|
+
const params = await req.json();
|
|
127
|
+
const stream = await handleWorkflowStream({
|
|
128
|
+
mastra,
|
|
129
|
+
workflowId: 'myWorkflow',
|
|
130
|
+
params,
|
|
131
|
+
});
|
|
132
|
+
return createUIMessageStreamResponse({ stream });
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### handleNetworkStream
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { handleNetworkStream } from '@mastra/ai-sdk';
|
|
140
|
+
import { createUIMessageStreamResponse } from 'ai';
|
|
141
|
+
import { mastra } from '@/src/mastra';
|
|
142
|
+
|
|
143
|
+
export async function POST(req: Request) {
|
|
144
|
+
const params = await req.json();
|
|
145
|
+
const stream = await handleNetworkStream({
|
|
146
|
+
mastra,
|
|
147
|
+
agentId: 'routingAgent',
|
|
148
|
+
params,
|
|
149
|
+
});
|
|
150
|
+
return createUIMessageStreamResponse({ stream });
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
96
154
|
## Manual transformation
|
|
97
155
|
|
|
98
156
|
If you have a raw Mastra `stream`, you can manually transform it to AI SDK UI message parts:
|
|
@@ -106,7 +164,9 @@ export async function POST(req: Request) {
|
|
|
106
164
|
const agent = mastra.getAgent('weatherAgent');
|
|
107
165
|
const stream = await agent.stream(messages);
|
|
108
166
|
|
|
167
|
+
// deduplicate messages https://ai-sdk.dev/docs/troubleshooting/repeated-assistant-messages
|
|
109
168
|
const uiMessageStream = createUIMessageStream({
|
|
169
|
+
originalMessages: messages,
|
|
110
170
|
execute: async ({ writer }) => {
|
|
111
171
|
for await (const part of toAISdkFormat(stream, { from: 'agent' })!) {
|
|
112
172
|
writer.write(part);
|
package/dist/chat-route.d.ts
CHANGED
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
import type { AgentExecutionOptions } from '@mastra/core/agent';
|
|
2
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
2
3
|
import { registerApiRoute } from '@mastra/core/server';
|
|
3
4
|
import type { OutputSchema } from '@mastra/core/stream';
|
|
5
|
+
import type { InferUIMessageChunk, UIMessage } from 'ai';
|
|
6
|
+
export type ChatStreamHandlerParams<UI_MESSAGE extends UIMessage, OUTPUT extends OutputSchema = undefined> = AgentExecutionOptions<OUTPUT, 'mastra'> & {
|
|
7
|
+
messages: UI_MESSAGE[];
|
|
8
|
+
resumeData?: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
export type ChatStreamHandlerOptions<UI_MESSAGE extends UIMessage, OUTPUT extends OutputSchema = undefined> = {
|
|
11
|
+
mastra: Mastra;
|
|
12
|
+
agentId: string;
|
|
13
|
+
params: ChatStreamHandlerParams<UI_MESSAGE, OUTPUT>;
|
|
14
|
+
defaultOptions?: AgentExecutionOptions<OUTPUT, 'mastra'>;
|
|
15
|
+
sendStart?: boolean;
|
|
16
|
+
sendFinish?: boolean;
|
|
17
|
+
sendReasoning?: boolean;
|
|
18
|
+
sendSources?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Framework-agnostic handler for streaming agent chat in AI SDK-compatible format.
|
|
22
|
+
* Use this function directly when you need to handle chat streaming outside of Hono or Mastra's own apiRoutes feature.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* // Next.js App Router
|
|
27
|
+
* import { handleChatStream } from '@mastra/ai-sdk';
|
|
28
|
+
* import { createUIMessageStreamResponse } from 'ai';
|
|
29
|
+
* import { mastra } from '@/src/mastra';
|
|
30
|
+
*
|
|
31
|
+
* export async function POST(req: Request) {
|
|
32
|
+
* const params = await req.json();
|
|
33
|
+
* const stream = await handleChatStream({
|
|
34
|
+
* mastra,
|
|
35
|
+
* agentId: 'weatherAgent',
|
|
36
|
+
* params,
|
|
37
|
+
* });
|
|
38
|
+
* return createUIMessageStreamResponse({ stream });
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function handleChatStream<UI_MESSAGE extends UIMessage, OUTPUT extends OutputSchema = undefined>({ mastra, agentId, params, defaultOptions, sendStart, sendFinish, sendReasoning, sendSources, }: ChatStreamHandlerOptions<UI_MESSAGE, OUTPUT>): Promise<ReadableStream<InferUIMessageChunk<UI_MESSAGE>>>;
|
|
4
43
|
export type chatRouteOptions<OUTPUT extends OutputSchema = undefined> = {
|
|
5
|
-
defaultOptions?: AgentExecutionOptions<OUTPUT, '
|
|
44
|
+
defaultOptions?: AgentExecutionOptions<OUTPUT, 'mastra'>;
|
|
6
45
|
} & ({
|
|
7
46
|
path: `${string}:agentId${string}`;
|
|
8
47
|
agent?: never;
|
|
@@ -18,9 +57,8 @@ export type chatRouteOptions<OUTPUT extends OutputSchema = undefined> = {
|
|
|
18
57
|
/**
|
|
19
58
|
* Creates a chat route handler for streaming agent conversations using the AI SDK format.
|
|
20
59
|
*
|
|
21
|
-
* This function registers an HTTP POST endpoint that accepts messages, executes an agent,
|
|
22
|
-
*
|
|
23
|
-
* *
|
|
60
|
+
* This function registers an HTTP POST endpoint that accepts messages, executes an agent, and streams the response back to the client in AI SDK-compatible format.
|
|
61
|
+
*
|
|
24
62
|
* @param {chatRouteOptions} options - Configuration options for the chat route
|
|
25
63
|
* @param {string} [options.path='/chat/:agentId'] - The route path. Include `:agentId` for dynamic routing
|
|
26
64
|
* @param {string} [options.agent] - Fixed agent ID when not using dynamic routing
|
|
@@ -40,7 +78,6 @@ export type chatRouteOptions<OUTPUT extends OutputSchema = undefined> = {
|
|
|
40
78
|
* // Dynamic agent routing
|
|
41
79
|
* chatRoute({
|
|
42
80
|
* path: '/chat/:agentId',
|
|
43
|
-
* sendReasoning: true,
|
|
44
81
|
* });
|
|
45
82
|
*
|
|
46
83
|
* @example
|
package/dist/chat-route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-route.d.ts","sourceRoot":"","sources":["../src/chat-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-route.d.ts","sourceRoot":"","sources":["../src/chat-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGzD,MAAM,MAAM,uBAAuB,CACjC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,YAAY,GAAG,SAAS,IACrC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC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CACJ,GAAG;IACA,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,SAAS,CAAC,MAAM,SAAS,YAAY,GAAG,SAAS,EAAE,EACjE,IAAuB,EACvB,KAAK,EACL,cAAc,EACd,SAAgB,EAChB,UAAiB,EACjB,aAAqB,EACrB,WAAmB,GACpB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CA0JhE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MessageListInput } from '@mastra/core/agent/message-list';
|
|
2
|
+
/**
|
|
3
|
+
* Converts messages to AI SDK V5 UI format
|
|
4
|
+
*/
|
|
5
|
+
export declare function toAISdkV5Messages(messages: MessageListInput): import("ai-v5").UIMessage<unknown, import("ai-v5").UIDataTypes, import("ai-v5").UITools>[];
|
|
6
|
+
/**
|
|
7
|
+
* Converts messages to AI SDK V4 UI format
|
|
8
|
+
*/
|
|
9
|
+
export declare function toAISdkV4Messages(messages: MessageListInput): import("@mastra/core/agent").UIMessageWithMetadata[];
|
|
10
|
+
//# sourceMappingURL=convert-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-messages.d.ts","sourceRoot":"","sources":["../src/convert-messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,8FAE3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,wDAE3D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { MastraModelOutput, OutputSchema, MastraAgentNetworkStream, WorkflowRunOutput } from '@mastra/core/stream';
|
|
2
|
+
import type { MastraWorkflowStream, Step, WorkflowResult } from '@mastra/core/workflows';
|
|
3
|
+
import type { InferUIMessageChunk, UIMessage, UIMessageStreamOptions } from 'ai';
|
|
4
|
+
import type { ZodObject, ZodType } from 'zod';
|
|
5
|
+
/**
|
|
6
|
+
* Converts Mastra streams (workflow, agent network, or agent) to AI SDK v5 compatible streams.
|
|
7
|
+
*
|
|
8
|
+
* This function transforms various Mastra stream types into ReadableStream objects that are compatible with the AI SDK v5, enabling seamless integration with AI SDK's streaming capabilities.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* @param {MastraWorkflowStream | WorkflowRunOutput | MastraAgentNetworkStream | MastraModelOutput} stream
|
|
12
|
+
* The Mastra stream to convert. Can be one of:
|
|
13
|
+
* - MastraWorkflowStream: A workflow execution stream
|
|
14
|
+
* - WorkflowRunOutput: The output of a workflow run
|
|
15
|
+
* - MastraAgentNetworkStream: An agent network execution stream
|
|
16
|
+
* - MastraModelOutput: An agent model output stream
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} options - Conversion options
|
|
19
|
+
* @param {'workflow' | 'network' | 'agent'} options.from - The type of stream being converted. Defaults to 'agent'
|
|
20
|
+
* @param {string} [options.lastMessageId] - (Agent only) The ID of the last message in the conversation
|
|
21
|
+
* @param {boolean} [options.sendStart=true] - (Agent only) Whether to send start events. Defaults to true
|
|
22
|
+
* @param {boolean} [options.sendFinish=true] - (Agent only) Whether to send finish events. Defaults to true
|
|
23
|
+
* @param {boolean} [options.sendReasoning] - (Agent only) Whether to include reasoning in the output
|
|
24
|
+
* @param {boolean} [options.sendSources] - (Agent only) Whether to include sources in the output
|
|
25
|
+
* @param {Function} [options.messageMetadata] - (Agent only) A function that receives the current stream part and returns metadata to attach to start and finish chunks
|
|
26
|
+
* @param {Function} [options.onError] - (Agent only) A function to handle errors during stream conversion. Receives the error and should return a string representation
|
|
27
|
+
*
|
|
28
|
+
* @returns {ReadableStream<InferUIMessageChunk<UIMessage>>} A ReadableStream compatible with AI SDK v5
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Convert a workflow stream
|
|
32
|
+
* const workflowStream = await workflowRun.stream(...);
|
|
33
|
+
* const aiSDKStream = toAISdkV5Stream(workflowStream, { from: 'workflow' });
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Convert an agent network stream
|
|
37
|
+
* const networkStream = await agentNetwork.network(...);
|
|
38
|
+
* const aiSDKStream = toAISdkV5Stream(networkStream, { from: 'network' });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Convert an agent stream with custom options
|
|
42
|
+
* const agentStream = await agent.stream(...);
|
|
43
|
+
* const aiSDKStream = toAISdkV5Stream(agentStream, {
|
|
44
|
+
* from: 'agent',
|
|
45
|
+
* lastMessageId: 'msg-123',
|
|
46
|
+
* sendReasoning: true,
|
|
47
|
+
* sendSources: true
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Convert an agent stream with messageMetadata
|
|
52
|
+
* const aiSDKStream = toAISdkV5Stream(agentStream, {
|
|
53
|
+
* from: 'agent',
|
|
54
|
+
* messageMetadata: ({ part }) => ({
|
|
55
|
+
* timestamp: Date.now(),
|
|
56
|
+
* partType: part.type
|
|
57
|
+
* })
|
|
58
|
+
* });
|
|
59
|
+
*/
|
|
60
|
+
export declare function toAISdkV5Stream<TOutput extends ZodType<any>, TInput extends ZodType<any>, TSteps extends Step<string, any, any, any, any, any>[], TState extends ZodObject<any>>(stream: MastraWorkflowStream<TState, TInput, TOutput, TSteps>, options: {
|
|
61
|
+
from: 'workflow';
|
|
62
|
+
includeTextStreamParts?: boolean;
|
|
63
|
+
}): ReadableStream<InferUIMessageChunk<UIMessage>>;
|
|
64
|
+
export declare function toAISdkV5Stream<TOutput extends ZodType<any>, TInput extends ZodType<any>, TSteps extends Step<string, any, any, any, any, any>[], TState extends ZodObject<any>>(stream: WorkflowRunOutput<WorkflowResult<TState, TInput, TOutput, TSteps>>, options: {
|
|
65
|
+
from: 'workflow';
|
|
66
|
+
includeTextStreamParts?: boolean;
|
|
67
|
+
}): ReadableStream<InferUIMessageChunk<UIMessage>>;
|
|
68
|
+
export declare function toAISdkV5Stream(stream: MastraAgentNetworkStream, options: {
|
|
69
|
+
from: 'network';
|
|
70
|
+
}): ReadableStream<InferUIMessageChunk<UIMessage>>;
|
|
71
|
+
export declare function toAISdkV5Stream<TOutput extends OutputSchema>(stream: MastraModelOutput<TOutput>, options: {
|
|
72
|
+
from: 'agent';
|
|
73
|
+
lastMessageId?: string;
|
|
74
|
+
sendStart?: boolean;
|
|
75
|
+
sendFinish?: boolean;
|
|
76
|
+
sendReasoning?: boolean;
|
|
77
|
+
sendSources?: boolean;
|
|
78
|
+
messageMetadata?: UIMessageStreamOptions<UIMessage>['messageMetadata'];
|
|
79
|
+
onError?: UIMessageStreamOptions<UIMessage>['onError'];
|
|
80
|
+
}): ReadableStream<InferUIMessageChunk<UIMessage>>;
|
|
81
|
+
//# sourceMappingURL=convert-streams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-streams.d.ts","sourceRoot":"","sources":["../src/convert-streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,YAAY,EACZ,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,IAAI,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAS9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,iBAAiB,CAAC,OAAO,CAAC,EAClC,OAAO,EAAE;IACP,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACvE,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;CACxD,GACA,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PartialSchemaOutput, OutputSchema, DataChunkType, ChunkType } from '@mastra/core/stream';
|
|
2
2
|
import type { InferUIMessageChunk, ObjectStreamPart, TextStreamPart, ToolSet, UIMessage } from 'ai';
|
|
3
3
|
export type OutputChunkType<OUTPUT extends OutputSchema = undefined> = TextStreamPart<ToolSet> | ObjectStreamPart<PartialSchemaOutput<OUTPUT>> | DataChunkType | undefined;
|
|
4
4
|
export type ToolAgentChunkType = {
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEvG,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,EA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