@mastra/ai-sdk 0.0.0-netlify-no-bundle-20251127120354 → 0.0.0-partial-response-backport-20251204204441

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.
@@ -1,16 +1,83 @@
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';
1
5
  /**
2
- * @deprecated Use `toAISdkStream` instead. This function has been renamed for clarity.
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
9
+ * with the AI SDK v5, enabling seamless integration with AI SDK's streaming capabilities.
10
+ *
11
+ *
12
+ * @param {MastraWorkflowStream | WorkflowRunOutput | MastraAgentNetworkStream | MastraModelOutput} stream
13
+ * The Mastra stream to convert. Can be one of:
14
+ * - MastraWorkflowStream: A workflow execution stream
15
+ * - WorkflowRunOutput: The output of a workflow run
16
+ * - MastraAgentNetworkStream: An agent network execution stream
17
+ * - MastraModelOutput: An agent model output stream
18
+ *
19
+ * @param {Object} options - Conversion options
20
+ * @param {'workflow' | 'network' | 'agent'} options.from - The type of stream being converted. Defaults to 'agent'
21
+ * @param {boolean} [options.includeTextStreamParts=true] - (Workflow only) Whether to include text stream parts from agent outputs. Defaults to true
22
+ * @param {string} [options.lastMessageId] - (Agent only) The ID of the last message in the conversation
23
+ * @param {boolean} [options.sendStart=true] - (Agent only) Whether to send start events. Defaults to true
24
+ * @param {boolean} [options.sendFinish=true] - (Agent only) Whether to send finish events. Defaults to true
25
+ * @param {boolean} [options.sendReasoning] - (Agent only) Whether to include reasoning in the output
26
+ * @param {boolean} [options.sendSources] - (Agent only) Whether to include sources in the output
27
+ * @param {Function} [options.messageMetadata] - (Agent only) A function that receives the current stream part and returns metadata to attach to start and finish chunks
28
+ * @param {Function} [options.onError] - (Agent only) A function to handle errors during stream conversion. Receives the error and should return a string representation
29
+ *
30
+ * @returns {ReadableStream<InferUIMessageChunk<UIMessage>>} A ReadableStream compatible with AI SDK v5
31
+ *
32
+ * @example
33
+ * // Convert a workflow stream
34
+ * const workflowStream = await workflowRun.stream(...);
35
+ * const aiSDKStream = toAISdkFormat(workflowStream, { from: 'workflow' });
36
+ *
37
+ * @example
38
+ * // Convert an agent network stream
39
+ * const networkStream = await agentNetwork.network(...);
40
+ * const aiSDKStream = toAISdkFormat(networkStream, { from: 'network' });
41
+ *
42
+ * @example
43
+ * // Convert an agent stream with custom options
44
+ * const agentStream = await agent.stream(...);
45
+ * const aiSDKStream = toAISdkFormat(agentStream, {
46
+ * from: 'agent',
47
+ * lastMessageId: 'msg-123',
48
+ * sendReasoning: true,
49
+ * sendSources: true
50
+ * });
3
51
  *
4
52
  * @example
5
- * ```typescript
6
- * // Old (deprecated):
7
- * import { toAISdkFormat } from '@mastra/ai-sdk';
8
- * const stream = toAISdkFormat(agentStream, { from: 'agent' });
9
- *
10
- * // New:
11
- * import { toAISdkStream } from '@mastra/ai-sdk';
12
- * const stream = toAISdkStream(agentStream, { from: 'agent' });
13
- * ```
53
+ * // Convert an agent stream with messageMetadata
54
+ * const aiSDKStream = toAISdkFormat(agentStream, {
55
+ * from: 'agent',
56
+ * messageMetadata: ({ part }) => ({
57
+ * timestamp: Date.now(),
58
+ * partType: part.type
59
+ * })
60
+ * });
14
61
  */
15
- export declare function toAISdkFormat(): never;
62
+ export declare function toAISdkFormat<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: {
63
+ from: 'workflow';
64
+ includeTextStreamParts?: boolean;
65
+ }): ReadableStream<InferUIMessageChunk<UIMessage>>;
66
+ export declare function toAISdkFormat<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: {
67
+ from: 'workflow';
68
+ includeTextStreamParts?: boolean;
69
+ }): ReadableStream<InferUIMessageChunk<UIMessage>>;
70
+ export declare function toAISdkFormat(stream: MastraAgentNetworkStream, options: {
71
+ from: 'network';
72
+ }): ReadableStream<InferUIMessageChunk<UIMessage>>;
73
+ export declare function toAISdkFormat<TOutput extends OutputSchema>(stream: MastraModelOutput<TOutput>, options: {
74
+ from: 'agent';
75
+ lastMessageId?: string;
76
+ sendStart?: boolean;
77
+ sendFinish?: boolean;
78
+ sendReasoning?: boolean;
79
+ sendSources?: boolean;
80
+ messageMetadata?: UIMessageStreamOptions<UIMessage>['messageMetadata'];
81
+ onError?: UIMessageStreamOptions<UIMessage>['onError'];
82
+ }): ReadableStream<InferUIMessageChunk<UIMessage>>;
16
83
  //# sourceMappingURL=to-ai-sdk-format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-ai-sdk-format.d.ts","sourceRoot":"","sources":["../src/to-ai-sdk-format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,KAAK,CASrC"}
1
+ {"version":3,"file":"to-ai-sdk-format.d.ts","sourceRoot":"","sources":["../src/to-ai-sdk-format.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,K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S,CAAC,CAAC,CAAC;AAClD,wBAAgB,aAAa,CAAC,OAAO,SAAS,YAAY,EACxD,MAAM,EAAE,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-route.d.ts","sourceRoot":"","sources":["../src/workflow-route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAcvD,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,GAAG,MAAM,cAAc,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7F;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,wBAAgB,aAAa,CAAC,EAC5B,IAA0C,EAC1C,QAAQ,EACR,sBAA6B,GAC9B,EAAE,oBAAoB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAsG5D"}
1
+ {"version":3,"file":"workflow-route.d.ts","sourceRoot":"","sources":["../src/workflow-route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAcvD,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,GAAG,MAAM,cAAc,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7F;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzE,wBAAgB,aAAa,CAAC,EAC5B,IAA0C,EAC1C,QAAQ,EACR,sBAA8B,GAC/B,EAAE,oBAAoB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAsG5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/ai-sdk",
3
- "version": "0.0.0-netlify-no-bundle-20251127120354",
3
+ "version": "0.0.0-partial-response-backport-20251204204441",
4
4
  "description": "Adds custom API routes to be compatible with the AI SDK UI parts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,16 +15,6 @@
15
15
  "default": "./dist/index.cjs"
16
16
  }
17
17
  },
18
- "./ui": {
19
- "import": {
20
- "types": "./dist/ui.d.ts",
21
- "default": "./dist/ui.js"
22
- },
23
- "require": {
24
- "types": "./dist/ui.d.ts",
25
- "default": "./dist/ui.cjs"
26
- }
27
- },
28
18
  "./package.json": "./package.json"
29
19
  },
30
20
  "files": [
@@ -33,20 +23,18 @@
33
23
  ],
34
24
  "peerDependencies": {
35
25
  "zod": "^3.25.0 || ^4.0.0",
36
- "@mastra/core": "0.0.0-netlify-no-bundle-20251127120354"
26
+ "@mastra/core": "0.0.0-partial-response-backport-20251204204441"
37
27
  },
38
28
  "devDependencies": {
39
29
  "@types/json-schema": "^7.0.15",
40
- "@vitest/coverage-v8": "4.0.12",
41
- "@vitest/ui": "4.0.12",
42
30
  "eslint": "^9.37.0",
43
31
  "tsup": "^8.5.0",
44
32
  "typescript": "^5.8.3",
45
- "vitest": "4.0.12",
33
+ "vitest": "^3.2.4",
46
34
  "zod": "^3.25.76",
47
- "@internal/lint": "0.0.0-netlify-no-bundle-20251127120354",
48
- "@mastra/core": "0.0.0-netlify-no-bundle-20251127120354",
49
- "@internal/types-builder": "0.0.0-netlify-no-bundle-20251127120354"
35
+ "@internal/lint": "0.0.0-partial-response-backport-20251204204441",
36
+ "@internal/types-builder": "0.0.0-partial-response-backport-20251204204441",
37
+ "@mastra/core": "0.0.0-partial-response-backport-20251204204441"
50
38
  },
51
39
  "keywords": [
52
40
  "mastra",
@@ -66,8 +54,12 @@
66
54
  "dependencies": {
67
55
  "ai": "^5.0.60"
68
56
  },
69
- "engines": {
70
- "node": ">=22.13.0"
57
+ "publishConfig": {
58
+ "access": "public",
59
+ "publish-branch": [
60
+ "main",
61
+ "0.x"
62
+ ]
71
63
  },
72
64
  "scripts": {
73
65
  "lint": "eslint .",
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,82 +0,0 @@
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
9
- * with the AI SDK v5, enabling seamless integration with AI SDK's streaming capabilities.
10
- *
11
- *
12
- * @param {MastraWorkflowStream | WorkflowRunOutput | MastraAgentNetworkStream | MastraModelOutput} stream
13
- * The Mastra stream to convert. Can be one of:
14
- * - MastraWorkflowStream: A workflow execution stream
15
- * - WorkflowRunOutput: The output of a workflow run
16
- * - MastraAgentNetworkStream: An agent network execution stream
17
- * - MastraModelOutput: An agent model output stream
18
- *
19
- * @param {Object} options - Conversion options
20
- * @param {'workflow' | 'network' | 'agent'} options.from - The type of stream being converted. Defaults to 'agent'
21
- * @param {string} [options.lastMessageId] - (Agent only) The ID of the last message in the conversation
22
- * @param {boolean} [options.sendStart=true] - (Agent only) Whether to send start events. Defaults to true
23
- * @param {boolean} [options.sendFinish=true] - (Agent only) Whether to send finish events. Defaults to true
24
- * @param {boolean} [options.sendReasoning] - (Agent only) Whether to include reasoning in the output
25
- * @param {boolean} [options.sendSources] - (Agent only) Whether to include sources in the output
26
- * @param {Function} [options.messageMetadata] - (Agent only) A function that receives the current stream part and returns metadata to attach to start and finish chunks
27
- * @param {Function} [options.onError] - (Agent only) A function to handle errors during stream conversion. Receives the error and should return a string representation
28
- *
29
- * @returns {ReadableStream<InferUIMessageChunk<UIMessage>>} A ReadableStream compatible with AI SDK v5
30
- *
31
- * @example
32
- * // Convert a workflow stream
33
- * const workflowStream = await workflowRun.stream(...);
34
- * const aiSDKStream = toAISdkV5Stream(workflowStream, { from: 'workflow' });
35
- *
36
- * @example
37
- * // Convert an agent network stream
38
- * const networkStream = await agentNetwork.network(...);
39
- * const aiSDKStream = toAISdkV5Stream(networkStream, { from: 'network' });
40
- *
41
- * @example
42
- * // Convert an agent stream with custom options
43
- * const agentStream = await agent.stream(...);
44
- * const aiSDKStream = toAISdkV5Stream(agentStream, {
45
- * from: 'agent',
46
- * lastMessageId: 'msg-123',
47
- * sendReasoning: true,
48
- * sendSources: true
49
- * });
50
- *
51
- * @example
52
- * // Convert an agent stream with messageMetadata
53
- * const aiSDKStream = toAISdkV5Stream(agentStream, {
54
- * from: 'agent',
55
- * messageMetadata: ({ part }) => ({
56
- * timestamp: Date.now(),
57
- * partType: part.type
58
- * })
59
- * });
60
- */
61
- 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: {
62
- from: 'workflow';
63
- includeTextStreamParts?: boolean;
64
- }): ReadableStream<InferUIMessageChunk<UIMessage>>;
65
- 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: {
66
- from: 'workflow';
67
- includeTextStreamParts?: boolean;
68
- }): ReadableStream<InferUIMessageChunk<UIMessage>>;
69
- export declare function toAISdkV5Stream(stream: MastraAgentNetworkStream, options: {
70
- from: 'network';
71
- }): ReadableStream<InferUIMessageChunk<UIMessage>>;
72
- export declare function toAISdkV5Stream<TOutput extends OutputSchema>(stream: MastraModelOutput<TOutput>, options: {
73
- from: 'agent';
74
- lastMessageId?: string;
75
- sendStart?: boolean;
76
- sendFinish?: boolean;
77
- sendReasoning?: boolean;
78
- sendSources?: boolean;
79
- messageMetadata?: UIMessageStreamOptions<UIMessage>['messageMetadata'];
80
- onError?: UIMessageStreamOptions<UIMessage>['onError'];
81
- }): ReadableStream<InferUIMessageChunk<UIMessage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AG,CAAC,EAAE,EACtD,MAAM,SAAS,SAAS,CAAC,GAAG,CAAC,EAE7B,MAAM,EAAE,iBAAiB,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,EAC1E,OAAO,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,sBAAsB,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9D,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;AAClD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,wBAAwB,EAChC,OAAO,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GAC3B,cAAc,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;AAClD,wBAAgB,eAAe,CAAC,OAAO,SAAS,YAAY,EAC1D,MAAM,EAAE,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/ui.cjs DELETED
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var messageList = require('@mastra/core/agent/message-list');
4
-
5
- // src/convert-messages.ts
6
- function toAISdkV5Messages(messages) {
7
- return new messageList.MessageList().add(messages, `memory`).get.all.aiV5.ui();
8
- }
9
- function toAISdkV4Messages(messages) {
10
- return new messageList.MessageList().add(messages, `memory`).get.all.aiV4.ui();
11
- }
12
-
13
- exports.toAISdkV4Messages = toAISdkV4Messages;
14
- exports.toAISdkV5Messages = toAISdkV5Messages;
15
- //# sourceMappingURL=ui.cjs.map
16
- //# sourceMappingURL=ui.cjs.map
package/dist/ui.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/convert-messages.ts"],"names":["MessageList"],"mappings":";;;;;AAMO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,IAAIA,uBAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAG;AACnE;AAKO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,IAAIA,uBAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAG;AACnE","file":"ui.cjs","sourcesContent":["import { MessageList } from '@mastra/core/agent/message-list';\nimport type { MessageListInput } from '@mastra/core/agent/message-list';\n\n/**\n * Converts messages to AI SDK V5 UI format\n */\nexport function toAISdkV5Messages(messages: MessageListInput) {\n return new MessageList().add(messages, `memory`).get.all.aiV5.ui();\n}\n\n/**\n * Converts messages to AI SDK V4 UI format\n */\nexport function toAISdkV4Messages(messages: MessageListInput) {\n return new MessageList().add(messages, `memory`).get.all.aiV4.ui();\n}\n"]}
package/dist/ui.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { toAISdkV5Messages, toAISdkV4Messages } from './convert-messages.js';
2
- //# sourceMappingURL=ui.d.ts.map
package/dist/ui.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/ui.js DELETED
@@ -1,13 +0,0 @@
1
- import { MessageList } from '@mastra/core/agent/message-list';
2
-
3
- // src/convert-messages.ts
4
- function toAISdkV5Messages(messages) {
5
- return new MessageList().add(messages, `memory`).get.all.aiV5.ui();
6
- }
7
- function toAISdkV4Messages(messages) {
8
- return new MessageList().add(messages, `memory`).get.all.aiV4.ui();
9
- }
10
-
11
- export { toAISdkV4Messages, toAISdkV5Messages };
12
- //# sourceMappingURL=ui.js.map
13
- //# sourceMappingURL=ui.js.map
package/dist/ui.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/convert-messages.ts"],"names":[],"mappings":";;;AAMO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,IAAI,WAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAG;AACnE;AAKO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,IAAI,WAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,QAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAG;AACnE","file":"ui.js","sourcesContent":["import { MessageList } from '@mastra/core/agent/message-list';\nimport type { MessageListInput } from '@mastra/core/agent/message-list';\n\n/**\n * Converts messages to AI SDK V5 UI format\n */\nexport function toAISdkV5Messages(messages: MessageListInput) {\n return new MessageList().add(messages, `memory`).get.all.aiV5.ui();\n}\n\n/**\n * Converts messages to AI SDK V4 UI format\n */\nexport function toAISdkV4Messages(messages: MessageListInput) {\n return new MessageList().add(messages, `memory`).get.all.aiV4.ui();\n}\n"]}