@mastra/ai-sdk 1.4.1-alpha.2 → 1.4.2-alpha.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.
- package/CHANGELOG.md +26 -0
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +425 -1757
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +311 -1772
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.cjs +895 -440
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +895 -440
- package/dist/index.js.map +1 -1
- package/dist/ui.cjs +1 -0
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.js +1 -0
- package/dist/ui.js.map +1 -1
- package/package.json +14 -14
- package/dist/chunk-3YJ25IUJ.js +0 -79
- package/dist/chunk-3YJ25IUJ.js.map +0 -1
- package/dist/chunk-DGUM43GV.js +0 -10
- package/dist/chunk-DGUM43GV.js.map +0 -1
- package/dist/chunk-HDI4ZP7N.js +0 -79
- package/dist/chunk-HDI4ZP7N.js.map +0 -1
- package/dist/chunk-HMOX24BQ.js +0 -439
- package/dist/chunk-HMOX24BQ.js.map +0 -1
- package/dist/chunk-IV3RKEE4.js +0 -439
- package/dist/chunk-IV3RKEE4.js.map +0 -1
- package/dist/chunk-JEQ2X3Z6.cjs +0 -12
- package/dist/chunk-JEQ2X3Z6.cjs.map +0 -1
- package/dist/chunk-PEZAMDZJ.cjs +0 -84
- package/dist/chunk-PEZAMDZJ.cjs.map +0 -1
- package/dist/chunk-VJW66KXQ.cjs +0 -441
- package/dist/chunk-VJW66KXQ.cjs.map +0 -1
- package/dist/chunk-WFARZCDO.cjs +0 -84
- package/dist/chunk-WFARZCDO.cjs.map +0 -1
- package/dist/chunk-X72VW7EY.cjs +0 -441
- package/dist/chunk-X72VW7EY.cjs.map +0 -1
- package/dist/token-APYSY3BW-CBIBV5F2.js +0 -61
- package/dist/token-APYSY3BW-CBIBV5F2.js.map +0 -1
- package/dist/token-APYSY3BW-INR55PKP.js +0 -61
- package/dist/token-APYSY3BW-INR55PKP.js.map +0 -1
- package/dist/token-APYSY3BW-M2K6HVOG.cjs +0 -63
- package/dist/token-APYSY3BW-M2K6HVOG.cjs.map +0 -1
- package/dist/token-APYSY3BW-Y5VD4L7Z.cjs +0 -63
- package/dist/token-APYSY3BW-Y5VD4L7Z.cjs.map +0 -1
- package/dist/token-util-RMHT2CPJ-3LCBPXJ6.cjs +0 -10
- package/dist/token-util-RMHT2CPJ-3LCBPXJ6.cjs.map +0 -1
- package/dist/token-util-RMHT2CPJ-4YTBAZ23.cjs +0 -10
- package/dist/token-util-RMHT2CPJ-4YTBAZ23.cjs.map +0 -1
- package/dist/token-util-RMHT2CPJ-HCMQIDTV.js +0 -8
- package/dist/token-util-RMHT2CPJ-HCMQIDTV.js.map +0 -1
- package/dist/token-util-RMHT2CPJ-IOKQM5O3.js +0 -8
- package/dist/token-util-RMHT2CPJ-IOKQM5O3.js.map +0 -1
package/dist/ui.cjs
CHANGED
package/dist/ui.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/convert-messages.ts"],"names":["MessageList"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/convert-messages.ts"],"names":["MessageList"],"mappings":";;;;;AAIA,SAAS,0BAA0B,OAAA,EAKhC;AAED,EAAA,IAAI,OAAA,CAAQ,QAAA,EAAU,cAAA,IAAkB,OAAA,CAAQ,UAAU,uBAAA,EAAyB;AACjF,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI,OAAA,CAAQ,SAAS,MAAA,EAAQ;AAC3B,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChC,IAAA,OAAO,QAAQ,KAAA,CAAM,IAAA;AAAA,MACnB,CAAA,IAAA,KAAQ,IAAA,CAAK,IAAA,KAAS,MAAA,IAAU,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,IAAY,IAAA,CAAK,IAAA,CAAK,QAAA,CAAS,kBAAkB;AAAA,KACxG;AAAA,EACF;AAEA,EAAA,OAAO,OAAO,OAAA,CAAQ,OAAA,KAAY,YAAY,OAAA,CAAQ,OAAA,CAAQ,SAAS,kBAAkB,CAAA;AAC3F;AAEA,SAAS,+BAEP,QAAA,EAAoB;AACpB,EAAA,OAAO,SAAS,MAAA,CAAO,CAAA,OAAA,KAAW,CAAC,yBAAA,CAA0B,OAAO,CAAC,CAAA;AACvE;AA8CO,SAAS,eAAA,CACd,QAAA,EACA,OAAA,GAAoC,EAAC,EACN;AAC/B,EAAA,MAAM,OAAO,IAAIA,uBAAA,EAAY,CAAE,GAAA,CAAI,UAAU,CAAA,MAAA,CAAQ,CAAA;AACrD,EAAA,IAAI,OAAA,CAAQ,YAAY,IAAA,EAAM;AAC5B,IAAA,OAAO,+BAA+B,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAAA,EAC9D;AACA,EAAA,OAAO,+BAA+B,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAC9D;AA2CO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,8BAAA,CAA+B,eAAA,CAAgB,QAAQ,CAAC,CAAA;AACjE;AA+CO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,8BAAA,CAA+B,IAAIA,uBAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,CAAA,MAAA,CAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,CAAA;AACnG","file":"ui.cjs","sourcesContent":["import { MessageList } from '@mastra/core/agent/message-list';\nimport type { MessageListInput } from '@mastra/core/agent/message-list';\nimport type { V5UIMessage, V6UIMessage } from './public-types';\n\nfunction isSystemReminderUIMessage(message: {\n role?: string;\n parts?: Array<{ type?: string; text?: string }>;\n content?: unknown;\n metadata?: Record<string, unknown>;\n}) {\n // Check metadata first — processors stamp systemReminder or legacy dynamicAgentsMdReminder\n if (message.metadata?.systemReminder || message.metadata?.dynamicAgentsMdReminder) {\n return true;\n }\n\n if (message.role !== 'user') {\n return false;\n }\n\n // Fall back to text inspection for backward compatibility\n if (Array.isArray(message.parts)) {\n return message.parts.some(\n part => part.type === 'text' && typeof part.text === 'string' && part.text.includes('<system-reminder'),\n );\n }\n\n return typeof message.content === 'string' && message.content.includes('<system-reminder');\n}\n\nfunction filterSystemReminderUIMessages<\n T extends { role?: string; parts?: Array<{ type?: string; text?: string }>; content?: unknown },\n>(messages: T[]): T[] {\n return messages.filter(message => !isSystemReminderUIMessage(message));\n}\n\ntype MessageConversionOptionsV5 = {\n version?: 'v5';\n};\n\ntype MessageConversionOptionsV6 = {\n version: 'v6';\n};\n\ntype MessageConversionOptions = MessageConversionOptionsV5 | MessageConversionOptionsV6;\n\n/**\n * Converts messages from various input formats to AI SDK UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5/V6 messages, Mastra DB messages, etc.)\n * and normalizes them to the AI SDK UIMessage format. It keeps the existing AI SDK v5/default behavior. If your app\n * is typed against AI SDK v6, pass `version: 'v6'`.\n *\n * Note: `version: 'v6'` uses the MessageList AI SDK v6 UI output path. MessageList input detection and ingestion\n * remain unchanged.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n * @param options - Conversion options. Omit or pass `{ version: 'v5' }` for the existing default behavior. Pass\n * `{ version: 'v6' }` when your app is typed against AI SDK v6 `useChat()` message types.\n *\n * @returns An array of AI SDK UIMessage objects typed for the selected version.\n *\n * @example\n * ```typescript\n * import { toAISdkMessages } from '@mastra/ai-sdk/ui';\n *\n * const v5Messages = toAISdkMessages(storedMessages);\n * const v6Messages = toAISdkMessages(storedMessages, { version: 'v6' });\n * ```\n */\nexport function toAISdkMessages(messages: MessageListInput, options?: MessageConversionOptionsV5): V5UIMessage[];\nexport function toAISdkMessages(messages: MessageListInput, options: MessageConversionOptionsV6): V6UIMessage[];\nexport function toAISdkMessages(\n messages: MessageListInput,\n options: MessageConversionOptions = {},\n): V5UIMessage[] | V6UIMessage[] {\n const list = new MessageList().add(messages, `memory`);\n if (options.version === 'v6') {\n return filterSystemReminderUIMessages(list.get.all.aiV6.ui());\n }\n return filterSystemReminderUIMessages(list.get.all.aiV5.ui());\n}\n\n/**\n * Converts messages from various input formats to AI SDK V5 UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V5 UIMessage format, which is suitable for use with AI SDK V5 UI components like `useChat()`.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n *\n * @returns An array of AI SDK V5 UIMessage objects with:\n * - `id` - Unique message identifier\n * - `role` - 'user' | 'assistant' | 'system'\n * - `parts` - Array of UI parts (text, tool results, files, reasoning, etc.)\n * - `metadata` - Optional metadata including createdAt, threadId, resourceId\n *\n * @example\n * ```typescript\n * import { toAISdkV5Messages } from '@mastra/ai-sdk';\n *\n * // Convert simple text messages\n * const messages = toAISdkV5Messages(['Hello', 'How can I help?']);\n *\n * // Convert AI SDK V4 messages to V5 format\n * const v4Messages = [\n * { id: '1', role: 'user', content: 'Hello', parts: [{ type: 'text', text: 'Hello' }] },\n * { id: '2', role: 'assistant', content: 'Hi!', parts: [{ type: 'text', text: 'Hi!' }] }\n * ];\n * const v5Messages = toAISdkV5Messages(v4Messages);\n *\n * // Use with useChat or similar AI SDK V5 hooks\n * const { messages: chatMessages } = useChat({\n * initialMessages: toAISdkV5Messages(storedMessages)\n * });\n * ```\n */\nexport function toAISdkV5Messages(messages: MessageListInput) {\n return filterSystemReminderUIMessages(toAISdkMessages(messages));\n}\n\n/**\n * Converts messages from various input formats to AI SDK V4 UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V4 UIMessage format, which is suitable for use with AI SDK V4 UI components.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n *\n * @returns An array of AI SDK V4 UIMessage objects with:\n * - `id` - Unique message identifier\n * - `role` - 'user' | 'assistant' | 'system'\n * - `content` - Text content of the message\n * - `parts` - Array of UI parts (text, tool-invocation, file, reasoning, etc.)\n * - `createdAt` - Message creation timestamp\n * - `toolInvocations` - Optional array of tool invocations (for assistant messages)\n * - `experimental_attachments` - Optional file attachments\n * - `metadata` - Optional custom metadata\n *\n * @example\n * ```typescript\n * import { toAISdkV4Messages } from '@mastra/ai-sdk';\n *\n * // Convert simple text messages\n * const messages = toAISdkV4Messages(['Hello', 'How can I help?']);\n *\n * // Convert AI SDK V5 messages to V4 format for legacy compatibility\n * const v5Messages = [\n * { id: '1', role: 'user', parts: [{ type: 'text', text: 'Hello' }] },\n * { id: '2', role: 'assistant', parts: [{ type: 'text', text: 'Hi!' }] }\n * ];\n * const v4Messages = toAISdkV4Messages(v5Messages);\n *\n * // Use with AI SDK V4 useChat hook\n * const { messages: chatMessages } = useChat({\n * initialMessages: toAISdkV4Messages(storedMessages)\n * });\n * ```\n */\nexport function toAISdkV4Messages(messages: MessageListInput) {\n return filterSystemReminderUIMessages(new MessageList().add(messages, `memory`).get.all.aiV4.ui());\n}\n"]}
|
package/dist/ui.js
CHANGED
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/convert-messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/convert-messages.ts"],"names":[],"mappings":";;;AAIA,SAAS,0BAA0B,OAAA,EAKhC;AAED,EAAA,IAAI,OAAA,CAAQ,QAAA,EAAU,cAAA,IAAkB,OAAA,CAAQ,UAAU,uBAAA,EAAyB;AACjF,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI,OAAA,CAAQ,SAAS,MAAA,EAAQ;AAC3B,IAAA,OAAO,KAAA;AAAA,EACT;AAGA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChC,IAAA,OAAO,QAAQ,KAAA,CAAM,IAAA;AAAA,MACnB,CAAA,IAAA,KAAQ,IAAA,CAAK,IAAA,KAAS,MAAA,IAAU,OAAO,IAAA,CAAK,IAAA,KAAS,QAAA,IAAY,IAAA,CAAK,IAAA,CAAK,QAAA,CAAS,kBAAkB;AAAA,KACxG;AAAA,EACF;AAEA,EAAA,OAAO,OAAO,OAAA,CAAQ,OAAA,KAAY,YAAY,OAAA,CAAQ,OAAA,CAAQ,SAAS,kBAAkB,CAAA;AAC3F;AAEA,SAAS,+BAEP,QAAA,EAAoB;AACpB,EAAA,OAAO,SAAS,MAAA,CAAO,CAAA,OAAA,KAAW,CAAC,yBAAA,CAA0B,OAAO,CAAC,CAAA;AACvE;AA8CO,SAAS,eAAA,CACd,QAAA,EACA,OAAA,GAAoC,EAAC,EACN;AAC/B,EAAA,MAAM,OAAO,IAAI,WAAA,EAAY,CAAE,GAAA,CAAI,UAAU,CAAA,MAAA,CAAQ,CAAA;AACrD,EAAA,IAAI,OAAA,CAAQ,YAAY,IAAA,EAAM;AAC5B,IAAA,OAAO,+BAA+B,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAAA,EAC9D;AACA,EAAA,OAAO,+BAA+B,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAC9D;AA2CO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,8BAAA,CAA+B,eAAA,CAAgB,QAAQ,CAAC,CAAA;AACjE;AA+CO,SAAS,kBAAkB,QAAA,EAA4B;AAC5D,EAAA,OAAO,8BAAA,CAA+B,IAAI,WAAA,EAAY,CAAE,GAAA,CAAI,QAAA,EAAU,CAAA,MAAA,CAAQ,CAAA,CAAE,GAAA,CAAI,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,CAAA;AACnG","file":"ui.js","sourcesContent":["import { MessageList } from '@mastra/core/agent/message-list';\nimport type { MessageListInput } from '@mastra/core/agent/message-list';\nimport type { V5UIMessage, V6UIMessage } from './public-types';\n\nfunction isSystemReminderUIMessage(message: {\n role?: string;\n parts?: Array<{ type?: string; text?: string }>;\n content?: unknown;\n metadata?: Record<string, unknown>;\n}) {\n // Check metadata first — processors stamp systemReminder or legacy dynamicAgentsMdReminder\n if (message.metadata?.systemReminder || message.metadata?.dynamicAgentsMdReminder) {\n return true;\n }\n\n if (message.role !== 'user') {\n return false;\n }\n\n // Fall back to text inspection for backward compatibility\n if (Array.isArray(message.parts)) {\n return message.parts.some(\n part => part.type === 'text' && typeof part.text === 'string' && part.text.includes('<system-reminder'),\n );\n }\n\n return typeof message.content === 'string' && message.content.includes('<system-reminder');\n}\n\nfunction filterSystemReminderUIMessages<\n T extends { role?: string; parts?: Array<{ type?: string; text?: string }>; content?: unknown },\n>(messages: T[]): T[] {\n return messages.filter(message => !isSystemReminderUIMessage(message));\n}\n\ntype MessageConversionOptionsV5 = {\n version?: 'v5';\n};\n\ntype MessageConversionOptionsV6 = {\n version: 'v6';\n};\n\ntype MessageConversionOptions = MessageConversionOptionsV5 | MessageConversionOptionsV6;\n\n/**\n * Converts messages from various input formats to AI SDK UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5/V6 messages, Mastra DB messages, etc.)\n * and normalizes them to the AI SDK UIMessage format. It keeps the existing AI SDK v5/default behavior. If your app\n * is typed against AI SDK v6, pass `version: 'v6'`.\n *\n * Note: `version: 'v6'` uses the MessageList AI SDK v6 UI output path. MessageList input detection and ingestion\n * remain unchanged.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n * @param options - Conversion options. Omit or pass `{ version: 'v5' }` for the existing default behavior. Pass\n * `{ version: 'v6' }` when your app is typed against AI SDK v6 `useChat()` message types.\n *\n * @returns An array of AI SDK UIMessage objects typed for the selected version.\n *\n * @example\n * ```typescript\n * import { toAISdkMessages } from '@mastra/ai-sdk/ui';\n *\n * const v5Messages = toAISdkMessages(storedMessages);\n * const v6Messages = toAISdkMessages(storedMessages, { version: 'v6' });\n * ```\n */\nexport function toAISdkMessages(messages: MessageListInput, options?: MessageConversionOptionsV5): V5UIMessage[];\nexport function toAISdkMessages(messages: MessageListInput, options: MessageConversionOptionsV6): V6UIMessage[];\nexport function toAISdkMessages(\n messages: MessageListInput,\n options: MessageConversionOptions = {},\n): V5UIMessage[] | V6UIMessage[] {\n const list = new MessageList().add(messages, `memory`);\n if (options.version === 'v6') {\n return filterSystemReminderUIMessages(list.get.all.aiV6.ui());\n }\n return filterSystemReminderUIMessages(list.get.all.aiV5.ui());\n}\n\n/**\n * Converts messages from various input formats to AI SDK V5 UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V5 UIMessage format, which is suitable for use with AI SDK V5 UI components like `useChat()`.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n *\n * @returns An array of AI SDK V5 UIMessage objects with:\n * - `id` - Unique message identifier\n * - `role` - 'user' | 'assistant' | 'system'\n * - `parts` - Array of UI parts (text, tool results, files, reasoning, etc.)\n * - `metadata` - Optional metadata including createdAt, threadId, resourceId\n *\n * @example\n * ```typescript\n * import { toAISdkV5Messages } from '@mastra/ai-sdk';\n *\n * // Convert simple text messages\n * const messages = toAISdkV5Messages(['Hello', 'How can I help?']);\n *\n * // Convert AI SDK V4 messages to V5 format\n * const v4Messages = [\n * { id: '1', role: 'user', content: 'Hello', parts: [{ type: 'text', text: 'Hello' }] },\n * { id: '2', role: 'assistant', content: 'Hi!', parts: [{ type: 'text', text: 'Hi!' }] }\n * ];\n * const v5Messages = toAISdkV5Messages(v4Messages);\n *\n * // Use with useChat or similar AI SDK V5 hooks\n * const { messages: chatMessages } = useChat({\n * initialMessages: toAISdkV5Messages(storedMessages)\n * });\n * ```\n */\nexport function toAISdkV5Messages(messages: MessageListInput) {\n return filterSystemReminderUIMessages(toAISdkMessages(messages));\n}\n\n/**\n * Converts messages from various input formats to AI SDK V4 UI message format.\n *\n * This function accepts messages in multiple formats (strings, AI SDK V4/V5 messages, Mastra DB messages, etc.) and normalizes them to the AI SDK V4 UIMessage format, which is suitable for use with AI SDK V4 UI components.\n *\n * @param messages - Messages to convert. Accepts:\n * - `string` - A single text message (treated as user role)\n * - `string[]` - Multiple text messages\n * - `MessageInput` - A single message object in any supported format:\n * - AI SDK V5 UIMessage or ModelMessage\n * - AI SDK V4 UIMessage or CoreMessage\n * - MastraDBMessage (internal storage format)\n * - MastraMessageV1 (legacy format)\n * - `MessageInput[]` - Array of message objects\n *\n * @returns An array of AI SDK V4 UIMessage objects with:\n * - `id` - Unique message identifier\n * - `role` - 'user' | 'assistant' | 'system'\n * - `content` - Text content of the message\n * - `parts` - Array of UI parts (text, tool-invocation, file, reasoning, etc.)\n * - `createdAt` - Message creation timestamp\n * - `toolInvocations` - Optional array of tool invocations (for assistant messages)\n * - `experimental_attachments` - Optional file attachments\n * - `metadata` - Optional custom metadata\n *\n * @example\n * ```typescript\n * import { toAISdkV4Messages } from '@mastra/ai-sdk';\n *\n * // Convert simple text messages\n * const messages = toAISdkV4Messages(['Hello', 'How can I help?']);\n *\n * // Convert AI SDK V5 messages to V4 format for legacy compatibility\n * const v5Messages = [\n * { id: '1', role: 'user', parts: [{ type: 'text', text: 'Hello' }] },\n * { id: '2', role: 'assistant', parts: [{ type: 'text', text: 'Hi!' }] }\n * ];\n * const v4Messages = toAISdkV4Messages(v5Messages);\n *\n * // Use with AI SDK V4 useChat hook\n * const { messages: chatMessages } = useChat({\n * initialMessages: toAISdkV4Messages(storedMessages)\n * });\n * ```\n */\nexport function toAISdkV4Messages(messages: MessageListInput) {\n return filterSystemReminderUIMessages(new MessageList().add(messages, `memory`).get.all.aiV4.ui());\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/ai-sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2-alpha.0",
|
|
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",
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
"zod": "^3.25.0 || ^4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@ai-sdk/provider": "^2.0.
|
|
40
|
+
"@ai-sdk/provider": "^2.0.3",
|
|
41
41
|
"@types/json-schema": "^7.0.15",
|
|
42
|
-
"@vitest/coverage-v8": "4.1.
|
|
43
|
-
"@vitest/ui": "4.1.
|
|
42
|
+
"@vitest/coverage-v8": "4.1.5",
|
|
43
|
+
"@vitest/ui": "4.1.5",
|
|
44
44
|
"eslint": "^10.2.1",
|
|
45
45
|
"tsup": "^8.5.1",
|
|
46
|
-
"typescript": "^
|
|
47
|
-
"vitest": "4.1.
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
|
+
"vitest": "4.1.5",
|
|
48
48
|
"zod": "^4.3.6",
|
|
49
|
-
"@internal/ai-sdk-v4": "0.0.
|
|
50
|
-
"@internal/
|
|
51
|
-
"@internal/ai-
|
|
52
|
-
"@internal/
|
|
53
|
-
"@mastra/
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@mastra/
|
|
49
|
+
"@internal/ai-sdk-v4": "0.0.39",
|
|
50
|
+
"@internal/lint": "0.0.92",
|
|
51
|
+
"@internal/ai-sdk-v5": "0.0.39",
|
|
52
|
+
"@internal/types-builder": "0.0.67",
|
|
53
|
+
"@mastra/core": "1.33.0-alpha.7",
|
|
54
|
+
"@internal/ai-v6": "0.0.39",
|
|
55
|
+
"@mastra/memory": "1.18.0-alpha.2",
|
|
56
|
+
"@mastra/libsql": "1.10.1-alpha.1"
|
|
57
57
|
},
|
|
58
58
|
"keywords": [
|
|
59
59
|
"mastra",
|
package/dist/chunk-3YJ25IUJ.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { __require } from './chunk-DGUM43GV.js';
|
|
2
|
-
|
|
3
|
-
// ../../packages/_vendored/ai_v5/dist/chunk-7D4SUZUM.js
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
-
get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
|
|
12
|
-
}) : x)(function(x) {
|
|
13
|
-
if (typeof __require !== "undefined") return __require.apply(this, arguments);
|
|
14
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
-
});
|
|
16
|
-
var __commonJS = (cb, mod) => function __require22() {
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
-
mod
|
|
34
|
-
));
|
|
35
|
-
|
|
36
|
-
// ../../packages/_vendored/ai_v5/dist/chunk-QOME2VME.js
|
|
37
|
-
var require_token_error = __commonJS({
|
|
38
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js"(exports$1, module) {
|
|
39
|
-
var __defProp2 = Object.defineProperty;
|
|
40
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
41
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
42
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
43
|
-
var __export = (target, all) => {
|
|
44
|
-
for (var name in all)
|
|
45
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
46
|
-
};
|
|
47
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
48
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
49
|
-
for (let key of __getOwnPropNames2(from))
|
|
50
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
51
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
52
|
-
}
|
|
53
|
-
return to;
|
|
54
|
-
};
|
|
55
|
-
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
56
|
-
var token_error_exports = {};
|
|
57
|
-
__export(token_error_exports, {
|
|
58
|
-
VercelOidcTokenError: () => VercelOidcTokenError
|
|
59
|
-
});
|
|
60
|
-
module.exports = __toCommonJS(token_error_exports);
|
|
61
|
-
var VercelOidcTokenError = class extends Error {
|
|
62
|
-
constructor(message, cause) {
|
|
63
|
-
super(message);
|
|
64
|
-
this.name = "VercelOidcTokenError";
|
|
65
|
-
this.cause = cause;
|
|
66
|
-
}
|
|
67
|
-
toString() {
|
|
68
|
-
if (this.cause) {
|
|
69
|
-
return `${this.name}: ${this.message}: ${this.cause}`;
|
|
70
|
-
}
|
|
71
|
-
return `${this.name}: ${this.message}`;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export { __commonJS, __require2 as __require, __toESM, require_token_error };
|
|
78
|
-
//# sourceMappingURL=chunk-3YJ25IUJ.js.map
|
|
79
|
-
//# sourceMappingURL=chunk-3YJ25IUJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/_vendored/ai_v5/dist/chunk-7D4SUZUM.js","../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js"],"names":["__require","__require2","exports","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__copyProps"],"mappings":";;;AAAA,IAAI,WAAW,MAAA,CAAO,MAAA;AACtB,IAAI,YAAY,MAAA,CAAO,cAAA;AACvB,IAAI,mBAAmB,MAAA,CAAO,wBAAA;AAC9B,IAAI,oBAAoB,MAAA,CAAO,mBAAA;AAC/B,IAAI,eAAe,MAAA,CAAO,cAAA;AAC1B,IAAI,YAAA,GAAe,OAAO,SAAA,CAAU,cAAA;AACpC,IAAIA,UAAAA,mBAA6B,CAAA,CAAC,CAAA,KAAM,OAAO,SAAA,KAAY,WAAA,GAAc,SAAA,GAAU,OAAO,KAAA,KAAU,WAAA,GAAc,IAAI,KAAA,CAAM,CAAA,EAAG;AAAA,EAC7H,GAAA,EAAK,CAAC,CAAA,EAAG,CAAA,KAAA,CAAO,OAAO,SAAA,KAAY,WAAA,GAAc,SAAA,GAAU,CAAA,EAAG,CAAC;AACjE,CAAC,CAAA,GAAI,CAAA,EAAG,SAAS,CAAA,EAAG;AAClB,EAAA,IAAI,OAAO,SAAA,KAAY,WAAA,SAAoB,SAAA,CAAQ,KAAA,CAAM,MAAM,SAAS,CAAA;AACxE,EAAA,MAAM,KAAA,CAAM,sBAAA,GAAyB,CAAA,GAAI,oBAAoB,CAAA;AAC/D,CAAC;AACD,IAAI,UAAA,GAAa,CAAC,EAAA,EAAI,GAAA,KAAQ,SAASC,WAAAA,GAAa;AAClD,EAAA,OAAO,WAAW,EAAA,CAAG,kBAAkB,EAAE,CAAA,CAAE,CAAC,CAAC,CAAA,EAAA,CAAI,GAAA,GAAM,EAAE,SAAS,EAAC,IAAK,OAAA,EAA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A,KAAA,CAAM,OAAO,CAAA;AACb,QAAA,IAAA,CAAK,IAAA,GAAO,sBAAA;AACZ,QAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACf,MAAA;MACA,QAAA,GAAW;AACT,QAAA,IAAI,KAAK,KAAA,EAAO;AACd,UAAA,OAAO,CAAA,EAAG,KAAK,IAAI,CAAA,EAAA,EAAK,KAAK,OAAO,CAAA,EAAA,EAAK,KAAK,KAAK,CAAA,CAAA;AACrD,QAAA;AACA,QAAA,OAAO,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,EAAA,EAAK,KAAK,OAAO,CAAA,CAAA;AACtC,MAAA;AAAA,KAAA;AACF,EAAA;AAAA,CAAA","file":"chunk-3YJ25IUJ.js","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __require, __toESM };\n//# sourceMappingURL=chunk-7D4SUZUM.js.map\n//# sourceMappingURL=chunk-7D4SUZUM.js.map","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n"]}
|
package/dist/chunk-DGUM43GV.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export { __require };
|
|
9
|
-
//# sourceMappingURL=chunk-DGUM43GV.js.map
|
|
10
|
-
//# sourceMappingURL=chunk-DGUM43GV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-DGUM43GV.js"}
|
package/dist/chunk-HDI4ZP7N.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { __require } from './chunk-DGUM43GV.js';
|
|
2
|
-
|
|
3
|
-
// ../../packages/_vendored/ai_v6/dist/chunk-7D4SUZUM.js
|
|
4
|
-
var __create = Object.create;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __require2 = /* @__PURE__ */ ((x) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
-
get: (a, b) => (typeof __require !== "undefined" ? __require : a)[b]
|
|
12
|
-
}) : x)(function(x) {
|
|
13
|
-
if (typeof __require !== "undefined") return __require.apply(this, arguments);
|
|
14
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
-
});
|
|
16
|
-
var __commonJS = (cb, mod) => function __require22() {
|
|
17
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
-
mod
|
|
34
|
-
));
|
|
35
|
-
|
|
36
|
-
// ../../packages/_vendored/ai_v6/dist/chunk-QOME2VME.js
|
|
37
|
-
var require_token_error = __commonJS({
|
|
38
|
-
"../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js"(exports$1, module) {
|
|
39
|
-
var __defProp2 = Object.defineProperty;
|
|
40
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
41
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
42
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
43
|
-
var __export = (target, all) => {
|
|
44
|
-
for (var name in all)
|
|
45
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
46
|
-
};
|
|
47
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
48
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
49
|
-
for (let key of __getOwnPropNames2(from))
|
|
50
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
51
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
52
|
-
}
|
|
53
|
-
return to;
|
|
54
|
-
};
|
|
55
|
-
var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
56
|
-
var token_error_exports = {};
|
|
57
|
-
__export(token_error_exports, {
|
|
58
|
-
VercelOidcTokenError: () => VercelOidcTokenError
|
|
59
|
-
});
|
|
60
|
-
module.exports = __toCommonJS(token_error_exports);
|
|
61
|
-
var VercelOidcTokenError = class extends Error {
|
|
62
|
-
constructor(message, cause) {
|
|
63
|
-
super(message);
|
|
64
|
-
this.name = "VercelOidcTokenError";
|
|
65
|
-
this.cause = cause;
|
|
66
|
-
}
|
|
67
|
-
toString() {
|
|
68
|
-
if (this.cause) {
|
|
69
|
-
return `${this.name}: ${this.message}: ${this.cause}`;
|
|
70
|
-
}
|
|
71
|
-
return `${this.name}: ${this.message}`;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export { __commonJS, __require2 as __require, __toESM, require_token_error };
|
|
78
|
-
//# sourceMappingURL=chunk-HDI4ZP7N.js.map
|
|
79
|
-
//# sourceMappingURL=chunk-HDI4ZP7N.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../packages/_vendored/ai_v6/dist/chunk-7D4SUZUM.js","../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js"],"names":["__require","__require2","exports","__defProp","__getOwnPropDesc","__getOwnPropNames","__hasOwnProp","__copyProps"],"mappings":";;;AAAA,IAAI,WAAW,MAAA,CAAO,MAAA;AACtB,IAAI,YAAY,MAAA,CAAO,cAAA;AACvB,IAAI,mBAAmB,MAAA,CAAO,wBAAA;AAC9B,IAAI,oBAAoB,MAAA,CAAO,mBAAA;AAC/B,IAAI,eAAe,MAAA,CAAO,cAAA;AAC1B,IAAI,YAAA,GAAe,OAAO,SAAA,CAAU,cAAA;AACpC,IAAIA,UAAAA,mBAA6B,CAAA,CAAC,C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MAAA;AACzC,YAAAH,WAAU,EAAA,EAAI,GAAA,EAAK,EAAE,GAAA,EAAK,MAAM,KAAK,GAAG,CAAA,EAAG,UAAA,EAAY,EAAE,OAAOC,iBAAAA,CAAiB,IAAA,EAAM,GAAG,CAAA,CAAA,IAAM,IAAA,CAAK,YAAY,CAAA;AACvH,MAAA;AACA,MAAA,OAAO,EAAA;AACT,IAAA,CAAA;AACA,IAAA,IAAI,YAAA,GAAe,CAAC,GAAA,KAAQG,YAAAA,CAAYJ,UAAAA,CAAU,EAAA,EAAI,YAAA,EAAc,EAAE,KAAA,EAAO,IAAA,EAAM,GAAG,GAAG,CAAA;AACzF,IAAA,IAAI,sBAAsB,EAAA;AAC1B,IAAA,QAAA,CAAS,mBAAA,EAAqB;AAC5B,MAAA,oBAAA,EAAsB,MAAM;KAC7B,CAAA;AACD,IAAA,MAAA,CAAO,OAAA,GAAU,aAAa,mBAAmB,CAAA;AACjD,IAAA,IAAM,oBAAA,GAAN,cAAmC,KAAA,CAAM;AACvC,MAAA,WAAA,CAAY,SAAS,KAAA,EAAO;AAC1B,QAAA,KAAA,CAAM,OAAO,CAAA;AACb,QAAA,IAAA,CAAK,IAAA,GAAO,sBAAA;AACZ,QAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AACf,MAAA;MACA,QAAA,GAAW;AACT,QAAA,IAAI,KAAK,KAAA,EAAO;AACd,UAAA,OAAO,CAAA,EAAG,KAAK,IAAI,CAAA,EAAA,EAAK,KAAK,OAAO,CAAA,EAAA,EAAK,KAAK,KAAK,CAAA,CAAA;AACrD,QAAA;AACA,QAAA,OAAO,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,EAAA,EAAK,KAAK,OAAO,CAAA,CAAA;AACtC,MAAA;AAAA,KAAA;AACF,EAAA;AAAA,CAAA","file":"chunk-HDI4ZP7N.js","sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __require, __toESM };\n//# sourceMappingURL=chunk-7D4SUZUM.js.map\n//# sourceMappingURL=chunk-7D4SUZUM.js.map","\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\n});\n"]}
|