@mastra/react 0.4.3 → 0.5.0

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 (49) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/dist/agent/extractRunIdFromMessages.d.ts +9 -2
  3. package/dist/agent/extractRunIdFromMessages.d.ts.map +1 -1
  4. package/dist/agent/hooks.d.ts +9 -11
  5. package/dist/agent/hooks.d.ts.map +1 -1
  6. package/dist/agent/types.d.ts +5 -1
  7. package/dist/agent/types.d.ts.map +1 -1
  8. package/dist/index.cjs +1342 -1476
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1342 -1476
  13. package/dist/index.js.map +1 -1
  14. package/dist/lib/mastra-db/accumulator.d.ts +48 -0
  15. package/dist/lib/mastra-db/accumulator.d.ts.map +1 -0
  16. package/dist/lib/mastra-db/formatCompletionFeedback.d.ts.map +1 -0
  17. package/dist/lib/mastra-db/fromCoreUserMessage.d.ts +11 -0
  18. package/dist/lib/mastra-db/fromCoreUserMessage.d.ts.map +1 -0
  19. package/dist/lib/mastra-db/index.d.ts +5 -0
  20. package/dist/lib/mastra-db/index.d.ts.map +1 -0
  21. package/dist/lib/mastra-db/types.d.ts +156 -0
  22. package/dist/lib/mastra-db/types.d.ts.map +1 -0
  23. package/dist/ui/MessageFactory/MessageFactory.d.ts +22 -0
  24. package/dist/ui/MessageFactory/MessageFactory.d.ts.map +1 -0
  25. package/dist/ui/MessageFactory/index.d.ts +3 -0
  26. package/dist/ui/MessageFactory/index.d.ts.map +1 -0
  27. package/dist/ui/MessageFactory/types.d.ts +164 -0
  28. package/dist/ui/MessageFactory/types.d.ts.map +1 -0
  29. package/dist/ui/index.d.ts +1 -0
  30. package/dist/ui/index.d.ts.map +1 -1
  31. package/package.json +6 -10
  32. package/dist/lib/ai-sdk/index.d.ts +0 -5
  33. package/dist/lib/ai-sdk/index.d.ts.map +0 -1
  34. package/dist/lib/ai-sdk/memory/resolveInitialMessages.d.ts +0 -13
  35. package/dist/lib/ai-sdk/memory/resolveInitialMessages.d.ts.map +0 -1
  36. package/dist/lib/ai-sdk/transformers/AISdkNetworkTransformer.d.ts +0 -11
  37. package/dist/lib/ai-sdk/transformers/AISdkNetworkTransformer.d.ts.map +0 -1
  38. package/dist/lib/ai-sdk/transformers/types.d.ts +0 -11
  39. package/dist/lib/ai-sdk/transformers/types.d.ts.map +0 -1
  40. package/dist/lib/ai-sdk/types.d.ts +0 -145
  41. package/dist/lib/ai-sdk/types.d.ts.map +0 -1
  42. package/dist/lib/ai-sdk/utils/formatCompletionFeedback.d.ts.map +0 -1
  43. package/dist/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.d.ts +0 -11
  44. package/dist/lib/ai-sdk/utils/fromCoreUserMessageToUIMessage.d.ts.map +0 -1
  45. package/dist/lib/ai-sdk/utils/toAssistantUIMessage.d.ts +0 -15
  46. package/dist/lib/ai-sdk/utils/toAssistantUIMessage.d.ts.map +0 -1
  47. package/dist/lib/ai-sdk/utils/toUIMessage.d.ts +0 -20
  48. package/dist/lib/ai-sdk/utils/toUIMessage.d.ts.map +0 -1
  49. /package/dist/lib/{ai-sdk/utils → mastra-db}/formatCompletionFeedback.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,133 @@
1
1
  # @mastra/react
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add a type-safe `MessageFactory` component to `@mastra/react` for rendering a `MastraDBMessage` with your own per-part components, and align its tripwire/task-verdict types with `@mastra/core`. ([#17514](https://github.com/mastra-ai/mastra/pull/17514))
8
+
9
+ **@mastra/react**
10
+
11
+ `MessageFactory` provides optional, fully type-safe render functions for each kind of message part. Only the renderer matching a part's type runs, and each receives correctly narrowed props; missing renderers fall back gracefully. Runtime-only `dynamic-tool` and AI SDK v5 `tool-${string}` parts are covered by a dedicated `DynamicTool` renderer, and optional role wrappers let you frame parts per message role.
12
+
13
+ ```tsx
14
+ import { MessageFactory } from '@mastra/react';
15
+
16
+ <MessageFactory
17
+ message={message}
18
+ Text={part => <p>{part.text}</p>}
19
+ ToolInvocation={part => <ToolCard name={part.toolInvocation.toolName} />}
20
+ DynamicTool={part => <ToolCard name={part.toolName} state={part.state} />}
21
+ Data={part => <DataView type={part.type} data={part.data} />}
22
+ roles={{ Signal: ({ children }) => <SignalFrame>{children}</SignalFrame> }}
23
+ />;
24
+ ```
25
+
26
+ It also accepts an optional `status` prop with four strongly-typed slots that render from a message's metadata while keeping part renderers pure. `Tripwire`, `Warning`, and `Error` are _replacement_ slots (rendered instead of the parts when `metadata.status` matches); `Task` is an _adjacent_ slot (rendered alongside the parts when a task-completion verdict exists). The factory only surfaces metadata to the slots and never filters it (for example, it still invokes `Task` when `suppressFeedback` is true) — the consumer decides what to render or skip. Existing behavior is unchanged when `status` is omitted.
27
+
28
+ ```tsx
29
+ <MessageFactory
30
+ message={message}
31
+ status={{
32
+ Error: ({ text }) => <ErrorNotice>{text}</ErrorNotice>,
33
+ Task: ({ passed, suppressFeedback }) => (suppressFeedback ? null : <TaskVerdict passed={passed} />),
34
+ }}
35
+ {...renderers}
36
+ />
37
+ ```
38
+
39
+ The narrowed part types used by the renderers are exported so consumers can type their own components: `TextPart`, `ReasoningPart`, `FilePart`, `StepStartPart`, `ToolInvocationPart`, `SourceDocumentPart`, and `SourceUrlPart`, plus `MessageFactoryPart` (the exact union of part shapes `MessageFactory` can dispatch — the typed accumulator parts plus the runtime-only `dynamic-tool` / `tool-${string}` parts) for typing part arrays precisely instead of `unknown[]`.
40
+
41
+ `MastraDBMessageMetadata.isTaskCompleteResult` is now typed as the `{ passed?, suppressFeedback? }` completion-verdict shape (matching `completionResult`) instead of `boolean`, so the `Task` slot resolves verdicts from either field without a cast.
42
+
43
+ `TripwireMetadata` is now an alias of core's `TripwirePayload`, and the message accumulator persists the canonical shape. Two behavioral changes to persisted `metadata.tripwire`:
44
+ - The tripwire `reason` is now persisted as `tripwire.reason` (previously it was only stored in the message text part).
45
+ - The processor metadata field was renamed from `tripwire.tripwirePayload` to `tripwire.metadata` to match the canonical type.
46
+
47
+ The `MessageFactory` `Tripwire` slot receives `reason` through `props.tripwire`.
48
+
49
+ **@mastra/core**
50
+
51
+ Exported the canonical `IsTaskCompletePayload` and `TripwirePayload` types from `@mastra/core/stream` so consumers can type their own task/completion and tripwire UI against them instead of redeclaring the shapes.
52
+
53
+ ```ts
54
+ import type { IsTaskCompletePayload, TripwirePayload } from '@mastra/core/stream';
55
+ ```
56
+
57
+ - Use the message-first client helper for user-authored thread input while preserving fallback behavior for older servers that only support the legacy signal route. ([#17238](https://github.com/mastra-ai/mastra/pull/17238))
58
+
59
+ ### Patch Changes
60
+
61
+ - Improved agent message, stream, and observational-memory type handling across the client SDKs and playground UI. ([#17208](https://github.com/mastra-ai/mastra/pull/17208))
62
+
63
+ - Updated dependencies [[`e17e5c1`](https://github.com/mastra-ai/mastra/commit/e17e5c1e1f6c7743d9e48ebce740e25cf4f897e0), [`d8a79af`](https://github.com/mastra-ai/mastra/commit/d8a79afe06a6352c90d0fb7bef0f394ad0af8eff), [`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`43dd577`](https://github.com/mastra-ai/mastra/commit/43dd577aa2b056b86b92cb903433f4fc13e69687), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
64
+ - @mastra/client-js@1.23.0
65
+ - @mastra/core@1.39.0
66
+
67
+ ## 0.5.0-alpha.0
68
+
69
+ ### Minor Changes
70
+
71
+ - Add a type-safe `MessageFactory` component to `@mastra/react` for rendering a `MastraDBMessage` with your own per-part components, and align its tripwire/task-verdict types with `@mastra/core`. ([#17514](https://github.com/mastra-ai/mastra/pull/17514))
72
+
73
+ **@mastra/react**
74
+
75
+ `MessageFactory` provides optional, fully type-safe render functions for each kind of message part. Only the renderer matching a part's type runs, and each receives correctly narrowed props; missing renderers fall back gracefully. Runtime-only `dynamic-tool` and AI SDK v5 `tool-${string}` parts are covered by a dedicated `DynamicTool` renderer, and optional role wrappers let you frame parts per message role.
76
+
77
+ ```tsx
78
+ import { MessageFactory } from '@mastra/react';
79
+
80
+ <MessageFactory
81
+ message={message}
82
+ Text={part => <p>{part.text}</p>}
83
+ ToolInvocation={part => <ToolCard name={part.toolInvocation.toolName} />}
84
+ DynamicTool={part => <ToolCard name={part.toolName} state={part.state} />}
85
+ Data={part => <DataView type={part.type} data={part.data} />}
86
+ roles={{ Signal: ({ children }) => <SignalFrame>{children}</SignalFrame> }}
87
+ />;
88
+ ```
89
+
90
+ It also accepts an optional `status` prop with four strongly-typed slots that render from a message's metadata while keeping part renderers pure. `Tripwire`, `Warning`, and `Error` are _replacement_ slots (rendered instead of the parts when `metadata.status` matches); `Task` is an _adjacent_ slot (rendered alongside the parts when a task-completion verdict exists). The factory only surfaces metadata to the slots and never filters it (for example, it still invokes `Task` when `suppressFeedback` is true) — the consumer decides what to render or skip. Existing behavior is unchanged when `status` is omitted.
91
+
92
+ ```tsx
93
+ <MessageFactory
94
+ message={message}
95
+ status={{
96
+ Error: ({ text }) => <ErrorNotice>{text}</ErrorNotice>,
97
+ Task: ({ passed, suppressFeedback }) => (suppressFeedback ? null : <TaskVerdict passed={passed} />),
98
+ }}
99
+ {...renderers}
100
+ />
101
+ ```
102
+
103
+ The narrowed part types used by the renderers are exported so consumers can type their own components: `TextPart`, `ReasoningPart`, `FilePart`, `StepStartPart`, `ToolInvocationPart`, `SourceDocumentPart`, and `SourceUrlPart`, plus `MessageFactoryPart` (the exact union of part shapes `MessageFactory` can dispatch — the typed accumulator parts plus the runtime-only `dynamic-tool` / `tool-${string}` parts) for typing part arrays precisely instead of `unknown[]`.
104
+
105
+ `MastraDBMessageMetadata.isTaskCompleteResult` is now typed as the `{ passed?, suppressFeedback? }` completion-verdict shape (matching `completionResult`) instead of `boolean`, so the `Task` slot resolves verdicts from either field without a cast.
106
+
107
+ `TripwireMetadata` is now an alias of core's `TripwirePayload`, and the message accumulator persists the canonical shape. Two behavioral changes to persisted `metadata.tripwire`:
108
+ - The tripwire `reason` is now persisted as `tripwire.reason` (previously it was only stored in the message text part).
109
+ - The processor metadata field was renamed from `tripwire.tripwirePayload` to `tripwire.metadata` to match the canonical type.
110
+
111
+ The `MessageFactory` `Tripwire` slot receives `reason` through `props.tripwire`.
112
+
113
+ **@mastra/core**
114
+
115
+ Exported the canonical `IsTaskCompletePayload` and `TripwirePayload` types from `@mastra/core/stream` so consumers can type their own task/completion and tripwire UI against them instead of redeclaring the shapes.
116
+
117
+ ```ts
118
+ import type { IsTaskCompletePayload, TripwirePayload } from '@mastra/core/stream';
119
+ ```
120
+
121
+ - Use the message-first client helper for user-authored thread input while preserving fallback behavior for older servers that only support the legacy signal route. ([#17238](https://github.com/mastra-ai/mastra/pull/17238))
122
+
123
+ ### Patch Changes
124
+
125
+ - Improved agent message, stream, and observational-memory type handling across the client SDKs and playground UI. ([#17208](https://github.com/mastra-ai/mastra/pull/17208))
126
+
127
+ - Updated dependencies [[`e17e5c1`](https://github.com/mastra-ai/mastra/commit/e17e5c1e1f6c7743d9e48ebce740e25cf4f897e0), [`d8a79af`](https://github.com/mastra-ai/mastra/commit/d8a79afe06a6352c90d0fb7bef0f394ad0af8eff), [`c973db4`](https://github.com/mastra-ai/mastra/commit/c973db428df1b564ff0c35d4b2a90e8f4f1e13fd), [`552285e`](https://github.com/mastra-ai/mastra/commit/552285e5af43cfc680a0972032cab8de8776c6a0), [`77e686c`](https://github.com/mastra-ai/mastra/commit/77e686c264e493e99ae5024e4dfe3ea5d5a09718), [`ece8dba`](https://github.com/mastra-ai/mastra/commit/ece8dba7ec1a5089eee8c33167cd762bfa91e509), [`e751af2`](https://github.com/mastra-ai/mastra/commit/e751af219433fbf4c7035b2d771b4c9ec8813b05), [`43dd577`](https://github.com/mastra-ai/mastra/commit/43dd577aa2b056b86b92cb903433f4fc13e69687), [`e2a8380`](https://github.com/mastra-ai/mastra/commit/e2a838017a7657850404c1e94c70d79ffdc6f14a), [`be3f1cd`](https://github.com/mastra-ai/mastra/commit/be3f1cd81f0e2a649e8eac15a024d542d814aef8), [`a34d9db`](https://github.com/mastra-ai/mastra/commit/a34d9dbc39fedb722f271318e9355ecee70489ab)]:
128
+ - @mastra/client-js@1.23.0-alpha.0
129
+ - @mastra/core@1.39.0-alpha.0
130
+
3
131
  ## 0.4.3
4
132
 
5
133
  ### Patch Changes
@@ -1,3 +1,10 @@
1
- import type { ExtendedMastraUIMessage } from '../lib/ai-sdk/index.js';
2
- export declare const extractRunIdFromMessages: (messages: ExtendedMastraUIMessage[]) => string | undefined;
1
+ import type { MastraDBMessage } from '@mastra/core/agent/message-list';
2
+ /**
3
+ * Scan initial DB-shape messages for any pending approvals, suspended tools, or
4
+ * `requireApprovalMetadata` entries and return the first non-empty `runId`.
5
+ *
6
+ * Metadata is read off `message.content.metadata`, the canonical location for
7
+ * MastraDBMessage UX hints.
8
+ */
9
+ export declare const extractRunIdFromMessages: (messages: MastraDBMessage[]) => string | undefined;
3
10
  //# sourceMappingURL=extractRunIdFromMessages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractRunIdFromMessages.d.ts","sourceRoot":"","sources":["../../src/agent/extractRunIdFromMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,eAAO,MAAM,wBAAwB,GAAI,UAAU,uBAAuB,EAAE,KAAG,MAAM,GAAG,SAyBvF,CAAC"}
1
+ {"version":3,"file":"extractRunIdFromMessages.d.ts","sourceRoot":"","sources":["../../src/agent/extractRunIdFromMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAyBvE;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,UAAU,eAAe,EAAE,KAAG,MAAM,GAAG,SAY/E,CAAC"}
@@ -1,16 +1,14 @@
1
- import type { UIMessage } from '@ai-sdk/react';
1
+ import type { MastraDBMessage } from '@mastra/core/agent/message-list';
2
2
  import type { CoreUserMessage } from '@mastra/core/llm';
3
3
  import type { TracingOptions } from '@mastra/core/observability';
4
4
  import type { RequestContext } from '@mastra/core/request-context';
5
5
  import type { ChunkType, NetworkChunkType } from '@mastra/core/stream';
6
- import type { MastraUIMessage } from '../lib/ai-sdk/index.js';
7
- import type { ModelSettings } from './types.js';
8
- type ToolsInput = any;
6
+ import type { ClientToolsInput, ModelSettings } from './types.js';
9
7
  export interface MastraChatProps {
10
8
  agentId: string;
11
9
  resourceId?: string;
12
10
  threadId?: string;
13
- initialMessages?: MastraUIMessage[];
11
+ initialMessages?: MastraDBMessage[];
14
12
  /** Persistent request context used for tool approval/decline calls (e.g. agentVersionId). */
15
13
  requestContext?: RequestContext;
16
14
  /**
@@ -18,7 +16,7 @@ export interface MastraChatProps {
18
16
  * the client-js subscription drives the full client-tool execution loop
19
17
  * (execute, emit tool-result, continuation) without any logic in React.
20
18
  */
21
- clientTools?: Record<string, unknown>;
19
+ clientTools?: ClientToolsInput;
22
20
  onSignalSent?: (signalId: string, preview: string) => void;
23
21
  onSignalEcho?: (signalId: string) => void;
24
22
  onThreadSignalsUnsupported?: () => void;
@@ -49,23 +47,23 @@ export type SendMessageArgs = {
49
47
  mode?: undefined;
50
48
  } & Omit<StreamArgs, 'coreUserMessages'>));
51
49
  export type GenerateArgs = SharedArgs & {
52
- onFinish?: (messages: UIMessage[]) => Promise<void>;
53
- clientTools?: ToolsInput;
50
+ onFinish?: (messages: MastraDBMessage[]) => Promise<void>;
51
+ clientTools?: ClientToolsInput;
54
52
  };
55
53
  export type StreamArgs = SharedArgs & {
56
54
  onChunk?: (chunk: ChunkType) => Promise<void>;
57
- clientTools?: ToolsInput;
55
+ clientTools?: ClientToolsInput;
58
56
  signalId?: string;
59
57
  };
60
58
  export type NetworkArgs = SharedArgs & {
61
59
  onNetworkChunk?: (chunk: NetworkChunkType) => Promise<void>;
62
60
  };
63
61
  export declare const useChat: ({ agentId, resourceId, threadId, initialMessages, requestContext: propsRequestContext, clientTools: hookClientTools, onSignalSent, onSignalEcho, onThreadSignalsUnsupported, enableThreadSignals, }: MastraChatProps) => {
64
- setMessages: import("react").Dispatch<import("react").SetStateAction<MastraUIMessage[]>>;
62
+ setMessages: import("react").Dispatch<import("react").SetStateAction<MastraDBMessage[]>>;
65
63
  sendMessage: ({ mode, ...args }: SendMessageArgs) => Promise<void>;
66
64
  isRunning: boolean;
67
65
  isAwaitingToolApproval: boolean;
68
- messages: MastraUIMessage[];
66
+ messages: MastraDBMessage[];
69
67
  approveToolCall: (toolCallId: string) => Promise<void>;
70
68
  declineToolCall: (toolCallId: string) => Promise<void>;
71
69
  approveToolCallGenerate: (toolCallId: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/agent/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BA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AAG,UAAU;;;CA60BxD,CAAC"}
@@ -1,3 +1,7 @@
1
+ import type { GenerateLegacyParams } from '@mastra/client-js';
2
+ import type { ToolsInput } from '@mastra/core/agent';
3
+ export type ClientToolsInput = ToolsInput;
4
+ export type ProviderOptionsInput = GenerateLegacyParams['providerOptions'];
1
5
  export interface ModelSettings {
2
6
  frequencyPenalty?: number;
3
7
  presencePenalty?: number;
@@ -8,7 +12,7 @@ export interface ModelSettings {
8
12
  topK?: number;
9
13
  topP?: number;
10
14
  instructions?: string;
11
- providerOptions?: Record<string, unknown>;
15
+ providerOptions?: ProviderOptionsInput;
12
16
  chatWithGenerate?: boolean;
13
17
  chatWithStream?: boolean;
14
18
  chatWithNetwork?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAA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