{"version":3,"file":"netlify-DrrhIGiN.cjs","names":["marker","symbol","_a","_b","AISDKError","name","marker2","symbol2","_a2","_b2","APICallError","name2","marker3","symbol3","_a3","_b3","EmptyResponseBodyError","getErrorMessage","name3","marker4","symbol4","_a4","_b4","InvalidArgumentError","name4","marker5","symbol5","_a5","_b5","InvalidPromptError","name5","marker6","symbol6","_a6","_b6","InvalidResponseDataError","name6","marker7","symbol7","_a7","_b7","JSONParseError","name7","marker8","symbol8","_a8","_b8","LoadAPIKeyError","name9","marker10","symbol10","_a10","_b10","NoContentGeneratedError","NoSuchModelError","TooManyEmbeddingValuesForCallError","name12","marker13","symbol13","_a13","_b13","TypeValidationError","name13","marker14","symbol14","_a14","_b14","UnsupportedFunctionalityError","ParseError","noop","createParser","EventSourceParserStream","createParser","combineHeaders","delay","createAbortError","extractResponseHeaders","convertBase64ToUint8Array","atob","convertUint8ArrayToBase64","btoa","typedArrayTag","arrayBufferByteLength","isUint8Array","convertToBase64","convertToFormData","cancelResponseBody","name","marker","symbol","_a","_b","DownloadError","AISDKError","isBrowserRuntime","isSameOrigin","validateDownloadUrl","isPrivateIPv6","isIPv4","isPrivateIPv4","parseIPv6","BLOCKED_REQUEST_HEADERS","sanitizeRequestHeaders","MAX_DOWNLOAD_REDIRECTS","REDIRECT_STATUS_CODES","fetchWithValidatedRedirects","DEFAULT_MAX_DOWNLOAD_SIZE","readResponseWithSizeLimit","downloadBlob","createIdGenerator","InvalidArgumentError","generateId","isAbortError","FETCH_FAILED_ERROR_MESSAGES","RETRYABLE_NETWORK_ERROR_CODES","findNetworkError","handleFetchError","APICallError","getRuntimeEnvironmentUserAgent","normalizeHeaders","withUserAgentSuffix","VERSION","getOriginalFetch","getFromApi","APICallError2","DEFAULT_SCHEMA_PREFIX","DEFAULT_SCHEMA_SUFFIX","DEFAULT_GENERIC_SUFFIX","injectJsonInstruction","injectJsonInstructionIntoMessages","loadApiKey","LoadAPIKeyError","mediaTypeToExtension","suspectProtoRx","suspectConstructorRx","_parse","filter","secureJsonParse","addAdditionalPropertiesToJsonSchema","visit","ignoreOverride","defaultOptions","getDefaultOptions","parseAnyDef","parseArrayDef","ZodFirstPartyTypeKind","parseDef","parseBigintDef","parseBooleanDef","parseBrandedDef","parseCatchDef","parseDateDef","integerDateParser","parseDefaultDef","parseEffectsDef","parseEnumDef","isJsonSchema7AllOfType","parseIntersectionDef","parseLiteralDef","emojiRegex","zodPatterns","parseStringDef","escapeLiteralCheckValue","escapeNonAlphaNumeric","ALPHA_NUMERIC","addFormat","addPattern","stringifyRegExpWithFlags","parseRecordDef","ZodFirstPartyTypeKind2","parseMapDef","parseNativeEnumDef","parseNeverDef","parseNullDef","primitiveMappings","parseUnionDef","asAnyOf","parseNullableDef","parseNumberDef","parseObjectDef","safeIsOptional","decideAdditionalProperties","parseOptionalDef","parsePipelineDef","parsePromiseDef","parseSetDef","parseTupleDef","parseUndefinedDef","parseUnknownDef","parseReadonlyDef","selectParser","ZodFirstPartyTypeKind3","getRelativePath","get$ref","addMeta","getRefs","zod3ToJsonSchema","schemaSymbol","lazySchema","jsonSchema","isSchema","asSchema","zodSchema","standardSchema","hasStandardJsonSchema","TypeValidationError","zod3Schema","zod4Schema","z4","isZod4Schema","validateTypes","safeValidateTypes","TypeValidationError2","parseJSON","JSONParseError","TypeValidationError3","safeParseJSON","parseJsonEventStream","EventSourceParserStream","parseProviderOptions","InvalidArgumentError2","getOriginalFetch2","postJsonToApi","postToApi","postFormDataToApi","APICallError3","tool","createProviderToolFactory","resolve","textDecoder","wrapResponseBodyStream","APICallError4","readResponseBodyAsText","createJsonErrorResponseHandler","createEventSourceResponseHandler","EmptyResponseBodyError","createJsonResponseHandler","createBinaryResponseHandler","createStatusCodeErrorResponseHandler","startsWithStructuredValue","StreamingToolCallArgumentState","StreamingToolCallTracker","InvalidResponseDataError","withoutTrailingSlash","toCamelCase","resolveProviderOptionsKey","defaultOpenAICompatibleErrorStructure","z","convertOpenAICompatibleChatUsage","getOpenAIMetadata","getAudioFormat","convertToOpenAICompatibleChatMessages","convertToBase64","UnsupportedFunctionalityError","convertBase64ToUint8Array","_exhaustiveCheck","getResponseMetadata","mapOpenAICompatibleFinishReason","openaiCompatibleLanguageModelChatOptions","z2","prepareTools","UnsupportedFunctionalityError2","OpenAICompatibleChatLanguageModel","createOpenAICompatibleChatChunkSchema","createJsonErrorResponseHandler","parseProviderOptions","postJsonToApi","combineHeaders","createJsonResponseHandler","OpenAICompatibleChatResponseSchema","InvalidResponseDataError","convertOpenAICompatibleContent","generateId","createEventSourceResponseHandler","StreamingToolCallTracker","openaiCompatibleTokenUsageSchema","z3","openAICompatibleContentSchema","lazySchema","zodSchema","chunkBaseSchema","convertOpenAICompatibleCompletionUsage","convertToOpenAICompatibleCompletionPrompt","InvalidPromptError","UnsupportedFunctionalityError3","getResponseMetadata2","openaiCompatibleLanguageModelCompletionOptions","lazySchema2","zodSchema2","z4","OpenAICompatibleCompletionLanguageModel","createOpenAICompatibleCompletionChunkSchema","createJsonErrorResponseHandler2","parseProviderOptions2","postJsonToApi2","combineHeaders2","createJsonResponseHandler2","openaiCompatibleCompletionResponseSchema","createEventSourceResponseHandler2","usageSchema","z5","lazySchema3","zodSchema3","openaiCompatibleEmbeddingModelOptions","lazySchema4","zodSchema4","z6","OpenAICompatibleEmbeddingModel","parseProviderOptions3","TooManyEmbeddingValuesForCallError","postJsonToApi3","combineHeaders3","createJsonErrorResponseHandler3","createJsonResponseHandler3","openaiTextEmbeddingResponseSchema","lazySchema5","zodSchema5","z7","combineHeaders4","postFormDataToApi","convertToFormData","fileToBlob","createJsonErrorResponseHandler4","createJsonResponseHandler4","openaiCompatibleImageResponseSchema","postJsonToApi4","convertBase64ToUint8Array2","InvalidResponseDataError2","getFromApi","createBinaryResponseHandler","createStatusCodeErrorResponseHandler","lazySchema6","zodSchema6","z8","downloadBlob","VERSION","withoutTrailingSlash","withUserAgentSuffix","z","lazySchema","zodSchema","createJsonErrorResponseHandler","APICallError","isRetryableStatusCode","_exhaustiveCheck","convertToBase64","UnsupportedFunctionalityError","getResponseMetadata","lazySchema2","zodSchema2","z2","lazySchema3","zodSchema3","z3","UnsupportedFunctionalityError2","parseProviderOptions","postJsonToApi","combineHeaders","createJsonResponseHandler","InvalidResponseDataError","generateId","createEventSourceResponseHandler","StreamingToolCallTracker","InvalidPromptError","UnsupportedFunctionalityError3","lazySchema4","zodSchema4","z4","lazySchema5","zodSchema5","z5","parseProviderOptions2","postJsonToApi2","combineHeaders2","createJsonResponseHandler2","createEventSourceResponseHandler2","lazySchema6","zodSchema6","z6","openaiTextEmbeddingResponseSchema","lazySchema7","zodSchema7","z7","_a","EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL","TooManyEmbeddingValuesForCallError","parseProviderOptions3","postJsonToApi3","combineHeaders3","createJsonResponseHandler3","lazySchema8","zodSchema8","z8","z9","lazySchema9","zodSchema9","parseProviderOptions4","postFormDataToApi","combineHeaders4","convertToFormData","convertBase64ToUint8Array","downloadBlob","fileToBlob","createJsonResponseHandler4","postJsonToApi4","lazySchema10","zodSchema10","z10","lazySchema11","zodSchema11","z11","createProviderToolFactoryWithOutputSchema2","lazySchema12","zodSchema12","z12","createProviderToolFactory","z13","fileSearchArgsSchema","lazySchema13","zodSchema13","fileSearchOutputSchema","fileSearch","createProviderToolFactoryWithOutputSchema3","imageGenerationArgsSchema","lazySchema14","zodSchema14","z14","imageGenerationInputSchema","imageGenerationOutputSchema","imageGenerationToolFactory","createProviderToolFactoryWithOutputSchema4","imageGeneration","lazySchema15","zodSchema15","z15","createProviderToolFactoryWithOutputSchema5","lazySchema16","zodSchema16","z16","createProviderToolFactoryWithOutputSchema6","lazySchema17","zodSchema17","z17","createProviderToolFactoryWithOutputSchema7","webSearchArgsSchema","lazySchema18","zodSchema18","z18","webSearchOutputSchema","webSearchToolFactory","createProviderToolFactoryWithOutputSchema8","webSearch","lazySchema19","zodSchema19","z19","createProviderToolFactoryWithOutputSchema9","z20","lazySchema20","zodSchema20","createProviderToolFactoryWithOutputSchema10","lazySchema21","zodSchema21","z21","safeParseJSON","safeValidateTypes","parseProviderOptions5","UnsupportedFunctionalityError4","convertToBase642","parseJSON","validateTypes","lazySchema22","zodSchema22","z22","z23","isRecord","lazySchema23","zodSchema23","prepareResponsesTools","UnsupportedFunctionalityError5","validateTypes2","env2","env","parseProviderOptions6","UnsupportedFunctionalityError6","postJsonToApi5","combineHeaders5","createJsonResponseHandler5","APICallError2","generateId2","createEventSourceResponseHandler3","lazySchema24","zodSchema24","z24","parseProviderOptions7","postJsonToApi6","combineHeaders6","createBinaryResponseHandler","lazySchema25","zodSchema25","z25","lazySchema26","zodSchema26","z26","parseProviderOptions8","convertBase64ToUint8Array2","mediaTypeToExtension","postFormDataToApi2","combineHeaders7","createJsonResponseHandler6","VERSION","withoutTrailingSlash","withUserAgentSuffix","loadApiKey","MastraError","VERSION","lazySchema","zodSchema","z","createJsonErrorResponseHandler","z2","lazySchema2","zodSchema2","lazySchema3","zodSchema3","z3","MAX_CACHE_BREAKPOINTS","getCacheControl","CacheControlValidator","lazySchema4","zodSchema4","z4","lazySchema5","zodSchema5","z5","createProviderToolFactory","lazySchema6","zodSchema6","z6","createProviderToolFactory2","lazySchema7","zodSchema7","z7","createProviderToolFactoryWithOutputSchema2","lazySchema8","zodSchema8","z8","createProviderToolFactoryWithOutputSchema3","lazySchema9","zodSchema9","z9","createProviderToolFactoryWithOutputSchema4","lazySchema10","zodSchema10","z10","createProviderToolFactoryWithOutputSchema5","prepareTools","validateTypes","UnsupportedFunctionalityError","_exhaustiveCheck","lazySchema11","zodSchema11","z11","createProviderToolFactoryWithOutputSchema6","lazySchema12","zodSchema12","z12","createProviderToolFactoryWithOutputSchema7","lazySchema13","zodSchema13","z13","createProviderToolFactoryWithOutputSchema8","lazySchema14","zodSchema14","z14","createProviderToolFactoryWithOutputSchema9","convertBase64ToUint8Array","UnsupportedFunctionalityError2","safeParseJSON","parseProviderOptions","convertToBase64","secureJsonParse","validateTypes2","generateId","parseProviderOptions2","combineHeaders","resolve","postJsonToApi","createJsonResponseHandler","createEventSourceResponseHandler","secureJsonParse2","InvalidResponseDataError","APICallError","lazySchema15","zodSchema15","z15","createProviderToolFactory3","lazySchema16","zodSchema16","z16","createProviderToolFactory4","lazySchema17","zodSchema17","z17","createProviderToolFactory5","lazySchema18","zodSchema18","z18","createProviderToolFactory6","lazySchema19","zodSchema19","z19","createProviderToolFactory7","lazySchema20","zodSchema20","z20","createProviderToolFactory8","lazySchema21","zodSchema21","z21","createProviderToolFactory9","lazySchema22","zodSchema22","z22","createProviderToolFactory10","lazySchema23","zodSchema23","z23","createProviderToolFactory11","lazySchema24","zodSchema24","z24","createProviderToolFactoryWithOutputSchema10","withoutTrailingSlash","InvalidArgumentError","loadApiKey","withUserAgentSuffix","generateId2","NoSuchModelError","marker","symbol","_a","AISDKError","name","APICallError","EmptyResponseBodyError","getErrorMessage","InvalidArgumentError","InvalidPromptError","InvalidResponseDataError","JSONParseError","LoadAPIKeyError","TypeValidationError","UnsupportedFunctionalityError","combineHeaders","delay","createAbortError","extractResponseHeaders","convertUint8ArrayToBase64","btoa","createIdGenerator","generateId","isAbortError","FETCH_FAILED_ERROR_MESSAGES","handleFetchError","getRuntimeEnvironmentUserAgent","normalizeHeaders","withUserAgentSuffix","VERSION","getOriginalFetch","getFromApi","loadApiKey","suspectProtoRx","suspectConstructorRx","_parse","filter","secureJsonParse","addAdditionalPropertiesToJsonSchema","visit","ignoreOverride","defaultOptions","getDefaultOptions","parseAnyDef","parseArrayDef","ZodFirstPartyTypeKind","parseDef","parseBigintDef","parseBooleanDef","parseBrandedDef","parseCatchDef","parseDateDef","integerDateParser","parseDefaultDef","parseEffectsDef","parseEnumDef","isJsonSchema7AllOfType","parseIntersectionDef","parseLiteralDef","emojiRegex","zodPatterns","parseStringDef","escapeLiteralCheckValue","escapeNonAlphaNumeric","ALPHA_NUMERIC","addFormat","addPattern","stringifyRegExpWithFlags","parseRecordDef","ZodFirstPartyTypeKind2","parseMapDef","parseNativeEnumDef","parseNeverDef","parseNullDef","primitiveMappings","parseUnionDef","asAnyOf","parseNullableDef","parseNumberDef","parseObjectDef","safeIsOptional","decideAdditionalProperties","parseOptionalDef","parsePipelineDef","parsePromiseDef","parseSetDef","parseTupleDef","parseUndefinedDef","parseUnknownDef","parseReadonlyDef","selectParser","ZodFirstPartyTypeKind3","getRelativePath","get$ref","addMeta","getRefs","zod3ToJsonSchema","schemaSymbol","jsonSchema","isSchema","asSchema","zodSchema","standardSchema","zod3Schema","zod4Schema","z4","isZod4Schema","validateTypes","safeValidateTypes","parseJSON","safeParseJSON","parseJsonEventStream","postJsonToApi","postToApi","tool","createJsonErrorResponseHandler","createEventSourceResponseHandler","createJsonResponseHandler","withoutTrailingSlash","z","z2","z3","getCacheControl","_exhaustiveCheck","z5","z6","z7","z8","z9","z10","webSearch","z11","removeUndefinedEntries","z12","marker$2","name$1","marker$1","symbol$1","name","marker","symbol","textDecoder$1","VERSION","getTopLevelMediaType","isFullMediaType","config","en","toJSONSchema","safeParseAsync","getOriginalFetch","textDecoder","z","prepareTools","getTopLevelMediaType","getFirstFrameImage","getLastFrameImage","resolveStartImage","VERSION","z","getTopLevelMediaType","getResponseMetadata$1","prepareTools","getResponseMetadata","usageSchema","VERSION","z","z","VERSION","z","getTopLevelMediaType","prepareTools","getHttpStatusCode","isRetryableStatusCode","getResponseMetadata","VERSION","lazySchema","zodSchema","z","createJsonErrorResponseHandler","lazySchema2","zodSchema2","z2","parseProviderOptions","InvalidArgumentError","convertToBase64","postJsonToApi","combineHeaders","resolve","createJsonResponseHandler","z3","lazySchema3","zodSchema3","VERSION","z4","lazySchema4","zodSchema4","EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER","parseProviderOptions2","TooManyEmbeddingValuesForCallError","combineHeaders2","resolve2","postJsonToApi2","createJsonResponseHandler2","lazySchema5","zodSchema5","z5","UnsupportedFunctionalityError","z6","UnsupportedFunctionalityError2","convertToBase642","secureJsonParse","isUrlSupported2","downloadBlob","convertUint8ArrayToBase64","lazySchema6","zodSchema6","z7","prepareTools","UnsupportedFunctionalityError3","_exhaustiveCheck","generateId","parseProviderOptions3","combineHeaders3","resolve3","postJsonToApi3","createJsonResponseHandler3","createEventSourceResponseHandler","z8","lazySchema7","zodSchema7","codeExecution","z9","createProviderToolFactory","lazySchema8","zodSchema8","z10","z11","fileSearchArgsSchema","lazySchema9","zodSchema9","fileSearch","createProviderToolFactory2","createProviderToolFactory3","lazySchema10","zodSchema10","z12","z13","lazySchema11","zodSchema11","createProviderToolFactory4","createProviderToolFactory5","lazySchema12","zodSchema12","z14","createProviderToolFactory6","z15","parseProviderOptions4","postJsonToApi4","combineHeaders4","resolve4","createJsonResponseHandler4","defaultGenerateId","convertToBase643","lazySchema13","zodSchema13","z16","getFirstFrameImage","resolveStartImage","getLastFrameImage","convertUint8ArrayToBase642","parseProviderOptions5","postJsonToApi5","combineHeaders5","resolve5","createJsonResponseHandler5","AISDKError","delay","getFromApi","isSameOrigin","lazySchema14","zodSchema14","z17","event","getTopLevelMediaType","convertToBase644","secureJsonParse2","z18","annotationSchema","lazySchema15","zodSchema15","lazySchema16","zodSchema16","z19","withUserAgentSuffix","combineHeaders6","getRuntimeEnvironmentUserAgent","delay2","getFromApi2","createJsonResponseHandler6","isAbortError","getFromApi3","createEventSourceResponseHandler2","isAbortError2","delay3","parseProviderOptions6","combineHeaders7","resolve6","postJsonToApi6","createJsonResponseHandler7","defaultGenerateId2","createEventSourceResponseHandler3","withoutTrailingSlash","withUserAgentSuffix2","loadApiKey","generateId2","getTopLevelMediaType","z","prepareTools","getResponseMetadata","textDecoder","VERSION","z","convertToBase64","UnsupportedFunctionalityError","_exhaustiveCheck","getResponseMetadata","lazySchema","zodSchema","z2","lazySchema2","zodSchema2","z3","createJsonErrorResponseHandler","UnsupportedFunctionalityError2","generateId","parseProviderOptions","injectJsonInstructionIntoMessages","postJsonToApi","combineHeaders","createJsonResponseHandler","createEventSourceResponseHandler","InvalidResponseDataError","z4","lazySchema3","zodSchema3","TooManyEmbeddingValuesForCallError","postJsonToApi2","combineHeaders2","createJsonResponseHandler2","lazySchema4","zodSchema4","z5","lazySchema5","zodSchema5","z6","parseProviderOptions2","postToApi","combineHeaders3","createJsonResponseHandler3","lazySchema6","zodSchema6","z7","VERSION","withoutTrailingSlash","withUserAgentSuffix","loadApiKey","NoSuchModelError","lazySchema","zodSchema","z","UnsupportedFunctionalityError","_exhaustiveCheck","convertUint8ArrayToBase64","z2","lazySchema2","zodSchema2","z3","lazySchema3","zodSchema3","getResponseMetadata","parseProviderOptions","postJsonToApi","combineHeaders","createJsonErrorResponseHandler","createJsonResponseHandler","APICallError","createEventSourceResponseHandler","TooManyEmbeddingValuesForCallError","parseProviderOptions2","postJsonToApi2","combineHeaders2","createJsonErrorResponseHandler2","createJsonResponseHandler2","convertBase64ToUint8Array","lazySchema4","zodSchema4","z4","VERSION","withUserAgentSuffix","loadApiKey","withoutTrailingSlash","NoSuchModelError","z","VERSION","z","getTopLevelMediaType","createGateway","InMemoryServerCache","MastraError"],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider/3.0.19/0b1d7b6863750d2561eeffa8e8855a8a3237be133a137f63f15430e10633b053/node_modules/@ai-sdk/provider/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/eventsource-parser/3.1.1/e30f67b0ff61a3a3a39b8308894e655beffc18d0fdc6af8dfff3c5512ba88c3a/node_modules/eventsource-parser/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/eventsource-parser/3.1.1/e30f67b0ff61a3a3a39b8308894e655beffc18d0fdc6af8dfff3c5512ba88c3a/node_modules/eventsource-parser/dist/stream.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider-utils/4.0.66/b622c802b4d37b51174bde15e2479e370e993113aea38fb145ab9dcdcb4e96fb/node_modules/@ai-sdk/provider-utils/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/openai-compatible/2.0.88/d1d0359bf44bd79da5e120c8cc560648629d2ac9989b32e687a6553c516a8e1a/node_modules/@ai-sdk/openai-compatible/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/openai/3.0.135/0cbc2af149c9f6a51280c2a42bf32923563c0fa673ab0f281e180ff76995d307/node_modules/@ai-sdk/openai/dist/index.mjs","../src/llm/model/gateways/base.ts","../src/llm/model/capability-file.ts","../src/llm/model/gateways/gateway-helpers.ts","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/anthropic/3.0.137/14a45de3f6c7c815ad75cef123394be704072e1b6b1ccb21eeb105b30d8f1a4c/node_modules/@ai-sdk/anthropic/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@openrouter/ai-sdk-provider/2.10.0/fe7a784499db3b65cf38b322ecc530d9838876359332081cbef953596975467b/node_modules/@openrouter/ai-sdk-provider/dist/index.mjs","../src/llm/model/gateways/constants.ts","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider/4.0.38/e664e4f4a2f64bc01469ef66c795af801494dcfe68f16e0722387d5cb8fc483e/node_modules/@ai-sdk/provider/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@workflow/serde/4.1.0/261fd96db91ae08052ff2d7ce2a9dc7ec2871d6a9ad311cee344b4f0d349e5bf/node_modules/@workflow/serde/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/provider-utils/5.0.81/3fe99b0b1a12e8ff07f54d06d435091d33858c41c659323e4db790d385895181/node_modules/@ai-sdk/provider-utils/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/alibaba/2.0.80/157a27a4a81ef46a40e6cb379e449e9428d5f4d03b0abf9b80e75e59cdbeda2e/node_modules/@ai-sdk/alibaba/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/openai-compatible/3.0.82/289166821eb0ef6abaef37d462322e62e80fb0ef3032014cdf6e51924280a758/node_modules/@ai-sdk/openai-compatible/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/cerebras/3.0.82/f109ec8918e0841442adbcf0c9d637b3318992b66615579531298e388b43b810/node_modules/@ai-sdk/cerebras/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/deepinfra/3.0.82/2102c81af44fdb1b674f87eed6ed515931510425680c717d4d0c3f08ba629eaa/node_modules/@ai-sdk/deepinfra/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/deepseek/3.0.77/66c57eaea375f099c0d5afc2718953567f99e1f49901a5e0fc26b289c746dee5/node_modules/@ai-sdk/deepseek/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/google/3.0.140/fe67e16c9063eb43bd4b7f5b8c6aa93589deab79cf93964b44ca84f0e83988b5/node_modules/@ai-sdk/google/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/groq/4.0.74/8ac5aad97fde20a7dfb371f3f59dc0bb413b926780ad139c8070529e218e3cd3/node_modules/@ai-sdk/groq/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/mistral/3.0.78/d7ae3108bf54dfdc6aa480e7d6a07d571e2ea796dc8797019fd4995564db3920/node_modules/@ai-sdk/mistral/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/perplexity/3.1.9/ca01ae6d57e9912715db1c033b9048f68417201bcc9fd79accbdb49c8695c7fb/node_modules/@ai-sdk/perplexity/dist/index.mjs","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/togetherai/3.0.83/20f70545dd8da1582f656285682dc37ed9494613695ca09b41ed52e853e809c0/node_modules/@ai-sdk/togetherai/dist/index.js","../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@ai-sdk/xai/5.0.35/e0618ebb4f63f13a767a1acb1d8d9b54666ee6ab27a9b4006e6b9cc1f854ade3/node_modules/@ai-sdk/xai/dist/index.js","../src/llm/model/gateway-resolver.ts","../src/llm/model/gateways/url-template.ts","../src/llm/model/gateways/models-dev.ts","../src/llm/model/gateways/netlify.ts"],"sourcesContent":["// src/errors/ai-sdk-error.ts\nvar marker = \"vercel.ai.error\";\nvar symbol = Symbol.for(marker);\nvar _a, _b;\nvar AISDKError = class _AISDKError extends (_b = Error, _a = symbol, _b) {\n  /**\n   * Creates an AI SDK Error.\n   *\n   * @param {Object} params - The parameters for creating the error.\n   * @param {string} params.name - The name of the error.\n   * @param {string} params.message - The error message.\n   * @param {unknown} [params.cause] - The underlying cause of the error.\n   */\n  constructor({\n    name: name14,\n    message,\n    cause\n  }) {\n    super(message);\n    this[_a] = true;\n    this.name = name14;\n    this.cause = cause;\n  }\n  /**\n   * Checks if the given error is an AI SDK Error.\n   * @param {unknown} error - The error to check.\n   * @returns {boolean} True if the error is an AI SDK Error, false otherwise.\n   */\n  static isInstance(error) {\n    return _AISDKError.hasMarker(error, marker);\n  }\n  static hasMarker(error, marker15) {\n    const markerSymbol = Symbol.for(marker15);\n    return error != null && typeof error === \"object\" && markerSymbol in error && typeof error[markerSymbol] === \"boolean\" && error[markerSymbol] === true;\n  }\n};\n\n// src/errors/api-call-error.ts\nvar name = \"AI_APICallError\";\nvar marker2 = `vercel.ai.error.${name}`;\nvar symbol2 = Symbol.for(marker2);\nvar _a2, _b2;\nvar APICallError = class extends (_b2 = AISDKError, _a2 = symbol2, _b2) {\n  constructor({\n    message,\n    url,\n    requestBodyValues,\n    statusCode,\n    responseHeaders,\n    responseBody,\n    cause,\n    isRetryable = statusCode != null && (statusCode === 408 || // request timeout\n    statusCode === 409 || // conflict\n    statusCode === 429 || // too many requests\n    statusCode >= 500),\n    // server error\n    data\n  }) {\n    super({ name, message, cause });\n    this[_a2] = true;\n    this.url = url;\n    this.requestBodyValues = requestBodyValues;\n    this.statusCode = statusCode;\n    this.responseHeaders = responseHeaders;\n    this.responseBody = responseBody;\n    this.isRetryable = isRetryable;\n    this.data = data;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker2);\n  }\n};\n\n// src/errors/empty-response-body-error.ts\nvar name2 = \"AI_EmptyResponseBodyError\";\nvar marker3 = `vercel.ai.error.${name2}`;\nvar symbol3 = Symbol.for(marker3);\nvar _a3, _b3;\nvar EmptyResponseBodyError = class extends (_b3 = AISDKError, _a3 = symbol3, _b3) {\n  // used in isInstance\n  constructor({ message = \"Empty response body\" } = {}) {\n    super({ name: name2, message });\n    this[_a3] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker3);\n  }\n};\n\n// src/errors/get-error-message.ts\nfunction getErrorMessage(error) {\n  if (error == null) {\n    return \"unknown error\";\n  }\n  if (typeof error === \"string\") {\n    return error;\n  }\n  if (error instanceof Error) {\n    return error.message;\n  }\n  return JSON.stringify(error);\n}\n\n// src/errors/invalid-argument-error.ts\nvar name3 = \"AI_InvalidArgumentError\";\nvar marker4 = `vercel.ai.error.${name3}`;\nvar symbol4 = Symbol.for(marker4);\nvar _a4, _b4;\nvar InvalidArgumentError = class extends (_b4 = AISDKError, _a4 = symbol4, _b4) {\n  constructor({\n    message,\n    cause,\n    argument\n  }) {\n    super({ name: name3, message, cause });\n    this[_a4] = true;\n    this.argument = argument;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker4);\n  }\n};\n\n// src/errors/invalid-prompt-error.ts\nvar name4 = \"AI_InvalidPromptError\";\nvar marker5 = `vercel.ai.error.${name4}`;\nvar symbol5 = Symbol.for(marker5);\nvar _a5, _b5;\nvar InvalidPromptError = class extends (_b5 = AISDKError, _a5 = symbol5, _b5) {\n  constructor({\n    prompt,\n    message,\n    cause\n  }) {\n    super({ name: name4, message: `Invalid prompt: ${message}`, cause });\n    this[_a5] = true;\n    this.prompt = prompt;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker5);\n  }\n};\n\n// src/errors/invalid-response-data-error.ts\nvar name5 = \"AI_InvalidResponseDataError\";\nvar marker6 = `vercel.ai.error.${name5}`;\nvar symbol6 = Symbol.for(marker6);\nvar _a6, _b6;\nvar InvalidResponseDataError = class extends (_b6 = AISDKError, _a6 = symbol6, _b6) {\n  constructor({\n    data,\n    message = `Invalid response data: ${JSON.stringify(data)}.`\n  }) {\n    super({ name: name5, message });\n    this[_a6] = true;\n    this.data = data;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker6);\n  }\n};\n\n// src/errors/json-parse-error.ts\nvar name6 = \"AI_JSONParseError\";\nvar marker7 = `vercel.ai.error.${name6}`;\nvar symbol7 = Symbol.for(marker7);\nvar _a7, _b7;\nvar JSONParseError = class extends (_b7 = AISDKError, _a7 = symbol7, _b7) {\n  constructor({ text, cause }) {\n    super({\n      name: name6,\n      message: `JSON parsing failed: Text: ${text}.\nError message: ${getErrorMessage(cause)}`,\n      cause\n    });\n    this[_a7] = true;\n    this.text = text;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker7);\n  }\n};\n\n// src/errors/load-api-key-error.ts\nvar name7 = \"AI_LoadAPIKeyError\";\nvar marker8 = `vercel.ai.error.${name7}`;\nvar symbol8 = Symbol.for(marker8);\nvar _a8, _b8;\nvar LoadAPIKeyError = class extends (_b8 = AISDKError, _a8 = symbol8, _b8) {\n  // used in isInstance\n  constructor({ message }) {\n    super({ name: name7, message });\n    this[_a8] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker8);\n  }\n};\n\n// src/errors/load-setting-error.ts\nvar name8 = \"AI_LoadSettingError\";\nvar marker9 = `vercel.ai.error.${name8}`;\nvar symbol9 = Symbol.for(marker9);\nvar _a9, _b9;\nvar LoadSettingError = class extends (_b9 = AISDKError, _a9 = symbol9, _b9) {\n  // used in isInstance\n  constructor({ message }) {\n    super({ name: name8, message });\n    this[_a9] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker9);\n  }\n};\n\n// src/errors/no-content-generated-error.ts\nvar name9 = \"AI_NoContentGeneratedError\";\nvar marker10 = `vercel.ai.error.${name9}`;\nvar symbol10 = Symbol.for(marker10);\nvar _a10, _b10;\nvar NoContentGeneratedError = class extends (_b10 = AISDKError, _a10 = symbol10, _b10) {\n  // used in isInstance\n  constructor({\n    message = \"No content generated.\"\n  } = {}) {\n    super({ name: name9, message });\n    this[_a10] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker10);\n  }\n};\n\n// src/errors/no-such-model-error.ts\nvar name10 = \"AI_NoSuchModelError\";\nvar marker11 = `vercel.ai.error.${name10}`;\nvar symbol11 = Symbol.for(marker11);\nvar _a11, _b11;\nvar NoSuchModelError = class extends (_b11 = AISDKError, _a11 = symbol11, _b11) {\n  constructor({\n    errorName = name10,\n    modelId,\n    modelType,\n    message = `No such ${modelType}: ${modelId}`\n  }) {\n    super({ name: errorName, message });\n    this[_a11] = true;\n    this.modelId = modelId;\n    this.modelType = modelType;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker11);\n  }\n};\n\n// src/errors/too-many-embedding-values-for-call-error.ts\nvar name11 = \"AI_TooManyEmbeddingValuesForCallError\";\nvar marker12 = `vercel.ai.error.${name11}`;\nvar symbol12 = Symbol.for(marker12);\nvar _a12, _b12;\nvar TooManyEmbeddingValuesForCallError = class extends (_b12 = AISDKError, _a12 = symbol12, _b12) {\n  constructor(options) {\n    super({\n      name: name11,\n      message: `Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`\n    });\n    this[_a12] = true;\n    this.provider = options.provider;\n    this.modelId = options.modelId;\n    this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;\n    this.values = options.values;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker12);\n  }\n};\n\n// src/errors/type-validation-error.ts\nvar name12 = \"AI_TypeValidationError\";\nvar marker13 = `vercel.ai.error.${name12}`;\nvar symbol13 = Symbol.for(marker13);\nvar _a13, _b13;\nvar TypeValidationError = class _TypeValidationError extends (_b13 = AISDKError, _a13 = symbol13, _b13) {\n  constructor({\n    value,\n    cause,\n    context\n  }) {\n    let contextPrefix = \"Type validation failed\";\n    if (context == null ? void 0 : context.field) {\n      contextPrefix += ` for ${context.field}`;\n    }\n    if ((context == null ? void 0 : context.entityName) || (context == null ? void 0 : context.entityId)) {\n      contextPrefix += \" (\";\n      const parts = [];\n      if (context.entityName) {\n        parts.push(context.entityName);\n      }\n      if (context.entityId) {\n        parts.push(`id: \"${context.entityId}\"`);\n      }\n      contextPrefix += parts.join(\", \");\n      contextPrefix += \")\";\n    }\n    super({\n      name: name12,\n      message: `${contextPrefix}: Value: ${JSON.stringify(value)}.\nError message: ${getErrorMessage(cause)}`,\n      cause\n    });\n    this[_a13] = true;\n    this.value = value;\n    this.context = context;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker13);\n  }\n  /**\n   * Wraps an error into a TypeValidationError.\n   * If the cause is already a TypeValidationError with the same value and context, it returns the cause.\n   * Otherwise, it creates a new TypeValidationError.\n   *\n   * @param {Object} params - The parameters for wrapping the error.\n   * @param {unknown} params.value - The value that failed validation.\n   * @param {unknown} params.cause - The original error or cause of the validation failure.\n   * @param {TypeValidationContext} params.context - Optional context about what is being validated.\n   * @returns {TypeValidationError} A TypeValidationError instance.\n   */\n  static wrap({\n    value,\n    cause,\n    context\n  }) {\n    var _a15, _b15, _c;\n    if (_TypeValidationError.isInstance(cause) && cause.value === value && ((_a15 = cause.context) == null ? void 0 : _a15.field) === (context == null ? void 0 : context.field) && ((_b15 = cause.context) == null ? void 0 : _b15.entityName) === (context == null ? void 0 : context.entityName) && ((_c = cause.context) == null ? void 0 : _c.entityId) === (context == null ? void 0 : context.entityId)) {\n      return cause;\n    }\n    return new _TypeValidationError({ value, cause, context });\n  }\n};\n\n// src/errors/unsupported-functionality-error.ts\nvar name13 = \"AI_UnsupportedFunctionalityError\";\nvar marker14 = `vercel.ai.error.${name13}`;\nvar symbol14 = Symbol.for(marker14);\nvar _a14, _b14;\nvar UnsupportedFunctionalityError = class extends (_b14 = AISDKError, _a14 = symbol14, _b14) {\n  constructor({\n    functionality,\n    message = `'${functionality}' functionality not supported.`\n  }) {\n    super({ name: name13, message });\n    this[_a14] = true;\n    this.functionality = functionality;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker14);\n  }\n};\n\n// src/json-value/is-json.ts\nfunction isJSONValue(value) {\n  if (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n    return true;\n  }\n  if (Array.isArray(value)) {\n    return value.every(isJSONValue);\n  }\n  if (typeof value === \"object\") {\n    return Object.entries(value).every(\n      ([key, val]) => typeof key === \"string\" && (val === void 0 || isJSONValue(val))\n    );\n  }\n  return false;\n}\nfunction isJSONArray(value) {\n  return Array.isArray(value) && value.every(isJSONValue);\n}\nfunction isJSONObject(value) {\n  return value != null && typeof value === \"object\" && Object.entries(value).every(\n    ([key, val]) => typeof key === \"string\" && (val === void 0 || isJSONValue(val))\n  );\n}\nexport {\n  AISDKError,\n  APICallError,\n  EmptyResponseBodyError,\n  InvalidArgumentError,\n  InvalidPromptError,\n  InvalidResponseDataError,\n  JSONParseError,\n  LoadAPIKeyError,\n  LoadSettingError,\n  NoContentGeneratedError,\n  NoSuchModelError,\n  TooManyEmbeddingValuesForCallError,\n  TypeValidationError,\n  UnsupportedFunctionalityError,\n  getErrorMessage,\n  isJSONArray,\n  isJSONObject,\n  isJSONValue\n};\n//# sourceMappingURL=index.mjs.map","class ParseError extends Error {\n  constructor(message, options) {\n    super(message), this.name = \"ParseError\", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;\n  }\n}\nconst LF = 10, CR = 13, SPACE = 32;\nfunction noop(_arg) {\n}\nfunction createParser(config) {\n  if (typeof config == \"function\")\n    throw new TypeError(\n      \"`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?\"\n    );\n  const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config, pendingFragments = [];\n  let pendingFragmentsLength = 0, isFirstChunk = !0, id, data = \"\", dataLines = 0, eventType, terminated = !1;\n  function feed(chunk) {\n    if (terminated)\n      throw new Error(\n        \"Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.\"\n      );\n    if (isFirstChunk && (isFirstChunk = !1, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {\n      const trailing2 = processLines(chunk);\n      trailing2 !== \"\" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();\n      return;\n    }\n    if (chunk.indexOf(`\n`) === -1 && chunk.indexOf(\"\\r\") === -1) {\n      pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();\n      return;\n    }\n    pendingFragments.push(chunk);\n    const input = pendingFragments.join(\"\");\n    pendingFragments.length = 0, pendingFragmentsLength = 0;\n    const trailing = processLines(input);\n    trailing !== \"\" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();\n  }\n  function checkBufferSize() {\n    maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = !0, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = \"\", dataLines = 0, eventType = void 0, onError(\n      new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {\n        type: \"max-buffer-size-exceeded\"\n      })\n    )));\n  }\n  function processLines(chunk) {\n    let searchIndex = 0;\n    if (chunk.indexOf(\"\\r\") === -1) {\n      let lfIndex = chunk.indexOf(`\n`, searchIndex);\n      for (; lfIndex !== -1; ) {\n        if (searchIndex === lfIndex) {\n          dataLines > 0 && onEvent({ id, event: eventType, data }), id = void 0, data = \"\", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`\n`, searchIndex);\n          continue;\n        }\n        const firstCharCode = chunk.charCodeAt(searchIndex);\n        if (isDataPrefix(chunk, searchIndex, firstCharCode)) {\n          const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex);\n          if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {\n            onEvent({ id, event: eventType, data: value }), id = void 0, data = \"\", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`\n`, searchIndex);\n            continue;\n          }\n          data = dataLines === 0 ? value : `${data}\n${value}`, dataLines++;\n        } else isEventPrefix(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(\n          chunk.charCodeAt(searchIndex + 6) === SPACE ? searchIndex + 7 : searchIndex + 6,\n          lfIndex\n        ) || void 0 : parseLine(chunk, searchIndex, lfIndex);\n        searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`\n`, searchIndex);\n      }\n      return chunk.slice(searchIndex);\n    }\n    for (; searchIndex < chunk.length; ) {\n      const crIndex = chunk.indexOf(\"\\r\", searchIndex), lfIndex = chunk.indexOf(`\n`, searchIndex);\n      let lineEnd = -1;\n      if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1)\n        break;\n      parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR && chunk.charCodeAt(searchIndex) === LF && searchIndex++;\n    }\n    return chunk.slice(searchIndex);\n  }\n  function parseLine(chunk, start, end) {\n    if (start === end) {\n      dispatchEvent();\n      return;\n    }\n    const firstCharCode = chunk.charCodeAt(start);\n    if (isDataPrefix(chunk, start, firstCharCode)) {\n      const valueStart = chunk.charCodeAt(start + 5) === SPACE ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end);\n      data = dataLines === 0 ? value2 : `${data}\n${value2}`, dataLines++;\n      return;\n    }\n    if (isEventPrefix(chunk, start, firstCharCode)) {\n      eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE ? start + 7 : start + 6, end) || void 0;\n      return;\n    }\n    if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {\n      const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);\n      value2.includes(\"\\0\") || (id = value2);\n      return;\n    }\n    if (firstCharCode === 58) {\n      if (onComment) {\n        const line2 = chunk.slice(start, end);\n        onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE ? 2 : 1));\n      }\n      return;\n    }\n    const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(\":\");\n    if (fieldSeparatorIndex === -1) {\n      processField(line, \"\", line);\n      return;\n    }\n    const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);\n    processField(field, value, line);\n  }\n  function processField(field, value, line) {\n    switch (field) {\n      case \"event\":\n        eventType = value || void 0;\n        break;\n      case \"data\":\n        data = dataLines === 0 ? value : `${data}\n${value}`, dataLines++;\n        break;\n      case \"id\":\n        value.includes(\"\\0\") || (id = value);\n        break;\n      case \"retry\":\n        /^\\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(\n          new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n            type: \"invalid-retry\",\n            value,\n            line\n          })\n        );\n        break;\n      default:\n        onError(\n          new ParseError(\n            `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}\\u2026` : field}\"`,\n            { type: \"unknown-field\", field, value, line }\n          )\n        );\n        break;\n    }\n  }\n  function dispatchEvent() {\n    dataLines > 0 && onEvent({\n      id,\n      event: eventType,\n      data\n    }), id = void 0, data = \"\", dataLines = 0, eventType = void 0;\n  }\n  function reset(options = {}) {\n    if (options.consume && pendingFragments.length > 0) {\n      const incompleteLine = pendingFragments.join(\"\");\n      parseLine(incompleteLine, 0, incompleteLine.length);\n    }\n    isFirstChunk = !0, id = void 0, data = \"\", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = !1;\n  }\n  return { feed, reset };\n}\nfunction isDataPrefix(chunk, i, firstCharCode) {\n  return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;\n}\nfunction isEventPrefix(chunk, i, firstCharCode) {\n  return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58;\n}\nexport {\n  ParseError,\n  createParser\n};\n//# sourceMappingURL=index.js.map\n","import { createParser } from \"./index.js\";\nimport { ParseError } from \"./index.js\";\nclass EventSourceParserStream extends TransformStream {\n  constructor({ onError, onRetry, onComment, maxBufferSize } = {}) {\n    let parser;\n    super({\n      start(controller) {\n        parser = createParser({\n          onEvent: (event) => {\n            controller.enqueue(event);\n          },\n          onError(error) {\n            typeof onError == \"function\" && onError(error), (onError === \"terminate\" || error.type === \"max-buffer-size-exceeded\") && controller.error(error);\n          },\n          onRetry,\n          onComment,\n          maxBufferSize\n        });\n      },\n      transform(chunk) {\n        parser.feed(chunk);\n      }\n    });\n  }\n}\nexport {\n  EventSourceParserStream,\n  ParseError\n};\n//# sourceMappingURL=stream.js.map\n","// src/combine-headers.ts\nfunction combineHeaders(...headers) {\n  return headers.reduce(\n    (combinedHeaders, currentHeaders) => ({\n      ...combinedHeaders,\n      ...currentHeaders\n    }),\n    {}\n  );\n}\n\n// src/convert-async-iterator-to-readable-stream.ts\nfunction convertAsyncIteratorToReadableStream(iterator) {\n  let cancelled = false;\n  return new ReadableStream({\n    /**\n     * Called when the consumer wants to pull more data from the stream.\n     *\n     * @param {ReadableStreamDefaultController<T>} controller - The controller to enqueue data into the stream.\n     * @returns {Promise<void>}\n     */\n    async pull(controller) {\n      if (cancelled) return;\n      try {\n        const { value, done } = await iterator.next();\n        if (done) {\n          controller.close();\n        } else {\n          controller.enqueue(value);\n        }\n      } catch (error) {\n        controller.error(error);\n      }\n    },\n    /**\n     * Called when the consumer cancels the stream.\n     */\n    async cancel(reason) {\n      cancelled = true;\n      if (iterator.return) {\n        try {\n          await iterator.return(reason);\n        } catch (e) {\n        }\n      }\n    }\n  });\n}\n\n// src/create-tool-name-mapping.ts\nfunction createToolNameMapping({\n  tools = [],\n  providerToolNames,\n  resolveProviderToolName\n}) {\n  var _a2;\n  const customToolNameToProviderToolName = {};\n  const providerToolNameToCustomToolName = {};\n  for (const tool2 of tools) {\n    if (tool2.type === \"provider\") {\n      const providerToolName = (_a2 = resolveProviderToolName == null ? void 0 : resolveProviderToolName(tool2)) != null ? _a2 : tool2.id in providerToolNames ? providerToolNames[tool2.id] : void 0;\n      if (providerToolName == null) {\n        continue;\n      }\n      customToolNameToProviderToolName[tool2.name] = providerToolName;\n      providerToolNameToCustomToolName[providerToolName] = tool2.name;\n    }\n  }\n  return {\n    toProviderToolName: (customToolName) => {\n      var _a3;\n      return (_a3 = customToolNameToProviderToolName[customToolName]) != null ? _a3 : customToolName;\n    },\n    toCustomToolName: (providerToolName) => {\n      var _a3;\n      return (_a3 = providerToolNameToCustomToolName[providerToolName]) != null ? _a3 : providerToolName;\n    }\n  };\n}\n\n// src/delay.ts\nasync function delay(delayInMs, options) {\n  if (delayInMs == null) {\n    return;\n  }\n  const signal = options == null ? void 0 : options.abortSignal;\n  return new Promise((resolve2, reject) => {\n    if (signal == null ? void 0 : signal.aborted) {\n      reject(createAbortError());\n      return;\n    }\n    const timeoutId = setTimeout(() => {\n      cleanup();\n      resolve2();\n    }, delayInMs);\n    const cleanup = () => {\n      clearTimeout(timeoutId);\n      signal == null ? void 0 : signal.removeEventListener(\"abort\", onAbort);\n    };\n    const onAbort = () => {\n      cleanup();\n      reject(createAbortError());\n    };\n    signal == null ? void 0 : signal.addEventListener(\"abort\", onAbort);\n  });\n}\nfunction createAbortError() {\n  return new DOMException(\"Delay was aborted\", \"AbortError\");\n}\n\n// src/delayed-promise.ts\nvar DelayedPromise = class {\n  constructor() {\n    this.status = { type: \"pending\" };\n    this._resolve = void 0;\n    this._reject = void 0;\n  }\n  get promise() {\n    if (this._promise) {\n      return this._promise;\n    }\n    this._promise = new Promise((resolve2, reject) => {\n      if (this.status.type === \"resolved\") {\n        resolve2(this.status.value);\n      } else if (this.status.type === \"rejected\") {\n        reject(this.status.error);\n      }\n      this._resolve = resolve2;\n      this._reject = reject;\n    });\n    return this._promise;\n  }\n  resolve(value) {\n    var _a2;\n    this.status = { type: \"resolved\", value };\n    if (this._promise) {\n      (_a2 = this._resolve) == null ? void 0 : _a2.call(this, value);\n    }\n  }\n  reject(error) {\n    var _a2;\n    this.status = { type: \"rejected\", error };\n    if (this._promise) {\n      (_a2 = this._reject) == null ? void 0 : _a2.call(this, error);\n    }\n  }\n  isResolved() {\n    return this.status.type === \"resolved\";\n  }\n  isRejected() {\n    return this.status.type === \"rejected\";\n  }\n  isPending() {\n    return this.status.type === \"pending\";\n  }\n};\n\n// src/extract-response-headers.ts\nfunction extractResponseHeaders(response) {\n  return Object.fromEntries([...response.headers]);\n}\n\n// src/uint8-utils.ts\nvar { btoa, atob } = globalThis;\nfunction convertBase64ToUint8Array(base64String) {\n  const base64Url = base64String.replace(/-/g, \"+\").replace(/_/g, \"/\");\n  const latin1string = atob(base64Url);\n  const bytes = new Uint8Array(latin1string.length);\n  for (let i = 0; i < latin1string.length; i++) {\n    bytes[i] = latin1string.charCodeAt(i);\n  }\n  return bytes;\n}\nfunction convertUint8ArrayToBase64(array) {\n  var _a2;\n  if (typeof ((_a2 = globalThis.Buffer) == null ? void 0 : _a2.from) === \"function\") {\n    return globalThis.Buffer.from(\n      array.buffer,\n      array.byteOffset,\n      array.byteLength\n    ).toString(\"base64\");\n  }\n  const chunks = [];\n  const chunkSize = 4096;\n  for (let i = 0; i < array.length; i += chunkSize) {\n    chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));\n  }\n  return btoa(chunks.join(\"\"));\n}\nvar typedArrayTag = Object.getOwnPropertyDescriptor(\n  Object.getPrototypeOf(Uint8Array.prototype),\n  Symbol.toStringTag\n).get;\nvar arrayBufferByteLength = Object.getOwnPropertyDescriptor(\n  ArrayBuffer.prototype,\n  \"byteLength\"\n).get;\nfunction isUint8Array(value) {\n  return ArrayBuffer.isView(value) && typedArrayTag.call(value) === \"Uint8Array\";\n}\nfunction isArrayBuffer(value) {\n  if (typeof value !== \"object\" || value === null || !(\"byteLength\" in value)) {\n    return false;\n  }\n  try {\n    arrayBufferByteLength.call(value);\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\nfunction convertToBase64(value) {\n  return isUint8Array(value) ? convertUint8ArrayToBase64(value) : value;\n}\n\n// src/convert-image-model-file-to-data-uri.ts\nfunction convertImageModelFileToDataUri(file) {\n  if (file.type === \"url\") return file.url;\n  return `data:${file.mediaType};base64,${typeof file.data === \"string\" ? file.data : convertUint8ArrayToBase64(file.data)}`;\n}\n\n// src/convert-to-form-data.ts\nfunction convertToFormData(input, options = {}) {\n  const { useArrayBrackets = true } = options;\n  const formData = new FormData();\n  for (const [key, value] of Object.entries(input)) {\n    if (value == null) {\n      continue;\n    }\n    if (Array.isArray(value)) {\n      if (value.length === 1) {\n        formData.append(key, value[0]);\n        continue;\n      }\n      const arrayKey = useArrayBrackets ? `${key}[]` : key;\n      for (const item of value) {\n        formData.append(arrayKey, item);\n      }\n      continue;\n    }\n    formData.append(key, value);\n  }\n  return formData;\n}\n\n// src/cancel-response-body.ts\nasync function cancelResponseBody(response) {\n  var _a2;\n  try {\n    await ((_a2 = response.body) == null ? void 0 : _a2.cancel());\n  } catch (e) {\n  }\n}\n\n// src/download-error.ts\nimport { AISDKError } from \"@ai-sdk/provider\";\nvar name = \"AI_DownloadError\";\nvar marker = `vercel.ai.error.${name}`;\nvar symbol = Symbol.for(marker);\nvar _a, _b;\nvar DownloadError = class extends (_b = AISDKError, _a = symbol, _b) {\n  constructor({\n    url,\n    statusCode,\n    statusText,\n    cause,\n    message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}`\n  }) {\n    super({ name, message, cause });\n    this[_a] = true;\n    this.url = url;\n    this.statusCode = statusCode;\n    this.statusText = statusText;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker);\n  }\n};\n\n// src/is-browser-runtime.ts\nfunction isBrowserRuntime(globalThisAny = globalThis) {\n  return globalThisAny.window != null;\n}\n\n// src/is-same-origin.ts\nfunction isSameOrigin(url, baseUrl) {\n  try {\n    return new URL(url).origin === new URL(baseUrl).origin;\n  } catch (e) {\n    return false;\n  }\n}\n\n// src/validate-download-url.ts\nfunction validateDownloadUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch (e) {\n    throw new DownloadError({\n      url,\n      message: `Invalid URL: ${url}`\n    });\n  }\n  if (parsed.protocol === \"data:\") {\n    return;\n  }\n  if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") {\n    throw new DownloadError({\n      url,\n      message: `URL scheme must be http, https, or data, got ${parsed.protocol}`\n    });\n  }\n  const hostname = parsed.hostname.toLowerCase().replace(/\\.+$/, \"\");\n  if (!hostname) {\n    throw new DownloadError({\n      url,\n      message: `URL must have a hostname`\n    });\n  }\n  if (hostname === \"localhost\" || hostname.endsWith(\".local\") || hostname.endsWith(\".localhost\") || hostname.endsWith(\".internal\")) {\n    throw new DownloadError({\n      url,\n      message: `URL with hostname ${hostname} is not allowed`\n    });\n  }\n  if (hostname.startsWith(\"[\") && hostname.endsWith(\"]\")) {\n    const ipv6 = hostname.slice(1, -1);\n    if (isPrivateIPv6(ipv6)) {\n      throw new DownloadError({\n        url,\n        message: `URL with IPv6 address ${hostname} is not allowed`\n      });\n    }\n    return;\n  }\n  if (isIPv4(hostname)) {\n    if (isPrivateIPv4(hostname)) {\n      throw new DownloadError({\n        url,\n        message: `URL with IP address ${hostname} is not allowed`\n      });\n    }\n  }\n}\nfunction validateDownloadAddress({\n  address,\n  family,\n  hostname\n}) {\n  const isUnsafe = family === 4 ? !isIPv4(address) || isPrivateIPv4(address) : family === 6 ? isPrivateIPv6(address) : true;\n  if (isUnsafe) {\n    throw new DownloadError({\n      url: hostname,\n      message: `Hostname ${hostname} resolved to disallowed IP address ${address}`\n    });\n  }\n}\nfunction isIPv4(hostname) {\n  const parts = hostname.split(\".\");\n  if (parts.length !== 4) return false;\n  return parts.every((part) => {\n    const num = Number(part);\n    return Number.isInteger(num) && num >= 0 && num <= 255 && String(num) === part;\n  });\n}\nfunction isPrivateIPv4(ip) {\n  const parts = ip.split(\".\").map(Number);\n  const [a, b, c] = parts;\n  if (a === 0) return true;\n  if (a === 10) return true;\n  if (a === 100 && b >= 64 && b <= 127) return true;\n  if (a === 127) return true;\n  if (a === 169 && b === 254) return true;\n  if (a === 172 && b >= 16 && b <= 31) return true;\n  if (a === 192 && b === 0 && c === 0) return true;\n  if (a === 192 && b === 168) return true;\n  if (a === 198 && (b === 18 || b === 19)) return true;\n  if (a >= 240) return true;\n  return false;\n}\nfunction parseIPv6(ip) {\n  let address = ip.toLowerCase();\n  const zoneIndex = address.indexOf(\"%\");\n  if (zoneIndex !== -1) {\n    address = address.slice(0, zoneIndex);\n  }\n  const halves = address.split(\"::\");\n  if (halves.length > 2) return null;\n  const toGroups = (segment) => {\n    if (segment === \"\") return [];\n    const groups = [];\n    const parts = segment.split(\":\");\n    for (let i = 0; i < parts.length; i++) {\n      const part = parts[i];\n      if (part.includes(\".\")) {\n        if (i !== parts.length - 1 || !isIPv4(part)) return null;\n        const [a, b, c, d] = part.split(\".\").map(Number);\n        groups.push(a << 8 | b, c << 8 | d);\n        continue;\n      }\n      if (!/^[0-9a-f]{1,4}$/.test(part)) return null;\n      groups.push(parseInt(part, 16));\n    }\n    return groups;\n  };\n  const head = toGroups(halves[0]);\n  if (head === null) return null;\n  if (halves.length === 2) {\n    const tail = toGroups(halves[1]);\n    if (tail === null) return null;\n    const fill = 8 - head.length - tail.length;\n    if (fill < 0) return null;\n    return [...head, ...new Array(fill).fill(0), ...tail];\n  }\n  return head.length === 8 ? head : null;\n}\nfunction isPrivateIPv6(ip) {\n  const groups = parseIPv6(ip);\n  if (groups === null) return true;\n  const topZero = (count) => groups.slice(0, count).every((group) => group === 0);\n  if (topZero(7) && (groups[7] === 0 || groups[7] === 1)) return true;\n  if ((groups[0] & 65024) === 64512) return true;\n  if ((groups[0] & 65472) === 65152) return true;\n  if ((groups[0] & 65472) === 65216) return true;\n  if ((groups[0] & 65280) === 65280) return true;\n  const embedsIPv4 = (\n    // ::/96 — IPv4-compatible (deprecated)\n    topZero(6) || // ::ffff:0:0/96 — IPv4-mapped (ffff in group 5)\n    topZero(5) && groups[5] === 65535 || // ::ffff:0:0/96 — IPv4-translated form (ffff in group 4, group 5 zero)\n    topZero(4) && groups[4] === 65535 && groups[5] === 0 || // 64:ff9b::/96 — NAT64 well-known prefix\n    groups[0] === 100 && groups[1] === 65435 && groups[2] === 0 && groups[3] === 0 && groups[4] === 0 && groups[5] === 0 || // 64:ff9b:1::/48 — NAT64 local-use prefix\n    groups[0] === 100 && groups[1] === 65435 && groups[2] === 1\n  );\n  if (embedsIPv4) {\n    const a = groups[6] >> 8 & 255;\n    const b = groups[6] & 255;\n    const c = groups[7] >> 8 & 255;\n    const d = groups[7] & 255;\n    return isPrivateIPv4(`${a}.${b}.${c}.${d}`);\n  }\n  return false;\n}\n\n// src/safe-node-fetch.ts\nfunction createSafeLookup(lookup) {\n  return ((hostname, options, callback) => {\n    lookup(hostname, { ...options, all: true }, (error, addresses) => {\n      if (error) {\n        callback(error);\n        return;\n      }\n      try {\n        const [firstAddress] = addresses;\n        if (firstAddress == null) {\n          throw new Error(`Hostname ${hostname} did not resolve to an address`);\n        }\n        for (const { address, family } of addresses) {\n          validateDownloadAddress({ address, family, hostname });\n        }\n        if (options.all === true) {\n          callback(null, addresses);\n        } else {\n          callback(\n            null,\n            firstAddress.address,\n            firstAddress.family\n          );\n        }\n      } catch (error2) {\n        callback(\n          error2 instanceof Error ? error2 : new Error(String(error2))\n        );\n      }\n    });\n  });\n}\nvar safeNodeFetchPromise;\nfunction isNodeRuntime() {\n  var _a2, _b2, _c;\n  const runtimeProcess = globalThis.process;\n  return ((_a2 = runtimeProcess == null ? void 0 : runtimeProcess.release) == null ? void 0 : _a2.name) === \"node\" && ((_b2 = runtimeProcess.versions) == null ? void 0 : _b2.bun) == null && ((_c = runtimeProcess.versions) == null ? void 0 : _c.deno) == null && runtimeProcess.title !== \"workerd\" && globalThis.EdgeRuntime == null;\n}\nasync function getDefaultDownloadFetch() {\n  if (!isNodeRuntime()) {\n    return globalThis.fetch;\n  }\n  return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = createSafeNodeFetch();\n}\nasync function createSafeNodeFetch() {\n  const [module, { lookup }] = await Promise.all([\n    loadNodeModule(\"node:module\"),\n    loadNodeModule(\"node:dns\")\n  ]);\n  const nodeRequire = module.createRequire(getCurrentModulePath());\n  const { Agent, fetch } = nodeRequire(\"undici\");\n  const dispatcher = new Agent({\n    connect: {\n      lookup: createSafeLookup(lookup)\n    }\n  });\n  return ((input, init) => fetch(\n    input,\n    {\n      ...init,\n      dispatcher\n    }\n  ));\n}\nasync function loadNodeModule(id) {\n  var _a2;\n  const processWithBuiltins = globalThis.process;\n  const builtinModule = (_a2 = processWithBuiltins == null ? void 0 : processWithBuiltins.getBuiltinModule) == null ? void 0 : _a2.call(processWithBuiltins, id);\n  if (builtinModule == null) {\n    throw new Error(`Node.js built-in module ${id} is unavailable`);\n  }\n  return builtinModule;\n}\nfunction getCurrentModulePath() {\n  const originalPrepareStackTrace = Error.prepareStackTrace;\n  try {\n    Error.prepareStackTrace = (_error, callSites) => callSites;\n    const error = new Error(\"Capture current module path\");\n    Error.captureStackTrace(error, getCurrentModulePath);\n    const [caller] = error.stack;\n    const fileName = caller == null ? void 0 : caller.getFileName();\n    if (fileName == null) {\n      throw new Error(\"Unable to determine the current module path\");\n    }\n    return fileName;\n  } finally {\n    Error.prepareStackTrace = originalPrepareStackTrace;\n  }\n}\n\n// src/sanitize-request-headers.ts\nvar BLOCKED_REQUEST_HEADERS = [\n  // Hop-by-hop / transport (RFC 7230 §6.1)\n  \"connection\",\n  \"keep-alive\",\n  \"te\",\n  \"trailer\",\n  \"transfer-encoding\",\n  \"upgrade\",\n  // Host / virtual-host routing\n  \"host\",\n  // Proxy / origin spoofing\n  \"forwarded\",\n  \"proxy-authorization\",\n  \"via\",\n  \"x-forwarded-for\",\n  \"x-forwarded-host\",\n  \"x-forwarded-proto\",\n  \"x-real-ip\",\n  // Cloud metadata (GCP, AWS IMDSv1/v2, Azure, Alibaba, DigitalOcean)\n  \"metadata\",\n  \"metadata-flavor\",\n  \"x-aws-ec2-metadata-token\",\n  \"x-metadata-token\",\n  // Session / cookie\n  \"cookie\",\n  \"set-cookie\"\n];\nfunction sanitizeRequestHeaders(input) {\n  const headers = new Headers(input);\n  for (const name2 of BLOCKED_REQUEST_HEADERS) {\n    headers.delete(name2);\n  }\n  return headers;\n}\n\n// src/fetch-with-validated-redirects.ts\nvar MAX_DOWNLOAD_REDIRECTS = 10;\nvar REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);\nasync function getValidatedFetch(customFetch) {\n  return customFetch == null || customFetch === globalThis.fetch ? await getDefaultDownloadFetch() : customFetch;\n}\nasync function fetchWithValidatedEndpoint({\n  url,\n  init,\n  fetch: customFetch,\n  trustedOrigin,\n  redirect = \"error\",\n  requireDnsValidation = false\n}) {\n  const urlText = url.toString();\n  const isTrusted = trustedOrigin !== void 0 && isSameOrigin(urlText, trustedOrigin);\n  if (!isTrusted) {\n    validateDownloadUrl(urlText);\n    if (requireDnsValidation && (customFetch == null || customFetch === globalThis.fetch) && !isNodeRuntime() && // A window alias alone does not distinguish older Deno from a browser.\n    !(isBrowserRuntime() && typeof document !== \"undefined\")) {\n      throw new DownloadError({\n        url: urlText,\n        message: \"This server runtime requires a custom fetch with connect-time DNS validation for untrusted URLs\"\n      });\n    }\n  }\n  const fetch = isTrusted && customFetch != null ? customFetch : isTrusted ? globalThis.fetch : await getValidatedFetch(customFetch);\n  return await fetch(url, {\n    ...init,\n    redirect\n  });\n}\nasync function fetchWithValidatedRedirects({\n  url,\n  headers,\n  abortSignal,\n  maxRedirects = MAX_DOWNLOAD_REDIRECTS,\n  fetch: customFetch,\n  trustedOrigin\n}) {\n  var _a2;\n  let currentHeaders = headers === void 0 ? void 0 : sanitizeRequestHeaders(headers);\n  const perHopInit = (redirect) => {\n    const init = { signal: abortSignal, redirect };\n    if (currentHeaders !== void 0) {\n      init.headers = new Headers(currentHeaders);\n    }\n    return init;\n  };\n  let currentUrl = url;\n  for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) {\n    const isTrustedHop = trustedOrigin !== void 0 && isSameOrigin(currentUrl, trustedOrigin);\n    if (!isTrustedHop) {\n      validateDownloadUrl(currentUrl);\n    }\n    const fetch = isTrustedHop && customFetch != null ? customFetch : isTrustedHop ? globalThis.fetch : await getValidatedFetch(customFetch);\n    const response = await fetch(currentUrl, perHopInit(\"manual\"));\n    if (response.type === \"opaqueredirect\") {\n      if (!isBrowserRuntime()) {\n        throw new DownloadError({\n          url,\n          message: `Redirect from ${currentUrl} could not be validated and was blocked`\n        });\n      }\n      return await fetch(currentUrl, perHopInit(\"follow\"));\n    }\n    const location = (_a2 = response.headers) == null ? void 0 : _a2.get(\"location\");\n    if (REDIRECT_STATUS_CODES.has(response.status) && location) {\n      void cancelResponseBody(response);\n      const nextUrl = new URL(location, currentUrl).toString();\n      if (new URL(currentUrl).protocol === \"https:\" && new URL(nextUrl).protocol === \"http:\") {\n        throw new DownloadError({\n          url,\n          message: \"Redirect from HTTPS to HTTP was blocked\"\n        });\n      }\n      if (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {\n        const userAgent = currentHeaders.get(\"user-agent\");\n        currentHeaders = new Headers(\n          userAgent == null ? void 0 : { \"user-agent\": userAgent }\n        );\n      }\n      currentUrl = nextUrl;\n      continue;\n    }\n    return response;\n  }\n  throw new DownloadError({\n    url,\n    message: `Too many redirects (max ${maxRedirects})`\n  });\n}\n\n// src/read-response-with-size-limit.ts\nvar DEFAULT_MAX_DOWNLOAD_SIZE = 2 * 1024 * 1024 * 1024;\nasync function readResponseWithSizeLimit({\n  response,\n  url,\n  maxBytes = DEFAULT_MAX_DOWNLOAD_SIZE\n}) {\n  const contentLength = response.headers.get(\"content-length\");\n  if (contentLength != null) {\n    const length = parseInt(contentLength, 10);\n    if (!isNaN(length) && length > maxBytes) {\n      await cancelResponseBody(response);\n      throw new DownloadError({\n        url,\n        message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes (Content-Length: ${length}).`\n      });\n    }\n  }\n  const body = response.body;\n  if (body == null) {\n    return new Uint8Array(0);\n  }\n  const reader = body.getReader();\n  const chunks = [];\n  let totalBytes = 0;\n  try {\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) {\n        break;\n      }\n      totalBytes += value.length;\n      if (totalBytes > maxBytes) {\n        throw new DownloadError({\n          url,\n          message: `Download of ${url} exceeded maximum size of ${maxBytes} bytes.`\n        });\n      }\n      chunks.push(value);\n    }\n  } finally {\n    try {\n      await reader.cancel();\n    } catch (e) {\n    } finally {\n      reader.releaseLock();\n    }\n  }\n  const result = new Uint8Array(totalBytes);\n  let offset = 0;\n  for (const chunk of chunks) {\n    result.set(chunk, offset);\n    offset += chunk.length;\n  }\n  return result;\n}\n\n// src/download-blob.ts\nasync function downloadBlob(url, options) {\n  var _a2, _b2;\n  try {\n    const response = await fetchWithValidatedRedirects({\n      url,\n      abortSignal: options == null ? void 0 : options.abortSignal\n    });\n    if (!response.ok) {\n      await cancelResponseBody(response);\n      throw new DownloadError({\n        url,\n        statusCode: response.status,\n        statusText: response.statusText\n      });\n    }\n    const data = await readResponseWithSizeLimit({\n      response,\n      url,\n      maxBytes: (_a2 = options == null ? void 0 : options.maxBytes) != null ? _a2 : DEFAULT_MAX_DOWNLOAD_SIZE\n    });\n    const contentType = (_b2 = response.headers.get(\"content-type\")) != null ? _b2 : void 0;\n    return new Blob([data], contentType ? { type: contentType } : void 0);\n  } catch (error) {\n    if (DownloadError.isInstance(error)) {\n      throw error;\n    }\n    throw new DownloadError({ url, cause: error });\n  }\n}\n\n// src/embedding-model-capabilities.ts\nvar EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = /* @__PURE__ */ Symbol.for(\n  \"vercel.ai.embeddingModel.maxInputBytesPerCall\"\n);\nvar EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER = /* @__PURE__ */ Symbol.for(\n  \"vercel.ai.embeddingModel.providerOptionsTransformer\"\n);\n\n// src/generate-id.ts\nimport { InvalidArgumentError } from \"@ai-sdk/provider\";\nvar createIdGenerator = ({\n  prefix,\n  size = 16,\n  alphabet = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n  separator = \"-\"\n} = {}) => {\n  const generator = () => {\n    const alphabetLength = alphabet.length;\n    const chars = new Array(size);\n    for (let i = 0; i < size; i++) {\n      chars[i] = alphabet[Math.random() * alphabetLength | 0];\n    }\n    return chars.join(\"\");\n  };\n  if (prefix == null) {\n    return generator;\n  }\n  if (alphabet.includes(separator)) {\n    throw new InvalidArgumentError({\n      argument: \"separator\",\n      message: `The separator \"${separator}\" must not be part of the alphabet \"${alphabet}\".`\n    });\n  }\n  return () => `${prefix}${separator}${generator()}`;\n};\nvar generateId = createIdGenerator();\n\n// src/encode-path-segment.ts\nfunction encodePathSegment(value) {\n  const encodedValue = encodeURIComponent(value);\n  return encodedValue === \".\" ? \"%252E\" : encodedValue === \"..\" ? \"%252E%252E\" : encodedValue;\n}\n\n// src/get-error-message.ts\nfunction getErrorMessage(error) {\n  if (error == null) {\n    return \"unknown error\";\n  }\n  if (typeof error === \"string\") {\n    return error;\n  }\n  if (error instanceof Error) {\n    return error.message;\n  }\n  return JSON.stringify(error);\n}\n\n// src/get-from-api.ts\nimport { APICallError as APICallError2 } from \"@ai-sdk/provider\";\n\n// src/handle-fetch-error.ts\nimport { APICallError } from \"@ai-sdk/provider\";\n\n// src/is-abort-error.ts\nfunction isAbortError(error) {\n  return (error instanceof Error || error instanceof DOMException) && (error.name === \"AbortError\" || error.name === \"ResponseAborted\" || // Next.js\n  error.name === \"TimeoutError\");\n}\n\n// src/handle-fetch-error.ts\nvar FETCH_FAILED_ERROR_MESSAGES = [\"fetch failed\", \"failed to fetch\"];\nvar RETRYABLE_NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([\n  \"ConnectionRefused\",\n  \"ConnectionClosed\",\n  \"FailedToOpenSocket\",\n  \"ECONNRESET\",\n  \"ECONNREFUSED\",\n  \"ETIMEDOUT\",\n  \"EPIPE\",\n  \"UND_ERR_SOCKET\",\n  \"UND_ERR_HEADERS_TIMEOUT\",\n  \"UND_ERR_BODY_TIMEOUT\",\n  \"UND_ERR_CONNECT_TIMEOUT\"\n]);\nfunction findNetworkError(error) {\n  const visited = /* @__PURE__ */ new Set();\n  let current = error;\n  while (current instanceof Error && !visited.has(current)) {\n    visited.add(current);\n    const errorWithCode = current;\n    if (typeof errorWithCode.code === \"string\" && RETRYABLE_NETWORK_ERROR_CODES.has(errorWithCode.code)) {\n      return errorWithCode;\n    }\n    current = current.cause;\n  }\n  return void 0;\n}\nfunction handleFetchError({\n  error,\n  url,\n  requestBodyValues\n}) {\n  if (isAbortError(error)) {\n    return error;\n  }\n  if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) {\n    const cause = error.cause;\n    if (cause != null) {\n      return new APICallError({\n        message: `Cannot connect to API: ${cause.message}`,\n        cause,\n        url,\n        requestBodyValues,\n        isRetryable: true\n        // retry when network error\n      });\n    }\n  }\n  const networkError = findNetworkError(error);\n  if (networkError != null) {\n    if (APICallError.isInstance(error)) {\n      return new APICallError({\n        message: error.message,\n        cause: error.cause,\n        url: error.url,\n        requestBodyValues: error.requestBodyValues,\n        statusCode: error.statusCode,\n        responseHeaders: error.responseHeaders,\n        responseBody: error.responseBody,\n        data: error.data,\n        isRetryable: true\n      });\n    }\n    return new APICallError({\n      message: `Cannot connect to API: ${error instanceof Error ? error.message : networkError.message}`,\n      cause: error,\n      url,\n      requestBodyValues,\n      isRetryable: true\n    });\n  }\n  return error;\n}\n\n// src/get-runtime-environment-user-agent.ts\nfunction getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {\n  var _a2, _b2, _c;\n  if (globalThisAny.window) {\n    return `runtime/browser`;\n  }\n  if ((_a2 = globalThisAny.navigator) == null ? void 0 : _a2.userAgent) {\n    return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;\n  }\n  if ((_c = (_b2 = globalThisAny.process) == null ? void 0 : _b2.versions) == null ? void 0 : _c.node) {\n    return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;\n  }\n  if (globalThisAny.EdgeRuntime) {\n    return `runtime/vercel-edge`;\n  }\n  return \"runtime/unknown\";\n}\n\n// src/normalize-headers.ts\nfunction normalizeHeaders(headers) {\n  if (headers == null) {\n    return {};\n  }\n  const normalized = {};\n  if (headers instanceof Headers) {\n    headers.forEach((value, key) => {\n      normalized[key.toLowerCase()] = value;\n    });\n  } else {\n    if (!Array.isArray(headers)) {\n      headers = Object.entries(headers);\n    }\n    for (const [key, value] of headers) {\n      if (value != null) {\n        normalized[key.toLowerCase()] = value;\n      }\n    }\n  }\n  return normalized;\n}\n\n// src/with-user-agent-suffix.ts\nfunction withUserAgentSuffix(headers, ...userAgentSuffixParts) {\n  const normalizedHeaders = new Headers(normalizeHeaders(headers));\n  const currentUserAgentHeader = normalizedHeaders.get(\"user-agent\") || \"\";\n  normalizedHeaders.set(\n    \"user-agent\",\n    [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(\" \")\n  );\n  return Object.fromEntries(normalizedHeaders.entries());\n}\n\n// src/version.ts\nvar VERSION = true ? \"4.0.66\" : \"0.0.0-test\";\n\n// src/get-from-api.ts\nvar getOriginalFetch = () => globalThis.fetch;\nvar getFromApi = async ({\n  url,\n  headers = {},\n  successfulResponseHandler,\n  failedResponseHandler,\n  abortSignal,\n  fetch,\n  validateUrl,\n  credentialedOrigin,\n  trustedOrigin\n}) => {\n  try {\n    const requestFetch = fetch != null ? fetch : getOriginalFetch();\n    const outgoingHeaders = credentialedOrigin !== void 0 && !isSameOrigin(url, credentialedOrigin) ? {} : headers;\n    const requestHeaders = withUserAgentSuffix(\n      outgoingHeaders,\n      `ai-sdk/provider-utils/${VERSION}`,\n      getRuntimeEnvironmentUserAgent()\n    );\n    const response = validateUrl ? await fetchWithValidatedRedirects({\n      url,\n      headers: requestHeaders,\n      abortSignal,\n      fetch,\n      trustedOrigin\n    }) : await requestFetch(url, {\n      method: \"GET\",\n      headers: requestHeaders,\n      signal: abortSignal\n    });\n    const responseHeaders = extractResponseHeaders(response);\n    if (!response.ok) {\n      let errorInformation;\n      try {\n        errorInformation = await failedResponseHandler({\n          response,\n          url,\n          requestBodyValues: {}\n        });\n      } catch (error) {\n        if (isAbortError(error) || APICallError2.isInstance(error)) {\n          throw error;\n        }\n        throw new APICallError2({\n          message: \"Failed to process error response\",\n          cause: error,\n          statusCode: response.status,\n          url,\n          responseHeaders,\n          requestBodyValues: {}\n        });\n      }\n      throw errorInformation.value;\n    }\n    try {\n      return await successfulResponseHandler({\n        response,\n        url,\n        requestBodyValues: {}\n      });\n    } catch (error) {\n      if (error instanceof Error) {\n        if (isAbortError(error) || APICallError2.isInstance(error)) {\n          throw error;\n        }\n      }\n      throw new APICallError2({\n        message: \"Failed to process successful response\",\n        cause: error,\n        statusCode: response.status,\n        url,\n        responseHeaders,\n        requestBodyValues: {}\n      });\n    }\n  } catch (error) {\n    throw handleFetchError({ error, url, requestBodyValues: {} });\n  }\n};\n\n// src/inject-json-instruction.ts\nvar DEFAULT_SCHEMA_PREFIX = \"JSON schema:\";\nvar DEFAULT_SCHEMA_SUFFIX = \"You MUST answer with a JSON object that matches the JSON schema above.\";\nvar DEFAULT_GENERIC_SUFFIX = \"You MUST answer with JSON.\";\nfunction injectJsonInstruction({\n  prompt,\n  schema,\n  schemaPrefix = schema != null ? DEFAULT_SCHEMA_PREFIX : void 0,\n  schemaSuffix = schema != null ? DEFAULT_SCHEMA_SUFFIX : DEFAULT_GENERIC_SUFFIX\n}) {\n  return [\n    prompt != null && prompt.length > 0 ? prompt : void 0,\n    prompt != null && prompt.length > 0 ? \"\" : void 0,\n    // add a newline if prompt is not null\n    schemaPrefix,\n    schema != null ? JSON.stringify(schema) : void 0,\n    schemaSuffix\n  ].filter((line) => line != null).join(\"\\n\");\n}\nfunction injectJsonInstructionIntoMessages({\n  messages,\n  schema,\n  schemaPrefix,\n  schemaSuffix\n}) {\n  var _a2, _b2;\n  const systemMessage = ((_a2 = messages[0]) == null ? void 0 : _a2.role) === \"system\" ? { ...messages[0] } : { role: \"system\", content: \"\" };\n  systemMessage.content = injectJsonInstruction({\n    prompt: systemMessage.content,\n    schema,\n    schemaPrefix,\n    schemaSuffix\n  });\n  return [\n    systemMessage,\n    ...((_b2 = messages[0]) == null ? void 0 : _b2.role) === \"system\" ? messages.slice(1) : messages\n  ];\n}\n\n// src/is-non-nullable.ts\nfunction isNonNullable(value) {\n  return value != null;\n}\n\n// src/is-url-supported.ts\nfunction isUrlSupported({\n  mediaType,\n  url,\n  supportedUrls\n}) {\n  mediaType = mediaType.toLowerCase();\n  return Object.entries(supportedUrls).map(([key, value]) => {\n    const mediaType2 = key.toLowerCase();\n    return mediaType2 === \"*\" || mediaType2 === \"*/*\" ? { mediaTypePrefix: \"\", regexes: value } : { mediaTypePrefix: mediaType2.replace(/\\*/, \"\"), regexes: value };\n  }).filter(\n    ({ mediaTypePrefix }) => mediaTypePrefix === \"\" || mediaTypePrefix.endsWith(\"/\") ? mediaType.startsWith(mediaTypePrefix) : mediaType === mediaTypePrefix\n  ).flatMap(({ regexes }) => regexes).some((pattern) => pattern.test(url));\n}\n\n// src/load-api-key.ts\nimport { LoadAPIKeyError } from \"@ai-sdk/provider\";\nfunction loadApiKey({\n  apiKey,\n  environmentVariableName,\n  apiKeyParameterName = \"apiKey\",\n  description\n}) {\n  if (typeof apiKey === \"string\") {\n    return apiKey;\n  }\n  if (apiKey != null) {\n    throw new LoadAPIKeyError({\n      message: `${description} API key must be a string.`\n    });\n  }\n  if (typeof process === \"undefined\") {\n    throw new LoadAPIKeyError({\n      message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`\n    });\n  }\n  apiKey = process.env[environmentVariableName];\n  if (apiKey == null) {\n    throw new LoadAPIKeyError({\n      message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`\n    });\n  }\n  if (typeof apiKey !== \"string\") {\n    throw new LoadAPIKeyError({\n      message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`\n    });\n  }\n  return apiKey;\n}\n\n// src/load-optional-setting.ts\nfunction loadOptionalSetting({\n  settingValue,\n  environmentVariableName\n}) {\n  if (typeof settingValue === \"string\") {\n    return settingValue;\n  }\n  if (settingValue != null || typeof process === \"undefined\") {\n    return void 0;\n  }\n  settingValue = process.env[environmentVariableName];\n  if (settingValue == null || typeof settingValue !== \"string\") {\n    return void 0;\n  }\n  return settingValue;\n}\n\n// src/load-setting.ts\nimport { LoadSettingError } from \"@ai-sdk/provider\";\nfunction loadSetting({\n  settingValue,\n  environmentVariableName,\n  settingName,\n  description\n}) {\n  if (typeof settingValue === \"string\") {\n    return settingValue;\n  }\n  if (settingValue != null) {\n    throw new LoadSettingError({\n      message: `${description} setting must be a string.`\n    });\n  }\n  if (typeof process === \"undefined\") {\n    throw new LoadSettingError({\n      message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.`\n    });\n  }\n  settingValue = process.env[environmentVariableName];\n  if (settingValue == null) {\n    throw new LoadSettingError({\n      message: `${description} setting is missing. Pass it using the '${settingName}' parameter or the ${environmentVariableName} environment variable.`\n    });\n  }\n  if (typeof settingValue !== \"string\") {\n    throw new LoadSettingError({\n      message: `${description} setting must be a string. The value of the ${environmentVariableName} environment variable is not a string.`\n    });\n  }\n  return settingValue;\n}\n\n// src/media-type-to-extension.ts\nfunction mediaTypeToExtension(mediaType) {\n  var _a2;\n  const [_type, subtype = \"\"] = mediaType.toLowerCase().split(\"/\");\n  return (_a2 = {\n    mpeg: \"mp3\",\n    \"x-wav\": \"wav\",\n    opus: \"ogg\",\n    mp4: \"m4a\",\n    \"x-m4a\": \"m4a\"\n  }[subtype]) != null ? _a2 : subtype;\n}\n\n// src/parse-json.ts\nimport {\n  JSONParseError,\n  TypeValidationError as TypeValidationError3\n} from \"@ai-sdk/provider\";\n\n// src/secure-json-parse.ts\nvar suspectProtoRx = /\"(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])\"\\s*:/;\nvar suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\nfunction _parse(text) {\n  const obj = JSON.parse(text);\n  if (obj === null || typeof obj !== \"object\") {\n    return obj;\n  }\n  if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {\n    return obj;\n  }\n  return filter(obj);\n}\nfunction filter(obj) {\n  let next = [obj];\n  while (next.length) {\n    const nodes = next;\n    next = [];\n    for (const node of nodes) {\n      if (Object.prototype.hasOwnProperty.call(node, \"__proto__\")) {\n        throw new SyntaxError(\"Object contains forbidden prototype property\");\n      }\n      if (Object.prototype.hasOwnProperty.call(node, \"constructor\") && node.constructor !== null && typeof node.constructor === \"object\" && Object.prototype.hasOwnProperty.call(node.constructor, \"prototype\")) {\n        throw new SyntaxError(\"Object contains forbidden prototype property\");\n      }\n      for (const key in node) {\n        const value = node[key];\n        if (value && typeof value === \"object\") {\n          next.push(value);\n        }\n      }\n    }\n  }\n  return obj;\n}\nfunction secureJsonParse(text) {\n  const { stackTraceLimit } = Error;\n  try {\n    Error.stackTraceLimit = 0;\n  } catch (e) {\n    return _parse(text);\n  }\n  try {\n    return _parse(text);\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit;\n  }\n}\n\n// src/validate-types.ts\nimport {\n  TypeValidationError as TypeValidationError2\n} from \"@ai-sdk/provider\";\n\n// src/schema.ts\nimport { TypeValidationError } from \"@ai-sdk/provider\";\nimport * as z4 from \"zod/v4\";\n\n// src/add-additional-properties-to-json-schema.ts\nfunction addAdditionalPropertiesToJsonSchema(jsonSchema2) {\n  if (jsonSchema2.type === \"object\" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes(\"object\")) {\n    const { additionalProperties } = jsonSchema2;\n    jsonSchema2.additionalProperties = additionalProperties != null && typeof additionalProperties !== \"boolean\" ? visit(additionalProperties) : false;\n    const { properties } = jsonSchema2;\n    if (properties != null) {\n      for (const key of Object.keys(properties)) {\n        properties[key] = visit(properties[key]);\n      }\n    }\n  }\n  if (jsonSchema2.items != null) {\n    jsonSchema2.items = Array.isArray(jsonSchema2.items) ? jsonSchema2.items.map(visit) : visit(jsonSchema2.items);\n  }\n  if (jsonSchema2.anyOf != null) {\n    jsonSchema2.anyOf = jsonSchema2.anyOf.map(visit);\n  }\n  if (jsonSchema2.allOf != null) {\n    jsonSchema2.allOf = jsonSchema2.allOf.map(visit);\n  }\n  if (jsonSchema2.oneOf != null) {\n    jsonSchema2.oneOf = jsonSchema2.oneOf.map(visit);\n  }\n  const { definitions } = jsonSchema2;\n  if (definitions != null) {\n    for (const key of Object.keys(definitions)) {\n      definitions[key] = visit(definitions[key]);\n    }\n  }\n  return jsonSchema2;\n}\nfunction visit(def) {\n  if (typeof def === \"boolean\") return def;\n  return addAdditionalPropertiesToJsonSchema(def);\n}\n\n// src/to-json-schema/zod3-to-json-schema/options.ts\nvar ignoreOverride = /* @__PURE__ */ Symbol(\n  \"Let zodToJsonSchema decide on which parser to use\"\n);\nvar defaultOptions = {\n  name: void 0,\n  $refStrategy: \"root\",\n  basePath: [\"#\"],\n  effectStrategy: \"input\",\n  pipeStrategy: \"all\",\n  dateStrategy: \"format:date-time\",\n  mapStrategy: \"entries\",\n  removeAdditionalStrategy: \"passthrough\",\n  allowedAdditionalProperties: true,\n  rejectedAdditionalProperties: false,\n  definitionPath: \"definitions\",\n  strictUnions: false,\n  definitions: {},\n  errorMessages: false,\n  patternStrategy: \"escape\",\n  applyRegexFlags: false,\n  emailStrategy: \"format:email\",\n  base64Strategy: \"contentEncoding:base64\",\n  nameStrategy: \"ref\"\n};\nvar getDefaultOptions = (options) => typeof options === \"string\" ? {\n  ...defaultOptions,\n  name: options\n} : {\n  ...defaultOptions,\n  ...options\n};\n\n// src/to-json-schema/zod3-to-json-schema/select-parser.ts\nimport { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from \"zod/v3\";\n\n// src/to-json-schema/zod3-to-json-schema/parsers/any.ts\nfunction parseAnyDef() {\n  return {};\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/array.ts\nimport { ZodFirstPartyTypeKind } from \"zod/v3\";\nfunction parseArrayDef(def, refs) {\n  var _a2, _b2, _c;\n  const res = {\n    type: \"array\"\n  };\n  if (((_a2 = def.type) == null ? void 0 : _a2._def) && ((_c = (_b2 = def.type) == null ? void 0 : _b2._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {\n    res.items = parseDef(def.type._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"items\"]\n    });\n  }\n  if (def.minLength) {\n    res.minItems = def.minLength.value;\n  }\n  if (def.maxLength) {\n    res.maxItems = def.maxLength.value;\n  }\n  if (def.exactLength) {\n    res.minItems = def.exactLength.value;\n    res.maxItems = def.exactLength.value;\n  }\n  return res;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/bigint.ts\nfunction parseBigintDef(def) {\n  const res = {\n    type: \"integer\",\n    format: \"int64\"\n  };\n  if (!def.checks) return res;\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"min\":\n        if (check.inclusive) {\n          res.minimum = check.value;\n        } else {\n          res.exclusiveMinimum = check.value;\n        }\n        break;\n      case \"max\":\n        if (check.inclusive) {\n          res.maximum = check.value;\n        } else {\n          res.exclusiveMaximum = check.value;\n        }\n        break;\n      case \"multipleOf\":\n        res.multipleOf = check.value;\n        break;\n    }\n  }\n  return res;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/boolean.ts\nfunction parseBooleanDef() {\n  return { type: \"boolean\" };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/branded.ts\nfunction parseBrandedDef(_def, refs) {\n  return parseDef(_def.type._def, refs);\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/catch.ts\nvar parseCatchDef = (def, refs) => {\n  return parseDef(def.innerType._def, refs);\n};\n\n// src/to-json-schema/zod3-to-json-schema/parsers/date.ts\nfunction parseDateDef(def, refs, overrideDateStrategy) {\n  const strategy = overrideDateStrategy != null ? overrideDateStrategy : refs.dateStrategy;\n  if (Array.isArray(strategy)) {\n    return {\n      anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))\n    };\n  }\n  switch (strategy) {\n    case \"string\":\n    case \"format:date-time\":\n      return {\n        type: \"string\",\n        format: \"date-time\"\n      };\n    case \"format:date\":\n      return {\n        type: \"string\",\n        format: \"date\"\n      };\n    case \"integer\":\n      return integerDateParser(def);\n  }\n}\nvar integerDateParser = (def) => {\n  const res = {\n    type: \"integer\",\n    format: \"unix-time\"\n  };\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"min\":\n        res.minimum = check.value;\n        break;\n      case \"max\":\n        res.maximum = check.value;\n        break;\n    }\n  }\n  return res;\n};\n\n// src/to-json-schema/zod3-to-json-schema/parsers/default.ts\nfunction parseDefaultDef(_def, refs) {\n  return {\n    ...parseDef(_def.innerType._def, refs),\n    default: _def.defaultValue()\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/effects.ts\nfunction parseEffectsDef(_def, refs) {\n  return refs.effectStrategy === \"input\" ? parseDef(_def.schema._def, refs) : parseAnyDef();\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/enum.ts\nfunction parseEnumDef(def) {\n  return {\n    type: \"string\",\n    enum: Array.from(def.values)\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/intersection.ts\nvar isJsonSchema7AllOfType = (type) => {\n  if (\"type\" in type && type.type === \"string\") return false;\n  return \"allOf\" in type;\n};\nfunction parseIntersectionDef(def, refs) {\n  const allOf = [\n    parseDef(def.left._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"allOf\", \"0\"]\n    }),\n    parseDef(def.right._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"allOf\", \"1\"]\n    })\n  ].filter((x) => !!x);\n  const mergedAllOf = [];\n  allOf.forEach((schema) => {\n    if (isJsonSchema7AllOfType(schema)) {\n      mergedAllOf.push(...schema.allOf);\n    } else {\n      let nestedSchema = schema;\n      if (\"additionalProperties\" in schema && schema.additionalProperties === false) {\n        const { additionalProperties, ...rest } = schema;\n        nestedSchema = rest;\n      }\n      mergedAllOf.push(nestedSchema);\n    }\n  });\n  return mergedAllOf.length ? { allOf: mergedAllOf } : void 0;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/literal.ts\nfunction parseLiteralDef(def) {\n  const parsedType = typeof def.value;\n  if (parsedType !== \"bigint\" && parsedType !== \"number\" && parsedType !== \"boolean\" && parsedType !== \"string\") {\n    return {\n      type: Array.isArray(def.value) ? \"array\" : \"object\"\n    };\n  }\n  return {\n    type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n    const: def.value\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/record.ts\nimport {\n  ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2\n} from \"zod/v3\";\n\n// src/to-json-schema/zod3-to-json-schema/parsers/string.ts\nvar emojiRegex = void 0;\nvar zodPatterns = {\n  /**\n   * `c` was changed to `[cC]` to replicate /i flag\n   */\n  cuid: /^[cC][^\\s-]{8,}$/,\n  cuid2: /^[0-9a-z]+$/,\n  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,\n  /**\n   * `a-z` was added to replicate /i flag\n   */\n  email: /^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_'+\\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,}$/,\n  /**\n   * Constructed a valid Unicode RegExp\n   *\n   * Lazily instantiate since this type of regex isn't supported\n   * in all envs (e.g. React Native).\n   *\n   * See:\n   * https://github.com/colinhacks/zod/issues/2433\n   * Fix in Zod:\n   * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b\n   */\n  emoji: () => {\n    if (emojiRegex === void 0) {\n      emojiRegex = RegExp(\n        \"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\",\n        \"u\"\n      );\n    }\n    return emojiRegex;\n  },\n  /**\n   * Unused\n   */\n  uuid: /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/,\n  /**\n   * Unused\n   */\n  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,\n  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,\n  /**\n   * Unused\n   */\n  ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,\n  ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,\n  base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,\n  base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,\n  nanoid: /^[a-zA-Z0-9_-]{21}$/,\n  jwt: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/\n};\nfunction parseStringDef(def, refs) {\n  const res = {\n    type: \"string\"\n  };\n  if (def.checks) {\n    for (const check of def.checks) {\n      switch (check.kind) {\n        case \"min\":\n          res.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n          break;\n        case \"max\":\n          res.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n          break;\n        case \"email\":\n          switch (refs.emailStrategy) {\n            case \"format:email\":\n              addFormat(res, \"email\", check.message, refs);\n              break;\n            case \"format:idn-email\":\n              addFormat(res, \"idn-email\", check.message, refs);\n              break;\n            case \"pattern:zod\":\n              addPattern(res, zodPatterns.email, check.message, refs);\n              break;\n          }\n          break;\n        case \"url\":\n          addFormat(res, \"uri\", check.message, refs);\n          break;\n        case \"uuid\":\n          addFormat(res, \"uuid\", check.message, refs);\n          break;\n        case \"regex\":\n          addPattern(res, check.regex, check.message, refs);\n          break;\n        case \"cuid\":\n          addPattern(res, zodPatterns.cuid, check.message, refs);\n          break;\n        case \"cuid2\":\n          addPattern(res, zodPatterns.cuid2, check.message, refs);\n          break;\n        case \"startsWith\":\n          addPattern(\n            res,\n            RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`),\n            check.message,\n            refs\n          );\n          break;\n        case \"endsWith\":\n          addPattern(\n            res,\n            RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`),\n            check.message,\n            refs\n          );\n          break;\n        case \"datetime\":\n          addFormat(res, \"date-time\", check.message, refs);\n          break;\n        case \"date\":\n          addFormat(res, \"date\", check.message, refs);\n          break;\n        case \"time\":\n          addFormat(res, \"time\", check.message, refs);\n          break;\n        case \"duration\":\n          addFormat(res, \"duration\", check.message, refs);\n          break;\n        case \"length\":\n          res.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n          res.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n          break;\n        case \"includes\": {\n          addPattern(\n            res,\n            RegExp(escapeLiteralCheckValue(check.value, refs)),\n            check.message,\n            refs\n          );\n          break;\n        }\n        case \"ip\": {\n          if (check.version !== \"v6\") {\n            addFormat(res, \"ipv4\", check.message, refs);\n          }\n          if (check.version !== \"v4\") {\n            addFormat(res, \"ipv6\", check.message, refs);\n          }\n          break;\n        }\n        case \"base64url\":\n          addPattern(res, zodPatterns.base64url, check.message, refs);\n          break;\n        case \"jwt\":\n          addPattern(res, zodPatterns.jwt, check.message, refs);\n          break;\n        case \"cidr\": {\n          if (check.version !== \"v6\") {\n            addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);\n          }\n          if (check.version !== \"v4\") {\n            addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);\n          }\n          break;\n        }\n        case \"emoji\":\n          addPattern(res, zodPatterns.emoji(), check.message, refs);\n          break;\n        case \"ulid\": {\n          addPattern(res, zodPatterns.ulid, check.message, refs);\n          break;\n        }\n        case \"base64\": {\n          switch (refs.base64Strategy) {\n            case \"format:binary\": {\n              addFormat(res, \"binary\", check.message, refs);\n              break;\n            }\n            case \"contentEncoding:base64\": {\n              res.contentEncoding = \"base64\";\n              break;\n            }\n            case \"pattern:zod\": {\n              addPattern(res, zodPatterns.base64, check.message, refs);\n              break;\n            }\n          }\n          break;\n        }\n        case \"nanoid\": {\n          addPattern(res, zodPatterns.nanoid, check.message, refs);\n        }\n        case \"toLowerCase\":\n        case \"toUpperCase\":\n        case \"trim\":\n          break;\n        default:\n          /* @__PURE__ */ ((_) => {\n          })(check);\n      }\n    }\n  }\n  return res;\n}\nfunction escapeLiteralCheckValue(literal, refs) {\n  return refs.patternStrategy === \"escape\" ? escapeNonAlphaNumeric(literal) : literal;\n}\nvar ALPHA_NUMERIC = new Set(\n  \"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\"\n);\nfunction escapeNonAlphaNumeric(source) {\n  let result = \"\";\n  for (let i = 0; i < source.length; i++) {\n    if (!ALPHA_NUMERIC.has(source[i])) {\n      result += \"\\\\\";\n    }\n    result += source[i];\n  }\n  return result;\n}\nfunction addFormat(schema, value, message, refs) {\n  var _a2;\n  if (schema.format || ((_a2 = schema.anyOf) == null ? void 0 : _a2.some((x) => x.format))) {\n    if (!schema.anyOf) {\n      schema.anyOf = [];\n    }\n    if (schema.format) {\n      schema.anyOf.push({\n        format: schema.format\n      });\n      delete schema.format;\n    }\n    schema.anyOf.push({\n      format: value,\n      ...message && refs.errorMessages && { errorMessage: { format: message } }\n    });\n  } else {\n    schema.format = value;\n  }\n}\nfunction addPattern(schema, regex, message, refs) {\n  var _a2;\n  if (schema.pattern || ((_a2 = schema.allOf) == null ? void 0 : _a2.some((x) => x.pattern))) {\n    if (!schema.allOf) {\n      schema.allOf = [];\n    }\n    if (schema.pattern) {\n      schema.allOf.push({\n        pattern: schema.pattern\n      });\n      delete schema.pattern;\n    }\n    schema.allOf.push({\n      pattern: stringifyRegExpWithFlags(regex, refs),\n      ...message && refs.errorMessages && { errorMessage: { pattern: message } }\n    });\n  } else {\n    schema.pattern = stringifyRegExpWithFlags(regex, refs);\n  }\n}\nfunction stringifyRegExpWithFlags(regex, refs) {\n  var _a2;\n  if (!refs.applyRegexFlags || !regex.flags) {\n    return regex.source;\n  }\n  const flags = {\n    i: regex.flags.includes(\"i\"),\n    // Case-insensitive\n    m: regex.flags.includes(\"m\"),\n    // `^` and `$` matches adjacent to newline characters\n    s: regex.flags.includes(\"s\")\n    // `.` matches newlines\n  };\n  const source = flags.i ? regex.source.toLowerCase() : regex.source;\n  let pattern = \"\";\n  let isEscaped = false;\n  let inCharGroup = false;\n  let inCharRange = false;\n  for (let i = 0; i < source.length; i++) {\n    if (isEscaped) {\n      pattern += source[i];\n      isEscaped = false;\n      continue;\n    }\n    if (flags.i) {\n      if (inCharGroup) {\n        if (source[i].match(/[a-z]/)) {\n          if (inCharRange) {\n            pattern += source[i];\n            pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();\n            inCharRange = false;\n          } else if (source[i + 1] === \"-\" && ((_a2 = source[i + 2]) == null ? void 0 : _a2.match(/[a-z]/))) {\n            pattern += source[i];\n            inCharRange = true;\n          } else {\n            pattern += `${source[i]}${source[i].toUpperCase()}`;\n          }\n          continue;\n        }\n      } else if (source[i].match(/[a-z]/)) {\n        pattern += `[${source[i]}${source[i].toUpperCase()}]`;\n        continue;\n      }\n    }\n    if (flags.m) {\n      if (source[i] === \"^\") {\n        pattern += `(^|(?<=[\\r\n]))`;\n        continue;\n      } else if (source[i] === \"$\") {\n        pattern += `($|(?=[\\r\n]))`;\n        continue;\n      }\n    }\n    if (flags.s && source[i] === \".\") {\n      pattern += inCharGroup ? `${source[i]}\\r\n` : `[${source[i]}\\r\n]`;\n      continue;\n    }\n    pattern += source[i];\n    if (source[i] === \"\\\\\") {\n      isEscaped = true;\n    } else if (inCharGroup && source[i] === \"]\") {\n      inCharGroup = false;\n    } else if (!inCharGroup && source[i] === \"[\") {\n      inCharGroup = true;\n    }\n  }\n  try {\n    new RegExp(pattern);\n  } catch (e) {\n    console.warn(\n      `Could not convert regex pattern at ${refs.currentPath.join(\n        \"/\"\n      )} to a flag-independent form! Falling back to the flag-ignorant source`\n    );\n    return regex.source;\n  }\n  return pattern;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/record.ts\nfunction parseRecordDef(def, refs) {\n  var _a2, _b2, _c, _d, _e, _f;\n  const schema = {\n    type: \"object\",\n    additionalProperties: (_a2 = parseDef(def.valueType._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"additionalProperties\"]\n    })) != null ? _a2 : refs.allowedAdditionalProperties\n  };\n  if (((_b2 = def.keyType) == null ? void 0 : _b2._def.typeName) === ZodFirstPartyTypeKind2.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {\n    const { type, ...keyType } = parseStringDef(def.keyType._def, refs);\n    return {\n      ...schema,\n      propertyNames: keyType\n    };\n  } else if (((_d = def.keyType) == null ? void 0 : _d._def.typeName) === ZodFirstPartyTypeKind2.ZodEnum) {\n    return {\n      ...schema,\n      propertyNames: {\n        enum: def.keyType._def.values\n      }\n    };\n  } else if (((_e = def.keyType) == null ? void 0 : _e._def.typeName) === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) {\n    const { type, ...keyType } = parseBrandedDef(\n      def.keyType._def,\n      refs\n    );\n    return {\n      ...schema,\n      propertyNames: keyType\n    };\n  }\n  return schema;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/map.ts\nfunction parseMapDef(def, refs) {\n  if (refs.mapStrategy === \"record\") {\n    return parseRecordDef(def, refs);\n  }\n  const keys = parseDef(def.keyType._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"items\", \"items\", \"0\"]\n  }) || parseAnyDef();\n  const values = parseDef(def.valueType._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"items\", \"items\", \"1\"]\n  }) || parseAnyDef();\n  return {\n    type: \"array\",\n    maxItems: 125,\n    items: {\n      type: \"array\",\n      items: [keys, values],\n      minItems: 2,\n      maxItems: 2\n    }\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/native-enum.ts\nfunction parseNativeEnumDef(def) {\n  const object = def.values;\n  const actualKeys = Object.keys(def.values).filter((key) => {\n    return typeof object[object[key]] !== \"number\";\n  });\n  const actualValues = actualKeys.map((key) => object[key]);\n  const parsedTypes = Array.from(\n    new Set(actualValues.map((values) => typeof values))\n  );\n  return {\n    type: parsedTypes.length === 1 ? parsedTypes[0] === \"string\" ? \"string\" : \"number\" : [\"string\", \"number\"],\n    enum: actualValues\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/never.ts\nfunction parseNeverDef() {\n  return { not: parseAnyDef() };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/null.ts\nfunction parseNullDef() {\n  return {\n    type: \"null\"\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/union.ts\nvar primitiveMappings = {\n  ZodString: \"string\",\n  ZodNumber: \"number\",\n  ZodBigInt: \"integer\",\n  ZodBoolean: \"boolean\",\n  ZodNull: \"null\"\n};\nfunction parseUnionDef(def, refs) {\n  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;\n  if (options.every(\n    (x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length)\n  )) {\n    const types = options.reduce((types2, x) => {\n      const type = primitiveMappings[x._def.typeName];\n      return type && !types2.includes(type) ? [...types2, type] : types2;\n    }, []);\n    return {\n      type: types.length > 1 ? types : types[0]\n    };\n  } else if (options.every((x) => x._def.typeName === \"ZodLiteral\" && !x.description)) {\n    const types = options.reduce(\n      (acc, x) => {\n        const type = typeof x._def.value;\n        switch (type) {\n          case \"string\":\n          case \"number\":\n          case \"boolean\":\n            return [...acc, type];\n          case \"bigint\":\n            return [...acc, \"integer\"];\n          case \"object\":\n            if (x._def.value === null) return [...acc, \"null\"];\n          case \"symbol\":\n          case \"undefined\":\n          case \"function\":\n          default:\n            return acc;\n        }\n      },\n      []\n    );\n    if (types.length === options.length) {\n      const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);\n      return {\n        type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],\n        enum: options.reduce(\n          (acc, x) => {\n            return acc.includes(x._def.value) ? acc : [...acc, x._def.value];\n          },\n          []\n        )\n      };\n    }\n  } else if (options.every((x) => x._def.typeName === \"ZodEnum\")) {\n    return {\n      type: \"string\",\n      enum: options.reduce(\n        (acc, x) => [\n          ...acc,\n          ...x._def.values.filter((x2) => !acc.includes(x2))\n        ],\n        []\n      )\n    };\n  }\n  return asAnyOf(def, refs);\n}\nvar asAnyOf = (def, refs) => {\n  const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map(\n    (x, i) => parseDef(x._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"anyOf\", `${i}`]\n    })\n  ).filter(\n    (x) => !!x && (!refs.strictUnions || typeof x === \"object\" && Object.keys(x).length > 0)\n  );\n  return anyOf.length ? { anyOf } : void 0;\n};\n\n// src/to-json-schema/zod3-to-json-schema/parsers/nullable.ts\nfunction parseNullableDef(def, refs) {\n  if ([\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(\n    def.innerType._def.typeName\n  ) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {\n    return {\n      type: [\n        primitiveMappings[def.innerType._def.typeName],\n        \"null\"\n      ]\n    };\n  }\n  const base = parseDef(def.innerType._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"anyOf\", \"0\"]\n  });\n  return base && { anyOf: [base, { type: \"null\" }] };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/number.ts\nfunction parseNumberDef(def) {\n  const res = {\n    type: \"number\"\n  };\n  if (!def.checks) return res;\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"int\":\n        res.type = \"integer\";\n        break;\n      case \"min\":\n        if (check.inclusive) {\n          res.minimum = check.value;\n        } else {\n          res.exclusiveMinimum = check.value;\n        }\n        break;\n      case \"max\":\n        if (check.inclusive) {\n          res.maximum = check.value;\n        } else {\n          res.exclusiveMaximum = check.value;\n        }\n        break;\n      case \"multipleOf\":\n        res.multipleOf = check.value;\n        break;\n    }\n  }\n  return res;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/object.ts\nfunction parseObjectDef(def, refs) {\n  const result = {\n    type: \"object\",\n    properties: {}\n  };\n  const required = [];\n  const shape = def.shape();\n  for (const propName in shape) {\n    let propDef = shape[propName];\n    if (propDef === void 0 || propDef._def === void 0) {\n      continue;\n    }\n    const propOptional = safeIsOptional(propDef);\n    const parsedDef = parseDef(propDef._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"properties\", propName],\n      propertyPath: [...refs.currentPath, \"properties\", propName]\n    });\n    if (parsedDef === void 0) {\n      continue;\n    }\n    result.properties[propName] = parsedDef;\n    if (!propOptional) {\n      required.push(propName);\n    }\n  }\n  if (required.length) {\n    result.required = required;\n  }\n  const additionalProperties = decideAdditionalProperties(def, refs);\n  if (additionalProperties !== void 0) {\n    result.additionalProperties = additionalProperties;\n  }\n  return result;\n}\nfunction decideAdditionalProperties(def, refs) {\n  if (def.catchall._def.typeName !== \"ZodNever\") {\n    return parseDef(def.catchall._def, {\n      ...refs,\n      currentPath: [...refs.currentPath, \"additionalProperties\"]\n    });\n  }\n  switch (def.unknownKeys) {\n    case \"passthrough\":\n      return refs.allowedAdditionalProperties;\n    case \"strict\":\n      return refs.rejectedAdditionalProperties;\n    case \"strip\":\n      return refs.removeAdditionalStrategy === \"strict\" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;\n  }\n}\nfunction safeIsOptional(schema) {\n  try {\n    return schema.isOptional();\n  } catch (e) {\n    return true;\n  }\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/optional.ts\nvar parseOptionalDef = (def, refs) => {\n  var _a2;\n  if (refs.currentPath.toString() === ((_a2 = refs.propertyPath) == null ? void 0 : _a2.toString())) {\n    return parseDef(def.innerType._def, refs);\n  }\n  const innerSchema = parseDef(def.innerType._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"anyOf\", \"1\"]\n  });\n  return innerSchema ? { anyOf: [{ not: parseAnyDef() }, innerSchema] } : parseAnyDef();\n};\n\n// src/to-json-schema/zod3-to-json-schema/parsers/pipeline.ts\nvar parsePipelineDef = (def, refs) => {\n  if (refs.pipeStrategy === \"input\") {\n    return parseDef(def.in._def, refs);\n  } else if (refs.pipeStrategy === \"output\") {\n    return parseDef(def.out._def, refs);\n  }\n  const a = parseDef(def.in._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"allOf\", \"0\"]\n  });\n  const b = parseDef(def.out._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"allOf\", a ? \"1\" : \"0\"]\n  });\n  return {\n    allOf: [a, b].filter((x) => x !== void 0)\n  };\n};\n\n// src/to-json-schema/zod3-to-json-schema/parsers/promise.ts\nfunction parsePromiseDef(def, refs) {\n  return parseDef(def.type._def, refs);\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/set.ts\nfunction parseSetDef(def, refs) {\n  const items = parseDef(def.valueType._def, {\n    ...refs,\n    currentPath: [...refs.currentPath, \"items\"]\n  });\n  const schema = {\n    type: \"array\",\n    uniqueItems: true,\n    items\n  };\n  if (def.minSize) {\n    schema.minItems = def.minSize.value;\n  }\n  if (def.maxSize) {\n    schema.maxItems = def.maxSize.value;\n  }\n  return schema;\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/tuple.ts\nfunction parseTupleDef(def, refs) {\n  if (def.rest) {\n    return {\n      type: \"array\",\n      minItems: def.items.length,\n      items: def.items.map(\n        (x, i) => parseDef(x._def, {\n          ...refs,\n          currentPath: [...refs.currentPath, \"items\", `${i}`]\n        })\n      ).reduce(\n        (acc, x) => x === void 0 ? acc : [...acc, x],\n        []\n      ),\n      additionalItems: parseDef(def.rest._def, {\n        ...refs,\n        currentPath: [...refs.currentPath, \"additionalItems\"]\n      })\n    };\n  } else {\n    return {\n      type: \"array\",\n      minItems: def.items.length,\n      maxItems: def.items.length,\n      items: def.items.map(\n        (x, i) => parseDef(x._def, {\n          ...refs,\n          currentPath: [...refs.currentPath, \"items\", `${i}`]\n        })\n      ).reduce(\n        (acc, x) => x === void 0 ? acc : [...acc, x],\n        []\n      )\n    };\n  }\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/undefined.ts\nfunction parseUndefinedDef() {\n  return {\n    not: parseAnyDef()\n  };\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/unknown.ts\nfunction parseUnknownDef() {\n  return parseAnyDef();\n}\n\n// src/to-json-schema/zod3-to-json-schema/parsers/readonly.ts\nvar parseReadonlyDef = (def, refs) => {\n  return parseDef(def.innerType._def, refs);\n};\n\n// src/to-json-schema/zod3-to-json-schema/select-parser.ts\nvar selectParser = (def, typeName, refs) => {\n  switch (typeName) {\n    case ZodFirstPartyTypeKind3.ZodString:\n      return parseStringDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodNumber:\n      return parseNumberDef(def);\n    case ZodFirstPartyTypeKind3.ZodObject:\n      return parseObjectDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodBigInt:\n      return parseBigintDef(def);\n    case ZodFirstPartyTypeKind3.ZodBoolean:\n      return parseBooleanDef();\n    case ZodFirstPartyTypeKind3.ZodDate:\n      return parseDateDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodUndefined:\n      return parseUndefinedDef();\n    case ZodFirstPartyTypeKind3.ZodNull:\n      return parseNullDef();\n    case ZodFirstPartyTypeKind3.ZodArray:\n      return parseArrayDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodUnion:\n    case ZodFirstPartyTypeKind3.ZodDiscriminatedUnion:\n      return parseUnionDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodIntersection:\n      return parseIntersectionDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodTuple:\n      return parseTupleDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodRecord:\n      return parseRecordDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodLiteral:\n      return parseLiteralDef(def);\n    case ZodFirstPartyTypeKind3.ZodEnum:\n      return parseEnumDef(def);\n    case ZodFirstPartyTypeKind3.ZodNativeEnum:\n      return parseNativeEnumDef(def);\n    case ZodFirstPartyTypeKind3.ZodNullable:\n      return parseNullableDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodOptional:\n      return parseOptionalDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodMap:\n      return parseMapDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodSet:\n      return parseSetDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodLazy:\n      return () => def.getter()._def;\n    case ZodFirstPartyTypeKind3.ZodPromise:\n      return parsePromiseDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodNaN:\n    case ZodFirstPartyTypeKind3.ZodNever:\n      return parseNeverDef();\n    case ZodFirstPartyTypeKind3.ZodEffects:\n      return parseEffectsDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodAny:\n      return parseAnyDef();\n    case ZodFirstPartyTypeKind3.ZodUnknown:\n      return parseUnknownDef();\n    case ZodFirstPartyTypeKind3.ZodDefault:\n      return parseDefaultDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodBranded:\n      return parseBrandedDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodReadonly:\n      return parseReadonlyDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodCatch:\n      return parseCatchDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodPipeline:\n      return parsePipelineDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodFunction:\n    case ZodFirstPartyTypeKind3.ZodVoid:\n    case ZodFirstPartyTypeKind3.ZodSymbol:\n      return void 0;\n    default:\n      return /* @__PURE__ */ ((_) => void 0)(typeName);\n  }\n};\n\n// src/to-json-schema/zod3-to-json-schema/get-relative-path.ts\nvar getRelativePath = (pathA, pathB) => {\n  let i = 0;\n  for (; i < pathA.length && i < pathB.length; i++) {\n    if (pathA[i] !== pathB[i]) break;\n  }\n  return [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\n\n// src/to-json-schema/zod3-to-json-schema/parse-def.ts\nfunction parseDef(def, refs, forceResolution = false) {\n  var _a2;\n  const seenItem = refs.seen.get(def);\n  if (refs.override) {\n    const overrideResult = (_a2 = refs.override) == null ? void 0 : _a2.call(\n      refs,\n      def,\n      refs,\n      seenItem,\n      forceResolution\n    );\n    if (overrideResult !== ignoreOverride) {\n      return overrideResult;\n    }\n  }\n  if (seenItem && !forceResolution) {\n    const seenSchema = get$ref(seenItem, refs);\n    if (seenSchema !== void 0) {\n      return seenSchema;\n    }\n  }\n  const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };\n  refs.seen.set(def, newItem);\n  const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);\n  const jsonSchema2 = typeof jsonSchemaOrGetter === \"function\" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;\n  if (jsonSchema2) {\n    addMeta(def, refs, jsonSchema2);\n  }\n  if (refs.postProcess) {\n    const postProcessResult = refs.postProcess(jsonSchema2, def, refs);\n    newItem.jsonSchema = jsonSchema2;\n    return postProcessResult;\n  }\n  newItem.jsonSchema = jsonSchema2;\n  return jsonSchema2;\n}\nvar get$ref = (item, refs) => {\n  switch (refs.$refStrategy) {\n    case \"root\":\n      return { $ref: item.path.join(\"/\") };\n    case \"relative\":\n      return { $ref: getRelativePath(refs.currentPath, item.path) };\n    case \"none\":\n    case \"seen\": {\n      if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {\n        console.warn(\n          `Recursive reference detected at ${refs.currentPath.join(\n            \"/\"\n          )}! Defaulting to any`\n        );\n        return parseAnyDef();\n      }\n      return refs.$refStrategy === \"seen\" ? parseAnyDef() : void 0;\n    }\n  }\n};\nvar addMeta = (def, refs, jsonSchema2) => {\n  if (def.description) {\n    jsonSchema2.description = def.description;\n  }\n  return jsonSchema2;\n};\n\n// src/to-json-schema/zod3-to-json-schema/refs.ts\nvar getRefs = (options) => {\n  const _options = getDefaultOptions(options);\n  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;\n  return {\n    ..._options,\n    currentPath,\n    propertyPath: void 0,\n    seen: new Map(\n      Object.entries(_options.definitions).map(([name2, def]) => [\n        def._def,\n        {\n          def: def._def,\n          path: [..._options.basePath, _options.definitionPath, name2],\n          // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n          jsonSchema: void 0\n        }\n      ])\n    )\n  };\n};\n\n// src/to-json-schema/zod3-to-json-schema/zod3-to-json-schema.ts\nvar zod3ToJsonSchema = (schema, options) => {\n  var _a2;\n  const refs = getRefs(options);\n  let definitions = typeof options === \"object\" && options.definitions ? Object.entries(options.definitions).reduce(\n    (acc, [name3, schema2]) => {\n      var _a3;\n      return {\n        ...acc,\n        [name3]: (_a3 = parseDef(\n          schema2._def,\n          {\n            ...refs,\n            currentPath: [...refs.basePath, refs.definitionPath, name3]\n          },\n          true\n        )) != null ? _a3 : parseAnyDef()\n      };\n    },\n    {}\n  ) : void 0;\n  const name2 = typeof options === \"string\" ? options : (options == null ? void 0 : options.nameStrategy) === \"title\" ? void 0 : options == null ? void 0 : options.name;\n  const main = (_a2 = parseDef(\n    schema._def,\n    name2 === void 0 ? refs : {\n      ...refs,\n      currentPath: [...refs.basePath, refs.definitionPath, name2]\n    },\n    false\n  )) != null ? _a2 : parseAnyDef();\n  const title = typeof options === \"object\" && options.name !== void 0 && options.nameStrategy === \"title\" ? options.name : void 0;\n  if (title !== void 0) {\n    main.title = title;\n  }\n  const combined = name2 === void 0 ? definitions ? {\n    ...main,\n    [refs.definitionPath]: definitions\n  } : main : {\n    $ref: [\n      ...refs.$refStrategy === \"relative\" ? [] : refs.basePath,\n      refs.definitionPath,\n      name2\n    ].join(\"/\"),\n    [refs.definitionPath]: {\n      ...definitions,\n      [name2]: main\n    }\n  };\n  combined.$schema = \"http://json-schema.org/draft-07/schema#\";\n  return combined;\n};\n\n// src/schema.ts\nvar schemaSymbol = /* @__PURE__ */ Symbol.for(\"vercel.ai.schema\");\nfunction lazySchema(createSchema) {\n  let schema;\n  return () => {\n    if (schema == null) {\n      schema = createSchema();\n    }\n    return schema;\n  };\n}\nfunction jsonSchema(jsonSchema2, {\n  validate\n} = {}) {\n  return {\n    [schemaSymbol]: true,\n    _type: void 0,\n    // should never be used directly\n    get jsonSchema() {\n      if (typeof jsonSchema2 === \"function\") {\n        jsonSchema2 = jsonSchema2();\n      }\n      return jsonSchema2;\n    },\n    validate\n  };\n}\nfunction isSchema(value) {\n  return typeof value === \"object\" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && \"jsonSchema\" in value && \"validate\" in value;\n}\nfunction asSchema(schema) {\n  return schema == null ? jsonSchema({\n    type: \"object\",\n    properties: {},\n    additionalProperties: false\n  }) : isSchema(schema) ? schema : \"~standard\" in schema ? schema[\"~standard\"].vendor === \"zod\" ? zodSchema(schema) : standardSchema(schema) : schema();\n}\nfunction standardSchema(standardSchema2) {\n  return jsonSchema(\n    () => {\n      if (!hasStandardJsonSchema(standardSchema2)) {\n        throw new Error(\n          `Standard schema vendor '${standardSchema2[\"~standard\"].vendor}' does not support JSON Schema conversion.`\n        );\n      }\n      return addAdditionalPropertiesToJsonSchema(\n        standardSchema2[\"~standard\"].jsonSchema.input({\n          target: \"draft-07\"\n        })\n      );\n    },\n    {\n      validate: async (value) => {\n        const result = await standardSchema2[\"~standard\"].validate(value);\n        return \"value\" in result ? { success: true, value: result.value } : {\n          success: false,\n          error: new TypeValidationError({\n            value,\n            cause: result.issues\n          })\n        };\n      }\n    }\n  );\n}\nfunction hasStandardJsonSchema(schema) {\n  return schema[\"~standard\"].jsonSchema != null;\n}\nfunction zod3Schema(zodSchema2, options) {\n  var _a2;\n  const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;\n  return jsonSchema(\n    // defer json schema creation to avoid unnecessary computation when only validation is needed\n    () => zod3ToJsonSchema(zodSchema2, {\n      $refStrategy: useReferences ? \"root\" : \"none\"\n    }),\n    {\n      validate: async (value) => {\n        const result = await zodSchema2.safeParseAsync(value);\n        return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n      }\n    }\n  );\n}\nfunction zod4Schema(zodSchema2, options) {\n  var _a2;\n  const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;\n  return jsonSchema(\n    // defer json schema creation to avoid unnecessary computation when only validation is needed\n    () => addAdditionalPropertiesToJsonSchema(\n      z4.toJSONSchema(zodSchema2, {\n        target: \"draft-7\",\n        io: \"input\",\n        reused: useReferences ? \"ref\" : \"inline\"\n      })\n    ),\n    {\n      validate: async (value) => {\n        const result = await z4.safeParseAsync(zodSchema2, value);\n        return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n      }\n    }\n  );\n}\nfunction isZod4Schema(zodSchema2) {\n  return \"_zod\" in zodSchema2;\n}\nfunction zodSchema(zodSchema2, options) {\n  if (isZod4Schema(zodSchema2)) {\n    return zod4Schema(zodSchema2, options);\n  } else {\n    return zod3Schema(zodSchema2, options);\n  }\n}\n\n// src/validate-types.ts\nasync function validateTypes({\n  value,\n  schema,\n  context\n}) {\n  const result = await safeValidateTypes({ value, schema, context });\n  if (!result.success) {\n    throw TypeValidationError2.wrap({ value, cause: result.error, context });\n  }\n  return result.value;\n}\nasync function safeValidateTypes({\n  value,\n  schema,\n  context\n}) {\n  const actualSchema = asSchema(schema);\n  try {\n    if (actualSchema.validate == null) {\n      return { success: true, value, rawValue: value };\n    }\n    const result = await actualSchema.validate(value);\n    if (result.success) {\n      return { success: true, value: result.value, rawValue: value };\n    }\n    return {\n      success: false,\n      error: TypeValidationError2.wrap({ value, cause: result.error, context }),\n      rawValue: value\n    };\n  } catch (error) {\n    return {\n      success: false,\n      error: TypeValidationError2.wrap({ value, cause: error, context }),\n      rawValue: value\n    };\n  }\n}\n\n// src/parse-json.ts\nasync function parseJSON({\n  text,\n  schema\n}) {\n  try {\n    const value = secureJsonParse(text);\n    if (schema == null) {\n      return value;\n    }\n    return validateTypes({ value, schema });\n  } catch (error) {\n    if (JSONParseError.isInstance(error) || TypeValidationError3.isInstance(error)) {\n      throw error;\n    }\n    throw new JSONParseError({ text, cause: error });\n  }\n}\nasync function safeParseJSON({\n  text,\n  schema\n}) {\n  try {\n    const value = secureJsonParse(text);\n    if (schema == null) {\n      return { success: true, value, rawValue: value };\n    }\n    return await safeValidateTypes({ value, schema });\n  } catch (error) {\n    return {\n      success: false,\n      error: JSONParseError.isInstance(error) ? error : new JSONParseError({ text, cause: error }),\n      rawValue: void 0\n    };\n  }\n}\nfunction isParsableJson(input) {\n  try {\n    secureJsonParse(input);\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n// src/parse-json-event-stream.ts\nimport {\n  EventSourceParserStream\n} from \"eventsource-parser/stream\";\nfunction parseJsonEventStream({\n  stream,\n  schema\n}) {\n  return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(\n    new TransformStream({\n      async transform({ data }, controller) {\n        if (data === \"[DONE]\") {\n          return;\n        }\n        controller.enqueue(await safeParseJSON({ text: data, schema }));\n      }\n    })\n  );\n}\n\n// src/parse-provider-options.ts\nimport { InvalidArgumentError as InvalidArgumentError2 } from \"@ai-sdk/provider\";\nasync function parseProviderOptions({\n  provider,\n  providerOptions,\n  schema\n}) {\n  if ((providerOptions == null ? void 0 : providerOptions[provider]) == null) {\n    return void 0;\n  }\n  const parsedProviderOptions = await safeValidateTypes({\n    value: providerOptions[provider],\n    schema\n  });\n  if (!parsedProviderOptions.success) {\n    throw new InvalidArgumentError2({\n      argument: \"providerOptions\",\n      message: `invalid ${provider} provider options`,\n      cause: parsedProviderOptions.error\n    });\n  }\n  return parsedProviderOptions.value;\n}\n\n// src/post-to-api.ts\nimport { APICallError as APICallError3 } from \"@ai-sdk/provider\";\nvar getOriginalFetch2 = () => globalThis.fetch;\nvar postJsonToApi = async ({\n  url,\n  headers,\n  body,\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch\n}) => postToApi({\n  url,\n  headers: {\n    \"Content-Type\": \"application/json\",\n    ...headers\n  },\n  body: {\n    content: JSON.stringify(body),\n    values: body\n  },\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch\n});\nvar postFormDataToApi = async ({\n  url,\n  headers,\n  formData,\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch\n}) => postToApi({\n  url,\n  headers,\n  body: {\n    content: formData,\n    values: Object.fromEntries(formData.entries())\n  },\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch\n});\nvar postToApi = async ({\n  url,\n  headers = {},\n  body,\n  successfulResponseHandler,\n  failedResponseHandler,\n  abortSignal,\n  fetch = getOriginalFetch2()\n}) => {\n  try {\n    const response = await fetch(url, {\n      method: \"POST\",\n      headers: withUserAgentSuffix(\n        headers,\n        `ai-sdk/provider-utils/${VERSION}`,\n        getRuntimeEnvironmentUserAgent()\n      ),\n      body: body.content,\n      signal: abortSignal\n    });\n    const responseHeaders = extractResponseHeaders(response);\n    if (!response.ok) {\n      let errorInformation;\n      try {\n        errorInformation = await failedResponseHandler({\n          response,\n          url,\n          requestBodyValues: body.values\n        });\n      } catch (error) {\n        if (isAbortError(error) || APICallError3.isInstance(error)) {\n          throw error;\n        }\n        throw new APICallError3({\n          message: \"Failed to process error response\",\n          cause: error,\n          statusCode: response.status,\n          url,\n          responseHeaders,\n          requestBodyValues: body.values\n        });\n      }\n      throw errorInformation.value;\n    }\n    try {\n      return await successfulResponseHandler({\n        response,\n        url,\n        requestBodyValues: body.values\n      });\n    } catch (error) {\n      if (error instanceof Error) {\n        if (isAbortError(error) || APICallError3.isInstance(error)) {\n          throw error;\n        }\n      }\n      throw new APICallError3({\n        message: \"Failed to process successful response\",\n        cause: error,\n        statusCode: response.status,\n        url,\n        responseHeaders,\n        requestBodyValues: body.values\n      });\n    }\n  } catch (error) {\n    throw handleFetchError({ error, url, requestBodyValues: body.values });\n  }\n};\n\n// src/types/tool.ts\nfunction tool(tool2) {\n  return tool2;\n}\nfunction dynamicTool(tool2) {\n  return { ...tool2, type: \"dynamic\" };\n}\n\n// src/provider-tool-factory.ts\nfunction createProviderToolFactory({\n  id,\n  inputSchema\n}) {\n  return ({\n    execute,\n    outputSchema,\n    needsApproval,\n    toModelOutput,\n    onInputStart,\n    onInputDelta,\n    onInputAvailable,\n    ...args\n  }) => tool({\n    type: \"provider\",\n    id,\n    args,\n    inputSchema,\n    outputSchema,\n    execute,\n    needsApproval,\n    toModelOutput,\n    onInputStart,\n    onInputDelta,\n    onInputAvailable\n  });\n}\nfunction createProviderToolFactoryWithOutputSchema({\n  id,\n  inputSchema,\n  outputSchema,\n  supportsDeferredResults\n}) {\n  return ({\n    execute,\n    needsApproval,\n    toModelOutput,\n    onInputStart,\n    onInputDelta,\n    onInputAvailable,\n    ...args\n  }) => tool({\n    type: \"provider\",\n    id,\n    args,\n    inputSchema,\n    outputSchema,\n    execute,\n    needsApproval,\n    toModelOutput,\n    onInputStart,\n    onInputDelta,\n    onInputAvailable,\n    supportsDeferredResults\n  });\n}\n\n// src/remove-undefined-entries.ts\nfunction removeUndefinedEntries(record) {\n  return Object.fromEntries(\n    Object.entries(record).filter(([_key, value]) => value != null)\n  );\n}\n\n// src/resolve.ts\nasync function resolve(value) {\n  if (typeof value === \"function\") {\n    value = value();\n  }\n  return value;\n}\n\n// src/retry-with-exponential-backoff.ts\nvar retryWithExponentialBackoff = ({\n  maxRetries = 2,\n  initialDelayInMs = 2e3,\n  backoffFactor = 2,\n  abortSignal,\n  shouldRetry,\n  getDelayInMs = ({ exponentialBackoffDelay }) => exponentialBackoffDelay,\n  createRetryError = ({ message }) => new Error(message)\n}) => async (f) => retryWithExponentialBackoffInternal(f, {\n  maxRetries,\n  delayInMs: initialDelayInMs,\n  backoffFactor,\n  abortSignal,\n  shouldRetry,\n  getDelayInMs,\n  createRetryError\n});\nasync function retryWithExponentialBackoffInternal(f, {\n  maxRetries,\n  delayInMs,\n  backoffFactor,\n  abortSignal,\n  shouldRetry,\n  getDelayInMs,\n  createRetryError\n}, errors = []) {\n  try {\n    return await f();\n  } catch (error) {\n    if (isAbortError(error)) {\n      throw error;\n    }\n    if (maxRetries === 0) {\n      throw error;\n    }\n    const errorMessage = getErrorMessage(error);\n    const newErrors = [...errors, error];\n    const tryNumber = newErrors.length;\n    if (tryNumber > maxRetries) {\n      throw createRetryError({\n        message: `Failed after ${tryNumber} attempts. Last error: ${errorMessage}`,\n        reason: \"maxRetriesExceeded\",\n        errors: newErrors\n      });\n    }\n    if (await shouldRetry(error) && tryNumber <= maxRetries) {\n      await delay(\n        getDelayInMs({\n          error,\n          exponentialBackoffDelay: delayInMs\n        }),\n        { abortSignal }\n      );\n      return retryWithExponentialBackoffInternal(\n        f,\n        {\n          maxRetries,\n          delayInMs: backoffFactor * delayInMs,\n          backoffFactor,\n          abortSignal,\n          shouldRetry,\n          getDelayInMs,\n          createRetryError\n        },\n        newErrors\n      );\n    }\n    if (tryNumber === 1) {\n      throw error;\n    }\n    throw createRetryError({\n      message: `Failed after ${tryNumber} attempts with non-retryable error: '${errorMessage}'`,\n      reason: \"errorNotRetryable\",\n      errors: newErrors\n    });\n  }\n}\n\n// src/response-handler.ts\nimport { APICallError as APICallError4, EmptyResponseBodyError } from \"@ai-sdk/provider\";\nvar textDecoder = new TextDecoder();\nfunction wrapResponseBodyStream({\n  stream,\n  url,\n  requestBodyValues,\n  statusCode,\n  responseHeaders\n}) {\n  const reader = stream.getReader();\n  let readerReleased = false;\n  const releaseReader = () => {\n    if (!readerReleased) {\n      reader.releaseLock();\n      readerReleased = true;\n    }\n  };\n  return new ReadableStream({\n    async pull(controller) {\n      try {\n        const { done, value } = await reader.read();\n        if (done) {\n          releaseReader();\n          controller.close();\n        } else {\n          controller.enqueue(value);\n        }\n      } catch (error) {\n        releaseReader();\n        if (isAbortError(error)) {\n          controller.error(error);\n          return;\n        }\n        controller.error(\n          handleFetchError({\n            error: new APICallError4({\n              message: \"Failed to process successful response\",\n              cause: error,\n              statusCode,\n              url,\n              responseHeaders,\n              requestBodyValues\n            }),\n            url,\n            requestBodyValues\n          })\n        );\n      }\n    },\n    async cancel(reason) {\n      try {\n        await reader.cancel(reason);\n      } finally {\n        releaseReader();\n      }\n    }\n  });\n}\nasync function readResponseBodyAsText({\n  response,\n  url\n}) {\n  return textDecoder.decode(\n    await readResponseWithSizeLimit({\n      response,\n      url\n    })\n  );\n}\nvar createJsonErrorResponseHandler = ({\n  errorSchema,\n  errorToMessage,\n  isRetryable\n}) => async ({ response, url, requestBodyValues }) => {\n  const responseBody = await readResponseBodyAsText({ response, url });\n  const responseHeaders = extractResponseHeaders(response);\n  if (responseBody.trim() === \"\") {\n    return {\n      responseHeaders,\n      value: new APICallError4({\n        message: response.statusText,\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n      })\n    };\n  }\n  try {\n    const parsedError = await parseJSON({\n      text: responseBody,\n      schema: errorSchema\n    });\n    return {\n      responseHeaders,\n      value: new APICallError4({\n        message: errorToMessage(parsedError),\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        data: parsedError,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response, parsedError)\n      })\n    };\n  } catch (parseError) {\n    return {\n      responseHeaders,\n      value: new APICallError4({\n        message: response.statusText,\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n      })\n    };\n  }\n};\nvar createEventSourceResponseHandler = (chunkSchema) => async ({ response, url, requestBodyValues }) => {\n  const responseHeaders = extractResponseHeaders(response);\n  if (response.body == null) {\n    throw new EmptyResponseBodyError({});\n  }\n  return {\n    responseHeaders,\n    value: parseJsonEventStream({\n      stream: wrapResponseBodyStream({\n        stream: response.body,\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders\n      }),\n      schema: chunkSchema\n    })\n  };\n};\nvar createJsonResponseHandler = (responseSchema) => async ({ response, url, requestBodyValues }) => {\n  const responseBody = await readResponseBodyAsText({ response, url });\n  const parsedResult = await safeParseJSON({\n    text: responseBody,\n    schema: responseSchema\n  });\n  const responseHeaders = extractResponseHeaders(response);\n  if (!parsedResult.success) {\n    throw new APICallError4({\n      message: \"Invalid JSON response\",\n      cause: parsedResult.error,\n      statusCode: response.status,\n      responseHeaders,\n      responseBody,\n      url,\n      requestBodyValues\n    });\n  }\n  return {\n    responseHeaders,\n    value: parsedResult.value,\n    rawValue: parsedResult.rawValue\n  };\n};\nvar createBinaryResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n  const responseHeaders = extractResponseHeaders(response);\n  if (!response.body) {\n    throw new APICallError4({\n      message: \"Response body is empty\",\n      url,\n      requestBodyValues,\n      statusCode: response.status,\n      responseHeaders,\n      responseBody: void 0\n    });\n  }\n  try {\n    const buffer = await response.arrayBuffer();\n    return {\n      responseHeaders,\n      value: new Uint8Array(buffer)\n    };\n  } catch (error) {\n    throw new APICallError4({\n      message: \"Failed to read response as array buffer\",\n      url,\n      requestBodyValues,\n      statusCode: response.status,\n      responseHeaders,\n      responseBody: void 0,\n      cause: error\n    });\n  }\n};\nvar createStatusCodeErrorResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n  const responseHeaders = extractResponseHeaders(response);\n  const responseBody = await readResponseBodyAsText({ response, url });\n  return {\n    responseHeaders,\n    value: new APICallError4({\n      message: response.statusText,\n      url,\n      requestBodyValues,\n      statusCode: response.status,\n      responseHeaders,\n      responseBody\n    })\n  };\n};\n\n// src/streaming-tool-call-tracker.ts\nimport {\n  InvalidResponseDataError\n} from \"@ai-sdk/provider\";\n\n// src/streaming-tool-call-argument-state.ts\nfunction startsWithStructuredValue(value) {\n  if (typeof value !== \"string\") {\n    return false;\n  }\n  const firstCharacter = value.trimStart()[0];\n  return firstCharacter === \"{\" || firstCharacter === \"[\";\n}\nvar StreamingToolCallArgumentState = class {\n  constructor(initialValue = \"\") {\n    this.structure = { kind: \"undetermined\" };\n    this.append(initialValue);\n  }\n  get hasCompleteStructuredValue() {\n    return this.structure.kind === \"structured\" && this.structure.complete === true;\n  }\n  append(delta) {\n    let nextStructure = this.structure;\n    for (const character of delta) {\n      if (nextStructure.kind === \"undetermined\") {\n        if (/\\s/.test(character)) {\n          continue;\n        }\n        if (character !== \"{\" && character !== \"[\") {\n          nextStructure = { kind: \"other\" };\n          continue;\n        }\n        nextStructure = {\n          kind: \"structured\",\n          stack: [character],\n          inString: false,\n          escaped: false,\n          complete: false\n        };\n        continue;\n      }\n      if (nextStructure.kind !== \"structured\" || nextStructure.complete) {\n        continue;\n      }\n      if (nextStructure.inString) {\n        if (nextStructure.escaped) {\n          nextStructure.escaped = false;\n        } else if (character === \"\\\\\") {\n          nextStructure.escaped = true;\n        } else if (character === '\"') {\n          nextStructure.inString = false;\n        }\n        continue;\n      }\n      if (character === '\"') {\n        nextStructure.inString = true;\n      } else if (character === \"{\" || character === \"[\") {\n        nextStructure.stack.push(character);\n      } else if (character === \"}\" || character === \"]\") {\n        const expectedOpening = character === \"}\" ? \"{\" : \"[\";\n        if (nextStructure.stack[nextStructure.stack.length - 1] !== expectedOpening) {\n          nextStructure = { kind: \"other\" };\n          continue;\n        }\n        nextStructure.stack.pop();\n        if (nextStructure.stack.length === 0) {\n          nextStructure.complete = true;\n        }\n      }\n    }\n    this.structure = nextStructure;\n  }\n};\n\n// src/streaming-tool-call-tracker.ts\nvar StreamingToolCallTracker = class {\n  constructor(controller, options = {}) {\n    this.toolCalls = [];\n    this.toolCallsById = /* @__PURE__ */ new Map();\n    this.toolCallsByIndex = /* @__PURE__ */ new Map();\n    this.usedToolCallIds = /* @__PURE__ */ new Set();\n    this.nextGeneratedIdSuffixes = /* @__PURE__ */ new Map();\n    var _a2, _b2;\n    this.controller = controller;\n    this._generateId = (_a2 = options.generateId) != null ? _a2 : generateId;\n    this.typeValidation = (_b2 = options.typeValidation) != null ? _b2 : \"none\";\n    this.extractMetadata = options.extractMetadata;\n    this.buildToolCallProviderMetadata = options.buildToolCallProviderMetadata;\n  }\n  processDelta(toolCallDelta) {\n    var _a2, _b2;\n    const wireName = (_a2 = toolCallDelta.function) == null ? void 0 : _a2.name;\n    const hasBlankName = typeof wireName === \"string\" && wireName.trim().length === 0;\n    const wireId = this.getNonBlankString(toolCallDelta.id);\n    const name2 = this.getNonBlankString(wireName);\n    const { index } = toolCallDelta;\n    const resolution = this.resolveToolCall({\n      wireId,\n      index,\n      name: name2,\n      hasExplicitCallStart: name2 != null && startsWithStructuredValue((_b2 = toolCallDelta.function) == null ? void 0 : _b2.arguments)\n    });\n    if (resolution.kind === \"ambiguous\") {\n      return;\n    }\n    let toolCall;\n    if (resolution.kind === \"new\") {\n      if (hasBlankName) {\n        return;\n      }\n      toolCall = this.processNewToolCall(toolCallDelta, {\n        wireId,\n        index,\n        name: name2\n      });\n    } else {\n      toolCall = resolution.toolCall;\n      if (wireId != null) {\n        this.associateWireId(toolCall, wireId);\n      }\n      this.processExistingToolCall(toolCall, toolCallDelta);\n    }\n    if (index != null) {\n      this.associateIndex(toolCall, index);\n    }\n  }\n  flush() {\n    const toolCalls = this.toolCalls.every((toolCall) => toolCall.index != null) ? [...this.toolCalls].sort(\n      (a, b) => a.index - b.index || a.sequence - b.sequence\n    ) : this.toolCalls;\n    for (const toolCall of toolCalls) {\n      if (!toolCall.hasFinished) {\n        this.finishToolCall(toolCall);\n      }\n    }\n  }\n  resolveToolCall({\n    wireId,\n    index,\n    name: name2,\n    hasExplicitCallStart\n  }) {\n    const indexedToolCalls = index != null ? this.toolCallsByIndex.get(index) : void 0;\n    const matchingIndexedToolCalls = this.filterToolCallsByName(\n      indexedToolCalls,\n      name2\n    );\n    if (wireId != null) {\n      const toolCallsWithId = this.toolCallsById.get(wireId);\n      if (toolCallsWithId != null) {\n        if (index != null) {\n          const matchingToolCalls = matchingIndexedToolCalls.filter(\n            (toolCall) => toolCallsWithId.has(toolCall)\n          );\n          const matchingToolCall = this.resolveMatchingToolCall(\n            matchingToolCalls,\n            hasExplicitCallStart\n          );\n          if (matchingToolCall.kind !== \"new\") {\n            return matchingToolCall;\n          }\n          if (name2 != null) {\n            return { kind: \"new\" };\n          }\n          if (indexedToolCalls != null) {\n            return { kind: \"ambiguous\" };\n          }\n          return this.resolveMatchingToolCall([...toolCallsWithId], false);\n        }\n        if (name2 != null) {\n          const matchingToolCalls = [...toolCallsWithId].filter(\n            (toolCall) => toolCall.function.name === name2\n          );\n          return this.resolveMatchingToolCall(\n            matchingToolCalls,\n            hasExplicitCallStart\n          );\n        }\n        return this.resolveMatchingToolCall([...toolCallsWithId], false);\n      }\n      if (matchingIndexedToolCalls.length > 0) {\n        return hasExplicitCallStart ? { kind: \"new\" } : this.resolveMatchingToolCall(matchingIndexedToolCalls, false);\n      }\n      return { kind: \"new\" };\n    }\n    if (indexedToolCalls != null) {\n      return this.resolveMatchingToolCall(\n        matchingIndexedToolCalls,\n        hasExplicitCallStart\n      );\n    }\n    if (name2 != null) {\n      return { kind: \"new\" };\n    }\n    const unfinishedToolCalls = this.toolCalls.filter(\n      (toolCall) => !toolCall.hasFinished\n    );\n    if (unfinishedToolCalls.length === 1) {\n      return { kind: \"existing\", toolCall: unfinishedToolCalls[0] };\n    }\n    return unfinishedToolCalls.length > 1 ? { kind: \"ambiguous\" } : { kind: \"new\" };\n  }\n  filterToolCallsByName(toolCalls, name2) {\n    if (toolCalls == null) {\n      return [];\n    }\n    return [...toolCalls].filter(\n      (toolCall) => name2 == null || toolCall.function.name === name2\n    );\n  }\n  resolveMatchingToolCall(toolCalls, hasExplicitCallStart) {\n    if (toolCalls.length === 0) {\n      return { kind: \"new\" };\n    }\n    if (!hasExplicitCallStart) {\n      return toolCalls.length === 1 ? { kind: \"existing\", toolCall: toolCalls[0] } : { kind: \"ambiguous\" };\n    }\n    const continuableToolCalls = toolCalls.filter(\n      (toolCall) => !toolCall.argumentState.hasCompleteStructuredValue\n    );\n    if (continuableToolCalls.length === 1) {\n      return { kind: \"existing\", toolCall: continuableToolCalls[0] };\n    }\n    return continuableToolCalls.length > 1 ? { kind: \"ambiguous\" } : { kind: \"new\" };\n  }\n  processNewToolCall(toolCallDelta, {\n    wireId,\n    index,\n    name: name2\n  }) {\n    var _a2, _b2, _c, _d, _e;\n    if (this.typeValidation === \"required\") {\n      if (toolCallDelta.type !== \"function\") {\n        throw new InvalidResponseDataError({\n          data: toolCallDelta,\n          message: `Expected 'function' type.`\n        });\n      }\n    } else if (this.typeValidation === \"if-present\") {\n      if (toolCallDelta.type != null && toolCallDelta.type !== \"function\") {\n        throw new InvalidResponseDataError({\n          data: toolCallDelta,\n          message: `Expected 'function' type.`\n        });\n      }\n    }\n    if (name2 == null) {\n      throw new InvalidResponseDataError({\n        data: toolCallDelta,\n        message: `Expected 'function.name' to be a string.`\n      });\n    }\n    const id = this.createToolCallId(wireId);\n    this.controller.enqueue({\n      type: \"tool-input-start\",\n      id,\n      toolName: name2\n    });\n    const toolCall = {\n      id,\n      index: index != null ? index : void 0,\n      sequence: this.toolCalls.length,\n      type: \"function\",\n      function: {\n        name: name2,\n        arguments: (_b2 = (_a2 = toolCallDelta.function) == null ? void 0 : _a2.arguments) != null ? _b2 : \"\"\n      },\n      argumentState: new StreamingToolCallArgumentState(\n        (_d = (_c = toolCallDelta.function) == null ? void 0 : _c.arguments) != null ? _d : \"\"\n      ),\n      hasFinished: false,\n      metadata: (_e = this.extractMetadata) == null ? void 0 : _e.call(this, toolCallDelta)\n    };\n    this.toolCalls.push(toolCall);\n    if (wireId != null) {\n      this.associateWireId(toolCall, wireId);\n    }\n    if (toolCall.function.arguments.length > 0) {\n      this.controller.enqueue({\n        type: \"tool-input-delta\",\n        id: toolCall.id,\n        delta: toolCall.function.arguments\n      });\n    }\n    return toolCall;\n  }\n  associateWireId(toolCall, wireId) {\n    let toolCallsWithId = this.toolCallsById.get(wireId);\n    if (toolCallsWithId == null) {\n      toolCallsWithId = /* @__PURE__ */ new Set();\n      this.toolCallsById.set(wireId, toolCallsWithId);\n    }\n    toolCallsWithId.add(toolCall);\n  }\n  associateIndex(toolCall, index) {\n    let toolCallsWithIndex = this.toolCallsByIndex.get(index);\n    if (toolCallsWithIndex == null) {\n      toolCallsWithIndex = /* @__PURE__ */ new Set();\n      this.toolCallsByIndex.set(index, toolCallsWithIndex);\n    }\n    toolCallsWithIndex.add(toolCall);\n  }\n  createToolCallId(wireId) {\n    var _a2, _b2;\n    if (wireId != null && !this.usedToolCallIds.has(wireId)) {\n      this.usedToolCallIds.add(wireId);\n      return wireId;\n    }\n    const generatedId = (_a2 = this.getNonBlankString(this._generateId())) != null ? _a2 : \"tool-call\";\n    if (!this.usedToolCallIds.has(generatedId)) {\n      this.usedToolCallIds.add(generatedId);\n      return generatedId;\n    }\n    const initialSuffix = (_b2 = this.nextGeneratedIdSuffixes.get(generatedId)) != null ? _b2 : 1;\n    const maximumSuffix = initialSuffix + this.usedToolCallIds.size;\n    for (let suffix = initialSuffix; suffix <= maximumSuffix; suffix++) {\n      const suffixedId = `${generatedId}-${suffix}`;\n      if (!this.usedToolCallIds.has(suffixedId)) {\n        this.usedToolCallIds.add(suffixedId);\n        this.nextGeneratedIdSuffixes.set(generatedId, suffix + 1);\n        return suffixedId;\n      }\n    }\n    throw new Error(\"Failed to create a unique tool call ID.\");\n  }\n  getNonBlankString(value) {\n    return value != null && value.trim().length > 0 ? value : void 0;\n  }\n  processExistingToolCall(toolCall, toolCallDelta) {\n    var _a2;\n    if (!toolCall.hasFinished && ((_a2 = toolCallDelta.function) == null ? void 0 : _a2.arguments) != null) {\n      toolCall.argumentState.append(toolCallDelta.function.arguments);\n      toolCall.function.arguments += toolCallDelta.function.arguments;\n      this.controller.enqueue({\n        type: \"tool-input-delta\",\n        id: toolCall.id,\n        delta: toolCallDelta.function.arguments\n      });\n    }\n  }\n  finishToolCall(toolCall) {\n    var _a2;\n    this.controller.enqueue({\n      type: \"tool-input-end\",\n      id: toolCall.id\n    });\n    const providerMetadata = (_a2 = this.buildToolCallProviderMetadata) == null ? void 0 : _a2.call(\n      this,\n      toolCall.metadata\n    );\n    this.controller.enqueue({\n      type: \"tool-call\",\n      toolCallId: toolCall.id,\n      toolName: toolCall.function.name,\n      input: toolCall.function.arguments,\n      ...providerMetadata ? { providerMetadata } : {}\n    });\n    toolCall.hasFinished = true;\n  }\n};\n\n// src/strip-file-extension.ts\nfunction stripFileExtension(filename) {\n  const firstDotIndex = filename.indexOf(\".\");\n  return firstDotIndex === -1 ? filename : filename.slice(0, firstDotIndex);\n}\n\n// src/without-trailing-slash.ts\nfunction withoutTrailingSlash(url) {\n  return url == null ? void 0 : url.replace(/\\/$/, \"\");\n}\n\n// src/is-async-iterable.ts\nfunction isAsyncIterable(obj) {\n  return obj != null && typeof obj[Symbol.asyncIterator] === \"function\";\n}\n\n// src/types/execute-tool.ts\nasync function* executeTool({\n  execute,\n  input,\n  options\n}) {\n  const result = execute(input, options);\n  if (isAsyncIterable(result)) {\n    let lastOutput;\n    for await (const output of result) {\n      lastOutput = output;\n      yield { type: \"preliminary\", output };\n    }\n    yield { type: \"final\", output: lastOutput };\n  } else {\n    yield { type: \"final\", output: await result };\n  }\n}\n\n// src/index.ts\nimport {\n  EventSourceParserStream as EventSourceParserStream2\n} from \"eventsource-parser/stream\";\n\n// src/stringify-with-bigint-and-cycles.ts\nfunction stringifyWithBigIntAndCycles(value) {\n  const ancestors = [];\n  return JSON.stringify(value, function(_key, value2) {\n    if (typeof value2 === \"bigint\") {\n      return value2.toString();\n    }\n    if (typeof value2 !== \"object\" || value2 === null) {\n      return value2;\n    }\n    while (ancestors.length > 0 && ancestors.at(-1) !== this) {\n      ancestors.pop();\n    }\n    if (ancestors.includes(value2)) {\n      return \"[Circular]\";\n    }\n    ancestors.push(value2);\n    return value2;\n  });\n}\nexport {\n  DEFAULT_MAX_DOWNLOAD_SIZE,\n  DelayedPromise,\n  DownloadError,\n  EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,\n  EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,\n  EventSourceParserStream2 as EventSourceParserStream,\n  StreamingToolCallTracker,\n  VERSION,\n  asSchema,\n  cancelResponseBody,\n  combineHeaders,\n  convertAsyncIteratorToReadableStream,\n  convertBase64ToUint8Array,\n  convertImageModelFileToDataUri,\n  convertToBase64,\n  convertToFormData,\n  convertUint8ArrayToBase64,\n  createBinaryResponseHandler,\n  createEventSourceResponseHandler,\n  createIdGenerator,\n  createJsonErrorResponseHandler,\n  createJsonResponseHandler,\n  createProviderToolFactory,\n  createProviderToolFactoryWithOutputSchema,\n  createStatusCodeErrorResponseHandler,\n  createToolNameMapping,\n  delay,\n  downloadBlob,\n  dynamicTool,\n  encodePathSegment,\n  executeTool,\n  extractResponseHeaders,\n  fetchWithValidatedEndpoint,\n  fetchWithValidatedRedirects,\n  generateId,\n  getErrorMessage,\n  getFromApi,\n  getRuntimeEnvironmentUserAgent,\n  injectJsonInstructionIntoMessages,\n  isAbortError,\n  isArrayBuffer,\n  isBrowserRuntime,\n  isNonNullable,\n  isParsableJson,\n  isSameOrigin,\n  isUint8Array,\n  isUrlSupported,\n  jsonSchema,\n  lazySchema,\n  loadApiKey,\n  loadOptionalSetting,\n  loadSetting,\n  mediaTypeToExtension,\n  normalizeHeaders,\n  parseJSON,\n  parseJsonEventStream,\n  parseProviderOptions,\n  postFormDataToApi,\n  postJsonToApi,\n  postToApi,\n  readResponseWithSizeLimit,\n  removeUndefinedEntries,\n  resolve,\n  retryWithExponentialBackoff,\n  safeParseJSON,\n  safeValidateTypes,\n  secureJsonParse,\n  stringifyWithBigIntAndCycles,\n  stripFileExtension,\n  tool,\n  validateDownloadUrl,\n  validateTypes,\n  withUserAgentSuffix,\n  withoutTrailingSlash,\n  zodSchema\n};\n//# sourceMappingURL=index.mjs.map","// src/chat/openai-compatible-chat-language-model.ts\nimport {\n  InvalidResponseDataError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema,\n  zodSchema,\n  StreamingToolCallTracker,\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonErrorResponseHandler,\n  createJsonResponseHandler,\n  generateId,\n  parseProviderOptions,\n  postJsonToApi\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\n\n// src/utils/to-camel-case.ts\nfunction toCamelCase(str) {\n  return str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());\n}\nfunction resolveProviderOptionsKey(rawName, providerOptions) {\n  const camelName = toCamelCase(rawName);\n  if (camelName !== rawName && (providerOptions == null ? void 0 : providerOptions[camelName]) != null) {\n    return camelName;\n  }\n  return rawName;\n}\n\n// src/openai-compatible-error.ts\nimport { z } from \"zod/v4\";\nvar openaiCompatibleErrorDataSchema = z.object({\n  error: z.object({\n    message: z.string(),\n    // The additional information below is handled loosely to support\n    // OpenAI-compatible providers that have slightly different error\n    // responses:\n    type: z.string().nullish(),\n    param: z.any().nullish(),\n    code: z.union([z.string(), z.number()]).nullish()\n  })\n});\nvar defaultOpenAICompatibleErrorStructure = {\n  errorSchema: openaiCompatibleErrorDataSchema,\n  errorToMessage: (data) => data.error.message\n};\n\n// src/chat/convert-openai-compatible-chat-usage.ts\nfunction convertOpenAICompatibleChatUsage(usage) {\n  var _a, _b, _c, _d, _e, _f;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = (_a = usage.prompt_tokens) != null ? _a : 0;\n  const completionTokens = (_b = usage.completion_tokens) != null ? _b : 0;\n  const cacheReadTokens = (_d = (_c = usage.prompt_tokens_details) == null ? void 0 : _c.cached_tokens) != null ? _d : 0;\n  const reasoningTokens = (_f = (_e = usage.completion_tokens_details) == null ? void 0 : _e.reasoning_tokens) != null ? _f : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens - cacheReadTokens,\n      cacheRead: cacheReadTokens,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: completionTokens,\n      text: Math.max(0, completionTokens - reasoningTokens),\n      reasoning: reasoningTokens\n    },\n    raw: usage\n  };\n}\n\n// src/chat/convert-to-openai-compatible-chat-messages.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nimport {\n  convertBase64ToUint8Array,\n  convertToBase64\n} from \"@ai-sdk/provider-utils\";\nfunction getOpenAIMetadata(message) {\n  var _a, _b;\n  return (_b = (_a = message == null ? void 0 : message.providerOptions) == null ? void 0 : _a.openaiCompatible) != null ? _b : {};\n}\nfunction getAudioFormat(mediaType) {\n  switch (mediaType) {\n    case \"audio/wav\":\n      return \"wav\";\n    case \"audio/mp3\":\n    case \"audio/mpeg\":\n      return \"mp3\";\n    default:\n      return null;\n  }\n}\nfunction convertToOpenAICompatibleChatMessages(prompt) {\n  var _a, _b, _c;\n  const messages = [];\n  for (const { role, content, ...message } of prompt) {\n    const metadata = getOpenAIMetadata({ ...message });\n    switch (role) {\n      case \"system\": {\n        messages.push({ role: \"system\", content, ...metadata });\n        break;\n      }\n      case \"user\": {\n        if (content.length === 1 && content[0].type === \"text\") {\n          messages.push({\n            role: \"user\",\n            content: content[0].text,\n            ...getOpenAIMetadata(content[0])\n          });\n          break;\n        }\n        messages.push({\n          role: \"user\",\n          content: content.map((part) => {\n            var _a2;\n            const partMetadata = getOpenAIMetadata(part);\n            switch (part.type) {\n              case \"text\": {\n                return { type: \"text\", text: part.text, ...partMetadata };\n              }\n              case \"file\": {\n                if (part.mediaType.startsWith(\"image/\")) {\n                  const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n                  return {\n                    type: \"image_url\",\n                    image_url: {\n                      url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`\n                    },\n                    ...partMetadata\n                  };\n                }\n                if (part.mediaType.startsWith(\"audio/\")) {\n                  if (part.data instanceof URL) {\n                    throw new UnsupportedFunctionalityError({\n                      functionality: \"audio file parts with URLs\"\n                    });\n                  }\n                  const format = getAudioFormat(part.mediaType);\n                  if (format === null) {\n                    throw new UnsupportedFunctionalityError({\n                      functionality: `audio media type ${part.mediaType}`\n                    });\n                  }\n                  return {\n                    type: \"input_audio\",\n                    input_audio: {\n                      data: convertToBase64(part.data),\n                      format\n                    },\n                    ...partMetadata\n                  };\n                }\n                if (part.mediaType === \"application/pdf\") {\n                  if (part.data instanceof URL) {\n                    throw new UnsupportedFunctionalityError({\n                      functionality: \"PDF file parts with URLs\"\n                    });\n                  }\n                  return {\n                    type: \"file\",\n                    file: {\n                      filename: (_a2 = part.filename) != null ? _a2 : \"document.pdf\",\n                      file_data: `data:application/pdf;base64,${convertToBase64(part.data)}`\n                    },\n                    ...partMetadata\n                  };\n                }\n                if (part.mediaType.startsWith(\"text/\")) {\n                  const textContent = part.data instanceof URL ? part.data.toString() : typeof part.data === \"string\" ? new TextDecoder().decode(\n                    convertBase64ToUint8Array(part.data)\n                  ) : new TextDecoder().decode(part.data);\n                  return {\n                    type: \"text\",\n                    text: textContent,\n                    ...partMetadata\n                  };\n                }\n                throw new UnsupportedFunctionalityError({\n                  functionality: `file part media type ${part.mediaType}`\n                });\n              }\n            }\n          }),\n          ...metadata\n        });\n        break;\n      }\n      case \"assistant\": {\n        let text = \"\";\n        let reasoning = \"\";\n        const toolCalls = [];\n        for (const part of content) {\n          const partMetadata = getOpenAIMetadata(part);\n          switch (part.type) {\n            case \"text\": {\n              text += part.text;\n              break;\n            }\n            case \"reasoning\": {\n              reasoning += part.text;\n              break;\n            }\n            case \"tool-call\": {\n              const thoughtSignature = (_b = (_a = part.providerOptions) == null ? void 0 : _a.google) == null ? void 0 : _b.thoughtSignature;\n              toolCalls.push({\n                id: part.toolCallId,\n                type: \"function\",\n                function: {\n                  name: part.toolName,\n                  arguments: JSON.stringify(part.input)\n                },\n                ...partMetadata,\n                // Include extra_content for Google Gemini thought signatures\n                ...thoughtSignature ? {\n                  extra_content: {\n                    google: {\n                      thought_signature: String(thoughtSignature)\n                    }\n                  }\n                } : {}\n              });\n              break;\n            }\n          }\n        }\n        messages.push({\n          role: \"assistant\",\n          content: toolCalls.length > 0 ? text || null : text,\n          ...reasoning.length > 0 ? { reasoning_content: reasoning } : {},\n          tool_calls: toolCalls.length > 0 ? toolCalls : void 0,\n          ...metadata\n        });\n        break;\n      }\n      case \"tool\": {\n        for (const toolResponse of content) {\n          if (toolResponse.type === \"tool-approval-response\") {\n            continue;\n          }\n          const output = toolResponse.output;\n          let contentValue;\n          switch (output.type) {\n            case \"text\":\n            case \"error-text\":\n              contentValue = output.value;\n              break;\n            case \"execution-denied\":\n              contentValue = (_c = output.reason) != null ? _c : \"Tool call execution denied.\";\n              break;\n            case \"content\":\n            case \"json\":\n            case \"error-json\":\n              contentValue = JSON.stringify(output.value);\n              break;\n          }\n          const toolResponseMetadata = getOpenAIMetadata(toolResponse);\n          messages.push({\n            role: \"tool\",\n            tool_call_id: toolResponse.toolCallId,\n            content: contentValue,\n            ...toolResponseMetadata\n          });\n        }\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return messages;\n}\n\n// src/chat/get-response-metadata.ts\nfunction getResponseMetadata({\n  id,\n  model,\n  created\n}) {\n  return {\n    id: id != null ? id : void 0,\n    modelId: model != null ? model : void 0,\n    timestamp: created != null ? new Date(created * 1e3) : void 0\n  };\n}\n\n// src/chat/map-openai-compatible-finish-reason.ts\nfunction mapOpenAICompatibleFinishReason(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    case \"function_call\":\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/chat/openai-compatible-chat-options.ts\nimport { z as z2 } from \"zod/v4\";\nvar openaiCompatibleLanguageModelChatOptions = z2.object({\n  /**\n   * A unique identifier representing your end-user, which can help the provider to\n   * monitor and detect abuse.\n   */\n  user: z2.string().optional(),\n  /**\n   * Reasoning effort for reasoning models. Defaults to `medium`.\n   */\n  reasoningEffort: z2.string().optional(),\n  /**\n   * Controls the verbosity of the generated text. Defaults to `medium`.\n   */\n  textVerbosity: z2.string().optional(),\n  /**\n   * Whether to use strict JSON schema validation.\n   * When true, the model uses constrained decoding to guarantee schema compliance.\n   * Only used when the provider supports structured outputs and a schema is provided.\n   *\n   * @default true\n   */\n  strictJsonSchema: z2.boolean().optional()\n});\n\n// src/chat/openai-compatible-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nfunction prepareTools({\n  tools,\n  toolChoice\n}) {\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  if (tools == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings };\n  }\n  const openaiCompatTools = [];\n  for (const tool of tools) {\n    if (tool.type === \"provider\") {\n      toolWarnings.push({\n        type: \"unsupported\",\n        feature: `provider-defined tool ${tool.id}`\n      });\n    } else {\n      openaiCompatTools.push({\n        type: \"function\",\n        function: {\n          name: tool.name,\n          description: tool.description,\n          parameters: tool.inputSchema,\n          ...tool.strict != null ? { strict: tool.strict } : {}\n        }\n      });\n    }\n  }\n  if (toolChoice == null) {\n    return { tools: openaiCompatTools, toolChoice: void 0, toolWarnings };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n    case \"none\":\n    case \"required\":\n      return { tools: openaiCompatTools, toolChoice: type, toolWarnings };\n    case \"tool\":\n      return {\n        tools: openaiCompatTools,\n        toolChoice: {\n          type: \"function\",\n          function: { name: toolChoice.toolName }\n        },\n        toolWarnings\n      };\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError2({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\n\n// src/chat/openai-compatible-chat-language-model.ts\nvar OpenAICompatibleChatLanguageModel = class {\n  // type inferred via constructor\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    var _a, _b;\n    this.modelId = modelId;\n    this.config = config;\n    const errorStructure = (_a = config.errorStructure) != null ? _a : defaultOpenAICompatibleErrorStructure;\n    this.chunkSchema = createOpenAICompatibleChatChunkSchema(\n      errorStructure.errorSchema\n    );\n    this.failedResponseHandler = createJsonErrorResponseHandler(errorStructure);\n    this.supportsStructuredOutputs = (_b = config.supportsStructuredOutputs) != null ? _b : false;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get providerOptionsName() {\n    return this.config.provider.split(\".\")[0].trim();\n  }\n  get supportedUrls() {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};\n  }\n  transformRequestBody(args) {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).transformRequestBody) == null ? void 0 : _b.call(_a, args)) != null ? _c : args;\n  }\n  convertUsage(usage) {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).convertUsage) == null ? void 0 : _b.call(_a, usage)) != null ? _c : convertOpenAICompatibleChatUsage(usage);\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    providerOptions,\n    stopSequences,\n    responseFormat,\n    seed,\n    toolChoice,\n    tools\n  }) {\n    var _a, _b, _c, _d, _e;\n    const warnings = [];\n    const deprecatedOptions = await parseProviderOptions({\n      provider: \"openai-compatible\",\n      providerOptions,\n      schema: openaiCompatibleLanguageModelChatOptions\n    });\n    if (deprecatedOptions != null) {\n      warnings.push({\n        type: \"other\",\n        message: `The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead.`\n      });\n    }\n    const compatibleOptions = Object.assign(\n      deprecatedOptions != null ? deprecatedOptions : {},\n      (_a = await parseProviderOptions({\n        provider: \"openaiCompatible\",\n        providerOptions,\n        schema: openaiCompatibleLanguageModelChatOptions\n      })) != null ? _a : {},\n      (_b = await parseProviderOptions({\n        provider: this.providerOptionsName,\n        providerOptions,\n        schema: openaiCompatibleLanguageModelChatOptions\n      })) != null ? _b : {},\n      (_c = await parseProviderOptions({\n        provider: toCamelCase(this.providerOptionsName),\n        providerOptions,\n        schema: openaiCompatibleLanguageModelChatOptions\n      })) != null ? _c : {}\n    );\n    const strictJsonSchema = (_d = compatibleOptions == null ? void 0 : compatibleOptions.strictJsonSchema) != null ? _d : true;\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    if ((responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && !this.supportsStructuredOutputs) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"responseFormat\",\n        details: \"JSON response format schema is only supported with structuredOutputs\"\n      });\n    }\n    const {\n      tools: openaiTools,\n      toolChoice: openaiToolChoice,\n      toolWarnings\n    } = prepareTools({\n      tools,\n      toolChoice\n    });\n    const metadataKey = resolveProviderOptionsKey(\n      this.providerOptionsName,\n      providerOptions\n    );\n    return {\n      metadataKey,\n      args: {\n        // model id:\n        model: this.modelId,\n        // model specific settings:\n        user: compatibleOptions.user,\n        // standardized settings:\n        max_tokens: maxOutputTokens,\n        temperature,\n        top_p: topP,\n        frequency_penalty: frequencyPenalty,\n        presence_penalty: presencePenalty,\n        response_format: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" ? this.supportsStructuredOutputs === true && responseFormat.schema != null ? {\n          type: \"json_schema\",\n          json_schema: {\n            schema: responseFormat.schema,\n            strict: strictJsonSchema,\n            name: (_e = responseFormat.name) != null ? _e : \"response\",\n            description: responseFormat.description\n          }\n        } : { type: \"json_object\" } : void 0,\n        stop: stopSequences,\n        seed,\n        ...Object.fromEntries(\n          Object.entries({\n            ...providerOptions == null ? void 0 : providerOptions[this.providerOptionsName],\n            ...providerOptions == null ? void 0 : providerOptions[toCamelCase(this.providerOptionsName)]\n          }).filter(\n            ([key]) => !Object.keys(\n              openaiCompatibleLanguageModelChatOptions.shape\n            ).includes(key)\n          )\n        ),\n        reasoning_effort: compatibleOptions.reasoningEffort,\n        verbosity: compatibleOptions.textVerbosity,\n        // messages:\n        messages: convertToOpenAICompatibleChatMessages(prompt),\n        // tools:\n        tools: openaiTools,\n        tool_choice: openaiToolChoice\n      },\n      warnings: [...warnings, ...toolWarnings]\n    };\n  }\n  async doGenerate(options) {\n    var _a, _b, _c, _d, _e, _f, _g, _h;\n    const { args, warnings, metadataKey } = await this.getArgs({ ...options });\n    const transformedBody = this.transformRequestBody(args);\n    const body = JSON.stringify(transformedBody);\n    const {\n      responseHeaders,\n      value: responseBody,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/chat/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body: transformedBody,\n      failedResponseHandler: this.failedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        OpenAICompatibleChatResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const choice = responseBody.choices[0];\n    if (choice == null) {\n      throw new InvalidResponseDataError({\n        data: rawResponse,\n        message: \"Response did not contain any choices.\"\n      });\n    }\n    const content = [];\n    const reasoning = (_a = choice.message.reasoning_content) != null ? _a : choice.message.reasoning;\n    if (reasoning != null && reasoning.length > 0) {\n      content.push({\n        type: \"reasoning\",\n        text: reasoning\n      });\n    }\n    content.push(...convertOpenAICompatibleContent(choice.message.content));\n    if (choice.message.tool_calls != null) {\n      for (const toolCall of choice.message.tool_calls) {\n        const thoughtSignature = (_c = (_b = toolCall.extra_content) == null ? void 0 : _b.google) == null ? void 0 : _c.thought_signature;\n        content.push({\n          type: \"tool-call\",\n          toolCallId: (_d = toolCall.id) != null ? _d : generateId(),\n          toolName: toolCall.function.name,\n          input: toolCall.function.arguments,\n          ...thoughtSignature ? {\n            providerMetadata: {\n              [metadataKey]: { thoughtSignature }\n            }\n          } : {}\n        });\n      }\n    }\n    const providerMetadata = {\n      [metadataKey]: {},\n      ...await ((_f = (_e = this.config.metadataExtractor) == null ? void 0 : _e.extractMetadata) == null ? void 0 : _f.call(_e, {\n        parsedBody: rawResponse\n      }))\n    };\n    const completionTokenDetails = (_g = responseBody.usage) == null ? void 0 : _g.completion_tokens_details;\n    if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {\n      providerMetadata[metadataKey].acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;\n    }\n    if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {\n      providerMetadata[metadataKey].rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;\n    }\n    return {\n      content,\n      finishReason: {\n        unified: mapOpenAICompatibleFinishReason(choice.finish_reason),\n        raw: (_h = choice.finish_reason) != null ? _h : void 0\n      },\n      usage: this.convertUsage(responseBody.usage),\n      providerMetadata,\n      request: { body },\n      response: {\n        ...getResponseMetadata(responseBody),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings\n    };\n  }\n  async doStream(options) {\n    var _a;\n    const { args, warnings, metadataKey } = await this.getArgs({ ...options });\n    const body = this.transformRequestBody({\n      ...args,\n      stream: true,\n      // only include stream_options when in strict compatibility mode:\n      stream_options: this.config.includeUsage ? { include_usage: true } : void 0\n    });\n    const metadataExtractor = (_a = this.config.metadataExtractor) == null ? void 0 : _a.createStreamExtractor();\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/chat/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: this.failedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        this.chunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const providerOptionsName = metadataKey;\n    let toolCallTracker;\n    const pendingToolCalls = /* @__PURE__ */ new Map();\n    const forwardedToolCallIndices = /* @__PURE__ */ new Set();\n    const processToolCallDelta = (toolCallDelta) => {\n      var _a2, _b, _c, _d, _e;\n      const index = toolCallDelta.index;\n      if (index == null || forwardedToolCallIndices.has(index)) {\n        toolCallTracker.processDelta(toolCallDelta);\n        return;\n      }\n      let pending = pendingToolCalls.get(index);\n      if (pending == null) {\n        pending = {\n          id: (_a2 = toolCallDelta.id) != null ? _a2 : null,\n          bufferedArguments: \"\",\n          extraContent: (_b = toolCallDelta.extra_content) != null ? _b : null\n        };\n        pendingToolCalls.set(index, pending);\n      } else {\n        if (pending.id == null && toolCallDelta.id != null) {\n          pending.id = toolCallDelta.id;\n        }\n        if (pending.extraContent == null && toolCallDelta.extra_content != null) {\n          pending.extraContent = toolCallDelta.extra_content;\n        }\n      }\n      const argumentsDelta = (_c = toolCallDelta.function) == null ? void 0 : _c.arguments;\n      if (argumentsDelta != null) {\n        pending.bufferedArguments += argumentsDelta;\n      }\n      const name = (_d = toolCallDelta.function) == null ? void 0 : _d.name;\n      if (name != null) {\n        toolCallTracker.processDelta({\n          index,\n          id: pending.id,\n          function: {\n            name,\n            arguments: pending.bufferedArguments\n          },\n          extra_content: (_e = pending.extraContent) != null ? _e : void 0\n        });\n        pendingToolCalls.delete(index);\n        forwardedToolCallIndices.add(index);\n      }\n    };\n    let finishReason;\n    let usage = void 0;\n    let isFirstChunk = true;\n    let isActiveReasoning = false;\n    let isActiveText = false;\n    const convertUsage = (usage2) => this.convertUsage(usage2);\n    return {\n      stream: response.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            toolCallTracker = new StreamingToolCallTracker(\n              controller,\n              {\n                generateId,\n                extractMetadata: (delta) => {\n                  var _a2, _b;\n                  const thoughtSignature = (_b = (_a2 = delta.extra_content) == null ? void 0 : _a2.google) == null ? void 0 : _b.thought_signature;\n                  return thoughtSignature ? { [providerOptionsName]: { thoughtSignature } } : void 0;\n                },\n                buildToolCallProviderMetadata: (metadata) => metadata\n              }\n            );\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a2, _b;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            metadataExtractor == null ? void 0 : metadataExtractor.processChunk(chunk.rawValue);\n            if (\"error\" in chunk.value) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({\n                type: \"error\",\n                error: chunk.value.error\n              });\n              return;\n            }\n            const value = chunk.value;\n            if (isFirstChunk) {\n              isFirstChunk = false;\n              controller.enqueue({\n                type: \"response-metadata\",\n                ...getResponseMetadata(value)\n              });\n            }\n            if (value.usage != null) {\n              usage = value.usage;\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = {\n                unified: mapOpenAICompatibleFinishReason(choice.finish_reason),\n                raw: (_a2 = choice.finish_reason) != null ? _a2 : void 0\n              };\n            }\n            if ((choice == null ? void 0 : choice.delta) == null) {\n              return;\n            }\n            const delta = choice.delta;\n            const enqueueReasoningDelta = (reasoningDelta) => {\n              if (isActiveText) {\n                controller.enqueue({ type: \"text-end\", id: \"txt-0\" });\n                isActiveText = false;\n              }\n              if (!isActiveReasoning) {\n                controller.enqueue({\n                  type: \"reasoning-start\",\n                  id: \"reasoning-0\"\n                });\n                isActiveReasoning = true;\n              }\n              controller.enqueue({\n                type: \"reasoning-delta\",\n                id: \"reasoning-0\",\n                delta: reasoningDelta\n              });\n            };\n            const enqueueTextDelta = (textDelta) => {\n              if (isActiveReasoning) {\n                controller.enqueue({\n                  type: \"reasoning-end\",\n                  id: \"reasoning-0\"\n                });\n                isActiveReasoning = false;\n              }\n              if (!isActiveText) {\n                controller.enqueue({ type: \"text-start\", id: \"txt-0\" });\n                isActiveText = true;\n              }\n              controller.enqueue({\n                type: \"text-delta\",\n                id: \"txt-0\",\n                delta: textDelta\n              });\n            };\n            const reasoningContent = (_b = delta.reasoning_content) != null ? _b : delta.reasoning;\n            if (reasoningContent) {\n              enqueueReasoningDelta(reasoningContent);\n            }\n            for (const contentPart of convertOpenAICompatibleContent(\n              delta.content\n            )) {\n              if (contentPart.type === \"reasoning\") {\n                enqueueReasoningDelta(contentPart.text);\n              } else {\n                enqueueTextDelta(contentPart.text);\n              }\n            }\n            if (delta.tool_calls != null && delta.tool_calls.length > 0) {\n              if (isActiveReasoning) {\n                controller.enqueue({\n                  type: \"reasoning-end\",\n                  id: \"reasoning-0\"\n                });\n                isActiveReasoning = false;\n              }\n              for (const toolCallDelta of delta.tool_calls) {\n                processToolCallDelta(toolCallDelta);\n              }\n            }\n          },\n          flush(controller) {\n            var _a2, _b, _c, _d;\n            if (isActiveReasoning) {\n              controller.enqueue({ type: \"reasoning-end\", id: \"reasoning-0\" });\n            }\n            if (isActiveText) {\n              controller.enqueue({ type: \"text-end\", id: \"txt-0\" });\n            }\n            for (const [index, pending] of pendingToolCalls) {\n              toolCallTracker.processDelta({\n                index,\n                id: pending.id,\n                function: { arguments: pending.bufferedArguments }\n              });\n            }\n            pendingToolCalls.clear();\n            toolCallTracker.flush();\n            if (finishReason == null) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({\n                type: \"error\",\n                error: new InvalidResponseDataError({\n                  data: void 0,\n                  message: \"Response stream ended without a finish reason.\"\n                })\n              });\n            }\n            const providerMetadata = {\n              [providerOptionsName]: {},\n              ...metadataExtractor == null ? void 0 : metadataExtractor.buildMetadata()\n            };\n            if (((_a2 = usage == null ? void 0 : usage.completion_tokens_details) == null ? void 0 : _a2.accepted_prediction_tokens) != null) {\n              providerMetadata[providerOptionsName].acceptedPredictionTokens = (_b = usage == null ? void 0 : usage.completion_tokens_details) == null ? void 0 : _b.accepted_prediction_tokens;\n            }\n            if (((_c = usage == null ? void 0 : usage.completion_tokens_details) == null ? void 0 : _c.rejected_prediction_tokens) != null) {\n              providerMetadata[providerOptionsName].rejectedPredictionTokens = (_d = usage == null ? void 0 : usage.completion_tokens_details) == null ? void 0 : _d.rejected_prediction_tokens;\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertUsage(usage),\n              providerMetadata\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n};\nvar openaiCompatibleTokenUsageSchema = () => z3.looseObject({\n  prompt_tokens: z3.number().nullish(),\n  completion_tokens: z3.number().nullish(),\n  total_tokens: z3.number().nullish(),\n  prompt_tokens_details: z3.looseObject({\n    cached_tokens: z3.number().nullish()\n  }).nullish(),\n  completion_tokens_details: z3.looseObject({\n    reasoning_tokens: z3.number().nullish(),\n    accepted_prediction_tokens: z3.number().nullish(),\n    rejected_prediction_tokens: z3.number().nullish()\n  }).nullish()\n}).nullish();\nvar openAICompatibleContentSchema = () => z3.union([\n  z3.string(),\n  z3.array(\n    z3.looseObject({\n      type: z3.string()\n    })\n  )\n]).nullish();\nfunction convertOpenAICompatibleContent(content) {\n  if (content == null) {\n    return [];\n  }\n  if (typeof content === \"string\") {\n    return content.length > 0 ? [{ type: \"text\", text: content }] : [];\n  }\n  const result = [];\n  for (const part of content) {\n    if (part.type === \"text\" && typeof part.text === \"string\") {\n      if (part.text.length > 0) {\n        result.push({ type: \"text\", text: part.text });\n      }\n    } else if (part.type === \"thinking\" && Array.isArray(part.thinking)) {\n      const reasoningText = part.thinking.filter(\n        (chunk) => chunk != null && typeof chunk === \"object\" && \"type\" in chunk && chunk.type === \"text\" && \"text\" in chunk && typeof chunk.text === \"string\"\n      ).map((chunk) => chunk.text).join(\"\");\n      if (reasoningText.length > 0) {\n        result.push({ type: \"reasoning\", text: reasoningText });\n      }\n    }\n  }\n  return result;\n}\nvar OpenAICompatibleChatResponseSchema = lazySchema(\n  () => zodSchema(\n    z3.looseObject({\n      id: z3.string().nullish(),\n      created: z3.number().nullish(),\n      model: z3.string().nullish(),\n      choices: z3.array(\n        z3.object({\n          message: z3.object({\n            role: z3.literal(\"assistant\").nullish(),\n            content: openAICompatibleContentSchema(),\n            reasoning_content: z3.string().nullish(),\n            reasoning: z3.string().nullish(),\n            tool_calls: z3.array(\n              z3.object({\n                id: z3.string().nullish(),\n                function: z3.object({\n                  name: z3.string(),\n                  arguments: z3.string()\n                }),\n                // Support for Google Gemini thought signatures via OpenAI compatibility\n                extra_content: z3.object({\n                  google: z3.object({\n                    thought_signature: z3.string().nullish()\n                  }).nullish()\n                }).nullish()\n              })\n            ).nullish()\n          }),\n          finish_reason: z3.string().nullish()\n        })\n      ),\n      usage: openaiCompatibleTokenUsageSchema()\n    })\n  )\n);\nvar chunkBaseSchema = () => z3.looseObject({\n  id: z3.string().nullish(),\n  created: z3.number().nullish(),\n  model: z3.string().nullish(),\n  choices: z3.array(\n    z3.object({\n      delta: z3.object({\n        role: z3.enum([\"assistant\", \"\"]).nullish(),\n        content: openAICompatibleContentSchema(),\n        // Most openai-compatible models set `reasoning_content`, but some\n        // providers serving `gpt-oss` set `reasoning`. See #7866\n        reasoning_content: z3.string().nullish(),\n        reasoning: z3.string().nullish(),\n        tool_calls: z3.array(\n          z3.object({\n            index: z3.number().nullish(),\n            //google does not send index\n            id: z3.string().nullish(),\n            function: z3.object({\n              name: z3.string().nullish(),\n              arguments: z3.string().nullish()\n            }),\n            // Support for Google Gemini thought signatures via OpenAI compatibility\n            extra_content: z3.object({\n              google: z3.object({\n                thought_signature: z3.string().nullish()\n              }).nullish()\n            }).nullish()\n          })\n        ).nullish()\n      }).nullish(),\n      finish_reason: z3.string().nullish()\n    })\n  ),\n  usage: openaiCompatibleTokenUsageSchema()\n});\nvar createOpenAICompatibleChatChunkSchema = (errorSchema) => z3.union([chunkBaseSchema(), errorSchema]);\n\n// src/completion/openai-compatible-completion-language-model.ts\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3,\n  combineHeaders as combineHeaders2,\n  createEventSourceResponseHandler as createEventSourceResponseHandler2,\n  createJsonErrorResponseHandler as createJsonErrorResponseHandler2,\n  createJsonResponseHandler as createJsonResponseHandler2,\n  parseProviderOptions as parseProviderOptions2,\n  postJsonToApi as postJsonToApi2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\n\n// src/completion/convert-openai-compatible-completion-usage.ts\nfunction convertOpenAICompatibleCompletionUsage(usage) {\n  var _a, _b;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = (_a = usage.prompt_tokens) != null ? _a : 0;\n  const completionTokens = (_b = usage.completion_tokens) != null ? _b : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens,\n      cacheRead: void 0,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: completionTokens,\n      text: completionTokens,\n      reasoning: void 0\n    },\n    raw: usage\n  };\n}\n\n// src/completion/convert-to-openai-compatible-completion-prompt.ts\nimport {\n  InvalidPromptError,\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError3\n} from \"@ai-sdk/provider\";\nfunction convertToOpenAICompatibleCompletionPrompt({\n  prompt,\n  user = \"user\",\n  assistant = \"assistant\"\n}) {\n  let text = \"\";\n  if (prompt[0].role === \"system\") {\n    text += `${prompt[0].content}\n\n`;\n    prompt = prompt.slice(1);\n  }\n  for (const { role, content } of prompt) {\n    switch (role) {\n      case \"system\": {\n        throw new InvalidPromptError({\n          message: \"Unexpected system message in prompt: ${content}\",\n          prompt\n        });\n      }\n      case \"user\": {\n        const userMessage = content.map((part) => {\n          switch (part.type) {\n            case \"text\": {\n              return part.text;\n            }\n          }\n        }).filter(Boolean).join(\"\");\n        text += `${user}:\n${userMessage}\n\n`;\n        break;\n      }\n      case \"assistant\": {\n        const assistantMessage = content.map((part) => {\n          switch (part.type) {\n            case \"text\": {\n              return part.text;\n            }\n            case \"tool-call\": {\n              throw new UnsupportedFunctionalityError3({\n                functionality: \"tool-call messages\"\n              });\n            }\n          }\n        }).join(\"\");\n        text += `${assistant}:\n${assistantMessage}\n\n`;\n        break;\n      }\n      case \"tool\": {\n        throw new UnsupportedFunctionalityError3({\n          functionality: \"tool messages\"\n        });\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  text += `${assistant}:\n`;\n  return {\n    prompt: text,\n    stopSequences: [`\n${user}:`]\n  };\n}\n\n// src/completion/get-response-metadata.ts\nfunction getResponseMetadata2({\n  id,\n  model,\n  created\n}) {\n  return {\n    id: id != null ? id : void 0,\n    modelId: model != null ? model : void 0,\n    timestamp: created != null ? new Date(created * 1e3) : void 0\n  };\n}\n\n// src/completion/map-openai-compatible-finish-reason.ts\nfunction mapOpenAICompatibleFinishReason2(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    case \"function_call\":\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/completion/openai-compatible-completion-options.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\nvar openaiCompatibleLanguageModelCompletionOptions = lazySchema2(\n  () => zodSchema2(\n    z4.object({\n      /**\n       * Echo back the prompt in addition to the completion.\n       */\n      echo: z4.boolean().optional(),\n      /**\n       * Modify the likelihood of specified tokens appearing in the completion.\n       *\n       * Accepts a JSON object that maps tokens (specified by their token ID in\n       * the GPT tokenizer) to an associated bias value from -100 to 100.\n       */\n      logitBias: z4.record(z4.string(), z4.number()).optional(),\n      /**\n       * The suffix that comes after a completion of inserted text.\n       */\n      suffix: z4.string().optional(),\n      /**\n       * A unique identifier representing your end-user, which can help providers to\n       * monitor and detect abuse.\n       */\n      user: z4.string().optional()\n    })\n  )\n);\n\n// src/completion/openai-compatible-completion-language-model.ts\nvar OpenAICompatibleCompletionLanguageModel = class {\n  // type inferred via constructor\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    var _a;\n    this.modelId = modelId;\n    this.config = config;\n    const errorStructure = (_a = config.errorStructure) != null ? _a : defaultOpenAICompatibleErrorStructure;\n    this.chunkSchema = createOpenAICompatibleCompletionChunkSchema(\n      errorStructure.errorSchema\n    );\n    this.failedResponseHandler = createJsonErrorResponseHandler2(errorStructure);\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get providerOptionsName() {\n    return this.config.provider.split(\".\")[0].trim();\n  }\n  get supportedUrls() {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences: userStopSequences,\n    responseFormat,\n    seed,\n    providerOptions,\n    tools,\n    toolChoice\n  }) {\n    var _a, _b;\n    const warnings = [];\n    const completionOptions = Object.assign(\n      (_a = await parseProviderOptions2({\n        provider: this.providerOptionsName,\n        providerOptions,\n        schema: openaiCompatibleLanguageModelCompletionOptions\n      })) != null ? _a : {},\n      (_b = await parseProviderOptions2({\n        provider: toCamelCase(this.providerOptionsName),\n        providerOptions,\n        schema: openaiCompatibleLanguageModelCompletionOptions\n      })) != null ? _b : {}\n    );\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    if (tools == null ? void 0 : tools.length) {\n      warnings.push({ type: \"unsupported\", feature: \"tools\" });\n    }\n    if (toolChoice != null) {\n      warnings.push({ type: \"unsupported\", feature: \"toolChoice\" });\n    }\n    if (responseFormat != null && responseFormat.type !== \"text\") {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"responseFormat\",\n        details: \"JSON response format is not supported.\"\n      });\n    }\n    const { prompt: completionPrompt, stopSequences } = convertToOpenAICompatibleCompletionPrompt({ prompt });\n    const stop = [...stopSequences != null ? stopSequences : [], ...userStopSequences != null ? userStopSequences : []];\n    return {\n      args: {\n        // model id:\n        model: this.modelId,\n        // model specific settings:\n        echo: completionOptions.echo,\n        logit_bias: completionOptions.logitBias,\n        suffix: completionOptions.suffix,\n        user: completionOptions.user,\n        // standardized settings:\n        max_tokens: maxOutputTokens,\n        temperature,\n        top_p: topP,\n        frequency_penalty: frequencyPenalty,\n        presence_penalty: presencePenalty,\n        seed,\n        ...providerOptions == null ? void 0 : providerOptions[this.providerOptionsName],\n        ...providerOptions == null ? void 0 : providerOptions[toCamelCase(this.providerOptionsName)],\n        // prompt:\n        prompt: completionPrompt,\n        // stop sequences:\n        stop: stop.length > 0 ? stop : void 0\n      },\n      warnings\n    };\n  }\n  async doGenerate(options) {\n    const { args, warnings } = await this.getArgs(options);\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi2({\n      url: this.config.url({\n        path: \"/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders2(this.config.headers(), options.headers),\n      body: args,\n      failedResponseHandler: this.failedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler2(\n        openaiCompatibleCompletionResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const choice = response.choices[0];\n    const content = [];\n    if (choice.text != null && choice.text.length > 0) {\n      content.push({ type: \"text\", text: choice.text });\n    }\n    return {\n      content,\n      usage: convertOpenAICompatibleCompletionUsage(response.usage),\n      finishReason: {\n        unified: mapOpenAICompatibleFinishReason2(choice.finish_reason),\n        raw: choice.finish_reason\n      },\n      request: { body: args },\n      response: {\n        ...getResponseMetadata2(response),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings\n    };\n  }\n  async doStream(options) {\n    const { args, warnings } = await this.getArgs(options);\n    const body = {\n      ...args,\n      stream: true,\n      // only include stream_options when in strict compatibility mode:\n      stream_options: this.config.includeUsage ? { include_usage: true } : void 0\n    };\n    const { responseHeaders, value: response } = await postJsonToApi2({\n      url: this.config.url({\n        path: \"/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders2(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: this.failedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler2(\n        this.chunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage = void 0;\n    let isFirstChunk = true;\n    return {\n      stream: response.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (\"error\" in value) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            if (isFirstChunk) {\n              isFirstChunk = false;\n              controller.enqueue({\n                type: \"response-metadata\",\n                ...getResponseMetadata2(value)\n              });\n              controller.enqueue({\n                type: \"text-start\",\n                id: \"0\"\n              });\n            }\n            if (value.usage != null) {\n              usage = value.usage;\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = {\n                unified: mapOpenAICompatibleFinishReason2(choice.finish_reason),\n                raw: (_a = choice.finish_reason) != null ? _a : void 0\n              };\n            }\n            if ((choice == null ? void 0 : choice.text) != null) {\n              controller.enqueue({\n                type: \"text-delta\",\n                id: \"0\",\n                delta: choice.text\n              });\n            }\n          },\n          flush(controller) {\n            if (!isFirstChunk) {\n              controller.enqueue({ type: \"text-end\", id: \"0\" });\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertOpenAICompatibleCompletionUsage(usage)\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n};\nvar usageSchema = () => z5.looseObject({\n  prompt_tokens: z5.number(),\n  completion_tokens: z5.number(),\n  total_tokens: z5.number()\n});\nvar openaiCompatibleCompletionResponseSchema = lazySchema3(\n  () => zodSchema3(\n    z5.object({\n      id: z5.string().nullish(),\n      created: z5.number().nullish(),\n      model: z5.string().nullish(),\n      choices: z5.array(\n        z5.object({\n          text: z5.string(),\n          finish_reason: z5.string()\n        })\n      ),\n      usage: usageSchema().nullish()\n    })\n  )\n);\nvar createOpenAICompatibleCompletionChunkSchema = (errorSchema) => z5.union([\n  z5.object({\n    id: z5.string().nullish(),\n    created: z5.number().nullish(),\n    model: z5.string().nullish(),\n    choices: z5.array(\n      z5.object({\n        text: z5.string(),\n        finish_reason: z5.string().nullish(),\n        index: z5.number()\n      })\n    ),\n    usage: usageSchema().nullish()\n  }),\n  errorSchema\n]);\n\n// src/embedding/openai-compatible-embedding-model.ts\nimport {\n  TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema5,\n  zodSchema as zodSchema5,\n  combineHeaders as combineHeaders3,\n  createJsonErrorResponseHandler as createJsonErrorResponseHandler3,\n  createJsonResponseHandler as createJsonResponseHandler3,\n  parseProviderOptions as parseProviderOptions3,\n  postJsonToApi as postJsonToApi3\n} from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\n\n// src/embedding/openai-compatible-embedding-options.ts\nimport {\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4\n} from \"@ai-sdk/provider-utils\";\nimport { z as z6 } from \"zod/v4\";\nvar openaiCompatibleEmbeddingModelOptions = lazySchema4(\n  () => zodSchema4(\n    z6.object({\n      /**\n       * The number of dimensions the resulting output embeddings should have.\n       * Only supported in text-embedding-3 and later models.\n       */\n      dimensions: z6.number().optional(),\n      /**\n       * A unique identifier representing your end-user, which can help providers to\n       * monitor and detect abuse.\n       */\n      user: z6.string().optional()\n    })\n  )\n);\n\n// src/embedding/openai-compatible-embedding-model.ts\nvar OpenAICompatibleEmbeddingModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get maxEmbeddingsPerCall() {\n    var _a;\n    return (_a = this.config.maxEmbeddingsPerCall) != null ? _a : 2048;\n  }\n  get supportsParallelCalls() {\n    var _a;\n    return (_a = this.config.supportsParallelCalls) != null ? _a : true;\n  }\n  get providerOptionsName() {\n    return this.config.provider.split(\".\")[0].trim();\n  }\n  async doEmbed({\n    values,\n    headers,\n    abortSignal,\n    providerOptions\n  }) {\n    var _a, _b, _c;\n    const warnings = [];\n    const deprecatedOptions = await parseProviderOptions3({\n      provider: \"openai-compatible\",\n      providerOptions,\n      schema: openaiCompatibleEmbeddingModelOptions\n    });\n    if (deprecatedOptions != null) {\n      warnings.push({\n        type: \"other\",\n        message: `The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead.`\n      });\n    }\n    const compatibleOptions = Object.assign(\n      deprecatedOptions != null ? deprecatedOptions : {},\n      (_a = await parseProviderOptions3({\n        provider: \"openaiCompatible\",\n        providerOptions,\n        schema: openaiCompatibleEmbeddingModelOptions\n      })) != null ? _a : {},\n      (_b = await parseProviderOptions3({\n        provider: this.providerOptionsName,\n        providerOptions,\n        schema: openaiCompatibleEmbeddingModelOptions\n      })) != null ? _b : {}\n    );\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values\n      });\n    }\n    const {\n      responseHeaders,\n      value: response,\n      rawValue\n    } = await postJsonToApi3({\n      url: this.config.url({\n        path: \"/embeddings\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders3(this.config.headers(), headers),\n      body: {\n        model: this.modelId,\n        input: values,\n        encoding_format: \"float\",\n        dimensions: compatibleOptions.dimensions,\n        user: compatibleOptions.user\n      },\n      failedResponseHandler: createJsonErrorResponseHandler3(\n        (_c = this.config.errorStructure) != null ? _c : defaultOpenAICompatibleErrorStructure\n      ),\n      successfulResponseHandler: createJsonResponseHandler3(\n        openaiTextEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      warnings,\n      embeddings: response.data.map((item) => item.embedding),\n      usage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,\n      providerMetadata: response.providerMetadata,\n      response: { headers: responseHeaders, body: rawValue }\n    };\n  }\n};\nvar openaiTextEmbeddingResponseSchema = lazySchema5(\n  () => zodSchema5(\n    z7.object({\n      data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),\n      usage: z7.object({ prompt_tokens: z7.number() }).nullish(),\n      providerMetadata: z7.record(z7.string(), z7.record(z7.string(), z7.any())).optional()\n    })\n  )\n);\n\n// src/image/openai-compatible-image-model.ts\nimport {\n  InvalidResponseDataError as InvalidResponseDataError2\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema6,\n  zodSchema as zodSchema6,\n  combineHeaders as combineHeaders4,\n  convertBase64ToUint8Array as convertBase64ToUint8Array2,\n  convertToFormData,\n  createBinaryResponseHandler,\n  createJsonErrorResponseHandler as createJsonErrorResponseHandler4,\n  createJsonResponseHandler as createJsonResponseHandler4,\n  createStatusCodeErrorResponseHandler,\n  downloadBlob,\n  getFromApi,\n  postFormDataToApi,\n  postJsonToApi as postJsonToApi4\n} from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\nvar OpenAICompatibleImageModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n    this.maxImagesPerCall = 10;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  /**\n   * The provider options key used to extract provider-specific options.\n   */\n  get providerOptionsKey() {\n    return this.config.provider.split(\".\")[0].trim();\n  }\n  // TODO: deprecate non-camelCase keys and remove in future major version\n  getArgs(providerOptions) {\n    return {\n      ...providerOptions[this.providerOptionsKey],\n      ...providerOptions[toCamelCase(this.providerOptionsKey)]\n    };\n  }\n  async doGenerate({\n    prompt,\n    n,\n    size,\n    aspectRatio,\n    seed,\n    providerOptions,\n    headers,\n    abortSignal,\n    files,\n    mask\n  }) {\n    var _a, _b, _c, _d, _e;\n    const warnings = [];\n    if (aspectRatio != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"aspectRatio\",\n        details: \"This model does not support aspect ratio. Use `size` instead.\"\n      });\n    }\n    if (seed != null) {\n      warnings.push({ type: \"unsupported\", feature: \"seed\" });\n    }\n    const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();\n    const args = this.getArgs(providerOptions);\n    const isEditing = files != null && files.length > 0;\n    const url = this.config.url({\n      path: isEditing ? \"/images/edits\" : \"/images/generations\",\n      modelId: this.modelId\n    });\n    const requestHeaders = combineHeaders4(this.config.headers(), headers);\n    if (isEditing) {\n      const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({\n        url,\n        headers: requestHeaders,\n        formData: convertToFormData({\n          model: this.modelId,\n          prompt,\n          image: await Promise.all(files.map((file) => fileToBlob(file))),\n          mask: mask != null ? await fileToBlob(mask) : void 0,\n          n,\n          size,\n          ...args\n        }),\n        failedResponseHandler: createJsonErrorResponseHandler4(\n          (_d = this.config.errorStructure) != null ? _d : defaultOpenAICompatibleErrorStructure\n        ),\n        successfulResponseHandler: createJsonResponseHandler4(\n          openaiCompatibleImageResponseSchema\n        ),\n        abortSignal,\n        fetch: this.config.fetch\n      });\n      return {\n        images: await this.getImages(response2.data, {\n          url,\n          headers: requestHeaders,\n          abortSignal\n        }),\n        warnings,\n        response: {\n          timestamp: currentDate,\n          modelId: this.modelId,\n          headers: responseHeaders2\n        }\n      };\n    }\n    const { value: response, responseHeaders } = await postJsonToApi4({\n      url,\n      headers: requestHeaders,\n      body: {\n        model: this.modelId,\n        prompt,\n        n,\n        size,\n        ...args,\n        response_format: \"b64_json\"\n      },\n      failedResponseHandler: createJsonErrorResponseHandler4(\n        (_e = this.config.errorStructure) != null ? _e : defaultOpenAICompatibleErrorStructure\n      ),\n      successfulResponseHandler: createJsonResponseHandler4(\n        openaiCompatibleImageResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      images: await this.getImages(response.data, {\n        url,\n        headers: requestHeaders,\n        abortSignal\n      }),\n      warnings,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders\n      }\n    };\n  }\n  async getImages(data, options) {\n    if (data.every((image) => image.b64_json != null)) {\n      return data.map((image) => image.b64_json);\n    }\n    return Promise.all(\n      data.map(async (image) => {\n        if (image.b64_json != null) {\n          return convertBase64ToUint8Array2(image.b64_json);\n        }\n        if (image.url == null) {\n          throw new InvalidResponseDataError2({\n            data: image,\n            message: \"Expected url in the image response\"\n          });\n        }\n        const { value } = await getFromApi({\n          url: image.url,\n          validateUrl: true,\n          trustedOrigin: options.url,\n          credentialedOrigin: options.url,\n          headers: options.headers,\n          abortSignal: options.abortSignal,\n          fetch: this.config.fetch,\n          successfulResponseHandler: createBinaryResponseHandler(),\n          failedResponseHandler: createStatusCodeErrorResponseHandler()\n        });\n        return value;\n      })\n    );\n  }\n};\nvar openaiCompatibleImageResponseSchema = lazySchema6(\n  () => zodSchema6(\n    z8.object({\n      data: z8.array(\n        z8.object({\n          b64_json: z8.string().nullish(),\n          url: z8.string().nullish()\n        }).refine((image) => image.b64_json != null || image.url != null, {\n          message: \"Expected b64_json or url in the image response\"\n        })\n      )\n    })\n  )\n);\nasync function fileToBlob(file) {\n  if (file.type === \"url\") {\n    return downloadBlob(file.url);\n  }\n  const data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array2(file.data);\n  return new Blob([data], { type: file.mediaType });\n}\n\n// src/openai-compatible-provider.ts\nimport {\n  withoutTrailingSlash,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\n\n// src/version.ts\nvar VERSION = true ? \"2.0.88\" : \"0.0.0-test\";\n\n// src/openai-compatible-provider.ts\nfunction createOpenAICompatible(options) {\n  const baseURL = withoutTrailingSlash(options.baseURL);\n  const providerName = options.name;\n  const headers = {\n    ...options.apiKey && { Authorization: `Bearer ${options.apiKey}` },\n    ...options.headers\n  };\n  const getHeaders = () => withUserAgentSuffix(headers, `ai-sdk/openai-compatible/${VERSION}`);\n  const getCommonModelConfig = (modelType) => ({\n    provider: `${providerName}.${modelType}`,\n    url: ({ path }) => {\n      const url = new URL(`${baseURL}${path}`);\n      if (options.queryParams) {\n        url.search = new URLSearchParams(options.queryParams).toString();\n      }\n      return url.toString();\n    },\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createLanguageModel = (modelId) => createChatModel(modelId);\n  const createChatModel = (modelId) => new OpenAICompatibleChatLanguageModel(modelId, {\n    ...getCommonModelConfig(\"chat\"),\n    includeUsage: options.includeUsage,\n    supportsStructuredOutputs: options.supportsStructuredOutputs,\n    supportedUrls: options.supportedUrls,\n    transformRequestBody: options.transformRequestBody,\n    metadataExtractor: options.metadataExtractor,\n    convertUsage: options.convertUsage\n  });\n  const createCompletionModel = (modelId) => new OpenAICompatibleCompletionLanguageModel(modelId, {\n    ...getCommonModelConfig(\"completion\"),\n    includeUsage: options.includeUsage\n  });\n  const createEmbeddingModel = (modelId) => new OpenAICompatibleEmbeddingModel(modelId, {\n    ...getCommonModelConfig(\"embedding\")\n  });\n  const createImageModel = (modelId) => new OpenAICompatibleImageModel(modelId, getCommonModelConfig(\"image\"));\n  const provider = (modelId) => createLanguageModel(modelId);\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createLanguageModel;\n  provider.chatModel = createChatModel;\n  provider.completionModel = createCompletionModel;\n  provider.embeddingModel = createEmbeddingModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.imageModel = createImageModel;\n  return provider;\n}\nexport {\n  OpenAICompatibleChatLanguageModel,\n  OpenAICompatibleCompletionLanguageModel,\n  OpenAICompatibleEmbeddingModel,\n  OpenAICompatibleImageModel,\n  VERSION,\n  createOpenAICompatible\n};\n//# sourceMappingURL=index.mjs.map","// src/openai-provider.ts\nimport {\n  loadApiKey,\n  loadOptionalSetting,\n  withoutTrailingSlash,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\n\n// src/chat/openai-chat-language-model.ts\nimport {\n  InvalidResponseDataError\n} from \"@ai-sdk/provider\";\nimport {\n  StreamingToolCallTracker,\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler,\n  generateId,\n  parseProviderOptions,\n  postJsonToApi\n} from \"@ai-sdk/provider-utils\";\n\n// src/openai-error.ts\nimport { z } from \"zod/v4\";\nimport {\n  lazySchema,\n  zodSchema,\n  createJsonErrorResponseHandler\n} from \"@ai-sdk/provider-utils\";\nvar openaiErrorDataSchema = () => z.object({\n  error: z.object({\n    message: z.string(),\n    // The additional information below is handled loosely to support\n    // OpenAI-compatible providers that have slightly different error\n    // responses:\n    type: z.string().nullish(),\n    param: z.any().nullish(),\n    code: z.union([z.string(), z.number()]).nullish()\n  })\n});\nvar openaiErrorDataSchemaValidator = lazySchema(\n  () => zodSchema(openaiErrorDataSchema())\n);\nvar openaiFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: openaiErrorDataSchemaValidator,\n  errorToMessage: (data) => data.error.message\n});\n\n// src/openai-language-model-capabilities.ts\nfunction getOpenAILanguageModelCapabilities(modelId) {\n  var _a2, _b, _c, _d, _e;\n  const oSeriesVersion = getOSeriesVersion(modelId);\n  const gptVersion = getGptVersion(modelId);\n  const isGptChatModel = (gptVersion == null ? void 0 : gptVersion.minor) == null && ((_b = (_a2 = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _a2.startsWith(\"chat\")) != null ? _b : false);\n  const isGptNanoModel = (_d = (_c = gptVersion == null ? void 0 : gptVersion.variant) == null ? void 0 : _c.startsWith(\"nano\")) != null ? _d : false;\n  const isGpt6OrLaterModel = gptVersion != null && gptVersion.major >= 6;\n  const isGpt6OrLaterModelWithNoneEffort = modelId === \"gpt-6-sol\" || modelId === \"gpt-6-luna\" || modelId === \"gpt-6.1-terra\";\n  const supportsFlexProcessing = oSeriesVersion != null && oSeriesVersion >= 3 || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;\n  const supportsPriorityProcessing = modelId.startsWith(\"gpt-4\") || gptVersion != null && gptVersion.major >= 5 && !isGptNanoModel && !isGptChatModel || oSeriesVersion != null && oSeriesVersion >= 3;\n  const isReasoningModel = oSeriesVersion != null || gptVersion != null && gptVersion.major >= 5 && !isGptChatModel;\n  const supportsNonReasoningParameters = !isGpt6OrLaterModel && gptVersion != null && (gptVersion.major > 5 || gptVersion.major === 5 && ((_e = gptVersion.minor) != null ? _e : 0) >= 1);\n  const systemMessageMode = isReasoningModel ? \"developer\" : \"system\";\n  return {\n    supportsFlexProcessing,\n    supportsPriorityProcessing,\n    supportsConfigurationUpdate: isGpt6OrLaterModel,\n    supportsAsyncToolCalling: isGpt6OrLaterModel,\n    supportedReasoningEfforts: isGpt6OrLaterModelWithNoneEffort ? [\"none\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] : isGpt6OrLaterModel ? [\"low\", \"medium\", \"high\", \"xhigh\", \"max\"] : void 0,\n    isReasoningModel,\n    systemMessageMode,\n    supportsNonReasoningParameters\n  };\n}\nfunction getOSeriesVersion(modelId) {\n  const match = /^o(\\d+)(?:-|$)/.exec(modelId);\n  return match == null ? void 0 : Number(match[1]);\n}\nfunction getGptVersion(modelId) {\n  const match = /^gpt-(\\d+)(?:\\.(\\d+))?(?:-(.+))?$/.exec(modelId);\n  if (match == null) {\n    return void 0;\n  }\n  return {\n    major: Number(match[1]),\n    minor: match[2] == null ? void 0 : Number(match[2]),\n    variant: match[3]\n  };\n}\n\n// src/normalize-openai-json-schema.ts\nfunction normalizeOpenAIJsonSchema(schema) {\n  const normalizedSchema = normalizeSchema(schema, true);\n  const reference = getSingletonReference(normalizedSchema);\n  if (reference == null) {\n    return normalizedSchema;\n  }\n  const { allOf: _allOf, ...schemaWithoutAllOf } = normalizedSchema;\n  const referencedSchema = getLocalReferenceSchema(reference, normalizedSchema);\n  return typeof referencedSchema !== \"object\" || referencedSchema == null ? normalizedSchema : { ...referencedSchema, ...schemaWithoutAllOf };\n  function normalizeSchema(schema2, isRoot = false) {\n    if (typeof schema2 !== \"object\" || schema2 == null) {\n      return schema2;\n    }\n    const normalizedSchema2 = { ...schema2 };\n    if (normalizedSchema2.properties != null) {\n      normalizedSchema2.properties = normalizeSchemaRecord(\n        normalizedSchema2.properties\n      );\n    }\n    if (normalizedSchema2.patternProperties != null) {\n      normalizedSchema2.patternProperties = normalizeSchemaRecord(\n        normalizedSchema2.patternProperties\n      );\n    }\n    if (normalizedSchema2.definitions != null) {\n      normalizedSchema2.definitions = normalizeSchemaRecord(\n        normalizedSchema2.definitions\n      );\n    }\n    if (normalizedSchema2.$defs != null) {\n      normalizedSchema2.$defs = normalizeSchemaRecord(normalizedSchema2.$defs);\n    }\n    if (normalizedSchema2.items != null) {\n      normalizedSchema2.items = Array.isArray(normalizedSchema2.items) ? normalizedSchema2.items.map((item) => normalizeSchema(item)) : normalizeSchema(normalizedSchema2.items);\n    }\n    if (normalizedSchema2.allOf != null) {\n      normalizedSchema2.allOf = normalizedSchema2.allOf.map(\n        (item) => normalizeSchema(item)\n      );\n    }\n    if (normalizedSchema2.anyOf != null) {\n      normalizedSchema2.anyOf = normalizedSchema2.anyOf.map(\n        (item) => normalizeSchema(item)\n      );\n    }\n    if (normalizedSchema2.oneOf != null) {\n      normalizedSchema2.oneOf = normalizedSchema2.oneOf.map(\n        (item) => normalizeSchema(item)\n      );\n    }\n    if (typeof normalizedSchema2.additionalProperties === \"object\" && normalizedSchema2.additionalProperties != null) {\n      normalizedSchema2.additionalProperties = normalizeSchema(\n        normalizedSchema2.additionalProperties\n      );\n    }\n    const reference2 = getSingletonReference(normalizedSchema2);\n    if (reference2 == null || isRoot) {\n      return normalizedSchema2;\n    }\n    const { allOf: _allOf2, ...schemaWithoutAllOf2 } = normalizedSchema2;\n    return { ...schemaWithoutAllOf2, $ref: reference2 };\n  }\n  function normalizeSchemaRecord(record) {\n    return Object.fromEntries(\n      Object.entries(record).map(([key, value]) => [\n        key,\n        normalizeSchema(value)\n      ])\n    );\n  }\n  function getSingletonReference(schema2) {\n    var _a2;\n    if (((_a2 = schema2.allOf) == null ? void 0 : _a2.length) !== 1) {\n      return void 0;\n    }\n    const [allOfSchema] = schema2.allOf;\n    return typeof allOfSchema === \"object\" && allOfSchema != null && Object.keys(allOfSchema).length === 1 && typeof allOfSchema.$ref === \"string\" ? allOfSchema.$ref : void 0;\n  }\n  function getLocalReferenceSchema(reference2, schema2) {\n    var _a2, _b;\n    const match = /^#\\/(definitions|\\$defs)\\/(.+)$/.exec(reference2);\n    if (match == null) {\n      return void 0;\n    }\n    const [, keyword, encodedName] = match;\n    const name = encodedName.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n    const definition = keyword === \"definitions\" ? (_a2 = schema2.definitions) == null ? void 0 : _a2[name] : (_b = schema2.$defs) == null ? void 0 : _b[name];\n    return definition;\n  }\n}\n\n// src/openai-stream-error.ts\nimport { APICallError } from \"@ai-sdk/provider\";\nfunction createOpenAIProviderStreamError(frame) {\n  var _a2, _b;\n  const streamError = parseStreamError(frame);\n  if (streamError == null) {\n    return void 0;\n  }\n  const statusCode = getStatusCode(streamError);\n  return {\n    message: streamError.message,\n    type: (_a2 = streamError.type) != null ? _a2 : void 0,\n    code: (_b = streamError.code) != null ? _b : void 0,\n    statusCode,\n    isRetryable: isRetryableStreamError(streamError, statusCode),\n    data: frame\n  };\n}\nasync function throwIfOpenAIStreamErrorBeforeOutput({\n  stream,\n  getError,\n  isOutputChunk,\n  url,\n  requestBodyValues,\n  responseHeaders\n}) {\n  const [streamForEarlyError, streamForConsumer] = stream.tee();\n  const reader = streamForEarlyError.getReader();\n  try {\n    while (true) {\n      const result = await reader.read();\n      if (result.done) {\n        return streamForConsumer;\n      }\n      const chunk = result.value;\n      if (!chunk.success) {\n        return streamForConsumer;\n      }\n      const errorFrame = getError(chunk.value);\n      if (errorFrame != null) {\n        streamForConsumer.cancel().catch(() => {\n        });\n        throw createOpenAIStreamError({\n          frame: errorFrame,\n          url,\n          requestBodyValues,\n          responseHeaders\n        });\n      }\n      if (isOutputChunk(chunk.value)) {\n        return streamForConsumer;\n      }\n    }\n  } finally {\n    reader.cancel().catch(() => {\n    });\n    reader.releaseLock();\n  }\n}\nfunction createOpenAIStreamError({\n  frame,\n  url,\n  requestBodyValues,\n  responseHeaders\n}) {\n  var _a2;\n  const streamError = parseStreamError(frame);\n  return new APICallError({\n    message: (_a2 = streamError == null ? void 0 : streamError.message) != null ? _a2 : \"OpenAI stream failed before any output was generated\",\n    url,\n    requestBodyValues,\n    statusCode: streamError == null ? 500 : getStatusCode(streamError),\n    responseHeaders,\n    responseBody: JSON.stringify(frame),\n    data: frame,\n    isRetryable: streamError == null ? true : isRetryableStreamError(streamError, getStatusCode(streamError))\n  });\n}\nfunction parseStreamError(frame) {\n  var _a2;\n  const value = asRecord(frame);\n  if (value == null) {\n    return void 0;\n  }\n  if (value.type === \"response.failed\") {\n    const response = asRecord(value.response);\n    const responseError = asRecord(response == null ? void 0 : response.error);\n    return typeof (responseError == null ? void 0 : responseError.message) === \"string\" ? {\n      message: responseError.message,\n      code: getStringOrNumber(responseError.code),\n      type: \"response.failed\"\n    } : void 0;\n  }\n  const error = (_a2 = asRecord(value.error)) != null ? _a2 : value;\n  return typeof error.message === \"string\" && (asRecord(value.error) != null || typeof error.type === \"string\" || \"code\" in error || \"param\" in error) ? {\n    message: error.message,\n    code: getStringOrNumber(error.code),\n    type: typeof error.type === \"string\" ? error.type : void 0\n  } : void 0;\n}\nfunction getStatusCode(error) {\n  if (typeof error.code === \"number\" && isHttpErrorStatusCode(error.code)) {\n    return error.code;\n  }\n  if (typeof error.code === \"string\" && /^\\d{3}$/.test(error.code)) {\n    const numericCode = Number(error.code);\n    if (isHttpErrorStatusCode(numericCode)) {\n      return numericCode;\n    }\n  }\n  const discriminator = [error.code, error.type].filter((value) => typeof value === \"string\" || typeof value === \"number\").join(\" \").toLowerCase();\n  if ([\"insufficient_quota\", \"rate_limit\"].some(\n    (term) => discriminator.includes(term)\n  )) {\n    return 429;\n  }\n  if (discriminator.includes(\"authentication\")) return 401;\n  if (discriminator.includes(\"permission\")) return 403;\n  if (discriminator.includes(\"not_found\")) return 404;\n  if ([\"invalid\", \"bad_request\", \"context_length\"].some(\n    (term) => discriminator.includes(term)\n  )) {\n    return 400;\n  }\n  if (discriminator.includes(\"overload\")) return 503;\n  if (discriminator.includes(\"timeout\")) return 504;\n  return 500;\n}\nfunction asRecord(value) {\n  return typeof value === \"object\" && value != null ? value : void 0;\n}\nfunction getStringOrNumber(value) {\n  return typeof value === \"string\" || typeof value === \"number\" ? value : void 0;\n}\nfunction isHttpErrorStatusCode(value) {\n  return Number.isInteger(value) && value >= 400 && value <= 599;\n}\nfunction isRetryableStatusCode(statusCode) {\n  return statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500;\n}\nfunction isRetryableStreamError(error, statusCode) {\n  if (error.code === \"insufficient_quota\" || error.type === \"insufficient_quota\") {\n    return false;\n  }\n  return isRetryableStatusCode(statusCode);\n}\n\n// src/chat/convert-openai-chat-usage.ts\nfunction convertOpenAIChatUsage(usage) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = (_a2 = usage.prompt_tokens) != null ? _a2 : 0;\n  const completionTokens = (_b = usage.completion_tokens) != null ? _b : 0;\n  const cachedTokens = (_d = (_c = usage.prompt_tokens_details) == null ? void 0 : _c.cached_tokens) != null ? _d : 0;\n  const cacheWriteTokens = (_f = (_e = usage.prompt_tokens_details) == null ? void 0 : _e.cache_write_tokens) != null ? _f : void 0;\n  const reasoningTokens = (_h = (_g = usage.completion_tokens_details) == null ? void 0 : _g.reasoning_tokens) != null ? _h : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens - cachedTokens - (cacheWriteTokens != null ? cacheWriteTokens : 0),\n      cacheRead: cachedTokens,\n      cacheWrite: cacheWriteTokens\n    },\n    outputTokens: {\n      total: completionTokens,\n      text: Math.max(0, completionTokens - reasoningTokens),\n      reasoning: reasoningTokens\n    },\n    raw: usage\n  };\n}\n\n// src/chat/convert-to-openai-chat-messages.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nimport { convertToBase64 } from \"@ai-sdk/provider-utils\";\nfunction serializeToolCallArguments(input) {\n  return JSON.stringify(\n    typeof input === \"object\" && input !== null && !Array.isArray(input) ? input : {}\n  );\n}\nfunction getPromptCacheBreakpoint(providerOptions) {\n  var _a2;\n  return (_a2 = providerOptions == null ? void 0 : providerOptions.openai) == null ? void 0 : _a2.promptCacheBreakpoint;\n}\nfunction convertToOpenAIChatMessages({\n  prompt,\n  systemMessageMode = \"system\"\n}) {\n  var _a2, _b;\n  const messages = [];\n  const warnings = [];\n  for (const { role, content, providerOptions } of prompt) {\n    switch (role) {\n      case \"system\": {\n        switch (systemMessageMode) {\n          case \"system\": {\n            const promptCacheBreakpoint = getPromptCacheBreakpoint(providerOptions);\n            messages.push({\n              role: \"system\",\n              content: promptCacheBreakpoint == null ? content : [\n                {\n                  type: \"text\",\n                  text: content,\n                  prompt_cache_breakpoint: promptCacheBreakpoint\n                }\n              ]\n            });\n            break;\n          }\n          case \"developer\": {\n            const promptCacheBreakpoint = getPromptCacheBreakpoint(providerOptions);\n            messages.push({\n              role: \"developer\",\n              content: promptCacheBreakpoint == null ? content : [\n                {\n                  type: \"text\",\n                  text: content,\n                  prompt_cache_breakpoint: promptCacheBreakpoint\n                }\n              ]\n            });\n            break;\n          }\n          case \"remove\": {\n            warnings.push({\n              type: \"other\",\n              message: \"system messages are removed for this model\"\n            });\n            break;\n          }\n          default: {\n            const _exhaustiveCheck = systemMessageMode;\n            throw new Error(\n              `Unsupported system message mode: ${_exhaustiveCheck}`\n            );\n          }\n        }\n        break;\n      }\n      case \"user\": {\n        if (content.length === 1 && content[0].type === \"text\" && getPromptCacheBreakpoint(content[0].providerOptions) == null) {\n          messages.push({ role: \"user\", content: content[0].text });\n          break;\n        }\n        messages.push({\n          role: \"user\",\n          content: content.map((part, index) => {\n            var _a3, _b2, _c;\n            switch (part.type) {\n              case \"text\": {\n                const promptCacheBreakpoint = getPromptCacheBreakpoint(\n                  part.providerOptions\n                );\n                return {\n                  type: \"text\",\n                  text: part.text,\n                  ...promptCacheBreakpoint != null && {\n                    prompt_cache_breakpoint: promptCacheBreakpoint\n                  }\n                };\n              }\n              case \"file\": {\n                const promptCacheBreakpoint = getPromptCacheBreakpoint(\n                  part.providerOptions\n                );\n                if (part.mediaType.startsWith(\"image/\")) {\n                  const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n                  return {\n                    type: \"image_url\",\n                    image_url: {\n                      url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,\n                      // OpenAI specific extension: image detail\n                      detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3.openai) == null ? void 0 : _b2.imageDetail\n                    },\n                    ...promptCacheBreakpoint != null && {\n                      prompt_cache_breakpoint: promptCacheBreakpoint\n                    }\n                  };\n                } else if (part.mediaType.startsWith(\"audio/\")) {\n                  if (part.data instanceof URL) {\n                    throw new UnsupportedFunctionalityError({\n                      functionality: \"audio file parts with URLs\"\n                    });\n                  }\n                  switch (part.mediaType) {\n                    case \"audio/wav\": {\n                      return {\n                        type: \"input_audio\",\n                        input_audio: {\n                          data: convertToBase64(part.data),\n                          format: \"wav\"\n                        },\n                        ...promptCacheBreakpoint != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint\n                        }\n                      };\n                    }\n                    case \"audio/mp3\":\n                    case \"audio/mpeg\": {\n                      return {\n                        type: \"input_audio\",\n                        input_audio: {\n                          data: convertToBase64(part.data),\n                          format: \"mp3\"\n                        },\n                        ...promptCacheBreakpoint != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint\n                        }\n                      };\n                    }\n                    default: {\n                      throw new UnsupportedFunctionalityError({\n                        functionality: `audio content parts with media type ${part.mediaType}`\n                      });\n                    }\n                  }\n                } else if (part.mediaType === \"application/pdf\") {\n                  if (part.data instanceof URL) {\n                    throw new UnsupportedFunctionalityError({\n                      functionality: \"PDF file parts with URLs\"\n                    });\n                  }\n                  return {\n                    type: \"file\",\n                    file: typeof part.data === \"string\" && part.data.startsWith(\"file-\") ? { file_id: part.data } : {\n                      filename: (_c = part.filename) != null ? _c : `part-${index}.pdf`,\n                      file_data: `data:application/pdf;base64,${convertToBase64(part.data)}`\n                    },\n                    ...promptCacheBreakpoint != null && {\n                      prompt_cache_breakpoint: promptCacheBreakpoint\n                    }\n                  };\n                } else {\n                  throw new UnsupportedFunctionalityError({\n                    functionality: `file part media type ${part.mediaType}`\n                  });\n                }\n              }\n            }\n          })\n        });\n        break;\n      }\n      case \"assistant\": {\n        let text = \"\";\n        const textParts = [];\n        let hasPromptCacheBreakpoint = false;\n        const toolCalls = [];\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\": {\n              const promptCacheBreakpoint = getPromptCacheBreakpoint(\n                part.providerOptions\n              );\n              text += part.text;\n              textParts.push({\n                type: \"text\",\n                text: part.text,\n                ...promptCacheBreakpoint != null && {\n                  prompt_cache_breakpoint: promptCacheBreakpoint\n                }\n              });\n              hasPromptCacheBreakpoint || (hasPromptCacheBreakpoint = promptCacheBreakpoint != null);\n              break;\n            }\n            case \"tool-call\": {\n              toolCalls.push({\n                id: part.toolCallId,\n                type: \"function\",\n                function: {\n                  name: part.toolName,\n                  arguments: serializeToolCallArguments(part.input)\n                }\n              });\n              break;\n            }\n          }\n        }\n        messages.push({\n          role: \"assistant\",\n          content: hasPromptCacheBreakpoint ? textParts : toolCalls.length > 0 ? text || null : text,\n          tool_calls: toolCalls.length > 0 ? toolCalls : void 0\n        });\n        break;\n      }\n      case \"tool\": {\n        for (const toolResponse of content) {\n          if (toolResponse.type === \"tool-approval-response\") {\n            continue;\n          }\n          const output = toolResponse.output;\n          const promptCacheBreakpoint = (_a2 = output.type === \"content\" ? output.value.map((part) => getPromptCacheBreakpoint(part.providerOptions)).find((breakpoint) => breakpoint != null) : getPromptCacheBreakpoint(output.providerOptions)) != null ? _a2 : getPromptCacheBreakpoint(toolResponse.providerOptions);\n          let contentValue;\n          switch (output.type) {\n            case \"text\":\n            case \"error-text\":\n              contentValue = output.value;\n              break;\n            case \"execution-denied\":\n              contentValue = (_b = output.reason) != null ? _b : \"Tool call execution denied.\";\n              break;\n            case \"content\":\n            case \"json\":\n            case \"error-json\":\n              contentValue = JSON.stringify(output.value);\n              break;\n          }\n          messages.push({\n            role: \"tool\",\n            tool_call_id: toolResponse.toolCallId,\n            content: promptCacheBreakpoint == null ? contentValue : [\n              {\n                type: \"text\",\n                text: contentValue,\n                prompt_cache_breakpoint: promptCacheBreakpoint\n              }\n            ]\n          });\n        }\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return { messages, warnings };\n}\n\n// src/chat/get-response-metadata.ts\nfunction getResponseMetadata({\n  id,\n  model,\n  created\n}) {\n  return {\n    id: id != null ? id : void 0,\n    modelId: model != null ? model : void 0,\n    timestamp: created ? new Date(created * 1e3) : void 0\n  };\n}\n\n// src/chat/map-openai-finish-reason.ts\nfunction mapOpenAIFinishReason(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    case \"function_call\":\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/chat/openai-chat-api.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar openaiChatResponseSchema = lazySchema2(\n  () => zodSchema2(\n    z2.object({\n      id: z2.string().nullish(),\n      created: z2.number().nullish(),\n      model: z2.string().nullish(),\n      choices: z2.array(\n        z2.object({\n          message: z2.object({\n            role: z2.literal(\"assistant\").nullish(),\n            content: z2.string().nullish(),\n            audio: z2.object({\n              transcript: z2.string().nullish()\n            }).nullish(),\n            tool_calls: z2.array(\n              z2.object({\n                id: z2.string().nullish(),\n                type: z2.literal(\"function\"),\n                function: z2.object({\n                  name: z2.string(),\n                  arguments: z2.string()\n                })\n              })\n            ).nullish(),\n            annotations: z2.array(\n              z2.object({\n                type: z2.literal(\"url_citation\"),\n                url_citation: z2.object({\n                  start_index: z2.number(),\n                  end_index: z2.number(),\n                  url: z2.string(),\n                  title: z2.string()\n                })\n              })\n            ).nullish()\n          }),\n          index: z2.number(),\n          logprobs: z2.object({\n            content: z2.array(\n              z2.object({\n                token: z2.string(),\n                logprob: z2.number(),\n                top_logprobs: z2.array(\n                  z2.object({\n                    token: z2.string(),\n                    logprob: z2.number()\n                  })\n                )\n              })\n            ).nullish()\n          }).nullish(),\n          finish_reason: z2.string().nullish()\n        })\n      ),\n      usage: z2.object({\n        prompt_tokens: z2.number().nullish(),\n        completion_tokens: z2.number().nullish(),\n        total_tokens: z2.number().nullish(),\n        prompt_tokens_details: z2.object({\n          cached_tokens: z2.number().nullish(),\n          cache_write_tokens: z2.number().nullish()\n        }).nullish(),\n        completion_tokens_details: z2.object({\n          reasoning_tokens: z2.number().nullish(),\n          accepted_prediction_tokens: z2.number().nullish(),\n          rejected_prediction_tokens: z2.number().nullish()\n        }).nullish()\n      }).nullish()\n    })\n  )\n);\nvar openaiChatChunkSchema = lazySchema2(\n  () => zodSchema2(\n    z2.union([\n      z2.object({\n        id: z2.string().nullish(),\n        created: z2.number().nullish(),\n        model: z2.string().nullish(),\n        choices: z2.array(\n          z2.object({\n            delta: z2.object({\n              role: z2.enum([\"assistant\"]).nullish(),\n              content: z2.string().nullish(),\n              tool_calls: z2.array(\n                z2.object({\n                  index: z2.number(),\n                  id: z2.string().nullish(),\n                  type: z2.literal(\"function\").nullish(),\n                  function: z2.object({\n                    name: z2.string().nullish(),\n                    arguments: z2.string().nullish()\n                  })\n                })\n              ).nullish(),\n              annotations: z2.array(\n                z2.object({\n                  type: z2.literal(\"url_citation\"),\n                  url_citation: z2.object({\n                    start_index: z2.number(),\n                    end_index: z2.number(),\n                    url: z2.string(),\n                    title: z2.string()\n                  })\n                })\n              ).nullish()\n            }).nullish(),\n            logprobs: z2.object({\n              content: z2.array(\n                z2.object({\n                  token: z2.string(),\n                  logprob: z2.number(),\n                  top_logprobs: z2.array(\n                    z2.object({\n                      token: z2.string(),\n                      logprob: z2.number()\n                    })\n                  )\n                })\n              ).nullish()\n            }).nullish(),\n            finish_reason: z2.string().nullish(),\n            index: z2.number()\n          })\n        ),\n        usage: z2.object({\n          prompt_tokens: z2.number().nullish(),\n          completion_tokens: z2.number().nullish(),\n          total_tokens: z2.number().nullish(),\n          prompt_tokens_details: z2.object({\n            cached_tokens: z2.number().nullish(),\n            cache_write_tokens: z2.number().nullish()\n          }).nullish(),\n          completion_tokens_details: z2.object({\n            reasoning_tokens: z2.number().nullish(),\n            accepted_prediction_tokens: z2.number().nullish(),\n            rejected_prediction_tokens: z2.number().nullish()\n          }).nullish()\n        }).nullish()\n      }),\n      openaiErrorDataSchema()\n    ])\n  )\n);\n\n// src/chat/openai-chat-options.ts\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\nvar openaiLanguageModelChatOptions = lazySchema3(\n  () => zodSchema3(\n    z3.object({\n      /**\n       * Modify the likelihood of specified tokens appearing in the completion.\n       *\n       * Accepts a JSON object that maps tokens (specified by their token ID in\n       * the GPT tokenizer) to an associated bias value from -100 to 100.\n       */\n      logitBias: z3.record(z3.coerce.number(), z3.number()).optional(),\n      /**\n       * Return the log probabilities of the tokens.\n       *\n       * Setting to true will return the log probabilities of the tokens that\n       * were generated.\n       *\n       * Setting to a number will return the log probabilities of the top n\n       * tokens that were generated.\n       */\n      logprobs: z3.union([z3.boolean(), z3.number()]).optional(),\n      /**\n       * Whether to enable parallel function calling during tool use. Default to true.\n       */\n      parallelToolCalls: z3.boolean().optional(),\n      /**\n       * A unique identifier representing your end-user, which can help OpenAI to\n       * monitor and detect abuse.\n       */\n      user: z3.string().optional(),\n      /**\n       * Reasoning effort for reasoning models. Defaults to `medium`.\n       * GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.\n       */\n      reasoningEffort: z3.enum([\"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n      /**\n       * Maximum number of completion tokens to generate. Useful for reasoning models.\n       */\n      maxCompletionTokens: z3.number().optional(),\n      /**\n       * Whether to enable persistence in responses API.\n       */\n      store: z3.boolean().optional(),\n      /**\n       * Metadata to associate with the request.\n       */\n      metadata: z3.record(z3.string().max(64), z3.string().max(512)).optional(),\n      /**\n       * Parameters for prediction mode.\n       */\n      prediction: z3.record(z3.string(), z3.any()).optional(),\n      /**\n       * Service tier for the request.\n       * - 'auto': Default service tier. The request will be processed with the service tier configured in the\n       *           Project settings. Unless otherwise configured, the Project will use 'default'.\n       * - 'flex': 50% cheaper processing at the cost of increased latency. Only available for o3 and o4-mini models.\n       * - 'priority': Higher-speed processing with predictably low latency at premium cost. Available for Enterprise customers.\n       * - 'fast': OpenAI's newer name for the 'priority' tier. Interchangeable with it.\n       * - 'ultrafast': Access-controlled Ultrafast processing. Only available for gpt-5.6-sol.\n       * - 'default': The request will be processed with the standard pricing and performance for the selected model.\n       *\n       * @default 'auto'\n       */\n      serviceTier: z3.enum([\"auto\", \"flex\", \"priority\", \"fast\", \"ultrafast\", \"default\"]).optional(),\n      /**\n       * Whether to use strict JSON schema validation.\n       *\n       * @default true\n       */\n      strictJsonSchema: z3.boolean().optional(),\n      /**\n       * Controls the verbosity of the model's responses.\n       * Lower values will result in more concise responses, while higher values will result in more verbose responses.\n       */\n      textVerbosity: z3.enum([\"low\", \"medium\", \"high\"]).optional(),\n      /**\n       * A cache key for prompt caching. Allows manual control over prompt caching behavior.\n       * Useful for improving cache hit rates and working around automatic caching issues.\n       */\n      promptCacheKey: z3.string().optional(),\n      /**\n       * Prompt cache behavior for GPT-5.6 and later models.\n       * `mode` controls whether OpenAI also places an implicit breakpoint.\n       * `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.\n       */\n      promptCacheOptions: z3.object({\n        mode: z3.enum([\"implicit\", \"explicit\"]).optional(),\n        ttl: z3.literal(\"30m\").optional()\n      }).optional(),\n      /**\n       * The retention policy for the prompt cache.\n       * - 'in_memory': Default. Standard prompt caching behavior.\n       * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.\n       *          Available for models before GPT-5.6 that support extended caching.\n       *\n       * @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.\n       *\n       * @default 'in_memory'\n       */\n      promptCacheRetention: z3.enum([\"in_memory\", \"24h\"]).optional(),\n      /**\n       * A stable identifier used to help detect users of your application\n       * that may be violating OpenAI's usage policies. The IDs should be a\n       * string that uniquely identifies each user. We recommend hashing their\n       * username or email address, in order to avoid sending us any identifying\n       * information.\n       */\n      safetyIdentifier: z3.string().optional(),\n      /**\n       * Override the system message mode for this model.\n       * - 'system': Use the 'system' role for system messages (default for most models)\n       * - 'developer': Use the 'developer' role for system messages (used by reasoning models)\n       * - 'remove': Remove system messages entirely\n       *\n       * If not specified, the mode is automatically determined based on the model.\n       */\n      systemMessageMode: z3.enum([\"system\", \"developer\", \"remove\"]).optional(),\n      /**\n       * Force treating this model as a reasoning model.\n       *\n       * This is useful for \"stealth\" reasoning models (e.g. via a custom baseURL)\n       * where the model ID is not recognized by the SDK's allowlist.\n       *\n       * When enabled, the SDK applies reasoning-model parameter compatibility rules\n       * and defaults `systemMessageMode` to `developer` unless overridden.\n       */\n      forceReasoning: z3.boolean().optional()\n    })\n  )\n);\n\n// src/chat/openai-chat-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nfunction prepareChatTools({\n  tools,\n  toolChoice\n}) {\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  if (tools == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings };\n  }\n  const openaiTools2 = [];\n  for (const tool of tools) {\n    switch (tool.type) {\n      case \"function\":\n        openaiTools2.push({\n          type: \"function\",\n          function: {\n            name: tool.name,\n            description: tool.description,\n            parameters: tool.inputSchema,\n            ...tool.strict != null ? { strict: tool.strict } : {}\n          }\n        });\n        break;\n      default:\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `tool type: ${tool.type}`\n        });\n        break;\n    }\n  }\n  if (toolChoice == null) {\n    return { tools: openaiTools2, toolChoice: void 0, toolWarnings };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n    case \"none\":\n    case \"required\":\n      return { tools: openaiTools2, toolChoice: type, toolWarnings };\n    case \"tool\":\n      return {\n        tools: openaiTools2,\n        toolChoice: {\n          type: \"function\",\n          function: {\n            name: toolChoice.toolName\n          }\n        },\n        toolWarnings\n      };\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError2({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\n\n// src/chat/openai-chat-language-model.ts\nvar OpenAIChatLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.supportedUrls = {\n      \"image/*\": [/^https?:\\/\\/.*$/]\n    };\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    tools,\n    toolChoice,\n    providerOptions\n  }) {\n    var _a2, _b, _c, _d, _e;\n    const warnings = [];\n    const openaiOptions = (_a2 = await parseProviderOptions({\n      provider: \"openai\",\n      providerOptions,\n      schema: openaiLanguageModelChatOptions\n    })) != null ? _a2 : {};\n    const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);\n    const isReasoningModel = (_b = openaiOptions.forceReasoning) != null ? _b : modelCapabilities.isReasoningModel;\n    let resolvedReasoningEffort = openaiOptions.reasoningEffort;\n    if (resolvedReasoningEffort != null && modelCapabilities.supportedReasoningEfforts != null && !modelCapabilities.supportedReasoningEfforts.includes(\n      resolvedReasoningEffort\n    )) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"reasoningEffort\",\n        details: `${this.modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(\", \")}`\n      });\n      resolvedReasoningEffort = void 0;\n    }\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    const { messages, warnings: messageWarnings } = convertToOpenAIChatMessages(\n      {\n        prompt,\n        systemMessageMode: (_c = openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? \"developer\" : modelCapabilities.systemMessageMode\n      }\n    );\n    warnings.push(...messageWarnings);\n    const strictJsonSchema = (_d = openaiOptions.strictJsonSchema) != null ? _d : true;\n    const baseArgs = {\n      // model id:\n      model: this.modelId,\n      // model specific settings:\n      logit_bias: openaiOptions.logitBias,\n      logprobs: openaiOptions.logprobs === true || typeof openaiOptions.logprobs === \"number\" ? true : void 0,\n      top_logprobs: typeof openaiOptions.logprobs === \"number\" ? openaiOptions.logprobs : typeof openaiOptions.logprobs === \"boolean\" ? openaiOptions.logprobs ? 0 : void 0 : void 0,\n      user: openaiOptions.user,\n      parallel_tool_calls: openaiOptions.parallelToolCalls,\n      // standardized settings:\n      max_tokens: maxOutputTokens,\n      temperature,\n      top_p: topP,\n      frequency_penalty: frequencyPenalty,\n      presence_penalty: presencePenalty,\n      response_format: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" ? responseFormat.schema != null ? {\n        type: \"json_schema\",\n        json_schema: {\n          schema: normalizeOpenAIJsonSchema(responseFormat.schema),\n          strict: strictJsonSchema,\n          name: (_e = responseFormat.name) != null ? _e : \"response\",\n          description: responseFormat.description\n        }\n      } : { type: \"json_object\" } : void 0,\n      stop: stopSequences,\n      seed,\n      verbosity: openaiOptions.textVerbosity,\n      // openai specific settings:\n      // TODO AI SDK 6: remove, we auto-map maxOutputTokens now\n      max_completion_tokens: openaiOptions.maxCompletionTokens,\n      store: openaiOptions.store,\n      metadata: openaiOptions.metadata,\n      prediction: openaiOptions.prediction,\n      reasoning_effort: resolvedReasoningEffort,\n      service_tier: openaiOptions.serviceTier,\n      prompt_cache_key: openaiOptions.promptCacheKey,\n      prompt_cache_options: openaiOptions.promptCacheOptions,\n      prompt_cache_retention: openaiOptions.promptCacheRetention,\n      safety_identifier: openaiOptions.safetyIdentifier,\n      // messages:\n      messages\n    };\n    if (modelCapabilities.supportedReasoningEfforts != null && baseArgs.prompt_cache_retention != null) {\n      baseArgs.prompt_cache_retention = void 0;\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"promptCacheRetention\",\n        details: \"promptCacheRetention is not supported by GPT-6 and later models; use promptCacheOptions instead\"\n      });\n    }\n    if (isReasoningModel) {\n      if (openaiOptions.reasoningEffort !== \"none\" || !modelCapabilities.supportsNonReasoningParameters) {\n        if (baseArgs.temperature != null) {\n          baseArgs.temperature = void 0;\n          warnings.push({\n            type: \"unsupported\",\n            feature: \"temperature\",\n            details: \"temperature is not supported for reasoning models\"\n          });\n        }\n        if (baseArgs.top_p != null) {\n          baseArgs.top_p = void 0;\n          warnings.push({\n            type: \"unsupported\",\n            feature: \"topP\",\n            details: \"topP is not supported for reasoning models\"\n          });\n        }\n        if (baseArgs.logprobs != null) {\n          baseArgs.logprobs = void 0;\n          warnings.push({\n            type: \"other\",\n            message: \"logprobs is not supported for reasoning models\"\n          });\n        }\n      }\n      if (baseArgs.frequency_penalty != null) {\n        baseArgs.frequency_penalty = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"frequencyPenalty\",\n          details: \"frequencyPenalty is not supported for reasoning models\"\n        });\n      }\n      if (baseArgs.presence_penalty != null) {\n        baseArgs.presence_penalty = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"presencePenalty\",\n          details: \"presencePenalty is not supported for reasoning models\"\n        });\n      }\n      if (baseArgs.logit_bias != null) {\n        baseArgs.logit_bias = void 0;\n        warnings.push({\n          type: \"other\",\n          message: \"logitBias is not supported for reasoning models\"\n        });\n      }\n      if (baseArgs.top_logprobs != null) {\n        baseArgs.top_logprobs = void 0;\n        warnings.push({\n          type: \"other\",\n          message: \"topLogprobs is not supported for reasoning models\"\n        });\n      }\n      if (baseArgs.max_tokens != null) {\n        if (baseArgs.max_completion_tokens == null) {\n          baseArgs.max_completion_tokens = baseArgs.max_tokens;\n        }\n        baseArgs.max_tokens = void 0;\n      }\n    } else if (this.modelId.startsWith(\"gpt-4o-search-preview\") || this.modelId.startsWith(\"gpt-4o-mini-search-preview\")) {\n      if (baseArgs.temperature != null) {\n        baseArgs.temperature = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"temperature\",\n          details: \"temperature is not supported for the search preview models and has been removed.\"\n        });\n      }\n    }\n    if (openaiOptions.serviceTier === \"flex\" && !modelCapabilities.supportsFlexProcessing) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"serviceTier\",\n        details: \"flex processing is only available for o3, o4-mini, and gpt-5 models\"\n      });\n      baseArgs.service_tier = void 0;\n    }\n    if ((openaiOptions.serviceTier === \"priority\" || openaiOptions.serviceTier === \"fast\") && !modelCapabilities.supportsPriorityProcessing) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"serviceTier\",\n        details: \"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported\"\n      });\n      baseArgs.service_tier = void 0;\n    }\n    const {\n      tools: openaiTools2,\n      toolChoice: openaiToolChoice,\n      toolWarnings\n    } = prepareChatTools({\n      tools,\n      toolChoice\n    });\n    return {\n      args: {\n        ...baseArgs,\n        tools: openaiTools2,\n        tool_choice: openaiToolChoice\n      },\n      warnings: [...warnings, ...toolWarnings]\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h;\n    const { args: body, warnings } = await this.getArgs(options);\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/chat/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        openaiChatResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const choice = response.choices[0];\n    if (choice == null) {\n      throw new InvalidResponseDataError({\n        data: rawResponse,\n        message: \"Response did not contain any choices.\"\n      });\n    }\n    const content = [];\n    const text = choice.message.content != null && choice.message.content.length > 0 ? choice.message.content : (_a2 = choice.message.audio) == null ? void 0 : _a2.transcript;\n    if (text != null && text.length > 0) {\n      content.push({ type: \"text\", text });\n    }\n    for (const toolCall of (_b = choice.message.tool_calls) != null ? _b : []) {\n      content.push({\n        type: \"tool-call\",\n        toolCallId: (_c = toolCall.id) != null ? _c : generateId(),\n        toolName: toolCall.function.name,\n        input: toolCall.function.arguments\n      });\n    }\n    for (const annotation of (_d = choice.message.annotations) != null ? _d : []) {\n      content.push({\n        type: \"source\",\n        sourceType: \"url\",\n        id: generateId(),\n        url: annotation.url_citation.url,\n        title: annotation.url_citation.title\n      });\n    }\n    const completionTokenDetails = (_e = response.usage) == null ? void 0 : _e.completion_tokens_details;\n    const promptTokenDetails = (_f = response.usage) == null ? void 0 : _f.prompt_tokens_details;\n    const providerMetadata = { openai: {} };\n    if ((completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens) != null) {\n      providerMetadata.openai.acceptedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.accepted_prediction_tokens;\n    }\n    if ((completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens) != null) {\n      providerMetadata.openai.rejectedPredictionTokens = completionTokenDetails == null ? void 0 : completionTokenDetails.rejected_prediction_tokens;\n    }\n    if (((_g = choice.logprobs) == null ? void 0 : _g.content) != null) {\n      providerMetadata.openai.logprobs = choice.logprobs.content;\n    }\n    return {\n      content,\n      finishReason: {\n        unified: mapOpenAIFinishReason(choice.finish_reason),\n        raw: (_h = choice.finish_reason) != null ? _h : void 0\n      },\n      usage: convertOpenAIChatUsage(response.usage),\n      request: { body },\n      response: {\n        ...getResponseMetadata(response),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings,\n      providerMetadata\n    };\n  }\n  async doStream(options) {\n    const { args, warnings } = await this.getArgs(options);\n    const body = {\n      ...args,\n      stream: true,\n      stream_options: {\n        include_usage: true\n      }\n    };\n    const url = this.config.url({\n      path: \"/chat/completions\",\n      modelId: this.modelId\n    });\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url,\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        openaiChatChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const checkedResponse = await throwIfOpenAIStreamErrorBeforeOutput({\n      stream: response,\n      getError: (chunk) => \"error\" in chunk ? chunk.error : void 0,\n      isOutputChunk: isOpenAIChatOutputChunk,\n      url,\n      requestBodyValues: body,\n      responseHeaders\n    });\n    let toolCallTracker;\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage = void 0;\n    let metadataExtracted = false;\n    let isActiveText = false;\n    const providerMetadata = { openai: {} };\n    const result = {\n      stream: checkedResponse.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            toolCallTracker = new StreamingToolCallTracker(controller, {\n              generateId,\n              typeValidation: \"if-present\"\n            });\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a2, _b, _c, _d, _e;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (\"error\" in value) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            if (!metadataExtracted) {\n              const metadata = getResponseMetadata(value);\n              if (Object.values(metadata).some(Boolean)) {\n                metadataExtracted = true;\n                controller.enqueue({\n                  type: \"response-metadata\",\n                  ...getResponseMetadata(value)\n                });\n              }\n            }\n            if (value.usage != null) {\n              usage = value.usage;\n              if (((_a2 = value.usage.completion_tokens_details) == null ? void 0 : _a2.accepted_prediction_tokens) != null) {\n                providerMetadata.openai.acceptedPredictionTokens = (_b = value.usage.completion_tokens_details) == null ? void 0 : _b.accepted_prediction_tokens;\n              }\n              if (((_c = value.usage.completion_tokens_details) == null ? void 0 : _c.rejected_prediction_tokens) != null) {\n                providerMetadata.openai.rejectedPredictionTokens = (_d = value.usage.completion_tokens_details) == null ? void 0 : _d.rejected_prediction_tokens;\n              }\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = {\n                unified: mapOpenAIFinishReason(choice.finish_reason),\n                raw: choice.finish_reason\n              };\n            }\n            if (((_e = choice == null ? void 0 : choice.logprobs) == null ? void 0 : _e.content) != null) {\n              providerMetadata.openai.logprobs = choice.logprobs.content;\n            }\n            if ((choice == null ? void 0 : choice.delta) == null) {\n              return;\n            }\n            const delta = choice.delta;\n            if (delta.content != null) {\n              if (!isActiveText) {\n                controller.enqueue({ type: \"text-start\", id: \"0\" });\n                isActiveText = true;\n              }\n              controller.enqueue({\n                type: \"text-delta\",\n                id: \"0\",\n                delta: delta.content\n              });\n            }\n            if (delta.tool_calls != null) {\n              for (const toolCallDelta of delta.tool_calls) {\n                toolCallTracker.processDelta(toolCallDelta);\n              }\n            }\n            if (delta.annotations != null) {\n              for (const annotation of delta.annotations) {\n                controller.enqueue({\n                  type: \"source\",\n                  sourceType: \"url\",\n                  id: generateId(),\n                  url: annotation.url_citation.url,\n                  title: annotation.url_citation.title\n                });\n              }\n            }\n          },\n          flush(controller) {\n            if (isActiveText) {\n              controller.enqueue({ type: \"text-end\", id: \"0\" });\n            }\n            toolCallTracker.flush();\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertOpenAIChatUsage(usage),\n              ...providerMetadata != null ? { providerMetadata } : {}\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n    return result;\n  }\n};\nfunction isOpenAIChatOutputChunk(chunk) {\n  if (\"error\" in chunk) {\n    return false;\n  }\n  return chunk.choices.some((choice) => {\n    const delta = choice.delta;\n    return (delta == null ? void 0 : delta.content) != null && delta.content.length > 0 || (delta == null ? void 0 : delta.tool_calls) != null && delta.tool_calls.length > 0 || (delta == null ? void 0 : delta.annotations) != null && delta.annotations.length > 0;\n  });\n}\n\n// src/completion/openai-completion-language-model.ts\nimport {\n  combineHeaders as combineHeaders2,\n  createEventSourceResponseHandler as createEventSourceResponseHandler2,\n  createJsonResponseHandler as createJsonResponseHandler2,\n  parseProviderOptions as parseProviderOptions2,\n  postJsonToApi as postJsonToApi2\n} from \"@ai-sdk/provider-utils\";\n\n// src/completion/convert-openai-completion-usage.ts\nfunction convertOpenAICompletionUsage(usage) {\n  var _a2, _b, _c, _d;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = (_a2 = usage.prompt_tokens) != null ? _a2 : 0;\n  const completionTokens = (_b = usage.completion_tokens) != null ? _b : 0;\n  return {\n    inputTokens: {\n      total: (_c = usage.prompt_tokens) != null ? _c : void 0,\n      noCache: promptTokens,\n      cacheRead: void 0,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: (_d = usage.completion_tokens) != null ? _d : void 0,\n      text: completionTokens,\n      reasoning: void 0\n    },\n    raw: usage\n  };\n}\n\n// src/completion/convert-to-openai-completion-prompt.ts\nimport {\n  InvalidPromptError,\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError3\n} from \"@ai-sdk/provider\";\nfunction convertToOpenAICompletionPrompt({\n  prompt,\n  user = \"user\",\n  assistant = \"assistant\"\n}) {\n  let text = \"\";\n  if (prompt[0].role === \"system\") {\n    text += `${prompt[0].content}\n\n`;\n    prompt = prompt.slice(1);\n  }\n  for (const { role, content } of prompt) {\n    switch (role) {\n      case \"system\": {\n        throw new InvalidPromptError({\n          message: \"Unexpected system message in prompt: ${content}\",\n          prompt\n        });\n      }\n      case \"user\": {\n        const userMessage = content.map((part) => {\n          switch (part.type) {\n            case \"text\": {\n              return part.text;\n            }\n          }\n        }).filter(Boolean).join(\"\");\n        text += `${user}:\n${userMessage}\n\n`;\n        break;\n      }\n      case \"assistant\": {\n        const assistantMessage = content.map((part) => {\n          switch (part.type) {\n            case \"text\": {\n              return part.text;\n            }\n            case \"tool-call\": {\n              throw new UnsupportedFunctionalityError3({\n                functionality: \"tool-call messages\"\n              });\n            }\n          }\n        }).join(\"\");\n        text += `${assistant}:\n${assistantMessage}\n\n`;\n        break;\n      }\n      case \"tool\": {\n        throw new UnsupportedFunctionalityError3({\n          functionality: \"tool messages\"\n        });\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  text += `${assistant}:\n`;\n  return {\n    prompt: text,\n    stopSequences: [`\n${user}:`]\n  };\n}\n\n// src/completion/get-response-metadata.ts\nfunction getResponseMetadata2({\n  id,\n  model,\n  created\n}) {\n  return {\n    id: id != null ? id : void 0,\n    modelId: model != null ? model : void 0,\n    timestamp: created != null ? new Date(created * 1e3) : void 0\n  };\n}\n\n// src/completion/map-openai-finish-reason.ts\nfunction mapOpenAIFinishReason2(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    case \"function_call\":\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/completion/openai-completion-api.ts\nimport { z as z4 } from \"zod/v4\";\nimport {\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4\n} from \"@ai-sdk/provider-utils\";\nvar openaiCompletionResponseSchema = lazySchema4(\n  () => zodSchema4(\n    z4.object({\n      id: z4.string().nullish(),\n      created: z4.number().nullish(),\n      model: z4.string().nullish(),\n      choices: z4.array(\n        z4.object({\n          text: z4.string(),\n          finish_reason: z4.string(),\n          logprobs: z4.object({\n            tokens: z4.array(z4.string()),\n            token_logprobs: z4.array(z4.number()),\n            top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()\n          }).nullish()\n        })\n      ),\n      usage: z4.object({\n        prompt_tokens: z4.number(),\n        completion_tokens: z4.number(),\n        total_tokens: z4.number()\n      }).nullish()\n    })\n  )\n);\nvar openaiCompletionChunkSchema = lazySchema4(\n  () => zodSchema4(\n    z4.union([\n      z4.object({\n        id: z4.string().nullish(),\n        created: z4.number().nullish(),\n        model: z4.string().nullish(),\n        choices: z4.array(\n          z4.object({\n            text: z4.string(),\n            finish_reason: z4.string().nullish(),\n            index: z4.number(),\n            logprobs: z4.object({\n              tokens: z4.array(z4.string()),\n              token_logprobs: z4.array(z4.number()),\n              top_logprobs: z4.array(z4.record(z4.string(), z4.number())).nullish()\n            }).nullish()\n          })\n        ),\n        usage: z4.object({\n          prompt_tokens: z4.number(),\n          completion_tokens: z4.number(),\n          total_tokens: z4.number()\n        }).nullish()\n      }),\n      openaiErrorDataSchema()\n    ])\n  )\n);\n\n// src/completion/openai-completion-options.ts\nimport {\n  lazySchema as lazySchema5,\n  zodSchema as zodSchema5\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\nvar openaiLanguageModelCompletionOptions = lazySchema5(\n  () => zodSchema5(\n    z5.object({\n      /**\n       * Echo back the prompt in addition to the completion.\n       */\n      echo: z5.boolean().optional(),\n      /**\n       * Modify the likelihood of specified tokens appearing in the completion.\n       *\n       * Accepts a JSON object that maps tokens (specified by their token ID in\n       * the GPT tokenizer) to an associated bias value from -100 to 100. You\n       * can use this tokenizer tool to convert text to token IDs. Mathematically,\n       * the bias is added to the logits generated by the model prior to sampling.\n       * The exact effect will vary per model, but values between -1 and 1 should\n       * decrease or increase likelihood of selection; values like -100 or 100\n       * should result in a ban or exclusive selection of the relevant token.\n       *\n       * As an example, you can pass {\"50256\": -100} to prevent the <|endoftext|>\n       * token from being generated.\n       */\n      logitBias: z5.record(z5.string(), z5.number()).optional(),\n      /**\n       * The suffix that comes after a completion of inserted text.\n       */\n      suffix: z5.string().optional(),\n      /**\n       * A unique identifier representing your end-user, which can help OpenAI to\n       * monitor and detect abuse. Learn more.\n       */\n      user: z5.string().optional(),\n      /**\n       * Return the log probabilities of the tokens. Including logprobs will increase\n       * the response size and can slow down response times. However, it can\n       * be useful to better understand how the model is behaving.\n       * Setting to true will return the log probabilities of the tokens that\n       * were generated.\n       * Setting to a number will return the log probabilities of the top n\n       * tokens that were generated.\n       */\n      logprobs: z5.union([z5.boolean(), z5.number()]).optional()\n    })\n  )\n);\n\n// src/completion/openai-completion-language-model.ts\nvar OpenAICompletionLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.supportedUrls = {\n      // No URLs are supported for completion models.\n    };\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get providerOptionsName() {\n    return this.config.provider.split(\".\")[0].trim();\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences: userStopSequences,\n    responseFormat,\n    tools,\n    toolChoice,\n    seed,\n    providerOptions\n  }) {\n    const warnings = [];\n    const openaiOptions = {\n      ...await parseProviderOptions2({\n        provider: \"openai\",\n        providerOptions,\n        schema: openaiLanguageModelCompletionOptions\n      }),\n      ...await parseProviderOptions2({\n        provider: this.providerOptionsName,\n        providerOptions,\n        schema: openaiLanguageModelCompletionOptions\n      })\n    };\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    if (tools == null ? void 0 : tools.length) {\n      warnings.push({ type: \"unsupported\", feature: \"tools\" });\n    }\n    if (toolChoice != null) {\n      warnings.push({ type: \"unsupported\", feature: \"toolChoice\" });\n    }\n    if (responseFormat != null && responseFormat.type !== \"text\") {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"responseFormat\",\n        details: \"JSON response format is not supported.\"\n      });\n    }\n    const { prompt: completionPrompt, stopSequences } = convertToOpenAICompletionPrompt({ prompt });\n    const stop = [...stopSequences != null ? stopSequences : [], ...userStopSequences != null ? userStopSequences : []];\n    return {\n      args: {\n        // model id:\n        model: this.modelId,\n        // model specific settings:\n        echo: openaiOptions.echo,\n        logit_bias: openaiOptions.logitBias,\n        logprobs: (openaiOptions == null ? void 0 : openaiOptions.logprobs) === true ? 0 : (openaiOptions == null ? void 0 : openaiOptions.logprobs) === false ? void 0 : openaiOptions == null ? void 0 : openaiOptions.logprobs,\n        suffix: openaiOptions.suffix,\n        user: openaiOptions.user,\n        // standardized settings:\n        max_tokens: maxOutputTokens,\n        temperature,\n        top_p: topP,\n        frequency_penalty: frequencyPenalty,\n        presence_penalty: presencePenalty,\n        seed,\n        // prompt:\n        prompt: completionPrompt,\n        // stop sequences:\n        stop: stop.length > 0 ? stop : void 0\n      },\n      warnings\n    };\n  }\n  async doGenerate(options) {\n    var _a2;\n    const { args, warnings } = await this.getArgs(options);\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi2({\n      url: this.config.url({\n        path: \"/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders2(this.config.headers(), options.headers),\n      body: args,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler2(\n        openaiCompletionResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const choice = response.choices[0];\n    const providerMetadata = { openai: {} };\n    if (choice.logprobs != null) {\n      providerMetadata.openai.logprobs = choice.logprobs;\n    }\n    return {\n      content: [{ type: \"text\", text: choice.text }],\n      usage: convertOpenAICompletionUsage(response.usage),\n      finishReason: {\n        unified: mapOpenAIFinishReason2(choice.finish_reason),\n        raw: (_a2 = choice.finish_reason) != null ? _a2 : void 0\n      },\n      request: { body: args },\n      response: {\n        ...getResponseMetadata2(response),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      providerMetadata,\n      warnings\n    };\n  }\n  async doStream(options) {\n    const { args, warnings } = await this.getArgs(options);\n    const body = {\n      ...args,\n      stream: true,\n      stream_options: {\n        include_usage: true\n      }\n    };\n    const url = this.config.url({\n      path: \"/completions\",\n      modelId: this.modelId\n    });\n    const { responseHeaders, value: response } = await postJsonToApi2({\n      url,\n      headers: combineHeaders2(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler2(\n        openaiCompletionChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const checkedResponse = await throwIfOpenAIStreamErrorBeforeOutput({\n      stream: response,\n      getError: (chunk) => \"error\" in chunk ? chunk.error : void 0,\n      isOutputChunk: isOpenAICompletionOutputChunk,\n      url,\n      requestBodyValues: body,\n      responseHeaders\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    const providerMetadata = { openai: {} };\n    let usage = void 0;\n    let isFirstChunk = true;\n    const result = {\n      stream: checkedResponse.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (\"error\" in value) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            if (isFirstChunk) {\n              isFirstChunk = false;\n              controller.enqueue({\n                type: \"response-metadata\",\n                ...getResponseMetadata2(value)\n              });\n              controller.enqueue({ type: \"text-start\", id: \"0\" });\n            }\n            if (value.usage != null) {\n              usage = value.usage;\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = {\n                unified: mapOpenAIFinishReason2(choice.finish_reason),\n                raw: choice.finish_reason\n              };\n            }\n            if ((choice == null ? void 0 : choice.logprobs) != null) {\n              providerMetadata.openai.logprobs = choice.logprobs;\n            }\n            if ((choice == null ? void 0 : choice.text) != null && choice.text.length > 0) {\n              controller.enqueue({\n                type: \"text-delta\",\n                id: \"0\",\n                delta: choice.text\n              });\n            }\n          },\n          flush(controller) {\n            if (!isFirstChunk) {\n              controller.enqueue({ type: \"text-end\", id: \"0\" });\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              providerMetadata,\n              usage: convertOpenAICompletionUsage(usage)\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n    return result;\n  }\n};\nfunction isOpenAICompletionOutputChunk(chunk) {\n  return !(\"error\" in chunk) && chunk.choices.some((choice) => choice.text.length > 0);\n}\n\n// src/embedding/openai-embedding-model.ts\nimport {\n  TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders as combineHeaders3,\n  createJsonResponseHandler as createJsonResponseHandler3,\n  EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,\n  parseProviderOptions as parseProviderOptions3,\n  postJsonToApi as postJsonToApi3\n} from \"@ai-sdk/provider-utils\";\n\n// src/embedding/openai-embedding-options.ts\nimport {\n  lazySchema as lazySchema6,\n  zodSchema as zodSchema6\n} from \"@ai-sdk/provider-utils\";\nimport { z as z6 } from \"zod/v4\";\nvar openaiEmbeddingModelOptions = lazySchema6(\n  () => zodSchema6(\n    z6.object({\n      /**\n       * The number of dimensions the resulting output embeddings should have.\n       * Only supported in text-embedding-3 and later models.\n       */\n      dimensions: z6.number().optional(),\n      /**\n       * A unique identifier representing your end-user, which can help OpenAI to\n       * monitor and detect abuse. Learn more.\n       */\n      user: z6.string().optional()\n    })\n  )\n);\n\n// src/embedding/openai-embedding-api.ts\nimport { lazySchema as lazySchema7, zodSchema as zodSchema7 } from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\nvar openaiTextEmbeddingResponseSchema = lazySchema7(\n  () => zodSchema7(\n    z7.object({\n      data: z7.array(z7.object({ embedding: z7.array(z7.number()) })),\n      usage: z7.object({ prompt_tokens: z7.number() }).nullish()\n    })\n  )\n);\n\n// src/embedding/openai-embedding-model.ts\nvar _a;\n_a = EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL;\nvar OpenAIEmbeddingModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.maxEmbeddingsPerCall = 2048;\n    this[_a] = 3e5;\n    this.supportsParallelCalls = true;\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doEmbed({\n    values,\n    headers,\n    abortSignal,\n    providerOptions\n  }) {\n    var _a2;\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values\n      });\n    }\n    const openaiOptions = (_a2 = await parseProviderOptions3({\n      provider: \"openai\",\n      providerOptions,\n      schema: openaiEmbeddingModelOptions\n    })) != null ? _a2 : {};\n    const {\n      responseHeaders,\n      value: response,\n      rawValue\n    } = await postJsonToApi3({\n      url: this.config.url({\n        path: \"/embeddings\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders3(this.config.headers(), headers),\n      body: {\n        model: this.modelId,\n        input: values,\n        encoding_format: \"float\",\n        dimensions: openaiOptions.dimensions,\n        user: openaiOptions.user\n      },\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler3(\n        openaiTextEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      warnings: [],\n      embeddings: response.data.map((item) => item.embedding),\n      usage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,\n      response: { headers: responseHeaders, body: rawValue }\n    };\n  }\n};\n\n// src/image/openai-image-model.ts\nimport {\n  combineHeaders as combineHeaders4,\n  convertBase64ToUint8Array,\n  convertToFormData,\n  createJsonResponseHandler as createJsonResponseHandler4,\n  downloadBlob,\n  parseProviderOptions as parseProviderOptions4,\n  postFormDataToApi,\n  postJsonToApi as postJsonToApi4\n} from \"@ai-sdk/provider-utils\";\n\n// src/image/openai-image-api.ts\nimport { lazySchema as lazySchema8, zodSchema as zodSchema8 } from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\nvar openaiImageResponseSchema = lazySchema8(\n  () => zodSchema8(\n    z8.object({\n      created: z8.number().nullish(),\n      data: z8.array(\n        z8.object({\n          b64_json: z8.string(),\n          revised_prompt: z8.string().nullish()\n        })\n      ),\n      background: z8.string().nullish(),\n      output_format: z8.string().nullish(),\n      size: z8.string().nullish(),\n      quality: z8.string().nullish(),\n      usage: z8.object({\n        input_tokens: z8.number().nullish(),\n        output_tokens: z8.number().nullish(),\n        total_tokens: z8.number().nullish(),\n        input_tokens_details: z8.object({\n          image_tokens: z8.number().nullish(),\n          text_tokens: z8.number().nullish()\n        }).nullish()\n      }).nullish()\n    })\n  )\n);\n\n// src/image/openai-image-model-options.ts\nimport {\n  lazySchema as lazySchema9,\n  zodSchema as zodSchema9\n} from \"@ai-sdk/provider-utils\";\nimport { z as z9 } from \"zod/v4\";\nvar modelMaxImagesPerCall = {\n  \"dall-e-3\": 1,\n  \"dall-e-2\": 10,\n  \"gpt-image-1\": 10,\n  \"gpt-image-1-mini\": 10,\n  \"gpt-image-1.5\": 10,\n  \"gpt-image-2\": 10,\n  \"gpt-image-2.5-flare\": 10,\n  \"gpt-image-2.5-flare-2026-09-08\": 10,\n  \"gpt-image-2.5-sunburst\": 10,\n  \"gpt-image-2.5-sunburst-2026-09-08\": 10,\n  \"chatgpt-image-latest\": 10\n};\nvar defaultResponseFormatPrefixes = [\"chatgpt-image-\", \"gpt-image-\"];\nfunction hasDefaultResponseFormat(modelId) {\n  return defaultResponseFormatPrefixes.some(\n    (prefix) => modelId.startsWith(prefix)\n  );\n}\nfunction getMaxImagesPerCall(modelId) {\n  var _a2;\n  return (_a2 = modelMaxImagesPerCall[modelId]) != null ? _a2 : modelId.startsWith(\"gpt-image-\") ? 10 : 1;\n}\nvar baseImageModelOptionsObject = () => z9.object({\n  /**\n   * Quality of the generated image(s).\n   *\n   * Valid values: `standard`, `hd`, `low`, `medium`, `high`, `xhigh`, `max`, `auto`.\n   * `xhigh` and `max` are supported by GPT Image 2.5 models.\n   */\n  quality: z9.enum([\"standard\", \"hd\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\", \"auto\"]).optional(),\n  /**\n   * Background behavior for the generated image(s).\n   *\n   * If `transparent`, the output format must support transparency\n   * (i.e. `png` or `webp`).\n   */\n  background: z9.enum([\"transparent\", \"opaque\", \"auto\"]).optional(),\n  /**\n   * Format in which the generated image(s) are returned.\n   */\n  outputFormat: z9.enum([\"png\", \"jpeg\", \"webp\"]).optional(),\n  /**\n   * Compression level (0-100) for the generated image(s). Applies to the\n   * `jpeg` and `webp` output formats.\n   */\n  outputCompression: z9.number().int().min(0).max(100).optional(),\n  /**\n   * A unique identifier representing your end-user, which can help OpenAI\n   * to monitor and detect abuse.\n   */\n  user: z9.string().optional()\n});\nvar openaiImageModelOptions = lazySchema9(\n  () => zodSchema9(baseImageModelOptionsObject())\n);\nvar openaiImageModelGenerationOptions = lazySchema9(\n  () => zodSchema9(\n    baseImageModelOptionsObject().extend({\n      /**\n       * Style of the generated image. `vivid` produces hyper-real and\n       * dramatic images; `natural` produces more subdued, less hyper-real\n       * looking images.\n       */\n      style: z9.enum([\"vivid\", \"natural\"]).optional(),\n      /**\n       * Content moderation level for the generated image(s). `low` applies\n       * less restrictive filtering.\n       */\n      moderation: z9.enum([\"auto\", \"low\"]).optional()\n    })\n  )\n);\nvar openaiImageModelEditOptions = lazySchema9(\n  () => zodSchema9(\n    baseImageModelOptionsObject().extend({\n      /**\n       * Fidelity of the output image(s) to the input image(s).\n       */\n      inputFidelity: z9.enum([\"high\", \"low\"]).optional()\n    })\n  )\n);\n\n// src/image/openai-image-model.ts\nvar OpenAIImageModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get maxImagesPerCall() {\n    return getMaxImagesPerCall(this.modelId);\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doGenerate({\n    prompt,\n    files,\n    mask,\n    n,\n    size,\n    aspectRatio,\n    seed,\n    providerOptions,\n    headers,\n    abortSignal\n  }) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;\n    const warnings = [];\n    if (aspectRatio != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"aspectRatio\",\n        details: \"This model does not support aspect ratio. Use `size` instead.\"\n      });\n    }\n    if (seed != null) {\n      warnings.push({ type: \"unsupported\", feature: \"seed\" });\n    }\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    if (files != null) {\n      const openaiOptions2 = (_d = await parseProviderOptions4({\n        provider: \"openai\",\n        providerOptions,\n        schema: openaiImageModelEditOptions\n      })) != null ? _d : {};\n      const { value: response2, responseHeaders: responseHeaders2 } = await postFormDataToApi({\n        url: this.config.url({\n          path: \"/images/edits\",\n          modelId: this.modelId\n        }),\n        headers: combineHeaders4(this.config.headers(), headers),\n        formData: convertToFormData({\n          model: this.modelId,\n          prompt,\n          image: await Promise.all(\n            files.map(\n              (file) => file.type === \"file\" ? new Blob(\n                [\n                  file.data instanceof Uint8Array ? new Blob([file.data], {\n                    type: file.mediaType\n                  }) : new Blob([convertBase64ToUint8Array(file.data)], {\n                    type: file.mediaType\n                  })\n                ],\n                { type: file.mediaType }\n              ) : downloadBlob(file.url)\n            )\n          ),\n          mask: mask != null ? await fileToBlob(mask) : void 0,\n          n,\n          size,\n          quality: openaiOptions2.quality,\n          background: openaiOptions2.background,\n          output_format: openaiOptions2.outputFormat,\n          output_compression: openaiOptions2.outputCompression,\n          input_fidelity: openaiOptions2.inputFidelity,\n          user: openaiOptions2.user\n        }),\n        failedResponseHandler: openaiFailedResponseHandler,\n        successfulResponseHandler: createJsonResponseHandler4(\n          openaiImageResponseSchema\n        ),\n        abortSignal,\n        fetch: this.config.fetch\n      });\n      return {\n        images: response2.data.map((item) => item.b64_json),\n        warnings,\n        usage: response2.usage != null ? {\n          inputTokens: (_e = response2.usage.input_tokens) != null ? _e : void 0,\n          outputTokens: (_f = response2.usage.output_tokens) != null ? _f : void 0,\n          totalTokens: (_g = response2.usage.total_tokens) != null ? _g : void 0\n        } : void 0,\n        response: {\n          timestamp: currentDate,\n          modelId: this.modelId,\n          headers: responseHeaders2\n        },\n        providerMetadata: {\n          openai: {\n            images: response2.data.map((item, index) => {\n              var _a3, _b2, _c2, _d2, _e2, _f2;\n              return {\n                ...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},\n                created: (_a3 = response2.created) != null ? _a3 : void 0,\n                size: (_b2 = response2.size) != null ? _b2 : void 0,\n                quality: (_c2 = response2.quality) != null ? _c2 : void 0,\n                background: (_d2 = response2.background) != null ? _d2 : void 0,\n                outputFormat: (_e2 = response2.output_format) != null ? _e2 : void 0,\n                ...distributeTokenDetails(\n                  (_f2 = response2.usage) == null ? void 0 : _f2.input_tokens_details,\n                  index,\n                  response2.data.length\n                )\n              };\n            })\n          }\n        }\n      };\n    }\n    const openaiOptions = (_h = await parseProviderOptions4({\n      provider: \"openai\",\n      providerOptions,\n      schema: openaiImageModelGenerationOptions\n    })) != null ? _h : {};\n    const { value: response, responseHeaders } = await postJsonToApi4({\n      url: this.config.url({\n        path: \"/images/generations\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders4(this.config.headers(), headers),\n      body: {\n        model: this.modelId,\n        prompt,\n        n,\n        size,\n        quality: openaiOptions.quality,\n        style: openaiOptions.style,\n        background: openaiOptions.background,\n        moderation: openaiOptions.moderation,\n        output_format: openaiOptions.outputFormat,\n        output_compression: openaiOptions.outputCompression,\n        user: openaiOptions.user,\n        ...!hasDefaultResponseFormat(this.modelId) ? { response_format: \"b64_json\" } : {}\n      },\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler4(\n        openaiImageResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      images: response.data.map((item) => item.b64_json),\n      warnings,\n      usage: response.usage != null ? {\n        inputTokens: (_i = response.usage.input_tokens) != null ? _i : void 0,\n        outputTokens: (_j = response.usage.output_tokens) != null ? _j : void 0,\n        totalTokens: (_k = response.usage.total_tokens) != null ? _k : void 0\n      } : void 0,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders\n      },\n      providerMetadata: {\n        openai: {\n          images: response.data.map((item, index) => {\n            var _a3, _b2, _c2, _d2, _e2, _f2;\n            return {\n              ...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {},\n              created: (_a3 = response.created) != null ? _a3 : void 0,\n              size: (_b2 = response.size) != null ? _b2 : void 0,\n              quality: (_c2 = response.quality) != null ? _c2 : void 0,\n              background: (_d2 = response.background) != null ? _d2 : void 0,\n              outputFormat: (_e2 = response.output_format) != null ? _e2 : void 0,\n              ...distributeTokenDetails(\n                (_f2 = response.usage) == null ? void 0 : _f2.input_tokens_details,\n                index,\n                response.data.length\n              )\n            };\n          })\n        }\n      }\n    };\n  }\n};\nfunction distributeTokenDetails(details, index, total) {\n  if (details == null) {\n    return {};\n  }\n  const result = {};\n  if (details.image_tokens != null) {\n    const base = Math.floor(details.image_tokens / total);\n    const remainder = details.image_tokens - base * (total - 1);\n    result.imageTokens = index === total - 1 ? remainder : base;\n  }\n  if (details.text_tokens != null) {\n    const base = Math.floor(details.text_tokens / total);\n    const remainder = details.text_tokens - base * (total - 1);\n    result.textTokens = index === total - 1 ? remainder : base;\n  }\n  return result;\n}\nasync function fileToBlob(file) {\n  if (!file) return void 0;\n  if (file.type === \"url\") {\n    return downloadBlob(file.url);\n  }\n  const data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array(file.data);\n  return new Blob([data], { type: file.mediaType });\n}\n\n// src/tool/apply-patch.ts\nimport {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema as lazySchema10,\n  zodSchema as zodSchema10\n} from \"@ai-sdk/provider-utils\";\nimport { z as z10 } from \"zod/v4\";\nvar applyPatchInputSchema = lazySchema10(\n  () => zodSchema10(\n    z10.object({\n      callId: z10.string(),\n      operation: z10.discriminatedUnion(\"type\", [\n        z10.object({\n          type: z10.literal(\"create_file\"),\n          path: z10.string(),\n          diff: z10.string()\n        }),\n        z10.object({\n          type: z10.literal(\"delete_file\"),\n          path: z10.string()\n        }),\n        z10.object({\n          type: z10.literal(\"update_file\"),\n          path: z10.string(),\n          diff: z10.string()\n        })\n      ])\n    })\n  )\n);\nvar applyPatchOutputSchema = lazySchema10(\n  () => zodSchema10(\n    z10.object({\n      status: z10.enum([\"completed\", \"failed\"]),\n      output: z10.string().optional()\n    })\n  )\n);\nvar applyPatchArgsSchema = lazySchema10(() => zodSchema10(z10.object({})));\nvar applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({\n  id: \"openai.apply_patch\",\n  inputSchema: applyPatchInputSchema,\n  outputSchema: applyPatchOutputSchema\n});\nvar applyPatch = applyPatchToolFactory;\n\n// src/tool/code-interpreter.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,\n  lazySchema as lazySchema11,\n  zodSchema as zodSchema11\n} from \"@ai-sdk/provider-utils\";\nimport { z as z11 } from \"zod/v4\";\nvar codeInterpreterInputSchema = lazySchema11(\n  () => zodSchema11(\n    z11.object({\n      code: z11.string().nullish(),\n      containerId: z11.string()\n    })\n  )\n);\nvar codeInterpreterOutputSchema = lazySchema11(\n  () => zodSchema11(\n    z11.object({\n      outputs: z11.array(\n        z11.discriminatedUnion(\"type\", [\n          z11.object({ type: z11.literal(\"logs\"), logs: z11.string() }),\n          z11.object({ type: z11.literal(\"image\"), url: z11.string() })\n        ])\n      ).nullish()\n    })\n  )\n);\nvar codeInterpreterArgsSchema = lazySchema11(\n  () => zodSchema11(\n    z11.object({\n      container: z11.union([\n        z11.string(),\n        z11.object({\n          fileIds: z11.array(z11.string()).optional()\n        })\n      ]).optional()\n    })\n  )\n);\nvar codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema2({\n  id: \"openai.code_interpreter\",\n  inputSchema: codeInterpreterInputSchema,\n  outputSchema: codeInterpreterOutputSchema\n});\nvar codeInterpreter = (args = {}) => {\n  return codeInterpreterToolFactory(args);\n};\n\n// src/tool/custom.ts\nimport {\n  createProviderToolFactory,\n  lazySchema as lazySchema12,\n  zodSchema as zodSchema12\n} from \"@ai-sdk/provider-utils\";\nimport { z as z12 } from \"zod/v4\";\nvar customArgsSchema = lazySchema12(\n  () => zodSchema12(\n    z12.object({\n      name: z12.string(),\n      description: z12.string().optional(),\n      async: z12.boolean().optional(),\n      format: z12.union([\n        z12.object({\n          type: z12.literal(\"grammar\"),\n          syntax: z12.enum([\"regex\", \"lark\"]),\n          definition: z12.string()\n        }),\n        z12.object({\n          type: z12.literal(\"text\")\n        })\n      ]).optional()\n    })\n  )\n);\nvar customInputSchema = lazySchema12(() => zodSchema12(z12.string()));\nvar customToolFactory = createProviderToolFactory({\n  id: \"openai.custom\",\n  inputSchema: customInputSchema\n});\nvar customTool = (args) => customToolFactory(args);\n\n// src/tool/file-search.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,\n  lazySchema as lazySchema13,\n  zodSchema as zodSchema13\n} from \"@ai-sdk/provider-utils\";\nimport { z as z13 } from \"zod/v4\";\nvar comparisonFilterSchema = () => z13.object({\n  key: z13.string(),\n  type: z13.enum([\"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\", \"in\", \"nin\"]),\n  value: z13.union([z13.string(), z13.number(), z13.boolean(), z13.array(z13.string())])\n});\nvar cachedCompoundFilterSchema;\nvar compoundFilterSchema = () => cachedCompoundFilterSchema != null ? cachedCompoundFilterSchema : cachedCompoundFilterSchema = z13.object({\n  type: z13.enum([\"and\", \"or\"]),\n  filters: z13.array(\n    z13.union([comparisonFilterSchema(), z13.lazy(() => compoundFilterSchema())])\n  )\n});\nvar fileSearchArgsSchema = lazySchema13(\n  () => zodSchema13(\n    z13.object({\n      vectorStoreIds: z13.array(z13.string()),\n      maxNumResults: z13.number().optional(),\n      ranking: z13.object({\n        ranker: z13.string().optional(),\n        scoreThreshold: z13.number().optional()\n      }).optional(),\n      filters: z13.union([comparisonFilterSchema(), compoundFilterSchema()]).optional()\n    })\n  )\n);\nvar fileSearchOutputSchema = lazySchema13(\n  () => zodSchema13(\n    z13.object({\n      queries: z13.array(z13.string()),\n      results: z13.array(\n        z13.object({\n          attributes: z13.record(z13.string(), z13.unknown()),\n          fileId: z13.string(),\n          filename: z13.string(),\n          score: z13.number(),\n          text: z13.string()\n        })\n      ).nullable()\n    })\n  )\n);\nvar fileSearch = createProviderToolFactoryWithOutputSchema3({\n  id: \"openai.file_search\",\n  inputSchema: z13.object({}),\n  outputSchema: fileSearchOutputSchema\n});\n\n// src/tool/image-generation.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,\n  lazySchema as lazySchema14,\n  zodSchema as zodSchema14\n} from \"@ai-sdk/provider-utils\";\nimport { z as z14 } from \"zod/v4\";\nvar imageGenerationArgsSchema = lazySchema14(\n  () => zodSchema14(\n    z14.object({\n      background: z14.enum([\"auto\", \"opaque\", \"transparent\"]).optional(),\n      inputFidelity: z14.enum([\"low\", \"high\"]).optional(),\n      inputImageMask: z14.object({\n        fileId: z14.string().optional(),\n        imageUrl: z14.string().optional()\n      }).optional(),\n      model: z14.string().optional(),\n      moderation: z14.enum([\"auto\"]).optional(),\n      outputCompression: z14.number().int().min(0).max(100).optional(),\n      outputFormat: z14.enum([\"png\", \"jpeg\", \"webp\"]).optional(),\n      partialImages: z14.number().int().min(0).max(3).optional(),\n      quality: z14.enum([\"auto\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n      size: z14.enum([\"1024x1024\", \"1024x1536\", \"1536x1024\", \"auto\"]).optional()\n    }).strict()\n  )\n);\nvar imageGenerationInputSchema = lazySchema14(() => zodSchema14(z14.object({})));\nvar imageGenerationOutputSchema = lazySchema14(\n  () => zodSchema14(z14.object({ result: z14.string() }))\n);\nvar imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema4({\n  id: \"openai.image_generation\",\n  inputSchema: imageGenerationInputSchema,\n  outputSchema: imageGenerationOutputSchema\n});\nvar imageGeneration = (args = {}) => {\n  return imageGenerationToolFactory(args);\n};\n\n// src/tool/local-shell.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,\n  lazySchema as lazySchema15,\n  zodSchema as zodSchema15\n} from \"@ai-sdk/provider-utils\";\nimport { z as z15 } from \"zod/v4\";\nvar localShellInputSchema = lazySchema15(\n  () => zodSchema15(\n    z15.object({\n      action: z15.object({\n        type: z15.literal(\"exec\"),\n        command: z15.array(z15.string()),\n        timeoutMs: z15.number().optional(),\n        user: z15.string().optional(),\n        workingDirectory: z15.string().optional(),\n        env: z15.record(z15.string(), z15.string()).optional()\n      })\n    })\n  )\n);\nvar localShellOutputSchema = lazySchema15(\n  () => zodSchema15(z15.object({ output: z15.string() }))\n);\nvar localShell = createProviderToolFactoryWithOutputSchema5({\n  id: \"openai.local_shell\",\n  inputSchema: localShellInputSchema,\n  outputSchema: localShellOutputSchema\n});\n\n// src/tool/shell.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,\n  lazySchema as lazySchema16,\n  zodSchema as zodSchema16\n} from \"@ai-sdk/provider-utils\";\nimport { z as z16 } from \"zod/v4\";\nvar shellInputSchema = lazySchema16(\n  () => zodSchema16(\n    z16.object({\n      action: z16.object({\n        commands: z16.array(z16.string()),\n        timeoutMs: z16.number().optional(),\n        maxOutputLength: z16.number().optional()\n      })\n    })\n  )\n);\nvar shellOutputSchema = lazySchema16(\n  () => zodSchema16(\n    z16.object({\n      output: z16.array(\n        z16.object({\n          stdout: z16.string(),\n          stderr: z16.string(),\n          outcome: z16.discriminatedUnion(\"type\", [\n            z16.object({ type: z16.literal(\"timeout\") }),\n            z16.object({ type: z16.literal(\"exit\"), exitCode: z16.number() })\n          ])\n        })\n      )\n    })\n  )\n);\nvar shellSkillsSchema = () => z16.array(\n  z16.discriminatedUnion(\"type\", [\n    z16.object({\n      type: z16.literal(\"skillReference\"),\n      skillId: z16.string(),\n      version: z16.string().optional()\n    }),\n    z16.object({\n      type: z16.literal(\"inline\"),\n      name: z16.string(),\n      description: z16.string(),\n      source: z16.object({\n        type: z16.literal(\"base64\"),\n        mediaType: z16.literal(\"application/zip\"),\n        data: z16.string()\n      })\n    })\n  ])\n).optional();\nvar shellArgsSchema = lazySchema16(\n  () => zodSchema16(\n    z16.object({\n      environment: z16.union([\n        z16.object({\n          type: z16.literal(\"containerAuto\"),\n          fileIds: z16.array(z16.string()).optional(),\n          memoryLimit: z16.enum([\"1g\", \"4g\", \"16g\", \"64g\"]).optional(),\n          networkPolicy: z16.discriminatedUnion(\"type\", [\n            z16.object({ type: z16.literal(\"disabled\") }),\n            z16.object({\n              type: z16.literal(\"allowlist\"),\n              allowedDomains: z16.array(z16.string()),\n              domainSecrets: z16.array(\n                z16.object({\n                  domain: z16.string(),\n                  name: z16.string(),\n                  value: z16.string()\n                })\n              ).optional()\n            })\n          ]).optional(),\n          skills: shellSkillsSchema()\n        }),\n        z16.object({\n          type: z16.literal(\"containerReference\"),\n          containerId: z16.string()\n        }),\n        z16.object({\n          type: z16.literal(\"local\").optional(),\n          skills: z16.array(\n            z16.object({\n              name: z16.string(),\n              description: z16.string(),\n              path: z16.string()\n            })\n          ).optional()\n        })\n      ]).optional()\n    })\n  )\n);\nvar shell = createProviderToolFactoryWithOutputSchema6({\n  id: \"openai.shell\",\n  inputSchema: shellInputSchema,\n  outputSchema: shellOutputSchema\n});\n\n// src/tool/tool-search.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,\n  lazySchema as lazySchema17,\n  zodSchema as zodSchema17\n} from \"@ai-sdk/provider-utils\";\nimport { z as z17 } from \"zod/v4\";\nvar toolSearchArgsSchema = lazySchema17(\n  () => zodSchema17(\n    z17.object({\n      execution: z17.enum([\"server\", \"client\"]).optional(),\n      description: z17.string().optional(),\n      parameters: z17.record(z17.string(), z17.unknown()).optional()\n    })\n  )\n);\nvar toolSearchInputSchema = lazySchema17(\n  () => zodSchema17(\n    z17.object({\n      arguments: z17.unknown().optional(),\n      call_id: z17.string().nullish()\n    })\n  )\n);\nvar toolSearchOutputSchema = lazySchema17(\n  () => zodSchema17(\n    z17.object({\n      tools: z17.array(z17.record(z17.string(), z17.unknown()))\n    })\n  )\n);\nvar toolSearchToolFactory = createProviderToolFactoryWithOutputSchema7({\n  id: \"openai.tool_search\",\n  inputSchema: toolSearchInputSchema,\n  outputSchema: toolSearchOutputSchema\n});\nvar toolSearch = (args = {}) => toolSearchToolFactory(args);\n\n// src/tool/web-search.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,\n  lazySchema as lazySchema18,\n  zodSchema as zodSchema18\n} from \"@ai-sdk/provider-utils\";\nimport { z as z18 } from \"zod/v4\";\nvar webSearchArgsSchema = lazySchema18(\n  () => zodSchema18(\n    z18.object({\n      externalWebAccess: z18.boolean().optional(),\n      filters: z18.object({\n        allowedDomains: z18.array(z18.string()).optional(),\n        blockedDomains: z18.array(z18.string()).optional()\n      }).optional(),\n      searchContextSize: z18.enum([\"low\", \"medium\", \"high\"]).optional(),\n      userLocation: z18.object({\n        type: z18.literal(\"approximate\"),\n        country: z18.string().optional(),\n        city: z18.string().optional(),\n        region: z18.string().optional(),\n        timezone: z18.string().optional()\n      }).optional()\n    })\n  )\n);\nvar webSearchInputSchema = lazySchema18(() => zodSchema18(z18.object({})));\nvar webSearchOutputSchema = lazySchema18(\n  () => zodSchema18(\n    z18.object({\n      action: z18.discriminatedUnion(\"type\", [\n        z18.object({\n          type: z18.literal(\"search\"),\n          query: z18.string().optional(),\n          queries: z18.array(z18.string()).optional()\n        }),\n        z18.object({\n          type: z18.literal(\"openPage\"),\n          url: z18.string().nullish()\n        }),\n        z18.object({\n          type: z18.literal(\"findInPage\"),\n          url: z18.string().nullish(),\n          pattern: z18.string().nullish()\n        })\n      ]).optional(),\n      sources: z18.array(\n        z18.discriminatedUnion(\"type\", [\n          z18.object({ type: z18.literal(\"url\"), url: z18.string() }),\n          z18.object({ type: z18.literal(\"api\"), name: z18.string() })\n        ])\n      ).optional()\n    })\n  )\n);\nvar webSearchToolFactory = createProviderToolFactoryWithOutputSchema8({\n  id: \"openai.web_search\",\n  inputSchema: webSearchInputSchema,\n  outputSchema: webSearchOutputSchema\n});\nvar webSearch = (args = {}) => webSearchToolFactory(args);\n\n// src/tool/web-search-preview.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,\n  lazySchema as lazySchema19,\n  zodSchema as zodSchema19\n} from \"@ai-sdk/provider-utils\";\nimport { z as z19 } from \"zod/v4\";\nvar webSearchPreviewArgsSchema = lazySchema19(\n  () => zodSchema19(\n    z19.object({\n      searchContextSize: z19.enum([\"low\", \"medium\", \"high\"]).optional(),\n      userLocation: z19.object({\n        type: z19.literal(\"approximate\"),\n        country: z19.string().optional(),\n        city: z19.string().optional(),\n        region: z19.string().optional(),\n        timezone: z19.string().optional()\n      }).optional()\n    })\n  )\n);\nvar webSearchPreviewInputSchema = lazySchema19(\n  () => zodSchema19(z19.object({}))\n);\nvar webSearchPreviewOutputSchema = lazySchema19(\n  () => zodSchema19(\n    z19.object({\n      action: z19.discriminatedUnion(\"type\", [\n        z19.object({\n          type: z19.literal(\"search\"),\n          query: z19.string().optional()\n        }),\n        z19.object({\n          type: z19.literal(\"openPage\"),\n          url: z19.string().nullish()\n        }),\n        z19.object({\n          type: z19.literal(\"findInPage\"),\n          url: z19.string().nullish(),\n          pattern: z19.string().nullish()\n        })\n      ]).optional()\n    })\n  )\n);\nvar webSearchPreview = createProviderToolFactoryWithOutputSchema9({\n  id: \"openai.web_search_preview\",\n  inputSchema: webSearchPreviewInputSchema,\n  outputSchema: webSearchPreviewOutputSchema\n});\n\n// src/tool/mcp.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,\n  lazySchema as lazySchema20,\n  zodSchema as zodSchema20\n} from \"@ai-sdk/provider-utils\";\nimport { z as z20 } from \"zod/v4\";\nvar cachedJsonValueSchema;\nvar jsonValueSchema = () => cachedJsonValueSchema != null ? cachedJsonValueSchema : cachedJsonValueSchema = z20.lazy(\n  () => z20.union([\n    z20.string(),\n    z20.number(),\n    z20.boolean(),\n    z20.null(),\n    z20.array(jsonValueSchema()),\n    z20.record(z20.string(), jsonValueSchema())\n  ])\n);\nvar mcpArgsSchema = lazySchema20(\n  () => zodSchema20(\n    z20.object({\n      serverLabel: z20.string(),\n      allowedTools: z20.union([\n        z20.array(z20.string()),\n        z20.object({\n          readOnly: z20.boolean().optional(),\n          toolNames: z20.array(z20.string()).optional()\n        })\n      ]).optional(),\n      authorization: z20.string().optional(),\n      connectorId: z20.string().optional(),\n      headers: z20.record(z20.string(), z20.string()).optional(),\n      requireApproval: z20.union([\n        z20.enum([\"always\", \"never\"]),\n        z20.object({\n          never: z20.object({\n            toolNames: z20.array(z20.string()).optional()\n          }).optional()\n        })\n      ]).optional(),\n      serverDescription: z20.string().optional(),\n      serverUrl: z20.string().optional()\n    }).refine(\n      (v) => v.serverUrl != null || v.connectorId != null,\n      \"One of serverUrl or connectorId must be provided.\"\n    )\n  )\n);\nvar mcpInputSchema = lazySchema20(() => zodSchema20(z20.object({})));\nvar mcpOutputSchema = lazySchema20(\n  () => zodSchema20(\n    z20.object({\n      type: z20.literal(\"call\"),\n      serverLabel: z20.string(),\n      name: z20.string(),\n      arguments: z20.string(),\n      output: z20.string().nullish(),\n      error: z20.union([z20.string(), jsonValueSchema()]).optional()\n    })\n  )\n);\nvar mcpToolFactory = createProviderToolFactoryWithOutputSchema10({\n  id: \"openai.mcp\",\n  inputSchema: mcpInputSchema,\n  outputSchema: mcpOutputSchema\n});\nvar mcp = (args) => mcpToolFactory(args);\n\n// src/openai-tools.ts\nvar openaiTools = {\n  /**\n   * The apply_patch tool lets GPT-5.1 create, update, and delete files in your\n   * codebase using structured diffs. Instead of just suggesting edits, the model\n   * emits patch operations that your application applies and then reports back on,\n   * enabling iterative, multi-step code editing workflows.\n   *\n   */\n  applyPatch,\n  /**\n   * Custom tools let callers constrain model output to a grammar (regex or\n   * Lark syntax). The model returns a `custom_tool_call` output item whose\n   * `input` field is a string matching the specified grammar.\n   *\n   * @param name - The name of the custom tool.\n   * @param description - An optional description of the tool.\n   * @param async - Whether the model can continue without waiting for the tool result.\n   * @param format - The output format constraint (grammar type, syntax, and definition).\n   */\n  customTool,\n  /**\n   * The Code Interpreter tool allows models to write and run Python code in a\n   * sandboxed environment to solve complex problems in domains like data analysis,\n   * coding, and math.\n   *\n   * @param container - The container to use for the code interpreter.\n   */\n  codeInterpreter,\n  /**\n   * File search is a tool available in the Responses API. It enables models to\n   * retrieve information in a knowledge base of previously uploaded files through\n   * semantic and keyword search.\n   *\n   * @param vectorStoreIds - The vector store IDs to use for the file search.\n   * @param maxNumResults - The maximum number of results to return.\n   * @param ranking - The ranking options to use for the file search.\n   * @param filters - The filters to use for the file search.\n   */\n  fileSearch,\n  /**\n   * The image generation tool allows you to generate images using a text prompt,\n   * and optionally image inputs. It leverages the GPT Image model,\n   * and automatically optimizes text inputs for improved performance.\n   *\n   * @param background - Background type for the generated image. One of 'auto', 'opaque', or 'transparent'.\n   * @param inputFidelity - Input fidelity for the generated image. One of 'low' or 'high'.\n   * @param inputImageMask - Optional mask for inpainting. Contains fileId and/or imageUrl.\n   * @param model - The image generation model to use. Default: gpt-image-1.\n   * @param moderation - Moderation level for the generated image. Default: 'auto'.\n   * @param outputCompression - Compression level for the output image (0-100).\n   * @param outputFormat - The output format of the generated image. One of 'png', 'jpeg', or 'webp'.\n   * @param partialImages - Number of partial images to generate in streaming mode (0-3).\n   * @param quality - The quality of the generated image. One of 'auto', 'low', 'medium', 'high', 'xhigh', or 'max'. 'xhigh' and 'max' require a GPT Image 2.5 model.\n   * @param size - The size of the generated image. One of 'auto', '1024x1024', '1024x1536', or '1536x1024'.\n   */\n  imageGeneration,\n  /**\n   * Local shell is a tool that allows agents to run shell commands locally\n   * on a machine you or the user provides.\n   *\n   * Supported models: `gpt-5-codex`\n   */\n  localShell,\n  /**\n   * The shell tool allows the model to interact with your local computer through\n   * a controlled command-line interface. The model proposes shell commands; your\n   * integration executes them and returns the outputs.\n   *\n   * Available through the Responses API for use with GPT-5.1.\n   *\n   * WARNING: Running arbitrary shell commands can be dangerous. Always sandbox\n   * execution or add strict allow-/deny-lists before forwarding a command to\n   * the system shell.\n   */\n  shell,\n  /**\n   * Web search allows models to access up-to-date information from the internet\n   * and provide answers with sourced citations.\n   *\n   * @param searchContextSize - The search context size to use for the web search.\n   * @param userLocation - The user location to use for the web search.\n   */\n  webSearchPreview,\n  /**\n   * Web search allows models to access up-to-date information from the internet\n   * and provide answers with sourced citations.\n   *\n   * @param filters - The filters to use for the web search.\n   * @param searchContextSize - The search context size to use for the web search.\n   * @param userLocation - The user location to use for the web search.\n   */\n  webSearch,\n  /**\n   * MCP (Model Context Protocol) allows models to call tools exposed by\n   * remote MCP servers or service connectors.\n   *\n   * @param serverLabel - Label to identify the MCP server.\n   * @param allowedTools - Allowed tool names or filter object.\n   * @param authorization - OAuth access token for the MCP server/connector.\n   * @param connectorId - Identifier for a service connector.\n   * @param headers - Optional headers to include in MCP requests.\n   * // param requireApproval - Approval policy ('always'|'never'|filter object). (Removed - always 'never')\n   * @param serverDescription - Optional description of the server.\n   * @param serverUrl - URL for the MCP server.\n   */\n  mcp,\n  /**\n   * Tool search allows the model to dynamically search for and load deferred\n   * tools into the model's context as needed. This helps reduce overall token\n   * usage, cost, and latency by only loading tools when the model needs them.\n   *\n   * To use tool search, mark functions or namespaces with `defer_loading: true`\n   * in the tools array. The model will use tool search to load these tools\n   * when it determines they are needed.\n   */\n  toolSearch\n};\n\n// src/responses/openai-responses-language-model.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError6,\n  APICallError as APICallError2\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders as combineHeaders5,\n  createEventSourceResponseHandler as createEventSourceResponseHandler3,\n  createJsonResponseHandler as createJsonResponseHandler5,\n  createToolNameMapping,\n  generateId as generateId2,\n  parseProviderOptions as parseProviderOptions6,\n  postJsonToApi as postJsonToApi5\n} from \"@ai-sdk/provider-utils\";\n\n// src/responses/convert-openai-responses-usage.ts\nfunction convertOpenAIResponsesUsage(usage) {\n  var _a2, _b, _c, _d, _e, _f;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const inputTokens = usage.input_tokens;\n  const outputTokens = usage.output_tokens;\n  const cachedTokens = (_b = (_a2 = usage.input_tokens_details) == null ? void 0 : _a2.cached_tokens) != null ? _b : 0;\n  const cacheWriteTokens = (_d = (_c = usage.input_tokens_details) == null ? void 0 : _c.cache_write_tokens) != null ? _d : void 0;\n  const reasoningTokens = (_f = (_e = usage.output_tokens_details) == null ? void 0 : _e.reasoning_tokens) != null ? _f : 0;\n  return {\n    inputTokens: {\n      total: inputTokens,\n      noCache: inputTokens - cachedTokens - (cacheWriteTokens != null ? cacheWriteTokens : 0),\n      cacheRead: cachedTokens,\n      cacheWrite: cacheWriteTokens\n    },\n    outputTokens: {\n      total: outputTokens,\n      text: outputTokens - reasoningTokens,\n      reasoning: reasoningTokens\n    },\n    raw: usage\n  };\n}\n\n// src/responses/convert-to-openai-responses-input.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError4\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema22,\n  zodSchema as zodSchema22,\n  convertToBase64 as convertToBase642,\n  isNonNullable,\n  parseJSON,\n  parseProviderOptions as parseProviderOptions5,\n  safeValidateTypes,\n  validateTypes\n} from \"@ai-sdk/provider-utils\";\nimport { z as z22 } from \"zod/v4\";\n\n// src/responses/openai-responses-options.ts\nimport {\n  lazySchema as lazySchema21,\n  zodSchema as zodSchema21\n} from \"@ai-sdk/provider-utils\";\nimport { z as z21 } from \"zod/v4\";\nvar TOP_LOGPROBS_MAX = 20;\nvar openaiResponsesReasoningModelIds = [\n  \"o1\",\n  \"o1-2024-12-17\",\n  \"o3\",\n  \"o3-2025-04-16\",\n  \"o3-mini\",\n  \"o3-mini-2025-01-31\",\n  \"o4-mini\",\n  \"o4-mini-2025-04-16\",\n  \"gpt-5\",\n  \"gpt-5-2025-08-07\",\n  \"gpt-5-codex\",\n  \"gpt-5-mini\",\n  \"gpt-5-mini-2025-08-07\",\n  \"gpt-5-nano\",\n  \"gpt-5-nano-2025-08-07\",\n  \"gpt-5-pro\",\n  \"gpt-5-pro-2025-10-06\",\n  \"gpt-5.1\",\n  \"gpt-5.1-chat-latest\",\n  \"gpt-5.1-codex-mini\",\n  \"gpt-5.1-codex\",\n  \"gpt-5.1-codex-max\",\n  \"gpt-5.2\",\n  \"gpt-5.2-chat-latest\",\n  \"gpt-5.2-pro\",\n  \"gpt-5.2-codex\",\n  \"gpt-5.3-chat-latest\",\n  \"gpt-5.3-codex\",\n  \"gpt-5.4\",\n  \"gpt-5.4-2026-03-05\",\n  \"gpt-5.4-mini\",\n  \"gpt-5.4-mini-2026-03-17\",\n  \"gpt-5.4-nano\",\n  \"gpt-5.4-nano-2026-03-17\",\n  \"gpt-5.4-pro\",\n  \"gpt-5.4-pro-2026-03-05\",\n  \"gpt-5.5\",\n  \"gpt-5.5-2026-04-23\",\n  \"gpt-5.6\",\n  \"gpt-5.6-luna\",\n  \"gpt-5.6-sol\",\n  \"gpt-5.6-terra\",\n  \"gpt-6-astra\",\n  \"gpt-6.1-sol\",\n  \"gpt-6.1-terra\",\n  \"gpt-6-luna\",\n  \"gpt-6-sol\"\n];\nvar openaiResponsesModelIds = [\n  \"gpt-4.1\",\n  \"gpt-4.1-2025-04-14\",\n  \"gpt-4.1-mini\",\n  \"gpt-4.1-mini-2025-04-14\",\n  \"gpt-4.1-nano\",\n  \"gpt-4.1-nano-2025-04-14\",\n  \"gpt-4o\",\n  \"gpt-4o-2024-05-13\",\n  \"gpt-4o-2024-08-06\",\n  \"gpt-4o-2024-11-20\",\n  \"gpt-4o-audio-preview\",\n  \"gpt-4o-audio-preview-2024-12-17\",\n  \"gpt-4o-search-preview\",\n  \"gpt-4o-search-preview-2025-03-11\",\n  \"gpt-4o-mini-search-preview\",\n  \"gpt-4o-mini-search-preview-2025-03-11\",\n  \"gpt-4o-mini\",\n  \"gpt-4o-mini-2024-07-18\",\n  \"gpt-3.5-turbo-0125\",\n  \"gpt-3.5-turbo\",\n  \"gpt-3.5-turbo-1106\",\n  \"gpt-5-chat-latest\",\n  ...openaiResponsesReasoningModelIds\n];\nvar openaiLanguageModelResponsesOptionsSchema = lazySchema21(\n  () => zodSchema21(\n    z21.object({\n      /**\n       * The ID of the OpenAI Conversation to continue.\n       * You must create a conversation first via the OpenAI API.\n       * Cannot be used in conjunction with `previousResponseId`.\n       * Defaults to `undefined`.\n       * @see https://platform.openai.com/docs/api-reference/conversations/create\n       */\n      conversation: z21.string().nullish(),\n      /**\n       * The set of extra fields to include in the response (advanced, usually not needed).\n       * Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.\n       */\n      include: z21.array(\n        z21.enum([\n          \"reasoning.encrypted_content\",\n          // handled internally by default, only needed for unknown reasoning models\n          \"file_search_call.results\",\n          \"web_search_call.results\",\n          \"message.output_text.logprobs\"\n        ])\n      ).nullish(),\n      /**\n       * Instructions for the model.\n       * They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.\n       * Defaults to `undefined`.\n       */\n      instructions: z21.string().nullish(),\n      /**\n       * Return the log probabilities of the tokens. Including logprobs will increase\n       * the response size and can slow down response times. However, it can\n       * be useful to better understand how the model is behaving.\n       *\n       * Setting to true will return the log probabilities of the tokens that\n       * were generated.\n       *\n       * Setting to a number will return the log probabilities of the top n\n       * tokens that were generated.\n       *\n       * @see https://platform.openai.com/docs/api-reference/responses/create\n       * @see https://cookbook.openai.com/examples/using_logprobs\n       */\n      logprobs: z21.union([z21.boolean(), z21.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),\n      /**\n       * The maximum number of total calls to built-in tools that can be processed in a response.\n       * This maximum number applies across all built-in tool calls, not per individual tool.\n       * Any further attempts to call a tool by the model will be ignored.\n       */\n      maxToolCalls: z21.number().nullish(),\n      /**\n       * Additional metadata to store with the generation.\n       */\n      metadata: z21.any().nullish(),\n      /**\n       * Whether to use parallel tool calls. Defaults to `true`.\n       */\n      parallelToolCalls: z21.boolean().nullish(),\n      /**\n       * The ID of the previous response. You can use it to continue a conversation.\n       * Defaults to `undefined`.\n       */\n      previousResponseId: z21.string().nullish(),\n      /**\n       * Sets a cache key to tie this prompt to cached prefixes for better caching performance.\n       */\n      promptCacheKey: z21.string().nullish(),\n      /**\n       * Prompt cache behavior for GPT-5.6 and later models.\n       * `mode` controls whether OpenAI also places an implicit breakpoint.\n       * `ttl` sets the minimum cache lifetime: `'30m'` (default) or `'12h'`.\n       * `prewarm` writes the prompt to the cache without generating output.\n       */\n      promptCacheOptions: z21.object({\n        mode: z21.enum([\"implicit\", \"explicit\"]).optional(),\n        ttl: z21.enum([\"30m\", \"12h\"]).optional(),\n        prewarm: z21.boolean().optional()\n      }).optional(),\n      /**\n       * The retention policy for the prompt cache.\n       * - 'in_memory': Default. Standard prompt caching behavior.\n       * - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.\n       *          Available for models before GPT-5.6 that support extended caching.\n       *\n       * @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.\n       *\n       * @default 'in_memory'\n       */\n      promptCacheRetention: z21.enum([\"in_memory\", \"24h\"]).nullish(),\n      /**\n       * Reasoning effort for reasoning models. Defaults to `medium`. If you use\n       * `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.\n       * GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.\n       * GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.\n       * Supported values vary by model.\n       */\n      reasoningEffort: z21.string().nullish(),\n      /**\n       * Updates the reasoning effort for GPT-6 and later models starting with this response\n       * without changing the request-level reasoning effort. This preserves the\n       * request prefix for prompt caching.\n       *\n       * Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be\n       * combined with automatic truncation.\n       */\n      reasoningEffortUpdate: z21.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n      /**\n       * Controls how much model work GPT-5.6 performs before returning a final answer.\n       * `standard` is the default. `pro` increases quality, latency, and token usage.\n       */\n      reasoningMode: z21.enum([\"standard\", \"pro\"]).optional(),\n      /**\n       * Controls which available reasoning items GPT-5.6 can use.\n       * `auto` uses the model default, `current_turn` excludes reasoning from earlier\n       * turns, and `all_turns` makes compatible earlier reasoning available.\n       */\n      reasoningContext: z21.enum([\"auto\", \"current_turn\", \"all_turns\"]).optional(),\n      /**\n       * Controls reasoning summary output from the model.\n       * Set to \"auto\" to automatically receive the richest level available,\n       * or \"detailed\" for comprehensive summaries.\n       */\n      reasoningSummary: z21.string().nullish(),\n      /**\n       * The identifier for safety monitoring and tracking.\n       */\n      safetyIdentifier: z21.string().nullish(),\n      /**\n       * Service tier for the request.\n       * Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).\n       * Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).\n       * Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).\n       * Set to 'ultrafast' for access-controlled Ultrafast processing (available only for gpt-5.6-sol).\n       *\n       * Defaults to 'auto'.\n       */\n      serviceTier: z21.enum([\"auto\", \"flex\", \"priority\", \"fast\", \"ultrafast\", \"default\"]).nullish(),\n      /**\n       * Whether to store the generation. Defaults to `true`.\n       */\n      store: z21.boolean().nullish(),\n      /**\n       * Whether to pass through non-image file types as generic input files.\n       *\n       * By default, inline file inputs are restricted to images and PDFs.\n       * Enable this when the target OpenAI Responses model supports additional\n       * file media types, such as text/csv.\n       */\n      passThroughUnsupportedFiles: z21.boolean().optional(),\n      /**\n       * Whether to use strict JSON schema validation.\n       * Defaults to `true`.\n       */\n      strictJsonSchema: z21.boolean().nullish(),\n      /**\n       * Controls the verbosity of the model's responses. Lower values ('low') will result\n       * in more concise responses, while higher values ('high') will result in more verbose responses.\n       * Valid values: 'low', 'medium', 'high'.\n       */\n      textVerbosity: z21.enum([\"low\", \"medium\", \"high\"]).nullish(),\n      /**\n       * Controls output truncation. 'auto' (default) performs truncation automatically;\n       * 'disabled' turns truncation off.\n       */\n      truncation: z21.enum([\"auto\", \"disabled\"]).nullish(),\n      /**\n       * A unique identifier representing your end-user, which can help OpenAI to\n       * monitor and detect abuse.\n       * Defaults to `undefined`.\n       * @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids\n       */\n      user: z21.string().nullish(),\n      /**\n       * Override the system message mode for this model.\n       * - 'system': Use the 'system' role for system messages (default for most models)\n       * - 'developer': Use the 'developer' role for system messages (used by reasoning models)\n       * - 'remove': Remove system messages entirely\n       *\n       * If not specified, the mode is automatically determined based on the model.\n       */\n      systemMessageMode: z21.enum([\"system\", \"developer\", \"remove\"]).optional(),\n      /**\n       * Force treating this model as a reasoning model.\n       *\n       * This is useful for \"stealth\" reasoning models (e.g. via a custom baseURL)\n       * where the model ID is not recognized by the SDK's allowlist.\n       *\n       * When enabled, the SDK applies reasoning-model parameter compatibility rules\n       * and defaults `systemMessageMode` to `developer` unless overridden.\n       */\n      forceReasoning: z21.boolean().optional(),\n      /**\n       * Restrict the callable tools to a subset while keeping the full tools\n       * list intact, so prompt caching is preserved across requests with\n       * different allowlists.\n       *\n       * When set, this overrides the request-level `toolChoice` and emits\n       * `tool_choice: { type: \"allowed_tools\", mode, tools }` on the wire.\n       *\n       * @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)\n       */\n      allowedTools: z21.object({\n        toolNames: z21.array(z21.string()).min(1),\n        mode: z21.enum([\"auto\", \"required\"]).optional()\n      }).optional()\n    })\n  )\n);\nvar openaiResponsesSystemMessageOptionsSchema = lazySchema21(\n  () => zodSchema21(\n    z21.object({\n      /**\n       * Emit a configuration update at this position in Responses history.\n       * Requires empty system message content and the same supported\n       * configuration as the request-level reasoningEffortUpdate option.\n       * Unsupported historical updates throw instead of being omitted.\n       *\n       * @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation\n       */\n      reasoningEffortUpdate: z21.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional()\n    })\n  )\n);\n\n// src/responses/expand-parallel-tool-call.ts\nimport {\n  isJSONObject\n} from \"@ai-sdk/provider\";\nimport { safeParseJSON } from \"@ai-sdk/provider-utils\";\nvar parallelToolName = \"parallel\";\nvar recipientNamePrefix = \"functions.\";\nfunction getParallelToolCallMetadata({\n  providerOptions,\n  providerOptionsName\n}) {\n  var _a2;\n  const metadata = (_a2 = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a2.parallelToolCall;\n  if (!isJSONObject(metadata) || typeof metadata.itemId !== \"string\" || typeof metadata.toolCallId !== \"string\" || typeof metadata.toolName !== \"string\" || typeof metadata.input !== \"string\" || typeof metadata.index !== \"number\" || !Number.isInteger(metadata.index) || typeof metadata.count !== \"number\" || !Number.isInteger(metadata.count) || metadata.index < 0 || metadata.count <= metadata.index) {\n    return void 0;\n  }\n  return metadata;\n}\nfunction isUndeclaredParallelToolCall({\n  toolName,\n  tools\n}) {\n  return toolName === parallelToolName && !tools.some((tool) => tool.name === parallelToolName);\n}\nasync function expandParallelToolCall({\n  toolCall,\n  tools,\n  providerOptionsName,\n  itemId\n}) {\n  if (!isUndeclaredParallelToolCall({ toolName: toolCall.toolName, tools })) {\n    return void 0;\n  }\n  const parsedInput = await safeParseJSON({ text: toolCall.input });\n  if (!parsedInput.success || !isJSONObject(parsedInput.value)) {\n    return void 0;\n  }\n  const toolUses = parsedInput.value.tool_uses;\n  if (!Array.isArray(toolUses) || toolUses.length === 0) {\n    return void 0;\n  }\n  const availableToolNames = new Set(tools.map((tool) => tool.name));\n  const expandedToolCalls = [];\n  for (const [index, toolUse] of toolUses.entries()) {\n    if (!isJSONObject(toolUse)) {\n      return void 0;\n    }\n    const recipientName = toolUse.recipient_name;\n    const parameters = toolUse.parameters;\n    if (typeof recipientName !== \"string\" || !recipientName.startsWith(recipientNamePrefix) || !isJSONObject(parameters)) {\n      return void 0;\n    }\n    const toolName = recipientName.slice(recipientNamePrefix.length);\n    if (toolName.length === 0 || !availableToolNames.has(toolName)) {\n      return void 0;\n    }\n    expandedToolCalls.push({\n      type: \"tool-call\",\n      toolCallId: `${toolCall.toolCallId}_${index}`,\n      toolName,\n      input: JSON.stringify(parameters),\n      providerMetadata: {\n        [providerOptionsName]: {\n          parallelToolCall: {\n            itemId,\n            toolCallId: toolCall.toolCallId,\n            toolName: toolCall.toolName,\n            input: toolCall.input,\n            index,\n            count: toolUses.length\n          }\n        }\n      }\n    });\n  }\n  return expandedToolCalls;\n}\n\n// src/responses/convert-to-openai-responses-input.ts\nfunction serializeToolCallArguments2(input) {\n  return JSON.stringify(input === void 0 ? {} : input);\n}\nasync function convertWebSearchToolResultOutput({\n  output,\n  id\n}) {\n  if (output.type !== \"json\") {\n    return void 0;\n  }\n  const validation = await safeValidateTypes({\n    value: output.value,\n    schema: webSearchOutputSchema\n  });\n  if (!validation.success || validation.value.action == null) {\n    return void 0;\n  }\n  const { action, sources } = validation.value;\n  switch (action.type) {\n    case \"search\":\n      return {\n        type: \"web_search_call\",\n        id,\n        status: \"completed\",\n        action: {\n          type: \"search\",\n          ...action.query != null && { query: action.query },\n          ...action.queries != null && { queries: action.queries },\n          ...sources != null && { sources }\n        }\n      };\n    case \"openPage\":\n      return {\n        type: \"web_search_call\",\n        id,\n        status: \"completed\",\n        action: {\n          type: \"open_page\",\n          url: action.url\n        }\n      };\n    case \"findInPage\":\n      return {\n        type: \"web_search_call\",\n        id,\n        status: \"completed\",\n        action: {\n          type: \"find_in_page\",\n          url: action.url,\n          pattern: action.pattern\n        }\n      };\n  }\n}\nasync function convertFunctionToolResultOutput({\n  output,\n  promptCacheBreakpoint,\n  providerOptionsName,\n  warnings\n}) {\n  var _a2;\n  const convertScalarOutput = (value) => promptCacheBreakpoint == null ? value : [\n    {\n      type: \"input_text\",\n      text: value,\n      prompt_cache_breakpoint: promptCacheBreakpoint\n    }\n  ];\n  switch (output.type) {\n    case \"text\":\n    case \"error-text\":\n      return convertScalarOutput(output.value);\n    case \"execution-denied\": {\n      return convertScalarOutput(\n        (_a2 = output.reason) != null ? _a2 : \"Tool call execution denied.\"\n      );\n    }\n    case \"json\":\n    case \"error-json\":\n      return convertScalarOutput(JSON.stringify(output.value));\n    case \"content\":\n      return output.value.map((item) => {\n        var _a3, _b, _c, _d, _e, _f, _g;\n        const promptCacheBreakpoint2 = getPromptCacheBreakpoint2(\n          item.providerOptions,\n          providerOptionsName\n        );\n        switch (item.type) {\n          case \"text\": {\n            return {\n              type: \"input_text\",\n              text: item.text,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"image-data\": {\n            return {\n              type: \"input_image\",\n              image_url: `data:${item.mediaType};base64,${item.data}`,\n              detail: (_b = (_a3 = item.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b.imageDetail,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"image-url\": {\n            return {\n              type: \"input_image\",\n              image_url: item.url,\n              detail: (_d = (_c = item.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.imageDetail,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"file-id\": {\n            return {\n              type: \"input_file\",\n              file_id: typeof item.fileId === \"string\" ? item.fileId : item.fileId[providerOptionsName],\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"image-file-id\": {\n            return {\n              type: \"input_image\",\n              file_id: typeof item.fileId === \"string\" ? item.fileId : item.fileId[providerOptionsName],\n              detail: (_f = (_e = item.providerOptions) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.imageDetail,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"file-data\": {\n            return {\n              type: \"input_file\",\n              filename: (_g = item.filename) != null ? _g : \"data\",\n              file_data: `data:${item.mediaType};base64,${item.data}`,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          case \"file-url\": {\n            return {\n              type: \"input_file\",\n              file_url: item.url,\n              ...promptCacheBreakpoint2 != null && {\n                prompt_cache_breakpoint: promptCacheBreakpoint2\n              }\n            };\n          }\n          default: {\n            warnings.push({\n              type: \"other\",\n              message: `unsupported tool content part type: ${item.type}`\n            });\n            return void 0;\n          }\n        }\n      }).filter(isNonNullable);\n  }\n}\nfunction hasSameParallelToolCall(first, second) {\n  return first.itemId === second.itemId && first.toolCallId === second.toolCallId && first.toolName === second.toolName && first.input === second.input && first.count === second.count;\n}\nfunction collectCompleteParallelToolResultGroups({\n  prompt,\n  providerOptionsName\n}) {\n  const pendingGroups = /* @__PURE__ */ new Map();\n  for (const message of prompt) {\n    if (message.role !== \"tool\") {\n      continue;\n    }\n    for (const part of message.content) {\n      if (part.type !== \"tool-result\") {\n        continue;\n      }\n      const metadata = getParallelToolCallMetadata({\n        providerOptions: part.providerOptions,\n        providerOptionsName\n      });\n      if (metadata == null) {\n        continue;\n      }\n      const existing = pendingGroups.get(metadata.toolCallId);\n      if (existing == null) {\n        pendingGroups.set(metadata.toolCallId, {\n          metadata,\n          results: /* @__PURE__ */ new Map([[metadata.index, part]]),\n          invalid: false\n        });\n        continue;\n      }\n      if (!hasSameParallelToolCall(existing.metadata, metadata) || existing.results.has(metadata.index)) {\n        existing.invalid = true;\n        continue;\n      }\n      existing.results.set(metadata.index, part);\n    }\n  }\n  const completeGroups = /* @__PURE__ */ new Map();\n  for (const [toolCallId, group] of pendingGroups) {\n    if (group.invalid || group.results.size !== group.metadata.count) {\n      continue;\n    }\n    const results = Array.from(\n      { length: group.metadata.count },\n      (_, index) => group.results.get(index)\n    );\n    if (results.every(isNonNullable)) {\n      completeGroups.set(toolCallId, {\n        metadata: group.metadata,\n        results\n      });\n    }\n  }\n  return completeGroups;\n}\nfunction getPromptCacheBreakpoint2(providerOptions, providerOptionsName) {\n  var _a2;\n  return (_a2 = providerOptions == null ? void 0 : providerOptions[providerOptionsName]) == null ? void 0 : _a2.promptCacheBreakpoint;\n}\nfunction getScalarToolResultPromptCacheBreakpoint({\n  output,\n  toolResultProviderOptions,\n  providerOptionsName\n}) {\n  var _a2;\n  return output.type === \"content\" ? void 0 : (_a2 = getPromptCacheBreakpoint2(output.providerOptions, providerOptionsName)) != null ? _a2 : getPromptCacheBreakpoint2(\n    toolResultProviderOptions,\n    providerOptionsName\n  );\n}\nfunction isFileId(data, prefixes) {\n  if (!prefixes) return false;\n  return prefixes.some((prefix) => data.startsWith(prefix));\n}\nasync function convertToOpenAIResponsesInput({\n  prompt,\n  toolNameMapping,\n  systemMessageMode,\n  providerOptionsName,\n  explicitMessageItemType = false,\n  fileIdPrefixes,\n  passThroughUnsupportedFiles = false,\n  store,\n  isReasoningModel = false,\n  hasConversation = false,\n  hasPreviousResponseId = false,\n  configurationUpdateUnsupportedReason,\n  hasLocalShellTool = false,\n  hasShellTool = false,\n  hasApplyPatchTool = false,\n  toolSearchToolName,\n  customProviderToolNames\n}) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G;\n  let input = [];\n  const warnings = [];\n  const processedApprovalIds = /* @__PURE__ */ new Set();\n  const parallelToolResultGroups = hasConversation || hasPreviousResponseId ? collectCompleteParallelToolResultGroups({\n    prompt,\n    providerOptionsName\n  }) : /* @__PURE__ */ new Map();\n  const emittedParallelToolCalls = /* @__PURE__ */ new Set();\n  const emittedParallelToolResults = /* @__PURE__ */ new Set();\n  for (const { role, content, providerOptions } of prompt) {\n    switch (role) {\n      case \"system\": {\n        let options = await parseProviderOptions5({\n          provider: providerOptionsName,\n          providerOptions,\n          schema: openaiResponsesSystemMessageOptionsSchema\n        });\n        if (options == null && providerOptionsName !== \"openai\") {\n          options = await parseProviderOptions5({\n            provider: \"openai\",\n            providerOptions,\n            schema: openaiResponsesSystemMessageOptionsSchema\n          });\n        }\n        const effort = options == null ? void 0 : options.reasoningEffortUpdate;\n        if (effort != null) {\n          const unsupportedReason = content !== \"\" ? \"Message-level reasoningEffortUpdate requires empty system message content.\" : configurationUpdateUnsupportedReason;\n          if (unsupportedReason != null) {\n            throw new UnsupportedFunctionalityError4({\n              functionality: \"Message-level reasoningEffortUpdate\",\n              message: unsupportedReason\n            });\n          }\n          input.push({\n            type: \"configuration_update\",\n            reasoning: { effort }\n          });\n          break;\n        }\n        switch (systemMessageMode) {\n          case \"system\": {\n            const promptCacheBreakpoint = getPromptCacheBreakpoint2(\n              providerOptions,\n              providerOptionsName\n            );\n            input.push({\n              ...explicitMessageItemType && { type: \"message\" },\n              role: \"system\",\n              content: promptCacheBreakpoint == null ? content : [\n                {\n                  type: \"input_text\",\n                  text: content,\n                  prompt_cache_breakpoint: promptCacheBreakpoint\n                }\n              ]\n            });\n            break;\n          }\n          case \"developer\": {\n            const promptCacheBreakpoint = getPromptCacheBreakpoint2(\n              providerOptions,\n              providerOptionsName\n            );\n            input.push({\n              ...explicitMessageItemType && { type: \"message\" },\n              role: \"developer\",\n              content: promptCacheBreakpoint == null ? content : [\n                {\n                  type: \"input_text\",\n                  text: content,\n                  prompt_cache_breakpoint: promptCacheBreakpoint\n                }\n              ]\n            });\n            break;\n          }\n          case \"remove\": {\n            warnings.push({\n              type: \"other\",\n              message: \"system messages are removed for this model\"\n            });\n            break;\n          }\n          default: {\n            const _exhaustiveCheck = systemMessageMode;\n            throw new Error(\n              `Unsupported system message mode: ${_exhaustiveCheck}`\n            );\n          }\n        }\n        break;\n      }\n      case \"user\": {\n        input.push({\n          ...explicitMessageItemType && { type: \"message\" },\n          role: \"user\",\n          content: content.map((part, index) => {\n            var _a3, _b2, _c2;\n            switch (part.type) {\n              case \"text\": {\n                const promptCacheBreakpoint = getPromptCacheBreakpoint2(\n                  part.providerOptions,\n                  providerOptionsName\n                );\n                return {\n                  type: \"input_text\",\n                  text: part.text,\n                  ...promptCacheBreakpoint != null && {\n                    prompt_cache_breakpoint: promptCacheBreakpoint\n                  }\n                };\n              }\n              case \"file\": {\n                const promptCacheBreakpoint = getPromptCacheBreakpoint2(\n                  part.providerOptions,\n                  providerOptionsName\n                );\n                const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n                if (mediaType.startsWith(\"image/\")) {\n                  return {\n                    type: \"input_image\",\n                    ...part.data instanceof URL ? { image_url: part.data.toString() } : typeof part.data === \"string\" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {\n                      image_url: `data:${mediaType};base64,${convertToBase642(part.data)}`\n                    },\n                    detail: (_b2 = (_a3 = part.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,\n                    ...promptCacheBreakpoint != null && {\n                      prompt_cache_breakpoint: promptCacheBreakpoint\n                    }\n                  };\n                }\n                if (part.data instanceof URL) {\n                  return {\n                    type: \"input_file\",\n                    file_url: part.data.toString(),\n                    ...promptCacheBreakpoint != null && {\n                      prompt_cache_breakpoint: promptCacheBreakpoint\n                    }\n                  };\n                }\n                if (mediaType !== \"application/pdf\" && !passThroughUnsupportedFiles) {\n                  throw new UnsupportedFunctionalityError4({\n                    functionality: `file part media type ${mediaType}`\n                  });\n                }\n                return {\n                  type: \"input_file\",\n                  ...typeof part.data === \"string\" && isFileId(part.data, fileIdPrefixes) ? { file_id: part.data } : {\n                    filename: (_c2 = part.filename) != null ? _c2 : mediaType === \"application/pdf\" ? `part-${index}.pdf` : `part-${index}`,\n                    file_data: `data:${mediaType};base64,${convertToBase642(part.data)}`\n                  },\n                  ...promptCacheBreakpoint != null && {\n                    prompt_cache_breakpoint: promptCacheBreakpoint\n                  }\n                };\n              }\n            }\n          })\n        });\n        break;\n      }\n      case \"assistant\": {\n        const reasoningMessages = {};\n        let hasPrecedingReasoning = false;\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\": {\n              const providerOpts = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName];\n              const id = providerOpts == null ? void 0 : providerOpts.itemId;\n              const phase = providerOpts == null ? void 0 : providerOpts.phase;\n              if (hasConversation && id != null) {\n                break;\n              }\n              const canUseItemId = id != null && (!isReasoningModel || hasPrecedingReasoning);\n              if (store && canUseItemId) {\n                input.push({ type: \"item_reference\", id });\n                break;\n              }\n              input.push({\n                ...explicitMessageItemType && { type: \"message\" },\n                role: \"assistant\",\n                content: [{ type: \"output_text\", text: part.text }],\n                id: canUseItemId ? id : void 0,\n                ...phase != null && { phase }\n              });\n              break;\n            }\n            case \"tool-call\": {\n              const parallelToolCallMetadata = getParallelToolCallMetadata({\n                providerOptions: part.providerOptions,\n                providerOptionsName\n              });\n              const parallelToolResultGroup = parallelToolCallMetadata == null ? void 0 : parallelToolResultGroups.get(\n                parallelToolCallMetadata.toolCallId\n              );\n              if (parallelToolCallMetadata != null && parallelToolResultGroup != null && hasSameParallelToolCall(\n                parallelToolResultGroup.metadata,\n                parallelToolCallMetadata\n              )) {\n                if (!emittedParallelToolCalls.has(\n                  parallelToolResultGroup.metadata.toolCallId\n                )) {\n                  emittedParallelToolCalls.add(\n                    parallelToolResultGroup.metadata.toolCallId\n                  );\n                  if (!hasConversation) {\n                    input.push({\n                      type: \"function_call\",\n                      call_id: parallelToolResultGroup.metadata.toolCallId,\n                      name: parallelToolResultGroup.metadata.toolName,\n                      arguments: parallelToolResultGroup.metadata.input\n                    });\n                  }\n                }\n                break;\n              }\n              const id = (_f = (_c = (_b = part.providerOptions) == null ? void 0 : _b[providerOptionsName]) == null ? void 0 : _c.itemId) != null ? _f : (_e = (_d = part.providerMetadata) == null ? void 0 : _d[providerOptionsName]) == null ? void 0 : _e.itemId;\n              const namespace = (_k = (_h = (_g = part.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.namespace) != null ? _k : (_j = (_i = part.providerMetadata) == null ? void 0 : _i[providerOptionsName]) == null ? void 0 : _j.namespace;\n              const isAsync = (_p = (_m = (_l = part.providerOptions) == null ? void 0 : _l[providerOptionsName]) == null ? void 0 : _m.async) != null ? _p : (_o = (_n = part.providerMetadata) == null ? void 0 : _n[providerOptionsName]) == null ? void 0 : _o.async;\n              if (hasConversation && id != null) {\n                break;\n              }\n              const resolvedToolName = toolNameMapping.toProviderToolName(\n                part.toolName\n              );\n              if (part.toolName === toolSearchToolName) {\n                if (store && id != null) {\n                  input.push({ type: \"item_reference\", id });\n                  break;\n                }\n                const parsedInput = typeof part.input === \"string\" ? await parseJSON({\n                  text: part.input,\n                  schema: toolSearchInputSchema\n                }) : await validateTypes({\n                  value: part.input,\n                  schema: toolSearchInputSchema\n                });\n                const execution = parsedInput.call_id != null ? \"client\" : \"server\";\n                input.push({\n                  type: \"tool_search_call\",\n                  id: id != null ? id : part.toolCallId,\n                  execution,\n                  call_id: (_q = parsedInput.call_id) != null ? _q : null,\n                  status: \"completed\",\n                  arguments: parsedInput.arguments\n                });\n                break;\n              }\n              if (part.providerExecuted) {\n                if (store && id != null) {\n                  input.push({ type: \"item_reference\", id });\n                }\n                if (store || !hasShellTool || resolvedToolName !== \"shell\") {\n                  break;\n                }\n              }\n              const isProviderDefinedToolCall = hasLocalShellTool && resolvedToolName === \"local_shell\" || hasShellTool && resolvedToolName === \"shell\" || hasApplyPatchTool && resolvedToolName === \"apply_patch\" || ((_r = customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) != null ? _r : false);\n              if (hasPreviousResponseId && store && id != null && isProviderDefinedToolCall) {\n                break;\n              }\n              if (store && id != null && isProviderDefinedToolCall) {\n                input.push({ type: \"item_reference\", id });\n                break;\n              }\n              if (hasLocalShellTool && resolvedToolName === \"local_shell\") {\n                const parsedInput = await validateTypes({\n                  value: part.input,\n                  schema: localShellInputSchema\n                });\n                input.push({\n                  type: \"local_shell_call\",\n                  call_id: part.toolCallId,\n                  id,\n                  action: {\n                    type: \"exec\",\n                    command: parsedInput.action.command,\n                    timeout_ms: parsedInput.action.timeoutMs,\n                    user: parsedInput.action.user,\n                    working_directory: parsedInput.action.workingDirectory,\n                    env: parsedInput.action.env\n                  }\n                });\n                break;\n              }\n              if (hasShellTool && resolvedToolName === \"shell\") {\n                const parsedInput = await validateTypes({\n                  value: part.input,\n                  schema: shellInputSchema\n                });\n                input.push({\n                  type: \"shell_call\",\n                  call_id: part.toolCallId,\n                  id,\n                  status: \"completed\",\n                  action: {\n                    commands: parsedInput.action.commands,\n                    timeout_ms: parsedInput.action.timeoutMs,\n                    max_output_length: parsedInput.action.maxOutputLength\n                  }\n                });\n                break;\n              }\n              if (hasApplyPatchTool && resolvedToolName === \"apply_patch\") {\n                const parsedInput = await validateTypes({\n                  value: part.input,\n                  schema: applyPatchInputSchema\n                });\n                input.push({\n                  type: \"apply_patch_call\",\n                  call_id: parsedInput.callId,\n                  id,\n                  status: \"completed\",\n                  operation: parsedInput.operation\n                });\n                break;\n              }\n              if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {\n                input.push({\n                  type: \"custom_tool_call\",\n                  call_id: part.toolCallId,\n                  name: resolvedToolName,\n                  input: typeof part.input === \"string\" ? part.input : JSON.stringify(part.input),\n                  ...isAsync != null && { async: isAsync },\n                  id\n                });\n                break;\n              }\n              input.push({\n                type: \"function_call\",\n                call_id: part.toolCallId,\n                name: resolvedToolName,\n                arguments: serializeToolCallArguments2(part.input),\n                ...isAsync != null && { async: isAsync },\n                ...namespace != null && { namespace }\n              });\n              break;\n            }\n            // assistant tool result parts are from provider-executed tools:\n            case \"tool-result\": {\n              if (part.output.type === \"execution-denied\" || part.output.type === \"json\" && typeof part.output.value === \"object\" && part.output.value != null && \"type\" in part.output.value && part.output.value.type === \"execution-denied\") {\n                break;\n              }\n              if (hasConversation) {\n                break;\n              }\n              const resolvedResultToolName = toolNameMapping.toProviderToolName(\n                part.toolName\n              );\n              if (resolvedResultToolName === \"web_search\" || resolvedResultToolName === \"web_search_preview\") {\n                const itemId = (_u = (_t = (_s = part.providerOptions) == null ? void 0 : _s[providerOptionsName]) == null ? void 0 : _t.itemId) != null ? _u : part.toolCallId;\n                if (store) {\n                  input.push({ type: \"item_reference\", id: itemId });\n                  break;\n                }\n                const webSearchCall = await convertWebSearchToolResultOutput({\n                  output: part.output,\n                  id: itemId\n                });\n                if (webSearchCall != null) {\n                  input.push(webSearchCall);\n                  break;\n                }\n              }\n              if (part.toolName === toolSearchToolName) {\n                const itemId = (_A = (_z = (_w = (_v = part.providerOptions) == null ? void 0 : _v[providerOptionsName]) == null ? void 0 : _w.itemId) != null ? _z : (_y = (_x = part.providerMetadata) == null ? void 0 : _x[providerOptionsName]) == null ? void 0 : _y.itemId) != null ? _A : part.toolCallId;\n                if (store) {\n                  input.push({ type: \"item_reference\", id: itemId });\n                } else if (part.output.type === \"json\") {\n                  const parsedOutput = await validateTypes({\n                    value: part.output.value,\n                    schema: toolSearchOutputSchema\n                  });\n                  input.push({\n                    type: \"tool_search_output\",\n                    id: itemId,\n                    execution: \"server\",\n                    call_id: null,\n                    status: \"completed\",\n                    tools: parsedOutput.tools\n                  });\n                }\n                break;\n              }\n              if (hasShellTool && resolvedResultToolName === \"shell\") {\n                if (part.output.type === \"json\") {\n                  const parsedOutput = await validateTypes({\n                    value: part.output.value,\n                    schema: shellOutputSchema\n                  });\n                  input.push({\n                    type: \"shell_call_output\",\n                    call_id: part.toolCallId,\n                    output: parsedOutput.output.map((item) => ({\n                      stdout: item.stdout,\n                      stderr: item.stderr,\n                      outcome: item.outcome.type === \"timeout\" ? { type: \"timeout\" } : {\n                        type: \"exit\",\n                        exit_code: item.outcome.exitCode\n                      }\n                    }))\n                  });\n                }\n                break;\n              }\n              if (store) {\n                const itemId = (_D = (_C = (_B = part.providerOptions) == null ? void 0 : _B[providerOptionsName]) == null ? void 0 : _C.itemId) != null ? _D : part.toolCallId;\n                input.push({ type: \"item_reference\", id: itemId });\n              } else {\n                warnings.push({\n                  type: \"other\",\n                  message: `Results for OpenAI tool ${part.toolName} are not sent to the API when store is false`\n                });\n              }\n              break;\n            }\n            case \"reasoning\": {\n              hasPrecedingReasoning = true;\n              const providerOptions2 = await parseProviderOptions5({\n                provider: providerOptionsName,\n                providerOptions: part.providerOptions,\n                schema: openaiResponsesReasoningProviderOptionsSchema\n              });\n              const reasoningId = providerOptions2 == null ? void 0 : providerOptions2.itemId;\n              if ((hasConversation || hasPreviousResponseId) && reasoningId != null) {\n                break;\n              }\n              if (reasoningId != null) {\n                const reasoningMessage = reasoningMessages[reasoningId];\n                if (store) {\n                  if (reasoningMessage === void 0) {\n                    input.push({ type: \"item_reference\", id: reasoningId });\n                    reasoningMessages[reasoningId] = {\n                      type: \"reasoning\",\n                      id: reasoningId,\n                      summary: []\n                    };\n                  }\n                } else {\n                  const summaryParts = [];\n                  if (part.text.length > 0) {\n                    summaryParts.push({\n                      type: \"summary_text\",\n                      text: part.text\n                    });\n                  } else if (reasoningMessage !== void 0) {\n                    warnings.push({\n                      type: \"other\",\n                      message: `Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(part)}.`\n                    });\n                  }\n                  if (reasoningMessage === void 0) {\n                    reasoningMessages[reasoningId] = {\n                      type: \"reasoning\",\n                      id: reasoningId,\n                      encrypted_content: providerOptions2 == null ? void 0 : providerOptions2.reasoningEncryptedContent,\n                      summary: summaryParts\n                    };\n                    input.push(reasoningMessages[reasoningId]);\n                  } else {\n                    reasoningMessage.summary.push(...summaryParts);\n                    if ((providerOptions2 == null ? void 0 : providerOptions2.reasoningEncryptedContent) != null) {\n                      reasoningMessage.encrypted_content = providerOptions2.reasoningEncryptedContent;\n                    }\n                  }\n                }\n              } else {\n                const encryptedContent = providerOptions2 == null ? void 0 : providerOptions2.reasoningEncryptedContent;\n                if (encryptedContent != null) {\n                  const summaryParts = [];\n                  if (part.text.length > 0) {\n                    summaryParts.push({\n                      type: \"summary_text\",\n                      text: part.text\n                    });\n                  }\n                  input.push({\n                    type: \"reasoning\",\n                    encrypted_content: encryptedContent,\n                    summary: summaryParts\n                  });\n                } else {\n                  warnings.push({\n                    type: \"other\",\n                    message: `Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(part)}.`\n                  });\n                }\n              }\n              break;\n            }\n          }\n        }\n        break;\n      }\n      case \"tool\": {\n        for (const part of content) {\n          if (part.type === \"tool-approval-response\") {\n            const approvalResponse = part;\n            if (processedApprovalIds.has(approvalResponse.approvalId)) {\n              continue;\n            }\n            processedApprovalIds.add(approvalResponse.approvalId);\n            if (store && !hasConversation && !hasPreviousResponseId) {\n              input.push({\n                type: \"item_reference\",\n                id: approvalResponse.approvalId\n              });\n            }\n            input.push({\n              type: \"mcp_approval_response\",\n              approval_request_id: approvalResponse.approvalId,\n              approve: approvalResponse.approved\n            });\n            continue;\n          }\n          const parallelToolCallMetadata = getParallelToolCallMetadata({\n            providerOptions: part.providerOptions,\n            providerOptionsName\n          });\n          const parallelToolResultGroup = parallelToolCallMetadata == null ? void 0 : parallelToolResultGroups.get(\n            parallelToolCallMetadata.toolCallId\n          );\n          if (parallelToolCallMetadata != null && parallelToolResultGroup != null && hasSameParallelToolCall(\n            parallelToolResultGroup.metadata,\n            parallelToolCallMetadata\n          )) {\n            if (!emittedParallelToolResults.has(\n              parallelToolResultGroup.metadata.toolCallId\n            )) {\n              emittedParallelToolResults.add(\n                parallelToolResultGroup.metadata.toolCallId\n              );\n              const toolOutputs = await Promise.all(\n                parallelToolResultGroup.results.map(async (result) => {\n                  const promptCacheBreakpoint = getScalarToolResultPromptCacheBreakpoint({\n                    output: result.output,\n                    toolResultProviderOptions: result.providerOptions,\n                    providerOptionsName\n                  });\n                  return {\n                    output: await convertFunctionToolResultOutput({\n                      output: result.output,\n                      providerOptionsName,\n                      warnings\n                    }),\n                    promptCacheBreakpoint\n                  };\n                })\n              );\n              const serializedToolOutputs = toolOutputs.map(\n                ({ output: output2 }) => typeof output2 === \"string\" ? output2 : JSON.stringify(output2)\n              );\n              const hasPromptCacheBreakpoint = toolOutputs.some(\n                ({ promptCacheBreakpoint }) => promptCacheBreakpoint != null\n              );\n              input.push({\n                type: \"function_call_output\",\n                call_id: parallelToolResultGroup.metadata.toolCallId,\n                // The internal wrapper returns one output containing the child\n                // results in the same order as the original tool_uses array.\n                output: hasPromptCacheBreakpoint ? serializedToolOutputs.map((text, index) => ({\n                  type: \"input_text\",\n                  text: index === 0 ? text : `\n${text}`,\n                  ...toolOutputs[index].promptCacheBreakpoint != null && {\n                    prompt_cache_breakpoint: toolOutputs[index].promptCacheBreakpoint\n                  }\n                })) : serializedToolOutputs.join(\"\\n\")\n              });\n            }\n            continue;\n          }\n          const output = part.output;\n          if (output.type === \"execution-denied\") {\n            const approvalId = (_F = (_E = output.providerOptions) == null ? void 0 : _E.openai) == null ? void 0 : _F.approvalId;\n            if (approvalId) {\n              continue;\n            }\n          }\n          const resolvedToolName = toolNameMapping.toProviderToolName(\n            part.toolName\n          );\n          if (part.toolName === toolSearchToolName && output.type === \"json\") {\n            const parsedOutput = await validateTypes({\n              value: output.value,\n              schema: toolSearchOutputSchema\n            });\n            input.push({\n              type: \"tool_search_output\",\n              execution: \"client\",\n              call_id: part.toolCallId,\n              status: \"completed\",\n              tools: parsedOutput.tools\n            });\n            continue;\n          }\n          if (hasLocalShellTool && resolvedToolName === \"local_shell\" && output.type === \"json\") {\n            const parsedOutput = await validateTypes({\n              value: output.value,\n              schema: localShellOutputSchema\n            });\n            input.push({\n              type: \"local_shell_call_output\",\n              call_id: part.toolCallId,\n              output: parsedOutput.output\n            });\n            continue;\n          }\n          if (hasShellTool && resolvedToolName === \"shell\" && output.type === \"json\") {\n            const parsedOutput = await validateTypes({\n              value: output.value,\n              schema: shellOutputSchema\n            });\n            input.push({\n              type: \"shell_call_output\",\n              call_id: part.toolCallId,\n              output: parsedOutput.output.map((item) => ({\n                stdout: item.stdout,\n                stderr: item.stderr,\n                outcome: item.outcome.type === \"timeout\" ? { type: \"timeout\" } : {\n                  type: \"exit\",\n                  exit_code: item.outcome.exitCode\n                }\n              }))\n            });\n            continue;\n          }\n          if (hasApplyPatchTool && part.toolName === \"apply_patch\" && output.type === \"json\") {\n            const parsedOutput = await validateTypes({\n              value: output.value,\n              schema: applyPatchOutputSchema\n            });\n            input.push({\n              type: \"apply_patch_call_output\",\n              call_id: part.toolCallId,\n              status: parsedOutput.status,\n              output: parsedOutput.output\n            });\n            continue;\n          }\n          if (customProviderToolNames == null ? void 0 : customProviderToolNames.has(resolvedToolName)) {\n            const promptCacheBreakpoint = getScalarToolResultPromptCacheBreakpoint({\n              output,\n              toolResultProviderOptions: part.providerOptions,\n              providerOptionsName\n            });\n            const convertScalarOutput = (value) => promptCacheBreakpoint == null ? value : [\n              {\n                type: \"input_text\",\n                text: value,\n                prompt_cache_breakpoint: promptCacheBreakpoint\n              }\n            ];\n            let outputValue;\n            switch (output.type) {\n              case \"text\":\n              case \"error-text\":\n                outputValue = convertScalarOutput(output.value);\n                break;\n              case \"execution-denied\":\n                outputValue = convertScalarOutput(\n                  (_G = output.reason) != null ? _G : \"Tool call execution denied.\"\n                );\n                break;\n              case \"json\":\n              case \"error-json\":\n                outputValue = convertScalarOutput(JSON.stringify(output.value));\n                break;\n              case \"content\":\n                outputValue = output.value.map((item) => {\n                  var _a3, _b2, _c2, _d2, _e2;\n                  const promptCacheBreakpoint2 = getPromptCacheBreakpoint2(\n                    item.providerOptions,\n                    providerOptionsName\n                  );\n                  switch (item.type) {\n                    case \"text\":\n                      return {\n                        type: \"input_text\",\n                        text: item.text,\n                        ...promptCacheBreakpoint2 != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint2\n                        }\n                      };\n                    case \"image-data\":\n                      return {\n                        type: \"input_image\",\n                        image_url: `data:${item.mediaType};base64,${item.data}`,\n                        detail: (_b2 = (_a3 = item.providerOptions) == null ? void 0 : _a3[providerOptionsName]) == null ? void 0 : _b2.imageDetail,\n                        ...promptCacheBreakpoint2 != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint2\n                        }\n                      };\n                    case \"image-url\":\n                      return {\n                        type: \"input_image\",\n                        image_url: item.url,\n                        detail: (_d2 = (_c2 = item.providerOptions) == null ? void 0 : _c2[providerOptionsName]) == null ? void 0 : _d2.imageDetail,\n                        ...promptCacheBreakpoint2 != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint2\n                        }\n                      };\n                    case \"file-data\":\n                      return {\n                        type: \"input_file\",\n                        filename: (_e2 = item.filename) != null ? _e2 : \"data\",\n                        file_data: `data:${item.mediaType};base64,${item.data}`,\n                        ...promptCacheBreakpoint2 != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint2\n                        }\n                      };\n                    case \"file-url\":\n                      return {\n                        type: \"input_file\",\n                        file_url: item.url,\n                        ...promptCacheBreakpoint2 != null && {\n                          prompt_cache_breakpoint: promptCacheBreakpoint2\n                        }\n                      };\n                    default:\n                      warnings.push({\n                        type: \"other\",\n                        message: `unsupported custom tool content part type: ${item.type}`\n                      });\n                      return void 0;\n                  }\n                }).filter(isNonNullable);\n                break;\n              default:\n                outputValue = \"\";\n            }\n            input.push({\n              type: \"custom_tool_call_output\",\n              call_id: part.toolCallId,\n              output: outputValue\n            });\n            continue;\n          }\n          const contentValue = await convertFunctionToolResultOutput({\n            output,\n            promptCacheBreakpoint: getScalarToolResultPromptCacheBreakpoint({\n              output,\n              toolResultProviderOptions: part.providerOptions,\n              providerOptionsName\n            }),\n            providerOptionsName,\n            warnings\n          });\n          input.push({\n            type: \"function_call_output\",\n            call_id: part.toolCallId,\n            output: contentValue\n          });\n        }\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  if (!store && input.some(\n    (item) => \"type\" in item && item.type === \"reasoning\" && item.encrypted_content == null\n  )) {\n    warnings.push({\n      type: \"other\",\n      message: \"Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts.\"\n    });\n    input = input.filter(\n      (item) => !(\"type\" in item) || item.type !== \"reasoning\" || item.encrypted_content != null\n    );\n  }\n  return { input, warnings };\n}\nvar openaiResponsesReasoningProviderOptionsSchema = lazySchema22(\n  () => zodSchema22(\n    z22.object({\n      itemId: z22.string().nullish(),\n      reasoningEncryptedContent: z22.string().nullish()\n    })\n  )\n);\n\n// src/responses/map-openai-responses-finish-reason.ts\nfunction mapOpenAIResponseFinishReason({\n  finishReason,\n  hasFunctionCall\n}) {\n  switch (finishReason) {\n    case void 0:\n    case null:\n      return hasFunctionCall ? \"tool-calls\" : \"stop\";\n    case \"max_output_tokens\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    default:\n      return hasFunctionCall ? \"tool-calls\" : \"other\";\n  }\n}\n\n// src/responses/openai-responses-api.ts\nimport {\n  lazySchema as lazySchema23,\n  zodSchema as zodSchema23\n} from \"@ai-sdk/provider-utils\";\nimport { z as z23 } from \"zod/v4\";\nvar cachedJsonValueSchema2;\nvar jsonValueSchema2 = () => cachedJsonValueSchema2 != null ? cachedJsonValueSchema2 : cachedJsonValueSchema2 = z23.lazy(\n  () => z23.union([\n    z23.string(),\n    z23.number(),\n    z23.boolean(),\n    z23.null(),\n    z23.array(jsonValueSchema2()),\n    z23.record(z23.string(), jsonValueSchema2().optional())\n  ])\n);\nvar jsonObjectSchema = () => z23.record(z23.string(), jsonValueSchema2().optional());\nvar openaiResponsesUsageSchema = () => z23.intersection(\n  jsonObjectSchema(),\n  z23.object({\n    input_tokens: z23.number(),\n    input_tokens_details: z23.intersection(\n      jsonObjectSchema(),\n      z23.object({\n        cached_tokens: z23.number().nullish(),\n        cache_write_tokens: z23.number().nullish(),\n        cache_write_tokens_details: z23.intersection(\n          jsonObjectSchema(),\n          z23.object({\n            ttl_30m_tokens: z23.number().nullish(),\n            ttl_12h_tokens: z23.number().nullish()\n          })\n        ).nullish(),\n        orchestration_input_tokens: z23.number().nullish(),\n        orchestration_input_cached_tokens: z23.number().nullish()\n      })\n    ).nullish(),\n    output_tokens: z23.number(),\n    output_tokens_details: z23.intersection(\n      jsonObjectSchema(),\n      z23.object({\n        reasoning_tokens: z23.number().nullish(),\n        orchestration_output_tokens: z23.number().nullish()\n      })\n    ).nullish(),\n    total_tokens: z23.number().optional()\n  })\n);\nfunction isRecord(value) {\n  return value != null && typeof value === \"object\" && !Array.isArray(value);\n}\nvar openaiResponsesLocalShellCallSchema = () => z23.object({\n  type: z23.literal(\"local_shell_call\"),\n  id: z23.string(),\n  call_id: z23.string(),\n  action: z23.object({\n    type: z23.literal(\"exec\"),\n    command: z23.array(z23.string()),\n    timeout_ms: z23.number().optional(),\n    user: z23.string().optional(),\n    working_directory: z23.string().optional(),\n    env: z23.record(z23.string(), z23.string()).optional()\n  })\n});\nvar openaiResponsesNestedErrorChunkSchema = () => z23.object({\n  type: z23.literal(\"error\"),\n  sequence_number: z23.number(),\n  error: z23.object({\n    type: z23.string(),\n    code: z23.string().nullish(),\n    message: z23.string(),\n    param: z23.string().nullish()\n  })\n});\nvar openaiResponsesErrorChunkSchema = () => z23.object({\n  type: z23.literal(\"error\"),\n  sequence_number: z23.number(),\n  code: z23.string().nullish(),\n  message: z23.string(),\n  param: z23.string().nullish()\n});\nvar openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([\n  \"error\",\n  \"response.apply_patch_call_operation_diff.delta\",\n  \"response.apply_patch_call_operation_diff.done\",\n  \"response.code_interpreter_call_code.delta\",\n  \"response.code_interpreter_call_code.done\",\n  \"response.completed\",\n  \"response.created\",\n  \"response.custom_tool_call_input.delta\",\n  \"response.failed\",\n  \"response.function_call_arguments.delta\",\n  \"response.function_call_arguments.done\",\n  \"response.image_generation_call.partial_image\",\n  \"response.incomplete\",\n  \"response.output_item.added\",\n  \"response.output_item.done\",\n  \"response.output_text.annotation.added\",\n  \"response.output_text.delta\",\n  \"response.reasoning_summary_part.added\",\n  \"response.reasoning_summary_part.done\",\n  \"response.reasoning_summary_text.delta\"\n]);\nvar openaiResponsesModeledOutputItemTypes = /* @__PURE__ */ new Set([\n  \"apply_patch_call\",\n  \"code_interpreter_call\",\n  \"computer_call\",\n  \"custom_tool_call\",\n  \"file_search_call\",\n  \"function_call\",\n  \"image_generation_call\",\n  \"local_shell_call\",\n  \"mcp_approval_request\",\n  \"mcp_call\",\n  \"mcp_list_tools\",\n  \"message\",\n  \"reasoning\",\n  \"shell_call\",\n  \"shell_call_output\",\n  \"tool_search_call\",\n  \"tool_search_output\",\n  \"web_search_call\"\n]);\nfunction isModeledOpenAIResponsesChunk(value) {\n  if (typeof value.type !== \"string\" || !openaiResponsesModeledChunkTypes.has(value.type)) {\n    return false;\n  }\n  if (value.type !== \"response.output_item.added\" && value.type !== \"response.output_item.done\") {\n    return true;\n  }\n  if (!isRecord(value.item) || typeof value.item.type !== \"string\") {\n    return true;\n  }\n  return openaiResponsesModeledOutputItemTypes.has(value.item.type);\n}\nvar openaiResponsesChunkSchema = lazySchema23(\n  () => zodSchema23(\n    z23.union([\n      z23.object({\n        type: z23.literal(\"response.output_text.delta\"),\n        item_id: z23.string(),\n        delta: z23.string(),\n        logprobs: z23.array(\n          z23.object({\n            token: z23.string(),\n            logprob: z23.number(),\n            top_logprobs: z23.array(\n              z23.object({\n                token: z23.string(),\n                logprob: z23.number()\n              })\n            )\n          })\n        ).nullish()\n      }),\n      z23.object({\n        type: z23.enum([\"response.completed\", \"response.incomplete\"]),\n        response: z23.object({\n          incomplete_details: z23.object({ reason: z23.string() }).nullish(),\n          usage: openaiResponsesUsageSchema().nullish(),\n          reasoning: z23.object({\n            context: z23.string().nullish()\n          }).nullish(),\n          service_tier: z23.string().nullish()\n        })\n      }),\n      z23.object({\n        type: z23.literal(\"response.failed\"),\n        sequence_number: z23.number(),\n        response: z23.object({\n          error: z23.object({\n            code: z23.string().nullish(),\n            message: z23.string()\n          }).nullish(),\n          incomplete_details: z23.object({ reason: z23.string() }).nullish(),\n          usage: openaiResponsesUsageSchema().nullish(),\n          reasoning: z23.object({\n            context: z23.string().nullish()\n          }).nullish(),\n          service_tier: z23.string().nullish()\n        })\n      }),\n      z23.object({\n        type: z23.literal(\"response.created\"),\n        response: z23.object({\n          id: z23.string(),\n          created_at: z23.number(),\n          model: z23.string(),\n          service_tier: z23.string().nullish()\n        })\n      }),\n      z23.object({\n        type: z23.literal(\"response.output_item.added\"),\n        output_index: z23.number(),\n        item: z23.discriminatedUnion(\"type\", [\n          z23.object({\n            type: z23.literal(\"message\"),\n            id: z23.string(),\n            phase: z23.enum([\"commentary\", \"final_answer\"]).nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"reasoning\"),\n            id: z23.string(),\n            encrypted_content: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"function_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            name: z23.string(),\n            arguments: z23.string(),\n            async: z23.boolean().nullish(),\n            namespace: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"web_search_call\"),\n            id: z23.string(),\n            status: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"computer_call\"),\n            id: z23.string(),\n            status: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"file_search_call\"),\n            id: z23.string()\n          }),\n          openaiResponsesLocalShellCallSchema(),\n          z23.object({\n            type: z23.literal(\"image_generation_call\"),\n            id: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"code_interpreter_call\"),\n            id: z23.string(),\n            container_id: z23.string(),\n            code: z23.string().nullable(),\n            outputs: z23.array(\n              z23.discriminatedUnion(\"type\", [\n                z23.object({ type: z23.literal(\"logs\"), logs: z23.string() }),\n                z23.object({ type: z23.literal(\"image\"), url: z23.string() })\n              ])\n            ).nullable(),\n            status: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_call\"),\n            id: z23.string(),\n            status: z23.string(),\n            approval_request_id: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_list_tools\"),\n            id: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_approval_request\"),\n            id: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"apply_patch_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\"]),\n            operation: z23.discriminatedUnion(\"type\", [\n              z23.object({\n                type: z23.literal(\"create_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"delete_file\"),\n                path: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"update_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              })\n            ])\n          }),\n          z23.object({\n            type: z23.literal(\"custom_tool_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            name: z23.string(),\n            input: z23.string(),\n            async: z23.boolean().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            action: z23.object({\n              commands: z23.array(z23.string())\n            })\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call_output\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            output: z23.array(\n              z23.object({\n                stdout: z23.string(),\n                stderr: z23.string(),\n                outcome: z23.discriminatedUnion(\"type\", [\n                  z23.object({ type: z23.literal(\"timeout\") }),\n                  z23.object({\n                    type: z23.literal(\"exit\"),\n                    exit_code: z23.number()\n                  })\n                ])\n              })\n            )\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_call\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            arguments: z23.unknown()\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_output\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            tools: z23.array(z23.record(z23.string(), jsonValueSchema2().optional()))\n          })\n        ])\n      }),\n      z23.object({\n        type: z23.literal(\"response.output_item.done\"),\n        output_index: z23.number(),\n        item: z23.discriminatedUnion(\"type\", [\n          z23.object({\n            type: z23.literal(\"message\"),\n            id: z23.string(),\n            phase: z23.enum([\"commentary\", \"final_answer\"]).nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"reasoning\"),\n            id: z23.string(),\n            encrypted_content: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"function_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            name: z23.string(),\n            arguments: z23.string(),\n            async: z23.boolean().nullish(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            namespace: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"custom_tool_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            name: z23.string(),\n            input: z23.string(),\n            async: z23.boolean().nullish(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"])\n          }),\n          z23.object({\n            type: z23.literal(\"code_interpreter_call\"),\n            id: z23.string(),\n            code: z23.string().nullable(),\n            container_id: z23.string(),\n            outputs: z23.array(\n              z23.discriminatedUnion(\"type\", [\n                z23.object({ type: z23.literal(\"logs\"), logs: z23.string() }),\n                z23.object({ type: z23.literal(\"image\"), url: z23.string() })\n              ])\n            ).nullable()\n          }),\n          z23.object({\n            type: z23.literal(\"image_generation_call\"),\n            id: z23.string(),\n            result: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"web_search_call\"),\n            id: z23.string(),\n            status: z23.string(),\n            action: z23.discriminatedUnion(\"type\", [\n              z23.object({\n                type: z23.literal(\"search\"),\n                query: z23.string().nullish(),\n                queries: z23.array(z23.string()).nullish(),\n                sources: z23.array(\n                  z23.discriminatedUnion(\"type\", [\n                    z23.object({ type: z23.literal(\"url\"), url: z23.string() }),\n                    z23.object({ type: z23.literal(\"api\"), name: z23.string() })\n                  ])\n                ).nullish()\n              }),\n              z23.object({\n                type: z23.literal(\"open_page\"),\n                url: z23.string().nullish()\n              }),\n              z23.object({\n                type: z23.literal(\"find_in_page\"),\n                url: z23.string().nullish(),\n                pattern: z23.string().nullish()\n              })\n            ]).nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"file_search_call\"),\n            id: z23.string(),\n            queries: z23.array(z23.string()),\n            results: z23.array(\n              z23.object({\n                attributes: z23.record(\n                  z23.string(),\n                  z23.union([z23.string(), z23.number(), z23.boolean()])\n                ),\n                file_id: z23.string(),\n                filename: z23.string(),\n                score: z23.number(),\n                text: z23.string()\n              })\n            ).nullish()\n          }),\n          openaiResponsesLocalShellCallSchema(),\n          z23.object({\n            type: z23.literal(\"computer_call\"),\n            id: z23.string(),\n            status: z23.literal(\"completed\")\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_call\"),\n            id: z23.string(),\n            status: z23.string(),\n            arguments: z23.string(),\n            name: z23.string(),\n            server_label: z23.string(),\n            output: z23.string().nullish(),\n            error: z23.union([\n              z23.string(),\n              z23.object({\n                type: z23.string().optional(),\n                code: z23.union([z23.number(), z23.string()]).optional(),\n                message: z23.string().optional()\n              }).loose()\n            ]).nullish(),\n            approval_request_id: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_list_tools\"),\n            id: z23.string(),\n            server_label: z23.string(),\n            tools: z23.array(\n              z23.object({\n                name: z23.string(),\n                description: z23.string().optional(),\n                input_schema: z23.any(),\n                annotations: z23.record(z23.string(), z23.unknown()).optional()\n              })\n            ),\n            error: z23.union([\n              z23.string(),\n              z23.object({\n                type: z23.string().optional(),\n                code: z23.union([z23.number(), z23.string()]).optional(),\n                message: z23.string().optional()\n              }).loose()\n            ]).optional()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_approval_request\"),\n            id: z23.string(),\n            server_label: z23.string(),\n            name: z23.string(),\n            arguments: z23.string(),\n            approval_request_id: z23.string().optional()\n          }),\n          z23.object({\n            type: z23.literal(\"apply_patch_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\"]),\n            operation: z23.discriminatedUnion(\"type\", [\n              z23.object({\n                type: z23.literal(\"create_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"delete_file\"),\n                path: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"update_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              })\n            ])\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            action: z23.object({\n              commands: z23.array(z23.string())\n            })\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call_output\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            output: z23.array(\n              z23.object({\n                stdout: z23.string(),\n                stderr: z23.string(),\n                outcome: z23.discriminatedUnion(\"type\", [\n                  z23.object({ type: z23.literal(\"timeout\") }),\n                  z23.object({\n                    type: z23.literal(\"exit\"),\n                    exit_code: z23.number()\n                  })\n                ])\n              })\n            )\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_call\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            arguments: z23.unknown()\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_output\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            tools: z23.array(z23.record(z23.string(), jsonValueSchema2().optional()))\n          })\n        ])\n      }),\n      z23.object({\n        type: z23.literal(\"response.function_call_arguments.delta\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        delta: z23.string()\n      }),\n      z23.object({\n        // `name` is documented as required but omitted from live API events:\n        // https://github.com/openai/openai-openapi/issues/545\n        type: z23.literal(\"response.function_call_arguments.done\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        arguments: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.custom_tool_call_input.delta\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        delta: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.image_generation_call.partial_image\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        partial_image_b64: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.code_interpreter_call_code.delta\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        delta: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.code_interpreter_call_code.done\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        code: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.output_text.annotation.added\"),\n        annotation: z23.discriminatedUnion(\"type\", [\n          z23.object({\n            type: z23.literal(\"url_citation\"),\n            start_index: z23.number(),\n            end_index: z23.number(),\n            url: z23.string(),\n            title: z23.string()\n          }),\n          z23.object({\n            type: z23.literal(\"file_citation\"),\n            file_id: z23.string(),\n            filename: z23.string(),\n            index: z23.number()\n          }),\n          z23.object({\n            type: z23.literal(\"container_file_citation\"),\n            container_id: z23.string(),\n            file_id: z23.string(),\n            filename: z23.string(),\n            start_index: z23.number(),\n            end_index: z23.number()\n          }),\n          z23.object({\n            type: z23.literal(\"file_path\"),\n            file_id: z23.string(),\n            index: z23.number()\n          })\n        ])\n      }),\n      z23.object({\n        type: z23.literal(\"response.reasoning_summary_part.added\"),\n        item_id: z23.string(),\n        summary_index: z23.number()\n      }),\n      z23.object({\n        type: z23.literal(\"response.reasoning_summary_text.delta\"),\n        item_id: z23.string(),\n        summary_index: z23.number(),\n        delta: z23.string()\n      }),\n      z23.object({\n        type: z23.literal(\"response.reasoning_summary_part.done\"),\n        item_id: z23.string(),\n        summary_index: z23.number()\n      }),\n      z23.object({\n        type: z23.literal(\"response.apply_patch_call_operation_diff.delta\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        delta: z23.string(),\n        obfuscation: z23.string().nullish()\n      }),\n      z23.object({\n        type: z23.literal(\"response.apply_patch_call_operation_diff.done\"),\n        item_id: z23.string(),\n        output_index: z23.number(),\n        diff: z23.string()\n      }),\n      openaiResponsesNestedErrorChunkSchema(),\n      openaiResponsesErrorChunkSchema(),\n      z23.object({ type: z23.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {\n        message: \"Known response chunk failed schema validation\"\n      }).transform((value) => ({\n        type: \"unknown_chunk\",\n        message: value.type\n      }))\n      // fallback for unknown chunks\n    ])\n  )\n);\nvar openaiResponsesResponseSchema = lazySchema23(\n  () => zodSchema23(\n    z23.object({\n      id: z23.string().optional(),\n      created_at: z23.number().optional(),\n      error: z23.object({\n        message: z23.string(),\n        type: z23.string(),\n        param: z23.string().nullish(),\n        code: z23.string()\n      }).nullish(),\n      model: z23.string().optional(),\n      output: z23.array(\n        z23.discriminatedUnion(\"type\", [\n          z23.object({\n            type: z23.literal(\"message\"),\n            role: z23.literal(\"assistant\"),\n            id: z23.string(),\n            phase: z23.enum([\"commentary\", \"final_answer\"]).nullish(),\n            content: z23.array(\n              z23.object({\n                type: z23.literal(\"output_text\"),\n                text: z23.string(),\n                logprobs: z23.array(\n                  z23.object({\n                    token: z23.string(),\n                    logprob: z23.number(),\n                    top_logprobs: z23.array(\n                      z23.object({\n                        token: z23.string(),\n                        logprob: z23.number()\n                      })\n                    )\n                  })\n                ).nullish(),\n                annotations: z23.array(\n                  z23.discriminatedUnion(\"type\", [\n                    z23.object({\n                      type: z23.literal(\"url_citation\"),\n                      start_index: z23.number(),\n                      end_index: z23.number(),\n                      url: z23.string(),\n                      title: z23.string()\n                    }),\n                    z23.object({\n                      type: z23.literal(\"file_citation\"),\n                      file_id: z23.string(),\n                      filename: z23.string(),\n                      index: z23.number()\n                    }),\n                    z23.object({\n                      type: z23.literal(\"container_file_citation\"),\n                      container_id: z23.string(),\n                      file_id: z23.string(),\n                      filename: z23.string(),\n                      start_index: z23.number(),\n                      end_index: z23.number()\n                    }),\n                    z23.object({\n                      type: z23.literal(\"file_path\"),\n                      file_id: z23.string(),\n                      index: z23.number()\n                    })\n                  ])\n                )\n              })\n            )\n          }),\n          z23.object({\n            type: z23.literal(\"web_search_call\"),\n            id: z23.string(),\n            status: z23.string(),\n            action: z23.discriminatedUnion(\"type\", [\n              z23.object({\n                type: z23.literal(\"search\"),\n                query: z23.string().nullish(),\n                queries: z23.array(z23.string()).nullish(),\n                sources: z23.array(\n                  z23.discriminatedUnion(\"type\", [\n                    z23.object({ type: z23.literal(\"url\"), url: z23.string() }),\n                    z23.object({\n                      type: z23.literal(\"api\"),\n                      name: z23.string()\n                    })\n                  ])\n                ).nullish()\n              }),\n              z23.object({\n                type: z23.literal(\"open_page\"),\n                url: z23.string().nullish()\n              }),\n              z23.object({\n                type: z23.literal(\"find_in_page\"),\n                url: z23.string().nullish(),\n                pattern: z23.string().nullish()\n              })\n            ]).nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"file_search_call\"),\n            id: z23.string(),\n            queries: z23.array(z23.string()),\n            results: z23.array(\n              z23.object({\n                attributes: z23.record(\n                  z23.string(),\n                  z23.union([z23.string(), z23.number(), z23.boolean()])\n                ),\n                file_id: z23.string(),\n                filename: z23.string(),\n                score: z23.number(),\n                text: z23.string()\n              })\n            ).nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"code_interpreter_call\"),\n            id: z23.string(),\n            code: z23.string().nullable(),\n            container_id: z23.string(),\n            outputs: z23.array(\n              z23.discriminatedUnion(\"type\", [\n                z23.object({ type: z23.literal(\"logs\"), logs: z23.string() }),\n                z23.object({ type: z23.literal(\"image\"), url: z23.string() })\n              ])\n            ).nullable()\n          }),\n          z23.object({\n            type: z23.literal(\"image_generation_call\"),\n            id: z23.string(),\n            result: z23.string()\n          }),\n          openaiResponsesLocalShellCallSchema(),\n          z23.object({\n            type: z23.literal(\"function_call\"),\n            call_id: z23.string(),\n            name: z23.string(),\n            arguments: z23.string(),\n            id: z23.string(),\n            async: z23.boolean().nullish(),\n            namespace: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"custom_tool_call\"),\n            call_id: z23.string(),\n            name: z23.string(),\n            input: z23.string(),\n            id: z23.string(),\n            async: z23.boolean().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"computer_call\"),\n            id: z23.string(),\n            status: z23.string().optional()\n          }),\n          z23.object({\n            type: z23.literal(\"reasoning\"),\n            id: z23.string(),\n            encrypted_content: z23.string().nullish(),\n            summary: z23.array(\n              z23.object({\n                type: z23.literal(\"summary_text\"),\n                text: z23.string()\n              })\n            )\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_call\"),\n            id: z23.string(),\n            status: z23.string(),\n            arguments: z23.string(),\n            name: z23.string(),\n            server_label: z23.string(),\n            output: z23.string().nullish(),\n            error: z23.union([\n              z23.string(),\n              z23.object({\n                type: z23.string().optional(),\n                code: z23.union([z23.number(), z23.string()]).optional(),\n                message: z23.string().optional()\n              }).loose()\n            ]).nullish(),\n            approval_request_id: z23.string().nullish()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_list_tools\"),\n            id: z23.string(),\n            server_label: z23.string(),\n            tools: z23.array(\n              z23.object({\n                name: z23.string(),\n                description: z23.string().optional(),\n                input_schema: z23.any(),\n                annotations: z23.record(z23.string(), z23.unknown()).optional()\n              })\n            ),\n            error: z23.union([\n              z23.string(),\n              z23.object({\n                type: z23.string().optional(),\n                code: z23.union([z23.number(), z23.string()]).optional(),\n                message: z23.string().optional()\n              }).loose()\n            ]).optional()\n          }),\n          z23.object({\n            type: z23.literal(\"mcp_approval_request\"),\n            id: z23.string(),\n            server_label: z23.string(),\n            name: z23.string(),\n            arguments: z23.string(),\n            approval_request_id: z23.string().optional()\n          }),\n          z23.object({\n            type: z23.literal(\"apply_patch_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\"]),\n            operation: z23.discriminatedUnion(\"type\", [\n              z23.object({\n                type: z23.literal(\"create_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"delete_file\"),\n                path: z23.string()\n              }),\n              z23.object({\n                type: z23.literal(\"update_file\"),\n                path: z23.string(),\n                diff: z23.string()\n              })\n            ])\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            action: z23.object({\n              commands: z23.array(z23.string())\n            })\n          }),\n          z23.object({\n            type: z23.literal(\"shell_call_output\"),\n            id: z23.string(),\n            call_id: z23.string(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            output: z23.array(\n              z23.object({\n                stdout: z23.string(),\n                stderr: z23.string(),\n                outcome: z23.discriminatedUnion(\"type\", [\n                  z23.object({ type: z23.literal(\"timeout\") }),\n                  z23.object({\n                    type: z23.literal(\"exit\"),\n                    exit_code: z23.number()\n                  })\n                ])\n              })\n            )\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_call\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            arguments: z23.unknown()\n          }),\n          z23.object({\n            type: z23.literal(\"tool_search_output\"),\n            id: z23.string(),\n            execution: z23.enum([\"server\", \"client\"]),\n            call_id: z23.string().nullable(),\n            status: z23.enum([\"in_progress\", \"completed\", \"incomplete\"]),\n            tools: z23.array(\n              z23.record(z23.string(), jsonValueSchema2().optional())\n            )\n          })\n        ])\n      ).optional(),\n      service_tier: z23.string().nullish(),\n      reasoning: z23.object({\n        context: z23.string().nullish()\n      }).nullish(),\n      incomplete_details: z23.object({ reason: z23.string() }).nullish(),\n      usage: openaiResponsesUsageSchema().nullish()\n    })\n  )\n);\n\n// src/responses/openai-responses-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError5\n} from \"@ai-sdk/provider\";\nimport { validateTypes as validateTypes2 } from \"@ai-sdk/provider-utils\";\nasync function prepareResponsesTools({\n  tools,\n  toolChoice,\n  allowedTools,\n  toolNameMapping,\n  customProviderToolNames,\n  supportsAsyncToolCalling = true,\n  providerOptionsName = \"openai\"\n}) {\n  var _a2, _b, _c, _d, _e, _f;\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  if (tools == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings };\n  }\n  const openaiTools2 = [];\n  const namespaceTools = /* @__PURE__ */ new Map();\n  const resolvedCustomProviderToolNames = customProviderToolNames != null ? customProviderToolNames : /* @__PURE__ */ new Set();\n  const allowedToolResolutions = /* @__PURE__ */ new Map();\n  const allowedToolAliases = /* @__PURE__ */ new Map();\n  const recordAllowedTool = (toolName, resolution, canonicalName) => {\n    allowedToolResolutions.set(toolName, resolution);\n    if (canonicalName == null || canonicalName === toolName) {\n      return;\n    }\n    const existingAlias = allowedToolAliases.get(canonicalName);\n    if (existingAlias == null) {\n      allowedToolAliases.set(canonicalName, resolution);\n    } else if (existingAlias !== \"ambiguous\" && !isSameAllowedTool(existingAlias, resolution)) {\n      allowedToolAliases.set(canonicalName, \"ambiguous\");\n    }\n  };\n  for (const tool of tools) {\n    switch (tool.type) {\n      case \"function\": {\n        const openaiOptions = (_c = (_a2 = tool.providerOptions) == null ? void 0 : _a2[providerOptionsName]) != null ? _c : (_b = tool.providerOptions) == null ? void 0 : _b.openai;\n        const openaiFunctionTool = prepareFunctionTool({\n          tool,\n          options: openaiOptions,\n          async: resolveAsyncToolOption({\n            value: openaiOptions == null ? void 0 : openaiOptions.async,\n            supportsAsyncToolCalling,\n            toolName: tool.name,\n            toolWarnings\n          })\n        });\n        const namespace = openaiOptions == null ? void 0 : openaiOptions.namespace;\n        if (namespace == null) {\n          openaiTools2.push(openaiFunctionTool);\n        } else {\n          let namespaceTool = namespaceTools.get(namespace.name);\n          if (namespaceTool == null) {\n            namespaceTool = {\n              type: \"namespace\",\n              name: namespace.name,\n              description: namespace.description,\n              tools: []\n            };\n            namespaceTools.set(namespace.name, namespaceTool);\n            openaiTools2.push(namespaceTool);\n          } else if (namespaceTool.description !== namespace.description) {\n            throw new UnsupportedFunctionalityError5({\n              functionality: `conflicting descriptions for OpenAI tool namespace \"${namespace.name}\"`\n            });\n          }\n          namespaceTool.tools.push(openaiFunctionTool);\n        }\n        recordAllowedTool(\n          tool.name,\n          namespace != null ? {\n            supported: false,\n            reason: \"tools inside an OpenAI tool namespace are not visible to tool_choice.allowed_tools\"\n          } : (openaiOptions == null ? void 0 : openaiOptions.deferLoading) === true ? {\n            supported: false,\n            reason: \"deferred tools are not visible to tool_choice.allowed_tools\"\n          } : {\n            supported: true,\n            entry: { type: \"function\", name: tool.name }\n          },\n          void 0\n        );\n        break;\n      }\n      case \"provider\": {\n        const openaiToolCountBefore = openaiTools2.length;\n        switch (tool.id) {\n          case \"openai.file_search\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: fileSearchArgsSchema\n            });\n            openaiTools2.push({\n              type: \"file_search\",\n              vector_store_ids: args.vectorStoreIds,\n              max_num_results: args.maxNumResults,\n              ranking_options: args.ranking ? {\n                ranker: args.ranking.ranker,\n                score_threshold: args.ranking.scoreThreshold\n              } : void 0,\n              filters: args.filters\n            });\n            break;\n          }\n          case \"openai.local_shell\": {\n            openaiTools2.push({\n              type: \"local_shell\"\n            });\n            break;\n          }\n          case \"openai.shell\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: shellArgsSchema\n            });\n            openaiTools2.push({\n              type: \"shell\",\n              ...args.environment && {\n                environment: mapShellEnvironment(args.environment)\n              }\n            });\n            break;\n          }\n          case \"openai.apply_patch\": {\n            openaiTools2.push({\n              type: \"apply_patch\"\n            });\n            break;\n          }\n          case \"openai.web_search_preview\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: webSearchPreviewArgsSchema\n            });\n            openaiTools2.push({\n              type: \"web_search_preview\",\n              search_context_size: args.searchContextSize,\n              user_location: args.userLocation\n            });\n            break;\n          }\n          case \"openai.web_search\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: webSearchArgsSchema\n            });\n            openaiTools2.push({\n              type: \"web_search\",\n              filters: args.filters != null ? {\n                allowed_domains: args.filters.allowedDomains,\n                blocked_domains: args.filters.blockedDomains\n              } : void 0,\n              external_web_access: args.externalWebAccess,\n              search_context_size: args.searchContextSize,\n              user_location: args.userLocation\n            });\n            break;\n          }\n          case \"openai.code_interpreter\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: codeInterpreterArgsSchema\n            });\n            openaiTools2.push({\n              type: \"code_interpreter\",\n              container: args.container == null ? { type: \"auto\", file_ids: void 0 } : typeof args.container === \"string\" ? args.container : { type: \"auto\", file_ids: args.container.fileIds }\n            });\n            break;\n          }\n          case \"openai.image_generation\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: imageGenerationArgsSchema\n            });\n            openaiTools2.push({\n              type: \"image_generation\",\n              background: args.background,\n              input_fidelity: args.inputFidelity,\n              input_image_mask: args.inputImageMask ? {\n                file_id: args.inputImageMask.fileId,\n                image_url: args.inputImageMask.imageUrl\n              } : void 0,\n              model: args.model,\n              moderation: args.moderation,\n              partial_images: args.partialImages,\n              quality: args.quality,\n              output_compression: args.outputCompression,\n              output_format: args.outputFormat,\n              size: args.size\n            });\n            break;\n          }\n          case \"openai.mcp\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: mcpArgsSchema\n            });\n            const mapApprovalFilter = (filter) => ({\n              tool_names: filter.toolNames\n            });\n            const requireApproval = args.requireApproval;\n            const requireApprovalParam = requireApproval == null ? void 0 : typeof requireApproval === \"string\" ? requireApproval : requireApproval.never != null ? { never: mapApprovalFilter(requireApproval.never) } : void 0;\n            openaiTools2.push({\n              type: \"mcp\",\n              server_label: args.serverLabel,\n              allowed_tools: Array.isArray(args.allowedTools) ? args.allowedTools : args.allowedTools ? {\n                read_only: args.allowedTools.readOnly,\n                tool_names: args.allowedTools.toolNames\n              } : void 0,\n              authorization: args.authorization,\n              connector_id: args.connectorId,\n              headers: args.headers,\n              require_approval: requireApprovalParam != null ? requireApprovalParam : \"never\",\n              server_description: args.serverDescription,\n              server_url: args.serverUrl\n            });\n            break;\n          }\n          case \"openai.custom\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: customArgsSchema\n            });\n            openaiTools2.push({\n              type: \"custom\",\n              name: args.name,\n              description: args.description,\n              ...resolveAsyncToolOption({\n                value: args.async,\n                supportsAsyncToolCalling,\n                toolName: args.name,\n                toolWarnings\n              }) != null ? { async: args.async } : {},\n              format: args.format\n            });\n            resolvedCustomProviderToolNames.add(args.name);\n            break;\n          }\n          case \"openai.tool_search\": {\n            const args = await validateTypes2({\n              value: tool.args,\n              schema: toolSearchArgsSchema\n            });\n            openaiTools2.push({\n              type: \"tool_search\",\n              ...args.execution != null ? { execution: args.execution } : {},\n              ...args.description != null ? { description: args.description } : {},\n              ...args.parameters != null ? { parameters: args.parameters } : {}\n            });\n            break;\n          }\n        }\n        if (openaiTools2.length > openaiToolCountBefore) {\n          const openaiTool = openaiTools2[openaiToolCountBefore];\n          recordAllowedTool(\n            tool.name,\n            toAllowedToolResolution(openaiTool),\n            toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(tool.name)\n          );\n        }\n        break;\n      }\n      default:\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `function tool ${tool}`\n        });\n        break;\n    }\n  }\n  if (allowedTools != null) {\n    const allowedToolEntries = [];\n    const droppedToolNames = [];\n    for (const name of allowedTools.toolNames) {\n      const directResolution = allowedToolResolutions.get(name);\n      const resolution = directResolution != null ? directResolution : allowedToolAliases.get(name);\n      if (directResolution != null && allowedToolAliases.has(name)) {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `allowedTools entry \"${name}\"`,\n          details: \"this name is both a tool name and the provider tool name of another tool in this request; the tool with this name is allowed\"\n        });\n      }\n      if (resolution === \"ambiguous\") {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `allowedTools entry \"${name}\"`,\n          details: \"several tools in this request share this provider tool name; use the tool name from the tools for this request instead\"\n        });\n        droppedToolNames.push(name);\n        continue;\n      }\n      if (resolution == null) {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `allowedTools entry \"${name}\"`,\n          details: \"the tool is not part of the tools for this request and is sent as a function tool\"\n        });\n        allowedToolEntries.push({\n          type: \"function\",\n          name: (_d = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name)) != null ? _d : name\n        });\n        continue;\n      }\n      if (!resolution.supported) {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `allowedTools entry \"${name}\"`,\n          details: `${resolution.reason}; the tool is removed from the allowed tools`\n        });\n        droppedToolNames.push(name);\n        continue;\n      }\n      allowedToolEntries.push(resolution.entry);\n    }\n    if (allowedToolEntries.length === 0) {\n      throw new UnsupportedFunctionalityError5({\n        functionality: `allowedTools with only tools that cannot be allow-listed (${droppedToolNames.join(\n          \", \"\n        )})`\n      });\n    }\n    return {\n      tools: openaiTools2,\n      toolChoice: {\n        type: \"allowed_tools\",\n        mode: (_e = allowedTools.mode) != null ? _e : \"auto\",\n        tools: allowedToolEntries\n      },\n      toolWarnings\n    };\n  }\n  if (toolChoice == null) {\n    return { tools: openaiTools2, toolChoice: void 0, toolWarnings };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n    case \"none\":\n    case \"required\":\n      return { tools: openaiTools2, toolChoice: type, toolWarnings };\n    case \"tool\": {\n      const resolvedToolName = (_f = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(toolChoice.toolName)) != null ? _f : toolChoice.toolName;\n      return {\n        tools: openaiTools2,\n        toolChoice: resolvedToolName === \"code_interpreter\" || resolvedToolName === \"file_search\" || resolvedToolName === \"image_generation\" || resolvedToolName === \"web_search_preview\" || resolvedToolName === \"web_search\" || resolvedToolName === \"mcp\" || resolvedToolName === \"apply_patch\" ? { type: resolvedToolName } : resolvedCustomProviderToolNames.has(resolvedToolName) ? { type: \"custom\", name: resolvedToolName } : { type: \"function\", name: resolvedToolName },\n        toolWarnings\n      };\n    }\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError5({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\nfunction allowedToolKey(entry) {\n  switch (entry.type) {\n    case \"mcp\":\n      return `mcp:${entry.server_label}`;\n    case \"function\":\n    case \"custom\":\n      return `${entry.type}:${entry.name}`;\n    default:\n      return entry.type;\n  }\n}\nfunction isSameAllowedTool(a, b) {\n  if (a.supported && b.supported) {\n    return allowedToolKey(a.entry) === allowedToolKey(b.entry);\n  }\n  if (!a.supported && !b.supported) {\n    return a.reason === b.reason;\n  }\n  return false;\n}\nfunction toAllowedToolResolution(tool) {\n  switch (tool.type) {\n    case \"custom\":\n      return { supported: true, entry: { type: \"custom\", name: tool.name } };\n    case \"mcp\":\n      return {\n        supported: true,\n        entry: { type: \"mcp\", server_label: tool.server_label }\n      };\n    case \"file_search\":\n    case \"web_search\":\n    case \"web_search_preview\":\n    case \"image_generation\":\n    case \"code_interpreter\":\n    case \"apply_patch\":\n    case \"shell\":\n    case \"local_shell\":\n      return { supported: true, entry: { type: tool.type } };\n    default:\n      return {\n        supported: false,\n        reason: `OpenAI does not support ${tool.type} tools in tool_choice.allowed_tools`\n      };\n  }\n}\nfunction prepareFunctionTool({\n  tool,\n  options,\n  async\n}) {\n  const deferLoading = options == null ? void 0 : options.deferLoading;\n  return {\n    type: \"function\",\n    name: tool.name,\n    description: tool.description,\n    parameters: tool.inputSchema,\n    ...async != null ? { async } : {},\n    ...tool.strict != null ? { strict: tool.strict } : {},\n    ...deferLoading != null ? { defer_loading: deferLoading } : {}\n  };\n}\nfunction resolveAsyncToolOption({\n  value,\n  supportsAsyncToolCalling,\n  toolName,\n  toolWarnings\n}) {\n  if (value !== true || supportsAsyncToolCalling) {\n    return value;\n  }\n  toolWarnings.push({\n    type: \"unsupported\",\n    feature: `async tool calling for \"${toolName}\"`,\n    details: \"Async tool calling is only supported by GPT-6 and later models.\"\n  });\n  return void 0;\n}\nfunction mapShellEnvironment(environment) {\n  if (environment.type === \"containerReference\") {\n    const env2 = environment;\n    return {\n      type: \"container_reference\",\n      container_id: env2.containerId\n    };\n  }\n  if (environment.type === \"containerAuto\") {\n    const env2 = environment;\n    return {\n      type: \"container_auto\",\n      file_ids: env2.fileIds,\n      memory_limit: env2.memoryLimit,\n      network_policy: env2.networkPolicy == null ? void 0 : env2.networkPolicy.type === \"disabled\" ? { type: \"disabled\" } : {\n        type: \"allowlist\",\n        allowed_domains: env2.networkPolicy.allowedDomains,\n        domain_secrets: env2.networkPolicy.domainSecrets\n      },\n      skills: mapShellSkills(env2.skills)\n    };\n  }\n  const env = environment;\n  return {\n    type: \"local\",\n    skills: env.skills\n  };\n}\nfunction mapShellSkills(skills) {\n  return skills == null ? void 0 : skills.map(\n    (skill) => skill.type === \"skillReference\" ? {\n      type: \"skill_reference\",\n      skill_id: skill.skillId,\n      version: skill.version\n    } : {\n      type: \"inline\",\n      name: skill.name,\n      description: skill.description,\n      source: {\n        type: \"base64\",\n        media_type: skill.source.mediaType,\n        data: skill.source.data\n      }\n    }\n  );\n}\n\n// src/responses/openai-responses-language-model.ts\nfunction extractApprovalRequestIdToToolCallIdMapping(prompt) {\n  var _a2, _b;\n  const mapping = {};\n  for (const message of prompt) {\n    if (message.role !== \"assistant\") continue;\n    for (const part of message.content) {\n      if (part.type !== \"tool-call\") continue;\n      const approvalRequestId = (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.openai) == null ? void 0 : _b.approvalRequestId;\n      if (approvalRequestId != null) {\n        mapping[approvalRequestId] = part.toolCallId;\n      }\n    }\n  }\n  return mapping;\n}\nfunction getConfigurationUpdateUnsupportedReason({\n  modelCapabilities,\n  options\n}) {\n  if (!modelCapabilities.supportsConfigurationUpdate) {\n    return \"reasoningEffortUpdate is only supported by GPT-6 and later models\";\n  }\n  if ((options == null ? void 0 : options.reasoningMode) === \"pro\" || (options == null ? void 0 : options.truncation) === \"auto\") {\n    return \"reasoningEffortUpdate requires standard reasoning mode without automatic truncation\";\n  }\n  return void 0;\n}\nvar OpenAIResponsesLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.supportedUrls = {\n      \"image/*\": [/^https?:\\/\\/.*$/],\n      \"application/pdf\": [/^https?:\\/\\/.*$/]\n    };\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    maxOutputTokens,\n    temperature,\n    stopSequences,\n    topP,\n    topK,\n    presencePenalty,\n    frequencyPenalty,\n    seed,\n    prompt,\n    providerOptions,\n    tools,\n    toolChoice,\n    responseFormat\n  }) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;\n    const warnings = [];\n    const modelCapabilities = getOpenAILanguageModelCapabilities(this.modelId);\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    if (seed != null) {\n      warnings.push({ type: \"unsupported\", feature: \"seed\" });\n    }\n    if (presencePenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"presencePenalty\" });\n    }\n    if (frequencyPenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"frequencyPenalty\" });\n    }\n    if (stopSequences != null) {\n      warnings.push({ type: \"unsupported\", feature: \"stopSequences\" });\n    }\n    const providerOptionsName = this.config.provider.includes(\"azure\") ? \"azure\" : \"openai\";\n    let openaiOptions = await parseProviderOptions6({\n      provider: providerOptionsName,\n      providerOptions,\n      schema: openaiLanguageModelResponsesOptionsSchema\n    });\n    if (openaiOptions == null && providerOptionsName !== \"openai\") {\n      openaiOptions = await parseProviderOptions6({\n        provider: \"openai\",\n        providerOptions,\n        schema: openaiLanguageModelResponsesOptionsSchema\n      });\n    }\n    const isReasoningModel = (_a2 = openaiOptions == null ? void 0 : openaiOptions.forceReasoning) != null ? _a2 : modelCapabilities.isReasoningModel;\n    let resolvedReasoningEffort = openaiOptions == null ? void 0 : openaiOptions.reasoningEffort;\n    if (resolvedReasoningEffort != null && modelCapabilities.supportedReasoningEfforts != null && !modelCapabilities.supportedReasoningEfforts.includes(\n      resolvedReasoningEffort\n    )) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"reasoningEffort\",\n        details: `${this.modelId} only supports the following reasoning efforts: ${modelCapabilities.supportedReasoningEfforts.join(\", \")}`\n      });\n      resolvedReasoningEffort = void 0;\n    }\n    if ((openaiOptions == null ? void 0 : openaiOptions.conversation) && (openaiOptions == null ? void 0 : openaiOptions.previousResponseId)) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"conversation\",\n        details: \"conversation and previousResponseId cannot be used together\"\n      });\n    }\n    const toolNameMapping = createToolNameMapping({\n      tools,\n      providerToolNames: {\n        \"openai.code_interpreter\": \"code_interpreter\",\n        \"openai.file_search\": \"file_search\",\n        \"openai.image_generation\": \"image_generation\",\n        \"openai.local_shell\": \"local_shell\",\n        \"openai.shell\": \"shell\",\n        \"openai.web_search\": \"web_search\",\n        \"openai.web_search_preview\": \"web_search_preview\",\n        \"openai.mcp\": \"mcp\",\n        \"openai.apply_patch\": \"apply_patch\",\n        \"openai.tool_search\": \"tool_search\"\n      },\n      resolveProviderToolName: (tool) => tool.id === \"openai.custom\" ? tool.args.name : void 0\n    });\n    const customProviderToolNames = /* @__PURE__ */ new Set();\n    const {\n      tools: openaiTools2,\n      toolChoice: openaiToolChoice,\n      toolWarnings\n    } = await prepareResponsesTools({\n      tools,\n      toolChoice,\n      allowedTools: (_b = openaiOptions == null ? void 0 : openaiOptions.allowedTools) != null ? _b : void 0,\n      toolNameMapping,\n      customProviderToolNames,\n      supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling,\n      providerOptionsName\n    });\n    const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({\n      modelCapabilities,\n      options: openaiOptions\n    });\n    const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({\n      prompt,\n      configurationUpdateUnsupportedReason,\n      toolNameMapping,\n      systemMessageMode: (_c = openaiOptions == null ? void 0 : openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? \"developer\" : modelCapabilities.systemMessageMode,\n      providerOptionsName,\n      explicitMessageItemType: this.config.explicitMessageItemType,\n      fileIdPrefixes: this.config.fileIdPrefixes,\n      passThroughUnsupportedFiles: (_d = openaiOptions == null ? void 0 : openaiOptions.passThroughUnsupportedFiles) != null ? _d : false,\n      store: (_e = openaiOptions == null ? void 0 : openaiOptions.store) != null ? _e : true,\n      isReasoningModel,\n      hasConversation: (openaiOptions == null ? void 0 : openaiOptions.conversation) != null,\n      hasPreviousResponseId: (openaiOptions == null ? void 0 : openaiOptions.previousResponseId) != null,\n      hasLocalShellTool: hasOpenAITool(\"openai.local_shell\"),\n      hasShellTool: hasOpenAITool(\"openai.shell\"),\n      hasApplyPatchTool: hasOpenAITool(\"openai.apply_patch\"),\n      toolSearchToolName: getOpenAIToolName(\"openai.tool_search\"),\n      customProviderToolNames: customProviderToolNames.size > 0 ? customProviderToolNames : void 0\n    });\n    warnings.push(...inputWarnings);\n    const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;\n    if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"reasoningEffortUpdate\",\n        details: configurationUpdateUnsupportedReason\n      });\n    } else if (reasoningEffortUpdate != null) {\n      const firstItem = input[0];\n      if ((firstItem == null ? void 0 : firstItem.type) !== \"configuration_update\" || firstItem.reasoning.effort !== reasoningEffortUpdate) {\n        input.unshift({\n          type: \"configuration_update\",\n          reasoning: { effort: reasoningEffortUpdate }\n        });\n      }\n    }\n    for (let i = 1; i < input.length; i++) {\n      if (input[i - 1].type === \"configuration_update\" && input[i].type === \"configuration_update\") {\n        throw new UnsupportedFunctionalityError6({\n          functionality: \"Adjacent reasoning effort configuration updates\"\n        });\n      }\n    }\n    const strictJsonSchema = (_f = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _f : true;\n    let include = openaiOptions == null ? void 0 : openaiOptions.include;\n    function addInclude(key) {\n      if (include == null) {\n        include = [key];\n      } else if (!include.includes(key)) {\n        include = [...include, key];\n      }\n    }\n    function getOpenAIToolName(id) {\n      var _a3;\n      return (_a3 = tools == null ? void 0 : tools.find((tool) => tool.type === \"provider\" && tool.id === id)) == null ? void 0 : _a3.name;\n    }\n    function hasOpenAITool(id) {\n      return getOpenAIToolName(id) != null;\n    }\n    const topLogprobs = typeof (openaiOptions == null ? void 0 : openaiOptions.logprobs) === \"number\" ? openaiOptions == null ? void 0 : openaiOptions.logprobs : (openaiOptions == null ? void 0 : openaiOptions.logprobs) === true ? TOP_LOGPROBS_MAX : void 0;\n    if (topLogprobs) {\n      addInclude(\"message.output_text.logprobs\");\n    }\n    const webSearchToolName = (_g = tools == null ? void 0 : tools.find(\n      (tool) => tool.type === \"provider\" && (tool.id === \"openai.web_search\" || tool.id === \"openai.web_search_preview\")\n    )) == null ? void 0 : _g.name;\n    if (webSearchToolName) {\n      addInclude(\"web_search_call.action.sources\");\n    }\n    if (hasOpenAITool(\"openai.code_interpreter\")) {\n      addInclude(\"code_interpreter_call.outputs\");\n    }\n    const store = openaiOptions == null ? void 0 : openaiOptions.store;\n    if (store === false && isReasoningModel) {\n      addInclude(\"reasoning.encrypted_content\");\n    }\n    const baseArgs = {\n      model: this.modelId,\n      input,\n      temperature,\n      top_p: topP,\n      max_output_tokens: maxOutputTokens,\n      ...((responseFormat == null ? void 0 : responseFormat.type) === \"json\" || (openaiOptions == null ? void 0 : openaiOptions.textVerbosity)) && {\n        text: {\n          ...(responseFormat == null ? void 0 : responseFormat.type) === \"json\" && {\n            format: responseFormat.schema != null ? {\n              type: \"json_schema\",\n              strict: strictJsonSchema,\n              name: (_h = responseFormat.name) != null ? _h : \"response\",\n              description: responseFormat.description,\n              schema: normalizeOpenAIJsonSchema(responseFormat.schema)\n            } : { type: \"json_object\" }\n          },\n          ...(openaiOptions == null ? void 0 : openaiOptions.textVerbosity) && {\n            verbosity: openaiOptions.textVerbosity\n          }\n        }\n      },\n      // provider options:\n      conversation: openaiOptions == null ? void 0 : openaiOptions.conversation,\n      max_tool_calls: openaiOptions == null ? void 0 : openaiOptions.maxToolCalls,\n      metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,\n      parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,\n      previous_response_id: openaiOptions == null ? void 0 : openaiOptions.previousResponseId,\n      store,\n      user: openaiOptions == null ? void 0 : openaiOptions.user,\n      instructions: openaiOptions == null ? void 0 : openaiOptions.instructions,\n      service_tier: openaiOptions == null ? void 0 : openaiOptions.serviceTier,\n      include,\n      prompt_cache_key: openaiOptions == null ? void 0 : openaiOptions.promptCacheKey,\n      prompt_cache_options: openaiOptions == null ? void 0 : openaiOptions.promptCacheOptions,\n      prompt_cache_retention: openaiOptions == null ? void 0 : openaiOptions.promptCacheRetention,\n      safety_identifier: openaiOptions == null ? void 0 : openaiOptions.safetyIdentifier,\n      top_logprobs: topLogprobs,\n      truncation: openaiOptions == null ? void 0 : openaiOptions.truncation,\n      // model-specific settings:\n      ...isReasoningModel && (resolvedReasoningEffort != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningMode) != null || (openaiOptions == null ? void 0 : openaiOptions.reasoningContext) != null) && {\n        reasoning: {\n          ...resolvedReasoningEffort != null && {\n            effort: resolvedReasoningEffort\n          },\n          ...(openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null && {\n            summary: openaiOptions.reasoningSummary\n          },\n          ...(openaiOptions == null ? void 0 : openaiOptions.reasoningMode) != null && {\n            mode: openaiOptions.reasoningMode\n          },\n          ...(openaiOptions == null ? void 0 : openaiOptions.reasoningContext) != null && {\n            context: openaiOptions.reasoningContext\n          }\n        }\n      }\n    };\n    if (modelCapabilities.supportsConfigurationUpdate && baseArgs.prompt_cache_retention != null) {\n      baseArgs.prompt_cache_retention = void 0;\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"promptCacheRetention\",\n        details: \"promptCacheRetention is not supported by GPT-6 and later models; use promptCacheOptions instead\"\n      });\n    }\n    if (isReasoningModel) {\n      if (!((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) === \"none\" && modelCapabilities.supportsNonReasoningParameters)) {\n        if (baseArgs.temperature != null) {\n          baseArgs.temperature = void 0;\n          warnings.push({\n            type: \"unsupported\",\n            feature: \"temperature\",\n            details: \"temperature is not supported for reasoning models\"\n          });\n        }\n        if (baseArgs.top_p != null) {\n          baseArgs.top_p = void 0;\n          warnings.push({\n            type: \"unsupported\",\n            feature: \"topP\",\n            details: \"topP is not supported for reasoning models\"\n          });\n        }\n      }\n      if (modelCapabilities.supportedReasoningEfforts != null && (baseArgs.top_logprobs != null || ((_i = baseArgs.include) == null ? void 0 : _i.includes(\"message.output_text.logprobs\")))) {\n        baseArgs.top_logprobs = void 0;\n        const filteredInclude = (_j = baseArgs.include) == null ? void 0 : _j.filter(\n          (value) => value !== \"message.output_text.logprobs\"\n        );\n        baseArgs.include = filteredInclude != null && filteredInclude.length > 0 ? filteredInclude : void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"logprobs\",\n          details: \"logprobs is not supported for reasoning models\"\n        });\n      }\n    } else {\n      if ((openaiOptions == null ? void 0 : openaiOptions.reasoningEffort) != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"reasoningEffort\",\n          details: \"reasoningEffort is not supported for non-reasoning models\"\n        });\n      }\n      if ((openaiOptions == null ? void 0 : openaiOptions.reasoningSummary) != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"reasoningSummary\",\n          details: \"reasoningSummary is not supported for non-reasoning models\"\n        });\n      }\n      if ((openaiOptions == null ? void 0 : openaiOptions.reasoningMode) != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"reasoningMode\",\n          details: \"reasoningMode is not supported for non-reasoning models\"\n        });\n      }\n      if ((openaiOptions == null ? void 0 : openaiOptions.reasoningContext) != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"reasoningContext\",\n          details: \"reasoningContext is not supported for non-reasoning models\"\n        });\n      }\n    }\n    if ((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === \"flex\" && !modelCapabilities.supportsFlexProcessing) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"serviceTier\",\n        details: \"flex processing is only available for o3, o4-mini, and gpt-5 models\"\n      });\n      delete baseArgs.service_tier;\n    }\n    if (((openaiOptions == null ? void 0 : openaiOptions.serviceTier) === \"priority\" || (openaiOptions == null ? void 0 : openaiOptions.serviceTier) === \"fast\") && !modelCapabilities.supportsPriorityProcessing) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"serviceTier\",\n        details: \"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported\"\n      });\n      delete baseArgs.service_tier;\n    }\n    const shellToolEnvType = (_m = (_l = (_k = tools == null ? void 0 : tools.find(\n      (tool) => tool.type === \"provider\" && tool.id === \"openai.shell\"\n    )) == null ? void 0 : _k.args) == null ? void 0 : _l.environment) == null ? void 0 : _m.type;\n    const isShellProviderExecuted = shellToolEnvType === \"containerAuto\" || shellToolEnvType === \"containerReference\";\n    return {\n      webSearchToolName,\n      args: {\n        ...baseArgs,\n        tools: openaiTools2,\n        tool_choice: openaiToolChoice\n      },\n      warnings: [...warnings, ...toolWarnings],\n      store,\n      toolNameMapping,\n      providerOptionsName,\n      isShellProviderExecuted\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;\n    const {\n      args: body,\n      warnings,\n      webSearchToolName,\n      toolNameMapping,\n      providerOptionsName,\n      isShellProviderExecuted\n    } = await this.getArgs(options);\n    const url = this.config.url({\n      path: \"/responses\",\n      modelId: this.modelId\n    });\n    const approvalRequestIdToDummyToolCallIdFromPrompt = extractApprovalRequestIdToToolCallIdMapping(options.prompt);\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi5({\n      url,\n      headers: combineHeaders5(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler5(\n        openaiResponsesResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    if (response.error) {\n      throw new APICallError2({\n        message: response.error.message,\n        url,\n        requestBodyValues: body,\n        statusCode: 400,\n        responseHeaders,\n        responseBody: rawResponse,\n        isRetryable: false\n      });\n    }\n    const content = [];\n    const logprobs = [];\n    const functionTools = (_b = (_a2 = options.tools) == null ? void 0 : _a2.filter(\n      (tool) => tool.type === \"function\"\n    )) != null ? _b : [];\n    let hasFunctionCall = false;\n    const hostedToolSearchCallIds = [];\n    for (const part of response.output) {\n      switch (part.type) {\n        case \"reasoning\": {\n          if (part.summary.length === 0) {\n            part.summary.push({ type: \"summary_text\", text: \"\" });\n          }\n          for (const summary of part.summary) {\n            content.push({\n              type: \"reasoning\",\n              text: summary.text,\n              providerMetadata: {\n                [providerOptionsName]: {\n                  itemId: part.id,\n                  reasoningEncryptedContent: (_c = part.encrypted_content) != null ? _c : null\n                }\n              }\n            });\n          }\n          break;\n        }\n        case \"image_generation_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"image_generation\"),\n            input: \"{}\",\n            providerExecuted: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"image_generation\"),\n            result: {\n              result: part.result\n            }\n          });\n          break;\n        }\n        case \"tool_search_call\": {\n          const toolCallId = (_d = part.call_id) != null ? _d : part.id;\n          const isHosted = part.execution === \"server\";\n          if (isHosted) {\n            hostedToolSearchCallIds.push(toolCallId);\n          }\n          content.push({\n            type: \"tool-call\",\n            toolCallId,\n            toolName: toolNameMapping.toCustomToolName(\"tool_search\"),\n            input: JSON.stringify({\n              arguments: part.arguments,\n              call_id: part.call_id\n            }),\n            ...isHosted ? { providerExecuted: true } : {},\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n        case \"tool_search_output\": {\n          const toolCallId = (_f = (_e = part.call_id) != null ? _e : hostedToolSearchCallIds.shift()) != null ? _f : part.id;\n          content.push({\n            type: \"tool-result\",\n            toolCallId,\n            toolName: toolNameMapping.toCustomToolName(\"tool_search\"),\n            result: {\n              tools: part.tools\n            },\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n        case \"local_shell_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.call_id,\n            toolName: toolNameMapping.toCustomToolName(\"local_shell\"),\n            input: JSON.stringify({\n              action: part.action\n            }),\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n        case \"shell_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.call_id,\n            toolName: toolNameMapping.toCustomToolName(\"shell\"),\n            input: JSON.stringify({\n              action: {\n                commands: part.action.commands\n              }\n            }),\n            ...isShellProviderExecuted && { providerExecuted: true },\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n        case \"shell_call_output\": {\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.call_id,\n            toolName: toolNameMapping.toCustomToolName(\"shell\"),\n            result: {\n              output: part.output.map((item) => ({\n                stdout: item.stdout,\n                stderr: item.stderr,\n                outcome: item.outcome.type === \"exit\" ? {\n                  type: \"exit\",\n                  exitCode: item.outcome.exit_code\n                } : { type: \"timeout\" }\n              }))\n            }\n          });\n          break;\n        }\n        case \"message\": {\n          for (const contentPart of part.content) {\n            if (((_h = (_g = options.providerOptions) == null ? void 0 : _g[providerOptionsName]) == null ? void 0 : _h.logprobs) && contentPart.logprobs) {\n              logprobs.push(contentPart.logprobs);\n            }\n            const providerMetadata2 = {\n              itemId: part.id,\n              ...part.phase != null && { phase: part.phase },\n              ...contentPart.annotations.length > 0 && {\n                annotations: contentPart.annotations\n              }\n            };\n            content.push({\n              type: \"text\",\n              text: contentPart.text,\n              providerMetadata: {\n                [providerOptionsName]: providerMetadata2\n              }\n            });\n            for (const annotation of contentPart.annotations) {\n              if (annotation.type === \"url_citation\") {\n                content.push({\n                  type: \"source\",\n                  sourceType: \"url\",\n                  id: (_k = (_j = (_i = this.config).generateId) == null ? void 0 : _j.call(_i)) != null ? _k : generateId2(),\n                  url: annotation.url,\n                  title: annotation.title\n                });\n              } else if (annotation.type === \"file_citation\") {\n                content.push({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_n = (_m = (_l = this.config).generateId) == null ? void 0 : _m.call(_l)) != null ? _n : generateId2(),\n                  mediaType: \"text/plain\",\n                  title: annotation.filename,\n                  filename: annotation.filename,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: annotation.type,\n                      fileId: annotation.file_id,\n                      index: annotation.index\n                    }\n                  }\n                });\n              } else if (annotation.type === \"container_file_citation\") {\n                content.push({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_q = (_p = (_o = this.config).generateId) == null ? void 0 : _p.call(_o)) != null ? _q : generateId2(),\n                  mediaType: \"text/plain\",\n                  title: annotation.filename,\n                  filename: annotation.filename,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: annotation.type,\n                      fileId: annotation.file_id,\n                      containerId: annotation.container_id\n                    }\n                  }\n                });\n              } else if (annotation.type === \"file_path\") {\n                content.push({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_t = (_s = (_r = this.config).generateId) == null ? void 0 : _s.call(_r)) != null ? _t : generateId2(),\n                  mediaType: \"application/octet-stream\",\n                  title: annotation.file_id,\n                  filename: annotation.file_id,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: annotation.type,\n                      fileId: annotation.file_id,\n                      index: annotation.index\n                    }\n                  }\n                });\n              }\n            }\n          }\n          break;\n        }\n        case \"function_call\": {\n          hasFunctionCall = true;\n          const expandedToolCalls = await expandParallelToolCall({\n            toolCall: {\n              toolCallId: part.call_id,\n              toolName: part.name,\n              input: part.arguments\n            },\n            tools: functionTools,\n            providerOptionsName,\n            itemId: part.id\n          });\n          if (expandedToolCalls != null) {\n            content.push(...expandedToolCalls);\n            break;\n          }\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.call_id,\n            toolName: part.name,\n            input: part.arguments,\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id,\n                ...part.async != null && { async: part.async },\n                ...part.namespace != null && { namespace: part.namespace }\n              }\n            }\n          });\n          break;\n        }\n        case \"custom_tool_call\": {\n          hasFunctionCall = true;\n          const toolName = toolNameMapping.toCustomToolName(part.name);\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.call_id,\n            toolName,\n            input: JSON.stringify(part.input),\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id,\n                ...part.async != null && { async: part.async }\n              }\n            }\n          });\n          break;\n        }\n        case \"web_search_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\n              webSearchToolName != null ? webSearchToolName : \"web_search\"\n            ),\n            input: JSON.stringify({}),\n            providerExecuted: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\n              webSearchToolName != null ? webSearchToolName : \"web_search\"\n            ),\n            ...mapWebSearchResult(part)\n          });\n          break;\n        }\n        case \"mcp_call\": {\n          const toolCallId = part.approval_request_id != null ? (_u = approvalRequestIdToDummyToolCallIdFromPrompt[part.approval_request_id]) != null ? _u : part.id : part.id;\n          const toolName = `mcp.${part.name}`;\n          content.push({\n            type: \"tool-call\",\n            toolCallId,\n            toolName,\n            input: part.arguments,\n            providerExecuted: true,\n            dynamic: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId,\n            toolName,\n            result: {\n              type: \"call\",\n              serverLabel: part.server_label,\n              name: part.name,\n              arguments: part.arguments,\n              ...part.output != null ? { output: part.output } : {},\n              ...part.error != null ? { error: part.error } : {}\n            },\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n        case \"mcp_list_tools\": {\n          break;\n        }\n        case \"mcp_approval_request\": {\n          const approvalRequestId = (_v = part.approval_request_id) != null ? _v : part.id;\n          const dummyToolCallId = (_y = (_x = (_w = this.config).generateId) == null ? void 0 : _x.call(_w)) != null ? _y : generateId2();\n          const toolName = `mcp.${part.name}`;\n          content.push({\n            type: \"tool-call\",\n            toolCallId: dummyToolCallId,\n            toolName,\n            input: part.arguments,\n            providerExecuted: true,\n            dynamic: true\n          });\n          content.push({\n            type: \"tool-approval-request\",\n            approvalId: approvalRequestId,\n            toolCallId: dummyToolCallId\n          });\n          break;\n        }\n        case \"computer_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n            input: \"\",\n            providerExecuted: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n            result: {\n              type: \"computer_use_tool_result\",\n              status: part.status || \"completed\"\n            }\n          });\n          break;\n        }\n        case \"file_search_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"file_search\"),\n            input: \"{}\",\n            providerExecuted: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"file_search\"),\n            result: {\n              queries: part.queries,\n              results: (_A = (_z = part.results) == null ? void 0 : _z.map((result) => ({\n                attributes: result.attributes,\n                fileId: result.file_id,\n                filename: result.filename,\n                score: result.score,\n                text: result.text\n              }))) != null ? _A : null\n            }\n          });\n          break;\n        }\n        case \"code_interpreter_call\": {\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n            input: JSON.stringify({\n              code: part.code,\n              containerId: part.container_id\n            }),\n            providerExecuted: true\n          });\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.id,\n            toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n            result: {\n              outputs: part.outputs\n            }\n          });\n          break;\n        }\n        case \"apply_patch_call\": {\n          hasFunctionCall = true;\n          content.push({\n            type: \"tool-call\",\n            toolCallId: part.call_id,\n            toolName: toolNameMapping.toCustomToolName(\"apply_patch\"),\n            input: JSON.stringify({\n              callId: part.call_id,\n              operation: part.operation\n            }),\n            providerMetadata: {\n              [providerOptionsName]: {\n                itemId: part.id\n              }\n            }\n          });\n          break;\n        }\n      }\n    }\n    const providerMetadata = {\n      [providerOptionsName]: {\n        responseId: response.id,\n        ...logprobs.length > 0 ? { logprobs } : {},\n        ...typeof response.service_tier === \"string\" ? { serviceTier: response.service_tier } : {},\n        ...((_B = response.reasoning) == null ? void 0 : _B.context) != null ? { reasoningContext: response.reasoning.context } : {}\n      }\n    };\n    const usage = response.usage;\n    return {\n      content,\n      finishReason: {\n        unified: mapOpenAIResponseFinishReason({\n          finishReason: (_C = response.incomplete_details) == null ? void 0 : _C.reason,\n          hasFunctionCall\n        }),\n        raw: (_E = (_D = response.incomplete_details) == null ? void 0 : _D.reason) != null ? _E : void 0\n      },\n      usage: convertOpenAIResponsesUsage(usage),\n      request: { body },\n      response: {\n        id: response.id,\n        timestamp: new Date(response.created_at * 1e3),\n        modelId: response.model,\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      providerMetadata,\n      warnings\n    };\n  }\n  async doStream(options) {\n    var _a2, _b;\n    const {\n      args: body,\n      warnings,\n      webSearchToolName,\n      toolNameMapping,\n      store,\n      providerOptionsName,\n      isShellProviderExecuted\n    } = await this.getArgs(options);\n    const url = this.config.url({\n      path: \"/responses\",\n      modelId: this.modelId\n    });\n    const { responseHeaders, value: response } = await postJsonToApi5({\n      url,\n      headers: combineHeaders5(this.config.headers(), options.headers),\n      body: {\n        ...body,\n        stream: true\n      },\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler3(\n        openaiResponsesChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const checkedResponse = await throwIfOpenAIStreamErrorBeforeOutput({\n      stream: response,\n      getError: (chunk) => isErrorChunk(chunk) || isResponseFailedChunk(chunk) && chunk.response.error != null ? chunk : void 0,\n      isOutputChunk: isResponseOutputChunk,\n      url,\n      requestBodyValues: body,\n      responseHeaders\n    });\n    const self = this;\n    const approvalRequestIdToDummyToolCallIdFromPrompt = extractApprovalRequestIdToToolCallIdMapping(options.prompt);\n    const functionTools = (_b = (_a2 = options.tools) == null ? void 0 : _a2.filter(\n      (tool) => tool.type === \"function\"\n    )) != null ? _b : [];\n    const approvalRequestIdToDummyToolCallIdFromStream = /* @__PURE__ */ new Map();\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage = void 0;\n    const logprobs = [];\n    let responseId = null;\n    const ongoingToolCalls = {};\n    const ongoingAnnotations = [];\n    let activeMessagePhase;\n    let hasFunctionCall = false;\n    const activeReasoning = {};\n    let serviceTier;\n    let reasoningContext;\n    const hostedToolSearchCallIds = [];\n    let encounteredStreamError = false;\n    const result = {\n      stream: checkedResponse.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              const error = isOpenAIChatCompletionChunk(chunk.rawValue) ? createOpenAIResponsesChatCompletionsMismatchError({\n                value: chunk.rawValue,\n                cause: chunk.error,\n                url,\n                requestBodyValues: body,\n                responseHeaders\n              }) : chunk.error;\n              encounteredStreamError = true;\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error });\n              return;\n            }\n            const value = chunk.value;\n            if (isResponseOutputItemAddedChunk(value)) {\n              if (value.item.type === \"function_call\") {\n                const suppressInputStreaming = isUndeclaredParallelToolCall({\n                  toolName: value.item.name,\n                  tools: functionTools\n                });\n                ongoingToolCalls[value.output_index] = {\n                  toolName: value.item.name,\n                  toolCallId: value.item.call_id,\n                  suppressInputStreaming,\n                  bufferedInputDeltas: suppressInputStreaming ? [] : void 0,\n                  async: value.item.async\n                };\n                if (!suppressInputStreaming) {\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id: value.item.call_id,\n                    toolName: value.item.name\n                  });\n                }\n              } else if (value.item.type === \"custom_tool_call\") {\n                const toolName = toolNameMapping.toCustomToolName(\n                  value.item.name\n                );\n                ongoingToolCalls[value.output_index] = {\n                  toolName,\n                  toolCallId: value.item.call_id,\n                  async: value.item.async\n                };\n                controller.enqueue({\n                  type: \"tool-input-start\",\n                  id: value.item.call_id,\n                  toolName,\n                  inputEncoding: \"text\"\n                });\n              } else if (value.item.type === \"web_search_call\") {\n                ongoingToolCalls[value.output_index] = {\n                  toolName: toolNameMapping.toCustomToolName(\n                    webSearchToolName != null ? webSearchToolName : \"web_search\"\n                  ),\n                  toolCallId: value.item.id\n                };\n                controller.enqueue({\n                  type: \"tool-input-start\",\n                  id: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\n                    webSearchToolName != null ? webSearchToolName : \"web_search\"\n                  ),\n                  providerExecuted: true\n                });\n                controller.enqueue({\n                  type: \"tool-input-end\",\n                  id: value.item.id\n                });\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\n                    webSearchToolName != null ? webSearchToolName : \"web_search\"\n                  ),\n                  input: JSON.stringify({}),\n                  providerExecuted: true\n                });\n              } else if (value.item.type === \"computer_call\") {\n                ongoingToolCalls[value.output_index] = {\n                  toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n                  toolCallId: value.item.id\n                };\n                controller.enqueue({\n                  type: \"tool-input-start\",\n                  id: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n                  providerExecuted: true\n                });\n              } else if (value.item.type === \"code_interpreter_call\") {\n                ongoingToolCalls[value.output_index] = {\n                  toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n                  toolCallId: value.item.id,\n                  codeInterpreter: {\n                    containerId: value.item.container_id\n                  }\n                };\n                controller.enqueue({\n                  type: \"tool-input-start\",\n                  id: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n                  providerExecuted: true\n                });\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: value.item.id,\n                  delta: `{\"containerId\":\"${value.item.container_id}\",\"code\":\"`\n                });\n              } else if (value.item.type === \"file_search_call\") {\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"file_search\"),\n                  input: \"{}\",\n                  providerExecuted: true\n                });\n              } else if (value.item.type === \"image_generation_call\") {\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"image_generation\"),\n                  input: \"{}\",\n                  providerExecuted: true\n                });\n              } else if (value.item.type === \"tool_search_call\") {\n                const toolCallId = value.item.id;\n                const toolName = toolNameMapping.toCustomToolName(\"tool_search\");\n                const isHosted = value.item.execution === \"server\";\n                ongoingToolCalls[value.output_index] = {\n                  toolName,\n                  toolCallId,\n                  toolSearchExecution: (_a3 = value.item.execution) != null ? _a3 : \"server\"\n                };\n                if (isHosted) {\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id: toolCallId,\n                    toolName,\n                    providerExecuted: true\n                  });\n                }\n              } else if (value.item.type === \"tool_search_output\") {\n              } else if (value.item.type === \"mcp_call\" || value.item.type === \"mcp_list_tools\" || value.item.type === \"mcp_approval_request\") {\n              } else if (value.item.type === \"apply_patch_call\") {\n                const { call_id: callId, operation } = value.item;\n                ongoingToolCalls[value.output_index] = {\n                  toolName: toolNameMapping.toCustomToolName(\"apply_patch\"),\n                  toolCallId: callId,\n                  applyPatch: {\n                    // delete_file doesn't have diff\n                    hasDiff: operation.type === \"delete_file\",\n                    endEmitted: operation.type === \"delete_file\"\n                  }\n                };\n                controller.enqueue({\n                  type: \"tool-input-start\",\n                  id: callId,\n                  toolName: toolNameMapping.toCustomToolName(\"apply_patch\")\n                });\n                if (operation.type === \"delete_file\") {\n                  const inputString = JSON.stringify({\n                    callId,\n                    operation\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: callId,\n                    delta: inputString\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: callId\n                  });\n                } else {\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: callId,\n                    delta: `{\"callId\":\"${escapeJSONDelta(callId)}\",\"operation\":{\"type\":\"${escapeJSONDelta(operation.type)}\",\"path\":\"${escapeJSONDelta(operation.path)}\",\"diff\":\"`\n                  });\n                }\n              } else if (value.item.type === \"shell_call\") {\n                ongoingToolCalls[value.output_index] = {\n                  toolName: toolNameMapping.toCustomToolName(\"shell\"),\n                  toolCallId: value.item.call_id\n                };\n              } else if (value.item.type === \"shell_call_output\") {\n              } else if (value.item.type === \"message\") {\n                ongoingAnnotations.splice(0);\n                activeMessagePhase = (_b2 = value.item.phase) != null ? _b2 : void 0;\n                controller.enqueue({\n                  type: \"text-start\",\n                  id: value.item.id,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id,\n                      ...value.item.phase != null && {\n                        phase: value.item.phase\n                      }\n                    }\n                  }\n                });\n              } else if (isResponseOutputItemAddedChunk(value) && value.item.type === \"reasoning\") {\n                activeReasoning[value.item.id] = {\n                  encryptedContent: value.item.encrypted_content,\n                  summaryParts: { 0: \"active\" }\n                };\n                controller.enqueue({\n                  type: \"reasoning-start\",\n                  id: `${value.item.id}:0`,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id,\n                      reasoningEncryptedContent: (_c = value.item.encrypted_content) != null ? _c : null\n                    }\n                  }\n                });\n              }\n            } else if (isResponseOutputItemDoneChunk(value)) {\n              if (value.item.type === \"message\") {\n                const phase = (_d = value.item.phase) != null ? _d : activeMessagePhase;\n                activeMessagePhase = void 0;\n                controller.enqueue({\n                  type: \"text-end\",\n                  id: value.item.id,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id,\n                      ...phase != null && { phase },\n                      ...ongoingAnnotations.length > 0 && {\n                        annotations: ongoingAnnotations\n                      }\n                    }\n                  }\n                });\n              } else if (value.item.type === \"function_call\") {\n                const item = value.item;\n                const ongoingToolCall = ongoingToolCalls[value.output_index];\n                ongoingToolCalls[value.output_index] = void 0;\n                hasFunctionCall = true;\n                const suppressInputStreaming = (_e = ongoingToolCall == null ? void 0 : ongoingToolCall.suppressInputStreaming) != null ? _e : isUndeclaredParallelToolCall({\n                  toolName: item.name,\n                  tools: functionTools\n                });\n                const enqueueUnexpandedToolCall = () => {\n                  var _a4;\n                  if (suppressInputStreaming) {\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: item.call_id,\n                      toolName: item.name\n                    });\n                    const bufferedInputDeltas = (_a4 = ongoingToolCall == null ? void 0 : ongoingToolCall.bufferedInputDeltas) != null ? _a4 : [];\n                    if (bufferedInputDeltas.length > 0) {\n                      for (const delta of bufferedInputDeltas) {\n                        controller.enqueue({\n                          type: \"tool-input-delta\",\n                          id: item.call_id,\n                          delta\n                        });\n                      }\n                    } else if (item.arguments.length > 0) {\n                      controller.enqueue({\n                        type: \"tool-input-delta\",\n                        id: item.call_id,\n                        delta: item.arguments\n                      });\n                    }\n                  }\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: item.call_id,\n                    ...item.namespace != null && {\n                      providerMetadata: {\n                        [providerOptionsName]: {\n                          namespace: item.namespace\n                        }\n                      }\n                    }\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId: item.call_id,\n                    toolName: item.name,\n                    input: item.arguments,\n                    providerMetadata: {\n                      [providerOptionsName]: {\n                        itemId: item.id,\n                        ...item.async != null ? { async: item.async } : (ongoingToolCall == null ? void 0 : ongoingToolCall.async) != null ? { async: ongoingToolCall.async } : {},\n                        ...item.namespace != null && {\n                          namespace: item.namespace\n                        }\n                      }\n                    }\n                  });\n                };\n                if (!suppressInputStreaming) {\n                  enqueueUnexpandedToolCall();\n                  return;\n                }\n                return expandParallelToolCall({\n                  toolCall: {\n                    toolCallId: item.call_id,\n                    toolName: item.name,\n                    input: item.arguments\n                  },\n                  tools: functionTools,\n                  providerOptionsName,\n                  itemId: item.id\n                }).then((expandedToolCalls) => {\n                  if (expandedToolCalls == null) {\n                    enqueueUnexpandedToolCall();\n                    return;\n                  }\n                  for (const toolCall of expandedToolCalls) {\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: toolCall.toolCallId,\n                      toolName: toolCall.toolName\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: toolCall.toolCallId,\n                      delta: toolCall.input\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-end\",\n                      id: toolCall.toolCallId\n                    });\n                    controller.enqueue(toolCall);\n                  }\n                });\n              } else if (value.item.type === \"custom_tool_call\") {\n                const ongoingToolCall = ongoingToolCalls[value.output_index];\n                ongoingToolCalls[value.output_index] = void 0;\n                hasFunctionCall = true;\n                const toolName = toolNameMapping.toCustomToolName(\n                  value.item.name\n                );\n                controller.enqueue({\n                  type: \"tool-input-end\",\n                  id: value.item.call_id\n                });\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.call_id,\n                  toolName,\n                  input: JSON.stringify(value.item.input),\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id,\n                      ...value.item.async != null ? { async: value.item.async } : (ongoingToolCall == null ? void 0 : ongoingToolCall.async) != null ? { async: ongoingToolCall.async } : {}\n                    }\n                  }\n                });\n              } else if (value.item.type === \"web_search_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\n                    webSearchToolName != null ? webSearchToolName : \"web_search\"\n                  ),\n                  ...mapWebSearchResult(value.item)\n                });\n              } else if (value.item.type === \"computer_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-input-end\",\n                  id: value.item.id\n                });\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n                  input: \"\",\n                  providerExecuted: true\n                });\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"computer_use\"),\n                  result: {\n                    type: \"computer_use_tool_result\",\n                    status: value.item.status || \"completed\"\n                  }\n                });\n              } else if (value.item.type === \"file_search_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"file_search\"),\n                  result: {\n                    queries: value.item.queries,\n                    results: (_g = (_f = value.item.results) == null ? void 0 : _f.map((result2) => ({\n                      attributes: result2.attributes,\n                      fileId: result2.file_id,\n                      filename: result2.filename,\n                      score: result2.score,\n                      text: result2.text\n                    }))) != null ? _g : null\n                  }\n                });\n              } else if (value.item.type === \"code_interpreter_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n                  result: {\n                    outputs: value.item.outputs\n                  }\n                });\n              } else if (value.item.type === \"image_generation_call\") {\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.id,\n                  toolName: toolNameMapping.toCustomToolName(\"image_generation\"),\n                  result: {\n                    result: value.item.result\n                  }\n                });\n              } else if (value.item.type === \"tool_search_call\") {\n                const toolCall = ongoingToolCalls[value.output_index];\n                const isHosted = value.item.execution === \"server\";\n                if (toolCall != null) {\n                  const toolCallId = isHosted ? toolCall.toolCallId : (_h = value.item.call_id) != null ? _h : value.item.id;\n                  if (isHosted) {\n                    hostedToolSearchCallIds.push(toolCallId);\n                  } else {\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: toolCallId,\n                      toolName: toolCall.toolName\n                    });\n                  }\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCallId\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId,\n                    toolName: toolCall.toolName,\n                    input: JSON.stringify({\n                      arguments: value.item.arguments,\n                      call_id: isHosted ? null : toolCallId\n                    }),\n                    ...isHosted ? { providerExecuted: true } : {},\n                    providerMetadata: {\n                      [providerOptionsName]: {\n                        itemId: value.item.id\n                      }\n                    }\n                  });\n                }\n                ongoingToolCalls[value.output_index] = void 0;\n              } else if (value.item.type === \"tool_search_output\") {\n                const toolCallId = (_j = (_i = value.item.call_id) != null ? _i : hostedToolSearchCallIds.shift()) != null ? _j : value.item.id;\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId,\n                  toolName: toolNameMapping.toCustomToolName(\"tool_search\"),\n                  result: {\n                    tools: value.item.tools\n                  },\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id\n                    }\n                  }\n                });\n              } else if (value.item.type === \"mcp_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                const approvalRequestId = (_k = value.item.approval_request_id) != null ? _k : void 0;\n                const aliasedToolCallId = approvalRequestId != null ? (_m = (_l = approvalRequestIdToDummyToolCallIdFromStream.get(\n                  approvalRequestId\n                )) != null ? _l : approvalRequestIdToDummyToolCallIdFromPrompt[approvalRequestId]) != null ? _m : value.item.id : value.item.id;\n                const toolName = `mcp.${value.item.name}`;\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: aliasedToolCallId,\n                  toolName,\n                  input: value.item.arguments,\n                  providerExecuted: true,\n                  dynamic: true\n                });\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: aliasedToolCallId,\n                  toolName,\n                  result: {\n                    type: \"call\",\n                    serverLabel: value.item.server_label,\n                    name: value.item.name,\n                    arguments: value.item.arguments,\n                    ...value.item.output != null ? { output: value.item.output } : {},\n                    ...value.item.error != null ? { error: value.item.error } : {}\n                  },\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item.id\n                    }\n                  }\n                });\n              } else if (value.item.type === \"mcp_list_tools\") {\n                ongoingToolCalls[value.output_index] = void 0;\n              } else if (value.item.type === \"apply_patch_call\") {\n                const toolCall = ongoingToolCalls[value.output_index];\n                if ((toolCall == null ? void 0 : toolCall.applyPatch) && !toolCall.applyPatch.endEmitted && value.item.operation.type !== \"delete_file\") {\n                  if (!toolCall.applyPatch.hasDiff) {\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: toolCall.toolCallId,\n                      delta: escapeJSONDelta(value.item.operation.diff)\n                    });\n                  }\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: toolCall.toolCallId,\n                    delta: '\"}}'\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCall.toolCallId\n                  });\n                  toolCall.applyPatch.endEmitted = true;\n                }\n                if (toolCall && value.item.status === \"completed\") {\n                  hasFunctionCall = true;\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId: toolCall.toolCallId,\n                    toolName: toolNameMapping.toCustomToolName(\"apply_patch\"),\n                    input: JSON.stringify({\n                      callId: value.item.call_id,\n                      operation: value.item.operation\n                    }),\n                    providerMetadata: {\n                      [providerOptionsName]: {\n                        itemId: value.item.id\n                      }\n                    }\n                  });\n                }\n                ongoingToolCalls[value.output_index] = void 0;\n              } else if (value.item.type === \"mcp_approval_request\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                const dummyToolCallId = (_p = (_o = (_n = self.config).generateId) == null ? void 0 : _o.call(_n)) != null ? _p : generateId2();\n                const approvalRequestId = (_q = value.item.approval_request_id) != null ? _q : value.item.id;\n                approvalRequestIdToDummyToolCallIdFromStream.set(\n                  approvalRequestId,\n                  dummyToolCallId\n                );\n                const toolName = `mcp.${value.item.name}`;\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: dummyToolCallId,\n                  toolName,\n                  input: value.item.arguments,\n                  providerExecuted: true,\n                  dynamic: true\n                });\n                controller.enqueue({\n                  type: \"tool-approval-request\",\n                  approvalId: approvalRequestId,\n                  toolCallId: dummyToolCallId\n                });\n              } else if (value.item.type === \"local_shell_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.call_id,\n                  toolName: toolNameMapping.toCustomToolName(\"local_shell\"),\n                  input: JSON.stringify({\n                    action: {\n                      type: \"exec\",\n                      command: value.item.action.command,\n                      timeoutMs: value.item.action.timeout_ms,\n                      user: value.item.action.user,\n                      workingDirectory: value.item.action.working_directory,\n                      env: value.item.action.env\n                    }\n                  }),\n                  providerMetadata: {\n                    [providerOptionsName]: { itemId: value.item.id }\n                  }\n                });\n              } else if (value.item.type === \"shell_call\") {\n                ongoingToolCalls[value.output_index] = void 0;\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: value.item.call_id,\n                  toolName: toolNameMapping.toCustomToolName(\"shell\"),\n                  input: JSON.stringify({\n                    action: {\n                      commands: value.item.action.commands\n                    }\n                  }),\n                  ...isShellProviderExecuted && {\n                    providerExecuted: true\n                  },\n                  providerMetadata: {\n                    [providerOptionsName]: { itemId: value.item.id }\n                  }\n                });\n              } else if (value.item.type === \"shell_call_output\") {\n                controller.enqueue({\n                  type: \"tool-result\",\n                  toolCallId: value.item.call_id,\n                  toolName: toolNameMapping.toCustomToolName(\"shell\"),\n                  result: {\n                    output: value.item.output.map(\n                      (item) => ({\n                        stdout: item.stdout,\n                        stderr: item.stderr,\n                        outcome: item.outcome.type === \"exit\" ? {\n                          type: \"exit\",\n                          exitCode: item.outcome.exit_code\n                        } : { type: \"timeout\" }\n                      })\n                    )\n                  }\n                });\n              } else if (value.item.type === \"reasoning\") {\n                const activeReasoningPart = activeReasoning[value.item.id];\n                const summaryPartIndices = Object.entries(\n                  activeReasoningPart.summaryParts\n                ).filter(\n                  ([_, status]) => status === \"active\" || status === \"can-conclude\"\n                ).map(([summaryIndex]) => summaryIndex);\n                for (const summaryIndex of summaryPartIndices) {\n                  controller.enqueue({\n                    type: \"reasoning-end\",\n                    id: `${value.item.id}:${summaryIndex}`,\n                    providerMetadata: {\n                      [providerOptionsName]: {\n                        itemId: value.item.id,\n                        reasoningEncryptedContent: (_r = value.item.encrypted_content) != null ? _r : null\n                      }\n                    }\n                  });\n                }\n                delete activeReasoning[value.item.id];\n              }\n            } else if (isResponseFunctionCallArgumentsDeltaChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if (toolCall != null) {\n                if (toolCall.suppressInputStreaming) {\n                  (_s = toolCall.bufferedInputDeltas) == null ? void 0 : _s.push(value.delta);\n                } else {\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: toolCall.toolCallId,\n                    delta: value.delta\n                  });\n                }\n              }\n            } else if (isResponseCustomToolCallInputDeltaChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if (toolCall != null) {\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta: value.delta\n                });\n              }\n            } else if (isResponseApplyPatchCallOperationDiffDeltaChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if (toolCall == null ? void 0 : toolCall.applyPatch) {\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta: escapeJSONDelta(value.delta)\n                });\n                toolCall.applyPatch.hasDiff = true;\n              }\n            } else if (isResponseApplyPatchCallOperationDiffDoneChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if ((toolCall == null ? void 0 : toolCall.applyPatch) && !toolCall.applyPatch.endEmitted) {\n                if (!toolCall.applyPatch.hasDiff) {\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: toolCall.toolCallId,\n                    delta: escapeJSONDelta(value.diff)\n                  });\n                  toolCall.applyPatch.hasDiff = true;\n                }\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta: '\"}}'\n                });\n                controller.enqueue({\n                  type: \"tool-input-end\",\n                  id: toolCall.toolCallId\n                });\n                toolCall.applyPatch.endEmitted = true;\n              }\n            } else if (isResponseImageGenerationCallPartialImageChunk(value)) {\n              controller.enqueue({\n                type: \"tool-result\",\n                toolCallId: value.item_id,\n                toolName: toolNameMapping.toCustomToolName(\"image_generation\"),\n                result: {\n                  result: value.partial_image_b64\n                },\n                preliminary: true\n              });\n            } else if (isResponseCodeInterpreterCallCodeDeltaChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if (toolCall != null) {\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta: escapeJSONDelta(value.delta)\n                });\n              }\n            } else if (isResponseCodeInterpreterCallCodeDoneChunk(value)) {\n              const toolCall = ongoingToolCalls[value.output_index];\n              if (toolCall != null) {\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta: '\"}'\n                });\n                controller.enqueue({\n                  type: \"tool-input-end\",\n                  id: toolCall.toolCallId\n                });\n                controller.enqueue({\n                  type: \"tool-call\",\n                  toolCallId: toolCall.toolCallId,\n                  toolName: toolNameMapping.toCustomToolName(\"code_interpreter\"),\n                  input: JSON.stringify({\n                    code: value.code,\n                    containerId: toolCall.codeInterpreter.containerId\n                  }),\n                  providerExecuted: true\n                });\n              }\n            } else if (isResponseCreatedChunk(value)) {\n              responseId = value.response.id;\n              controller.enqueue({\n                type: \"response-metadata\",\n                id: value.response.id,\n                timestamp: new Date(value.response.created_at * 1e3),\n                modelId: value.response.model\n              });\n            } else if (isTextDeltaChunk(value)) {\n              controller.enqueue({\n                type: \"text-delta\",\n                id: value.item_id,\n                delta: value.delta\n              });\n              if (((_u = (_t = options.providerOptions) == null ? void 0 : _t[providerOptionsName]) == null ? void 0 : _u.logprobs) && value.logprobs) {\n                logprobs.push(value.logprobs);\n              }\n            } else if (value.type === \"response.reasoning_summary_part.added\") {\n              if (value.summary_index > 0) {\n                const activeReasoningPart = activeReasoning[value.item_id];\n                activeReasoningPart.summaryParts[value.summary_index] = \"active\";\n                for (const summaryIndex of Object.keys(\n                  activeReasoningPart.summaryParts\n                )) {\n                  if (activeReasoningPart.summaryParts[summaryIndex] === \"can-conclude\") {\n                    controller.enqueue({\n                      type: \"reasoning-end\",\n                      id: `${value.item_id}:${summaryIndex}`,\n                      providerMetadata: {\n                        [providerOptionsName]: {\n                          itemId: value.item_id\n                        }\n                      }\n                    });\n                    activeReasoningPart.summaryParts[summaryIndex] = \"concluded\";\n                  }\n                }\n                controller.enqueue({\n                  type: \"reasoning-start\",\n                  id: `${value.item_id}:${value.summary_index}`,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item_id,\n                      reasoningEncryptedContent: (_w = (_v = activeReasoning[value.item_id]) == null ? void 0 : _v.encryptedContent) != null ? _w : null\n                    }\n                  }\n                });\n              }\n            } else if (value.type === \"response.reasoning_summary_text.delta\") {\n              controller.enqueue({\n                type: \"reasoning-delta\",\n                id: `${value.item_id}:${value.summary_index}`,\n                delta: value.delta,\n                providerMetadata: {\n                  [providerOptionsName]: {\n                    itemId: value.item_id\n                  }\n                }\n              });\n            } else if (value.type === \"response.reasoning_summary_part.done\") {\n              if (store) {\n                controller.enqueue({\n                  type: \"reasoning-end\",\n                  id: `${value.item_id}:${value.summary_index}`,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      itemId: value.item_id\n                    }\n                  }\n                });\n                activeReasoning[value.item_id].summaryParts[value.summary_index] = \"concluded\";\n              } else {\n                activeReasoning[value.item_id].summaryParts[value.summary_index] = \"can-conclude\";\n              }\n            } else if (isResponseFinishedChunk(value)) {\n              if (!encounteredStreamError) {\n                finishReason = {\n                  unified: mapOpenAIResponseFinishReason({\n                    finishReason: (_x = value.response.incomplete_details) == null ? void 0 : _x.reason,\n                    hasFunctionCall\n                  }),\n                  raw: (_z = (_y = value.response.incomplete_details) == null ? void 0 : _y.reason) != null ? _z : void 0\n                };\n              }\n              usage = (_A = value.response.usage) != null ? _A : void 0;\n              if (typeof value.response.service_tier === \"string\") {\n                serviceTier = value.response.service_tier;\n              }\n              if (((_B = value.response.reasoning) == null ? void 0 : _B.context) != null) {\n                reasoningContext = value.response.reasoning.context;\n              }\n            } else if (isResponseFailedChunk(value)) {\n              const incompleteReason = (_C = value.response.incomplete_details) == null ? void 0 : _C.reason;\n              finishReason = {\n                unified: incompleteReason ? mapOpenAIResponseFinishReason({\n                  finishReason: incompleteReason,\n                  hasFunctionCall\n                }) : \"error\",\n                raw: incompleteReason != null ? incompleteReason : \"error\"\n              };\n              usage = (_D = value.response.usage) != null ? _D : void 0;\n              if (((_E = value.response.reasoning) == null ? void 0 : _E.context) != null) {\n                reasoningContext = value.response.reasoning.context;\n              }\n              if (!encounteredStreamError && value.response.error != null) {\n                encounteredStreamError = true;\n                const error = {\n                  type: \"response.failed\",\n                  sequence_number: value.sequence_number,\n                  response: {\n                    error: value.response.error,\n                    incomplete_details: value.response.incomplete_details,\n                    service_tier: value.response.service_tier\n                  }\n                };\n                controller.enqueue({\n                  type: \"error\",\n                  error: (_F = createOpenAIProviderStreamError(error)) != null ? _F : error\n                });\n              }\n            } else if (isResponseAnnotationAddedChunk(value)) {\n              ongoingAnnotations.push(value.annotation);\n              if (value.annotation.type === \"url_citation\") {\n                controller.enqueue({\n                  type: \"source\",\n                  sourceType: \"url\",\n                  id: (_I = (_H = (_G = self.config).generateId) == null ? void 0 : _H.call(_G)) != null ? _I : generateId2(),\n                  url: value.annotation.url,\n                  title: value.annotation.title\n                });\n              } else if (value.annotation.type === \"file_citation\") {\n                controller.enqueue({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_L = (_K = (_J = self.config).generateId) == null ? void 0 : _K.call(_J)) != null ? _L : generateId2(),\n                  mediaType: \"text/plain\",\n                  title: value.annotation.filename,\n                  filename: value.annotation.filename,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: value.annotation.type,\n                      fileId: value.annotation.file_id,\n                      index: value.annotation.index\n                    }\n                  }\n                });\n              } else if (value.annotation.type === \"container_file_citation\") {\n                controller.enqueue({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_O = (_N = (_M = self.config).generateId) == null ? void 0 : _N.call(_M)) != null ? _O : generateId2(),\n                  mediaType: \"text/plain\",\n                  title: value.annotation.filename,\n                  filename: value.annotation.filename,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: value.annotation.type,\n                      fileId: value.annotation.file_id,\n                      containerId: value.annotation.container_id\n                    }\n                  }\n                });\n              } else if (value.annotation.type === \"file_path\") {\n                controller.enqueue({\n                  type: \"source\",\n                  sourceType: \"document\",\n                  id: (_R = (_Q = (_P = self.config).generateId) == null ? void 0 : _Q.call(_P)) != null ? _R : generateId2(),\n                  mediaType: \"application/octet-stream\",\n                  title: value.annotation.file_id,\n                  filename: value.annotation.file_id,\n                  providerMetadata: {\n                    [providerOptionsName]: {\n                      type: value.annotation.type,\n                      fileId: value.annotation.file_id,\n                      index: value.annotation.index\n                    }\n                  }\n                });\n              }\n            } else if (isErrorChunk(value)) {\n              encounteredStreamError = true;\n              finishReason = { unified: \"error\", raw: \"error\" };\n              controller.enqueue({\n                type: \"error\",\n                error: (_S = createOpenAIProviderStreamError(value)) != null ? _S : value\n              });\n            }\n          },\n          flush(controller) {\n            var _a3;\n            for (const toolCall of Object.values(ongoingToolCalls)) {\n              if (!(toolCall == null ? void 0 : toolCall.suppressInputStreaming)) {\n                continue;\n              }\n              controller.enqueue({\n                type: \"tool-input-start\",\n                id: toolCall.toolCallId,\n                toolName: toolCall.toolName\n              });\n              for (const delta of (_a3 = toolCall.bufferedInputDeltas) != null ? _a3 : []) {\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.toolCallId,\n                  delta\n                });\n              }\n            }\n            const providerMetadata = {\n              [providerOptionsName]: {\n                responseId,\n                ...logprobs.length > 0 ? { logprobs } : {},\n                ...serviceTier !== void 0 ? { serviceTier } : {},\n                ...reasoningContext !== void 0 ? { reasoningContext } : {}\n              }\n            };\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertOpenAIResponsesUsage(usage),\n              providerMetadata\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n    return result;\n  }\n};\nfunction isTextDeltaChunk(chunk) {\n  return chunk.type === \"response.output_text.delta\";\n}\nfunction isOpenAIChatCompletionChunk(value) {\n  const chunk = asRecord2(value);\n  return chunk != null && Array.isArray(chunk.choices) && typeof chunk.type !== \"string\";\n}\nfunction createOpenAIResponsesChatCompletionsMismatchError({\n  value,\n  cause,\n  url,\n  requestBodyValues,\n  responseHeaders\n}) {\n  return new APICallError2({\n    message: \"Received a Chat Completions stream while using the OpenAI Responses API. The default OpenAI provider model uses the Responses API. If your custom baseURL targets a Chat Completions-compatible endpoint, use openai.chat('model-id') or createOpenAI(...).chat('model-id') instead. You can also use @ai-sdk/openai-compatible for OpenAI-compatible providers.\",\n    url,\n    requestBodyValues,\n    responseHeaders,\n    responseBody: JSON.stringify(value),\n    cause,\n    data: value,\n    isRetryable: false\n  });\n}\nfunction asRecord2(value) {\n  return typeof value === \"object\" && value != null ? value : void 0;\n}\nfunction isResponseOutputItemDoneChunk(chunk) {\n  return chunk.type === \"response.output_item.done\";\n}\nfunction isResponseFinishedChunk(chunk) {\n  return chunk.type === \"response.completed\" || chunk.type === \"response.incomplete\";\n}\nfunction isResponseFailedChunk(chunk) {\n  return chunk.type === \"response.failed\";\n}\nfunction isResponseCreatedChunk(chunk) {\n  return chunk.type === \"response.created\";\n}\nfunction isResponseFunctionCallArgumentsDeltaChunk(chunk) {\n  return chunk.type === \"response.function_call_arguments.delta\";\n}\nfunction isResponseCustomToolCallInputDeltaChunk(chunk) {\n  return chunk.type === \"response.custom_tool_call_input.delta\";\n}\nfunction isResponseImageGenerationCallPartialImageChunk(chunk) {\n  return chunk.type === \"response.image_generation_call.partial_image\";\n}\nfunction isResponseCodeInterpreterCallCodeDeltaChunk(chunk) {\n  return chunk.type === \"response.code_interpreter_call_code.delta\";\n}\nfunction isResponseCodeInterpreterCallCodeDoneChunk(chunk) {\n  return chunk.type === \"response.code_interpreter_call_code.done\";\n}\nfunction isResponseApplyPatchCallOperationDiffDeltaChunk(chunk) {\n  return chunk.type === \"response.apply_patch_call_operation_diff.delta\";\n}\nfunction isResponseApplyPatchCallOperationDiffDoneChunk(chunk) {\n  return chunk.type === \"response.apply_patch_call_operation_diff.done\";\n}\nfunction isResponseOutputItemAddedChunk(chunk) {\n  return chunk.type === \"response.output_item.added\";\n}\nfunction isResponseAnnotationAddedChunk(chunk) {\n  return chunk.type === \"response.output_text.annotation.added\";\n}\nfunction isErrorChunk(chunk) {\n  return chunk.type === \"error\";\n}\nfunction isResponseOutputChunk(chunk) {\n  return !(chunk.type === \"response.created\" || chunk.type === \"response.failed\" || chunk.type === \"error\" || chunk.type === \"unknown_chunk\");\n}\nfunction mapWebSearchResult({\n  action,\n  status\n}) {\n  return status === \"completed\" ? { result: mapWebSearchOutput(action) } : { isError: true, result: { status } };\n}\nfunction mapWebSearchOutput(action) {\n  var _a2;\n  if (action == null) {\n    return {};\n  }\n  switch (action.type) {\n    case \"search\":\n      return {\n        action: {\n          type: \"search\",\n          query: (_a2 = action.query) != null ? _a2 : void 0,\n          ...action.queries != null && { queries: action.queries }\n        },\n        // include sources when provided by the Responses API (behind include flag)\n        ...action.sources != null && { sources: action.sources }\n      };\n    case \"open_page\":\n      return { action: { type: \"openPage\", url: action.url } };\n    case \"find_in_page\":\n      return {\n        action: {\n          type: \"findInPage\",\n          url: action.url,\n          pattern: action.pattern\n        }\n      };\n  }\n}\nfunction escapeJSONDelta(delta) {\n  return JSON.stringify(delta).slice(1, -1);\n}\n\n// src/speech/openai-speech-model.ts\nimport {\n  combineHeaders as combineHeaders6,\n  createBinaryResponseHandler,\n  parseProviderOptions as parseProviderOptions7,\n  postJsonToApi as postJsonToApi6\n} from \"@ai-sdk/provider-utils\";\n\n// src/speech/openai-speech-options.ts\nimport {\n  lazySchema as lazySchema24,\n  zodSchema as zodSchema24\n} from \"@ai-sdk/provider-utils\";\nimport { z as z24 } from \"zod/v4\";\nvar openaiSpeechModelOptionsSchema = lazySchema24(\n  () => zodSchema24(\n    z24.object({\n      instructions: z24.string().nullish(),\n      speed: z24.number().min(0.25).max(4).default(1).nullish()\n    })\n  )\n);\n\n// src/speech/openai-speech-model.ts\nvar OpenAISpeechModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    text,\n    voice = \"alloy\",\n    outputFormat = \"mp3\",\n    speed,\n    instructions,\n    language,\n    providerOptions\n  }) {\n    const warnings = [];\n    const openAIOptions = await parseProviderOptions7({\n      provider: \"openai\",\n      providerOptions,\n      schema: openaiSpeechModelOptionsSchema\n    });\n    const requestBody = {\n      model: this.modelId,\n      input: text,\n      voice,\n      response_format: \"mp3\",\n      speed,\n      instructions\n    };\n    if (outputFormat) {\n      if ([\"mp3\", \"opus\", \"aac\", \"flac\", \"wav\", \"pcm\"].includes(outputFormat)) {\n        requestBody.response_format = outputFormat;\n      } else {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"outputFormat\",\n          details: `Unsupported output format: ${outputFormat}. Using mp3 instead.`\n        });\n      }\n    }\n    if (openAIOptions) {\n      const speechModelOptions = {};\n      for (const key in speechModelOptions) {\n        const value = speechModelOptions[key];\n        if (value !== void 0) {\n          requestBody[key] = value;\n        }\n      }\n    }\n    if (language) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"language\",\n        details: `OpenAI speech models do not support language selection. Language parameter \"${language}\" was ignored.`\n      });\n    }\n    return {\n      requestBody,\n      warnings\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c;\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    const { requestBody, warnings } = await this.getArgs(options);\n    const {\n      value: audio,\n      responseHeaders,\n      rawValue: rawResponse\n    } = await postJsonToApi6({\n      url: this.config.url({\n        path: \"/audio/speech\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders6(this.config.headers(), options.headers),\n      body: requestBody,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createBinaryResponseHandler(),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      audio,\n      warnings,\n      request: {\n        body: JSON.stringify(requestBody)\n      },\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders,\n        body: rawResponse\n      }\n    };\n  }\n};\n\n// src/transcription/openai-transcription-model.ts\nimport {\n  combineHeaders as combineHeaders7,\n  convertBase64ToUint8Array as convertBase64ToUint8Array2,\n  createJsonResponseHandler as createJsonResponseHandler6,\n  mediaTypeToExtension,\n  parseProviderOptions as parseProviderOptions8,\n  postFormDataToApi as postFormDataToApi2\n} from \"@ai-sdk/provider-utils\";\n\n// src/transcription/openai-transcription-api.ts\nimport { lazySchema as lazySchema25, zodSchema as zodSchema25 } from \"@ai-sdk/provider-utils\";\nimport { z as z25 } from \"zod/v4\";\nvar openaiTranscriptionResponseSchema = lazySchema25(\n  () => zodSchema25(\n    z25.object({\n      text: z25.string(),\n      language: z25.string().nullish(),\n      duration: z25.number().nullish(),\n      words: z25.array(\n        z25.object({\n          word: z25.string(),\n          start: z25.number(),\n          end: z25.number()\n        })\n      ).nullish(),\n      segments: z25.array(\n        z25.object({\n          id: z25.number(),\n          seek: z25.number(),\n          start: z25.number(),\n          end: z25.number(),\n          text: z25.string(),\n          tokens: z25.array(z25.number()),\n          temperature: z25.number(),\n          avg_logprob: z25.number(),\n          compression_ratio: z25.number(),\n          no_speech_prob: z25.number()\n        })\n      ).nullish(),\n      // Lenient: an unexpected usage shape must not fail the transcription.\n      usage: z25.object({\n        type: z25.string().nullish(),\n        seconds: z25.number().nullish()\n      }).nullish().catch(void 0)\n    })\n  )\n);\n\n// src/transcription/openai-transcription-options.ts\nimport {\n  lazySchema as lazySchema26,\n  zodSchema as zodSchema26\n} from \"@ai-sdk/provider-utils\";\nimport { z as z26 } from \"zod/v4\";\nvar openAITranscriptionModelOptions = lazySchema26(\n  () => zodSchema26(\n    z26.object({\n      /**\n       * Additional information to include in the transcription response.\n       */\n      include: z26.array(z26.string()).optional(),\n      /**\n       * The language of the input audio in ISO-639-1 format.\n       */\n      language: z26.string().optional(),\n      /**\n       * An optional text to guide the model's style or continue a previous audio segment.\n       */\n      prompt: z26.string().optional(),\n      /**\n       * The sampling temperature, between 0 and 1.\n       * @default 0\n       */\n      temperature: z26.number().min(0).max(1).default(0).optional(),\n      /**\n       * The timestamp granularities to populate for this transcription.\n       * @default ['segment']\n       */\n      timestampGranularities: z26.array(z26.enum([\"word\", \"segment\"])).default([\"segment\"]).optional()\n    })\n  )\n);\n\n// src/transcription/openai-transcription-model.ts\nvar languageMap = {\n  afrikaans: \"af\",\n  arabic: \"ar\",\n  armenian: \"hy\",\n  azerbaijani: \"az\",\n  belarusian: \"be\",\n  bosnian: \"bs\",\n  bulgarian: \"bg\",\n  catalan: \"ca\",\n  chinese: \"zh\",\n  croatian: \"hr\",\n  czech: \"cs\",\n  danish: \"da\",\n  dutch: \"nl\",\n  english: \"en\",\n  estonian: \"et\",\n  finnish: \"fi\",\n  french: \"fr\",\n  galician: \"gl\",\n  german: \"de\",\n  greek: \"el\",\n  hebrew: \"he\",\n  hindi: \"hi\",\n  hungarian: \"hu\",\n  icelandic: \"is\",\n  indonesian: \"id\",\n  italian: \"it\",\n  japanese: \"ja\",\n  kannada: \"kn\",\n  kazakh: \"kk\",\n  korean: \"ko\",\n  latvian: \"lv\",\n  lithuanian: \"lt\",\n  macedonian: \"mk\",\n  malay: \"ms\",\n  marathi: \"mr\",\n  maori: \"mi\",\n  nepali: \"ne\",\n  norwegian: \"no\",\n  persian: \"fa\",\n  polish: \"pl\",\n  portuguese: \"pt\",\n  romanian: \"ro\",\n  russian: \"ru\",\n  serbian: \"sr\",\n  slovak: \"sk\",\n  slovenian: \"sl\",\n  spanish: \"es\",\n  swahili: \"sw\",\n  swedish: \"sv\",\n  tagalog: \"tl\",\n  tamil: \"ta\",\n  thai: \"th\",\n  turkish: \"tr\",\n  ukrainian: \"uk\",\n  urdu: \"ur\",\n  vietnamese: \"vi\",\n  welsh: \"cy\"\n};\nvar OpenAITranscriptionModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    audio,\n    mediaType,\n    providerOptions\n  }) {\n    const warnings = [];\n    const openAIOptions = await parseProviderOptions8({\n      provider: \"openai\",\n      providerOptions,\n      schema: openAITranscriptionModelOptions\n    });\n    const formData = new FormData();\n    const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array2(audio)]);\n    formData.append(\"model\", this.modelId);\n    const fileExtension = mediaTypeToExtension(mediaType);\n    formData.append(\n      \"file\",\n      new File([blob], \"audio\", { type: mediaType }),\n      `audio.${fileExtension}`\n    );\n    if (openAIOptions) {\n      const transcriptionModelOptions = {\n        include: openAIOptions.include,\n        language: openAIOptions.language,\n        prompt: openAIOptions.prompt,\n        // https://platform.openai.com/docs/api-reference/audio/createTranscription#audio_createtranscription-response_format\n        // prefer verbose_json to get segments for models that support it\n        // gpt-4o(-mini)-transcribe (incl. snapshots) and gpt-transcribe reject verbose_json:\n        response_format: [\"gpt-4o-transcribe\", \"gpt-4o-mini-transcribe\"].includes(\n          this.modelId\n        ) || this.modelId.startsWith(\"gpt-4o-mini-transcribe-\") || this.modelId === \"gpt-transcribe\" || this.modelId.startsWith(\"gpt-transcribe-\") ? \"json\" : \"verbose_json\",\n        temperature: openAIOptions.temperature,\n        timestamp_granularities: openAIOptions.timestampGranularities\n      };\n      for (const [key, value] of Object.entries(transcriptionModelOptions)) {\n        if (value != null) {\n          if (Array.isArray(value)) {\n            for (const item of value) {\n              formData.append(`${key}[]`, String(item));\n            }\n          } else {\n            formData.append(key, String(value));\n          }\n        }\n      }\n    }\n    return {\n      formData,\n      warnings\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    const { formData, warnings } = await this.getArgs(options);\n    const {\n      value: response,\n      responseHeaders,\n      rawValue: rawResponse\n    } = await postFormDataToApi2({\n      url: this.config.url({\n        path: \"/audio/transcriptions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders7(this.config.headers(), options.headers),\n      formData,\n      failedResponseHandler: openaiFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler6(\n        openaiTranscriptionResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const language = response.language != null && response.language in languageMap ? languageMap[response.language] : void 0;\n    return {\n      text: response.text,\n      segments: (_g = (_f = (_d = response.segments) == null ? void 0 : _d.map((segment) => ({\n        text: segment.text,\n        startSecond: segment.start,\n        endSecond: segment.end\n      }))) != null ? _f : (_e = response.words) == null ? void 0 : _e.map((word) => ({\n        text: word.word,\n        startSecond: word.start,\n        endSecond: word.end\n      }))) != null ? _g : [],\n      language,\n      // Duration-billed json responses report the duration only in `usage`:\n      durationInSeconds: (_j = response.duration) != null ? _j : ((_h = response.usage) == null ? void 0 : _h.type) === \"duration\" ? (_i = response.usage.seconds) != null ? _i : void 0 : void 0,\n      warnings,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders,\n        body: rawResponse\n      }\n    };\n  }\n};\n\n// src/version.ts\nvar VERSION = true ? \"3.0.135\" : \"0.0.0-test\";\n\n// src/openai-provider.ts\nfunction createOpenAI(options = {}) {\n  var _a2, _b;\n  const baseURL = (_a2 = withoutTrailingSlash(\n    loadOptionalSetting({\n      settingValue: options.baseURL,\n      environmentVariableName: \"OPENAI_BASE_URL\"\n    })\n  )) != null ? _a2 : \"https://api.openai.com/v1\";\n  const providerName = (_b = options.name) != null ? _b : \"openai\";\n  const getHeaders = () => withUserAgentSuffix(\n    {\n      Authorization: `Bearer ${loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"OPENAI_API_KEY\",\n        description: \"OpenAI\"\n      })}`,\n      \"OpenAI-Organization\": options.organization,\n      \"OpenAI-Project\": options.project,\n      ...options.headers\n    },\n    `ai-sdk/openai/${VERSION}`\n  );\n  const createChatModel = (modelId) => new OpenAIChatLanguageModel(modelId, {\n    provider: `${providerName}.chat`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createCompletionModel = (modelId) => new OpenAICompletionLanguageModel(modelId, {\n    provider: `${providerName}.completion`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createEmbeddingModel = (modelId) => new OpenAIEmbeddingModel(modelId, {\n    provider: `${providerName}.embedding`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createImageModel = (modelId) => new OpenAIImageModel(modelId, {\n    provider: `${providerName}.image`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {\n    provider: `${providerName}.transcription`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {\n    provider: `${providerName}.speech`,\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createLanguageModel = (modelId) => {\n    if (new.target) {\n      throw new Error(\n        \"The OpenAI model function cannot be called with the new keyword.\"\n      );\n    }\n    return createResponsesModel(modelId);\n  };\n  const createResponsesModel = (modelId) => {\n    return new OpenAIResponsesLanguageModel(modelId, {\n      provider: `${providerName}.responses`,\n      url: ({ path }) => `${baseURL}${path}`,\n      headers: getHeaders,\n      fetch: options.fetch,\n      fileIdPrefixes: [\"file-\"]\n    });\n  };\n  const provider = function(modelId) {\n    return createLanguageModel(modelId);\n  };\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createLanguageModel;\n  provider.chat = createChatModel;\n  provider.completion = createCompletionModel;\n  provider.responses = createResponsesModel;\n  provider.embedding = createEmbeddingModel;\n  provider.embeddingModel = createEmbeddingModel;\n  provider.textEmbedding = createEmbeddingModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.image = createImageModel;\n  provider.imageModel = createImageModel;\n  provider.transcription = createTranscriptionModel;\n  provider.transcriptionModel = createTranscriptionModel;\n  provider.speech = createSpeechModel;\n  provider.speechModel = createSpeechModel;\n  provider.tools = openaiTools;\n  return provider;\n}\nvar openai = createOpenAI();\nexport {\n  VERSION,\n  createOpenAI,\n  openai\n};\n//# sourceMappingURL=index.mjs.map","/**\n * Base class for model gateway providers\n * Gateways fetch provider configurations and build URLs for model access\n */\n\nimport type { LanguageModelV2 } from '@ai-sdk/provider-v5';\nimport type { LanguageModelV3 } from '@ai-sdk/provider-v6';\nimport type { LanguageModelV4 } from '@ai-sdk/provider-v7';\nimport type { StreamTransport } from '../../../stream/types';\nimport type { OpenAITransport, ResponsesWebSocketOptions } from '../provider-options.js';\n\n/**\n * Per-model provider override sourced from a models.dev model's `provider` block.\n * Lets a single provider serve individual models over a different endpoint / request\n * shape / SDK than the provider default (e.g. a model served over the OpenAI\n * Responses API while the provider default is chat-completions).\n */\nexport interface ModelProviderOverride {\n  api?: string; // Base API URL for this model (may contain ${ENV} templates)\n  shape?: 'responses' | 'completions'; // Request shape to use for this model\n  npm?: string; // SDK package to use for this model\n}\n\n/** Prices in USD per 1 million tokens, one per token kind. */\nexport interface ModelPricingRates {\n  input?: number;\n  output?: number;\n  cache_read?: number;\n  cache_write?: number;\n  reasoning?: number;\n  input_audio?: number;\n  output_audio?: number;\n}\n\n/** Rates that apply once the input reaches `tier.size` tokens (long-context pricing). */\nexport interface ModelPricingTier extends ModelPricingRates {\n  tier: { type?: 'context'; size: number };\n}\n\n/**\n * What one model costs. Same shape as a models.dev model's `cost`, so prices can be copied\n * from models.dev or a provider's price page as they are.\n */\nexport interface ModelPricing extends ModelPricingRates {\n  tiers?: ModelPricingTier[];\n}\n\nexport interface ProviderConfig {\n  url?: string;\n  apiKeyHeader?: string;\n  apiKeyEnvVar: string | string[];\n  name: string;\n  models: string[];\n  /** ISO release dates keyed by model ID, when the catalog supplies them. */\n  modelReleaseDates?: Record<string, string>;\n  docUrl?: string; // Optional documentation URL\n  gateway: string;\n  npm?: string; // NPM package name from models.dev (e.g., \"@ai-sdk/anthropic\")\n  // Per-model overrides (endpoint/shape/SDK) keyed by model id, when a provider\n  // serves some models differently than its default (models.dev model `provider`).\n  modelOverrides?: Record<string, ModelProviderOverride>;\n  // Model ids the upstream provider has marked deprecated. These stay in `models`\n  // so existing configs keep type-checking and keep their capability/override data;\n  // surfaces that offer models for *new* selection should de-emphasize or hide them.\n  deprecatedModels?: string[];\n  // Prices keyed by model id, for models that models.dev does not list (private deployments,\n  // resellers). `@mastra/observability` uses them for cost metrics before models.dev prices.\n  pricing?: Record<string, ModelPricing>;\n}\n\n/**\n * Compact capability data collected from gateways during generation.\n * Each provider maps to a list of model IDs that support a capability.\n */\nexport type AttachmentCapabilities = Record<string, string[]>;\nexport type TemperatureCapabilities = Record<string, string[]>;\nexport type StructuredOutputCapabilities = Record<string, string[]>;\n\n/** A reasoning control a model accepts, as published by models.dev `reasoning_options`. */\nexport type ModelReasoningOption =\n  | { type: 'effort'; values: string[] }\n  | { type: 'budget_tokens'; min?: number; max?: number }\n  | { type: 'toggle' };\n\n/** Provider ID → model ID → the reasoning controls that model accepts. */\nexport type ReasoningCapabilities = Record<string, Record<string, ModelReasoningOption[]>>;\n\n/**\n * Union type for language models that can be returned by gateways.\n * Supports AI SDK v5 (LanguageModelV2), v6 (LanguageModelV3), and v7 (LanguageModelV4).\n */\nexport type GatewayLanguageModel = LanguageModelV2 | LanguageModelV3 | LanguageModelV4;\nexport type GatewayStreamTransportHandle = Pick<StreamTransport, 'type' | 'close'>;\n\n/** @internal Stream transport handle attached by gateways that own custom streaming transports. */\nexport const MASTRA_GATEWAY_STREAM_TRANSPORT = Symbol.for('@mastra/core.gatewayStreamTransport');\n\nexport type GatewayLanguageModelWithStreamTransport = GatewayLanguageModel & {\n  [MASTRA_GATEWAY_STREAM_TRANSPORT]?: GatewayStreamTransportHandle;\n};\n\nexport type GatewayAuthSource = 'explicit' | 'gateway' | 'legacy';\n\nexport type GatewayAuthRequest = {\n  gatewayId: string;\n  providerId: string;\n  modelId: string;\n  routerId: string;\n};\n\nexport type GatewayAuthResult = {\n  apiKey?: string;\n  bearerToken?: string;\n  headers?: Record<string, string>;\n  source?: GatewayAuthSource;\n};\n\nexport interface MastraModelGatewayInterface {\n  /**\n   * Unique identifier for the gateway\n   * This ID is used as the prefix for all providers from this gateway (e.g., \"netlify/anthropic\")\n   * Exception: models.dev is a provider registry and doesn't use a prefix\n   */\n  readonly id: string;\n\n  /**\n   * Name of the gateway provider\n   */\n  readonly name: string;\n\n  /**\n   * Get the gateway ID. Optional for plain object gateways; defaults to `id`.\n   * @deprecated Use `id` instead.\n   * @returns The gateway ID.\n   */\n  getId?(): string;\n\n  /**\n   * Whether this gateway should be enabled for the current runtime.\n   * Disabled gateways are skipped when syncing and filtered out when reading cached registry data.\n   * Optional for plain object gateways; defaults to `true`.\n   */\n  shouldEnable?(): boolean;\n\n  /**\n   * Whether this gateway claims the given model/router id even when the id is\n   * not prefixed with the gateway's own id (e.g. a bare `anthropic/...` id that\n   * this gateway can authenticate via OAuth/stored credentials).\n   * Checked after exact prefix matching but before the models.dev registry\n   * fallback. Optional; defaults to `false`.\n   */\n  handlesModel?(modelId: string): boolean;\n\n  /**\n   * Fetch provider configurations from the gateway.\n   * Should return providers in the standard format.\n   */\n  fetchProviders(): Promise<Record<string, ProviderConfig>>;\n\n  /**\n   * Build the URL for a specific model/provider combination\n   * @param modelId Full model ID (e.g., \"openai/gpt-4o\" or \"netlify/openai/gpt-4o\")\n   * @param envVars Environment variables available\n   * @returns URL string if this gateway can handle the model, false otherwise\n   */\n  buildUrl(modelId: string, envVars: Record<string, string>): string | undefined | Promise<string | undefined>;\n\n  getApiKey(modelId: string): Promise<string>;\n\n  /**\n   * Resolve auth before falling back to getApiKey/env behavior.\n   */\n  resolveAuth?(request: GatewayAuthRequest): Promise<GatewayAuthResult | undefined> | GatewayAuthResult | undefined;\n\n  /**\n   * Resolve a language model from the gateway.\n   * Supports returning LanguageModelV2 (AI SDK v5), LanguageModelV3 (AI SDK v6), or LanguageModelV4 (AI SDK v7).\n   */\n  resolveLanguageModel(args: {\n    modelId: string;\n    providerId: string;\n    apiKey: string;\n    headers?: Record<string, string>;\n    transport?: OpenAITransport;\n    responsesWebSocket?: ResponsesWebSocketOptions;\n  }): Promise<GatewayLanguageModel> | GatewayLanguageModel;\n\n  /**\n   * Custom serialization for tracing/observability spans.\n   * Gateways typically hold credentials (apiKey, OAuth tokens, customFetch\n   * closures that capture secrets). The base implementation exposes only\n   * the gateway identity so subclasses are safe by default.\n   */\n  serializeForSpan?(): { id: string; name: string } & Record<string, unknown>;\n}\n\nexport abstract class MastraModelGateway implements MastraModelGatewayInterface {\n  abstract readonly id: string;\n  abstract readonly name: string;\n\n  getId(): string {\n    return this.id;\n  }\n\n  shouldEnable(): boolean {\n    return true;\n  }\n\n  handlesModel(_modelId: string): boolean {\n    return false;\n  }\n\n  abstract fetchProviders(): Promise<Record<string, ProviderConfig>>;\n\n  abstract buildUrl(modelId: string, envVars: Record<string, string>): string | undefined | Promise<string | undefined>;\n\n  abstract getApiKey(modelId: string): Promise<string>;\n\n  abstract resolveLanguageModel(args: {\n    modelId: string;\n    providerId: string;\n    apiKey: string;\n    headers?: Record<string, string>;\n    transport?: OpenAITransport;\n    responsesWebSocket?: ResponsesWebSocketOptions;\n  }): Promise<GatewayLanguageModel> | GatewayLanguageModel;\n\n  serializeForSpan(): { id: string; name: string } {\n    return { id: this.id, name: this.name };\n  }\n}\n","import type { ModelReasoningOption } from './gateways/base.js';\n\nexport interface ProviderCapabilityFile {\n  attachment?: string[];\n  temperature?: string[];\n  structuredOutput?: string[];\n  reasoning?: Record<string, ModelReasoningOption[]>;\n}\n\nexport function getCapabilityFileName(provider: string): string {\n  return `${encodeURIComponent(provider)}.json`;\n}\n","import { MastraError } from '../../../error/index.js';\nimport type { GatewayAuthResult, MastraModelGatewayInterface } from './base.js';\n\nexport function getGatewayId(gateway: MastraModelGatewayInterface): string {\n  return gateway.getId?.() ?? gateway.id;\n}\n\nexport function shouldEnableGateway(gateway: MastraModelGatewayInterface): boolean {\n  return gateway.shouldEnable?.() ?? true;\n}\n\nexport function hasAuthCredentials(auth?: GatewayAuthResult): auth is GatewayAuthResult {\n  return Boolean(auth?.apiKey || auth?.bearerToken || (auth?.headers && Object.keys(auth.headers).length > 0));\n}\n\nexport function serializeGatewayForSpan(\n  gateway: MastraModelGatewayInterface,\n): { id: string; name: string } & Record<string, unknown> {\n  return gateway.serializeForSpan?.() ?? { id: getGatewayId(gateway), name: gateway.name };\n}\n\n/**\n * Find the gateway the model router would use for a model ID.\n * Disabled gateways are skipped. A gateway ID is used as the prefix (e.g.,\n * \"netlify\" for netlify gateway); gateways may also claim a model through\n * `handlesModel`. models.dev is a provider registry and doesn't use a prefix.\n */\nexport function findGatewayForModel(\n  modelId: string,\n  allGateways: MastraModelGatewayInterface[],\n): MastraModelGatewayInterface {\n  const gateways = allGateways.filter(shouldEnableGateway);\n\n  // First, check for gateways whose ID matches the prefix (true gateways like netlify, openrouter, vercel)\n  const prefixedGateway = gateways.find(g => {\n    const id = getGatewayId(g);\n    return id !== 'models.dev' && (id === modelId || modelId.startsWith(`${id}/`));\n  });\n  if (prefixedGateway) {\n    return prefixedGateway;\n  }\n\n  // Then check gateways that explicitly claim this (possibly unprefixed) model\n  // id, e.g. a gateway that authenticates a bare `anthropic/...` id via OAuth.\n  const claimingGateway = gateways.find(g => getGatewayId(g) !== 'models.dev' && g.handlesModel?.(modelId) === true);\n  if (claimingGateway) {\n    return claimingGateway;\n  }\n\n  // Then check models.dev (provider registry without prefix)\n  const modelsDevGateway = gateways.find(g => getGatewayId(g) === 'models.dev');\n  if (modelsDevGateway) {\n    return modelsDevGateway;\n  }\n\n  throw new MastraError({\n    id: 'MODEL_ROUTER_NO_GATEWAY_FOUND',\n    category: 'USER',\n    domain: 'MODEL_ROUTER',\n    text: `No Mastra model router gateway found for model id ${modelId}`,\n  });\n}\n","// src/anthropic-provider.ts\nimport {\n  InvalidArgumentError,\n  NoSuchModelError\n} from \"@ai-sdk/provider\";\nimport {\n  generateId as generateId2,\n  loadApiKey,\n  loadOptionalSetting,\n  withoutTrailingSlash,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\n\n// src/version.ts\nvar VERSION = true ? \"3.0.137\" : \"0.0.0-test\";\n\n// src/anthropic-messages-language-model.ts\nimport {\n  APICallError,\n  InvalidResponseDataError\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler,\n  createToolNameMapping,\n  generateId,\n  parseProviderOptions as parseProviderOptions2,\n  postJsonToApi,\n  resolve,\n  secureJsonParse as secureJsonParse2\n} from \"@ai-sdk/provider-utils\";\n\n// src/anthropic-error.ts\nimport {\n  createJsonErrorResponseHandler,\n  lazySchema,\n  zodSchema\n} from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\nvar anthropicErrorDataSchema = lazySchema(\n  () => zodSchema(\n    z.object({\n      type: z.literal(\"error\"),\n      error: z.object({\n        type: z.string(),\n        message: z.string()\n      })\n    })\n  )\n);\nvar anthropicFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: anthropicErrorDataSchema,\n  errorToMessage: (data) => data.error.message\n});\n\n// src/anthropic-messages-api.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar anthropicStopDetailsSchema = () => z2.object({\n  type: z2.string(),\n  category: z2.string().nullish(),\n  explanation: z2.string().nullish(),\n  recommended_model: z2.string().nullish()\n});\nvar anthropicSafeguardResultSchema = () => z2.object({\n  type: z2.string(),\n  status: z2.object({\n    type: z2.string(),\n    tool_uses: z2.record(\n      z2.string(),\n      z2.object({\n        type: z2.string(),\n        outcome: z2.string().nullish(),\n        explanation: z2.string().nullish()\n      })\n    ).nullish()\n  })\n});\nvar anthropicToolCallCallerSchema = () => z2.union([\n  z2.object({\n    type: z2.literal(\"code_execution_20250825\"),\n    tool_id: z2.string()\n  }),\n  z2.object({\n    type: z2.literal(\"code_execution_20260120\"),\n    tool_id: z2.string()\n  }),\n  z2.object({\n    type: z2.literal(\"direct\")\n  })\n]);\nvar anthropicInputTransformationSchema = () => z2.object({\n  type: z2.string(),\n  path: z2.string(),\n  reason: z2.string()\n});\nvar anthropicMessagesResponseSchema = lazySchema2(\n  () => zodSchema2(\n    z2.object({\n      type: z2.literal(\"message\"),\n      id: z2.string().nullish(),\n      model: z2.string().nullish(),\n      content: z2.array(\n        z2.discriminatedUnion(\"type\", [\n          z2.object({\n            type: z2.literal(\"text\"),\n            text: z2.string(),\n            citations: z2.array(\n              z2.discriminatedUnion(\"type\", [\n                z2.object({\n                  type: z2.literal(\"web_search_result_location\"),\n                  cited_text: z2.string(),\n                  url: z2.string(),\n                  title: z2.string(),\n                  encrypted_index: z2.string()\n                }),\n                z2.object({\n                  type: z2.literal(\"page_location\"),\n                  cited_text: z2.string(),\n                  document_index: z2.number(),\n                  document_title: z2.string().nullable(),\n                  start_page_number: z2.number(),\n                  end_page_number: z2.number()\n                }),\n                z2.object({\n                  type: z2.literal(\"char_location\"),\n                  cited_text: z2.string(),\n                  document_index: z2.number(),\n                  document_title: z2.string().nullable(),\n                  start_char_index: z2.number(),\n                  end_char_index: z2.number()\n                })\n              ])\n            ).optional()\n          }),\n          z2.object({\n            type: z2.literal(\"thinking\"),\n            thinking: z2.string(),\n            signature: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"redacted_thinking\"),\n            data: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"compaction\"),\n            content: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            input: z2.unknown(),\n            // Programmatic tool calling: caller info when triggered from code execution\n            caller: anthropicToolCallCallerSchema().optional(),\n            // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to\n            toolset_name: z2.string().nullish()\n          }),\n          z2.object({\n            type: z2.literal(\"server_tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            input: z2.record(z2.string(), z2.unknown()).nullish(),\n            caller: anthropicToolCallCallerSchema().optional()\n          }),\n          z2.object({\n            type: z2.literal(\"mcp_tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            input: z2.unknown(),\n            server_name: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"mcp_tool_result\"),\n            tool_use_id: z2.string(),\n            is_error: z2.boolean(),\n            content: z2.array(\n              z2.union([\n                z2.string(),\n                z2.object({ type: z2.literal(\"text\"), text: z2.string() })\n              ])\n            )\n          }),\n          z2.object({\n            type: z2.literal(\"web_fetch_tool_result\"),\n            tool_use_id: z2.string(),\n            caller: anthropicToolCallCallerSchema().optional(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"web_fetch_result\"),\n                url: z2.string(),\n                retrieved_at: z2.string(),\n                content: z2.object({\n                  type: z2.literal(\"document\"),\n                  title: z2.string().nullable(),\n                  citations: z2.object({ enabled: z2.boolean() }).optional(),\n                  source: z2.union([\n                    z2.object({\n                      type: z2.literal(\"base64\"),\n                      media_type: z2.literal(\"application/pdf\"),\n                      data: z2.string()\n                    }),\n                    z2.object({\n                      type: z2.literal(\"text\"),\n                      media_type: z2.literal(\"text/plain\"),\n                      data: z2.string()\n                    })\n                  ])\n                })\n              }),\n              z2.object({\n                type: z2.literal(\"web_fetch_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          z2.object({\n            type: z2.literal(\"web_search_tool_result\"),\n            tool_use_id: z2.string(),\n            caller: anthropicToolCallCallerSchema().optional(),\n            content: z2.union([\n              z2.array(\n                z2.object({\n                  type: z2.literal(\"web_search_result\"),\n                  url: z2.string(),\n                  title: z2.string(),\n                  encrypted_content: z2.string(),\n                  page_age: z2.string().nullish()\n                })\n              ),\n              z2.object({\n                type: z2.literal(\"web_search_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // code execution results for code_execution_20250522 tool:\n          z2.object({\n            type: z2.literal(\"code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"code_execution_result\"),\n                stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number(),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ).optional().default([])\n              }),\n              z2.object({\n                type: z2.literal(\"encrypted_code_execution_result\"),\n                encrypted_stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number(),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ).optional().default([])\n              }),\n              z2.object({\n                type: z2.literal(\"code_execution_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // bash code execution results for code_execution_20250825 tool:\n          z2.object({\n            type: z2.literal(\"bash_code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"bash_code_execution_result\"),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"bash_code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ),\n                stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number()\n              }),\n              z2.object({\n                type: z2.literal(\"bash_code_execution_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // text editor code execution results for code_execution_20250825 tool:\n          z2.object({\n            type: z2.literal(\"text_editor_code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_tool_result_error\"),\n                error_code: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_view_result\"),\n                content: z2.string(),\n                file_type: z2.string(),\n                num_lines: z2.number().nullable(),\n                start_line: z2.number().nullable(),\n                total_lines: z2.number().nullable()\n              }),\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_create_result\"),\n                is_file_update: z2.boolean()\n              }),\n              z2.object({\n                type: z2.literal(\n                  \"text_editor_code_execution_str_replace_result\"\n                ),\n                lines: z2.array(z2.string()).nullable(),\n                new_lines: z2.number().nullable(),\n                new_start: z2.number().nullable(),\n                old_lines: z2.number().nullable(),\n                old_start: z2.number().nullable()\n              })\n            ])\n          }),\n          // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n          z2.object({\n            type: z2.literal(\"tool_search_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"tool_search_tool_search_result\"),\n                tool_references: z2.array(\n                  z2.object({\n                    type: z2.literal(\"tool_reference\"),\n                    tool_name: z2.string()\n                  })\n                )\n              }),\n              z2.object({\n                type: z2.literal(\"tool_search_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // advisor results for advisor_20260301:\n          z2.object({\n            type: z2.literal(\"advisor_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"advisor_result\"),\n                text: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"advisor_redacted_result\"),\n                encrypted_content: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"advisor_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // Server-side fallback marker. Parsed so the response validates, but\n          // dropped from the content output (the AI SDK has no model-hop\n          // primitive). The hop remains observable via usage.iterations.\n          z2.object({\n            type: z2.literal(\"fallback\")\n          })\n        ])\n      ),\n      stop_reason: z2.string().nullish(),\n      stop_sequence: z2.string().nullish(),\n      stop_details: anthropicStopDetailsSchema().nullish(),\n      input_transformations: z2.array(anthropicInputTransformationSchema()).nullish(),\n      safeguard_results: z2.array(anthropicSafeguardResultSchema()).nullish(),\n      usage: z2.looseObject({\n        input_tokens: z2.number(),\n        output_tokens: z2.number(),\n        output_tokens_details: z2.object({\n          thinking_tokens: z2.number().nullish()\n        }).nullish(),\n        cache_creation_input_tokens: z2.number().nullish(),\n        cache_read_input_tokens: z2.number().nullish(),\n        iterations: z2.array(\n          z2.object({\n            type: z2.union([\n              z2.literal(\"compaction\"),\n              z2.literal(\"message\"),\n              z2.literal(\"advisor_message\"),\n              z2.literal(\"fallback_message\")\n            ]),\n            model: z2.string().nullish(),\n            input_tokens: z2.number(),\n            output_tokens: z2.number(),\n            cache_creation_input_tokens: z2.number().nullish(),\n            cache_read_input_tokens: z2.number().nullish()\n          })\n        ).nullish()\n      }),\n      container: z2.object({\n        expires_at: z2.string(),\n        id: z2.string(),\n        skills: z2.array(\n          z2.object({\n            type: z2.union([z2.literal(\"anthropic\"), z2.literal(\"custom\")]),\n            skill_id: z2.string(),\n            version: z2.string()\n          })\n        ).nullish()\n      }).nullish(),\n      context_management: z2.object({\n        applied_edits: z2.array(\n          z2.union([\n            z2.object({\n              type: z2.literal(\"clear_tool_uses_20250919\"),\n              cleared_tool_uses: z2.number(),\n              cleared_input_tokens: z2.number()\n            }),\n            z2.object({\n              type: z2.literal(\"clear_thinking_20251015\"),\n              cleared_thinking_turns: z2.number(),\n              cleared_input_tokens: z2.number()\n            }),\n            z2.object({\n              type: z2.literal(\"compact_20260112\")\n            })\n          ])\n        )\n      }).nullish()\n    })\n  )\n);\nvar anthropicMessagesChunkSchema = lazySchema2(\n  () => zodSchema2(\n    z2.discriminatedUnion(\"type\", [\n      z2.object({\n        type: z2.literal(\"message_start\"),\n        message: z2.object({\n          id: z2.string().nullish(),\n          model: z2.string().nullish(),\n          role: z2.string().nullish(),\n          usage: z2.looseObject({\n            input_tokens: z2.number(),\n            cache_creation_input_tokens: z2.number().nullish(),\n            cache_read_input_tokens: z2.number().nullish()\n          }),\n          // Programmatic tool calling: content may be pre-populated for deferred tool calls\n          content: z2.array(\n            z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"tool_use\"),\n                id: z2.string(),\n                name: z2.string(),\n                input: z2.unknown(),\n                caller: anthropicToolCallCallerSchema().optional(),\n                toolset_name: z2.string().nullish()\n              })\n            ])\n          ).nullish(),\n          stop_reason: z2.string().nullish(),\n          input_transformations: z2.array(anthropicInputTransformationSchema()).nullish(),\n          container: z2.object({\n            expires_at: z2.string(),\n            id: z2.string()\n          }).nullish()\n        })\n      }),\n      z2.object({\n        type: z2.literal(\"content_block_start\"),\n        index: z2.number(),\n        content_block: z2.discriminatedUnion(\"type\", [\n          z2.object({\n            type: z2.literal(\"text\"),\n            text: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"thinking\"),\n            thinking: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            // Programmatic tool calling: input may be present directly for deferred tool calls\n            input: z2.record(z2.string(), z2.unknown()).optional(),\n            // Programmatic tool calling: caller info when triggered from code execution\n            caller: anthropicToolCallCallerSchema().optional(),\n            // Toolsets (e.g. computer toolset): name of the toolset this member call belongs to\n            toolset_name: z2.string().nullish()\n          }),\n          z2.object({\n            type: z2.literal(\"redacted_thinking\"),\n            data: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"compaction\"),\n            content: z2.string().nullish()\n          }),\n          z2.object({\n            type: z2.literal(\"server_tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            input: z2.record(z2.string(), z2.unknown()).nullish(),\n            caller: anthropicToolCallCallerSchema().optional()\n          }),\n          z2.object({\n            type: z2.literal(\"mcp_tool_use\"),\n            id: z2.string(),\n            name: z2.string(),\n            input: z2.unknown(),\n            server_name: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"mcp_tool_result\"),\n            tool_use_id: z2.string(),\n            is_error: z2.boolean(),\n            content: z2.array(\n              z2.union([\n                z2.string(),\n                z2.object({ type: z2.literal(\"text\"), text: z2.string() })\n              ])\n            )\n          }),\n          z2.object({\n            type: z2.literal(\"web_fetch_tool_result\"),\n            tool_use_id: z2.string(),\n            caller: anthropicToolCallCallerSchema().optional(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"web_fetch_result\"),\n                url: z2.string(),\n                retrieved_at: z2.string(),\n                content: z2.object({\n                  type: z2.literal(\"document\"),\n                  title: z2.string().nullable(),\n                  citations: z2.object({ enabled: z2.boolean() }).optional(),\n                  source: z2.union([\n                    z2.object({\n                      type: z2.literal(\"base64\"),\n                      media_type: z2.literal(\"application/pdf\"),\n                      data: z2.string()\n                    }),\n                    z2.object({\n                      type: z2.literal(\"text\"),\n                      media_type: z2.literal(\"text/plain\"),\n                      data: z2.string()\n                    })\n                  ])\n                })\n              }),\n              z2.object({\n                type: z2.literal(\"web_fetch_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          z2.object({\n            type: z2.literal(\"web_search_tool_result\"),\n            tool_use_id: z2.string(),\n            caller: anthropicToolCallCallerSchema().optional(),\n            content: z2.union([\n              z2.array(\n                z2.object({\n                  type: z2.literal(\"web_search_result\"),\n                  url: z2.string(),\n                  title: z2.string(),\n                  encrypted_content: z2.string(),\n                  page_age: z2.string().nullish()\n                })\n              ),\n              z2.object({\n                type: z2.literal(\"web_search_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // code execution results for code_execution_20250522 tool:\n          z2.object({\n            type: z2.literal(\"code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"code_execution_result\"),\n                stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number(),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ).optional().default([])\n              }),\n              z2.object({\n                type: z2.literal(\"encrypted_code_execution_result\"),\n                encrypted_stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number(),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ).optional().default([])\n              }),\n              z2.object({\n                type: z2.literal(\"code_execution_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // bash code execution results for code_execution_20250825 tool:\n          z2.object({\n            type: z2.literal(\"bash_code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"bash_code_execution_result\"),\n                content: z2.array(\n                  z2.object({\n                    type: z2.literal(\"bash_code_execution_output\"),\n                    file_id: z2.string()\n                  })\n                ),\n                stdout: z2.string(),\n                stderr: z2.string(),\n                return_code: z2.number()\n              }),\n              z2.object({\n                type: z2.literal(\"bash_code_execution_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // text editor code execution results for code_execution_20250825 tool:\n          z2.object({\n            type: z2.literal(\"text_editor_code_execution_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_tool_result_error\"),\n                error_code: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_view_result\"),\n                content: z2.string(),\n                file_type: z2.string(),\n                num_lines: z2.number().nullable(),\n                start_line: z2.number().nullable(),\n                total_lines: z2.number().nullable()\n              }),\n              z2.object({\n                type: z2.literal(\"text_editor_code_execution_create_result\"),\n                is_file_update: z2.boolean()\n              }),\n              z2.object({\n                type: z2.literal(\n                  \"text_editor_code_execution_str_replace_result\"\n                ),\n                lines: z2.array(z2.string()).nullable(),\n                new_lines: z2.number().nullable(),\n                new_start: z2.number().nullable(),\n                old_lines: z2.number().nullable(),\n                old_start: z2.number().nullable()\n              })\n            ])\n          }),\n          // tool search tool results for tool_search_tool_regex_20251119 and tool_search_tool_bm25_20251119:\n          z2.object({\n            type: z2.literal(\"tool_search_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.union([\n              z2.object({\n                type: z2.literal(\"tool_search_tool_search_result\"),\n                tool_references: z2.array(\n                  z2.object({\n                    type: z2.literal(\"tool_reference\"),\n                    tool_name: z2.string()\n                  })\n                )\n              }),\n              z2.object({\n                type: z2.literal(\"tool_search_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // advisor results for advisor_20260301:\n          z2.object({\n            type: z2.literal(\"advisor_tool_result\"),\n            tool_use_id: z2.string(),\n            content: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"advisor_result\"),\n                text: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"advisor_redacted_result\"),\n                encrypted_content: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"advisor_tool_result_error\"),\n                error_code: z2.string()\n              })\n            ])\n          }),\n          // Server-side fallback marker; dropped from content output (see the\n          // response schema). The hop remains observable via usage.iterations.\n          z2.object({\n            type: z2.literal(\"fallback\")\n          })\n        ])\n      }),\n      z2.object({\n        type: z2.literal(\"content_block_delta\"),\n        index: z2.number(),\n        delta: z2.discriminatedUnion(\"type\", [\n          z2.object({\n            type: z2.literal(\"input_json_delta\"),\n            partial_json: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"text_delta\"),\n            text: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"thinking_delta\"),\n            thinking: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"signature_delta\"),\n            signature: z2.string()\n          }),\n          z2.object({\n            type: z2.literal(\"compaction_delta\"),\n            content: z2.string().nullish()\n          }),\n          z2.object({\n            type: z2.literal(\"citations_delta\"),\n            citation: z2.discriminatedUnion(\"type\", [\n              z2.object({\n                type: z2.literal(\"web_search_result_location\"),\n                cited_text: z2.string(),\n                url: z2.string(),\n                title: z2.string(),\n                encrypted_index: z2.string()\n              }),\n              z2.object({\n                type: z2.literal(\"page_location\"),\n                cited_text: z2.string(),\n                document_index: z2.number(),\n                document_title: z2.string().nullable(),\n                start_page_number: z2.number(),\n                end_page_number: z2.number()\n              }),\n              z2.object({\n                type: z2.literal(\"char_location\"),\n                cited_text: z2.string(),\n                document_index: z2.number(),\n                document_title: z2.string().nullable(),\n                start_char_index: z2.number(),\n                end_char_index: z2.number()\n              })\n            ])\n          })\n        ])\n      }),\n      z2.object({\n        type: z2.literal(\"content_block_stop\"),\n        index: z2.number()\n      }),\n      z2.object({\n        type: z2.literal(\"error\"),\n        error: z2.object({\n          type: z2.string(),\n          message: z2.string()\n        })\n      }),\n      z2.object({\n        type: z2.literal(\"message_delta\"),\n        delta: z2.object({\n          stop_reason: z2.string().nullish(),\n          stop_sequence: z2.string().nullish(),\n          stop_details: anthropicStopDetailsSchema().nullish(),\n          safeguard_results: z2.array(anthropicSafeguardResultSchema()).nullish(),\n          container: z2.object({\n            expires_at: z2.string(),\n            id: z2.string(),\n            skills: z2.array(\n              z2.object({\n                type: z2.union([\n                  z2.literal(\"anthropic\"),\n                  z2.literal(\"custom\")\n                ]),\n                skill_id: z2.string(),\n                version: z2.string()\n              })\n            ).nullish()\n          }).nullish()\n        }),\n        usage: z2.looseObject({\n          input_tokens: z2.number().nullish(),\n          output_tokens: z2.number(),\n          output_tokens_details: z2.object({\n            thinking_tokens: z2.number().nullish()\n          }).nullish(),\n          cache_creation_input_tokens: z2.number().nullish(),\n          cache_read_input_tokens: z2.number().nullish(),\n          iterations: z2.array(\n            z2.object({\n              type: z2.union([\n                z2.literal(\"compaction\"),\n                z2.literal(\"message\"),\n                z2.literal(\"advisor_message\"),\n                z2.literal(\"fallback_message\")\n              ]),\n              model: z2.string().nullish(),\n              input_tokens: z2.number(),\n              output_tokens: z2.number(),\n              cache_creation_input_tokens: z2.number().nullish(),\n              cache_read_input_tokens: z2.number().nullish()\n            })\n          ).nullish()\n        }),\n        input_transformations: z2.array(anthropicInputTransformationSchema()).nullish(),\n        context_management: z2.object({\n          applied_edits: z2.array(\n            z2.union([\n              z2.object({\n                type: z2.literal(\"clear_tool_uses_20250919\"),\n                cleared_tool_uses: z2.number(),\n                cleared_input_tokens: z2.number()\n              }),\n              z2.object({\n                type: z2.literal(\"clear_thinking_20251015\"),\n                cleared_thinking_turns: z2.number(),\n                cleared_input_tokens: z2.number()\n              }),\n              z2.object({\n                type: z2.literal(\"compact_20260112\")\n              })\n            ])\n          )\n        }).nullish()\n      }),\n      z2.object({\n        type: z2.literal(\"message_stop\")\n      }),\n      z2.object({\n        type: z2.literal(\"ping\")\n      })\n    ])\n  )\n);\nvar anthropicReasoningMetadataSchema = lazySchema2(\n  () => zodSchema2(\n    z2.object({\n      signature: z2.string().optional(),\n      redactedData: z2.string().optional()\n    })\n  )\n);\n\n// src/anthropic-messages-options.ts\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\nvar anthropicFilePartProviderOptions = lazySchema3(\n  () => zodSchema3(\n    z3.object({\n      /**\n       * Citation configuration for this document.\n       * When enabled, this document will generate citations in the response.\n       */\n      citations: z3.object({\n        /**\n         * Enable citations for this document\n         */\n        enabled: z3.boolean()\n      }).optional(),\n      /**\n       * Custom title for the document.\n       * If not provided, the filename will be used.\n       */\n      title: z3.string().optional(),\n      /**\n       * Context about the document that will be passed to the model\n       * but not used towards cited content.\n       * Useful for storing document metadata as text or stringified JSON.\n       */\n      context: z3.string().optional()\n    })\n  )\n);\nvar anthropicSystemMessageProviderOptions = lazySchema3(\n  () => zodSchema3(\n    z3.object({\n      /**\n       * Clears this mid-conversation system message after the current turn.\n       *\n       * Requires the `mid-conversation-system-clear-at-2026-08-21` beta,\n       * which is added automatically.\n       */\n      clearAt: z3.literal(\"next_user_message\").optional(),\n      /**\n       * Sets the model effort from the next user turn until a later message\n       * changes it. An effort-only system message with empty content can appear\n       * first. The required `mid-conversation-output-config-2026-07-01` beta is\n       * added automatically.\n       */\n      effort: z3.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n      /**\n       * Mid-conversation tool changes. Adds or removes tools from the\n       * conversation's tool set between turns without invalidating the prompt\n       * cache.\n       *\n       * Only supported on system messages that appear mid-conversation (not the\n       * initial system prompt). A system message carrying tool changes must come\n       * right before an assistant message or at the end of the messages.\n       *\n       * Tools referenced by a `tool_addition` must be declared in the `tools`\n       * option (typically with `deferLoading: true` so they are not loaded until\n       * the addition surfaces them). The required\n       * `mid-conversation-tool-changes-2026-07-01` beta is added automatically.\n       */\n      toolChanges: z3.array(\n        z3.discriminatedUnion(\"type\", [\n          z3.object({\n            type: z3.literal(\"tool_addition\"),\n            toolName: z3.string()\n          }),\n          z3.object({\n            type: z3.literal(\"tool_removal\"),\n            toolName: z3.string()\n          })\n        ])\n      ).optional()\n    })\n  )\n);\nvar anthropicLanguageModelOptions = lazySchema3(() => {\n  const anthropicThinkingBlockBinding = z3.object({\n    prefixMismatchBehavior: z3.enum([\"error\", \"drop_block\"])\n  });\n  return zodSchema3(\n    z3.object({\n      /**\n       * Whether to send reasoning to the model.\n       *\n       * This allows you to deactivate reasoning inputs for models that do not support them.\n       */\n      sendReasoning: z3.boolean().optional(),\n      /**\n       * Determines how structured outputs are generated.\n       *\n       * - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.\n       * - `jsonTool`: Use a special 'json' tool to specify the structured output format.\n       * - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).\n       */\n      structuredOutputMode: z3.enum([\"outputFormat\", \"jsonTool\", \"auto\"]).optional(),\n      /**\n       * Configuration for enabling Claude's extended thinking.\n       *\n       * When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer.\n       * Requires a minimum budget of 1,024 tokens and counts towards the `max_tokens` limit.\n       *\n       * Models that always use adaptive thinking (e.g. `claude-opus-5-5`,\n       * `claude-fable-5-1`) reject `enabled` and `disabled`. For those models the\n       * provider drops the unsupported setting, emits a warning, and sends an\n       * adaptive thinking request. Use `effort` to control how much they think.\n       *\n       * `claude-sonnet-5-5` supports `between_tools`, its lowest thinking setting,\n       * and the provider uses it in place of `disabled` for that model.\n       */\n      thinking: z3.union([\n        z3.discriminatedUnion(\"type\", [\n          z3.object({\n            /** for Sonnet 4.6, Opus 4.6, and newer models */\n            type: z3.literal(\"adaptive\"),\n            /**\n             * Controls whether thinking content is included in the response.\n             * - `\"omitted\"`: Thinking blocks are present but text is empty (default for Opus 4.7+).\n             * - `\"summarized\"`: Thinking content is returned. Required to see reasoning output.\n             * - `\"updates\"`: Thinking updates are returned between tool calls.\n             */\n            display: z3.enum([\"omitted\", \"summarized\", \"updates\"]).optional(),\n            /**\n             * Controls how thinking blocks are bound to an assistant prefix.\n             *\n             * Requires the `thinking-binding-controls-2026-08-01` beta,\n             * which is added automatically.\n             */\n            blockBinding: anthropicThinkingBlockBinding.optional()\n          }),\n          z3.object({\n            /** for models before Opus 4.6, except Sonnet 4.6 still supports it */\n            type: z3.literal(\"enabled\"),\n            budgetTokens: z3.number().optional()\n          }),\n          z3.object({\n            type: z3.literal(\"disabled\")\n          }),\n          z3.object({\n            /**\n             * for `claude-sonnet-5-5`: no upfront thinking, but progress notes\n             * between tool calls are returned as summarized thinking blocks.\n             * Only supported at `low`, `medium`, and `high` effort.\n             */\n            type: z3.literal(\"between_tools\")\n          })\n        ]),\n        /**\n         * Configures prefix mismatch recovery without changing the model's\n         * default thinking mode.\n         */\n        z3.object({\n          blockBinding: anthropicThinkingBlockBinding\n        })\n      ]).optional(),\n      /**\n       * Whether to disable parallel function calling during tool use. Default is false.\n       * When set to true, Claude will use at most one tool per response.\n       */\n      disableParallelToolUse: z3.boolean().optional(),\n      /**\n       * Cache control settings for this message.\n       * See https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching\n       */\n      cacheControl: z3.object({\n        type: z3.literal(\"ephemeral\"),\n        ttl: z3.union([z3.literal(\"5m\"), z3.literal(\"1h\")]).optional()\n      }).optional(),\n      /**\n       * Metadata to include with the request.\n       *\n       * See https://platform.claude.com/docs/en/api/messages/create for details.\n       */\n      metadata: z3.object({\n        /**\n         * An external identifier for the user associated with the request.\n         *\n         * Should be a UUID, hash value, or other opaque identifier.\n         * Must not contain PII (name, email, phone number, etc.).\n         */\n        userId: z3.string().optional()\n      }).optional(),\n      /**\n       * MCP servers to be utilized in this request.\n       */\n      mcpServers: z3.array(\n        z3.object({\n          type: z3.literal(\"url\"),\n          name: z3.string(),\n          url: z3.string(),\n          authorizationToken: z3.string().nullish(),\n          toolConfiguration: z3.object({\n            enabled: z3.boolean().nullish(),\n            allowedTools: z3.array(z3.string()).nullish()\n          }).nullish()\n        })\n      ).optional(),\n      /**\n       * Agent Skills configuration. Skills enable Claude to perform specialized tasks\n       * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.\n       * Requires code execution tool to be enabled.\n       */\n      container: z3.object({\n        id: z3.string().optional(),\n        skills: z3.array(\n          z3.object({\n            type: z3.union([z3.literal(\"anthropic\"), z3.literal(\"custom\")]),\n            skillId: z3.string(),\n            version: z3.string().optional()\n          })\n        ).optional()\n      }).optional(),\n      /**\n       * Whether to enable fine-grained (eager) streaming of tool call inputs\n       * and structured outputs for every function tool in the request. When\n       * true (the default), each function tool receives a default of\n       * `eager_input_streaming: true` unless it explicitly sets\n       * `providerOptions.anthropic.eagerInputStreaming`.\n       *\n       * @default true\n       */\n      toolStreaming: z3.boolean().optional(),\n      /**\n       * Controls how much effort the model spends on thinking, text responses,\n       * and tool calls. On models that always use adaptive thinking\n       * (e.g. `claude-opus-5-5`), effort is the main lever for latency and cost.\n       *\n       * The API default is `high` for most models and `medium` for `claude-opus-5-5`.\n       */\n      effort: z3.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]).optional(),\n      /**\n       * Task budget for agentic turns. Informs the model of the total token budget\n       * available for the current task, allowing it to prioritize work and wind down\n       * gracefully as the budget is consumed.\n       *\n       * Advisory only — does not enforce a hard token limit.\n       */\n      taskBudget: z3.object({\n        type: z3.literal(\"tokens\"),\n        total: z3.number().int().min(2e4),\n        remaining: z3.number().int().min(0).optional()\n      }).optional(),\n      /**\n       * Enable fast mode for faster inference (2.5x faster output token speeds).\n       * Only supported with claude-opus-4-6.\n       */\n      speed: z3.enum([\"fast\", \"standard\"]).optional(),\n      /**\n       * Controls where model inference runs for this request.\n       *\n       * - `\"global\"`: Inference may run in any available geography (default).\n       * - `\"us\"`: Inference runs only in US-based infrastructure.\n       *\n       * See https://platform.claude.com/docs/en/build-with-claude/data-residency\n       */\n      inferenceGeo: z3.enum([\"us\", \"global\"]).optional(),\n      /**\n       * Server-side fallback configuration.\n       *\n       * When the primary model's safety classifiers block a turn, the API\n       * automatically retries it server-side on a fallback model. A\n       * `content-filter` finish reason means the fallback(s) refused as well.\n       *\n       * - `'default'` (recommended): the API routes the retry to Anthropic's\n       *   recommended fallback model based on the refusal category. Requires the\n       *   `server-side-fallback-2026-07-01` beta, which is added automatically.\n       * - Array form: an explicit fallback chain. Each entry is merged into the\n       *   request as a direct request to that entry's model, so it must be\n       *   formatted accordingly: `model` is required, and an entry may\n       *   additionally override `max_tokens`, `thinking`, `output_config`, and\n       *   `speed` for that attempt only (`speed` additionally requires the speed\n       *   beta). The value is passed through to the API as-is, and the\n       *   `server-side-fallback-2026-06-01` beta is added automatically.\n       */\n      fallbacks: z3.union([\n        z3.literal(\"default\"),\n        z3.array(\n          z3.object({\n            model: z3.string(),\n            max_tokens: z3.number().int().optional(),\n            thinking: z3.record(z3.string(), z3.unknown()).optional(),\n            output_config: z3.record(z3.string(), z3.unknown()).optional(),\n            speed: z3.enum([\"fast\", \"standard\"]).optional()\n          })\n        )\n      ]).optional(),\n      /**\n       * A set of beta features to enable.\n       * Allow a provider to receive the full `betas` set if it needs it.\n       */\n      anthropicBeta: z3.array(z3.string()).optional(),\n      /**\n       * Server-side safeguards to run as part of the request.\n       *\n       * `dangerous_tool_use` asks the API to classify every `tool_use` block in\n       * the response for dangerous actions (the check Claude Code's auto mode\n       * relies on). The per-call verdicts are returned in\n       * `providerMetadata.anthropic.safeguardResults`, keyed by tool call id.\n       * `classifierContext` is passed through to the API as `classifier_context`.\n       * The `dangerous-tool-use-2026-09-03` beta is added automatically.\n       */\n      safeguards: z3.array(\n        z3.object({\n          type: z3.literal(\"dangerous_tool_use\"),\n          classifierContext: z3.record(z3.string(), z3.unknown()).optional()\n        })\n      ).optional(),\n      contextManagement: z3.object({\n        edits: z3.array(\n          z3.discriminatedUnion(\"type\", [\n            z3.object({\n              type: z3.literal(\"clear_tool_uses_20250919\"),\n              trigger: z3.discriminatedUnion(\"type\", [\n                z3.object({\n                  type: z3.literal(\"input_tokens\"),\n                  value: z3.number()\n                }),\n                z3.object({\n                  type: z3.literal(\"tool_uses\"),\n                  value: z3.number()\n                })\n              ]).optional(),\n              keep: z3.object({\n                type: z3.literal(\"tool_uses\"),\n                value: z3.number()\n              }).optional(),\n              clearAtLeast: z3.object({\n                type: z3.literal(\"input_tokens\"),\n                value: z3.number()\n              }).optional(),\n              clearToolInputs: z3.boolean().optional(),\n              excludeTools: z3.array(z3.string()).optional()\n            }),\n            z3.object({\n              type: z3.literal(\"clear_thinking_20251015\"),\n              keep: z3.union([\n                z3.literal(\"all\"),\n                z3.object({\n                  type: z3.literal(\"thinking_turns\"),\n                  value: z3.number()\n                })\n              ]).optional()\n            }),\n            z3.object({\n              type: z3.literal(\"compact_20260112\"),\n              trigger: z3.object({\n                type: z3.literal(\"input_tokens\"),\n                value: z3.number()\n              }).optional(),\n              pauseAfterCompaction: z3.boolean().optional(),\n              instructions: z3.string().optional()\n            })\n          ])\n        )\n      }).optional()\n    })\n  );\n});\n\n// src/anthropic-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\n\n// src/get-cache-control.ts\nvar MAX_CACHE_BREAKPOINTS = 4;\nfunction getCacheControl(providerMetadata, providerOptionsName) {\n  var _a, _b, _c;\n  const custom = providerMetadata == null ? void 0 : providerMetadata[providerOptionsName];\n  const anthropic2 = providerMetadata == null ? void 0 : providerMetadata.anthropic;\n  const cacheControlValue = (_c = (_b = (_a = custom == null ? void 0 : custom.cacheControl) != null ? _a : custom == null ? void 0 : custom.cache_control) != null ? _b : anthropic2 == null ? void 0 : anthropic2.cacheControl) != null ? _c : anthropic2 == null ? void 0 : anthropic2.cache_control;\n  return cacheControlValue;\n}\nvar CacheControlValidator = class {\n  constructor(providerOptionsName = \"anthropic\") {\n    this.providerOptionsName = providerOptionsName;\n    this.breakpointCount = 0;\n    this.warnings = [];\n  }\n  getCacheControl(providerMetadata, context) {\n    const cacheControlValue = getCacheControl(\n      providerMetadata,\n      this.providerOptionsName\n    );\n    if (!cacheControlValue) {\n      return void 0;\n    }\n    if (!context.canCache) {\n      this.warnings.push({\n        type: \"unsupported\",\n        feature: \"cache_control on non-cacheable context\",\n        details: `cache_control cannot be set on ${context.type}. It will be ignored.`\n      });\n      return void 0;\n    }\n    this.breakpointCount++;\n    if (this.breakpointCount > MAX_CACHE_BREAKPOINTS) {\n      this.warnings.push({\n        type: \"unsupported\",\n        feature: \"cacheControl breakpoint limit\",\n        details: `Maximum ${MAX_CACHE_BREAKPOINTS} cache breakpoints exceeded (found ${this.breakpointCount}). This breakpoint will be ignored.`\n      });\n      return void 0;\n    }\n    return cacheControlValue;\n  }\n  getWarnings() {\n    return this.warnings;\n  }\n};\n\n// src/tool/advisor_20260301.ts\nimport {\n  createProviderToolFactoryWithOutputSchema,\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\nvar advisor_20260301ArgsSchema = lazySchema4(\n  () => zodSchema4(\n    z4.object({\n      model: z4.string(),\n      maxUses: z4.number().optional(),\n      caching: z4.object({\n        type: z4.literal(\"ephemeral\"),\n        ttl: z4.union([z4.literal(\"5m\"), z4.literal(\"1h\")])\n      }).optional()\n    })\n  )\n);\nvar advisor_20260301OutputSchema = lazySchema4(\n  () => zodSchema4(\n    z4.discriminatedUnion(\"type\", [\n      z4.object({\n        type: z4.literal(\"advisor_result\"),\n        text: z4.string()\n      }),\n      z4.object({\n        type: z4.literal(\"advisor_redacted_result\"),\n        encryptedContent: z4.string()\n      }),\n      z4.object({\n        type: z4.literal(\"advisor_tool_result_error\"),\n        errorCode: z4.string()\n      })\n    ])\n  )\n);\nvar advisor_20260301InputSchema = lazySchema4(\n  () => zodSchema4(z4.object({}).strict())\n);\nvar factory = createProviderToolFactoryWithOutputSchema({\n  id: \"anthropic.advisor_20260301\",\n  inputSchema: advisor_20260301InputSchema,\n  outputSchema: advisor_20260301OutputSchema,\n  supportsDeferredResults: true\n});\nvar advisor_20260301 = (args) => {\n  return factory(args);\n};\n\n// src/tool/computer-toolset_20260801.ts\nimport {\n  createProviderToolFactory,\n  lazySchema as lazySchema5,\n  zodSchema as zodSchema5\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\nvar computerToolset_20260801Members = [\n  \"screenshot\",\n  \"zoom\",\n  \"left_click\",\n  \"right_click\",\n  \"middle_click\",\n  \"double_click\",\n  \"triple_click\",\n  \"left_click_drag\",\n  \"mouse_move\",\n  \"left_mouse_down\",\n  \"left_mouse_up\",\n  \"cursor_position\",\n  \"scroll\",\n  \"type\",\n  \"key\",\n  \"hold_key\",\n  \"wait\"\n];\nvar computerToolset_20260801InputSchema = lazySchema5(\n  () => zodSchema5(\n    z5.object({\n      action: z5.enum(computerToolset_20260801Members),\n      coordinate: z5.tuple([z5.number().int(), z5.number().int()]).optional(),\n      duration: z5.number().optional(),\n      region: z5.tuple([\n        z5.number().int(),\n        z5.number().int(),\n        z5.number().int(),\n        z5.number().int()\n      ]).optional(),\n      repeat: z5.number().int().optional(),\n      scroll_amount: z5.number().optional(),\n      scroll_direction: z5.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n      start_coordinate: z5.tuple([z5.number().int(), z5.number().int()]).optional(),\n      text: z5.string().optional()\n    })\n  )\n);\nvar computerToolset_20260801ArgsSchema = lazySchema5(\n  () => zodSchema5(\n    z5.object({\n      configs: z5.partialRecord(\n        z5.enum(computerToolset_20260801Members),\n        z5.object({\n          enabled: z5.boolean().optional(),\n          deferLoading: z5.boolean().optional()\n        })\n      ).optional()\n    })\n  )\n);\nvar computerToolset_20260801 = createProviderToolFactory({\n  id: \"anthropic.computer_toolset_20260801\",\n  inputSchema: computerToolset_20260801InputSchema\n});\n\n// src/tool/text-editor_20250728.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory2,\n  lazySchema as lazySchema6,\n  zodSchema as zodSchema6\n} from \"@ai-sdk/provider-utils\";\nimport { z as z6 } from \"zod/v4\";\nvar textEditor_20250728ArgsSchema = lazySchema6(\n  () => zodSchema6(\n    z6.object({\n      maxCharacters: z6.number().optional()\n    })\n  )\n);\nvar textEditor_20250728InputSchema = lazySchema6(\n  () => zodSchema6(\n    z6.object({\n      command: z6.enum([\"view\", \"create\", \"str_replace\", \"insert\"]),\n      path: z6.string(),\n      file_text: z6.string().optional(),\n      insert_line: z6.number().int().optional(),\n      new_str: z6.string().optional(),\n      insert_text: z6.string().optional(),\n      old_str: z6.string().optional(),\n      view_range: z6.array(z6.number().int()).optional()\n    })\n  )\n);\nvar factory2 = createProviderToolFactory2({\n  id: \"anthropic.text_editor_20250728\",\n  inputSchema: textEditor_20250728InputSchema\n});\nvar textEditor_20250728 = (args = {}) => {\n  return factory2(args);\n};\n\n// src/tool/web-search_20260209.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,\n  lazySchema as lazySchema7,\n  zodSchema as zodSchema7\n} from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\nvar webSearch_20260209ArgsSchema = lazySchema7(\n  () => zodSchema7(\n    z7.object({\n      maxUses: z7.number().optional(),\n      allowedDomains: z7.array(z7.string()).optional(),\n      blockedDomains: z7.array(z7.string()).optional(),\n      userLocation: z7.object({\n        type: z7.literal(\"approximate\"),\n        city: z7.string().optional(),\n        region: z7.string().optional(),\n        country: z7.string().optional(),\n        timezone: z7.string().optional()\n      }).optional()\n    })\n  )\n);\nvar webSearch_20260209OutputSchema = lazySchema7(\n  () => zodSchema7(\n    z7.array(\n      z7.object({\n        url: z7.string(),\n        title: z7.string().nullable(),\n        pageAge: z7.string().nullable(),\n        encryptedContent: z7.string(),\n        type: z7.literal(\"web_search_result\")\n      })\n    )\n  )\n);\nvar webSearch_20260209InputSchema = lazySchema7(\n  () => zodSchema7(\n    z7.object({\n      query: z7.string()\n    })\n  )\n);\nvar factory3 = createProviderToolFactoryWithOutputSchema2({\n  id: \"anthropic.web_search_20260209\",\n  inputSchema: webSearch_20260209InputSchema,\n  outputSchema: webSearch_20260209OutputSchema,\n  supportsDeferredResults: true\n});\nvar webSearch_20260209 = (args = {}) => {\n  return factory3(args);\n};\n\n// src/tool/web-search_20250305.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,\n  lazySchema as lazySchema8,\n  zodSchema as zodSchema8\n} from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\nvar webSearch_20250305ArgsSchema = lazySchema8(\n  () => zodSchema8(\n    z8.object({\n      maxUses: z8.number().optional(),\n      allowedDomains: z8.array(z8.string()).optional(),\n      blockedDomains: z8.array(z8.string()).optional(),\n      userLocation: z8.object({\n        type: z8.literal(\"approximate\"),\n        city: z8.string().optional(),\n        region: z8.string().optional(),\n        country: z8.string().optional(),\n        timezone: z8.string().optional()\n      }).optional()\n    })\n  )\n);\nvar webSearch_20250305OutputSchema = lazySchema8(\n  () => zodSchema8(\n    z8.array(\n      z8.object({\n        url: z8.string(),\n        title: z8.string().nullable(),\n        pageAge: z8.string().nullable(),\n        encryptedContent: z8.string(),\n        type: z8.literal(\"web_search_result\")\n      })\n    )\n  )\n);\nvar webSearch_20250305InputSchema = lazySchema8(\n  () => zodSchema8(\n    z8.object({\n      query: z8.string()\n    })\n  )\n);\nvar factory4 = createProviderToolFactoryWithOutputSchema3({\n  id: \"anthropic.web_search_20250305\",\n  inputSchema: webSearch_20250305InputSchema,\n  outputSchema: webSearch_20250305OutputSchema,\n  supportsDeferredResults: true\n});\nvar webSearch_20250305 = (args = {}) => {\n  return factory4(args);\n};\n\n// src/tool/web-fetch-20260209.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,\n  lazySchema as lazySchema9,\n  zodSchema as zodSchema9\n} from \"@ai-sdk/provider-utils\";\nimport { z as z9 } from \"zod/v4\";\nvar webFetch_20260209ArgsSchema = lazySchema9(\n  () => zodSchema9(\n    z9.object({\n      maxUses: z9.number().optional(),\n      allowedDomains: z9.array(z9.string()).optional(),\n      blockedDomains: z9.array(z9.string()).optional(),\n      citations: z9.object({ enabled: z9.boolean() }).optional(),\n      maxContentTokens: z9.number().optional()\n    })\n  )\n);\nvar webFetch_20260209OutputSchema = lazySchema9(\n  () => zodSchema9(\n    z9.object({\n      type: z9.literal(\"web_fetch_result\"),\n      url: z9.string(),\n      content: z9.object({\n        type: z9.literal(\"document\"),\n        title: z9.string().nullable(),\n        citations: z9.object({ enabled: z9.boolean() }).optional(),\n        source: z9.union([\n          z9.object({\n            type: z9.literal(\"base64\"),\n            mediaType: z9.literal(\"application/pdf\"),\n            data: z9.string()\n          }),\n          z9.object({\n            type: z9.literal(\"text\"),\n            mediaType: z9.literal(\"text/plain\"),\n            data: z9.string()\n          })\n        ])\n      }),\n      retrievedAt: z9.string().nullable()\n    })\n  )\n);\nvar webFetch_20260209InputSchema = lazySchema9(\n  () => zodSchema9(\n    z9.object({\n      url: z9.string()\n    })\n  )\n);\nvar factory5 = createProviderToolFactoryWithOutputSchema4({\n  id: \"anthropic.web_fetch_20260209\",\n  inputSchema: webFetch_20260209InputSchema,\n  outputSchema: webFetch_20260209OutputSchema,\n  supportsDeferredResults: true\n});\nvar webFetch_20260209 = (args = {}) => {\n  return factory5(args);\n};\n\n// src/tool/web-fetch-20250910.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5,\n  lazySchema as lazySchema10,\n  zodSchema as zodSchema10\n} from \"@ai-sdk/provider-utils\";\nimport { z as z10 } from \"zod/v4\";\nvar webFetch_20250910ArgsSchema = lazySchema10(\n  () => zodSchema10(\n    z10.object({\n      maxUses: z10.number().optional(),\n      allowedDomains: z10.array(z10.string()).optional(),\n      blockedDomains: z10.array(z10.string()).optional(),\n      citations: z10.object({ enabled: z10.boolean() }).optional(),\n      maxContentTokens: z10.number().optional()\n    })\n  )\n);\nvar webFetch_20250910OutputSchema = lazySchema10(\n  () => zodSchema10(\n    z10.object({\n      type: z10.literal(\"web_fetch_result\"),\n      url: z10.string(),\n      content: z10.object({\n        type: z10.literal(\"document\"),\n        title: z10.string().nullable(),\n        citations: z10.object({ enabled: z10.boolean() }).optional(),\n        source: z10.union([\n          z10.object({\n            type: z10.literal(\"base64\"),\n            mediaType: z10.literal(\"application/pdf\"),\n            data: z10.string()\n          }),\n          z10.object({\n            type: z10.literal(\"text\"),\n            mediaType: z10.literal(\"text/plain\"),\n            data: z10.string()\n          })\n        ])\n      }),\n      retrievedAt: z10.string().nullable()\n    })\n  )\n);\nvar webFetch_20250910InputSchema = lazySchema10(\n  () => zodSchema10(\n    z10.object({\n      url: z10.string()\n    })\n  )\n);\nvar factory6 = createProviderToolFactoryWithOutputSchema5({\n  id: \"anthropic.web_fetch_20250910\",\n  inputSchema: webFetch_20250910InputSchema,\n  outputSchema: webFetch_20250910OutputSchema,\n  supportsDeferredResults: true\n});\nvar webFetch_20250910 = (args = {}) => {\n  return factory6(args);\n};\n\n// src/anthropic-prepare-tools.ts\nimport { validateTypes } from \"@ai-sdk/provider-utils\";\nasync function prepareTools({\n  tools,\n  toolChoice,\n  disableParallelToolUse,\n  cacheControlValidator,\n  supportsStructuredOutput,\n  supportsStrictTools,\n  defaultEagerInputStreaming = false,\n  rejectsForcedToolUse = false\n}) {\n  var _a, _b;\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  const betas = /* @__PURE__ */ new Set();\n  const validator = cacheControlValidator || new CacheControlValidator();\n  if (tools == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings, betas };\n  }\n  const anthropicTools2 = [];\n  for (const tool of tools) {\n    switch (tool.type) {\n      case \"function\": {\n        const cacheControl = validator.getCacheControl(tool.providerOptions, {\n          type: \"tool definition\",\n          canCache: true\n        });\n        const anthropicOptions = (_a = tool.providerOptions) == null ? void 0 : _a.anthropic;\n        const eagerInputStreaming = (_b = anthropicOptions == null ? void 0 : anthropicOptions.eagerInputStreaming) != null ? _b : defaultEagerInputStreaming;\n        const deferLoading = anthropicOptions == null ? void 0 : anthropicOptions.deferLoading;\n        const allowedCallers = anthropicOptions == null ? void 0 : anthropicOptions.allowedCallers;\n        if (!supportsStrictTools && tool.strict != null) {\n          toolWarnings.push({\n            type: \"unsupported\",\n            feature: \"strict\",\n            details: `Tool '${tool.name}' has strict: ${tool.strict}, but strict mode is not supported by this provider. The strict property will be ignored.`\n          });\n        }\n        anthropicTools2.push({\n          name: tool.name,\n          description: tool.description,\n          input_schema: tool.inputSchema,\n          cache_control: cacheControl,\n          ...eagerInputStreaming ? { eager_input_streaming: true } : {},\n          ...supportsStrictTools === true && tool.strict != null ? { strict: tool.strict } : {},\n          ...deferLoading != null ? { defer_loading: deferLoading } : {},\n          ...allowedCallers != null ? { allowed_callers: allowedCallers } : {},\n          ...tool.inputExamples != null ? {\n            input_examples: tool.inputExamples.map(\n              (example) => example.input\n            )\n          } : {}\n        });\n        if (supportsStructuredOutput === true) {\n          betas.add(\"structured-outputs-2025-11-13\");\n        }\n        if (tool.inputExamples != null || allowedCallers != null) {\n          betas.add(\"advanced-tool-use-2025-11-20\");\n        }\n        break;\n      }\n      case \"provider\": {\n        switch (tool.id) {\n          case \"anthropic.code_execution_20250522\": {\n            betas.add(\"code-execution-2025-05-22\");\n            anthropicTools2.push({\n              type: \"code_execution_20250522\",\n              name: \"code_execution\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.code_execution_20250825\": {\n            betas.add(\"code-execution-2025-08-25\");\n            anthropicTools2.push({\n              type: \"code_execution_20250825\",\n              name: \"code_execution\"\n            });\n            break;\n          }\n          case \"anthropic.code_execution_20260120\": {\n            anthropicTools2.push({\n              type: \"code_execution_20260120\",\n              name: \"code_execution\"\n            });\n            break;\n          }\n          case \"anthropic.computer_20250124\": {\n            betas.add(\"computer-use-2025-01-24\");\n            anthropicTools2.push({\n              name: \"computer\",\n              type: \"computer_20250124\",\n              display_width_px: tool.args.displayWidthPx,\n              display_height_px: tool.args.displayHeightPx,\n              display_number: tool.args.displayNumber,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.computer_20251124\": {\n            betas.add(\"computer-use-2025-11-24\");\n            anthropicTools2.push({\n              name: \"computer\",\n              type: \"computer_20251124\",\n              display_width_px: tool.args.displayWidthPx,\n              display_height_px: tool.args.displayHeightPx,\n              display_number: tool.args.displayNumber,\n              enable_zoom: tool.args.enableZoom,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.computer_toolset_20260801\": {\n            const args = await validateTypes({\n              value: tool.args,\n              schema: computerToolset_20260801ArgsSchema\n            });\n            const configs = args.configs != null ? Object.fromEntries(\n              Object.entries(args.configs).map(([member, config]) => [\n                member,\n                {\n                  ...(config == null ? void 0 : config.enabled) != null && {\n                    enabled: config.enabled\n                  },\n                  ...(config == null ? void 0 : config.deferLoading) != null && {\n                    defer_loading: config.deferLoading\n                  }\n                }\n              ])\n            ) : void 0;\n            anthropicTools2.push({\n              type: \"computer_toolset_20260801\",\n              ...configs != null && { configs },\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.computer_20241022\": {\n            betas.add(\"computer-use-2024-10-22\");\n            anthropicTools2.push({\n              name: \"computer\",\n              type: \"computer_20241022\",\n              display_width_px: tool.args.displayWidthPx,\n              display_height_px: tool.args.displayHeightPx,\n              display_number: tool.args.displayNumber,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.text_editor_20250124\": {\n            betas.add(\"computer-use-2025-01-24\");\n            anthropicTools2.push({\n              name: \"str_replace_editor\",\n              type: \"text_editor_20250124\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.text_editor_20241022\": {\n            betas.add(\"computer-use-2024-10-22\");\n            anthropicTools2.push({\n              name: \"str_replace_editor\",\n              type: \"text_editor_20241022\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.text_editor_20250429\": {\n            betas.add(\"computer-use-2025-01-24\");\n            anthropicTools2.push({\n              name: \"str_replace_based_edit_tool\",\n              type: \"text_editor_20250429\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.text_editor_20250728\": {\n            const args = await validateTypes({\n              value: tool.args,\n              schema: textEditor_20250728ArgsSchema\n            });\n            anthropicTools2.push({\n              name: \"str_replace_based_edit_tool\",\n              type: \"text_editor_20250728\",\n              max_characters: args.maxCharacters,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.bash_20250124\": {\n            betas.add(\"computer-use-2025-01-24\");\n            anthropicTools2.push({\n              name: \"bash\",\n              type: \"bash_20250124\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.bash_20241022\": {\n            betas.add(\"computer-use-2024-10-22\");\n            anthropicTools2.push({\n              name: \"bash\",\n              type: \"bash_20241022\",\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.memory_20250818\": {\n            betas.add(\"context-management-2025-06-27\");\n            anthropicTools2.push({\n              name: \"memory\",\n              type: \"memory_20250818\"\n            });\n            break;\n          }\n          case \"anthropic.web_fetch_20250910\": {\n            betas.add(\"web-fetch-2025-09-10\");\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webFetch_20250910ArgsSchema\n            });\n            anthropicTools2.push({\n              type: \"web_fetch_20250910\",\n              name: \"web_fetch\",\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              citations: args.citations,\n              max_content_tokens: args.maxContentTokens,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.web_fetch_20260209\": {\n            betas.add(\"code-execution-web-tools-2026-02-09\");\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webFetch_20260209ArgsSchema\n            });\n            anthropicTools2.push({\n              type: \"web_fetch_20260209\",\n              name: \"web_fetch\",\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              citations: args.citations,\n              max_content_tokens: args.maxContentTokens,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.web_search_20250305\": {\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webSearch_20250305ArgsSchema\n            });\n            anthropicTools2.push({\n              type: \"web_search_20250305\",\n              name: \"web_search\",\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              user_location: args.userLocation,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.web_search_20260209\": {\n            betas.add(\"code-execution-web-tools-2026-02-09\");\n            const args = await validateTypes({\n              value: tool.args,\n              schema: webSearch_20260209ArgsSchema\n            });\n            anthropicTools2.push({\n              type: \"web_search_20260209\",\n              name: \"web_search\",\n              max_uses: args.maxUses,\n              allowed_domains: args.allowedDomains,\n              blocked_domains: args.blockedDomains,\n              user_location: args.userLocation,\n              cache_control: void 0\n            });\n            break;\n          }\n          case \"anthropic.tool_search_regex_20251119\": {\n            anthropicTools2.push({\n              type: \"tool_search_tool_regex_20251119\",\n              name: \"tool_search_tool_regex\"\n            });\n            break;\n          }\n          case \"anthropic.tool_search_bm25_20251119\": {\n            anthropicTools2.push({\n              type: \"tool_search_tool_bm25_20251119\",\n              name: \"tool_search_tool_bm25\"\n            });\n            break;\n          }\n          case \"anthropic.advisor_20260301\": {\n            betas.add(\"advisor-tool-2026-03-01\");\n            const args = await validateTypes({\n              value: tool.args,\n              schema: advisor_20260301ArgsSchema\n            });\n            anthropicTools2.push({\n              type: \"advisor_20260301\",\n              name: \"advisor\",\n              model: args.model,\n              ...args.maxUses !== void 0 && { max_uses: args.maxUses },\n              ...args.caching !== void 0 && { caching: args.caching }\n            });\n            break;\n          }\n          default: {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`\n            });\n            break;\n          }\n        }\n        break;\n      }\n      default: {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `tool ${tool}`\n        });\n        break;\n      }\n    }\n  }\n  if (toolChoice == null) {\n    return {\n      tools: anthropicTools2,\n      toolChoice: disableParallelToolUse ? { type: \"auto\", disable_parallel_tool_use: disableParallelToolUse } : void 0,\n      toolWarnings,\n      betas\n    };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n      return {\n        tools: anthropicTools2,\n        toolChoice: {\n          type: \"auto\",\n          disable_parallel_tool_use: disableParallelToolUse\n        },\n        toolWarnings,\n        betas\n      };\n    case \"required\":\n      if (rejectsForcedToolUse) {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: \"toolChoice\",\n          details: `toolChoice 'required' is not supported with this model or thinking configuration. Using 'auto' instead. Instruct the model to use a tool in the prompt and verify that a tool call was made.`\n        });\n        return {\n          tools: anthropicTools2,\n          toolChoice: {\n            type: \"auto\",\n            disable_parallel_tool_use: disableParallelToolUse\n          },\n          toolWarnings,\n          betas\n        };\n      }\n      return {\n        tools: anthropicTools2,\n        toolChoice: {\n          type: \"any\",\n          disable_parallel_tool_use: disableParallelToolUse\n        },\n        toolWarnings,\n        betas\n      };\n    case \"none\":\n      return {\n        tools: anthropicTools2,\n        toolChoice: { type: \"none\" },\n        toolWarnings,\n        betas\n      };\n    case \"tool\":\n      if (rejectsForcedToolUse) {\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: \"toolChoice\",\n          details: `toolChoice 'tool' is not supported with this model or thinking configuration. Only the '${toolChoice.toolName}' tool is sent with 'auto' tool choice. Instruct the model to use the tool in the prompt and verify that a tool call was made.`\n        });\n        return {\n          tools: anthropicTools2.filter(\n            (tool) => \"name\" in tool && tool.name === toolChoice.toolName\n          ),\n          toolChoice: {\n            type: \"auto\",\n            disable_parallel_tool_use: disableParallelToolUse\n          },\n          toolWarnings,\n          betas\n        };\n      }\n      return {\n        tools: anthropicTools2,\n        toolChoice: {\n          type: \"tool\",\n          name: toolChoice.toolName,\n          disable_parallel_tool_use: disableParallelToolUse\n        },\n        toolWarnings,\n        betas\n      };\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\n\n// src/convert-anthropic-messages-usage.ts\nfunction convertAnthropicMessagesUsage({\n  usage,\n  rawUsage\n}) {\n  var _a, _b, _c, _d, _e;\n  const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;\n  const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;\n  const reasoningTokens = (_d = (_c = usage.output_tokens_details) == null ? void 0 : _c.thinking_tokens) != null ? _d : void 0;\n  let inputTokens;\n  let outputTokens;\n  const servedByFallback = (_e = usage.iterations) == null ? void 0 : _e.some(\n    (iter) => iter.type === \"fallback_message\"\n  );\n  if (usage.iterations && usage.iterations.length > 0 && !servedByFallback) {\n    const executorIterations = usage.iterations.filter(\n      (iter) => iter.type === \"compaction\" || iter.type === \"message\"\n    );\n    if (executorIterations.length > 0) {\n      const totals = executorIterations.reduce(\n        (acc, iter) => ({\n          input: acc.input + iter.input_tokens,\n          output: acc.output + iter.output_tokens\n        }),\n        { input: 0, output: 0 }\n      );\n      inputTokens = totals.input;\n      outputTokens = totals.output;\n    } else {\n      inputTokens = usage.input_tokens;\n      outputTokens = usage.output_tokens;\n    }\n  } else {\n    inputTokens = usage.input_tokens;\n    outputTokens = usage.output_tokens;\n  }\n  return {\n    inputTokens: {\n      total: inputTokens + cacheCreationTokens + cacheReadTokens,\n      noCache: inputTokens,\n      cacheRead: cacheReadTokens,\n      cacheWrite: cacheCreationTokens\n    },\n    outputTokens: {\n      total: outputTokens,\n      text: reasoningTokens == null ? void 0 : outputTokens - reasoningTokens,\n      reasoning: reasoningTokens\n    },\n    raw: rawUsage != null ? rawUsage : usage\n  };\n}\n\n// src/convert-to-anthropic-messages-prompt.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nimport {\n  convertBase64ToUint8Array,\n  convertToBase64,\n  parseProviderOptions,\n  safeParseJSON,\n  isNonNullable,\n  secureJsonParse,\n  validateTypes as validateTypes2\n} from \"@ai-sdk/provider-utils\";\n\n// src/tool/code-execution_20250522.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6,\n  lazySchema as lazySchema11,\n  zodSchema as zodSchema11\n} from \"@ai-sdk/provider-utils\";\nimport { z as z11 } from \"zod/v4\";\nvar codeExecution_20250522OutputSchema = lazySchema11(\n  () => zodSchema11(\n    z11.object({\n      type: z11.literal(\"code_execution_result\"),\n      stdout: z11.string(),\n      stderr: z11.string(),\n      return_code: z11.number(),\n      content: z11.array(\n        z11.object({\n          type: z11.literal(\"code_execution_output\"),\n          file_id: z11.string()\n        })\n      ).optional().default([])\n    })\n  )\n);\nvar codeExecution_20250522InputSchema = lazySchema11(\n  () => zodSchema11(\n    z11.object({\n      code: z11.string()\n    })\n  )\n);\nvar factory7 = createProviderToolFactoryWithOutputSchema6({\n  id: \"anthropic.code_execution_20250522\",\n  inputSchema: codeExecution_20250522InputSchema,\n  outputSchema: codeExecution_20250522OutputSchema\n});\nvar codeExecution_20250522 = (args = {}) => {\n  return factory7(args);\n};\n\n// src/tool/code-execution_20250825.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7,\n  lazySchema as lazySchema12,\n  zodSchema as zodSchema12\n} from \"@ai-sdk/provider-utils\";\nimport { z as z12 } from \"zod/v4\";\nvar codeExecution_20250825OutputSchema = lazySchema12(\n  () => zodSchema12(\n    z12.discriminatedUnion(\"type\", [\n      z12.object({\n        type: z12.literal(\"code_execution_result\"),\n        stdout: z12.string(),\n        stderr: z12.string(),\n        return_code: z12.number(),\n        content: z12.array(\n          z12.object({\n            type: z12.literal(\"code_execution_output\"),\n            file_id: z12.string()\n          })\n        ).optional().default([])\n      }),\n      z12.object({\n        type: z12.literal(\"bash_code_execution_result\"),\n        content: z12.array(\n          z12.object({\n            type: z12.literal(\"bash_code_execution_output\"),\n            file_id: z12.string()\n          })\n        ),\n        stdout: z12.string(),\n        stderr: z12.string(),\n        return_code: z12.number()\n      }),\n      z12.object({\n        type: z12.literal(\"bash_code_execution_tool_result_error\"),\n        error_code: z12.string()\n      }),\n      z12.object({\n        type: z12.literal(\"text_editor_code_execution_tool_result_error\"),\n        error_code: z12.string()\n      }),\n      z12.object({\n        type: z12.literal(\"text_editor_code_execution_view_result\"),\n        content: z12.string(),\n        file_type: z12.string(),\n        num_lines: z12.number().nullable(),\n        start_line: z12.number().nullable(),\n        total_lines: z12.number().nullable()\n      }),\n      z12.object({\n        type: z12.literal(\"text_editor_code_execution_create_result\"),\n        is_file_update: z12.boolean()\n      }),\n      z12.object({\n        type: z12.literal(\"text_editor_code_execution_str_replace_result\"),\n        lines: z12.array(z12.string()).nullable(),\n        new_lines: z12.number().nullable(),\n        new_start: z12.number().nullable(),\n        old_lines: z12.number().nullable(),\n        old_start: z12.number().nullable()\n      })\n    ])\n  )\n);\nvar codeExecution_20250825InputSchema = lazySchema12(\n  () => zodSchema12(\n    z12.discriminatedUnion(\"type\", [\n      // Programmatic tool calling format (mapped from { code } by AI SDK)\n      z12.object({\n        type: z12.literal(\"programmatic-tool-call\"),\n        code: z12.string()\n      }),\n      z12.object({\n        type: z12.literal(\"bash_code_execution\"),\n        command: z12.string()\n      }),\n      z12.discriminatedUnion(\"command\", [\n        z12.object({\n          type: z12.literal(\"text_editor_code_execution\"),\n          command: z12.literal(\"view\"),\n          path: z12.string()\n        }),\n        z12.object({\n          type: z12.literal(\"text_editor_code_execution\"),\n          command: z12.literal(\"create\"),\n          path: z12.string(),\n          file_text: z12.string().nullish()\n        }),\n        z12.object({\n          type: z12.literal(\"text_editor_code_execution\"),\n          command: z12.literal(\"str_replace\"),\n          path: z12.string(),\n          old_str: z12.string(),\n          new_str: z12.string()\n        })\n      ])\n    ])\n  )\n);\nvar factory8 = createProviderToolFactoryWithOutputSchema7({\n  id: \"anthropic.code_execution_20250825\",\n  inputSchema: codeExecution_20250825InputSchema,\n  outputSchema: codeExecution_20250825OutputSchema,\n  // Programmatic tool calling: tool results may be deferred to a later turn\n  // when code execution triggers a client-executed tool that needs to be\n  // resolved before the code execution result can be returned.\n  supportsDeferredResults: true\n});\nvar codeExecution_20250825 = (args = {}) => {\n  return factory8(args);\n};\n\n// src/tool/code-execution_20260120.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema8,\n  lazySchema as lazySchema13,\n  zodSchema as zodSchema13\n} from \"@ai-sdk/provider-utils\";\nimport { z as z13 } from \"zod/v4\";\nvar codeExecution_20260120OutputSchema = lazySchema13(\n  () => zodSchema13(\n    z13.discriminatedUnion(\"type\", [\n      z13.object({\n        type: z13.literal(\"code_execution_result\"),\n        stdout: z13.string(),\n        stderr: z13.string(),\n        return_code: z13.number(),\n        content: z13.array(\n          z13.object({\n            type: z13.literal(\"code_execution_output\"),\n            file_id: z13.string()\n          })\n        ).optional().default([])\n      }),\n      z13.object({\n        type: z13.literal(\"encrypted_code_execution_result\"),\n        encrypted_stdout: z13.string(),\n        stderr: z13.string(),\n        return_code: z13.number(),\n        content: z13.array(\n          z13.object({\n            type: z13.literal(\"code_execution_output\"),\n            file_id: z13.string()\n          })\n        ).optional().default([])\n      }),\n      z13.object({\n        type: z13.literal(\"bash_code_execution_result\"),\n        content: z13.array(\n          z13.object({\n            type: z13.literal(\"bash_code_execution_output\"),\n            file_id: z13.string()\n          })\n        ),\n        stdout: z13.string(),\n        stderr: z13.string(),\n        return_code: z13.number()\n      }),\n      z13.object({\n        type: z13.literal(\"bash_code_execution_tool_result_error\"),\n        error_code: z13.string()\n      }),\n      z13.object({\n        type: z13.literal(\"text_editor_code_execution_tool_result_error\"),\n        error_code: z13.string()\n      }),\n      z13.object({\n        type: z13.literal(\"text_editor_code_execution_view_result\"),\n        content: z13.string(),\n        file_type: z13.string(),\n        num_lines: z13.number().nullable(),\n        start_line: z13.number().nullable(),\n        total_lines: z13.number().nullable()\n      }),\n      z13.object({\n        type: z13.literal(\"text_editor_code_execution_create_result\"),\n        is_file_update: z13.boolean()\n      }),\n      z13.object({\n        type: z13.literal(\"text_editor_code_execution_str_replace_result\"),\n        lines: z13.array(z13.string()).nullable(),\n        new_lines: z13.number().nullable(),\n        new_start: z13.number().nullable(),\n        old_lines: z13.number().nullable(),\n        old_start: z13.number().nullable()\n      })\n    ])\n  )\n);\nvar codeExecution_20260120InputSchema = lazySchema13(\n  () => zodSchema13(\n    z13.discriminatedUnion(\"type\", [\n      z13.object({\n        type: z13.literal(\"programmatic-tool-call\"),\n        code: z13.string()\n      }),\n      z13.object({\n        type: z13.literal(\"bash_code_execution\"),\n        command: z13.string()\n      }),\n      z13.discriminatedUnion(\"command\", [\n        z13.object({\n          type: z13.literal(\"text_editor_code_execution\"),\n          command: z13.literal(\"view\"),\n          path: z13.string()\n        }),\n        z13.object({\n          type: z13.literal(\"text_editor_code_execution\"),\n          command: z13.literal(\"create\"),\n          path: z13.string(),\n          file_text: z13.string().nullish()\n        }),\n        z13.object({\n          type: z13.literal(\"text_editor_code_execution\"),\n          command: z13.literal(\"str_replace\"),\n          path: z13.string(),\n          old_str: z13.string(),\n          new_str: z13.string()\n        })\n      ])\n    ])\n  )\n);\nvar factory9 = createProviderToolFactoryWithOutputSchema8({\n  id: \"anthropic.code_execution_20260120\",\n  inputSchema: codeExecution_20260120InputSchema,\n  outputSchema: codeExecution_20260120OutputSchema,\n  supportsDeferredResults: true\n});\nvar codeExecution_20260120 = (args = {}) => {\n  return factory9(args);\n};\n\n// src/tool/tool-search-regex_20251119.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema9,\n  lazySchema as lazySchema14,\n  zodSchema as zodSchema14\n} from \"@ai-sdk/provider-utils\";\nimport { z as z14 } from \"zod/v4\";\nvar toolSearchRegex_20251119OutputSchema = lazySchema14(\n  () => zodSchema14(\n    z14.array(\n      z14.object({\n        type: z14.literal(\"tool_reference\"),\n        toolName: z14.string()\n      })\n    )\n  )\n);\nvar toolSearchRegex_20251119InputSchema = lazySchema14(\n  () => zodSchema14(\n    z14.object({\n      /**\n       * A regex pattern to search for tools.\n       * Uses Python re.search() syntax. Maximum 200 characters.\n       *\n       * Examples:\n       * - \"weather\" - matches tool names/descriptions containing \"weather\"\n       * - \"get_.*_data\" - matches tools like get_user_data, get_weather_data\n       * - \"database.*query|query.*database\" - OR patterns for flexibility\n       * - \"(?i)slack\" - case-insensitive search\n       */\n      pattern: z14.string(),\n      /**\n       * Maximum number of tools to return. Optional.\n       */\n      limit: z14.number().optional()\n    })\n  )\n);\nvar factory10 = createProviderToolFactoryWithOutputSchema9({\n  id: \"anthropic.tool_search_regex_20251119\",\n  inputSchema: toolSearchRegex_20251119InputSchema,\n  outputSchema: toolSearchRegex_20251119OutputSchema,\n  supportsDeferredResults: true\n});\nvar toolSearchRegex_20251119 = (args = {}) => {\n  return factory10(args);\n};\n\n// src/convert-to-anthropic-messages-prompt.ts\nfunction convertToString(data) {\n  if (typeof data === \"string\") {\n    return new TextDecoder().decode(convertBase64ToUint8Array(data));\n  }\n  if (data instanceof Uint8Array) {\n    return new TextDecoder().decode(data);\n  }\n  if (data instanceof URL) {\n    throw new UnsupportedFunctionalityError2({\n      functionality: \"URL-based text documents are not supported for citations\"\n    });\n  }\n  throw new UnsupportedFunctionalityError2({\n    functionality: `unsupported data type for text documents: ${typeof data}`\n  });\n}\nfunction isUrlData(data) {\n  return data instanceof URL || isUrlString(data);\n}\nfunction isUrlString(data) {\n  return typeof data === \"string\" && /^https?:\\/\\//i.test(data);\n}\nfunction getUrlString(data) {\n  return data instanceof URL ? data.toString() : data;\n}\nasync function extractErrorValue(value) {\n  if (typeof value === \"string\") {\n    const result = await safeParseJSON({ text: value });\n    if (result.success && typeof result.value === \"object\" && result.value !== null) {\n      return result.value;\n    }\n    return {\n      errorCode: \"unavailable\"\n    };\n  }\n  if (typeof value === \"object\" && value !== null) {\n    return value;\n  }\n  return {};\n}\nasync function convertToAnthropicMessagesPrompt({\n  prompt,\n  sendReasoning,\n  warnings,\n  cacheControlValidator,\n  toolNameMapping,\n  toolsetNames = {},\n  convertMediaPart\n}) {\n  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;\n  const betas = /* @__PURE__ */ new Set();\n  const blocks = groupIntoBlocks(prompt);\n  const validator = cacheControlValidator || new CacheControlValidator();\n  let system = void 0;\n  const messages = [];\n  let lastUserMessageIndex = -1;\n  async function shouldEnableCitations(providerMetadata) {\n    var _a2, _b2;\n    const anthropicOptions = await parseProviderOptions({\n      provider: \"anthropic\",\n      providerOptions: providerMetadata,\n      schema: anthropicFilePartProviderOptions\n    });\n    return (_b2 = (_a2 = anthropicOptions == null ? void 0 : anthropicOptions.citations) == null ? void 0 : _a2.enabled) != null ? _b2 : false;\n  }\n  async function getDocumentMetadata(providerMetadata) {\n    const anthropicOptions = await parseProviderOptions({\n      provider: \"anthropic\",\n      providerOptions: providerMetadata,\n      schema: anthropicFilePartProviderOptions\n    });\n    return {\n      title: anthropicOptions == null ? void 0 : anthropicOptions.title,\n      context: anthropicOptions == null ? void 0 : anthropicOptions.context\n    };\n  }\n  for (let i = 0; i < blocks.length; i++) {\n    const block = blocks[i];\n    const isLastBlock = i === blocks.length - 1;\n    const type = block.type;\n    switch (type) {\n      case \"system\": {\n        const systemMessages = [];\n        let toolChangeCount = 0;\n        let hasMidConversationOptions = false;\n        for (const { content: text, providerOptions } of block.messages) {\n          const systemMessageOptions = await parseProviderOptions({\n            provider: \"anthropic\",\n            providerOptions,\n            schema: anthropicSystemMessageProviderOptions\n          });\n          const toolChanges = (_a = systemMessageOptions == null ? void 0 : systemMessageOptions.toolChanges) != null ? _a : [];\n          const clearAt = systemMessageOptions == null ? void 0 : systemMessageOptions.clearAt;\n          const effort = systemMessageOptions == null ? void 0 : systemMessageOptions.effort;\n          const content = [];\n          if (text !== \"\" || toolChanges.length === 0 && clearAt == null && effort == null) {\n            content.push({\n              type: \"text\",\n              text,\n              cache_control: validator.getCacheControl(providerOptions, {\n                type: \"system message\",\n                canCache: true\n              })\n            });\n          }\n          for (const toolChange of toolChanges) {\n            toolChangeCount++;\n            content.push({\n              type: toolChange.type,\n              tool: {\n                type: \"tool_reference\",\n                name: toolNameMapping.toProviderToolName(toolChange.toolName)\n              }\n            });\n          }\n          hasMidConversationOptions || (hasMidConversationOptions = clearAt != null || effort != null);\n          systemMessages.push({\n            role: \"system\",\n            content,\n            ...clearAt != null && { clear_at: clearAt },\n            ...effort != null && { output_config: { effort } }\n          });\n        }\n        if (i === 0 || system == null && toolChangeCount === 0 && !hasMidConversationOptions) {\n          if (toolChangeCount > 0) {\n            warnings.push({\n              type: \"other\",\n              message: \"tool changes on the initial system message are not supported by Anthropic. Configure the initial tool set via the tools option instead. The tool changes have been ignored.\"\n            });\n          }\n          for (const message of systemMessages) {\n            if (message.content.length === 0 && message.clear_at == null && message.output_config != null) {\n              messages.push(message);\n              betas.add(\"mid-conversation-output-config-2026-07-01\");\n            } else if (message.clear_at != null || message.output_config != null) {\n              warnings.push({\n                type: \"other\",\n                message: \"clearAt and effort on this initial system message are not supported by Anthropic. Use a separate effort-only system message with empty content to set effort. These options have been ignored.\"\n              });\n            }\n          }\n          system = systemMessages.flatMap(\n            (message) => message.content.filter(\n              (part) => part.type === \"text\"\n            )\n          );\n        } else {\n          messages.push(...systemMessages);\n          betas.add(\"mid-conversation-system-2026-04-07\");\n          if (toolChangeCount > 0) {\n            betas.add(\"mid-conversation-tool-changes-2026-07-01\");\n          }\n          if (systemMessages.some((message) => message.clear_at != null)) {\n            betas.add(\"mid-conversation-system-clear-at-2026-08-21\");\n          }\n          if (systemMessages.some((message) => message.output_config != null)) {\n            betas.add(\"mid-conversation-output-config-2026-07-01\");\n          }\n        }\n        break;\n      }\n      case \"user\": {\n        const anthropicContent = [];\n        for (const message of block.messages) {\n          const { role, content } = message;\n          switch (role) {\n            case \"user\": {\n              if (content.length > 0) {\n                lastUserMessageIndex = messages.length;\n              }\n              for (let j = 0; j < content.length; j++) {\n                const part = content[j];\n                const isLastPart = j === content.length - 1;\n                const cacheControl = (_b = validator.getCacheControl(part.providerOptions, {\n                  type: \"user message part\",\n                  canCache: true\n                })) != null ? _b : isLastPart ? validator.getCacheControl(message.providerOptions, {\n                  type: \"user message\",\n                  canCache: true\n                }) : void 0;\n                switch (part.type) {\n                  case \"text\": {\n                    anthropicContent.push({\n                      type: \"text\",\n                      text: part.text,\n                      cache_control: cacheControl\n                    });\n                    break;\n                  }\n                  case \"file\": {\n                    const customContent = await (convertMediaPart == null ? void 0 : convertMediaPart(part));\n                    if (customContent != null) {\n                      anthropicContent.push({\n                        ...customContent,\n                        cache_control: cacheControl\n                      });\n                      break;\n                    }\n                    if (part.mediaType.startsWith(\"image/\")) {\n                      anthropicContent.push({\n                        type: \"image\",\n                        source: isUrlData(part.data) ? {\n                          type: \"url\",\n                          url: getUrlString(part.data)\n                        } : {\n                          type: \"base64\",\n                          media_type: part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType,\n                          data: convertToBase64(part.data)\n                        },\n                        cache_control: cacheControl\n                      });\n                    } else if (part.mediaType === \"application/pdf\") {\n                      betas.add(\"pdfs-2024-09-25\");\n                      const enableCitations = await shouldEnableCitations(\n                        part.providerOptions\n                      );\n                      const metadata = await getDocumentMetadata(\n                        part.providerOptions\n                      );\n                      anthropicContent.push({\n                        type: \"document\",\n                        source: isUrlData(part.data) ? {\n                          type: \"url\",\n                          url: getUrlString(part.data)\n                        } : {\n                          type: \"base64\",\n                          media_type: \"application/pdf\",\n                          data: convertToBase64(part.data)\n                        },\n                        title: (_c = metadata.title) != null ? _c : part.filename,\n                        ...metadata.context && { context: metadata.context },\n                        ...enableCitations && {\n                          citations: { enabled: true }\n                        },\n                        cache_control: cacheControl\n                      });\n                    } else if (part.mediaType === \"text/plain\") {\n                      const enableCitations = await shouldEnableCitations(\n                        part.providerOptions\n                      );\n                      const metadata = await getDocumentMetadata(\n                        part.providerOptions\n                      );\n                      anthropicContent.push({\n                        type: \"document\",\n                        source: isUrlData(part.data) ? {\n                          type: \"url\",\n                          url: getUrlString(part.data)\n                        } : {\n                          type: \"text\",\n                          media_type: \"text/plain\",\n                          data: convertToString(part.data)\n                        },\n                        title: (_d = metadata.title) != null ? _d : part.filename,\n                        ...metadata.context && { context: metadata.context },\n                        ...enableCitations && {\n                          citations: { enabled: true }\n                        },\n                        cache_control: cacheControl\n                      });\n                    } else {\n                      throw new UnsupportedFunctionalityError2({\n                        functionality: `media type: ${part.mediaType}`\n                      });\n                    }\n                    break;\n                  }\n                }\n              }\n              break;\n            }\n            case \"tool\": {\n              for (let i2 = 0; i2 < content.length; i2++) {\n                const part = content[i2];\n                if (part.type === \"tool-approval-response\") {\n                  continue;\n                }\n                const output = part.output;\n                const outputProviderOptions = \"providerOptions\" in output ? output.providerOptions : output.type === \"content\" ? (_e = output.value.find(\n                  (contentPart) => contentPart.providerOptions != null\n                )) == null ? void 0 : _e.providerOptions : void 0;\n                const isLastPart = i2 === content.length - 1;\n                const cacheControl = (_g = (_f = validator.getCacheControl(part.providerOptions, {\n                  type: \"tool result part\",\n                  canCache: true\n                })) != null ? _f : validator.getCacheControl(outputProviderOptions, {\n                  type: \"tool result output\",\n                  canCache: true\n                })) != null ? _g : isLastPart ? validator.getCacheControl(message.providerOptions, {\n                  type: \"tool result message\",\n                  canCache: true\n                }) : void 0;\n                let contentValue;\n                switch (output.type) {\n                  case \"content\":\n                    contentValue = output.value.map((contentPart) => {\n                      var _a2;\n                      switch (contentPart.type) {\n                        case \"text\":\n                          return {\n                            type: \"text\",\n                            text: contentPart.text\n                          };\n                        case \"image-data\": {\n                          return {\n                            type: \"image\",\n                            source: {\n                              type: \"base64\",\n                              media_type: contentPart.mediaType,\n                              data: contentPart.data\n                            }\n                          };\n                        }\n                        case \"image-url\": {\n                          return {\n                            type: \"image\",\n                            source: {\n                              type: \"url\",\n                              url: contentPart.url\n                            }\n                          };\n                        }\n                        case \"file-url\": {\n                          return {\n                            type: \"document\",\n                            source: {\n                              type: \"url\",\n                              url: contentPart.url\n                            }\n                          };\n                        }\n                        case \"file-data\": {\n                          if (contentPart.mediaType === \"application/pdf\") {\n                            betas.add(\"pdfs-2024-09-25\");\n                            return {\n                              type: \"document\",\n                              source: {\n                                type: \"base64\",\n                                media_type: contentPart.mediaType,\n                                data: contentPart.data\n                              }\n                            };\n                          }\n                          warnings.push({\n                            type: \"other\",\n                            message: `unsupported tool content part type: ${contentPart.type} with media type: ${contentPart.mediaType}`\n                          });\n                          return void 0;\n                        }\n                        case \"custom\": {\n                          const anthropicOptions = (_a2 = contentPart.providerOptions) == null ? void 0 : _a2.anthropic;\n                          if ((anthropicOptions == null ? void 0 : anthropicOptions.type) === \"tool-reference\") {\n                            return {\n                              type: \"tool_reference\",\n                              tool_name: anthropicOptions.toolName\n                            };\n                          }\n                          warnings.push({\n                            type: \"other\",\n                            message: `unsupported custom tool content part`\n                          });\n                          return void 0;\n                        }\n                        default: {\n                          warnings.push({\n                            type: \"other\",\n                            message: `unsupported tool content part type: ${contentPart.type}`\n                          });\n                          return void 0;\n                        }\n                      }\n                    }).filter(isNonNullable);\n                    break;\n                  case \"text\":\n                  case \"error-text\":\n                    contentValue = output.value;\n                    break;\n                  case \"execution-denied\":\n                    contentValue = (_h = output.reason) != null ? _h : \"Tool call execution denied.\";\n                    break;\n                  case \"json\":\n                  case \"error-json\":\n                  default:\n                    contentValue = JSON.stringify(output.value);\n                    break;\n                }\n                const toolsetName = getAnthropicToolsetName({\n                  toolName: part.toolName,\n                  providerOptions: part.providerOptions,\n                  toolsetNames\n                });\n                anthropicContent.push({\n                  type: \"tool_result\",\n                  tool_use_id: part.toolCallId,\n                  ...toolsetName != null && { toolset_name: toolsetName },\n                  content: contentValue,\n                  is_error: output.type === \"error-text\" || output.type === \"error-json\" ? true : void 0,\n                  cache_control: cacheControl\n                });\n              }\n              break;\n            }\n            default: {\n              const _exhaustiveCheck = role;\n              throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n            }\n          }\n        }\n        messages.push({ role: \"user\", content: anthropicContent });\n        break;\n      }\n      case \"assistant\": {\n        const anthropicContent = [];\n        const mcpToolUseIds = /* @__PURE__ */ new Set();\n        for (let j = 0; j < block.messages.length; j++) {\n          const message = block.messages[j];\n          const isLastMessage = j === block.messages.length - 1;\n          const { content } = message;\n          for (let k = 0; k < content.length; k++) {\n            const part = content[k];\n            const isLastContentPart = k === content.length - 1;\n            const cacheControl = (_i = validator.getCacheControl(part.providerOptions, {\n              type: \"assistant message part\",\n              canCache: true\n            })) != null ? _i : isLastContentPart ? validator.getCacheControl(message.providerOptions, {\n              type: \"assistant message\",\n              canCache: true\n            }) : void 0;\n            switch (part.type) {\n              case \"text\": {\n                const textMetadata = (_j = part.providerOptions) == null ? void 0 : _j.anthropic;\n                if ((textMetadata == null ? void 0 : textMetadata.type) === \"compaction\") {\n                  anthropicContent.push({\n                    type: \"compaction\",\n                    content: part.text,\n                    cache_control: cacheControl\n                  });\n                } else {\n                  anthropicContent.push({\n                    type: \"text\",\n                    text: (\n                      // trim the last text part if it's the last message in the block\n                      // because Anthropic does not allow trailing whitespace\n                      // in pre-filled assistant responses\n                      isLastBlock && isLastMessage && isLastContentPart ? part.text.trim() : part.text\n                    ),\n                    ...(textMetadata == null ? void 0 : textMetadata.citations) != null && {\n                      citations: textMetadata.citations\n                    },\n                    cache_control: cacheControl\n                  });\n                }\n                break;\n              }\n              case \"reasoning\": {\n                if (sendReasoning) {\n                  const reasoningMetadata = await parseProviderOptions({\n                    provider: \"anthropic\",\n                    providerOptions: part.providerOptions,\n                    schema: anthropicReasoningMetadataSchema\n                  });\n                  if (reasoningMetadata != null) {\n                    if (reasoningMetadata.signature != null) {\n                      validator.getCacheControl(part.providerOptions, {\n                        type: \"thinking block\",\n                        canCache: false\n                      });\n                      anthropicContent.push({\n                        type: \"thinking\",\n                        thinking: part.text,\n                        signature: reasoningMetadata.signature\n                      });\n                    } else if (reasoningMetadata.redactedData != null) {\n                      validator.getCacheControl(part.providerOptions, {\n                        type: \"redacted thinking block\",\n                        canCache: false\n                      });\n                      anthropicContent.push({\n                        type: \"redacted_thinking\",\n                        data: reasoningMetadata.redactedData\n                      });\n                    } else {\n                      warnings.push({\n                        type: \"other\",\n                        message: \"unsupported reasoning metadata\"\n                      });\n                    }\n                  } else {\n                    warnings.push({\n                      type: \"other\",\n                      message: \"unsupported reasoning metadata\"\n                    });\n                  }\n                } else {\n                  warnings.push({\n                    type: \"other\",\n                    message: \"sending reasoning content is disabled for this model\"\n                  });\n                }\n                break;\n              }\n              case \"tool-call\": {\n                const caller = getAnthropicCaller(part.providerOptions);\n                if (part.providerExecuted) {\n                  const providerToolName = toolNameMapping.toProviderToolName(\n                    part.toolName\n                  );\n                  const isMcpToolUse = ((_l = (_k = part.providerOptions) == null ? void 0 : _k.anthropic) == null ? void 0 : _l.type) === \"mcp-tool-use\";\n                  if (isMcpToolUse) {\n                    mcpToolUseIds.add(part.toolCallId);\n                    const serverName = (_n = (_m = part.providerOptions) == null ? void 0 : _m.anthropic) == null ? void 0 : _n.serverName;\n                    if (serverName == null || typeof serverName !== \"string\") {\n                      warnings.push({\n                        type: \"other\",\n                        message: \"mcp tool use server name is required and must be a string\"\n                      });\n                      break;\n                    }\n                    anthropicContent.push({\n                      type: \"mcp_tool_use\",\n                      id: part.toolCallId,\n                      name: part.toolName,\n                      input: part.input,\n                      server_name: serverName,\n                      cache_control: cacheControl\n                    });\n                  } else if (\n                    // code execution 20250825:\n                    providerToolName === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"type\" in part.input && typeof part.input.type === \"string\" && (part.input.type === \"bash_code_execution\" || part.input.type === \"text_editor_code_execution\")\n                  ) {\n                    const { type: subtoolName, ...input } = part.input;\n                    anthropicContent.push({\n                      type: \"server_tool_use\",\n                      id: part.toolCallId,\n                      name: subtoolName,\n                      // map back to subtool name\n                      input,\n                      ...caller && { caller },\n                      cache_control: cacheControl\n                    });\n                  } else if (\n                    // code execution 20250825 programmatic tool calling:\n                    // Strip the fake 'programmatic-tool-call' type before sending to Anthropic\n                    providerToolName === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"type\" in part.input && part.input.type === \"programmatic-tool-call\"\n                  ) {\n                    const { type: _, ...inputWithoutType } = part.input;\n                    anthropicContent.push({\n                      type: \"server_tool_use\",\n                      id: part.toolCallId,\n                      name: \"code_execution\",\n                      input: inputWithoutType,\n                      ...caller && { caller },\n                      cache_control: cacheControl\n                    });\n                  } else {\n                    if (providerToolName === \"code_execution\" || // code execution 20250522\n                    providerToolName === \"web_fetch\" || providerToolName === \"web_search\") {\n                      anthropicContent.push({\n                        type: \"server_tool_use\",\n                        id: part.toolCallId,\n                        name: providerToolName,\n                        input: part.input,\n                        ...caller && { caller },\n                        cache_control: cacheControl\n                      });\n                    } else if (providerToolName === \"tool_search_tool_regex\" || providerToolName === \"tool_search_tool_bm25\") {\n                      anthropicContent.push({\n                        type: \"server_tool_use\",\n                        id: part.toolCallId,\n                        name: providerToolName,\n                        input: part.input,\n                        ...caller && { caller },\n                        cache_control: cacheControl\n                      });\n                    } else if (providerToolName === \"advisor\") {\n                      anthropicContent.push({\n                        type: \"server_tool_use\",\n                        id: part.toolCallId,\n                        name: \"advisor\",\n                        input: {},\n                        ...caller && { caller },\n                        cache_control: cacheControl\n                      });\n                    } else {\n                      warnings.push({\n                        type: \"other\",\n                        message: `provider executed tool call for tool ${part.toolName} is not supported`\n                      });\n                    }\n                  }\n                  break;\n                }\n                const toolsetName = getAnthropicToolsetName({\n                  toolName: part.toolName,\n                  providerOptions: part.providerOptions,\n                  toolsetNames\n                });\n                if (toolsetName != null) {\n                  const { action, ...memberInput } = typeof part.input === \"object\" && part.input !== null && !Array.isArray(part.input) ? part.input : {};\n                  if (typeof action !== \"string\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `toolset tool call for tool ${part.toolName} is missing the action`\n                    });\n                    break;\n                  }\n                  anthropicContent.push({\n                    type: \"tool_use\",\n                    id: part.toolCallId,\n                    name: action,\n                    toolset_name: toolsetName,\n                    input: memberInput,\n                    ...caller && { caller },\n                    cache_control: cacheControl\n                  });\n                  break;\n                }\n                anthropicContent.push({\n                  type: \"tool_use\",\n                  id: part.toolCallId,\n                  name: part.toolName,\n                  input: part.input,\n                  ...caller && { caller },\n                  cache_control: cacheControl\n                });\n                break;\n              }\n              case \"tool-result\": {\n                const providerToolName = toolNameMapping.toProviderToolName(\n                  part.toolName\n                );\n                const caller = getAnthropicCaller(part.providerOptions);\n                if (mcpToolUseIds.has(part.toolCallId)) {\n                  const output = part.output;\n                  if (output.type !== \"json\" && output.type !== \"error-json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  anthropicContent.push({\n                    type: \"mcp_tool_result\",\n                    tool_use_id: part.toolCallId,\n                    is_error: output.type === \"error-json\",\n                    content: output.value,\n                    cache_control: cacheControl\n                  });\n                } else if (providerToolName === \"code_execution\") {\n                  const output = part.output;\n                  if (output.type === \"error-text\" || output.type === \"error-json\") {\n                    let errorInfo = {};\n                    try {\n                      if (typeof output.value === \"string\") {\n                        errorInfo = secureJsonParse(output.value);\n                      } else if (typeof output.value === \"object\" && output.value !== null) {\n                        errorInfo = output.value;\n                      }\n                    } catch (e) {\n                    }\n                    if (errorInfo.type === \"code_execution_tool_result_error\") {\n                      anthropicContent.push({\n                        type: \"code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: \"code_execution_tool_result_error\",\n                          error_code: (_o = errorInfo.errorCode) != null ? _o : \"unknown\"\n                        },\n                        cache_control: cacheControl\n                      });\n                    } else {\n                      anthropicContent.push({\n                        type: \"bash_code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        content: {\n                          type: \"bash_code_execution_tool_result_error\",\n                          error_code: (_p = errorInfo.errorCode) != null ? _p : \"unknown\"\n                        }\n                      });\n                    }\n                    break;\n                  }\n                  if (output.type !== \"json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  if (output.value == null || typeof output.value !== \"object\" || !(\"type\" in output.value) || typeof output.value.type !== \"string\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output value is not a valid code execution result for tool ${part.toolName}`\n                    });\n                    break;\n                  }\n                  if (output.value.type === \"code_execution_result\") {\n                    const codeExecutionOutput = await validateTypes2({\n                      value: output.value,\n                      schema: codeExecution_20250522OutputSchema\n                    });\n                    anthropicContent.push({\n                      type: \"code_execution_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: codeExecutionOutput.type,\n                        stdout: codeExecutionOutput.stdout,\n                        stderr: codeExecutionOutput.stderr,\n                        return_code: codeExecutionOutput.return_code,\n                        content: (_q = codeExecutionOutput.content) != null ? _q : []\n                      },\n                      cache_control: cacheControl\n                    });\n                  } else if (output.value.type === \"encrypted_code_execution_result\") {\n                    const codeExecutionOutput = await validateTypes2({\n                      value: output.value,\n                      schema: codeExecution_20260120OutputSchema\n                    });\n                    if (codeExecutionOutput.type === \"encrypted_code_execution_result\") {\n                      anthropicContent.push({\n                        type: \"code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: codeExecutionOutput.type,\n                          encrypted_stdout: codeExecutionOutput.encrypted_stdout,\n                          stderr: codeExecutionOutput.stderr,\n                          return_code: codeExecutionOutput.return_code,\n                          content: (_r = codeExecutionOutput.content) != null ? _r : []\n                        },\n                        cache_control: cacheControl\n                      });\n                    }\n                  } else {\n                    const codeExecutionOutput = await validateTypes2({\n                      value: output.value,\n                      schema: codeExecution_20250825OutputSchema\n                    });\n                    if (codeExecutionOutput.type === \"code_execution_result\") {\n                      anthropicContent.push({\n                        type: \"code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        content: {\n                          type: codeExecutionOutput.type,\n                          stdout: codeExecutionOutput.stdout,\n                          stderr: codeExecutionOutput.stderr,\n                          return_code: codeExecutionOutput.return_code,\n                          content: (_s = codeExecutionOutput.content) != null ? _s : []\n                        },\n                        cache_control: cacheControl\n                      });\n                    } else if (codeExecutionOutput.type === \"bash_code_execution_result\" || codeExecutionOutput.type === \"bash_code_execution_tool_result_error\") {\n                      anthropicContent.push({\n                        type: \"bash_code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        // Prompt caching requires stable key ordering:\n                        // https://platform.claude.com/docs/en/build-with-claude/prompt-caching#troubleshooting-common-issues\n                        content: codeExecutionOutput.type === \"bash_code_execution_result\" ? {\n                          type: codeExecutionOutput.type,\n                          stdout: codeExecutionOutput.stdout,\n                          stderr: codeExecutionOutput.stderr,\n                          return_code: codeExecutionOutput.return_code,\n                          content: codeExecutionOutput.content\n                        } : codeExecutionOutput\n                      });\n                    } else {\n                      anthropicContent.push({\n                        type: \"text_editor_code_execution_tool_result\",\n                        tool_use_id: part.toolCallId,\n                        cache_control: cacheControl,\n                        content: codeExecutionOutput\n                      });\n                    }\n                  }\n                  break;\n                }\n                if (providerToolName === \"web_fetch\") {\n                  const output = part.output;\n                  if (output.type === \"error-json\") {\n                    anthropicContent.push({\n                      type: \"web_fetch_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"web_fetch_tool_result_error\",\n                        error_code: (_t = (await extractErrorValue(output.value)).errorCode) != null ? _t : \"unavailable\"\n                      },\n                      ...caller && { caller },\n                      cache_control: cacheControl\n                    });\n                    break;\n                  }\n                  if (output.type !== \"json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  const webFetchOutput = await validateTypes2({\n                    value: output.value,\n                    schema: webFetch_20250910OutputSchema\n                  });\n                  anthropicContent.push({\n                    type: \"web_fetch_tool_result\",\n                    tool_use_id: part.toolCallId,\n                    content: {\n                      type: \"web_fetch_result\",\n                      url: webFetchOutput.url,\n                      retrieved_at: webFetchOutput.retrievedAt,\n                      content: {\n                        type: \"document\",\n                        title: webFetchOutput.content.title,\n                        citations: webFetchOutput.content.citations,\n                        source: {\n                          type: webFetchOutput.content.source.type,\n                          media_type: webFetchOutput.content.source.mediaType,\n                          data: webFetchOutput.content.source.data\n                        }\n                      }\n                    },\n                    ...caller && { caller },\n                    cache_control: cacheControl\n                  });\n                  break;\n                }\n                if (providerToolName === \"web_search\") {\n                  const output = part.output;\n                  if (output.type === \"error-json\") {\n                    anthropicContent.push({\n                      type: \"web_search_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"web_search_tool_result_error\",\n                        error_code: (_u = (await extractErrorValue(output.value)).errorCode) != null ? _u : \"unavailable\"\n                      },\n                      ...caller && { caller },\n                      cache_control: cacheControl\n                    });\n                    break;\n                  }\n                  if (output.type !== \"json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  const webSearchOutput = await validateTypes2({\n                    value: output.value,\n                    schema: webSearch_20250305OutputSchema\n                  });\n                  anthropicContent.push({\n                    type: \"web_search_tool_result\",\n                    tool_use_id: part.toolCallId,\n                    content: webSearchOutput.map((result) => ({\n                      url: result.url,\n                      title: result.title,\n                      page_age: result.pageAge,\n                      encrypted_content: result.encryptedContent,\n                      type: result.type\n                    })),\n                    ...caller && { caller },\n                    cache_control: cacheControl\n                  });\n                  break;\n                }\n                if (providerToolName === \"tool_search_tool_regex\" || providerToolName === \"tool_search_tool_bm25\") {\n                  const output = part.output;\n                  if (output.type === \"error-json\" || output.type === \"json\" && output.value != null && typeof output.value === \"object\" && !Array.isArray(output.value) && \"type\" in output.value && output.value.type === \"tool_search_tool_result_error\") {\n                    anthropicContent.push({\n                      type: \"tool_search_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"tool_search_tool_result_error\",\n                        error_code: (_v = (await extractErrorValue(output.value)).errorCode) != null ? _v : \"unavailable\"\n                      },\n                      cache_control: cacheControl\n                    });\n                    break;\n                  }\n                  if (output.type !== \"json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  const toolSearchOutput = await validateTypes2({\n                    value: output.value,\n                    schema: toolSearchRegex_20251119OutputSchema\n                  });\n                  const toolReferences = toolSearchOutput.map((ref) => ({\n                    type: \"tool_reference\",\n                    tool_name: ref.toolName\n                  }));\n                  anthropicContent.push({\n                    type: \"tool_search_tool_result\",\n                    tool_use_id: part.toolCallId,\n                    content: {\n                      type: \"tool_search_tool_search_result\",\n                      tool_references: toolReferences\n                    },\n                    cache_control: cacheControl\n                  });\n                  break;\n                }\n                if (providerToolName === \"advisor\") {\n                  const output = part.output;\n                  if (output.type !== \"json\" && output.type !== \"error-json\") {\n                    warnings.push({\n                      type: \"other\",\n                      message: `provider executed tool result output type ${output.type} for tool ${part.toolName} is not supported`\n                    });\n                    break;\n                  }\n                  const advisorOutput = await validateTypes2({\n                    value: output.value,\n                    schema: advisor_20260301OutputSchema\n                  });\n                  if (advisorOutput.type === \"advisor_result\") {\n                    anthropicContent.push({\n                      type: \"advisor_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"advisor_result\",\n                        text: advisorOutput.text\n                      },\n                      cache_control: cacheControl\n                    });\n                  } else if (advisorOutput.type === \"advisor_redacted_result\") {\n                    anthropicContent.push({\n                      type: \"advisor_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"advisor_redacted_result\",\n                        encrypted_content: advisorOutput.encryptedContent\n                      },\n                      cache_control: cacheControl\n                    });\n                  } else {\n                    anthropicContent.push({\n                      type: \"advisor_tool_result\",\n                      tool_use_id: part.toolCallId,\n                      content: {\n                        type: \"advisor_tool_result_error\",\n                        error_code: advisorOutput.errorCode\n                      },\n                      cache_control: cacheControl\n                    });\n                  }\n                  break;\n                }\n                warnings.push({\n                  type: \"other\",\n                  message: `provider executed tool result for tool ${part.toolName} is not supported`\n                });\n                break;\n              }\n            }\n          }\n        }\n        messages.push({\n          role: \"assistant\",\n          content: moveToolUseBlocksToEnd(anthropicContent)\n        });\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = type;\n        throw new Error(`content type: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  const codeExecutionToolCallIds = /* @__PURE__ */ new Set();\n  for (const message of messages) {\n    if (message.role !== \"assistant\") {\n      continue;\n    }\n    for (const part of message.content) {\n      if (part.type === \"server_tool_use\" && part.name === \"code_execution\") {\n        codeExecutionToolCallIds.add(part.id);\n      }\n    }\n  }\n  const warnedToolCallIds = /* @__PURE__ */ new Set();\n  for (let i = 0; i < lastUserMessageIndex; i++) {\n    const message = messages[i];\n    if (message.role !== \"assistant\") {\n      continue;\n    }\n    for (const part of message.content) {\n      if (!(\"caller\" in part)) {\n        continue;\n      }\n      const caller = part.caller;\n      if (caller == null || caller.type === \"direct\" || codeExecutionToolCallIds.has(caller.tool_id)) {\n        continue;\n      }\n      const toolCallId = \"id\" in part ? part.id : part.tool_use_id;\n      delete part.caller;\n      if (!warnedToolCallIds.has(toolCallId)) {\n        warnedToolCallIds.add(toolCallId);\n        warnings.push({\n          type: \"other\",\n          message: `Omitted caller metadata for tool ${toolCallId} because source code execution tool ${caller.tool_id} is missing from the conversation history.`\n        });\n      }\n    }\n  }\n  return {\n    prompt: { system, messages },\n    betas\n  };\n}\nfunction groupIntoBlocks(prompt) {\n  const blocks = [];\n  let currentBlock = void 0;\n  for (const message of prompt) {\n    const { role } = message;\n    switch (role) {\n      case \"system\": {\n        if ((currentBlock == null ? void 0 : currentBlock.type) !== \"system\") {\n          currentBlock = { type: \"system\", messages: [] };\n          blocks.push(currentBlock);\n        }\n        currentBlock.messages.push(message);\n        break;\n      }\n      case \"assistant\": {\n        if ((currentBlock == null ? void 0 : currentBlock.type) !== \"assistant\") {\n          currentBlock = { type: \"assistant\", messages: [] };\n          blocks.push(currentBlock);\n        }\n        currentBlock.messages.push(message);\n        break;\n      }\n      case \"user\": {\n        if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n          currentBlock = { type: \"user\", messages: [] };\n          blocks.push(currentBlock);\n        }\n        currentBlock.messages.push(message);\n        break;\n      }\n      case \"tool\": {\n        if ((currentBlock == null ? void 0 : currentBlock.type) !== \"user\") {\n          currentBlock = { type: \"user\", messages: [] };\n          blocks.push(currentBlock);\n        }\n        currentBlock.messages.push(message);\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return blocks;\n}\nfunction moveToolUseBlocksToEnd(content) {\n  const result = [];\n  let segment = [];\n  function flushSegment() {\n    result.push(\n      ...segment.filter((part) => part.type !== \"tool_use\"),\n      ...segment.filter((part) => part.type === \"tool_use\")\n    );\n    segment = [];\n  }\n  for (const part of content) {\n    if (part.type === \"thinking\" || part.type === \"redacted_thinking\") {\n      flushSegment();\n      result.push(part);\n    } else {\n      segment.push(part);\n    }\n  }\n  flushSegment();\n  return result;\n}\nfunction getAnthropicToolsetName({\n  toolName,\n  providerOptions,\n  toolsetNames\n}) {\n  var _a;\n  const fromTools = toolsetNames[toolName];\n  if (fromTools != null) {\n    return fromTools;\n  }\n  const fromMetadata = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.toolsetName;\n  return typeof fromMetadata === \"string\" ? fromMetadata : void 0;\n}\nfunction getAnthropicCaller(providerOptions) {\n  var _a;\n  const caller = (_a = providerOptions == null ? void 0 : providerOptions.anthropic) == null ? void 0 : _a.caller;\n  if (((caller == null ? void 0 : caller.type) === \"code_execution_20250825\" || (caller == null ? void 0 : caller.type) === \"code_execution_20260120\") && caller.toolId) {\n    return {\n      type: caller.type,\n      tool_id: caller.toolId\n    };\n  }\n  return (caller == null ? void 0 : caller.type) === \"direct\" ? { type: \"direct\" } : void 0;\n}\n\n// src/map-anthropic-stop-reason.ts\nfunction mapAnthropicStopReason({\n  finishReason,\n  isJsonResponseFromTool\n}) {\n  switch (finishReason) {\n    case \"pause_turn\":\n    case \"end_turn\":\n    case \"stop_sequence\":\n      return \"stop\";\n    case \"refusal\":\n      return \"content-filter\";\n    case \"tool_use\":\n      return isJsonResponseFromTool ? \"stop\" : \"tool-calls\";\n    case \"max_tokens\":\n    case \"model_context_window_exceeded\":\n      return \"length\";\n    case \"compaction\":\n      return \"other\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/sanitize-json-schema.ts\nvar SUPPORTED_STRING_FORMATS = /* @__PURE__ */ new Set([\n  \"date-time\",\n  \"time\",\n  \"date\",\n  \"duration\",\n  \"email\",\n  \"hostname\",\n  \"uri\",\n  \"ipv4\",\n  \"ipv6\",\n  \"uuid\"\n]);\nvar DESCRIPTION_CONSTRAINT_KEYS = [\n  \"minimum\",\n  \"maximum\",\n  \"exclusiveMinimum\",\n  \"exclusiveMaximum\",\n  \"multipleOf\",\n  \"minLength\",\n  \"maxLength\",\n  \"pattern\",\n  \"minItems\",\n  \"maxItems\",\n  \"uniqueItems\",\n  \"minProperties\",\n  \"maxProperties\",\n  \"not\"\n];\nfunction sanitizeJsonSchema(schema) {\n  return sanitizeSchema(schema);\n}\nfunction sanitizeDefinition(definition) {\n  if (typeof definition === \"boolean\" || !isPlainObject(definition)) {\n    return definition;\n  }\n  return sanitizeSchema(definition);\n}\nfunction sanitizeSchema(schema) {\n  const result = {};\n  if (schema.$ref != null) {\n    return { $ref: schema.$ref, ...sanitizeSchemaDefinitions(schema) };\n  }\n  if (schema.$schema != null) {\n    result.$schema = schema.$schema;\n  }\n  if (schema.$id != null) {\n    result.$id = schema.$id;\n  }\n  if (schema.title != null) {\n    result.title = schema.title;\n  }\n  if (schema.description != null) {\n    result.description = schema.description;\n  }\n  if (schema.default !== void 0) {\n    result.default = schema.default;\n  }\n  if (schema.const !== void 0) {\n    result.const = schema.const;\n  }\n  if (schema.enum != null) {\n    result.enum = schema.enum;\n  }\n  if (schema.type != null) {\n    result.type = schema.type;\n  }\n  if (schema.anyOf != null) {\n    result.anyOf = schema.anyOf.map(sanitizeDefinition);\n  } else if (schema.oneOf != null) {\n    result.anyOf = schema.oneOf.map(sanitizeDefinition);\n  }\n  if (schema.allOf != null) {\n    result.allOf = schema.allOf.map(sanitizeDefinition);\n  }\n  Object.assign(result, sanitizeSchemaDefinitions(schema));\n  if (schema.type === \"object\" || schema.properties != null) {\n    if (schema.properties != null) {\n      result.properties = Object.fromEntries(\n        Object.entries(schema.properties).map(([name, definition]) => [\n          name,\n          sanitizeDefinition(definition)\n        ])\n      );\n    }\n    result.additionalProperties = false;\n    if (schema.required != null) {\n      result.required = schema.required;\n    }\n  }\n  if (schema.items != null) {\n    result.items = Array.isArray(schema.items) ? schema.items.map(sanitizeDefinition) : sanitizeDefinition(schema.items);\n  }\n  if (typeof schema.format === \"string\" && SUPPORTED_STRING_FORMATS.has(schema.format)) {\n    result.format = schema.format;\n  }\n  const constraintDescription = getConstraintDescription(schema);\n  if (constraintDescription != null) {\n    result.description = result.description == null ? constraintDescription : `${result.description}\n${constraintDescription}`;\n  }\n  return result;\n}\nfunction sanitizeSchemaDefinitions(schema) {\n  const { $defs } = schema;\n  const sanitizeAll = (definitions) => Object.fromEntries(\n    Object.entries(definitions).map(([name, definition]) => [\n      name,\n      sanitizeDefinition(definition)\n    ])\n  );\n  return {\n    ...schema.definitions != null && {\n      definitions: sanitizeAll(schema.definitions)\n    },\n    ...$defs != null && { $defs: sanitizeAll($defs) }\n  };\n}\nfunction getConstraintDescription(schema) {\n  const descriptions = DESCRIPTION_CONSTRAINT_KEYS.flatMap((key) => {\n    const value = schema[key];\n    if (value == null || value === false) {\n      return [];\n    }\n    return `${formatConstraintName(key)}: ${formatConstraintValue(value)}`;\n  });\n  if (typeof schema.format === \"string\" && !SUPPORTED_STRING_FORMATS.has(schema.format)) {\n    descriptions.push(`format: ${schema.format}`);\n  }\n  return descriptions.length === 0 ? void 0 : `${descriptions.join(\"; \")}.`;\n}\nfunction formatConstraintName(key) {\n  return key.replace(/[A-Z]/g, (match) => ` ${match.toLowerCase()}`);\n}\nfunction formatConstraintValue(value) {\n  if (typeof value === \"string\") {\n    return value;\n  }\n  return JSON.stringify(value);\n}\nfunction isPlainObject(value) {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// src/has-circular-schema-reference.ts\nvar SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([\n  \"dependentSchemas\",\n  \"patternProperties\",\n  \"properties\"\n]);\nvar DATA_KEYWORDS = /* @__PURE__ */ new Set([\"const\", \"default\", \"enum\", \"examples\"]);\nfunction hasCircularSchemaReference(schema) {\n  const visiting = /* @__PURE__ */ new Set();\n  const visited = /* @__PURE__ */ new Set();\n  const visit = (pointer) => {\n    if (visiting.has(pointer)) {\n      return true;\n    }\n    if (visited.has(pointer)) {\n      return false;\n    }\n    const target = resolveSchemaPointer(schema, pointer);\n    if (target === void 0) {\n      return false;\n    }\n    visiting.add(pointer);\n    const isCircular = collectLocalRefs(target).some(visit);\n    visiting.delete(pointer);\n    visited.add(pointer);\n    return isCircular;\n  };\n  return visit(\"#\");\n}\nfunction collectLocalRefs(node, refs = []) {\n  if (Array.isArray(node)) {\n    for (const item of node) {\n      collectLocalRefs(item, refs);\n    }\n    return refs;\n  }\n  if (!isRecord(node)) {\n    return refs;\n  }\n  for (const [key, value] of Object.entries(node)) {\n    if (key === \"$ref\") {\n      if (typeof value === \"string\" && value.startsWith(\"#\")) {\n        refs.push(value);\n      }\n    } else if (SCHEMA_MAP_KEYWORDS.has(key) && isRecord(value)) {\n      for (const subschema of Object.values(value)) {\n        collectLocalRefs(subschema, refs);\n      }\n    } else if (\n      // definitions are only reached through a `$ref`:\n      key !== \"$defs\" && key !== \"definitions\" && !DATA_KEYWORDS.has(key)\n    ) {\n      collectLocalRefs(value, refs);\n    }\n  }\n  return refs;\n}\nfunction resolveSchemaPointer(schema, pointer) {\n  if (pointer === \"#\") {\n    return schema;\n  }\n  if (!pointer.startsWith(\"#/\")) {\n    return void 0;\n  }\n  let decodedPointer;\n  try {\n    decodedPointer = decodeURIComponent(pointer.slice(2));\n  } catch (e) {\n    return void 0;\n  }\n  let current = schema;\n  for (const rawSegment of decodedPointer.split(\"/\")) {\n    const segment = rawSegment.replace(/~1/g, \"/\").replace(/~0/g, \"~\");\n    if (Array.isArray(current)) {\n      current = current[Number(segment)];\n    } else if (isRecord(current)) {\n      current = current[segment];\n    } else {\n      return void 0;\n    }\n  }\n  return current;\n}\nfunction isRecord(value) {\n  return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// src/supports-native-structured-output-schema.ts\nvar MAX_OPTIONAL_PROPERTIES = 10;\nvar SUBSCHEMA_KEYWORDS = [\n  \"additionalProperties\",\n  \"contains\",\n  \"else\",\n  \"if\",\n  \"items\",\n  \"not\",\n  \"then\"\n];\nvar SUBSCHEMA_LIST_KEYWORDS = [\"allOf\", \"anyOf\", \"oneOf\", \"prefixItems\"];\nvar SUBSCHEMA_MAP_KEYWORDS = [\n  \"dependentSchemas\",\n  \"patternProperties\",\n  \"properties\"\n];\nfunction supportsNativeStructuredOutputSchema(schema) {\n  if (hasCircularSchemaReference(schema)) {\n    return false;\n  }\n  const { optionalProperties, hasOpenObject } = getSchemaStats(\n    schema,\n    schema,\n    /* @__PURE__ */ new Map()\n  );\n  return !hasOpenObject && optionalProperties <= MAX_OPTIONAL_PROPERTIES;\n}\nfunction getSchemaStats(node, root, refStats) {\n  const stats = { optionalProperties: 0, hasOpenObject: false };\n  if (!isRecord(node)) {\n    return stats;\n  }\n  const add = (child) => {\n    const childStats = getSchemaStats(child, root, refStats);\n    stats.optionalProperties += childStats.optionalProperties;\n    stats.hasOpenObject || (stats.hasOpenObject = childStats.hasOpenObject);\n  };\n  if (typeof node.$ref === \"string\" && node.$ref.startsWith(\"#\")) {\n    let resolved = refStats.get(node.$ref);\n    if (resolved == null) {\n      resolved = getSchemaStats(\n        resolveSchemaPointer(root, node.$ref),\n        root,\n        refStats\n      );\n      refStats.set(node.$ref, resolved);\n    }\n    stats.optionalProperties += resolved.optionalProperties;\n    stats.hasOpenObject || (stats.hasOpenObject = resolved.hasOpenObject);\n  }\n  if (isOpenObject(node)) {\n    stats.hasOpenObject = true;\n  }\n  if (isRecord(node.properties)) {\n    const required = new Set(Array.isArray(node.required) ? node.required : []);\n    stats.optionalProperties += Object.keys(node.properties).filter(\n      (name) => !required.has(name)\n    ).length;\n  }\n  for (const keyword of SUBSCHEMA_KEYWORDS) {\n    const value = node[keyword];\n    if (Array.isArray(value)) {\n      value.forEach(add);\n    } else {\n      add(value);\n    }\n  }\n  for (const keyword of SUBSCHEMA_LIST_KEYWORDS) {\n    const value = node[keyword];\n    if (Array.isArray(value)) {\n      value.forEach(add);\n    }\n  }\n  for (const keyword of SUBSCHEMA_MAP_KEYWORDS) {\n    const value = node[keyword];\n    if (isRecord(value)) {\n      Object.values(value).forEach(add);\n    }\n  }\n  return stats;\n}\nfunction isOpenObject(node) {\n  const { additionalProperties, patternProperties, properties, type } = node;\n  if (additionalProperties === true || isRecord(additionalProperties)) {\n    return true;\n  }\n  if (isRecord(patternProperties) && Object.keys(patternProperties).length > 0) {\n    return true;\n  }\n  const isObjectType = type === \"object\" || Array.isArray(type) && type.includes(\"object\");\n  return isObjectType && properties == null && additionalProperties !== false;\n}\n\n// src/anthropic-messages-language-model.ts\nfunction createCitationSource(citation, citationDocuments, generateId3) {\n  var _a;\n  if (citation.type === \"web_search_result_location\") {\n    return {\n      type: \"source\",\n      sourceType: \"url\",\n      id: generateId3(),\n      url: citation.url,\n      title: citation.title,\n      providerMetadata: {\n        anthropic: {\n          citedText: citation.cited_text,\n          encryptedIndex: citation.encrypted_index\n        }\n      }\n    };\n  }\n  if (citation.type !== \"page_location\" && citation.type !== \"char_location\") {\n    return;\n  }\n  const documentInfo = citationDocuments[citation.document_index];\n  if (!documentInfo) {\n    return;\n  }\n  return {\n    type: \"source\",\n    sourceType: \"document\",\n    id: generateId3(),\n    mediaType: documentInfo.mediaType,\n    title: (_a = citation.document_title) != null ? _a : documentInfo.title,\n    filename: documentInfo.filename,\n    providerMetadata: {\n      anthropic: citation.type === \"page_location\" ? {\n        citedText: citation.cited_text,\n        startPageNumber: citation.start_page_number,\n        endPageNumber: citation.end_page_number\n      } : {\n        citedText: citation.cited_text,\n        startCharIndex: citation.start_char_index,\n        endCharIndex: citation.end_char_index\n      }\n    }\n  };\n}\nfunction getAnthropicCallerInfo(caller) {\n  return caller == null ? void 0 : {\n    type: caller.type,\n    toolId: \"tool_id\" in caller ? caller.tool_id : void 0\n  };\n}\nfunction getAnthropicCallerMetadata(caller) {\n  const callerInfo = getAnthropicCallerInfo(caller);\n  return callerInfo == null ? {} : { providerMetadata: { anthropic: { caller: callerInfo } } };\n}\nfunction getAnthropicToolsetNames(tools) {\n  const toolsetNames = {};\n  for (const tool of tools != null ? tools : []) {\n    if (tool.type === \"provider\" && tool.id === \"anthropic.computer_toolset_20260801\") {\n      toolsetNames[tool.name] = \"computer\";\n    }\n  }\n  return toolsetNames;\n}\nfunction toToolsetMemberInput({\n  memberName,\n  input\n}) {\n  return {\n    action: memberName,\n    ...typeof input === \"object\" && input !== null && !Array.isArray(input) ? input : {}\n  };\n}\nvar TEXT_OR_THINKING_BLOCK_TYPES = /* @__PURE__ */ new Set([\n  \"redacted_thinking\",\n  \"text\",\n  \"thinking\"\n]);\nfunction isContinuationStopReason(stopReason) {\n  return stopReason === \"pause_turn\" || stopReason === \"tool_use\";\n}\nfunction getJsonResponseToolFallbackText(content, stopReason) {\n  const text = /* @__PURE__ */ new Set();\n  if (isContinuationStopReason(stopReason)) {\n    return text;\n  }\n  for (const part of content) {\n    if (part.type === \"tool_use\" && part.name === \"json\") {\n      return /* @__PURE__ */ new Set();\n    }\n    if (part.type === \"text\") {\n      text.add(part);\n    } else if (!TEXT_OR_THINKING_BLOCK_TYPES.has(part.type)) {\n      text.clear();\n    }\n  }\n  return text;\n}\nvar AnthropicMessagesLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    var _a;\n    this.modelId = modelId;\n    this.config = config;\n    this.generateId = (_a = config.generateId) != null ? _a : generateId;\n  }\n  supportsUrl(url) {\n    return url.protocol === \"https:\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  /**\n   * Extracts the dynamic provider name from the config.provider string.\n   * e.g., 'my-custom-anthropic.messages' -> 'my-custom-anthropic'\n   */\n  get providerOptionsName() {\n    const provider = this.config.provider;\n    const dotIndex = provider.indexOf(\".\");\n    return dotIndex === -1 ? provider : provider.substring(0, dotIndex);\n  }\n  get supportedUrls() {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).supportedUrls) == null ? void 0 : _b.call(_a)) != null ? _c : {};\n  }\n  async getArgs({\n    userSuppliedBetas,\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    tools,\n    toolChoice,\n    providerOptions,\n    stream\n  }) {\n    var _a, _b, _c, _d, _e, _f, _g, _h;\n    const warnings = [];\n    if (frequencyPenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"frequencyPenalty\" });\n    }\n    if (presencePenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"presencePenalty\" });\n    }\n    if (seed != null) {\n      warnings.push({ type: \"unsupported\", feature: \"seed\" });\n    }\n    const maxTemperature = (_a = this.config.maxTemperature) != null ? _a : 1;\n    const temperatureProvider = this.config.maxTemperature == null ? \"anthropic\" : this.providerOptionsName;\n    if (temperature != null && temperature > maxTemperature) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"temperature\",\n        details: `${temperature} exceeds ${temperatureProvider} maximum of ${maxTemperature.toFixed(1)}. clamped to ${maxTemperature.toFixed(1)}`\n      });\n      temperature = maxTemperature;\n    } else if (temperature != null && temperature < 0) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"temperature\",\n        details: `${temperature} is below ${temperatureProvider} minimum of 0. clamped to 0`\n      });\n      temperature = 0;\n    }\n    if ((responseFormat == null ? void 0 : responseFormat.type) === \"json\") {\n      if (responseFormat.schema == null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"responseFormat\",\n          details: \"JSON response format requires a schema. The response format is ignored.\"\n        });\n      }\n    }\n    const providerOptionsName = this.providerOptionsName;\n    const canonicalOptions = await parseProviderOptions2({\n      provider: \"anthropic\",\n      providerOptions,\n      schema: anthropicLanguageModelOptions\n    });\n    const customProviderOptions = providerOptionsName !== \"anthropic\" ? await parseProviderOptions2({\n      provider: providerOptionsName,\n      providerOptions,\n      schema: anthropicLanguageModelOptions\n    }) : null;\n    const usedCustomProviderKey = customProviderOptions != null;\n    const anthropicOptions = Object.assign(\n      {},\n      canonicalOptions != null ? canonicalOptions : {},\n      customProviderOptions != null ? customProviderOptions : {}\n    );\n    const {\n      maxOutputTokens: maxOutputTokensForModel,\n      supportsStructuredOutput: modelSupportsStructuredOutput,\n      rejectsSamplingParameters,\n      rejectsThinkingDisabledAboveHighEffort,\n      rejectsThinkingDisabled,\n      rejectsBudgetThinking,\n      rejectsForcedToolUse,\n      supportsBetweenToolsThinking,\n      isKnownModel\n    } = getModelCapabilities(this.modelId);\n    if (!isKnownModel && maxOutputTokens == null) {\n      warnings.push({\n        type: \"compatibility\",\n        feature: \"maxOutputTokens\",\n        details: `The model \"${this.modelId}\" is unknown. The max output tokens have been limited to ${maxOutputTokensForModel}. Set maxOutputTokens explicitly to override this limit.`\n      });\n    }\n    if (rejectsSamplingParameters) {\n      if (temperature != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"temperature\",\n          details: `temperature is not supported by ${this.modelId} and will be ignored`\n        });\n        temperature = void 0;\n      }\n      if (topK != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"topK\",\n          details: `topK is not supported by ${this.modelId} and will be ignored`\n        });\n        topK = void 0;\n      }\n      if (topP != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"topP\",\n          details: `topP is not supported by ${this.modelId} and will be ignored`\n        });\n        topP = void 0;\n      }\n    }\n    const isAnthropicModel = isKnownModel || this.modelId.includes(\"claude-\");\n    const supportsStructuredOutput = ((_b = this.config.supportsNativeStructuredOutput) != null ? _b : true) && modelSupportsStructuredOutput;\n    const supportsStrictTools = ((_c = this.config.supportsStrictTools) != null ? _c : true) && modelSupportsStructuredOutput;\n    const structureOutputMode = (_d = anthropicOptions == null ? void 0 : anthropicOptions.structuredOutputMode) != null ? _d : \"auto\";\n    let useStructuredOutput = structureOutputMode === \"outputFormat\" || structureOutputMode === \"auto\" && supportsStructuredOutput;\n    if (!useStructuredOutput && rejectsForcedToolUse && modelSupportsStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && supportsNativeStructuredOutputSchema(responseFormat.schema)) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"providerOptions.anthropic.structuredOutputMode\",\n        details: `structuredOutputMode 'jsonTool' is not supported by ${this.modelId} because it rejects forced tool use. Using 'outputFormat' instead.`\n      });\n      useStructuredOutput = true;\n    }\n    const jsonResponseTool = (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && !useStructuredOutput ? {\n      type: \"function\",\n      name: \"json\",\n      description: \"Respond with a JSON object.\",\n      inputSchema: responseFormat.schema\n    } : void 0;\n    if (jsonResponseTool != null && (anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse) === false) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"providerOptions.anthropic.disableParallelToolUse\",\n        details: \"`disableParallelToolUse: false` is ignored when using the JSON response tool. Parallel tool use is disabled to ensure a single coherent JSON tool call.\"\n      });\n    }\n    const contextManagement = anthropicOptions == null ? void 0 : anthropicOptions.contextManagement;\n    const cacheControlValidator = new CacheControlValidator(\n      this.config.cacheControlProviderOptionsName\n    );\n    const toolNameMapping = createToolNameMapping({\n      tools,\n      providerToolNames: {\n        \"anthropic.code_execution_20250522\": \"code_execution\",\n        \"anthropic.code_execution_20250825\": \"code_execution\",\n        \"anthropic.code_execution_20260120\": \"code_execution\",\n        \"anthropic.computer_20241022\": \"computer\",\n        \"anthropic.computer_20250124\": \"computer\",\n        \"anthropic.computer_20251124\": \"computer\",\n        \"anthropic.computer_toolset_20260801\": \"computer\",\n        \"anthropic.text_editor_20241022\": \"str_replace_editor\",\n        \"anthropic.text_editor_20250124\": \"str_replace_editor\",\n        \"anthropic.text_editor_20250429\": \"str_replace_based_edit_tool\",\n        \"anthropic.text_editor_20250728\": \"str_replace_based_edit_tool\",\n        \"anthropic.bash_20241022\": \"bash\",\n        \"anthropic.bash_20250124\": \"bash\",\n        \"anthropic.memory_20250818\": \"memory\",\n        \"anthropic.web_search_20250305\": \"web_search\",\n        \"anthropic.web_search_20260209\": \"web_search\",\n        \"anthropic.web_fetch_20250910\": \"web_fetch\",\n        \"anthropic.web_fetch_20260209\": \"web_fetch\",\n        \"anthropic.tool_search_regex_20251119\": \"tool_search_tool_regex\",\n        \"anthropic.tool_search_bm25_20251119\": \"tool_search_tool_bm25\",\n        \"anthropic.advisor_20260301\": \"advisor\"\n      }\n    });\n    const toolsetNames = getAnthropicToolsetNames(tools);\n    const { prompt: messagesPrompt, betas } = await convertToAnthropicMessagesPrompt({\n      prompt,\n      sendReasoning: (_e = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _e : true,\n      warnings,\n      cacheControlValidator,\n      toolNameMapping,\n      toolsetNames,\n      convertMediaPart: this.config.convertMediaPart\n    });\n    if (rejectsThinkingDisabled && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null) {\n      const requestedThinking = anthropicOptions.thinking;\n      const requestedType = \"type\" in requestedThinking ? requestedThinking.type : void 0;\n      if (requestedType === \"disabled\" && supportsBetweenToolsThinking) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"providerOptions.anthropic.thinking\",\n          details: `thinking cannot be disabled for ${this.modelId}. Using 'between_tools' thinking, the lowest thinking setting, instead.`\n        });\n        anthropicOptions.thinking = { type: \"between_tools\" };\n      } else if (requestedType === \"disabled\") {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"providerOptions.anthropic.thinking\",\n          details: `thinking cannot be disabled for ${this.modelId}; it always uses adaptive thinking. The thinking setting has been removed. Lower 'effort' to reduce thinking.`\n        });\n        anthropicOptions.thinking = void 0;\n      }\n    }\n    if (rejectsBudgetThinking && (anthropicOptions == null ? void 0 : anthropicOptions.thinking) != null && \"type\" in anthropicOptions.thinking && anthropicOptions.thinking.type === \"enabled\") {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"providerOptions.anthropic.thinking\",\n        details: rejectsThinkingDisabled ? `budget-based thinking is not supported by ${this.modelId}; it always uses adaptive thinking. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.` : `budget-based thinking is not supported by ${this.modelId}. Using adaptive thinking instead. Use 'effort' to control how much the model thinks.`\n      });\n      anthropicOptions.thinking = { type: \"adaptive\" };\n    }\n    const thinking = anthropicOptions == null ? void 0 : anthropicOptions.thinking;\n    const thinkingType = thinking != null && \"type\" in thinking ? thinking.type : void 0;\n    if (rejectsThinkingDisabledAboveHighEffort && thinkingType === \"disabled\" && (anthropicOptions.effort === \"xhigh\" || anthropicOptions.effort === \"max\")) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"providerOptions.anthropic.effort\",\n        details: `effort '${anthropicOptions.effort}' is not supported by ${this.modelId} when thinking is disabled. The effort has been lowered to 'high'.`\n      });\n      anthropicOptions.effort = \"high\";\n    }\n    if (thinkingType === \"between_tools\" && (anthropicOptions.effort === \"xhigh\" || anthropicOptions.effort === \"max\")) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"providerOptions.anthropic.effort\",\n        details: `effort '${anthropicOptions.effort}' is not supported with 'between_tools' thinking. The effort has been lowered to 'high'.`\n      });\n      anthropicOptions.effort = \"high\";\n    }\n    const isThinking = thinkingType === \"enabled\" || thinkingType === \"adaptive\" || thinkingType === \"between_tools\";\n    const sendThinking = isThinking || thinkingType === \"disabled\";\n    let thinkingBudget = thinkingType === \"enabled\" && thinking != null && \"budgetTokens\" in thinking ? thinking.budgetTokens : void 0;\n    const thinkingDisplay = thinkingType === \"adaptive\" && thinking != null && \"display\" in thinking ? thinking.display : void 0;\n    const thinkingBlockBinding = thinking != null && \"blockBinding\" in thinking ? thinking.blockBinding : void 0;\n    const sendThinkingConfig = sendThinking || thinkingBlockBinding != null;\n    const maxTokens = maxOutputTokens != null ? maxOutputTokens : maxOutputTokensForModel;\n    const baseArgs = {\n      // model id:\n      model: this.modelId,\n      // standardized settings:\n      max_tokens: maxTokens,\n      temperature,\n      top_k: topK,\n      top_p: topP,\n      stop_sequences: stopSequences,\n      // provider specific settings:\n      ...sendThinkingConfig && {\n        thinking: {\n          ...thinkingType != null && { type: thinkingType },\n          ...thinkingBudget != null && { budget_tokens: thinkingBudget },\n          ...thinkingDisplay != null && { display: thinkingDisplay },\n          ...thinkingBlockBinding != null && {\n            block_binding: {\n              prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior\n            }\n          }\n        }\n      },\n      ...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null) && {\n        output_config: {\n          ...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {\n            effort: anthropicOptions.effort\n          },\n          ...(anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) && {\n            task_budget: {\n              type: anthropicOptions.taskBudget.type,\n              total: anthropicOptions.taskBudget.total,\n              ...anthropicOptions.taskBudget.remaining != null && {\n                remaining: anthropicOptions.taskBudget.remaining\n              }\n            }\n          },\n          ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && {\n            format: {\n              type: \"json_schema\",\n              schema: sanitizeJsonSchema(responseFormat.schema)\n            }\n          }\n        }\n      },\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {\n        speed: anthropicOptions.speed\n      },\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.inferenceGeo) && {\n        inference_geo: anthropicOptions.inferenceGeo\n      },\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.fallbacks) != null && (anthropicOptions.fallbacks === \"default\" || anthropicOptions.fallbacks.length > 0) && {\n        fallbacks: anthropicOptions.fallbacks\n      },\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {\n        cache_control: anthropicOptions.cacheControl\n      },\n      ...((_f = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _f.userId) != null && {\n        metadata: { user_id: anthropicOptions.metadata.userId }\n      },\n      // mcp servers:\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {\n        mcp_servers: anthropicOptions.mcpServers.map((server) => ({\n          type: server.type,\n          name: server.name,\n          url: server.url,\n          authorization_token: server.authorizationToken,\n          tool_configuration: server.toolConfiguration ? {\n            allowed_tools: server.toolConfiguration.allowedTools,\n            enabled: server.toolConfiguration.enabled\n          } : void 0\n        }))\n      },\n      // container: For programmatic tool calling (just an ID string) or agent skills (object with id and skills)\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {\n        container: anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0 ? (\n          // Object format when skills are provided (agent skills feature)\n          {\n            id: anthropicOptions.container.id,\n            skills: anthropicOptions.container.skills.map((skill) => ({\n              type: skill.type,\n              skill_id: skill.skillId,\n              version: skill.version\n            }))\n          }\n        ) : (\n          // String format for container ID only (programmatic tool calling)\n          anthropicOptions.container.id\n        )\n      },\n      // prompt:\n      system: messagesPrompt.system,\n      messages: messagesPrompt.messages,\n      ...(anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0 && {\n        safeguards: anthropicOptions.safeguards.map((safeguard) => ({\n          type: safeguard.type,\n          ...safeguard.classifierContext !== void 0 && {\n            classifier_context: safeguard.classifierContext\n          }\n        }))\n      },\n      ...contextManagement && {\n        context_management: {\n          edits: contextManagement.edits.map((edit) => {\n            const strategy = edit.type;\n            switch (strategy) {\n              case \"clear_tool_uses_20250919\":\n                return {\n                  type: edit.type,\n                  ...edit.trigger !== void 0 && {\n                    trigger: edit.trigger\n                  },\n                  ...edit.keep !== void 0 && { keep: edit.keep },\n                  ...edit.clearAtLeast !== void 0 && {\n                    clear_at_least: edit.clearAtLeast\n                  },\n                  ...edit.clearToolInputs !== void 0 && {\n                    clear_tool_inputs: edit.clearToolInputs\n                  },\n                  ...edit.excludeTools !== void 0 && {\n                    exclude_tools: edit.excludeTools\n                  }\n                };\n              case \"clear_thinking_20251015\":\n                return {\n                  type: edit.type,\n                  ...edit.keep !== void 0 && { keep: edit.keep }\n                };\n              case \"compact_20260112\":\n                return {\n                  type: edit.type,\n                  ...edit.trigger !== void 0 && {\n                    trigger: edit.trigger\n                  },\n                  ...edit.pauseAfterCompaction !== void 0 && {\n                    pause_after_compaction: edit.pauseAfterCompaction\n                  },\n                  ...edit.instructions !== void 0 && {\n                    instructions: edit.instructions\n                  }\n                };\n              default:\n                warnings.push({\n                  type: \"other\",\n                  message: `Unknown context management strategy: ${strategy}`\n                });\n                return void 0;\n            }\n          }).filter((edit) => edit !== void 0)\n        }\n      }\n    };\n    if (isThinking) {\n      if (thinkingType === \"enabled\" && thinkingBudget == null) {\n        warnings.push({\n          type: \"compatibility\",\n          feature: \"extended thinking\",\n          details: \"thinking budget is required when thinking is enabled. using default budget of 1024 tokens.\"\n        });\n        baseArgs.thinking = {\n          type: \"enabled\",\n          budget_tokens: 1024\n        };\n        thinkingBudget = 1024;\n      }\n      if (baseArgs.temperature != null && !this.config.supportsTemperatureAndTopPWithThinking) {\n        baseArgs.temperature = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"temperature\",\n          details: \"temperature is not supported when thinking is enabled\"\n        });\n      }\n      if (topK != null) {\n        baseArgs.top_k = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"topK\",\n          details: \"topK is not supported when thinking is enabled\"\n        });\n      }\n      if (topP != null && !this.config.supportsTemperatureAndTopPWithThinking) {\n        baseArgs.top_p = void 0;\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"topP\",\n          details: \"topP is not supported when thinking is enabled\"\n        });\n      }\n      baseArgs.max_tokens = maxTokens + (thinkingBudget != null ? thinkingBudget : 0);\n    } else {\n      if (isAnthropicModel && topP != null && temperature != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"topP\",\n          details: `topP is not supported when temperature is set. topP is ignored.`\n        });\n        baseArgs.top_p = void 0;\n      }\n    }\n    if (isKnownModel && baseArgs.max_tokens > maxOutputTokensForModel) {\n      if (maxOutputTokens != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"maxOutputTokens\",\n          details: `${baseArgs.max_tokens} (maxOutputTokens + thinkingBudget) is greater than ${this.modelId} ${maxOutputTokensForModel} max output tokens. The max output tokens have been limited to ${maxOutputTokensForModel}.`\n        });\n      }\n      baseArgs.max_tokens = maxOutputTokensForModel;\n    }\n    if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {\n      betas.add(\"mcp-client-2025-04-04\");\n    }\n    if ((anthropicOptions == null ? void 0 : anthropicOptions.safeguards) && anthropicOptions.safeguards.length > 0) {\n      betas.add(\"dangerous-tool-use-2026-09-03\");\n    }\n    if (contextManagement) {\n      betas.add(\"context-management-2025-06-27\");\n      if (contextManagement.edits.some((e) => e.type === \"compact_20260112\")) {\n        betas.add(\"compact-2026-01-12\");\n      }\n    }\n    if ((anthropicOptions == null ? void 0 : anthropicOptions.container) && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {\n      betas.add(\"code-execution-2025-08-25\");\n      betas.add(\"skills-2025-10-02\");\n      betas.add(\"files-api-2025-04-14\");\n      if (!(tools == null ? void 0 : tools.some(\n        (tool) => tool.type === \"provider\" && (tool.id === \"anthropic.code_execution_20250825\" || tool.id === \"anthropic.code_execution_20260120\")\n      ))) {\n        warnings.push({\n          type: \"other\",\n          message: \"code execution tool is required when using skills\"\n        });\n      }\n    }\n    if (anthropicOptions == null ? void 0 : anthropicOptions.taskBudget) {\n      betas.add(\"task-budgets-2026-03-13\");\n    }\n    if (thinkingDisplay === \"updates\") {\n      betas.add(\"thinking-display-updates-2026-08-18\");\n    }\n    if (thinkingBlockBinding != null) {\n      betas.add(\"thinking-binding-controls-2026-08-01\");\n    }\n    if ((anthropicOptions == null ? void 0 : anthropicOptions.speed) === \"fast\") {\n      betas.add(\"fast-mode-2026-02-01\");\n    }\n    if ((anthropicOptions == null ? void 0 : anthropicOptions.fallbacks) === \"default\") {\n      betas.add(\"server-side-fallback-2026-07-01\");\n    } else if ((anthropicOptions == null ? void 0 : anthropicOptions.fallbacks) && anthropicOptions.fallbacks.length > 0) {\n      betas.add(\"server-side-fallback-2026-06-01\");\n    }\n    const defaultEagerInputStreaming = stream && ((_g = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _g : true);\n    const {\n      tools: anthropicTools2,\n      toolChoice: anthropicToolChoice,\n      toolWarnings,\n      betas: toolsBetas\n    } = await prepareTools(\n      jsonResponseTool != null ? {\n        tools: [...tools != null ? tools : [], jsonResponseTool],\n        toolChoice: { type: \"required\" },\n        disableParallelToolUse: true,\n        cacheControlValidator,\n        supportsStructuredOutput: false,\n        supportsStrictTools,\n        defaultEagerInputStreaming,\n        rejectsForcedToolUse: rejectsForcedToolUse || thinkingType === \"enabled\"\n      } : {\n        tools: tools != null ? tools : [],\n        toolChoice,\n        disableParallelToolUse: anthropicOptions == null ? void 0 : anthropicOptions.disableParallelToolUse,\n        cacheControlValidator,\n        supportsStructuredOutput,\n        supportsStrictTools,\n        defaultEagerInputStreaming,\n        rejectsForcedToolUse: rejectsForcedToolUse || thinkingType === \"enabled\"\n      }\n    );\n    const cacheWarnings = cacheControlValidator.getWarnings();\n    return {\n      args: {\n        ...baseArgs,\n        tools: anthropicTools2,\n        tool_choice: anthropicToolChoice,\n        stream: stream === true ? true : void 0\n        // do not send when not streaming\n      },\n      warnings: [...warnings, ...toolWarnings, ...cacheWarnings],\n      betas: /* @__PURE__ */ new Set([\n        ...betas,\n        ...toolsBetas,\n        ...userSuppliedBetas,\n        ...(_h = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _h : []\n      ]),\n      usesJsonResponseTool: jsonResponseTool != null,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey\n    };\n  }\n  async getHeaders({\n    betas,\n    headers\n  }) {\n    return combineHeaders(\n      await resolve(this.config.headers),\n      headers,\n      betas.size > 0 ? { \"anthropic-beta\": Array.from(betas).join(\",\") } : {}\n    );\n  }\n  async getBetasFromHeaders(requestHeaders) {\n    var _a, _b;\n    const configHeaders = await resolve(this.config.headers);\n    const configBetaHeader = (_a = configHeaders[\"anthropic-beta\"]) != null ? _a : \"\";\n    const requestBetaHeader = (_b = requestHeaders == null ? void 0 : requestHeaders[\"anthropic-beta\"]) != null ? _b : \"\";\n    return new Set(\n      [\n        ...configBetaHeader.toLowerCase().split(\",\"),\n        ...requestBetaHeader.toLowerCase().split(\",\")\n      ].map((beta) => beta.trim()).filter((beta) => beta !== \"\")\n    );\n  }\n  buildRequestUrl(isStreaming) {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).buildRequestUrl) == null ? void 0 : _b.call(_a, this.config.baseURL, isStreaming)) != null ? _c : `${this.config.baseURL}/messages`;\n  }\n  transformRequestBody(args, betas) {\n    var _a, _b, _c;\n    return (_c = (_b = (_a = this.config).transformRequestBody) == null ? void 0 : _b.call(_a, args, betas)) != null ? _c : args;\n  }\n  extractCitationDocuments(prompt) {\n    const isCitationPart = (part) => {\n      var _a, _b;\n      if (part.type !== \"file\") {\n        return false;\n      }\n      if (part.mediaType !== \"application/pdf\" && part.mediaType !== \"text/plain\") {\n        return false;\n      }\n      const anthropic2 = (_a = part.providerOptions) == null ? void 0 : _a.anthropic;\n      const citationsConfig = anthropic2 == null ? void 0 : anthropic2.citations;\n      return (_b = citationsConfig == null ? void 0 : citationsConfig.enabled) != null ? _b : false;\n    };\n    return prompt.filter((message) => message.role === \"user\").flatMap((message) => message.content).filter(isCitationPart).map((part) => {\n      var _a;\n      const filePart = part;\n      return {\n        title: (_a = filePart.filename) != null ? _a : \"Untitled Document\",\n        filename: filePart.filename,\n        mediaType: filePart.mediaType\n      };\n    });\n  }\n  async doGenerate(options) {\n    var _a, _b, _c, _d, _e, _f, _g, _h, _i;\n    const {\n      args,\n      warnings,\n      betas,\n      usesJsonResponseTool,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey\n    } = await this.getArgs({\n      ...options,\n      stream: false,\n      userSuppliedBetas: await this.getBetasFromHeaders(options.headers)\n    });\n    const citationDocuments = [\n      ...this.extractCitationDocuments(options.prompt)\n    ];\n    const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n      args.tools\n    );\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url: this.buildRequestUrl(false),\n      headers: await this.getHeaders({ betas, headers: options.headers }),\n      body: this.transformRequestBody(args, betas),\n      failedResponseHandler: anthropicFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        anthropicMessagesResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const content = [];\n    const mcpToolCalls = {};\n    const serverToolCalls = {};\n    let isJsonResponseFromTool = false;\n    const jsonResponseToolFallbackText = usesJsonResponseTool ? getJsonResponseToolFallbackText(response.content, response.stop_reason) : void 0;\n    for (const part of response.content) {\n      switch (part.type) {\n        case \"text\": {\n          if (jsonResponseToolFallbackText == null || jsonResponseToolFallbackText.has(part)) {\n            const webSearchCitations = (_a = part.citations) == null ? void 0 : _a.filter(\n              (citation) => citation.type === \"web_search_result_location\"\n            );\n            content.push({\n              type: \"text\",\n              text: part.text,\n              ...webSearchCitations != null && webSearchCitations.length > 0 && {\n                providerMetadata: {\n                  anthropic: {\n                    citations: webSearchCitations\n                  }\n                }\n              }\n            });\n            if (part.citations) {\n              for (const citation of part.citations) {\n                const source = createCitationSource(\n                  citation,\n                  citationDocuments,\n                  this.generateId\n                );\n                if (source) {\n                  content.push(source);\n                }\n              }\n            }\n          }\n          break;\n        }\n        case \"thinking\": {\n          content.push({\n            type: \"reasoning\",\n            text: part.thinking,\n            providerMetadata: {\n              anthropic: {\n                signature: part.signature\n              }\n            }\n          });\n          break;\n        }\n        case \"redacted_thinking\": {\n          content.push({\n            type: \"reasoning\",\n            text: \"\",\n            providerMetadata: {\n              anthropic: {\n                redactedData: part.data\n              }\n            }\n          });\n          break;\n        }\n        case \"compaction\": {\n          content.push({\n            type: \"text\",\n            text: part.content,\n            providerMetadata: {\n              anthropic: {\n                type: \"compaction\"\n              }\n            }\n          });\n          break;\n        }\n        case \"tool_use\": {\n          const isJsonResponseTool = usesJsonResponseTool && part.name === \"json\";\n          if (isJsonResponseTool) {\n            isJsonResponseFromTool = true;\n            content.push({\n              type: \"text\",\n              text: JSON.stringify(part.input)\n            });\n          } else if (part.toolset_name != null) {\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(part.toolset_name),\n              input: JSON.stringify(\n                toToolsetMemberInput({\n                  memberName: part.name,\n                  input: part.input\n                })\n              ),\n              providerMetadata: {\n                anthropic: {\n                  toolsetName: part.toolset_name,\n                  ...(_b = getAnthropicCallerMetadata(part.caller).providerMetadata) == null ? void 0 : _b.anthropic\n                }\n              }\n            });\n          } else {\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: part.name,\n              input: JSON.stringify(part.input),\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          }\n          break;\n        }\n        case \"server_tool_use\": {\n          if (part.name === \"text_editor_code_execution\" || part.name === \"bash_code_execution\") {\n            const providerToolName = \"code_execution\";\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n              input: JSON.stringify({ type: part.name, ...part.input }),\n              providerExecuted: true,\n              // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n              // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n              // tool was not explicitly provided. We therefore bypass the general validation by marking the\n              // tool as dynamic.\n              ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {},\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          } else if (part.name === \"web_search\" || part.name === \"code_execution\" || part.name === \"web_fetch\") {\n            const inputToSerialize = part.name === \"code_execution\" && part.input != null && typeof part.input === \"object\" && \"code\" in part.input && !(\"type\" in part.input) ? { type: \"programmatic-tool-call\", ...part.input } : part.input;\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(part.name),\n              input: JSON.stringify(inputToSerialize),\n              providerExecuted: true,\n              // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n              // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n              // tool was not explicitly provided. We therefore bypass the general validation by marking the\n              // tool as dynamic.\n              ...markCodeExecutionDynamic && part.name === \"code_execution\" ? { dynamic: true } : {},\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          } else if (part.name === \"tool_search_tool_regex\" || part.name === \"tool_search_tool_bm25\") {\n            serverToolCalls[part.id] = part.name;\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(part.name),\n              input: JSON.stringify(part.input),\n              providerExecuted: true,\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          } else if (part.name === \"advisor\") {\n            content.push({\n              type: \"tool-call\",\n              toolCallId: part.id,\n              toolName: toolNameMapping.toCustomToolName(\"advisor\"),\n              input: JSON.stringify(part.input),\n              providerExecuted: true,\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          }\n          break;\n        }\n        case \"mcp_tool_use\": {\n          mcpToolCalls[part.id] = {\n            type: \"tool-call\",\n            toolCallId: part.id,\n            toolName: part.name,\n            input: JSON.stringify(part.input),\n            providerExecuted: true,\n            dynamic: true,\n            providerMetadata: {\n              anthropic: {\n                type: \"mcp-tool-use\",\n                serverName: part.server_name\n              }\n            }\n          };\n          content.push(mcpToolCalls[part.id]);\n          break;\n        }\n        case \"mcp_tool_result\": {\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.tool_use_id,\n            toolName: mcpToolCalls[part.tool_use_id].toolName,\n            isError: part.is_error,\n            result: part.content,\n            dynamic: true,\n            providerMetadata: mcpToolCalls[part.tool_use_id].providerMetadata\n          });\n          break;\n        }\n        case \"web_fetch_tool_result\": {\n          if (part.content.type === \"web_fetch_result\") {\n            citationDocuments.push({\n              title: (_c = part.content.content.title) != null ? _c : part.content.url,\n              mediaType: part.content.content.source.media_type\n            });\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n              result: {\n                type: \"web_fetch_result\",\n                url: part.content.url,\n                retrievedAt: part.content.retrieved_at,\n                content: {\n                  type: part.content.content.type,\n                  title: part.content.content.title,\n                  citations: part.content.content.citations,\n                  source: {\n                    type: part.content.content.source.type,\n                    mediaType: part.content.content.source.media_type,\n                    data: part.content.content.source.data\n                  }\n                }\n              },\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          } else if (part.content.type === \"web_fetch_tool_result_error\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n              isError: true,\n              result: {\n                type: \"web_fetch_tool_result_error\",\n                errorCode: part.content.error_code\n              },\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          }\n          break;\n        }\n        case \"web_search_tool_result\": {\n          if (Array.isArray(part.content)) {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n              result: part.content.map((result) => {\n                var _a2;\n                return {\n                  url: result.url,\n                  title: result.title,\n                  pageAge: (_a2 = result.page_age) != null ? _a2 : null,\n                  encryptedContent: result.encrypted_content,\n                  type: result.type\n                };\n              }),\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n            for (const result of part.content) {\n              content.push({\n                type: \"source\",\n                sourceType: \"url\",\n                id: this.generateId(),\n                url: result.url,\n                title: result.title,\n                providerMetadata: {\n                  anthropic: {\n                    pageAge: (_d = result.page_age) != null ? _d : null\n                  }\n                }\n              });\n            }\n          } else {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n              isError: true,\n              result: {\n                type: \"web_search_tool_result_error\",\n                errorCode: part.content.error_code\n              },\n              ...getAnthropicCallerMetadata(part.caller)\n            });\n          }\n          break;\n        }\n        // code execution 20250522:\n        case \"code_execution_tool_result\": {\n          if (part.content.type === \"code_execution_result\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n              result: {\n                type: part.content.type,\n                stdout: part.content.stdout,\n                stderr: part.content.stderr,\n                return_code: part.content.return_code,\n                content: (_e = part.content.content) != null ? _e : []\n              }\n            });\n          } else if (part.content.type === \"encrypted_code_execution_result\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n              result: {\n                type: part.content.type,\n                encrypted_stdout: part.content.encrypted_stdout,\n                stderr: part.content.stderr,\n                return_code: part.content.return_code,\n                content: (_f = part.content.content) != null ? _f : []\n              }\n            });\n          } else if (part.content.type === \"code_execution_tool_result_error\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n              isError: true,\n              result: {\n                type: \"code_execution_tool_result_error\",\n                errorCode: part.content.error_code\n              }\n            });\n          }\n          break;\n        }\n        // code execution 20250825:\n        case \"bash_code_execution_tool_result\":\n        case \"text_editor_code_execution_tool_result\": {\n          content.push({\n            type: \"tool-result\",\n            toolCallId: part.tool_use_id,\n            toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n            result: part.content\n          });\n          break;\n        }\n        // tool search tool results:\n        case \"tool_search_tool_result\": {\n          let providerToolName = serverToolCalls[part.tool_use_id];\n          if (providerToolName == null) {\n            const bm25CustomName = toolNameMapping.toCustomToolName(\n              \"tool_search_tool_bm25\"\n            );\n            const regexCustomName = toolNameMapping.toCustomToolName(\n              \"tool_search_tool_regex\"\n            );\n            if (bm25CustomName !== \"tool_search_tool_bm25\") {\n              providerToolName = \"tool_search_tool_bm25\";\n            } else if (regexCustomName !== \"tool_search_tool_regex\") {\n              providerToolName = \"tool_search_tool_regex\";\n            } else {\n              providerToolName = \"tool_search_tool_regex\";\n            }\n          }\n          if (part.content.type === \"tool_search_tool_search_result\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(providerToolName),\n              result: part.content.tool_references.map((ref) => ({\n                type: ref.type,\n                toolName: ref.tool_name\n              }))\n            });\n          } else {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: toolNameMapping.toCustomToolName(providerToolName),\n              isError: true,\n              result: {\n                type: \"tool_search_tool_result_error\",\n                errorCode: part.content.error_code\n              }\n            });\n          }\n          break;\n        }\n        // advisor results for advisor_20260301:\n        case \"advisor_tool_result\": {\n          const advisorToolName = toolNameMapping.toCustomToolName(\"advisor\");\n          if (part.content.type === \"advisor_result\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              result: {\n                type: \"advisor_result\",\n                text: part.content.text\n              }\n            });\n          } else if (part.content.type === \"advisor_redacted_result\") {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              result: {\n                type: \"advisor_redacted_result\",\n                encryptedContent: part.content.encrypted_content\n              }\n            });\n          } else {\n            content.push({\n              type: \"tool-result\",\n              toolCallId: part.tool_use_id,\n              toolName: advisorToolName,\n              isError: true,\n              result: {\n                type: \"advisor_tool_result_error\",\n                errorCode: part.content.error_code\n              }\n            });\n          }\n          break;\n        }\n        // Server-side fallback marker: the AI SDK has no content primitive for\n        // a model hop, so drop it. The hop is still observable via\n        // usage.iterations.\n        case \"fallback\": {\n          break;\n        }\n      }\n    }\n    return {\n      content,\n      finishReason: {\n        unified: mapAnthropicStopReason({\n          finishReason: response.stop_reason,\n          isJsonResponseFromTool\n        }),\n        raw: (_g = response.stop_reason) != null ? _g : void 0\n      },\n      usage: convertAnthropicMessagesUsage({ usage: response.usage }),\n      request: { body: args },\n      response: {\n        id: (_h = response.id) != null ? _h : void 0,\n        modelId: (_i = response.model) != null ? _i : void 0,\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings,\n      providerMetadata: (() => {\n        var _a2, _b2, _c2, _d2, _e2;\n        const stopDetails = mapAnthropicStopDetails(response.stop_details);\n        const anthropicMetadata = {\n          usage: response.usage,\n          cacheCreationInputTokens: (_a2 = response.usage.cache_creation_input_tokens) != null ? _a2 : null,\n          stopSequence: (_b2 = response.stop_sequence) != null ? _b2 : null,\n          ...stopDetails != null ? { stopDetails } : {},\n          ...response.input_transformations != null ? { inputTransformations: response.input_transformations } : {},\n          ...response.safeguard_results != null ? { safeguardResults: response.safeguard_results } : {},\n          iterations: response.usage.iterations ? response.usage.iterations.map(\n            (iter) => ({\n              type: iter.type,\n              ...iter.model != null ? { model: iter.model } : {},\n              inputTokens: iter.input_tokens,\n              outputTokens: iter.output_tokens,\n              ...iter.cache_creation_input_tokens ? {\n                cacheCreationInputTokens: iter.cache_creation_input_tokens\n              } : {},\n              ...iter.cache_read_input_tokens ? {\n                cacheReadInputTokens: iter.cache_read_input_tokens\n              } : {}\n            })\n          ) : null,\n          container: response.container ? {\n            expiresAt: response.container.expires_at,\n            id: response.container.id,\n            skills: (_d2 = (_c2 = response.container.skills) == null ? void 0 : _c2.map((skill) => ({\n              type: skill.type,\n              skillId: skill.skill_id,\n              version: skill.version\n            }))) != null ? _d2 : null\n          } : null,\n          contextManagement: (_e2 = mapAnthropicResponseContextManagement(\n            response.context_management\n          )) != null ? _e2 : null\n        };\n        const providerMetadata = {\n          anthropic: anthropicMetadata\n        };\n        if (usedCustomProviderKey && providerOptionsName !== \"anthropic\") {\n          providerMetadata[providerOptionsName] = anthropicMetadata;\n        }\n        return providerMetadata;\n      })()\n    };\n  }\n  async doStream(options) {\n    var _a, _b;\n    const {\n      args: body,\n      warnings,\n      betas,\n      usesJsonResponseTool,\n      toolNameMapping,\n      providerOptionsName,\n      usedCustomProviderKey\n    } = await this.getArgs({\n      ...options,\n      stream: true,\n      userSuppliedBetas: await this.getBetasFromHeaders(options.headers)\n    });\n    const citationDocuments = [\n      ...this.extractCitationDocuments(options.prompt)\n    ];\n    const markCodeExecutionDynamic = hasWebTool20260209WithoutCodeExecution(\n      body.tools\n    );\n    const url = this.buildRequestUrl(true);\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url,\n      headers: await this.getHeaders({ betas, headers: options.headers }),\n      body: this.transformRequestBody(body, betas),\n      failedResponseHandler: anthropicFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        anthropicMessagesChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    const usage = {\n      input_tokens: 0,\n      output_tokens: 0,\n      cache_creation_input_tokens: 0,\n      cache_read_input_tokens: 0,\n      iterations: null\n    };\n    const contentBlocks = {};\n    const mcpToolCalls = {};\n    const serverToolCalls = {};\n    let contextManagement = null;\n    let rawUsage = void 0;\n    let cacheCreationInputTokens = null;\n    let stopSequence = null;\n    let stopDetails = void 0;\n    let inputTransformations;\n    let safeguardResults;\n    let container = null;\n    let isJsonResponseFromTool = false;\n    const heldBackText = [];\n    const heldBackTextByIndex = /* @__PURE__ */ new Map();\n    const createTextEnd = (id, citations) => ({\n      type: \"text-end\",\n      id,\n      ...citations.length > 0 && {\n        providerMetadata: { anthropic: { citations } }\n      }\n    });\n    let isMessageOpen = false;\n    let activeMessageId;\n    let hasInvalidMessageSequence = false;\n    let blockType = void 0;\n    const generateId3 = this.generateId;\n    const transformedStream = response.pipeThrough(\n      new TransformStream({\n        start(controller) {\n          controller.enqueue({ type: \"stream-start\", warnings });\n        },\n        transform(chunk, controller) {\n          var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;\n          if (hasInvalidMessageSequence) {\n            return;\n          }\n          if (options.includeRawChunks) {\n            controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n          }\n          if (!chunk.success) {\n            controller.enqueue({ type: \"error\", error: chunk.error });\n            return;\n          }\n          const value = chunk.value;\n          switch (value.type) {\n            case \"ping\": {\n              return;\n            }\n            case \"content_block_start\": {\n              const part = value.content_block;\n              const contentBlockType = part.type;\n              if (contentBlockType === \"fallback\") {\n                return;\n              }\n              blockType = contentBlockType;\n              if (!TEXT_OR_THINKING_BLOCK_TYPES.has(contentBlockType)) {\n                heldBackText.length = 0;\n              }\n              switch (contentBlockType) {\n                case \"text\": {\n                  if (usesJsonResponseTool) {\n                    const entry = {\n                      id: String(value.index),\n                      text: \"\",\n                      citations: []\n                    };\n                    heldBackText.push(entry);\n                    heldBackTextByIndex.set(value.index, entry);\n                    return;\n                  }\n                  contentBlocks[value.index] = {\n                    type: \"text\",\n                    citations: []\n                  };\n                  controller.enqueue({\n                    type: \"text-start\",\n                    id: String(value.index)\n                  });\n                  return;\n                }\n                case \"thinking\": {\n                  contentBlocks[value.index] = { type: \"reasoning\" };\n                  controller.enqueue({\n                    type: \"reasoning-start\",\n                    id: String(value.index)\n                  });\n                  return;\n                }\n                case \"redacted_thinking\": {\n                  contentBlocks[value.index] = { type: \"reasoning\" };\n                  controller.enqueue({\n                    type: \"reasoning-start\",\n                    id: String(value.index),\n                    providerMetadata: {\n                      anthropic: {\n                        redactedData: part.data\n                      }\n                    }\n                  });\n                  return;\n                }\n                case \"compaction\": {\n                  contentBlocks[value.index] = {\n                    type: \"text\",\n                    citations: []\n                  };\n                  controller.enqueue({\n                    type: \"text-start\",\n                    id: String(value.index),\n                    providerMetadata: {\n                      anthropic: {\n                        type: \"compaction\"\n                      }\n                    }\n                  });\n                  return;\n                }\n                case \"tool_use\": {\n                  const isJsonResponseTool = usesJsonResponseTool && part.name === \"json\";\n                  if (isJsonResponseTool) {\n                    isJsonResponseFromTool = true;\n                    contentBlocks[value.index] = {\n                      type: \"text\",\n                      citations: []\n                    };\n                    controller.enqueue({\n                      type: \"text-start\",\n                      id: String(value.index)\n                    });\n                  } else if (part.toolset_name != null) {\n                    const callerInfo = getAnthropicCallerInfo(part.caller);\n                    const customToolName = toolNameMapping.toCustomToolName(\n                      part.toolset_name\n                    );\n                    const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;\n                    contentBlocks[value.index] = {\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: hasNonEmptyInput ? JSON.stringify(part.input) : \"\",\n                      firstDelta: true,\n                      toolset: {\n                        name: part.toolset_name,\n                        memberName: part.name\n                      },\n                      ...callerInfo && { caller: callerInfo }\n                    };\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: customToolName\n                    });\n                  } else {\n                    const callerInfo = getAnthropicCallerInfo(part.caller);\n                    const hasNonEmptyInput = part.input && Object.keys(part.input).length > 0;\n                    const initialInput = hasNonEmptyInput ? JSON.stringify(part.input) : \"\";\n                    contentBlocks[value.index] = {\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: part.name,\n                      input: initialInput,\n                      firstDelta: initialInput.length === 0,\n                      ...callerInfo && { caller: callerInfo }\n                    };\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: part.name\n                    });\n                  }\n                  return;\n                }\n                case \"server_tool_use\": {\n                  const callerInfo = getAnthropicCallerInfo(part.caller);\n                  if ([\n                    \"web_fetch\",\n                    \"web_search\",\n                    // code execution 20250825:\n                    \"code_execution\",\n                    // code execution 20250825 text editor:\n                    \"text_editor_code_execution\",\n                    // code execution 20250825 bash:\n                    \"bash_code_execution\"\n                  ].includes(part.name)) {\n                    const providerToolName = part.name === \"text_editor_code_execution\" || part.name === \"bash_code_execution\" ? \"code_execution\" : part.name;\n                    const providerToolInputType = part.name === \"text_editor_code_execution\" || part.name === \"bash_code_execution\" ? part.name : part.name === \"code_execution\" ? \"programmatic-tool-call\" : void 0;\n                    const customToolName = toolNameMapping.toCustomToolName(providerToolName);\n                    const finalInput = part.input != null && typeof part.input === \"object\" && Object.keys(part.input).length > 0 ? JSON.stringify(part.input) : \"\";\n                    contentBlocks[value.index] = {\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: finalInput,\n                      providerExecuted: true,\n                      // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n                      // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n                      // tool was not explicitly provided. We therefore bypass the general validation by marking the\n                      // tool as dynamic.\n                      ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {},\n                      firstDelta: finalInput.length === 0,\n                      providerToolName,\n                      providerToolInputType,\n                      ...callerInfo && { caller: callerInfo }\n                    };\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true,\n                      // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n                      // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n                      // tool was not explicitly provided. We therefore bypass the general validation by marking the\n                      // tool as dynamic.\n                      ...markCodeExecutionDynamic && providerToolName === \"code_execution\" ? { dynamic: true } : {}\n                    });\n                  } else if (part.name === \"tool_search_tool_regex\" || part.name === \"tool_search_tool_bm25\") {\n                    serverToolCalls[part.id] = part.name;\n                    const customToolName = toolNameMapping.toCustomToolName(\n                      part.name\n                    );\n                    contentBlocks[value.index] = {\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: \"\",\n                      providerExecuted: true,\n                      firstDelta: true,\n                      providerToolName: part.name,\n                      ...callerInfo && { caller: callerInfo }\n                    };\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true\n                    });\n                  } else if (part.name === \"advisor\") {\n                    const customToolName = toolNameMapping.toCustomToolName(\"advisor\");\n                    contentBlocks[value.index] = {\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: customToolName,\n                      input: \"{}\",\n                      providerExecuted: true,\n                      firstDelta: true,\n                      providerToolName: part.name,\n                      ...callerInfo && { caller: callerInfo }\n                    };\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: customToolName,\n                      providerExecuted: true\n                    });\n                  }\n                  return;\n                }\n                case \"web_fetch_tool_result\": {\n                  if (part.content.type === \"web_fetch_result\") {\n                    citationDocuments.push({\n                      title: (_a2 = part.content.content.title) != null ? _a2 : part.content.url,\n                      mediaType: part.content.content.source.media_type\n                    });\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n                      result: {\n                        type: \"web_fetch_result\",\n                        url: part.content.url,\n                        retrievedAt: part.content.retrieved_at,\n                        content: {\n                          type: part.content.content.type,\n                          title: part.content.content.title,\n                          citations: part.content.content.citations,\n                          source: {\n                            type: part.content.content.source.type,\n                            mediaType: part.content.content.source.media_type,\n                            data: part.content.content.source.data\n                          }\n                        }\n                      },\n                      ...getAnthropicCallerMetadata(part.caller)\n                    });\n                  } else if (part.content.type === \"web_fetch_tool_result_error\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"web_fetch\"),\n                      isError: true,\n                      result: {\n                        type: \"web_fetch_tool_result_error\",\n                        errorCode: part.content.error_code\n                      },\n                      ...getAnthropicCallerMetadata(part.caller)\n                    });\n                  }\n                  return;\n                }\n                case \"web_search_tool_result\": {\n                  if (Array.isArray(part.content)) {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n                      result: part.content.map((result) => {\n                        var _a3;\n                        return {\n                          url: result.url,\n                          title: result.title,\n                          pageAge: (_a3 = result.page_age) != null ? _a3 : null,\n                          encryptedContent: result.encrypted_content,\n                          type: result.type\n                        };\n                      }),\n                      ...getAnthropicCallerMetadata(part.caller)\n                    });\n                    for (const result of part.content) {\n                      controller.enqueue({\n                        type: \"source\",\n                        sourceType: \"url\",\n                        id: generateId3(),\n                        url: result.url,\n                        title: result.title,\n                        providerMetadata: {\n                          anthropic: {\n                            pageAge: (_b2 = result.page_age) != null ? _b2 : null\n                          }\n                        }\n                      });\n                    }\n                  } else {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"web_search\"),\n                      isError: true,\n                      result: {\n                        type: \"web_search_tool_result_error\",\n                        errorCode: part.content.error_code\n                      },\n                      ...getAnthropicCallerMetadata(part.caller)\n                    });\n                  }\n                  return;\n                }\n                // code execution 20250522:\n                case \"code_execution_tool_result\": {\n                  if (part.content.type === \"code_execution_result\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n                      result: {\n                        type: part.content.type,\n                        stdout: part.content.stdout,\n                        stderr: part.content.stderr,\n                        return_code: part.content.return_code,\n                        content: (_c = part.content.content) != null ? _c : []\n                      }\n                    });\n                  } else if (part.content.type === \"encrypted_code_execution_result\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n                      result: {\n                        type: part.content.type,\n                        encrypted_stdout: part.content.encrypted_stdout,\n                        stderr: part.content.stderr,\n                        return_code: part.content.return_code,\n                        content: (_d = part.content.content) != null ? _d : []\n                      }\n                    });\n                  } else if (part.content.type === \"code_execution_tool_result_error\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n                      isError: true,\n                      result: {\n                        type: \"code_execution_tool_result_error\",\n                        errorCode: part.content.error_code\n                      }\n                    });\n                  }\n                  return;\n                }\n                // code execution 20250825:\n                case \"bash_code_execution_tool_result\":\n                case \"text_editor_code_execution_tool_result\": {\n                  controller.enqueue({\n                    type: \"tool-result\",\n                    toolCallId: part.tool_use_id,\n                    toolName: toolNameMapping.toCustomToolName(\"code_execution\"),\n                    result: part.content\n                  });\n                  return;\n                }\n                // tool search tool results:\n                case \"tool_search_tool_result\": {\n                  let providerToolName = serverToolCalls[part.tool_use_id];\n                  if (providerToolName == null) {\n                    const bm25CustomName = toolNameMapping.toCustomToolName(\n                      \"tool_search_tool_bm25\"\n                    );\n                    const regexCustomName = toolNameMapping.toCustomToolName(\n                      \"tool_search_tool_regex\"\n                    );\n                    if (bm25CustomName !== \"tool_search_tool_bm25\") {\n                      providerToolName = \"tool_search_tool_bm25\";\n                    } else if (regexCustomName !== \"tool_search_tool_regex\") {\n                      providerToolName = \"tool_search_tool_regex\";\n                    } else {\n                      providerToolName = \"tool_search_tool_regex\";\n                    }\n                  }\n                  if (part.content.type === \"tool_search_tool_search_result\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(providerToolName),\n                      result: part.content.tool_references.map((ref) => ({\n                        type: ref.type,\n                        toolName: ref.tool_name\n                      }))\n                    });\n                  } else {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: toolNameMapping.toCustomToolName(providerToolName),\n                      isError: true,\n                      result: {\n                        type: \"tool_search_tool_result_error\",\n                        errorCode: part.content.error_code\n                      }\n                    });\n                  }\n                  return;\n                }\n                // advisor results for advisor_20260301:\n                // arrives fully formed in a single content_block_start (no deltas).\n                case \"advisor_tool_result\": {\n                  const advisorToolName = toolNameMapping.toCustomToolName(\"advisor\");\n                  if (part.content.type === \"advisor_result\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      result: {\n                        type: \"advisor_result\",\n                        text: part.content.text\n                      }\n                    });\n                  } else if (part.content.type === \"advisor_redacted_result\") {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      result: {\n                        type: \"advisor_redacted_result\",\n                        encryptedContent: part.content.encrypted_content\n                      }\n                    });\n                  } else {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId: part.tool_use_id,\n                      toolName: advisorToolName,\n                      isError: true,\n                      result: {\n                        type: \"advisor_tool_result_error\",\n                        errorCode: part.content.error_code\n                      }\n                    });\n                  }\n                  return;\n                }\n                case \"mcp_tool_use\": {\n                  mcpToolCalls[part.id] = {\n                    type: \"tool-call\",\n                    toolCallId: part.id,\n                    toolName: part.name,\n                    input: JSON.stringify(part.input),\n                    providerExecuted: true,\n                    dynamic: true,\n                    providerMetadata: {\n                      anthropic: {\n                        type: \"mcp-tool-use\",\n                        serverName: part.server_name\n                      }\n                    }\n                  };\n                  controller.enqueue(mcpToolCalls[part.id]);\n                  return;\n                }\n                case \"mcp_tool_result\": {\n                  controller.enqueue({\n                    type: \"tool-result\",\n                    toolCallId: part.tool_use_id,\n                    toolName: mcpToolCalls[part.tool_use_id].toolName,\n                    isError: part.is_error,\n                    result: part.content,\n                    dynamic: true,\n                    providerMetadata: mcpToolCalls[part.tool_use_id].providerMetadata\n                  });\n                  return;\n                }\n                default: {\n                  const _exhaustiveCheck = contentBlockType;\n                  throw new Error(\n                    `Unsupported content block type: ${_exhaustiveCheck}`\n                  );\n                }\n              }\n            }\n            case \"content_block_stop\": {\n              if (contentBlocks[value.index] != null) {\n                const contentBlock = contentBlocks[value.index];\n                switch (contentBlock.type) {\n                  case \"text\": {\n                    controller.enqueue(\n                      createTextEnd(\n                        String(value.index),\n                        contentBlock.citations\n                      )\n                    );\n                    break;\n                  }\n                  case \"reasoning\": {\n                    controller.enqueue({\n                      type: \"reasoning-end\",\n                      id: String(value.index)\n                    });\n                    break;\n                  }\n                  case \"tool-call\":\n                    const isJsonResponseTool = usesJsonResponseTool && contentBlock.toolName === \"json\";\n                    if (!isJsonResponseTool) {\n                      if (contentBlock.toolset != null) {\n                        let memberInput = {};\n                        try {\n                          memberInput = contentBlock.input === \"\" ? {} : secureJsonParse2(contentBlock.input);\n                        } catch (e) {\n                          memberInput = void 0;\n                        }\n                        contentBlock.input = memberInput === void 0 ? contentBlock.input : JSON.stringify(\n                          toToolsetMemberInput({\n                            memberName: contentBlock.toolset.memberName,\n                            input: memberInput\n                          })\n                        );\n                        controller.enqueue({\n                          type: \"tool-input-delta\",\n                          id: contentBlock.toolCallId,\n                          delta: contentBlock.input\n                        });\n                      }\n                      controller.enqueue({\n                        type: \"tool-input-end\",\n                        id: contentBlock.toolCallId\n                      });\n                      let finalInput = contentBlock.input === \"\" ? \"{}\" : contentBlock.input;\n                      if (contentBlock.providerToolName === \"code_execution\") {\n                        try {\n                          const parsed = secureJsonParse2(finalInput);\n                          if (parsed != null && typeof parsed === \"object\" && \"code\" in parsed && !(\"type\" in parsed)) {\n                            finalInput = JSON.stringify({\n                              type: \"programmatic-tool-call\",\n                              ...parsed\n                            });\n                          }\n                        } catch (e) {\n                        }\n                      }\n                      controller.enqueue({\n                        type: \"tool-call\",\n                        toolCallId: contentBlock.toolCallId,\n                        toolName: contentBlock.toolName,\n                        input: finalInput,\n                        providerExecuted: contentBlock.providerExecuted,\n                        // Specific 'web_fetch' or 'web_search' tools may need code execution, which the Anthropic API\n                        // implicitly allows. In this scenario, we need to allow 'code_execution' tool calls even if the\n                        // tool was not explicitly provided. We therefore bypass the general validation by marking the\n                        // tool as dynamic.\n                        ...markCodeExecutionDynamic && contentBlock.providerToolName === \"code_execution\" ? { dynamic: true } : {},\n                        ...(contentBlock.caller || contentBlock.toolset) && {\n                          providerMetadata: {\n                            anthropic: {\n                              ...contentBlock.toolset && {\n                                toolsetName: contentBlock.toolset.name\n                              },\n                              ...contentBlock.caller && {\n                                caller: contentBlock.caller\n                              }\n                            }\n                          }\n                        }\n                      });\n                    }\n                    break;\n                }\n                delete contentBlocks[value.index];\n              }\n              blockType = void 0;\n              return;\n            }\n            case \"content_block_delta\": {\n              const deltaType = value.delta.type;\n              switch (deltaType) {\n                case \"text_delta\": {\n                  if (usesJsonResponseTool) {\n                    const entry = heldBackTextByIndex.get(value.index);\n                    if (entry != null) {\n                      entry.text += value.delta.text;\n                    }\n                    return;\n                  }\n                  controller.enqueue({\n                    type: \"text-delta\",\n                    id: String(value.index),\n                    delta: value.delta.text\n                  });\n                  return;\n                }\n                case \"thinking_delta\": {\n                  controller.enqueue({\n                    type: \"reasoning-delta\",\n                    id: String(value.index),\n                    delta: value.delta.thinking\n                  });\n                  return;\n                }\n                case \"signature_delta\": {\n                  if (blockType === \"thinking\") {\n                    controller.enqueue({\n                      type: \"reasoning-delta\",\n                      id: String(value.index),\n                      delta: \"\",\n                      providerMetadata: {\n                        anthropic: {\n                          signature: value.delta.signature\n                        }\n                      }\n                    });\n                  }\n                  return;\n                }\n                case \"compaction_delta\": {\n                  if (value.delta.content != null) {\n                    controller.enqueue({\n                      type: \"text-delta\",\n                      id: String(value.index),\n                      delta: value.delta.content\n                    });\n                  }\n                  return;\n                }\n                case \"input_json_delta\": {\n                  const contentBlock = contentBlocks[value.index];\n                  let delta = value.delta.partial_json;\n                  if (delta.length === 0) {\n                    return;\n                  }\n                  if (isJsonResponseFromTool) {\n                    if ((contentBlock == null ? void 0 : contentBlock.type) !== \"text\") {\n                      return;\n                    }\n                    controller.enqueue({\n                      type: \"text-delta\",\n                      id: String(value.index),\n                      delta\n                    });\n                  } else {\n                    if ((contentBlock == null ? void 0 : contentBlock.type) !== \"tool-call\") {\n                      return;\n                    }\n                    if (contentBlock.toolset != null) {\n                      contentBlock.input += delta;\n                      return;\n                    }\n                    if (contentBlock.firstDelta && contentBlock.providerToolInputType != null) {\n                      delta = `{\"type\": \"${contentBlock.providerToolInputType}\",${delta.substring(1)}`;\n                    }\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: contentBlock.toolCallId,\n                      delta\n                    });\n                    contentBlock.input += delta;\n                    contentBlock.firstDelta = false;\n                  }\n                  return;\n                }\n                case \"citations_delta\": {\n                  const citation = value.delta.citation;\n                  const contentBlock = contentBlocks[value.index];\n                  if (citation.type === \"web_search_result_location\") {\n                    if ((contentBlock == null ? void 0 : contentBlock.type) === \"text\") {\n                      contentBlock.citations.push(citation);\n                    }\n                    (_e = heldBackTextByIndex.get(value.index)) == null ? void 0 : _e.citations.push(citation);\n                  }\n                  const source = createCitationSource(\n                    citation,\n                    citationDocuments,\n                    generateId3\n                  );\n                  if (source) {\n                    controller.enqueue(source);\n                  }\n                  return;\n                }\n                default: {\n                  const _exhaustiveCheck = deltaType;\n                  throw new Error(\n                    `Unsupported delta type: ${_exhaustiveCheck}`\n                  );\n                }\n              }\n            }\n            case \"message_start\": {\n              if (isMessageOpen) {\n                if (activeMessageId === value.message.id) {\n                  return;\n                }\n                hasInvalidMessageSequence = true;\n                controller.enqueue({\n                  type: \"error\",\n                  error: new InvalidResponseDataError({\n                    data: value,\n                    message: `Received message_start for message ${JSON.stringify(value.message.id)} while message ${JSON.stringify(activeMessageId)} is still open.`\n                  })\n                });\n                return;\n              }\n              isMessageOpen = true;\n              activeMessageId = value.message.id;\n              heldBackTextByIndex.clear();\n              usage.input_tokens = value.message.usage.input_tokens;\n              usage.cache_read_input_tokens = (_f = value.message.usage.cache_read_input_tokens) != null ? _f : 0;\n              usage.cache_creation_input_tokens = (_g = value.message.usage.cache_creation_input_tokens) != null ? _g : 0;\n              rawUsage = {\n                ...value.message.usage\n              };\n              cacheCreationInputTokens = (_h = value.message.usage.cache_creation_input_tokens) != null ? _h : null;\n              if (value.message.input_transformations != null) {\n                inputTransformations = value.message.input_transformations;\n              }\n              if (value.message.container != null) {\n                container = {\n                  expiresAt: value.message.container.expires_at,\n                  id: value.message.container.id,\n                  skills: null\n                };\n              }\n              if (value.message.stop_reason != null) {\n                finishReason = {\n                  unified: mapAnthropicStopReason({\n                    finishReason: value.message.stop_reason,\n                    isJsonResponseFromTool\n                  }),\n                  raw: value.message.stop_reason\n                };\n              }\n              controller.enqueue({\n                type: \"response-metadata\",\n                id: (_i = value.message.id) != null ? _i : void 0,\n                modelId: (_j = value.message.model) != null ? _j : void 0\n              });\n              if (value.message.content != null) {\n                for (let contentIndex = 0; contentIndex < value.message.content.length; contentIndex++) {\n                  const part = value.message.content[contentIndex];\n                  if (part.type === \"tool_use\") {\n                    const callerInfo = getAnthropicCallerInfo(part.caller);\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: part.id,\n                      toolName: part.name\n                    });\n                    const inputStr = JSON.stringify((_k = part.input) != null ? _k : {});\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: part.id,\n                      delta: inputStr\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-end\",\n                      id: part.id\n                    });\n                    controller.enqueue({\n                      type: \"tool-call\",\n                      toolCallId: part.id,\n                      toolName: part.name,\n                      input: inputStr,\n                      ...callerInfo && {\n                        providerMetadata: {\n                          anthropic: {\n                            caller: callerInfo\n                          }\n                        }\n                      }\n                    });\n                  }\n                }\n              }\n              return;\n            }\n            case \"message_delta\": {\n              if (value.usage.input_tokens != null && usage.input_tokens !== value.usage.input_tokens) {\n                usage.input_tokens = value.usage.input_tokens;\n              }\n              usage.output_tokens = value.usage.output_tokens;\n              if (value.usage.output_tokens_details != null) {\n                usage.output_tokens_details = value.usage.output_tokens_details;\n              }\n              if (value.usage.cache_read_input_tokens != null) {\n                usage.cache_read_input_tokens = value.usage.cache_read_input_tokens;\n              }\n              if (value.usage.cache_creation_input_tokens != null) {\n                usage.cache_creation_input_tokens = value.usage.cache_creation_input_tokens;\n                cacheCreationInputTokens = value.usage.cache_creation_input_tokens;\n              }\n              if (value.usage.iterations != null) {\n                usage.iterations = value.usage.iterations;\n              }\n              finishReason = {\n                unified: mapAnthropicStopReason({\n                  finishReason: value.delta.stop_reason,\n                  isJsonResponseFromTool\n                }),\n                raw: (_l = value.delta.stop_reason) != null ? _l : void 0\n              };\n              stopSequence = (_m = value.delta.stop_sequence) != null ? _m : null;\n              stopDetails = mapAnthropicStopDetails(value.delta.stop_details);\n              container = value.delta.container != null ? {\n                expiresAt: value.delta.container.expires_at,\n                id: value.delta.container.id,\n                skills: (_o = (_n = value.delta.container.skills) == null ? void 0 : _n.map((skill) => ({\n                  type: skill.type,\n                  skillId: skill.skill_id,\n                  version: skill.version\n                }))) != null ? _o : null\n              } : null;\n              if (value.context_management) {\n                contextManagement = mapAnthropicResponseContextManagement(\n                  value.context_management\n                );\n              }\n              if (value.input_transformations != null) {\n                inputTransformations = value.input_transformations;\n              }\n              if (value.delta.safeguard_results != null) {\n                safeguardResults = value.delta.safeguard_results;\n              }\n              rawUsage = {\n                ...rawUsage,\n                ...value.usage\n              };\n              return;\n            }\n            case \"message_stop\": {\n              isMessageOpen = false;\n              activeMessageId = void 0;\n              const anthropicMetadata = {\n                usage: rawUsage != null ? rawUsage : null,\n                cacheCreationInputTokens,\n                stopSequence,\n                ...stopDetails != null ? { stopDetails } : {},\n                ...inputTransformations != null ? { inputTransformations } : {},\n                ...safeguardResults != null ? { safeguardResults } : {},\n                iterations: usage.iterations ? usage.iterations.map(\n                  (iter) => ({\n                    type: iter.type,\n                    ...iter.model != null ? { model: iter.model } : {},\n                    inputTokens: iter.input_tokens,\n                    outputTokens: iter.output_tokens,\n                    ...iter.cache_creation_input_tokens ? {\n                      cacheCreationInputTokens: iter.cache_creation_input_tokens\n                    } : {},\n                    ...iter.cache_read_input_tokens ? {\n                      cacheReadInputTokens: iter.cache_read_input_tokens\n                    } : {}\n                  })\n                ) : null,\n                container,\n                contextManagement\n              };\n              const providerMetadata = {\n                anthropic: anthropicMetadata\n              };\n              if (usedCustomProviderKey && providerOptionsName !== \"anthropic\") {\n                providerMetadata[providerOptionsName] = anthropicMetadata;\n              }\n              if (!isJsonResponseFromTool && !isContinuationStopReason(finishReason.raw)) {\n                for (const { id, text, citations } of heldBackText) {\n                  if (text.length === 0) continue;\n                  controller.enqueue({ type: \"text-start\", id });\n                  controller.enqueue({ type: \"text-delta\", id, delta: text });\n                  controller.enqueue(createTextEnd(id, citations));\n                }\n              }\n              heldBackText.length = 0;\n              controller.enqueue({\n                type: \"finish\",\n                finishReason,\n                usage: convertAnthropicMessagesUsage({ usage, rawUsage }),\n                providerMetadata\n              });\n              return;\n            }\n            case \"error\": {\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            default: {\n              const _exhaustiveCheck = value;\n              throw new Error(`Unsupported chunk type: ${_exhaustiveCheck}`);\n            }\n          }\n        }\n      })\n    );\n    const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();\n    const firstChunkReader = streamForFirstChunk.getReader();\n    try {\n      await firstChunkReader.read();\n      let result = await firstChunkReader.read();\n      if (((_a = result.value) == null ? void 0 : _a.type) === \"raw\") {\n        result = await firstChunkReader.read();\n      }\n      if (((_b = result.value) == null ? void 0 : _b.type) === \"error\") {\n        const error = result.value.error;\n        throw new APICallError({\n          message: error.message,\n          url,\n          requestBodyValues: body,\n          statusCode: error.type === \"overloaded_error\" ? 529 : 500,\n          responseHeaders,\n          responseBody: JSON.stringify(error),\n          isRetryable: error.type === \"overloaded_error\"\n        });\n      }\n    } finally {\n      firstChunkReader.cancel().catch(() => {\n      });\n      firstChunkReader.releaseLock();\n    }\n    return {\n      stream: streamForConsumer,\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n};\nfunction getModelCapabilities(modelId) {\n  if (modelId.includes(\"claude-sonnet-5-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: true,\n      rejectsThinkingDisabled: true,\n      rejectsBudgetThinking: true,\n      rejectsForcedToolUse: true,\n      supportsBetweenToolsThinking: true,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-opus-5-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: true,\n      rejectsThinkingDisabled: true,\n      rejectsBudgetThinking: true,\n      rejectsForcedToolUse: true,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-haiku-5-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: true,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: true,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-opus-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: true,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-fable-5-1\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: true,\n      rejectsBudgetThinking: true,\n      rejectsForcedToolUse: true,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-fable-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: true,\n      rejectsBudgetThinking: true,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-opus-4-8\") || modelId.includes(\"claude-opus-4-7\") || modelId.includes(\"claude-sonnet-5\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-sonnet-4-6\") || modelId.includes(\"claude-opus-4-6\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-sonnet-4-5\") || modelId.includes(\"claude-opus-4-5\") || modelId.includes(\"claude-haiku-4-5\")) {\n    return {\n      maxOutputTokens: 64e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-opus-4-1\")) {\n    return {\n      maxOutputTokens: 32e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-sonnet-4-\")) {\n    return {\n      maxOutputTokens: 64e3,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-opus-4-\")) {\n    return {\n      maxOutputTokens: 32e3,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (modelId.includes(\"claude-3-haiku\")) {\n    return {\n      maxOutputTokens: 4096,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: true\n    };\n  } else if (/claude-(?:instant(?:-|$)|v?2(?=$|[-.:])|3(?=$|[-.]))/.test(modelId)) {\n    return {\n      maxOutputTokens: 4096,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: false\n    };\n  } else if (modelId.includes(\"claude-\")) {\n    return {\n      maxOutputTokens: 128e3,\n      supportsStructuredOutput: true,\n      rejectsSamplingParameters: true,\n      rejectsThinkingDisabledAboveHighEffort: true,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: false\n    };\n  } else {\n    return {\n      maxOutputTokens: 4096,\n      supportsStructuredOutput: false,\n      rejectsSamplingParameters: false,\n      rejectsThinkingDisabledAboveHighEffort: false,\n      rejectsThinkingDisabled: false,\n      rejectsBudgetThinking: false,\n      rejectsForcedToolUse: false,\n      supportsBetweenToolsThinking: false,\n      isKnownModel: false\n    };\n  }\n}\nfunction hasWebTool20260209WithoutCodeExecution(tools) {\n  if (!tools) {\n    return false;\n  }\n  let hasWebTool20260209 = false;\n  let hasCodeExecutionTool = false;\n  for (const tool of tools) {\n    if (\"type\" in tool && (tool.type === \"web_fetch_20260209\" || tool.type === \"web_search_20260209\")) {\n      hasWebTool20260209 = true;\n      continue;\n    }\n    if (\"name\" in tool && tool.name === \"code_execution\") {\n      hasCodeExecutionTool = true;\n      break;\n    }\n  }\n  return hasWebTool20260209 && !hasCodeExecutionTool;\n}\nfunction mapAnthropicResponseContextManagement(contextManagement) {\n  return contextManagement ? {\n    appliedEdits: contextManagement.applied_edits.map((edit) => {\n      const strategy = edit.type;\n      switch (strategy) {\n        case \"clear_tool_uses_20250919\":\n          return {\n            type: edit.type,\n            clearedToolUses: edit.cleared_tool_uses,\n            clearedInputTokens: edit.cleared_input_tokens\n          };\n        case \"clear_thinking_20251015\":\n          return {\n            type: edit.type,\n            clearedThinkingTurns: edit.cleared_thinking_turns,\n            clearedInputTokens: edit.cleared_input_tokens\n          };\n        case \"compact_20260112\":\n          return {\n            type: edit.type\n          };\n      }\n    }).filter((edit) => edit !== void 0)\n  } : null;\n}\nfunction mapAnthropicStopDetails(stopDetails) {\n  if (stopDetails == null) {\n    return void 0;\n  }\n  return {\n    type: stopDetails.type,\n    ...stopDetails.category != null ? { category: stopDetails.category } : {},\n    ...stopDetails.explanation != null ? { explanation: stopDetails.explanation } : {},\n    ...stopDetails.recommended_model != null ? { recommendedModel: stopDetails.recommended_model } : {}\n  };\n}\n\n// src/tool/bash_20241022.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory3,\n  lazySchema as lazySchema15,\n  zodSchema as zodSchema15\n} from \"@ai-sdk/provider-utils\";\nimport { z as z15 } from \"zod/v4\";\nvar bash_20241022InputSchema = lazySchema15(\n  () => zodSchema15(\n    z15.object({\n      command: z15.string(),\n      restart: z15.boolean().optional()\n    })\n  )\n);\nvar bash_20241022 = createProviderToolFactory3({\n  id: \"anthropic.bash_20241022\",\n  inputSchema: bash_20241022InputSchema\n});\n\n// src/tool/bash_20250124.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory4,\n  lazySchema as lazySchema16,\n  zodSchema as zodSchema16\n} from \"@ai-sdk/provider-utils\";\nimport { z as z16 } from \"zod/v4\";\nvar bash_20250124InputSchema = lazySchema16(\n  () => zodSchema16(\n    z16.object({\n      command: z16.string(),\n      restart: z16.boolean().optional()\n    })\n  )\n);\nvar bash_20250124 = createProviderToolFactory4({\n  id: \"anthropic.bash_20250124\",\n  inputSchema: bash_20250124InputSchema\n});\n\n// src/tool/computer_20241022.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory5,\n  lazySchema as lazySchema17,\n  zodSchema as zodSchema17\n} from \"@ai-sdk/provider-utils\";\nimport { z as z17 } from \"zod/v4\";\nvar computer_20241022InputSchema = lazySchema17(\n  () => zodSchema17(\n    z17.object({\n      action: z17.enum([\n        \"key\",\n        \"type\",\n        \"mouse_move\",\n        \"left_click\",\n        \"left_click_drag\",\n        \"right_click\",\n        \"middle_click\",\n        \"double_click\",\n        \"screenshot\",\n        \"cursor_position\"\n      ]),\n      coordinate: z17.array(z17.number().int()).optional(),\n      text: z17.string().optional()\n    })\n  )\n);\nvar computer_20241022 = createProviderToolFactory5({\n  id: \"anthropic.computer_20241022\",\n  inputSchema: computer_20241022InputSchema\n});\n\n// src/tool/computer_20250124.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory6,\n  lazySchema as lazySchema18,\n  zodSchema as zodSchema18\n} from \"@ai-sdk/provider-utils\";\nimport { z as z18 } from \"zod/v4\";\nvar computer_20250124InputSchema = lazySchema18(\n  () => zodSchema18(\n    z18.object({\n      action: z18.enum([\n        \"key\",\n        \"hold_key\",\n        \"type\",\n        \"cursor_position\",\n        \"mouse_move\",\n        \"left_mouse_down\",\n        \"left_mouse_up\",\n        \"left_click\",\n        \"left_click_drag\",\n        \"right_click\",\n        \"middle_click\",\n        \"double_click\",\n        \"triple_click\",\n        \"scroll\",\n        \"wait\",\n        \"screenshot\"\n      ]),\n      coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),\n      duration: z18.number().optional(),\n      scroll_amount: z18.number().optional(),\n      scroll_direction: z18.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n      start_coordinate: z18.tuple([z18.number().int(), z18.number().int()]).optional(),\n      text: z18.string().optional()\n    })\n  )\n);\nvar computer_20250124 = createProviderToolFactory6({\n  id: \"anthropic.computer_20250124\",\n  inputSchema: computer_20250124InputSchema\n});\n\n// src/tool/computer_20251124.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory7,\n  lazySchema as lazySchema19,\n  zodSchema as zodSchema19\n} from \"@ai-sdk/provider-utils\";\nimport { z as z19 } from \"zod/v4\";\nvar computer_20251124InputSchema = lazySchema19(\n  () => zodSchema19(\n    z19.object({\n      action: z19.enum([\n        \"key\",\n        \"hold_key\",\n        \"type\",\n        \"cursor_position\",\n        \"mouse_move\",\n        \"left_mouse_down\",\n        \"left_mouse_up\",\n        \"left_click\",\n        \"left_click_drag\",\n        \"right_click\",\n        \"middle_click\",\n        \"double_click\",\n        \"triple_click\",\n        \"scroll\",\n        \"wait\",\n        \"screenshot\",\n        \"zoom\"\n      ]),\n      coordinate: z19.tuple([z19.number().int(), z19.number().int()]).optional(),\n      duration: z19.number().optional(),\n      region: z19.tuple([\n        z19.number().int(),\n        z19.number().int(),\n        z19.number().int(),\n        z19.number().int()\n      ]).optional(),\n      scroll_amount: z19.number().optional(),\n      scroll_direction: z19.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n      start_coordinate: z19.tuple([z19.number().int(), z19.number().int()]).optional(),\n      text: z19.string().optional()\n    })\n  )\n);\nvar computer_20251124 = createProviderToolFactory7({\n  id: \"anthropic.computer_20251124\",\n  inputSchema: computer_20251124InputSchema\n});\n\n// src/tool/memory_20250818.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory8,\n  lazySchema as lazySchema20,\n  zodSchema as zodSchema20\n} from \"@ai-sdk/provider-utils\";\nimport { z as z20 } from \"zod/v4\";\nvar memory_20250818InputSchema = lazySchema20(\n  () => zodSchema20(\n    z20.discriminatedUnion(\"command\", [\n      z20.object({\n        command: z20.literal(\"view\"),\n        path: z20.string(),\n        view_range: z20.tuple([z20.number(), z20.number()]).optional()\n      }),\n      z20.object({\n        command: z20.literal(\"create\"),\n        path: z20.string(),\n        file_text: z20.string()\n      }),\n      z20.object({\n        command: z20.literal(\"str_replace\"),\n        path: z20.string(),\n        old_str: z20.string(),\n        new_str: z20.string()\n      }),\n      z20.object({\n        command: z20.literal(\"insert\"),\n        path: z20.string(),\n        insert_line: z20.number(),\n        insert_text: z20.string()\n      }),\n      z20.object({\n        command: z20.literal(\"delete\"),\n        path: z20.string()\n      }),\n      z20.object({\n        command: z20.literal(\"rename\"),\n        old_path: z20.string(),\n        new_path: z20.string()\n      })\n    ])\n  )\n);\nvar memory_20250818 = createProviderToolFactory8({\n  id: \"anthropic.memory_20250818\",\n  inputSchema: memory_20250818InputSchema\n});\n\n// src/tool/text-editor_20241022.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory9,\n  lazySchema as lazySchema21,\n  zodSchema as zodSchema21\n} from \"@ai-sdk/provider-utils\";\nimport { z as z21 } from \"zod/v4\";\nvar textEditor_20241022InputSchema = lazySchema21(\n  () => zodSchema21(\n    z21.object({\n      command: z21.enum([\"view\", \"create\", \"str_replace\", \"insert\", \"undo_edit\"]),\n      path: z21.string(),\n      file_text: z21.string().optional(),\n      insert_line: z21.number().int().optional(),\n      new_str: z21.string().optional(),\n      insert_text: z21.string().optional(),\n      old_str: z21.string().optional(),\n      view_range: z21.array(z21.number().int()).optional()\n    })\n  )\n);\nvar textEditor_20241022 = createProviderToolFactory9({\n  id: \"anthropic.text_editor_20241022\",\n  inputSchema: textEditor_20241022InputSchema\n});\n\n// src/tool/text-editor_20250124.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory10,\n  lazySchema as lazySchema22,\n  zodSchema as zodSchema22\n} from \"@ai-sdk/provider-utils\";\nimport { z as z22 } from \"zod/v4\";\nvar textEditor_20250124InputSchema = lazySchema22(\n  () => zodSchema22(\n    z22.object({\n      command: z22.enum([\"view\", \"create\", \"str_replace\", \"insert\", \"undo_edit\"]),\n      path: z22.string(),\n      file_text: z22.string().optional(),\n      insert_line: z22.number().int().optional(),\n      new_str: z22.string().optional(),\n      insert_text: z22.string().optional(),\n      old_str: z22.string().optional(),\n      view_range: z22.array(z22.number().int()).optional()\n    })\n  )\n);\nvar textEditor_20250124 = createProviderToolFactory10({\n  id: \"anthropic.text_editor_20250124\",\n  inputSchema: textEditor_20250124InputSchema\n});\n\n// src/tool/text-editor_20250429.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory11,\n  lazySchema as lazySchema23,\n  zodSchema as zodSchema23\n} from \"@ai-sdk/provider-utils\";\nimport { z as z23 } from \"zod/v4\";\nvar textEditor_20250429InputSchema = lazySchema23(\n  () => zodSchema23(\n    z23.object({\n      command: z23.enum([\"view\", \"create\", \"str_replace\", \"insert\"]),\n      path: z23.string(),\n      file_text: z23.string().optional(),\n      insert_line: z23.number().int().optional(),\n      new_str: z23.string().optional(),\n      insert_text: z23.string().optional(),\n      old_str: z23.string().optional(),\n      view_range: z23.array(z23.number().int()).optional()\n    })\n  )\n);\nvar textEditor_20250429 = createProviderToolFactory11({\n  id: \"anthropic.text_editor_20250429\",\n  inputSchema: textEditor_20250429InputSchema\n});\n\n// src/tool/tool-search-bm25_20251119.ts\nimport {\n  createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema10,\n  lazySchema as lazySchema24,\n  zodSchema as zodSchema24\n} from \"@ai-sdk/provider-utils\";\nimport { z as z24 } from \"zod/v4\";\nvar toolSearchBm25_20251119OutputSchema = lazySchema24(\n  () => zodSchema24(\n    z24.array(\n      z24.object({\n        type: z24.literal(\"tool_reference\"),\n        toolName: z24.string()\n      })\n    )\n  )\n);\nvar toolSearchBm25_20251119InputSchema = lazySchema24(\n  () => zodSchema24(\n    z24.object({\n      /**\n       * A natural language query to search for tools.\n       * Claude will use BM25 text search to find relevant tools.\n       */\n      query: z24.string(),\n      /**\n       * Maximum number of tools to return. Optional.\n       */\n      limit: z24.number().optional()\n    })\n  )\n);\nvar factory11 = createProviderToolFactoryWithOutputSchema10({\n  id: \"anthropic.tool_search_bm25_20251119\",\n  inputSchema: toolSearchBm25_20251119InputSchema,\n  outputSchema: toolSearchBm25_20251119OutputSchema,\n  supportsDeferredResults: true\n});\nvar toolSearchBm25_20251119 = (args = {}) => {\n  return factory11(args);\n};\n\n// src/anthropic-tools.ts\nvar anthropicTools = {\n  /**\n   * Pairs a faster executor model with a higher-intelligence advisor model\n   * that provides strategic guidance mid-generation.\n   *\n   * The advisor lets a faster, lower-cost executor model consult a\n   * higher-intelligence advisor model server-side. The advisor reads the\n   * executor's full transcript and produces a plan or course correction;\n   * the executor continues with the task, informed by the advice. All of\n   * this happens inside a single `/v1/messages` request.\n   *\n   * Beta header `advisor-tool-2026-03-01` is added automatically when this\n   * tool is included.\n   *\n   * Multi-turn conversations: pass the full assistant content (including\n   * `advisor_tool_result` blocks) back to the API on subsequent turns. If\n   * you omit the advisor tool from `tools` on a follow-up turn while the\n   * message history still contains `advisor_tool_result` blocks, the API\n   * returns a `400 invalid_request_error`.\n   *\n   * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,\n   * Opus 4.7. The advisor must be at least as capable as the executor.\n   *\n   * @param model - The advisor model ID (required), e.g. `\"claude-opus-4-8\"`.\n   * @param maxUses - Maximum advisor calls per request (per-request cap).\n   * @param caching - Enables prompt caching for the advisor's transcript\n   * across calls within a conversation. Worthwhile from ~3 advisor calls\n   * per conversation.\n   */\n  advisor_20260301,\n  /**\n   * The bash tool enables Claude to execute shell commands in a persistent bash session,\n   * allowing system operations, script execution, and command-line automation.\n   *\n   * Image results are supported.\n   */\n  bash_20241022,\n  /**\n   * The bash tool enables Claude to execute shell commands in a persistent bash session,\n   * allowing system operations, script execution, and command-line automation.\n   *\n   * Image results are supported.\n   */\n  bash_20250124,\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   */\n  codeExecution_20250522,\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   *\n   * This is the latest version with enhanced Bash support and file operations.\n   */\n  codeExecution_20250825,\n  /**\n   * Claude can analyze data, create visualizations, perform complex calculations,\n   * run system commands, create and edit files, and process uploaded files directly within\n   * the API conversation.\n   *\n   * The code execution tool allows Claude to run both Python and Bash commands and manipulate files,\n   * including writing code, in a secure, sandboxed environment.\n   *\n   * This is the recommended version. Does not require a beta header.\n   *\n   * Supported models: Claude Opus 4.6, Sonnet 4.6, Sonnet 4.5, Opus 4.5\n   */\n  codeExecution_20260120,\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * Image results are supported.\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   */\n  computer_20241022,\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * Image results are supported.\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   */\n  computer_20250124,\n  /**\n   * Claude can interact with computer environments through the computer use tool, which\n   * provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.\n   *\n   * This version adds the zoom action for detailed screen region inspection.\n   *\n   * Image results are supported.\n   *\n   * Supported models: Claude Opus 4.5\n   *\n   * @param displayWidthPx - The width of the display being controlled by the model in pixels.\n   * @param displayHeightPx - The height of the display being controlled by the model in pixels.\n   * @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.\n   * @param enableZoom - Enable zoom action. Set to true to allow Claude to zoom into specific screen regions. Default: false.\n   */\n  computer_20251124,\n  /**\n   * The computer toolset lets Claude control a computer through screenshots,\n   * mouse, and keyboard. It replaces the versioned computer tools\n   * (`computer_20251124` and earlier) on newer models.\n   *\n   * The API returns each computer action as its own `tool_use` block with\n   * `toolset_name: 'computer'`. The AI SDK maps every member call to this tool\n   * and exposes the member name as `action`, so `execute` receives the same\n   * input shape as the older computer tools. Claude may return several actions\n   * in one turn.\n   *\n   * Coordinates are always in the pixel space of the screenshots you return;\n   * there are no display size parameters. Zoom is enabled by default.\n   *\n   * Does not require a beta header.\n   *\n   * Supported models: Claude Opus 5.5 (required; older computer tool types\n   * are rejected), Opus 5, Sonnet 5, Fable 5, Fable 5.1, Opus 4.8.\n   *\n   * @param configs - Per-member settings keyed by member name, e.g.\n   * `{ zoom: { enabled: false } }`. Omitted members keep their defaults.\n   */\n  computerToolset_20260801,\n  /**\n   * The memory tool enables Claude to store and retrieve information across conversations through a memory file directory.\n   * Claude can create, read, update, and delete files that persist between sessions,\n   * allowing it to build knowledge over time without keeping everything in the context window.\n   * The memory tool operates client-side—you control where and how the data is stored through your own infrastructure.\n   *\n   * Supported models: Claude Sonnet 4.5, Claude Sonnet 4, Claude Opus 4.1, Claude Opus 4.\n   */\n  memory_20250818,\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Supported models: Claude Sonnet 3.5\n   */\n  textEditor_20241022,\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Supported models: Claude Sonnet 3.7\n   */\n  textEditor_20250124,\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Note: This version does not support the \"undo_edit\" command.\n   *\n   * @deprecated Use textEditor_20250728 instead\n   */\n  textEditor_20250429,\n  /**\n   * Claude can use an Anthropic-defined text editor tool to view and modify text files,\n   * helping you debug, fix, and improve your code or other text documents. This allows Claude\n   * to directly interact with your files, providing hands-on assistance rather than just suggesting changes.\n   *\n   * Note: This version does not support the \"undo_edit\" command and adds optional max_characters parameter.\n   *\n   * Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1\n   *\n   * @param maxCharacters - Optional maximum number of characters to view in the file\n   */\n  textEditor_20250728,\n  /**\n   * Creates a web fetch tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - The max_uses parameter limits the number of web fetches performed\n   * @param allowedDomains - Only fetch from these domains\n   * @param blockedDomains - Never fetch from these domains\n   * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n   * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n   */\n  webFetch_20250910,\n  /**\n   * Creates a web fetch tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - The max_uses parameter limits the number of web fetches performed\n   * @param allowedDomains - Only fetch from these domains\n   * @param blockedDomains - Never fetch from these domains\n   * @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set \"citations\": {\"enabled\": true} to enable Claude to cite specific passages from fetched documents.\n   * @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.\n   */\n  webFetch_20260209,\n  /**\n   * Creates a web search tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n   * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n   * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n   * @param userLocation - Optional user location information to provide geographically relevant search results.\n   */\n  webSearch_20250305,\n  /**\n   * Creates a web search tool that gives Claude direct access to real-time web content.\n   *\n   * @param maxUses - Maximum number of web searches Claude can perform during the conversation.\n   * @param allowedDomains - Optional list of domains that Claude is allowed to search.\n   * @param blockedDomains - Optional list of domains that Claude should avoid when searching.\n   * @param userLocation - Optional user location information to provide geographically relevant search results.\n   */\n  webSearch_20260209,\n  /**\n   * Creates a tool search tool that uses regex patterns to find tools.\n   *\n   * The tool search tool enables Claude to work with hundreds or thousands of tools\n   * by dynamically discovering and loading them on-demand. Instead of loading all\n   * tool definitions into the context window upfront, Claude searches your tool\n   * catalog and loads only the tools it needs.\n   *\n   * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n   * to mark them for deferred loading.\n   *\n   * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n   */\n  toolSearchRegex_20251119,\n  /**\n   * Creates a tool search tool that uses BM25 (natural language) to find tools.\n   *\n   * The tool search tool enables Claude to work with hundreds or thousands of tools\n   * by dynamically discovering and loading them on-demand. Instead of loading all\n   * tool definitions into the context window upfront, Claude searches your tool\n   * catalog and loads only the tools it needs.\n   *\n   * Use `providerOptions: { anthropic: { deferLoading: true } }` on other tools\n   * to mark them for deferred loading.\n   *\n   * Supported models: Claude Opus 4.5, Claude Sonnet 4.5\n   */\n  toolSearchBm25_20251119\n};\n\n// src/anthropic-provider.ts\nvar ANTHROPIC_API_URL = \"https://api.anthropic.com\";\nvar ANTHROPIC_API_VERSIONED_URL = `${ANTHROPIC_API_URL}/v1`;\nfunction normalizeBaseURL(baseURL) {\n  const baseURLWithoutTrailingSlash = withoutTrailingSlash(baseURL);\n  return baseURLWithoutTrailingSlash === ANTHROPIC_API_URL ? ANTHROPIC_API_VERSIONED_URL : baseURLWithoutTrailingSlash;\n}\nfunction createAnthropic(options = {}) {\n  var _a, _b;\n  const baseURL = (_a = normalizeBaseURL(\n    loadOptionalSetting({\n      settingValue: options.baseURL,\n      environmentVariableName: \"ANTHROPIC_BASE_URL\"\n    })\n  )) != null ? _a : ANTHROPIC_API_VERSIONED_URL;\n  const providerName = (_b = options.name) != null ? _b : \"anthropic.messages\";\n  if (options.apiKey && options.authToken) {\n    throw new InvalidArgumentError({\n      argument: \"apiKey/authToken\",\n      message: \"Both apiKey and authToken were provided. Please use only one authentication method.\"\n    });\n  }\n  const getHeaders = () => {\n    const authHeaders = options.authToken ? { Authorization: `Bearer ${options.authToken}` } : {\n      \"x-api-key\": loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"ANTHROPIC_API_KEY\",\n        description: \"Anthropic\"\n      })\n    };\n    return withUserAgentSuffix(\n      {\n        \"anthropic-version\": \"2023-06-01\",\n        ...authHeaders,\n        ...options.headers\n      },\n      `ai-sdk/anthropic/${VERSION}`\n    );\n  };\n  const createChatModel = (modelId) => {\n    var _a2;\n    return new AnthropicMessagesLanguageModel(modelId, {\n      provider: providerName,\n      baseURL,\n      headers: getHeaders,\n      fetch: options.fetch,\n      generateId: (_a2 = options.generateId) != null ? _a2 : generateId2,\n      supportedUrls: () => ({\n        \"image/*\": [/^https?:\\/\\/.*$/],\n        \"application/pdf\": [/^https?:\\/\\/.*$/]\n      })\n    });\n  };\n  const provider = function(modelId) {\n    if (new.target) {\n      throw new Error(\n        \"The Anthropic model function cannot be called with the new keyword.\"\n      );\n    }\n    return createChatModel(modelId);\n  };\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.messages = createChatModel;\n  provider.embeddingModel = (modelId) => {\n    throw new NoSuchModelError({ modelId, modelType: \"embeddingModel\" });\n  };\n  provider.textEmbeddingModel = provider.embeddingModel;\n  provider.imageModel = (modelId) => {\n    throw new NoSuchModelError({ modelId, modelType: \"imageModel\" });\n  };\n  provider.tools = anthropicTools;\n  return provider;\n}\nvar anthropic = createAnthropic();\n\n// src/forward-anthropic-container-id-from-last-step.ts\nfunction forwardAnthropicContainerIdFromLastStep({\n  steps\n}) {\n  var _a, _b, _c;\n  for (let i = steps.length - 1; i >= 0; i--) {\n    const containerId = (_c = (_b = (_a = steps[i].providerMetadata) == null ? void 0 : _a.anthropic) == null ? void 0 : _b.container) == null ? void 0 : _c.id;\n    if (containerId) {\n      return {\n        providerOptions: {\n          anthropic: {\n            container: { id: containerId }\n          }\n        }\n      };\n    }\n  }\n  return void 0;\n}\nexport {\n  VERSION,\n  anthropic,\n  createAnthropic,\n  forwardAnthropicContainerIdFromLastStep\n};\n//# sourceMappingURL=index.mjs.map","var __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __typeError = (msg) => {\n  throw TypeError(msg);\n};\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n  for (var prop in b || (b = {}))\n    if (__hasOwnProp.call(b, prop))\n      __defNormalProp(a, prop, b[prop]);\n  if (__getOwnPropSymbols)\n    for (var prop of __getOwnPropSymbols(b)) {\n      if (__propIsEnum.call(b, prop))\n        __defNormalProp(a, prop, b[prop]);\n    }\n  return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n  var target = {};\n  for (var prop in source)\n    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n      target[prop] = source[prop];\n  if (source != null && __getOwnPropSymbols)\n    for (var prop of __getOwnPropSymbols(source)) {\n      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n        target[prop] = source[prop];\n    }\n  return target;\n};\nvar __accessCheck = (obj, member, msg) => member.has(obj) || __typeError(\"Cannot \" + msg);\nvar __privateGet = (obj, member, getter) => (__accessCheck(obj, member, \"read from private field\"), getter ? getter.call(obj) : member.get(obj));\nvar __privateAdd = (obj, member, value) => member.has(obj) ? __typeError(\"Cannot add the same private member more than once\") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n\n// node_modules/.pnpm/@ai-sdk+provider@3.0.8/node_modules/@ai-sdk/provider/dist/index.mjs\nvar marker = \"vercel.ai.error\";\nvar symbol = Symbol.for(marker);\nvar _a;\nvar _b;\nvar AISDKError = class _AISDKError extends (_b = Error, _a = symbol, _b) {\n  /**\n   * Creates an AI SDK Error.\n   *\n   * @param {Object} params - The parameters for creating the error.\n   * @param {string} params.name - The name of the error.\n   * @param {string} params.message - The error message.\n   * @param {unknown} [params.cause] - The underlying cause of the error.\n   */\n  constructor({\n    name: name142,\n    message,\n    cause\n  }) {\n    super(message);\n    this[_a] = true;\n    this.name = name142;\n    this.cause = cause;\n  }\n  /**\n   * Checks if the given error is an AI SDK Error.\n   * @param {unknown} error - The error to check.\n   * @returns {boolean} True if the error is an AI SDK Error, false otherwise.\n   */\n  static isInstance(error) {\n    return _AISDKError.hasMarker(error, marker);\n  }\n  static hasMarker(error, marker152) {\n    const markerSymbol = Symbol.for(marker152);\n    return error != null && typeof error === \"object\" && markerSymbol in error && typeof error[markerSymbol] === \"boolean\" && error[markerSymbol] === true;\n  }\n};\nvar name = \"AI_APICallError\";\nvar marker2 = `vercel.ai.error.${name}`;\nvar symbol2 = Symbol.for(marker2);\nvar _a2;\nvar _b2;\nvar APICallError = class extends (_b2 = AISDKError, _a2 = symbol2, _b2) {\n  constructor({\n    message,\n    url,\n    requestBodyValues,\n    statusCode,\n    responseHeaders,\n    responseBody,\n    cause,\n    isRetryable = statusCode != null && (statusCode === 408 || // request timeout\n    statusCode === 409 || // conflict\n    statusCode === 429 || // too many requests\n    statusCode >= 500),\n    // server error\n    data\n  }) {\n    super({ name, message, cause });\n    this[_a2] = true;\n    this.url = url;\n    this.requestBodyValues = requestBodyValues;\n    this.statusCode = statusCode;\n    this.responseHeaders = responseHeaders;\n    this.responseBody = responseBody;\n    this.isRetryable = isRetryable;\n    this.data = data;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker2);\n  }\n};\nvar name2 = \"AI_EmptyResponseBodyError\";\nvar marker3 = `vercel.ai.error.${name2}`;\nvar symbol3 = Symbol.for(marker3);\nvar _a3;\nvar _b3;\nvar EmptyResponseBodyError = class extends (_b3 = AISDKError, _a3 = symbol3, _b3) {\n  // used in isInstance\n  constructor({ message = \"Empty response body\" } = {}) {\n    super({ name: name2, message });\n    this[_a3] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker3);\n  }\n};\nfunction getErrorMessage(error) {\n  if (error == null) {\n    return \"unknown error\";\n  }\n  if (typeof error === \"string\") {\n    return error;\n  }\n  if (error instanceof Error) {\n    return error.message;\n  }\n  return JSON.stringify(error);\n}\nvar name3 = \"AI_InvalidArgumentError\";\nvar marker4 = `vercel.ai.error.${name3}`;\nvar symbol4 = Symbol.for(marker4);\nvar _a4;\nvar _b4;\nvar InvalidArgumentError = class extends (_b4 = AISDKError, _a4 = symbol4, _b4) {\n  constructor({\n    message,\n    cause,\n    argument\n  }) {\n    super({ name: name3, message, cause });\n    this[_a4] = true;\n    this.argument = argument;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker4);\n  }\n};\nvar name4 = \"AI_InvalidPromptError\";\nvar marker5 = `vercel.ai.error.${name4}`;\nvar symbol5 = Symbol.for(marker5);\nvar _a5;\nvar _b5;\nvar InvalidPromptError = class extends (_b5 = AISDKError, _a5 = symbol5, _b5) {\n  constructor({\n    prompt,\n    message,\n    cause\n  }) {\n    super({ name: name4, message: `Invalid prompt: ${message}`, cause });\n    this[_a5] = true;\n    this.prompt = prompt;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker5);\n  }\n};\nvar name5 = \"AI_InvalidResponseDataError\";\nvar marker6 = `vercel.ai.error.${name5}`;\nvar symbol6 = Symbol.for(marker6);\nvar _a6;\nvar _b6;\nvar InvalidResponseDataError = class extends (_b6 = AISDKError, _a6 = symbol6, _b6) {\n  constructor({\n    data,\n    message = `Invalid response data: ${JSON.stringify(data)}.`\n  }) {\n    super({ name: name5, message });\n    this[_a6] = true;\n    this.data = data;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker6);\n  }\n};\nvar name6 = \"AI_JSONParseError\";\nvar marker7 = `vercel.ai.error.${name6}`;\nvar symbol7 = Symbol.for(marker7);\nvar _a7;\nvar _b7;\nvar JSONParseError = class extends (_b7 = AISDKError, _a7 = symbol7, _b7) {\n  constructor({ text, cause }) {\n    super({\n      name: name6,\n      message: `JSON parsing failed: Text: ${text}.\nError message: ${getErrorMessage(cause)}`,\n      cause\n    });\n    this[_a7] = true;\n    this.text = text;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker7);\n  }\n};\nvar name7 = \"AI_LoadAPIKeyError\";\nvar marker8 = `vercel.ai.error.${name7}`;\nvar symbol8 = Symbol.for(marker8);\nvar _a8;\nvar _b8;\nvar LoadAPIKeyError = class extends (_b8 = AISDKError, _a8 = symbol8, _b8) {\n  // used in isInstance\n  constructor({ message }) {\n    super({ name: name7, message });\n    this[_a8] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker8);\n  }\n};\nvar name8 = \"AI_LoadSettingError\";\nvar marker9 = `vercel.ai.error.${name8}`;\nvar symbol9 = Symbol.for(marker9);\nvar _a9;\nvar _b9;\nvar LoadSettingError = class extends (_b9 = AISDKError, _a9 = symbol9, _b9) {\n  // used in isInstance\n  constructor({ message }) {\n    super({ name: name8, message });\n    this[_a9] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker9);\n  }\n};\nvar name9 = \"AI_NoContentGeneratedError\";\nvar marker10 = `vercel.ai.error.${name9}`;\nvar symbol10 = Symbol.for(marker10);\nvar _a10;\nvar _b10;\nvar NoContentGeneratedError = class extends (_b10 = AISDKError, _a10 = symbol10, _b10) {\n  // used in isInstance\n  constructor({\n    message = \"No content generated.\"\n  } = {}) {\n    super({ name: name9, message });\n    this[_a10] = true;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker10);\n  }\n};\nvar name10 = \"AI_NoSuchModelError\";\nvar marker11 = `vercel.ai.error.${name10}`;\nvar symbol11 = Symbol.for(marker11);\nvar _a11;\nvar _b11;\nvar NoSuchModelError = class extends (_b11 = AISDKError, _a11 = symbol11, _b11) {\n  constructor({\n    errorName = name10,\n    modelId,\n    modelType,\n    message = `No such ${modelType}: ${modelId}`\n  }) {\n    super({ name: errorName, message });\n    this[_a11] = true;\n    this.modelId = modelId;\n    this.modelType = modelType;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker11);\n  }\n};\nvar name11 = \"AI_TooManyEmbeddingValuesForCallError\";\nvar marker12 = `vercel.ai.error.${name11}`;\nvar symbol12 = Symbol.for(marker12);\nvar _a12;\nvar _b12;\nvar TooManyEmbeddingValuesForCallError = class extends (_b12 = AISDKError, _a12 = symbol12, _b12) {\n  constructor(options) {\n    super({\n      name: name11,\n      message: `Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`\n    });\n    this[_a12] = true;\n    this.provider = options.provider;\n    this.modelId = options.modelId;\n    this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;\n    this.values = options.values;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker12);\n  }\n};\nvar name12 = \"AI_TypeValidationError\";\nvar marker13 = `vercel.ai.error.${name12}`;\nvar symbol13 = Symbol.for(marker13);\nvar _a13;\nvar _b13;\nvar TypeValidationError = class _TypeValidationError extends (_b13 = AISDKError, _a13 = symbol13, _b13) {\n  constructor({\n    value,\n    cause,\n    context\n  }) {\n    let contextPrefix = \"Type validation failed\";\n    if (context == null ? void 0 : context.field) {\n      contextPrefix += ` for ${context.field}`;\n    }\n    if ((context == null ? void 0 : context.entityName) || (context == null ? void 0 : context.entityId)) {\n      contextPrefix += \" (\";\n      const parts = [];\n      if (context.entityName) {\n        parts.push(context.entityName);\n      }\n      if (context.entityId) {\n        parts.push(`id: \"${context.entityId}\"`);\n      }\n      contextPrefix += parts.join(\", \");\n      contextPrefix += \")\";\n    }\n    super({\n      name: name12,\n      message: `${contextPrefix}: Value: ${JSON.stringify(value)}.\nError message: ${getErrorMessage(cause)}`,\n      cause\n    });\n    this[_a13] = true;\n    this.value = value;\n    this.context = context;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker13);\n  }\n  /**\n   * Wraps an error into a TypeValidationError.\n   * If the cause is already a TypeValidationError with the same value and context, it returns the cause.\n   * Otherwise, it creates a new TypeValidationError.\n   *\n   * @param {Object} params - The parameters for wrapping the error.\n   * @param {unknown} params.value - The value that failed validation.\n   * @param {unknown} params.cause - The original error or cause of the validation failure.\n   * @param {TypeValidationContext} params.context - Optional context about what is being validated.\n   * @returns {TypeValidationError} A TypeValidationError instance.\n   */\n  static wrap({\n    value,\n    cause,\n    context\n  }) {\n    var _a152, _b152, _c;\n    if (_TypeValidationError.isInstance(cause) && cause.value === value && ((_a152 = cause.context) == null ? void 0 : _a152.field) === (context == null ? void 0 : context.field) && ((_b152 = cause.context) == null ? void 0 : _b152.entityName) === (context == null ? void 0 : context.entityName) && ((_c = cause.context) == null ? void 0 : _c.entityId) === (context == null ? void 0 : context.entityId)) {\n      return cause;\n    }\n    return new _TypeValidationError({ value, cause, context });\n  }\n};\nvar name13 = \"AI_UnsupportedFunctionalityError\";\nvar marker14 = `vercel.ai.error.${name13}`;\nvar symbol14 = Symbol.for(marker14);\nvar _a14;\nvar _b14;\nvar UnsupportedFunctionalityError = class extends (_b14 = AISDKError, _a14 = symbol14, _b14) {\n  constructor({\n    functionality,\n    message = `'${functionality}' functionality not supported.`\n  }) {\n    super({ name: name13, message });\n    this[_a14] = true;\n    this.functionality = functionality;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker14);\n  }\n};\n\n// node_modules/.pnpm/@ai-sdk+provider-utils@4.0.23_zod@4.3.5/node_modules/@ai-sdk/provider-utils/dist/index.mjs\nimport * as z4 from \"zod/v4\";\nimport { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from \"zod/v3\";\nimport { ZodFirstPartyTypeKind } from \"zod/v3\";\nimport {\n  ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2\n} from \"zod/v3\";\n\n// node_modules/.pnpm/eventsource-parser@3.0.6/node_modules/eventsource-parser/dist/index.js\nvar ParseError = class extends Error {\n  constructor(message, options) {\n    super(message), this.name = \"ParseError\", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;\n  }\n};\nfunction noop(_arg) {\n}\nfunction createParser(callbacks) {\n  if (typeof callbacks == \"function\")\n    throw new TypeError(\n      \"`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?\"\n    );\n  const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;\n  let incompleteLine = \"\", isFirstChunk = true, id, data = \"\", eventType = \"\";\n  function feed(newChunk) {\n    const chunk = isFirstChunk ? newChunk.replace(/^\\xEF\\xBB\\xBF/, \"\") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`);\n    for (const line of complete)\n      parseLine(line);\n    incompleteLine = incomplete, isFirstChunk = false;\n  }\n  function parseLine(line) {\n    if (line === \"\") {\n      dispatchEvent();\n      return;\n    }\n    if (line.startsWith(\":\")) {\n      onComment && onComment(line.slice(line.startsWith(\": \") ? 2 : 1));\n      return;\n    }\n    const fieldSeparatorIndex = line.indexOf(\":\");\n    if (fieldSeparatorIndex !== -1) {\n      const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === \" \" ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);\n      processField(field, value, line);\n      return;\n    }\n    processField(line, \"\", line);\n  }\n  function processField(field, value, line) {\n    switch (field) {\n      case \"event\":\n        eventType = value;\n        break;\n      case \"data\":\n        data = `${data}${value}\n`;\n        break;\n      case \"id\":\n        id = value.includes(\"\\0\") ? void 0 : value;\n        break;\n      case \"retry\":\n        /^\\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(\n          new ParseError(`Invalid \\`retry\\` value: \"${value}\"`, {\n            type: \"invalid-retry\",\n            value,\n            line\n          })\n        );\n        break;\n      default:\n        onError(\n          new ParseError(\n            `Unknown field \"${field.length > 20 ? `${field.slice(0, 20)}\\u2026` : field}\"`,\n            { type: \"unknown-field\", field, value, line }\n          )\n        );\n        break;\n    }\n  }\n  function dispatchEvent() {\n    data.length > 0 && onEvent({\n      id,\n      event: eventType || void 0,\n      // If the data buffer's last character is a U+000A LINE FEED (LF) character,\n      // then remove the last character from the data buffer.\n      data: data.endsWith(`\n`) ? data.slice(0, -1) : data\n    }), id = void 0, data = \"\", eventType = \"\";\n  }\n  function reset(options = {}) {\n    incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id = void 0, data = \"\", eventType = \"\", incompleteLine = \"\";\n  }\n  return { feed, reset };\n}\nfunction splitLines(chunk) {\n  const lines = [];\n  let incompleteLine = \"\", searchIndex = 0;\n  for (; searchIndex < chunk.length; ) {\n    const crIndex = chunk.indexOf(\"\\r\", searchIndex), lfIndex = chunk.indexOf(`\n`, searchIndex);\n    let lineEnd = -1;\n    if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {\n      incompleteLine = chunk.slice(searchIndex);\n      break;\n    } else {\n      const line = chunk.slice(searchIndex, lineEnd);\n      lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === \"\\r\" && chunk[searchIndex] === `\n` && searchIndex++;\n    }\n  }\n  return [lines, incompleteLine];\n}\n\n// node_modules/.pnpm/eventsource-parser@3.0.6/node_modules/eventsource-parser/dist/stream.js\nvar EventSourceParserStream = class extends TransformStream {\n  constructor({ onError, onRetry, onComment } = {}) {\n    let parser;\n    super({\n      start(controller) {\n        parser = createParser({\n          onEvent: (event) => {\n            controller.enqueue(event);\n          },\n          onError(error) {\n            onError === \"terminate\" ? controller.error(error) : typeof onError == \"function\" && onError(error);\n          },\n          onRetry,\n          onComment\n        });\n      },\n      transform(chunk) {\n        parser.feed(chunk);\n      }\n    });\n  }\n};\n\n// node_modules/.pnpm/@ai-sdk+provider-utils@4.0.23_zod@4.3.5/node_modules/@ai-sdk/provider-utils/dist/index.mjs\nfunction combineHeaders(...headers) {\n  return headers.reduce(\n    (combinedHeaders, currentHeaders) => __spreadValues(__spreadValues({}, combinedHeaders), currentHeaders != null ? currentHeaders : {}),\n    {}\n  );\n}\nasync function delay(delayInMs, options) {\n  if (delayInMs == null) {\n    return Promise.resolve();\n  }\n  const signal = options == null ? void 0 : options.abortSignal;\n  return new Promise((resolve2, reject) => {\n    if (signal == null ? void 0 : signal.aborted) {\n      reject(createAbortError());\n      return;\n    }\n    const timeoutId = setTimeout(() => {\n      cleanup();\n      resolve2();\n    }, delayInMs);\n    const cleanup = () => {\n      clearTimeout(timeoutId);\n      signal == null ? void 0 : signal.removeEventListener(\"abort\", onAbort);\n    };\n    const onAbort = () => {\n      cleanup();\n      reject(createAbortError());\n    };\n    signal == null ? void 0 : signal.addEventListener(\"abort\", onAbort);\n  });\n}\nfunction createAbortError() {\n  return new DOMException(\"Delay was aborted\", \"AbortError\");\n}\nfunction extractResponseHeaders(response) {\n  return Object.fromEntries([...response.headers]);\n}\nvar { btoa, atob } = globalThis;\nfunction convertUint8ArrayToBase64(array) {\n  let latin1string = \"\";\n  for (let i = 0; i < array.length; i++) {\n    latin1string += String.fromCodePoint(array[i]);\n  }\n  return btoa(latin1string);\n}\nvar name14 = \"AI_DownloadError\";\nvar marker15 = `vercel.ai.error.${name14}`;\nvar symbol15 = Symbol.for(marker15);\nvar _a15;\nvar _b15;\nvar DownloadError = class extends (_b15 = AISDKError, _a15 = symbol15, _b15) {\n  constructor({\n    url,\n    statusCode,\n    statusText,\n    cause,\n    message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}`\n  }) {\n    super({ name: name14, message, cause });\n    this[_a15] = true;\n    this.url = url;\n    this.statusCode = statusCode;\n    this.statusText = statusText;\n  }\n  static isInstance(error) {\n    return AISDKError.hasMarker(error, marker15);\n  }\n};\nvar DEFAULT_MAX_DOWNLOAD_SIZE = 2 * 1024 * 1024 * 1024;\nvar createIdGenerator = ({\n  prefix,\n  size = 16,\n  alphabet = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n  separator = \"-\"\n} = {}) => {\n  const generator = () => {\n    const alphabetLength = alphabet.length;\n    const chars = new Array(size);\n    for (let i = 0; i < size; i++) {\n      chars[i] = alphabet[Math.random() * alphabetLength | 0];\n    }\n    return chars.join(\"\");\n  };\n  if (prefix == null) {\n    return generator;\n  }\n  if (alphabet.includes(separator)) {\n    throw new InvalidArgumentError({\n      argument: \"separator\",\n      message: `The separator \"${separator}\" must not be part of the alphabet \"${alphabet}\".`\n    });\n  }\n  return () => `${prefix}${separator}${generator()}`;\n};\nvar generateId = createIdGenerator();\nfunction isAbortError(error) {\n  return (error instanceof Error || error instanceof DOMException) && (error.name === \"AbortError\" || error.name === \"ResponseAborted\" || // Next.js\n  error.name === \"TimeoutError\");\n}\nvar FETCH_FAILED_ERROR_MESSAGES = [\"fetch failed\", \"failed to fetch\"];\nvar BUN_ERROR_CODES = [\n  \"ConnectionRefused\",\n  \"ConnectionClosed\",\n  \"FailedToOpenSocket\",\n  \"ECONNRESET\",\n  \"ECONNREFUSED\",\n  \"ETIMEDOUT\",\n  \"EPIPE\"\n];\nfunction isBunNetworkError(error) {\n  if (!(error instanceof Error)) {\n    return false;\n  }\n  const code = error.code;\n  if (typeof code === \"string\" && BUN_ERROR_CODES.includes(code)) {\n    return true;\n  }\n  return false;\n}\nfunction handleFetchError({\n  error,\n  url,\n  requestBodyValues\n}) {\n  if (isAbortError(error)) {\n    return error;\n  }\n  if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) {\n    const cause = error.cause;\n    if (cause != null) {\n      return new APICallError({\n        message: `Cannot connect to API: ${cause.message}`,\n        cause,\n        url,\n        requestBodyValues,\n        isRetryable: true\n        // retry when network error\n      });\n    }\n  }\n  if (isBunNetworkError(error)) {\n    return new APICallError({\n      message: `Cannot connect to API: ${error.message}`,\n      cause: error,\n      url,\n      requestBodyValues,\n      isRetryable: true\n    });\n  }\n  return error;\n}\nfunction getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {\n  var _a22, _b22, _c;\n  if (globalThisAny.window) {\n    return `runtime/browser`;\n  }\n  if ((_a22 = globalThisAny.navigator) == null ? void 0 : _a22.userAgent) {\n    return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;\n  }\n  if ((_c = (_b22 = globalThisAny.process) == null ? void 0 : _b22.versions) == null ? void 0 : _c.node) {\n    return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;\n  }\n  if (globalThisAny.EdgeRuntime) {\n    return `runtime/vercel-edge`;\n  }\n  return \"runtime/unknown\";\n}\nfunction normalizeHeaders(headers) {\n  if (headers == null) {\n    return {};\n  }\n  const normalized = {};\n  if (headers instanceof Headers) {\n    headers.forEach((value, key) => {\n      normalized[key.toLowerCase()] = value;\n    });\n  } else {\n    if (!Array.isArray(headers)) {\n      headers = Object.entries(headers);\n    }\n    for (const [key, value] of headers) {\n      if (value != null) {\n        normalized[key.toLowerCase()] = value;\n      }\n    }\n  }\n  return normalized;\n}\nfunction withUserAgentSuffix(headers, ...userAgentSuffixParts) {\n  const normalizedHeaders = new Headers(normalizeHeaders(headers));\n  const currentUserAgentHeader = normalizedHeaders.get(\"user-agent\") || \"\";\n  normalizedHeaders.set(\n    \"user-agent\",\n    [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(\" \")\n  );\n  return Object.fromEntries(normalizedHeaders.entries());\n}\nvar VERSION = true ? \"4.0.23\" : \"0.0.0-test\";\nvar getOriginalFetch = () => globalThis.fetch;\nvar getFromApi = async ({\n  url,\n  headers = {},\n  successfulResponseHandler,\n  failedResponseHandler,\n  abortSignal,\n  fetch: fetch2 = getOriginalFetch()\n}) => {\n  try {\n    const response = await fetch2(url, {\n      method: \"GET\",\n      headers: withUserAgentSuffix(\n        headers,\n        `ai-sdk/provider-utils/${VERSION}`,\n        getRuntimeEnvironmentUserAgent()\n      ),\n      signal: abortSignal\n    });\n    const responseHeaders = extractResponseHeaders(response);\n    if (!response.ok) {\n      let errorInformation;\n      try {\n        errorInformation = await failedResponseHandler({\n          response,\n          url,\n          requestBodyValues: {}\n        });\n      } catch (error) {\n        if (isAbortError(error) || APICallError.isInstance(error)) {\n          throw error;\n        }\n        throw new APICallError({\n          message: \"Failed to process error response\",\n          cause: error,\n          statusCode: response.status,\n          url,\n          responseHeaders,\n          requestBodyValues: {}\n        });\n      }\n      throw errorInformation.value;\n    }\n    try {\n      return await successfulResponseHandler({\n        response,\n        url,\n        requestBodyValues: {}\n      });\n    } catch (error) {\n      if (error instanceof Error) {\n        if (isAbortError(error) || APICallError.isInstance(error)) {\n          throw error;\n        }\n      }\n      throw new APICallError({\n        message: \"Failed to process successful response\",\n        cause: error,\n        statusCode: response.status,\n        url,\n        responseHeaders,\n        requestBodyValues: {}\n      });\n    }\n  } catch (error) {\n    throw handleFetchError({ error, url, requestBodyValues: {} });\n  }\n};\nfunction loadApiKey({\n  apiKey,\n  environmentVariableName,\n  apiKeyParameterName = \"apiKey\",\n  description\n}) {\n  if (typeof apiKey === \"string\") {\n    return apiKey;\n  }\n  if (apiKey != null) {\n    throw new LoadAPIKeyError({\n      message: `${description} API key must be a string.`\n    });\n  }\n  if (typeof process === \"undefined\") {\n    throw new LoadAPIKeyError({\n      message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`\n    });\n  }\n  apiKey = process.env[environmentVariableName];\n  if (apiKey == null) {\n    throw new LoadAPIKeyError({\n      message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`\n    });\n  }\n  if (typeof apiKey !== \"string\") {\n    throw new LoadAPIKeyError({\n      message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`\n    });\n  }\n  return apiKey;\n}\nvar suspectProtoRx = /\"(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])\"\\s*:/;\nvar suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\nfunction _parse(text) {\n  const obj = JSON.parse(text);\n  if (obj === null || typeof obj !== \"object\") {\n    return obj;\n  }\n  if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {\n    return obj;\n  }\n  return filter(obj);\n}\nfunction filter(obj) {\n  let next = [obj];\n  while (next.length) {\n    const nodes = next;\n    next = [];\n    for (const node of nodes) {\n      if (Object.prototype.hasOwnProperty.call(node, \"__proto__\")) {\n        throw new SyntaxError(\"Object contains forbidden prototype property\");\n      }\n      if (Object.prototype.hasOwnProperty.call(node, \"constructor\") && node.constructor !== null && typeof node.constructor === \"object\" && Object.prototype.hasOwnProperty.call(node.constructor, \"prototype\")) {\n        throw new SyntaxError(\"Object contains forbidden prototype property\");\n      }\n      for (const key in node) {\n        const value = node[key];\n        if (value && typeof value === \"object\") {\n          next.push(value);\n        }\n      }\n    }\n  }\n  return obj;\n}\nfunction secureJsonParse(text) {\n  const { stackTraceLimit } = Error;\n  try {\n    Error.stackTraceLimit = 0;\n  } catch (e) {\n    return _parse(text);\n  }\n  try {\n    return _parse(text);\n  } finally {\n    Error.stackTraceLimit = stackTraceLimit;\n  }\n}\nfunction addAdditionalPropertiesToJsonSchema(jsonSchema2) {\n  if (jsonSchema2.type === \"object\" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes(\"object\")) {\n    jsonSchema2.additionalProperties = false;\n    const { properties } = jsonSchema2;\n    if (properties != null) {\n      for (const key of Object.keys(properties)) {\n        properties[key] = visit(properties[key]);\n      }\n    }\n  }\n  if (jsonSchema2.items != null) {\n    jsonSchema2.items = Array.isArray(jsonSchema2.items) ? jsonSchema2.items.map(visit) : visit(jsonSchema2.items);\n  }\n  if (jsonSchema2.anyOf != null) {\n    jsonSchema2.anyOf = jsonSchema2.anyOf.map(visit);\n  }\n  if (jsonSchema2.allOf != null) {\n    jsonSchema2.allOf = jsonSchema2.allOf.map(visit);\n  }\n  if (jsonSchema2.oneOf != null) {\n    jsonSchema2.oneOf = jsonSchema2.oneOf.map(visit);\n  }\n  const { definitions } = jsonSchema2;\n  if (definitions != null) {\n    for (const key of Object.keys(definitions)) {\n      definitions[key] = visit(definitions[key]);\n    }\n  }\n  return jsonSchema2;\n}\nfunction visit(def) {\n  if (typeof def === \"boolean\") return def;\n  return addAdditionalPropertiesToJsonSchema(def);\n}\nvar ignoreOverride = /* @__PURE__ */ Symbol(\n  \"Let zodToJsonSchema decide on which parser to use\"\n);\nvar defaultOptions = {\n  name: void 0,\n  $refStrategy: \"root\",\n  basePath: [\"#\"],\n  effectStrategy: \"input\",\n  pipeStrategy: \"all\",\n  dateStrategy: \"format:date-time\",\n  mapStrategy: \"entries\",\n  removeAdditionalStrategy: \"passthrough\",\n  allowedAdditionalProperties: true,\n  rejectedAdditionalProperties: false,\n  definitionPath: \"definitions\",\n  strictUnions: false,\n  definitions: {},\n  errorMessages: false,\n  patternStrategy: \"escape\",\n  applyRegexFlags: false,\n  emailStrategy: \"format:email\",\n  base64Strategy: \"contentEncoding:base64\",\n  nameStrategy: \"ref\"\n};\nvar getDefaultOptions = (options) => typeof options === \"string\" ? __spreadProps(__spreadValues({}, defaultOptions), {\n  name: options\n}) : __spreadValues(__spreadValues({}, defaultOptions), options);\nfunction parseAnyDef() {\n  return {};\n}\nfunction parseArrayDef(def, refs) {\n  var _a22, _b22, _c;\n  const res = {\n    type: \"array\"\n  };\n  if (((_a22 = def.type) == null ? void 0 : _a22._def) && ((_c = (_b22 = def.type) == null ? void 0 : _b22._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {\n    res.items = parseDef(def.type._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"items\"]\n    }));\n  }\n  if (def.minLength) {\n    res.minItems = def.minLength.value;\n  }\n  if (def.maxLength) {\n    res.maxItems = def.maxLength.value;\n  }\n  if (def.exactLength) {\n    res.minItems = def.exactLength.value;\n    res.maxItems = def.exactLength.value;\n  }\n  return res;\n}\nfunction parseBigintDef(def) {\n  const res = {\n    type: \"integer\",\n    format: \"int64\"\n  };\n  if (!def.checks) return res;\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"min\":\n        if (check.inclusive) {\n          res.minimum = check.value;\n        } else {\n          res.exclusiveMinimum = check.value;\n        }\n        break;\n      case \"max\":\n        if (check.inclusive) {\n          res.maximum = check.value;\n        } else {\n          res.exclusiveMaximum = check.value;\n        }\n        break;\n      case \"multipleOf\":\n        res.multipleOf = check.value;\n        break;\n    }\n  }\n  return res;\n}\nfunction parseBooleanDef() {\n  return { type: \"boolean\" };\n}\nfunction parseBrandedDef(_def, refs) {\n  return parseDef(_def.type._def, refs);\n}\nvar parseCatchDef = (def, refs) => {\n  return parseDef(def.innerType._def, refs);\n};\nfunction parseDateDef(def, refs, overrideDateStrategy) {\n  const strategy = overrideDateStrategy != null ? overrideDateStrategy : refs.dateStrategy;\n  if (Array.isArray(strategy)) {\n    return {\n      anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))\n    };\n  }\n  switch (strategy) {\n    case \"string\":\n    case \"format:date-time\":\n      return {\n        type: \"string\",\n        format: \"date-time\"\n      };\n    case \"format:date\":\n      return {\n        type: \"string\",\n        format: \"date\"\n      };\n    case \"integer\":\n      return integerDateParser(def);\n  }\n}\nvar integerDateParser = (def) => {\n  const res = {\n    type: \"integer\",\n    format: \"unix-time\"\n  };\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"min\":\n        res.minimum = check.value;\n        break;\n      case \"max\":\n        res.maximum = check.value;\n        break;\n    }\n  }\n  return res;\n};\nfunction parseDefaultDef(_def, refs) {\n  return __spreadProps(__spreadValues({}, parseDef(_def.innerType._def, refs)), {\n    default: _def.defaultValue()\n  });\n}\nfunction parseEffectsDef(_def, refs) {\n  return refs.effectStrategy === \"input\" ? parseDef(_def.schema._def, refs) : parseAnyDef();\n}\nfunction parseEnumDef(def) {\n  return {\n    type: \"string\",\n    enum: Array.from(def.values)\n  };\n}\nvar isJsonSchema7AllOfType = (type) => {\n  if (\"type\" in type && type.type === \"string\") return false;\n  return \"allOf\" in type;\n};\nfunction parseIntersectionDef(def, refs) {\n  const allOf = [\n    parseDef(def.left._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"allOf\", \"0\"]\n    })),\n    parseDef(def.right._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"allOf\", \"1\"]\n    }))\n  ].filter((x) => !!x);\n  const mergedAllOf = [];\n  allOf.forEach((schema) => {\n    if (isJsonSchema7AllOfType(schema)) {\n      mergedAllOf.push(...schema.allOf);\n    } else {\n      let nestedSchema = schema;\n      if (\"additionalProperties\" in schema && schema.additionalProperties === false) {\n        const _a16 = schema, { additionalProperties } = _a16, rest = __objRest(_a16, [\"additionalProperties\"]);\n        nestedSchema = rest;\n      }\n      mergedAllOf.push(nestedSchema);\n    }\n  });\n  return mergedAllOf.length ? { allOf: mergedAllOf } : void 0;\n}\nfunction parseLiteralDef(def) {\n  const parsedType = typeof def.value;\n  if (parsedType !== \"bigint\" && parsedType !== \"number\" && parsedType !== \"boolean\" && parsedType !== \"string\") {\n    return {\n      type: Array.isArray(def.value) ? \"array\" : \"object\"\n    };\n  }\n  return {\n    type: parsedType === \"bigint\" ? \"integer\" : parsedType,\n    const: def.value\n  };\n}\nvar emojiRegex = void 0;\nvar zodPatterns = {\n  /**\n   * `c` was changed to `[cC]` to replicate /i flag\n   */\n  cuid: /^[cC][^\\s-]{8,}$/,\n  cuid2: /^[0-9a-z]+$/,\n  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,\n  /**\n   * `a-z` was added to replicate /i flag\n   */\n  email: /^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_'+\\-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$/,\n  /**\n   * Constructed a valid Unicode RegExp\n   *\n   * Lazily instantiate since this type of regex isn't supported\n   * in all envs (e.g. React Native).\n   *\n   * See:\n   * https://github.com/colinhacks/zod/issues/2433\n   * Fix in Zod:\n   * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b\n   */\n  emoji: () => {\n    if (emojiRegex === void 0) {\n      emojiRegex = RegExp(\n        \"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\",\n        \"u\"\n      );\n    }\n    return emojiRegex;\n  },\n  /**\n   * Unused\n   */\n  uuid: /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/,\n  /**\n   * Unused\n   */\n  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,\n  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,\n  /**\n   * Unused\n   */\n  ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,\n  ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,\n  base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,\n  base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,\n  nanoid: /^[a-zA-Z0-9_-]{21}$/,\n  jwt: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/\n};\nfunction parseStringDef(def, refs) {\n  const res = {\n    type: \"string\"\n  };\n  if (def.checks) {\n    for (const check of def.checks) {\n      switch (check.kind) {\n        case \"min\":\n          res.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n          break;\n        case \"max\":\n          res.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n          break;\n        case \"email\":\n          switch (refs.emailStrategy) {\n            case \"format:email\":\n              addFormat(res, \"email\", check.message, refs);\n              break;\n            case \"format:idn-email\":\n              addFormat(res, \"idn-email\", check.message, refs);\n              break;\n            case \"pattern:zod\":\n              addPattern(res, zodPatterns.email, check.message, refs);\n              break;\n          }\n          break;\n        case \"url\":\n          addFormat(res, \"uri\", check.message, refs);\n          break;\n        case \"uuid\":\n          addFormat(res, \"uuid\", check.message, refs);\n          break;\n        case \"regex\":\n          addPattern(res, check.regex, check.message, refs);\n          break;\n        case \"cuid\":\n          addPattern(res, zodPatterns.cuid, check.message, refs);\n          break;\n        case \"cuid2\":\n          addPattern(res, zodPatterns.cuid2, check.message, refs);\n          break;\n        case \"startsWith\":\n          addPattern(\n            res,\n            RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`),\n            check.message,\n            refs\n          );\n          break;\n        case \"endsWith\":\n          addPattern(\n            res,\n            RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`),\n            check.message,\n            refs\n          );\n          break;\n        case \"datetime\":\n          addFormat(res, \"date-time\", check.message, refs);\n          break;\n        case \"date\":\n          addFormat(res, \"date\", check.message, refs);\n          break;\n        case \"time\":\n          addFormat(res, \"time\", check.message, refs);\n          break;\n        case \"duration\":\n          addFormat(res, \"duration\", check.message, refs);\n          break;\n        case \"length\":\n          res.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n          res.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n          break;\n        case \"includes\": {\n          addPattern(\n            res,\n            RegExp(escapeLiteralCheckValue(check.value, refs)),\n            check.message,\n            refs\n          );\n          break;\n        }\n        case \"ip\": {\n          if (check.version !== \"v6\") {\n            addFormat(res, \"ipv4\", check.message, refs);\n          }\n          if (check.version !== \"v4\") {\n            addFormat(res, \"ipv6\", check.message, refs);\n          }\n          break;\n        }\n        case \"base64url\":\n          addPattern(res, zodPatterns.base64url, check.message, refs);\n          break;\n        case \"jwt\":\n          addPattern(res, zodPatterns.jwt, check.message, refs);\n          break;\n        case \"cidr\": {\n          if (check.version !== \"v6\") {\n            addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);\n          }\n          if (check.version !== \"v4\") {\n            addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);\n          }\n          break;\n        }\n        case \"emoji\":\n          addPattern(res, zodPatterns.emoji(), check.message, refs);\n          break;\n        case \"ulid\": {\n          addPattern(res, zodPatterns.ulid, check.message, refs);\n          break;\n        }\n        case \"base64\": {\n          switch (refs.base64Strategy) {\n            case \"format:binary\": {\n              addFormat(res, \"binary\", check.message, refs);\n              break;\n            }\n            case \"contentEncoding:base64\": {\n              res.contentEncoding = \"base64\";\n              break;\n            }\n            case \"pattern:zod\": {\n              addPattern(res, zodPatterns.base64, check.message, refs);\n              break;\n            }\n          }\n          break;\n        }\n        case \"nanoid\": {\n          addPattern(res, zodPatterns.nanoid, check.message, refs);\n        }\n        case \"toLowerCase\":\n        case \"toUpperCase\":\n        case \"trim\":\n          break;\n        default:\n          /* @__PURE__ */ ((_) => {\n          })(check);\n      }\n    }\n  }\n  return res;\n}\nfunction escapeLiteralCheckValue(literal, refs) {\n  return refs.patternStrategy === \"escape\" ? escapeNonAlphaNumeric(literal) : literal;\n}\nvar ALPHA_NUMERIC = new Set(\n  \"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\"\n);\nfunction escapeNonAlphaNumeric(source) {\n  let result = \"\";\n  for (let i = 0; i < source.length; i++) {\n    if (!ALPHA_NUMERIC.has(source[i])) {\n      result += \"\\\\\";\n    }\n    result += source[i];\n  }\n  return result;\n}\nfunction addFormat(schema, value, message, refs) {\n  var _a22;\n  if (schema.format || ((_a22 = schema.anyOf) == null ? void 0 : _a22.some((x) => x.format))) {\n    if (!schema.anyOf) {\n      schema.anyOf = [];\n    }\n    if (schema.format) {\n      schema.anyOf.push({\n        format: schema.format\n      });\n      delete schema.format;\n    }\n    schema.anyOf.push(__spreadValues({\n      format: value\n    }, message && refs.errorMessages && { errorMessage: { format: message } }));\n  } else {\n    schema.format = value;\n  }\n}\nfunction addPattern(schema, regex, message, refs) {\n  var _a22;\n  if (schema.pattern || ((_a22 = schema.allOf) == null ? void 0 : _a22.some((x) => x.pattern))) {\n    if (!schema.allOf) {\n      schema.allOf = [];\n    }\n    if (schema.pattern) {\n      schema.allOf.push({\n        pattern: schema.pattern\n      });\n      delete schema.pattern;\n    }\n    schema.allOf.push(__spreadValues({\n      pattern: stringifyRegExpWithFlags(regex, refs)\n    }, message && refs.errorMessages && { errorMessage: { pattern: message } }));\n  } else {\n    schema.pattern = stringifyRegExpWithFlags(regex, refs);\n  }\n}\nfunction stringifyRegExpWithFlags(regex, refs) {\n  var _a22;\n  if (!refs.applyRegexFlags || !regex.flags) {\n    return regex.source;\n  }\n  const flags = {\n    i: regex.flags.includes(\"i\"),\n    // Case-insensitive\n    m: regex.flags.includes(\"m\"),\n    // `^` and `$` matches adjacent to newline characters\n    s: regex.flags.includes(\"s\")\n    // `.` matches newlines\n  };\n  const source = flags.i ? regex.source.toLowerCase() : regex.source;\n  let pattern = \"\";\n  let isEscaped = false;\n  let inCharGroup = false;\n  let inCharRange = false;\n  for (let i = 0; i < source.length; i++) {\n    if (isEscaped) {\n      pattern += source[i];\n      isEscaped = false;\n      continue;\n    }\n    if (flags.i) {\n      if (inCharGroup) {\n        if (source[i].match(/[a-z]/)) {\n          if (inCharRange) {\n            pattern += source[i];\n            pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();\n            inCharRange = false;\n          } else if (source[i + 1] === \"-\" && ((_a22 = source[i + 2]) == null ? void 0 : _a22.match(/[a-z]/))) {\n            pattern += source[i];\n            inCharRange = true;\n          } else {\n            pattern += `${source[i]}${source[i].toUpperCase()}`;\n          }\n          continue;\n        }\n      } else if (source[i].match(/[a-z]/)) {\n        pattern += `[${source[i]}${source[i].toUpperCase()}]`;\n        continue;\n      }\n    }\n    if (flags.m) {\n      if (source[i] === \"^\") {\n        pattern += `(^|(?<=[\\r\n]))`;\n        continue;\n      } else if (source[i] === \"$\") {\n        pattern += `($|(?=[\\r\n]))`;\n        continue;\n      }\n    }\n    if (flags.s && source[i] === \".\") {\n      pattern += inCharGroup ? `${source[i]}\\r\n` : `[${source[i]}\\r\n]`;\n      continue;\n    }\n    pattern += source[i];\n    if (source[i] === \"\\\\\") {\n      isEscaped = true;\n    } else if (inCharGroup && source[i] === \"]\") {\n      inCharGroup = false;\n    } else if (!inCharGroup && source[i] === \"[\") {\n      inCharGroup = true;\n    }\n  }\n  try {\n    new RegExp(pattern);\n  } catch (e) {\n    console.warn(\n      `Could not convert regex pattern at ${refs.currentPath.join(\n        \"/\"\n      )} to a flag-independent form! Falling back to the flag-ignorant source`\n    );\n    return regex.source;\n  }\n  return pattern;\n}\nfunction parseRecordDef(def, refs) {\n  var _a22, _b22, _c, _d, _e, _f;\n  const schema = {\n    type: \"object\",\n    additionalProperties: (_a22 = parseDef(def.valueType._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"additionalProperties\"]\n    }))) != null ? _a22 : refs.allowedAdditionalProperties\n  };\n  if (((_b22 = def.keyType) == null ? void 0 : _b22._def.typeName) === ZodFirstPartyTypeKind2.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {\n    const _a16 = parseStringDef(def.keyType._def, refs), { type } = _a16, keyType = __objRest(_a16, [\"type\"]);\n    return __spreadProps(__spreadValues({}, schema), {\n      propertyNames: keyType\n    });\n  } else if (((_d = def.keyType) == null ? void 0 : _d._def.typeName) === ZodFirstPartyTypeKind2.ZodEnum) {\n    return __spreadProps(__spreadValues({}, schema), {\n      propertyNames: {\n        enum: def.keyType._def.values\n      }\n    });\n  } else if (((_e = def.keyType) == null ? void 0 : _e._def.typeName) === ZodFirstPartyTypeKind2.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind2.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) {\n    const _b16 = parseBrandedDef(\n      def.keyType._def,\n      refs\n    ), { type } = _b16, keyType = __objRest(_b16, [\"type\"]);\n    return __spreadProps(__spreadValues({}, schema), {\n      propertyNames: keyType\n    });\n  }\n  return schema;\n}\nfunction parseMapDef(def, refs) {\n  if (refs.mapStrategy === \"record\") {\n    return parseRecordDef(def, refs);\n  }\n  const keys = parseDef(def.keyType._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"items\", \"items\", \"0\"]\n  })) || parseAnyDef();\n  const values = parseDef(def.valueType._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"items\", \"items\", \"1\"]\n  })) || parseAnyDef();\n  return {\n    type: \"array\",\n    maxItems: 125,\n    items: {\n      type: \"array\",\n      items: [keys, values],\n      minItems: 2,\n      maxItems: 2\n    }\n  };\n}\nfunction parseNativeEnumDef(def) {\n  const object = def.values;\n  const actualKeys = Object.keys(def.values).filter((key) => {\n    return typeof object[object[key]] !== \"number\";\n  });\n  const actualValues = actualKeys.map((key) => object[key]);\n  const parsedTypes = Array.from(\n    new Set(actualValues.map((values) => typeof values))\n  );\n  return {\n    type: parsedTypes.length === 1 ? parsedTypes[0] === \"string\" ? \"string\" : \"number\" : [\"string\", \"number\"],\n    enum: actualValues\n  };\n}\nfunction parseNeverDef() {\n  return { not: parseAnyDef() };\n}\nfunction parseNullDef() {\n  return {\n    type: \"null\"\n  };\n}\nvar primitiveMappings = {\n  ZodString: \"string\",\n  ZodNumber: \"number\",\n  ZodBigInt: \"integer\",\n  ZodBoolean: \"boolean\",\n  ZodNull: \"null\"\n};\nfunction parseUnionDef(def, refs) {\n  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;\n  if (options.every(\n    (x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length)\n  )) {\n    const types = options.reduce((types2, x) => {\n      const type = primitiveMappings[x._def.typeName];\n      return type && !types2.includes(type) ? [...types2, type] : types2;\n    }, []);\n    return {\n      type: types.length > 1 ? types : types[0]\n    };\n  } else if (options.every((x) => x._def.typeName === \"ZodLiteral\" && !x.description)) {\n    const types = options.reduce(\n      (acc, x) => {\n        const type = typeof x._def.value;\n        switch (type) {\n          case \"string\":\n          case \"number\":\n          case \"boolean\":\n            return [...acc, type];\n          case \"bigint\":\n            return [...acc, \"integer\"];\n          case \"object\":\n            if (x._def.value === null) return [...acc, \"null\"];\n          case \"symbol\":\n          case \"undefined\":\n          case \"function\":\n          default:\n            return acc;\n        }\n      },\n      []\n    );\n    if (types.length === options.length) {\n      const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);\n      return {\n        type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],\n        enum: options.reduce(\n          (acc, x) => {\n            return acc.includes(x._def.value) ? acc : [...acc, x._def.value];\n          },\n          []\n        )\n      };\n    }\n  } else if (options.every((x) => x._def.typeName === \"ZodEnum\")) {\n    return {\n      type: \"string\",\n      enum: options.reduce(\n        (acc, x) => [\n          ...acc,\n          ...x._def.values.filter((x2) => !acc.includes(x2))\n        ],\n        []\n      )\n    };\n  }\n  return asAnyOf(def, refs);\n}\nvar asAnyOf = (def, refs) => {\n  const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map(\n    (x, i) => parseDef(x._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"anyOf\", `${i}`]\n    }))\n  ).filter(\n    (x) => !!x && (!refs.strictUnions || typeof x === \"object\" && Object.keys(x).length > 0)\n  );\n  return anyOf.length ? { anyOf } : void 0;\n};\nfunction parseNullableDef(def, refs) {\n  if ([\"ZodString\", \"ZodNumber\", \"ZodBigInt\", \"ZodBoolean\", \"ZodNull\"].includes(\n    def.innerType._def.typeName\n  ) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) {\n    return {\n      type: [\n        primitiveMappings[def.innerType._def.typeName],\n        \"null\"\n      ]\n    };\n  }\n  const base = parseDef(def.innerType._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"anyOf\", \"0\"]\n  }));\n  return base && { anyOf: [base, { type: \"null\" }] };\n}\nfunction parseNumberDef(def) {\n  const res = {\n    type: \"number\"\n  };\n  if (!def.checks) return res;\n  for (const check of def.checks) {\n    switch (check.kind) {\n      case \"int\":\n        res.type = \"integer\";\n        break;\n      case \"min\":\n        if (check.inclusive) {\n          res.minimum = check.value;\n        } else {\n          res.exclusiveMinimum = check.value;\n        }\n        break;\n      case \"max\":\n        if (check.inclusive) {\n          res.maximum = check.value;\n        } else {\n          res.exclusiveMaximum = check.value;\n        }\n        break;\n      case \"multipleOf\":\n        res.multipleOf = check.value;\n        break;\n    }\n  }\n  return res;\n}\nfunction parseObjectDef(def, refs) {\n  const result = {\n    type: \"object\",\n    properties: {}\n  };\n  const required = [];\n  const shape = def.shape();\n  for (const propName in shape) {\n    let propDef = shape[propName];\n    if (propDef === void 0 || propDef._def === void 0) {\n      continue;\n    }\n    const propOptional = safeIsOptional(propDef);\n    const parsedDef = parseDef(propDef._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"properties\", propName],\n      propertyPath: [...refs.currentPath, \"properties\", propName]\n    }));\n    if (parsedDef === void 0) {\n      continue;\n    }\n    result.properties[propName] = parsedDef;\n    if (!propOptional) {\n      required.push(propName);\n    }\n  }\n  if (required.length) {\n    result.required = required;\n  }\n  const additionalProperties = decideAdditionalProperties(def, refs);\n  if (additionalProperties !== void 0) {\n    result.additionalProperties = additionalProperties;\n  }\n  return result;\n}\nfunction decideAdditionalProperties(def, refs) {\n  if (def.catchall._def.typeName !== \"ZodNever\") {\n    return parseDef(def.catchall._def, __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.currentPath, \"additionalProperties\"]\n    }));\n  }\n  switch (def.unknownKeys) {\n    case \"passthrough\":\n      return refs.allowedAdditionalProperties;\n    case \"strict\":\n      return refs.rejectedAdditionalProperties;\n    case \"strip\":\n      return refs.removeAdditionalStrategy === \"strict\" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;\n  }\n}\nfunction safeIsOptional(schema) {\n  try {\n    return schema.isOptional();\n  } catch (e) {\n    return true;\n  }\n}\nvar parseOptionalDef = (def, refs) => {\n  var _a22;\n  if (refs.currentPath.toString() === ((_a22 = refs.propertyPath) == null ? void 0 : _a22.toString())) {\n    return parseDef(def.innerType._def, refs);\n  }\n  const innerSchema = parseDef(def.innerType._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"anyOf\", \"1\"]\n  }));\n  return innerSchema ? { anyOf: [{ not: parseAnyDef() }, innerSchema] } : parseAnyDef();\n};\nvar parsePipelineDef = (def, refs) => {\n  if (refs.pipeStrategy === \"input\") {\n    return parseDef(def.in._def, refs);\n  } else if (refs.pipeStrategy === \"output\") {\n    return parseDef(def.out._def, refs);\n  }\n  const a = parseDef(def.in._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"allOf\", \"0\"]\n  }));\n  const b = parseDef(def.out._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"allOf\", a ? \"1\" : \"0\"]\n  }));\n  return {\n    allOf: [a, b].filter((x) => x !== void 0)\n  };\n};\nfunction parsePromiseDef(def, refs) {\n  return parseDef(def.type._def, refs);\n}\nfunction parseSetDef(def, refs) {\n  const items = parseDef(def.valueType._def, __spreadProps(__spreadValues({}, refs), {\n    currentPath: [...refs.currentPath, \"items\"]\n  }));\n  const schema = {\n    type: \"array\",\n    uniqueItems: true,\n    items\n  };\n  if (def.minSize) {\n    schema.minItems = def.minSize.value;\n  }\n  if (def.maxSize) {\n    schema.maxItems = def.maxSize.value;\n  }\n  return schema;\n}\nfunction parseTupleDef(def, refs) {\n  if (def.rest) {\n    return {\n      type: \"array\",\n      minItems: def.items.length,\n      items: def.items.map(\n        (x, i) => parseDef(x._def, __spreadProps(__spreadValues({}, refs), {\n          currentPath: [...refs.currentPath, \"items\", `${i}`]\n        }))\n      ).reduce(\n        (acc, x) => x === void 0 ? acc : [...acc, x],\n        []\n      ),\n      additionalItems: parseDef(def.rest._def, __spreadProps(__spreadValues({}, refs), {\n        currentPath: [...refs.currentPath, \"additionalItems\"]\n      }))\n    };\n  } else {\n    return {\n      type: \"array\",\n      minItems: def.items.length,\n      maxItems: def.items.length,\n      items: def.items.map(\n        (x, i) => parseDef(x._def, __spreadProps(__spreadValues({}, refs), {\n          currentPath: [...refs.currentPath, \"items\", `${i}`]\n        }))\n      ).reduce(\n        (acc, x) => x === void 0 ? acc : [...acc, x],\n        []\n      )\n    };\n  }\n}\nfunction parseUndefinedDef() {\n  return {\n    not: parseAnyDef()\n  };\n}\nfunction parseUnknownDef() {\n  return parseAnyDef();\n}\nvar parseReadonlyDef = (def, refs) => {\n  return parseDef(def.innerType._def, refs);\n};\nvar selectParser = (def, typeName, refs) => {\n  switch (typeName) {\n    case ZodFirstPartyTypeKind3.ZodString:\n      return parseStringDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodNumber:\n      return parseNumberDef(def);\n    case ZodFirstPartyTypeKind3.ZodObject:\n      return parseObjectDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodBigInt:\n      return parseBigintDef(def);\n    case ZodFirstPartyTypeKind3.ZodBoolean:\n      return parseBooleanDef();\n    case ZodFirstPartyTypeKind3.ZodDate:\n      return parseDateDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodUndefined:\n      return parseUndefinedDef();\n    case ZodFirstPartyTypeKind3.ZodNull:\n      return parseNullDef();\n    case ZodFirstPartyTypeKind3.ZodArray:\n      return parseArrayDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodUnion:\n    case ZodFirstPartyTypeKind3.ZodDiscriminatedUnion:\n      return parseUnionDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodIntersection:\n      return parseIntersectionDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodTuple:\n      return parseTupleDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodRecord:\n      return parseRecordDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodLiteral:\n      return parseLiteralDef(def);\n    case ZodFirstPartyTypeKind3.ZodEnum:\n      return parseEnumDef(def);\n    case ZodFirstPartyTypeKind3.ZodNativeEnum:\n      return parseNativeEnumDef(def);\n    case ZodFirstPartyTypeKind3.ZodNullable:\n      return parseNullableDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodOptional:\n      return parseOptionalDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodMap:\n      return parseMapDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodSet:\n      return parseSetDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodLazy:\n      return () => def.getter()._def;\n    case ZodFirstPartyTypeKind3.ZodPromise:\n      return parsePromiseDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodNaN:\n    case ZodFirstPartyTypeKind3.ZodNever:\n      return parseNeverDef();\n    case ZodFirstPartyTypeKind3.ZodEffects:\n      return parseEffectsDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodAny:\n      return parseAnyDef();\n    case ZodFirstPartyTypeKind3.ZodUnknown:\n      return parseUnknownDef();\n    case ZodFirstPartyTypeKind3.ZodDefault:\n      return parseDefaultDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodBranded:\n      return parseBrandedDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodReadonly:\n      return parseReadonlyDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodCatch:\n      return parseCatchDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodPipeline:\n      return parsePipelineDef(def, refs);\n    case ZodFirstPartyTypeKind3.ZodFunction:\n    case ZodFirstPartyTypeKind3.ZodVoid:\n    case ZodFirstPartyTypeKind3.ZodSymbol:\n      return void 0;\n    default:\n      return /* @__PURE__ */ ((_) => void 0)(typeName);\n  }\n};\nvar getRelativePath = (pathA, pathB) => {\n  let i = 0;\n  for (; i < pathA.length && i < pathB.length; i++) {\n    if (pathA[i] !== pathB[i]) break;\n  }\n  return [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\nfunction parseDef(def, refs, forceResolution = false) {\n  var _a22;\n  const seenItem = refs.seen.get(def);\n  if (refs.override) {\n    const overrideResult = (_a22 = refs.override) == null ? void 0 : _a22.call(\n      refs,\n      def,\n      refs,\n      seenItem,\n      forceResolution\n    );\n    if (overrideResult !== ignoreOverride) {\n      return overrideResult;\n    }\n  }\n  if (seenItem && !forceResolution) {\n    const seenSchema = get$ref(seenItem, refs);\n    if (seenSchema !== void 0) {\n      return seenSchema;\n    }\n  }\n  const newItem = { def, path: refs.currentPath, jsonSchema: void 0 };\n  refs.seen.set(def, newItem);\n  const jsonSchemaOrGetter = selectParser(def, def.typeName, refs);\n  const jsonSchema2 = typeof jsonSchemaOrGetter === \"function\" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;\n  if (jsonSchema2) {\n    addMeta(def, refs, jsonSchema2);\n  }\n  if (refs.postProcess) {\n    const postProcessResult = refs.postProcess(jsonSchema2, def, refs);\n    newItem.jsonSchema = jsonSchema2;\n    return postProcessResult;\n  }\n  newItem.jsonSchema = jsonSchema2;\n  return jsonSchema2;\n}\nvar get$ref = (item, refs) => {\n  switch (refs.$refStrategy) {\n    case \"root\":\n      return { $ref: item.path.join(\"/\") };\n    case \"relative\":\n      return { $ref: getRelativePath(refs.currentPath, item.path) };\n    case \"none\":\n    case \"seen\": {\n      if (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {\n        console.warn(\n          `Recursive reference detected at ${refs.currentPath.join(\n            \"/\"\n          )}! Defaulting to any`\n        );\n        return parseAnyDef();\n      }\n      return refs.$refStrategy === \"seen\" ? parseAnyDef() : void 0;\n    }\n  }\n};\nvar addMeta = (def, refs, jsonSchema2) => {\n  if (def.description) {\n    jsonSchema2.description = def.description;\n  }\n  return jsonSchema2;\n};\nvar getRefs = (options) => {\n  const _options = getDefaultOptions(options);\n  const currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;\n  return __spreadProps(__spreadValues({}, _options), {\n    currentPath,\n    propertyPath: void 0,\n    seen: new Map(\n      Object.entries(_options.definitions).map(([name22, def]) => [\n        def._def,\n        {\n          def: def._def,\n          path: [..._options.basePath, _options.definitionPath, name22],\n          // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.\n          jsonSchema: void 0\n        }\n      ])\n    )\n  });\n};\nvar zod3ToJsonSchema = (schema, options) => {\n  var _a22;\n  const refs = getRefs(options);\n  let definitions = typeof options === \"object\" && options.definitions ? Object.entries(options.definitions).reduce(\n    (acc, [name32, schema2]) => {\n      var _a32;\n      return __spreadProps(__spreadValues({}, acc), {\n        [name32]: (_a32 = parseDef(\n          schema2._def,\n          __spreadProps(__spreadValues({}, refs), {\n            currentPath: [...refs.basePath, refs.definitionPath, name32]\n          }),\n          true\n        )) != null ? _a32 : parseAnyDef()\n      });\n    },\n    {}\n  ) : void 0;\n  const name22 = typeof options === \"string\" ? options : (options == null ? void 0 : options.nameStrategy) === \"title\" ? void 0 : options == null ? void 0 : options.name;\n  const main = (_a22 = parseDef(\n    schema._def,\n    name22 === void 0 ? refs : __spreadProps(__spreadValues({}, refs), {\n      currentPath: [...refs.basePath, refs.definitionPath, name22]\n    }),\n    false\n  )) != null ? _a22 : parseAnyDef();\n  const title = typeof options === \"object\" && options.name !== void 0 && options.nameStrategy === \"title\" ? options.name : void 0;\n  if (title !== void 0) {\n    main.title = title;\n  }\n  const combined = name22 === void 0 ? definitions ? __spreadProps(__spreadValues({}, main), {\n    [refs.definitionPath]: definitions\n  }) : main : {\n    $ref: [\n      ...refs.$refStrategy === \"relative\" ? [] : refs.basePath,\n      refs.definitionPath,\n      name22\n    ].join(\"/\"),\n    [refs.definitionPath]: __spreadProps(__spreadValues({}, definitions), {\n      [name22]: main\n    })\n  };\n  combined.$schema = \"http://json-schema.org/draft-07/schema#\";\n  return combined;\n};\nvar schemaSymbol = /* @__PURE__ */ Symbol.for(\"vercel.ai.schema\");\nfunction jsonSchema(jsonSchema2, {\n  validate\n} = {}) {\n  return {\n    [schemaSymbol]: true,\n    _type: void 0,\n    // should never be used directly\n    get jsonSchema() {\n      if (typeof jsonSchema2 === \"function\") {\n        jsonSchema2 = jsonSchema2();\n      }\n      return jsonSchema2;\n    },\n    validate\n  };\n}\nfunction isSchema(value) {\n  return typeof value === \"object\" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && \"jsonSchema\" in value && \"validate\" in value;\n}\nfunction asSchema(schema) {\n  return schema == null ? jsonSchema({ properties: {}, additionalProperties: false }) : isSchema(schema) ? schema : \"~standard\" in schema ? schema[\"~standard\"].vendor === \"zod\" ? zodSchema(schema) : standardSchema(schema) : schema();\n}\nfunction standardSchema(standardSchema2) {\n  return jsonSchema(\n    () => addAdditionalPropertiesToJsonSchema(\n      standardSchema2[\"~standard\"].jsonSchema.input({\n        target: \"draft-07\"\n      })\n    ),\n    {\n      validate: async (value) => {\n        const result = await standardSchema2[\"~standard\"].validate(value);\n        return \"value\" in result ? { success: true, value: result.value } : {\n          success: false,\n          error: new TypeValidationError({\n            value,\n            cause: result.issues\n          })\n        };\n      }\n    }\n  );\n}\nfunction zod3Schema(zodSchema2, options) {\n  var _a22;\n  const useReferences = (_a22 = options == null ? void 0 : options.useReferences) != null ? _a22 : false;\n  return jsonSchema(\n    // defer json schema creation to avoid unnecessary computation when only validation is needed\n    () => zod3ToJsonSchema(zodSchema2, {\n      $refStrategy: useReferences ? \"root\" : \"none\"\n    }),\n    {\n      validate: async (value) => {\n        const result = await zodSchema2.safeParseAsync(value);\n        return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n      }\n    }\n  );\n}\nfunction zod4Schema(zodSchema2, options) {\n  var _a22;\n  const useReferences = (_a22 = options == null ? void 0 : options.useReferences) != null ? _a22 : false;\n  return jsonSchema(\n    // defer json schema creation to avoid unnecessary computation when only validation is needed\n    () => addAdditionalPropertiesToJsonSchema(\n      z4.toJSONSchema(zodSchema2, {\n        target: \"draft-7\",\n        io: \"input\",\n        reused: useReferences ? \"ref\" : \"inline\"\n      })\n    ),\n    {\n      validate: async (value) => {\n        const result = await z4.safeParseAsync(zodSchema2, value);\n        return result.success ? { success: true, value: result.data } : { success: false, error: result.error };\n      }\n    }\n  );\n}\nfunction isZod4Schema(zodSchema2) {\n  return \"_zod\" in zodSchema2;\n}\nfunction zodSchema(zodSchema2, options) {\n  if (isZod4Schema(zodSchema2)) {\n    return zod4Schema(zodSchema2, options);\n  } else {\n    return zod3Schema(zodSchema2, options);\n  }\n}\nasync function validateTypes({\n  value,\n  schema,\n  context\n}) {\n  const result = await safeValidateTypes({ value, schema, context });\n  if (!result.success) {\n    throw TypeValidationError.wrap({ value, cause: result.error, context });\n  }\n  return result.value;\n}\nasync function safeValidateTypes({\n  value,\n  schema,\n  context\n}) {\n  const actualSchema = asSchema(schema);\n  try {\n    if (actualSchema.validate == null) {\n      return { success: true, value, rawValue: value };\n    }\n    const result = await actualSchema.validate(value);\n    if (result.success) {\n      return { success: true, value: result.value, rawValue: value };\n    }\n    return {\n      success: false,\n      error: TypeValidationError.wrap({ value, cause: result.error, context }),\n      rawValue: value\n    };\n  } catch (error) {\n    return {\n      success: false,\n      error: TypeValidationError.wrap({ value, cause: error, context }),\n      rawValue: value\n    };\n  }\n}\nasync function parseJSON({\n  text,\n  schema\n}) {\n  try {\n    const value = secureJsonParse(text);\n    if (schema == null) {\n      return value;\n    }\n    return validateTypes({ value, schema });\n  } catch (error) {\n    if (JSONParseError.isInstance(error) || TypeValidationError.isInstance(error)) {\n      throw error;\n    }\n    throw new JSONParseError({ text, cause: error });\n  }\n}\nasync function safeParseJSON({\n  text,\n  schema\n}) {\n  try {\n    const value = secureJsonParse(text);\n    if (schema == null) {\n      return { success: true, value, rawValue: value };\n    }\n    return await safeValidateTypes({ value, schema });\n  } catch (error) {\n    return {\n      success: false,\n      error: JSONParseError.isInstance(error) ? error : new JSONParseError({ text, cause: error }),\n      rawValue: void 0\n    };\n  }\n}\nfunction isParsableJson(input) {\n  try {\n    secureJsonParse(input);\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\nfunction parseJsonEventStream({\n  stream,\n  schema\n}) {\n  return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).pipeThrough(\n    new TransformStream({\n      async transform({ data }, controller) {\n        if (data === \"[DONE]\") {\n          return;\n        }\n        controller.enqueue(await safeParseJSON({ text: data, schema }));\n      }\n    })\n  );\n}\nvar getOriginalFetch2 = () => globalThis.fetch;\nvar postJsonToApi = async ({\n  url,\n  headers,\n  body,\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch: fetch2\n}) => postToApi({\n  url,\n  headers: __spreadValues({\n    \"Content-Type\": \"application/json\"\n  }, headers),\n  body: {\n    content: JSON.stringify(body),\n    values: body\n  },\n  failedResponseHandler,\n  successfulResponseHandler,\n  abortSignal,\n  fetch: fetch2\n});\nvar postToApi = async ({\n  url,\n  headers = {},\n  body,\n  successfulResponseHandler,\n  failedResponseHandler,\n  abortSignal,\n  fetch: fetch2 = getOriginalFetch2()\n}) => {\n  try {\n    const response = await fetch2(url, {\n      method: \"POST\",\n      headers: withUserAgentSuffix(\n        headers,\n        `ai-sdk/provider-utils/${VERSION}`,\n        getRuntimeEnvironmentUserAgent()\n      ),\n      body: body.content,\n      signal: abortSignal\n    });\n    const responseHeaders = extractResponseHeaders(response);\n    if (!response.ok) {\n      let errorInformation;\n      try {\n        errorInformation = await failedResponseHandler({\n          response,\n          url,\n          requestBodyValues: body.values\n        });\n      } catch (error) {\n        if (isAbortError(error) || APICallError.isInstance(error)) {\n          throw error;\n        }\n        throw new APICallError({\n          message: \"Failed to process error response\",\n          cause: error,\n          statusCode: response.status,\n          url,\n          responseHeaders,\n          requestBodyValues: body.values\n        });\n      }\n      throw errorInformation.value;\n    }\n    try {\n      return await successfulResponseHandler({\n        response,\n        url,\n        requestBodyValues: body.values\n      });\n    } catch (error) {\n      if (error instanceof Error) {\n        if (isAbortError(error) || APICallError.isInstance(error)) {\n          throw error;\n        }\n      }\n      throw new APICallError({\n        message: \"Failed to process successful response\",\n        cause: error,\n        statusCode: response.status,\n        url,\n        responseHeaders,\n        requestBodyValues: body.values\n      });\n    }\n  } catch (error) {\n    throw handleFetchError({ error, url, requestBodyValues: body.values });\n  }\n};\nfunction tool(tool2) {\n  return tool2;\n}\nfunction createProviderToolFactory({\n  id,\n  inputSchema\n}) {\n  return (_a16) => {\n    var _b16 = _a16, {\n      execute,\n      outputSchema,\n      needsApproval,\n      toModelOutput,\n      onInputStart,\n      onInputDelta,\n      onInputAvailable\n    } = _b16, args = __objRest(_b16, [\n      \"execute\",\n      \"outputSchema\",\n      \"needsApproval\",\n      \"toModelOutput\",\n      \"onInputStart\",\n      \"onInputDelta\",\n      \"onInputAvailable\"\n    ]);\n    return tool({\n      type: \"provider\",\n      id,\n      args,\n      inputSchema,\n      outputSchema,\n      execute,\n      needsApproval,\n      toModelOutput,\n      onInputStart,\n      onInputDelta,\n      onInputAvailable\n    });\n  };\n}\nvar createJsonErrorResponseHandler = ({\n  errorSchema,\n  errorToMessage,\n  isRetryable\n}) => async ({ response, url, requestBodyValues }) => {\n  const responseBody = await response.text();\n  const responseHeaders = extractResponseHeaders(response);\n  if (responseBody.trim() === \"\") {\n    return {\n      responseHeaders,\n      value: new APICallError({\n        message: response.statusText,\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n      })\n    };\n  }\n  try {\n    const parsedError = await parseJSON({\n      text: responseBody,\n      schema: errorSchema\n    });\n    return {\n      responseHeaders,\n      value: new APICallError({\n        message: errorToMessage(parsedError),\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        data: parsedError,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response, parsedError)\n      })\n    };\n  } catch (parseError) {\n    return {\n      responseHeaders,\n      value: new APICallError({\n        message: response.statusText,\n        url,\n        requestBodyValues,\n        statusCode: response.status,\n        responseHeaders,\n        responseBody,\n        isRetryable: isRetryable == null ? void 0 : isRetryable(response)\n      })\n    };\n  }\n};\nvar createEventSourceResponseHandler = (chunkSchema) => async ({ response }) => {\n  const responseHeaders = extractResponseHeaders(response);\n  if (response.body == null) {\n    throw new EmptyResponseBodyError({});\n  }\n  return {\n    responseHeaders,\n    value: parseJsonEventStream({\n      stream: response.body,\n      schema: chunkSchema\n    })\n  };\n};\nvar createJsonResponseHandler = (responseSchema) => async ({ response, url, requestBodyValues }) => {\n  const responseBody = await response.text();\n  const parsedResult = await safeParseJSON({\n    text: responseBody,\n    schema: responseSchema\n  });\n  const responseHeaders = extractResponseHeaders(response);\n  if (!parsedResult.success) {\n    throw new APICallError({\n      message: \"Invalid JSON response\",\n      cause: parsedResult.error,\n      statusCode: response.status,\n      responseHeaders,\n      responseBody,\n      url,\n      requestBodyValues\n    });\n  }\n  return {\n    responseHeaders,\n    value: parsedResult.value,\n    rawValue: parsedResult.rawValue\n  };\n};\nfunction withoutTrailingSlash(url) {\n  return url == null ? void 0 : url.replace(/\\/$/, \"\");\n}\n\n// src/schemas/reasoning-details.ts\nimport { z } from \"zod/v4\";\n\n// src/utils/type-guards.ts\nfunction isDefinedOrNotNull(value) {\n  return value !== null && value !== void 0;\n}\n\n// src/schemas/format.ts\nvar ReasoningFormat = /* @__PURE__ */ ((ReasoningFormat2) => {\n  ReasoningFormat2[\"Unknown\"] = \"unknown\";\n  ReasoningFormat2[\"OpenAIResponsesV1\"] = \"openai-responses-v1\";\n  ReasoningFormat2[\"AzureOpenAIResponsesV1\"] = \"azure-openai-responses-v1\";\n  ReasoningFormat2[\"XAIResponsesV1\"] = \"xai-responses-v1\";\n  ReasoningFormat2[\"AnthropicClaudeV1\"] = \"anthropic-claude-v1\";\n  ReasoningFormat2[\"GoogleGeminiV1\"] = \"google-gemini-v1\";\n  return ReasoningFormat2;\n})(ReasoningFormat || {});\nvar DEFAULT_REASONING_FORMAT = \"anthropic-claude-v1\" /* AnthropicClaudeV1 */;\n\n// src/schemas/reasoning-details.ts\nvar CommonReasoningDetailSchema = z.object({\n  id: z.string().nullish(),\n  format: z.enum(ReasoningFormat).nullish(),\n  index: z.number().optional()\n}).loose();\nvar ReasoningDetailSummarySchema = z.object({\n  type: z.literal(\"reasoning.summary\" /* Summary */),\n  summary: z.string()\n}).extend(CommonReasoningDetailSchema.shape);\nvar ReasoningDetailEncryptedSchema = z.object({\n  type: z.literal(\"reasoning.encrypted\" /* Encrypted */),\n  data: z.string()\n}).extend(CommonReasoningDetailSchema.shape);\nvar ReasoningDetailTextSchema = z.object({\n  type: z.literal(\"reasoning.text\" /* Text */),\n  text: z.string().nullish(),\n  signature: z.string().nullish()\n}).extend(CommonReasoningDetailSchema.shape);\nvar ReasoningDetailUnionSchema = z.union([\n  ReasoningDetailSummarySchema,\n  ReasoningDetailEncryptedSchema,\n  ReasoningDetailTextSchema\n]);\nvar ReasoningDetailsWithUnknownSchema = z.union([\n  ReasoningDetailUnionSchema,\n  z.unknown().transform(() => null)\n]);\nvar ReasoningDetailArraySchema = z.array(ReasoningDetailsWithUnknownSchema).transform((d) => d.filter((d2) => !!d2));\nvar OutputUnionToReasoningDetailsSchema = z.union([\n  z.object({\n    delta: z.object({\n      reasoning_details: z.array(ReasoningDetailsWithUnknownSchema)\n    })\n  }).transform(\n    (data) => data.delta.reasoning_details.filter(isDefinedOrNotNull)\n  ),\n  z.object({\n    message: z.object({\n      reasoning_details: z.array(ReasoningDetailsWithUnknownSchema)\n    })\n  }).transform(\n    (data) => data.message.reasoning_details.filter(isDefinedOrNotNull)\n  ),\n  z.object({\n    text: z.string(),\n    reasoning_details: z.array(ReasoningDetailsWithUnknownSchema)\n  }).transform((data) => data.reasoning_details.filter(isDefinedOrNotNull))\n]);\n\n// src/schemas/error-response.ts\nimport { z as z2 } from \"zod/v4\";\nvar OpenRouterErrorResponseSchema = z2.object({\n  error: z2.object({\n    code: z2.union([z2.string(), z2.number()]).nullable().optional().default(null),\n    message: z2.string(),\n    type: z2.string().nullable().optional().default(null),\n    param: z2.any().nullable().optional().default(null)\n  }).passthrough()\n}).passthrough();\nfunction extractErrorMessage(data) {\n  const error = data.error;\n  const metadata = error.metadata;\n  if (!metadata) {\n    return data.error.message;\n  }\n  const parts = [];\n  if (typeof metadata.provider_name === \"string\" && metadata.provider_name) {\n    parts.push(`[${metadata.provider_name}]`);\n  }\n  const raw = metadata.raw;\n  const rawMessage = extractRawMessage(raw);\n  if (rawMessage && rawMessage !== data.error.message) {\n    parts.push(rawMessage);\n  } else {\n    parts.push(data.error.message);\n  }\n  return parts.join(\" \");\n}\nfunction extractRawMessage(raw) {\n  if (typeof raw === \"string\") {\n    try {\n      const parsed = JSON.parse(raw);\n      if (typeof parsed === \"object\" && parsed !== null) {\n        return extractRawMessage(parsed);\n      }\n      return raw;\n    } catch (e) {\n      return raw;\n    }\n  }\n  if (typeof raw !== \"object\" || raw === null) {\n    return void 0;\n  }\n  const obj = raw;\n  for (const field of [\"message\", \"error\", \"detail\", \"details\", \"msg\"]) {\n    const value = obj[field];\n    if (typeof value === \"string\" && value.length > 0) {\n      return value;\n    }\n    if (typeof value === \"object\" && value !== null) {\n      const nested = extractRawMessage(value);\n      if (nested) {\n        return nested;\n      }\n    }\n  }\n  return void 0;\n}\nvar openrouterFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: OpenRouterErrorResponseSchema,\n  errorToMessage: extractErrorMessage\n});\n\n// src/schemas/provider-metadata.ts\nimport { z as z3 } from \"zod/v4\";\nvar FileAnnotationSchema = z3.object({\n  type: z3.literal(\"file\"),\n  file: z3.object({\n    hash: z3.string(),\n    name: z3.string(),\n    content: z3.array(\n      z3.object({\n        type: z3.string(),\n        text: z3.string().optional()\n      }).catchall(z3.any())\n    ).optional()\n  }).catchall(z3.any())\n}).catchall(z3.any());\nvar OpenRouterProviderMetadataSchema = z3.object({\n  provider: z3.string(),\n  reasoning_details: z3.array(ReasoningDetailUnionSchema).optional(),\n  annotations: z3.array(FileAnnotationSchema).optional(),\n  usage: z3.object({\n    promptTokens: z3.number(),\n    promptTokensDetails: z3.object({\n      cachedTokens: z3.number()\n    }).catchall(z3.any()).optional(),\n    completionTokens: z3.number(),\n    completionTokensDetails: z3.object({\n      reasoningTokens: z3.number()\n    }).catchall(z3.any()).optional(),\n    totalTokens: z3.number(),\n    cost: z3.number().optional(),\n    costDetails: z3.object({\n      upstreamInferenceCost: z3.number()\n    }).catchall(z3.any()).optional()\n  }).catchall(z3.any())\n}).catchall(z3.any());\nvar OpenRouterProviderOptionsSchema = z3.object({\n  openrouter: z3.object({\n    // Use ReasoningDetailArraySchema (with unknown fallback) instead of\n    // z.array(ReasoningDetailUnionSchema) so that a single malformed entry\n    // (e.g., a future format not yet in the enum) is individually dropped\n    // rather than causing the entire array to fail parsing.\n    reasoning_details: ReasoningDetailArraySchema.optional(),\n    annotations: z3.array(FileAnnotationSchema).optional()\n  }).optional()\n}).optional();\n\n// src/utils/compute-token-usage.ts\nfunction computeTokenUsage(usage) {\n  var _a16, _b16, _c, _d, _e, _f, _g, _h;\n  const promptTokens = (_a16 = usage.prompt_tokens) != null ? _a16 : 0;\n  const completionTokens = (_b16 = usage.completion_tokens) != null ? _b16 : 0;\n  const cacheReadTokens = (_d = (_c = usage.prompt_tokens_details) == null ? void 0 : _c.cached_tokens) != null ? _d : 0;\n  const cacheWriteTokens = (_f = (_e = usage.prompt_tokens_details) == null ? void 0 : _e.cache_write_tokens) != null ? _f : void 0;\n  const reasoningTokens = (_h = (_g = usage.completion_tokens_details) == null ? void 0 : _g.reasoning_tokens) != null ? _h : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens - cacheReadTokens,\n      cacheRead: cacheReadTokens,\n      cacheWrite: cacheWriteTokens\n    },\n    outputTokens: {\n      total: completionTokens,\n      text: completionTokens - reasoningTokens,\n      reasoning: reasoningTokens\n    },\n    raw: usage\n  };\n}\nfunction emptyUsage() {\n  return {\n    inputTokens: {\n      total: 0,\n      noCache: void 0,\n      cacheRead: void 0,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: 0,\n      text: void 0,\n      reasoning: void 0\n    },\n    raw: void 0\n  };\n}\n\n// src/utils/map-finish-reason.ts\nfunction mapToUnified(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n    case \"function_call\":\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\nfunction mapOpenRouterFinishReason(finishReason) {\n  return {\n    unified: mapToUnified(finishReason),\n    raw: finishReason != null ? finishReason : void 0\n  };\n}\nfunction createFinishReason(unified, raw) {\n  return { unified, raw };\n}\n\n// src/utils/with-stream-error-handling.ts\nfunction withStreamErrorHandling(source, onError) {\n  const reader = source.getReader();\n  return new ReadableStream({\n    async pull(controller) {\n      try {\n        const { done, value } = await reader.read();\n        if (done) {\n          controller.close();\n        } else {\n          controller.enqueue(value);\n        }\n      } catch (err) {\n        onError(err);\n        reader.cancel().catch(() => {\n        });\n        controller.close();\n      }\n    },\n    cancel(reason) {\n      reader.cancel(reason);\n    }\n  });\n}\n\n// src/utils/deterministic-stringify.ts\nfunction deterministicStringify(value) {\n  return JSON.stringify(sortKeys(value));\n}\nfunction sortKeys(value) {\n  if (value === null || value === void 0) {\n    return value;\n  }\n  if (Array.isArray(value)) {\n    return value.map(sortKeys);\n  }\n  if (typeof value === \"object\") {\n    const sorted = {};\n    const entries = Object.entries(value);\n    entries.sort(([a], [b]) => a.localeCompare(b));\n    for (const [key, val] of entries) {\n      sorted[key] = sortKeys(val);\n    }\n    return sorted;\n  }\n  return value;\n}\n\n// src/utils/reasoning-details-duplicate-tracker.ts\nvar _seenKeys;\nvar ReasoningDetailsDuplicateTracker = class {\n  constructor() {\n    __privateAdd(this, _seenKeys, /* @__PURE__ */ new Set());\n  }\n  /**\n   * Attempts to track a detail.\n   * Returns true if this is a NEW detail (not seen before and has valid key),\n   * false if it was skipped (no valid key) or already seen (duplicate).\n   */\n  upsert(detail) {\n    const key = this.getCanonicalKey(detail);\n    if (key === null) {\n      return false;\n    }\n    if (__privateGet(this, _seenKeys).has(key)) {\n      return false;\n    }\n    __privateGet(this, _seenKeys).add(key);\n    return true;\n  }\n  getCanonicalKey(detail) {\n    switch (detail.type) {\n      case \"reasoning.summary\" /* Summary */:\n        return detail.summary;\n      case \"reasoning.encrypted\" /* Encrypted */:\n        if (detail.id) {\n          return detail.id;\n        }\n        return detail.data;\n      case \"reasoning.text\" /* Text */: {\n        if (detail.text) {\n          return detail.text;\n        }\n        if (detail.signature) {\n          return detail.signature;\n        }\n        return null;\n      }\n      default: {\n        return null;\n      }\n    }\n  }\n};\n_seenKeys = new WeakMap();\n\n// src/types/openrouter-chat-completions-input.ts\nvar OPENROUTER_AUDIO_FORMATS = [\n  \"wav\",\n  \"mp3\",\n  \"aiff\",\n  \"aac\",\n  \"ogg\",\n  \"flac\",\n  \"m4a\",\n  \"pcm16\",\n  \"pcm24\"\n];\n\n// src/chat/is-url.ts\nfunction isUrl({\n  url,\n  protocols\n}) {\n  try {\n    const urlObj = new URL(url);\n    return protocols.has(urlObj.protocol);\n  } catch (_) {\n    return false;\n  }\n}\n\n// src/chat/file-url-utils.ts\nfunction buildFileDataUrl({\n  data,\n  mediaType,\n  defaultMediaType\n}) {\n  if (data instanceof Uint8Array) {\n    const base64 = convertUint8ArrayToBase64(data);\n    return `data:${mediaType != null ? mediaType : defaultMediaType};base64,${base64}`;\n  }\n  const stringData = data.toString();\n  if (isUrl({\n    url: stringData,\n    protocols: /* @__PURE__ */ new Set([\"http:\", \"https:\"])\n  })) {\n    return stringData;\n  }\n  return stringData.startsWith(\"data:\") ? stringData : `data:${mediaType != null ? mediaType : defaultMediaType};base64,${stringData}`;\n}\nfunction getFileUrl({\n  part,\n  defaultMediaType\n}) {\n  const data = part.data instanceof URL ? part.data.toString() : part.data;\n  return buildFileDataUrl({\n    data,\n    mediaType: part.mediaType,\n    defaultMediaType\n  });\n}\nfunction getMediaType(dataUrl, defaultMediaType) {\n  var _a16;\n  const match = dataUrl.match(/^data:([^;]+)/);\n  return match ? (_a16 = match[1]) != null ? _a16 : defaultMediaType : defaultMediaType;\n}\nfunction getBase64FromDataUrl(dataUrl) {\n  const match = dataUrl.match(/^data:[^;]*;base64,(.+)$/);\n  return match ? match[1] : dataUrl;\n}\nvar MIME_TO_FORMAT = {\n  // MP3 variants\n  mpeg: \"mp3\",\n  mp3: \"mp3\",\n  // WAV variants\n  \"x-wav\": \"wav\",\n  wave: \"wav\",\n  wav: \"wav\",\n  // OGG variants\n  ogg: \"ogg\",\n  vorbis: \"ogg\",\n  // AAC variants\n  aac: \"aac\",\n  \"x-aac\": \"aac\",\n  // M4A variants\n  m4a: \"m4a\",\n  \"x-m4a\": \"m4a\",\n  mp4: \"m4a\",\n  // AIFF variants\n  aiff: \"aiff\",\n  \"x-aiff\": \"aiff\",\n  // FLAC\n  flac: \"flac\",\n  \"x-flac\": \"flac\",\n  // PCM variants\n  pcm16: \"pcm16\",\n  pcm24: \"pcm24\"\n};\nfunction getInputAudioData(part) {\n  const fileData = getFileUrl({\n    part,\n    defaultMediaType: \"audio/mpeg\"\n  });\n  if (isUrl({\n    url: fileData,\n    protocols: /* @__PURE__ */ new Set([\"http:\", \"https:\"])\n  })) {\n    throw new Error(\n      `Audio files cannot be provided as URLs.\n\nOpenRouter requires audio to be base64-encoded. Please:\n1. Download the audio file locally\n2. Read it as a Buffer or Uint8Array\n3. Pass it as the data parameter\n\nThe AI SDK will automatically handle base64 encoding.\n\nLearn more: https://openrouter.ai/docs/features/multimodal/audio`\n    );\n  }\n  const data = getBase64FromDataUrl(fileData);\n  const mediaType = part.mediaType || \"audio/mpeg\";\n  const rawFormat = mediaType.replace(\"audio/\", \"\");\n  const format = MIME_TO_FORMAT[rawFormat];\n  if (format === void 0) {\n    const supportedList = OPENROUTER_AUDIO_FORMATS.join(\", \");\n    throw new Error(\n      `Unsupported audio format: \"${mediaType}\"\n\nOpenRouter supports the following audio formats: ${supportedList}\n\nLearn more: https://openrouter.ai/docs/features/multimodal/audio`\n    );\n  }\n  return { data, format };\n}\n\n// src/chat/convert-to-openrouter-chat-messages.ts\nfunction getCacheControl(providerMetadata) {\n  var _a16, _b16, _c;\n  const anthropic = providerMetadata == null ? void 0 : providerMetadata.anthropic;\n  const openrouter2 = providerMetadata == null ? void 0 : providerMetadata.openrouter;\n  return (_c = (_b16 = (_a16 = openrouter2 == null ? void 0 : openrouter2.cacheControl) != null ? _a16 : openrouter2 == null ? void 0 : openrouter2.cache_control) != null ? _b16 : anthropic == null ? void 0 : anthropic.cacheControl) != null ? _c : anthropic == null ? void 0 : anthropic.cache_control;\n}\nfunction convertToOpenRouterChatMessages(prompt) {\n  var _a16, _b16, _c, _d, _e, _f, _g, _h;\n  const messages = [];\n  const reasoningDetailsTracker = new ReasoningDetailsDuplicateTracker();\n  for (const { role, content, providerOptions } of prompt) {\n    switch (role) {\n      case \"system\": {\n        const cacheControl = getCacheControl(providerOptions);\n        messages.push({\n          role: \"system\",\n          content: [\n            __spreadValues({\n              type: \"text\",\n              text: content\n            }, cacheControl && { cache_control: cacheControl })\n          ]\n        });\n        break;\n      }\n      case \"user\": {\n        if (content.length === 1 && ((_a16 = content[0]) == null ? void 0 : _a16.type) === \"text\") {\n          const cacheControl = (_b16 = getCacheControl(providerOptions)) != null ? _b16 : getCacheControl(content[0].providerOptions);\n          const contentWithCacheControl = cacheControl ? [\n            {\n              type: \"text\",\n              text: content[0].text,\n              cache_control: cacheControl\n            }\n          ] : content[0].text;\n          messages.push({\n            role: \"user\",\n            content: contentWithCacheControl\n          });\n          break;\n        }\n        const messageCacheControl = getCacheControl(providerOptions);\n        let lastTextPartIndex = -1;\n        for (let i = content.length - 1; i >= 0; i--) {\n          if (((_c = content[i]) == null ? void 0 : _c.type) === \"text\") {\n            lastTextPartIndex = i;\n            break;\n          }\n        }\n        const contentParts = content.map(\n          (part, index) => {\n            var _a17, _b17, _c2, _d2, _e2, _f2, _g2;\n            const isLastTextPart = part.type === \"text\" && index === lastTextPartIndex;\n            const partCacheControl = getCacheControl(part.providerOptions);\n            const cacheControl = part.type === \"text\" ? partCacheControl != null ? partCacheControl : isLastTextPart ? messageCacheControl : void 0 : partCacheControl;\n            switch (part.type) {\n              case \"text\":\n                return __spreadValues({\n                  type: \"text\",\n                  text: part.text\n                }, cacheControl && { cache_control: cacheControl });\n              case \"file\": {\n                if ((_a17 = part.mediaType) == null ? void 0 : _a17.startsWith(\"image/\")) {\n                  const url = getFileUrl({\n                    part,\n                    defaultMediaType: \"image/jpeg\"\n                  });\n                  return __spreadValues({\n                    type: \"image_url\",\n                    image_url: {\n                      url\n                    }\n                  }, cacheControl && { cache_control: cacheControl });\n                }\n                if ((_b17 = part.mediaType) == null ? void 0 : _b17.startsWith(\"video/\")) {\n                  const url = getFileUrl({\n                    part,\n                    defaultMediaType: \"video/mp4\"\n                  });\n                  return __spreadValues({\n                    type: \"video_url\",\n                    video_url: {\n                      url\n                    }\n                  }, cacheControl && { cache_control: cacheControl });\n                }\n                if ((_c2 = part.mediaType) == null ? void 0 : _c2.startsWith(\"audio/\")) {\n                  return __spreadValues({\n                    type: \"input_audio\",\n                    input_audio: getInputAudioData(part)\n                  }, cacheControl && { cache_control: cacheControl });\n                }\n                const fileName = String(\n                  (_g2 = (_f2 = (_e2 = (_d2 = part.providerOptions) == null ? void 0 : _d2.openrouter) == null ? void 0 : _e2.filename) != null ? _f2 : part.filename) != null ? _g2 : \"\"\n                );\n                const fileData = getFileUrl({\n                  part,\n                  defaultMediaType: \"application/pdf\"\n                });\n                if (isUrl({\n                  url: fileData,\n                  protocols: /* @__PURE__ */ new Set([\"http:\", \"https:\"])\n                })) {\n                  return {\n                    type: \"file\",\n                    file: {\n                      filename: fileName,\n                      file_data: fileData\n                    }\n                  };\n                }\n                return __spreadValues({\n                  type: \"file\",\n                  file: {\n                    filename: fileName,\n                    file_data: fileData\n                  }\n                }, cacheControl && { cache_control: cacheControl });\n              }\n              default: {\n                return __spreadValues({\n                  type: \"text\",\n                  text: \"\"\n                }, cacheControl && { cache_control: cacheControl });\n              }\n            }\n          }\n        );\n        messages.push({\n          role: \"user\",\n          content: contentParts\n        });\n        break;\n      }\n      case \"assistant\": {\n        let text = \"\";\n        let reasoning = \"\";\n        const toolCalls = [];\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\": {\n              text += part.text;\n              break;\n            }\n            case \"tool-call\": {\n              toolCalls.push({\n                id: part.toolCallId,\n                type: \"function\",\n                function: {\n                  name: part.toolName,\n                  arguments: deterministicStringify(part.input)\n                }\n              });\n              break;\n            }\n            case \"reasoning\": {\n              reasoning += part.text;\n              break;\n            }\n            case \"file\":\n              break;\n            default: {\n              break;\n            }\n          }\n        }\n        const parsedProviderOptions = OpenRouterProviderOptionsSchema.safeParse(providerOptions);\n        const messageReasoningDetails = parsedProviderOptions.success ? (_e = (_d = parsedProviderOptions.data) == null ? void 0 : _d.openrouter) == null ? void 0 : _e.reasoning_details : void 0;\n        const messageAnnotations = parsedProviderOptions.success ? (_g = (_f = parsedProviderOptions.data) == null ? void 0 : _f.openrouter) == null ? void 0 : _g.annotations : void 0;\n        const candidateReasoningDetails = messageReasoningDetails && Array.isArray(messageReasoningDetails) ? messageReasoningDetails : findFirstReasoningDetails(content);\n        let finalReasoningDetails;\n        if (candidateReasoningDetails) {\n          const validDetails = candidateReasoningDetails.filter((detail) => {\n            var _a17;\n            if (detail.type !== \"reasoning.text\" /* Text */) {\n              return true;\n            }\n            const format = (_a17 = detail.format) != null ? _a17 : DEFAULT_REASONING_FORMAT;\n            if (format !== \"anthropic-claude-v1\" /* AnthropicClaudeV1 */ && format !== \"google-gemini-v1\" /* GoogleGeminiV1 */) {\n              return true;\n            }\n            return !!detail.signature;\n          });\n          if (validDetails.length < candidateReasoningDetails.length) {\n            const logger = globalThis.AI_SDK_LOG_WARNINGS;\n            if (logger !== false && typeof logger !== \"function\") {\n              console.warn(\n                \"[openrouter] Some reasoning_details entries were removed because they were missing signatures. See https://github.com/OpenRouterTeam/ai-sdk-provider/issues/423 and https://github.com/OpenRouterTeam/ai-sdk-provider/issues/418 for more details.\"\n              );\n            }\n          }\n          const uniqueDetails = [];\n          for (const detail of validDetails) {\n            if (reasoningDetailsTracker.upsert(detail)) {\n              uniqueDetails.push(detail);\n            }\n          }\n          finalReasoningDetails = uniqueDetails;\n        }\n        const effectiveReasoning = reasoning && finalReasoningDetails && finalReasoningDetails.length > 0 ? reasoning : void 0;\n        messages.push({\n          role: \"assistant\",\n          content: text || null,\n          tool_calls: toolCalls.length > 0 ? toolCalls : void 0,\n          reasoning: effectiveReasoning,\n          reasoning_details: finalReasoningDetails,\n          annotations: messageAnnotations,\n          cache_control: getCacheControl(providerOptions)\n        });\n        break;\n      }\n      case \"tool\": {\n        for (const toolResponse of content) {\n          if (toolResponse.type === \"tool-approval-response\") {\n            continue;\n          }\n          const content2 = getToolResultContent(toolResponse);\n          messages.push({\n            role: \"tool\",\n            tool_call_id: toolResponse.toolCallId,\n            content: content2,\n            name: toolResponse.toolName,\n            cache_control: (_h = getCacheControl(providerOptions)) != null ? _h : getCacheControl(toolResponse.providerOptions)\n          });\n        }\n        break;\n      }\n      default: {\n        break;\n      }\n    }\n  }\n  return messages;\n}\nfunction getToolResultContent(input) {\n  var _a16;\n  switch (input.output.type) {\n    case \"text\":\n    case \"error-text\":\n      return input.output.value;\n    case \"json\":\n    case \"error-json\":\n      return JSON.stringify(input.output.value);\n    case \"content\":\n      return mapToolResultContentParts(input.output.value);\n    case \"execution-denied\":\n      return (_a16 = input.output.reason) != null ? _a16 : \"Tool execution denied\";\n  }\n}\nfunction mapToolResultContentParts(parts) {\n  return parts.map((part) => {\n    var _a16, _b16, _c, _d;\n    switch (part.type) {\n      case \"text\":\n        return { type: \"text\", text: part.text };\n      case \"image-data\":\n        return {\n          type: \"image_url\",\n          image_url: {\n            url: buildFileDataUrl({\n              data: part.data,\n              mediaType: part.mediaType,\n              defaultMediaType: \"image/jpeg\"\n            })\n          }\n        };\n      case \"image-url\":\n        return {\n          type: \"image_url\",\n          image_url: { url: part.url }\n        };\n      case \"file-data\": {\n        const dataUrl = buildFileDataUrl({\n          data: part.data,\n          mediaType: part.mediaType,\n          defaultMediaType: \"application/octet-stream\"\n        });\n        if ((_a16 = part.mediaType) == null ? void 0 : _a16.startsWith(\"image/\")) {\n          return {\n            type: \"image_url\",\n            image_url: { url: dataUrl }\n          };\n        }\n        if ((_b16 = part.mediaType) == null ? void 0 : _b16.startsWith(\"video/\")) {\n          return {\n            type: \"video_url\",\n            video_url: { url: dataUrl }\n          };\n        }\n        if ((_c = part.mediaType) == null ? void 0 : _c.startsWith(\"audio/\")) {\n          const rawFormat = part.mediaType.replace(\"audio/\", \"\");\n          const format = MIME_TO_FORMAT[rawFormat];\n          if (format !== void 0) {\n            return {\n              type: \"input_audio\",\n              input_audio: {\n                data: getBase64FromDataUrl(dataUrl),\n                format\n              }\n            };\n          }\n        }\n        return {\n          type: \"file\",\n          file: {\n            filename: (_d = part.filename) != null ? _d : \"\",\n            file_data: dataUrl\n          }\n        };\n      }\n      case \"file-url\": {\n        if (looksLikeImageUrl(part.url)) {\n          return {\n            type: \"image_url\",\n            image_url: { url: part.url }\n          };\n        }\n        return {\n          type: \"file\",\n          file: {\n            filename: filenameFromUrl(part.url),\n            file_data: part.url\n          }\n        };\n      }\n      case \"file-id\":\n      case \"image-file-id\":\n      case \"custom\":\n        return { type: \"text\", text: JSON.stringify(part) };\n      default: {\n        const _exhaustiveCheck = part;\n        return { type: \"text\", text: JSON.stringify(_exhaustiveCheck) };\n      }\n    }\n  });\n}\nvar IMAGE_EXTENSIONS = /* @__PURE__ */ new Set([\n  \"jpg\",\n  \"jpeg\",\n  \"png\",\n  \"gif\",\n  \"webp\",\n  \"svg\",\n  \"bmp\",\n  \"ico\",\n  \"tif\",\n  \"tiff\",\n  \"avif\"\n]);\nfunction looksLikeImageUrl(url) {\n  var _a16;\n  try {\n    const pathname = new URL(url).pathname;\n    const ext = (_a16 = pathname.split(\".\").pop()) == null ? void 0 : _a16.toLowerCase();\n    return ext !== void 0 && IMAGE_EXTENSIONS.has(ext);\n  } catch (e) {\n    return false;\n  }\n}\nfunction filenameFromUrl(url) {\n  try {\n    const pathname = new URL(url).pathname;\n    const last = pathname.split(\"/\").pop();\n    return (last == null ? void 0 : last.includes(\".\")) ? last : \"\";\n  } catch (e) {\n    return \"\";\n  }\n}\nfunction findFirstReasoningDetails(content) {\n  var _a16, _b16, _c, _d;\n  for (const part of content) {\n    if (part.type === \"tool-call\") {\n      const parsed = OpenRouterProviderOptionsSchema.safeParse(\n        part.providerOptions\n      );\n      if (parsed.success && ((_b16 = (_a16 = parsed.data) == null ? void 0 : _a16.openrouter) == null ? void 0 : _b16.reasoning_details) && parsed.data.openrouter.reasoning_details.length > 0) {\n        return parsed.data.openrouter.reasoning_details;\n      }\n    }\n  }\n  for (const part of content) {\n    if (part.type === \"reasoning\") {\n      const parsed = OpenRouterProviderOptionsSchema.safeParse(\n        part.providerOptions\n      );\n      if (parsed.success && ((_d = (_c = parsed.data) == null ? void 0 : _c.openrouter) == null ? void 0 : _d.reasoning_details) && parsed.data.openrouter.reasoning_details.length > 0) {\n        return parsed.data.openrouter.reasoning_details;\n      }\n    }\n  }\n  return void 0;\n}\n\n// src/chat/get-tool-choice.ts\nimport { z as z5 } from \"zod/v4\";\nvar ChatCompletionToolChoiceSchema = z5.union([\n  z5.literal(\"auto\"),\n  z5.literal(\"none\"),\n  z5.literal(\"required\"),\n  z5.object({\n    type: z5.literal(\"function\"),\n    function: z5.object({\n      name: z5.string()\n    })\n  })\n]);\nfunction getChatCompletionToolChoice(toolChoice) {\n  switch (toolChoice.type) {\n    case \"auto\":\n    case \"none\":\n    case \"required\":\n      return toolChoice.type;\n    case \"tool\": {\n      return {\n        type: \"function\",\n        function: { name: toolChoice.toolName }\n      };\n    }\n    default: {\n      toolChoice;\n      throw new InvalidArgumentError({\n        argument: \"toolChoice\",\n        message: `Invalid tool choice type: ${JSON.stringify(toolChoice)}`\n      });\n    }\n  }\n}\n\n// src/chat/schemas.ts\nimport { z as z7 } from \"zod/v4\";\n\n// src/schemas/image.ts\nimport { z as z6 } from \"zod/v4\";\nvar ImageResponseSchema = z6.object({\n  type: z6.literal(\"image_url\"),\n  image_url: z6.object({\n    url: z6.string()\n  }).passthrough()\n}).passthrough();\nvar ImageResponseWithUnknownSchema = z6.union([\n  ImageResponseSchema,\n  z6.unknown().transform(() => null)\n]);\nvar ImageResponseArraySchema = z6.array(ImageResponseWithUnknownSchema).transform((d) => d.filter((d2) => !!d2));\n\n// src/chat/schemas.ts\nvar OpenRouterChatCompletionBaseResponseSchema = z7.object({\n  id: z7.string().optional(),\n  model: z7.string().optional(),\n  provider: z7.string().optional(),\n  usage: z7.object({\n    prompt_tokens: z7.number(),\n    prompt_tokens_details: z7.object({\n      cached_tokens: z7.number(),\n      cache_write_tokens: z7.number().nullish()\n    }).passthrough().nullish(),\n    completion_tokens: z7.number(),\n    completion_tokens_details: z7.object({\n      reasoning_tokens: z7.number()\n    }).passthrough().nullish(),\n    total_tokens: z7.number(),\n    cost: z7.number().optional(),\n    cost_details: z7.object({\n      upstream_inference_cost: z7.number().nullish()\n    }).passthrough().nullish()\n  }).passthrough().nullish()\n}).passthrough();\nvar OpenRouterNonStreamChatCompletionResponseSchema = z7.union([\n  // Success response with choices\n  OpenRouterChatCompletionBaseResponseSchema.extend({\n    choices: z7.array(\n      z7.object({\n        message: z7.object({\n          role: z7.literal(\"assistant\"),\n          content: z7.string().nullable().optional(),\n          reasoning: z7.string().nullable().optional(),\n          reasoning_details: ReasoningDetailArraySchema.nullish(),\n          images: ImageResponseArraySchema.nullish(),\n          tool_calls: z7.array(\n            z7.object({\n              id: z7.string().optional().nullable(),\n              type: z7.literal(\"function\"),\n              function: z7.object({\n                name: z7.string(),\n                arguments: z7.string().optional()\n              }).passthrough()\n            }).passthrough()\n          ).optional(),\n          annotations: z7.array(\n            z7.union([\n              // URL citation from web search\n              // title, start_index, end_index are optional as some upstream providers may omit them\n              z7.object({\n                type: z7.literal(\"url_citation\"),\n                url_citation: z7.object({\n                  url: z7.string(),\n                  title: z7.string().optional(),\n                  start_index: z7.number().optional(),\n                  end_index: z7.number().optional(),\n                  content: z7.string().optional()\n                }).passthrough()\n              }).passthrough(),\n              // File annotation from FileParserPlugin (old format)\n              z7.object({\n                type: z7.literal(\"file_annotation\"),\n                file_annotation: z7.object({\n                  file_id: z7.string(),\n                  quote: z7.string().optional()\n                }).passthrough()\n              }).passthrough(),\n              // File annotation from FileParserPlugin (new format)\n              z7.object({\n                type: z7.literal(\"file\"),\n                file: z7.object({\n                  hash: z7.string(),\n                  name: z7.string(),\n                  content: z7.array(\n                    z7.object({\n                      type: z7.string(),\n                      text: z7.string().optional()\n                    }).passthrough()\n                  ).optional()\n                }).passthrough()\n              }).passthrough()\n            ])\n          ).nullish()\n        }).passthrough(),\n        index: z7.number().nullish(),\n        logprobs: z7.object({\n          content: z7.array(\n            z7.object({\n              token: z7.string(),\n              logprob: z7.number(),\n              top_logprobs: z7.array(\n                z7.object({\n                  token: z7.string(),\n                  logprob: z7.number()\n                }).passthrough()\n              )\n            }).passthrough()\n          ).nullable()\n        }).passthrough().nullable().optional(),\n        finish_reason: z7.string().optional().nullable()\n      }).passthrough()\n    )\n  }),\n  // Error response (HTTP 200 with error payload)\n  OpenRouterErrorResponseSchema.extend({\n    user_id: z7.string().optional()\n  })\n]);\nvar OpenRouterStreamChatCompletionChunkSchema = z7.union([\n  OpenRouterChatCompletionBaseResponseSchema.extend({\n    choices: z7.array(\n      z7.object({\n        delta: z7.object({\n          role: z7.enum([\"assistant\"]).optional(),\n          content: z7.string().nullish(),\n          reasoning: z7.string().nullish().optional(),\n          reasoning_details: ReasoningDetailArraySchema.nullish(),\n          images: ImageResponseArraySchema.nullish(),\n          tool_calls: z7.array(\n            z7.object({\n              index: z7.number().nullish(),\n              id: z7.string().nullish(),\n              type: z7.literal(\"function\").optional(),\n              function: z7.object({\n                name: z7.string().nullish(),\n                arguments: z7.string().nullish()\n              }).passthrough()\n            }).passthrough()\n          ).nullish(),\n          annotations: z7.array(\n            z7.union([\n              // URL citation from web search\n              // title, start_index, end_index are optional as some upstream providers may omit them\n              z7.object({\n                type: z7.literal(\"url_citation\"),\n                url_citation: z7.object({\n                  url: z7.string(),\n                  title: z7.string().optional(),\n                  start_index: z7.number().optional(),\n                  end_index: z7.number().optional(),\n                  content: z7.string().optional()\n                }).passthrough()\n              }).passthrough(),\n              // File annotation from FileParserPlugin (old format)\n              z7.object({\n                type: z7.literal(\"file_annotation\"),\n                file_annotation: z7.object({\n                  file_id: z7.string(),\n                  quote: z7.string().optional()\n                }).passthrough()\n              }).passthrough(),\n              // File annotation from FileParserPlugin (new format)\n              z7.object({\n                type: z7.literal(\"file\"),\n                file: z7.object({\n                  hash: z7.string(),\n                  name: z7.string(),\n                  content: z7.array(\n                    z7.object({\n                      type: z7.string(),\n                      text: z7.string().optional()\n                    }).passthrough()\n                  ).optional()\n                }).passthrough()\n              }).passthrough()\n            ])\n          ).nullish()\n        }).passthrough().nullish(),\n        logprobs: z7.object({\n          content: z7.array(\n            z7.object({\n              token: z7.string(),\n              logprob: z7.number(),\n              top_logprobs: z7.array(\n                z7.object({\n                  token: z7.string(),\n                  logprob: z7.number()\n                }).passthrough()\n              )\n            }).passthrough()\n          ).nullable()\n        }).passthrough().nullish(),\n        finish_reason: z7.string().nullable().optional(),\n        index: z7.number().nullish()\n      }).passthrough()\n    )\n  }),\n  OpenRouterErrorResponseSchema\n]);\n\n// src/chat/index.ts\nvar OpenRouterChatLanguageModel = class {\n  constructor(modelId, settings, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"openrouter\";\n    this.defaultObjectGenerationMode = \"tool\";\n    this.supportsImageUrls = true;\n    this.supportedUrls = {\n      \"image/*\": [\n        /^data:image\\/[a-zA-Z]+;base64,/,\n        /^https?:\\/\\/.+\\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i\n      ],\n      // 'text/*': [/^data:text\\//, /^https?:\\/\\/.+$/],\n      \"application/*\": [/^data:application\\//, /^https?:\\/\\/.+$/]\n    };\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n  }\n  getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    frequencyPenalty,\n    presencePenalty,\n    seed,\n    stopSequences,\n    responseFormat,\n    topK,\n    tools,\n    toolChoice\n  }) {\n    var _a16, _b16, _c, _d;\n    const baseArgs = __spreadValues(__spreadValues({\n      // model id:\n      model: this.modelId,\n      models: this.settings.models,\n      // model specific settings:\n      logit_bias: this.settings.logitBias,\n      logprobs: this.settings.logprobs === true || typeof this.settings.logprobs === \"number\" ? true : void 0,\n      top_logprobs: typeof this.settings.logprobs === \"number\" ? this.settings.logprobs : typeof this.settings.logprobs === \"boolean\" ? this.settings.logprobs ? 0 : void 0 : void 0,\n      user: this.settings.user,\n      parallel_tool_calls: this.settings.parallelToolCalls,\n      // standardized settings (call-level options override model-level settings):\n      max_tokens: maxOutputTokens != null ? maxOutputTokens : this.settings.maxTokens,\n      temperature: temperature != null ? temperature : this.settings.temperature,\n      top_p: topP != null ? topP : this.settings.topP,\n      frequency_penalty: frequencyPenalty != null ? frequencyPenalty : this.settings.frequencyPenalty,\n      presence_penalty: presencePenalty != null ? presencePenalty : this.settings.presencePenalty,\n      seed,\n      stop: stopSequences,\n      response_format: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" ? responseFormat.schema != null ? {\n        type: \"json_schema\",\n        json_schema: __spreadValues({\n          schema: responseFormat.schema,\n          strict: (_b16 = (_a16 = this.settings.structuredOutputs) == null ? void 0 : _a16.strict) != null ? _b16 : true,\n          name: (_c = responseFormat.name) != null ? _c : \"response\"\n        }, responseFormat.description && {\n          description: responseFormat.description\n        })\n      } : { type: \"json_object\" } : void 0,\n      top_k: topK != null ? topK : this.settings.topK,\n      // messages:\n      messages: convertToOpenRouterChatMessages(prompt),\n      // OpenRouter specific settings:\n      include_reasoning: this.settings.includeReasoning,\n      reasoning: this.settings.reasoning,\n      usage: this.settings.usage,\n      // Web search settings:\n      plugins: this.settings.plugins,\n      web_search_options: this.settings.web_search_options,\n      // Provider routing settings:\n      provider: this.settings.provider,\n      // Debug settings:\n      debug: this.settings.debug,\n      // Anthropic automatic caching:\n      cache_control: this.settings.cache_control\n    }, this.config.extraBody), this.settings.extraBody);\n    if (tools && tools.length > 0) {\n      const mappedTools = [];\n      for (const tool2 of tools) {\n        if (tool2.type === \"function\") {\n          const openrouterOptions = (_d = tool2.providerOptions) == null ? void 0 : _d.openrouter;\n          const eagerInputStreaming = openrouterOptions == null ? void 0 : openrouterOptions.eager_input_streaming;\n          mappedTools.push(__spreadValues({\n            type: \"function\",\n            function: {\n              name: tool2.name,\n              description: tool2.description,\n              parameters: tool2.inputSchema\n            }\n          }, eagerInputStreaming != null && {\n            eager_input_streaming: eagerInputStreaming\n          }));\n        } else if (tool2.type === \"provider\") {\n          mappedTools.push(mapProviderTool(tool2));\n        }\n      }\n      return __spreadProps(__spreadValues({}, baseArgs), {\n        tools: mappedTools,\n        tool_choice: toolChoice ? getChatCompletionToolChoice(toolChoice) : void 0\n      });\n    }\n    return baseArgs;\n  }\n  async doGenerate(options) {\n    var _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;\n    const providerOptions = options.providerOptions || {};\n    const openrouterOptions = providerOptions.openrouter || {};\n    const _a16 = openrouterOptions, { cacheControl } = _a16, restOpenrouterOptions = __objRest(_a16, [\"cacheControl\"]);\n    const args = __spreadValues(__spreadValues(__spreadValues({}, this.getArgs(options)), restOpenrouterOptions), cacheControl != null && !(\"cache_control\" in restOpenrouterOptions) ? { cache_control: cacheControl } : {});\n    const { value: responseValue, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/chat/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body: args,\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        OpenRouterNonStreamChatCompletionResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    if (\"error\" in responseValue) {\n      const errorData = responseValue.error;\n      throw new APICallError({\n        message: errorData.message,\n        url: this.config.url({\n          path: \"/chat/completions\",\n          modelId: this.modelId\n        }),\n        requestBodyValues: args,\n        statusCode: 200,\n        responseHeaders,\n        data: errorData\n      });\n    }\n    const response = responseValue;\n    const choice = response.choices[0];\n    if (!choice) {\n      throw new NoContentGeneratedError({\n        message: \"No choice in response\"\n      });\n    }\n    const usageInfo = response.usage ? computeTokenUsage(response.usage) : emptyUsage();\n    const reasoningDetails = (_b16 = choice.message.reasoning_details) != null ? _b16 : [];\n    const reasoning = reasoningDetails.length > 0 ? reasoningDetails.map((detail) => {\n      switch (detail.type) {\n        case \"reasoning.text\" /* Text */: {\n          if (detail.text) {\n            return {\n              type: \"reasoning\",\n              text: detail.text,\n              providerMetadata: {\n                openrouter: {\n                  reasoning_details: [detail]\n                }\n              }\n            };\n          }\n          break;\n        }\n        case \"reasoning.summary\" /* Summary */: {\n          if (detail.summary) {\n            return {\n              type: \"reasoning\",\n              text: detail.summary,\n              providerMetadata: {\n                openrouter: {\n                  reasoning_details: [detail]\n                }\n              }\n            };\n          }\n          break;\n        }\n        case \"reasoning.encrypted\" /* Encrypted */: {\n          break;\n        }\n        default: {\n          detail;\n        }\n      }\n      return null;\n    }).filter((p) => p !== null) : choice.message.reasoning ? [\n      {\n        type: \"reasoning\",\n        text: choice.message.reasoning\n      }\n    ] : [];\n    const content = [];\n    content.push(...reasoning);\n    if (choice.message.content) {\n      content.push({\n        type: \"text\",\n        text: choice.message.content\n      });\n    }\n    if (choice.message.tool_calls) {\n      let reasoningDetailsAttachedToToolCall = false;\n      const seenToolCallIds = /* @__PURE__ */ new Set();\n      for (const toolCall of choice.message.tool_calls) {\n        let toolCallId = toolCall.id;\n        if (!toolCallId || seenToolCallIds.has(toolCallId)) {\n          toolCallId = generateId();\n        }\n        seenToolCallIds.add(toolCallId);\n        content.push({\n          type: \"tool-call\",\n          toolCallId,\n          toolName: toolCall.function.name,\n          input: (_c = toolCall.function.arguments) != null ? _c : \"{}\",\n          providerMetadata: !reasoningDetailsAttachedToToolCall ? {\n            openrouter: {\n              reasoning_details: reasoningDetails\n            }\n          } : void 0\n        });\n        reasoningDetailsAttachedToToolCall = true;\n      }\n    }\n    if (choice.message.images) {\n      for (const image of choice.message.images) {\n        content.push({\n          type: \"file\",\n          mediaType: getMediaType(image.image_url.url, \"image/jpeg\"),\n          data: getBase64FromDataUrl(image.image_url.url)\n        });\n      }\n    }\n    if (choice.message.annotations) {\n      for (const annotation of choice.message.annotations) {\n        if (annotation.type === \"url_citation\") {\n          content.push({\n            type: \"source\",\n            sourceType: \"url\",\n            id: annotation.url_citation.url,\n            url: annotation.url_citation.url,\n            title: (_d = annotation.url_citation.title) != null ? _d : \"\",\n            providerMetadata: {\n              openrouter: {\n                content: (_e = annotation.url_citation.content) != null ? _e : \"\",\n                startIndex: (_f = annotation.url_citation.start_index) != null ? _f : 0,\n                endIndex: (_g = annotation.url_citation.end_index) != null ? _g : 0\n              }\n            }\n          });\n        }\n      }\n    }\n    const fileAnnotations = (_h = choice.message.annotations) == null ? void 0 : _h.filter(\n      (a) => a.type === \"file\"\n    );\n    const hasToolCalls = choice.message.tool_calls && choice.message.tool_calls.length > 0;\n    const hasEncryptedReasoning = reasoningDetails.some(\n      (d) => d.type === \"reasoning.encrypted\" /* Encrypted */ && d.data\n    );\n    const shouldOverrideFinishReason = hasToolCalls && hasEncryptedReasoning && choice.finish_reason === \"stop\";\n    const mappedFinishReason = shouldOverrideFinishReason ? createFinishReason(\"tool-calls\", (_i = choice.finish_reason) != null ? _i : void 0) : mapOpenRouterFinishReason(choice.finish_reason);\n    const effectiveFinishReason = hasToolCalls && mappedFinishReason.unified === \"other\" ? createFinishReason(\"tool-calls\", mappedFinishReason.raw) : mappedFinishReason;\n    return {\n      content,\n      finishReason: effectiveFinishReason,\n      usage: usageInfo,\n      warnings: [],\n      providerMetadata: {\n        openrouter: OpenRouterProviderMetadataSchema.parse({\n          provider: (_j = response.provider) != null ? _j : \"\",\n          reasoning_details: (_k = choice.message.reasoning_details) != null ? _k : [],\n          annotations: fileAnnotations && fileAnnotations.length > 0 ? fileAnnotations : void 0,\n          usage: __spreadValues(__spreadValues(__spreadValues(__spreadValues({\n            promptTokens: (_l = usageInfo.inputTokens.total) != null ? _l : 0,\n            completionTokens: (_m = usageInfo.outputTokens.total) != null ? _m : 0,\n            totalTokens: ((_n = usageInfo.inputTokens.total) != null ? _n : 0) + ((_o = usageInfo.outputTokens.total) != null ? _o : 0)\n          }, ((_p = response.usage) == null ? void 0 : _p.cost) != null ? { cost: response.usage.cost } : {}), ((_r = (_q = response.usage) == null ? void 0 : _q.prompt_tokens_details) == null ? void 0 : _r.cached_tokens) != null ? {\n            promptTokensDetails: {\n              cachedTokens: response.usage.prompt_tokens_details.cached_tokens\n            }\n          } : {}), ((_t = (_s = response.usage) == null ? void 0 : _s.completion_tokens_details) == null ? void 0 : _t.reasoning_tokens) != null ? {\n            completionTokensDetails: {\n              reasoningTokens: response.usage.completion_tokens_details.reasoning_tokens\n            }\n          } : {}), ((_v = (_u = response.usage) == null ? void 0 : _u.cost_details) == null ? void 0 : _v.upstream_inference_cost) != null ? {\n            costDetails: {\n              upstreamInferenceCost: response.usage.cost_details.upstream_inference_cost\n            }\n          } : {})\n        })\n      },\n      request: { body: args },\n      response: {\n        id: response.id,\n        modelId: response.model,\n        headers: responseHeaders,\n        body: response\n      }\n    };\n  }\n  async doStream(options) {\n    var _b16;\n    const providerOptions = options.providerOptions || {};\n    const openrouterOptions = providerOptions.openrouter || {};\n    const _a16 = openrouterOptions, { cacheControl } = _a16, restOpenrouterOptions = __objRest(_a16, [\"cacheControl\"]);\n    const args = __spreadValues(__spreadValues(__spreadValues({}, this.getArgs(options)), restOpenrouterOptions), cacheControl != null && !(\"cache_control\" in restOpenrouterOptions) ? { cache_control: cacheControl } : {});\n    const { value: response, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/chat/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body: __spreadProps(__spreadValues({}, args), {\n        stream: true,\n        // only include stream_options when in strict compatibility mode:\n        stream_options: this.config.compatibility === \"strict\" ? __spreadValues({\n          include_usage: true\n        }, ((_b16 = this.settings.usage) == null ? void 0 : _b16.include) ? { include_usage: true } : {}) : void 0\n      }),\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        OpenRouterStreamChatCompletionChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let streamError;\n    const safeResponse = withStreamErrorHandling(response, (err) => {\n      streamError = err;\n    });\n    const toolCalls = [];\n    const seenToolCallIds = /* @__PURE__ */ new Set();\n    let finishReason = createFinishReason(\"other\");\n    const usage = {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n    const openrouterUsage = {};\n    let rawUsage;\n    const accumulatedReasoningDetails = [];\n    let reasoningDetailsAttachedToToolCall = false;\n    const accumulatedFileAnnotations = [];\n    let textStarted = false;\n    let reasoningStarted = false;\n    let textId;\n    let reasoningId;\n    let openrouterResponseId;\n    let provider;\n    return {\n      stream: safeResponse.pipeThrough(\n        new TransformStream({\n          transform(chunk, controller) {\n            var _a17, _b17, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (\"error\" in value) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            if (value.provider) {\n              provider = value.provider;\n            }\n            if (value.id) {\n              openrouterResponseId = value.id;\n              controller.enqueue({\n                type: \"response-metadata\",\n                id: value.id\n              });\n            }\n            if (value.model) {\n              controller.enqueue({\n                type: \"response-metadata\",\n                modelId: value.model\n              });\n            }\n            if (value.usage != null) {\n              const computed = computeTokenUsage(value.usage);\n              Object.assign(usage.inputTokens, computed.inputTokens);\n              Object.assign(usage.outputTokens, computed.outputTokens);\n              rawUsage = value.usage;\n              const promptTokens = (_a17 = value.usage.prompt_tokens) != null ? _a17 : 0;\n              const completionTokens = (_b17 = value.usage.completion_tokens) != null ? _b17 : 0;\n              openrouterUsage.promptTokens = promptTokens;\n              if (value.usage.prompt_tokens_details) {\n                openrouterUsage.promptTokensDetails = {\n                  cachedTokens: (_c = value.usage.prompt_tokens_details.cached_tokens) != null ? _c : 0\n                };\n              }\n              openrouterUsage.completionTokens = completionTokens;\n              if (value.usage.completion_tokens_details) {\n                openrouterUsage.completionTokensDetails = {\n                  reasoningTokens: (_d = value.usage.completion_tokens_details.reasoning_tokens) != null ? _d : 0\n                };\n              }\n              if (value.usage.cost != null) {\n                openrouterUsage.cost = value.usage.cost;\n              }\n              openrouterUsage.totalTokens = value.usage.total_tokens;\n              const upstreamInferenceCost = (_e = value.usage.cost_details) == null ? void 0 : _e.upstream_inference_cost;\n              if (upstreamInferenceCost != null) {\n                openrouterUsage.costDetails = {\n                  upstreamInferenceCost\n                };\n              }\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = mapOpenRouterFinishReason(choice.finish_reason);\n            }\n            if ((choice == null ? void 0 : choice.delta) == null) {\n              return;\n            }\n            const delta = choice.delta;\n            const emitReasoningChunk = (chunkText) => {\n              if (!reasoningStarted) {\n                reasoningId = generateId();\n                controller.enqueue({\n                  type: \"reasoning-start\",\n                  id: reasoningId\n                });\n                reasoningStarted = true;\n              }\n              controller.enqueue({\n                type: \"reasoning-delta\",\n                delta: chunkText,\n                id: reasoningId || generateId()\n              });\n            };\n            if (delta.reasoning_details && delta.reasoning_details.length > 0) {\n              for (const detail of delta.reasoning_details) {\n                if (detail.type === \"reasoning.text\" /* Text */) {\n                  const lastDetail = accumulatedReasoningDetails[accumulatedReasoningDetails.length - 1];\n                  if ((lastDetail == null ? void 0 : lastDetail.type) === \"reasoning.text\" /* Text */) {\n                    lastDetail.text = (lastDetail.text || \"\") + (detail.text || \"\");\n                    lastDetail.signature = lastDetail.signature || detail.signature;\n                    lastDetail.format = lastDetail.format || detail.format;\n                  } else {\n                    accumulatedReasoningDetails.push(__spreadValues({}, detail));\n                  }\n                } else {\n                  accumulatedReasoningDetails.push(detail);\n                }\n              }\n              if (!textStarted) {\n                for (const detail of delta.reasoning_details) {\n                  switch (detail.type) {\n                    case \"reasoning.text\" /* Text */: {\n                      emitReasoningChunk(detail.text || \"\");\n                      break;\n                    }\n                    case \"reasoning.encrypted\" /* Encrypted */: {\n                      break;\n                    }\n                    case \"reasoning.summary\" /* Summary */: {\n                      if (detail.summary) {\n                        emitReasoningChunk(detail.summary);\n                      }\n                      break;\n                    }\n                    default: {\n                      detail;\n                      break;\n                    }\n                  }\n                }\n              }\n            } else if (delta.reasoning && !textStarted) {\n              emitReasoningChunk(delta.reasoning);\n            }\n            if (delta.content) {\n              if (reasoningStarted && !textStarted) {\n                controller.enqueue({\n                  type: \"reasoning-end\",\n                  id: reasoningId || generateId(),\n                  // Always include accumulated reasoning_details so the AI SDK can\n                  // update the reasoning part's providerMetadata with the correct\n                  // signature.  The signature typically arrives in the last delta,\n                  // but reasoning-start only carries the first delta's metadata.\n                  // An empty array is intentional — it signals the provider produced\n                  // no reasoning tokens this turn (e.g. DeepSeek V4).\n                  providerMetadata: {\n                    openrouter: {\n                      reasoning_details: accumulatedReasoningDetails\n                    }\n                  }\n                });\n                reasoningStarted = false;\n              }\n              if (!textStarted) {\n                textId = openrouterResponseId || generateId();\n                controller.enqueue({\n                  type: \"text-start\",\n                  id: textId\n                });\n                textStarted = true;\n              }\n              controller.enqueue({\n                type: \"text-delta\",\n                delta: delta.content,\n                id: textId || generateId()\n              });\n            }\n            if (delta.annotations) {\n              for (const annotation of delta.annotations) {\n                if (annotation.type === \"url_citation\") {\n                  controller.enqueue({\n                    type: \"source\",\n                    sourceType: \"url\",\n                    id: annotation.url_citation.url,\n                    url: annotation.url_citation.url,\n                    title: (_f = annotation.url_citation.title) != null ? _f : \"\",\n                    providerMetadata: {\n                      openrouter: {\n                        content: (_g = annotation.url_citation.content) != null ? _g : \"\",\n                        startIndex: (_h = annotation.url_citation.start_index) != null ? _h : 0,\n                        endIndex: (_i = annotation.url_citation.end_index) != null ? _i : 0\n                      }\n                    }\n                  });\n                } else if (annotation.type === \"file\") {\n                  const file = annotation.file;\n                  if (file && typeof file === \"object\" && \"hash\" in file && \"name\" in file) {\n                    accumulatedFileAnnotations.push(\n                      annotation\n                    );\n                  }\n                }\n              }\n            }\n            if (delta.tool_calls != null) {\n              for (const toolCallDelta of delta.tool_calls) {\n                const index = (_j = toolCallDelta.index) != null ? _j : toolCalls.length - 1;\n                if (toolCalls[index] == null) {\n                  if (toolCallDelta.type !== \"function\") {\n                    throw new InvalidResponseDataError({\n                      data: toolCallDelta,\n                      message: `Expected 'function' type.`\n                    });\n                  }\n                  if (((_k = toolCallDelta.function) == null ? void 0 : _k.name) == null) {\n                    throw new InvalidResponseDataError({\n                      data: toolCallDelta,\n                      message: `Expected 'function.name' to be a string.`\n                    });\n                  }\n                  let toolCallId = (_l = toolCallDelta.id) != null ? _l : \"\";\n                  if (!toolCallId || seenToolCallIds.has(toolCallId)) {\n                    toolCallId = generateId();\n                  }\n                  seenToolCallIds.add(toolCallId);\n                  toolCalls[index] = {\n                    id: toolCallId,\n                    type: \"function\",\n                    function: {\n                      name: toolCallDelta.function.name,\n                      arguments: (_m = toolCallDelta.function.arguments) != null ? _m : \"\"\n                    },\n                    inputStarted: false,\n                    sent: false\n                  };\n                  const toolCall2 = toolCalls[index];\n                  if (toolCall2 == null) {\n                    throw new InvalidResponseDataError({\n                      data: { index, toolCallsLength: toolCalls.length },\n                      message: `Tool call at index ${index} is missing after creation.`\n                    });\n                  }\n                  if (((_n = toolCall2.function) == null ? void 0 : _n.name) != null && ((_o = toolCall2.function) == null ? void 0 : _o.arguments) != null && isParsableJson(toolCall2.function.arguments)) {\n                    toolCall2.inputStarted = true;\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: toolCall2.id,\n                      toolName: toolCall2.function.name\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: toolCall2.id,\n                      delta: toolCall2.function.arguments\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-end\",\n                      id: toolCall2.id\n                    });\n                    controller.enqueue({\n                      type: \"tool-call\",\n                      toolCallId: toolCall2.id,\n                      toolName: toolCall2.function.name,\n                      input: toolCall2.function.arguments,\n                      providerMetadata: !reasoningDetailsAttachedToToolCall ? {\n                        openrouter: {\n                          reasoning_details: accumulatedReasoningDetails\n                        }\n                      } : void 0\n                    });\n                    reasoningDetailsAttachedToToolCall = true;\n                    toolCall2.sent = true;\n                  }\n                  continue;\n                }\n                const toolCall = toolCalls[index];\n                if (toolCall == null) {\n                  throw new InvalidResponseDataError({\n                    data: {\n                      index,\n                      toolCallsLength: toolCalls.length,\n                      toolCallDelta\n                    },\n                    message: `Tool call at index ${index} is missing during merge.`\n                  });\n                }\n                if (!toolCall.inputStarted) {\n                  toolCall.inputStarted = true;\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id: toolCall.id,\n                    toolName: toolCall.function.name\n                  });\n                  if (toolCall.function.arguments) {\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: toolCall.id,\n                      delta: toolCall.function.arguments\n                    });\n                  }\n                }\n                if (((_p = toolCallDelta.function) == null ? void 0 : _p.arguments) != null) {\n                  toolCall.function.arguments += (_r = (_q = toolCallDelta.function) == null ? void 0 : _q.arguments) != null ? _r : \"\";\n                }\n                controller.enqueue({\n                  type: \"tool-input-delta\",\n                  id: toolCall.id,\n                  delta: (_s = toolCallDelta.function.arguments) != null ? _s : \"\"\n                });\n                if (!toolCall.sent && ((_t = toolCall.function) == null ? void 0 : _t.name) != null && ((_u = toolCall.function) == null ? void 0 : _u.arguments) != null && isParsableJson(toolCall.function.arguments)) {\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCall.id\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId: toolCall.id,\n                    toolName: toolCall.function.name,\n                    input: toolCall.function.arguments,\n                    providerMetadata: !reasoningDetailsAttachedToToolCall ? {\n                      openrouter: {\n                        reasoning_details: accumulatedReasoningDetails\n                      }\n                    } : void 0\n                  });\n                  reasoningDetailsAttachedToToolCall = true;\n                  toolCall.sent = true;\n                }\n              }\n            }\n            if (delta.images != null) {\n              for (const image of delta.images) {\n                controller.enqueue({\n                  type: \"file\",\n                  mediaType: getMediaType(image.image_url.url, \"image/jpeg\"),\n                  data: getBase64FromDataUrl(image.image_url.url)\n                });\n              }\n            }\n          },\n          flush(controller) {\n            const hasToolCalls = toolCalls.length > 0;\n            if (streamError != null) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: streamError });\n            }\n            const hasEncryptedReasoning = accumulatedReasoningDetails.some(\n              (d) => d.type === \"reasoning.encrypted\" /* Encrypted */ && d.data\n            );\n            if (hasToolCalls && hasEncryptedReasoning && finishReason.unified === \"stop\") {\n              finishReason = createFinishReason(\"tool-calls\", finishReason.raw);\n            }\n            if (hasToolCalls && finishReason.unified === \"other\") {\n              finishReason = createFinishReason(\"tool-calls\", finishReason.raw);\n            }\n            if (finishReason.unified === \"tool-calls\") {\n              for (const toolCall of toolCalls) {\n                if (toolCall && !toolCall.sent) {\n                  const input = isParsableJson(toolCall.function.arguments) ? toolCall.function.arguments : \"{}\";\n                  if (!toolCall.inputStarted) {\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: toolCall.id,\n                      toolName: toolCall.function.name\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id: toolCall.id,\n                      delta: input\n                    });\n                  }\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCall.id\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId: toolCall.id,\n                    toolName: toolCall.function.name,\n                    input,\n                    providerMetadata: !reasoningDetailsAttachedToToolCall ? {\n                      openrouter: {\n                        reasoning_details: accumulatedReasoningDetails\n                      }\n                    } : void 0\n                  });\n                  reasoningDetailsAttachedToToolCall = true;\n                  toolCall.sent = true;\n                }\n              }\n            }\n            if (reasoningStarted) {\n              controller.enqueue({\n                type: \"reasoning-end\",\n                id: reasoningId || generateId(),\n                // Always include accumulated reasoning_details so the AI SDK can\n                // update the reasoning part's providerMetadata.  An empty array is\n                // intentional — it signals the provider produced no reasoning tokens.\n                providerMetadata: {\n                  openrouter: {\n                    reasoning_details: accumulatedReasoningDetails\n                  }\n                }\n              });\n            }\n            if (textStarted) {\n              controller.enqueue({\n                type: \"text-end\",\n                id: textId || generateId()\n              });\n            }\n            const openrouterMetadata = {\n              usage: openrouterUsage\n            };\n            if (provider !== void 0) {\n              openrouterMetadata.provider = provider;\n            }\n            openrouterMetadata.reasoning_details = accumulatedReasoningDetails;\n            if (accumulatedFileAnnotations.length > 0) {\n              openrouterMetadata.annotations = accumulatedFileAnnotations;\n            }\n            if (usage.inputTokens.total === void 0 && openrouterUsage.promptTokens !== void 0) {\n              usage.inputTokens.total = openrouterUsage.promptTokens;\n            }\n            if (usage.outputTokens.total === void 0 && openrouterUsage.completionTokens !== void 0) {\n              usage.outputTokens.total = openrouterUsage.completionTokens;\n            }\n            usage.raw = rawUsage;\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage,\n              providerMetadata: {\n                openrouter: openrouterMetadata\n              }\n            });\n          }\n        })\n      ),\n      warnings: [],\n      request: { body: args },\n      response: { headers: responseHeaders }\n    };\n  }\n};\nfunction mapProviderTool(tool2) {\n  const [provider, toolName] = tool2.id.split(\".\");\n  const apiToolType = `${provider}:${toolName}`;\n  const mappedArgs = {};\n  for (const [key, value] of Object.entries(tool2.args)) {\n    if (value !== void 0) {\n      mappedArgs[camelToSnake(key)] = value;\n    }\n  }\n  return __spreadValues({\n    type: apiToolType\n  }, mappedArgs);\n}\nfunction camelToSnake(str) {\n  return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);\n}\n\n// src/completion/convert-to-openrouter-completion-prompt.ts\nfunction convertToOpenRouterCompletionPrompt({\n  prompt,\n  inputFormat,\n  user = \"user\",\n  assistant = \"assistant\"\n}) {\n  if (inputFormat === \"prompt\" && prompt.length === 1 && prompt[0] && prompt[0].role === \"user\" && prompt[0].content.length === 1 && prompt[0].content[0] && prompt[0].content[0].type === \"text\") {\n    return { prompt: prompt[0].content[0].text };\n  }\n  let text = \"\";\n  if (prompt[0] && prompt[0].role === \"system\") {\n    text += `${prompt[0].content}\n\n`;\n    prompt = prompt.slice(1);\n  }\n  for (const { role, content } of prompt) {\n    switch (role) {\n      case \"system\": {\n        throw new InvalidPromptError({\n          message: `Unexpected system message in prompt: ${content}`,\n          prompt\n        });\n      }\n      case \"user\": {\n        const userMessage = content.map((part) => {\n          switch (part.type) {\n            case \"text\": {\n              return part.text;\n            }\n            case \"file\": {\n              throw new UnsupportedFunctionalityError({\n                functionality: \"file attachments\"\n              });\n            }\n            default: {\n              return \"\";\n            }\n          }\n        }).join(\"\");\n        text += `${user}:\n${userMessage}\n\n`;\n        break;\n      }\n      case \"assistant\": {\n        const assistantMessage = content.map(\n          (part) => {\n            switch (part.type) {\n              case \"text\": {\n                return part.text;\n              }\n              case \"tool-call\": {\n                throw new UnsupportedFunctionalityError({\n                  functionality: \"tool-call messages\"\n                });\n              }\n              case \"tool-result\": {\n                throw new UnsupportedFunctionalityError({\n                  functionality: \"tool-result messages\"\n                });\n              }\n              case \"reasoning\": {\n                throw new UnsupportedFunctionalityError({\n                  functionality: \"reasoning messages\"\n                });\n              }\n              case \"file\": {\n                throw new UnsupportedFunctionalityError({\n                  functionality: \"file attachments\"\n                });\n              }\n              default: {\n                return \"\";\n              }\n            }\n          }\n        ).join(\"\");\n        text += `${assistant}:\n${assistantMessage}\n\n`;\n        break;\n      }\n      case \"tool\": {\n        throw new UnsupportedFunctionalityError({\n          functionality: \"tool messages\"\n        });\n      }\n      default: {\n        break;\n      }\n    }\n  }\n  text += `${assistant}:\n`;\n  return {\n    prompt: text\n  };\n}\n\n// src/completion/schemas.ts\nimport { z as z8 } from \"zod/v4\";\nvar OpenRouterCompletionChunkSchema = z8.union([\n  z8.object({\n    id: z8.string().optional(),\n    model: z8.string().optional(),\n    provider: z8.string().optional(),\n    choices: z8.array(\n      z8.object({\n        text: z8.string(),\n        reasoning: z8.string().nullish().optional(),\n        reasoning_details: ReasoningDetailArraySchema.nullish(),\n        finish_reason: z8.string().nullish(),\n        index: z8.number().nullish(),\n        logprobs: z8.object({\n          tokens: z8.array(z8.string()),\n          token_logprobs: z8.array(z8.number()),\n          top_logprobs: z8.array(z8.record(z8.string(), z8.number())).nullable()\n        }).passthrough().nullable().optional()\n      }).passthrough()\n    ),\n    usage: z8.object({\n      prompt_tokens: z8.number(),\n      prompt_tokens_details: z8.object({\n        cached_tokens: z8.number(),\n        cache_write_tokens: z8.number().nullish()\n      }).passthrough().nullish(),\n      completion_tokens: z8.number(),\n      completion_tokens_details: z8.object({\n        reasoning_tokens: z8.number()\n      }).passthrough().nullish(),\n      total_tokens: z8.number(),\n      cost: z8.number().optional(),\n      cost_details: z8.object({\n        upstream_inference_cost: z8.number().nullish()\n      }).passthrough().nullish()\n    }).passthrough().nullish()\n  }).passthrough(),\n  OpenRouterErrorResponseSchema\n]);\n\n// src/completion/index.ts\nvar OpenRouterCompletionLanguageModel = class {\n  constructor(modelId, settings, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"openrouter\";\n    this.supportsImageUrls = true;\n    this.supportedUrls = {\n      \"image/*\": [\n        /^data:image\\/[a-zA-Z]+;base64,/,\n        /^https?:\\/\\/.+\\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i\n      ],\n      \"text/*\": [/^data:text\\//, /^https?:\\/\\/.+$/],\n      \"application/*\": [/^data:application\\//, /^https?:\\/\\/.+$/]\n    };\n    this.defaultObjectGenerationMode = void 0;\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n  }\n  getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    frequencyPenalty,\n    presencePenalty,\n    seed,\n    responseFormat,\n    topK,\n    stopSequences,\n    tools,\n    toolChoice\n  }) {\n    const { prompt: completionPrompt } = convertToOpenRouterCompletionPrompt({\n      prompt,\n      inputFormat: \"prompt\"\n    });\n    if (tools == null ? void 0 : tools.length) {\n      throw new UnsupportedFunctionalityError({\n        functionality: \"tools\"\n      });\n    }\n    if (toolChoice) {\n      throw new UnsupportedFunctionalityError({\n        functionality: \"toolChoice\"\n      });\n    }\n    return __spreadValues(__spreadValues({\n      // model id:\n      model: this.modelId,\n      models: this.settings.models,\n      // model specific settings:\n      logit_bias: this.settings.logitBias,\n      logprobs: typeof this.settings.logprobs === \"number\" ? this.settings.logprobs : typeof this.settings.logprobs === \"boolean\" ? this.settings.logprobs ? 0 : void 0 : void 0,\n      suffix: this.settings.suffix,\n      user: this.settings.user,\n      // standardized settings (call-level options override model-level settings):\n      max_tokens: maxOutputTokens != null ? maxOutputTokens : this.settings.maxTokens,\n      temperature: temperature != null ? temperature : this.settings.temperature,\n      top_p: topP != null ? topP : this.settings.topP,\n      frequency_penalty: frequencyPenalty != null ? frequencyPenalty : this.settings.frequencyPenalty,\n      presence_penalty: presencePenalty != null ? presencePenalty : this.settings.presencePenalty,\n      seed,\n      stop: stopSequences,\n      response_format: responseFormat,\n      top_k: topK != null ? topK : this.settings.topK,\n      // prompt:\n      prompt: completionPrompt,\n      // OpenRouter specific settings:\n      include_reasoning: this.settings.includeReasoning,\n      reasoning: this.settings.reasoning\n    }, this.config.extraBody), this.settings.extraBody);\n  }\n  async doGenerate(options) {\n    var _a16, _b16, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;\n    const providerOptions = options.providerOptions || {};\n    const openrouterOptions = providerOptions.openrouter || {};\n    const args = __spreadValues(__spreadValues({}, this.getArgs(options)), openrouterOptions);\n    const { value: response, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body: args,\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        OpenRouterCompletionChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    if (\"error\" in response) {\n      const errorData = response.error;\n      throw new APICallError({\n        message: errorData.message,\n        url: this.config.url({\n          path: \"/completions\",\n          modelId: this.modelId\n        }),\n        requestBodyValues: args,\n        statusCode: 200,\n        responseHeaders,\n        data: errorData\n      });\n    }\n    const choice = response.choices[0];\n    if (!choice) {\n      throw new NoContentGeneratedError({\n        message: \"No choice in OpenRouter completion response\"\n      });\n    }\n    return {\n      content: [\n        {\n          type: \"text\",\n          text: (_a16 = choice.text) != null ? _a16 : \"\"\n        }\n      ],\n      finishReason: mapOpenRouterFinishReason(choice.finish_reason),\n      usage: response.usage ? computeTokenUsage(response.usage) : emptyUsage(),\n      warnings: [],\n      providerMetadata: {\n        openrouter: OpenRouterProviderMetadataSchema.parse({\n          provider: (_b16 = response.provider) != null ? _b16 : \"\",\n          usage: __spreadValues(__spreadValues(__spreadValues(__spreadValues({\n            promptTokens: (_d = (_c = response.usage) == null ? void 0 : _c.prompt_tokens) != null ? _d : 0,\n            completionTokens: (_f = (_e = response.usage) == null ? void 0 : _e.completion_tokens) != null ? _f : 0,\n            totalTokens: ((_h = (_g = response.usage) == null ? void 0 : _g.prompt_tokens) != null ? _h : 0) + ((_j = (_i = response.usage) == null ? void 0 : _i.completion_tokens) != null ? _j : 0)\n          }, ((_k = response.usage) == null ? void 0 : _k.cost) != null ? { cost: response.usage.cost } : {}), ((_m = (_l = response.usage) == null ? void 0 : _l.prompt_tokens_details) == null ? void 0 : _m.cached_tokens) != null ? {\n            promptTokensDetails: {\n              cachedTokens: response.usage.prompt_tokens_details.cached_tokens\n            }\n          } : {}), ((_o = (_n = response.usage) == null ? void 0 : _n.completion_tokens_details) == null ? void 0 : _o.reasoning_tokens) != null ? {\n            completionTokensDetails: {\n              reasoningTokens: response.usage.completion_tokens_details.reasoning_tokens\n            }\n          } : {}), ((_q = (_p = response.usage) == null ? void 0 : _p.cost_details) == null ? void 0 : _q.upstream_inference_cost) != null ? {\n            costDetails: {\n              upstreamInferenceCost: response.usage.cost_details.upstream_inference_cost\n            }\n          } : {})\n        })\n      },\n      response: {\n        headers: responseHeaders\n      }\n    };\n  }\n  async doStream(options) {\n    const providerOptions = options.providerOptions || {};\n    const openrouterOptions = providerOptions.openrouter || {};\n    const args = __spreadValues(__spreadValues({}, this.getArgs(options)), openrouterOptions);\n    const { value: response, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/completions\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body: __spreadProps(__spreadValues({}, args), {\n        stream: true,\n        // only include stream_options when in strict compatibility mode:\n        stream_options: this.config.compatibility === \"strict\" ? { include_usage: true } : void 0\n      }),\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        OpenRouterCompletionChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let streamError;\n    const safeResponse = withStreamErrorHandling(response, (err) => {\n      streamError = err;\n    });\n    let finishReason = createFinishReason(\"other\");\n    const usage = {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n    const openrouterUsage = {};\n    let provider;\n    let rawUsage;\n    return {\n      stream: safeResponse.pipeThrough(\n        new TransformStream({\n          transform(chunk, controller) {\n            var _a16, _b16, _c, _d, _e;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (\"error\" in value) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: value.error });\n              return;\n            }\n            if (value.provider) {\n              provider = value.provider;\n            }\n            if (value.usage != null) {\n              const computed = computeTokenUsage(value.usage);\n              Object.assign(usage.inputTokens, computed.inputTokens);\n              Object.assign(usage.outputTokens, computed.outputTokens);\n              rawUsage = value.usage;\n              const promptTokens = (_a16 = value.usage.prompt_tokens) != null ? _a16 : 0;\n              const completionTokens = (_b16 = value.usage.completion_tokens) != null ? _b16 : 0;\n              openrouterUsage.promptTokens = promptTokens;\n              if (value.usage.prompt_tokens_details) {\n                openrouterUsage.promptTokensDetails = {\n                  cachedTokens: (_c = value.usage.prompt_tokens_details.cached_tokens) != null ? _c : 0\n                };\n              }\n              openrouterUsage.completionTokens = completionTokens;\n              if (value.usage.completion_tokens_details) {\n                openrouterUsage.completionTokensDetails = {\n                  reasoningTokens: (_d = value.usage.completion_tokens_details.reasoning_tokens) != null ? _d : 0\n                };\n              }\n              if (value.usage.cost != null) {\n                openrouterUsage.cost = value.usage.cost;\n              }\n              openrouterUsage.totalTokens = value.usage.total_tokens;\n              const upstreamInferenceCost = (_e = value.usage.cost_details) == null ? void 0 : _e.upstream_inference_cost;\n              if (upstreamInferenceCost != null) {\n                openrouterUsage.costDetails = {\n                  upstreamInferenceCost\n                };\n              }\n            }\n            const choice = value.choices[0];\n            if ((choice == null ? void 0 : choice.finish_reason) != null) {\n              finishReason = mapOpenRouterFinishReason(choice.finish_reason);\n            }\n            if ((choice == null ? void 0 : choice.text) != null) {\n              controller.enqueue({\n                type: \"text-delta\",\n                delta: choice.text,\n                id: generateId()\n              });\n            }\n          },\n          flush(controller) {\n            if (streamError != null) {\n              finishReason = createFinishReason(\"error\");\n              controller.enqueue({ type: \"error\", error: streamError });\n            }\n            usage.raw = rawUsage;\n            const openrouterMetadata = {\n              usage: openrouterUsage\n            };\n            if (provider !== void 0) {\n              openrouterMetadata.provider = provider;\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage,\n              providerMetadata: {\n                openrouter: openrouterMetadata\n              }\n            });\n          }\n        })\n      ),\n      response: {\n        headers: responseHeaders\n      }\n    };\n  }\n};\n\n// src/embedding/schemas.ts\nimport { z as z9 } from \"zod/v4\";\nvar openrouterEmbeddingUsageSchema = z9.object({\n  prompt_tokens: z9.number(),\n  total_tokens: z9.number(),\n  cost: z9.number().optional()\n});\nvar openrouterEmbeddingDataSchema = z9.object({\n  object: z9.literal(\"embedding\"),\n  embedding: z9.array(z9.number()),\n  index: z9.number().optional()\n});\nvar OpenRouterEmbeddingResponseSchema = z9.object({\n  id: z9.string().optional(),\n  object: z9.literal(\"list\"),\n  data: z9.array(openrouterEmbeddingDataSchema),\n  model: z9.string(),\n  provider: z9.string().optional(),\n  usage: openrouterEmbeddingUsageSchema.optional()\n});\n\n// src/embedding/index.ts\nvar OpenRouterEmbeddingModel = class {\n  constructor(modelId, settings, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"openrouter\";\n    this.maxEmbeddingsPerCall = void 0;\n    this.supportsParallelCalls = true;\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n  }\n  async doEmbed(options) {\n    var _a16, _b16, _c, _d, _e, _f;\n    const { values, abortSignal, headers } = options;\n    const args = __spreadValues(__spreadValues({\n      model: this.modelId,\n      input: values,\n      user: this.settings.user,\n      provider: this.settings.provider\n    }, this.config.extraBody), this.settings.extraBody);\n    const { value: responseValue, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/embeddings\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), headers),\n      body: args,\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        OpenRouterEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      embeddings: responseValue.data.map((item) => item.embedding),\n      usage: responseValue.usage ? { tokens: responseValue.usage.prompt_tokens } : void 0,\n      providerMetadata: {\n        openrouter: OpenRouterProviderMetadataSchema.parse({\n          provider: (_a16 = responseValue.provider) != null ? _a16 : \"\",\n          usage: __spreadValues({\n            promptTokens: (_c = (_b16 = responseValue.usage) == null ? void 0 : _b16.prompt_tokens) != null ? _c : 0,\n            completionTokens: 0,\n            totalTokens: (_e = (_d = responseValue.usage) == null ? void 0 : _d.total_tokens) != null ? _e : 0\n          }, ((_f = responseValue.usage) == null ? void 0 : _f.cost) != null ? { cost: responseValue.usage.cost } : {})\n        })\n      },\n      response: {\n        headers: responseHeaders,\n        body: responseValue\n      },\n      warnings: []\n    };\n  }\n};\n\n// src/facade.ts\nvar OpenRouter = class {\n  /**\n   * Creates a new OpenRouter provider instance.\n   */\n  constructor(options = {}) {\n    var _a16, _b16;\n    this.baseURL = (_b16 = withoutTrailingSlash((_a16 = options.baseURL) != null ? _a16 : options.baseUrl)) != null ? _b16 : \"https://openrouter.ai/api/v1\";\n    this.apiKey = options.apiKey;\n    this.headers = options.headers;\n    this.api_keys = options.api_keys;\n    this.appName = options.appName;\n    this.appUrl = options.appUrl;\n  }\n  get baseConfig() {\n    return {\n      baseURL: this.baseURL,\n      headers: () => __spreadValues(__spreadValues(__spreadValues(__spreadValues({\n        Authorization: `Bearer ${loadApiKey({\n          apiKey: this.apiKey,\n          environmentVariableName: \"OPENROUTER_API_KEY\",\n          description: \"OpenRouter\"\n        })}`\n      }, this.appName && { \"X-OpenRouter-Title\": this.appName }), this.appUrl && { \"HTTP-Referer\": this.appUrl }), this.headers), this.api_keys && Object.keys(this.api_keys).length > 0 && {\n        \"X-Provider-API-Keys\": JSON.stringify(this.api_keys)\n      })\n    };\n  }\n  chat(modelId, settings = {}) {\n    return new OpenRouterChatLanguageModel(modelId, settings, __spreadProps(__spreadValues({\n      provider: \"openrouter.chat\"\n    }, this.baseConfig), {\n      compatibility: \"strict\",\n      url: ({ path }) => `${this.baseURL}${path}`\n    }));\n  }\n  completion(modelId, settings = {}) {\n    return new OpenRouterCompletionLanguageModel(modelId, settings, __spreadProps(__spreadValues({\n      provider: \"openrouter.completion\"\n    }, this.baseConfig), {\n      compatibility: \"strict\",\n      url: ({ path }) => `${this.baseURL}${path}`\n    }));\n  }\n  textEmbeddingModel(modelId, settings = {}) {\n    return new OpenRouterEmbeddingModel(modelId, settings, __spreadProps(__spreadValues({\n      provider: \"openrouter.embedding\"\n    }, this.baseConfig), {\n      url: ({ path }) => `${this.baseURL}${path}`\n    }));\n  }\n  /**\n   * @deprecated Use textEmbeddingModel instead\n   */\n  embedding(modelId, settings = {}) {\n    return this.textEmbeddingModel(modelId, settings);\n  }\n};\n\n// src/image/schemas.ts\nimport { z as z10 } from \"zod/v4\";\nvar OpenRouterImageResponseSchema = z10.object({\n  created: z10.number().optional(),\n  data: z10.array(\n    z10.object({\n      b64_json: z10.string()\n    }).passthrough()\n  ),\n  usage: z10.object({\n    prompt_tokens: z10.number(),\n    completion_tokens: z10.number(),\n    total_tokens: z10.number()\n  }).passthrough().optional()\n}).passthrough();\n\n// src/image/index.ts\nvar OpenRouterImageModel = class {\n  constructor(modelId, settings, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"openrouter\";\n    this.maxImagesPerCall = 10;\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n  }\n  async doGenerate(options) {\n    const {\n      prompt,\n      n,\n      size,\n      aspectRatio,\n      seed,\n      files,\n      mask,\n      abortSignal,\n      headers,\n      providerOptions\n    } = options;\n    const openrouterOptions = (providerOptions == null ? void 0 : providerOptions.openrouter) || {};\n    const warnings = [];\n    if (mask !== void 0) {\n      throw new UnsupportedFunctionalityError({\n        functionality: \"image inpainting (mask parameter)\"\n      });\n    }\n    const hasFiles = files !== void 0 && files.length > 0;\n    const inputReferences = hasFiles ? files.map((file) => convertFileToInputReference(file)) : void 0;\n    const body = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({\n      model: this.modelId,\n      prompt: prompt != null ? prompt : \"\"\n    }, n !== void 0 && { n }), size !== void 0 && { size }), aspectRatio !== void 0 && { aspect_ratio: aspectRatio }), seed !== void 0 && { seed }), inputReferences !== void 0 && {\n      input_references: inputReferences\n    }), this.settings.user !== void 0 && { user: this.settings.user }), this.settings.provider !== void 0 && {\n      provider: this.settings.provider\n    }), this.config.extraBody), this.settings.extraBody), openrouterOptions);\n    const { value: responseValue, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/images\",\n        modelId: this.modelId\n      }),\n      headers: combineHeaders(this.config.headers(), headers),\n      body,\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        OpenRouterImageResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    if (!responseValue.data || responseValue.data.length === 0) {\n      throw new NoContentGeneratedError({\n        message: \"No images in response\"\n      });\n    }\n    const images = responseValue.data.map((item) => item.b64_json);\n    const usage = responseValue.usage ? {\n      inputTokens: responseValue.usage.prompt_tokens,\n      outputTokens: responseValue.usage.completion_tokens,\n      totalTokens: responseValue.usage.total_tokens\n    } : void 0;\n    return {\n      images,\n      warnings,\n      response: {\n        timestamp: /* @__PURE__ */ new Date(),\n        modelId: this.modelId,\n        headers: responseHeaders\n      },\n      usage\n    };\n  }\n};\nvar DEFAULT_IMAGE_MEDIA_TYPE = \"image/png\";\nfunction convertFileToInputReference(file) {\n  if (file.type === \"url\") {\n    return {\n      type: \"image_url\",\n      image_url: { url: file.url }\n    };\n  }\n  const url = buildFileDataUrl({\n    data: file.data,\n    mediaType: file.mediaType,\n    defaultMediaType: DEFAULT_IMAGE_MEDIA_TYPE\n  });\n  return {\n    type: \"image_url\",\n    image_url: { url }\n  };\n}\n\n// src/tool/web-search.ts\nimport { z as z11 } from \"zod/v4\";\nvar webSearchInputSchema = z11.object({\n  /** Search results returned by the server tool */\n  results: z11.array(z11.unknown()).optional()\n});\nvar webSearch = createProviderToolFactory({\n  id: \"openrouter.web_search\",\n  inputSchema: webSearchInputSchema\n});\n\n// src/utils/remove-undefined.ts\nfunction removeUndefinedEntries(record) {\n  return Object.fromEntries(\n    Object.entries(record).filter(([, value]) => value != null)\n  );\n}\n\n// src/utils/with-user-agent-suffix.ts\nfunction normalizeHeaders2(headers) {\n  if (!headers) {\n    return {};\n  }\n  if (headers instanceof Headers) {\n    return Object.fromEntries(headers.entries());\n  }\n  if (Array.isArray(headers)) {\n    return Object.fromEntries(headers);\n  }\n  return headers;\n}\nfunction findHeaderKey(headers, targetKey) {\n  const lowerTarget = targetKey.toLowerCase();\n  return Object.keys(headers).find((key) => key.toLowerCase() === lowerTarget);\n}\nfunction withUserAgentSuffix2(headers, ...userAgentSuffixParts) {\n  const normalizedHeaders = normalizeHeaders2(headers);\n  const cleanedHeaders = removeUndefinedEntries(normalizedHeaders);\n  const existingUserAgentKey = findHeaderKey(cleanedHeaders, \"user-agent\");\n  const existingUserAgentValue = existingUserAgentKey ? cleanedHeaders[existingUserAgentKey] : void 0;\n  const userAgent = (existingUserAgentValue == null ? void 0 : existingUserAgentValue.trim()) ? existingUserAgentValue : userAgentSuffixParts.filter(Boolean).join(\" \");\n  const headersWithoutUserAgent = Object.fromEntries(\n    Object.entries(cleanedHeaders).filter(\n      ([key]) => key.toLowerCase() !== \"user-agent\"\n    )\n  );\n  return __spreadProps(__spreadValues({}, headersWithoutUserAgent), {\n    \"user-agent\": userAgent\n  });\n}\n\n// src/version.ts\nvar VERSION2 = false ? \"0.0.0-test\" : \"2.10.0\";\n\n// src/video/schemas.ts\nimport { z as z12 } from \"zod/v4\";\nvar VideoGenerationSubmitResponseSchema = z12.object({\n  id: z12.string(),\n  generation_id: z12.string().optional(),\n  polling_url: z12.string(),\n  status: z12.string()\n}).passthrough();\nvar VideoGenerationPollResponseSchema = z12.object({\n  id: z12.string(),\n  generation_id: z12.string().optional(),\n  polling_url: z12.string(),\n  status: z12.string(),\n  unsigned_urls: z12.array(z12.string()).optional(),\n  usage: z12.object({\n    cost: z12.number().optional(),\n    is_byok: z12.boolean().optional()\n  }).passthrough().optional(),\n  error: z12.string().optional()\n}).passthrough();\n\n// src/video/index.ts\nvar DEFAULT_POLL_INTERVAL_MS = 2e3;\nvar DEFAULT_MAX_POLL_TIME_MS = 6e5;\nvar OpenRouterVideoModel = class {\n  constructor(modelId, settings, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"openrouter\";\n    this.maxVideosPerCall = 1;\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n  }\n  async doGenerate(options) {\n    var _a16, _b16, _c, _d, _e;\n    const {\n      prompt,\n      n,\n      aspectRatio,\n      resolution,\n      duration,\n      seed,\n      image,\n      abortSignal,\n      headers,\n      providerOptions\n    } = options;\n    const warnings = [];\n    if (n > 1) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"n > 1\",\n        details: `OpenRouter video generation returns 1 video per call. Requested ${n} videos.`\n      });\n    }\n    const body = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({\n      model: this.modelId,\n      prompt: prompt != null ? prompt : \"\"\n    }, aspectRatio !== void 0 && { aspect_ratio: aspectRatio }), resolution !== void 0 && { size: resolution }), duration !== void 0 && { duration }), seed !== void 0 && { seed }), this.settings.generateAudio !== void 0 && {\n      generate_audio: this.settings.generateAudio\n    }), image !== void 0 && {\n      frame_images: [convertImageToFrameImage(image)]\n    }), this.config.extraBody), this.settings.extraBody), providerOptions.openrouter);\n    const mergedHeaders = combineHeaders(this.config.headers(), headers);\n    const { value: submitResponse, responseHeaders } = await postJsonToApi({\n      url: this.config.url({\n        path: \"/videos\",\n        modelId: this.modelId\n      }),\n      headers: mergedHeaders,\n      body,\n      failedResponseHandler: openrouterFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        VideoGenerationSubmitResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    const pollIntervalMs = (_a16 = this.settings.pollIntervalMs) != null ? _a16 : DEFAULT_POLL_INTERVAL_MS;\n    const maxPollTimeMs = (_b16 = this.settings.maxPollTimeMs) != null ? _b16 : DEFAULT_MAX_POLL_TIME_MS;\n    const pollResult = await this.pollUntilComplete({\n      jobId: submitResponse.id,\n      headers: mergedHeaders,\n      abortSignal,\n      pollIntervalMs,\n      maxPollTimeMs\n    });\n    const videos = [];\n    if (pollResult.unsigned_urls) {\n      for (const url of pollResult.unsigned_urls) {\n        videos.push({\n          type: \"url\",\n          url,\n          mediaType: \"video/mp4\"\n        });\n      }\n    }\n    const providerMetadata = {\n      openrouter: {\n        generationId: (_c = pollResult.generation_id) != null ? _c : null,\n        cost: (_e = (_d = pollResult.usage) == null ? void 0 : _d.cost) != null ? _e : null\n      }\n    };\n    return {\n      videos,\n      warnings,\n      providerMetadata,\n      response: {\n        timestamp: /* @__PURE__ */ new Date(),\n        modelId: this.modelId,\n        headers: responseHeaders\n      }\n    };\n  }\n  async pollUntilComplete({\n    jobId,\n    headers,\n    abortSignal,\n    pollIntervalMs,\n    maxPollTimeMs\n  }) {\n    var _a16;\n    const startTime = Date.now();\n    while (Date.now() - startTime < maxPollTimeMs) {\n      abortSignal == null ? void 0 : abortSignal.throwIfAborted();\n      await delay(pollIntervalMs);\n      abortSignal == null ? void 0 : abortSignal.throwIfAborted();\n      const { value: pollResponse } = await getFromApi({\n        url: this.config.url({\n          path: `/videos/${jobId}`,\n          modelId: this.modelId\n        }),\n        headers,\n        failedResponseHandler: openrouterFailedResponseHandler,\n        successfulResponseHandler: createJsonResponseHandler(\n          VideoGenerationPollResponseSchema\n        ),\n        abortSignal,\n        fetch: this.config.fetch\n      });\n      if (pollResponse.status === \"completed\") {\n        return {\n          generation_id: pollResponse.generation_id,\n          unsigned_urls: pollResponse.unsigned_urls,\n          usage: pollResponse.usage\n        };\n      }\n      if (pollResponse.status === \"failed\" || pollResponse.status === \"dead\" || pollResponse.status === \"cancelled\" || pollResponse.status === \"expired\") {\n        throw new APICallError({\n          message: (_a16 = pollResponse.error) != null ? _a16 : `Video generation failed with status: ${pollResponse.status}`,\n          url: this.config.url({\n            path: `/videos/${jobId}`,\n            modelId: this.modelId\n          }),\n          requestBodyValues: {},\n          statusCode: 500,\n          isRetryable: false\n        });\n      }\n    }\n    throw new APICallError({\n      message: `Video generation timed out after ${maxPollTimeMs}ms`,\n      url: this.config.url({\n        path: `/videos/${jobId}`,\n        modelId: this.modelId\n      }),\n      requestBodyValues: {},\n      statusCode: 408,\n      isRetryable: true\n    });\n  }\n};\nfunction convertImageToFrameImage(file) {\n  if (file.type === \"url\") {\n    return {\n      type: \"image_url\",\n      image_url: { url: file.url },\n      frame_type: \"first_frame\"\n    };\n  }\n  const url = buildFileDataUrl({\n    data: file.data,\n    mediaType: file.mediaType,\n    defaultMediaType: \"image/png\"\n  });\n  return {\n    type: \"image_url\",\n    image_url: { url },\n    frame_type: \"first_frame\"\n  };\n}\n\n// src/provider.ts\nfunction createOpenRouter(options = {}) {\n  var _a16, _b16, _c;\n  const baseURL = (_b16 = withoutTrailingSlash((_a16 = options.baseURL) != null ? _a16 : options.baseUrl)) != null ? _b16 : \"https://openrouter.ai/api/v1\";\n  const compatibility = (_c = options.compatibility) != null ? _c : \"compatible\";\n  const getHeaders = () => withUserAgentSuffix2(\n    __spreadValues(__spreadValues(__spreadValues(__spreadValues({\n      Authorization: `Bearer ${loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"OPENROUTER_API_KEY\",\n        description: \"OpenRouter\"\n      })}`\n    }, options.appName && { \"X-OpenRouter-Title\": options.appName }), options.appUrl && { \"HTTP-Referer\": options.appUrl }), options.headers), options.api_keys && Object.keys(options.api_keys).length > 0 && {\n      \"X-Provider-API-Keys\": JSON.stringify(options.api_keys)\n    }),\n    `ai-sdk/openrouter/${VERSION2}`\n  );\n  const createChatModel = (modelId, settings = {}) => new OpenRouterChatLanguageModel(modelId, settings, {\n    provider: \"openrouter.chat\",\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    compatibility,\n    fetch: options.fetch,\n    extraBody: options.extraBody\n  });\n  const createCompletionModel = (modelId, settings = {}) => new OpenRouterCompletionLanguageModel(modelId, settings, {\n    provider: \"openrouter.completion\",\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    compatibility,\n    fetch: options.fetch,\n    extraBody: options.extraBody\n  });\n  const createEmbeddingModel = (modelId, settings = {}) => new OpenRouterEmbeddingModel(modelId, settings, {\n    provider: \"openrouter.embedding\",\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch,\n    extraBody: options.extraBody\n  });\n  const createImageModel = (modelId, settings = {}) => new OpenRouterImageModel(modelId, settings, {\n    provider: \"openrouter.image\",\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch,\n    extraBody: options.extraBody\n  });\n  const createVideoModel = (modelId, settings = {}) => new OpenRouterVideoModel(modelId, settings, {\n    provider: \"openrouter.video\",\n    url: ({ path }) => `${baseURL}${path}`,\n    headers: getHeaders,\n    fetch: options.fetch,\n    extraBody: options.extraBody\n  });\n  const createLanguageModel = (modelId, settings) => {\n    if (new.target) {\n      throw new Error(\n        \"The OpenRouter model function cannot be called with the new keyword.\"\n      );\n    }\n    if (modelId === \"openai/gpt-3.5-turbo-instruct\") {\n      return createCompletionModel(\n        modelId,\n        settings\n      );\n    }\n    return createChatModel(modelId, settings);\n  };\n  const provider = (modelId, settings) => createLanguageModel(modelId, settings);\n  provider.languageModel = createLanguageModel;\n  provider.chat = createChatModel;\n  provider.completion = createCompletionModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.embedding = createEmbeddingModel;\n  provider.imageModel = createImageModel;\n  provider.videoModel = createVideoModel;\n  provider.tools = {\n    webSearch\n  };\n  return provider;\n}\nvar openrouter = createOpenRouter({\n  compatibility: \"strict\"\n  // strict for OpenRouter API\n});\nexport {\n  OpenRouter,\n  createOpenRouter,\n  openrouter\n};\n//# sourceMappingURL=index.mjs.map","declare const __MASTRA_VERSION__: string;\n\nexport const MASTRA_USER_AGENT = typeof __MASTRA_VERSION__ !== 'undefined' ? `mastra/${__MASTRA_VERSION__}` : 'mastra';\n\n// anything in this list will use the corresponding ai sdk package instead of using openai-compat endpoints\nexport const PROVIDERS_WITH_INSTALLED_PACKAGES = [\n  'anthropic',\n  'cerebras',\n  'deepinfra',\n  'deepseek',\n  'google',\n  'groq',\n  'mistral',\n  'openai',\n  'openrouter',\n  'perplexity',\n  'togetherai',\n  'vercel',\n  'xai',\n];\n\n// anything here doesn't show up in model router. for now that's just copilot which requires a special oauth flow\nexport const EXCLUDED_PROVIDERS = ['github-copilot'];\n\n// Header used to pass gateway API key when Authorization is occupied by an OAuth token\nexport const GATEWAY_AUTH_HEADER = 'X-Memory-Gateway-Authorization';\n","//#region src/errors/ai-sdk-error.ts\n/**\n* Symbol used for identifying AI SDK Error instances.\n* Enables checking if an error is an instance of AISDKError across package versions.\n*/\nconst marker$18 = \"vercel.ai.error\";\nconst symbol$18 = Symbol.for(marker$18);\n/**\n* Custom error class for AI SDK related errors.\n* @extends Error\n*/\nvar AISDKError = class AISDKError extends Error {\n\t/**\n\t* Creates an AI SDK Error.\n\t*\n\t* @param {Object} params - The parameters for creating the error.\n\t* @param {string} params.name - The name of the error.\n\t* @param {string} params.message - The error message.\n\t* @param {unknown} [params.cause] - The underlying cause of the error.\n\t*/\n\tconstructor({ name, message, cause }) {\n\t\tsuper(message);\n\t\tthis[symbol$18] = true;\n\t\tthis.name = name;\n\t\tthis.cause = cause;\n\t}\n\t/**\n\t* Checks if the given error is an AI SDK Error.\n\t* @param {unknown} error - The error to check.\n\t* @returns {boolean} True if the error is an AI SDK Error, false otherwise.\n\t*/\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$18);\n\t}\n\tstatic hasMarker(error, marker) {\n\t\tconst markerSymbol = Symbol.for(marker);\n\t\treturn error != null && typeof error === \"object\" && markerSymbol in error && typeof error[markerSymbol] === \"boolean\" && error[markerSymbol] === true;\n\t}\n};\n//#endregion\n//#region src/errors/decision-unsupported-question-type-error.ts\nconst name$17 = \"AI_DecisionUnsupportedQuestionTypeError\";\nconst marker$17 = `vercel.ai.error.${name$17}`;\nconst symbol$17 = Symbol.for(marker$17);\n/**\n* A decision model does not support the type of a requested question.\n*/\nvar DecisionUnsupportedQuestionTypeError = class extends AISDKError {\n\tconstructor({ questionId, questionType, provider, modelId, message = `Question \"${questionId}\" has type \"${questionType}\", which is not supported by provider \"${provider}\" and model \"${modelId}\".` }) {\n\t\tsuper({\n\t\t\tname: name$17,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$17] = true;\n\t\tthis.questionId = questionId;\n\t\tthis.questionType = questionType;\n\t\tthis.provider = provider;\n\t\tthis.modelId = modelId;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$17);\n\t}\n};\n//#endregion\n//#region src/errors/api-call-error.ts\nconst name$16 = \"AI_APICallError\";\nconst marker$16 = `vercel.ai.error.${name$16}`;\nconst symbol$16 = Symbol.for(marker$16);\nvar APICallError = class extends AISDKError {\n\tconstructor({ message, url, requestBodyValues, statusCode, responseHeaders, responseBody, cause, isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500), data }) {\n\t\tsuper({\n\t\t\tname: name$16,\n\t\t\tmessage,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$16] = true;\n\t\tthis.url = url;\n\t\tthis.requestBodyValues = requestBodyValues;\n\t\tthis.statusCode = statusCode;\n\t\tthis.responseHeaders = responseHeaders;\n\t\tthis.responseBody = responseBody;\n\t\tthis.isRetryable = isRetryable;\n\t\tthis.data = data;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$16);\n\t}\n};\n//#endregion\n//#region src/errors/empty-response-body-error.ts\nconst name$15 = \"AI_EmptyResponseBodyError\";\nconst marker$15 = `vercel.ai.error.${name$15}`;\nconst symbol$15 = Symbol.for(marker$15);\nvar EmptyResponseBodyError = class extends AISDKError {\n\tconstructor({ message = \"Empty response body\" } = {}) {\n\t\tsuper({\n\t\t\tname: name$15,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$15] = true;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$15);\n\t}\n};\n//#endregion\n//#region src/errors/decision-refusal-error.ts\nconst name$14 = \"AI_DecisionRefusalError\";\nconst marker$14 = `vercel.ai.error.${name$14}`;\nconst symbol$14 = Symbol.for(marker$14);\n/**\n* A decision model declined to answer one or more questions.\n*/\nvar DecisionRefusalError = class extends AISDKError {\n\tconstructor({ questionIds, provider, modelId, message = `Decision model \"${modelId}\" from provider \"${provider}\" refused ${questionIds.length === 1 ? \"question\" : \"questions\"} ${questionIds.map((id) => JSON.stringify(id)).join(\", \")}.` }) {\n\t\tsuper({\n\t\t\tname: name$14,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$14] = true;\n\t\tthis.questionIds = questionIds;\n\t\tthis.provider = provider;\n\t\tthis.modelId = modelId;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$14);\n\t}\n};\n//#endregion\n//#region src/errors/extraction-refusal-error.ts\nconst name$13 = \"AI_ExtractionRefusalError\";\nconst marker$13 = `vercel.ai.error.${name$13}`;\nconst symbol$13 = Symbol.for(marker$13);\n/**\n* An extraction model declined to extract one or more fields.\n*/\nvar ExtractionRefusalError = class extends AISDKError {\n\tconstructor({ fieldIds, provider, modelId, message = `Extraction model \"${modelId}\" from provider \"${provider}\" refused ${fieldIds.length === 1 ? \"field\" : \"fields\"} ${fieldIds.map((id) => JSON.stringify(id)).join(\", \")}.` }) {\n\t\tsuper({\n\t\t\tname: name$13,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$13] = true;\n\t\tthis.fieldIds = fieldIds;\n\t\tthis.provider = provider;\n\t\tthis.modelId = modelId;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$13);\n\t}\n};\n//#endregion\n//#region src/errors/extraction-unsupported-field-type-error.ts\nconst name$12 = \"AI_ExtractionUnsupportedFieldTypeError\";\nconst marker$12 = `vercel.ai.error.${name$12}`;\nconst symbol$12 = Symbol.for(marker$12);\n/**\n* An extraction model does not support the type of a requested field.\n*/\nvar ExtractionUnsupportedFieldTypeError = class extends AISDKError {\n\tconstructor({ fieldId, fieldType, provider, modelId, message = `Field \"${fieldId}\" has type \"${fieldType}\", which is not supported by provider \"${provider}\" and model \"${modelId}\".` }) {\n\t\tsuper({\n\t\t\tname: name$12,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$12] = true;\n\t\tthis.fieldId = fieldId;\n\t\tthis.fieldType = fieldType;\n\t\tthis.provider = provider;\n\t\tthis.modelId = modelId;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$12);\n\t}\n};\n//#endregion\n//#region src/errors/get-error-message.ts\nfunction getErrorMessage(error) {\n\tif (error == null) return \"unknown error\";\n\tif (typeof error === \"string\") return error;\n\tif (error instanceof Error) return error.toString();\n\treturn JSON.stringify(error);\n}\n//#endregion\n//#region src/errors/invalid-argument-error.ts\nconst name$11 = \"AI_InvalidArgumentError\";\nconst marker$11 = `vercel.ai.error.${name$11}`;\nconst symbol$11 = Symbol.for(marker$11);\n/**\n* A function argument is invalid.\n*/\nvar InvalidArgumentError = class extends AISDKError {\n\tconstructor({ message, cause, argument }) {\n\t\tsuper({\n\t\t\tname: name$11,\n\t\t\tmessage,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$11] = true;\n\t\tthis.argument = argument;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$11);\n\t}\n};\n//#endregion\n//#region src/errors/invalid-prompt-error.ts\nconst name$10 = \"AI_InvalidPromptError\";\nconst marker$10 = `vercel.ai.error.${name$10}`;\nconst symbol$10 = Symbol.for(marker$10);\n/**\n* A prompt is invalid. This error should be thrown by providers when they cannot\n* process a prompt.\n*/\nvar InvalidPromptError = class extends AISDKError {\n\tconstructor({ prompt, message, cause }) {\n\t\tsuper({\n\t\t\tname: name$10,\n\t\t\tmessage: `Invalid prompt: ${message}`,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$10] = true;\n\t\tthis.prompt = prompt;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$10);\n\t}\n};\n//#endregion\n//#region src/errors/invalid-response-data-error.ts\nconst name$9 = \"AI_InvalidResponseDataError\";\nconst marker$9 = `vercel.ai.error.${name$9}`;\nconst symbol$9 = Symbol.for(marker$9);\n/**\n* Server returned a response with invalid data content.\n* This should be thrown by providers when they cannot parse the response from the API.\n*/\nvar InvalidResponseDataError = class extends AISDKError {\n\tconstructor({ data, message = `Invalid response data: ${JSON.stringify(data)}.` }) {\n\t\tsuper({\n\t\t\tname: name$9,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$9] = true;\n\t\tthis.data = data;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$9);\n\t}\n};\n//#endregion\n//#region src/errors/json-parse-error.ts\nconst name$8 = \"AI_JSONParseError\";\nconst marker$8 = `vercel.ai.error.${name$8}`;\nconst symbol$8 = Symbol.for(marker$8);\nvar JSONParseError = class extends AISDKError {\n\tconstructor({ text, cause }) {\n\t\tsuper({\n\t\t\tname: name$8,\n\t\t\tmessage: `JSON parsing failed: Text: ${text}.\\nError message: ${getErrorMessage(cause)}`,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$8] = true;\n\t\tthis.text = text;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$8);\n\t}\n};\n//#endregion\n//#region src/errors/load-api-key-error.ts\nconst name$7 = \"AI_LoadAPIKeyError\";\nconst marker$7 = `vercel.ai.error.${name$7}`;\nconst symbol$7 = Symbol.for(marker$7);\nvar LoadAPIKeyError = class extends AISDKError {\n\tconstructor({ message }) {\n\t\tsuper({\n\t\t\tname: name$7,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$7] = true;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$7);\n\t}\n};\n//#endregion\n//#region src/errors/load-setting-error.ts\nconst name$6 = \"AI_LoadSettingError\";\nconst marker$6 = `vercel.ai.error.${name$6}`;\nconst symbol$6 = Symbol.for(marker$6);\nvar LoadSettingError = class extends AISDKError {\n\tconstructor({ message }) {\n\t\tsuper({\n\t\t\tname: name$6,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$6] = true;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$6);\n\t}\n};\n//#endregion\n//#region src/errors/no-content-generated-error.ts\nconst name$5 = \"AI_NoContentGeneratedError\";\nconst marker$5 = `vercel.ai.error.${name$5}`;\nconst symbol$5 = Symbol.for(marker$5);\n/**\n* Thrown when the AI provider fails to generate any content.\n*/\nvar NoContentGeneratedError = class extends AISDKError {\n\tconstructor({ message = \"No content generated.\" } = {}) {\n\t\tsuper({\n\t\t\tname: name$5,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$5] = true;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$5);\n\t}\n};\n//#endregion\n//#region src/errors/no-such-model-error.ts\nconst name$4 = \"AI_NoSuchModelError\";\nconst marker$4 = `vercel.ai.error.${name$4}`;\nconst symbol$4 = Symbol.for(marker$4);\nvar NoSuchModelError = class extends AISDKError {\n\tconstructor({ errorName = name$4, modelId, modelType, message = `No such ${modelType}: ${modelId}` }) {\n\t\tsuper({\n\t\t\tname: errorName,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$4] = true;\n\t\tthis.modelId = modelId;\n\t\tthis.modelType = modelType;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$4);\n\t}\n};\n//#endregion\n//#region src/errors/no-such-provider-reference-error.ts\nconst name$3 = \"AI_NoSuchProviderReferenceError\";\nconst marker$3 = `vercel.ai.error.${name$3}`;\nconst symbol$3 = Symbol.for(marker$3);\n/**\n* Thrown when a provider reference cannot be resolved because the specified\n* provider is not found in the provider reference mapping.\n*/\nvar NoSuchProviderReferenceError = class extends AISDKError {\n\tconstructor({ provider, reference, message = `No provider reference found for provider '${provider}'. Available providers: ${Object.keys(reference).join(\", \")}` }) {\n\t\tsuper({\n\t\t\tname: name$3,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol$3] = true;\n\t\tthis.provider = provider;\n\t\tthis.reference = reference;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$3);\n\t}\n};\n//#endregion\n//#region src/errors/too-many-embedding-values-for-call-error.ts\nconst name$2 = \"AI_TooManyEmbeddingValuesForCallError\";\nconst marker$2 = `vercel.ai.error.${name$2}`;\nconst symbol$2 = Symbol.for(marker$2);\nvar TooManyEmbeddingValuesForCallError = class extends AISDKError {\n\tconstructor(options) {\n\t\tsuper({\n\t\t\tname: name$2,\n\t\t\tmessage: `Too many values for a single embedding call. The ${options.provider} model \"${options.modelId}\" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`\n\t\t});\n\t\tthis[symbol$2] = true;\n\t\tthis.provider = options.provider;\n\t\tthis.modelId = options.modelId;\n\t\tthis.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;\n\t\tthis.values = options.values;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$2);\n\t}\n};\n//#endregion\n//#region src/errors/type-validation-error.ts\nconst name$1 = \"AI_TypeValidationError\";\nconst marker$1 = `vercel.ai.error.${name$1}`;\nconst symbol$1 = Symbol.for(marker$1);\nvar TypeValidationError = class TypeValidationError extends AISDKError {\n\tconstructor({ value, cause, context }) {\n\t\tlet contextPrefix = \"Type validation failed\";\n\t\tif (context?.field) contextPrefix += ` for ${context.field}`;\n\t\tif (context?.entityName || context?.entityId) {\n\t\t\tcontextPrefix += \" (\";\n\t\t\tconst parts = [];\n\t\t\tif (context.entityName) parts.push(context.entityName);\n\t\t\tif (context.entityId) parts.push(`id: \"${context.entityId}\"`);\n\t\t\tcontextPrefix += parts.join(\", \");\n\t\t\tcontextPrefix += \")\";\n\t\t}\n\t\tsuper({\n\t\t\tname: name$1,\n\t\t\tmessage: `${contextPrefix}: Value: ${JSON.stringify(value)}.\\nError message: ${getErrorMessage(cause)}`,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$1] = true;\n\t\tthis.value = value;\n\t\tthis.context = context;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$1);\n\t}\n\t/**\n\t* Wraps an error into a TypeValidationError.\n\t* If the cause is already a TypeValidationError with the same value and context, it returns the cause.\n\t* Otherwise, it creates a new TypeValidationError.\n\t*\n\t* @param {Object} params - The parameters for wrapping the error.\n\t* @param {unknown} params.value - The value that failed validation.\n\t* @param {unknown} params.cause - The original error or cause of the validation failure.\n\t* @param {TypeValidationContext} params.context - Optional context about what is being validated.\n\t* @returns {TypeValidationError} A TypeValidationError instance.\n\t*/\n\tstatic wrap({ value, cause, context }) {\n\t\tif (TypeValidationError.isInstance(cause) && cause.value === value && cause.context?.field === context?.field && cause.context?.entityName === context?.entityName && cause.context?.entityId === context?.entityId) return cause;\n\t\treturn new TypeValidationError({\n\t\t\tvalue,\n\t\t\tcause,\n\t\t\tcontext\n\t\t});\n\t}\n};\n//#endregion\n//#region src/errors/unsupported-functionality-error.ts\nconst name = \"AI_UnsupportedFunctionalityError\";\nconst marker = `vercel.ai.error.${name}`;\nconst symbol = Symbol.for(marker);\nvar UnsupportedFunctionalityError = class extends AISDKError {\n\tconstructor({ functionality, message = `'${functionality}' functionality not supported.` }) {\n\t\tsuper({\n\t\t\tname,\n\t\t\tmessage\n\t\t});\n\t\tthis[symbol] = true;\n\t\tthis.functionality = functionality;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker);\n\t}\n};\n//#endregion\n//#region src/errors/index.ts\n/** @deprecated Use `Experimental_DecisionUnsupportedQuestionTypeError` instead. */\nconst Experimental_EvaluationUnsupportedQuestionTypeError = DecisionUnsupportedQuestionTypeError;\n//#endregion\n//#region src/json-value/is-json.ts\nfunction isJSONValue(value) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") return true;\n\tif (Array.isArray(value)) return value.every(isJSONValue);\n\tif (typeof value === \"object\") return Object.entries(value).every(([key, val]) => typeof key === \"string\" && (val === void 0 || isJSONValue(val)));\n\treturn false;\n}\nfunction isJSONArray(value) {\n\treturn Array.isArray(value) && value.every(isJSONValue);\n}\nfunction isJSONObject(value) {\n\treturn value != null && typeof value === \"object\" && Object.entries(value).every(([key, val]) => typeof key === \"string\" && (val === void 0 || isJSONValue(val)));\n}\n//#endregion\nexport { AISDKError, APICallError, EmptyResponseBodyError, DecisionRefusalError as Experimental_DecisionRefusalError, DecisionUnsupportedQuestionTypeError as Experimental_DecisionUnsupportedQuestionTypeError, Experimental_EvaluationUnsupportedQuestionTypeError, ExtractionRefusalError as Experimental_ExtractionRefusalError, ExtractionUnsupportedFieldTypeError as Experimental_ExtractionUnsupportedFieldTypeError, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, JSONParseError, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };\n\n//# sourceMappingURL=index.js.map","/**\n * Symbol used to define custom serialization for user-defined class instances.\n * The static method should accept an instance and return serializable data.\n *\n * @example\n * ```ts\n * import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';\n *\n * class MyClass {\n *   constructor(public value: string) {}\n *\n *   static [WORKFLOW_SERIALIZE](instance: MyClass) {\n *     return { value: instance.value };\n *   }\n *\n *   static [WORKFLOW_DESERIALIZE](data: { value: string }) {\n *     return new MyClass(data.value);\n *   }\n * }\n * ```\n */\nexport const WORKFLOW_SERIALIZE = Symbol.for('workflow-serialize');\n/**\n * Symbol used to define custom deserialization for user-defined class instances.\n * The static method should accept serialized data and return a class instance.\n *\n * @see WORKFLOW_SERIALIZE for usage example\n */\nexport const WORKFLOW_DESERIALIZE = Symbol.for('workflow-deserialize');\n//# sourceMappingURL=index.js.map","import { AISDKError, APICallError, EmptyResponseBodyError, InvalidArgumentError, InvalidResponseDataError, JSONParseError, LoadAPIKeyError, LoadSettingError, NoSuchProviderReferenceError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage } from \"@ai-sdk/provider\";\nimport { safeParseAsync } from \"zod/v4\";\nimport { config, toJSONSchema } from \"zod/v4/core\";\nimport en from \"zod/v4/locales/en.js\";\nimport { EventSourceParserStream, EventSourceParserStream as EventSourceParserStream$1 } from \"eventsource-parser/stream\";\nimport { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from \"@workflow/serde\";\n//#region src/as-array.ts\n/**\n* Normalizes a possibly undefined or non-array value into an array.\n*/\nfunction asArray(value) {\n\treturn value === void 0 ? [] : Array.isArray(value) ? value : [value];\n}\n//#endregion\n//#region src/combine-headers.ts\nfunction combineHeaders(...headers) {\n\treturn headers.reduce((combinedHeaders, currentHeaders) => ({\n\t\t...combinedHeaders,\n\t\t...currentHeaders\n\t}), {});\n}\n//#endregion\n//#region src/remove-undefined-entries.ts\n/**\n* Removes entries from a record where the value is null or undefined.\n* @param record - The input object whose entries may be null or undefined.\n* @returns A new object containing only entries with non-null and non-undefined values.\n*/\nfunction removeUndefinedEntries(record) {\n\treturn Object.fromEntries(Object.entries(record).filter(([_key, value]) => value != null));\n}\n//#endregion\n//#region src/delay.ts\n/**\n* Creates a Promise that resolves after a specified delay\n* @param delayInMs - The delay duration in milliseconds. If null or undefined, resolves immediately.\n* @param signal - Optional AbortSignal to cancel the delay\n* @returns A Promise that resolves after the specified delay\n* @throws {DOMException} When the signal is aborted\n*/\nasync function delay(delayInMs, options) {\n\tif (delayInMs == null) return;\n\tconst signal = options?.abortSignal;\n\treturn new Promise((resolve, reject) => {\n\t\tif (signal?.aborted) {\n\t\t\treject(createAbortError());\n\t\t\treturn;\n\t\t}\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\tcleanup();\n\t\t\tresolve();\n\t\t}, delayInMs);\n\t\tconst cleanup = () => {\n\t\t\tclearTimeout(timeoutId);\n\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t};\n\t\tconst onAbort = () => {\n\t\t\tcleanup();\n\t\t\treject(createAbortError());\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", onAbort);\n\t});\n}\nfunction createAbortError() {\n\treturn new DOMException(\"Delay was aborted\", \"AbortError\");\n}\n//#endregion\n//#region src/websocket.ts\nfunction getWebSocketConstructor(webSocket) {\n\tconst WebSocketConstructor = webSocket ?? globalThis.WebSocket;\n\tif (WebSocketConstructor == null) throw new Error(\"No WebSocket implementation available.\");\n\treturn WebSocketConstructor;\n}\n/**\n* Converts an http(s) URL to the corresponding ws(s) URL.\n*/\nfunction toWebSocketUrl(url) {\n\tconst wsUrl = new URL(url);\n\tif (wsUrl.protocol === \"http:\") wsUrl.protocol = \"ws:\";\n\telse if (wsUrl.protocol === \"https:\") wsUrl.protocol = \"wss:\";\n\treturn wsUrl;\n}\nconst textDecoder$1 = new TextDecoder();\n/**\n* Reads WebSocket message data as text, handling string, binary,\n* and Blob payloads.\n*/\nasync function readWebSocketMessageText(data) {\n\tif (typeof data === \"string\") return data;\n\tif (data instanceof ArrayBuffer) return textDecoder$1.decode(data);\n\tif (ArrayBuffer.isView(data)) return textDecoder$1.decode(data);\n\tif (typeof Blob !== \"undefined\" && data instanceof Blob) return data.text();\n\treturn String(data);\n}\nconst WEBSOCKET_OPEN_STATE = 1;\n/**\n* Waits until the socket's send buffer drains below `highWaterMark` bytes.\n* No-op for implementations that do not expose `bufferedAmount`. There is no\n* portable drain event, so this polls. Returns as soon as the socket is no\n* longer open or the signal aborts — `bufferedAmount` never drains on a\n* closed socket, so waiting on would poll forever.\n*/\nasync function waitForWebSocketBufferDrain(socket, { highWaterMark = 1048576, pollIntervalMs = 20, abortSignal } = {}) {\n\twhile (socket.readyState === WEBSOCKET_OPEN_STATE && (socket.bufferedAmount ?? 0) > highWaterMark) {\n\t\tif (abortSignal?.aborted === true) return;\n\t\tawait delay(pollIntervalMs);\n\t}\n}\n//#endregion\n//#region src/connect-to-websocket.ts\n/**\n* Opens a WebSocket for a provider model, owning the transport-generic layer\n* (analogous to `postToApi` for HTTP): constructor resolution, header hygiene,\n* abort wiring, and message decoding. Callers own the URL, the auth channel\n* (subprotocols vs headers), and the wire protocol.\n*/\nfunction connectToWebSocket({ url, protocols, headers, webSocket, abortSignal, onOpen, onMessageText, onProcessingError, onSocketError, onClose, onAbort }) {\n\tlet socket;\n\tlet abortListener;\n\tconst close = (code) => {\n\t\tif (abortListener != null) {\n\t\t\tabortSignal?.removeEventListener(\"abort\", abortListener);\n\t\t\tabortListener = void 0;\n\t\t}\n\t\ttry {\n\t\t\tsocket?.close(code);\n\t\t} catch {}\n\t};\n\tif (abortSignal?.aborted) {\n\t\tonAbort?.(abortSignal.reason ?? /* @__PURE__ */ new Error(\"Aborted\"));\n\t\treturn {\n\t\t\tsocket: void 0,\n\t\t\tclose\n\t\t};\n\t}\n\ttry {\n\t\tsocket = new (getWebSocketConstructor(webSocket))(url, protocols, { headers: removeUndefinedEntries(headers ?? {}) });\n\t} catch (error) {\n\t\tonProcessingError(error);\n\t\treturn {\n\t\t\tsocket: void 0,\n\t\t\tclose\n\t\t};\n\t}\n\tif (abortSignal != null && onAbort != null) {\n\t\tabortListener = () => onAbort(abortSignal.reason ?? /* @__PURE__ */ new Error(\"Aborted\"));\n\t\tabortSignal.addEventListener(\"abort\", abortListener, { once: true });\n\t}\n\tconst openedSocket = socket;\n\tsocket.onopen = () => {\n\t\ttry {\n\t\t\tonOpen?.(openedSocket);\n\t\t} catch (error) {\n\t\t\tonProcessingError(error);\n\t\t}\n\t};\n\tlet tail = Promise.resolve();\n\tsocket.onmessage = (event) => {\n\t\ttail = tail.then(() => readWebSocketMessageText(event.data)).then((text) => onMessageText(text)).catch(onProcessingError);\n\t};\n\tsocket.onerror = () => {\n\t\ttail = tail.then(() => onSocketError?.()).catch(onProcessingError);\n\t};\n\tsocket.onclose = (event) => {\n\t\tconst closeEvent = event;\n\t\tconst code = typeof closeEvent?.code === \"number\" ? closeEvent.code : void 0;\n\t\tconst reason = typeof closeEvent?.reason === \"string\" ? closeEvent.reason : void 0;\n\t\ttail = tail.then(() => onClose?.({\n\t\t\tcode,\n\t\t\treason\n\t\t})).catch(onProcessingError);\n\t};\n\treturn {\n\t\tsocket,\n\t\tclose\n\t};\n}\n//#endregion\n//#region src/convert-async-iterator-to-readable-stream.ts\n/**\n* Converts an AsyncIterator to a ReadableStream.\n*\n* @template T - The type of elements produced by the AsyncIterator.\n* @param { <T>} iterator - The AsyncIterator to convert.\n* @returns {ReadableStream<T>} - A ReadableStream that provides the same data as the AsyncIterator.\n*/\nfunction convertAsyncIteratorToReadableStream(iterator) {\n\tlet cancelled = false;\n\treturn new ReadableStream({\n\t\t/**\n\t\t* Called when the consumer wants to pull more data from the stream.\n\t\t*\n\t\t* @param {ReadableStreamDefaultController<T>} controller - The controller to enqueue data into the stream.\n\t\t* @returns {Promise<void>}\n\t\t*/\n\t\tasync pull(controller) {\n\t\t\tif (cancelled) return;\n\t\t\ttry {\n\t\t\t\tconst { value, done } = await iterator.next();\n\t\t\t\tif (done) controller.close();\n\t\t\t\telse controller.enqueue(value);\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t* Called when the consumer cancels the stream.\n\t\t*/\n\t\tasync cancel(reason) {\n\t\t\tcancelled = true;\n\t\t\tif (iterator.return) try {\n\t\t\t\tawait iterator.return(reason);\n\t\t\t} catch {}\n\t\t}\n\t});\n}\n//#endregion\n//#region src/uint8-utils.ts\nconst { btoa, atob } = globalThis;\nfunction convertBase64ToUint8Array(base64String) {\n\tconst base64Url = base64String.replace(/-/g, \"+\").replace(/_/g, \"/\");\n\tconst latin1string = atob(base64Url);\n\tconst bytes = new Uint8Array(latin1string.length);\n\tfor (let i = 0; i < latin1string.length; i++) bytes[i] = latin1string.charCodeAt(i);\n\treturn bytes;\n}\nfunction convertUint8ArrayToBase64(array) {\n\tif (typeof globalThis.Buffer?.from === \"function\") return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString(\"base64\");\n\tconst chunks = [];\n\tconst chunkSize = 4096;\n\tfor (let i = 0; i < array.length; i += chunkSize) chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));\n\treturn btoa(chunks.join(\"\"));\n}\nconst typedArrayTag = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;\nconst arrayBufferByteLength = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, \"byteLength\").get;\nfunction isUint8Array(value) {\n\treturn ArrayBuffer.isView(value) && typedArrayTag.call(value) === \"Uint8Array\";\n}\nfunction isArrayBuffer(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"byteLength\" in value)) return false;\n\ttry {\n\t\tarrayBufferByteLength.call(value);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction convertToBase64(value) {\n\treturn isUint8Array(value) ? convertUint8ArrayToBase64(value) : value;\n}\n//#endregion\n//#region src/convert-inline-file-data-to-uint8-array.ts\n/**\n* Converts inline file data (a tagged `data` or `text` shape) into raw bytes.\n*\n* - `{ type: 'text', text }` → UTF-8 encoded bytes\n* - `{ type: 'data', data: Uint8Array | Buffer }` → returned as-is\n* - `{ type: 'data', data: ArrayBuffer }` → wrapped in a `Uint8Array`\n* - `{ type: 'data', data: string }` → decoded as base64\n*\n* `{ type: 'stream' }` data is rejected: providers without streaming upload\n* support funnel here and surface a clear `UnsupportedFunctionalityError`.\n*/\nfunction convertInlineFileDataToUint8Array(data) {\n\tif (data.type === \"stream\") {\n\t\tconst error = new UnsupportedFunctionalityError({ functionality: \"streaming file upload\" });\n\t\tdata.stream.cancel(error).catch(() => {});\n\t\tthrow error;\n\t}\n\tif (data.type === \"text\") return new TextEncoder().encode(data.text);\n\tif (data.data instanceof Uint8Array) return data.data;\n\tif (isUint8Array(data.data)) return new Uint8Array(data.data.buffer, data.data.byteOffset, data.data.byteLength);\n\tif (isArrayBuffer(data.data)) return new Uint8Array(data.data);\n\treturn convertBase64ToUint8Array(data.data);\n}\n//#endregion\n//#region src/convert-image-model-file-to-data-uri.ts\n/**\n* Convert an ImageModelV4File to a URL or data URI string.\n*\n* If the file is a URL, it returns the URL as-is.\n* If the file is base64 data, it returns a data URI with the base64 data.\n* If the file is a Uint8Array, it converts it to base64 and returns a data URI.\n*/\nfunction convertImageModelFileToDataUri(file) {\n\tif (file.type === \"url\") return file.url;\n\treturn `data:${file.mediaType};base64,${typeof file.data === \"string\" ? file.data : convertUint8ArrayToBase64(file.data)}`;\n}\n//#endregion\n//#region src/convert-json-response-tool-stream.ts\n/**\n* Providers that cannot use native structured output for a request can use a\n* JSON response tool instead. This utility converts that tool's streamed input\n* into text events so the SDK can parse it as structured output.\n*\n* Conversational text is suppressed. Application tool calls pass through so the\n* caller can execute them. A response containing only the JSON tool finishes\n* with `stop`; a response containing application calls keeps its finish reason.\n*/\nfunction convertJsonResponseToolStream(toolName) {\n\tconst responseToolIds = /* @__PURE__ */ new Set();\n\tconst responseToolsWithDeltas = /* @__PURE__ */ new Set();\n\tlet hasResponseTool = false;\n\tlet hasApplicationTool = false;\n\treturn new TransformStream({ transform(part, controller) {\n\t\tswitch (part.type) {\n\t\t\tcase \"text-start\":\n\t\t\tcase \"text-delta\":\n\t\t\tcase \"text-end\": return;\n\t\t\tcase \"tool-input-start\":\n\t\t\t\tif (part.toolName === toolName) {\n\t\t\t\t\tresponseToolIds.add(part.id);\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t...part.providerMetadata && { providerMetadata: part.providerMetadata }\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"tool-input-delta\":\n\t\t\t\tif (responseToolIds.has(part.id)) {\n\t\t\t\t\tif (part.delta.length > 0) responseToolsWithDeltas.add(part.id);\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\tdelta: part.delta,\n\t\t\t\t\t\t...part.providerMetadata && { providerMetadata: part.providerMetadata }\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"tool-input-end\":\n\t\t\t\tif (responseToolIds.has(part.id)) return;\n\t\t\t\tbreak;\n\t\t\tcase \"tool-call\":\n\t\t\t\tif (part.toolName === toolName) {\n\t\t\t\t\tif (!responseToolsWithDeltas.has(part.toolCallId)) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\t\tdelta: part.input,\n\t\t\t\t\t\t...part.providerMetadata && { providerMetadata: part.providerMetadata }\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\t\t...part.providerMetadata && { providerMetadata: part.providerMetadata }\n\t\t\t\t\t});\n\t\t\t\t\thasResponseTool = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!part.providerExecuted) hasApplicationTool = true;\n\t\t\t\tbreak;\n\t\t\tcase \"finish\": if (hasResponseTool && !hasApplicationTool && part.finishReason.unified === \"tool-calls\") {\n\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t...part,\n\t\t\t\t\tfinishReason: {\n\t\t\t\t\t\t...part.finishReason,\n\t\t\t\t\t\tunified: \"stop\"\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcontroller.enqueue(part);\n\t} });\n}\n//#endregion\n//#region src/convert-to-form-data.ts\n/**\n* Converts an input object to FormData for multipart/form-data requests.\n*\n* Handles the following cases:\n* - `null` or `undefined` values are skipped\n* - Arrays with a single element are appended as a single value\n* - Arrays with multiple elements are appended with `[]` suffix (e.g., `image[]`)\n*   unless `useArrayBrackets` is set to `false`\n* - All other values are appended directly\n*\n* @param input - The input object to convert. Use a generic type for type validation.\n* @param options - Optional configuration object.\n* @param options.useArrayBrackets - Whether to add `[]` suffix for multi-element arrays.\n*   Defaults to `true`. Set to `false` for APIs that expect repeated keys without brackets.\n* @returns A FormData object containing the input values.\n*\n* @example\n* ```ts\n* type MyInput = {\n*   model: string;\n*   prompt: string;\n*   images: Blob[];\n* };\n*\n* const formData = convertToFormData<MyInput>({\n*   model: 'gpt-image-1',\n*   prompt: 'A cat',\n*   images: [blob1, blob2],\n* });\n* ```\n*/\nfunction convertToFormData(input, options = {}) {\n\tconst { useArrayBrackets = true } = options;\n\tconst formData = new FormData();\n\tfor (const [key, value] of Object.entries(input)) {\n\t\tif (value == null) continue;\n\t\tif (Array.isArray(value)) {\n\t\t\tif (value.length === 1) {\n\t\t\t\tformData.append(key, value[0]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst arrayKey = useArrayBrackets ? `${key}[]` : key;\n\t\t\tfor (const item of value) formData.append(arrayKey, item);\n\t\t\tcontinue;\n\t\t}\n\t\tformData.append(key, value);\n\t}\n\treturn formData;\n}\n//#endregion\n//#region src/create-language-model-response-metadata.ts\n/**\n* Converts common provider response fields into language model response\n* metadata.\n*/\nfunction createLanguageModelResponseMetadata({ id, model, created }) {\n\treturn {\n\t\tid: id ?? void 0,\n\t\tmodelId: model ?? void 0,\n\t\ttimestamp: created != null ? /* @__PURE__ */ new Date(created * 1e3) : void 0\n\t};\n}\n//#endregion\n//#region src/create-null-language-model-usage.ts\n/**\n* Creates an empty language model usage result for unavailable usage data.\n*/\nfunction createNullLanguageModelUsage() {\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: void 0,\n\t\t\tnoCache: void 0,\n\t\t\tcacheRead: void 0,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: void 0,\n\t\t\ttext: void 0,\n\t\t\treasoning: void 0\n\t\t},\n\t\traw: void 0\n\t};\n}\n//#endregion\n//#region src/create-tool-name-mapping.ts\n/**\n* @param tools - Tools that were passed to the language model.\n* @param providerToolNames - Maps the provider tool ids to the provider tool names.\n*/\nfunction createToolNameMapping({ tools = [], providerToolNames }) {\n\tconst customToolNameToProviderToolName = {};\n\tconst providerToolNameToCustomToolName = {};\n\tfor (const tool of tools) if (tool.type === \"provider\" && tool.id in providerToolNames) {\n\t\tconst providerToolName = providerToolNames[tool.id];\n\t\tcustomToolNameToProviderToolName[tool.name] = providerToolName;\n\t\tproviderToolNameToCustomToolName[providerToolName] = tool.name;\n\t}\n\treturn {\n\t\ttoProviderToolName: (customToolName) => customToolNameToProviderToolName[customToolName] ?? customToolName,\n\t\ttoCustomToolName: (providerToolName) => providerToolNameToCustomToolName[providerToolName] ?? providerToolName\n\t};\n}\n//#endregion\n//#region src/create-provider-stream-error.ts\nconst marker$2 = Symbol.for(\"vercel.ai.providerStreamError\");\n/**\n* Adds provider-owned status and retry metadata to a stream error payload\n* without requiring provider packages to depend on AI SDK Core.\n*/\nfunction createProviderStreamError({ message, type, code, statusCode, isRetryable, data }) {\n\tconst error = {\n\t\tmessage,\n\t\ttype,\n\t\tcode,\n\t\tstatusCode,\n\t\tisRetryable,\n\t\tdata\n\t};\n\tObject.defineProperty(error, marker$2, { value: true });\n\treturn error;\n}\nfunction isProviderStreamError(error) {\n\treturn typeof error === \"object\" && error != null && error[marker$2] === true;\n}\n//#endregion\n//#region src/delayed-promise.ts\n/**\n* Delayed promise. It is only constructed once the value is accessed.\n* This is useful to avoid unhandled promise rejections when the promise is created\n* but not accessed.\n*/\nvar DelayedPromise = class {\n\tconstructor() {\n\t\tthis.status = { type: \"pending\" };\n\t\tthis._resolve = void 0;\n\t\tthis._reject = void 0;\n\t}\n\tget promise() {\n\t\tif (this._promise) return this._promise;\n\t\tthis._promise = new Promise((resolve, reject) => {\n\t\t\tif (this.status.type === \"resolved\") resolve(this.status.value);\n\t\t\telse if (this.status.type === \"rejected\") reject(this.status.error);\n\t\t\tthis._resolve = resolve;\n\t\t\tthis._reject = reject;\n\t\t});\n\t\treturn this._promise;\n\t}\n\tresolve(value) {\n\t\tthis.status = {\n\t\t\ttype: \"resolved\",\n\t\t\tvalue\n\t\t};\n\t\tif (this._promise) this._resolve?.(value);\n\t}\n\treject(error) {\n\t\tthis.status = {\n\t\t\ttype: \"rejected\",\n\t\t\terror\n\t\t};\n\t\tif (this._promise) this._reject?.(error);\n\t}\n\tisResolved() {\n\t\treturn this.status.type === \"resolved\";\n\t}\n\tisRejected() {\n\t\treturn this.status.type === \"rejected\";\n\t}\n\tisPending() {\n\t\treturn this.status.type === \"pending\";\n\t}\n};\n//#endregion\n//#region src/extract-response-headers.ts\n/**\n* Extracts the headers from a response object and returns them as a key-value object.\n*\n* @param response - The response object to extract headers from.\n* @returns The headers as a key-value object.\n*/\nfunction extractResponseHeaders(response) {\n\treturn Object.fromEntries([...response.headers]);\n}\n//#endregion\n//#region src/get-runtime-environment-user-agent.ts\nfunction getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {\n\tif (globalThisAny.navigator?.userAgent) return globalThisAny.navigator.userAgent.toLowerCase();\n\tif (globalThisAny.process?.versions?.node) return `node.js/${globalThisAny.process.version}`;\n\tif (globalThisAny.EdgeRuntime) return \"vercel-edge\";\n\treturn \"\";\n}\n//#endregion\n//#region src/is-abort-error.ts\nfunction isAbortError(error) {\n\treturn (error instanceof Error || typeof DOMException === \"function\" && error instanceof DOMException) && (error.name === \"AbortError\" || error.name === \"ResponseAborted\" || error.name === \"TimeoutError\");\n}\n//#endregion\n//#region src/handle-fetch-error.ts\nconst FETCH_FAILED_ERROR_MESSAGES = [\"fetch failed\", \"failed to fetch\"];\nconst RETRYABLE_NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([\n\t\"ConnectionRefused\",\n\t\"ConnectionClosed\",\n\t\"FailedToOpenSocket\",\n\t\"ECONNRESET\",\n\t\"ECONNREFUSED\",\n\t\"ETIMEDOUT\",\n\t\"EPIPE\",\n\t\"UND_ERR_SOCKET\",\n\t\"UND_ERR_HEADERS_TIMEOUT\",\n\t\"UND_ERR_BODY_TIMEOUT\",\n\t\"UND_ERR_CONNECT_TIMEOUT\"\n]);\nfunction findNetworkError(error) {\n\tconst visited = /* @__PURE__ */ new Set();\n\tlet current = error;\n\twhile (current instanceof Error && !visited.has(current)) {\n\t\tvisited.add(current);\n\t\tconst errorWithCode = current;\n\t\tif (typeof errorWithCode.code === \"string\" && RETRYABLE_NETWORK_ERROR_CODES.has(errorWithCode.code)) return errorWithCode;\n\t\tcurrent = current.cause;\n\t}\n}\nfunction handleFetchError({ error, url, requestBodyValues }) {\n\tif (isAbortError(error)) return error;\n\tif (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) {\n\t\tconst cause = error.cause;\n\t\tif (cause != null) return new APICallError({\n\t\t\tmessage: `Cannot connect to API: ${cause.message}`,\n\t\t\tcause,\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tisRetryable: true\n\t\t});\n\t}\n\tconst networkError = findNetworkError(error);\n\tif (networkError != null) {\n\t\tif (APICallError.isInstance(error)) return new APICallError({\n\t\t\tmessage: error.message,\n\t\t\tcause: error.cause,\n\t\t\turl: error.url,\n\t\t\trequestBodyValues: error.requestBodyValues,\n\t\t\tstatusCode: error.statusCode,\n\t\t\tresponseHeaders: error.responseHeaders,\n\t\t\tresponseBody: error.responseBody,\n\t\t\tdata: error.data,\n\t\t\tisRetryable: true\n\t\t});\n\t\treturn new APICallError({\n\t\t\tmessage: `Cannot connect to API: ${error instanceof Error ? error.message : networkError.message}`,\n\t\t\tcause: error,\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tisRetryable: true\n\t\t});\n\t}\n\treturn error;\n}\n//#endregion\n//#region src/version.ts\nconst VERSION = \"5.0.81\";\n//#endregion\n//#region src/normalize-headers.ts\n/**\n* Normalizes different header inputs into a plain record with lower-case keys.\n* Entries with `undefined` or `null` values are removed.\n*\n* @param headers - Input headers (`Headers`, tuples array, plain record) to normalize.\n* @returns A record containing the normalized header entries.\n*/\nfunction normalizeHeaders(headers) {\n\tif (headers == null) return {};\n\tconst normalized = {};\n\tif (headers instanceof Headers) headers.forEach((value, key) => {\n\t\tnormalized[key.toLowerCase()] = value;\n\t});\n\telse {\n\t\tif (!Array.isArray(headers)) headers = Object.entries(headers);\n\t\tfor (const [key, value] of headers) if (value != null) normalized[key.toLowerCase()] = value;\n\t}\n\treturn normalized;\n}\n//#endregion\n//#region src/with-user-agent-suffix.ts\n/**\n* Appends suffix parts to the `user-agent` header.\n* If a `user-agent` header already exists, the suffix parts are appended to it.\n* If no `user-agent` header exists, a new one is created with the suffix parts.\n* Automatically removes undefined entries from the headers.\n*\n* @param headers - The original headers.\n* @param userAgentSuffixParts - The parts to append to the `user-agent` header.\n* @returns The new headers with the `user-agent` header set or updated.\n*/\nfunction withUserAgentSuffix(headers, ...userAgentSuffixParts) {\n\tconst normalizedHeaders = new Headers(normalizeHeaders(headers));\n\tconst currentUserAgentHeader = normalizedHeaders.get(\"user-agent\") || \"\";\n\tnormalizedHeaders.set(\"user-agent\", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(\" \"));\n\treturn Object.fromEntries(normalizedHeaders.entries());\n}\n//#endregion\n//#region src/delete-from-api.ts\nconst getOriginalFetch$3 = () => globalThis.fetch;\n/**\n* Sends a DELETE request. For URLs built from developer-configured endpoints\n* only — there is no untrusted-URL validation path (use `getFromApi` with\n* `validateUrl` for response-supplied URLs).\n*/\nconst deleteFromApi = async ({ url, headers = {}, failedResponseHandler, successfulResponseHandler, abortSignal, fetch = getOriginalFetch$3() }) => {\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: withUserAgentSuffix(headers, `ai-sdk-provider-utils/${VERSION}`, getRuntimeEnvironmentUserAgent()),\n\t\t\tsignal: abortSignal\n\t\t});\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (!response.ok) {\n\t\t\tlet errorInformation;\n\t\t\ttry {\n\t\t\t\terrorInformation = await failedResponseHandler({\n\t\t\t\t\tresponse,\n\t\t\t\t\turl,\n\t\t\t\t\trequestBodyValues: {}\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t\tthrow new APICallError({\n\t\t\t\t\tmessage: \"Failed to process error response\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tstatusCode: response.status,\n\t\t\t\t\turl,\n\t\t\t\t\tresponseHeaders,\n\t\t\t\t\trequestBodyValues: {}\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow errorInformation.value;\n\t\t}\n\t\ttry {\n\t\t\treturn await successfulResponseHandler({\n\t\t\t\tresponse,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues: {}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t}\n\t\t\tthrow new APICallError({\n\t\t\t\tmessage: \"Failed to process successful response\",\n\t\t\t\tcause: error,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\turl,\n\t\t\t\tresponseHeaders,\n\t\t\t\trequestBodyValues: {}\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow handleFetchError({\n\t\t\terror,\n\t\t\turl,\n\t\t\trequestBodyValues: {}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/detect-media-type.ts\nconst imageMediaTypeSignatures = [\n\t{\n\t\tmediaType: \"image/gif\",\n\t\tbytesPrefix: [\n\t\t\t71,\n\t\t\t73,\n\t\t\t70,\n\t\t\t56,\n\t\t\t55,\n\t\t\t97\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/gif\",\n\t\tbytesPrefix: [\n\t\t\t71,\n\t\t\t73,\n\t\t\t70,\n\t\t\t56,\n\t\t\t57,\n\t\t\t97\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/png\",\n\t\tbytesPrefix: [\n\t\t\t137,\n\t\t\t80,\n\t\t\t78,\n\t\t\t71\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/jpeg\",\n\t\tbytesPrefix: [255, 216]\n\t},\n\t{\n\t\tmediaType: \"image/webp\",\n\t\tbytesPrefix: [\n\t\t\t82,\n\t\t\t73,\n\t\t\t70,\n\t\t\t70,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t87,\n\t\t\t69,\n\t\t\t66,\n\t\t\t80\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/bmp\",\n\t\tbytesPrefix: [\n\t\t\t66,\n\t\t\t77,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/tiff\",\n\t\tbytesPrefix: [\n\t\t\t73,\n\t\t\t73,\n\t\t\t42,\n\t\t\t0\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/tiff\",\n\t\tbytesPrefix: [\n\t\t\t77,\n\t\t\t77,\n\t\t\t0,\n\t\t\t42\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/avif\",\n\t\tbytesPrefix: [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tnull,\n\t\t\t102,\n\t\t\t116,\n\t\t\t121,\n\t\t\t112,\n\t\t\t97,\n\t\t\t118,\n\t\t\t105,\n\t\t\t102\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"image/heic\",\n\t\tbytesPrefix: [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tnull,\n\t\t\t102,\n\t\t\t116,\n\t\t\t121,\n\t\t\t112,\n\t\t\t104,\n\t\t\t101,\n\t\t\t105,\n\t\t\t99\n\t\t]\n\t}\n];\nconst documentMediaTypeSignatures = [{\n\tmediaType: \"application/pdf\",\n\tbytesPrefix: [\n\t\t37,\n\t\t80,\n\t\t68,\n\t\t70\n\t]\n}];\nconst audioMediaTypeSignaturesWithoutMp4 = [\n\t{\n\t\tmediaType: \"audio/aac\",\n\t\tbytesPrefix: [255, 240]\n\t},\n\t{\n\t\tmediaType: \"audio/aac\",\n\t\tbytesPrefix: [255, 241]\n\t},\n\t{\n\t\tmediaType: \"audio/aac\",\n\t\tbytesPrefix: [255, 248]\n\t},\n\t{\n\t\tmediaType: \"audio/aac\",\n\t\tbytesPrefix: [255, 249]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 251]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 250]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 243]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 242]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 227]\n\t},\n\t{\n\t\tmediaType: \"audio/mpeg\",\n\t\tbytesPrefix: [255, 226]\n\t},\n\t{\n\t\tmediaType: \"audio/wav\",\n\t\tbytesPrefix: [\n\t\t\t82,\n\t\t\t73,\n\t\t\t70,\n\t\t\t70,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\tnull,\n\t\t\t87,\n\t\t\t65,\n\t\t\t86,\n\t\t\t69\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"audio/ogg\",\n\t\tbytesPrefix: [\n\t\t\t79,\n\t\t\t103,\n\t\t\t103,\n\t\t\t83\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"audio/flac\",\n\t\tbytesPrefix: [\n\t\t\t102,\n\t\t\t76,\n\t\t\t97,\n\t\t\t67\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"audio/aac\",\n\t\tbytesPrefix: [\n\t\t\t64,\n\t\t\t21,\n\t\t\t0,\n\t\t\t0\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"audio/webm\",\n\t\tbytesPrefix: [\n\t\t\t26,\n\t\t\t69,\n\t\t\t223,\n\t\t\t163\n\t\t]\n\t}\n];\nconst audioMediaTypeSignatures = [...audioMediaTypeSignaturesWithoutMp4, {\n\tmediaType: \"audio/mp4\",\n\tbytesPrefix: [\n\t\t0,\n\t\t0,\n\t\t0,\n\t\tnull,\n\t\t102,\n\t\t116,\n\t\t121,\n\t\t112\n\t]\n}];\nconst videoMediaTypeSignatures = [\n\t{\n\t\tmediaType: \"video/mp4\",\n\t\tbytesPrefix: [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tnull,\n\t\t\t102,\n\t\t\t116,\n\t\t\t121,\n\t\t\t112\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"video/webm\",\n\t\tbytesPrefix: [\n\t\t\t26,\n\t\t\t69,\n\t\t\t223,\n\t\t\t163\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"video/quicktime\",\n\t\tbytesPrefix: [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t20,\n\t\t\t102,\n\t\t\t116,\n\t\t\t121,\n\t\t\t112,\n\t\t\t113,\n\t\t\t116\n\t\t]\n\t},\n\t{\n\t\tmediaType: \"video/x-msvideo\",\n\t\tbytesPrefix: [\n\t\t\t82,\n\t\t\t73,\n\t\t\t70,\n\t\t\t70\n\t\t]\n\t}\n];\nconst DEFAULT_SNIFF_BYTES = 18;\nconst ID3_SCAN_BYTES = 131084;\nfunction decodePrefix(data, maxBytes) {\n\tif (typeof data !== \"string\") return data.length > maxBytes ? data.subarray(0, maxBytes) : data;\n\tconst maxChars = Math.ceil(maxBytes / 3) * 4;\n\tconst bytes = convertBase64ToUint8Array(data.substring(0, Math.min(data.length, maxChars)));\n\treturn bytes.length > maxBytes ? bytes.subarray(0, maxBytes) : bytes;\n}\nfunction hasID3(bytes) {\n\treturn bytes.length > 10 && bytes[0] === 73 && bytes[1] === 68 && bytes[2] === 51;\n}\nconst stripID3 = (bytes) => {\n\tconst id3Size = (bytes[6] & 127) << 21 | (bytes[7] & 127) << 14 | (bytes[8] & 127) << 7 | bytes[9] & 127;\n\treturn bytes.subarray(id3Size + 10);\n};\nfunction detectMediaTypeBySignatures({ data, signatures }) {\n\tlet bytes = decodePrefix(data, DEFAULT_SNIFF_BYTES);\n\tif (hasID3(bytes)) bytes = stripID3(decodePrefix(data, ID3_SCAN_BYTES));\n\tfor (const signature of signatures) if (bytes.length >= signature.bytesPrefix.length && signature.bytesPrefix.every((byte, index) => byte === null || bytes[index] === byte)) return signature.mediaType;\n}\nconst topLevelSignatureTables = {\n\timage: imageMediaTypeSignatures,\n\taudio: audioMediaTypeSignatures,\n\tvideo: videoMediaTypeSignatures,\n\tapplication: documentMediaTypeSignatures\n};\n/**\n* Detect the IANA media type of a file from its raw bytes or base64 string.\n*\n* - When `topLevelType` is omitted, every known signature is considered\n*   (image, audio, video, and application). Returns `undefined` when the\n*   bytes do not match any known signature.\n* - When `topLevelType` is provided, only signatures for that top-level\n*   segment are considered. Returns `undefined` for unsupported segments\n*   (e.g. `\"text\"`) or when no signature matches.\n*/\nfunction detectMediaType({ data, topLevelType }) {\n\tif (topLevelType === void 0) return detectMediaTypeBySignatures({\n\t\tdata,\n\t\tsignatures: [\n\t\t\t...imageMediaTypeSignatures,\n\t\t\t...documentMediaTypeSignatures,\n\t\t\t...audioMediaTypeSignaturesWithoutMp4,\n\t\t\t...videoMediaTypeSignatures\n\t\t]\n\t});\n\tif (!Object.prototype.hasOwnProperty.call(topLevelSignatureTables, topLevelType)) return;\n\treturn detectMediaTypeBySignatures({\n\t\tdata,\n\t\tsignatures: topLevelSignatureTables[topLevelType]\n\t});\n}\n/**\n* Returns the top-level segment of a media type (the portion before `/`).\n*\n* Examples:\n*   - `\"image/png\"` -> `\"image\"`\n*   - `\"image/*\"` -> `\"image\"`\n*   - `\"image\"` -> `\"image\"`\n*   - `\"image/\"` -> `\"image\"`\n*   - `\"\"` -> `\"\"`\n*   - `\"/\"` -> `\"\"`\n*/\nfunction getTopLevelMediaType(mediaType) {\n\tconst slashIndex = mediaType.indexOf(\"/\");\n\treturn slashIndex === -1 ? mediaType : mediaType.substring(0, slashIndex);\n}\n/**\n* Returns `true` only when the given media type has a non-empty, non-wildcard\n* subtype (i.e. matches the form `type/subtype`, and `subtype` is not `*`).\n*\n* Examples:\n*   - `\"image/png\"` -> `true`\n*   - `\"image/*\"` -> `false`\n*   - `\"image\"` -> `false`\n*   - `\"image/\"` -> `false`\n*   - `\"\"` -> `false`\n*   - `\"/\"` -> `false`\n*/\nfunction isFullMediaType(mediaType) {\n\tconst slashIndex = mediaType.indexOf(\"/\");\n\tif (slashIndex === -1) return false;\n\tconst subtype = mediaType.substring(slashIndex + 1);\n\treturn subtype.length > 0 && subtype !== \"*\";\n}\n//#endregion\n//#region src/cancel-response-body.ts\n/**\n* Cancels a response body to release the underlying connection.\n*\n* When a fetch Response is rejected without consuming its body (e.g. a failed\n* status code, an open-redirect rejection, or a Content-Length that exceeds the\n* size limit), the underlying TCP socket is not returned to the connection pool\n* and may stay open until the process runs out of file descriptors. Cancelling\n* the body avoids this leak.\n*\n* Errors thrown while cancelling are ignored: the body may already be locked,\n* disturbed, or absent, none of which should mask the original rejection.\n*/\nasync function cancelResponseBody(response) {\n\ttry {\n\t\tawait response.body?.cancel();\n\t} catch {}\n}\n//#endregion\n//#region src/download-error.ts\nconst name$1 = \"AI_DownloadError\";\nconst marker$1 = `vercel.ai.error.${name$1}`;\nconst symbol$1 = Symbol.for(marker$1);\nvar DownloadError = class extends AISDKError {\n\tconstructor({ url, statusCode, statusText, cause, message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}` }) {\n\t\tsuper({\n\t\t\tname: name$1,\n\t\t\tmessage,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol$1] = true;\n\t\tthis.url = url;\n\t\tthis.statusCode = statusCode;\n\t\tthis.statusText = statusText;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker$1);\n\t}\n};\n//#endregion\n//#region src/is-browser-runtime.ts\n/**\n* Returns `true` when running in a browser.\n*\n* Detection keys on the presence of a global `window`, matching the browser\n* check used elsewhere in this package (see `getRuntimeEnvironmentUserAgent`)\n* so the SDK has a single, consistent definition of \"browser\". Server runtimes\n* (Node.js, Deno, Bun, edge/workers) do not define `window`.\n*/\nfunction isBrowserRuntime(globalThisAny = globalThis) {\n\treturn globalThisAny.window != null;\n}\n//#endregion\n//#region src/is-same-origin.ts\n/**\n* Returns true when `url` has the same origin (scheme + host + port) as\n* `baseUrl`.\n*\n* Used to decide whether provider credentials may be attached to a request to a\n* URL taken from a provider response (e.g. a polling or media-download URL).\n* Credentials must only be sent to the provider's own origin; a response that\n* names a foreign host (a CDN, or an attacker-controlled host if the response\n* is tampered with) must not receive the API key.\n*\n* Returns false if either value is not a valid absolute URL (fail-closed).\n*/\nfunction isSameOrigin(url, baseUrl) {\n\ttry {\n\t\treturn new URL(url).origin === new URL(baseUrl).origin;\n\t} catch {\n\t\treturn false;\n\t}\n}\n//#endregion\n//#region src/sanitize-request-headers.ts\n/**\n* Request headers stripped before fetching an untrusted URL: host/virtual-host\n* routing, proxy/origin spoofing, cloud-metadata, cookies, and hop-by-hop\n* transport headers (RFC 7230 §6.1).\n*\n* `Authorization` and other credential-bearing caller headers (e.g. `x-key`)\n* are intentionally not listed because trusted provider requests may need\n* them. `fetchUntrustedUrl` separately restricts an untrusted first hop to an\n* explicit allowlist of non-credential request metadata. Both it and\n* `fetchWithValidatedRedirects` drop all caller headers except the user-agent\n* on a cross-origin redirect.\n*/\nconst BLOCKED_REQUEST_HEADERS = [\n\t\"connection\",\n\t\"keep-alive\",\n\t\"te\",\n\t\"trailer\",\n\t\"transfer-encoding\",\n\t\"upgrade\",\n\t\"host\",\n\t\"forwarded\",\n\t\"proxy-authorization\",\n\t\"via\",\n\t\"x-forwarded-for\",\n\t\"x-forwarded-host\",\n\t\"x-forwarded-proto\",\n\t\"x-real-ip\",\n\t\"metadata\",\n\t\"metadata-flavor\",\n\t\"x-aws-ec2-metadata-token\",\n\t\"x-metadata-token\",\n\t\"cookie\",\n\t\"set-cookie\"\n];\n/**\n* Returns a fresh `Headers` built from `input` with {@link BLOCKED_REQUEST_HEADERS}\n* removed. The input is never mutated.\n*/\nfunction sanitizeRequestHeaders(input) {\n\tconst headers = new Headers(input);\n\tfor (const name of BLOCKED_REQUEST_HEADERS) headers.delete(name);\n\treturn headers;\n}\n//#endregion\n//#region src/validate-download-url.ts\n/**\n* Validates that a URL is safe to download from, blocking private/internal addresses\n* to prevent SSRF attacks.\n*\n* This function performs string/literal-IP checks only. DNS validation must\n* be provided by the fetch transport or network egress controls.\n*\n* @param url - The URL string to validate.\n* @throws DownloadError if the URL is unsafe.\n*/\nfunction validateDownloadUrl(url) {\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(url);\n\t} catch {\n\t\tthrow new DownloadError({\n\t\t\turl,\n\t\t\tmessage: `Invalid URL: ${url}`\n\t\t});\n\t}\n\tif (parsed.protocol === \"data:\") return;\n\tif (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\") throw new DownloadError({\n\t\turl,\n\t\tmessage: `URL scheme must be http, https, or data, got ${parsed.protocol}`\n\t});\n\tconst hostname = parsed.hostname.toLowerCase().replace(/\\.+$/, \"\");\n\tif (!hostname) throw new DownloadError({\n\t\turl,\n\t\tmessage: `URL must have a hostname`\n\t});\n\tif (hostname === \"localhost\" || hostname.endsWith(\".local\") || hostname.endsWith(\".localhost\") || hostname.endsWith(\".internal\")) throw new DownloadError({\n\t\turl,\n\t\tmessage: `URL with hostname ${hostname} is not allowed`\n\t});\n\tif (hostname.startsWith(\"[\") && hostname.endsWith(\"]\")) {\n\t\tif (isPrivateIPv6(hostname.slice(1, -1))) throw new DownloadError({\n\t\t\turl,\n\t\t\tmessage: `URL with IPv6 address ${hostname} is not allowed`\n\t\t});\n\t\treturn;\n\t}\n\tif (isIPv4(hostname)) {\n\t\tif (isPrivateIPv4(hostname)) throw new DownloadError({\n\t\t\turl,\n\t\t\tmessage: `URL with IP address ${hostname} is not allowed`\n\t\t});\n\t}\n}\nfunction isIPv4(hostname) {\n\tconst parts = hostname.split(\".\");\n\tif (parts.length !== 4) return false;\n\treturn parts.every((part) => {\n\t\tconst num = Number(part);\n\t\treturn Number.isInteger(num) && num >= 0 && num <= 255 && String(num) === part;\n\t});\n}\nfunction isPrivateIPv4(ip) {\n\tconst [a, b, c] = ip.split(\".\").map(Number);\n\tif (a === 0) return true;\n\tif (a === 10) return true;\n\tif (a === 100 && b >= 64 && b <= 127) return true;\n\tif (a === 127) return true;\n\tif (a === 169 && b === 254) return true;\n\tif (a === 172 && b >= 16 && b <= 31) return true;\n\tif (a === 192 && b === 0 && c === 0) return true;\n\tif (a === 192 && b === 0 && c === 2) return true;\n\tif (a === 192 && b === 168) return true;\n\tif (a === 198 && (b === 18 || b === 19)) return true;\n\tif (a === 198 && b === 51 && c === 100) return true;\n\tif (a === 203 && b === 0 && c === 113) return true;\n\tif (a >= 224) return true;\n\treturn false;\n}\n/**\n* Expands an IPv6 address string into its 8 16-bit groups, handling `::`\n* compression and an optional dotted-decimal IPv4 tail (e.g. `::ffff:127.0.0.1`).\n*\n* @returns the 8 groups, or null if the input is not a parseable IPv6 address.\n*/\nfunction parseIPv6(ip) {\n\tlet address = ip.toLowerCase();\n\tconst zoneIndex = address.indexOf(\"%\");\n\tif (zoneIndex !== -1) address = address.slice(0, zoneIndex);\n\tconst halves = address.split(\"::\");\n\tif (halves.length > 2) return null;\n\tconst toGroups = (segment) => {\n\t\tif (segment === \"\") return [];\n\t\tconst groups = [];\n\t\tconst parts = segment.split(\":\");\n\t\tfor (let i = 0; i < parts.length; i++) {\n\t\t\tconst part = parts[i];\n\t\t\tif (part.includes(\".\")) {\n\t\t\t\tif (i !== parts.length - 1 || !isIPv4(part)) return null;\n\t\t\t\tconst [a, b, c, d] = part.split(\".\").map(Number);\n\t\t\t\tgroups.push(a << 8 | b, c << 8 | d);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!/^[0-9a-f]{1,4}$/.test(part)) return null;\n\t\t\tgroups.push(parseInt(part, 16));\n\t\t}\n\t\treturn groups;\n\t};\n\tconst head = toGroups(halves[0]);\n\tif (head === null) return null;\n\tif (halves.length === 2) {\n\t\tconst tail = toGroups(halves[1]);\n\t\tif (tail === null) return null;\n\t\tconst fill = 8 - head.length - tail.length;\n\t\tif (fill < 0) return null;\n\t\treturn [\n\t\t\t...head,\n\t\t\t...new Array(fill).fill(0),\n\t\t\t...tail\n\t\t];\n\t}\n\treturn head.length === 8 ? head : null;\n}\nfunction isPrivateIPv6(ip) {\n\tconst groups = parseIPv6(ip);\n\tif (groups === null) return true;\n\tconst topZero = (count) => groups.slice(0, count).every((group) => group === 0);\n\tif (topZero(7) && (groups[7] === 0 || groups[7] === 1)) return true;\n\tif ((groups[0] & 65024) === 64512) return true;\n\tif ((groups[0] & 65472) === 65152) return true;\n\tif ((groups[0] & 65472) === 65216) return true;\n\tif ((groups[0] & 65280) === 65280) return true;\n\tif (groups[0] === 8193 && groups[1] === 3512) return true;\n\tif (groups[0] === 16383 && (groups[1] & 61440) === 0) return true;\n\tif (topZero(6) || topZero(5) && groups[5] === 65535 || topZero(4) && groups[4] === 65535 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 0 && groups[3] === 0 && groups[4] === 0 && groups[5] === 0 || groups[0] === 100 && groups[1] === 65435 && groups[2] === 1) return isPrivateIPv4(`${groups[6] >> 8 & 255}.${groups[6] & 255}.${groups[7] >> 8 & 255}.${groups[7] & 255}`);\n\treturn false;\n}\n//#endregion\n//#region src/fetch-with-validated-redirects.ts\nconst MAX_DOWNLOAD_REDIRECTS = 10;\nconst REDIRECT_STATUS_CODES = /* @__PURE__ */ new Set([\n\t301,\n\t302,\n\t303,\n\t307,\n\t308\n]);\n/**\n* Fetches one validated URL without following redirects.\n*\n* Uses the supplied fetch or the runtime's global fetch. URL validation does\n* not resolve DNS; inject a transport such as guarded-fetch on Node.js\n* when connection-time DNS validation is needed.\n* Redirects are rejected by default. Callers using `redirect: 'manual'` must\n* validate the Location target before issuing another request.\n*/\nasync function fetchWithValidatedEndpoint({ url, init, fetch: customFetch, trustedOrigin, redirect = \"error\", requireDnsValidation = false }) {\n\tconst urlText = url.toString();\n\tif (!(trustedOrigin !== void 0 && isSameOrigin(urlText, trustedOrigin))) {\n\t\tvalidateDownloadUrl(urlText);\n\t\tif (requireDnsValidation && (customFetch == null || customFetch === globalThis.fetch) && !(isBrowserRuntime() && typeof document !== \"undefined\")) throw new DownloadError({\n\t\t\turl: urlText,\n\t\t\tmessage: \"This server runtime requires a custom fetch with connect-time DNS validation for untrusted URLs\"\n\t\t});\n\t}\n\treturn await (customFetch ?? globalThis.fetch)(url, {\n\t\t...init,\n\t\tredirect\n\t});\n}\n/**\n* Fetches a URL while enforcing the download guard on every hop.\n*\n* Redirects are followed manually (`redirect: 'manual'`) so each hop is\n* validated with {@link validateDownloadUrl} *before* it is requested. Relying\n* on the default `redirect: 'follow'` would issue the request to a redirect\n* target (e.g. an internal address) before we ever see its URL, defeating the\n* guard.\n*\n* Manually followed redirects from HTTPS to HTTP are rejected before requesting\n* the target.\n*\n* Request headers are also protected: {@link sanitizeRequestHeaders} strips\n* proxy/metadata/cookie/hop-by-hop headers before the first request, and all\n* caller headers except `User-Agent` are dropped on a cross-origin redirect.\n* Credentials and custom headers are preserved on the first hop for backwards\n* compatibility. The caller must ensure that the initial URL may receive them.\n* Use `fetchUntrustedUrl` for URLs that require first-hop credential isolation.\n* The fetch spec only strips `Authorization` on cross-origin redirects because\n* in a browser, CORS preflighting protects custom headers; there is no CORS on\n* the server, so provider API keys carried in custom headers (e.g. `x-key`)\n* must be dropped here as well.\n*\n* A `redirect: 'manual'` request yields an unreadable opaque response in the\n* browser (and in other spec-compliant fetch implementations), so the redirect\n* target cannot be validated here. In a real browser this is safe to follow\n* natively because reaching an internal network is not possible (fetch is\n* constrained by CORS and cannot reach a server's internal network or\n* cloud-metadata). On any other runtime we cannot validate the hop, so we fail\n* closed rather than follow it blindly and bypass the guard.\n*\n* A hop that is same-origin with `trustedOrigin` (the developer-configured\n* provider endpoint) skips target validation: that origin is exactly what an\n* unvalidated, config-derived request would fetch anyway, and validating it\n* would break legitimate self-hosted / localhost deployments whose response\n* URLs point back at the configured host. Hops on any other origin are always\n* validated.\n*\n* The returned response is the final (non-redirect) response. The caller is\n* responsible for checking `response.ok` and reading the body.\n*\n* URL validation does not resolve DNS. Use guarded-fetch on Node.js\n* for connection-time DNS validation, or enforce network egress restrictions.\n*\n* @throws DownloadError if a hop is unsafe, the redirect limit is exceeded, or\n* a redirect cannot be validated on a non-browser runtime.\n*/\nasync function fetchWithValidatedRedirects({ url, headers, abortSignal, maxRedirects = MAX_DOWNLOAD_REDIRECTS, fetch: customFetch, trustedOrigin }) {\n\tlet currentHeaders = headers === void 0 ? void 0 : sanitizeRequestHeaders(headers);\n\tconst perHopInit = (redirect) => {\n\t\tconst init = {\n\t\t\tsignal: abortSignal,\n\t\t\tredirect\n\t\t};\n\t\tif (currentHeaders !== void 0) init.headers = new Headers(currentHeaders);\n\t\treturn init;\n\t};\n\tlet currentUrl = url;\n\tfor (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) {\n\t\tif (!(trustedOrigin !== void 0 && isSameOrigin(currentUrl, trustedOrigin))) validateDownloadUrl(currentUrl);\n\t\tconst fetch = customFetch ?? globalThis.fetch;\n\t\tconst response = await fetch(currentUrl, perHopInit(\"manual\"));\n\t\tif (response.type === \"opaqueredirect\") {\n\t\t\tif (!isBrowserRuntime()) throw new DownloadError({\n\t\t\t\turl,\n\t\t\t\tmessage: `Redirect from ${currentUrl} could not be validated and was blocked`\n\t\t\t});\n\t\t\treturn await fetch(currentUrl, perHopInit(\"follow\"));\n\t\t}\n\t\tconst location = response.headers?.get(\"location\");\n\t\tif (REDIRECT_STATUS_CODES.has(response.status) && location) {\n\t\t\tcancelResponseBody(response);\n\t\t\tconst nextUrl = new URL(location, currentUrl).toString();\n\t\t\tif (new URL(currentUrl).protocol === \"https:\" && new URL(nextUrl).protocol === \"http:\") throw new DownloadError({\n\t\t\t\turl,\n\t\t\t\tmessage: \"Redirect from HTTPS to HTTP was blocked\"\n\t\t\t});\n\t\t\tif (currentHeaders !== void 0 && !isSameOrigin(nextUrl, currentUrl)) {\n\t\t\t\tconst userAgent = currentHeaders.get(\"user-agent\");\n\t\t\t\tcurrentHeaders = new Headers(userAgent == null ? void 0 : { \"user-agent\": userAgent });\n\t\t\t}\n\t\t\tcurrentUrl = nextUrl;\n\t\t\tcontinue;\n\t\t}\n\t\treturn response;\n\t}\n\tthrow new DownloadError({\n\t\turl,\n\t\tmessage: `Too many redirects (max ${maxRedirects})`\n\t});\n}\n//#endregion\n//#region src/fetch-untrusted-url.ts\nconst SAFE_UNTRUSTED_FIRST_HOP_HEADERS = /* @__PURE__ */ new Set([\n\t\"accept\",\n\t\"accept-language\",\n\t\"baggage\",\n\t\"cache-control\",\n\t\"idempotency-key\",\n\t\"if-match\",\n\t\"if-modified-since\",\n\t\"if-none-match\",\n\t\"if-range\",\n\t\"if-unmodified-since\",\n\t\"pragma\",\n\t\"range\",\n\t\"traceparent\",\n\t\"tracestate\",\n\t\"user-agent\",\n\t\"x-correlation-id\",\n\t\"x-request-id\"\n]);\n/**\n* Fetches an untrusted URL with first-hop credential isolation and validated\n* redirects. Uses the URL validation, runtime fetch transport, redirect\n* limits, and cross-origin header stripping of {@link fetchWithValidatedRedirects}.\n* Inject guarded-fetch on Node.js for connect-time DNS validation.\n*\n* Without a matching `credentialedOrigin` (or `trustedOrigin` when it is\n* omitted), only allowlisted request metadata is sent on the first hop.\n* Arbitrary caller headers require an explicit matching origin because vendor\n* credential names cannot be inferred safely. Proxy, metadata, cookie, and\n* hop-by-hop headers are sanitized even for a matching origin.\n*\n* `trustedOrigin` also exempts same-origin hops from URL validation, allowing\n* developer-configured private endpoints. Both origin options must come from\n* developer configuration, never from untrusted response data.\n*\n* This is an opt-in alternative to `fetchWithValidatedRedirects`, whose\n* existing first-hop header behavior is preserved for compatibility.\n*/\nasync function fetchUntrustedUrl({ headers, credentialedOrigin, untrustedFirstHopHeaders, ...options }) {\n\tlet firstHopHeaders;\n\tif (headers !== void 0) {\n\t\tfirstHopHeaders = sanitizeRequestHeaders(headers);\n\t\tconst origin = credentialedOrigin ?? options.trustedOrigin;\n\t\tif (origin === void 0 || !isSameOrigin(options.url, origin)) {\n\t\t\tconst allowedHeaders = /* @__PURE__ */ new Set([...SAFE_UNTRUSTED_FIRST_HOP_HEADERS, ...(untrustedFirstHopHeaders ?? []).map((name) => name.toLowerCase())]);\n\t\t\tfirstHopHeaders = new Headers([...firstHopHeaders].filter(([name]) => allowedHeaders.has(name)));\n\t\t}\n\t}\n\treturn fetchWithValidatedRedirects({\n\t\t...options,\n\t\theaders: firstHopHeaders\n\t});\n}\n//#endregion\n//#region src/read-response-with-size-limit.ts\n/**\n* Default maximum download size: 2 GiB.\n*\n* `fetch().arrayBuffer()` has ~2x peak memory overhead (undici buffers the\n* body internally, then creates the JS ArrayBuffer), so very large downloads\n* risk exceeding the default V8 heap limit on 64-bit systems and terminating\n* the process with an out-of-memory error.\n*\n* Setting this limit converts an unrecoverable OOM crash into a catchable\n* `DownloadError`.\n*/\nconst DEFAULT_MAX_DOWNLOAD_SIZE = 2147483648;\n/**\n* Reads a fetch Response body with a size limit to prevent memory exhaustion.\n*\n* Checks the Content-Length header for early rejection, then reads the body\n* incrementally via ReadableStream and aborts with a DownloadError when the\n* limit is exceeded.\n*\n* @param response - The fetch Response to read.\n* @param url - The URL being downloaded (used in error messages).\n* @param maxBytes - Maximum allowed bytes. Defaults to DEFAULT_MAX_DOWNLOAD_SIZE.\n* @param onChunk - Optional. Receives each chunk instead of the chunks being\n* collected, so the body is not held in memory, and the returned array is empty.\n* The chunk may be a view on a larger buffer, copy what you keep.\n* @returns A Uint8Array containing the response body.\n* @throws DownloadError if the response exceeds maxBytes.\n*/\nasync function readResponseWithSizeLimit({ response, url, maxBytes = DEFAULT_MAX_DOWNLOAD_SIZE, onChunk }) {\n\tconst contentLength = response.headers.get(\"content-length\");\n\tif (contentLength != null) {\n\t\tconst length = parseInt(contentLength, 10);\n\t\tif (!isNaN(length) && length > maxBytes) {\n\t\t\tawait cancelResponseBody(response);\n\t\t\tthrow new DownloadError({\n\t\t\t\turl,\n\t\t\t\tmessage: `Download of ${url} exceeded maximum size of ${maxBytes} bytes (Content-Length: ${length}).`\n\t\t\t});\n\t\t}\n\t}\n\tconst body = response.body;\n\tif (body == null) return /* @__PURE__ */ new Uint8Array(0);\n\tconst reader = body.getReader();\n\tconst chunks = [];\n\tlet totalBytes = 0;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) break;\n\t\t\ttotalBytes += value.length;\n\t\t\tif (totalBytes > maxBytes) throw new DownloadError({\n\t\t\t\turl,\n\t\t\t\tmessage: `Download of ${url} exceeded maximum size of ${maxBytes} bytes.`\n\t\t\t});\n\t\t\tif (onChunk != null) {\n\t\t\t\tonChunk(value);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tchunks.push(value.byteLength < value.buffer.byteLength ? new Uint8Array(value) : value);\n\t\t}\n\t} finally {\n\t\ttry {\n\t\t\tawait reader.cancel();\n\t\t} catch {} finally {\n\t\t\treader.releaseLock();\n\t\t}\n\t}\n\tconst result = new Uint8Array(onChunk != null ? 0 : totalBytes);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tresult.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/download-blob.ts\n/**\n* Download a file from a URL and return it as a Blob.\n*\n* @param url - The URL to download from.\n* @param options - Optional settings for the download.\n* @param options.maxBytes - Maximum allowed download size in bytes. Defaults to 100 MiB.\n* @param options.abortSignal - An optional abort signal to cancel the download.\n* @param options.fetch - Fetch transport, e.g. guarded-fetch for DNS validation on Node.js.\n* @returns A Promise that resolves to the downloaded Blob.\n*\n* @throws DownloadError if the download fails or exceeds maxBytes.\n*/\nasync function downloadBlob(url, options) {\n\ttry {\n\t\tconst response = await fetchUntrustedUrl({\n\t\t\turl,\n\t\t\tabortSignal: options?.abortSignal,\n\t\t\tfetch: options?.fetch\n\t\t});\n\t\tif (!response.ok) {\n\t\t\tawait cancelResponseBody(response);\n\t\t\tthrow new DownloadError({\n\t\t\t\turl,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\tstatusText: response.statusText\n\t\t\t});\n\t\t}\n\t\tconst data = await readResponseWithSizeLimit({\n\t\t\tresponse,\n\t\t\turl,\n\t\t\tmaxBytes: options?.maxBytes ?? 2147483648\n\t\t});\n\t\tconst contentType = response.headers.get(\"content-type\") ?? void 0;\n\t\treturn new Blob([data], contentType ? { type: contentType } : void 0);\n\t} catch (error) {\n\t\tif (DownloadError.isInstance(error)) throw error;\n\t\tthrow new DownloadError({\n\t\t\turl,\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\n//#region src/embedding-model-capabilities.ts\n/**\n* Symbol for exposing the UTF-8 input byte budget of an embedding model.\n*\n* This capability is experimental and intentionally lives outside the versioned\n* embedding model specification.\n*/\nconst EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = Symbol.for(\"vercel.ai.embeddingModel.maxInputBytesPerCall\");\n/**\n* Symbol for transforming provider options for an automatically batched\n* embedding model call.\n*\n* This capability is experimental and intentionally lives outside the versioned\n* embedding model specification.\n*/\nconst EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER = Symbol.for(\"vercel.ai.embeddingModel.providerOptionsTransformer\");\n//#endregion\n//#region src/encode-path-segment.ts\n/**\n* Encodes a raw identifier as one URL path segment, including standalone dot\n* segments that URL parsers would otherwise normalize. Pass unencoded values;\n* for resource paths with intentional slashes, encode each segment separately.\n*/\nfunction encodePathSegment(value) {\n\tconst encodedValue = encodeURIComponent(value);\n\treturn encodedValue === \".\" ? \"%252E\" : encodedValue === \"..\" ? \"%252E%252E\" : encodedValue;\n}\n//#endregion\n//#region src/extract-lines.ts\n/**\n* Extracts a 1-based inclusive line range from `text`, auto-detecting the\n* file's line ending (`\\r\\n`, `\\n`, or `\\r`, in that priority).\n*\n* Mixed line endings are not supported: detection picks one and uses it for\n* both the split and the rejoin, so files that mix conventions will not slice\n* cleanly. When neither `startLine` nor `endLine` is provided, the input is\n* returned unchanged. `endLine` past EOF clamps to the last line.\n*/\nfunction extractLines({ text, startLine, endLine }) {\n\tif (startLine == null && endLine == null) return text;\n\tconst lineEnding = text.includes(\"\\r\\n\") ? \"\\r\\n\" : text.includes(\"\\n\") ? \"\\n\" : text.includes(\"\\r\") ? \"\\r\" : \"\\n\";\n\tconst lines = text.split(lineEnding);\n\tconst start = Math.max(1, startLine ?? 1) - 1;\n\tconst end = Math.min(lines.length, endLine ?? lines.length);\n\treturn lines.slice(start, end).join(lineEnding);\n}\n//#endregion\n//#region src/filter-nullable.ts\n/**\n* Filters `null` and `undefined` values out of a list of values.\n*\n* @param values - The values to filter.\n* @returns A new array containing only non-nullish values.\n*/\nfunction filterNullable(...values) {\n\treturn values.filter((value) => value != null);\n}\n//#endregion\n//#region src/generate-id.ts\n/**\n* Creates an ID generator.\n* The total length of the ID is the sum of the prefix, separator, and random part length.\n* Not cryptographically secure.\n*\n* @param alphabet - The alphabet to use for the ID. Default: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.\n* @param prefix - The prefix of the ID to generate. Optional.\n* @param separator - The separator between the prefix and the random part of the ID. Default: '-'.\n* @param size - The size of the random part of the ID to generate. Default: 16.\n*/\nconst createIdGenerator = ({ prefix, size = 16, alphabet = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", separator = \"-\" } = {}) => {\n\tconst generator = () => {\n\t\tconst alphabetLength = alphabet.length;\n\t\tconst chars = new Array(size);\n\t\tfor (let i = 0; i < size; i++) chars[i] = alphabet[Math.random() * alphabetLength | 0];\n\t\treturn chars.join(\"\");\n\t};\n\tif (prefix == null) return generator;\n\tif (alphabet.includes(separator)) throw new InvalidArgumentError({\n\t\targument: \"separator\",\n\t\tmessage: `The separator \"${separator}\" must not be part of the alphabet \"${alphabet}\".`\n\t});\n\treturn () => `${prefix}${separator}${generator()}`;\n};\n/**\n* Generates a 16-character random string to use for IDs.\n* Not cryptographically secure.\n*/\nconst generateId = createIdGenerator();\n//#endregion\n//#region src/get-from-api.ts\nconst getOriginalFetch$2 = () => globalThis.fetch;\nconst getFromApi = async ({ url, headers = {}, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin }) => {\n\ttry {\n\t\tconst requestFetch = fetch ?? getOriginalFetch$2();\n\t\tconst requestHeaders = withUserAgentSuffix(credentialedOrigin !== void 0 && !isSameOrigin(url, credentialedOrigin) ? {} : headers, `ai-sdk-provider-utils/${VERSION}`, getRuntimeEnvironmentUserAgent());\n\t\tconst response = validateUrl ? await fetchWithValidatedRedirects({\n\t\t\turl,\n\t\t\theaders: requestHeaders,\n\t\t\tabortSignal,\n\t\t\tfetch,\n\t\t\ttrustedOrigin\n\t\t}) : await requestFetch(url, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: requestHeaders,\n\t\t\tsignal: abortSignal\n\t\t});\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (!response.ok) {\n\t\t\tlet errorInformation;\n\t\t\ttry {\n\t\t\t\terrorInformation = await failedResponseHandler({\n\t\t\t\t\tresponse,\n\t\t\t\t\turl,\n\t\t\t\t\trequestBodyValues: {}\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t\tthrow new APICallError({\n\t\t\t\t\tmessage: \"Failed to process error response\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tstatusCode: response.status,\n\t\t\t\t\turl,\n\t\t\t\t\tresponseHeaders,\n\t\t\t\t\trequestBodyValues: {}\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow errorInformation.value;\n\t\t}\n\t\ttry {\n\t\t\treturn await successfulResponseHandler({\n\t\t\t\tresponse,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues: {}\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t}\n\t\t\tthrow new APICallError({\n\t\t\t\tmessage: \"Failed to process successful response\",\n\t\t\t\tcause: error,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\turl,\n\t\t\t\tresponseHeaders,\n\t\t\t\trequestBodyValues: {}\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow handleFetchError({\n\t\t\terror,\n\t\t\turl,\n\t\t\trequestBodyValues: {}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/inject-json-instruction.ts\nconst DEFAULT_SCHEMA_PREFIX = \"JSON schema:\";\nconst DEFAULT_SCHEMA_SUFFIX = \"You MUST answer with a JSON object that matches the JSON schema above.\";\nconst DEFAULT_GENERIC_SUFFIX = \"You MUST answer with JSON.\";\nfunction injectJsonInstruction({ prompt, schema, schemaPrefix = schema != null ? DEFAULT_SCHEMA_PREFIX : void 0, schemaSuffix = schema != null ? DEFAULT_SCHEMA_SUFFIX : DEFAULT_GENERIC_SUFFIX }) {\n\treturn [\n\t\tprompt != null && prompt.length > 0 ? prompt : void 0,\n\t\tprompt != null && prompt.length > 0 ? \"\" : void 0,\n\t\tschemaPrefix,\n\t\tschema != null ? JSON.stringify(schema) : void 0,\n\t\tschemaSuffix\n\t].filter((line) => line != null).join(\"\\n\");\n}\nfunction injectJsonInstructionIntoMessages({ messages, schema, schemaPrefix, schemaSuffix }) {\n\tconst systemMessage = messages[0]?.role === \"system\" ? { ...messages[0] } : {\n\t\trole: \"system\",\n\t\tcontent: \"\"\n\t};\n\tsystemMessage.content = injectJsonInstruction({\n\t\tprompt: systemMessage.content,\n\t\tschema,\n\t\tschemaPrefix,\n\t\tschemaSuffix\n\t});\n\treturn [systemMessage, ...messages[0]?.role === \"system\" ? messages.slice(1) : messages];\n}\n//#endregion\n//#region src/is-buffer.ts\n/**\n* Type-guard for Node.js `Buffer` instances.\n*\n* Uses optional chaining on `globalThis.Buffer` so it returns `false` in\n* runtimes where `Buffer` is not available (e.g. CloudFlare Workers).\n*/\nfunction isBuffer(value) {\n\treturn globalThis.Buffer?.isBuffer(value) ?? false;\n}\n//#endregion\n//#region src/is-non-nullable.ts\n/**\n* Type guard that checks whether a value is not `null` or `undefined`.\n*\n* @template T - The type of the value to check.\n* @param value - The value to check.\n* @returns `true` if the value is neither `null` nor `undefined`, otherwise `false`.\n*/\nfunction isNonNullable(value) {\n\treturn value != null;\n}\n//#endregion\n//#region src/is-provider-reference.ts\n/**\n* Checks whether a value is a provider reference (a mapping of provider names\n* to provider-specific identifiers) as opposed to raw bytes, a URL, or a\n* tagged `{ type: ... }` object.\n*/\nfunction isProviderReference(data) {\n\treturn typeof data === \"object\" && data !== null && !isUint8Array(data) && !(data instanceof URL) && !isArrayBuffer(data) && !isBuffer(data) && !(\"type\" in data);\n}\n//#endregion\n//#region src/is-record.ts\n/**\n* Checks whether a value is a non-null, non-array object.\n*/\nfunction isRecord(value) {\n\treturn value != null && typeof value === \"object\" && !Array.isArray(value);\n}\n//#endregion\n//#region src/is-url-supported.ts\n/**\n* Checks if the given URL is supported natively by the model.\n*\n* @param mediaType - The media type of the URL. Case-insensitive. May be a full\n*                    `type/subtype`, a wildcard `type/*`, or just the\n*                    top-level segment (e.g. `image`).\n* @param url - The URL to check.\n* @param supportedUrls - A record where keys are case-insensitive media types (or '*')\n*                        and values are arrays of RegExp patterns for URLs.\n*\n* @returns `true` if the URL matches a pattern under the specific media type\n*          or the wildcard '*', `false` otherwise.\n*/\nfunction isUrlSupported({ mediaType, url, supportedUrls }) {\n\tmediaType = mediaType.toLowerCase();\n\tconst isTopLevelOnly = !mediaType.includes(\"/\");\n\treturn Object.entries(supportedUrls).map(([key, value]) => {\n\t\tconst mediaType = key.toLowerCase();\n\t\treturn mediaType === \"*\" || mediaType === \"*/*\" ? {\n\t\t\tmediaTypePrefix: \"\",\n\t\t\tregexes: value\n\t\t} : {\n\t\t\tmediaTypePrefix: mediaType.replace(/\\*/, \"\"),\n\t\t\tregexes: value\n\t\t};\n\t}).filter(({ mediaTypePrefix }) => {\n\t\tif (mediaTypePrefix === \"\") return true;\n\t\tif (isTopLevelOnly) return `${mediaType}/` === mediaTypePrefix;\n\t\treturn mediaTypePrefix.endsWith(\"/\") ? mediaType.startsWith(mediaTypePrefix) : mediaType === mediaTypePrefix;\n\t}).flatMap(({ regexes }) => regexes).some((pattern) => testRegExpFromStart(pattern, url));\n}\nfunction testRegExpFromStart(pattern, value) {\n\tif (!pattern.global && !pattern.sticky) return pattern.test(value);\n\tconst lastIndex = pattern.lastIndex;\n\tpattern.lastIndex = 0;\n\ttry {\n\t\treturn pattern.test(value);\n\t} finally {\n\t\tpattern.lastIndex = lastIndex;\n\t}\n}\n//#endregion\n//#region src/is-valid-hostname-part.ts\n/**\n* Checks whether a value is a valid ASCII hostname part: 1–63 letters, digits,\n* or hyphens, without a leading or trailing hyphen.\n*\n* Use this before inserting a resource name, region, or location into a\n* generated hostname. Rejects values such as `evil.example.com/#` and\n* `user@localhost:8080/#` that could change the request destination.\n*/\nfunction isValidHostnamePart(value) {\n\treturn /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i.exec(value)?.[0] === value;\n}\n//#endregion\n//#region src/load-api-key.ts\nfunction loadApiKey({ apiKey, environmentVariableName, apiKeyParameterName = \"apiKey\", description }) {\n\tif (typeof apiKey === \"string\") return apiKey;\n\tif (apiKey != null) throw new LoadAPIKeyError({ message: `${description} API key must be a string.` });\n\tif (typeof process === \"undefined\") throw new LoadAPIKeyError({ message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.` });\n\tapiKey = process.env[environmentVariableName];\n\tif (apiKey == null) throw new LoadAPIKeyError({ message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.` });\n\tif (typeof apiKey !== \"string\") throw new LoadAPIKeyError({ message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.` });\n\treturn apiKey;\n}\n//#endregion\n//#region src/load-optional-setting.ts\n/**\n* Loads an optional `string` setting from the environment or a parameter.\n*\n* @param settingValue - The setting value.\n* @param environmentVariableName - The environment variable name.\n* @returns The setting value.\n*/\nfunction loadOptionalSetting({ settingValue, environmentVariableName }) {\n\tif (typeof settingValue === \"string\") return settingValue;\n\tif (settingValue != null || typeof process === \"undefined\") return;\n\tsettingValue = process.env[environmentVariableName];\n\tif (settingValue == null || typeof settingValue !== \"string\") return;\n\treturn settingValue;\n}\n//#endregion\n//#region src/load-setting.ts\n/**\n* Loads a `string` setting from the environment or a parameter.\n*\n* @param settingValue - The setting value.\n* @param environmentVariableName - The environment variable name.\n* @param settingName - The setting name.\n* @param description - The description of the setting.\n* @returns The setting value.\n*/\nfunction loadSetting({ settingValue, environmentVariableName, settingName, description }) {\n\tif (typeof settingValue === \"string\") return settingValue;\n\tif (settingValue != null) throw new LoadSettingError({ message: `${description} setting must be a string.` });\n\tif (typeof process === \"undefined\") throw new LoadSettingError({ message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.` });\n\tsettingValue = process.env[environmentVariableName];\n\tif (settingValue == null) throw new LoadSettingError({ message: `${description} setting is missing. Pass it using the '${settingName}' parameter or the ${environmentVariableName} environment variable.` });\n\tif (typeof settingValue !== \"string\") throw new LoadSettingError({ message: `${description} setting must be a string. The value of the ${environmentVariableName} environment variable is not a string.` });\n\treturn settingValue;\n}\n//#endregion\n//#region src/map-reasoning-to-provider.ts\n/**\n* Reasoning levels in ascending order.\n*/\nconst REASONING_LEVELS = [\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\",\n\t\"max\"\n];\nfunction isCustomReasoning(reasoning) {\n\treturn reasoning !== void 0 && reasoning !== \"provider-default\";\n}\n/**\n* Maps a top-level reasoning value to a provider-specific effort string.\n*\n* A `providerOptionsEffort` (the reasoning effort set in provider options) is\n* returned unchanged. Otherwise, `undefined` and `'provider-default'` return\n* `undefined`, and other reasoning values are mapped with the effort map.\n*\n* The effort map should only contain the values that the model supports. An\n* unsupported value maps to the next lower supported level, or the next higher\n* one if there is no lower level. `'none'` is never used as a fallback, so an\n* unsupported `'none'` maps to the lowest supported level.\n*\n* Pushes a compatibility warning if the effort that is sent differs from the\n* requested value, or an unsupported warning if the effort map is empty.\n*\n* @returns The provider options effort, the mapped effort string, or\n*   `undefined` if no effort should be sent.\n*/\nfunction mapReasoningToProviderEffort({ reasoning, effortMap, providerOptionsEffort, warnings }) {\n\tif (providerOptionsEffort != null) return providerOptionsEffort;\n\tif (!isCustomReasoning(reasoning)) return;\n\tconst index = REASONING_LEVELS.indexOf(reasoning);\n\tconst level = [\n\t\treasoning,\n\t\t...REASONING_LEVELS.slice(0, Math.max(index, 0)).reverse(),\n\t\t...REASONING_LEVELS.slice(index + 1)\n\t].find((candidate) => effortMap[candidate] != null);\n\tif (level == null) {\n\t\twarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"reasoning\",\n\t\t\tdetails: `reasoning \"${reasoning}\" is not supported by this model.`\n\t\t});\n\t\treturn;\n\t}\n\tconst mapped = effortMap[level];\n\tif (mapped !== reasoning) warnings.push({\n\t\ttype: \"compatibility\",\n\t\tfeature: \"reasoning\",\n\t\tdetails: `reasoning \"${reasoning}\" is not directly supported by this model. mapped to effort \"${mapped}\".`\n\t});\n\treturn mapped;\n}\nconst DEFAULT_REASONING_BUDGET_PERCENTAGES = {\n\tminimal: .02,\n\tlow: .1,\n\tmedium: .3,\n\thigh: .6,\n\txhigh: .9,\n\tmax: .95\n};\n/**\n* Maps a top-level reasoning value to an absolute token budget by multiplying\n* the model's max output tokens by a percentage for the level. Levels missing\n* from `budgetPercentages` use the default percentages. The result is clamped\n* between `minReasoningBudget` (default 1024) and `maxReasoningBudget`.\n*\n* Handle `'none'` before calling this function when the model can disable\n* reasoning. Otherwise, `'none'` maps to `minReasoningBudget` with a\n* compatibility warning.\n*\n* @returns The computed token budget.\n*/\nfunction mapReasoningToProviderBudget({ reasoning, maxOutputTokens, maxReasoningBudget, minReasoningBudget = 1024, budgetPercentages, warnings }) {\n\tif (reasoning === \"none\") {\n\t\twarnings.push({\n\t\t\ttype: \"compatibility\",\n\t\t\tfeature: \"reasoning\",\n\t\t\tdetails: `reasoning \"none\" is not supported by this model. mapped to the minimum reasoning budget of ${minReasoningBudget} tokens.`\n\t\t});\n\t\treturn minReasoningBudget;\n\t}\n\tconst percentage = budgetPercentages?.[reasoning] ?? DEFAULT_REASONING_BUDGET_PERCENTAGES[reasoning];\n\treturn Math.min(maxReasoningBudget, Math.max(minReasoningBudget, Math.round(maxOutputTokens * percentage)));\n}\n//#endregion\n//#region src/media-type-to-extension.ts\n/**\n* Maps a media type to its corresponding file extension.\n* It was originally introduced to set a filename for audio file uploads\n* in https://github.com/vercel/ai/pull/8159.\n*\n* @param mediaType The media type to map.\n* @returns The corresponding file extension\n* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types\n*/\nfunction mediaTypeToExtension(mediaType) {\n\tconst [_type, subtype = \"\"] = mediaType.toLowerCase().split(\"/\");\n\treturn {\n\t\tmpeg: \"mp3\",\n\t\t\"x-wav\": \"wav\",\n\t\topus: \"ogg\",\n\t\tmp4: \"m4a\",\n\t\t\"x-m4a\": \"m4a\"\n\t}[subtype] ?? subtype;\n}\n//#endregion\n//#region src/normalize-batch-request-counts.ts\n/**\n* Normalizes complete batch request counts.\n*\n* Returns `undefined` when any count is missing, is not a non-negative safe\n* integer, or when the item counts do not add up to the total.\n*/\nfunction normalizeBatchRequestCounts({ total, pending, completed, failed }) {\n\tif (isNonNegativeSafeInteger(total) && isNonNegativeSafeInteger(pending) && isNonNegativeSafeInteger(completed) && isNonNegativeSafeInteger(failed) && pending + completed + failed === total) return {\n\t\ttotal,\n\t\tpending,\n\t\tcompleted,\n\t\tfailed\n\t};\n}\nfunction isNonNegativeSafeInteger(value) {\n\treturn value != null && Number.isSafeInteger(value) && value >= 0;\n}\n//#endregion\n//#region src/secure-json-parse.ts\nconst suspectProtoRx = /\"(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])(?:p|\\\\u0070)(?:r|\\\\u0072)(?:o|\\\\u006[Ff])(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:_|\\\\u005[Ff])(?:_|\\\\u005[Ff])\"\\s*:/;\nconst suspectConstructorRx = /\"(?:c|\\\\u0063)(?:o|\\\\u006[Ff])(?:n|\\\\u006[Ee])(?:s|\\\\u0073)(?:t|\\\\u0074)(?:r|\\\\u0072)(?:u|\\\\u0075)(?:c|\\\\u0063)(?:t|\\\\u0074)(?:o|\\\\u006[Ff])(?:r|\\\\u0072)\"\\s*:/;\nfunction _parse(text) {\n\tconst obj = JSON.parse(text);\n\tif (obj === null || typeof obj !== \"object\") return obj;\n\tif (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) return obj;\n\treturn filter(obj);\n}\nfunction filter(obj) {\n\tlet next = [obj];\n\twhile (next.length) {\n\t\tconst nodes = next;\n\t\tnext = [];\n\t\tfor (const node of nodes) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(node, \"__proto__\")) throw new SyntaxError(\"Object contains forbidden prototype property\");\n\t\t\tif (Object.prototype.hasOwnProperty.call(node, \"constructor\") && node.constructor !== null && typeof node.constructor === \"object\" && Object.prototype.hasOwnProperty.call(node.constructor, \"prototype\")) throw new SyntaxError(\"Object contains forbidden prototype property\");\n\t\t\tfor (const key in node) {\n\t\t\t\tconst value = node[key];\n\t\t\t\tif (value && typeof value === \"object\") next.push(value);\n\t\t\t}\n\t\t}\n\t}\n\treturn obj;\n}\nfunction secureJsonParse(text) {\n\tconst { stackTraceLimit } = Error;\n\ttry {\n\t\tError.stackTraceLimit = 0;\n\t} catch {\n\t\treturn _parse(text);\n\t}\n\ttry {\n\t\treturn _parse(text);\n\t} finally {\n\t\tError.stackTraceLimit = stackTraceLimit;\n\t}\n}\n//#endregion\n//#region src/add-additional-properties-to-json-schema.ts\n/**\n* Recursively adds additionalProperties: false to object schemas that do not\n* define a schema for their additional properties. This is necessary because\n* some providers (e.g. OpenAI) do not support additionalProperties: true.\n*/\nfunction addAdditionalPropertiesToJsonSchema(jsonSchema) {\n\tif (jsonSchema.type === \"object\" || Array.isArray(jsonSchema.type) && jsonSchema.type.includes(\"object\")) {\n\t\tconst { additionalProperties } = jsonSchema;\n\t\tjsonSchema.additionalProperties = additionalProperties != null && typeof additionalProperties !== \"boolean\" ? visit(additionalProperties) : false;\n\t\tconst { properties } = jsonSchema;\n\t\tif (properties != null) for (const key of Object.keys(properties)) properties[key] = visit(properties[key]);\n\t}\n\tif (jsonSchema.items != null) jsonSchema.items = Array.isArray(jsonSchema.items) ? jsonSchema.items.map(visit) : visit(jsonSchema.items);\n\tif (jsonSchema.anyOf != null) jsonSchema.anyOf = jsonSchema.anyOf.map(visit);\n\tif (jsonSchema.allOf != null) jsonSchema.allOf = jsonSchema.allOf.map(visit);\n\tif (jsonSchema.oneOf != null) jsonSchema.oneOf = jsonSchema.oneOf.map(visit);\n\tconst { definitions } = jsonSchema;\n\tif (definitions != null) for (const key of Object.keys(definitions)) definitions[key] = visit(definitions[key]);\n\treturn jsonSchema;\n}\nfunction visit(def) {\n\tif (typeof def === \"boolean\") return def;\n\treturn addAdditionalPropertiesToJsonSchema(def);\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/options.ts\nconst ignoreOverride = Symbol(\"Let zodToJsonSchema decide on which parser to use\");\nconst defaultOptions = {\n\tname: void 0,\n\t$refStrategy: \"root\",\n\tbasePath: [\"#\"],\n\teffectStrategy: \"input\",\n\tpipeStrategy: \"all\",\n\tdateStrategy: \"format:date-time\",\n\tmapStrategy: \"entries\",\n\tremoveAdditionalStrategy: \"passthrough\",\n\tallowedAdditionalProperties: true,\n\trejectedAdditionalProperties: false,\n\tdefinitionPath: \"definitions\",\n\tstrictUnions: false,\n\tdefinitions: {},\n\terrorMessages: false,\n\tpatternStrategy: \"escape\",\n\tapplyRegexFlags: false,\n\temailStrategy: \"format:email\",\n\tbase64Strategy: \"contentEncoding:base64\",\n\tnameStrategy: \"ref\"\n};\nconst getDefaultOptions = (options) => typeof options === \"string\" ? {\n\t...defaultOptions,\n\tname: options\n} : {\n\t...defaultOptions,\n\t...options\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/any.ts\nfunction parseAnyDef() {\n\treturn {};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/array.ts\nfunction parseArrayDef(def, refs) {\n\tconst res = { type: \"array\" };\n\tif (def.type?._def && def.type?._def?.typeName !== \"ZodAny\") res.items = parseDef(def.type._def, {\n\t\t...refs,\n\t\tcurrentPath: [...refs.currentPath, \"items\"]\n\t});\n\tif (def.minLength) res.minItems = def.minLength.value;\n\tif (def.maxLength) res.maxItems = def.maxLength.value;\n\tif (def.exactLength) {\n\t\tres.minItems = def.exactLength.value;\n\t\tres.maxItems = def.exactLength.value;\n\t}\n\treturn res;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/bigint.ts\nfunction parseBigintDef(def) {\n\tconst res = {\n\t\ttype: \"integer\",\n\t\tformat: \"int64\"\n\t};\n\tif (!def.checks) return res;\n\tfor (const check of def.checks) switch (check.kind) {\n\t\tcase \"min\":\n\t\t\tif (check.inclusive) res.minimum = check.value;\n\t\t\telse res.exclusiveMinimum = check.value;\n\t\t\tbreak;\n\t\tcase \"max\":\n\t\t\tif (check.inclusive) res.maximum = check.value;\n\t\t\telse res.exclusiveMaximum = check.value;\n\t\t\tbreak;\n\t\tcase \"multipleOf\": res.multipleOf = check.value;\n\t}\n\treturn res;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/boolean.ts\nfunction parseBooleanDef() {\n\treturn { type: \"boolean\" };\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/branded.ts\nfunction parseBrandedDef(_def, refs) {\n\treturn parseDef(_def.type._def, refs);\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/catch.ts\nconst parseCatchDef = (def, refs) => {\n\treturn parseDef(def.innerType._def, refs);\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/date.ts\nfunction parseDateDef(def, refs, overrideDateStrategy) {\n\tconst strategy = overrideDateStrategy ?? refs.dateStrategy;\n\tif (Array.isArray(strategy)) return { anyOf: strategy.map((item) => parseDateDef(def, refs, item)) };\n\tswitch (strategy) {\n\t\tcase \"string\":\n\t\tcase \"format:date-time\": return {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date-time\"\n\t\t};\n\t\tcase \"format:date\": return {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date\"\n\t\t};\n\t\tcase \"integer\": return integerDateParser(def);\n\t}\n}\nconst integerDateParser = (def) => {\n\tconst res = {\n\t\ttype: \"integer\",\n\t\tformat: \"unix-time\"\n\t};\n\tfor (const check of def.checks) switch (check.kind) {\n\t\tcase \"min\":\n\t\t\tres.minimum = check.value;\n\t\t\tbreak;\n\t\tcase \"max\": res.maximum = check.value;\n\t}\n\treturn res;\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/default.ts\nfunction parseDefaultDef(_def, refs) {\n\treturn {\n\t\t...parseDef(_def.innerType._def, refs),\n\t\tdefault: _def.defaultValue()\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/effects.ts\nfunction parseEffectsDef(_def, refs) {\n\treturn refs.effectStrategy === \"input\" ? parseDef(_def.schema._def, refs) : parseAnyDef();\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/enum.ts\nfunction parseEnumDef(def) {\n\treturn {\n\t\ttype: \"string\",\n\t\tenum: Array.from(def.values)\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/intersection.ts\nconst isJsonSchema7AllOfType = (type) => {\n\tif (\"type\" in type && type.type === \"string\") return false;\n\treturn \"allOf\" in type;\n};\nfunction parseIntersectionDef(def, refs) {\n\tconst allOf = [parseDef(def.left._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"allOf\",\n\t\t\t\"0\"\n\t\t]\n\t}), parseDef(def.right._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"allOf\",\n\t\t\t\"1\"\n\t\t]\n\t})].filter((x) => !!x);\n\tconst mergedAllOf = [];\n\tallOf.forEach((schema) => {\n\t\tif (isJsonSchema7AllOfType(schema)) mergedAllOf.push(...schema.allOf);\n\t\telse {\n\t\t\tlet nestedSchema = schema;\n\t\t\tif (\"additionalProperties\" in schema && schema.additionalProperties === false) {\n\t\t\t\tconst { additionalProperties: _additionalProperties, ...rest } = schema;\n\t\t\t\tnestedSchema = rest;\n\t\t\t}\n\t\t\tmergedAllOf.push(nestedSchema);\n\t\t}\n\t});\n\treturn mergedAllOf.length ? { allOf: mergedAllOf } : void 0;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/literal.ts\nfunction parseLiteralDef(def) {\n\tconst parsedType = typeof def.value;\n\tif (parsedType !== \"bigint\" && parsedType !== \"number\" && parsedType !== \"boolean\" && parsedType !== \"string\") return { type: Array.isArray(def.value) ? \"array\" : \"object\" };\n\treturn {\n\t\ttype: parsedType === \"bigint\" ? \"integer\" : parsedType,\n\t\tconst: def.value\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/string.ts\nlet emojiRegex = void 0;\n/**\n* Generated from the regular expressions found here as of 2024-05-22:\n* https://github.com/colinhacks/zod/blob/master/src/types.ts.\n*\n* Expressions with /i flag have been changed accordingly.\n*/\nconst zodPatterns = {\n\t/**\n\t* `c` was changed to `[cC]` to replicate /i flag\n\t*/\n\tcuid: /^[cC][^\\s-]{8,}$/,\n\tcuid2: /^[0-9a-z]+$/,\n\tulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,\n\t/**\n\t* `a-z` was added to replicate /i flag\n\t*/\n\temail: /^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_'+\\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,}$/,\n\t/**\n\t* Constructed a valid Unicode RegExp\n\t*\n\t* Lazily instantiate since this type of regex isn't supported\n\t* in all envs (e.g. React Native).\n\t*\n\t* See:\n\t* https://github.com/colinhacks/zod/issues/2433\n\t* Fix in Zod:\n\t* https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b\n\t*/\n\temoji: () => {\n\t\tif (emojiRegex === void 0) emojiRegex = RegExp(\"^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$\", \"u\");\n\t\treturn emojiRegex;\n\t},\n\t/**\n\t* Unused\n\t*/\n\tuuid: /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/,\n\t/**\n\t* Unused\n\t*/\n\tipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,\n\tipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/,\n\t/**\n\t* Unused\n\t*/\n\tipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,\n\tipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,\n\tbase64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,\n\tbase64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,\n\tnanoid: /^[a-zA-Z0-9_-]{21}$/,\n\tjwt: /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/\n};\nfunction parseStringDef(def, refs) {\n\tconst res = { type: \"string\" };\n\tif (def.checks) for (const check of def.checks) switch (check.kind) {\n\t\tcase \"min\":\n\t\t\tres.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n\t\t\tbreak;\n\t\tcase \"max\":\n\t\t\tres.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n\t\t\tbreak;\n\t\tcase \"email\":\n\t\t\tswitch (refs.emailStrategy) {\n\t\t\t\tcase \"format:email\":\n\t\t\t\t\taddFormat(res, \"email\", check.message, refs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"format:idn-email\":\n\t\t\t\t\taddFormat(res, \"idn-email\", check.message, refs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"pattern:zod\": addPattern(res, zodPatterns.email, check.message, refs);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"url\":\n\t\t\taddFormat(res, \"uri\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"uuid\":\n\t\t\taddFormat(res, \"uuid\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"regex\":\n\t\t\taddPattern(res, check.regex, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"cuid\":\n\t\t\taddPattern(res, zodPatterns.cuid, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"cuid2\":\n\t\t\taddPattern(res, zodPatterns.cuid2, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"startsWith\":\n\t\t\taddPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);\n\t\t\tbreak;\n\t\tcase \"endsWith\":\n\t\t\taddPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);\n\t\t\tbreak;\n\t\tcase \"datetime\":\n\t\t\taddFormat(res, \"date-time\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"date\":\n\t\t\taddFormat(res, \"date\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"time\":\n\t\t\taddFormat(res, \"time\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"duration\":\n\t\t\taddFormat(res, \"duration\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"length\":\n\t\t\tres.minLength = typeof res.minLength === \"number\" ? Math.max(res.minLength, check.value) : check.value;\n\t\t\tres.maxLength = typeof res.maxLength === \"number\" ? Math.min(res.maxLength, check.value) : check.value;\n\t\t\tbreak;\n\t\tcase \"includes\":\n\t\t\taddPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);\n\t\t\tbreak;\n\t\tcase \"ip\":\n\t\t\tif (check.version !== \"v6\") addFormat(res, \"ipv4\", check.message, refs);\n\t\t\tif (check.version !== \"v4\") addFormat(res, \"ipv6\", check.message, refs);\n\t\t\tbreak;\n\t\tcase \"base64url\":\n\t\t\taddPattern(res, zodPatterns.base64url, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"jwt\":\n\t\t\taddPattern(res, zodPatterns.jwt, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"cidr\":\n\t\t\tif (check.version !== \"v6\") addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);\n\t\t\tif (check.version !== \"v4\") addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"emoji\":\n\t\t\taddPattern(res, zodPatterns.emoji(), check.message, refs);\n\t\t\tbreak;\n\t\tcase \"ulid\":\n\t\t\taddPattern(res, zodPatterns.ulid, check.message, refs);\n\t\t\tbreak;\n\t\tcase \"base64\":\n\t\t\tswitch (refs.base64Strategy) {\n\t\t\t\tcase \"format:binary\":\n\t\t\t\t\taddFormat(res, \"binary\", check.message, refs);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"contentEncoding:base64\":\n\t\t\t\t\tres.contentEncoding = \"base64\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"pattern:zod\": addPattern(res, zodPatterns.base64, check.message, refs);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"nanoid\": addPattern(res, zodPatterns.nanoid, check.message, refs);\n\t}\n\treturn res;\n}\nfunction escapeLiteralCheckValue(literal, refs) {\n\treturn refs.patternStrategy === \"escape\" ? escapeNonAlphaNumeric(literal) : literal;\n}\nconst ALPHA_NUMERIC = /* @__PURE__ */ new Set(\"ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789\");\nfunction escapeNonAlphaNumeric(source) {\n\tlet result = \"\";\n\tfor (let i = 0; i < source.length; i++) {\n\t\tif (!ALPHA_NUMERIC.has(source[i])) result += \"\\\\\";\n\t\tresult += source[i];\n\t}\n\treturn result;\n}\nfunction addFormat(schema, value, message, refs) {\n\tif (schema.format || schema.anyOf?.some((x) => x.format)) {\n\t\tif (!schema.anyOf) schema.anyOf = [];\n\t\tif (schema.format) {\n\t\t\tschema.anyOf.push({ format: schema.format });\n\t\t\tdelete schema.format;\n\t\t}\n\t\tschema.anyOf.push({\n\t\t\tformat: value,\n\t\t\t...message && refs.errorMessages && { errorMessage: { format: message } }\n\t\t});\n\t} else schema.format = value;\n}\nfunction addPattern(schema, regex, message, refs) {\n\tif (schema.pattern || schema.allOf?.some((x) => x.pattern)) {\n\t\tif (!schema.allOf) schema.allOf = [];\n\t\tif (schema.pattern) {\n\t\t\tschema.allOf.push({ pattern: schema.pattern });\n\t\t\tdelete schema.pattern;\n\t\t}\n\t\tschema.allOf.push({\n\t\t\tpattern: stringifyRegExpWithFlags(regex, refs),\n\t\t\t...message && refs.errorMessages && { errorMessage: { pattern: message } }\n\t\t});\n\t} else schema.pattern = stringifyRegExpWithFlags(regex, refs);\n}\nfunction stringifyRegExpWithFlags(regex, refs) {\n\tif (!refs.applyRegexFlags || !regex.flags) return regex.source;\n\tconst flags = {\n\t\ti: regex.flags.includes(\"i\"),\n\t\tm: regex.flags.includes(\"m\"),\n\t\ts: regex.flags.includes(\"s\")\n\t};\n\tconst source = flags.i ? regex.source.toLowerCase() : regex.source;\n\tlet pattern = \"\";\n\tlet isEscaped = false;\n\tlet inCharGroup = false;\n\tlet inCharRange = false;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tif (isEscaped) {\n\t\t\tpattern += source[i];\n\t\t\tisEscaped = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (flags.i) {\n\t\t\tif (inCharGroup) {\n\t\t\t\tif (source[i].match(/[a-z]/)) {\n\t\t\t\t\tif (inCharRange) {\n\t\t\t\t\t\tpattern += source[i];\n\t\t\t\t\t\tpattern += `${source[i - 2]}-${source[i]}`.toUpperCase();\n\t\t\t\t\t\tinCharRange = false;\n\t\t\t\t\t} else if (source[i + 1] === \"-\" && source[i + 2]?.match(/[a-z]/)) {\n\t\t\t\t\t\tpattern += source[i];\n\t\t\t\t\t\tinCharRange = true;\n\t\t\t\t\t} else pattern += `${source[i]}${source[i].toUpperCase()}`;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (source[i].match(/[a-z]/)) {\n\t\t\t\tpattern += `[${source[i]}${source[i].toUpperCase()}]`;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (flags.m) {\n\t\t\tif (source[i] === \"^\") {\n\t\t\t\tpattern += `(^|(?<=[\\r\\n]))`;\n\t\t\t\tcontinue;\n\t\t\t} else if (source[i] === \"$\") {\n\t\t\t\tpattern += `($|(?=[\\r\\n]))`;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (flags.s && source[i] === \".\") {\n\t\t\tpattern += inCharGroup ? `${source[i]}\\r\\n` : `[${source[i]}\\r\\n]`;\n\t\t\tcontinue;\n\t\t}\n\t\tpattern += source[i];\n\t\tif (source[i] === \"\\\\\") isEscaped = true;\n\t\telse if (inCharGroup && source[i] === \"]\") inCharGroup = false;\n\t\telse if (!inCharGroup && source[i] === \"[\") inCharGroup = true;\n\t}\n\ttry {\n\t\tnew RegExp(pattern);\n\t} catch {\n\t\tconsole.warn(`Could not convert regex pattern at ${refs.currentPath.join(\"/\")} to a flag-independent form! Falling back to the flag-ignorant source`);\n\t\treturn regex.source;\n\t}\n\treturn pattern;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/record.ts\nfunction parseRecordDef(def, refs) {\n\tconst schema = {\n\t\ttype: \"object\",\n\t\tadditionalProperties: parseDef(def.valueType._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [...refs.currentPath, \"additionalProperties\"]\n\t\t}) ?? refs.allowedAdditionalProperties\n\t};\n\tif (def.keyType?._def.typeName === \"ZodString\" && def.keyType._def.checks?.length) {\n\t\tconst { type: _type, ...keyType } = parseStringDef(def.keyType._def, refs);\n\t\treturn {\n\t\t\t...schema,\n\t\t\tpropertyNames: keyType\n\t\t};\n\t} else if (def.keyType?._def.typeName === \"ZodEnum\") return {\n\t\t...schema,\n\t\tpropertyNames: { enum: def.keyType._def.values }\n\t};\n\telse if (def.keyType?._def.typeName === \"ZodBranded\" && def.keyType._def.type._def.typeName === \"ZodString\" && def.keyType._def.type._def.checks?.length) {\n\t\tconst { type: _type, ...keyType } = parseBrandedDef(def.keyType._def, refs);\n\t\treturn {\n\t\t\t...schema,\n\t\t\tpropertyNames: keyType\n\t\t};\n\t}\n\treturn schema;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/map.ts\nfunction parseMapDef(def, refs) {\n\tif (refs.mapStrategy === \"record\") return parseRecordDef(def, refs);\n\treturn {\n\t\ttype: \"array\",\n\t\tmaxItems: 125,\n\t\titems: {\n\t\t\ttype: \"array\",\n\t\t\titems: [parseDef(def.keyType._def, {\n\t\t\t\t...refs,\n\t\t\t\tcurrentPath: [\n\t\t\t\t\t...refs.currentPath,\n\t\t\t\t\t\"items\",\n\t\t\t\t\t\"items\",\n\t\t\t\t\t\"0\"\n\t\t\t\t]\n\t\t\t}) || parseAnyDef(), parseDef(def.valueType._def, {\n\t\t\t\t...refs,\n\t\t\t\tcurrentPath: [\n\t\t\t\t\t...refs.currentPath,\n\t\t\t\t\t\"items\",\n\t\t\t\t\t\"items\",\n\t\t\t\t\t\"1\"\n\t\t\t\t]\n\t\t\t}) || parseAnyDef()],\n\t\t\tminItems: 2,\n\t\t\tmaxItems: 2\n\t\t}\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/native-enum.ts\nfunction parseNativeEnumDef(def) {\n\tconst object = def.values;\n\tconst actualValues = Object.keys(def.values).filter((key) => {\n\t\treturn typeof object[object[key]] !== \"number\";\n\t}).map((key) => object[key]);\n\tconst parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));\n\treturn {\n\t\ttype: parsedTypes.length === 1 ? parsedTypes[0] === \"string\" ? \"string\" : \"number\" : [\"string\", \"number\"],\n\t\tenum: actualValues\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/never.ts\nfunction parseNeverDef() {\n\treturn { not: parseAnyDef() };\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/null.ts\nfunction parseNullDef() {\n\treturn { type: \"null\" };\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/union.ts\nconst primitiveMappings = {\n\tZodString: \"string\",\n\tZodNumber: \"number\",\n\tZodBigInt: \"integer\",\n\tZodBoolean: \"boolean\",\n\tZodNull: \"null\"\n};\nfunction parseUnionDef(def, refs) {\n\tconst options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;\n\tif (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {\n\t\tconst types = options.reduce((types, x) => {\n\t\t\tconst type = primitiveMappings[x._def.typeName];\n\t\t\treturn type && !types.includes(type) ? [...types, type] : types;\n\t\t}, []);\n\t\treturn { type: types.length > 1 ? types : types[0] };\n\t} else if (options.every((x) => x._def.typeName === \"ZodLiteral\" && !x.description)) {\n\t\tconst types = options.reduce((acc, x) => {\n\t\t\tconst type = typeof x._def.value;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"string\":\n\t\t\t\tcase \"number\":\n\t\t\t\tcase \"boolean\": return [...acc, type];\n\t\t\t\tcase \"bigint\": return [...acc, \"integer\"];\n\t\t\t\tcase \"object\": if (x._def.value === null) return [...acc, \"null\"];\n\t\t\t\tdefault: return acc;\n\t\t\t}\n\t\t}, []);\n\t\tif (types.length === options.length) {\n\t\t\tconst uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);\n\t\t\treturn {\n\t\t\t\ttype: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],\n\t\t\t\tenum: options.reduce((acc, x) => {\n\t\t\t\t\treturn acc.includes(x._def.value) ? acc : [...acc, x._def.value];\n\t\t\t\t}, [])\n\t\t\t};\n\t\t}\n\t} else if (options.every((x) => x._def.typeName === \"ZodEnum\")) return {\n\t\ttype: \"string\",\n\t\tenum: options.reduce((acc, x) => [...acc, ...x._def.values.filter((x) => !acc.includes(x))], [])\n\t};\n\treturn asAnyOf(def, refs);\n}\nconst asAnyOf = (def, refs) => {\n\tconst anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"anyOf\",\n\t\t\t`${i}`\n\t\t]\n\t})).filter((x) => !!x && (!refs.strictUnions || typeof x === \"object\" && Object.keys(x).length > 0));\n\treturn anyOf.length ? { anyOf } : void 0;\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/nullable.ts\nfunction parseNullableDef(def, refs) {\n\tif ([\n\t\t\"ZodString\",\n\t\t\"ZodNumber\",\n\t\t\"ZodBigInt\",\n\t\t\"ZodBoolean\",\n\t\t\"ZodNull\"\n\t].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length)) return { type: [primitiveMappings[def.innerType._def.typeName], \"null\"] };\n\tconst base = parseDef(def.innerType._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"anyOf\",\n\t\t\t\"0\"\n\t\t]\n\t});\n\treturn base && { anyOf: [base, { type: \"null\" }] };\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/number.ts\nfunction parseNumberDef(def) {\n\tconst res = { type: \"number\" };\n\tif (!def.checks) return res;\n\tfor (const check of def.checks) switch (check.kind) {\n\t\tcase \"int\":\n\t\t\tres.type = \"integer\";\n\t\t\tbreak;\n\t\tcase \"min\":\n\t\t\tif (check.inclusive) res.minimum = check.value;\n\t\t\telse res.exclusiveMinimum = check.value;\n\t\t\tbreak;\n\t\tcase \"max\":\n\t\t\tif (check.inclusive) res.maximum = check.value;\n\t\t\telse res.exclusiveMaximum = check.value;\n\t\t\tbreak;\n\t\tcase \"multipleOf\": res.multipleOf = check.value;\n\t}\n\treturn res;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/object.ts\nfunction parseObjectDef(def, refs) {\n\tconst result = {\n\t\ttype: \"object\",\n\t\tproperties: {}\n\t};\n\tconst required = [];\n\tconst shape = def.shape();\n\tfor (const propName in shape) {\n\t\tlet propDef = shape[propName];\n\t\tif (propDef === void 0 || propDef._def === void 0) continue;\n\t\tconst propOptional = safeIsOptional(propDef);\n\t\tconst parsedDef = parseDef(propDef._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [\n\t\t\t\t...refs.currentPath,\n\t\t\t\t\"properties\",\n\t\t\t\tpropName\n\t\t\t],\n\t\t\tpropertyPath: [\n\t\t\t\t...refs.currentPath,\n\t\t\t\t\"properties\",\n\t\t\t\tpropName\n\t\t\t]\n\t\t});\n\t\tif (parsedDef === void 0) continue;\n\t\tresult.properties[propName] = parsedDef;\n\t\tif (!propOptional) required.push(propName);\n\t}\n\tif (required.length) result.required = required;\n\tconst additionalProperties = decideAdditionalProperties(def, refs);\n\tif (additionalProperties !== void 0) result.additionalProperties = additionalProperties;\n\treturn result;\n}\nfunction decideAdditionalProperties(def, refs) {\n\tif (def.catchall._def.typeName !== \"ZodNever\") return parseDef(def.catchall._def, {\n\t\t...refs,\n\t\tcurrentPath: [...refs.currentPath, \"additionalProperties\"]\n\t});\n\tswitch (def.unknownKeys) {\n\t\tcase \"passthrough\": return refs.allowedAdditionalProperties;\n\t\tcase \"strict\": return refs.rejectedAdditionalProperties;\n\t\tcase \"strip\": return refs.removeAdditionalStrategy === \"strict\" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;\n\t}\n}\nfunction safeIsOptional(schema) {\n\ttry {\n\t\treturn schema.isOptional();\n\t} catch {\n\t\treturn true;\n\t}\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/optional.ts\nconst parseOptionalDef = (def, refs) => {\n\tif (refs.currentPath.toString() === refs.propertyPath?.toString()) return parseDef(def.innerType._def, refs);\n\tconst innerSchema = parseDef(def.innerType._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"anyOf\",\n\t\t\t\"1\"\n\t\t]\n\t});\n\treturn innerSchema ? { anyOf: [{ not: parseAnyDef() }, innerSchema] } : parseAnyDef();\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/pipeline.ts\nconst parsePipelineDef = (def, refs) => {\n\tif (refs.pipeStrategy === \"input\") return parseDef(def.in._def, refs);\n\telse if (refs.pipeStrategy === \"output\") return parseDef(def.out._def, refs);\n\tconst inputSchema = parseDef(def.in._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"allOf\",\n\t\t\t\"0\"\n\t\t]\n\t});\n\treturn { allOf: [inputSchema, parseDef(def.out._def, {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.currentPath,\n\t\t\t\"allOf\",\n\t\t\tinputSchema ? \"1\" : \"0\"\n\t\t]\n\t})].filter((schema) => schema !== void 0) };\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/promise.ts\nfunction parsePromiseDef(def, refs) {\n\treturn parseDef(def.type._def, refs);\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/set.ts\nfunction parseSetDef(def, refs) {\n\tconst schema = {\n\t\ttype: \"array\",\n\t\tuniqueItems: true,\n\t\titems: parseDef(def.valueType._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [...refs.currentPath, \"items\"]\n\t\t})\n\t};\n\tif (def.minSize) schema.minItems = def.minSize.value;\n\tif (def.maxSize) schema.maxItems = def.maxSize.value;\n\treturn schema;\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/tuple.ts\nfunction parseTupleDef(def, refs) {\n\tif (def.rest) return {\n\t\ttype: \"array\",\n\t\tminItems: def.items.length,\n\t\titems: def.items.map((x, i) => parseDef(x._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [\n\t\t\t\t...refs.currentPath,\n\t\t\t\t\"items\",\n\t\t\t\t`${i}`\n\t\t\t]\n\t\t})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),\n\t\tadditionalItems: parseDef(def.rest._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [...refs.currentPath, \"additionalItems\"]\n\t\t})\n\t};\n\telse return {\n\t\ttype: \"array\",\n\t\tminItems: def.items.length,\n\t\tmaxItems: def.items.length,\n\t\titems: def.items.map((x, i) => parseDef(x._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [\n\t\t\t\t...refs.currentPath,\n\t\t\t\t\"items\",\n\t\t\t\t`${i}`\n\t\t\t]\n\t\t})).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])\n\t};\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/undefined.ts\nfunction parseUndefinedDef() {\n\treturn { not: parseAnyDef() };\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/unknown.ts\nfunction parseUnknownDef() {\n\treturn parseAnyDef();\n}\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parsers/readonly.ts\nconst parseReadonlyDef = (def, refs) => {\n\treturn parseDef(def.innerType._def, refs);\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/select-parser.ts\nconst selectParser = (def, typeName, refs) => {\n\tswitch (typeName) {\n\t\tcase \"ZodString\": return parseStringDef(def, refs);\n\t\tcase \"ZodNumber\": return parseNumberDef(def);\n\t\tcase \"ZodObject\": return parseObjectDef(def, refs);\n\t\tcase \"ZodBigInt\": return parseBigintDef(def);\n\t\tcase \"ZodBoolean\": return parseBooleanDef();\n\t\tcase \"ZodDate\": return parseDateDef(def, refs);\n\t\tcase \"ZodUndefined\": return parseUndefinedDef();\n\t\tcase \"ZodNull\": return parseNullDef();\n\t\tcase \"ZodArray\": return parseArrayDef(def, refs);\n\t\tcase \"ZodUnion\":\n\t\tcase \"ZodDiscriminatedUnion\": return parseUnionDef(def, refs);\n\t\tcase \"ZodIntersection\": return parseIntersectionDef(def, refs);\n\t\tcase \"ZodTuple\": return parseTupleDef(def, refs);\n\t\tcase \"ZodRecord\": return parseRecordDef(def, refs);\n\t\tcase \"ZodLiteral\": return parseLiteralDef(def);\n\t\tcase \"ZodEnum\": return parseEnumDef(def);\n\t\tcase \"ZodNativeEnum\": return parseNativeEnumDef(def);\n\t\tcase \"ZodNullable\": return parseNullableDef(def, refs);\n\t\tcase \"ZodOptional\": return parseOptionalDef(def, refs);\n\t\tcase \"ZodMap\": return parseMapDef(def, refs);\n\t\tcase \"ZodSet\": return parseSetDef(def, refs);\n\t\tcase \"ZodLazy\": return () => def.getter()._def;\n\t\tcase \"ZodPromise\": return parsePromiseDef(def, refs);\n\t\tcase \"ZodNaN\":\n\t\tcase \"ZodNever\": return parseNeverDef();\n\t\tcase \"ZodEffects\": return parseEffectsDef(def, refs);\n\t\tcase \"ZodAny\": return parseAnyDef();\n\t\tcase \"ZodUnknown\": return parseUnknownDef();\n\t\tcase \"ZodDefault\": return parseDefaultDef(def, refs);\n\t\tcase \"ZodBranded\": return parseBrandedDef(def, refs);\n\t\tcase \"ZodReadonly\": return parseReadonlyDef(def, refs);\n\t\tcase \"ZodCatch\": return parseCatchDef(def, refs);\n\t\tcase \"ZodPipeline\": return parsePipelineDef(def, refs);\n\t\tcase \"ZodFunction\":\n\t\tcase \"ZodVoid\":\n\t\tcase \"ZodSymbol\": return;\n\t\tdefault:\n /* c8 ignore next */\n\t\treturn ((_) => void 0)(typeName);\n\t}\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/get-relative-path.ts\nconst getRelativePath = (pathA, pathB) => {\n\tlet i = 0;\n\tfor (; i < pathA.length && i < pathB.length; i++) if (pathA[i] !== pathB[i]) break;\n\treturn [(pathA.length - i).toString(), ...pathB.slice(i)].join(\"/\");\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/parse-def.ts\nfunction parseDef(def, refs, forceResolution = false) {\n\tconst seenItem = refs.seen.get(def);\n\tif (refs.override) {\n\t\tconst overrideResult = refs.override?.(def, refs, seenItem, forceResolution);\n\t\tif (overrideResult !== ignoreOverride) return overrideResult;\n\t}\n\tif (seenItem && !forceResolution) {\n\t\tconst seenSchema = get$ref(seenItem, refs);\n\t\tif (seenSchema !== void 0) return seenSchema;\n\t}\n\tconst newItem = {\n\t\tdef,\n\t\tpath: refs.currentPath,\n\t\tjsonSchema: void 0\n\t};\n\trefs.seen.set(def, newItem);\n\tconst jsonSchemaOrGetter = selectParser(def, def.typeName, refs);\n\tconst jsonSchema = typeof jsonSchemaOrGetter === \"function\" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;\n\tif (jsonSchema) addMeta(def, refs, jsonSchema);\n\tif (refs.postProcess) {\n\t\tconst postProcessResult = refs.postProcess(jsonSchema, def, refs);\n\t\tnewItem.jsonSchema = jsonSchema;\n\t\treturn postProcessResult;\n\t}\n\tnewItem.jsonSchema = jsonSchema;\n\treturn jsonSchema;\n}\nconst get$ref = (item, refs) => {\n\tswitch (refs.$refStrategy) {\n\t\tcase \"root\": return { $ref: item.path.join(\"/\") };\n\t\tcase \"relative\": return { $ref: getRelativePath(refs.currentPath, item.path) };\n\t\tcase \"none\":\n\t\tcase \"seen\":\n\t\t\tif (item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value)) {\n\t\t\t\tconsole.warn(`Recursive reference detected at ${refs.currentPath.join(\"/\")}! Defaulting to any`);\n\t\t\t\treturn parseAnyDef();\n\t\t\t}\n\t\t\treturn refs.$refStrategy === \"seen\" ? parseAnyDef() : void 0;\n\t}\n};\nconst addMeta = (def, refs, jsonSchema) => {\n\tif (def.description) jsonSchema.description = def.description;\n\treturn jsonSchema;\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/refs.ts\nconst getRefs = (options) => {\n\tconst _options = getDefaultOptions(options);\n\tconst currentPath = _options.name !== void 0 ? [\n\t\t..._options.basePath,\n\t\t_options.definitionPath,\n\t\t_options.name\n\t] : _options.basePath;\n\treturn {\n\t\t..._options,\n\t\tcurrentPath,\n\t\tpropertyPath: void 0,\n\t\tseen: new Map(Object.entries(_options.definitions).map(([name, def]) => [def._def, {\n\t\t\tdef: def._def,\n\t\t\tpath: [\n\t\t\t\t..._options.basePath,\n\t\t\t\t_options.definitionPath,\n\t\t\t\tname\n\t\t\t],\n\t\t\tjsonSchema: void 0\n\t\t}]))\n\t};\n};\n//#endregion\n//#region src/to-json-schema/zod3-to-json-schema/zod3-to-json-schema.ts\nconst zod3ToJsonSchema = (schema, options) => {\n\tconst refs = getRefs(options);\n\tlet definitions = typeof options === \"object\" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({\n\t\t...acc,\n\t\t[name]: parseDef(schema._def, {\n\t\t\t...refs,\n\t\t\tcurrentPath: [\n\t\t\t\t...refs.basePath,\n\t\t\t\trefs.definitionPath,\n\t\t\t\tname\n\t\t\t]\n\t\t}, true) ?? parseAnyDef()\n\t}), {}) : void 0;\n\tconst name = typeof options === \"string\" ? options : options?.nameStrategy === \"title\" ? void 0 : options?.name;\n\tconst main = parseDef(schema._def, name === void 0 ? refs : {\n\t\t...refs,\n\t\tcurrentPath: [\n\t\t\t...refs.basePath,\n\t\t\trefs.definitionPath,\n\t\t\tname\n\t\t]\n\t}, false) ?? parseAnyDef();\n\tconst title = typeof options === \"object\" && options.name !== void 0 && options.nameStrategy === \"title\" ? options.name : void 0;\n\tif (title !== void 0) main.title = title;\n\tconst combined = name === void 0 ? definitions ? {\n\t\t...main,\n\t\t[refs.definitionPath]: definitions\n\t} : main : {\n\t\t$ref: [\n\t\t\t...refs.$refStrategy === \"relative\" ? [] : refs.basePath,\n\t\t\trefs.definitionPath,\n\t\t\tname\n\t\t].join(\"/\"),\n\t\t[refs.definitionPath]: {\n\t\t\t...definitions,\n\t\t\t[name]: main\n\t\t}\n\t};\n\tcombined.$schema = \"http://json-schema.org/draft-07/schema#\";\n\treturn combined;\n};\n//#endregion\n//#region src/schema.ts\n/**\n* Used to mark schemas so we can support both Zod and custom schemas.\n*/\nconst schemaSymbol = Symbol.for(\"vercel.ai.schema\");\n/**\n* Creates a schema with deferred creation.\n* This is important to reduce the startup time of the library\n* and to avoid initializing unused validators.\n*\n* @param createValidator A function that creates a schema.\n* @returns A function that returns a schema.\n*/\nfunction lazySchema(createSchema) {\n\tlet schema;\n\treturn () => {\n\t\tif (schema == null) schema = createSchema();\n\t\treturn schema;\n\t};\n}\n/**\n* Create a schema using a JSON Schema.\n*\n* @param jsonSchema The JSON Schema for the schema.\n* @param options.validate Optional. A validation function for the schema.\n*/\nfunction jsonSchema(jsonSchema, { validate } = {}) {\n\treturn {\n\t\t[schemaSymbol]: true,\n\t\t_type: void 0,\n\t\tget jsonSchema() {\n\t\t\tif (typeof jsonSchema === \"function\") jsonSchema = jsonSchema();\n\t\t\treturn jsonSchema;\n\t\t},\n\t\tvalidate\n\t};\n}\nfunction isSchema(value) {\n\treturn typeof value === \"object\" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && \"jsonSchema\" in value && \"validate\" in value;\n}\nfunction asSchema(schema) {\n\treturn schema == null ? jsonSchema({\n\t\ttype: \"object\",\n\t\tproperties: {},\n\t\tadditionalProperties: false\n\t}) : isSchema(schema) ? schema : \"~standard\" in schema ? schema[\"~standard\"].vendor === \"zod\" ? zodSchema(schema) : standardSchema(schema) : schema();\n}\nfunction standardSchema(standardSchema) {\n\treturn jsonSchema(() => {\n\t\tif (!hasStandardJsonSchema(standardSchema)) throw new Error(`Standard schema vendor '${standardSchema[\"~standard\"].vendor}' does not support JSON Schema conversion.`);\n\t\treturn addAdditionalPropertiesToJsonSchema(standardSchema[\"~standard\"].jsonSchema.input({ target: \"draft-07\" }));\n\t}, { validate: async (value) => {\n\t\tconst result = await standardSchema[\"~standard\"].validate(value);\n\t\treturn \"value\" in result ? {\n\t\t\tsuccess: true,\n\t\t\tvalue: result.value\n\t\t} : {\n\t\t\tsuccess: false,\n\t\t\terror: new TypeValidationError({\n\t\t\t\tvalue,\n\t\t\t\tcause: result.issues\n\t\t\t})\n\t\t};\n\t} });\n}\nfunction hasStandardJsonSchema(schema) {\n\treturn schema[\"~standard\"].jsonSchema != null;\n}\nfunction zod3Schema(zodSchema, options) {\n\tconst useReferences = options?.useReferences ?? false;\n\treturn jsonSchema(() => zod3ToJsonSchema(zodSchema, { $refStrategy: useReferences ? \"root\" : \"none\" }), { validate: async (value) => {\n\t\tconst result = await zodSchema.safeParseAsync(value);\n\t\treturn result.success ? {\n\t\t\tsuccess: true,\n\t\t\tvalue: result.data\n\t\t} : {\n\t\t\tsuccess: false,\n\t\t\terror: result.error\n\t\t};\n\t} });\n}\nfunction zod4Schema(zodSchema, options) {\n\tif (!config().localeError) config(en());\n\tconst useReferences = options?.useReferences ?? false;\n\treturn jsonSchema(() => addAdditionalPropertiesToJsonSchema(toJSONSchema(zodSchema, {\n\t\ttarget: \"draft-7\",\n\t\tio: \"input\",\n\t\treused: useReferences ? \"ref\" : \"inline\"\n\t})), { validate: async (value) => {\n\t\tconst result = await safeParseAsync(zodSchema, value);\n\t\treturn result.success ? {\n\t\t\tsuccess: true,\n\t\t\tvalue: result.data\n\t\t} : {\n\t\t\tsuccess: false,\n\t\t\terror: result.error\n\t\t};\n\t} });\n}\nfunction isZod4Schema(zodSchema) {\n\treturn \"_zod\" in zodSchema;\n}\nfunction zodSchema(zodSchema, options) {\n\tif (isZod4Schema(zodSchema)) return zod4Schema(zodSchema, options);\n\telse return zod3Schema(zodSchema, options);\n}\n//#endregion\n//#region src/validate-types.ts\n/**\n* Validates the types of an unknown object using a schema and\n* return a strongly-typed object.\n*\n* @template T - The type of the object to validate.\n* @param {string} options.value - The object to validate.\n* @param {Validator<T>} options.schema - The schema to use for validating the JSON.\n* @param {TypeValidationContext} options.context - Optional context about what is being validated.\n* @returns {Promise<T>} - The typed object.\n*/\nasync function validateTypes({ value, schema, context }) {\n\tconst result = await safeValidateTypes({\n\t\tvalue,\n\t\tschema,\n\t\tcontext\n\t});\n\tif (!result.success) throw TypeValidationError.wrap({\n\t\tvalue,\n\t\tcause: result.error,\n\t\tcontext\n\t});\n\treturn result.value;\n}\n/**\n* Safely validates the types of an unknown object using a schema and\n* return a strongly-typed object.\n*\n* @template T - The type of the object to validate.\n* @param {string} options.value - The JSON object to validate.\n* @param {Validator<T>} options.schema - The schema to use for validating the JSON.\n* @param {TypeValidationContext} options.context - Optional context about what is being validated.\n* @returns An object with either a `success` flag and the parsed and typed data, or a `success` flag and an error object.\n*/\nasync function safeValidateTypes({ value, schema, context }) {\n\tconst actualSchema = asSchema(schema);\n\ttry {\n\t\tif (actualSchema.validate == null) return {\n\t\t\tsuccess: true,\n\t\t\tvalue,\n\t\t\trawValue: value\n\t\t};\n\t\tconst result = await actualSchema.validate(value);\n\t\tif (result.success) return {\n\t\t\tsuccess: true,\n\t\t\tvalue: result.value,\n\t\t\trawValue: value\n\t\t};\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: TypeValidationError.wrap({\n\t\t\t\tvalue,\n\t\t\t\tcause: result.error,\n\t\t\t\tcontext\n\t\t\t}),\n\t\t\trawValue: value\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: TypeValidationError.wrap({\n\t\t\t\tvalue,\n\t\t\t\tcause: error,\n\t\t\t\tcontext\n\t\t\t}),\n\t\t\trawValue: value\n\t\t};\n\t}\n}\n//#endregion\n//#region src/parse-json.ts\nasync function parseJSON({ text, schema }) {\n\ttry {\n\t\tconst value = secureJsonParse(text);\n\t\tif (schema == null) return value;\n\t\treturn await validateTypes({\n\t\t\tvalue,\n\t\t\tschema\n\t\t});\n\t} catch (error) {\n\t\tif (JSONParseError.isInstance(error) || TypeValidationError.isInstance(error)) throw error;\n\t\tthrow new JSONParseError({\n\t\t\ttext,\n\t\t\tcause: error\n\t\t});\n\t}\n}\nasync function safeParseJSON({ text, schema }) {\n\ttry {\n\t\tconst value = secureJsonParse(text);\n\t\tif (schema == null) return {\n\t\t\tsuccess: true,\n\t\t\tvalue,\n\t\t\trawValue: value\n\t\t};\n\t\treturn await safeValidateTypes({\n\t\t\tvalue,\n\t\t\tschema\n\t\t});\n\t} catch (error) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: JSONParseError.isInstance(error) ? error : new JSONParseError({\n\t\t\t\ttext,\n\t\t\t\tcause: error\n\t\t\t}),\n\t\t\trawValue: void 0\n\t\t};\n\t}\n}\nfunction isParsableJson(input) {\n\ttry {\n\t\tsecureJsonParse(input);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n//#endregion\n//#region src/parse-json-event-stream.ts\n/**\n* Parses a JSON event stream into a stream of parsed JSON objects.\n*/\nfunction parseJsonEventStream({ stream, schema }) {\n\treturn stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream$1()).pipeThrough(new TransformStream({ async transform({ data }, controller) {\n\t\tif (data === \"[DONE]\") return;\n\t\tcontroller.enqueue(await safeParseJSON({\n\t\t\ttext: data,\n\t\t\tschema\n\t\t}));\n\t} }));\n}\n//#endregion\n//#region src/parse-provider-options.ts\nasync function parseProviderOptions({ provider, providerOptions, schema }) {\n\tif (providerOptions?.[provider] == null) return;\n\tconst parsedProviderOptions = await safeValidateTypes({\n\t\tvalue: providerOptions[provider],\n\t\tschema\n\t});\n\tif (!parsedProviderOptions.success) throw new InvalidArgumentError({\n\t\targument: \"providerOptions\",\n\t\tmessage: `invalid ${provider} provider options`,\n\t\tcause: parsedProviderOptions.error\n\t});\n\treturn parsedProviderOptions.value;\n}\n//#endregion\n//#region src/resolve-provider-options.ts\n/**\n* Parses provider options that a model accepts under more than one\n* `providerOptions` namespace, e.g. a canonical key plus a provider-specific\n* or legacy alias.\n*\n* Each present namespace is validated against `schema` exactly like\n* `parseProviderOptions` does, so an invalid namespace throws.\n*\n* @returns the resolved options (`undefined` when no namespace is present)\n* and the namespaces that contributed to them, in resolution order.\n*/\nasync function resolveProviderOptions({ providerOptions, namespaces, resolution, schema }) {\n\tconst parsed = [];\n\tconst matched = [];\n\tfor (const namespace of new Set(namespaces)) {\n\t\tconst options = await parseProviderOptions({\n\t\t\tprovider: namespace,\n\t\t\tproviderOptions,\n\t\t\tschema\n\t\t});\n\t\tif (options == null) continue;\n\t\tif (resolution === \"first\") return {\n\t\t\toptions,\n\t\t\tnamespaces: [namespace]\n\t\t};\n\t\tparsed.push(options);\n\t\tmatched.push(namespace);\n\t}\n\treturn {\n\t\toptions: parsed.length === 0 ? void 0 : Object.assign({}, ...parsed),\n\t\tnamespaces: matched\n\t};\n}\n//#endregion\n//#region src/post-multipart-stream-to-api.ts\nconst getOriginalFetch$1 = () => globalThis.fetch;\nfunction escapeMultipartHeaderValue(value) {\n\treturn value.replace(/[\\r\\n]/g, \"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\");\n}\nfunction createMultipartBody(parts, boundary) {\n\tconst encoder = new TextEncoder();\n\tlet disposed = false;\n\tlet activeReader;\n\tconst enteredStreams = /* @__PURE__ */ new Set();\n\tasync function* emitParts() {\n\t\tfor (const part of parts) {\n\t\t\tif (disposed) return;\n\t\t\tconst disposition = `--${boundary}\\r\\nContent-Disposition: form-data; name=\"${escapeMultipartHeaderValue(part.name)}\"`;\n\t\t\tif (part.type === \"field\") {\n\t\t\t\tyield encoder.encode(`${disposition}\\r\\n\\r\\n${part.value}\\r\\n`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst filenameParameter = `; filename=\"${escapeMultipartHeaderValue(part.filename ?? \"blob\")}\"`;\n\t\t\tconst mediaType = (part.mediaType ?? \"application/octet-stream\").replace(/[\\r\\n]/g, \"\");\n\t\t\tyield encoder.encode(`${disposition}${filenameParameter}\\r\\nContent-Type: ${mediaType}\\r\\n\\r\\n`);\n\t\t\tif (part.content instanceof Uint8Array) yield part.content;\n\t\t\telse {\n\t\t\t\tconst reader = part.content.getReader();\n\t\t\t\tactiveReader = reader;\n\t\t\t\tenteredStreams.add(part.content);\n\t\t\t\tlet finished = false;\n\t\t\t\ttry {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\t\tif (done || disposed) {\n\t\t\t\t\t\t\tfinished = done;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyield value;\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tactiveReader = void 0;\n\t\t\t\t\tif (!finished) await reader.cancel().catch(() => {});\n\t\t\t\t\treader.releaseLock();\n\t\t\t\t}\n\t\t\t\tif (disposed) return;\n\t\t\t}\n\t\t\tyield encoder.encode(\"\\r\\n\");\n\t\t}\n\t\tyield encoder.encode(`--${boundary}--\\r\\n`);\n\t}\n\treturn {\n\t\tstream: convertAsyncIteratorToReadableStream(emitParts()),\n\t\tasync dispose(reason) {\n\t\t\tif (disposed) return;\n\t\t\tdisposed = true;\n\t\t\tconst reader = activeReader;\n\t\t\tif (reader != null) await reader.cancel(reason).catch(() => {});\n\t\t\tfor (const part of parts) if (part.type === \"file\" && !(part.content instanceof Uint8Array) && !enteredStreams.has(part.content)) await part.content.cancel(reason).catch(() => {});\n\t\t}\n\t};\n}\n/**\n* POSTs a multipart/form-data body as a request stream, so file parts backed\n* by a `ReadableStream` are sent without buffering the full file in memory.\n*\n* Requires a fetch implementation that supports streaming request bodies\n* (`duplex: 'half'`). Callers with fully buffered payloads can keep using\n* `postFormDataToApi`.\n*/\nconst postMultipartStreamToApi = async ({ url, headers = {}, parts, failedResponseHandler, successfulResponseHandler, abortSignal, fetch = getOriginalFetch$1() }) => {\n\tconst boundary = `ai-sdk-multipart-${generateId()}`;\n\tconst requestBodyValues = Object.fromEntries(parts.map((part) => [part.name, part.type === \"field\" ? part.value : `<file:${part.filename ?? part.name}>`]));\n\tconst body = createMultipartBody(parts, boundary);\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: withUserAgentSuffix({\n\t\t\t\t...headers,\n\t\t\t\t\"Content-Type\": `multipart/form-data; boundary=${boundary}`\n\t\t\t}, `ai-sdk-provider-utils/${VERSION}`, getRuntimeEnvironmentUserAgent()),\n\t\t\tbody: body.stream,\n\t\t\tduplex: \"half\",\n\t\t\tsignal: abortSignal\n\t\t});\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (!response.ok) {\n\t\t\tlet errorInformation;\n\t\t\ttry {\n\t\t\t\terrorInformation = await failedResponseHandler({\n\t\t\t\t\tresponse,\n\t\t\t\t\turl,\n\t\t\t\t\trequestBodyValues\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t\tthrow new APICallError({\n\t\t\t\t\tmessage: \"Failed to process error response\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tstatusCode: response.status,\n\t\t\t\t\turl,\n\t\t\t\t\tresponseHeaders,\n\t\t\t\t\trequestBodyValues\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow errorInformation.value;\n\t\t}\n\t\ttry {\n\t\t\treturn await successfulResponseHandler({\n\t\t\t\tresponse,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t}\n\t\t\tthrow new APICallError({\n\t\t\t\tmessage: \"Failed to process successful response\",\n\t\t\t\tcause: error,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\turl,\n\t\t\t\tresponseHeaders,\n\t\t\t\trequestBodyValues\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tawait body.dispose(error);\n\t\tthrow handleFetchError({\n\t\t\terror,\n\t\t\turl,\n\t\t\trequestBodyValues\n\t\t});\n\t}\n};\n//#endregion\n//#region src/post-to-api.ts\nconst getOriginalFetch = () => globalThis.fetch;\nconst postJsonToApi = async ({ url, headers, body, failedResponseHandler, successfulResponseHandler, abortSignal, fetch }) => await postToApi({\n\turl,\n\theaders: {\n\t\t\"Content-Type\": \"application/json\",\n\t\t...headers\n\t},\n\tbody: {\n\t\tcontent: JSON.stringify(body),\n\t\tvalues: body\n\t},\n\tfailedResponseHandler,\n\tsuccessfulResponseHandler,\n\tabortSignal,\n\tfetch\n});\nconst postFormDataToApi = async ({ url, headers, formData, failedResponseHandler, successfulResponseHandler, abortSignal, fetch }) => await postToApi({\n\turl,\n\theaders,\n\tbody: {\n\t\tcontent: formData,\n\t\tvalues: Object.fromEntries(formData.entries())\n\t},\n\tfailedResponseHandler,\n\tsuccessfulResponseHandler,\n\tabortSignal,\n\tfetch\n});\nconst postToApi = async ({ url, headers = {}, body, successfulResponseHandler, failedResponseHandler, abortSignal, fetch = getOriginalFetch() }) => {\n\ttry {\n\t\tconst response = await fetch(url, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: withUserAgentSuffix(headers, `ai-sdk-provider-utils/${VERSION}`, getRuntimeEnvironmentUserAgent()),\n\t\t\tbody: body.content,\n\t\t\tsignal: abortSignal\n\t\t});\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (!response.ok) {\n\t\t\tlet errorInformation;\n\t\t\ttry {\n\t\t\t\terrorInformation = await failedResponseHandler({\n\t\t\t\t\tresponse,\n\t\t\t\t\turl,\n\t\t\t\t\trequestBodyValues: body.values\n\t\t\t\t});\n\t\t\t} catch (error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t\tthrow new APICallError({\n\t\t\t\t\tmessage: \"Failed to process error response\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tstatusCode: response.status,\n\t\t\t\t\turl,\n\t\t\t\t\tresponseHeaders,\n\t\t\t\t\trequestBodyValues: body.values\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow errorInformation.value;\n\t\t}\n\t\ttry {\n\t\t\treturn await successfulResponseHandler({\n\t\t\t\tresponse,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues: body.values\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof Error) {\n\t\t\t\tif (isAbortError(error) || APICallError.isInstance(error)) throw error;\n\t\t\t}\n\t\t\tthrow new APICallError({\n\t\t\t\tmessage: \"Failed to process successful response\",\n\t\t\t\tcause: error,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\turl,\n\t\t\t\tresponseHeaders,\n\t\t\t\trequestBodyValues: body.values\n\t\t\t});\n\t\t}\n\t} catch (error) {\n\t\tthrow handleFetchError({\n\t\t\terror,\n\t\t\turl,\n\t\t\trequestBodyValues: body.values\n\t\t});\n\t}\n};\n//#endregion\n//#region src/types/tool.ts\nfunction tool(tool) {\n\treturn tool;\n}\n/**\n* Define a dynamic tool.\n*/\nfunction dynamicTool(tool) {\n\treturn {\n\t\t...tool,\n\t\ttype: \"dynamic\"\n\t};\n}\n//#endregion\n//#region src/telemetry-redaction.ts\nconst telemetryRedaction = Symbol.for(\"vercel.ai.telemetry.redact\");\n/**\n* Attach a provider-owned telemetry view without changing the original value.\n* The annotation is not serialized or included in enumerable application data.\n* Keep the annotated object when forwarding tool arguments or provider metadata.\n*/\nfunction withTelemetryRedaction(value, redact) {\n\treturn Object.create(Object.getPrototypeOf(value), {\n\t\t...Object.getOwnPropertyDescriptors(value),\n\t\t[telemetryRedaction]: {\n\t\t\tvalue: redact,\n\t\t\tconfigurable: true\n\t\t}\n\t});\n}\n/** Apply the provider's telemetry view, leaving unannotated values unchanged. */\nfunction redactTelemetryValue(value) {\n\tif (value == null || typeof value !== \"object\") return value;\n\tconst redact = Object.getOwnPropertyDescriptor(value, telemetryRedaction)?.value;\n\tif (typeof redact !== \"function\") return value;\n\ttry {\n\t\treturn redact(value);\n\t} catch {\n\t\treturn;\n\t}\n}\n//#endregion\n//#region src/provider-defined-tool-factory.ts\nfunction createProviderDefinedToolFactory({ id, inputSchema, redactArgs }) {\n\treturn ({ execute, outputSchema, needsApproval, toModelOutput, onInputStart, onInputDelta, onInputAvailable, ...args }) => tool({\n\t\ttype: \"provider\",\n\t\tisProviderExecuted: false,\n\t\tid,\n\t\targs: redactArgs == null ? args : withTelemetryRedaction(args, redactArgs),\n\t\tinputSchema,\n\t\toutputSchema,\n\t\texecute,\n\t\tneedsApproval,\n\t\ttoModelOutput,\n\t\tonInputStart,\n\t\tonInputDelta,\n\t\tonInputAvailable\n\t});\n}\nfunction createProviderDefinedToolFactoryWithOutputSchema({ id, inputSchema, outputSchema, redactArgs }) {\n\treturn ({ execute, needsApproval, toModelOutput, onInputStart, onInputDelta, onInputAvailable, ...args }) => tool({\n\t\ttype: \"provider\",\n\t\tisProviderExecuted: false,\n\t\tid,\n\t\targs: redactArgs == null ? args : withTelemetryRedaction(args, redactArgs),\n\t\tinputSchema,\n\t\toutputSchema,\n\t\texecute,\n\t\tneedsApproval,\n\t\ttoModelOutput,\n\t\tonInputStart,\n\t\tonInputDelta,\n\t\tonInputAvailable\n\t});\n}\n//#endregion\n//#region src/provider-executed-tool-factory.ts\nfunction createProviderExecutedToolFactory({ id, inputSchema, outputSchema, supportsDeferredResults, redactArgs }) {\n\treturn ({ onInputStart, onInputDelta, onInputAvailable, ...args }) => tool({\n\t\ttype: \"provider\",\n\t\tisProviderExecuted: true,\n\t\tid,\n\t\targs: redactArgs == null ? args : withTelemetryRedaction(args, redactArgs),\n\t\tinputSchema,\n\t\toutputSchema,\n\t\tonInputStart,\n\t\tonInputDelta,\n\t\tonInputAvailable,\n\t\tsupportsDeferredResults\n\t});\n}\n//#endregion\n//#region src/resolve.ts\n/**\n* Resolves a value that could be a raw value, a Promise, a function returning a value,\n* or a function returning a Promise.\n*/\nasync function resolve(value) {\n\tif (typeof value === \"function\") value = value();\n\treturn value;\n}\n/**\n* Resolves and transforms a value, preserving synchronous results. This allows\n* synchronous credentials to remain usable by workflow serialization while\n* asynchronous credentials are awaited by request handlers.\n*/\nfunction resolveWith(value, transform) {\n\tconst resolved = typeof value === \"function\" ? value() : value;\n\tif (resolved != null && (typeof resolved === \"object\" || typeof resolved === \"function\") && typeof resolved.then === \"function\") return Promise.resolve(resolved).then(transform);\n\treturn transform(resolved);\n}\n//#endregion\n//#region src/resolve-full-media-type.ts\n/**\n* Resolves a file part's media type to a full `type/subtype` form required by\n* providers whose API demands the full IANA media type.\n*\n* - If `part.mediaType` is already a full media type (e.g. `image/png`), it is\n*   returned as-is.\n* - Otherwise, when inline bytes are available (`part.data.type === 'data'`),\n*   the subtype is sniffed from the bytes using the signature table that\n*   corresponds to the top-level segment.\n* - When neither applies (e.g. top-level-only with a URL source, or bytes that\n*   cannot be detected), an `UnsupportedFunctionalityError` is thrown.\n*/\nfunction resolveFullMediaType({ part }) {\n\tif (isFullMediaType(part.mediaType)) return part.mediaType;\n\tif (part.data.type === \"data\") {\n\t\tconst detected = detectMediaType({\n\t\t\tdata: part.data.data,\n\t\t\ttopLevelType: getTopLevelMediaType(part.mediaType)\n\t\t});\n\t\tif (detected) return detected;\n\t\tthrow new UnsupportedFunctionalityError({ functionality: `file of media type \"${part.mediaType}\" must specify subtype since it could not be auto-detected` });\n\t}\n\tthrow new UnsupportedFunctionalityError({ functionality: `file of media type \"${part.mediaType}\" must specify subtype since it is not passed as inline bytes` });\n}\n//#endregion\n//#region src/resolve-provider-reference.ts\n/**\n* Resolves a provider reference to the provider-specific identifier for the\n* given provider. Throws `NoSuchProviderReferenceError` if the provider is not\n* found in the reference mapping.\n*/\nfunction resolveProviderReference({ reference, provider }) {\n\tconst id = reference[provider];\n\tif (id != null) return id;\n\tthrow new NoSuchProviderReferenceError({\n\t\tprovider,\n\t\treference\n\t});\n}\n//#endregion\n//#region src/retry-with-exponential-backoff.ts\n/**\n* Retries a failed operation with exponential backoff.\n*/\nconst retryWithExponentialBackoff = ({ maxRetries = 2, initialDelayInMs = 2e3, backoffFactor = 2, abortSignal, shouldRetry, getDelayInMs = ({ exponentialBackoffDelay }) => exponentialBackoffDelay, createRetryError = ({ message }) => new Error(message) }) => async (f) => retryWithExponentialBackoffInternal(f, {\n\tmaxRetries,\n\tdelayInMs: initialDelayInMs,\n\tbackoffFactor,\n\tabortSignal,\n\tshouldRetry,\n\tgetDelayInMs,\n\tcreateRetryError\n});\nasync function retryWithExponentialBackoffInternal(f, { maxRetries, delayInMs, backoffFactor, abortSignal, shouldRetry, getDelayInMs, createRetryError }, errors = []) {\n\ttry {\n\t\treturn await f();\n\t} catch (error) {\n\t\tif (isAbortError(error)) throw error;\n\t\tif (maxRetries === 0) throw error;\n\t\tconst errorMessage = getErrorMessage(error);\n\t\tconst newErrors = [...errors, error];\n\t\tconst tryNumber = newErrors.length;\n\t\tif (tryNumber > maxRetries) throw createRetryError({\n\t\t\tmessage: `Failed after ${tryNumber} attempts. Last error: ${errorMessage}`,\n\t\t\treason: \"maxRetriesExceeded\",\n\t\t\terrors: newErrors\n\t\t});\n\t\tif (await shouldRetry(error) && tryNumber <= maxRetries) {\n\t\t\tawait delay(getDelayInMs({\n\t\t\t\terror,\n\t\t\t\texponentialBackoffDelay: delayInMs\n\t\t\t}), { abortSignal });\n\t\t\treturn retryWithExponentialBackoffInternal(f, {\n\t\t\t\tmaxRetries,\n\t\t\t\tdelayInMs: backoffFactor * delayInMs,\n\t\t\t\tbackoffFactor,\n\t\t\t\tabortSignal,\n\t\t\t\tshouldRetry,\n\t\t\t\tgetDelayInMs,\n\t\t\t\tcreateRetryError\n\t\t\t}, newErrors);\n\t\t}\n\t\tif (tryNumber === 1) throw error;\n\t\tthrow createRetryError({\n\t\t\tmessage: `Failed after ${tryNumber} attempts with non-retryable error: '${errorMessage}'`,\n\t\t\treason: \"errorNotRetryable\",\n\t\t\terrors: newErrors\n\t\t});\n\t}\n}\n//#endregion\n//#region src/json-binary-field-scanner.ts\n/**\n* Streaming extraction of large base64 strings from a JSON response body.\n*\n* A JSON response that carries an image or a file is mostly one very long\n* base64 string. The regular pipeline (collect chunks, concatenate, decode to\n* text, `JSON.parse`, decode base64) holds about four copies of that string at\n* once. The scanner reads the body chunk by chunk instead: strings at the\n* configured paths are decoded to bytes while they stream in, and the text that\n* is handed to `JSON.parse` (the \"skeleton\") holds a short placeholder in their\n* place.\n*\n* - The skeleton is the original body except for the extracted strings, so\n*   `secureJsonParse` still sees every key (a base64 string cannot contain a\n*   quote, so it cannot hide one).\n* - A string is extracted only if it is canonical standard-alphabet base64\n*   (length divisible by 4, `=` only as the final padding, zero trailing bits,\n*   no escape sequences or whitespace). The bytes are then exactly what `atob`\n*   gives for it. Everything else stays a string. What was decoded before a\n*   string turned out not to qualify is encoded back, which gives the original\n*   characters.\n*/\n/** Strings that decode to fewer bytes stay strings. */\nconst DEFAULT_BINARY_FIELD_MIN_BYTES = 65536;\nconst QUOTE = 34;\nconst BACKSLASH = 92;\nconst EQUALS = 61;\nconst COMMA = 44;\nconst COLON = 58;\nconst LEFT_BRACE = 123;\nconst RIGHT_BRACE = 125;\nconst LEFT_BRACKET = 91;\nconst RIGHT_BRACKET = 93;\nconst OUTSIDE = 0;\nconst KEY = 1;\nconst SKIP = 2;\nconst BLOB = 3;\n/**\n* Compiles paths such as `images[*]` or `content[*].data.data`: plain object\n* keys (letters, digits, `_` and `-`) joined by `.`, and `[*]` for every\n* element of an array. Keys are compared with the raw bytes of the key in the\n* body, so a key written with an escape sequence never matches.\n*/\nfunction compileBinaryFieldPaths(paths) {\n\tconst root = /* @__PURE__ */ new Map();\n\tfor (const path of paths) {\n\t\tif (!/^(?:[\\w-]+|\\[\\*])(?:\\.[\\w-]+|\\[\\*])*$/.test(path)) throw new InvalidArgumentError({\n\t\t\targument: \"experimental_binaryFields\",\n\t\t\tmessage: `Invalid binary field path \"${path}\"`\n\t\t});\n\t\tlet node = root;\n\t\tfor (const segment of path.match(/\\[\\*]|[\\w-]+/g)) {\n\t\t\tconst edges = segment === \"[*]\" ? [null] : new TextEncoder().encode(`${segment}\"`);\n\t\t\tfor (const edge of edges) {\n\t\t\t\tlet next = node.get(edge);\n\t\t\t\tif (next === void 0) node.set(edge, next = /* @__PURE__ */ new Map());\n\t\t\t\tnode = next;\n\t\t\t}\n\t\t}\n\t\tnode.set(true, node);\n\t}\n\treturn root;\n}\nfunction join(parts, length) {\n\tconst bytes = new Uint8Array(length);\n\tlet at = 0;\n\tfor (const part of parts) {\n\t\tbytes.set(part, at);\n\t\tat += part.length;\n\t}\n\treturn bytes;\n}\nfunction createJsonBinaryFieldScanner(paths, minBytes = DEFAULT_BINARY_FIELD_MIN_BYTES) {\n\tconst sextet = (/* @__PURE__ */ new Uint8Array(256)).fill(64);\n\tfor (let index = 0; index < 64; index++) sextet[\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".charCodeAt(index)] = index;\n\tconst encoder = new TextEncoder();\n\tconst pieces = [];\n\tlet piece = /* @__PURE__ */ new Uint8Array(65536);\n\tlet pieceLength = 0;\n\tlet size = 0;\n\tconst binaries = /* @__PURE__ */ new Map();\n\tconst frames = [];\n\tlet skipped = 0;\n\tlet mode = OUTSIDE;\n\tlet escaped = false;\n\tlet last = 0;\n\tlet key;\n\tlet segments = [];\n\tlet segment = /* @__PURE__ */ new Uint8Array(0);\n\tlet at = 0;\n\tlet total = 0;\n\tlet bits = 0;\n\tlet chars = 0;\n\tlet padding = 0;\n\tconst add = (bytes) => {\n\t\tfor (let offset = 0; offset < bytes.length;) {\n\t\t\tconst length = Math.min(piece.length - pieceLength, bytes.length - offset);\n\t\t\tpiece.set(bytes.subarray(offset, offset + length), pieceLength);\n\t\t\tpieceLength += length;\n\t\t\toffset += length;\n\t\t\tsize += length;\n\t\t\tif (pieceLength === piece.length) {\n\t\t\t\tpieces.push(piece);\n\t\t\t\tpiece = /* @__PURE__ */ new Uint8Array(65536);\n\t\t\t\tpieceLength = 0;\n\t\t\t}\n\t\t}\n\t};\n\tconst emit = (chunk, start, end) => add(chunk.subarray(start, end));\n\tconst reset = () => {\n\t\tsegments = [];\n\t\tsegment = /* @__PURE__ */ new Uint8Array(0);\n\t\tat = 0;\n\t\ttotal = 0;\n\t\tbits = 0;\n\t\tchars = 0;\n\t\tpadding = 0;\n\t};\n\tconst grow = () => {\n\t\tif (at > 0) segments.push(segment.subarray(0, at));\n\t\tsegment = new Uint8Array(Math.min(Math.max(total, 4096), 4 << 20));\n\t\tat = 0;\n\t};\n\tconst rest = () => bits << (4 - chars) * 6;\n\tconst restore = () => {\n\t\tfor (const part of [...segments, segment.subarray(0, at)]) add(encoder.encode(convertUint8ArrayToBase64(part)));\n\t\tconst group = rest();\n\t\tadd(encoder.encode(convertUint8ArrayToBase64(Uint8Array.of(group >> 16, group >> 8, group)).slice(0, chars) + \"=\".repeat(padding)));\n\t\treset();\n\t};\n\tconst closeBlob = () => {\n\t\tmode = OUTSIDE;\n\t\tconst tail = chars && chars - 1;\n\t\tif (padding === (4 - chars) % 4 && !(bits & (1 << (4 - chars) * 2) - 1) && total + tail >= minBytes) {\n\t\t\tconst group = rest();\n\t\t\tconst bytes = join([...segments, segment.subarray(0, at)], total + tail);\n\t\t\tfor (let index = 0; index < tail; index++) bytes[total + index] = group >> 16 - 8 * index;\n\t\t\tconst placeholder = `[binary data: ${bytes.length} bytes; ref ${crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(2)).join(\"-\")}]`;\n\t\t\tbinaries.set(placeholder, bytes);\n\t\t\tadd(encoder.encode(placeholder));\n\t\t\treset();\n\t\t} else restore();\n\t};\n\tconst push = (chunk) => {\n\t\tlet from = 0;\n\t\tconst { length } = chunk;\n\t\tfor (let index = 0; index < length; index++) {\n\t\t\tlet byte = chunk[index];\n\t\t\tif (mode === BLOB) {\n\t\t\t\tif (padding === 0) {\n\t\t\t\t\tlet pending = bits;\n\t\t\t\t\tlet count = chars;\n\t\t\t\t\tfor (let value; index < length && (value = sextet[chunk[index]]) < 64; index++) {\n\t\t\t\t\t\tpending = pending << 6 | value;\n\t\t\t\t\t\tif (++count === 4) {\n\t\t\t\t\t\t\tif (at + 3 > segment.length) grow();\n\t\t\t\t\t\t\tsegment[at++] = pending >> 16;\n\t\t\t\t\t\t\tsegment[at++] = pending >> 8;\n\t\t\t\t\t\t\tsegment[at++] = pending;\n\t\t\t\t\t\t\ttotal += 3;\n\t\t\t\t\t\t\tpending = 0;\n\t\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbits = pending;\n\t\t\t\t\tchars = count;\n\t\t\t\t}\n\t\t\t\tif (index >= length) break;\n\t\t\t\tbyte = chunk[index];\n\t\t\t\tif (byte === QUOTE) {\n\t\t\t\t\tcloseBlob();\n\t\t\t\t\tfrom = index;\n\t\t\t\t} else if (byte === EQUALS && chars > 1 && padding < 4 - chars) padding++;\n\t\t\t\telse {\n\t\t\t\t\trestore();\n\t\t\t\t\tmode = SKIP;\n\t\t\t\t\tfrom = index--;\n\t\t\t\t}\n\t\t\t} else if (mode !== OUTSIDE) {\n\t\t\t\tif (mode === KEY) key = key?.get(byte);\n\t\t\t\tif (escaped) escaped = false;\n\t\t\t\telse if (byte === BACKSLASH) escaped = true;\n\t\t\t\telse if (byte === QUOTE) {\n\t\t\t\t\tif (mode === KEY) frames.at(-1).next = key;\n\t\t\t\t\tmode = OUTSIDE;\n\t\t\t\t}\n\t\t\t} else if (byte === QUOTE) {\n\t\t\t\tconst frame = frames.at(-1);\n\t\t\t\tif (skipped > 0) mode = SKIP;\n\t\t\t\telse if (frame?.keys && (last === LEFT_BRACE || last === COMMA)) {\n\t\t\t\t\tmode = KEY;\n\t\t\t\t\tkey = frame.keys;\n\t\t\t\t} else if ((frame ? frame.next : paths)?.get(true)) {\n\t\t\t\t\tmode = BLOB;\n\t\t\t\t\temit(chunk, from, index + 1);\n\t\t\t\t} else mode = SKIP;\n\t\t\t} else if (byte === LEFT_BRACE || byte === LEFT_BRACKET) {\n\t\t\t\tlast = byte;\n\t\t\t\tconst frame = frames.at(-1);\n\t\t\t\tconst node = skipped > 0 ? void 0 : frame ? frame.next : paths;\n\t\t\t\tconst items = node?.get(null);\n\t\t\t\tif (byte === LEFT_BRACE && node) frames.push({ keys: node });\n\t\t\t\telse if (byte === LEFT_BRACKET && items) frames.push({\n\t\t\t\t\tkeys: null,\n\t\t\t\t\tnext: items\n\t\t\t\t});\n\t\t\t\telse skipped++;\n\t\t\t} else if (byte === RIGHT_BRACE || byte === RIGHT_BRACKET) {\n\t\t\t\tif (skipped > 0) skipped--;\n\t\t\t\telse frames.pop();\n\t\t\t} else if (byte === COMMA || byte === COLON) last = byte;\n\t\t}\n\t\tif (mode !== BLOB) emit(chunk, from, length);\n\t};\n\tconst finish = () => {\n\t\tif (mode === BLOB) restore();\n\t\treturn {\n\t\t\ttext: new TextDecoder().decode(join([...pieces, piece.subarray(0, pieceLength)], size)),\n\t\t\tbinaries\n\t\t};\n\t};\n\treturn {\n\t\tpush,\n\t\tfinish\n\t};\n}\n/**\n* Replaces the placeholders in a parsed value with the bytes they stand for.\n* Objects and arrays are copied, the parsed value is not modified. A\n* placeholder holds a random number, so a string that equals one is ours.\n*/\nfunction replaceBinaryFieldPlaceholders(value, binaries) {\n\tif (typeof value === \"string\") return binaries.get(value) ?? value;\n\tif (Array.isArray(value)) return value.map((item) => replaceBinaryFieldPlaceholders(item, binaries));\n\tif (value != null && typeof value === \"object\") return Object.fromEntries(Object.entries(value).map(([name, item]) => [name, replaceBinaryFieldPlaceholders(item, binaries)]));\n\treturn value;\n}\n/**\n* Makes `JSON.stringify` give the placeholder for each of the arrays, instead\n* of `{\"0\":…,\"1\":…}` with an entry for every byte: 24 MiB of bytes would\n* become a string of more than 300 MB. That is what a validator, or the code\n* that reports its issues, does with a value it puts into an error message.\n* The property is not enumerable, so the arrays look the same otherwise.\n* Returns the function that removes it again.\n*/\nfunction maskBinariesInJson(binaries) {\n\tfor (const [placeholder, bytes] of binaries) Object.defineProperty(bytes, \"toJSON\", {\n\t\tvalue: () => placeholder,\n\t\tconfigurable: true\n\t});\n\treturn () => {\n\t\tfor (const bytes of binaries.values()) Reflect.deleteProperty(bytes, \"toJSON\");\n\t};\n}\n/**\n* Wraps a schema so that it validates the extracted bytes in place of their\n* placeholders. The value parsed from the skeleton, and the value of the\n* validation error of the response, keep the placeholders: reporting an error\n* never prints the bytes.\n*\n* The errors of the schema itself may hold the bytes: a Standard Schema\n* validator wraps the value it was given into an error, and the issues it\n* reports may carry the offending input. So that their messages do not grow\n* with the image, the arrays stringify as their placeholders, and keep doing\n* so as long as an error can refer to them. When the validation succeeds the\n* arrays are plain again, for whoever receives them.\n*/\nfunction withBinaryFields(schema, binaries) {\n\tif (binaries.size === 0) return schema;\n\tconst actualSchema = asSchema(schema);\n\treturn jsonSchema({}, { validate: async (value) => {\n\t\tconst replaced = replaceBinaryFieldPlaceholders(value, binaries);\n\t\tconst unmask = maskBinariesInJson(binaries);\n\t\tconst result = actualSchema.validate ? await actualSchema.validate(replaced) : {\n\t\t\tsuccess: true,\n\t\t\tvalue: replaced\n\t\t};\n\t\tif (result.success) unmask();\n\t\treturn result;\n\t} });\n}\n//#endregion\n//#region src/response-handler.ts\nconst textDecoder = new TextDecoder();\nconst DEFAULT_MAX_JSON_LINE_BYTES = 67108864;\nfunction wrapResponseBodyStream({ stream, url, requestBodyValues, statusCode, responseHeaders }) {\n\tconst reader = stream.getReader();\n\tlet readerReleased = false;\n\tconst releaseReader = () => {\n\t\tif (!readerReleased) {\n\t\t\treader.releaseLock();\n\t\t\treaderReleased = true;\n\t\t}\n\t};\n\treturn new ReadableStream({\n\t\tasync pull(controller) {\n\t\t\ttry {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) {\n\t\t\t\t\treleaseReader();\n\t\t\t\t\tcontroller.close();\n\t\t\t\t} else controller.enqueue(value);\n\t\t\t} catch (error) {\n\t\t\t\treleaseReader();\n\t\t\t\tif (isAbortError(error)) {\n\t\t\t\t\tcontroller.error(error);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontroller.error(handleFetchError({\n\t\t\t\t\terror: new APICallError({\n\t\t\t\t\t\tmessage: \"Failed to process successful response\",\n\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\tstatusCode,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\tresponseHeaders,\n\t\t\t\t\t\trequestBodyValues\n\t\t\t\t\t}),\n\t\t\t\t\turl,\n\t\t\t\t\trequestBodyValues\n\t\t\t\t}));\n\t\t\t}\n\t\t},\n\t\tasync cancel(reason) {\n\t\t\ttry {\n\t\t\t\tawait reader.cancel(reason);\n\t\t\t} finally {\n\t\t\t\treleaseReader();\n\t\t\t}\n\t\t}\n\t});\n}\nasync function readResponseBodyAsText({ response, url }) {\n\treturn textDecoder.decode(await readResponseWithSizeLimit({\n\t\tresponse,\n\t\turl\n\t}));\n}\nconst createJsonErrorResponseHandler = ({ errorSchema, errorToMessage, isRetryable }) => async ({ response, url, requestBodyValues }) => {\n\tconst responseBody = await readResponseBodyAsText({\n\t\tresponse,\n\t\turl\n\t});\n\tconst responseHeaders = extractResponseHeaders(response);\n\tif (responseBody.trim() === \"\") return {\n\t\tresponseHeaders,\n\t\tvalue: new APICallError({\n\t\t\tmessage: response.statusText,\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tstatusCode: response.status,\n\t\t\tresponseHeaders,\n\t\t\tresponseBody,\n\t\t\tisRetryable: isRetryable?.(response)\n\t\t})\n\t};\n\ttry {\n\t\tconst parsedError = await parseJSON({\n\t\t\ttext: responseBody,\n\t\t\tschema: errorSchema\n\t\t});\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: new APICallError({\n\t\t\t\tmessage: errorToMessage(parsedError),\n\t\t\t\turl,\n\t\t\t\trequestBodyValues,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\tresponseHeaders,\n\t\t\t\tresponseBody,\n\t\t\t\tdata: parsedError,\n\t\t\t\tisRetryable: isRetryable?.(response, parsedError)\n\t\t\t})\n\t\t};\n\t} catch {\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: new APICallError({\n\t\t\t\tmessage: response.statusText,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\tresponseHeaders,\n\t\t\t\tresponseBody,\n\t\t\t\tisRetryable: isRetryable?.(response)\n\t\t\t})\n\t\t};\n\t}\n};\nconst createEventSourceResponseHandler = (chunkSchema) => async ({ response, url, requestBodyValues }) => {\n\tconst responseHeaders = extractResponseHeaders(response);\n\tif (response.body == null) throw new EmptyResponseBodyError({});\n\treturn {\n\t\tresponseHeaders,\n\t\tvalue: parseJsonEventStream({\n\t\t\tstream: wrapResponseBodyStream({\n\t\t\t\tstream: response.body,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\tresponseHeaders\n\t\t\t}),\n\t\t\tschema: chunkSchema\n\t\t})\n\t};\n};\nconst createJsonResponseHandler = (responseSchema, { experimental_binaryFields } = {}) => {\n\tconst binaryFieldPaths = experimental_binaryFields?.length ? compileBinaryFieldPaths(experimental_binaryFields) : void 0;\n\treturn async ({ response, url, requestBodyValues }) => {\n\t\tlet responseBody;\n\t\tlet schema = responseSchema;\n\t\tif (binaryFieldPaths == null) responseBody = await readResponseBodyAsText({\n\t\t\tresponse,\n\t\t\turl\n\t\t});\n\t\telse {\n\t\t\tconst scanner = createJsonBinaryFieldScanner(binaryFieldPaths);\n\t\t\tawait readResponseWithSizeLimit({\n\t\t\t\tresponse,\n\t\t\t\turl,\n\t\t\t\tonChunk: scanner.push\n\t\t\t});\n\t\t\tconst scanned = scanner.finish();\n\t\t\tresponseBody = scanned.text;\n\t\t\tschema = withBinaryFields(responseSchema, scanned.binaries);\n\t\t}\n\t\tconst parsedResult = await safeParseJSON({\n\t\t\ttext: responseBody,\n\t\t\tschema\n\t\t});\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (!parsedResult.success) throw new APICallError({\n\t\t\tmessage: \"Invalid JSON response\",\n\t\t\tcause: parsedResult.error,\n\t\t\tstatusCode: response.status,\n\t\t\tresponseHeaders,\n\t\t\tresponseBody,\n\t\t\turl,\n\t\t\trequestBodyValues\n\t\t});\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: parsedResult.value,\n\t\t\trawValue: parsedResult.rawValue\n\t\t};\n\t};\n};\nconst createJsonLinesResponseHandler = (responseSchema, { maxLineBytes = DEFAULT_MAX_JSON_LINE_BYTES } = {}) => {\n\tif (!Number.isSafeInteger(maxLineBytes) || maxLineBytes <= 0) throw new InvalidArgumentError({\n\t\targument: \"maxLineBytes\",\n\t\tmessage: \"maxLineBytes must be a positive safe integer.\"\n\t});\n\treturn async ({ response, url }) => {\n\t\tconst responseHeaders = extractResponseHeaders(response);\n\t\tif (response.body == null) throw new EmptyResponseBodyError({});\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: parseJsonLines({\n\t\t\t\tstream: response.body,\n\t\t\t\tschema: responseSchema,\n\t\t\t\turl,\n\t\t\t\tmaxLineBytes\n\t\t\t})\n\t\t};\n\t};\n};\nasync function* parseJsonLines({ stream, schema, url, maxLineBytes }) {\n\tconst reader = stream.getReader();\n\tconst decoder = new TextDecoder();\n\tlet buffer = \"\";\n\tlet lineBytes = 0;\n\tlet finished = false;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) {\n\t\t\t\tfinished = true;\n\t\t\t\tbuffer += decoder.decode();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tlet offset = 0;\n\t\t\twhile (offset < value.length) {\n\t\t\t\tconst lineEnd = value.indexOf(10, offset);\n\t\t\t\tconst segmentEnd = lineEnd === -1 ? value.length : lineEnd;\n\t\t\t\tlineBytes += segmentEnd - offset;\n\t\t\t\tif (lineBytes > maxLineBytes) throw new DownloadError({\n\t\t\t\t\tmessage: `JSON Lines response exceeded maximum line size of ${maxLineBytes} bytes.`,\n\t\t\t\t\turl\n\t\t\t\t});\n\t\t\t\tconst decodeEnd = lineEnd === -1 ? segmentEnd : lineEnd + 1;\n\t\t\t\tbuffer += decoder.decode(value.subarray(offset, decodeEnd), { stream: true });\n\t\t\t\tif (lineEnd === -1) break;\n\t\t\t\tconst line = buffer.slice(0, -1).replace(/\\r$/, \"\");\n\t\t\t\tbuffer = \"\";\n\t\t\t\tlineBytes = 0;\n\t\t\t\toffset = decodeEnd;\n\t\t\t\tif (line.trim().length > 0) yield await parseJSON({\n\t\t\t\t\ttext: line,\n\t\t\t\t\tschema\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst finalLine = buffer.replace(/\\r$/, \"\");\n\t\tif (finalLine.trim().length > 0) yield await parseJSON({\n\t\t\ttext: finalLine,\n\t\t\tschema\n\t\t});\n\t} finally {\n\t\tif (!finished) await reader.cancel().catch(() => {});\n\t\treader.releaseLock();\n\t}\n}\nconst createBinaryResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n\tconst responseHeaders = extractResponseHeaders(response);\n\tif (!response.body) throw new APICallError({\n\t\tmessage: \"Response body is empty\",\n\t\turl,\n\t\trequestBodyValues,\n\t\tstatusCode: response.status,\n\t\tresponseHeaders,\n\t\tresponseBody: void 0\n\t});\n\ttry {\n\t\tconst buffer = await response.arrayBuffer();\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: new Uint8Array(buffer)\n\t\t};\n\t} catch (error) {\n\t\tthrow new APICallError({\n\t\t\tmessage: \"Failed to read response as array buffer\",\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tstatusCode: response.status,\n\t\t\tresponseHeaders,\n\t\t\tresponseBody: void 0,\n\t\t\tcause: error\n\t\t});\n\t}\n};\n/**\n* Passes the response body through as a `ReadableStream<Uint8Array>` without\n* buffering it (unlike `createBinaryResponseHandler`). The consumer is\n* responsible for draining or cancelling the stream.\n*/\nconst createBinaryStreamResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n\tconst responseHeaders = extractResponseHeaders(response);\n\tif (response.body == null) throw new EmptyResponseBodyError({});\n\treturn {\n\t\tresponseHeaders,\n\t\tvalue: wrapResponseBodyStream({\n\t\t\tstream: response.body,\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tstatusCode: response.status,\n\t\t\tresponseHeaders\n\t\t})\n\t};\n};\nconst createStatusCodeErrorResponseHandler = () => async ({ response, url, requestBodyValues }) => {\n\tconst responseHeaders = extractResponseHeaders(response);\n\tconst responseBody = await readResponseBodyAsText({\n\t\tresponse,\n\t\turl\n\t});\n\treturn {\n\t\tresponseHeaders,\n\t\tvalue: new APICallError({\n\t\t\tmessage: response.statusText,\n\t\t\turl,\n\t\t\trequestBodyValues,\n\t\t\tstatusCode: response.status,\n\t\t\tresponseHeaders,\n\t\t\tresponseBody\n\t\t})\n\t};\n};\n//#endregion\n//#region src/is-json-serializable.ts\n/**\n* Checks whether a value can cross a workflow serialization boundary.\n*\n* The check accepts JSON-like primitives, arrays, and plain objects whose\n* nested values are also serializable. It rejects functions, symbols,\n* bigints, and non-plain objects such as class instances, dates, and regexes.\n*/\nfunction isJSONSerializable(value) {\n\tif (value === null || value === void 0) return true;\n\tconst type = typeof value;\n\tif (type === \"string\" || type === \"number\" || type === \"boolean\") return true;\n\tif (type === \"function\" || type === \"symbol\" || type === \"bigint\") return false;\n\tif (Array.isArray(value)) return value.every(isJSONSerializable);\n\tif (Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isJSONSerializable);\n\treturn false;\n}\n//#endregion\n//#region src/serialization-error.ts\nconst name = \"AI_SerializationError\";\nconst marker = `vercel.ai.error.${name}`;\nconst symbol = Symbol.for(marker);\nvar SerializationError = class extends AISDKError {\n\tconstructor({ message = \"Failed to serialize value.\", cause } = {}) {\n\t\tsuper({\n\t\t\tname,\n\t\t\tmessage,\n\t\t\tcause\n\t\t});\n\t\tthis[symbol] = true;\n\t}\n\tstatic isInstance(error) {\n\t\treturn AISDKError.hasMarker(error, marker);\n\t}\n};\n//#endregion\n//#region src/serialize-model-options.ts\n/**\n* Serializes a model instance for workflow step boundaries.\n* Returns the `modelId` plus the JSON-serializable config properties.\n*\n* Non-serializable values are omitted. As a special case, a\n* function-valued `headers` property is resolved during serialization\n* and included if the returned value is JSON-serializable.\n*\n* Used as the body of `static [WORKFLOW_SERIALIZE]` in provider models.\n*\n* @example\n* ```ts\n* static [WORKFLOW_SERIALIZE](model: MyLanguageModel) {\n*   return serializeModelOptions({\n*     modelId: model.modelId,\n*     config: model.config,\n*   });\n* }\n* ```\n*/\nfunction serializeModelOptions(options) {\n\tconst serializableConfig = {};\n\tfor (const [key, value] of Object.entries(options.config)) if (key === \"headers\") {\n\t\tconst resolvedHeaders = resolveSync(value);\n\t\tif (isJSONSerializable(resolvedHeaders)) serializableConfig[key] = resolvedHeaders;\n\t} else if (isJSONSerializable(value)) serializableConfig[key] = value;\n\treturn {\n\t\tmodelId: options.modelId,\n\t\tconfig: serializableConfig\n\t};\n}\nfunction resolveSync(value) {\n\tlet next = value;\n\tif (typeof value === \"function\") next = value();\n\tif (next instanceof Promise) throw new SerializationError({ message: \"Cannot serialize asynchronous model options.\" });\n\treturn next;\n}\n//#endregion\n//#region src/speech-stream-envelope.ts\n/**\n* Experimental speech-stream WebSocket envelope (v1): the standard\n* serialization of `Experimental_StreamingSpeechModelV4.doStream` over a WebSocket. Clients (e.g.\n* the `@ai-sdk/gateway` provider) encode with this module and servers (e.g.\n* AI Gateway) decode with it, so the two sides cannot drift.\n*\n* Envelope rules:\n*\n* 1. The client sends exactly one `speech-stream.start` TEXT frame first.\n* 2. Input text rides `speech-stream.text-delta` TEXT frames, in order. A\n*    frame may carry its text part's `voice` and `providerOptions`. A long\n*    part may span several frames: `voice` is repeated on each, and\n*    `providerOptions` appear on the first only, so they must describe an\n*    event at the start of the part (e.g. a turn break), not a setting. An\n*    empty `delta` is valid and carries only part metadata; it does not end\n*    the input.\n* 3. The client signals the end of the input text with the\n*    `speech-stream.text-done` TEXT frame; a plain close without it is an\n*    abort.\n* 4. Every server→client TEXT frame is one JSON-serialized\n*    `SpeechModelV4StreamPart` (flattened, no wrapper). `audio` payloads are\n*    base64 strings. `Date` values (`response-metadata.timestamp`) serialize\n*    to ISO 8601 strings and are revived by `parseSpeechStreamPart`. `Error`\n*    payloads in `error` parts serialize as `{ name, message }`; servers may\n*    instead send `{ type, message }`, where `type` names an error class the\n*    client can map to a typed error (e.g. `invalid_request_error`).\n* 5. The server closes with code 1000 after the `finish` part. Over this\n*    envelope an `error` part is terminal: the server sends it on failure and\n*    then closes non-1000. A close without a prior `finish` is an error.\n* 6. Unknown frame/part types are ignored in both directions (forward\n*    compatibility).\n* 7. Servers may enforce a maximum frame size (the AI Gateway rejects frames\n*    over 256 KiB); clients should keep text-delta frames under 64 KiB.\n* 8. Connection establishment (URL, auth) is transport-specific and out of\n*    scope.\n*\n* The envelope validates frame shape only; server policy layers on top. Both\n* parsers use `secureJsonParse`, so frames carrying `__proto__` /\n* `constructor.prototype` keys are rejected rather than parsed.\n*/\n/** Type of the first client TEXT frame. */\nconst SPEECH_STREAM_START_FRAME_TYPE = \"speech-stream.start\";\n/** Type of the client TEXT frame that carries one input text delta. */\nconst SPEECH_STREAM_TEXT_DELTA_FRAME_TYPE = \"speech-stream.text-delta\";\n/** Type of the client TEXT frame that signals the end of the input text. */\nconst SPEECH_STREAM_TEXT_DONE_FRAME_TYPE = \"speech-stream.text-done\";\nconst optionalStartFrameFields = {\n\tinstructions: \"string\",\n\tlanguage: \"string\",\n\tspeed: \"number\",\n\tvoice: \"string\",\n\tincludeRawChunks: \"boolean\"\n};\n/**\n* Server-side: parse a client TEXT frame. Validates envelope shape only and\n* rejects prototype-pollution payloads. Never throws.\n*/\nfunction parseSpeechStreamClientFrame(text) {\n\tlet value;\n\ttry {\n\t\tvalue = secureJsonParse(text);\n\t} catch {\n\t\treturn {\n\t\t\ttype: \"invalid\",\n\t\t\tmessage: \"malformed JSON\"\n\t\t};\n\t}\n\tif (!isRecord(value)) return {\n\t\ttype: \"invalid\",\n\t\tmessage: \"frame must be a JSON object\"\n\t};\n\tif (typeof value.type !== \"string\") return {\n\t\ttype: \"invalid\",\n\t\tmessage: \"frame type must be a string\"\n\t};\n\tswitch (value.type) {\n\t\tcase SPEECH_STREAM_START_FRAME_TYPE: {\n\t\t\tfor (const [field, type] of Object.entries(optionalStartFrameFields)) if (value[field] !== void 0 && typeof value[field] !== type) return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: `${field} must be a ${type} when present`\n\t\t\t};\n\t\t\tif (value.outputFormat !== void 0 && !isAudioFormat(value.outputFormat)) return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"outputFormat must be an audio format object ({ type, rate? }) when present\"\n\t\t\t};\n\t\t\tif (value.providerOptions !== void 0 && !isProviderOptions(value.providerOptions)) return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"providerOptions must be an object of provider objects when present\"\n\t\t\t};\n\t\t\tconst frame = { type: SPEECH_STREAM_START_FRAME_TYPE };\n\t\t\tfor (const field of Object.keys(optionalStartFrameFields)) if (value[field] !== void 0) frame[field] = value[field];\n\t\t\tif (value.outputFormat !== void 0) {\n\t\t\t\tconst { type, rate } = value.outputFormat;\n\t\t\t\tframe.outputFormat = {\n\t\t\t\t\ttype,\n\t\t\t\t\t...rate !== void 0 && { rate }\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (value.providerOptions !== void 0) frame.providerOptions = value.providerOptions;\n\t\t\treturn {\n\t\t\t\ttype: \"start\",\n\t\t\t\tframe\n\t\t\t};\n\t\t}\n\t\tcase SPEECH_STREAM_TEXT_DELTA_FRAME_TYPE:\n\t\t\tif (typeof value.delta !== \"string\") return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"text-delta frame must have a string delta\"\n\t\t\t};\n\t\t\tif (value.voice !== void 0 && typeof value.voice !== \"string\") return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"text-delta voice must be a string when present\"\n\t\t\t};\n\t\t\tif (value.providerOptions !== void 0 && !isProviderOptions(value.providerOptions)) return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"text-delta providerOptions must be an object of provider objects when present\"\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"text-delta\",\n\t\t\t\tdelta: value.delta,\n\t\t\t\t...value.voice !== void 0 && { voice: value.voice },\n\t\t\t\t...value.providerOptions !== void 0 && { providerOptions: value.providerOptions }\n\t\t\t};\n\t\tcase SPEECH_STREAM_TEXT_DONE_FRAME_TYPE: return { type: \"text-done\" };\n\t\tdefault: return { type: \"unknown\" };\n\t}\n}\n/**\n* Server-side: serialize a speech stream part as one TEXT frame. Binary audio\n* is base64-encoded and `Error` payloads serialize as `{ name, message }`.\n* Returns `undefined` for payloads that are not JSON-serializable; callers\n* drop the frame.\n*/\nfunction serializeSpeechStreamPart(part) {\n\ttry {\n\t\tif (part.type === \"audio\" && part.audio instanceof Uint8Array) return JSON.stringify({\n\t\t\t...part,\n\t\t\taudio: convertUint8ArrayToBase64(part.audio)\n\t\t});\n\t\tif (part.type === \"error\" && isError$1(part.error)) return JSON.stringify({\n\t\t\t...part,\n\t\t\terror: {\n\t\t\t\tname: part.error.name,\n\t\t\t\tmessage: part.error.message\n\t\t\t}\n\t\t});\n\t\treturn JSON.stringify(part);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction isError$1(value) {\n\treturn value instanceof Error || Object.prototype.toString.call(value) === \"[object Error]\";\n}\n/**\n* Client-side: parse a server TEXT frame into a speech stream part. Returns\n* `undefined` for malformed or unsafe JSON, unknown part types, and known\n* part types whose fields are missing or mistyped. Revives\n* `response-metadata.timestamp` to a `Date`.\n*/\nfunction parseSpeechStreamPart(text) {\n\tlet value;\n\ttry {\n\t\tvalue = secureJsonParse(text);\n\t} catch {\n\t\treturn;\n\t}\n\tif (!isRecord(value)) return;\n\tconst part = value;\n\tswitch (part.type) {\n\t\tcase \"stream-start\": {\n\t\t\tif (!Array.isArray(part.warnings)) return;\n\t\t\tconst warnings = part.warnings.filter((warning) => !isUnknownWarningType(warning));\n\t\t\treturn warnings.every(isWarning$1) ? {\n\t\t\t\t...part,\n\t\t\t\twarnings\n\t\t\t} : void 0;\n\t\t}\n\t\tcase \"audio\": return isString$1(part.audio) && isAudioFormat(part.audioFormat) && isOptional$1(part.id, isString$1) && isOptional$1(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"finish\": return isOptional$1(part.usage, isUsage) && isOptional$1(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"response-metadata\": {\n\t\t\tif (!(isOptional$1(part.modelId, isString$1) && isOptional$1(part.headers, isRecord))) return;\n\t\t\tconst timestamp = part.timestamp;\n\t\t\tif (timestamp == null) return {\n\t\t\t\t...part,\n\t\t\t\ttimestamp: void 0\n\t\t\t};\n\t\t\tif (typeof timestamp !== \"string\") return;\n\t\t\tconst revived = new Date(timestamp);\n\t\t\treturn Number.isNaN(revived.getTime()) ? void 0 : {\n\t\t\t\t...part,\n\t\t\t\ttimestamp: revived\n\t\t\t};\n\t\t}\n\t\tcase \"raw\": return \"rawValue\" in part ? part : void 0;\n\t\tcase \"error\": return \"error\" in part ? part : void 0;\n\t\tdefault: return;\n\t}\n}\nfunction isString$1(value) {\n\treturn typeof value === \"string\";\n}\nfunction isOptional$1(value, check) {\n\treturn value === void 0 || check(value);\n}\nconst knownWarningTypes = /* @__PURE__ */ new Set([\n\t\"compatibility\",\n\t\"deprecated\",\n\t\"other\",\n\t\"unsupported\"\n]);\nfunction isUnknownWarningType(value) {\n\treturn isRecord(value) && isString$1(value.type) && !knownWarningTypes.has(value.type);\n}\nfunction isWarning$1(value) {\n\tif (!isRecord(value)) return false;\n\tswitch (value.type) {\n\t\tcase \"compatibility\":\n\t\tcase \"unsupported\": return isString$1(value.feature) && isOptional$1(value.details, isString$1);\n\t\tcase \"deprecated\": return isString$1(value.setting) && isString$1(value.message);\n\t\tcase \"other\": return isString$1(value.message);\n\t\tdefault: return false;\n\t}\n}\nfunction isProviderOptions(value) {\n\treturn isRecord(value) && Object.values(value).every(isRecord);\n}\nfunction isAudioFormat(value) {\n\treturn isRecord(value) && isString$1(value.type) && value.type.length > 0 && isOptional$1(value.rate, (rate) => typeof rate === \"number\" && Number.isFinite(rate) && rate > 0);\n}\nfunction isUsage(value) {\n\treturn isRecord(value) && [\n\t\t\"inputCharacters\",\n\t\t\"inputTokens\",\n\t\t\"outputTokens\"\n\t].every((key) => isOptional$1(value[key], (count) => typeof count === \"number\"));\n}\n//#endregion\n//#region src/streaming-tool-call-argument-state.ts\nfunction startsWithStructuredValue(value) {\n\tif (typeof value !== \"string\") return false;\n\tconst firstCharacter = value.trimStart()[0];\n\treturn firstCharacter === \"{\" || firstCharacter === \"[\";\n}\n/**\n* Incrementally tracks whether streamed tool-call arguments contain a complete\n* structured JSON value. This is intentionally structural rather than a JSON\n* parse: a currently parsable scalar can still be the prefix of a later value.\n*/\nvar StreamingToolCallArgumentState = class {\n\tconstructor(initialValue = \"\") {\n\t\tthis.structure = { kind: \"undetermined\" };\n\t\tthis.append(initialValue);\n\t}\n\tget hasCompleteStructuredValue() {\n\t\treturn this.structure.kind === \"structured\" && this.structure.complete === true;\n\t}\n\tappend(delta) {\n\t\tlet nextStructure = this.structure;\n\t\tfor (const character of delta) {\n\t\t\tif (nextStructure.kind === \"undetermined\") {\n\t\t\t\tif (/\\s/.test(character)) continue;\n\t\t\t\tif (character !== \"{\" && character !== \"[\") {\n\t\t\t\t\tnextStructure = { kind: \"other\" };\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tnextStructure = {\n\t\t\t\t\tkind: \"structured\",\n\t\t\t\t\tstack: [character],\n\t\t\t\t\tinString: false,\n\t\t\t\t\tescaped: false,\n\t\t\t\t\tcomplete: false\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (nextStructure.kind !== \"structured\" || nextStructure.complete) continue;\n\t\t\tif (nextStructure.inString) {\n\t\t\t\tif (nextStructure.escaped) nextStructure.escaped = false;\n\t\t\t\telse if (character === \"\\\\\") nextStructure.escaped = true;\n\t\t\t\telse if (character === \"\\\"\") nextStructure.inString = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character === \"\\\"\") nextStructure.inString = true;\n\t\t\telse if (character === \"{\" || character === \"[\") nextStructure.stack.push(character);\n\t\t\telse if (character === \"}\" || character === \"]\") {\n\t\t\t\tconst expectedOpening = character === \"}\" ? \"{\" : \"[\";\n\t\t\t\tif (nextStructure.stack.at(-1) !== expectedOpening) {\n\t\t\t\t\tnextStructure = { kind: \"other\" };\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tnextStructure.stack.pop();\n\t\t\t\tif (nextStructure.stack.length === 0) nextStructure.complete = true;\n\t\t\t}\n\t\t}\n\t\tthis.structure = nextStructure;\n\t}\n};\n//#endregion\n//#region src/streaming-tool-call-tracker.ts\n/**\n* Tracks streaming tool call state across multiple deltas from an\n* OpenAI-compatible chat completion stream. Handles argument accumulation,\n* emits tool-input-start/delta/end and tool-call events, and finalizes\n* unfinished tool calls on flush.\n*\n* Used by openai, openai-compatible, groq, deepseek, alibaba, mistral, and\n* moonshotai providers.\n*/\nvar StreamingToolCallTracker = class {\n\tconstructor(controller, options = {}) {\n\t\tthis.toolCalls = [];\n\t\tthis.toolCallsById = /* @__PURE__ */ new Map();\n\t\tthis.toolCallsByIndex = /* @__PURE__ */ new Map();\n\t\tthis.usedToolCallIds = /* @__PURE__ */ new Set();\n\t\tthis.nextGeneratedIdSuffixes = /* @__PURE__ */ new Map();\n\t\tthis.controller = controller;\n\t\tthis._generateId = options.generateId ?? generateId;\n\t\tthis.typeValidation = options.typeValidation ?? \"none\";\n\t\tthis.extractMetadata = options.extractMetadata;\n\t\tthis.buildToolCallProviderMetadata = options.buildToolCallProviderMetadata;\n\t}\n\t/**\n\t* Process a tool call delta from a streaming response chunk.\n\t* Emits tool-input-start, tool-input-delta, tool-input-end, and tool-call\n\t* events as appropriate.\n\t*/\n\tprocessDelta(toolCallDelta) {\n\t\tconst wireName = toolCallDelta.function?.name;\n\t\tconst hasBlankName = typeof wireName === \"string\" && wireName.trim().length === 0;\n\t\tconst wireId = this.getNonBlankString(toolCallDelta.id);\n\t\tconst name = this.getNonBlankString(wireName);\n\t\tconst argumentsDelta = toolCallDelta.function?.arguments;\n\t\tconst { index } = toolCallDelta;\n\t\tconst resolution = this.resolveToolCall({\n\t\t\twireId,\n\t\t\tindex,\n\t\t\tname,\n\t\t\thasExplicitCallStart: name != null && startsWithStructuredValue(argumentsDelta),\n\t\t\thasEmptyArguments: argumentsDelta == null || argumentsDelta.trim().length === 0\n\t\t});\n\t\tif (resolution.kind === \"ambiguous\") return;\n\t\tlet toolCall;\n\t\tif (resolution.kind === \"new\") {\n\t\t\tif (hasBlankName) return;\n\t\t\ttoolCall = this.processNewToolCall(toolCallDelta, {\n\t\t\t\twireId,\n\t\t\t\tindex,\n\t\t\t\tname\n\t\t\t});\n\t\t} else {\n\t\t\ttoolCall = resolution.toolCall;\n\t\t\tif (wireId != null) this.associateWireId(toolCall, wireId);\n\t\t\tthis.processExistingToolCall(toolCall, toolCallDelta);\n\t\t}\n\t\tif (index != null) this.associateIndex(toolCall, index);\n\t}\n\t/**\n\t* Finalize any unfinished tool calls. Should be called during the stream's\n\t* flush handler to ensure all tool calls are properly completed.\n\t*/\n\tflush() {\n\t\tconst toolCalls = this.toolCalls.every((toolCall) => toolCall.index != null) ? [...this.toolCalls].sort((a, b) => a.index - b.index || a.sequence - b.sequence) : this.toolCalls;\n\t\tfor (const toolCall of toolCalls) if (!toolCall.hasFinished) this.finishToolCall(toolCall);\n\t}\n\t/**\n\t* Correlation precedence for streamed deltas:\n\t*\n\t* | ID evidence | index/name evidence | start evidence | resolution |\n\t* | --- | --- | --- | --- |\n\t* | known | matching | any | matching call, new call, or ambiguity |\n\t* | known | conflicting | named | new call |\n\t* | unseen | matching | structured start | new call |\n\t* | unseen | matching | named empty arguments | incomplete call, new call, or ambiguity |\n\t* | unseen | matching | continuation | matching call or ambiguity |\n\t* | absent | matching | any | matching call, new call, or ambiguity |\n\t* | absent | absent | named | new call |\n\t* | absent | absent | unnamed | sole unfinished call, new call, or ambiguity |\n\t*/\n\tresolveToolCall({ wireId, index, name, hasExplicitCallStart, hasEmptyArguments }) {\n\t\tconst indexedToolCalls = index != null ? this.toolCallsByIndex.get(index) : void 0;\n\t\tconst matchingIndexedToolCalls = this.filterToolCallsByName(indexedToolCalls, name);\n\t\tif (wireId != null) {\n\t\t\tconst toolCallsWithId = this.toolCallsById.get(wireId);\n\t\t\tif (toolCallsWithId != null) {\n\t\t\t\tif (index != null) {\n\t\t\t\t\tconst matchingToolCalls = matchingIndexedToolCalls.filter((toolCall) => toolCallsWithId.has(toolCall));\n\t\t\t\t\tconst matchingToolCall = this.resolveMatchingToolCall(matchingToolCalls, hasExplicitCallStart);\n\t\t\t\t\tif (matchingToolCall.kind !== \"new\") return matchingToolCall;\n\t\t\t\t\tif (name != null) return { kind: \"new\" };\n\t\t\t\t\tif (indexedToolCalls != null) return { kind: \"ambiguous\" };\n\t\t\t\t\treturn this.resolveMatchingToolCall([...toolCallsWithId], false);\n\t\t\t\t}\n\t\t\t\tif (name != null) {\n\t\t\t\t\tconst matchingToolCalls = [...toolCallsWithId].filter((toolCall) => toolCall.function.name === name);\n\t\t\t\t\treturn this.resolveMatchingToolCall(matchingToolCalls, hasExplicitCallStart);\n\t\t\t\t}\n\t\t\t\treturn this.resolveMatchingToolCall([...toolCallsWithId], false);\n\t\t\t}\n\t\t\tif (matchingIndexedToolCalls.length > 0) return hasExplicitCallStart ? { kind: \"new\" } : this.resolveMatchingToolCall(matchingIndexedToolCalls, name != null && hasEmptyArguments);\n\t\t\treturn { kind: \"new\" };\n\t\t}\n\t\tif (indexedToolCalls != null) return this.resolveMatchingToolCall(matchingIndexedToolCalls, hasExplicitCallStart);\n\t\tif (name != null) return { kind: \"new\" };\n\t\tconst unfinishedToolCalls = this.toolCalls.filter((toolCall) => !toolCall.hasFinished);\n\t\treturn this.resolveMatchingToolCall(unfinishedToolCalls, false);\n\t}\n\tfilterToolCallsByName(toolCalls, name) {\n\t\tif (toolCalls == null) return [];\n\t\treturn [...toolCalls].filter((toolCall) => name == null || toolCall.function.name === name);\n\t}\n\tresolveMatchingToolCall(toolCalls, hasExplicitCallStart) {\n\t\tif (toolCalls.length === 0) return { kind: \"new\" };\n\t\tconst continuableToolCalls = toolCalls.filter((toolCall) => !toolCall.argumentState.hasCompleteStructuredValue);\n\t\tif (!hasExplicitCallStart && toolCalls.length === 1) return {\n\t\t\tkind: \"existing\",\n\t\t\ttoolCall: toolCalls[0]\n\t\t};\n\t\tif (continuableToolCalls.length === 1) return {\n\t\t\tkind: \"existing\",\n\t\t\ttoolCall: continuableToolCalls[0]\n\t\t};\n\t\tif (continuableToolCalls.length > 1 || !hasExplicitCallStart) return { kind: \"ambiguous\" };\n\t\treturn { kind: \"new\" };\n\t}\n\tprocessNewToolCall(toolCallDelta, { wireId, index, name }) {\n\t\tif (this.typeValidation === \"required\") {\n\t\t\tif (toolCallDelta.type !== \"function\") throw new InvalidResponseDataError({\n\t\t\t\tdata: toolCallDelta,\n\t\t\t\tmessage: `Expected 'function' type.`\n\t\t\t});\n\t\t} else if (this.typeValidation === \"if-present\") {\n\t\t\tif (toolCallDelta.type != null && toolCallDelta.type !== \"function\") throw new InvalidResponseDataError({\n\t\t\t\tdata: toolCallDelta,\n\t\t\t\tmessage: `Expected 'function' type.`\n\t\t\t});\n\t\t}\n\t\tif (name == null) throw new InvalidResponseDataError({\n\t\t\tdata: toolCallDelta,\n\t\t\tmessage: `Expected 'function.name' to be a string.`\n\t\t});\n\t\tconst id = this.createToolCallId(wireId);\n\t\tthis.controller.enqueue({\n\t\t\ttype: \"tool-input-start\",\n\t\t\tid,\n\t\t\ttoolName: name\n\t\t});\n\t\tconst metadata = this.extractMetadata?.(toolCallDelta);\n\t\tconst initialArguments = toolCallDelta.function?.arguments ?? \"\";\n\t\tconst toolCall = {\n\t\t\tid,\n\t\t\tindex: index ?? void 0,\n\t\t\tsequence: this.toolCalls.length,\n\t\t\ttype: \"function\",\n\t\t\tfunction: {\n\t\t\t\tname,\n\t\t\t\targuments: initialArguments\n\t\t\t},\n\t\t\targumentState: new StreamingToolCallArgumentState(initialArguments),\n\t\t\thasFinished: false,\n\t\t\tmetadata\n\t\t};\n\t\tthis.toolCalls.push(toolCall);\n\t\tif (wireId != null) this.associateWireId(toolCall, wireId);\n\t\tif (toolCall.function.arguments.length > 0) this.controller.enqueue({\n\t\t\ttype: \"tool-input-delta\",\n\t\t\tid: toolCall.id,\n\t\t\tdelta: toolCall.function.arguments\n\t\t});\n\t\treturn toolCall;\n\t}\n\tassociateWireId(toolCall, wireId) {\n\t\tlet toolCallsWithId = this.toolCallsById.get(wireId);\n\t\tif (toolCallsWithId == null) {\n\t\t\ttoolCallsWithId = /* @__PURE__ */ new Set();\n\t\t\tthis.toolCallsById.set(wireId, toolCallsWithId);\n\t\t}\n\t\ttoolCallsWithId.add(toolCall);\n\t}\n\tassociateIndex(toolCall, index) {\n\t\tlet toolCallsWithIndex = this.toolCallsByIndex.get(index);\n\t\tif (toolCallsWithIndex == null) {\n\t\t\ttoolCallsWithIndex = /* @__PURE__ */ new Set();\n\t\t\tthis.toolCallsByIndex.set(index, toolCallsWithIndex);\n\t\t}\n\t\ttoolCallsWithIndex.add(toolCall);\n\t}\n\tcreateToolCallId(wireId) {\n\t\tif (wireId != null && !this.usedToolCallIds.has(wireId)) {\n\t\t\tthis.usedToolCallIds.add(wireId);\n\t\t\treturn wireId;\n\t\t}\n\t\tconst generatedId = this.getNonBlankString(this._generateId()) ?? \"tool-call\";\n\t\tif (!this.usedToolCallIds.has(generatedId)) {\n\t\t\tthis.usedToolCallIds.add(generatedId);\n\t\t\treturn generatedId;\n\t\t}\n\t\tconst initialSuffix = this.nextGeneratedIdSuffixes.get(generatedId) ?? 1;\n\t\tconst maximumSuffix = initialSuffix + this.usedToolCallIds.size;\n\t\tfor (let suffix = initialSuffix; suffix <= maximumSuffix; suffix++) {\n\t\t\tconst suffixedId = `${generatedId}-${suffix}`;\n\t\t\tif (!this.usedToolCallIds.has(suffixedId)) {\n\t\t\t\tthis.usedToolCallIds.add(suffixedId);\n\t\t\t\tthis.nextGeneratedIdSuffixes.set(generatedId, suffix + 1);\n\t\t\t\treturn suffixedId;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Failed to create a unique tool call ID.\");\n\t}\n\tgetNonBlankString(value) {\n\t\treturn value != null && value.trim().length > 0 ? value : void 0;\n\t}\n\tprocessExistingToolCall(toolCall, toolCallDelta) {\n\t\tif (toolCall.hasFinished) return;\n\t\tif (toolCallDelta.function?.arguments != null) {\n\t\t\ttoolCall.argumentState.append(toolCallDelta.function.arguments);\n\t\t\ttoolCall.function.arguments += toolCallDelta.function.arguments;\n\t\t\tthis.controller.enqueue({\n\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\tid: toolCall.id,\n\t\t\t\tdelta: toolCallDelta.function.arguments\n\t\t\t});\n\t\t}\n\t}\n\tfinishToolCall(toolCall) {\n\t\tthis.controller.enqueue({\n\t\t\ttype: \"tool-input-end\",\n\t\t\tid: toolCall.id\n\t\t});\n\t\tconst providerMetadata = this.buildToolCallProviderMetadata?.(toolCall.metadata);\n\t\tthis.controller.enqueue({\n\t\t\ttype: \"tool-call\",\n\t\t\ttoolCallId: toolCall.id,\n\t\t\ttoolName: toolCall.function.name,\n\t\t\tinput: toolCall.function.arguments,\n\t\t\t...providerMetadata ? { providerMetadata } : {}\n\t\t});\n\t\ttoolCall.hasFinished = true;\n\t}\n};\n//#endregion\n//#region src/strip-file-extension.ts\n/**\n* Strips file extension segments from a filename.\n*\n* Examples:\n* - \"report.pdf\" -> \"report\"\n* - \"archive.tar.gz\" -> \"archive\"\n* - \"filename\" -> \"filename\"\n*/\nfunction stripFileExtension(filename) {\n\tconst firstDotIndex = filename.indexOf(\".\");\n\treturn firstDotIndex === -1 ? filename : filename.slice(0, firstDotIndex);\n}\n//#endregion\n//#region src/transcription-stream-envelope.ts\n/**\n* Experimental transcription-stream WebSocket envelope (v1): the standard\n* serialization of `TranscriptionModelV4.doStream` over a WebSocket. Clients\n* (e.g. the `@ai-sdk/gateway` provider) encode with this module and servers\n* (e.g. AI Gateway) decode with it, so the two sides cannot drift.\n*\n* Envelope rules:\n*\n* 1. The client sends exactly one `transcription-stream.start` TEXT frame\n*    first.\n* 2. Audio rides BINARY frames containing raw bytes in the declared\n*    `inputAudioFormat` (base64 string chunks are decoded before sending).\n* 3. The client signals end of audio with the\n*    `transcription-stream.audio-done` TEXT frame; a plain close without it\n*    is an abort.\n* 4. Every server→client TEXT frame is one JSON-serialized\n*    `TranscriptionModelV4StreamPart` (flattened, no wrapper). Payloads must\n*    be JSON-serializable. `Date` values (`response-metadata.timestamp`)\n*    serialize to ISO 8601 strings and are revived by\n*    `parseTranscriptionStreamPart`. `Error` payloads in `error` parts\n*    serialize as `{ name, message }`.\n* 5. The server closes with code 1000 after the `finish` part; on failure it\n*    sends an `error` part and closes non-1000. A close without a prior\n*    `finish` is an error.\n* 6. Unknown frame/part types are ignored in both directions (forward\n*    compatibility).\n* 7. Servers may enforce a maximum frame size (the AI Gateway rejects frames\n*    over 256 KiB); clients should split audio into frames of at most\n*    64 KiB.\n* 8. Connection establishment (URL, auth) is transport-specific and out of\n*    scope.\n*\n* The envelope validates frame shape only; server policy (accepted audio\n* formats, required `rate`, size limits) layers on top. Both parsers use\n* `secureJsonParse`, so frames carrying `__proto__` / `constructor.prototype`\n* keys are rejected (prototype-pollution protection) rather than parsed.\n*/\n/** Type of the first client TEXT frame. */\nconst TRANSCRIPTION_STREAM_START_FRAME_TYPE = \"transcription-stream.start\";\n/** Type of the client TEXT frame that signals the end of the audio input. */\nconst TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE = \"transcription-stream.audio-done\";\n/**\n* Server-side: parse a client TEXT frame. Validates envelope shape only and\n* rejects prototype-pollution payloads (parsed with `secureJsonParse`). Never\n* throws.\n*/\nfunction parseTranscriptionStreamClientFrame(text) {\n\tlet value;\n\ttry {\n\t\tvalue = secureJsonParse(text);\n\t} catch {\n\t\treturn {\n\t\t\ttype: \"invalid\",\n\t\t\tmessage: \"malformed JSON\"\n\t\t};\n\t}\n\tif (value == null || typeof value !== \"object\" || Array.isArray(value)) return {\n\t\ttype: \"invalid\",\n\t\tmessage: \"frame must be a JSON object\"\n\t};\n\tconst frame = value;\n\tif (typeof frame.type !== \"string\") return {\n\t\ttype: \"invalid\",\n\t\tmessage: \"frame type must be a string\"\n\t};\n\tswitch (frame.type) {\n\t\tcase TRANSCRIPTION_STREAM_START_FRAME_TYPE: {\n\t\t\tconst inputAudioFormat = frame.inputAudioFormat;\n\t\t\tif (inputAudioFormat == null || typeof inputAudioFormat !== \"object\" || Array.isArray(inputAudioFormat) || typeof inputAudioFormat.type !== \"string\") return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"start frame must have an inputAudioFormat object with a string type\"\n\t\t\t};\n\t\t\tif (inputAudioFormat.rate !== void 0 && typeof inputAudioFormat.rate !== \"number\") return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"inputAudioFormat.rate must be a number when present\"\n\t\t\t};\n\t\t\tif (frame.providerOptions !== void 0 && (frame.providerOptions == null || typeof frame.providerOptions !== \"object\" || Array.isArray(frame.providerOptions))) return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"providerOptions must be an object when present\"\n\t\t\t};\n\t\t\tif (frame.includeRawChunks !== void 0 && typeof frame.includeRawChunks !== \"boolean\") return {\n\t\t\t\ttype: \"invalid\",\n\t\t\t\tmessage: \"includeRawChunks must be a boolean when present\"\n\t\t\t};\n\t\t\treturn {\n\t\t\t\ttype: \"start\",\n\t\t\t\tframe\n\t\t\t};\n\t\t}\n\t\tcase TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE: return { type: \"audio-done\" };\n\t\tdefault: return { type: \"unknown\" };\n\t}\n}\n/**\n* Server-side: serialize a transcription stream part as one TEXT frame.\n* `Error` payloads in `error` parts serialize as `{ name, message }` —\n* `Error` properties are non-enumerable, so a plain `JSON.stringify` would\n* serialize them to `{}` and lose the message end-to-end. Returns\n* `undefined` for payloads that are not JSON-serializable (envelope rule 4,\n* e.g. bigint or cyclic values); callers drop the frame.\n*/\nfunction serializeTranscriptionStreamPart(part) {\n\ttry {\n\t\tif (part.type === \"error\" && isError(part.error)) return JSON.stringify({\n\t\t\t...part,\n\t\t\terror: {\n\t\t\t\tname: part.error.name,\n\t\t\t\tmessage: part.error.message\n\t\t\t}\n\t\t});\n\t\treturn JSON.stringify(part);\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction isError(value) {\n\treturn value instanceof Error || Object.prototype.toString.call(value) === \"[object Error]\";\n}\n/**\n* Client-side: parse a server TEXT frame into a transcription stream part.\n* Returns `undefined` for malformed or unsafe (prototype-polluting) JSON\n* (parsed with `secureJsonParse`), unknown part types, and known part types\n* whose required or optional fields are missing or mistyped (including\n* warning and segment elements) — downstream SDK code dereferences those\n* fields, so a drifted server must not crash or pollute the stream.\n* Revives `response-metadata.timestamp` to a `Date`.\n*/\nfunction parseTranscriptionStreamPart(text) {\n\tlet value;\n\ttry {\n\t\tvalue = secureJsonParse(text);\n\t} catch {\n\t\treturn;\n\t}\n\tif (value == null || typeof value !== \"object\" || Array.isArray(value)) return;\n\tconst part = value;\n\tswitch (part.type) {\n\t\tcase \"stream-start\": return Array.isArray(part.warnings) && part.warnings.every(isWarning) ? part : void 0;\n\t\tcase \"transcript-delta\": return isString(part.delta) && isOptional(part.id, isString) && isOptional(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"transcript-partial\": return isString(part.text) && isOptional(part.id, isString) && isOptional(part.startSecond, isNumber) && isOptional(part.durationInSeconds, isNumber) && isOptional(part.channelIndex, isNumber) && isOptional(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"transcript-final\": return isString(part.text) && isOptional(part.id, isString) && isOptional(part.startSecond, isNumber) && isOptional(part.endSecond, isNumber) && isOptional(part.channelIndex, isNumber) && isOptional(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"finish\": return isString(part.text) && Array.isArray(part.segments) && part.segments.every(isSegment) && isOptional(part.language, isString) && isOptional(part.durationInSeconds, isNumber) && isOptional(part.usage, isRecord) && isOptional(part.providerMetadata, isRecord) ? part : void 0;\n\t\tcase \"response-metadata\": {\n\t\t\tif (!(isOptional(part.modelId, isString) && isOptional(part.headers, isRecord))) return;\n\t\t\tconst timestamp = part.timestamp;\n\t\t\tif (timestamp == null) return {\n\t\t\t\t...part,\n\t\t\t\ttimestamp: void 0\n\t\t\t};\n\t\t\tif (typeof timestamp !== \"string\") return;\n\t\t\tconst revived = new Date(timestamp);\n\t\t\treturn Number.isNaN(revived.getTime()) ? void 0 : {\n\t\t\t\t...part,\n\t\t\t\ttimestamp: revived\n\t\t\t};\n\t\t}\n\t\tcase \"raw\": return \"rawValue\" in part ? part : void 0;\n\t\tcase \"error\": return \"error\" in part ? part : void 0;\n\t\tdefault: return;\n\t}\n}\nfunction isString(value) {\n\treturn typeof value === \"string\";\n}\nfunction isNumber(value) {\n\treturn typeof value === \"number\";\n}\nfunction isOptional(value, check) {\n\treturn value === void 0 || check(value);\n}\nfunction isWarning(value) {\n\treturn isRecord(value) && isString(value.type);\n}\nfunction isSegment(value) {\n\treturn isRecord(value) && isString(value.text) && isNumber(value.startSecond) && isNumber(value.endSecond);\n}\n//#endregion\n//#region src/validate-base-url.ts\nfunction validateBaseURL(baseURL) {\n\tif (baseURL?.trim() === \"\") throw new InvalidArgumentError({\n\t\targument: \"baseURL\",\n\t\tmessage: \"baseURL must be a non-empty string.\"\n\t});\n\treturn baseURL;\n}\n//#endregion\n//#region src/without-trailing-slash.ts\nfunction withoutTrailingSlash(url) {\n\treturn url?.replace(/\\/$/, \"\");\n}\n//#endregion\n//#region src/types/executable-tool.ts\n/**\n* Checks whether a tool exposes an execute function.\n*/\nfunction isExecutableTool(tool) {\n\treturn tool != null && typeof tool.execute === \"function\";\n}\n//#endregion\n//#region src/is-async-iterable.ts\nfunction isAsyncIterable(obj) {\n\treturn obj != null && typeof obj[Symbol.asyncIterator] === \"function\";\n}\n//#endregion\n//#region src/types/execute-tool.ts\n/**\n* Executes a tool function and normalizes its results into a stream of outputs.\n*\n* - If the tool's `execute` function returns an `AsyncIterable`, each yielded value is emitted as\n*   `{ type: \"preliminary\", output }`. After iteration completes, the last yielded value is emitted\n*   again as `{ type: \"final\", output }`.\n* - If the tool returns a direct value or Promise, a single `{ type: \"final\", output }` is yielded.\n*\n* @param params.tool The tool whose `execute` function should be invoked.\n* @param params.input The input value to pass to the tool.\n* @param params.options Additional options for tool execution.\n* @yields A preliminary output for each streamed value, followed by a final output, or a single final\n* output for non-streaming tools.\n*/\nasync function* executeTool({ tool, input, options }) {\n\tconst result = tool.execute(input, options);\n\tif (isAsyncIterable(result)) {\n\t\tlet lastOutput;\n\t\tfor await (const output of result) {\n\t\t\tlastOutput = output;\n\t\t\tyield {\n\t\t\t\ttype: \"preliminary\",\n\t\t\t\toutput\n\t\t\t};\n\t\t}\n\t\tyield {\n\t\t\ttype: \"final\",\n\t\t\toutput: lastOutput\n\t\t};\n\t} else yield {\n\t\ttype: \"final\",\n\t\toutput: await result\n\t};\n}\n//#endregion\n//#region src/types/tool-caller.ts\nfunction toolCaller(tool, definition) {\n\treturn Object.defineProperty({ ...tool }, \"experimental_toolCaller\", { value: definition });\n}\nfunction getToolCaller(tool) {\n\treturn tool?.experimental_toolCaller;\n}\n//#endregion\n//#region src/stringify-with-bigint-and-cycles.ts\n/**\n* Serializes a value as JSON, representing BigInt values as decimal strings and\n* ancestor cycles as \"[Circular]\". Reused objects, toJSON methods, and other JSON\n* serialization behavior are preserved. Getters and toJSON methods may throw.\n*/\nfunction stringifyWithBigIntAndCycles(value) {\n\tconst ancestors = [];\n\treturn JSON.stringify(value, function(_key, value) {\n\t\tif (typeof value === \"bigint\") return value.toString();\n\t\tif (typeof value !== \"object\" || value === null) return value;\n\t\twhile (ancestors.length > 0 && ancestors.at(-1) !== this) ancestors.pop();\n\t\tif (ancestors.includes(value)) return \"[Circular]\";\n\t\tancestors.push(value);\n\t\treturn value;\n\t});\n}\n//#endregion\nexport { DEFAULT_MAX_DOWNLOAD_SIZE, DelayedPromise, DownloadError, EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, SPEECH_STREAM_START_FRAME_TYPE as EXPERIMENTAL_SPEECH_STREAM_START_FRAME_TYPE, SPEECH_STREAM_TEXT_DELTA_FRAME_TYPE as EXPERIMENTAL_SPEECH_STREAM_TEXT_DELTA_FRAME_TYPE, SPEECH_STREAM_TEXT_DONE_FRAME_TYPE as EXPERIMENTAL_SPEECH_STREAM_TEXT_DONE_FRAME_TYPE, TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE as EXPERIMENTAL_TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE, TRANSCRIPTION_STREAM_START_FRAME_TYPE as EXPERIMENTAL_TRANSCRIPTION_STREAM_START_FRAME_TYPE, EventSourceParserStream, SerializationError, StreamingToolCallTracker, VERSION, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, asArray, asSchema, cancelResponseBody, combineHeaders, connectToWebSocket, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertInlineFileDataToUint8Array, convertJsonResponseToolStream, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createBinaryStreamResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonLinesResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata, createNullLanguageModelUsage, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createProviderExecutedToolFactory, createProviderStreamError, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, deleteFromApi, detectMediaType, downloadBlob, dynamicTool, encodePathSegment, executeTool, getToolCaller as experimental_getToolCaller, parseSpeechStreamClientFrame as experimental_parseSpeechStreamClientFrame, parseSpeechStreamPart as experimental_parseSpeechStreamPart, parseTranscriptionStreamClientFrame as experimental_parseTranscriptionStreamClientFrame, parseTranscriptionStreamPart as experimental_parseTranscriptionStreamPart, serializeSpeechStreamPart as experimental_serializeSpeechStreamPart, serializeTranscriptionStreamPart as experimental_serializeTranscriptionStreamPart, toolCaller as experimental_toolCaller, extractLines, extractResponseHeaders, fetchUntrustedUrl, fetchWithValidatedEndpoint, fetchWithValidatedRedirects, filterNullable, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, getTopLevelMediaType, getWebSocketConstructor, injectJsonInstructionIntoMessages, isAbortError, isArrayBuffer, isBrowserRuntime, isBuffer, isCustomReasoning, isExecutableTool, isFullMediaType, isNonNullable, isParsableJson, isProviderReference, isProviderStreamError, isRecord, isSameOrigin, isUint8Array, isUrlSupported, isValidHostnamePart, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mapReasoningToProviderBudget, mapReasoningToProviderEffort, mediaTypeToExtension, normalizeBatchRequestCounts, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postMultipartStreamToApi, postToApi, readResponseWithSizeLimit, readWebSocketMessageText, redactTelemetryValue, removeUndefinedEntries, resolve, resolveFullMediaType, resolveProviderOptions, resolveProviderReference, resolveWith, retryWithExponentialBackoff, safeParseJSON, safeValidateTypes, secureJsonParse, serializeModelOptions, stringifyWithBigIntAndCycles, stripFileExtension, toWebSocketUrl, tool, validateBaseURL, validateDownloadUrl, validateTypes, waitForWebSocketBufferDrain, withTelemetryRedaction, withUserAgentSuffix, withoutTrailingSlash, zodSchema };\n\n//# sourceMappingURL=index.js.map","import { AISDKError, NoSuchModelError, TooManyEmbeddingValuesForCallError, UnsupportedFunctionalityError } from \"@ai-sdk/provider\";\nimport { StreamingToolCallTracker, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertImageModelFileToDataUri, convertToBase64, convertUint8ArrayToBase64, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata, createNullLanguageModelUsage, encodePathSegment, generateId, getFromApi, getTopLevelMediaType, injectJsonInstructionIntoMessages, isCustomReasoning, lazySchema, loadApiKey, mapReasoningToProviderBudget, parseProviderOptions, postJsonToApi, resolve, resolveFullMediaType, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/alibaba-chat-language-model-options.ts\nconst alibabaLanguageModelChatOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Enable thinking/reasoning mode for supported models.\n\t* When enabled, the model generates reasoning content before the response.\n\t*\n\t* @default false\n\t*/\n\tenableThinking: z.boolean().optional(),\n\t/**\n\t* Maximum number of reasoning tokens to generate.\n\t*/\n\tthinkingBudget: z.number().positive().optional(),\n\t/**\n\t* Whether to preserve reasoning from previous assistant messages.\n\t*\n\t* When enabled, historical reasoning is sent separately as\n\t* `reasoning_content` and Alibaba receives `preserve_thinking: true`.\n\t* Defaults to `true` for models that support preserved thinking; set to\n\t* `false` to opt out.\n\t*/\n\tpreserveThinking: z.boolean().optional(),\n\t/**\n\t* Whether to enable parallel function calling during tool use.\n\t*\n\t* @default true\n\t*/\n\tparallelToolCalls: z.boolean().optional()\n})));\n//#endregion\n//#region src/alibaba-error.ts\nconst alibabaErrorDataSchema = lazySchema(() => zodSchema(z.object({ error: z.object({\n\tmessage: z.string(),\n\tcode: z.string().nullish(),\n\ttype: z.string().nullish()\n}) })));\nconst alibabaFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: alibabaErrorDataSchema,\n\terrorToMessage: (data) => data.error.message\n});\n//#endregion\n//#region src/alibaba-prepare-tools.ts\nfunction prepareTools({ tools, toolChoice }) {\n\ttools = tools?.length ? tools : void 0;\n\tconst toolWarnings = [];\n\tif (tools == null) return {\n\t\ttools: void 0,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst alibabaTools = [];\n\tfor (const tool of tools) if (tool.type === \"provider\") toolWarnings.push({\n\t\ttype: \"unsupported\",\n\t\tfeature: `provider-defined tool ${tool.id}`\n\t});\n\telse alibabaTools.push({\n\t\ttype: \"function\",\n\t\tfunction: {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.inputSchema,\n\t\t\t...tool.strict != null ? { strict: tool.strict } : {}\n\t\t}\n\t});\n\tif (toolChoice == null) return {\n\t\ttools: alibabaTools,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst type = toolChoice.type;\n\tswitch (type) {\n\t\tcase \"auto\":\n\t\tcase \"none\":\n\t\tcase \"required\": return {\n\t\t\ttools: alibabaTools,\n\t\t\ttoolChoice: type,\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"tool\": return {\n\t\t\ttools: alibabaTools,\n\t\t\ttoolChoice: {\n\t\t\t\ttype: \"function\",\n\t\t\t\tfunction: { name: toolChoice.toolName }\n\t\t\t},\n\t\t\ttoolWarnings\n\t\t};\n\t\tdefault: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });\n\t}\n}\n//#endregion\n//#region src/convert-alibaba-usage.ts\nfunction convertAlibabaUsage(usage) {\n\tif (usage == null) return createNullLanguageModelUsage();\n\tconst promptTokens = usage.prompt_tokens ?? 0;\n\tconst completionTokens = usage.completion_tokens ?? 0;\n\tconst cacheReadTokens = usage.prompt_tokens_details?.cached_tokens ?? 0;\n\tconst cacheWriteTokens = usage.prompt_tokens_details?.cache_creation_input_tokens ?? 0;\n\tconst reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? 0;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokens,\n\t\t\tnoCache: promptTokens - cacheReadTokens - cacheWriteTokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: cacheWriteTokens\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: completionTokens,\n\t\t\ttext: Math.max(0, completionTokens - reasoningTokens),\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/convert-to-alibaba-chat-messages.ts\nfunction formatImageUrl({ part }) {\n\tif (part.data.type === \"url\") return part.data.url.toString();\n\tif (part.data.type === \"data\") return `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}`;\n\tthrow new UnsupportedFunctionalityError({ functionality: `file part data type ${part.data.type}` });\n}\nfunction convertToAlibabaChatMessages({ prompt, cacheControlValidator, preserveThinking = false }) {\n\tconst messages = [];\n\tlet lastUserMessageIndex = -1;\n\tfor (let i = prompt.length - 1; i >= 0; i--) if (prompt[i].role === \"user\") {\n\t\tlastUserMessageIndex = i;\n\t\tbreak;\n\t}\n\tlet index = -1;\n\tfor (const { role, content, ...message } of prompt) {\n\t\tindex++;\n\t\tconst messageCacheControl = cacheControlValidator?.getCacheControl(message.providerOptions);\n\t\tswitch (role) {\n\t\t\tcase \"system\":\n\t\t\t\tif (messageCacheControl) messages.push({\n\t\t\t\t\trole: \"system\",\n\t\t\t\t\tcontent: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext: content,\n\t\t\t\t\t\tcache_control: messageCacheControl\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\telse messages.push({\n\t\t\t\t\trole: \"system\",\n\t\t\t\t\tcontent\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"user\":\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tcontent: content.map((part, index) => {\n\t\t\t\t\t\tconst isLastPart = index === content.length - 1;\n\t\t\t\t\t\tconst partCacheControl = cacheControlValidator?.getCacheControl(part.providerOptions) ?? (isLastPart ? messageCacheControl : void 0);\n\t\t\t\t\t\tswitch (part.type) {\n\t\t\t\t\t\t\tcase \"text\": return {\n\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\ttext: part.text,\n\t\t\t\t\t\t\t\t...partCacheControl ? { cache_control: partCacheControl } : {}\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcase \"file\": switch (part.data.type) {\n\t\t\t\t\t\t\t\tcase \"reference\": throw new UnsupportedFunctionalityError({ functionality: \"file parts with provider references\" });\n\t\t\t\t\t\t\t\tcase \"text\": throw new UnsupportedFunctionalityError({ functionality: \"text file parts\" });\n\t\t\t\t\t\t\t\tcase \"url\":\n\t\t\t\t\t\t\t\tcase \"data\": if (getTopLevelMediaType(part.mediaType) === \"image\") return {\n\t\t\t\t\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\t\t\t\t\timage_url: { url: formatImageUrl({ part }) },\n\t\t\t\t\t\t\t\t\t...partCacheControl ? { cache_control: partCacheControl } : {}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\telse throw new UnsupportedFunctionalityError({ functionality: \"Only image file parts are supported\" });\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"assistant\": {\n\t\t\t\tlet text = \"\";\n\t\t\t\tlet reasoningContent = \"\";\n\t\t\t\tconst toolCalls = [];\n\t\t\t\tfor (const part of content) switch (part.type) {\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\ttext += part.text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"tool-call\":\n\t\t\t\t\t\ttoolCalls.push({\n\t\t\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\t\tfunction: {\n\t\t\t\t\t\t\t\tname: part.toolName,\n\t\t\t\t\t\t\t\targuments: JSON.stringify(part.input)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reasoning\": if (preserveThinking || index > lastUserMessageIndex) reasoningContent += part.text;\n\t\t\t\t}\n\t\t\t\tif (text.length === 0 && toolCalls.length === 0 && reasoningContent.length === 0) break;\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\tcontent: text.length === 0 && toolCalls.length === 0 && reasoningContent.length > 0 ? null : messageCacheControl ? [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\ttext,\n\t\t\t\t\t\tcache_control: messageCacheControl\n\t\t\t\t\t}] : text || null,\n\t\t\t\t\t...reasoningContent.length > 0 ? { reasoning_content: reasoningContent } : {},\n\t\t\t\t\ttool_calls: toolCalls.length > 0 ? toolCalls : void 0\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"tool\": {\n\t\t\t\tconst toolResponses = content.filter((r) => r.type !== \"tool-approval-response\");\n\t\t\t\tfor (let i = 0; i < toolResponses.length; i++) {\n\t\t\t\t\tconst toolResponse = toolResponses[i];\n\t\t\t\t\tconst output = toolResponse.output;\n\t\t\t\t\tconst isLastPart = i === toolResponses.length - 1;\n\t\t\t\t\tconst partCacheControl = cacheControlValidator?.getCacheControl(toolResponse.providerOptions) ?? (isLastPart ? messageCacheControl : void 0);\n\t\t\t\t\tlet contentValue;\n\t\t\t\t\tswitch (output.type) {\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tcase \"error-text\":\n\t\t\t\t\t\t\tcontentValue = output.value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"execution-denied\":\n\t\t\t\t\t\t\tcontentValue = output.reason ?? \"Tool call execution denied.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"content\":\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\tcase \"error-json\": contentValue = JSON.stringify(output.value);\n\t\t\t\t\t}\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\trole: \"tool\",\n\t\t\t\t\t\ttool_call_id: toolResponse.toolCallId,\n\t\t\t\t\t\tcontent: partCacheControl ? [{\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: contentValue,\n\t\t\t\t\t\t\tcache_control: partCacheControl\n\t\t\t\t\t\t}] : contentValue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: throw new Error(`Unsupported role: ${role}`);\n\t\t}\n\t}\n\treturn messages;\n}\n//#endregion\n//#region src/get-cache-control.ts\nconst MAX_CACHE_BREAKPOINTS = 4;\nfunction getCacheControl(providerMetadata) {\n\tconst alibaba = providerMetadata?.alibaba;\n\treturn alibaba?.cacheControl ?? alibaba?.cache_control;\n}\nvar CacheControlValidator = class {\n\tconstructor() {\n\t\tthis.breakpointCount = 0;\n\t\tthis.warnings = [];\n\t}\n\tgetCacheControl(providerMetadata) {\n\t\tconst cacheControlValue = getCacheControl(providerMetadata);\n\t\tif (!cacheControlValue) return;\n\t\tthis.breakpointCount++;\n\t\tif (this.breakpointCount > MAX_CACHE_BREAKPOINTS) this.warnings.push({\n\t\t\ttype: \"other\",\n\t\t\tmessage: `Max breakpoint limit exceeded. Only the last ${MAX_CACHE_BREAKPOINTS} cache markers will take effect.`\n\t\t});\n\t\treturn cacheControlValue;\n\t}\n\tgetWarnings() {\n\t\treturn this.warnings;\n\t}\n};\n//#endregion\n//#region src/map-alibaba-finish-reason.ts\nfunction mapAlibabaFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tcase \"function_call\":\n\t\tcase \"tool_calls\": return \"tool-calls\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/supports-json-schema-output.ts\nconst JSON_SCHEMA_MODEL_PREFIXES = [\n\t\"qwen3.7-plus\",\n\t\"qwen3.7-flash\",\n\t\"qwen3.7-max\",\n\t\"qwen3.8-max\",\n\t\"qwen3.8-flash\"\n];\nfunction supportsJsonSchemaOutput(modelId) {\n\treturn JSON_SCHEMA_MODEL_PREFIXES.some((prefix) => modelId === prefix || modelId.startsWith(`${prefix}-`));\n}\n//#endregion\n//#region src/supports-preserved-thinking.ts\n/**\n* Whether a model id supports Alibaba's preserved-thinking mode\n* (`preserve_thinking`), which replays assistant `reasoning_content` from\n* previous turns.\n*\n* Supported models per Alibaba's documentation:\n* https://docs.qwencloud.com/developer-guides/text-generation/thinking#preserve-thinking-in-multi-turn\n*/\nconst preservedThinkingModelIds = /* @__PURE__ */ new Set([\n\t\"kimi-k2.7-code\",\n\t\"qwen3.6-max-preview\",\n\t\"qwen3.6-plus\",\n\t\"qwen3.6-plus-2026-04-02\",\n\t\"qwen3.7-flash\",\n\t\"qwen3.7-flash-2026-07-15\",\n\t\"qwen3.7-max\",\n\t\"qwen3.7-max-2026-05-17\",\n\t\"qwen3.7-max-2026-05-20\",\n\t\"qwen3.7-max-2026-06-08\",\n\t\"qwen3.7-max-preview\",\n\t\"qwen3.7-plus\",\n\t\"qwen3.7-plus-2026-05-26\",\n\t\"qwen3.8-flash\",\n\t\"qwen3.8-max\",\n\t\"qwen3.8-max-0902\"\n]);\nfunction supportsPreservedThinking(modelId) {\n\treturn preservedThinkingModelIds.has(modelId);\n}\n//#endregion\n//#region src/alibaba-chat-language-model.ts\n/**\n* Alibaba language model implementation.\n*\n* Implements LanguageModelV4 interface for Alibaba Cloud's Qwen models.\n* Supports OpenAI-compatible chat completions API with Alibaba-specific features:\n* - Reasoning/thinking mode (enable_thinking, reasoning_content)\n* - Thinking budget control (thinking_budget)\n* - Prompt caching (cached_tokens tracking)\n*/\nvar AlibabaChatLanguageModel = class AlibabaChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new AlibabaChatLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.supportedUrls = { \"image/*\": [/^https?:\\/\\/.*$/] };\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\t/**\n\t* Builds request arguments for Alibaba API call.\n\t* Converts AI SDK options to Alibaba API format.\n\t*/\n\tasync getArgs({ prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, reasoning, providerOptions, tools, toolChoice }) {\n\t\tconst warnings = [];\n\t\tconst cacheControlValidator = new CacheControlValidator();\n\t\tconst alibabaOptions = await parseProviderOptions({\n\t\t\tprovider: \"alibaba\",\n\t\t\tproviderOptions,\n\t\t\tschema: alibabaLanguageModelChatOptions\n\t\t});\n\t\tif (frequencyPenalty != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"frequencyPenalty\"\n\t\t});\n\t\tconst preserveThinking = alibabaOptions?.preserveThinking ?? (supportsPreservedThinking(this.modelId) ? true : void 0);\n\t\tconst useJsonSchema = responseFormat?.type === \"json\" && responseFormat.schema != null && supportsJsonSchemaOutput(this.modelId);\n\t\tconst useJsonObject = responseFormat?.type === \"json\" && !useJsonSchema;\n\t\tif (useJsonObject && responseFormat.schema != null) warnings.push({\n\t\t\ttype: \"compatibility\",\n\t\t\tfeature: \"responseFormat JSON schema\",\n\t\t\tdetails: `Alibaba does not support JSON Schema output for model ${this.modelId}. JSON Object mode is used instead. The schema was injected into the system message and will only be validated locally.`\n\t\t});\n\t\tconst resolvedPrompt = useJsonObject ? injectJsonInstructionIntoMessages({\n\t\t\tmessages: prompt,\n\t\t\tschema: responseFormat.schema\n\t\t}) : prompt;\n\t\tconst baseArgs = {\n\t\t\tmodel: this.modelId,\n\t\t\tmax_tokens: maxOutputTokens,\n\t\t\ttemperature,\n\t\t\ttop_p: topP,\n\t\t\ttop_k: topK,\n\t\t\tpresence_penalty: presencePenalty,\n\t\t\tstop: stopSequences,\n\t\t\tseed,\n\t\t\tresponse_format: responseFormat?.type === \"json\" ? useJsonSchema ? {\n\t\t\t\ttype: \"json_schema\",\n\t\t\t\tjson_schema: {\n\t\t\t\t\tschema: responseFormat.schema,\n\t\t\t\t\tname: responseFormat.name ?? \"response\",\n\t\t\t\t\tdescription: responseFormat.description\n\t\t\t\t}\n\t\t\t} : { type: \"json_object\" } : void 0,\n\t\t\t...resolveAlibabaThinking({\n\t\t\t\treasoning,\n\t\t\t\talibabaOptions,\n\t\t\t\twarnings\n\t\t\t}),\n\t\t\t...preserveThinking != null ? { preserve_thinking: preserveThinking } : {},\n\t\t\tmessages: convertToAlibabaChatMessages({\n\t\t\t\tprompt: resolvedPrompt,\n\t\t\t\tcacheControlValidator,\n\t\t\t\tpreserveThinking: preserveThinking ?? false\n\t\t\t})\n\t\t};\n\t\tconst { tools: alibabaTools, toolChoice: alibabaToolChoice, toolWarnings } = prepareTools({\n\t\t\ttools,\n\t\t\ttoolChoice\n\t\t});\n\t\twarnings.push(...cacheControlValidator.getWarnings());\n\t\treturn {\n\t\t\targs: {\n\t\t\t\t...baseArgs,\n\t\t\t\ttools: alibabaTools,\n\t\t\t\ttool_choice: alibabaToolChoice,\n\t\t\t\t...alibabaTools != null && alibabaOptions?.parallelToolCalls !== void 0 ? { parallel_tool_calls: alibabaOptions.parallelToolCalls } : {}\n\t\t\t},\n\t\t\twarnings: [...warnings, ...toolWarnings]\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args, warnings } = await this.getArgs(options);\n\t\tconst { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/chat/completions`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody: args,\n\t\t\tfailedResponseHandler: alibabaFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(alibabaChatResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst choice = response.choices[0];\n\t\tconst content = [];\n\t\tconst reasoning = choice.message.reasoning_content;\n\t\tif (reasoning != null && reasoning.length > 0) content.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: reasoning\n\t\t});\n\t\tconst text = choice.message.content;\n\t\tif (text != null && text.length > 0) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t});\n\t\tif (choice.message.tool_calls != null) for (const toolCall of choice.message.tool_calls) content.push({\n\t\t\ttype: \"tool-call\",\n\t\t\ttoolCallId: toolCall.id || generateId(),\n\t\t\ttoolName: toolCall.function.name,\n\t\t\tinput: toolCall.function.arguments\n\t\t});\n\t\treturn {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: mapAlibabaFinishReason(choice.finish_reason),\n\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t},\n\t\t\tusage: convertAlibabaUsage(response.usage),\n\t\t\trequest: { body: JSON.stringify(args) },\n\t\t\tresponse: {\n\t\t\t\t...createLanguageModelResponseMetadata(response),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings } = await this.getArgs(options);\n\t\tconst body = {\n\t\t\t...args,\n\t\t\tstream: true,\n\t\t\tstream_options: this.config.includeUsage ? { include_usage: true } : void 0\n\t\t};\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/chat/completions`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: alibabaFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(alibabaChatChunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet finishReason = {\n\t\t\tunified: \"interrupted\",\n\t\t\traw: void 0\n\t\t};\n\t\tlet usage = void 0;\n\t\tlet isFirstChunk = true;\n\t\tlet activeText = false;\n\t\tlet activeReasoningId = null;\n\t\tlet toolCallTracker;\n\t\treturn {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\ttoolCallTracker = new StreamingToolCallTracker(controller, { generateId });\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = chunk.value;\n\t\t\t\t\tif (isFirstChunk) {\n\t\t\t\t\t\tisFirstChunk = false;\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t...createLanguageModelResponseMetadata(value)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (value.usage != null) usage = value.usage;\n\t\t\t\t\tif (value.choices.length === 0) return;\n\t\t\t\t\tconst choice = value.choices[0];\n\t\t\t\t\tconst delta = choice.delta;\n\t\t\t\t\tif (delta.reasoning_content != null && delta.reasoning_content.length > 0) {\n\t\t\t\t\t\tif (activeReasoningId == null) {\n\t\t\t\t\t\t\tif (activeText) {\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tactiveText = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tactiveReasoningId = generateId();\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: activeReasoningId\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: activeReasoningId,\n\t\t\t\t\t\t\tdelta: delta.reasoning_content\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.content != null && delta.content.length > 0) {\n\t\t\t\t\t\tif (activeReasoningId != null) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: activeReasoningId\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tactiveReasoningId = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!activeText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tactiveText = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\tid: \"0\",\n\t\t\t\t\t\t\tdelta: delta.content\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.tool_calls != null && delta.tool_calls.length > 0) {\n\t\t\t\t\t\tif (activeReasoningId != null) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: activeReasoningId\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tactiveReasoningId = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (activeText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tactiveText = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const toolCallDelta of delta.tool_calls) toolCallTracker.processDelta(toolCallDelta);\n\t\t\t\t\t}\n\t\t\t\t\tif (choice.finish_reason != null) finishReason = {\n\t\t\t\t\t\tunified: mapAlibabaFinishReason(choice.finish_reason),\n\t\t\t\t\t\traw: choice.finish_reason\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tif (activeReasoningId != null) controller.enqueue({\n\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\tid: activeReasoningId\n\t\t\t\t\t});\n\t\t\t\t\tif (activeText) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t});\n\t\t\t\t\ttoolCallTracker.flush();\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: convertAlibabaUsage(usage)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body: JSON.stringify(body) },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t}\n};\nfunction resolveAlibabaThinking({ reasoning, alibabaOptions, warnings }) {\n\tif (alibabaOptions?.enableThinking != null || alibabaOptions?.thinkingBudget != null) return {\n\t\t...alibabaOptions.enableThinking != null ? { enable_thinking: alibabaOptions.enableThinking } : {},\n\t\t...alibabaOptions.thinkingBudget != null ? { thinking_budget: alibabaOptions.thinkingBudget } : {}\n\t};\n\tif (!isCustomReasoning(reasoning)) return {};\n\tif (reasoning === \"none\") return { enable_thinking: false };\n\treturn {\n\t\tenable_thinking: true,\n\t\tthinking_budget: mapReasoningToProviderBudget({\n\t\t\treasoning,\n\t\t\tmaxOutputTokens: 16384,\n\t\t\tmaxReasoningBudget: 16384,\n\t\t\twarnings\n\t\t})\n\t};\n}\n/**\n* Reference for schemas below:\n* https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions\n*/\nconst alibabaUsageSchema = () => z.looseObject({\n\tprompt_tokens: z.number(),\n\tcompletion_tokens: z.number(),\n\ttotal_tokens: z.number(),\n\tprompt_tokens_details: z.looseObject({\n\t\tcached_tokens: z.number().nullish(),\n\t\tcache_creation_input_tokens: z.number().nullish(),\n\t\tcache_type: z.string().nullish()\n\t}).nullish(),\n\tcompletion_tokens_details: z.looseObject({ reasoning_tokens: z.number().nullish() }).nullish()\n});\nconst alibabaChatResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tmessage: z.object({\n\t\t\trole: z.literal(\"assistant\").nullish(),\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tid: z.string(),\n\t\t\t\ttype: z.literal(\"function\"),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\targuments: z.string()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}),\n\t\tfinish_reason: z.string().nullish(),\n\t\tindex: z.number()\n\t})),\n\tusage: alibabaUsageSchema().nullish()\n})));\nconst alibabaChatChunkSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tdelta: z.object({\n\t\t\trole: z.enum([\"assistant\"]).nullish(),\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tindex: z.number().nullish(),\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\ttype: z.literal(\"function\").nullish(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string().nullish(),\n\t\t\t\t\targuments: z.string().nullish()\n\t\t\t\t}).nullish()\n\t\t\t})).nullish()\n\t\t}),\n\t\tfinish_reason: z.string().nullish(),\n\t\tindex: z.number()\n\t})),\n\tusage: alibabaUsageSchema().nullish()\n})));\n//#endregion\n//#region src/alibaba-embedding-model-options.ts\nconst alibabaEmbeddingModelOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Differentiates query text from document text for asymmetric retrieval tasks.\n\t* Defaults to `document`.\n\t*/\n\ttextType: z.enum([\"query\", \"document\"]).optional(),\n\t/**\n\t* The dimension of the output embedding vectors. Defaults to 1024.\n\t*\n\t* `text-embedding-v4` also supports 1536 and 2048 dimensions.\n\t*/\n\tdimension: z.number().optional(),\n\t/**\n\t* The output vector type. Defaults to `dense`.\n\t*\n\t* Sparse-only output is not supported by the AI SDK embedding interface,\n\t* which requires dense number arrays.\n\t*/\n\toutputType: z.enum([\n\t\t\"dense\",\n\t\t\"sparse\",\n\t\t\"dense&sparse\"\n\t]).optional()\n})));\n//#endregion\n//#region src/alibaba-embedding-model.ts\nconst alibabaEmbeddingFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: z.object({\n\t\tcode: z.string().nullish(),\n\t\tmessage: z.string(),\n\t\trequest_id: z.string().nullish()\n\t}),\n\terrorToMessage: (data) => data.message\n});\nvar AlibabaEmbeddingModel = class AlibabaEmbeddingModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new AlibabaEmbeddingModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxEmbeddingsPerCall = 10;\n\t\tthis.supportsParallelCalls = false;\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tasync doEmbed({ values, dimensions, headers, abortSignal, providerOptions }) {\n\t\tif (values.length > this.maxEmbeddingsPerCall) throw new TooManyEmbeddingValuesForCallError({\n\t\t\tprovider: this.provider,\n\t\t\tmodelId: this.modelId,\n\t\t\tmaxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n\t\t\tvalues\n\t\t});\n\t\tconst alibabaOptions = await parseProviderOptions({\n\t\t\tprovider: \"alibaba\",\n\t\t\tproviderOptions,\n\t\t\tschema: alibabaEmbeddingModelOptions\n\t\t});\n\t\tif (alibabaOptions?.outputType === \"sparse\") throw new UnsupportedFunctionalityError({\n\t\t\tfunctionality: \"Alibaba embedding outputType 'sparse'\",\n\t\t\tmessage: \"Alibaba embedding outputType 'sparse' is not supported because AI SDK embeddings require dense number arrays. Use 'dense' or 'dense&sparse' instead.\"\n\t\t});\n\t\tconst { responseHeaders, value: response, rawValue } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/services/embeddings/text-embedding/text-embedding`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tinput: { texts: values },\n\t\t\t\tparameters: {\n\t\t\t\t\ttext_type: alibabaOptions?.textType,\n\t\t\t\t\tdimension: alibabaOptions?.dimension ?? dimensions,\n\t\t\t\t\toutput_type: alibabaOptions?.outputType\n\t\t\t\t}\n\t\t\t},\n\t\t\tfailedResponseHandler: alibabaEmbeddingFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(alibabaTextEmbeddingResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst sortedEmbeddings = response.output.embeddings.sort((a, b) => a.text_index - b.text_index);\n\t\tconst sparseEmbeddings = sortedEmbeddings.map((item) => item.sparse_embedding == null ? void 0 : {\n\t\t\ttextIndex: item.text_index,\n\t\t\tsparseEmbedding: item.sparse_embedding\n\t\t}).filter((item) => item != null);\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tembeddings: sortedEmbeddings.map((item) => item.embedding),\n\t\t\tusage: response.usage ? { tokens: response.usage.total_tokens } : void 0,\n\t\t\tproviderMetadata: sparseEmbeddings.length > 0 ? { alibaba: { sparseEmbeddings } } : void 0,\n\t\t\tresponse: {\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawValue\n\t\t\t}\n\t\t};\n\t}\n};\nconst alibabaTextEmbeddingSparseEmbeddingSchema = () => z.object({\n\tindex: z.number(),\n\tvalue: z.number(),\n\ttoken: z.string().nullish()\n});\nconst alibabaTextEmbeddingResponseSchema = lazySchema(() => zodSchema(z.object({\n\toutput: z.object({ embeddings: z.array(z.object({\n\t\tembedding: z.array(z.number()),\n\t\ttext_index: z.number(),\n\t\tsparse_embedding: z.array(alibabaTextEmbeddingSparseEmbeddingSchema()).nullish()\n\t})) }),\n\tusage: z.object({ total_tokens: z.number() }).nullish()\n})));\n//#endregion\n//#region src/alibaba-video-model-options.ts\nconst alibabaVideoModelOptionsSchema = lazySchema(() => zodSchema(z.looseObject({\n\tnegativePrompt: z.string().nullish(),\n\taudioUrl: z.string().nullish(),\n\tpromptExtend: z.boolean().nullish(),\n\tshotType: z.enum([\"single\", \"multi\"]).nullish(),\n\twatermark: z.boolean().nullish(),\n\taudio: z.boolean().nullish(),\n\treferenceUrls: z.array(z.string()).nullish(),\n\tmedia: z.array(z.object({\n\t\ttype: z.enum([\n\t\t\t\"reference_image\",\n\t\t\t\"reference_video\",\n\t\t\t\"reference_audio\",\n\t\t\t\"first_frame\",\n\t\t\t\"last_frame\",\n\t\t\t\"file\",\n\t\t\t\"link\"\n\t\t]),\n\t\turl: z.string(),\n\t\treferenceVoice: z.string().nullish()\n\t})).nullish(),\n\tratio: z.enum([\n\t\t\"adaptive\",\n\t\t\"16:9\",\n\t\t\"9:16\",\n\t\t\"1:1\",\n\t\t\"4:3\",\n\t\t\"3:4\"\n\t]).nullish(),\n\tpollIntervalMs: z.number().positive().nullish(),\n\tpollTimeoutMs: z.number().positive().nullish()\n})));\n//#endregion\n//#region src/alibaba-video-model.ts\nconst alibabaVideoErrorSchema = lazySchema(() => zodSchema(z.object({\n\tcode: z.string().nullish(),\n\tmessage: z.string(),\n\trequest_id: z.string().nullish()\n})));\nconst alibabaVideoFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: alibabaVideoErrorSchema,\n\terrorToMessage: (data) => data.message\n});\nconst alibabaVideoCreateTaskSchema = lazySchema(() => zodSchema(z.object({\n\toutput: z.object({\n\t\ttask_status: z.string(),\n\t\ttask_id: z.string()\n\t}).nullish(),\n\trequest_id: z.string().nullish()\n})));\nconst alibabaVideoTaskStatusSchema = lazySchema(() => zodSchema(z.object({\n\toutput: z.object({\n\t\ttask_id: z.string(),\n\t\ttask_status: z.string(),\n\t\tvideo_url: z.string().nullish(),\n\t\tsubmit_time: z.string().nullish(),\n\t\tscheduled_time: z.string().nullish(),\n\t\tend_time: z.string().nullish(),\n\t\torig_prompt: z.string().nullish(),\n\t\tactual_prompt: z.string().nullish(),\n\t\tcode: z.string().nullish(),\n\t\tmessage: z.string().nullish()\n\t}).nullish(),\n\tusage: z.object({\n\t\tduration: z.number().nullish(),\n\t\toutput_video_duration: z.number().nullish(),\n\t\tinput_video_duration: z.number().nullish(),\n\t\tfps: z.number().nullish(),\n\t\tSR: z.number().nullish(),\n\t\tsize: z.string().nullish(),\n\t\tratio: z.string().nullish()\n\t}).nullish(),\n\trequest_id: z.string().nullish()\n})));\nfunction detectMode(modelId) {\n\tif (modelId.includes(\"-i2v\")) return \"i2v\";\n\tif (modelId.includes(\"-r2v\")) return \"r2v\";\n\treturn \"t2v\";\n}\nfunction detectProtocol(modelId) {\n\tconst version = /^wanx?(\\d+)(?:\\.(\\d+))?(?=[.-]|$)/.exec(modelId);\n\tif (version != null) {\n\t\tconst major = Number(version[1]);\n\t\tconst minor = Number(version[2] ?? 0);\n\t\tif (major < 2 || major === 2 && minor < 7) return \"legacy\";\n\t\tif (major === 2) return \"wan27\";\n\t}\n\treturn \"wan3\";\n}\nconst resolutionTierMap = {\n\t\"1280x720\": \"720P\",\n\t\"720x1280\": \"720P\",\n\t\"960x960\": \"720P\",\n\t\"1088x832\": \"720P\",\n\t\"832x1088\": \"720P\",\n\t\"1920x1080\": \"1080P\",\n\t\"1080x1920\": \"1080P\",\n\t\"1440x1440\": \"1080P\",\n\t\"1632x1248\": \"1080P\",\n\t\"1248x1632\": \"1080P\",\n\t\"832x480\": \"480P\",\n\t\"480x832\": \"480P\",\n\t\"624x624\": \"480P\"\n};\nconst supportedRatios = /* @__PURE__ */ new Set([\n\t\"16:9\",\n\t\"9:16\",\n\t\"1:1\",\n\t\"4:3\",\n\t\"3:4\"\n]);\nfunction deriveRatioFromResolution(resolution) {\n\tconst [width, height] = resolution.split(\"x\").map(Number);\n\tif (!Number.isInteger(width) || !Number.isInteger(height) || width <= 0 || height <= 0) return;\n\tlet a = width;\n\tlet b = height;\n\twhile (b !== 0) [a, b] = [b, a % b];\n\tconst ratio = `${width / a}:${height / a}`;\n\treturn supportedRatios.has(ratio) ? ratio : void 0;\n}\nfunction fileToImageString(file) {\n\tif (file.type === \"url\") return file.url;\n\treturn typeof file.data === \"string\" ? file.data : convertUint8ArrayToBase64(file.data);\n}\nfunction getFirstFrameImage(options) {\n\treturn options.frameImages?.find((frame) => frame.frameType === \"first_frame\")?.image;\n}\nfunction getLastFrameImage(options) {\n\treturn options.frameImages?.find((frame) => frame.frameType === \"last_frame\")?.image;\n}\nfunction resolveStartImage(options) {\n\treturn getFirstFrameImage(options) ?? options.image;\n}\nfunction isVideoUrl(url) {\n\treturn /\\.(mp4|mov)([?#]|$)/i.test(url);\n}\nfunction resolveMedia(options, alibabaOptions, warnings, frames) {\n\tif (alibabaOptions?.media != null && alibabaOptions.media.length > 0) return alibabaOptions.media.map((item) => ({\n\t\ttype: item.type,\n\t\turl: item.url,\n\t\t...item.referenceVoice != null ? { reference_voice: item.referenceVoice } : {}\n\t}));\n\tconst media = [];\n\tfor (const reference of options.inputReferences ?? []) if (reference.type === \"url\") media.push({\n\t\ttype: isVideoUrl(reference.url) ? \"reference_video\" : \"reference_image\",\n\t\turl: reference.url\n\t});\n\telse if (reference.mediaType.startsWith(\"image/\")) media.push({\n\t\ttype: \"reference_image\",\n\t\turl: convertImageModelFileToDataUri(reference)\n\t});\n\telse warnings.push({\n\t\ttype: \"unsupported\",\n\t\tfeature: \"inputReferences\",\n\t\tdetails: \"Alibaba reference-to-video requires URL references for videos. Non-URL video reference was skipped.\"\n\t});\n\tif (frames.first != null) media.push({\n\t\ttype: \"first_frame\",\n\t\turl: convertImageModelFileToDataUri(frames.first)\n\t});\n\tif (frames.last != null) media.push({\n\t\ttype: \"last_frame\",\n\t\turl: convertImageModelFileToDataUri(frames.last)\n\t});\n\treturn media.length > 0 ? media : void 0;\n}\nfunction resolveReferenceUrls(options, alibabaOptions, warnings) {\n\tif (options.frameImages != null && options.frameImages.length > 0) return;\n\tif (options.inputReferences != null && options.inputReferences.length > 0) {\n\t\tconst urls = [];\n\t\tfor (const reference of options.inputReferences) if (reference.type === \"url\") urls.push(reference.url);\n\t\telse warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"inputReferences\",\n\t\t\tdetails: \"Alibaba reference-to-video requires URL references. Non-URL reference was skipped.\"\n\t\t});\n\t\treturn urls.length > 0 ? urls : void 0;\n\t}\n\treturn alibabaOptions?.referenceUrls ?? void 0;\n}\nvar AlibabaVideoModel = class {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxVideosPerCall = 1;\n\t}\n\tasync buildRequest(options) {\n\t\tconst warnings = [];\n\t\tconst mode = detectMode(this.modelId);\n\t\tconst alibabaOptions = await parseProviderOptions({\n\t\t\tprovider: \"alibaba\",\n\t\t\tproviderOptions: options.providerOptions,\n\t\t\tschema: alibabaVideoModelOptionsSchema\n\t\t});\n\t\tconst input = {};\n\t\tif (options.prompt != null) input.prompt = options.prompt;\n\t\tif (alibabaOptions?.negativePrompt != null) input.negative_prompt = alibabaOptions.negativePrompt;\n\t\tif (alibabaOptions?.audioUrl != null) input.audio_url = alibabaOptions.audioUrl;\n\t\tconst startImage = resolveStartImage(options);\n\t\tconst protocol = detectProtocol(this.modelId);\n\t\tconst wan27 = protocol === \"wan27\";\n\t\tconst wan3 = protocol === \"wan3\";\n\t\tconst tieredProtocol = wan27 || wan3;\n\t\tconst supportsRatio = wan3 || wan27 && mode !== \"i2v\";\n\t\tif (!wan3 && mode === \"i2v\" && startImage != null) input.img_url = fileToImageString(startImage);\n\t\tif (wan3) {\n\t\t\tconst media = resolveMedia(options, alibabaOptions, warnings, {\n\t\t\t\tfirst: startImage,\n\t\t\t\tlast: getLastFrameImage(options)\n\t\t\t});\n\t\t\tif (media != null) input.media = media;\n\t\t} else if (mode === \"r2v\") {\n\t\t\tif (wan27) {\n\t\t\t\tconst media = resolveMedia(options, alibabaOptions, warnings, { first: getFirstFrameImage(options) });\n\t\t\t\tif (media != null) input.media = media;\n\t\t\t} else {\n\t\t\t\tconst referenceUrls = resolveReferenceUrls(options, alibabaOptions, warnings);\n\t\t\t\tif (referenceUrls != null && referenceUrls.length > 0) input.reference_urls = referenceUrls;\n\t\t\t}\n\t\t}\n\t\tif (getLastFrameImage(options) != null && !wan3) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"frameImages\",\n\t\t\tdetails: \"This model does not support last_frame. The last frame image was ignored.\"\n\t\t});\n\t\tif (options.inputReferences != null && options.inputReferences.length > 0 && mode !== \"r2v\" && !wan3) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"inputReferences\",\n\t\t\tdetails: \"Alibaba only supports inputReferences (reference-to-video) on reference-to-video models. The reference images were ignored.\"\n\t\t});\n\t\tconst parameters = {};\n\t\tif (options.duration != null) parameters.duration = options.duration;\n\t\tif (options.seed != null) parameters.seed = options.seed;\n\t\tif (options.resolution != null) {\n\t\t\tif (mode === \"i2v\" || tieredProtocol) {\n\t\t\t\tconst resolutionTier = resolutionTierMap[options.resolution] || options.resolution;\n\t\t\t\tconst supportedTiers = wan3 ? [\n\t\t\t\t\t\"480P\",\n\t\t\t\t\t\"720P\",\n\t\t\t\t\t\"1080P\"\n\t\t\t\t] : [\"720P\", \"1080P\"];\n\t\t\t\tif (tieredProtocol && !supportedTiers.includes(resolutionTier)) warnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: \"resolution\",\n\t\t\t\t\tdetails: `${wan3 ? \"wan3\" : \"wan2.7\"} models only support the ${supportedTiers.join(\", \")} resolution tiers. The resolution \"${options.resolution}\" was ignored.`\n\t\t\t\t});\n\t\t\t\telse parameters.resolution = resolutionTier;\n\t\t\t} else parameters.size = options.resolution.replace(\"x\", \"*\");\n\t\t}\n\t\tif (supportsRatio) {\n\t\t\tconst ratio = alibabaOptions?.ratio ?? options.aspectRatio ?? (options.resolution != null ? deriveRatioFromResolution(options.resolution) : void 0);\n\t\t\tif (ratio != null) parameters.ratio = ratio;\n\t\t}\n\t\tif (alibabaOptions?.promptExtend != null) parameters.prompt_extend = alibabaOptions.promptExtend;\n\t\tif (alibabaOptions?.shotType != null) {\n\t\t\tif (tieredProtocol) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"shotType\",\n\t\t\t\tdetails: `${wan3 ? \"wan3\" : \"wan2.7\"} models do not support the shotType option. Describe the shot structure in the prompt instead.`\n\t\t\t});\n\t\t\telse parameters.shot_type = alibabaOptions.shotType;\n\t\t}\n\t\tif (alibabaOptions?.watermark != null) parameters.watermark = alibabaOptions.watermark;\n\t\tconst audio = options.generateAudio ?? alibabaOptions?.audio;\n\t\tif (audio != null) {\n\t\t\tif (wan27) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"generateAudio\",\n\t\t\t\tdetails: \"wan2.7 models always generate audio. The audio option was ignored.\"\n\t\t\t});\n\t\t\telse parameters.audio = audio;\n\t\t}\n\t\tif (options.aspectRatio && !supportsRatio) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"aspectRatio\",\n\t\t\tdetails: \"Alibaba video models use explicit size/resolution dimensions. Use the resolution option or providerOptions.alibaba for size control.\"\n\t\t});\n\t\tif (options.fps) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"fps\",\n\t\t\tdetails: \"Alibaba video models do not support custom FPS.\"\n\t\t});\n\t\tif (options.n != null && options.n > 1) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"n\",\n\t\t\tdetails: \"Alibaba video models only support generating 1 video per call.\"\n\t\t});\n\t\treturn {\n\t\t\tinput,\n\t\t\tparameters,\n\t\t\twarnings,\n\t\t\talibabaOptions\n\t\t};\n\t}\n\tbuildCompletedResult(statusResponse, responseHeaders, warnings, currentDate) {\n\t\tconst taskId = statusResponse.output?.task_id;\n\t\tconst videoUrl = statusResponse.output?.video_url;\n\t\tif (!videoUrl) throw new AISDKError({\n\t\t\tname: \"ALIBABA_VIDEO_GENERATION_ERROR\",\n\t\t\tmessage: `No video URL in response. Task ID: ${taskId}`\n\t\t});\n\t\treturn {\n\t\t\tstatus: \"completed\",\n\t\t\tvideos: [{\n\t\t\t\ttype: \"url\",\n\t\t\t\turl: videoUrl,\n\t\t\t\tmediaType: \"video/mp4\"\n\t\t\t}],\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t},\n\t\t\tproviderMetadata: { alibaba: {\n\t\t\t\ttaskId,\n\t\t\t\tvideoUrl,\n\t\t\t\t...statusResponse.output?.actual_prompt ? { actualPrompt: statusResponse.output.actual_prompt } : {},\n\t\t\t\t...statusResponse.usage ? { usage: {\n\t\t\t\t\tduration: statusResponse.usage.duration,\n\t\t\t\t\toutputVideoDuration: statusResponse.usage.output_video_duration,\n\t\t\t\t\tresolution: statusResponse.usage.SR,\n\t\t\t\t\tsize: statusResponse.usage.size,\n\t\t\t\t\t...statusResponse.usage.input_video_duration != null ? { inputVideoDuration: statusResponse.usage.input_video_duration } : {},\n\t\t\t\t\t...statusResponse.usage.fps != null ? { fps: statusResponse.usage.fps } : {},\n\t\t\t\t\t...statusResponse.usage.ratio != null ? { ratio: statusResponse.usage.ratio } : {}\n\t\t\t\t} } : {}\n\t\t\t} }\n\t\t};\n\t}\n\tasync doStart(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { input, parameters, warnings } = await this.buildRequest(options);\n\t\tconst { value: createResponse, responseHeaders } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/api/v1/services/aigc/video-generation/video-synthesis`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers, { \"X-DashScope-Async\": \"enable\" }),\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tinput,\n\t\t\t\tparameters\n\t\t\t},\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(alibabaVideoCreateTaskSchema),\n\t\t\tfailedResponseHandler: alibabaVideoFailedResponseHandler,\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst taskId = createResponse.output?.task_id;\n\t\tif (!taskId) throw new AISDKError({\n\t\t\tname: \"ALIBABA_VIDEO_GENERATION_ERROR\",\n\t\t\tmessage: `No task_id returned from Alibaba API. Response: ${JSON.stringify(createResponse)}`\n\t\t});\n\t\treturn {\n\t\t\toperation: { taskId },\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n\tasync doStatus(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { taskId } = options.operation;\n\t\tconst { value: statusResponse, responseHeaders } = await getFromApi({\n\t\t\turl: `${this.config.baseURL}/api/v1/tasks/${encodePathSegment(taskId)}`,\n\t\t\tvalidateUrl: false,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(alibabaVideoTaskStatusSchema),\n\t\t\tfailedResponseHandler: alibabaVideoFailedResponseHandler,\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst taskStatus = statusResponse.output?.task_status;\n\t\tif (taskStatus === \"SUCCEEDED\") return this.buildCompletedResult(statusResponse, responseHeaders, [], currentDate);\n\t\tif (taskStatus === \"FAILED\" || taskStatus === \"CANCELED\") return {\n\t\t\tstatus: \"error\",\n\t\t\terror: `Video generation ${taskStatus.toLowerCase()}. Task ID: ${taskId}. ${statusResponse.output?.message ?? \"\"}`.trim(),\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t\treturn {\n\t\t\tstatus: \"pending\",\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/version.ts\nconst VERSION = \"2.0.80\";\n//#endregion\n//#region src/alibaba-provider.ts\n/**\n* Create an Alibaba Cloud (Qwen) provider instance.\n*/\nfunction createAlibaba(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL) ?? \"https://dashscope-intl.aliyuncs.com/compatible-mode/v1\";\n\tconst videoBaseURL = withoutTrailingSlash(options.videoBaseURL) ?? \"https://dashscope-intl.aliyuncs.com\";\n\tconst embeddingBaseURL = withoutTrailingSlash(options.embeddingBaseURL) ?? \"https://dashscope-intl.aliyuncs.com/api/v1\";\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"ALIBABA_API_KEY\",\n\t\t\tdescription: \"Alibaba Cloud (DashScope)\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-alibaba/${VERSION}`));\n\tconst createLanguageModel = (modelId) => new AlibabaChatLanguageModel(modelId, {\n\t\tprovider: \"alibaba.chat\",\n\t\tbaseURL,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch,\n\t\tincludeUsage: options.includeUsage ?? true\n\t});\n\tconst createEmbeddingModel = (modelId) => new AlibabaEmbeddingModel(modelId, {\n\t\tprovider: \"alibaba.embedding\",\n\t\tbaseURL: embeddingBaseURL,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createVideoModel = (modelId) => new AlibabaVideoModel(modelId, {\n\t\tprovider: \"alibaba.video\",\n\t\tbaseURL: videoBaseURL,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst provider = function(modelId) {\n\t\tif (new.target) throw new Error(\"The Alibaba model function cannot be called with the new keyword.\");\n\t\treturn createLanguageModel(modelId);\n\t};\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createLanguageModel;\n\tprovider.chatModel = createLanguageModel;\n\tprovider.embedding = createEmbeddingModel;\n\tprovider.embeddingModel = createEmbeddingModel;\n\tprovider.video = createVideoModel;\n\tprovider.videoModel = createVideoModel;\n\tprovider.imageModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"imageModel\"\n\t\t});\n\t};\n\treturn provider;\n}\nconst alibaba = createAlibaba();\n//#endregion\nexport { VERSION, alibaba, createAlibaba };\n\n//# sourceMappingURL=index.js.map","import { InvalidPromptError, InvalidResponseDataError, TooManyEmbeddingValuesForCallError, UnsupportedFunctionalityError } from \"@ai-sdk/provider\";\nimport { StreamingToolCallTracker, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertBase64ToUint8Array, convertToBase64, convertToFormData, createBinaryResponseHandler, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata, createLanguageModelResponseMetadata as getResponseMetadata, createNullLanguageModelUsage, createStatusCodeErrorResponseHandler, downloadBlob, generateId, getFromApi, getTopLevelMediaType, isCustomReasoning, lazySchema, parseProviderOptions, postFormDataToApi, postJsonToApi, resolve, resolveFullMediaType, resolveProviderReference, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/utils/to-camel-case.ts\nfunction toCamelCase(str) {\n\treturn str.replace(/[_-]([a-z])/g, (g) => g[1].toUpperCase());\n}\n/**\nResolves which key to use for providerMetadata based on what the caller\npassed in providerOptions. Returns the camelCase variant when the caller\nsupplied it, otherwise falls back to the raw name.\n*/\nfunction resolveProviderOptionsKey(rawName, providerOptions) {\n\tconst camelName = toCamelCase(rawName);\n\tif (camelName !== rawName && providerOptions?.[camelName] != null) return camelName;\n\treturn rawName;\n}\n/**\nPushes a deprecation warning when the user supplies providerOptions under a non-camelCase key\n*/\nfunction warnIfDeprecatedProviderOptionsKey({ rawName, providerOptions, warnings }) {\n\tconst camelName = toCamelCase(rawName);\n\tif (camelName !== rawName && providerOptions?.[rawName] != null) warnings.push({\n\t\ttype: \"deprecated\",\n\t\tsetting: `providerOptions key '${rawName}'`,\n\t\tmessage: `Use '${camelName}' instead.`\n\t});\n}\nconst defaultOpenAICompatibleErrorStructure = {\n\terrorSchema: z.object({ error: z.object({\n\t\tmessage: z.string(),\n\t\ttype: z.string().nullish(),\n\t\tparam: z.any().nullish(),\n\t\tcode: z.union([z.string(), z.number()]).nullish()\n\t}) }),\n\terrorToMessage: (data) => data.error.message\n};\n//#endregion\n//#region src/chat/convert-openai-compatible-chat-usage.ts\nfunction convertOpenAICompatibleChatUsage(usage) {\n\tif (usage == null) return createNullLanguageModelUsage();\n\tconst promptTokens = usage.prompt_tokens ?? 0;\n\tconst completionTokens = usage.completion_tokens ?? 0;\n\tconst cacheReadTokens = usage.prompt_tokens_details?.cached_tokens ?? 0;\n\tconst reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? 0;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokens,\n\t\t\tnoCache: promptTokens - cacheReadTokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: completionTokens,\n\t\t\ttext: Math.max(0, completionTokens - reasoningTokens),\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/chat/convert-to-openai-compatible-chat-messages.ts\nfunction getOpenAIMetadata(message) {\n\treturn message?.providerOptions?.openaiCompatible ?? {};\n}\nfunction getAudioFormat(mediaType) {\n\tswitch (mediaType) {\n\t\tcase \"audio/wav\": return \"wav\";\n\t\tcase \"audio/mp3\":\n\t\tcase \"audio/mpeg\": return \"mp3\";\n\t\tdefault: return null;\n\t}\n}\nfunction convertToOpenAICompatibleContentPart(part, provider) {\n\tconst partMetadata = getOpenAIMetadata(part);\n\tswitch (part.type) {\n\t\tcase \"text\": return {\n\t\t\ttype: \"text\",\n\t\t\ttext: part.text,\n\t\t\t...partMetadata\n\t\t};\n\t\tcase \"file\": switch (part.data.type) {\n\t\t\tcase \"reference\": return {\n\t\t\t\ttype: \"file\",\n\t\t\t\tfile: { file_id: resolveProviderReference({\n\t\t\t\t\treference: part.data.reference,\n\t\t\t\t\tprovider\n\t\t\t\t}) },\n\t\t\t\t...partMetadata\n\t\t\t};\n\t\t\tcase \"text\": throw new UnsupportedFunctionalityError({ functionality: \"text file parts\" });\n\t\t\tcase \"url\":\n\t\t\tcase \"data\": {\n\t\t\t\tconst topLevel = getTopLevelMediaType(part.mediaType);\n\t\t\t\tif (topLevel === \"image\") return {\n\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\timage_url: { url: part.data.type === \"url\" ? part.data.url.toString() : `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}` },\n\t\t\t\t\t...partMetadata\n\t\t\t\t};\n\t\t\t\tif (topLevel === \"video\") return {\n\t\t\t\t\ttype: \"video_url\",\n\t\t\t\t\tvideo_url: { url: part.data.type === \"url\" ? part.data.url.toString() : `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}` },\n\t\t\t\t\t...partMetadata\n\t\t\t\t};\n\t\t\t\tif (topLevel === \"audio\") {\n\t\t\t\t\tif (part.data.type === \"url\") throw new UnsupportedFunctionalityError({ functionality: \"audio file parts with URLs\" });\n\t\t\t\t\tconst fullMediaType = resolveFullMediaType({ part });\n\t\t\t\t\tconst format = getAudioFormat(fullMediaType);\n\t\t\t\t\tif (format === null) throw new UnsupportedFunctionalityError({ functionality: `audio media type ${fullMediaType}` });\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"input_audio\",\n\t\t\t\t\t\tinput_audio: {\n\t\t\t\t\t\t\tdata: convertToBase64(part.data.data),\n\t\t\t\t\t\t\tformat\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...partMetadata\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (topLevel === \"application\") {\n\t\t\t\t\tif (part.data.type === \"url\") throw new UnsupportedFunctionalityError({ functionality: \"PDF file parts with URLs\" });\n\t\t\t\t\tconst fullMediaType = resolveFullMediaType({ part });\n\t\t\t\t\tif (fullMediaType !== \"application/pdf\") throw new UnsupportedFunctionalityError({ functionality: `file part media type ${fullMediaType}` });\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"file\",\n\t\t\t\t\t\tfile: {\n\t\t\t\t\t\t\tfilename: part.filename ?? \"document.pdf\",\n\t\t\t\t\t\t\tfile_data: `data:application/pdf;base64,${convertToBase64(part.data.data)}`\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...partMetadata\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif (topLevel === \"text\") return {\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: part.data.type === \"url\" ? part.data.url.toString() : typeof part.data.data === \"string\" ? new TextDecoder().decode(convertBase64ToUint8Array(part.data.data)) : new TextDecoder().decode(part.data.data),\n\t\t\t\t\t...partMetadata\n\t\t\t\t};\n\t\t\t\tthrow new UnsupportedFunctionalityError({ functionality: `file part media type ${part.mediaType}` });\n\t\t\t}\n\t\t}\n\t}\n}\nfunction convertToolContentPart(part, provider) {\n\tif (part.type === \"custom\") throw new UnsupportedFunctionalityError({ functionality: \"custom tool content parts\" });\n\treturn convertToOpenAICompatibleContentPart(part, provider);\n}\nfunction convertToOpenAICompatibleChatMessages(prompt, { provider = \"openaiCompatible\", providerOptionsKey = \"google\", supportsMultiPartToolContent = false } = {}) {\n\tconst messages = [];\n\tfor (const { role, content, ...message } of prompt) {\n\t\tconst metadata = getOpenAIMetadata({ ...message });\n\t\tswitch (role) {\n\t\t\tcase \"system\":\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"system\",\n\t\t\t\t\tcontent,\n\t\t\t\t\t...metadata\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"user\":\n\t\t\t\tif (content.length === 1 && content[0].type === \"text\") {\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: content[0].text,\n\t\t\t\t\t\t...getOpenAIMetadata(content[0])\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tcontent: content.map((part) => convertToOpenAICompatibleContentPart(part, provider)),\n\t\t\t\t\t...metadata\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"assistant\": {\n\t\t\t\tlet text = \"\";\n\t\t\t\tlet reasoning = \"\";\n\t\t\t\tconst toolCalls = [];\n\t\t\t\tfor (const part of content) {\n\t\t\t\t\tconst partMetadata = getOpenAIMetadata(part);\n\t\t\t\t\tswitch (part.type) {\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t\ttext += part.text;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"reasoning\":\n\t\t\t\t\t\t\treasoning += part.text;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"tool-call\": {\n\t\t\t\t\t\t\tconst thoughtSignature = part.providerOptions?.[providerOptionsKey]?.thoughtSignature ?? part.providerOptions?.google?.thoughtSignature;\n\t\t\t\t\t\t\ttoolCalls.push({\n\t\t\t\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\t\t\tfunction: {\n\t\t\t\t\t\t\t\t\tname: part.toolName,\n\t\t\t\t\t\t\t\t\targuments: JSON.stringify(part.input)\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t...partMetadata,\n\t\t\t\t\t\t\t\t...thoughtSignature ? { extra_content: { google: { thought_signature: String(thoughtSignature) } } } : {}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\tcontent: toolCalls.length > 0 ? text || null : text,\n\t\t\t\t\t...reasoning.length > 0 ? { reasoning_content: reasoning } : {},\n\t\t\t\t\ttool_calls: toolCalls.length > 0 ? toolCalls : void 0,\n\t\t\t\t\t...metadata\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"tool\":\n\t\t\t\tfor (const toolResponse of content) {\n\t\t\t\t\tif (toolResponse.type === \"tool-approval-response\") continue;\n\t\t\t\t\tconst output = toolResponse.output;\n\t\t\t\t\tlet contentValue;\n\t\t\t\t\tswitch (output.type) {\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tcase \"error-text\":\n\t\t\t\t\t\t\tcontentValue = output.value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"execution-denied\":\n\t\t\t\t\t\t\tcontentValue = output.reason ?? \"Tool call execution denied.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\tcase \"error-json\":\n\t\t\t\t\t\t\tcontentValue = JSON.stringify(output.value);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"content\": contentValue = supportsMultiPartToolContent ? output.value.map((part) => convertToolContentPart(part, provider)) : JSON.stringify(output.value);\n\t\t\t\t\t}\n\t\t\t\t\tconst toolResponseMetadata = getOpenAIMetadata(toolResponse);\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\trole: \"tool\",\n\t\t\t\t\t\ttool_call_id: toolResponse.toolCallId,\n\t\t\t\t\t\tcontent: contentValue,\n\t\t\t\t\t\t...toolResponseMetadata\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault: throw new Error(`Unsupported role: ${role}`);\n\t\t}\n\t}\n\treturn messages;\n}\n//#endregion\n//#region src/chat/get-response-metadata.ts\nfunction getResponseMetadata$1({ id, model, created }) {\n\treturn createLanguageModelResponseMetadata({\n\t\tid,\n\t\tmodel,\n\t\tcreated: created || void 0\n\t});\n}\n//#endregion\n//#region src/chat/map-openai-compatible-finish-reason.ts\nfunction mapOpenAICompatibleFinishReason$1(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tcase \"function_call\":\n\t\tcase \"tool_calls\": return \"tool-calls\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/chat/openai-compatible-chat-language-model-options.ts\nconst openaiCompatibleLanguageModelChatOptions = z.object({\n\t/**\n\t* A unique identifier representing your end-user, which can help the provider to\n\t* monitor and detect abuse.\n\t*/\n\tuser: z.string().optional(),\n\t/**\n\t* Reasoning effort for reasoning models. Defaults to `medium`.\n\t*/\n\treasoningEffort: z.string().optional(),\n\t/**\n\t* Controls the verbosity of the generated text. Defaults to `medium`.\n\t*/\n\ttextVerbosity: z.string().optional(),\n\t/**\n\t* Whether to use strict JSON schema validation.\n\t* When true, the model uses constrained decoding to guarantee schema compliance.\n\t* Only used when the provider supports structured outputs and a schema is provided.\n\t*\n\t* @default true\n\t*/\n\tstrictJsonSchema: z.boolean().optional()\n});\n//#endregion\n//#region src/chat/openai-compatible-prepare-tools.ts\nfunction prepareTools({ tools, toolChoice }) {\n\ttools = tools?.length ? tools : void 0;\n\tconst toolWarnings = [];\n\tif (tools == null) return {\n\t\ttools: void 0,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst openaiCompatTools = [];\n\tfor (const tool of tools) if (tool.type === \"provider\") toolWarnings.push({\n\t\ttype: \"unsupported\",\n\t\tfeature: `provider-defined tool ${tool.id}`\n\t});\n\telse openaiCompatTools.push({\n\t\ttype: \"function\",\n\t\tfunction: {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.inputSchema,\n\t\t\t...tool.strict != null ? { strict: tool.strict } : {}\n\t\t}\n\t});\n\tif (toolChoice == null) return {\n\t\ttools: openaiCompatTools,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst type = toolChoice.type;\n\tswitch (type) {\n\t\tcase \"auto\":\n\t\tcase \"none\":\n\t\tcase \"required\": return {\n\t\t\ttools: openaiCompatTools,\n\t\t\ttoolChoice: type,\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"tool\": return {\n\t\t\ttools: openaiCompatTools,\n\t\t\ttoolChoice: {\n\t\t\t\ttype: \"function\",\n\t\t\t\tfunction: { name: toolChoice.toolName }\n\t\t\t},\n\t\t\ttoolWarnings\n\t\t};\n\t\tdefault: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });\n\t}\n}\n//#endregion\n//#region src/chat/openai-compatible-chat-language-model.ts\nvar OpenAICompatibleChatLanguageModel = class OpenAICompatibleChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new OpenAICompatibleChatLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tconst errorStructure = config.errorStructure ?? defaultOpenAICompatibleErrorStructure;\n\t\tthis.chunkSchema = createOpenAICompatibleChatChunkSchema(errorStructure.errorSchema);\n\t\tthis.failedResponseHandler = createJsonErrorResponseHandler(errorStructure);\n\t\tthis.supportsStructuredOutputs = config.supportsStructuredOutputs ?? false;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tget providerOptionsName() {\n\t\treturn this.config.provider.split(\".\")[0].trim();\n\t}\n\tget supportedUrls() {\n\t\treturn this.config.supportedUrls?.() ?? {};\n\t}\n\ttransformRequestBody(args, warnings) {\n\t\treturn this.config.transformRequestBody?.(args, warnings) ?? args;\n\t}\n\tconvertUsage(usage) {\n\t\treturn this.config.convertUsage?.(usage) ?? convertOpenAICompatibleChatUsage(usage);\n\t}\n\tasync getArgs({ prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, reasoning, providerOptions, stopSequences, responseFormat, seed, toolChoice, tools }) {\n\t\tconst warnings = [];\n\t\tconst deprecatedOptions = await parseProviderOptions({\n\t\t\tprovider: \"openai-compatible\",\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelChatOptions\n\t\t});\n\t\tif (deprecatedOptions != null) warnings.push({\n\t\t\ttype: \"deprecated\",\n\t\t\tsetting: \"providerOptions key 'openai-compatible'\",\n\t\t\tmessage: \"Use 'openaiCompatible' instead.\"\n\t\t});\n\t\twarnIfDeprecatedProviderOptionsKey({\n\t\t\trawName: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\twarnings\n\t\t});\n\t\tconst compatibleOptions = Object.assign(deprecatedOptions ?? {}, await parseProviderOptions({\n\t\t\tprovider: \"openaiCompatible\",\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelChatOptions\n\t\t}) ?? {}, await parseProviderOptions({\n\t\t\tprovider: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelChatOptions\n\t\t}) ?? {}, await parseProviderOptions({\n\t\t\tprovider: toCamelCase(this.providerOptionsName),\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelChatOptions\n\t\t}) ?? {});\n\t\tconst strictJsonSchema = compatibleOptions?.strictJsonSchema ?? true;\n\t\tif (topK != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"topK\"\n\t\t});\n\t\tif (responseFormat?.type === \"json\" && responseFormat.schema != null && !this.supportsStructuredOutputs) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"responseFormat\",\n\t\t\tdetails: \"JSON response format schema is only supported with structuredOutputs\"\n\t\t});\n\t\tconst { tools: openaiTools, toolChoice: openaiToolChoice, toolWarnings } = prepareTools({\n\t\t\ttools,\n\t\t\ttoolChoice\n\t\t});\n\t\tconst metadataKey = resolveProviderOptionsKey(this.providerOptionsName, providerOptions);\n\t\treturn {\n\t\t\tmetadataKey,\n\t\t\targs: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tuser: compatibleOptions.user,\n\t\t\t\tmax_tokens: maxOutputTokens,\n\t\t\t\ttemperature,\n\t\t\t\ttop_p: topP,\n\t\t\t\tfrequency_penalty: frequencyPenalty,\n\t\t\t\tpresence_penalty: presencePenalty,\n\t\t\t\tresponse_format: responseFormat?.type === \"json\" ? this.supportsStructuredOutputs === true && responseFormat.schema != null ? {\n\t\t\t\t\ttype: \"json_schema\",\n\t\t\t\t\tjson_schema: {\n\t\t\t\t\t\tschema: responseFormat.schema,\n\t\t\t\t\t\tstrict: strictJsonSchema,\n\t\t\t\t\t\tname: responseFormat.name ?? \"response\",\n\t\t\t\t\t\tdescription: responseFormat.description\n\t\t\t\t\t}\n\t\t\t\t} : { type: \"json_object\" } : void 0,\n\t\t\t\tstop: stopSequences,\n\t\t\t\tseed,\n\t\t\t\t...Object.fromEntries(Object.entries({\n\t\t\t\t\t...providerOptions?.[this.providerOptionsName],\n\t\t\t\t\t...providerOptions?.[toCamelCase(this.providerOptionsName)]\n\t\t\t\t}).filter(([key]) => !Object.keys(openaiCompatibleLanguageModelChatOptions.shape).includes(key))),\n\t\t\t\treasoning_effort: compatibleOptions.reasoningEffort ?? (isCustomReasoning(reasoning) ? this.config.mapReasoning != null ? this.config.mapReasoning({\n\t\t\t\t\treasoning,\n\t\t\t\t\twarnings\n\t\t\t\t}) : reasoning : void 0),\n\t\t\t\tverbosity: compatibleOptions.textVerbosity,\n\t\t\t\tmessages: convertToOpenAICompatibleChatMessages(prompt, {\n\t\t\t\t\tprovider: this.providerOptionsName,\n\t\t\t\t\tproviderOptionsKey: metadataKey,\n\t\t\t\t\tsupportsMultiPartToolContent: this.config.supportsMultiPartToolContent\n\t\t\t\t}),\n\t\t\t\ttools: openaiTools,\n\t\t\t\ttool_choice: openaiToolChoice\n\t\t\t},\n\t\t\twarnings: [...warnings, ...toolWarnings]\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args, warnings, metadataKey } = await this.getArgs({ ...options });\n\t\tconst transformedBody = this.transformRequestBody(args, warnings);\n\t\tconst body = JSON.stringify(transformedBody);\n\t\tconst { responseHeaders, value: responseBody, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody: transformedBody,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(OpenAICompatibleChatResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst choice = responseBody.choices[0];\n\t\tif (choice == null) throw new InvalidResponseDataError({\n\t\t\tdata: rawResponse,\n\t\t\tmessage: \"Response did not contain any choices.\"\n\t\t});\n\t\tconst content = [];\n\t\tconst reasoning = choice.message.reasoning_content ?? choice.message.reasoning;\n\t\tif (reasoning != null && reasoning.length > 0) content.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: reasoning\n\t\t});\n\t\tcontent.push(...convertOpenAICompatibleContent(choice.message.content));\n\t\tif (choice.message.tool_calls != null) for (const toolCall of choice.message.tool_calls) {\n\t\t\tconst thoughtSignature = toolCall.extra_content?.google?.thought_signature;\n\t\t\tcontent.push({\n\t\t\t\ttype: \"tool-call\",\n\t\t\t\ttoolCallId: toolCall.id || generateId(),\n\t\t\t\ttoolName: toolCall.function.name,\n\t\t\t\tinput: toolCall.function.arguments,\n\t\t\t\t...thoughtSignature ? { providerMetadata: { [metadataKey]: { thoughtSignature } } } : {}\n\t\t\t});\n\t\t}\n\t\tconst providerMetadata = {\n\t\t\t[metadataKey]: {},\n\t\t\t...await this.config.metadataExtractor?.extractMetadata?.({ parsedBody: rawResponse })\n\t\t};\n\t\tconst completionTokenDetails = responseBody.usage?.completion_tokens_details;\n\t\tif (completionTokenDetails?.accepted_prediction_tokens != null) providerMetadata[metadataKey].acceptedPredictionTokens = completionTokenDetails?.accepted_prediction_tokens;\n\t\tif (completionTokenDetails?.rejected_prediction_tokens != null) providerMetadata[metadataKey].rejectedPredictionTokens = completionTokenDetails?.rejected_prediction_tokens;\n\t\treturn {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: mapOpenAICompatibleFinishReason$1(choice.finish_reason),\n\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t},\n\t\t\tusage: this.convertUsage(responseBody.usage),\n\t\t\tproviderMetadata,\n\t\t\trequest: { body },\n\t\t\tresponse: {\n\t\t\t\t...getResponseMetadata$1(responseBody),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings, metadataKey } = await this.getArgs({ ...options });\n\t\tconst body = this.transformRequestBody({\n\t\t\t...args,\n\t\t\tstream: true,\n\t\t\tstream_options: this.config.includeUsage ? { include_usage: true } : void 0\n\t\t}, warnings);\n\t\tconst metadataExtractor = this.config.metadataExtractor?.createStreamExtractor();\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(this.chunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst providerOptionsName = metadataKey;\n\t\tlet toolCallTracker;\n\t\tconst pendingToolCalls = /* @__PURE__ */ new Map();\n\t\tconst forwardedToolCallIndices = /* @__PURE__ */ new Set();\n\t\tconst processToolCallDelta = (toolCallDelta) => {\n\t\t\tconst index = toolCallDelta.index;\n\t\t\tif (index == null || forwardedToolCallIndices.has(index)) {\n\t\t\t\ttoolCallTracker.processDelta(toolCallDelta);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet pending = pendingToolCalls.get(index);\n\t\t\tif (pending == null) {\n\t\t\t\tpending = {\n\t\t\t\t\tid: toolCallDelta.id ?? null,\n\t\t\t\t\tbufferedArguments: \"\",\n\t\t\t\t\textraContent: toolCallDelta.extra_content ?? null\n\t\t\t\t};\n\t\t\t\tpendingToolCalls.set(index, pending);\n\t\t\t} else {\n\t\t\t\tif (pending.id == null && toolCallDelta.id != null) pending.id = toolCallDelta.id;\n\t\t\t\tif (pending.extraContent == null && toolCallDelta.extra_content != null) pending.extraContent = toolCallDelta.extra_content;\n\t\t\t}\n\t\t\tconst argumentsDelta = toolCallDelta.function?.arguments;\n\t\t\tif (argumentsDelta != null) pending.bufferedArguments += argumentsDelta;\n\t\t\tconst name = toolCallDelta.function?.name;\n\t\t\tif (name != null) {\n\t\t\t\tconst forwardDelta = {\n\t\t\t\t\tindex,\n\t\t\t\t\tid: pending.id,\n\t\t\t\t\tfunction: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\targuments: pending.bufferedArguments\n\t\t\t\t\t},\n\t\t\t\t\textra_content: pending.extraContent ?? void 0\n\t\t\t\t};\n\t\t\t\ttoolCallTracker.processDelta(forwardDelta);\n\t\t\t\tpendingToolCalls.delete(index);\n\t\t\t\tforwardedToolCallIndices.add(index);\n\t\t\t}\n\t\t};\n\t\tlet finishReason;\n\t\tlet usage = void 0;\n\t\tlet metadataExtracted = false;\n\t\tlet isActiveReasoning = false;\n\t\tlet isActiveText = false;\n\t\tconst convertUsage = (usage) => this.convertUsage(usage);\n\t\treturn {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\ttoolCallTracker = new StreamingToolCallTracker(controller, {\n\t\t\t\t\t\tgenerateId,\n\t\t\t\t\t\textractMetadata: (delta) => {\n\t\t\t\t\t\t\tconst thoughtSignature = delta.extra_content?.google?.thought_signature;\n\t\t\t\t\t\t\treturn thoughtSignature ? { [providerOptionsName]: { thoughtSignature } } : void 0;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbuildToolCallProviderMetadata: (metadata) => metadata\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tmetadataExtractor?.processChunk(chunk.rawValue);\n\t\t\t\t\tif (\"error\" in chunk.value) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.value.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = chunk.value;\n\t\t\t\t\tif (!metadataExtracted) {\n\t\t\t\t\t\tconst metadata = getResponseMetadata$1(value);\n\t\t\t\t\t\tif (Object.values(metadata).some(Boolean)) {\n\t\t\t\t\t\t\tmetadataExtracted = true;\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t\t...metadata\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (value.usage != null) usage = value.usage;\n\t\t\t\t\tconst choice = value.choices[0];\n\t\t\t\t\tif (choice?.finish_reason != null) finishReason = {\n\t\t\t\t\t\tunified: mapOpenAICompatibleFinishReason$1(choice.finish_reason),\n\t\t\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t\t\t};\n\t\t\t\t\tif (choice?.delta == null) return;\n\t\t\t\t\tconst delta = choice.delta;\n\t\t\t\t\tconst enqueueReasoningDelta = (reasoningDelta) => {\n\t\t\t\t\t\tif (isActiveText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveText = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: \"reasoning-0\",\n\t\t\t\t\t\t\tdelta: reasoningDelta\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tconst enqueueTextDelta = (textDelta) => {\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isActiveText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveText = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\tid: \"txt-0\",\n\t\t\t\t\t\t\tdelta: textDelta\n\t\t\t\t\t\t});\n\t\t\t\t\t};\n\t\t\t\t\tconst reasoningContent = delta.reasoning_content ?? delta.reasoning;\n\t\t\t\t\tif (reasoningContent) enqueueReasoningDelta(reasoningContent);\n\t\t\t\t\tfor (const contentPart of convertOpenAICompatibleContent(delta.content)) if (contentPart.type === \"reasoning\") enqueueReasoningDelta(contentPart.text);\n\t\t\t\t\telse enqueueTextDelta(contentPart.text);\n\t\t\t\t\tif (delta.tool_calls != null && delta.tool_calls.length > 0) {\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const toolCallDelta of delta.tool_calls) processToolCallDelta(toolCallDelta);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tif (isActiveReasoning) controller.enqueue({\n\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t});\n\t\t\t\t\tif (isActiveText) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t});\n\t\t\t\t\tfor (const [index, pending] of pendingToolCalls) toolCallTracker.processDelta({\n\t\t\t\t\t\tindex,\n\t\t\t\t\t\tid: pending.id,\n\t\t\t\t\t\tfunction: { arguments: pending.bufferedArguments }\n\t\t\t\t\t});\n\t\t\t\t\tpendingToolCalls.clear();\n\t\t\t\t\ttoolCallTracker.flush();\n\t\t\t\t\tif (finishReason == null) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: new InvalidResponseDataError({\n\t\t\t\t\t\t\t\tdata: void 0,\n\t\t\t\t\t\t\t\tmessage: \"Response stream ended without a finish reason.\"\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tconst providerMetadata = {\n\t\t\t\t\t\t[providerOptionsName]: {},\n\t\t\t\t\t\t...metadataExtractor?.buildMetadata()\n\t\t\t\t\t};\n\t\t\t\t\tif (usage?.completion_tokens_details?.accepted_prediction_tokens != null) providerMetadata[providerOptionsName].acceptedPredictionTokens = usage?.completion_tokens_details?.accepted_prediction_tokens;\n\t\t\t\t\tif (usage?.completion_tokens_details?.rejected_prediction_tokens != null) providerMetadata[providerOptionsName].rejectedPredictionTokens = usage?.completion_tokens_details?.rejected_prediction_tokens;\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: convertUsage(usage),\n\t\t\t\t\t\tproviderMetadata\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t}\n};\nconst openaiCompatibleTokenUsageSchema = () => z.looseObject({\n\tprompt_tokens: z.number().nullish(),\n\tcompletion_tokens: z.number().nullish(),\n\ttotal_tokens: z.number().nullish(),\n\tprompt_tokens_details: z.looseObject({ cached_tokens: z.number().nullish() }).nullish(),\n\tcompletion_tokens_details: z.looseObject({\n\t\treasoning_tokens: z.number().nullish(),\n\t\taccepted_prediction_tokens: z.number().nullish(),\n\t\trejected_prediction_tokens: z.number().nullish()\n\t}).nullish()\n}).nullish();\nconst openAICompatibleContentSchema = () => z.union([z.string(), z.array(z.looseObject({ type: z.string() }))]).nullish();\nfunction convertOpenAICompatibleContent(content) {\n\tif (content == null) return [];\n\tif (typeof content === \"string\") return content.length > 0 ? [{\n\t\ttype: \"text\",\n\t\ttext: content\n\t}] : [];\n\tconst result = [];\n\tfor (const part of content) if (part.type === \"text\" && typeof part.text === \"string\") {\n\t\tif (part.text.length > 0) result.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: part.text\n\t\t});\n\t} else if (part.type === \"thinking\" && Array.isArray(part.thinking)) {\n\t\tconst reasoningText = part.thinking.filter((chunk) => chunk != null && typeof chunk === \"object\" && \"type\" in chunk && chunk.type === \"text\" && \"text\" in chunk && typeof chunk.text === \"string\").map((chunk) => chunk.text).join(\"\");\n\t\tif (reasoningText.length > 0) result.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: reasoningText\n\t\t});\n\t}\n\treturn result;\n}\nconst OpenAICompatibleChatResponseSchema = lazySchema(() => zodSchema(z.looseObject({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tmessage: z.object({\n\t\t\trole: z.literal(\"assistant\").nullish(),\n\t\t\tcontent: openAICompatibleContentSchema(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\treasoning: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\targuments: z.string()\n\t\t\t\t}),\n\t\t\t\textra_content: z.object({ google: z.object({ thought_signature: z.string().nullish() }).nullish() }).nullish()\n\t\t\t})).nullish()\n\t\t}),\n\t\tfinish_reason: z.string().nullish()\n\t})),\n\tusage: openaiCompatibleTokenUsageSchema()\n})));\nconst chunkBaseSchema = () => z.looseObject({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tdelta: z.object({\n\t\t\trole: z.enum([\"assistant\", \"\"]).nullish(),\n\t\t\tcontent: openAICompatibleContentSchema(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\treasoning: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tindex: z.number().nullish(),\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string().nullish(),\n\t\t\t\t\targuments: z.string().nullish()\n\t\t\t\t}),\n\t\t\t\textra_content: z.object({ google: z.object({ thought_signature: z.string().nullish() }).nullish() }).nullish()\n\t\t\t})).nullish()\n\t\t}).nullish(),\n\t\tfinish_reason: z.string().nullish()\n\t})),\n\tusage: openaiCompatibleTokenUsageSchema()\n});\nconst createOpenAICompatibleChatChunkSchema = (errorSchema) => z.union([chunkBaseSchema(), errorSchema]);\n//#endregion\n//#region src/completion/convert-openai-compatible-completion-usage.ts\nfunction convertOpenAICompatibleCompletionUsage(usage) {\n\tif (usage == null) return createNullLanguageModelUsage();\n\tconst promptTokens = usage.prompt_tokens ?? 0;\n\tconst completionTokens = usage.completion_tokens ?? 0;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokens,\n\t\t\tnoCache: promptTokens,\n\t\t\tcacheRead: void 0,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: completionTokens,\n\t\t\ttext: completionTokens,\n\t\t\treasoning: void 0\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/completion/convert-to-openai-compatible-completion-prompt.ts\nfunction convertToOpenAICompatibleCompletionPrompt({ prompt, user = \"user\", assistant = \"assistant\" }) {\n\tlet text = \"\";\n\tif (prompt[0].role === \"system\") {\n\t\ttext += `${prompt[0].content}\\n\\n`;\n\t\tprompt = prompt.slice(1);\n\t}\n\tfor (const { role, content } of prompt) switch (role) {\n\t\tcase \"system\": throw new InvalidPromptError({\n\t\t\tmessage: `Unexpected system message in prompt: ${content}`,\n\t\t\tprompt\n\t\t});\n\t\tcase \"user\": {\n\t\t\tconst userMessage = content.map((part) => {\n\t\t\t\tswitch (part.type) {\n\t\t\t\t\tcase \"text\": return part.text;\n\t\t\t\t}\n\t\t\t}).filter(Boolean).join(\"\");\n\t\t\ttext += `${user}:\\n${userMessage}\\n\\n`;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"assistant\": {\n\t\t\tconst assistantMessage = content.map((part) => {\n\t\t\t\tswitch (part.type) {\n\t\t\t\t\tcase \"text\": return part.text;\n\t\t\t\t\tcase \"tool-call\": throw new UnsupportedFunctionalityError({ functionality: \"tool-call messages\" });\n\t\t\t\t}\n\t\t\t}).join(\"\");\n\t\t\ttext += `${assistant}:\\n${assistantMessage}\\n\\n`;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"tool\": throw new UnsupportedFunctionalityError({ functionality: \"tool messages\" });\n\t\tdefault: throw new Error(`Unsupported role: ${role}`);\n\t}\n\ttext += `${assistant}:\\n`;\n\treturn {\n\t\tprompt: text,\n\t\tstopSequences: [`\\n${user}:`]\n\t};\n}\n//#endregion\n//#region src/completion/map-openai-compatible-finish-reason.ts\nfunction mapOpenAICompatibleFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tcase \"function_call\":\n\t\tcase \"tool_calls\": return \"tool-calls\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/completion/openai-compatible-completion-language-model-options.ts\nconst openaiCompatibleLanguageModelCompletionOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Echo back the prompt in addition to the completion.\n\t*/\n\techo: z.boolean().optional(),\n\t/**\n\t* Modify the likelihood of specified tokens appearing in the completion.\n\t*\n\t* Accepts a JSON object that maps tokens (specified by their token ID in\n\t* the GPT tokenizer) to an associated bias value from -100 to 100.\n\t*/\n\tlogitBias: z.record(z.string(), z.number()).optional(),\n\t/**\n\t* The suffix that comes after a completion of inserted text.\n\t*/\n\tsuffix: z.string().optional(),\n\t/**\n\t* A unique identifier representing your end-user, which can help providers to\n\t* monitor and detect abuse.\n\t*/\n\tuser: z.string().optional()\n})));\n//#endregion\n//#region src/completion/openai-compatible-completion-language-model.ts\nvar OpenAICompatibleCompletionLanguageModel = class OpenAICompatibleCompletionLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new OpenAICompatibleCompletionLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tconst errorStructure = config.errorStructure ?? defaultOpenAICompatibleErrorStructure;\n\t\tthis.chunkSchema = createOpenAICompatibleCompletionChunkSchema(errorStructure.errorSchema);\n\t\tthis.failedResponseHandler = createJsonErrorResponseHandler(errorStructure);\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tget providerOptionsName() {\n\t\treturn this.config.provider.split(\".\")[0].trim();\n\t}\n\tget supportedUrls() {\n\t\treturn this.config.supportedUrls?.() ?? {};\n\t}\n\tasync getArgs({ prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences: userStopSequences, responseFormat, seed, providerOptions, tools, toolChoice }) {\n\t\tconst warnings = [];\n\t\twarnIfDeprecatedProviderOptionsKey({\n\t\t\trawName: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\twarnings\n\t\t});\n\t\tconst completionOptions = Object.assign(await parseProviderOptions({\n\t\t\tprovider: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelCompletionOptions\n\t\t}) ?? {}, await parseProviderOptions({\n\t\t\tprovider: toCamelCase(this.providerOptionsName),\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleLanguageModelCompletionOptions\n\t\t}) ?? {});\n\t\tif (topK != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"topK\"\n\t\t});\n\t\tif (tools?.length) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"tools\"\n\t\t});\n\t\tif (toolChoice != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"toolChoice\"\n\t\t});\n\t\tif (responseFormat != null && responseFormat.type !== \"text\") warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"responseFormat\",\n\t\t\tdetails: \"JSON response format is not supported.\"\n\t\t});\n\t\tconst { prompt: completionPrompt, stopSequences } = convertToOpenAICompatibleCompletionPrompt({ prompt });\n\t\tconst stop = [...stopSequences ?? [], ...userStopSequences ?? []];\n\t\treturn {\n\t\t\targs: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\techo: completionOptions.echo,\n\t\t\t\tlogit_bias: completionOptions.logitBias,\n\t\t\t\tsuffix: completionOptions.suffix,\n\t\t\t\tuser: completionOptions.user,\n\t\t\t\tmax_tokens: maxOutputTokens,\n\t\t\t\ttemperature,\n\t\t\t\ttop_p: topP,\n\t\t\t\tfrequency_penalty: frequencyPenalty,\n\t\t\t\tpresence_penalty: presencePenalty,\n\t\t\t\tseed,\n\t\t\t\t...providerOptions?.[this.providerOptionsName],\n\t\t\t\t...providerOptions?.[toCamelCase(this.providerOptionsName)],\n\t\t\t\tprompt: completionPrompt,\n\t\t\t\tstop: stop.length > 0 ? stop : void 0\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args, warnings } = await this.getArgs(options);\n\t\tconst { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody: args,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(openaiCompatibleCompletionResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst choice = response.choices[0];\n\t\tconst content = [];\n\t\tif (choice.text != null && choice.text.length > 0) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: choice.text\n\t\t});\n\t\treturn {\n\t\t\tcontent,\n\t\t\tusage: convertOpenAICompatibleCompletionUsage(response.usage),\n\t\t\tfinishReason: {\n\t\t\t\tunified: mapOpenAICompatibleFinishReason(choice.finish_reason),\n\t\t\t\traw: choice.finish_reason\n\t\t\t},\n\t\t\trequest: { body: args },\n\t\t\tresponse: {\n\t\t\t\t...getResponseMetadata(response),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings } = await this.getArgs(options);\n\t\tconst body = {\n\t\t\t...args,\n\t\t\tstream: true,\n\t\t\tstream_options: this.config.includeUsage ? { include_usage: true } : void 0\n\t\t};\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(this.chunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet finishReason = {\n\t\t\tunified: \"other\",\n\t\t\traw: void 0\n\t\t};\n\t\tlet usage = void 0;\n\t\tlet isFirstChunk = true;\n\t\treturn {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = chunk.value;\n\t\t\t\t\tif (\"error\" in value) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: value.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (isFirstChunk) {\n\t\t\t\t\t\tisFirstChunk = false;\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t...getResponseMetadata(value)\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (value.usage != null) usage = value.usage;\n\t\t\t\t\tconst choice = value.choices[0];\n\t\t\t\t\tif (choice?.finish_reason != null) finishReason = {\n\t\t\t\t\t\tunified: mapOpenAICompatibleFinishReason(choice.finish_reason),\n\t\t\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t\t\t};\n\t\t\t\t\tif (choice?.text != null) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\tid: \"0\",\n\t\t\t\t\t\tdelta: choice.text\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tif (!isFirstChunk) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: \"0\"\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: convertOpenAICompatibleCompletionUsage(usage)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t}\n};\nconst usageSchema = () => z.looseObject({\n\tprompt_tokens: z.number(),\n\tcompletion_tokens: z.number(),\n\ttotal_tokens: z.number()\n});\nconst openaiCompatibleCompletionResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\ttext: z.string(),\n\t\tfinish_reason: z.string()\n\t})),\n\tusage: usageSchema().nullish()\n})));\nconst createOpenAICompatibleCompletionChunkSchema = (errorSchema) => z.union([z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\ttext: z.string(),\n\t\tfinish_reason: z.string().nullish(),\n\t\tindex: z.number()\n\t})),\n\tusage: usageSchema().nullish()\n}), errorSchema]);\n//#endregion\n//#region src/embedding/openai-compatible-embedding-model-options.ts\nconst openaiCompatibleEmbeddingModelOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* The number of dimensions the resulting output embeddings should have.\n\t* Only supported in text-embedding-3 and later models.\n\t*/\n\tdimensions: z.number().optional(),\n\t/**\n\t* A unique identifier representing your end-user, which can help providers to\n\t* monitor and detect abuse.\n\t*/\n\tuser: z.string().optional()\n})));\n//#endregion\n//#region src/embedding/openai-compatible-embedding-model.ts\nvar OpenAICompatibleEmbeddingModel = class OpenAICompatibleEmbeddingModel {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tget maxEmbeddingsPerCall() {\n\t\treturn this.config.maxEmbeddingsPerCall ?? 2048;\n\t}\n\tget supportsParallelCalls() {\n\t\treturn this.config.supportsParallelCalls ?? true;\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new OpenAICompatibleEmbeddingModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget providerOptionsName() {\n\t\treturn this.config.provider.split(\".\")[0].trim();\n\t}\n\tasync doEmbed({ values, dimensions, headers, abortSignal, providerOptions }) {\n\t\tconst warnings = [];\n\t\tconst deprecatedOptions = await parseProviderOptions({\n\t\t\tprovider: \"openai-compatible\",\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleEmbeddingModelOptions\n\t\t});\n\t\tif (deprecatedOptions != null) warnings.push({\n\t\t\ttype: \"deprecated\",\n\t\t\tsetting: \"providerOptions key 'openai-compatible'\",\n\t\t\tmessage: \"Use 'openaiCompatible' instead.\"\n\t\t});\n\t\twarnIfDeprecatedProviderOptionsKey({\n\t\t\trawName: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\twarnings\n\t\t});\n\t\tconst compatibleOptions = Object.assign(deprecatedOptions ?? {}, await parseProviderOptions({\n\t\t\tprovider: \"openaiCompatible\",\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleEmbeddingModelOptions\n\t\t}) ?? {}, await parseProviderOptions({\n\t\t\tprovider: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\tschema: openaiCompatibleEmbeddingModelOptions\n\t\t}) ?? {});\n\t\tif (values.length > this.maxEmbeddingsPerCall) throw new TooManyEmbeddingValuesForCallError({\n\t\t\tprovider: this.provider,\n\t\t\tmodelId: this.modelId,\n\t\t\tmaxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n\t\t\tvalues\n\t\t});\n\t\tconst { responseHeaders, value: response, rawValue } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/embeddings\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tinput: values,\n\t\t\t\tencoding_format: \"float\",\n\t\t\t\tdimensions: compatibleOptions.dimensions ?? dimensions,\n\t\t\t\tuser: compatibleOptions.user\n\t\t\t},\n\t\t\tfailedResponseHandler: createJsonErrorResponseHandler(this.config.errorStructure ?? defaultOpenAICompatibleErrorStructure),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(openaiTextEmbeddingResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\twarnings,\n\t\t\tembeddings: response.data.map((item) => item.embedding),\n\t\t\tusage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,\n\t\t\tproviderMetadata: response.providerMetadata,\n\t\t\tresponse: {\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawValue\n\t\t\t}\n\t\t};\n\t}\n};\nconst openaiTextEmbeddingResponseSchema = lazySchema(() => zodSchema(z.object({\n\tdata: z.array(z.object({ embedding: z.array(z.number()) })),\n\tusage: z.object({ prompt_tokens: z.number() }).nullish(),\n\tproviderMetadata: z.record(z.string(), z.record(z.string(), z.any())).optional()\n})));\n//#endregion\n//#region src/image/openai-compatible-image-model.ts\nvar OpenAICompatibleImageModel = class OpenAICompatibleImageModel {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\t/**\n\t* The provider options key used to extract provider-specific options.\n\t*/\n\tget providerOptionsKey() {\n\t\treturn this.config.provider.split(\".\")[0].trim();\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new OpenAICompatibleImageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxImagesPerCall = 10;\n\t\tthis.supportsFileInputs = void 0;\n\t\tthis.supportsMaskInputs = void 0;\n\t}\n\tgetArgs(providerOptions, warnings) {\n\t\twarnIfDeprecatedProviderOptionsKey({\n\t\t\trawName: this.providerOptionsKey,\n\t\t\tproviderOptions,\n\t\t\twarnings\n\t\t});\n\t\treturn {\n\t\t\t...providerOptions[this.providerOptionsKey],\n\t\t\t...providerOptions[toCamelCase(this.providerOptionsKey)]\n\t\t};\n\t}\n\tasync doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, files, mask }) {\n\t\tconst warnings = [];\n\t\tif (aspectRatio != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"aspectRatio\",\n\t\t\tdetails: \"This model does not support aspect ratio. Use `size` instead.\"\n\t\t});\n\t\tif (seed != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"seed\"\n\t\t});\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst args = this.getArgs(providerOptions, warnings);\n\t\tconst isEditing = files != null && files.length > 0;\n\t\tconst url = this.config.url({\n\t\t\tpath: isEditing ? \"/images/edits\" : \"/images/generations\",\n\t\t\tmodelId: this.modelId\n\t\t});\n\t\tconst requestHeaders = combineHeaders(await resolve(this.config.headers), headers);\n\t\tif (isEditing) {\n\t\t\tconst { value: response, responseHeaders } = await postFormDataToApi({\n\t\t\t\turl,\n\t\t\t\theaders: requestHeaders,\n\t\t\t\tformData: convertToFormData({\n\t\t\t\t\tmodel: this.modelId,\n\t\t\t\t\tprompt,\n\t\t\t\t\timage: await Promise.all(files.map((file) => fileToBlob(file))),\n\t\t\t\t\tmask: mask != null ? await fileToBlob(mask) : void 0,\n\t\t\t\t\tn,\n\t\t\t\t\tsize,\n\t\t\t\t\t...args\n\t\t\t\t}),\n\t\t\t\tfailedResponseHandler: createJsonErrorResponseHandler(this.config.errorStructure ?? defaultOpenAICompatibleErrorStructure),\n\t\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(openaiCompatibleImageResponseSchema),\n\t\t\t\tabortSignal,\n\t\t\t\tfetch: this.config.fetch\n\t\t\t});\n\t\t\treturn {\n\t\t\t\timages: await this.getImages(response.data, {\n\t\t\t\t\turl,\n\t\t\t\t\theaders,\n\t\t\t\t\tabortSignal\n\t\t\t\t}),\n\t\t\t\twarnings,\n\t\t\t\tusage: mapImageUsage(response.usage),\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst { value: response, responseHeaders } = await postJsonToApi({\n\t\t\turl,\n\t\t\theaders: requestHeaders,\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tprompt,\n\t\t\t\tn,\n\t\t\t\tsize,\n\t\t\t\t...args\n\t\t\t},\n\t\t\tfailedResponseHandler: createJsonErrorResponseHandler(this.config.errorStructure ?? defaultOpenAICompatibleErrorStructure),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(openaiCompatibleImageResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\timages: await this.getImages(response.data, {\n\t\t\t\turl,\n\t\t\t\theaders,\n\t\t\t\tabortSignal\n\t\t\t}),\n\t\t\twarnings,\n\t\t\tusage: mapImageUsage(response.usage),\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n\tasync getImages(data, options) {\n\t\tif (data.every((image) => image.b64_json != null)) return data.map((image) => image.b64_json);\n\t\treturn Promise.all(data.map(async (image) => {\n\t\t\tif (image.b64_json != null) return convertBase64ToUint8Array(image.b64_json);\n\t\t\tif (image.url == null) throw new InvalidResponseDataError({\n\t\t\t\tdata: image,\n\t\t\t\tmessage: \"Expected url in the image response\"\n\t\t\t});\n\t\t\tconst { value } = await getFromApi({\n\t\t\t\turl: image.url,\n\t\t\t\tvalidateUrl: true,\n\t\t\t\ttrustedOrigin: options.url,\n\t\t\t\tcredentialedOrigin: options.url,\n\t\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\t\tabortSignal: options.abortSignal,\n\t\t\t\tfetch: this.config.fetch,\n\t\t\t\tsuccessfulResponseHandler: createBinaryResponseHandler(),\n\t\t\t\tfailedResponseHandler: createStatusCodeErrorResponseHandler()\n\t\t\t});\n\t\t\treturn value;\n\t\t}));\n\t}\n};\nfunction mapImageUsage(usage) {\n\treturn usage == null ? void 0 : {\n\t\tinputTokens: usage.input_tokens ?? void 0,\n\t\toutputTokens: usage.output_tokens ?? void 0,\n\t\ttotalTokens: usage.total_tokens ?? void 0\n\t};\n}\nconst openaiCompatibleImageResponseSchema = lazySchema(() => zodSchema(z.object({\n\tdata: z.array(z.object({\n\t\tb64_json: z.string().nullish(),\n\t\turl: z.string().nullish()\n\t}).refine((image) => image.b64_json != null || image.url != null, { message: \"Expected b64_json or url in the image response\" })),\n\tusage: z.object({\n\t\tinput_tokens: z.number().nullish(),\n\t\toutput_tokens: z.number().nullish(),\n\t\ttotal_tokens: z.number().nullish()\n\t}).nullish()\n})));\nasync function fileToBlob(file) {\n\tif (file.type === \"url\") return downloadBlob(file.url);\n\tconst data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array(file.data);\n\treturn new Blob([data], { type: file.mediaType });\n}\n//#endregion\n//#region src/version.ts\nconst VERSION = \"3.0.82\";\n//#endregion\n//#region src/openai-compatible-provider.ts\n/**\n* Create an OpenAICompatible provider instance.\n*/\nfunction createOpenAICompatible(options) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL);\n\tconst providerName = options.name;\n\tconst configuredApiKey = options.apiKey;\n\tconst headers = { ...options.headers };\n\tconst getHeaders = () => resolveWith(configuredApiKey, (apiKey) => withUserAgentSuffix({\n\t\t...apiKey && { Authorization: `Bearer ${apiKey}` },\n\t\t...headers\n\t}, `ai-sdk-openai-compatible/${VERSION}`));\n\tconst getCommonModelConfig = (modelType) => ({\n\t\tprovider: `${providerName}.${modelType}`,\n\t\turl: ({ path }) => {\n\t\t\tconst url = new URL(`${baseURL}${path}`);\n\t\t\tif (options.queryParams) url.search = new URLSearchParams(options.queryParams).toString();\n\t\t\treturn url.toString();\n\t\t},\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createLanguageModel = (modelId) => createChatModel(modelId);\n\tconst createChatModel = (modelId) => new OpenAICompatibleChatLanguageModel(modelId, {\n\t\t...getCommonModelConfig(\"chat\"),\n\t\tincludeUsage: options.includeUsage,\n\t\tsupportsStructuredOutputs: options.supportsStructuredOutputs,\n\t\tsupportsMultiPartToolContent: options.supportsMultiPartToolContent,\n\t\tsupportedUrls: options.supportedUrls,\n\t\ttransformRequestBody: options.transformRequestBody,\n\t\tmetadataExtractor: options.metadataExtractor,\n\t\tconvertUsage: options.convertUsage\n\t});\n\tconst createCompletionModel = (modelId) => new OpenAICompatibleCompletionLanguageModel(modelId, {\n\t\t...getCommonModelConfig(\"completion\"),\n\t\tincludeUsage: options.includeUsage\n\t});\n\tconst createEmbeddingModel = (modelId) => new OpenAICompatibleEmbeddingModel(modelId, { ...getCommonModelConfig(\"embedding\") });\n\tconst createImageModel = (modelId) => new OpenAICompatibleImageModel(modelId, getCommonModelConfig(\"image\"));\n\tconst provider = (modelId) => createLanguageModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createLanguageModel;\n\tprovider.chatModel = createChatModel;\n\tprovider.completionModel = createCompletionModel;\n\tprovider.embeddingModel = createEmbeddingModel;\n\tprovider.textEmbeddingModel = createEmbeddingModel;\n\tprovider.imageModel = createImageModel;\n\treturn provider;\n}\n//#endregion\nexport { OpenAICompatibleChatLanguageModel, OpenAICompatibleCompletionLanguageModel, OpenAICompatibleEmbeddingModel, OpenAICompatibleImageModel, VERSION, createOpenAICompatible };\n\n//# sourceMappingURL=index.js.map","import { NoSuchModelError } from \"@ai-sdk/provider\";\nimport { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, loadApiKey, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash } from \"@ai-sdk/provider-utils\";\nimport { OpenAICompatibleChatLanguageModel } from \"@ai-sdk/openai-compatible\";\nimport { z } from \"zod/v4\";\n//#region src/cerebras-chat-language-model.ts\nfunction isStructuredOutputWithToolCallsFinishReason({ rawFinishReason, hasText, responseFormatType }) {\n\treturn responseFormatType === \"json\" && rawFinishReason === \"tool_calls\" && hasText;\n}\nvar CerebrasChatLanguageModel = class CerebrasChatLanguageModel extends OpenAICompatibleChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new CerebrasChatLanguageModel(options.modelId, options.config);\n\t}\n\tasync doGenerate(options) {\n\t\tconst result = await super.doGenerate(options);\n\t\tif (!isStructuredOutputWithToolCallsFinishReason({\n\t\t\trawFinishReason: result.finishReason.raw,\n\t\t\thasText: result.content.some((part) => part.type === \"text\" && part.text.length > 0),\n\t\t\tresponseFormatType: options.responseFormat?.type\n\t\t})) return result;\n\t\treturn {\n\t\t\t...result,\n\t\t\tcontent: result.content.filter((part) => part.type !== \"tool-call\"),\n\t\t\tfinishReason: {\n\t\t\t\t...result.finishReason,\n\t\t\t\tunified: \"stop\"\n\t\t\t}\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst result = await super.doStream(options);\n\t\tlet hasText = false;\n\t\treturn {\n\t\t\t...result,\n\t\t\tstream: result.stream.pipeThrough(new TransformStream({ transform(part, controller) {\n\t\t\t\tif (part.type === \"text-delta\" && part.delta.length > 0) hasText = true;\n\t\t\t\tif (part.type === \"finish\" && isStructuredOutputWithToolCallsFinishReason({\n\t\t\t\t\trawFinishReason: part.finishReason.raw,\n\t\t\t\t\thasText,\n\t\t\t\t\tresponseFormatType: options.responseFormat?.type\n\t\t\t\t})) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t...part,\n\t\t\t\t\t\tfinishReason: {\n\t\t\t\t\t\t\t...part.finishReason,\n\t\t\t\t\t\t\tunified: \"stop\"\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (options.responseFormat?.type === \"json\" && hasText && (part.type === \"tool-input-start\" || part.type === \"tool-input-delta\" || part.type === \"tool-input-end\" || part.type === \"tool-call\")) return;\n\t\t\t\tcontroller.enqueue(part);\n\t\t\t} }))\n\t\t};\n\t}\n};\n//#endregion\n//#region src/version.ts\nconst VERSION = \"3.0.82\";\n//#endregion\n//#region src/cerebras-provider.ts\nconst cerebrasErrorStructure = {\n\terrorSchema: z.object({\n\t\tmessage: z.string(),\n\t\ttype: z.string(),\n\t\tparam: z.string(),\n\t\tcode: z.string()\n\t}),\n\terrorToMessage: (data) => data.message\n};\n/**\n* Cerebras expects assistant reasoning history in the `reasoning` field, while\n* the shared OpenAI-compatible converter serializes it as `reasoning_content`.\n*/\nfunction transformCerebrasRequestBody(args) {\n\tconst { max_tokens: maxTokens, parallelToolCalls, topLogprobs, logitBias, serviceTier, reasoningFormat, promptCacheKey, ...restArgs } = args;\n\treturn {\n\t\t...restArgs,\n\t\t...maxTokens !== void 0 && { max_completion_tokens: maxTokens },\n\t\t...parallelToolCalls !== void 0 && { parallel_tool_calls: parallelToolCalls },\n\t\t...topLogprobs !== void 0 && { top_logprobs: topLogprobs },\n\t\t...logitBias !== void 0 && { logit_bias: logitBias },\n\t\t...serviceTier !== void 0 && { service_tier: serviceTier },\n\t\t...reasoningFormat !== void 0 && { reasoning_format: reasoningFormat },\n\t\t...promptCacheKey !== void 0 && { prompt_cache_key: promptCacheKey },\n\t\tmessages: Array.isArray(args.messages) ? args.messages.map((message) => {\n\t\t\tif (message == null || typeof message !== \"object\" || message.role !== \"assistant\" || !(\"reasoning_content\" in message)) return message;\n\t\t\tconst { reasoning_content, ...rest } = message;\n\t\t\treturn {\n\t\t\t\t...rest,\n\t\t\t\t...!(\"reasoning\" in rest) && reasoning_content !== void 0 ? { reasoning: reasoning_content } : {}\n\t\t\t};\n\t\t}) : args.messages\n\t};\n}\nfunction createCerebras(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL ?? \"https://api.cerebras.ai/v1\");\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"CEREBRAS_API_KEY\",\n\t\t\tdescription: \"Cerebras API key\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-cerebras/${VERSION}`));\n\tconst createLanguageModel = (modelId) => {\n\t\treturn new CerebrasChatLanguageModel(modelId, {\n\t\t\tprovider: `cerebras.chat`,\n\t\t\turl: ({ path }) => `${baseURL}${path}`,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch,\n\t\t\terrorStructure: cerebrasErrorStructure,\n\t\t\tsupportsStructuredOutputs: true,\n\t\t\ttransformRequestBody: transformCerebrasRequestBody\n\t\t});\n\t};\n\tconst provider = (modelId) => createLanguageModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createLanguageModel;\n\tprovider.chat = createLanguageModel;\n\tprovider.embeddingModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"embeddingModel\"\n\t\t});\n\t};\n\tprovider.textEmbeddingModel = provider.embeddingModel;\n\tprovider.imageModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"imageModel\"\n\t\t});\n\t};\n\treturn provider;\n}\nconst cerebras = createCerebras();\n//#endregion\nexport { VERSION, cerebras, createCerebras };\n\n//# sourceMappingURL=index.js.map","import { OpenAICompatibleChatLanguageModel, OpenAICompatibleCompletionLanguageModel, OpenAICompatibleEmbeddingModel } from \"@ai-sdk/openai-compatible\";\nimport { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertBase64ToUint8Array, convertToFormData, createJsonErrorResponseHandler, createJsonResponseHandler, downloadBlob, lazySchema, loadApiKey, parseProviderOptions, postFormDataToApi, postJsonToApi, resolve, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/deepinfra-image-model-options.ts\nconst deepInfraImageModelOptionsSchema = lazySchema(() => zodSchema(z.looseObject({\n\tnegative_prompt: z.string().nullish(),\n\tnum_inference_steps: z.number().nullish(),\n\tguidance_scale: z.number().nullish(),\n\tguidance: z.number().nullish(),\n\tresponse_format: z.enum([\"b64_json\"]).nullish(),\n\tquality: z.string().nullish(),\n\tstyle: z.string().nullish(),\n\tuser: z.string().nullish()\n})));\n//#endregion\n//#region src/deepinfra-image-model.ts\nvar DeepInfraImageModel = class DeepInfraImageModel {\n\tget supportsFileInputs() {\n\t\treturn [\n\t\t\t\"stabilityai/sd3.5\",\n\t\t\t\"black-forest-labs/FLUX-1.1-pro\",\n\t\t\t\"black-forest-labs/FLUX-1-schnell\",\n\t\t\t\"black-forest-labs/FLUX-1-dev\",\n\t\t\t\"black-forest-labs/FLUX-pro\",\n\t\t\t\"black-forest-labs/FLUX.1-Kontext-dev\",\n\t\t\t\"black-forest-labs/FLUX.1-Kontext-pro\",\n\t\t\t\"Qwen/Qwen-Image-Edit\",\n\t\t\t\"stabilityai/sd3.5-medium\",\n\t\t\t\"stabilityai/sdxl-turbo\"\n\t\t].includes(this.modelId) ? true : void 0;\n\t}\n\tget supportsMaskInputs() {\n\t\treturn this.supportsFileInputs;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new DeepInfraImageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxImagesPerCall = 1;\n\t}\n\tasync doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, files, mask }) {\n\t\tconst warnings = [];\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst deepInfraOptions = await parseProviderOptions({\n\t\t\tprovider: \"deepinfra\",\n\t\t\tproviderOptions,\n\t\t\tschema: deepInfraImageModelOptionsSchema\n\t\t});\n\t\tif (files != null && files.length > 0) {\n\t\t\tconst { value: response, responseHeaders } = await postFormDataToApi({\n\t\t\t\turl: this.getEditUrl(),\n\t\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\t\tformData: convertToFormData({\n\t\t\t\t\tmodel: this.modelId,\n\t\t\t\t\tprompt,\n\t\t\t\t\timage: await Promise.all(files.map((file) => fileToBlob(file))),\n\t\t\t\t\tmask: mask != null ? await fileToBlob(mask) : void 0,\n\t\t\t\t\tn,\n\t\t\t\t\tsize,\n\t\t\t\t\t...deepInfraOptions\n\t\t\t\t}, { useArrayBrackets: false }),\n\t\t\t\tfailedResponseHandler: createJsonErrorResponseHandler({\n\t\t\t\t\terrorSchema: deepInfraEditErrorSchema,\n\t\t\t\t\terrorToMessage: (error) => error.error?.message ?? \"Unknown error\"\n\t\t\t\t}),\n\t\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(deepInfraEditResponseSchema),\n\t\t\t\tabortSignal,\n\t\t\t\tfetch: this.config.fetch\n\t\t\t});\n\t\t\treturn {\n\t\t\t\timages: response.data.map((item) => item.b64_json),\n\t\t\t\twarnings,\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tconst splitSize = size?.split(\"x\");\n\t\tconst { value: response, responseHeaders } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/${this.modelId}`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody: {\n\t\t\t\tprompt,\n\t\t\t\tnum_images: n,\n\t\t\t\t...aspectRatio && { aspect_ratio: aspectRatio },\n\t\t\t\t...splitSize && {\n\t\t\t\t\twidth: splitSize[0],\n\t\t\t\t\theight: splitSize[1]\n\t\t\t\t},\n\t\t\t\t...seed != null && { seed },\n\t\t\t\t...deepInfraOptions\n\t\t\t},\n\t\t\tfailedResponseHandler: createJsonErrorResponseHandler({\n\t\t\t\terrorSchema: deepInfraErrorSchema,\n\t\t\t\terrorToMessage: (error) => error.detail.error\n\t\t\t}),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(deepInfraImageResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\timages: response.images.map((image) => image.replace(/^data:image\\/\\w+;base64,/, \"\")),\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n\tgetEditUrl() {\n\t\treturn `${this.config.baseURL.replace(\"/inference\", \"/openai\")}/images/edits`;\n\t}\n};\nconst deepInfraErrorSchema = z.object({ detail: z.object({ error: z.string() }) });\nconst deepInfraImageResponseSchema = z.object({ images: z.array(z.string()) });\nconst deepInfraEditErrorSchema = z.object({ error: z.object({ message: z.string() }).optional() });\nconst deepInfraEditResponseSchema = z.object({ data: z.array(z.object({ b64_json: z.string() })) });\nasync function fileToBlob(file) {\n\tif (file.type === \"url\") return downloadBlob(file.url);\n\tconst data = file.data instanceof Uint8Array ? file.data : convertBase64ToUint8Array(file.data);\n\treturn new Blob([data], { type: file.mediaType });\n}\n//#endregion\n//#region src/deepinfra-chat-language-model.ts\nvar DeepInfraChatLanguageModel = class DeepInfraChatLanguageModel extends OpenAICompatibleChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new DeepInfraChatLanguageModel(options.modelId, options.config);\n\t}\n\t/**\n\t* Fixes incorrect token usage for Gemini/Gemma models from DeepInfra.\n\t*\n\t* DeepInfra's API returns completion_tokens that don't include reasoning_tokens\n\t* for Gemini/Gemma models, which violates the OpenAI-compatible spec.\n\t* According to the spec, completion_tokens should include reasoning_tokens.\n\t*\n\t* Example of incorrect data from DeepInfra:\n\t* {\n\t*   \"completion_tokens\": 84,    // text-only tokens\n\t*   \"completion_tokens_details\": {\n\t*     \"reasoning_tokens\": 1081  // reasoning tokens not included above\n\t*   }\n\t* }\n\t*\n\t* This would result in negative text tokens: 84 - 1081 = -997\n\t*\n\t* The fix: If reasoning_tokens > completion_tokens, add reasoning_tokens\n\t* to completion_tokens: 84 + 1081 = 1165\n\t*/\n\tfixUsageForGeminiModels(usage) {\n\t\tif (!usage || !usage.completion_tokens_details?.reasoning_tokens) return usage;\n\t\tconst completionTokens = usage.completion_tokens ?? 0;\n\t\tconst reasoningTokens = usage.completion_tokens_details.reasoning_tokens;\n\t\tif (reasoningTokens > completionTokens) {\n\t\t\tconst correctedCompletionTokens = completionTokens + reasoningTokens;\n\t\t\treturn {\n\t\t\t\t...usage,\n\t\t\t\tcompletion_tokens: correctedCompletionTokens,\n\t\t\t\ttotal_tokens: usage.total_tokens != null ? usage.total_tokens + reasoningTokens : void 0\n\t\t\t};\n\t\t}\n\t\treturn usage;\n\t}\n\tasync doGenerate(options) {\n\t\tconst result = await super.doGenerate(options);\n\t\tif (result.usage?.raw) {\n\t\t\tconst fixedRawUsage = this.fixUsageForGeminiModels(result.usage.raw);\n\t\t\tif (fixedRawUsage !== result.usage.raw) {\n\t\t\t\tconst promptTokens = fixedRawUsage.prompt_tokens ?? 0;\n\t\t\t\tconst completionTokens = fixedRawUsage.completion_tokens ?? 0;\n\t\t\t\tconst cacheReadTokens = fixedRawUsage.prompt_tokens_details?.cached_tokens ?? 0;\n\t\t\t\tconst reasoningTokens = fixedRawUsage.completion_tokens_details?.reasoning_tokens ?? 0;\n\t\t\t\treturn {\n\t\t\t\t\t...result,\n\t\t\t\t\tusage: {\n\t\t\t\t\t\tinputTokens: {\n\t\t\t\t\t\t\ttotal: promptTokens,\n\t\t\t\t\t\t\tnoCache: promptTokens - cacheReadTokens,\n\t\t\t\t\t\t\tcacheRead: cacheReadTokens,\n\t\t\t\t\t\t\tcacheWrite: void 0\n\t\t\t\t\t\t},\n\t\t\t\t\t\toutputTokens: {\n\t\t\t\t\t\t\ttotal: completionTokens,\n\t\t\t\t\t\t\ttext: completionTokens - reasoningTokens,\n\t\t\t\t\t\t\treasoning: reasoningTokens\n\t\t\t\t\t\t},\n\t\t\t\t\t\traw: fixedRawUsage\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\tasync doStream(options) {\n\t\tconst result = await super.doStream(options);\n\t\tconst originalStream = result.stream;\n\t\tconst fixUsage = this.fixUsageForGeminiModels.bind(this);\n\t\tconst transformedStream = new ReadableStream({ async start(controller) {\n\t\t\tconst reader = originalStream.getReader();\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\tif (done) break;\n\t\t\t\t\tif (value.type === \"finish\" && value.usage?.raw) {\n\t\t\t\t\t\tconst fixedRawUsage = fixUsage(value.usage.raw);\n\t\t\t\t\t\tif (fixedRawUsage !== value.usage.raw) {\n\t\t\t\t\t\t\tconst promptTokens = fixedRawUsage.prompt_tokens ?? 0;\n\t\t\t\t\t\t\tconst completionTokens = fixedRawUsage.completion_tokens ?? 0;\n\t\t\t\t\t\t\tconst cacheReadTokens = fixedRawUsage.prompt_tokens_details?.cached_tokens ?? 0;\n\t\t\t\t\t\t\tconst reasoningTokens = fixedRawUsage.completion_tokens_details?.reasoning_tokens ?? 0;\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t...value,\n\t\t\t\t\t\t\t\tusage: {\n\t\t\t\t\t\t\t\t\tinputTokens: {\n\t\t\t\t\t\t\t\t\t\ttotal: promptTokens,\n\t\t\t\t\t\t\t\t\t\tnoCache: promptTokens - cacheReadTokens,\n\t\t\t\t\t\t\t\t\t\tcacheRead: cacheReadTokens,\n\t\t\t\t\t\t\t\t\t\tcacheWrite: void 0\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\toutputTokens: {\n\t\t\t\t\t\t\t\t\t\ttotal: completionTokens,\n\t\t\t\t\t\t\t\t\t\ttext: completionTokens - reasoningTokens,\n\t\t\t\t\t\t\t\t\t\treasoning: reasoningTokens\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\traw: fixedRawUsage\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else controller.enqueue(value);\n\t\t\t\t\t} else controller.enqueue(value);\n\t\t\t\t}\n\t\t\t\tcontroller.close();\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t} });\n\t\treturn {\n\t\t\t...result,\n\t\t\tstream: transformedStream\n\t\t};\n\t}\n};\n//#endregion\n//#region src/version.ts\nconst VERSION = \"3.0.82\";\n//#endregion\n//#region src/deepinfra-provider.ts\nfunction createDeepInfra(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL ?? \"https://api.deepinfra.com/v1\");\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"DEEPINFRA_API_KEY\",\n\t\t\tdescription: \"DeepInfra's API key\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-deepinfra/${VERSION}`));\n\tconst getCommonModelConfig = (modelType) => ({\n\t\tprovider: `deepinfra.${modelType}`,\n\t\turl: ({ path }) => `${baseURL}/openai${path}`,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createChatModel = (modelId) => {\n\t\treturn new DeepInfraChatLanguageModel(modelId, {\n\t\t\t...getCommonModelConfig(\"chat\"),\n\t\t\tsupportsStructuredOutputs: true\n\t\t});\n\t};\n\tconst createCompletionModel = (modelId) => new OpenAICompatibleCompletionLanguageModel(modelId, getCommonModelConfig(\"completion\"));\n\tconst createEmbeddingModel = (modelId) => new OpenAICompatibleEmbeddingModel(modelId, getCommonModelConfig(\"embedding\"));\n\tconst createImageModel = (modelId) => new DeepInfraImageModel(modelId, {\n\t\t...getCommonModelConfig(\"image\"),\n\t\tbaseURL: baseURL ? `${baseURL}/inference` : \"https://api.deepinfra.com/v1/inference\"\n\t});\n\tconst provider = (modelId) => createChatModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.completionModel = createCompletionModel;\n\tprovider.chatModel = createChatModel;\n\tprovider.image = createImageModel;\n\tprovider.imageModel = createImageModel;\n\tprovider.languageModel = createChatModel;\n\tprovider.embeddingModel = createEmbeddingModel;\n\tprovider.textEmbeddingModel = createEmbeddingModel;\n\treturn provider;\n}\nconst deepInfra = createDeepInfra();\n//#endregion\nexport { VERSION, createDeepInfra, deepInfra, deepInfra as deepinfra };\n\n//# sourceMappingURL=index.js.map","import { InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, NoSuchModelError, UnsupportedFunctionalityError } from \"@ai-sdk/provider\";\nimport { StreamingToolCallTracker, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertInlineFileDataToUint8Array, convertToBase64, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata as getResponseMetadata, createNullLanguageModelUsage, createProviderStreamError, detectMediaType, generateId, getTopLevelMediaType, isCustomReasoning, lazySchema, loadApiKey, mapReasoningToProviderEffort, parseProviderOptions, postFormDataToApi, postJsonToApi, resolve, resolveFullMediaType, resolveProviderReference, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/chat/deepseek-file-part-options.ts\nconst deepseekFilePartProviderOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Controls how DeepSeek processes an image sent as an `image_url` part.\n\t*\n\t* @see https://api-docs.deepseek.com/api/create-chat-completion/\n\t*/\n\timageDetail: z.enum([\n\t\t\"low\",\n\t\t\"high\",\n\t\t\"original\",\n\t\t\"auto\"\n\t]).optional(),\n\t/**\n\t* Sends inline image data as a DeepSeek `file` part using `file_data`\n\t* instead of an `image_url` data URL. When set, the file part's filename\n\t* is preserved.\n\t*\n\t* This option only applies to inline image data. It cannot be combined\n\t* with `imageDetail`.\n\t*/\n\tfileData: z.literal(true).optional()\n})));\n//#endregion\n//#region src/chat/deepseek-chat-language-model-options.ts\nfunction createDeepseekChatOptionsSchema() {\n\treturn z.object({\n\t\t/**\n\t\t* Whether to return log probabilities for generated tokens.\n\t\t*/\n\t\tlogprobs: z.boolean().optional(),\n\t\t/**\n\t\t* Number of most likely tokens to return at each token position.\n\t\t*\n\t\t* Setting this option automatically enables `logprobs`.\n\t\t*/\n\t\ttopLogprobs: z.number().int().min(0).max(20).optional(),\n\t\t/**\n\t\t* An opaque identifier for the end user. DeepSeek uses this identifier for\n\t\t* content-safety tracing and request isolation.\n\t\t*\n\t\t* Must contain only ASCII letters, numbers, underscores, and hyphens, and\n\t\t* must be at most 512 characters long.\n\t\t*/\n\t\tuserId: z.string().regex(/^[a-zA-Z0-9_-]+$/, \"userId must match /^[a-zA-Z0-9_-]+$/\").max(512, \"userId must be at most 512 characters long\").optional(),\n\t\t/**\n\t\t* Type of thinking to use. Defaults to `enabled`.\n\t\t*/\n\t\tthinking: z.object({ type: z.enum([\n\t\t\t\"adaptive\",\n\t\t\t\"enabled\",\n\t\t\t\"disabled\"\n\t\t]).optional() }).optional(),\n\t\t/**\n\t\t* Controls the thinking strength for DeepSeek V4 reasoning models.\n\t\t*/\n\t\treasoningEffort: z.enum([\n\t\t\t\"low\",\n\t\t\t\"medium\",\n\t\t\t\"high\",\n\t\t\t\"xhigh\",\n\t\t\t\"max\"\n\t\t]).optional(),\n\t\t/**\n\t\t* Whether to use strict JSON schema validation for structured outputs.\n\t\t* Only applies when the serving endpoint supports JSON schema response\n\t\t* formats (e.g. Azure). Defaults to `true`.\n\t\t*/\n\t\tstrictJsonSchema: z.boolean().optional()\n\t});\n}\nlet chatOptionsSchema;\nfunction getDeepseekChatOptionsSchema() {\n\treturn chatOptionsSchema ??= createDeepseekChatOptionsSchema();\n}\nconst deepseekLanguageModelChatOptions = lazySchema(() => zodSchema(getDeepseekChatOptionsSchema()));\nfunction createDeepseekMessageOptionsSchema() {\n\treturn z.object({ \n\t/**\n\t* The name of the participant represented by the message.\n\t*\n\t* Supported on system, user, and assistant messages.\n\t*/\nname: z.string().optional() });\n}\nlet messageOptionsSchema;\nfunction getDeepseekMessageOptionsSchema() {\n\treturn messageOptionsSchema ??= createDeepseekMessageOptionsSchema();\n}\nlazySchema(() => zodSchema(getDeepseekMessageOptionsSchema()));\nfunction createDeepseekAssistantMessageOptionsSchema() {\n\treturn getDeepseekMessageOptionsSchema().extend({ \n\t/**\n\t* Whether the assistant message content is a prefix that DeepSeek should\n\t* continue. This beta feature is only supported on the final assistant\n\t* message when using a beta base URL.\n\t*/\nprefix: z.literal(true).optional() });\n}\nlet assistantMessageOptionsSchema;\nfunction getDeepseekAssistantMessageOptionsSchema() {\n\treturn assistantMessageOptionsSchema ??= createDeepseekAssistantMessageOptionsSchema();\n}\nconst deepseekAssistantMessageProviderOptions = lazySchema(() => zodSchema(getDeepseekAssistantMessageOptionsSchema()));\n//#endregion\n//#region src/chat/is-deepseek-v4-model.ts\n/**\n* Whether a model id uses DeepSeek V4-or-newer behavior (thinking mode on by\n* default, `reasoning_content` required on every assistant turn).\n*\n* DeepSeek publishes V4 models under both versioned ids (`deepseek-v4-pro`,\n* `deepseek-v4-flash-*`) and unversioned aliases (`deepseek-flash`, currently\n* serving V4.1 Flash). Known legacy aliases and pre-V4 version IDs retain\n* their previous behavior; unrecognized IDs inherit the current protocol.\n*/\nfunction isDeepSeekV4Model(modelId) {\n\treturn !/(^|[/.])deepseek-(?:chat|reasoner|v[1-3](?:\\.\\d+)?)(?=[-/:.]|$)/.test(modelId);\n}\n//#endregion\n//#region src/chat/convert-to-deepseek-chat-messages.ts\nconst supportedImageMediaTypes = /* @__PURE__ */ new Set([\n\t\"image/gif\",\n\t\"image/jpeg\",\n\t\"image/jpg\",\n\t\"image/png\",\n\t\"image/webp\"\n]);\nfunction resolveDeepSeekImageMediaType(part) {\n\tconst resolvedMediaType = resolveFullMediaType({ part });\n\tif (!supportedImageMediaTypes.has(resolvedMediaType)) throw new UnsupportedFunctionalityError({\n\t\tfunctionality: `DeepSeek image media type ${resolvedMediaType}`,\n\t\tmessage: \"DeepSeek supports JPEG, PNG, GIF, and WebP image inputs.\"\n\t});\n\treturn resolvedMediaType;\n}\nfunction validateDeepSeekImageUrl({ url, prompt }) {\n\tif (url.length > 8192) throw new InvalidPromptError({\n\t\tprompt,\n\t\tmessage: \"DeepSeek image URLs must not exceed 8192 characters.\"\n\t});\n}\nasync function convertToDeepSeekChatMessages({ prompt, responseFormat, modelId, providerOptionsName = \"deepseek\", supportsAssistantPrefixCompletion = false, supportsStructuredOutputs = false }) {\n\tconst isDeepSeekV4 = isDeepSeekV4Model(modelId);\n\tconst messages = [];\n\tconst warnings = [];\n\tif (responseFormat?.type === \"json\") {\n\t\tif (responseFormat.schema == null) messages.push({\n\t\t\trole: \"system\",\n\t\t\tcontent: \"Return JSON.\"\n\t\t});\n\t\telse if (!supportsStructuredOutputs) {\n\t\t\tmessages.push({\n\t\t\t\trole: \"system\",\n\t\t\t\tcontent: \"Return JSON that conforms to the following schema: \" + JSON.stringify(responseFormat.schema)\n\t\t\t});\n\t\t\twarnings.push({\n\t\t\t\ttype: \"compatibility\",\n\t\t\t\tfeature: \"responseFormat JSON schema\",\n\t\t\t\tdetails: \"JSON response schema is injected into the system message.\"\n\t\t\t});\n\t\t}\n\t}\n\tlet lastUserMessageIndex = -1;\n\tfor (let i = prompt.length - 1; i >= 0; i--) if (prompt[i].role === \"user\") {\n\t\tlastUserMessageIndex = i;\n\t\tbreak;\n\t}\n\tlet index = -1;\n\tfor (const { role, content, providerOptions } of prompt) {\n\t\tindex++;\n\t\tconst deepseekMessageOptions = await parseProviderOptions({\n\t\t\tprovider: providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\tschema: deepseekAssistantMessageProviderOptions\n\t\t});\n\t\tif (deepseekMessageOptions?.prefix === true && role !== \"assistant\") throw new InvalidPromptError({\n\t\t\tprompt,\n\t\t\tmessage: \"DeepSeek assistant prefix completion requires `prefix: true` on an assistant message.\"\n\t\t});\n\t\tswitch (role) {\n\t\t\tcase \"system\":\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"system\",\n\t\t\t\t\tcontent,\n\t\t\t\t\t...deepseekMessageOptions?.name != null && { name: deepseekMessageOptions.name }\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase \"user\": {\n\t\t\t\tif (!content.some((part) => part.type === \"file\" && (part.data.type === \"reference\" || part.data.type === \"url\" || part.data.type === \"data\") && getTopLevelMediaType(part.mediaType) === \"image\")) {\n\t\t\t\t\tlet userContent = \"\";\n\t\t\t\t\tfor (const part of content) if (part.type === \"text\") userContent += part.text;\n\t\t\t\t\telse warnings.push({\n\t\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\t\tfeature: `user message part type: ${part.type}`\n\t\t\t\t\t});\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\trole: \"user\",\n\t\t\t\t\t\tcontent: userContent,\n\t\t\t\t\t\t...deepseekMessageOptions?.name != null && { name: deepseekMessageOptions.name }\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tconst userContent = [];\n\t\t\t\tfor (const part of content) if (part.type === \"text\") userContent.push({\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: part.text\n\t\t\t\t});\n\t\t\t\telse if (part.type === \"file\" && getTopLevelMediaType(part.mediaType) === \"image\") {\n\t\t\t\t\tconst filePartOptions = await parseProviderOptions({\n\t\t\t\t\t\tprovider: providerOptionsName,\n\t\t\t\t\t\tproviderOptions: part.providerOptions,\n\t\t\t\t\t\tschema: deepseekFilePartProviderOptions\n\t\t\t\t\t});\n\t\t\t\t\tif (part.data.type === \"reference\") userContent.push({\n\t\t\t\t\t\ttype: \"file\",\n\t\t\t\t\t\tfile_id: resolveProviderReference({\n\t\t\t\t\t\t\treference: part.data.reference,\n\t\t\t\t\t\t\tprovider: \"deepseek\"\n\t\t\t\t\t\t})\n\t\t\t\t\t});\n\t\t\t\t\telse if (part.data.type === \"url\" || part.data.type === \"data\") {\n\t\t\t\t\t\tconst resolvedMediaType = resolveDeepSeekImageMediaType(part);\n\t\t\t\t\t\tif (part.data.type === \"url\") {\n\t\t\t\t\t\t\tconst url = part.data.url.toString();\n\t\t\t\t\t\t\tvalidateDeepSeekImageUrl({\n\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\tprompt\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (filePartOptions?.fileData === true) throw new InvalidPromptError({\n\t\t\t\t\t\t\t\tprompt,\n\t\t\t\t\t\t\t\tmessage: \"DeepSeek `fileData` image parts require inline data, not a URL.\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tuserContent.push({\n\t\t\t\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\t\t\t\timage_url: {\n\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t\t...filePartOptions?.imageDetail != null && { detail: filePartOptions.imageDetail }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst dataUrl = `data:${resolvedMediaType === \"image/jpg\" ? \"image/jpeg\" : resolvedMediaType};base64,${convertToBase64(part.data.data)}`;\n\t\t\t\t\t\t\tif (filePartOptions?.fileData === true) {\n\t\t\t\t\t\t\t\tif (filePartOptions.imageDetail != null) throw new InvalidPromptError({\n\t\t\t\t\t\t\t\t\tprompt,\n\t\t\t\t\t\t\t\t\tmessage: \"DeepSeek `imageDetail` cannot be combined with `fileData`.\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tuserContent.push({\n\t\t\t\t\t\t\t\t\ttype: \"file\",\n\t\t\t\t\t\t\t\t\tfile_data: dataUrl,\n\t\t\t\t\t\t\t\t\t...part.filename != null && { filename: part.filename }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else userContent.push({\n\t\t\t\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\t\t\t\timage_url: {\n\t\t\t\t\t\t\t\t\turl: dataUrl,\n\t\t\t\t\t\t\t\t\t...filePartOptions?.imageDetail != null && { detail: filePartOptions.imageDetail }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} else warnings.push({\n\t\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\t\tfeature: `user message part type: ${part.type}`\n\t\t\t\t\t});\n\t\t\t\t} else warnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: `user message part type: ${part.type}`\n\t\t\t\t});\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tcontent: userContent,\n\t\t\t\t\t...deepseekMessageOptions?.name != null && { name: deepseekMessageOptions.name }\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"assistant\": {\n\t\t\t\tif (deepseekMessageOptions?.prefix === true) {\n\t\t\t\t\tif (index !== prompt.length - 1) throw new InvalidPromptError({\n\t\t\t\t\t\tprompt,\n\t\t\t\t\t\tmessage: \"DeepSeek assistant prefix completion requires the prefixed assistant message to be the final message.\"\n\t\t\t\t\t});\n\t\t\t\t\tif (!supportsAssistantPrefixCompletion) throw new UnsupportedFunctionalityError({\n\t\t\t\t\t\tfunctionality: \"DeepSeek assistant prefix completion\",\n\t\t\t\t\t\tmessage: \"DeepSeek assistant prefix completion requires a beta base URL ending in `/beta`.\"\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet text = \"\";\n\t\t\t\tlet reasoning;\n\t\t\t\tconst toolCalls = [];\n\t\t\t\tfor (const part of content) switch (part.type) {\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\ttext += part.text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"reasoning\":\n\t\t\t\t\t\tif (index <= lastUserMessageIndex && !isDeepSeekV4) break;\n\t\t\t\t\t\tif (reasoning == null) reasoning = part.text;\n\t\t\t\t\t\telse reasoning += part.text;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"tool-call\": toolCalls.push({\n\t\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\tfunction: {\n\t\t\t\t\t\t\tname: part.toolName,\n\t\t\t\t\t\t\targuments: JSON.stringify(part.input)\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\tcontent: text,\n\t\t\t\t\t...deepseekMessageOptions?.name != null && { name: deepseekMessageOptions.name },\n\t\t\t\t\t...deepseekMessageOptions?.prefix === true && { prefix: true },\n\t\t\t\t\treasoning_content: reasoning ?? (isDeepSeekV4 ? \"\" : void 0),\n\t\t\t\t\ttool_calls: toolCalls.length > 0 ? toolCalls : void 0\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"tool\":\n\t\t\t\tif (deepseekMessageOptions?.name != null) warnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: \"message name on tool messages\"\n\t\t\t\t});\n\t\t\t\tfor (const toolResponse of content) {\n\t\t\t\t\tif (toolResponse.type === \"tool-approval-response\") continue;\n\t\t\t\t\tconst output = toolResponse.output;\n\t\t\t\t\tlet contentValue;\n\t\t\t\t\tswitch (output.type) {\n\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\tcase \"error-text\":\n\t\t\t\t\t\t\tcontentValue = output.value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"execution-denied\":\n\t\t\t\t\t\t\tcontentValue = output.reason ?? \"Tool call execution denied.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\tcase \"error-json\":\n\t\t\t\t\t\t\tcontentValue = JSON.stringify(output.value);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"content\":\n\t\t\t\t\t\t\tif (!output.value.some((part) => part.type === \"file\" && (part.data.type === \"reference\" || part.data.type === \"url\" || part.data.type === \"data\") && getTopLevelMediaType(part.mediaType) === \"image\")) {\n\t\t\t\t\t\t\t\tcontentValue = JSON.stringify(output.value);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontentValue = [];\n\t\t\t\t\t\t\tfor (const part of output.value) if (part.type === \"text\") contentValue.push({\n\t\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\t\ttext: part.text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\telse if (part.type === \"file\" && (part.data.type === \"reference\" || part.data.type === \"url\" || part.data.type === \"data\") && getTopLevelMediaType(part.mediaType) === \"image\") {\n\t\t\t\t\t\t\t\tif (part.data.type === \"reference\") {\n\t\t\t\t\t\t\t\t\tcontentValue.push({\n\t\t\t\t\t\t\t\t\t\ttype: \"file\",\n\t\t\t\t\t\t\t\t\t\tfile_id: resolveProviderReference({\n\t\t\t\t\t\t\t\t\t\t\treference: part.data.reference,\n\t\t\t\t\t\t\t\t\t\t\tprovider: \"deepseek\"\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst filePartOptions = await parseProviderOptions({\n\t\t\t\t\t\t\t\t\tprovider: providerOptionsName,\n\t\t\t\t\t\t\t\t\tproviderOptions: part.providerOptions,\n\t\t\t\t\t\t\t\t\tschema: deepseekFilePartProviderOptions\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tconst resolvedMediaType = resolveDeepSeekImageMediaType(part);\n\t\t\t\t\t\t\t\tlet url;\n\t\t\t\t\t\t\t\tif (part.data.type === \"url\") {\n\t\t\t\t\t\t\t\t\turl = part.data.url.toString();\n\t\t\t\t\t\t\t\t\tvalidateDeepSeekImageUrl({\n\t\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t\t\tprompt\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} else url = `data:${resolvedMediaType === \"image/jpg\" ? \"image/jpeg\" : resolvedMediaType};base64,${convertToBase64(part.data.data)}`;\n\t\t\t\t\t\t\t\tcontentValue.push({\n\t\t\t\t\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\t\t\t\t\timage_url: {\n\t\t\t\t\t\t\t\t\t\turl,\n\t\t\t\t\t\t\t\t\t\t...filePartOptions?.imageDetail != null && { detail: filePartOptions.imageDetail }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else warnings.push({\n\t\t\t\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\t\t\t\tfeature: `tool result content part type: ${part.type}`\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tmessages.push({\n\t\t\t\t\t\trole: \"tool\",\n\t\t\t\t\t\ttool_call_id: toolResponse.toolCallId,\n\t\t\t\t\t\tcontent: contentValue\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault: warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: `message role: ${role}`\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tmessages,\n\t\twarnings\n\t};\n}\n//#endregion\n//#region src/chat/convert-to-deepseek-usage.ts\nfunction convertDeepSeekUsage(usage) {\n\tif (usage == null) return createNullLanguageModelUsage();\n\tconst promptTokens = usage.prompt_tokens ?? 0;\n\tconst completionTokens = usage.completion_tokens ?? 0;\n\tconst cacheReadTokens = usage.prompt_cache_hit_tokens ?? usage.prompt_tokens_details?.cached_tokens ?? 0;\n\tconst reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? 0;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokens,\n\t\t\tnoCache: promptTokens - cacheReadTokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: completionTokens,\n\t\t\ttext: Math.max(0, completionTokens - reasoningTokens),\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/chat/deepseek-chat-api-types.ts\nfunction createTokenUsageSchema() {\n\treturn z.looseObject({\n\t\tprompt_tokens: z.number().nullish(),\n\t\tcompletion_tokens: z.number().nullish(),\n\t\tprompt_cache_hit_tokens: z.number().nullish(),\n\t\tprompt_cache_miss_tokens: z.number().nullish(),\n\t\ttotal_tokens: z.number().nullish(),\n\t\tprompt_tokens_details: z.looseObject({ cached_tokens: z.number().nullish() }).nullish(),\n\t\tcompletion_tokens_details: z.looseObject({ reasoning_tokens: z.number().nullish() }).nullish()\n\t}).nullish();\n}\nlet tokenUsageSchema;\nfunction getTokenUsageSchema() {\n\treturn tokenUsageSchema ??= createTokenUsageSchema();\n}\nfunction createDeepSeekErrorSchema() {\n\treturn z.object({ error: z.object({\n\t\tmessage: z.string(),\n\t\ttype: z.string().nullish(),\n\t\tparam: z.any().nullish(),\n\t\tcode: z.union([z.string(), z.number()]).nullish()\n\t}) });\n}\nlet errorSchema;\nfunction getDeepSeekErrorSchema() {\n\treturn errorSchema ??= createDeepSeekErrorSchema();\n}\nconst deepSeekErrorSchema = lazySchema(() => zodSchema(getDeepSeekErrorSchema()));\nfunction createDeepseekChatLogprobsSchema() {\n\tconst deepseekChatLogprobSchema = z.object({\n\t\ttoken: z.string(),\n\t\tlogprob: z.number(),\n\t\tbytes: z.array(z.number()).nullable(),\n\t\ttop_logprobs: z.array(z.object({\n\t\t\ttoken: z.string(),\n\t\t\tlogprob: z.number(),\n\t\t\tbytes: z.array(z.number()).nullable()\n\t\t}))\n\t});\n\treturn z.object({\n\t\tcontent: z.array(deepseekChatLogprobSchema).nullish(),\n\t\treasoning_content: z.array(deepseekChatLogprobSchema).nullish()\n\t}).nullish();\n}\nlet logprobsSchema;\nfunction getDeepseekChatLogprobsSchema() {\n\treturn logprobsSchema ??= createDeepseekChatLogprobsSchema();\n}\nconst deepseekChatResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tobject: z.literal(\"chat.completion\").nullish(),\n\tsystem_fingerprint: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tindex: z.number().nullish(),\n\t\tmessage: z.object({\n\t\t\trole: z.literal(\"assistant\").nullish(),\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\ttype: z.literal(\"function\").nullish(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\targuments: z.string()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}),\n\t\tlogprobs: getDeepseekChatLogprobsSchema(),\n\t\tfinish_reason: z.string().nullish()\n\t})),\n\tusage: getTokenUsageSchema()\n})));\nconst deepseekChatChunkSchema = lazySchema(() => zodSchema(z.union([z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tobject: z.literal(\"chat.completion.chunk\").nullish(),\n\tsystem_fingerprint: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tindex: z.number().nullish(),\n\t\tdelta: z.object({\n\t\t\trole: z.enum([\"assistant\"]).nullish(),\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tindex: z.number(),\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\ttype: z.literal(\"function\").nullish(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string().nullish(),\n\t\t\t\t\targuments: z.string().nullish()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}).nullish(),\n\t\tlogprobs: getDeepseekChatLogprobsSchema(),\n\t\tfinish_reason: z.string().nullish()\n\t})),\n\tusage: getTokenUsageSchema()\n}), getDeepSeekErrorSchema()])));\n//#endregion\n//#region src/chat/deepseek-prepare-tools.ts\nfunction prepareTools({ tools, toolChoice, supportsStrictToolCalls }) {\n\ttools = tools?.length ? tools : void 0;\n\tconst toolWarnings = [];\n\tif (tools == null) return {\n\t\ttools: void 0,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst functionTools = tools.filter((tool) => tool.type === \"function\");\n\tconst hasStrictTool = functionTools.some((tool) => tool.strict === true);\n\tif (hasStrictTool && supportsStrictToolCalls === false) throw new UnsupportedFunctionalityError({\n\t\tfunctionality: \"DeepSeek strict tool calls\",\n\t\tmessage: \"DeepSeek strict tool calls require a beta base URL ending in `/beta`.\"\n\t});\n\tif (hasStrictTool && supportsStrictToolCalls === true && functionTools.some((tool) => tool.strict !== true)) throw new UnsupportedFunctionalityError({\n\t\tfunctionality: \"mixed DeepSeek strict and non-strict tool calls\",\n\t\tmessage: \"DeepSeek strict mode requires every function tool in the request to set `strict: true`.\"\n\t});\n\tconst deepseekTools = [];\n\tfor (const tool of tools) if (tool.type === \"provider\") toolWarnings.push({\n\t\ttype: \"unsupported\",\n\t\tfeature: `provider-defined tool ${tool.id}`\n\t});\n\telse deepseekTools.push({\n\t\ttype: \"function\",\n\t\tfunction: {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.inputSchema,\n\t\t\t...tool.strict != null ? { strict: tool.strict } : {}\n\t\t}\n\t});\n\tif (toolChoice == null) return {\n\t\ttools: deepseekTools,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst type = toolChoice?.type;\n\tswitch (type) {\n\t\tcase \"auto\":\n\t\tcase \"none\":\n\t\tcase \"required\": return {\n\t\t\ttools: deepseekTools,\n\t\t\ttoolChoice: type,\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"tool\": return {\n\t\t\ttools: deepseekTools,\n\t\t\ttoolChoice: {\n\t\t\t\ttype: \"function\",\n\t\t\t\tfunction: { name: toolChoice.toolName }\n\t\t\t},\n\t\t\ttoolWarnings\n\t\t};\n\t\tdefault: return {\n\t\t\ttools: deepseekTools,\n\t\t\ttoolChoice: void 0,\n\t\t\ttoolWarnings: [...toolWarnings, {\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: `tool choice type: ${type}`\n\t\t\t}]\n\t\t};\n\t}\n}\n//#endregion\n//#region src/chat/map-deepseek-finish-reason.ts\nfunction mapDeepSeekFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tcase \"tool_calls\": return \"tool-calls\";\n\t\tcase \"insufficient_system_resource\": return \"error\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/chat/deepseek-chat-language-model.ts\nfunction createDeepSeekStreamError(error, data) {\n\tconst metadata = getDeepSeekStreamErrorMetadata(error);\n\treturn createProviderStreamError({\n\t\tmessage: error.message,\n\t\ttype: error.type ?? void 0,\n\t\tcode: error.code ?? void 0,\n\t\t...metadata,\n\t\tdata\n\t});\n}\nfunction getDeepSeekStreamErrorMetadata(error) {\n\tif (error.code === \"insufficient_quota\" || error.type === \"insufficient_quota\") return {\n\t\tstatusCode: 429,\n\t\tisRetryable: false\n\t};\n\tconst explicitStatusCode = getHttpStatusCode(error.code);\n\tif (explicitStatusCode != null) return {\n\t\tstatusCode: explicitStatusCode,\n\t\tisRetryable: isRetryableStatusCode(explicitStatusCode)\n\t};\n\tfor (const discriminator of [error.code, error.type]) switch (discriminator) {\n\t\tcase \"rate_limit_exceeded\":\n\t\tcase \"rate_limit_error\": return {\n\t\t\tstatusCode: 429,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"server_error\":\n\t\tcase \"api_error\":\n\t\tcase \"internal_server_error\": return {\n\t\t\tstatusCode: 500,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"overloaded_error\":\n\t\tcase \"service_unavailable\": return {\n\t\t\tstatusCode: 503,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"timeout\":\n\t\tcase \"timeout_error\": return {\n\t\t\tstatusCode: 504,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"authentication_error\":\n\t\tcase \"invalid_api_key\": return {\n\t\t\tstatusCode: 401,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"permission_error\": return {\n\t\t\tstatusCode: 403,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"not_found_error\":\n\t\tcase \"model_not_found\": return {\n\t\t\tstatusCode: 404,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"bad_request\":\n\t\tcase \"context_length_exceeded\":\n\t\tcase \"invalid_request_error\": return {\n\t\t\tstatusCode: 400,\n\t\t\tisRetryable: false\n\t\t};\n\t}\n\treturn {};\n}\nfunction getHttpStatusCode(value) {\n\tconst statusCode = typeof value === \"string\" && /^\\d{3}$/.test(value) ? Number(value) : value;\n\treturn typeof statusCode === \"number\" && Number.isInteger(statusCode) && statusCode >= 400 && statusCode <= 599 ? statusCode : void 0;\n}\nfunction isRetryableStatusCode(statusCode) {\n\treturn statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500;\n}\nfunction mapDeepSeekProviderReasoningEffort({ reasoningEffort, warnings }) {\n\tconst mapped = reasoningEffort === \"medium\" ? \"high\" : reasoningEffort === \"xhigh\" ? \"max\" : reasoningEffort;\n\tif (mapped !== reasoningEffort) warnings.push({\n\t\ttype: \"compatibility\",\n\t\tfeature: \"reasoningEffort\",\n\t\tdetails: `reasoningEffort \"${reasoningEffort}\" is not a canonical DeepSeek value. mapped to \"${mapped}\".`\n\t});\n\treturn mapped;\n}\nvar DeepSeekChatLanguageModel = class DeepSeekChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new DeepSeekChatLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.supportedUrls = { \"image/*\": [/^https?:\\/\\/.*$/] };\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.failedResponseHandler = createJsonErrorResponseHandler({\n\t\t\terrorSchema: deepSeekErrorSchema,\n\t\t\terrorToMessage: (error) => error.error.message\n\t\t});\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tget providerOptionsName() {\n\t\treturn this.config.provider.split(\".\")[0].trim();\n\t}\n\tasync getArgs({ prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, reasoning, providerOptions, stopSequences, responseFormat, seed, toolChoice, tools }) {\n\t\tconst deepseekOptions = await parseProviderOptions({\n\t\t\tprovider: this.providerOptionsName,\n\t\t\tproviderOptions,\n\t\t\tschema: deepseekLanguageModelChatOptions\n\t\t}) ?? {};\n\t\tconst supportsStructuredOutputs = this.config.supportsStructuredOutputs === true;\n\t\tconst supportsPenaltySampling = this.config.supportsPenaltySampling === true;\n\t\tconst { messages, warnings } = await convertToDeepSeekChatMessages({\n\t\t\tprompt,\n\t\t\tresponseFormat,\n\t\t\tmodelId: this.modelId,\n\t\t\tproviderOptionsName: this.providerOptionsName,\n\t\t\tsupportsAssistantPrefixCompletion: this.config.supportsAssistantPrefixCompletion,\n\t\t\tsupportsStructuredOutputs\n\t\t});\n\t\tconst allWarnings = [...warnings];\n\t\tif (topK != null) allWarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"topK\"\n\t\t});\n\t\tif (seed != null) allWarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"seed\"\n\t\t});\n\t\tif (!supportsPenaltySampling && frequencyPenalty != null) allWarnings.push({\n\t\t\ttype: \"deprecated\",\n\t\t\tsetting: \"frequencyPenalty\",\n\t\t\tmessage: \"frequencyPenalty is deprecated by DeepSeek and has been omitted. Remove frequencyPenalty from the request.\"\n\t\t});\n\t\tif (!supportsPenaltySampling && presencePenalty != null) allWarnings.push({\n\t\t\ttype: \"deprecated\",\n\t\t\tsetting: \"presencePenalty\",\n\t\t\tmessage: \"presencePenalty is deprecated by DeepSeek and has been omitted. Remove presencePenalty from the request.\"\n\t\t});\n\t\tconst { tools: deepseekTools, toolChoice: deepseekToolChoices, toolWarnings } = prepareTools({\n\t\t\ttools,\n\t\t\ttoolChoice,\n\t\t\tsupportsStrictToolCalls: this.config.supportsStrictToolCalls\n\t\t});\n\t\tconst thinkingType = deepseekOptions.thinking?.type;\n\t\tif (thinkingType === \"adaptive\") allWarnings.push({\n\t\t\ttype: \"compatibility\",\n\t\t\tfeature: \"thinking.type\",\n\t\t\tdetails: \"thinking.type \\\"adaptive\\\" is not a canonical DeepSeek value. mapped to \\\"enabled\\\".\"\n\t\t});\n\t\tconst thinking = this.config.supportsThinking === false ? void 0 : thinkingType != null ? { type: thinkingType === \"adaptive\" ? \"enabled\" : thinkingType } : isCustomReasoning(reasoning) ? { type: reasoning === \"none\" ? \"disabled\" : \"enabled\" } : void 0;\n\t\tconst isThinkingEnabled = this.config.supportsThinking !== false && thinking?.type !== \"disabled\" && (thinking != null || this.modelId === \"deepseek-reasoner\" || isDeepSeekV4Model(this.modelId));\n\t\tif (isThinkingEnabled && temperature != null) allWarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"temperature\",\n\t\t\tdetails: \"temperature has no effect when DeepSeek thinking is enabled. Set providerOptions.deepseek.thinking.type to 'disabled' to use temperature.\"\n\t\t});\n\t\tif (isThinkingEnabled && topP != null) allWarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"topP\",\n\t\t\tdetails: \"topP has no effect when DeepSeek thinking is enabled. Set providerOptions.deepseek.thinking.type to 'disabled' to use topP.\"\n\t\t});\n\t\tconst reasoningEffort = deepseekOptions.reasoningEffort != null ? mapDeepSeekProviderReasoningEffort({\n\t\t\treasoningEffort: deepseekOptions.reasoningEffort,\n\t\t\twarnings: allWarnings\n\t\t}) : isCustomReasoning(reasoning) && reasoning !== \"none\" ? mapReasoningToProviderEffort({\n\t\t\treasoning,\n\t\t\teffortMap: {\n\t\t\t\tlow: \"low\",\n\t\t\t\thigh: \"high\",\n\t\t\t\tmax: \"max\"\n\t\t\t},\n\t\t\twarnings: allWarnings\n\t\t}) : void 0;\n\t\treturn {\n\t\t\targs: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\t...(deepseekOptions.logprobs === true || deepseekOptions.topLogprobs != null) && { logprobs: true },\n\t\t\t\t...deepseekOptions.topLogprobs != null && { top_logprobs: deepseekOptions.topLogprobs },\n\t\t\t\tmax_tokens: maxOutputTokens,\n\t\t\t\ttemperature: isThinkingEnabled ? void 0 : temperature,\n\t\t\t\ttop_p: isThinkingEnabled ? void 0 : topP,\n\t\t\t\tfrequency_penalty: supportsPenaltySampling ? frequencyPenalty : void 0,\n\t\t\t\tpresence_penalty: supportsPenaltySampling ? presencePenalty : void 0,\n\t\t\t\tresponse_format: responseFormat?.type === \"json\" ? supportsStructuredOutputs && responseFormat.schema != null ? {\n\t\t\t\t\ttype: \"json_schema\",\n\t\t\t\t\tjson_schema: {\n\t\t\t\t\t\tschema: responseFormat.schema,\n\t\t\t\t\t\tstrict: deepseekOptions.strictJsonSchema ?? true,\n\t\t\t\t\t\tname: responseFormat.name ?? \"response\",\n\t\t\t\t\t\tdescription: responseFormat.description\n\t\t\t\t\t}\n\t\t\t\t} : { type: \"json_object\" } : void 0,\n\t\t\t\tstop: stopSequences,\n\t\t\t\tmessages,\n\t\t\t\ttools: deepseekTools,\n\t\t\t\ttool_choice: deepseekToolChoices,\n\t\t\t\tthinking,\n\t\t\t\t...deepseekOptions.userId != null && { user_id: deepseekOptions.userId },\n\t\t\t\t...thinking?.type !== \"disabled\" && reasoningEffort != null && { reasoning_effort: reasoningEffort }\n\t\t\t},\n\t\t\twarnings: [...allWarnings, ...toolWarnings]\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args, warnings } = await this.getArgs({ ...options });\n\t\tconst { responseHeaders, value: responseBody, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody: args,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(deepseekChatResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst choice = responseBody.choices[0];\n\t\tif (choice == null) throw new InvalidResponseDataError({\n\t\t\tdata: rawResponse,\n\t\t\tmessage: \"Response did not contain any choices.\"\n\t\t});\n\t\tconst content = [];\n\t\tconst reasoning = choice.message.reasoning_content;\n\t\tif (reasoning != null && reasoning.length > 0) content.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: reasoning\n\t\t});\n\t\tif (choice.message.tool_calls != null) for (const toolCall of choice.message.tool_calls) content.push({\n\t\t\ttype: \"tool-call\",\n\t\t\ttoolCallId: toolCall.id || generateId(),\n\t\t\ttoolName: toolCall.function.name,\n\t\t\tinput: toolCall.function.arguments\n\t\t});\n\t\tconst text = choice.message.content;\n\t\tif (text != null && text.length > 0) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t});\n\t\treturn {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: mapDeepSeekFinishReason(choice.finish_reason),\n\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t},\n\t\t\tusage: convertDeepSeekUsage(responseBody.usage),\n\t\t\tproviderMetadata: { [this.providerOptionsName]: {\n\t\t\t\tpromptCacheHitTokens: responseBody.usage?.prompt_cache_hit_tokens,\n\t\t\t\tpromptCacheMissTokens: responseBody.usage?.prompt_cache_miss_tokens,\n\t\t\t\t...responseBody.object != null && { responseObject: responseBody.object },\n\t\t\t\t...choice.index != null && { choiceIndex: choice.index },\n\t\t\t\t...choice.message.role != null && { messageRole: choice.message.role },\n\t\t\t\t...choice.message.tool_calls != null && { toolCallTypes: choice.message.tool_calls.map((toolCall) => toolCall.type).filter((type) => type != null) },\n\t\t\t\t...choice.logprobs != null && { logprobs: choice.logprobs },\n\t\t\t\t...responseBody.system_fingerprint != null && { systemFingerprint: responseBody.system_fingerprint }\n\t\t\t} },\n\t\t\trequest: { body: args },\n\t\t\tresponse: {\n\t\t\t\t...getResponseMetadata(responseBody),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings } = await this.getArgs({ ...options });\n\t\tconst body = {\n\t\t\t...args,\n\t\t\tstream: true,\n\t\t\tstream_options: { include_usage: true }\n\t\t};\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: this.failedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(deepseekChatChunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet toolCallTracker;\n\t\tlet finishReason = {\n\t\t\tunified: \"interrupted\",\n\t\t\traw: void 0\n\t\t};\n\t\tlet usage = void 0;\n\t\tlet systemFingerprint = void 0;\n\t\tlet isFirstChunk = true;\n\t\tconst providerOptionsName = this.providerOptionsName;\n\t\tlet isActiveReasoning = false;\n\t\tlet isActiveText = false;\n\t\tlet responseObject;\n\t\tlet choiceIndex;\n\t\tlet messageRole;\n\t\tconst toolCallTypes = /* @__PURE__ */ new Map();\n\t\tconst contentLogprobs = [];\n\t\tconst reasoningLogprobs = [];\n\t\treturn {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\ttoolCallTracker = new StreamingToolCallTracker(controller, { generateId });\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = chunk.value;\n\t\t\t\t\tif (\"error\" in value) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: createDeepSeekStreamError(value.error, value)\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (isFirstChunk) {\n\t\t\t\t\t\tisFirstChunk = false;\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t...getResponseMetadata(value)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (value.usage != null) usage = value.usage;\n\t\t\t\t\tif (value.object != null) responseObject = value.object;\n\t\t\t\t\tif (value.system_fingerprint != null) systemFingerprint = value.system_fingerprint;\n\t\t\t\t\tconst choice = value.choices[0];\n\t\t\t\t\tif (choice?.index != null) choiceIndex = choice.index;\n\t\t\t\t\tif (choice?.finish_reason != null) finishReason = {\n\t\t\t\t\t\tunified: mapDeepSeekFinishReason(choice.finish_reason),\n\t\t\t\t\t\traw: choice.finish_reason\n\t\t\t\t\t};\n\t\t\t\t\tif (choice?.logprobs?.content != null) contentLogprobs.push(...choice.logprobs.content);\n\t\t\t\t\tif (choice?.logprobs?.reasoning_content != null) reasoningLogprobs.push(...choice.logprobs.reasoning_content);\n\t\t\t\t\tif (choice?.delta == null) return;\n\t\t\t\t\tconst delta = choice.delta;\n\t\t\t\t\tif (delta.role != null) messageRole = delta.role;\n\t\t\t\t\tconst reasoningContent = delta.reasoning_content;\n\t\t\t\t\tif (reasoningContent) {\n\t\t\t\t\t\tif (!isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: \"reasoning-0\",\n\t\t\t\t\t\t\tdelta: reasoningContent\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.content) {\n\t\t\t\t\t\tif (!isActiveText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveText = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\tid: \"txt-0\",\n\t\t\t\t\t\t\tdelta: delta.content\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.tool_calls != null && delta.tool_calls.length > 0) {\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const toolCallDelta of delta.tool_calls) {\n\t\t\t\t\t\t\tif (toolCallDelta.type != null) toolCallTypes.set(toolCallDelta.index, toolCallDelta.type);\n\t\t\t\t\t\t\ttoolCallTracker.processDelta(toolCallDelta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tif (isActiveReasoning) controller.enqueue({\n\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t});\n\t\t\t\t\tif (isActiveText) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t});\n\t\t\t\t\ttoolCallTracker.flush();\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: convertDeepSeekUsage(usage),\n\t\t\t\t\t\tproviderMetadata: { [providerOptionsName]: {\n\t\t\t\t\t\t\tpromptCacheHitTokens: usage?.prompt_cache_hit_tokens ?? void 0,\n\t\t\t\t\t\t\tpromptCacheMissTokens: usage?.prompt_cache_miss_tokens ?? void 0,\n\t\t\t\t\t\t\t...responseObject != null && { responseObject },\n\t\t\t\t\t\t\t...choiceIndex != null && { choiceIndex },\n\t\t\t\t\t\t\t...messageRole != null && { messageRole },\n\t\t\t\t\t\t\t...toolCallTypes.size > 0 && { toolCallTypes: [...toolCallTypes.entries()].sort(([left], [right]) => left - right).map(([, type]) => type) },\n\t\t\t\t\t\t\t...(contentLogprobs.length > 0 || reasoningLogprobs.length > 0) && { logprobs: {\n\t\t\t\t\t\t\t\t...contentLogprobs.length > 0 && { content: contentLogprobs },\n\t\t\t\t\t\t\t\t...reasoningLogprobs.length > 0 && { reasoning_content: reasoningLogprobs }\n\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\t...systemFingerprint != null && { systemFingerprint }\n\t\t\t\t\t\t} }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t}\n};\n//#endregion\n//#region src/files/deepseek-files-api.ts\nconst deepSeekFilesResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string(),\n\tobject: z.literal(\"file\").nullish(),\n\tbytes: z.number().int().nonnegative().nullish(),\n\tcreated_at: z.number().int().nonnegative().nullish(),\n\tfilename: z.string().nullish(),\n\tpurpose: z.literal(\"user_data\").nullish(),\n\texpires_at: z.number().int().nonnegative().nullish()\n})));\n//#endregion\n//#region src/files/deepseek-files-options.ts\nconst deepSeekFilesOptionsSchema = lazySchema(() => zodSchema(z.object({ \n/**\n* Number of seconds after creation before the file expires.\n* Must be between 1 hour and 30 days.\n*/\nexpiresAfter: z.number().int().min(3600).max(2592e3).optional() })));\n//#endregion\n//#region src/files/deepseek-files.ts\nconst deepSeekFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: deepSeekErrorSchema,\n\terrorToMessage: (error) => error.error.message\n});\nconst MAX_FILE_SIZE_BYTES = 67108864;\nconst MAX_FILENAME_LENGTH = 512;\nconst supportedMediaTypes = /* @__PURE__ */ new Set([\n\t\"image/gif\",\n\t\"image/jpeg\",\n\t\"image/jpg\",\n\t\"image/png\",\n\t\"image/webp\"\n]);\nconst genericMediaTypes = /* @__PURE__ */ new Set([\n\t\"\",\n\t\"application/binary\",\n\t\"application/octet-stream\",\n\t\"binary/octet-stream\",\n\t\"image\",\n\t\"image/*\"\n]);\nconst supportedFilenameExtensions = /* @__PURE__ */ new Set([\n\t\"gif\",\n\t\"jpeg\",\n\t\"jpg\",\n\t\"png\",\n\t\"webp\"\n]);\nvar DeepSeekFiles = class {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(config) {\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t}\n\tasync uploadFile({ data, mediaType, filename, abortSignal, headers, providerOptions }) {\n\t\tconst deepSeekOptions = await parseProviderOptions({\n\t\t\tprovider: \"deepseek\",\n\t\t\tproviderOptions,\n\t\t\tschema: deepSeekFilesOptionsSchema\n\t\t});\n\t\tconst fileBytes = convertInlineFileDataToUint8Array(data);\n\t\tvalidateFileUpload({\n\t\t\tfileBytes,\n\t\t\tmediaType,\n\t\t\tfilename\n\t\t});\n\t\tconst blob = new Blob([fileBytes], { type: mediaType });\n\t\tconst formData = new FormData();\n\t\tif (filename != null) formData.append(\"file\", blob, filename);\n\t\telse formData.append(\"file\", blob);\n\t\tformData.append(\"purpose\", \"user_data\");\n\t\tif (deepSeekOptions?.expiresAfter != null) {\n\t\t\tformData.append(\"expires_after[anchor]\", \"created_at\");\n\t\t\tformData.append(\"expires_after[seconds]\", String(deepSeekOptions.expiresAfter));\n\t\t}\n\t\tconst { value: response } = await postFormDataToApi({\n\t\t\turl: `${this.config.baseURL}/files`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tformData,\n\t\t\tfailedResponseHandler: deepSeekFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(deepSeekFilesResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tproviderReference: { deepseek: response.id },\n\t\t\t...response.filename ?? filename ? { filename: response.filename ?? filename } : {},\n\t\t\t...mediaType != null ? { mediaType } : {},\n\t\t\tproviderMetadata: { deepseek: {\n\t\t\t\t...response.object != null ? { object: response.object } : {},\n\t\t\t\t...response.filename != null ? { filename: response.filename } : {},\n\t\t\t\t...response.purpose != null ? { purpose: response.purpose } : {},\n\t\t\t\t...response.bytes != null ? { bytes: response.bytes } : {},\n\t\t\t\t...response.created_at != null ? { createdAt: response.created_at } : {},\n\t\t\t\t...response.expires_at != null ? { expiresAt: response.expires_at } : {}\n\t\t\t} }\n\t\t};\n\t}\n};\nfunction validateFileUpload({ fileBytes, mediaType, filename }) {\n\tif (fileBytes.length > MAX_FILE_SIZE_BYTES) throw new InvalidArgumentError({\n\t\targument: \"data\",\n\t\tmessage: `DeepSeek file uploads must not exceed 64 MiB (${MAX_FILE_SIZE_BYTES.toLocaleString(\"en-US\")} bytes). Received ${fileBytes.length.toLocaleString(\"en-US\")} bytes.`\n\t});\n\tif (filename != null) {\n\t\tconst filenameLength = Array.from(filename).length;\n\t\tif (filenameLength > MAX_FILENAME_LENGTH) throw new InvalidArgumentError({\n\t\t\targument: \"filename\",\n\t\t\tmessage: `DeepSeek filenames must not exceed ${MAX_FILENAME_LENGTH} characters. Received ${filenameLength} characters.`\n\t\t});\n\t}\n\tconst normalizedMediaType = normalizeMediaType(mediaType);\n\tconst detectedMediaType = detectMediaType({ data: fileBytes });\n\tif (detectedMediaType != null && !supportedMediaTypes.has(detectedMediaType)) throw new InvalidArgumentError({\n\t\targument: \"data\",\n\t\tmessage: `DeepSeek file uploads support JPEG, PNG, GIF, and WebP images. Detected unsupported file content type \"${detectedMediaType}\".`\n\t});\n\tif (supportedMediaTypes.has(normalizedMediaType)) return;\n\tif (!genericMediaTypes.has(normalizedMediaType)) throw new InvalidArgumentError({\n\t\targument: \"mediaType\",\n\t\tmessage: `DeepSeek file uploads support JPEG, PNG, GIF, and WebP images. Received unsupported media type \"${mediaType}\".`\n\t});\n\tif (detectedMediaType != null || hasSupportedFilenameExtension(filename)) return;\n\tthrow new InvalidArgumentError({\n\t\targument: \"mediaType\",\n\t\tmessage: `DeepSeek file uploads support JPEG, PNG, GIF, and WebP images. Provide a supported media type or a filename ending in .jpg, .jpeg, .png, .gif, or .webp. Received \"${mediaType}\".`\n\t});\n}\nfunction normalizeMediaType(mediaType) {\n\treturn mediaType.split(\";\", 1)[0].trim().toLowerCase();\n}\nfunction hasSupportedFilenameExtension(filename) {\n\tif (filename == null) return false;\n\tconst extensionSeparatorIndex = filename.lastIndexOf(\".\");\n\treturn extensionSeparatorIndex !== -1 && supportedFilenameExtensions.has(filename.slice(extensionSeparatorIndex + 1).toLowerCase());\n}\n//#endregion\n//#region src/version.ts\nconst VERSION = \"3.0.77\";\n//#endregion\n//#region src/deepseek-provider.ts\nfunction createDeepSeek(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL ?? \"https://api.deepseek.com\") ?? \"https://api.deepseek.com\";\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"DEEPSEEK_API_KEY\",\n\t\t\tdescription: \"DeepSeek API key\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-deepseek/${VERSION}`));\n\tconst createLanguageModel = (modelId) => {\n\t\treturn new DeepSeekChatLanguageModel(modelId, {\n\t\t\tprovider: `deepseek.chat`,\n\t\t\turl: ({ path }) => `${baseURL}${path}`,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch,\n\t\t\tsupportsAssistantPrefixCompletion: baseURL.endsWith(\"/beta\"),\n\t\t\tsupportsStrictToolCalls: baseURL.endsWith(\"/beta\")\n\t\t});\n\t};\n\tconst createFiles = () => new DeepSeekFiles({\n\t\tprovider: \"deepseek.files\",\n\t\tbaseURL,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst provider = (modelId) => createLanguageModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createLanguageModel;\n\tprovider.chat = createLanguageModel;\n\tprovider.files = createFiles;\n\tprovider.embeddingModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"embeddingModel\"\n\t\t});\n\t};\n\tprovider.textEmbeddingModel = provider.embeddingModel;\n\tprovider.imageModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"imageModel\"\n\t\t});\n\t};\n\treturn provider;\n}\nconst deepSeek = createDeepSeek();\n//#endregion\nexport { VERSION, createDeepSeek, deepSeek, deepSeek as deepseek };\n\n//# sourceMappingURL=index.js.map","// src/transcription/google-transcription-model.ts\nimport {\n  InvalidArgumentError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3,\n  combineHeaders,\n  convertToBase64,\n  createJsonResponseHandler,\n  parseProviderOptions,\n  postJsonToApi,\n  resolve\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\n\n// src/google-error.ts\nimport {\n  createJsonErrorResponseHandler,\n  lazySchema,\n  zodSchema\n} from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\nvar googleErrorDataSchema = lazySchema(\n  () => zodSchema(\n    z.object({\n      error: z.object({\n        code: z.number().nullable(),\n        message: z.string(),\n        status: z.string(),\n        details: z.array(z.unknown()).nullish()\n      })\n    })\n  )\n);\nvar googleFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: googleErrorDataSchema,\n  errorToMessage: (data) => data.error.message\n});\n\n// src/transcription/google-transcription-model-options.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar googleTranscriptionModelOptions = lazySchema2(\n  () => zodSchema2(\n    z2.object({\n      /**\n       * BCP-47 language codes providing hints about the languages present in the\n       * audio. If omitted or empty, defaults to automatic language detection.\n       */\n      languageCodes: z2.array(z2.string()).optional(),\n      /**\n       * Custom vocabulary phrases, which bias the speech recognition model\n       * toward recognizing specific terms.\n       */\n      customVocabulary: z2.array(z2.string()).optional(),\n      /**\n       * Enables word-level timestamp generation.\n       */\n      wordTimestamp: z2.boolean().optional(),\n      /**\n       * Enables speaker diarization.\n       */\n      diarization: z2.boolean().optional(),\n      /**\n       * Transcription output formatting mode.\n       *\n       * - `VERBATIM` (default): exact literal transcript preserving filler\n       *   words, repetitions, and false starts.\n       * - `SMART`: cleans up and structures the transcript in real time —\n       *   disfluency removal, inline self-corrections, structured formatting\n       *   (lists, numbers, dates, paragraph breaks), and grammar/casing polish.\n       */\n      mode: z2.enum([\"SMART\", \"VERBATIM\"]).optional()\n    })\n  )\n);\n\n// src/transcription/google-transcription-model.ts\nfunction isLiveTranscriptionModelId(modelId) {\n  return modelId.includes(\"-live\");\n}\nvar GoogleTranscriptionModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async parseOptions(providerOptions) {\n    return parseProviderOptions({\n      provider: \"google\",\n      providerOptions,\n      schema: googleTranscriptionModelOptions\n    });\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f;\n    if (isLiveTranscriptionModelId(this.modelId)) {\n      throw new InvalidArgumentError({\n        argument: \"modelId\",\n        message: `Model '${this.modelId}' only supports streaming transcription, which requires AI SDK v7. Use a unary model such as 'gemini-3.5-transcribe'.`\n      });\n    }\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    const warnings = [];\n    const googleOptions = await this.parseOptions(options.providerOptions);\n    const transcriptionConfig = buildTranscriptionConfig(googleOptions);\n    const requestBody = {\n      model: this.modelId,\n      input: [\n        {\n          type: \"audio\",\n          data: convertToBase64(options.audio),\n          mime_type: options.mediaType\n        }\n      ],\n      ...transcriptionConfig != null ? { generation_config: { transcription_config: transcriptionConfig } } : {}\n    };\n    const {\n      value: response,\n      responseHeaders,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url: `${this.config.baseURL}/interactions`,\n      headers: combineHeaders(\n        this.config.headers ? await resolve(this.config.headers) : void 0,\n        options.headers\n      ),\n      body: requestBody,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        googleInteractionsTranscriptionResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let text = \"\";\n    const segments = [];\n    for (const step of (_d = response.steps) != null ? _d : []) {\n      for (const content of (_e = step.content) != null ? _e : []) {\n        if (content.type !== \"text\" || content.text == null) continue;\n        text += content.text;\n        for (const annotation of (_f = content.annotations) != null ? _f : []) {\n          if (annotation.type !== \"word_info\") continue;\n          const startSecond = parseOffsetSeconds(annotation.start_offset);\n          const endSecond = parseOffsetSeconds(annotation.end_offset);\n          if (annotation.text == null || startSecond == null || endSecond == null) {\n            continue;\n          }\n          segments.push({ text: annotation.text, startSecond, endSecond });\n        }\n      }\n    }\n    return {\n      text,\n      segments,\n      language: void 0,\n      durationInSeconds: void 0,\n      warnings,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      ...response.usage != null ? {\n        providerMetadata: {\n          google: { usage: response.usage }\n        }\n      } : {}\n    };\n  }\n};\nfunction buildTranscriptionConfig(options) {\n  var _a2;\n  if (options == null) return void 0;\n  const config = {};\n  if (options.languageCodes != null) {\n    config.language_codes = options.languageCodes;\n  }\n  if (options.customVocabulary != null) {\n    config.custom_vocabulary = options.customVocabulary;\n  }\n  if (options.mode != null || options.diarization === true || options.wordTimestamp === true) {\n    config.mode = {\n      type: ((_a2 = options.mode) != null ? _a2 : \"VERBATIM\").toLowerCase(),\n      ...options.diarization === true ? { diarization_mode: \"speaker\" } : {},\n      ...options.wordTimestamp === true ? { timestamp_granularities: [\"word\"] } : {}\n    };\n  }\n  return Object.keys(config).length > 0 ? config : void 0;\n}\nfunction parseOffsetSeconds(offset) {\n  if (offset == null) return void 0;\n  const parsed = Number.parseFloat(offset);\n  return Number.isFinite(parsed) ? parsed : void 0;\n}\nvar googleInteractionsWordAnnotationSchema = () => z3.object({\n  type: z3.string().nullish(),\n  text: z3.string().nullish(),\n  speaker: z3.string().nullish(),\n  start_offset: z3.string().nullish(),\n  end_offset: z3.string().nullish()\n});\nvar googleInteractionsTranscriptionResponseSchema = lazySchema3(\n  () => zodSchema3(\n    z3.object({\n      status: z3.string().nullish(),\n      steps: z3.array(\n        z3.object({\n          type: z3.string().nullish(),\n          content: z3.array(\n            z3.object({\n              type: z3.string().nullish(),\n              text: z3.string().nullish(),\n              annotations: z3.array(googleInteractionsWordAnnotationSchema()).nullish()\n            })\n          ).nullish()\n        })\n      ).nullish(),\n      usage: z3.record(z3.string(), z3.unknown()).nullish()\n    })\n  )\n);\n\n// src/google-provider.ts\nimport {\n  generateId as generateId2,\n  loadApiKey,\n  withoutTrailingSlash,\n  withUserAgentSuffix as withUserAgentSuffix2\n} from \"@ai-sdk/provider-utils\";\n\n// src/version.ts\nvar VERSION = true ? \"3.0.140\" : \"0.0.0-test\";\n\n// src/google-generative-ai-embedding-model.ts\nimport {\n  TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders as combineHeaders2,\n  createJsonResponseHandler as createJsonResponseHandler2,\n  EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,\n  lazySchema as lazySchema5,\n  parseProviderOptions as parseProviderOptions2,\n  postJsonToApi as postJsonToApi2,\n  resolve as resolve2,\n  zodSchema as zodSchema5\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\n\n// src/google-generative-ai-embedding-options.ts\nimport {\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\nvar googleEmbeddingContentPartSchema = () => z4.union([\n  z4.object({ text: z4.string() }),\n  z4.object({\n    inlineData: z4.object({\n      mimeType: z4.string(),\n      data: z4.string()\n    })\n  }),\n  z4.object({\n    fileData: z4.object({\n      fileUri: z4.string(),\n      mimeType: z4.string()\n    })\n  })\n]);\nvar googleEmbeddingModelOptions = lazySchema4(\n  () => zodSchema4(\n    z4.object({\n      /**\n       * Optional. Optional reduced dimension for the output embedding.\n       * If set, excessive values in the output embedding are truncated from the end.\n       */\n      outputDimensionality: z4.number().optional(),\n      /**\n       * Optional. Specifies the task type for generating embeddings.\n       * Supported task types:\n       * - SEMANTIC_SIMILARITY: Optimized for text similarity.\n       * - CLASSIFICATION: Optimized for text classification.\n       * - CLUSTERING: Optimized for clustering texts based on similarity.\n       * - RETRIEVAL_DOCUMENT: Optimized for document retrieval.\n       * - RETRIEVAL_QUERY: Optimized for query-based retrieval.\n       * - QUESTION_ANSWERING: Optimized for answering questions.\n       * - FACT_VERIFICATION: Optimized for verifying factual information.\n       * - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.\n       */\n      taskType: z4.enum([\n        \"SEMANTIC_SIMILARITY\",\n        \"CLASSIFICATION\",\n        \"CLUSTERING\",\n        \"RETRIEVAL_DOCUMENT\",\n        \"RETRIEVAL_QUERY\",\n        \"QUESTION_ANSWERING\",\n        \"FACT_VERIFICATION\",\n        \"CODE_RETRIEVAL_QUERY\"\n      ]).optional(),\n      /**\n       * Optional. Per-value multimodal content parts for embedding non-text\n       * content (images, video, PDF, audio). Each entry corresponds to the\n       * embedding value at the same index and its parts are merged with the\n       * text value in the request. Use `null` for entries that are text-only.\n       *\n       * The array length must match the number of values being embedded. In\n       * the case of a single embedding, the array length must be 1.\n       */\n      content: z4.array(z4.array(googleEmbeddingContentPartSchema()).min(1).nullable()).optional()\n    })\n  )\n);\n\n// src/google-generative-ai-embedding-model.ts\nvar _a;\n_a = EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER;\nvar GoogleGenerativeAIEmbeddingModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.maxEmbeddingsPerCall = 100;\n    this.supportsParallelCalls = true;\n    this[_a] = ({ providerOptions, values, startIndex, endIndex }) => {\n      var _a2;\n      const multimodalContent = (_a2 = providerOptions == null ? void 0 : providerOptions.google) == null ? void 0 : _a2.content;\n      if (!Array.isArray(multimodalContent)) {\n        return providerOptions;\n      }\n      validateMultimodalContentLength({\n        multimodalContent,\n        values\n      });\n      return {\n        ...providerOptions,\n        google: {\n          ...providerOptions == null ? void 0 : providerOptions.google,\n          content: multimodalContent.slice(startIndex, endIndex)\n        }\n      };\n    };\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doEmbed({\n    values,\n    headers,\n    abortSignal,\n    providerOptions\n  }) {\n    const googleOptions = await parseProviderOptions2({\n      provider: \"google\",\n      providerOptions,\n      schema: googleEmbeddingModelOptions\n    });\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values\n      });\n    }\n    const mergedHeaders = combineHeaders2(\n      await resolve2(this.config.headers),\n      headers\n    );\n    const multimodalContent = googleOptions == null ? void 0 : googleOptions.content;\n    validateMultimodalContentLength({ multimodalContent, values });\n    if (values.length === 1) {\n      const valueParts = multimodalContent == null ? void 0 : multimodalContent[0];\n      const textPart = values[0] ? [{ text: values[0] }] : [];\n      const parts = valueParts != null ? [...textPart, ...valueParts] : [{ text: values[0] }];\n      const {\n        responseHeaders: responseHeaders2,\n        value: response2,\n        rawValue: rawValue2\n      } = await postJsonToApi2({\n        url: `${this.config.baseURL}/models/${this.modelId}:embedContent`,\n        headers: mergedHeaders,\n        body: {\n          model: `models/${this.modelId}`,\n          content: {\n            parts\n          },\n          outputDimensionality: googleOptions == null ? void 0 : googleOptions.outputDimensionality,\n          taskType: googleOptions == null ? void 0 : googleOptions.taskType\n        },\n        failedResponseHandler: googleFailedResponseHandler,\n        successfulResponseHandler: createJsonResponseHandler2(\n          googleGenerativeAISingleEmbeddingResponseSchema\n        ),\n        abortSignal,\n        fetch: this.config.fetch\n      });\n      return {\n        warnings: [],\n        embeddings: [response2.embedding.values],\n        usage: void 0,\n        response: { headers: responseHeaders2, body: rawValue2 }\n      };\n    }\n    const {\n      responseHeaders,\n      value: response,\n      rawValue\n    } = await postJsonToApi2({\n      url: `${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`,\n      headers: mergedHeaders,\n      body: {\n        requests: values.map((value, index) => {\n          const valueParts = multimodalContent == null ? void 0 : multimodalContent[index];\n          const textPart = value ? [{ text: value }] : [];\n          return {\n            model: `models/${this.modelId}`,\n            content: {\n              role: \"user\",\n              parts: valueParts != null ? [...textPart, ...valueParts] : [{ text: value }]\n            },\n            outputDimensionality: googleOptions == null ? void 0 : googleOptions.outputDimensionality,\n            taskType: googleOptions == null ? void 0 : googleOptions.taskType\n          };\n        })\n      },\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler2(\n        googleGenerativeAITextEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      warnings: [],\n      embeddings: response.embeddings.map((item) => item.values),\n      usage: void 0,\n      response: { headers: responseHeaders, body: rawValue }\n    };\n  }\n};\nvar googleGenerativeAITextEmbeddingResponseSchema = lazySchema5(\n  () => zodSchema5(\n    z5.object({\n      embeddings: z5.array(z5.object({ values: z5.array(z5.number()) }))\n    })\n  )\n);\nvar googleGenerativeAISingleEmbeddingResponseSchema = lazySchema5(\n  () => zodSchema5(\n    z5.object({\n      embedding: z5.object({ values: z5.array(z5.number()) })\n    })\n  )\n);\nfunction validateMultimodalContentLength({\n  multimodalContent,\n  values\n}) {\n  if (multimodalContent != null && multimodalContent.length !== values.length) {\n    throw new Error(\n      `The number of multimodal content entries (${multimodalContent.length}) must match the number of values (${values.length}).`\n    );\n  }\n}\n\n// src/google-generative-ai-language-model.ts\nimport {\n  combineHeaders as combineHeaders3,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler as createJsonResponseHandler3,\n  generateId,\n  lazySchema as lazySchema7,\n  parseProviderOptions as parseProviderOptions3,\n  postJsonToApi as postJsonToApi3,\n  resolve as resolve3,\n  zodSchema as zodSchema7\n} from \"@ai-sdk/provider-utils\";\nimport { z as z8 } from \"zod/v4\";\n\n// src/continue-google-stream.ts\nfunction continueGoogleStream({\n  stream,\n  getContinuationToken,\n  continueStream\n}) {\n  let reader = stream.getReader();\n  let pendingContinuationToken;\n  return new ReadableStream({\n    async pull(controller) {\n      while (true) {\n        const { done, value } = await reader.read();\n        if (!done) {\n          if (value.success) {\n            const token = getContinuationToken(value.value);\n            if (token != null) {\n              pendingContinuationToken = token;\n            }\n          }\n          controller.enqueue(value);\n          return;\n        }\n        if (pendingContinuationToken == null) {\n          controller.close();\n          return;\n        }\n        const continuationToken = pendingContinuationToken;\n        pendingContinuationToken = void 0;\n        try {\n          reader = (await continueStream(continuationToken)).getReader();\n        } catch (error) {\n          controller.enqueue({\n            success: false,\n            error,\n            rawValue: void 0\n          });\n          controller.close();\n          return;\n        }\n      }\n    },\n    async cancel(reason) {\n      await reader.cancel(reason);\n    }\n  });\n}\n\n// src/convert-google-generative-ai-usage.ts\nfunction convertGoogleGenerativeAIUsage(usage) {\n  var _a2, _b, _c, _d;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = (_a2 = usage.promptTokenCount) != null ? _a2 : 0;\n  const candidatesTokens = (_b = usage.candidatesTokenCount) != null ? _b : 0;\n  const cachedContentTokens = (_c = usage.cachedContentTokenCount) != null ? _c : 0;\n  const thoughtsTokens = (_d = usage.thoughtsTokenCount) != null ? _d : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens - cachedContentTokens,\n      cacheRead: cachedContentTokens,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: candidatesTokens + thoughtsTokens,\n      text: candidatesTokens,\n      reasoning: thoughtsTokens\n    },\n    raw: usage\n  };\n}\nfunction addGoogleGenerativeAIUsageMetadata(a, b) {\n  if (a == null || b == null) {\n    return b != null ? b : a;\n  }\n  return {\n    ...a,\n    ...b,\n    promptTokenCount: addCounts(a.promptTokenCount, b.promptTokenCount),\n    candidatesTokenCount: addCounts(\n      a.candidatesTokenCount,\n      b.candidatesTokenCount\n    ),\n    toolUsePromptTokenCount: addCounts(\n      a.toolUsePromptTokenCount,\n      b.toolUsePromptTokenCount\n    ),\n    totalTokenCount: addCounts(a.totalTokenCount, b.totalTokenCount),\n    cachedContentTokenCount: addCounts(\n      a.cachedContentTokenCount,\n      b.cachedContentTokenCount\n    ),\n    thoughtsTokenCount: addCounts(a.thoughtsTokenCount, b.thoughtsTokenCount),\n    promptTokensDetails: addTokenDetails(\n      a.promptTokensDetails,\n      b.promptTokensDetails\n    ),\n    cacheTokensDetails: addTokenDetails(\n      a.cacheTokensDetails,\n      b.cacheTokensDetails\n    ),\n    candidatesTokensDetails: addTokenDetails(\n      a.candidatesTokensDetails,\n      b.candidatesTokensDetails\n    ),\n    toolUsePromptTokensDetails: addTokenDetails(\n      a.toolUsePromptTokensDetails,\n      b.toolUsePromptTokensDetails\n    )\n  };\n}\nfunction addCounts(a, b) {\n  return a == null && b == null ? b != null ? b : a : (a != null ? a : 0) + (b != null ? b : 0);\n}\nfunction addTokenDetails(a, b) {\n  var _a2;\n  if (a == null || b == null) {\n    return b != null ? b : a;\n  }\n  const tokenCounts = /* @__PURE__ */ new Map();\n  for (const { modality, tokenCount } of [...a, ...b]) {\n    tokenCounts.set(modality, ((_a2 = tokenCounts.get(modality)) != null ? _a2 : 0) + tokenCount);\n  }\n  return Array.from(tokenCounts, ([modality, tokenCount]) => ({\n    modality,\n    tokenCount\n  }));\n}\n\n// src/convert-json-schema-to-openapi-schema.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nvar recursiveReferenceFunctionalityPrefix = \"recursive JSON Schema reference:\";\nfunction isRecursiveJSONSchemaReferenceError(error) {\n  return UnsupportedFunctionalityError.isInstance(error) && error.functionality.startsWith(recursiveReferenceFunctionalityPrefix);\n}\nfunction convertJSONSchemaToOpenAPISchema(jsonSchema, isRoot = true) {\n  const rootSchema = typeof jsonSchema === \"object\" ? jsonSchema : void 0;\n  return convertJSONSchemaDefinition(jsonSchema, isRoot, {\n    definitions: rootSchema == null ? void 0 : rootSchema.definitions,\n    dollarDefinitions: rootSchema == null ? void 0 : rootSchema.$defs,\n    resolvingReferences: /* @__PURE__ */ new Set()\n  });\n}\nfunction convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {\n  if (jsonSchema == null) {\n    return void 0;\n  }\n  if (typeof jsonSchema === \"boolean\") {\n    return { type: \"boolean\", properties: {} };\n  }\n  if (jsonSchema.$ref != null) {\n    return convertJSONSchemaReference({\n      jsonSchema,\n      reference: jsonSchema.$ref,\n      isRoot,\n      referenceContext\n    });\n  }\n  if (isEmptyObjectSchema(jsonSchema)) {\n    if (isRoot) {\n      return void 0;\n    }\n    if (jsonSchema.description) {\n      return { type: \"object\", description: jsonSchema.description };\n    }\n    return { type: \"object\" };\n  }\n  const {\n    type,\n    description,\n    required,\n    properties,\n    items,\n    allOf,\n    anyOf,\n    oneOf,\n    format,\n    const: constValue,\n    minLength,\n    enum: enumValues\n  } = jsonSchema;\n  const result = {};\n  if (description) result.description = description;\n  if (required) result.required = required;\n  if (format) result.format = format;\n  if (type) {\n    if (Array.isArray(type)) {\n      const hasNull = type.includes(\"null\");\n      const nonNullTypes = type.filter((t) => t !== \"null\");\n      if (nonNullTypes.length === 0) {\n        result.type = \"null\";\n      } else if (nonNullTypes.length === 1) {\n        result.type = nonNullTypes[0];\n        if (hasNull) {\n          result.nullable = true;\n        }\n      } else {\n        result.anyOf = nonNullTypes.map((t) => ({ type: t }));\n        if (hasNull) {\n          result.nullable = true;\n        }\n      }\n    } else {\n      result.type = type;\n    }\n  }\n  const values = enumValues != null ? enumValues : constValue !== void 0 ? [constValue] : void 0;\n  if (values !== void 0) {\n    addEnumToSchema({ values, type, result });\n  }\n  if (properties != null) {\n    result.properties = Object.entries(properties).reduce(\n      (acc, [key, value]) => {\n        acc[key] = convertJSONSchemaDefinition(value, false, referenceContext);\n        return acc;\n      },\n      {}\n    );\n  }\n  if (items) {\n    result.items = Array.isArray(items) ? items.map(\n      (item) => convertJSONSchemaDefinition(item, false, referenceContext)\n    ) : convertJSONSchemaDefinition(items, false, referenceContext);\n  }\n  if (allOf) {\n    result.allOf = allOf.map(\n      (item) => convertJSONSchemaDefinition(item, false, referenceContext)\n    );\n  }\n  if (anyOf) {\n    if (anyOf.some(\n      (schema) => typeof schema === \"object\" && (schema == null ? void 0 : schema.type) === \"null\"\n    )) {\n      const nonNullSchemas = anyOf.filter(\n        (schema) => !(typeof schema === \"object\" && (schema == null ? void 0 : schema.type) === \"null\")\n      );\n      if (nonNullSchemas.length === 1) {\n        const converted = convertJSONSchemaDefinition(\n          nonNullSchemas[0],\n          false,\n          referenceContext\n        );\n        if (typeof converted === \"object\") {\n          result.nullable = true;\n          Object.assign(result, converted);\n        }\n      } else {\n        result.anyOf = nonNullSchemas.map(\n          (item) => convertJSONSchemaDefinition(item, false, referenceContext)\n        );\n        result.nullable = true;\n      }\n    } else {\n      result.anyOf = anyOf.map(\n        (item) => convertJSONSchemaDefinition(item, false, referenceContext)\n      );\n    }\n  }\n  if (oneOf) {\n    result.oneOf = oneOf.map(\n      (item) => convertJSONSchemaDefinition(item, false, referenceContext)\n    );\n  }\n  if (minLength !== void 0) {\n    result.minLength = minLength;\n  }\n  return result;\n}\nfunction addEnumToSchema({\n  values,\n  type,\n  result\n}) {\n  const nullable = Array.isArray(type) && type.includes(\"null\") || type === void 0 && values.includes(null);\n  const enumValues = nullable ? values.filter((value) => value !== null) : values;\n  if (values.length > 0 && values.every((value) => value === null)) {\n    const typeAllowsNull = type === void 0 || type === \"null\" || Array.isArray(type) && type.includes(\"null\");\n    if (typeAllowsNull) {\n      result.type = \"null\";\n      if (Array.isArray(type)) {\n        delete result.anyOf;\n      }\n      return;\n    }\n  }\n  const enumType = getEnumType({ values: enumValues, type });\n  if (enumType === void 0) {\n    throw new UnsupportedFunctionalityError({\n      functionality: \"JSON Schema enum with mixed or unsupported values\",\n      message: \"Google does not support this JSON Schema enum. Enum values must share one supported primitive type and match the schema type.\"\n    });\n  }\n  result.type = enumType;\n  if (Array.isArray(type)) {\n    delete result.anyOf;\n  }\n  if (nullable) {\n    result.nullable = true;\n  }\n  if (enumType === \"string\") {\n    result.enum = enumValues;\n  } else {\n    result.format = \"enum\";\n    result.enum = enumValues.map(String);\n  }\n}\nfunction getEnumType({\n  values,\n  type\n}) {\n  if (values.length === 0) {\n    return void 0;\n  }\n  const typeAllows = (enumType) => type === void 0 || type === enumType || Array.isArray(type) && type.includes(enumType);\n  if (typeAllows(\"string\") && values.every((value) => typeof value === \"string\")) {\n    return \"string\";\n  }\n  if ((typeAllows(\"number\") || typeAllows(\"integer\")) && values.every((value) => typeof value === \"number\" && Number.isFinite(value))) {\n    if (typeAllows(\"number\")) {\n      return \"number\";\n    }\n    if (values.every((value) => Number.isInteger(value))) {\n      return \"integer\";\n    }\n  }\n  if (typeAllows(\"boolean\") && values.every((value) => typeof value === \"boolean\")) {\n    return \"boolean\";\n  }\n  return void 0;\n}\nfunction convertJSONSchemaReference({\n  jsonSchema,\n  reference,\n  isRoot,\n  referenceContext\n}) {\n  const { definition, referenceKey } = getReferencedDefinition(\n    reference,\n    referenceContext\n  );\n  if (referenceContext.resolvingReferences.has(referenceKey)) {\n    throw new UnsupportedFunctionalityError({\n      functionality: `${recursiveReferenceFunctionalityPrefix} ${reference}`,\n      message: \"Google schema conversion does not support recursive JSON Schema references.\"\n    });\n  }\n  const resolvingReferences = new Set(referenceContext.resolvingReferences);\n  resolvingReferences.add(referenceKey);\n  const { $ref: _reference, ...siblingSchema } = jsonSchema;\n  const resolvedSchema = typeof definition === \"boolean\" ? definition ? siblingSchema : false : { ...definition, ...siblingSchema };\n  return convertJSONSchemaDefinition(resolvedSchema, isRoot, {\n    ...referenceContext,\n    resolvingReferences\n  });\n}\nfunction getReferencedDefinition(reference, referenceContext) {\n  const definitionSources = [\n    {\n      prefix: \"#/$defs/\",\n      definitions: referenceContext.dollarDefinitions\n    },\n    {\n      prefix: \"#/definitions/\",\n      definitions: referenceContext.definitions\n    }\n  ];\n  const source = definitionSources.find(\n    ({ prefix }) => reference.startsWith(prefix)\n  );\n  const encodedDefinitionName = source ? reference.slice(source.prefix.length) : void 0;\n  if (source == null || encodedDefinitionName == null || encodedDefinitionName.length === 0 || encodedDefinitionName.includes(\"/\")) {\n    throwUnsupportedReference(reference);\n  }\n  let decodedDefinitionName;\n  try {\n    decodedDefinitionName = decodeURIComponent(encodedDefinitionName);\n  } catch (e) {\n    throwUnsupportedReference(reference);\n  }\n  if (decodedDefinitionName.includes(\"/\") || /~(?![01])/u.test(decodedDefinitionName) || source.definitions == null) {\n    throwUnsupportedReference(reference);\n  }\n  const definitionName = decodedDefinitionName.replace(\n    /~[01]/g,\n    (match) => match === \"~1\" ? \"/\" : \"~\"\n  );\n  if (!Object.prototype.hasOwnProperty.call(source.definitions, definitionName)) {\n    throwUnsupportedReference(reference);\n  }\n  return {\n    definition: source.definitions[definitionName],\n    referenceKey: `${source.prefix}${definitionName}`\n  };\n}\nfunction throwUnsupportedReference(reference) {\n  throw new UnsupportedFunctionalityError({\n    functionality: `JSON Schema reference: ${reference}`,\n    message: \"Google schema conversion only supports references to direct children of root-level $defs or definitions.\"\n  });\n}\nfunction isEmptyObjectSchema(jsonSchema) {\n  return jsonSchema != null && typeof jsonSchema === \"object\" && jsonSchema.type === \"object\" && (jsonSchema.properties == null || Object.keys(jsonSchema.properties).length === 0) && !jsonSchema.additionalProperties;\n}\n\n// src/convert-to-google-generative-ai-messages.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nimport {\n  convertToBase64 as convertToBase642,\n  isUrlSupported,\n  secureJsonParse\n} from \"@ai-sdk/provider-utils\";\n\n// src/google-generative-ai-prompt.ts\nimport { z as z6 } from \"zod/v4\";\nvar googleVideoMetadataSchema = z6.object({\n  /** Start offset as a duration in seconds, e.g. `'3.5s'`. */\n  startOffset: z6.string().optional(),\n  /** End offset as a duration in seconds, e.g. `'10s'`. */\n  endOffset: z6.string().optional(),\n  /** Frames per second in the range (0, 24]. Defaults to 1. */\n  fps: z6.number().gt(0).max(24).optional()\n});\n\n// src/convert-to-google-generative-ai-messages.ts\nvar SKIP_THOUGHT_SIGNATURE_VALIDATOR = \"skip_thought_signature_validator\";\nfunction getGoogleProviderOptions(providerOptions, providerOptionsName) {\n  const namespaces = [\n    providerOptionsName,\n    \"google\",\n    \"googleVertex\",\n    \"vertex\"\n  ].filter((namespace, index, allNamespaces) => {\n    return allNamespaces.indexOf(namespace) === index;\n  });\n  for (const namespace of namespaces) {\n    const options = providerOptions == null ? void 0 : providerOptions[namespace];\n    if (options != null) {\n      return options;\n    }\n  }\n}\nvar dataUrlRegex = /^data:([^;,]+);base64,(.+)$/s;\nfunction parseBase64DataUrl(value) {\n  const match = dataUrlRegex.exec(value);\n  if (match == null) {\n    return void 0;\n  }\n  return {\n    mediaType: match[1],\n    data: match[2]\n  };\n}\nfunction convertUrlToolResultPart(url, mediaType, supportedFunctionResponseUrls) {\n  const parsedDataUrl = parseBase64DataUrl(url);\n  if (parsedDataUrl != null) {\n    return {\n      inlineData: {\n        mimeType: parsedDataUrl.mediaType,\n        data: parsedDataUrl.data\n      }\n    };\n  }\n  return mediaType != null && isUrlSupported({\n    url,\n    mediaType,\n    supportedUrls: supportedFunctionResponseUrls\n  }) ? {\n    fileData: {\n      mimeType: mediaType,\n      fileUri: url\n    }\n  } : void 0;\n}\nfunction appendToolResultParts(parts, toolName, outputValue, toolCallId, includeFunctionCallIds = true, supportedFunctionResponseUrls = {}) {\n  const functionResponseParts = [];\n  const responseTextParts = [];\n  for (const contentPart of outputValue) {\n    switch (contentPart.type) {\n      case \"text\": {\n        responseTextParts.push(contentPart.text);\n        break;\n      }\n      case \"image-data\":\n      case \"file-data\": {\n        functionResponseParts.push({\n          inlineData: {\n            mimeType: contentPart.mediaType,\n            data: contentPart.data\n          }\n        });\n        break;\n      }\n      case \"image-url\":\n      case \"file-url\": {\n        const functionResponsePart = convertUrlToolResultPart(\n          contentPart.url,\n          contentPart.mediaType,\n          supportedFunctionResponseUrls\n        );\n        if (functionResponsePart != null) {\n          functionResponseParts.push(functionResponsePart);\n        } else {\n          responseTextParts.push(JSON.stringify(contentPart));\n        }\n        break;\n      }\n      default: {\n        responseTextParts.push(JSON.stringify(contentPart));\n        break;\n      }\n    }\n  }\n  parts.push({\n    functionResponse: {\n      ...includeFunctionCallIds && toolCallId != null ? { id: toolCallId } : {},\n      name: toolName,\n      response: {\n        name: toolName,\n        content: responseTextParts.length > 0 ? responseTextParts.join(\"\\n\") : \"Tool executed successfully.\"\n      },\n      ...functionResponseParts.length > 0 ? { parts: functionResponseParts } : {}\n    }\n  });\n}\nfunction appendLegacyToolResultParts(parts, toolName, outputValue, toolCallId, includeFunctionCallIds = true) {\n  for (const contentPart of outputValue) {\n    switch (contentPart.type) {\n      case \"text\":\n        parts.push({\n          functionResponse: {\n            ...includeFunctionCallIds && toolCallId != null ? { id: toolCallId } : {},\n            name: toolName,\n            response: {\n              name: toolName,\n              content: contentPart.text\n            }\n          }\n        });\n        break;\n      case \"image-data\":\n      case \"file-data\": {\n        const topLevelMediaType = String(contentPart.mediaType).split(\"/\")[0];\n        parts.push(\n          {\n            inlineData: {\n              mimeType: String(contentPart.mediaType),\n              data: String(contentPart.data)\n            }\n          },\n          {\n            text: `Tool executed successfully and returned this ${topLevelMediaType === \"image\" ? \"image\" : \"file\"} as a response`\n          }\n        );\n        break;\n      }\n      default:\n        parts.push({ text: JSON.stringify(contentPart) });\n        break;\n    }\n  }\n}\nfunction convertToGoogleGenerativeAIMessages(prompt, options) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h;\n  const systemInstructionParts = [];\n  const contents = [];\n  let systemMessagesAllowed = true;\n  const isGemmaModel = (_a2 = options == null ? void 0 : options.isGemmaModel) != null ? _a2 : false;\n  const isGemini3Model = (_b = options == null ? void 0 : options.isGemini3Model) != null ? _b : false;\n  const providerOptionsName = (_c = options == null ? void 0 : options.providerOptionsName) != null ? _c : \"google\";\n  const supportsFunctionResponseParts = (_d = options == null ? void 0 : options.supportsFunctionResponseParts) != null ? _d : true;\n  const onWarning = options == null ? void 0 : options.onWarning;\n  const includeFunctionCallIds = (_e = options == null ? void 0 : options.includeFunctionCallIds) != null ? _e : true;\n  const supportedFunctionResponseUrls = (_f = options == null ? void 0 : options.supportedFunctionResponseUrls) != null ? _f : {};\n  let sentinelInjected = false;\n  const missingSignatureToolNames = [];\n  const injectSkipSignature = (toolName) => {\n    missingSignatureToolNames.push(toolName);\n    sentinelInjected = true;\n    return SKIP_THOUGHT_SIGNATURE_VALIDATOR;\n  };\n  for (const { role, content } of prompt) {\n    switch (role) {\n      case \"system\": {\n        if (!systemMessagesAllowed) {\n          throw new UnsupportedFunctionalityError2({\n            functionality: \"system messages are only supported at the beginning of the conversation\"\n          });\n        }\n        systemInstructionParts.push({ text: content });\n        break;\n      }\n      case \"user\": {\n        systemMessagesAllowed = false;\n        const parts = [];\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\": {\n              parts.push({ text: part.text });\n              break;\n            }\n            case \"file\": {\n              const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n              const rawVideoMetadata = (_g = getGoogleProviderOptions(\n                part.providerOptions,\n                providerOptionsName\n              )) == null ? void 0 : _g.videoMetadata;\n              const videoMetadata = rawVideoMetadata == null ? void 0 : googleVideoMetadataSchema.parse(rawVideoMetadata);\n              parts.push(\n                part.data instanceof URL ? {\n                  fileData: {\n                    mimeType: mediaType,\n                    fileUri: part.data.protocol === \"gs:\" && part.originalUrl != null ? part.originalUrl : part.data.toString()\n                  },\n                  ...videoMetadata != null ? { videoMetadata } : {}\n                } : {\n                  inlineData: {\n                    mimeType: mediaType,\n                    data: convertToBase642(part.data)\n                  },\n                  ...videoMetadata != null ? { videoMetadata } : {}\n                }\n              );\n              break;\n            }\n          }\n        }\n        contents.push({ role: \"user\", parts });\n        break;\n      }\n      case \"assistant\": {\n        systemMessagesAllowed = false;\n        let modelResponseHasSignedFunctionCall = false;\n        contents.push({\n          role: \"model\",\n          parts: content.map((part) => {\n            const providerOpts = getGoogleProviderOptions(\n              part.providerOptions,\n              providerOptionsName\n            );\n            const thoughtSignature = (providerOpts == null ? void 0 : providerOpts.thoughtSignature) != null ? String(providerOpts.thoughtSignature) : void 0;\n            switch (part.type) {\n              case \"text\": {\n                return part.text.length === 0 ? void 0 : {\n                  text: part.text,\n                  thoughtSignature\n                };\n              }\n              case \"reasoning\": {\n                return part.text.length === 0 ? void 0 : {\n                  text: part.text,\n                  thought: true,\n                  thoughtSignature\n                };\n              }\n              case \"file\": {\n                if (part.data instanceof URL) {\n                  throw new UnsupportedFunctionalityError2({\n                    functionality: \"File data URLs in assistant messages are not supported\"\n                  });\n                }\n                return {\n                  inlineData: {\n                    mimeType: part.mediaType,\n                    data: convertToBase642(part.data)\n                  },\n                  ...(providerOpts == null ? void 0 : providerOpts.thought) === true ? { thought: true } : {},\n                  thoughtSignature\n                };\n              }\n              case \"tool-call\": {\n                const serverToolCallId = (providerOpts == null ? void 0 : providerOpts.serverToolCallId) != null ? String(providerOpts.serverToolCallId) : void 0;\n                const serverToolType = (providerOpts == null ? void 0 : providerOpts.serverToolType) != null ? String(providerOpts.serverToolType) : void 0;\n                const isServerToolCall = serverToolCallId != null && serverToolType != null;\n                const shouldSkipMissingSignatureMitigation = (\n                  // Gemini 3 returns a single signature for a parallel\n                  // function-call response on the first standard function\n                  // call. Subsequent standard function calls in the same\n                  // model response legitimately have no signature.\n                  !isServerToolCall && thoughtSignature == null && modelResponseHasSignedFunctionCall\n                );\n                const effectiveThoughtSignature = thoughtSignature != null ? thoughtSignature : isGemini3Model && !shouldSkipMissingSignatureMitigation ? injectSkipSignature(part.toolName) : void 0;\n                if (!isServerToolCall && thoughtSignature != null) {\n                  modelResponseHasSignedFunctionCall = true;\n                }\n                if (isServerToolCall) {\n                  return {\n                    toolCall: {\n                      toolType: serverToolType,\n                      args: typeof part.input === \"string\" ? secureJsonParse(part.input) : part.input,\n                      id: serverToolCallId\n                    },\n                    thoughtSignature: effectiveThoughtSignature\n                  };\n                }\n                return {\n                  functionCall: {\n                    ...includeFunctionCallIds && part.toolCallId != null ? { id: part.toolCallId } : {},\n                    name: part.toolName,\n                    args: part.input\n                  },\n                  thoughtSignature: effectiveThoughtSignature\n                };\n              }\n              case \"tool-result\": {\n                const serverToolCallId = (providerOpts == null ? void 0 : providerOpts.serverToolCallId) != null ? String(providerOpts.serverToolCallId) : void 0;\n                const serverToolType = (providerOpts == null ? void 0 : providerOpts.serverToolType) != null ? String(providerOpts.serverToolType) : void 0;\n                if (serverToolCallId && serverToolType) {\n                  return {\n                    toolResponse: {\n                      toolType: serverToolType,\n                      response: part.output.type === \"json\" ? part.output.value : {},\n                      id: serverToolCallId\n                    },\n                    thoughtSignature\n                  };\n                }\n                return void 0;\n              }\n            }\n          }).filter((part) => part !== void 0)\n        });\n        break;\n      }\n      case \"tool\": {\n        systemMessagesAllowed = false;\n        const parts = [];\n        for (const part of content) {\n          if (part.type === \"tool-approval-response\") {\n            continue;\n          }\n          const partProviderOpts = getGoogleProviderOptions(\n            part.providerOptions,\n            providerOptionsName\n          );\n          const serverToolCallId = (partProviderOpts == null ? void 0 : partProviderOpts.serverToolCallId) != null ? String(partProviderOpts.serverToolCallId) : void 0;\n          const serverToolType = (partProviderOpts == null ? void 0 : partProviderOpts.serverToolType) != null ? String(partProviderOpts.serverToolType) : void 0;\n          if (serverToolCallId && serverToolType) {\n            const serverThoughtSignature = (partProviderOpts == null ? void 0 : partProviderOpts.thoughtSignature) != null ? String(partProviderOpts.thoughtSignature) : void 0;\n            if (contents.length > 0) {\n              const lastContent = contents[contents.length - 1];\n              if (lastContent.role === \"model\") {\n                lastContent.parts.push({\n                  toolResponse: {\n                    toolType: serverToolType,\n                    response: part.output.type === \"json\" ? part.output.value : {},\n                    id: serverToolCallId\n                  },\n                  thoughtSignature: serverThoughtSignature\n                });\n                continue;\n              }\n            }\n          }\n          const output = part.output;\n          if (output.type === \"content\") {\n            if (supportsFunctionResponseParts) {\n              appendToolResultParts(\n                parts,\n                part.toolName,\n                output.value,\n                part.toolCallId,\n                includeFunctionCallIds,\n                supportedFunctionResponseUrls\n              );\n            } else {\n              appendLegacyToolResultParts(\n                parts,\n                part.toolName,\n                output.value,\n                part.toolCallId,\n                includeFunctionCallIds\n              );\n            }\n          } else {\n            parts.push({\n              functionResponse: {\n                ...includeFunctionCallIds && part.toolCallId != null ? { id: part.toolCallId } : {},\n                name: part.toolName,\n                response: {\n                  name: part.toolName,\n                  content: output.type === \"execution-denied\" ? (_h = output.reason) != null ? _h : \"Tool call execution denied.\" : output.value\n                }\n              }\n            });\n          }\n        }\n        contents.push({\n          role: \"user\",\n          parts\n        });\n        break;\n      }\n    }\n  }\n  if (isGemmaModel && systemInstructionParts.length > 0 && contents.length > 0 && contents[0].role === \"user\") {\n    const systemText = systemInstructionParts.map((part) => part.text).join(\"\\n\\n\");\n    contents[0].parts.unshift({ text: systemText + \"\\n\\n\" });\n  }\n  if (sentinelInjected && onWarning != null) {\n    const uniqueToolNames = Array.from(new Set(missingSignatureToolNames));\n    onWarning({\n      type: \"other\",\n      message: `Replayed ${missingSignatureToolNames.length} \\`functionCall\\` part(s) for a Gemini 3 model without a \\`thoughtSignature\\` (tools: ${uniqueToolNames.map((name) => `\\`${name}\\``).join(\", \")}). Injected the documented \\`skip_thought_signature_validator\\` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops \\`providerOptions.google.thoughtSignature\\` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.`\n    });\n  }\n  return {\n    systemInstruction: systemInstructionParts.length > 0 && !isGemmaModel ? { parts: systemInstructionParts } : void 0,\n    contents\n  };\n}\n\n// src/download-tool-result-files.ts\nimport {\n  convertUint8ArrayToBase64,\n  downloadBlob,\n  isUrlSupported as isUrlSupported2\n} from \"@ai-sdk/provider-utils\";\nasync function downloadToolResultFiles(prompt, {\n  abortSignal,\n  supportedUrls = {}\n}) {\n  async function downloadOutput(output) {\n    if (output.type !== \"content\") {\n      return output;\n    }\n    return {\n      ...output,\n      value: await Promise.all(\n        output.value.map(async (part) => {\n          var _a2;\n          if (part.type !== \"file-url\" && part.type !== \"image-url\") {\n            return part;\n          }\n          if (part.type === \"file-url\" && part.mediaType != null && isUrlSupported2({\n            url: part.url,\n            mediaType: part.mediaType,\n            supportedUrls\n          })) {\n            return part;\n          }\n          const blob = await downloadBlob(part.url, { abortSignal });\n          return {\n            type: part.type === \"file-url\" ? \"file-data\" : \"image-data\",\n            data: convertUint8ArrayToBase64(\n              new Uint8Array(await blob.arrayBuffer())\n            ),\n            mediaType: blob.type || (part.type === \"file-url\" ? (_a2 = part.mediaType) != null ? _a2 : \"application/octet-stream\" : \"image/*\"),\n            providerOptions: part.providerOptions\n          };\n        })\n      )\n    };\n  }\n  return Promise.all(\n    prompt.map(async (message) => {\n      switch (message.role) {\n        case \"assistant\":\n          return {\n            ...message,\n            content: await Promise.all(\n              message.content.map(\n                async (part) => part.type === \"tool-result\" ? { ...part, output: await downloadOutput(part.output) } : part\n              )\n            )\n          };\n        case \"tool\":\n          return {\n            ...message,\n            content: await Promise.all(\n              message.content.map(\n                async (part) => part.type === \"tool-result\" ? { ...part, output: await downloadOutput(part.output) } : part\n              )\n            )\n          };\n        default:\n          return message;\n      }\n    })\n  );\n}\n\n// src/get-model-path.ts\nfunction getModelPath(modelId) {\n  return modelId.includes(\"/\") ? modelId : `models/${modelId}`;\n}\n\n// src/google-generative-ai-options.ts\nimport {\n  lazySchema as lazySchema6,\n  zodSchema as zodSchema6\n} from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\nvar googleLanguageModelOptions = lazySchema6(\n  () => zodSchema6(\n    z7.object({\n      responseModalities: z7.array(z7.enum([\"TEXT\", \"IMAGE\"])).optional(),\n      thinkingConfig: z7.object({\n        thinkingBudget: z7.number().optional(),\n        includeThoughts: z7.boolean().optional(),\n        // https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level\n        thinkingLevel: z7.enum([\"minimal\", \"low\", \"medium\", \"high\"]).optional()\n      }).optional(),\n      /**\n       * Optional.\n       * The name of the cached content used as context to serve the prediction.\n       * Format: cachedContents/{cachedContent}\n       */\n      cachedContent: z7.string().optional(),\n      /**\n       * Optional. Enable structured output. Default is true.\n       *\n       * This is useful when the JSON Schema contains elements that are\n       * not supported by the OpenAPI schema version that\n       * Google Generative AI uses. You can use this to disable\n       * structured outputs if you need to.\n       */\n      structuredOutputs: z7.boolean().optional(),\n      /**\n       * Optional. A list of unique safety settings for blocking unsafe content.\n       */\n      safetySettings: z7.array(\n        z7.object({\n          category: z7.enum([\n            \"HARM_CATEGORY_UNSPECIFIED\",\n            \"HARM_CATEGORY_HATE_SPEECH\",\n            \"HARM_CATEGORY_DANGEROUS_CONTENT\",\n            \"HARM_CATEGORY_HARASSMENT\",\n            \"HARM_CATEGORY_SEXUALLY_EXPLICIT\",\n            \"HARM_CATEGORY_CIVIC_INTEGRITY\"\n          ]),\n          threshold: z7.enum([\n            \"HARM_BLOCK_THRESHOLD_UNSPECIFIED\",\n            \"BLOCK_LOW_AND_ABOVE\",\n            \"BLOCK_MEDIUM_AND_ABOVE\",\n            \"BLOCK_ONLY_HIGH\",\n            \"BLOCK_NONE\",\n            \"OFF\"\n          ])\n        })\n      ).optional(),\n      threshold: z7.enum([\n        \"HARM_BLOCK_THRESHOLD_UNSPECIFIED\",\n        \"BLOCK_LOW_AND_ABOVE\",\n        \"BLOCK_MEDIUM_AND_ABOVE\",\n        \"BLOCK_ONLY_HIGH\",\n        \"BLOCK_NONE\",\n        \"OFF\"\n      ]).optional(),\n      /**\n       * Optional. Enables timestamp understanding for audio-only files.\n       *\n       * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding\n       */\n      audioTimestamp: z7.boolean().optional(),\n      /**\n       * Optional. Defines labels used in billing reports. Available on Vertex AI only.\n       *\n       * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls\n       */\n      labels: z7.record(z7.string(), z7.string()).optional(),\n      /**\n       * Optional. If specified, the media resolution specified will be used.\n       *\n       * https://ai.google.dev/api/generate-content#MediaResolution\n       */\n      mediaResolution: z7.enum([\n        \"MEDIA_RESOLUTION_UNSPECIFIED\",\n        \"MEDIA_RESOLUTION_LOW\",\n        \"MEDIA_RESOLUTION_MEDIUM\",\n        \"MEDIA_RESOLUTION_HIGH\"\n      ]).optional(),\n      /**\n       * Optional. Configures the image generation aspect ratio for Gemini models.\n       *\n       * https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios\n       */\n      imageConfig: z7.object({\n        aspectRatio: z7.enum([\n          \"1:1\",\n          \"2:3\",\n          \"3:2\",\n          \"3:4\",\n          \"4:3\",\n          \"4:5\",\n          \"5:4\",\n          \"9:16\",\n          \"16:9\",\n          \"21:9\",\n          \"1:8\",\n          \"8:1\",\n          \"1:4\",\n          \"4:1\"\n        ]).optional(),\n        imageSize: z7.enum([\"1K\", \"2K\", \"4K\", \"512\"]).optional(),\n        /**\n         * Optional. Controls the generation of people in images.\n         * Vertex AI only.\n         */\n        personGeneration: z7.enum([\n          \"PERSON_GENERATION_UNSPECIFIED\",\n          \"ALLOW_ALL\",\n          \"ALLOW_ADULT\",\n          \"ALLOW_NONE\"\n        ]).optional(),\n        /**\n         * Optional. Controls whether generation of prominent people\n         * (celebrities) is allowed. When set together with\n         * `personGeneration`, `personGeneration` takes precedence.\n         * Vertex AI only.\n         *\n         * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig\n         */\n        prominentPeople: z7.enum([\n          \"PROMINENT_PEOPLE_UNSPECIFIED\",\n          \"ALLOW_PROMINENT_PEOPLE\",\n          \"BLOCK_PROMINENT_PEOPLE\"\n        ]).optional(),\n        /**\n         * Optional. The image output format for generated images.\n         * Vertex AI only.\n         */\n        imageOutputOptions: z7.object({\n          mimeType: z7.enum([\"image/jpeg\", \"image/png\"]).optional(),\n          compressionQuality: z7.number().optional()\n        }).optional()\n      }).optional(),\n      /**\n       * Optional. Configuration for grounding retrieval.\n       * Used to provide location context for Google Maps and Google Search grounding.\n       *\n       * https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps\n       */\n      retrievalConfig: z7.object({\n        latLng: z7.object({\n          latitude: z7.number(),\n          longitude: z7.number()\n        }).optional()\n      }).optional(),\n      /**\n       * Optional. When set to true, function call arguments will be streamed\n       * incrementally via partialArgs in streaming responses. Only supported\n       * on the Vertex AI API (not the Gemini API) and only for Gemini 3+\n       * models.\n       *\n       * @default false\n       *\n       * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc\n       */\n      streamFunctionCallArguments: z7.boolean().optional(),\n      /**\n       * Optional. The service tier to use for the request. Sent as the\n       * `serviceTier` body field. Gemini API only.\n       */\n      serviceTier: z7.enum([\"standard\", \"flex\", \"priority\"]).optional(),\n      /**\n       * Optional. Resumes a response that stopped with `MAX_TOKENS` because it\n       * used up its `maxOutputTokens` budget (Gemini 4 long decode). Pass the\n       * `continuationToken` from the previous response's provider metadata\n       * together with the original prompt and a higher `maxOutputTokens` (the\n       * budget is cumulative across requests). Requests that reach the\n       * per-request cap while budget remains (`CONTINUATION`) are continued\n       * automatically. Sent as the `continuationToken` body field.\n       */\n      continuationToken: z7.string().optional(),\n      /**\n       * Optional. Vertex AI only. Sent as the\n       * `X-Vertex-AI-LLM-Shared-Request-Type` request header to select a\n       * shared (PayGo) tier. With Provisioned Throughput allocated and\n       * `requestType` unset, the request falls back to this tier only if\n       * PT capacity is exhausted.\n       *\n       * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo\n       * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/flex-paygo\n       */\n      sharedRequestType: z7.enum([\"priority\", \"flex\", \"standard\"]).optional(),\n      /**\n       * Optional. Vertex AI only. Sent as the `X-Vertex-AI-LLM-Request-Type`\n       * request header. Set to `'shared'` together with `sharedRequestType`\n       * to bypass Provisioned Throughput entirely.\n       *\n       * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo\n       */\n      requestType: z7.enum([\"shared\"]).optional()\n    })\n  )\n);\n\n// src/google-model-capabilities.ts\nvar gemini1ModelPattern = /(^|\\/)gemini-1(?:[.-]|$)/i;\nvar gemini2ModelPattern = /(^|\\/)gemini-2(?:[.-]|$)/i;\nvar gemini25ModelPattern = /(^|\\/)gemini-2\\.5(?:[.-]|$)/i;\nvar geminiModelPattern = /(^|\\/)gemini-/i;\nfunction isKnownPreGemini2Model(modelId) {\n  return gemini1ModelPattern.test(modelId) || /(^|\\/)gemini-pro(?:-vision)?$/i.test(modelId) || /(^|\\/)gemini-robotics-er-1\\.5(?:[.-]|$)/i.test(modelId);\n}\nfunction getGoogleModelCapabilities(modelId) {\n  const isGeminiModel2 = geminiModelPattern.test(modelId);\n  const isGemini2Model = gemini2ModelPattern.test(modelId);\n  const isKnownPreGemini2 = isKnownPreGemini2Model(modelId);\n  const isKnownOlderModel = isKnownPreGemini2 || isGemini2Model;\n  const usesGemini3Features = isGeminiModel2 && !isKnownOlderModel;\n  return {\n    supportsGemini2Tools: isGeminiModel2 && !isKnownPreGemini2 || modelId.toLowerCase().includes(\"nano-banana\"),\n    supportsFileSearch: gemini25ModelPattern.test(modelId) || usesGemini3Features,\n    usesGemini3Features\n  };\n}\n\n// src/google-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError3\n} from \"@ai-sdk/provider\";\nfunction prepareTools({\n  tools,\n  toolChoice,\n  modelId,\n  isVertexProvider = false\n}) {\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  const { supportsGemini2Tools, supportsFileSearch, usesGemini3Features } = getGoogleModelCapabilities(modelId);\n  if (tools == null) {\n    return { tools: void 0, toolConfig: void 0, toolWarnings };\n  }\n  const hasFunctionTools = tools.some((tool) => tool.type === \"function\");\n  const hasProviderTools = tools.some((tool) => tool.type === \"provider\");\n  if (hasFunctionTools && hasProviderTools && !usesGemini3Features) {\n    toolWarnings.push({\n      type: \"unsupported\",\n      feature: `combination of function and provider-defined tools`\n    });\n  }\n  if (hasProviderTools) {\n    const googleTools2 = [];\n    const ProviderTools = tools.filter((tool) => tool.type === \"provider\");\n    ProviderTools.forEach((tool) => {\n      switch (tool.id) {\n        case \"google.google_search\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({ googleSearch: { ...tool.args } });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"Google Search requires Gemini 2.0 or newer.\"\n            });\n          }\n          break;\n        case \"google.enterprise_web_search\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({ enterpriseWebSearch: {} });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"Enterprise Web Search requires Gemini 2.0 or newer.\"\n            });\n          }\n          break;\n        case \"google.url_context\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({ urlContext: {} });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"The URL context tool is not supported with other Gemini models than Gemini 2.\"\n            });\n          }\n          break;\n        case \"google.code_execution\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({ codeExecution: {} });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"The code execution tool is not supported with other Gemini models than Gemini 2.\"\n            });\n          }\n          break;\n        case \"google.file_search\":\n          if (supportsFileSearch) {\n            googleTools2.push({ fileSearch: { ...tool.args } });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"The file search tool is only supported with Gemini 2.5 models and Gemini 3 models.\"\n            });\n          }\n          break;\n        case \"google.vertex_rag_store\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({\n              retrieval: {\n                vertex_rag_store: {\n                  rag_resources: {\n                    rag_corpus: tool.args.ragCorpus\n                  },\n                  similarity_top_k: tool.args.topK\n                }\n              }\n            });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"The RAG store tool is not supported with other Gemini models than Gemini 2.\"\n            });\n          }\n          break;\n        case \"google.google_maps\":\n          if (supportsGemini2Tools) {\n            googleTools2.push({ googleMaps: {} });\n          } else {\n            toolWarnings.push({\n              type: \"unsupported\",\n              feature: `provider-defined tool ${tool.id}`,\n              details: \"The Google Maps grounding tool is not supported with Gemini models other than Gemini 2 or newer.\"\n            });\n          }\n          break;\n        default:\n          toolWarnings.push({\n            type: \"unsupported\",\n            feature: `provider-defined tool ${tool.id}`\n          });\n          break;\n      }\n    });\n    if (hasFunctionTools && usesGemini3Features && googleTools2.length > 0) {\n      const functionDeclarations2 = [];\n      for (const tool of tools) {\n        if (tool.type === \"function\") {\n          functionDeclarations2.push(prepareFunctionDeclaration(tool));\n        }\n      }\n      const combinedToolConfig = {\n        functionCallingConfig: { mode: \"VALIDATED\" },\n        ...!isVertexProvider && {\n          includeServerSideToolInvocations: true\n        }\n      };\n      if (toolChoice != null) {\n        switch (toolChoice.type) {\n          case \"auto\":\n            break;\n          case \"none\":\n            combinedToolConfig.functionCallingConfig = { mode: \"NONE\" };\n            break;\n          case \"required\":\n            combinedToolConfig.functionCallingConfig = { mode: \"ANY\" };\n            break;\n          case \"tool\":\n            combinedToolConfig.functionCallingConfig = {\n              mode: \"ANY\",\n              allowedFunctionNames: [toolChoice.toolName]\n            };\n            break;\n        }\n      }\n      return {\n        tools: [...googleTools2, { functionDeclarations: functionDeclarations2 }],\n        toolConfig: combinedToolConfig,\n        toolWarnings\n      };\n    }\n    return {\n      tools: googleTools2.length > 0 ? googleTools2 : void 0,\n      toolConfig: void 0,\n      toolWarnings\n    };\n  }\n  const functionDeclarations = [];\n  let hasStrictTools = false;\n  for (const tool of tools) {\n    switch (tool.type) {\n      case \"function\":\n        functionDeclarations.push(prepareFunctionDeclaration(tool));\n        if (tool.strict === true) {\n          hasStrictTools = true;\n        }\n        break;\n      default:\n        toolWarnings.push({\n          type: \"unsupported\",\n          feature: `function tool ${tool.name}`\n        });\n        break;\n    }\n  }\n  if (toolChoice == null) {\n    return {\n      tools: [{ functionDeclarations }],\n      toolConfig: hasStrictTools ? { functionCallingConfig: { mode: \"VALIDATED\" } } : void 0,\n      toolWarnings\n    };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n      return {\n        tools: [{ functionDeclarations }],\n        toolConfig: {\n          functionCallingConfig: {\n            mode: hasStrictTools ? \"VALIDATED\" : \"AUTO\"\n          }\n        },\n        toolWarnings\n      };\n    case \"none\":\n      return {\n        tools: [{ functionDeclarations }],\n        toolConfig: { functionCallingConfig: { mode: \"NONE\" } },\n        toolWarnings\n      };\n    case \"required\":\n      return {\n        tools: [{ functionDeclarations }],\n        toolConfig: {\n          functionCallingConfig: {\n            mode: \"ANY\"\n          }\n        },\n        toolWarnings\n      };\n    case \"tool\":\n      return {\n        tools: [{ functionDeclarations }],\n        toolConfig: {\n          functionCallingConfig: {\n            mode: \"ANY\",\n            allowedFunctionNames: [toolChoice.toolName]\n          }\n        },\n        toolWarnings\n      };\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError3({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\nfunction prepareFunctionDeclaration(tool) {\n  var _a2;\n  const declaration = {\n    name: tool.name,\n    description: (_a2 = tool.description) != null ? _a2 : \"\"\n  };\n  try {\n    return {\n      ...declaration,\n      parameters: convertJSONSchemaToOpenAPISchema(tool.inputSchema)\n    };\n  } catch (error) {\n    if (!isRecursiveJSONSchemaReferenceError(error)) {\n      throw error;\n    }\n    return {\n      ...declaration,\n      parametersJsonSchema: tool.inputSchema\n    };\n  }\n}\n\n// src/google-json-accumulator.ts\nvar GoogleJSONAccumulator = class {\n  constructor() {\n    this.accumulatedArgs = {};\n    this.jsonText = \"\";\n    /**\n     * Stack representing the currently \"open\" containers in the JSON output.\n     * Entry 0 is always the root `{` object once the first value is written.\n     */\n    this.pathStack = [];\n    /**\n     * Whether a string value is currently \"open\" (willContinue was true),\n     * meaning the closing quote has not yet been emitted.\n     */\n    this.stringOpen = false;\n  }\n  /**\n   * Input: [{jsonPath:\"$.brightness\",numberValue:50}]\n   * Output: { currentJSON:{brightness:50}, textDelta:'{\"brightness\":50' }\n   */\n  processPartialArgs(partialArgs) {\n    let delta = \"\";\n    for (const arg of partialArgs) {\n      const isArrayTerminator = arg.jsonPath.endsWith(\"[]\");\n      const jsonPath = isArrayTerminator ? arg.jsonPath.slice(0, -2) : arg.jsonPath;\n      const rawPath = jsonPath.replace(/^\\$\\./, \"\");\n      if (!rawPath || rawPath === \"$\") continue;\n      const segments = parsePath(rawPath);\n      const existingValue = getNestedValue(this.accumulatedArgs, segments);\n      const isStringContinuation = arg.stringValue != null && existingValue !== void 0;\n      if (isStringContinuation) {\n        const escaped = JSON.stringify(arg.stringValue).slice(1, -1);\n        setNestedValue(\n          this.accumulatedArgs,\n          segments,\n          existingValue + arg.stringValue\n        );\n        delta += escaped;\n        continue;\n      }\n      const resolved = resolvePartialArgValue(arg);\n      if (resolved == null) {\n        if (existingValue !== void 0 || arg.willContinue === true) continue;\n        setNestedValue(\n          this.accumulatedArgs,\n          segments,\n          isArrayTerminator ? [] : {}\n        );\n        delta += this.emitContainer(segments, isArrayTerminator);\n        continue;\n      }\n      setNestedValue(this.accumulatedArgs, segments, resolved.value);\n      delta += this.emitNavigationTo(segments, arg, resolved.json);\n    }\n    this.jsonText += delta;\n    return {\n      currentJSON: this.accumulatedArgs,\n      textDelta: delta\n    };\n  }\n  /**\n   * Input: jsonText='{\"brightness\":50', accumulatedArgs={brightness:50}\n   * Output: { finalJSON:'{\"brightness\":50}', closingDelta:'}' }\n   */\n  finalize() {\n    const finalArgs = JSON.stringify(this.accumulatedArgs);\n    const closingDelta = finalArgs.slice(this.jsonText.length);\n    return { finalJSON: finalArgs, closingDelta };\n  }\n  /**\n   * Input: pathStack=[] (first call) or pathStack=[root,...] (subsequent calls)\n   * Output: '{' (first call) or '' (subsequent calls)\n   */\n  ensureRoot() {\n    if (this.pathStack.length === 0) {\n      this.pathStack.push({ segment: \"\", isArray: false, childCount: 0 });\n      return \"{\";\n    }\n    return \"\";\n  }\n  /**\n   * Emits the JSON text fragment needed to navigate from the current open\n   * path to the new leaf at `targetSegments`, then writes the value.\n   *\n   * Input: targetSegments=[\"recipe\",\"name\"], arg={jsonPath:\"$.recipe.name\",stringValue:\"Lasagna\"}, valueJson='\"Lasagna\"'\n   * Output: '{\"recipe\":{\"name\":\"Lasagna\"'\n   */\n  emitNavigationTo(targetSegments, arg, valueJson) {\n    let fragment = \"\";\n    if (this.stringOpen) {\n      fragment += '\"';\n      this.stringOpen = false;\n    }\n    fragment += this.ensureRoot();\n    const targetContainerSegments = targetSegments.slice(0, -1);\n    const leafSegment = targetSegments[targetSegments.length - 1];\n    const commonDepth = this.findCommonStackDepth(targetContainerSegments);\n    fragment += this.closeDownTo(commonDepth);\n    fragment += this.openDownTo(targetContainerSegments, leafSegment);\n    fragment += this.emitLeaf(leafSegment, arg, valueJson);\n    return fragment;\n  }\n  /**\n   * Navigates to `targetSegments` and opens a container there. The container\n   * stays open so later entries for its children continue inside it; it is\n   * closed by subsequent navigation or by `finalize()`.\n   *\n   * Input: targetSegments=[\"nested\",\"tags\"], isArray=true\n   * Output: '{\"nested\":{\"tags\":['\n   */\n  emitContainer(targetSegments, isArray) {\n    let fragment = \"\";\n    if (this.stringOpen) {\n      fragment += '\"';\n      this.stringOpen = false;\n    }\n    fragment += this.ensureRoot();\n    const commonDepth = this.findCommonStackDepth(targetSegments);\n    fragment += this.closeDownTo(commonDepth);\n    fragment += this.openDownTo(targetSegments, isArray ? 0 : \"\");\n    return fragment;\n  }\n  /**\n   * Returns the stack depth to preserve when navigating to a new target\n   * container path. Always >= 1 (the root is never popped).\n   *\n   * Input: stack=[root,\"recipe\",\"ingredients\",0], target=[\"recipe\",\"ingredients\",1]\n   * Output: 3 (keep root+\"recipe\"+\"ingredients\")\n   */\n  findCommonStackDepth(targetContainer) {\n    const maxDepth = Math.min(\n      this.pathStack.length - 1,\n      targetContainer.length\n    );\n    let common = 0;\n    for (let i = 0; i < maxDepth; i++) {\n      if (this.pathStack[i + 1].segment === targetContainer[i]) {\n        common++;\n      } else {\n        break;\n      }\n    }\n    return common + 1;\n  }\n  /**\n   * Closes containers from the current stack depth back down to `targetDepth`.\n   *\n   * Input: this.pathStack=[root,\"recipe\",\"ingredients\",0], targetDepth=3\n   * Output: '}'\n   */\n  closeDownTo(targetDepth) {\n    let fragment = \"\";\n    while (this.pathStack.length > targetDepth) {\n      const entry = this.pathStack.pop();\n      fragment += entry.isArray ? \"]\" : \"}\";\n    }\n    return fragment;\n  }\n  /**\n   * Opens containers from the current stack depth down to the full target\n   * container path, emitting opening `{`, `[`, keys, and commas as needed.\n   * `leafSegment` is used to determine if the innermost container is an array.\n   *\n   * Input: this.pathStack=[root], targetContainer=[\"recipe\",\"ingredients\"], leafSegment=0\n   * Output: '\"recipe\":{\"ingredients\":['\n   */\n  openDownTo(targetContainer, leafSegment) {\n    let fragment = \"\";\n    const startIdx = this.pathStack.length - 1;\n    for (let i = startIdx; i < targetContainer.length; i++) {\n      const seg = targetContainer[i];\n      const parentEntry = this.pathStack[this.pathStack.length - 1];\n      if (parentEntry.childCount > 0) {\n        fragment += \",\";\n      }\n      parentEntry.childCount++;\n      if (typeof seg === \"string\") {\n        fragment += `${JSON.stringify(seg)}:`;\n      }\n      const childSeg = i + 1 < targetContainer.length ? targetContainer[i + 1] : leafSegment;\n      const isArray = typeof childSeg === \"number\";\n      fragment += isArray ? \"[\" : \"{\";\n      this.pathStack.push({ segment: seg, isArray, childCount: 0 });\n    }\n    return fragment;\n  }\n  /**\n   * Emits the comma, key, and value for a leaf entry in the current container.\n   *\n   * Input: leafSegment=\"name\", arg={stringValue:\"Lasagna\"}, valueJson='\"Lasagna\"'\n   * Output: '\"name\":\"Lasagna\"' (or ',\"name\":\"Lasagna\"' if container.childCount > 0)\n   */\n  emitLeaf(leafSegment, arg, valueJson) {\n    let fragment = \"\";\n    const container = this.pathStack[this.pathStack.length - 1];\n    if (container.childCount > 0) {\n      fragment += \",\";\n    }\n    container.childCount++;\n    if (typeof leafSegment === \"string\") {\n      fragment += `${JSON.stringify(leafSegment)}:`;\n    }\n    if (arg.stringValue != null && arg.willContinue) {\n      fragment += valueJson.slice(0, -1);\n      this.stringOpen = true;\n    } else {\n      fragment += valueJson;\n    }\n    return fragment;\n  }\n};\nfunction parsePath(rawPath) {\n  const segments = [];\n  for (const part of rawPath.split(\".\")) {\n    const bracketIdx = part.indexOf(\"[\");\n    if (bracketIdx === -1) {\n      segments.push(part);\n    } else {\n      if (bracketIdx > 0) segments.push(part.slice(0, bracketIdx));\n      for (const m of part.matchAll(/\\[(\\d+)\\]/g)) {\n        segments.push(parseInt(m[1], 10));\n      }\n    }\n  }\n  return segments;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\nfunction hasOwnProperty(obj, key) {\n  return hasOwn.call(obj, key);\n}\nfunction defineOwnProperty(obj, key, value) {\n  Object.defineProperty(obj, key, {\n    value,\n    enumerable: true,\n    configurable: true,\n    writable: true\n  });\n}\nfunction getNestedValue(obj, segments) {\n  let current = obj;\n  for (const seg of segments) {\n    if (current == null || typeof current !== \"object\") return void 0;\n    const currentRecord = current;\n    if (!hasOwnProperty(currentRecord, seg)) return void 0;\n    current = currentRecord[seg];\n  }\n  return current;\n}\nfunction setNestedValue(obj, segments, value) {\n  let current = obj;\n  for (let i = 0; i < segments.length - 1; i++) {\n    const seg = segments[i];\n    const nextSeg = segments[i + 1];\n    if (!hasOwnProperty(current, seg) || current[seg] == null) {\n      defineOwnProperty(current, seg, typeof nextSeg === \"number\" ? [] : {});\n    }\n    current = current[seg];\n  }\n  defineOwnProperty(current, segments[segments.length - 1], value);\n}\nfunction resolvePartialArgValue(arg) {\n  var _a2, _b;\n  const value = (_b = (_a2 = arg.stringValue) != null ? _a2 : arg.numberValue) != null ? _b : arg.boolValue;\n  if (value != null) return { value, json: JSON.stringify(value) };\n  if (\"nullValue\" in arg) return { value: null, json: \"null\" };\n  return void 0;\n}\n\n// src/map-google-generative-ai-finish-reason.ts\nfunction mapGoogleGenerativeAIFinishReason({\n  finishReason,\n  hasToolCalls\n}) {\n  switch (finishReason) {\n    case \"STOP\":\n      return hasToolCalls ? \"tool-calls\" : \"stop\";\n    case \"MAX_TOKENS\":\n    // Gemini 4 long decode: the per-request cap was reached while budget\n    // remains. Continued automatically; only surfaced if continuing fails.\n    case \"CONTINUATION\":\n      return \"length\";\n    case \"IMAGE_SAFETY\":\n    case \"RECITATION\":\n    case \"SAFETY\":\n    case \"BLOCKLIST\":\n    case \"PROHIBITED_CONTENT\":\n    case \"SPII\":\n      return \"content-filter\";\n    case \"MALFORMED_FUNCTION_CALL\":\n      return \"error\";\n    case \"FINISH_REASON_UNSPECIFIED\":\n    case \"OTHER\":\n    default:\n      return \"other\";\n  }\n}\n\n// src/google-generative-ai-language-model.ts\nvar configurableSafetySettingCategories = [\n  \"HARM_CATEGORY_HATE_SPEECH\",\n  \"HARM_CATEGORY_DANGEROUS_CONTENT\",\n  \"HARM_CATEGORY_HARASSMENT\",\n  \"HARM_CATEGORY_SEXUALLY_EXPLICIT\"\n];\nvar gemini25ModelPattern2 = /(^|\\/)gemini-2\\.5(?:[.-]|$)/i;\nvar googleCloudStorageFunctionResponseUrls = {\n  \"image/png\": [/^gs:\\/\\/.*$/],\n  \"image/jpeg\": [/^gs:\\/\\/.*$/],\n  \"image/webp\": [/^gs:\\/\\/.*$/],\n  \"application/pdf\": [/^gs:\\/\\/.*$/],\n  \"text/plain\": [/^gs:\\/\\/.*$/]\n};\nvar GoogleGenerativeAILanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    var _a2;\n    this.modelId = modelId;\n    this.config = config;\n    this.generateId = (_a2 = config.generateId) != null ? _a2 : generateId;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get supportedUrls() {\n    var _a2, _b, _c;\n    return (_c = (_b = (_a2 = this.config).supportedUrls) == null ? void 0 : _b.call(_a2)) != null ? _c : {};\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    tools,\n    toolChoice,\n    providerOptions,\n    abortSignal\n  }, { isStreaming = false } = {}) {\n    var _a2, _b, _c;\n    const warnings = [];\n    const providerOptionsName = this.config.provider.includes(\"vertex\") ? \"vertex\" : \"google\";\n    let googleOptions = await parseProviderOptions3({\n      provider: providerOptionsName,\n      providerOptions,\n      schema: googleLanguageModelOptions\n    });\n    if (googleOptions == null && providerOptionsName !== \"google\") {\n      googleOptions = await parseProviderOptions3({\n        provider: \"google\",\n        providerOptions,\n        schema: googleLanguageModelOptions\n      });\n    }\n    const isVertexProvider = this.config.provider.startsWith(\"google.vertex.\");\n    if ((tools == null ? void 0 : tools.some(\n      (tool) => tool.type === \"provider\" && tool.id === \"google.vertex_rag_store\"\n    )) && !isVertexProvider) {\n      warnings.push({\n        type: \"other\",\n        message: `The 'vertex_rag_store' tool is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (${this.config.provider}).`\n      });\n    }\n    if ((googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) && !isVertexProvider) {\n      warnings.push({\n        type: \"other\",\n        message: `'streamFunctionCallArguments' is only supported on the Vertex AI API and will be ignored with the current Google provider (${this.config.provider}). See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc`\n      });\n    }\n    if ((googleOptions == null ? void 0 : googleOptions.serviceTier) && isVertexProvider) {\n      warnings.push({\n        type: \"other\",\n        message: \"'serviceTier' is a Gemini API option and is not supported on Vertex AI. Use 'sharedRequestType' (and optionally 'requestType') instead. See https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo\"\n      });\n    }\n    if (((googleOptions == null ? void 0 : googleOptions.sharedRequestType) || (googleOptions == null ? void 0 : googleOptions.requestType)) && !isVertexProvider) {\n      warnings.push({\n        type: \"other\",\n        message: `'sharedRequestType' and 'requestType' are Vertex AI options and are ignored with the current Google provider (${this.config.provider}).`\n      });\n    }\n    const vertexPaygoHeaders = isVertexProvider && ((googleOptions == null ? void 0 : googleOptions.sharedRequestType) || (googleOptions == null ? void 0 : googleOptions.requestType)) ? {\n      ...googleOptions.sharedRequestType && {\n        \"X-Vertex-AI-LLM-Shared-Request-Type\": googleOptions.sharedRequestType\n      },\n      ...googleOptions.requestType && {\n        \"X-Vertex-AI-LLM-Request-Type\": googleOptions.requestType\n      }\n    } : void 0;\n    const bodyServiceTier = isVertexProvider ? void 0 : googleOptions == null ? void 0 : googleOptions.serviceTier;\n    let imageConfig = googleOptions == null ? void 0 : googleOptions.imageConfig;\n    if (imageConfig != null && !isVertexProvider) {\n      const {\n        personGeneration,\n        prominentPeople,\n        imageOutputOptions,\n        ...geminiApiImageConfig\n      } = imageConfig;\n      const droppedImageConfigFields = Object.entries({\n        personGeneration,\n        prominentPeople,\n        imageOutputOptions\n      }).filter(([, value]) => value != null).map(([key]) => `'imageConfig.${key}'`);\n      if (droppedImageConfigFields.length > 0) {\n        warnings.push({\n          type: \"other\",\n          message: `${droppedImageConfigFields.join(\", \")} ${droppedImageConfigFields.length === 1 ? \"is a Vertex AI option and is\" : \"are Vertex AI options and are\"} ignored with the current Google provider (${this.config.provider}).`\n        });\n        imageConfig = geminiApiImageConfig;\n      }\n    }\n    const isGemmaModel = this.modelId.toLowerCase().startsWith(\"gemma-\");\n    const isGemini25DeveloperApiModel = !isVertexProvider && gemini25ModelPattern2.test(this.modelId);\n    if (isGemini25DeveloperApiModel && frequencyPenalty != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"frequencyPenalty\"\n      });\n    }\n    if (isGemini25DeveloperApiModel && presencePenalty != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"presencePenalty\"\n      });\n    }\n    const { usesGemini3Features } = getGoogleModelCapabilities(this.modelId);\n    const supportedFunctionResponseUrls = usesGemini3Features && isVertexProvider ? googleCloudStorageFunctionResponseUrls : void 0;\n    const promptWithDownloadedToolResultFiles = isVertexProvider ? await downloadToolResultFiles(prompt, {\n      abortSignal,\n      supportedUrls: supportedFunctionResponseUrls\n    }) : prompt;\n    const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(\n      promptWithDownloadedToolResultFiles,\n      {\n        isGemmaModel,\n        isGemini3Model: usesGemini3Features,\n        providerOptionsName,\n        supportsFunctionResponseParts: usesGemini3Features,\n        onWarning: (warning) => warnings.push(warning),\n        includeFunctionCallIds: !isVertexProvider,\n        supportedFunctionResponseUrls\n      }\n    );\n    const {\n      tools: googleTools2,\n      toolConfig: googleToolConfig,\n      toolWarnings\n    } = prepareTools({\n      tools,\n      toolChoice,\n      modelId: this.modelId,\n      isVertexProvider\n    });\n    const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a2 = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a2 : false : void 0;\n    const safetyThreshold = googleOptions == null ? void 0 : googleOptions.threshold;\n    const safetySettings = (_b = googleOptions == null ? void 0 : googleOptions.safetySettings) != null ? _b : safetyThreshold != null ? configurableSafetySettingCategories.map((category) => ({\n      category,\n      threshold: safetyThreshold\n    })) : void 0;\n    const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {\n      ...googleToolConfig,\n      ...streamFunctionCallArguments && {\n        functionCallingConfig: {\n          ...googleToolConfig == null ? void 0 : googleToolConfig.functionCallingConfig,\n          streamFunctionCallArguments: true\n        }\n      },\n      ...(googleOptions == null ? void 0 : googleOptions.retrievalConfig) && {\n        retrievalConfig: googleOptions.retrievalConfig\n      }\n    } : void 0;\n    return {\n      args: {\n        generationConfig: {\n          // standardized settings:\n          maxOutputTokens,\n          temperature,\n          topK,\n          topP,\n          frequencyPenalty: isGemini25DeveloperApiModel ? void 0 : frequencyPenalty,\n          presencePenalty: isGemini25DeveloperApiModel ? void 0 : presencePenalty,\n          stopSequences,\n          seed,\n          // response format:\n          responseMimeType: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" ? \"application/json\" : void 0,\n          responseSchema: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null && // Google GenAI does not support all OpenAPI Schema features,\n          // so this is needed as an escape hatch:\n          // TODO convert into provider option\n          ((_c = googleOptions == null ? void 0 : googleOptions.structuredOutputs) != null ? _c : true) ? convertJSONSchemaToOpenAPISchema(responseFormat.schema) : void 0,\n          ...(googleOptions == null ? void 0 : googleOptions.audioTimestamp) && {\n            audioTimestamp: googleOptions.audioTimestamp\n          },\n          // provider options:\n          responseModalities: googleOptions == null ? void 0 : googleOptions.responseModalities,\n          thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig,\n          ...(googleOptions == null ? void 0 : googleOptions.mediaResolution) && {\n            mediaResolution: googleOptions.mediaResolution\n          },\n          ...imageConfig && { imageConfig }\n        },\n        contents,\n        systemInstruction: isGemmaModel ? void 0 : systemInstruction,\n        safetySettings,\n        tools: googleTools2,\n        toolConfig,\n        cachedContent: googleOptions == null ? void 0 : googleOptions.cachedContent,\n        labels: googleOptions == null ? void 0 : googleOptions.labels,\n        serviceTier: bodyServiceTier,\n        ...(googleOptions == null ? void 0 : googleOptions.continuationToken) != null && {\n          continuationToken: googleOptions.continuationToken\n        }\n      },\n      warnings: [...warnings, ...toolWarnings],\n      providerOptionsName,\n      extraHeaders: vertexPaygoHeaders\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;\n    const { args, warnings, providerOptionsName, extraHeaders } = await this.getArgs(options);\n    const mergedHeaders = combineHeaders3(\n      await resolve3(this.config.headers),\n      options.headers,\n      extraHeaders\n    );\n    const generateContent = (body) => postJsonToApi3({\n      url: `${this.config.baseURL}/${getModelPath(\n        this.modelId\n      )}:generateContent`,\n      headers: mergedHeaders,\n      body,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler3(responseSchema),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await generateContent(args);\n    const continuedParts = [];\n    const groundingMetadataPerRequest = [];\n    let continuedUsageMetadata;\n    const firstPromptTokenCount = (_a2 = response.usageMetadata) == null ? void 0 : _a2.promptTokenCount;\n    while (true) {\n      const candidate2 = (_b = response.candidates) == null ? void 0 : _b[0];\n      groundingMetadataPerRequest.push((_c = candidate2 == null ? void 0 : candidate2.groundingMetadata) != null ? _c : null);\n      const continuationToken = (candidate2 == null ? void 0 : candidate2.finishReason) === \"CONTINUATION\" ? candidate2.continuationToken : void 0;\n      if (continuationToken == null) {\n        break;\n      }\n      continuedParts.push(...(_e = (_d = candidate2 == null ? void 0 : candidate2.content) == null ? void 0 : _d.parts) != null ? _e : []);\n      continuedUsageMetadata = addGoogleGenerativeAIUsageMetadata(\n        continuedUsageMetadata,\n        (_f = response.usageMetadata) != null ? _f : void 0\n      );\n      ({\n        responseHeaders,\n        value: response,\n        rawValue: rawResponse\n      } = await generateContent({ ...args, continuationToken }));\n    }\n    const candidate = (_g = response.candidates) == null ? void 0 : _g[0];\n    const promptBlockReason = (_h = response.promptFeedback) == null ? void 0 : _h.blockReason;\n    const confirmedPromptBlockReason = isConfirmedPromptBlockReason(\n      promptBlockReason\n    ) ? promptBlockReason : void 0;\n    const isPromptBlocked = (candidate == null ? void 0 : candidate.finishReason) == null && confirmedPromptBlockReason != null;\n    const rawFinishReason = (_i = candidate == null ? void 0 : candidate.finishReason) != null ? _i : confirmedPromptBlockReason;\n    const content = [];\n    const parts = [...continuedParts, ...(_k = (_j = candidate == null ? void 0 : candidate.content) == null ? void 0 : _j.parts) != null ? _k : []];\n    const usageMetadata = addGoogleGenerativeAIUsageMetadata(\n      continuedUsageMetadata,\n      (_l = response.usageMetadata) != null ? _l : void 0\n    );\n    let lastCodeExecutionToolCallId;\n    let lastServerToolCallId;\n    for (const part of parts) {\n      if (\"executableCode\" in part && ((_m = part.executableCode) == null ? void 0 : _m.code)) {\n        const toolCallId = this.config.generateId();\n        lastCodeExecutionToolCallId = toolCallId;\n        content.push({\n          type: \"tool-call\",\n          toolCallId,\n          toolName: \"code_execution\",\n          input: JSON.stringify(part.executableCode),\n          providerExecuted: true\n        });\n      } else if (\"codeExecutionResult\" in part && part.codeExecutionResult) {\n        content.push({\n          type: \"tool-result\",\n          // Results correspond to the most recent executable code part.\n          toolCallId: lastCodeExecutionToolCallId,\n          toolName: \"code_execution\",\n          result: {\n            outcome: part.codeExecutionResult.outcome,\n            output: (_n = part.codeExecutionResult.output) != null ? _n : \"\"\n          }\n        });\n      } else if (\"text\" in part && part.text != null) {\n        const thoughtSignatureMetadata = part.thoughtSignature ? {\n          [providerOptionsName]: {\n            thoughtSignature: part.thoughtSignature\n          }\n        } : void 0;\n        if (part.text.length === 0) {\n          if (thoughtSignatureMetadata != null && content.length > 0) {\n            const lastContent = content[content.length - 1];\n            lastContent.providerMetadata = thoughtSignatureMetadata;\n          }\n        } else {\n          content.push({\n            type: part.thought === true ? \"reasoning\" : \"text\",\n            text: part.text,\n            providerMetadata: thoughtSignatureMetadata\n          });\n        }\n      } else if (\"functionCall\" in part && part.functionCall.name != null) {\n        content.push({\n          type: \"tool-call\",\n          toolCallId: (_o = part.functionCall.id) != null ? _o : this.config.generateId(),\n          toolName: part.functionCall.name,\n          input: JSON.stringify((_p = part.functionCall.args) != null ? _p : {}),\n          providerMetadata: part.thoughtSignature ? {\n            [providerOptionsName]: {\n              thoughtSignature: part.thoughtSignature\n            }\n          } : void 0\n        });\n      } else if (\"inlineData\" in part) {\n        const hasThought = part.thought === true;\n        const hasThoughtSignature = !!part.thoughtSignature;\n        content.push({\n          type: \"file\",\n          data: part.inlineData.data,\n          mediaType: part.inlineData.mimeType,\n          providerMetadata: hasThought || hasThoughtSignature ? {\n            [providerOptionsName]: {\n              ...hasThought ? { thought: true } : {},\n              ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}\n            }\n          } : void 0\n        });\n      } else if (\"toolCall\" in part && part.toolCall) {\n        const toolCallId = (_q = part.toolCall.id) != null ? _q : this.config.generateId();\n        lastServerToolCallId = toolCallId;\n        content.push({\n          type: \"tool-call\",\n          toolCallId,\n          toolName: `server:${part.toolCall.toolType}`,\n          input: JSON.stringify((_r = part.toolCall.args) != null ? _r : {}),\n          providerExecuted: true,\n          dynamic: true,\n          providerMetadata: part.thoughtSignature ? {\n            [providerOptionsName]: {\n              thoughtSignature: part.thoughtSignature,\n              serverToolCallId: toolCallId,\n              serverToolType: part.toolCall.toolType\n            }\n          } : {\n            [providerOptionsName]: {\n              serverToolCallId: toolCallId,\n              serverToolType: part.toolCall.toolType\n            }\n          }\n        });\n      } else if (\"toolResponse\" in part && part.toolResponse) {\n        const responseToolCallId = (_s = lastServerToolCallId != null ? lastServerToolCallId : part.toolResponse.id) != null ? _s : this.config.generateId();\n        content.push({\n          type: \"tool-result\",\n          toolCallId: responseToolCallId,\n          toolName: `server:${part.toolResponse.toolType}`,\n          result: (_t = part.toolResponse.response) != null ? _t : {},\n          providerMetadata: part.thoughtSignature ? {\n            [providerOptionsName]: {\n              thoughtSignature: part.thoughtSignature,\n              serverToolCallId: responseToolCallId,\n              serverToolType: part.toolResponse.toolType\n            }\n          } : {\n            [providerOptionsName]: {\n              serverToolCallId: responseToolCallId,\n              serverToolType: part.toolResponse.toolType\n            }\n          }\n        });\n        lastServerToolCallId = void 0;\n      }\n    }\n    const sources = (_u = extractSources({\n      groundingMetadata: candidate == null ? void 0 : candidate.groundingMetadata,\n      generateId: this.config.generateId\n    })) != null ? _u : [];\n    for (const source of sources) {\n      content.push(source);\n    }\n    return {\n      content,\n      finishReason: {\n        unified: isPromptBlocked ? \"content-filter\" : mapGoogleGenerativeAIFinishReason({\n          finishReason: rawFinishReason,\n          // Only count client-executed tool calls for finish reason determination.\n          hasToolCalls: content.some(\n            (part) => part.type === \"tool-call\" && !part.providerExecuted\n          )\n        }),\n        raw: rawFinishReason\n      },\n      usage: convertGoogleGenerativeAIUsage(usageMetadata),\n      warnings,\n      providerMetadata: {\n        [providerOptionsName]: {\n          promptFeedback: (_v = response.promptFeedback) != null ? _v : null,\n          groundingMetadata: (_w = candidate == null ? void 0 : candidate.groundingMetadata) != null ? _w : null,\n          ...groundingMetadataPerRequest.length > 1 ? { groundingMetadataPerRequest } : {},\n          urlContextMetadata: (_x = candidate == null ? void 0 : candidate.urlContextMetadata) != null ? _x : null,\n          safetyRatings: (_y = candidate == null ? void 0 : candidate.safetyRatings) != null ? _y : null,\n          usageMetadata: usageMetadata != null ? usageMetadata : null,\n          finishMessage: (_z = candidate == null ? void 0 : candidate.finishMessage) != null ? _z : null,\n          serviceTier: (_A = usageMetadata == null ? void 0 : usageMetadata.serviceTier) != null ? _A : null,\n          ...(candidate == null ? void 0 : candidate.continuationToken) != null && rawFinishReason === \"MAX_TOKENS\" ? { continuationToken: candidate.continuationToken } : {},\n          ...continuedUsageMetadata != null && firstPromptTokenCount != null ? { initialPromptTokenCount: firstPromptTokenCount } : {}\n        }\n      },\n      request: { body: args },\n      response: {\n        // TODO timestamp, model id\n        id: (_B = response.responseId) != null ? _B : void 0,\n        headers: responseHeaders,\n        body: rawResponse\n      }\n    };\n  }\n  async doStream(options) {\n    const { args, warnings, providerOptionsName, extraHeaders } = await this.getArgs(options, { isStreaming: true });\n    const headers = combineHeaders3(\n      await resolve3(this.config.headers),\n      options.headers,\n      extraHeaders\n    );\n    const streamGenerateContent = (body) => postJsonToApi3({\n      url: `${this.config.baseURL}/${getModelPath(\n        this.modelId\n      )}:streamGenerateContent?alt=sse`,\n      headers,\n      body,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(chunkSchema),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const { responseHeaders, value: firstResponse } = await streamGenerateContent(args);\n    const groundingMetadataPerRequest = [];\n    let requestGroundingMetadata = null;\n    const response = continueGoogleStream({\n      stream: firstResponse,\n      getContinuationToken: (chunk) => {\n        var _a2, _b;\n        const candidate = (_a2 = chunk.candidates) == null ? void 0 : _a2[0];\n        if ((candidate == null ? void 0 : candidate.groundingMetadata) != null) {\n          requestGroundingMetadata = candidate.groundingMetadata;\n        }\n        return (candidate == null ? void 0 : candidate.finishReason) === \"CONTINUATION\" ? (_b = candidate.continuationToken) != null ? _b : void 0 : void 0;\n      },\n      continueStream: async (continuationToken) => {\n        const { value } = await streamGenerateContent({\n          ...args,\n          continuationToken\n        });\n        groundingMetadataPerRequest.push(requestGroundingMetadata);\n        requestGroundingMetadata = null;\n        return value;\n      }\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage = void 0;\n    let continuedUsage = void 0;\n    let initialPromptTokenCount = void 0;\n    let promptFeedback = null;\n    let lastGroundingMetadata = null;\n    let lastUrlContextMetadata = null;\n    let lastSafetyRatings = null;\n    let lastFinishMessage = null;\n    let lastContinuationToken = null;\n    let confirmedPromptBlockReason;\n    const generateId3 = this.config.generateId;\n    let hasToolCalls = false;\n    let hasEmittedResponseMetadata = false;\n    let currentTextBlockId = null;\n    let currentReasoningBlockId = null;\n    let blockCounter = 0;\n    const emittedSourceUrls = /* @__PURE__ */ new Set();\n    let lastCodeExecutionToolCallId;\n    let lastServerToolCallId;\n    const activeStreamingToolCalls = [];\n    const finishActiveStreamingToolCall = (controller) => {\n      const active = activeStreamingToolCalls.pop();\n      if (active == null) {\n        return;\n      }\n      const { finalJSON, closingDelta } = active.accumulator.finalize();\n      if (closingDelta.length > 0) {\n        controller.enqueue({\n          type: \"tool-input-delta\",\n          id: active.toolCallId,\n          delta: closingDelta,\n          providerMetadata: active.providerMetadata\n        });\n      }\n      controller.enqueue({\n        type: \"tool-input-end\",\n        id: active.toolCallId,\n        providerMetadata: active.providerMetadata\n      });\n      controller.enqueue({\n        type: \"tool-call\",\n        toolCallId: active.toolCallId,\n        toolName: active.toolName,\n        input: finalJSON,\n        providerMetadata: active.providerMetadata\n      });\n      hasToolCalls = true;\n    };\n    return {\n      stream: response.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (!hasEmittedResponseMetadata && value.responseId != null) {\n              hasEmittedResponseMetadata = true;\n              controller.enqueue({\n                type: \"response-metadata\",\n                id: value.responseId\n              });\n            }\n            const usageMetadata = value.usageMetadata;\n            if (usageMetadata != null) {\n              usage = usageMetadata;\n            }\n            if (value.promptFeedback != null && confirmedPromptBlockReason == null) {\n              promptFeedback = value.promptFeedback;\n              if (isConfirmedPromptBlockReason(value.promptFeedback.blockReason)) {\n                confirmedPromptBlockReason = value.promptFeedback.blockReason;\n                finishReason = {\n                  unified: \"content-filter\",\n                  raw: confirmedPromptBlockReason\n                };\n              }\n            }\n            const candidate = (_a2 = value.candidates) == null ? void 0 : _a2[0];\n            if (candidate != null) {\n              if (candidate.groundingMetadata != null) {\n                lastGroundingMetadata = candidate.groundingMetadata;\n              }\n              if (candidate.urlContextMetadata != null) {\n                lastUrlContextMetadata = candidate.urlContextMetadata;\n              }\n              if (candidate.safetyRatings != null) {\n                lastSafetyRatings = candidate.safetyRatings;\n              }\n              if (candidate.finishMessage != null) {\n                lastFinishMessage = candidate.finishMessage;\n              }\n              if (candidate.continuationToken != null) {\n                lastContinuationToken = candidate.continuationToken;\n              }\n            }\n            if (confirmedPromptBlockReason != null || candidate == null) {\n              return;\n            }\n            const content = candidate.content;\n            const sources = extractSources({\n              groundingMetadata: candidate.groundingMetadata,\n              generateId: generateId3\n            });\n            if (sources != null) {\n              for (const source of sources) {\n                if (source.sourceType === \"url\" && !emittedSourceUrls.has(source.url)) {\n                  emittedSourceUrls.add(source.url);\n                  controller.enqueue(source);\n                }\n              }\n            }\n            if (content != null) {\n              const parts = (_b = content.parts) != null ? _b : [];\n              for (const part of parts) {\n                if (\"executableCode\" in part && ((_c = part.executableCode) == null ? void 0 : _c.code)) {\n                  const toolCallId = generateId3();\n                  lastCodeExecutionToolCallId = toolCallId;\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId,\n                    toolName: \"code_execution\",\n                    input: JSON.stringify(part.executableCode),\n                    providerExecuted: true\n                  });\n                } else if (\"codeExecutionResult\" in part && part.codeExecutionResult) {\n                  const toolCallId = lastCodeExecutionToolCallId;\n                  if (toolCallId) {\n                    controller.enqueue({\n                      type: \"tool-result\",\n                      toolCallId,\n                      toolName: \"code_execution\",\n                      result: {\n                        outcome: part.codeExecutionResult.outcome,\n                        output: (_d = part.codeExecutionResult.output) != null ? _d : \"\"\n                      }\n                    });\n                  }\n                } else if (\"text\" in part && part.text != null) {\n                  const thoughtSignatureMetadata = part.thoughtSignature ? {\n                    [providerOptionsName]: {\n                      thoughtSignature: part.thoughtSignature\n                    }\n                  } : void 0;\n                  if (part.text.length === 0) {\n                    if (thoughtSignatureMetadata != null && currentTextBlockId !== null) {\n                      controller.enqueue({\n                        type: \"text-delta\",\n                        id: currentTextBlockId,\n                        delta: \"\",\n                        providerMetadata: thoughtSignatureMetadata\n                      });\n                    }\n                  } else if (part.thought === true) {\n                    if (currentTextBlockId !== null) {\n                      controller.enqueue({\n                        type: \"text-end\",\n                        id: currentTextBlockId\n                      });\n                      currentTextBlockId = null;\n                    }\n                    if (currentReasoningBlockId === null) {\n                      currentReasoningBlockId = String(blockCounter++);\n                      controller.enqueue({\n                        type: \"reasoning-start\",\n                        id: currentReasoningBlockId,\n                        providerMetadata: thoughtSignatureMetadata\n                      });\n                    }\n                    controller.enqueue({\n                      type: \"reasoning-delta\",\n                      id: currentReasoningBlockId,\n                      delta: part.text,\n                      providerMetadata: thoughtSignatureMetadata\n                    });\n                  } else {\n                    if (currentReasoningBlockId !== null) {\n                      controller.enqueue({\n                        type: \"reasoning-end\",\n                        id: currentReasoningBlockId\n                      });\n                      currentReasoningBlockId = null;\n                    }\n                    if (currentTextBlockId === null) {\n                      currentTextBlockId = String(blockCounter++);\n                      controller.enqueue({\n                        type: \"text-start\",\n                        id: currentTextBlockId,\n                        providerMetadata: thoughtSignatureMetadata\n                      });\n                    }\n                    controller.enqueue({\n                      type: \"text-delta\",\n                      id: currentTextBlockId,\n                      delta: part.text,\n                      providerMetadata: thoughtSignatureMetadata\n                    });\n                  }\n                } else if (\"inlineData\" in part) {\n                  if (currentTextBlockId !== null) {\n                    controller.enqueue({\n                      type: \"text-end\",\n                      id: currentTextBlockId\n                    });\n                    currentTextBlockId = null;\n                  }\n                  if (currentReasoningBlockId !== null) {\n                    controller.enqueue({\n                      type: \"reasoning-end\",\n                      id: currentReasoningBlockId\n                    });\n                    currentReasoningBlockId = null;\n                  }\n                  const hasThought = part.thought === true;\n                  const hasThoughtSignature = !!part.thoughtSignature;\n                  const fileMeta = hasThought || hasThoughtSignature ? {\n                    [providerOptionsName]: {\n                      ...hasThought ? { thought: true } : {},\n                      ...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}\n                    }\n                  } : void 0;\n                  controller.enqueue({\n                    type: \"file\",\n                    mediaType: part.inlineData.mimeType,\n                    data: part.inlineData.data,\n                    providerMetadata: fileMeta\n                  });\n                } else if (\"toolCall\" in part && part.toolCall) {\n                  const toolCallId = (_e = part.toolCall.id) != null ? _e : generateId3();\n                  lastServerToolCallId = toolCallId;\n                  const serverMeta = {\n                    [providerOptionsName]: {\n                      ...part.thoughtSignature ? { thoughtSignature: part.thoughtSignature } : {},\n                      serverToolCallId: toolCallId,\n                      serverToolType: part.toolCall.toolType\n                    }\n                  };\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId,\n                    toolName: `server:${part.toolCall.toolType}`,\n                    input: JSON.stringify((_f = part.toolCall.args) != null ? _f : {}),\n                    providerExecuted: true,\n                    dynamic: true,\n                    providerMetadata: serverMeta\n                  });\n                } else if (\"toolResponse\" in part && part.toolResponse) {\n                  const responseToolCallId = (_g = lastServerToolCallId != null ? lastServerToolCallId : part.toolResponse.id) != null ? _g : generateId3();\n                  const serverMeta = {\n                    [providerOptionsName]: {\n                      ...part.thoughtSignature ? { thoughtSignature: part.thoughtSignature } : {},\n                      serverToolCallId: responseToolCallId,\n                      serverToolType: part.toolResponse.toolType\n                    }\n                  };\n                  controller.enqueue({\n                    type: \"tool-result\",\n                    toolCallId: responseToolCallId,\n                    toolName: `server:${part.toolResponse.toolType}`,\n                    result: (_h = part.toolResponse.response) != null ? _h : {},\n                    providerMetadata: serverMeta\n                  });\n                  lastServerToolCallId = void 0;\n                }\n              }\n              for (const part of parts) {\n                if (!(\"functionCall\" in part)) continue;\n                const providerMeta = part.thoughtSignature ? {\n                  [providerOptionsName]: {\n                    thoughtSignature: part.thoughtSignature\n                  }\n                } : void 0;\n                const isStreamingChunk = part.functionCall.partialArgs != null || part.functionCall.name != null && part.functionCall.willContinue === true;\n                const isTerminalChunk = part.functionCall.name == null && part.functionCall.args == null && part.functionCall.partialArgs == null && part.functionCall.willContinue == null;\n                const isCompleteCall = part.functionCall.name != null && part.functionCall.args != null && part.functionCall.partialArgs == null;\n                const isNoArgsCompleteCall = part.functionCall.name != null && part.functionCall.args == null && part.functionCall.partialArgs == null && part.functionCall.willContinue !== true;\n                if (isStreamingChunk) {\n                  if (part.functionCall.name != null) {\n                    const toolCallId = (_i = part.functionCall.id) != null ? _i : generateId3();\n                    const accumulator = new GoogleJSONAccumulator();\n                    activeStreamingToolCalls.push({\n                      toolCallId,\n                      toolName: part.functionCall.name,\n                      accumulator,\n                      providerMetadata: providerMeta\n                    });\n                    controller.enqueue({\n                      type: \"tool-input-start\",\n                      id: toolCallId,\n                      toolName: part.functionCall.name,\n                      providerMetadata: providerMeta\n                    });\n                    if (part.functionCall.partialArgs != null) {\n                      const partialArgs = part.functionCall.partialArgs;\n                      const { textDelta } = accumulator.processPartialArgs(partialArgs);\n                      if (textDelta.length > 0) {\n                        controller.enqueue({\n                          type: \"tool-input-delta\",\n                          id: toolCallId,\n                          delta: textDelta,\n                          providerMetadata: providerMeta\n                        });\n                      }\n                      if (part.functionCall.willContinue !== true && partialArgs.every((arg) => arg.willContinue !== true)) {\n                        finishActiveStreamingToolCall(controller);\n                      }\n                    }\n                  } else if (part.functionCall.partialArgs != null && activeStreamingToolCalls.length > 0) {\n                    const active = activeStreamingToolCalls[activeStreamingToolCalls.length - 1];\n                    const partialArgs = part.functionCall.partialArgs;\n                    const { textDelta } = active.accumulator.processPartialArgs(partialArgs);\n                    if (textDelta.length > 0) {\n                      controller.enqueue({\n                        type: \"tool-input-delta\",\n                        id: active.toolCallId,\n                        delta: textDelta,\n                        providerMetadata: providerMeta\n                      });\n                    }\n                    if (part.functionCall.willContinue !== true && partialArgs.every((arg) => arg.willContinue !== true)) {\n                      finishActiveStreamingToolCall(controller);\n                    }\n                  }\n                } else if (isTerminalChunk && activeStreamingToolCalls.length > 0) {\n                  finishActiveStreamingToolCall(controller);\n                } else if (isCompleteCall) {\n                  const toolCallId = (_j = part.functionCall.id) != null ? _j : generateId3();\n                  const toolName = part.functionCall.name;\n                  const args2 = typeof part.functionCall.args === \"string\" ? part.functionCall.args : JSON.stringify((_k = part.functionCall.args) != null ? _k : {});\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id: toolCallId,\n                    toolName,\n                    providerMetadata: providerMeta\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: toolCallId,\n                    delta: args2,\n                    providerMetadata: providerMeta\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCallId,\n                    providerMetadata: providerMeta\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId,\n                    toolName,\n                    input: args2,\n                    providerMetadata: providerMeta\n                  });\n                  hasToolCalls = true;\n                } else if (isNoArgsCompleteCall) {\n                  const toolCallId = (_l = part.functionCall.id) != null ? _l : generateId3();\n                  const toolName = part.functionCall.name;\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id: toolCallId,\n                    toolName,\n                    providerMetadata: providerMeta\n                  });\n                  controller.enqueue({\n                    type: \"tool-input-end\",\n                    id: toolCallId,\n                    providerMetadata: providerMeta\n                  });\n                  controller.enqueue({\n                    type: \"tool-call\",\n                    toolCallId,\n                    toolName,\n                    input: \"{}\",\n                    providerMetadata: providerMeta\n                  });\n                  hasToolCalls = true;\n                }\n              }\n            }\n            if (candidate.finishReason === \"CONTINUATION\") {\n              if (continuedUsage == null) {\n                initialPromptTokenCount = usage == null ? void 0 : usage.promptTokenCount;\n              }\n              continuedUsage = addGoogleGenerativeAIUsageMetadata(\n                continuedUsage,\n                usage\n              );\n              usage = void 0;\n            }\n            if (candidate.finishReason != null) {\n              finishReason = {\n                unified: mapGoogleGenerativeAIFinishReason({\n                  finishReason: candidate.finishReason,\n                  hasToolCalls\n                }),\n                raw: candidate.finishReason\n              };\n            }\n          },\n          flush(controller) {\n            var _a2;\n            usage = addGoogleGenerativeAIUsageMetadata(continuedUsage, usage);\n            if (currentTextBlockId !== null) {\n              controller.enqueue({\n                type: \"text-end\",\n                id: currentTextBlockId\n              });\n            }\n            if (currentReasoningBlockId !== null) {\n              controller.enqueue({\n                type: \"reasoning-end\",\n                id: currentReasoningBlockId\n              });\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertGoogleGenerativeAIUsage(usage),\n              providerMetadata: {\n                [providerOptionsName]: {\n                  promptFeedback,\n                  groundingMetadata: lastGroundingMetadata,\n                  ...groundingMetadataPerRequest.length > 0 ? {\n                    groundingMetadataPerRequest: [\n                      ...groundingMetadataPerRequest,\n                      requestGroundingMetadata\n                    ]\n                  } : {},\n                  urlContextMetadata: lastUrlContextMetadata,\n                  safetyRatings: lastSafetyRatings,\n                  usageMetadata: usage != null ? usage : null,\n                  finishMessage: lastFinishMessage,\n                  serviceTier: (_a2 = usage == null ? void 0 : usage.serviceTier) != null ? _a2 : null,\n                  // Only surface the token when the response stopped early\n                  // (budget used up, or continuing failed), not for the\n                  // checkpoint tokens of a stream that finished normally.\n                  ...lastContinuationToken != null && (finishReason.raw === \"MAX_TOKENS\" || finishReason.raw === \"CONTINUATION\") ? { continuationToken: lastContinuationToken } : {},\n                  ...initialPromptTokenCount != null ? { initialPromptTokenCount } : {}\n                }\n              }\n            });\n          }\n        })\n      ),\n      response: { headers: responseHeaders },\n      request: { body: args }\n    };\n  }\n};\nfunction extractSources({\n  groundingMetadata,\n  generateId: generateId3\n}) {\n  var _a2, _b, _c, _d, _e, _f;\n  if (!(groundingMetadata == null ? void 0 : groundingMetadata.groundingChunks)) {\n    return void 0;\n  }\n  const sources = [];\n  for (const chunk of groundingMetadata.groundingChunks) {\n    if (chunk.web != null) {\n      sources.push({\n        type: \"source\",\n        sourceType: \"url\",\n        id: generateId3(),\n        url: chunk.web.uri,\n        title: (_a2 = chunk.web.title) != null ? _a2 : void 0\n      });\n    } else if (chunk.image != null) {\n      sources.push({\n        type: \"source\",\n        sourceType: \"url\",\n        id: generateId3(),\n        // Google requires attribution to the source URI, not the actual image URI.\n        // TODO: add another type in v7 to allow both the image and source URL to be included separately\n        url: chunk.image.sourceUri,\n        title: (_b = chunk.image.title) != null ? _b : void 0\n      });\n    } else if (chunk.retrievedContext != null) {\n      const uri = chunk.retrievedContext.uri;\n      const fileSearchStore = chunk.retrievedContext.fileSearchStore;\n      if (uri && (uri.startsWith(\"http://\") || uri.startsWith(\"https://\"))) {\n        sources.push({\n          type: \"source\",\n          sourceType: \"url\",\n          id: generateId3(),\n          url: uri,\n          title: (_c = chunk.retrievedContext.title) != null ? _c : void 0\n        });\n      } else if (uri) {\n        const title = (_d = chunk.retrievedContext.title) != null ? _d : \"Unknown Document\";\n        let mediaType = \"application/octet-stream\";\n        let filename = void 0;\n        if (uri.endsWith(\".pdf\")) {\n          mediaType = \"application/pdf\";\n          filename = uri.split(\"/\").pop();\n        } else if (uri.endsWith(\".txt\")) {\n          mediaType = \"text/plain\";\n          filename = uri.split(\"/\").pop();\n        } else if (uri.endsWith(\".docx\")) {\n          mediaType = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n          filename = uri.split(\"/\").pop();\n        } else if (uri.endsWith(\".doc\")) {\n          mediaType = \"application/msword\";\n          filename = uri.split(\"/\").pop();\n        } else if (uri.match(/\\.(md|markdown)$/)) {\n          mediaType = \"text/markdown\";\n          filename = uri.split(\"/\").pop();\n        } else {\n          filename = uri.split(\"/\").pop();\n        }\n        sources.push({\n          type: \"source\",\n          sourceType: \"document\",\n          id: generateId3(),\n          mediaType,\n          title,\n          filename\n        });\n      } else if (fileSearchStore) {\n        const title = (_e = chunk.retrievedContext.title) != null ? _e : \"Unknown Document\";\n        sources.push({\n          type: \"source\",\n          sourceType: \"document\",\n          id: generateId3(),\n          mediaType: \"application/octet-stream\",\n          title,\n          filename: fileSearchStore.split(\"/\").pop()\n        });\n      }\n    } else if (chunk.maps != null) {\n      if (chunk.maps.uri) {\n        sources.push({\n          type: \"source\",\n          sourceType: \"url\",\n          id: generateId3(),\n          url: chunk.maps.uri,\n          title: (_f = chunk.maps.title) != null ? _f : void 0\n        });\n      }\n    }\n  }\n  return sources.length > 0 ? sources : void 0;\n}\nvar getGroundingMetadataSchema = () => z8.object({\n  webSearchQueries: z8.array(z8.string()).nullish(),\n  imageSearchQueries: z8.array(z8.string()).nullish(),\n  retrievalQueries: z8.array(z8.string()).nullish(),\n  searchEntryPoint: z8.object({ renderedContent: z8.string() }).nullish(),\n  groundingChunks: z8.array(\n    z8.object({\n      web: z8.object({ uri: z8.string(), title: z8.string().nullish() }).nullish(),\n      image: z8.object({\n        sourceUri: z8.string(),\n        imageUri: z8.string(),\n        title: z8.string().nullish(),\n        domain: z8.string().nullish()\n      }).nullish(),\n      retrievedContext: z8.object({\n        uri: z8.string().nullish(),\n        title: z8.string().nullish(),\n        text: z8.string().nullish(),\n        fileSearchStore: z8.string().nullish(),\n        customMetadata: z8.array(\n          z8.object({\n            key: z8.string(),\n            stringValue: z8.string().nullish(),\n            numericValue: z8.number().nullish(),\n            stringListValue: z8.object({ values: z8.array(z8.string()).nullish() }).nullish()\n          })\n        ).nullish()\n      }).nullish(),\n      maps: z8.object({\n        uri: z8.string().nullish(),\n        title: z8.string().nullish(),\n        text: z8.string().nullish(),\n        placeId: z8.string().nullish()\n      }).nullish()\n    })\n  ).nullish(),\n  groundingSupports: z8.array(\n    z8.object({\n      segment: z8.object({\n        startIndex: z8.number().nullish(),\n        endIndex: z8.number().nullish(),\n        text: z8.string().nullish()\n      }).nullish(),\n      segment_text: z8.string().nullish(),\n      groundingChunkIndices: z8.array(z8.number()).nullish(),\n      supportChunkIndices: z8.array(z8.number()).nullish(),\n      confidenceScores: z8.array(z8.number()).nullish(),\n      confidenceScore: z8.array(z8.number()).nullish()\n    })\n  ).nullish(),\n  retrievalMetadata: z8.union([\n    z8.object({\n      webDynamicRetrievalScore: z8.number()\n    }),\n    z8.object({})\n  ]).nullish()\n});\nvar partialArgSchema = () => z8.object({\n  jsonPath: z8.string(),\n  stringValue: z8.string().nullish(),\n  numberValue: z8.number().nullish(),\n  boolValue: z8.boolean().nullish(),\n  nullValue: z8.unknown().nullish(),\n  willContinue: z8.boolean().nullish()\n});\nvar getContentSchema = () => z8.object({\n  parts: z8.array(\n    z8.union([\n      // note: order matters since text can be fully empty\n      z8.object({\n        functionCall: z8.object({\n          id: z8.string().nullish(),\n          name: z8.string().nullish(),\n          args: z8.unknown().nullish(),\n          partialArgs: z8.array(partialArgSchema()).nullish(),\n          willContinue: z8.boolean().nullish()\n        }),\n        thoughtSignature: z8.string().nullish()\n      }),\n      z8.object({\n        inlineData: z8.object({\n          mimeType: z8.string(),\n          data: z8.string()\n        }),\n        thought: z8.boolean().nullish(),\n        thoughtSignature: z8.string().nullish()\n      }),\n      z8.object({\n        toolCall: z8.object({\n          toolType: z8.string(),\n          args: z8.unknown().nullish(),\n          id: z8.string()\n        }),\n        thoughtSignature: z8.string().nullish()\n      }),\n      z8.object({\n        toolResponse: z8.object({\n          toolType: z8.string(),\n          response: z8.unknown().nullish(),\n          id: z8.string()\n        }),\n        thoughtSignature: z8.string().nullish()\n      }),\n      z8.object({\n        executableCode: z8.object({\n          language: z8.string(),\n          code: z8.string()\n        }).nullish(),\n        codeExecutionResult: z8.object({\n          outcome: z8.string(),\n          output: z8.string().nullish()\n        }).nullish(),\n        text: z8.string().nullish(),\n        thought: z8.boolean().nullish(),\n        thoughtSignature: z8.string().nullish()\n      })\n    ])\n  ).nullish()\n});\nvar getSafetyRatingSchema = () => z8.object({\n  category: z8.string().nullish(),\n  probability: z8.string().nullish(),\n  probabilityScore: z8.number().nullish(),\n  severity: z8.string().nullish(),\n  severityScore: z8.number().nullish(),\n  blocked: z8.boolean().nullish()\n});\nvar tokenDetailsSchema = () => z8.array(\n  z8.object({\n    modality: z8.string(),\n    tokenCount: z8.number()\n  }).catchall(z8.json())\n).nullish();\nvar usageSchema = () => z8.object({\n  cachedContentTokenCount: z8.number().nullish(),\n  thoughtsTokenCount: z8.number().nullish(),\n  promptTokenCount: z8.number().nullish(),\n  candidatesTokenCount: z8.number().nullish(),\n  toolUsePromptTokenCount: z8.number().nullish(),\n  totalTokenCount: z8.number().nullish(),\n  // https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType\n  trafficType: z8.string().nullish(),\n  serviceTier: z8.string().nullish(),\n  // https://ai.google.dev/api/generate-content#Modality\n  promptTokensDetails: tokenDetailsSchema(),\n  cacheTokensDetails: tokenDetailsSchema(),\n  candidatesTokensDetails: tokenDetailsSchema(),\n  toolUsePromptTokensDetails: tokenDetailsSchema()\n}).catchall(z8.json());\nvar getUrlContextMetadataSchema = () => z8.object({\n  urlMetadata: z8.array(\n    z8.object({\n      retrievedUrl: z8.string(),\n      urlRetrievalStatus: z8.string()\n    })\n  ).nullish()\n});\nvar responseSchema = lazySchema7(\n  () => zodSchema7(\n    z8.object({\n      responseId: z8.string().nullish(),\n      candidates: z8.array(\n        z8.object({\n          content: getContentSchema().nullish().or(z8.object({}).strict()),\n          finishReason: z8.string().nullish(),\n          finishMessage: z8.string().nullish(),\n          continuationToken: z8.string().nullish(),\n          safetyRatings: z8.array(getSafetyRatingSchema()).nullish(),\n          groundingMetadata: getGroundingMetadataSchema().nullish(),\n          urlContextMetadata: getUrlContextMetadataSchema().nullish()\n        })\n      ).nullish(),\n      usageMetadata: usageSchema().nullish(),\n      promptFeedback: z8.object({\n        blockReason: z8.string().nullish(),\n        safetyRatings: z8.array(getSafetyRatingSchema()).nullish()\n      }).nullish()\n    })\n  )\n);\nvar chunkSchema = lazySchema7(\n  () => zodSchema7(\n    z8.object({\n      responseId: z8.string().nullish(),\n      candidates: z8.array(\n        z8.object({\n          content: getContentSchema().nullish(),\n          finishReason: z8.string().nullish(),\n          finishMessage: z8.string().nullish(),\n          continuationToken: z8.string().nullish(),\n          safetyRatings: z8.array(getSafetyRatingSchema()).nullish(),\n          groundingMetadata: getGroundingMetadataSchema().nullish(),\n          urlContextMetadata: getUrlContextMetadataSchema().nullish()\n        })\n      ).nullish(),\n      usageMetadata: usageSchema().nullish(),\n      promptFeedback: z8.object({\n        blockReason: z8.string().nullish(),\n        safetyRatings: z8.array(getSafetyRatingSchema()).nullish()\n      }).nullish()\n    })\n  )\n);\nfunction isConfirmedPromptBlockReason(blockReason) {\n  return blockReason != null && blockReason !== \"\" && blockReason !== \"BLOCK_REASON_UNSPECIFIED\" && blockReason !== \"BLOCKED_REASON_UNSPECIFIED\";\n}\n\n// src/tool/code-execution.ts\nimport { createProviderToolFactoryWithOutputSchema } from \"@ai-sdk/provider-utils\";\nimport { z as z9 } from \"zod/v4\";\nvar codeExecution = createProviderToolFactoryWithOutputSchema({\n  id: \"google.code_execution\",\n  inputSchema: z9.object({\n    language: z9.string().describe(\"The programming language of the code.\"),\n    code: z9.string().describe(\"The code to be executed.\")\n  }),\n  outputSchema: z9.object({\n    outcome: z9.string().describe('The outcome of the execution (e.g., \"OUTCOME_OK\").'),\n    output: z9.string().describe(\"The output from the code execution.\")\n  })\n});\n\n// src/tool/enterprise-web-search.ts\nimport {\n  createProviderToolFactory,\n  lazySchema as lazySchema8,\n  zodSchema as zodSchema8\n} from \"@ai-sdk/provider-utils\";\nimport { z as z10 } from \"zod/v4\";\nvar enterpriseWebSearch = createProviderToolFactory({\n  id: \"google.enterprise_web_search\",\n  inputSchema: lazySchema8(() => zodSchema8(z10.object({})))\n});\n\n// src/tool/file-search.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory2,\n  lazySchema as lazySchema9,\n  zodSchema as zodSchema9\n} from \"@ai-sdk/provider-utils\";\nimport { z as z11 } from \"zod/v4\";\nvar fileSearchArgsBaseSchema = () => z11.object({\n  /** The names of the file_search_stores to retrieve from.\n   *  Example: `fileSearchStores/my-file-search-store-123`\n   */\n  fileSearchStoreNames: z11.array(z11.string()).describe(\n    \"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`\"\n  ),\n  /** The number of file search retrieval chunks to retrieve. */\n  topK: z11.number().int().positive().describe(\"The number of file search retrieval chunks to retrieve.\").optional(),\n  /** Metadata filter to apply to the file search retrieval documents.\n   *  See https://google.aip.dev/160 for the syntax of the filter expression.\n   */\n  metadataFilter: z11.string().describe(\n    \"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression.\"\n  ).optional()\n}).passthrough();\nvar fileSearchArgsSchema = lazySchema9(\n  () => zodSchema9(fileSearchArgsBaseSchema())\n);\nvar fileSearch = createProviderToolFactory2({\n  id: \"google.file_search\",\n  inputSchema: fileSearchArgsSchema\n});\n\n// src/tool/google-maps.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory3,\n  lazySchema as lazySchema10,\n  zodSchema as zodSchema10\n} from \"@ai-sdk/provider-utils\";\nimport { z as z12 } from \"zod/v4\";\nvar googleMaps = createProviderToolFactory3({\n  id: \"google.google_maps\",\n  inputSchema: lazySchema10(() => zodSchema10(z12.object({})))\n});\n\n// src/tool/google-search.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory4,\n  lazySchema as lazySchema11,\n  zodSchema as zodSchema11\n} from \"@ai-sdk/provider-utils\";\nimport { z as z13 } from \"zod/v4\";\nvar googleSearchToolArgsBaseSchema = () => z13.object({\n  searchTypes: z13.object({\n    webSearch: z13.object({}).optional(),\n    imageSearch: z13.object({}).optional()\n  }).optional(),\n  timeRangeFilter: z13.object({\n    startTime: z13.string(),\n    endTime: z13.string()\n  }).optional()\n}).passthrough();\nvar googleSearchToolArgsSchema = lazySchema11(\n  () => zodSchema11(googleSearchToolArgsBaseSchema())\n);\nvar googleSearch = createProviderToolFactory4(\n  {\n    id: \"google.google_search\",\n    inputSchema: googleSearchToolArgsSchema\n  }\n);\n\n// src/tool/url-context.ts\nimport {\n  createProviderToolFactory as createProviderToolFactory5,\n  lazySchema as lazySchema12,\n  zodSchema as zodSchema12\n} from \"@ai-sdk/provider-utils\";\nimport { z as z14 } from \"zod/v4\";\nvar urlContext = createProviderToolFactory5({\n  id: \"google.url_context\",\n  inputSchema: lazySchema12(() => zodSchema12(z14.object({})))\n});\n\n// src/tool/vertex-rag-store.ts\nimport { createProviderToolFactory as createProviderToolFactory6 } from \"@ai-sdk/provider-utils\";\nimport { z as z15 } from \"zod/v4\";\nvar vertexRagStore = createProviderToolFactory6({\n  id: \"google.vertex_rag_store\",\n  inputSchema: z15.object({\n    ragCorpus: z15.string(),\n    topK: z15.number().optional()\n  })\n});\n\n// src/google-tools.ts\nvar googleTools = {\n  /**\n   * Creates a Google search tool that gives Google direct access to real-time web content.\n   * Must have name \"google_search\".\n   */\n  googleSearch,\n  /**\n   * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.\n   * Designed for highly-regulated industries (finance, healthcare, public sector).\n   * Does not log customer data and supports VPC service controls.\n   * Must have name \"enterprise_web_search\".\n   *\n   * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.\n   *\n   * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise\n   */\n  enterpriseWebSearch,\n  /**\n   * Creates a Google Maps grounding tool that gives the model access to Google Maps data.\n   * Must have name \"google_maps\".\n   *\n   * @see https://ai.google.dev/gemini-api/docs/maps-grounding\n   * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps\n   */\n  googleMaps,\n  /**\n   * Creates a URL context tool that gives Google direct access to real-time web content.\n   * Must have name \"url_context\".\n   */\n  urlContext,\n  /**\n   * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.\n   * Must have name \"file_search\".\n   *\n   * @param fileSearchStoreNames - Fully-qualified File Search store resource names.\n   * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.\n   * @param topK - Optional result limit for the number of chunks returned from File Search.\n   *\n   * @see https://ai.google.dev/gemini-api/docs/file-search\n   */\n  fileSearch,\n  /**\n   * A tool that enables the model to generate and run Python code.\n   * Must have name \"code_execution\".\n   *\n   * @note Ensure the selected model supports Code Execution.\n   * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.\n   *\n   * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)\n   * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)\n   */\n  codeExecution,\n  /**\n   * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.\n   * Must have name \"vertex_rag_store\".\n   */\n  vertexRagStore\n};\n\n// src/google-generative-ai-image-model.ts\nimport {\n  combineHeaders as combineHeaders4,\n  convertToBase64 as convertToBase643,\n  createJsonResponseHandler as createJsonResponseHandler4,\n  generateId as defaultGenerateId,\n  lazySchema as lazySchema13,\n  parseProviderOptions as parseProviderOptions4,\n  postJsonToApi as postJsonToApi4,\n  resolve as resolve4,\n  zodSchema as zodSchema13\n} from \"@ai-sdk/provider-utils\";\nimport { z as z16 } from \"zod/v4\";\nvar GoogleGenerativeAIImageModel = class {\n  constructor(modelId, settings, config) {\n    this.modelId = modelId;\n    this.settings = settings;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get maxImagesPerCall() {\n    if (this.settings.maxImagesPerCall != null) {\n      return this.settings.maxImagesPerCall;\n    }\n    if (isGeminiModel(this.modelId)) {\n      return 10;\n    }\n    return 4;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doGenerate(options) {\n    if (isGeminiModel(this.modelId)) {\n      return this.doGenerateGemini(options);\n    }\n    return this.doGenerateImagen(options);\n  }\n  async doGenerateImagen(options) {\n    var _a2, _b, _c;\n    const {\n      prompt,\n      n = 1,\n      size,\n      aspectRatio = \"1:1\",\n      seed,\n      providerOptions,\n      headers,\n      abortSignal,\n      files,\n      mask\n    } = options;\n    const warnings = [];\n    if (files != null && files.length > 0) {\n      throw new Error(\n        \"Google Generative AI does not support image editing with Imagen models. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.\"\n      );\n    }\n    if (mask != null) {\n      throw new Error(\n        \"Google Generative AI does not support image editing with masks. Use Google Vertex AI (@ai-sdk/google-vertex) for image editing capabilities.\"\n      );\n    }\n    if (size != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"size\",\n        details: \"This model does not support the `size` option. Use `aspectRatio` instead.\"\n      });\n    }\n    if (seed != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"seed\",\n        details: \"This model does not support the `seed` option through this provider.\"\n      });\n    }\n    const googleOptions = await parseProviderOptions4({\n      provider: \"google\",\n      providerOptions,\n      schema: googleImageModelOptionsSchema\n    });\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    const parameters = {\n      sampleCount: n\n    };\n    if (aspectRatio != null) {\n      parameters.aspectRatio = aspectRatio;\n    }\n    if (googleOptions) {\n      const { googleSearch: imagenGoogleSearch, ...imagenOptions } = googleOptions;\n      if (imagenGoogleSearch != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"googleSearch\",\n          details: \"Google Search grounding is only supported on Gemini image models.\"\n        });\n      }\n      Object.assign(parameters, imagenOptions);\n    }\n    const body = {\n      instances: [{ prompt }],\n      parameters\n    };\n    const { responseHeaders, value: response } = await postJsonToApi4({\n      url: `${this.config.baseURL}/models/${this.modelId}:predict`,\n      headers: combineHeaders4(await resolve4(this.config.headers), headers),\n      body,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler4(\n        googleImageResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    const imagePredictions = response.predictions.filter(\n      (prediction) => \"bytesBase64Encoded\" in prediction\n    );\n    return {\n      images: imagePredictions.map(\n        ({ bytesBase64Encoded }) => bytesBase64Encoded\n      ),\n      ...response.predictions.some(\n        (prediction) => \"raiFilteredReason\" in prediction\n      ) && { isRetryable: false },\n      warnings,\n      providerMetadata: {\n        google: {\n          images: imagePredictions.map(() => ({\n            // Add any prediction-specific metadata here\n          }))\n        }\n      },\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders\n      }\n    };\n  }\n  async doGenerateGemini(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;\n    const {\n      prompt,\n      n,\n      size,\n      aspectRatio,\n      seed,\n      providerOptions,\n      headers,\n      abortSignal,\n      files,\n      mask\n    } = options;\n    const warnings = [];\n    if (mask != null) {\n      throw new Error(\n        \"Gemini image models do not support mask-based image editing.\"\n      );\n    }\n    if (n != null && n > 1) {\n      throw new Error(\n        \"Gemini image models do not support generating a set number of images per call. Use n=1 or omit the n parameter.\"\n      );\n    }\n    if (size != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"size\",\n        details: \"This model does not support the `size` option. Use `aspectRatio` instead.\"\n      });\n    }\n    const userContent = [];\n    if (prompt != null) {\n      userContent.push({ type: \"text\", text: prompt });\n    }\n    if (files != null && files.length > 0) {\n      for (const file of files) {\n        if (file.type === \"url\") {\n          userContent.push({\n            type: \"file\",\n            data: new URL(file.url),\n            mediaType: \"image/*\"\n          });\n        } else {\n          userContent.push({\n            type: \"file\",\n            data: typeof file.data === \"string\" ? file.data : new Uint8Array(file.data),\n            mediaType: file.mediaType\n          });\n        }\n      }\n    }\n    const languageModelPrompt = [\n      { role: \"user\", content: userContent }\n    ];\n    const googleImageOptions = await parseProviderOptions4({\n      provider: \"google\",\n      providerOptions,\n      schema: googleImageModelOptionsSchema\n    });\n    const { googleSearch: _strippedGoogleSearch, ...passthroughGoogleOptions } = (_a2 = providerOptions == null ? void 0 : providerOptions.google) != null ? _a2 : {};\n    const languageModel = new GoogleGenerativeAILanguageModel(this.modelId, {\n      provider: this.config.provider,\n      baseURL: this.config.baseURL,\n      headers: (_b = this.config.headers) != null ? _b : {},\n      fetch: this.config.fetch,\n      generateId: (_c = this.config.generateId) != null ? _c : defaultGenerateId\n    });\n    const result = await languageModel.doGenerate({\n      prompt: languageModelPrompt,\n      seed,\n      providerOptions: {\n        google: {\n          responseModalities: [\"IMAGE\"],\n          imageConfig: aspectRatio ? {\n            aspectRatio\n          } : void 0,\n          ...passthroughGoogleOptions\n        }\n      },\n      tools: (googleImageOptions == null ? void 0 : googleImageOptions.googleSearch) != null ? [\n        {\n          type: \"provider\",\n          id: \"google.google_search\",\n          name: \"google_search\",\n          args: googleImageOptions.googleSearch\n        }\n      ] : void 0,\n      headers,\n      abortSignal\n    });\n    const currentDate = (_f = (_e = (_d = this.config._internal) == null ? void 0 : _d.currentDate) == null ? void 0 : _e.call(_d)) != null ? _f : /* @__PURE__ */ new Date();\n    const images = [];\n    for (const part of result.content) {\n      if (part.type === \"file\" && part.mediaType.startsWith(\"image/\")) {\n        images.push(convertToBase643(part.data));\n      }\n    }\n    const languageModelGoogleMetadata = (_h = (_g = result.providerMetadata) == null ? void 0 : _g.google) != null ? _h : {};\n    return {\n      images,\n      ...result.finishReason.unified === \"content-filter\" ? { isRetryable: false } : {},\n      warnings,\n      providerMetadata: {\n        google: {\n          ...languageModelGoogleMetadata,\n          images: images.map(() => ({}))\n        }\n      },\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: (_i = result.response) == null ? void 0 : _i.headers\n      },\n      usage: result.usage ? {\n        inputTokens: result.usage.inputTokens.total,\n        outputTokens: result.usage.outputTokens.total,\n        totalTokens: ((_j = result.usage.inputTokens.total) != null ? _j : 0) + ((_k = result.usage.outputTokens.total) != null ? _k : 0)\n      } : void 0\n    };\n  }\n};\nfunction isGeminiModel(modelId) {\n  return modelId.startsWith(\"gemini-\");\n}\nvar googleImageResponseSchema = lazySchema13(\n  () => zodSchema13(\n    z16.object({\n      predictions: z16.array(\n        z16.union([\n          z16.object({ bytesBase64Encoded: z16.string() }),\n          z16.object({ raiFilteredReason: z16.string() })\n        ])\n      ).default([])\n    })\n  )\n);\nvar googleImageModelOptionsSchema = lazySchema13(\n  () => zodSchema13(\n    z16.object({\n      personGeneration: z16.enum([\"dont_allow\", \"allow_adult\", \"allow_all\"]).nullish(),\n      aspectRatio: z16.enum([\"1:1\", \"3:4\", \"4:3\", \"9:16\", \"16:9\"]).nullish(),\n      /**\n       * Enable Google Search grounding for Gemini image models. The value is\n       * forwarded as the args of the `google.tools.googleSearch` provider\n       * tool on the underlying language-model call. Pass `{}` for defaults.\n       *\n       * `generateImage` does not accept a `tools` parameter, so this is the\n       * dedicated escape hatch for grounding image generation the same way\n       * `generateText` does.\n       */\n      googleSearch: googleSearchToolArgsBaseSchema().optional()\n    })\n  )\n);\n\n// src/google-generative-ai-video-model.ts\nimport {\n  AISDKError\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders as combineHeaders5,\n  convertUint8ArrayToBase64 as convertUint8ArrayToBase642,\n  createJsonResponseHandler as createJsonResponseHandler5,\n  delay,\n  getFromApi,\n  isSameOrigin,\n  lazySchema as lazySchema14,\n  parseProviderOptions as parseProviderOptions5,\n  postJsonToApi as postJsonToApi5,\n  resolve as resolve5,\n  zodSchema as zodSchema14\n} from \"@ai-sdk/provider-utils\";\nimport { z as z17 } from \"zod/v4\";\nfunction getFirstFrameImage(options) {\n  var _a2, _b;\n  return (_b = (_a2 = options.frameImages) == null ? void 0 : _a2.find((frame) => frame.frameType === \"first_frame\")) == null ? void 0 : _b.image;\n}\nfunction resolveStartImage(options) {\n  var _a2;\n  return (_a2 = getFirstFrameImage(options)) != null ? _a2 : options.image;\n}\nfunction getLastFrameImage(options) {\n  var _a2, _b;\n  return (_b = (_a2 = options.frameImages) == null ? void 0 : _a2.find((frame) => frame.frameType === \"last_frame\")) == null ? void 0 : _b.image;\n}\nfunction getInputReferences(options) {\n  if (options.frameImages != null && options.frameImages.length > 0) {\n    return void 0;\n  }\n  return options.inputReferences != null && options.inputReferences.length > 0 ? options.inputReferences : void 0;\n}\nfunction convertFileToGoogleImage(file, warnings) {\n  if (file.type === \"url\") {\n    if (file.url.startsWith(\"gs://\")) {\n      return {\n        gcsUri: file.url,\n        mimeType: \"image/png\"\n      };\n    }\n    warnings.push({\n      type: \"unsupported\",\n      feature: \"URL-based image input\",\n      details: \"Google Generative AI video models require base64-encoded images or GCS URIs. URL will be ignored.\"\n    });\n    return void 0;\n  }\n  const base64Data = typeof file.data === \"string\" ? file.data : convertUint8ArrayToBase642(file.data);\n  return {\n    bytesBase64Encoded: base64Data,\n    mimeType: file.mediaType || \"image/png\"\n  };\n}\nfunction convertProviderReferenceImage(refImg) {\n  if (refImg.bytesBase64Encoded) {\n    return {\n      image: {\n        bytesBase64Encoded: refImg.bytesBase64Encoded,\n        mimeType: \"image/png\"\n      }\n    };\n  }\n  if (refImg.gcsUri) {\n    return {\n      image: {\n        gcsUri: refImg.gcsUri,\n        mimeType: \"image/png\"\n      }\n    };\n  }\n  return refImg;\n}\nfunction convertInputReferenceImage(file, warnings) {\n  const image = convertFileToGoogleImage(file, warnings);\n  return image != null ? { image } : void 0;\n}\nvar GoogleGenerativeAIVideoModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get maxVideosPerCall() {\n    return 4;\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h;\n    const currentDate = (_c = (_b = (_a2 = this.config._internal) == null ? void 0 : _a2.currentDate) == null ? void 0 : _b.call(_a2)) != null ? _c : /* @__PURE__ */ new Date();\n    const warnings = [];\n    const googleOptions = await parseProviderOptions5({\n      provider: \"google\",\n      providerOptions: options.providerOptions,\n      schema: googleVideoModelOptionsSchema\n    });\n    const instances = [{}];\n    const instance = instances[0];\n    if (options.prompt != null) {\n      instance.prompt = options.prompt;\n    }\n    const startImage = resolveStartImage(options);\n    if (startImage != null) {\n      const image = convertFileToGoogleImage(startImage, warnings);\n      if (image != null) {\n        instance.image = image;\n      }\n    }\n    const lastFrameImage = getLastFrameImage(options);\n    if (lastFrameImage != null) {\n      const lastFrame = convertFileToGoogleImage(lastFrameImage, warnings);\n      if (lastFrame != null) {\n        instance.lastFrame = lastFrame;\n      }\n    }\n    const inputReferences = getInputReferences(options);\n    if (inputReferences != null) {\n      instance.referenceImages = inputReferences.flatMap((reference) => {\n        const converted = convertInputReferenceImage(reference, warnings);\n        return converted != null ? [converted] : [];\n      });\n    } else if ((googleOptions == null ? void 0 : googleOptions.referenceImages) != null) {\n      instance.referenceImages = googleOptions.referenceImages.map(\n        (refImg) => convertProviderReferenceImage(refImg)\n      );\n    }\n    const parameters = {\n      sampleCount: options.n\n    };\n    if (options.aspectRatio) {\n      parameters.aspectRatio = options.aspectRatio;\n    }\n    if (options.resolution) {\n      const resolutionMap = {\n        \"1280x720\": \"720p\",\n        \"1920x1080\": \"1080p\",\n        \"3840x2160\": \"4k\"\n      };\n      parameters.resolution = resolutionMap[options.resolution] || options.resolution;\n    }\n    if (options.duration) {\n      parameters.durationSeconds = options.duration;\n    }\n    if (options.seed) {\n      parameters.seed = options.seed;\n    }\n    if (googleOptions != null) {\n      const opts = googleOptions;\n      if (opts.personGeneration !== void 0 && opts.personGeneration !== null) {\n        parameters.personGeneration = opts.personGeneration;\n      }\n      if (opts.negativePrompt !== void 0 && opts.negativePrompt !== null) {\n        parameters.negativePrompt = opts.negativePrompt;\n      }\n      for (const [key, value] of Object.entries(opts)) {\n        if (![\n          \"pollIntervalMs\",\n          \"pollTimeoutMs\",\n          \"personGeneration\",\n          \"negativePrompt\",\n          \"referenceImages\"\n        ].includes(key)) {\n          parameters[key] = value;\n        }\n      }\n    }\n    const { value: operation } = await postJsonToApi5({\n      url: `${this.config.baseURL}/models/${this.modelId}:predictLongRunning`,\n      headers: combineHeaders5(\n        await resolve5(this.config.headers),\n        options.headers\n      ),\n      body: {\n        instances,\n        parameters\n      },\n      successfulResponseHandler: createJsonResponseHandler5(\n        googleOperationSchema\n      ),\n      failedResponseHandler: googleFailedResponseHandler,\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const operationName = operation.name;\n    if (!operationName) {\n      throw new AISDKError({\n        name: \"GOOGLE_VIDEO_GENERATION_ERROR\",\n        message: \"No operation name returned from API\"\n      });\n    }\n    const pollIntervalMs = (_d = googleOptions == null ? void 0 : googleOptions.pollIntervalMs) != null ? _d : 1e4;\n    const pollTimeoutMs = (_e = googleOptions == null ? void 0 : googleOptions.pollTimeoutMs) != null ? _e : 6e5;\n    const startTime = Date.now();\n    let finalOperation = operation;\n    let responseHeaders;\n    while (!finalOperation.done) {\n      if (Date.now() - startTime > pollTimeoutMs) {\n        throw new AISDKError({\n          name: \"GOOGLE_VIDEO_GENERATION_TIMEOUT\",\n          message: `Video generation timed out after ${pollTimeoutMs}ms`\n        });\n      }\n      await delay(pollIntervalMs);\n      if ((_f = options.abortSignal) == null ? void 0 : _f.aborted) {\n        throw new AISDKError({\n          name: \"GOOGLE_VIDEO_GENERATION_ABORTED\",\n          message: \"Video generation request was aborted\"\n        });\n      }\n      const { value: statusOperation, responseHeaders: pollHeaders } = await getFromApi({\n        url: `${this.config.baseURL}/${operationName}`,\n        headers: combineHeaders5(\n          await resolve5(this.config.headers),\n          options.headers\n        ),\n        successfulResponseHandler: createJsonResponseHandler5(\n          googleOperationSchema\n        ),\n        failedResponseHandler: googleFailedResponseHandler,\n        abortSignal: options.abortSignal,\n        fetch: this.config.fetch\n      });\n      finalOperation = statusOperation;\n      responseHeaders = pollHeaders;\n    }\n    if (finalOperation.error) {\n      throw new AISDKError({\n        name: \"GOOGLE_VIDEO_GENERATION_FAILED\",\n        message: `Video generation failed: ${finalOperation.error.message}`\n      });\n    }\n    const response = finalOperation.response;\n    if (!((_g = response == null ? void 0 : response.generateVideoResponse) == null ? void 0 : _g.generatedSamples) || response.generateVideoResponse.generatedSamples.length === 0) {\n      throw new AISDKError({\n        name: \"GOOGLE_VIDEO_GENERATION_ERROR\",\n        message: `No videos in response. Response: ${JSON.stringify(finalOperation)}`\n      });\n    }\n    const videos = [];\n    const videoMetadata = [];\n    const resolvedHeaders = await resolve5(this.config.headers);\n    const apiKey = resolvedHeaders == null ? void 0 : resolvedHeaders[\"x-goog-api-key\"];\n    for (const generatedSample of response.generateVideoResponse.generatedSamples) {\n      if ((_h = generatedSample.video) == null ? void 0 : _h.uri) {\n        const urlWithAuth = apiKey && isSameOrigin(generatedSample.video.uri, this.config.baseURL) ? `${generatedSample.video.uri}${generatedSample.video.uri.includes(\"?\") ? \"&\" : \"?\"}key=${apiKey}` : generatedSample.video.uri;\n        videos.push({\n          type: \"url\",\n          url: urlWithAuth,\n          mediaType: \"video/mp4\"\n        });\n        videoMetadata.push({\n          uri: generatedSample.video.uri\n        });\n      }\n    }\n    if (videos.length === 0) {\n      throw new AISDKError({\n        name: \"GOOGLE_VIDEO_GENERATION_ERROR\",\n        message: \"No valid videos in response\"\n      });\n    }\n    return {\n      videos,\n      warnings,\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders\n      },\n      providerMetadata: {\n        google: {\n          videos: videoMetadata\n        }\n      }\n    };\n  }\n};\nvar googleOperationSchema = lazySchema14(\n  () => zodSchema14(\n    z17.object({\n      name: z17.string().nullish(),\n      done: z17.boolean().nullish(),\n      error: z17.object({\n        code: z17.number().nullish(),\n        message: z17.string(),\n        status: z17.string().nullish()\n      }).nullish(),\n      response: z17.object({\n        generateVideoResponse: z17.object({\n          generatedSamples: z17.array(\n            z17.object({\n              video: z17.object({\n                uri: z17.string().nullish()\n              }).nullish()\n            })\n          ).nullish()\n        }).nullish()\n      }).nullish()\n    })\n  )\n);\nvar googleVideoModelOptionsSchema = lazySchema14(\n  () => zodSchema14(\n    z17.object({\n      pollIntervalMs: z17.number().positive().nullish(),\n      pollTimeoutMs: z17.number().positive().nullish(),\n      personGeneration: z17.enum([\"dont_allow\", \"allow_adult\", \"allow_all\"]).nullish(),\n      negativePrompt: z17.string().nullish(),\n      referenceImages: z17.array(\n        z17.object({\n          bytesBase64Encoded: z17.string().nullish(),\n          gcsUri: z17.string().nullish()\n        })\n      ).nullish()\n    }).passthrough()\n  )\n);\n\n// src/interactions/google-interactions-language-model.ts\nimport {\n  combineHeaders as combineHeaders7,\n  createEventSourceResponseHandler as createEventSourceResponseHandler3,\n  createJsonResponseHandler as createJsonResponseHandler7,\n  generateId as defaultGenerateId2,\n  parseProviderOptions as parseProviderOptions6,\n  postJsonToApi as postJsonToApi6,\n  resolve as resolve6\n} from \"@ai-sdk/provider-utils\";\n\n// src/interactions/convert-google-interactions-usage.ts\nfunction convertGoogleInteractionsUsage(usage) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const totalInput = (_a2 = usage.total_input_tokens) != null ? _a2 : 0;\n  const totalOutput = (_b = usage.total_output_tokens) != null ? _b : 0;\n  const totalThought = (_c = usage.total_thought_tokens) != null ? _c : 0;\n  const totalCached = (_d = usage.total_cached_tokens) != null ? _d : 0;\n  return {\n    inputTokens: {\n      total: (_e = usage.total_input_tokens) != null ? _e : void 0,\n      noCache: usage.total_input_tokens == null ? void 0 : totalInput - totalCached,\n      cacheRead: (_f = usage.total_cached_tokens) != null ? _f : void 0,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: usage.total_output_tokens == null && usage.total_thought_tokens == null ? void 0 : totalOutput + totalThought,\n      text: (_g = usage.total_output_tokens) != null ? _g : void 0,\n      reasoning: (_h = usage.total_thought_tokens) != null ? _h : void 0\n    },\n    raw: usage\n  };\n}\nfunction getGoogleInteractionsOutputTokensByModality(usage) {\n  const byModality = usage == null ? void 0 : usage.output_tokens_by_modality;\n  if (byModality == null) {\n    return void 0;\n  }\n  const result = {};\n  for (const entry of byModality) {\n    if ((entry == null ? void 0 : entry.modality) != null && entry.tokens != null) {\n      result[entry.modality] = entry.tokens;\n    }\n  }\n  return Object.keys(result).length > 0 ? result : void 0;\n}\n\n// src/interactions/extract-google-interactions-sources.ts\nvar KNOWN_DOC_EXTENSIONS = {\n  pdf: \"application/pdf\",\n  txt: \"text/plain\",\n  md: \"text/markdown\",\n  markdown: \"text/markdown\",\n  doc: \"application/msword\",\n  docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n};\nfunction inferDocMediaType(uriOrName) {\n  const lower = uriOrName.toLowerCase();\n  for (const [ext, media] of Object.entries(KNOWN_DOC_EXTENSIONS)) {\n    if (lower.endsWith(`.${ext}`)) return media;\n  }\n  return \"application/octet-stream\";\n}\nfunction basename(uriOrName) {\n  const parts = uriOrName.split(\"/\");\n  const last = parts[parts.length - 1];\n  return last && last.length > 0 ? last : void 0;\n}\nfunction annotationToSource({\n  annotation,\n  generateId: generateId3\n}) {\n  var _a2, _b, _c, _d, _e;\n  switch (annotation.type) {\n    case \"url_citation\": {\n      const a = annotation;\n      if (a.url == null || a.url.length === 0) return void 0;\n      return {\n        type: \"source\",\n        sourceType: \"url\",\n        id: generateId3(),\n        url: a.url,\n        ...a.title != null ? { title: a.title } : {}\n      };\n    }\n    case \"file_citation\": {\n      const a = annotation;\n      const uri = (_b = (_a2 = a.url) != null ? _a2 : a.document_uri) != null ? _b : a.file_name;\n      if (uri == null || uri.length === 0) return void 0;\n      if (uri.startsWith(\"http://\") || uri.startsWith(\"https://\")) {\n        return {\n          type: \"source\",\n          sourceType: \"url\",\n          id: generateId3(),\n          url: uri,\n          ...a.file_name != null ? { title: a.file_name } : {}\n        };\n      }\n      const filename = (_c = a.file_name) != null ? _c : basename(uri);\n      const mediaType = inferDocMediaType(uri);\n      return {\n        type: \"source\",\n        sourceType: \"document\",\n        id: generateId3(),\n        mediaType,\n        title: (_e = (_d = a.file_name) != null ? _d : filename) != null ? _e : uri,\n        ...filename != null ? { filename } : {}\n      };\n    }\n    case \"place_citation\": {\n      const a = annotation;\n      if (a.url == null || a.url.length === 0) return void 0;\n      return {\n        type: \"source\",\n        sourceType: \"url\",\n        id: generateId3(),\n        url: a.url,\n        ...a.name != null ? { title: a.name } : {}\n      };\n    }\n    default:\n      return void 0;\n  }\n}\nfunction builtinToolResultToSources({\n  block,\n  generateId: generateId3\n}) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;\n  const sources = [];\n  switch (block.type) {\n    case \"url_context_result\": {\n      const result = (_a2 = block.result) != null ? _a2 : [];\n      for (const entry of result) {\n        if ((entry == null ? void 0 : entry.url) == null || entry.url.length === 0) continue;\n        if (entry.status != null && entry.status !== \"success\") continue;\n        sources.push({\n          type: \"source\",\n          sourceType: \"url\",\n          id: generateId3(),\n          url: entry.url\n        });\n      }\n      break;\n    }\n    case \"google_search_result\": {\n      const result = (_b = block.result) != null ? _b : [];\n      for (const entry of result) {\n        const url = entry == null ? void 0 : entry.url;\n        if (url == null || url.length === 0) continue;\n        sources.push({\n          type: \"source\",\n          sourceType: \"url\",\n          id: generateId3(),\n          url,\n          ...entry.title != null ? { title: entry.title } : {}\n        });\n      }\n      break;\n    }\n    case \"google_maps_result\": {\n      const result = (_c = block.result) != null ? _c : [];\n      for (const entry of result) {\n        for (const place of (_d = entry.places) != null ? _d : []) {\n          if (place.url == null || place.url.length === 0) continue;\n          sources.push({\n            type: \"source\",\n            sourceType: \"url\",\n            id: generateId3(),\n            url: place.url,\n            ...place.name != null ? { title: place.name } : {}\n          });\n        }\n      }\n      break;\n    }\n    case \"file_search_result\": {\n      const result = (_e = block.result) != null ? _e : [];\n      for (const raw of result) {\n        if (raw == null || typeof raw !== \"object\") continue;\n        const entry = raw;\n        const uri = (_g = (_f = entry.url) != null ? _f : entry.document_uri) != null ? _g : entry.file_name;\n        if (uri == null || uri.length === 0) continue;\n        if (uri.startsWith(\"http://\") || uri.startsWith(\"https://\")) {\n          sources.push({\n            type: \"source\",\n            sourceType: \"url\",\n            id: generateId3(),\n            url: uri,\n            ...entry.title != null ? { title: entry.title } : {}\n          });\n          continue;\n        }\n        const filename = (_h = entry.file_name) != null ? _h : basename(uri);\n        const mediaType = inferDocMediaType(uri);\n        sources.push({\n          type: \"source\",\n          sourceType: \"document\",\n          id: generateId3(),\n          mediaType,\n          title: (_k = (_j = (_i = entry.title) != null ? _i : entry.file_name) != null ? _j : filename) != null ? _k : uri,\n          ...filename != null ? { filename } : {}\n        });\n      }\n      break;\n    }\n    default:\n      break;\n  }\n  return sources;\n}\nfunction annotationsToSources({\n  annotations,\n  generateId: generateId3\n}) {\n  var _a2;\n  if (annotations == null) return [];\n  const seen = /* @__PURE__ */ new Set();\n  const sources = [];\n  for (const annotation of annotations) {\n    const source = annotationToSource({ annotation, generateId: generateId3 });\n    if (source == null) continue;\n    const key = source.sourceType === \"url\" ? `url:${source.url}` : `doc:${(_a2 = source.filename) != null ? _a2 : source.title}`;\n    if (seen.has(key)) continue;\n    seen.add(key);\n    sources.push(source);\n  }\n  return sources;\n}\n\n// src/interactions/map-google-interactions-finish-reason.ts\nfunction mapGoogleInteractionsFinishReason({\n  status,\n  hasFunctionCall\n}) {\n  switch (status) {\n    case \"completed\":\n      return hasFunctionCall ? \"tool-calls\" : \"stop\";\n    case \"requires_action\":\n      return \"tool-calls\";\n    case \"failed\":\n      return \"error\";\n    case \"incomplete\":\n      return \"length\";\n    case \"cancelled\":\n      return \"other\";\n    case \"in_progress\":\n    default:\n      return \"other\";\n  }\n}\n\n// src/interactions/build-google-interactions-stream-transform.ts\nvar BUILTIN_TOOL_CALL_TYPES = /* @__PURE__ */ new Set([\n  \"google_search_call\",\n  \"code_execution_call\",\n  \"url_context_call\",\n  \"file_search_call\",\n  \"google_maps_call\",\n  \"mcp_server_tool_call\"\n]);\nvar BUILTIN_TOOL_RESULT_TYPES = /* @__PURE__ */ new Set([\n  \"google_search_result\",\n  \"code_execution_result\",\n  \"url_context_result\",\n  \"file_search_result\",\n  \"google_maps_result\",\n  \"mcp_server_tool_result\"\n]);\nfunction builtinToolNameFromCallType(type) {\n  return type.replace(/_call$/, \"\");\n}\nfunction builtinToolNameFromResultType(type) {\n  return type.replace(/_result$/, \"\");\n}\nfunction buildGoogleInteractionsStreamTransform({\n  warnings,\n  generateId: generateId3,\n  includeRawChunks,\n  serviceTier: headerServiceTier\n}) {\n  let interactionId;\n  let usage;\n  let serviceTier = headerServiceTier;\n  let finishStatus;\n  let hasFunctionCall = false;\n  const openBlocks = /* @__PURE__ */ new Map();\n  const emittedSourceKeys = /* @__PURE__ */ new Set();\n  function sourceKey(source) {\n    var _a2;\n    return source.sourceType === \"url\" ? `url:${source.url}` : `doc:${(_a2 = source.filename) != null ? _a2 : source.title}`;\n  }\n  return new TransformStream({\n    start(controller) {\n      controller.enqueue({ type: \"stream-start\", warnings });\n    },\n    transform(chunk, controller) {\n      var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;\n      if (includeRawChunks) {\n        controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n      }\n      if (!chunk.success) {\n        finishStatus = \"failed\";\n        controller.enqueue({ type: \"error\", error: chunk.error });\n        return;\n      }\n      const value = chunk.value;\n      const eventType = value.event_type;\n      switch (eventType) {\n        case \"interaction.created\": {\n          const event = value;\n          const interaction = event.interaction;\n          interactionId = (interaction == null ? void 0 : interaction.id) != null && interaction.id.length > 0 ? interaction.id : void 0;\n          const created = interaction == null ? void 0 : interaction.created;\n          let timestamp;\n          if (typeof created === \"string\") {\n            const parsed = new Date(created);\n            if (!Number.isNaN(parsed.getTime())) {\n              timestamp = parsed;\n            }\n          }\n          controller.enqueue({\n            type: \"response-metadata\",\n            ...interactionId != null ? { id: interactionId } : {},\n            modelId: interaction == null ? void 0 : interaction.model,\n            ...timestamp ? { timestamp } : {}\n          });\n          break;\n        }\n        case \"step.start\": {\n          const event = value;\n          const step = event.step;\n          const index = event.index;\n          const blockId = `${interactionId != null ? interactionId : \"interaction\"}:${index}`;\n          const stepType = step == null ? void 0 : step.type;\n          if (stepType === \"model_output\") {\n            const initial = (_a2 = step == null ? void 0 : step.content) == null ? void 0 : _a2[0];\n            if ((initial == null ? void 0 : initial.type) === \"text\") {\n              openBlocks.set(index, {\n                kind: \"text\",\n                id: blockId,\n                emittedSourceKeys: /* @__PURE__ */ new Set()\n              });\n              controller.enqueue({ type: \"text-start\", id: blockId });\n              const initialSources = annotationsToSources({\n                annotations: initial.annotations,\n                generateId: generateId3\n              });\n              for (const source of initialSources) {\n                const key = sourceKey(source);\n                if (emittedSourceKeys.has(key)) continue;\n                emittedSourceKeys.add(key);\n                controller.enqueue(source);\n              }\n            } else if ((initial == null ? void 0 : initial.type) === \"image\") {\n              openBlocks.set(index, {\n                kind: \"image\",\n                id: blockId,\n                ...initial.data != null ? { data: initial.data } : {},\n                ...initial.mime_type != null ? { mimeType: initial.mime_type } : {},\n                ...initial.uri != null ? { uri: initial.uri } : {}\n              });\n            } else {\n              openBlocks.set(index, {\n                kind: \"pending_model_output\",\n                id: blockId\n              });\n            }\n          } else if (stepType === \"thought\") {\n            const signature = step == null ? void 0 : step.signature;\n            openBlocks.set(index, {\n              kind: \"reasoning\",\n              id: blockId,\n              ...signature != null ? { signature } : {}\n            });\n            controller.enqueue({ type: \"reasoning-start\", id: blockId });\n            if (Array.isArray(step == null ? void 0 : step.summary)) {\n              for (const item of step.summary) {\n                if ((item == null ? void 0 : item.type) === \"text\" && typeof item.text === \"string\") {\n                  controller.enqueue({\n                    type: \"reasoning-delta\",\n                    id: blockId,\n                    delta: item.text\n                  });\n                }\n              }\n            }\n          } else if (stepType === \"function_call\") {\n            const toolCallId = (_b = step == null ? void 0 : step.id) != null ? _b : blockId;\n            const toolName = (_c = step == null ? void 0 : step.name) != null ? _c : \"unknown\";\n            hasFunctionCall = true;\n            const state = {\n              kind: \"function_call\",\n              id: blockId,\n              toolCallId,\n              toolName,\n              argumentsAccum: \"\",\n              ...(step == null ? void 0 : step.signature) != null ? { signature: step.signature } : {}\n            };\n            openBlocks.set(index, state);\n            controller.enqueue({\n              type: \"tool-input-start\",\n              id: toolCallId,\n              toolName\n            });\n          } else if (stepType != null && BUILTIN_TOOL_CALL_TYPES.has(stepType)) {\n            const toolName = stepType === \"mcp_server_tool_call\" ? (_d = step == null ? void 0 : step.name) != null ? _d : \"mcp_server_tool\" : builtinToolNameFromCallType(stepType);\n            const toolCallId = (_e = step == null ? void 0 : step.id) != null ? _e : blockId;\n            const state = {\n              kind: \"builtin_tool_call\",\n              id: blockId,\n              blockType: stepType,\n              toolCallId,\n              toolName,\n              arguments: (_f = step == null ? void 0 : step.arguments) != null ? _f : {},\n              callEmitted: false\n            };\n            openBlocks.set(index, state);\n          } else if (stepType != null && BUILTIN_TOOL_RESULT_TYPES.has(stepType)) {\n            const toolName = stepType === \"mcp_server_tool_result\" ? (_g = step == null ? void 0 : step.name) != null ? _g : \"mcp_server_tool\" : builtinToolNameFromResultType(stepType);\n            const callId = (_h = step == null ? void 0 : step.call_id) != null ? _h : blockId;\n            const state = {\n              kind: \"builtin_tool_result\",\n              id: blockId,\n              blockType: stepType,\n              callId,\n              toolName,\n              result: (_i = step == null ? void 0 : step.result) != null ? _i : null,\n              ...(step == null ? void 0 : step.is_error) != null ? { isError: step.is_error } : {},\n              resultEmitted: false\n            };\n            openBlocks.set(index, state);\n          } else {\n            openBlocks.set(index, { kind: \"unknown\", id: blockId });\n          }\n          break;\n        }\n        case \"step.delta\": {\n          const event = value;\n          let open = openBlocks.get(event.index);\n          if (open == null) break;\n          const dtype = (_j = event.delta) == null ? void 0 : _j.type;\n          if (open.kind === \"pending_model_output\") {\n            if (dtype === \"text\" || dtype === \"text_annotation\" || dtype === \"text_annotation_delta\") {\n              const promoted = {\n                kind: \"text\",\n                id: open.id,\n                emittedSourceKeys: /* @__PURE__ */ new Set()\n              };\n              openBlocks.set(event.index, promoted);\n              open = promoted;\n              controller.enqueue({ type: \"text-start\", id: promoted.id });\n            }\n          }\n          if (dtype === \"image\" && (open.kind === \"pending_model_output\" || open.kind === \"text\" || open.kind === \"image\")) {\n            const img = event.delta;\n            const google2 = {};\n            if (interactionId != null) google2.interactionId = interactionId;\n            const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;\n            if ((img == null ? void 0 : img.data) != null && img.data.length > 0) {\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_k = img.mime_type) != null ? _k : \"image/png\",\n                data: img.data,\n                ...providerMetadata ? { providerMetadata } : {}\n              });\n            } else if ((img == null ? void 0 : img.uri) != null && img.uri.length > 0) {\n              const uriProviderMetadata = {\n                google: {\n                  ...interactionId != null ? { interactionId } : {},\n                  imageUri: img.uri\n                }\n              };\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_l = img.mime_type) != null ? _l : \"image/png\",\n                data: \"\",\n                providerMetadata: uriProviderMetadata\n              });\n            }\n            if (open.kind === \"image\") {\n              open.data = void 0;\n              open.uri = void 0;\n            }\n            break;\n          }\n          if (dtype === \"video\" && (open.kind === \"pending_model_output\" || open.kind === \"text\")) {\n            const videoDelta = event.delta;\n            const google2 = {};\n            if (interactionId != null) google2.interactionId = interactionId;\n            const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;\n            if ((videoDelta == null ? void 0 : videoDelta.data) != null && videoDelta.data.length > 0) {\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_m = videoDelta.mime_type) != null ? _m : \"video/mp4\",\n                data: videoDelta.data,\n                ...providerMetadata ? { providerMetadata } : {}\n              });\n            } else if ((videoDelta == null ? void 0 : videoDelta.uri) != null && videoDelta.uri.length > 0) {\n              const uriProviderMetadata = {\n                google: {\n                  ...interactionId != null ? { interactionId } : {},\n                  videoUri: videoDelta.uri\n                }\n              };\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_n = videoDelta.mime_type) != null ? _n : \"video/mp4\",\n                data: \"\",\n                providerMetadata: uriProviderMetadata\n              });\n            }\n            break;\n          }\n          const delta = event.delta;\n          if (open.kind === \"text\" && (delta == null ? void 0 : delta.type) === \"text\") {\n            const text = (_o = delta.text) != null ? _o : \"\";\n            if (text.length > 0) {\n              controller.enqueue({\n                type: \"text-delta\",\n                id: open.id,\n                delta: text\n              });\n            }\n          } else if (open.kind === \"text\" && ((delta == null ? void 0 : delta.type) === \"text_annotation\" || (delta == null ? void 0 : delta.type) === \"text_annotation_delta\")) {\n            const sources = annotationsToSources({\n              annotations: delta.annotations,\n              generateId: generateId3\n            });\n            for (const source of sources) {\n              const key = sourceKey(source);\n              if (emittedSourceKeys.has(key)) continue;\n              emittedSourceKeys.add(key);\n              open.emittedSourceKeys.add(key);\n              controller.enqueue(source);\n            }\n          } else if (open.kind === \"image\" && (delta == null ? void 0 : delta.type) === \"image\") {\n            if (delta.data != null) open.data = delta.data;\n            if (delta.mime_type != null) open.mimeType = delta.mime_type;\n            if (delta.uri != null) open.uri = delta.uri;\n          } else if (open.kind === \"reasoning\") {\n            if ((delta == null ? void 0 : delta.type) === \"thought_summary\") {\n              const item = delta.content;\n              if ((item == null ? void 0 : item.type) === \"text\" && typeof item.text === \"string\") {\n                controller.enqueue({\n                  type: \"reasoning-delta\",\n                  id: open.id,\n                  delta: item.text\n                });\n              }\n            } else if ((delta == null ? void 0 : delta.type) === \"thought_signature\") {\n              const signature = delta.signature;\n              if (signature != null) {\n                open.signature = signature;\n              }\n            }\n          } else if (open.kind === \"function_call\" && (delta == null ? void 0 : delta.type) === \"arguments_delta\") {\n            const slice = typeof delta.arguments === \"string\" ? delta.arguments : \"\";\n            if (slice.length > 0) {\n              open.argumentsAccum += slice;\n              controller.enqueue({\n                type: \"tool-input-delta\",\n                id: open.toolCallId,\n                delta: slice\n              });\n            }\n            if (delta.id != null) {\n              open.toolCallId = delta.id;\n            }\n            if (delta.signature != null) {\n              open.signature = delta.signature;\n            }\n            hasFunctionCall = true;\n          } else if (open.kind === \"builtin_tool_call\" && (delta == null ? void 0 : delta.type) === open.blockType) {\n            if (delta.id != null) open.toolCallId = delta.id;\n            if (delta.arguments != null && typeof delta.arguments === \"object\") {\n              open.arguments = delta.arguments;\n            }\n            if (delta.name != null && open.blockType === \"mcp_server_tool_call\") {\n              open.toolName = delta.name;\n            }\n          } else if (open.kind === \"builtin_tool_result\" && (delta == null ? void 0 : delta.type) === open.blockType) {\n            if (delta.call_id != null) open.callId = delta.call_id;\n            if (delta.result !== void 0) open.result = delta.result;\n            if (delta.is_error != null) open.isError = delta.is_error;\n            if (delta.name != null && open.blockType === \"mcp_server_tool_result\") {\n              open.toolName = delta.name;\n            }\n          }\n          break;\n        }\n        case \"step.stop\": {\n          const event = value;\n          const open = openBlocks.get(event.index);\n          if (open == null) break;\n          if (open.kind === \"text\") {\n            const textProviderMetadata = interactionId != null ? { google: { interactionId } } : void 0;\n            controller.enqueue({\n              type: \"text-end\",\n              id: open.id,\n              ...textProviderMetadata ? { providerMetadata: textProviderMetadata } : {}\n            });\n          } else if (open.kind === \"reasoning\") {\n            const google2 = {};\n            if (open.signature != null) google2.signature = open.signature;\n            if (interactionId != null) google2.interactionId = interactionId;\n            const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;\n            controller.enqueue({\n              type: \"reasoning-end\",\n              id: open.id,\n              ...providerMetadata ? { providerMetadata } : {}\n            });\n          } else if (open.kind === \"image\") {\n            const google2 = {};\n            if (interactionId != null) google2.interactionId = interactionId;\n            const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;\n            if (open.data != null && open.data.length > 0) {\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_p = open.mimeType) != null ? _p : \"image/png\",\n                data: open.data,\n                ...providerMetadata ? { providerMetadata } : {}\n              });\n            } else if (open.uri != null && open.uri.length > 0) {\n              const uriProviderMetadata = {\n                google: {\n                  ...interactionId != null ? { interactionId } : {},\n                  imageUri: open.uri\n                }\n              };\n              controller.enqueue({\n                type: \"file\",\n                mediaType: (_q = open.mimeType) != null ? _q : \"image/png\",\n                data: \"\",\n                providerMetadata: uriProviderMetadata\n              });\n            }\n          } else if (open.kind === \"function_call\") {\n            const accumulated = open.argumentsAccum.length > 0 ? open.argumentsAccum : \"{}\";\n            controller.enqueue({\n              type: \"tool-input-end\",\n              id: open.toolCallId\n            });\n            const google2 = {};\n            if (open.signature != null) google2.signature = open.signature;\n            if (interactionId != null) google2.interactionId = interactionId;\n            const providerMetadata = Object.keys(google2).length > 0 ? { google: google2 } : void 0;\n            controller.enqueue({\n              type: \"tool-call\",\n              toolCallId: open.toolCallId,\n              toolName: open.toolName,\n              input: accumulated,\n              ...providerMetadata ? { providerMetadata } : {}\n            });\n          } else if (open.kind === \"builtin_tool_call\" && !open.callEmitted) {\n            controller.enqueue({\n              type: \"tool-call\",\n              toolCallId: open.toolCallId,\n              toolName: open.toolName,\n              input: JSON.stringify((_r = open.arguments) != null ? _r : {}),\n              providerExecuted: true\n            });\n            open.callEmitted = true;\n          } else if (open.kind === \"builtin_tool_result\" && !open.resultEmitted) {\n            controller.enqueue({\n              type: \"tool-result\",\n              toolCallId: open.callId,\n              toolName: open.toolName,\n              result: (_s = open.result) != null ? _s : null\n            });\n            open.resultEmitted = true;\n            const sources = builtinToolResultToSources({\n              block: {\n                type: open.blockType,\n                call_id: open.callId,\n                result: open.result\n              },\n              generateId: generateId3\n            });\n            for (const source of sources) {\n              const key = sourceKey(source);\n              if (emittedSourceKeys.has(key)) continue;\n              emittedSourceKeys.add(key);\n              controller.enqueue(source);\n            }\n          }\n          openBlocks.delete(event.index);\n          break;\n        }\n        case \"interaction.status_update\":\n        case \"interaction.in_progress\":\n        case \"interaction.requires_action\": {\n          const event = value;\n          if (event.status != null) {\n            finishStatus = event.status;\n          } else if (eventType === \"interaction.requires_action\") {\n            finishStatus = \"requires_action\";\n          } else {\n            finishStatus = \"in_progress\";\n          }\n          break;\n        }\n        case \"interaction.completed\": {\n          const event = value;\n          const interaction = event.interaction;\n          if ((interaction == null ? void 0 : interaction.id) != null && interaction.id.length > 0) {\n            interactionId = interaction.id;\n          }\n          if ((interaction == null ? void 0 : interaction.status) != null) {\n            finishStatus = interaction.status;\n          }\n          if ((interaction == null ? void 0 : interaction.usage) != null) {\n            usage = interaction.usage;\n          }\n          if ((interaction == null ? void 0 : interaction.service_tier) != null) {\n            serviceTier = interaction.service_tier;\n          }\n          break;\n        }\n        case \"error\": {\n          const event = value;\n          finishStatus = \"failed\";\n          const errorPayload = (_t = event.error) != null ? _t : {\n            message: \"Unknown interaction error\"\n          };\n          controller.enqueue({ type: \"error\", error: errorPayload });\n          break;\n        }\n        default:\n          break;\n      }\n    },\n    flush(controller) {\n      const finishReason = {\n        unified: mapGoogleInteractionsFinishReason({\n          status: finishStatus,\n          hasFunctionCall\n        }),\n        raw: finishStatus\n      };\n      const outputTokensByModality = getGoogleInteractionsOutputTokensByModality(usage);\n      const providerMetadata = {\n        google: {\n          ...interactionId != null ? { interactionId } : {},\n          ...serviceTier != null ? { serviceTier } : {},\n          ...outputTokensByModality != null ? { outputTokensByModality } : {}\n        }\n      };\n      controller.enqueue({\n        type: \"finish\",\n        finishReason,\n        usage: convertGoogleInteractionsUsage(usage),\n        providerMetadata\n      });\n    }\n  });\n}\n\n// src/interactions/convert-to-google-interactions-input.ts\nimport { convertToBase64 as convertToBase644, secureJsonParse as secureJsonParse2 } from \"@ai-sdk/provider-utils\";\nfunction getTopLevelMediaType(mediaType) {\n  const slashIndex = mediaType.indexOf(\"/\");\n  return slashIndex === -1 ? mediaType : mediaType.substring(0, slashIndex);\n}\nfunction isFullMediaType(mediaType) {\n  const slashIndex = mediaType.indexOf(\"/\");\n  if (slashIndex === -1) {\n    return false;\n  }\n  const subtype = mediaType.substring(slashIndex + 1);\n  return subtype.length > 0 && subtype !== \"*\";\n}\nfunction convertToGoogleInteractionsInput({\n  prompt,\n  previousInteractionId,\n  store,\n  mediaResolution\n}) {\n  var _a2, _b, _c, _d, _e, _f, _g;\n  const warnings = [];\n  const incoherentCombo = previousInteractionId != null && store === false;\n  const shouldCompact = previousInteractionId != null && store !== false;\n  if (incoherentCombo) {\n    warnings.push({\n      type: \"other\",\n      message: \"google.interactions: providerOptions.google.previousInteractionId was set together with store: false. These are incoherent (the prior interaction cannot be referenced when nothing was stored on the server); the full history will be sent and previous_interaction_id will still be emitted.\"\n    });\n  }\n  const compactedPrompt = shouldCompact ? compactPromptForPreviousInteraction({\n    prompt,\n    previousInteractionId\n  }) : prompt;\n  const systemTexts = [];\n  const steps = [];\n  for (const message of compactedPrompt) {\n    switch (message.role) {\n      case \"system\": {\n        systemTexts.push(message.content);\n        break;\n      }\n      case \"user\": {\n        const content = [];\n        for (const part of message.content) {\n          if (part.type === \"text\") {\n            content.push({ type: \"text\", text: part.text });\n          } else if (part.type === \"file\") {\n            const fileBlock = convertFilePartToContent({\n              part,\n              warnings,\n              mediaResolution\n            });\n            if (fileBlock != null) {\n              content.push(fileBlock);\n            }\n          }\n        }\n        const merged = mergeAdjacentTextContent(content);\n        if (merged.length > 0) {\n          steps.push({ type: \"user_input\", content: merged });\n        }\n        break;\n      }\n      case \"assistant\": {\n        let pendingModelOutput = [];\n        const flushModelOutput = () => {\n          if (pendingModelOutput.length > 0) {\n            steps.push({ type: \"model_output\", content: pendingModelOutput });\n            pendingModelOutput = [];\n          }\n        };\n        for (const part of message.content) {\n          if (part.type === \"text\") {\n            pendingModelOutput.push({ type: \"text\", text: part.text });\n          } else if (part.type === \"reasoning\") {\n            flushModelOutput();\n            const signature = (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b.signature;\n            steps.push({\n              type: \"thought\",\n              ...signature != null ? { signature } : {},\n              summary: part.text.length > 0 ? [{ type: \"text\", text: part.text }] : void 0\n            });\n          } else if (part.type === \"file\") {\n            const fileBlock = convertFilePartToContent({\n              part,\n              warnings,\n              mediaResolution\n            });\n            if (fileBlock != null) {\n              pendingModelOutput.push(fileBlock);\n            }\n          } else if (part.type === \"tool-call\") {\n            flushModelOutput();\n            const signature = (_d = (_c = part.providerOptions) == null ? void 0 : _c.google) == null ? void 0 : _d.signature;\n            const args = typeof part.input === \"string\" ? safeParseToolArgs(part.input) : (_e = part.input) != null ? _e : {};\n            steps.push({\n              type: \"function_call\",\n              id: part.toolCallId,\n              name: part.toolName,\n              arguments: args,\n              ...signature != null ? { signature } : {}\n            });\n          } else {\n            warnings.push({\n              type: \"other\",\n              message: `google.interactions: unsupported assistant content part type \"${part.type}\"; part dropped.`\n            });\n          }\n        }\n        flushModelOutput();\n        break;\n      }\n      case \"tool\": {\n        const content = [];\n        for (const part of message.content) {\n          if (part.type !== \"tool-result\") {\n            warnings.push({\n              type: \"other\",\n              message: `google.interactions: unsupported tool message part type \"${part.type}\"; part dropped.`\n            });\n            continue;\n          }\n          const block = convertToolResultPart({\n            toolCallId: part.toolCallId,\n            toolName: part.toolName,\n            output: part.output,\n            signature: (_g = (_f = part.providerOptions) == null ? void 0 : _f.google) == null ? void 0 : _g.signature,\n            warnings\n          });\n          content.push(block);\n        }\n        if (content.length > 0) {\n          steps.push({ type: \"user_input\", content });\n        }\n        break;\n      }\n    }\n  }\n  const systemInstruction = systemTexts.length > 0 ? systemTexts.join(\"\\n\\n\") : void 0;\n  return { input: steps, systemInstruction, warnings };\n}\nfunction convertFilePartToContent({\n  part,\n  warnings,\n  mediaResolution\n}) {\n  const topLevel = getTopLevelMediaType(part.mediaType);\n  let kind;\n  switch (topLevel) {\n    case \"image\":\n      kind = \"image\";\n      break;\n    case \"audio\":\n      kind = \"audio\";\n      break;\n    case \"video\":\n      kind = \"video\";\n      break;\n    case \"application\":\n      kind = \"document\";\n      break;\n    default:\n      kind = void 0;\n  }\n  if (kind == null) {\n    warnings.push({\n      type: \"other\",\n      message: `google.interactions: unsupported file media type \"${part.mediaType}\"; part dropped.`\n    });\n    return void 0;\n  }\n  const resolutionField = mediaResolution != null && (kind === \"image\" || kind === \"video\") ? { resolution: mediaResolution } : {};\n  if (part.data instanceof URL) {\n    return {\n      type: kind,\n      uri: part.data.toString(),\n      ...isFullMediaType(part.mediaType) ? { mime_type: part.mediaType } : {},\n      ...resolutionField\n    };\n  }\n  if (!isFullMediaType(part.mediaType)) {\n    warnings.push({\n      type: \"other\",\n      message: `google.interactions: inline file data requires a full IANA media type (e.g. \"image/png\"), got \"${part.mediaType}\"; part dropped.`\n    });\n    return void 0;\n  }\n  return {\n    type: kind,\n    data: convertToBase644(part.data),\n    mime_type: part.mediaType,\n    ...resolutionField\n  };\n}\nfunction compactPromptForPreviousInteraction({\n  prompt,\n  previousInteractionId\n}) {\n  const out = [];\n  const droppedToolCallIds = /* @__PURE__ */ new Set();\n  for (const message of prompt) {\n    if (message.role === \"assistant\") {\n      const matchesLinkedInteraction = message.content.some((part) => {\n        var _a2, _b;\n        const partInteractionId = (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b.interactionId;\n        return partInteractionId === previousInteractionId;\n      });\n      if (matchesLinkedInteraction) {\n        for (const part of message.content) {\n          if (part.type === \"tool-call\") {\n            droppedToolCallIds.add(part.toolCallId);\n          }\n        }\n        continue;\n      }\n      out.push(message);\n      continue;\n    }\n    if (message.role === \"tool\") {\n      const remaining = message.content.filter((part) => {\n        if (part.type !== \"tool-result\") {\n          return true;\n        }\n        return !droppedToolCallIds.has(part.toolCallId);\n      });\n      if (remaining.length === 0) {\n        continue;\n      }\n      out.push({\n        ...message,\n        content: remaining\n      });\n      continue;\n    }\n    out.push(message);\n  }\n  return out;\n}\nfunction safeParseToolArgs(input) {\n  try {\n    const parsed = secureJsonParse2(input);\n    if (parsed != null && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n      return parsed;\n    }\n    return { value: parsed };\n  } catch (e) {\n    return { value: input };\n  }\n}\nfunction convertToolResultPart({\n  toolCallId,\n  toolName,\n  output,\n  signature,\n  warnings\n}) {\n  var _a2;\n  const base = {\n    type: \"function_result\",\n    call_id: toolCallId,\n    name: toolName,\n    ...signature != null ? { signature } : {}\n  };\n  switch (output.type) {\n    case \"text\":\n      return { ...base, result: output.value };\n    case \"json\":\n      return { ...base, result: JSON.stringify(output.value) };\n    case \"error-text\":\n      return { ...base, is_error: true, result: output.value };\n    case \"error-json\":\n      return { ...base, is_error: true, result: JSON.stringify(output.value) };\n    case \"execution-denied\":\n      return {\n        ...base,\n        is_error: true,\n        result: (_a2 = output.reason) != null ? _a2 : \"Tool execution denied by user.\"\n      };\n    case \"content\": {\n      const blocks = [];\n      for (const item of output.value) {\n        if (item.type === \"text\") {\n          blocks.push({ type: \"text\", text: item.text });\n        } else if (item.type === \"image-data\") {\n          const imageBlock = filePartToImageBlock({\n            part: {\n              type: \"file\",\n              mediaType: item.mediaType,\n              data: item.data\n            },\n            warnings\n          });\n          if (imageBlock != null) {\n            blocks.push(imageBlock);\n          }\n        } else if (item.type === \"image-url\") {\n          const imageBlock = filePartToImageBlock({\n            part: {\n              type: \"file\",\n              mediaType: \"image/*\",\n              data: new URL(item.url)\n            },\n            warnings\n          });\n          if (imageBlock != null) {\n            blocks.push(imageBlock);\n          }\n        } else if (item.type === \"file-data\" || item.type === \"file-url\") {\n          const mediaType = item.type === \"file-data\" ? item.mediaType : \"application/*\";\n          const topLevel = getTopLevelMediaType(mediaType);\n          if (topLevel !== \"image\") {\n            warnings.push({\n              type: \"other\",\n              message: `google.interactions: tool-result file with mediaType \"${mediaType}\" is not supported (Interactions \\`function_result.result\\` accepts only text and image content); part dropped.`\n            });\n            continue;\n          }\n          const imageBlock = filePartToImageBlock({\n            part: item.type === \"file-data\" ? {\n              type: \"file\",\n              mediaType: item.mediaType,\n              data: item.data\n            } : {\n              type: \"file\",\n              mediaType,\n              data: new URL(item.url)\n            },\n            warnings\n          });\n          if (imageBlock != null) {\n            blocks.push(imageBlock);\n          }\n        } else {\n          warnings.push({\n            type: \"other\",\n            message: `google.interactions: tool-result content part type \"${item.type}\" is not supported; part dropped.`\n          });\n        }\n      }\n      return { ...base, result: blocks };\n    }\n  }\n}\nfunction filePartToImageBlock({\n  part,\n  warnings\n}) {\n  if (part.data instanceof URL) {\n    return {\n      type: \"image\",\n      uri: part.data.toString(),\n      ...isFullMediaType(part.mediaType) ? { mime_type: part.mediaType } : {}\n    };\n  }\n  if (!isFullMediaType(part.mediaType)) {\n    warnings.push({\n      type: \"other\",\n      message: `google.interactions: tool-result image part requires a full IANA media type (e.g. \"image/png\"), got \"${part.mediaType}\"; part dropped.`\n    });\n    return void 0;\n  }\n  return {\n    type: \"image\",\n    data: convertToBase644(part.data),\n    mime_type: part.mediaType\n  };\n}\nfunction mergeAdjacentTextContent(content) {\n  if (content.length < 2) {\n    return content;\n  }\n  const result = [];\n  for (const block of content) {\n    const last = result[result.length - 1];\n    if (block.type === \"text\" && last != null && last.type === \"text\" && last.annotations == null && block.annotations == null) {\n      const merged = {\n        type: \"text\",\n        text: `${last.text}\n\n${block.text}`\n      };\n      result[result.length - 1] = merged;\n      continue;\n    }\n    result.push(block);\n  }\n  return result;\n}\n\n// src/interactions/google-interactions-api.ts\nimport {\n  lazySchema as lazySchema15,\n  zodSchema as zodSchema15\n} from \"@ai-sdk/provider-utils\";\nimport { z as z18 } from \"zod/v4\";\nvar tokenByModalitySchema = () => z18.object({\n  modality: z18.string().nullish(),\n  tokens: z18.number().nullish()\n}).loose();\nvar usageSchema2 = () => z18.object({\n  total_input_tokens: z18.number().nullish(),\n  total_output_tokens: z18.number().nullish(),\n  total_thought_tokens: z18.number().nullish(),\n  total_cached_tokens: z18.number().nullish(),\n  total_tool_use_tokens: z18.number().nullish(),\n  total_tokens: z18.number().nullish(),\n  input_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),\n  output_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),\n  cached_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),\n  tool_use_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),\n  grounding_tool_count: z18.array(\n    z18.object({\n      type: z18.string().nullish(),\n      count: z18.number().nullish()\n    }).loose()\n  ).nullish()\n}).loose();\nvar interactionStatusSchema = () => z18.enum([\n  \"in_progress\",\n  \"requires_action\",\n  \"completed\",\n  \"failed\",\n  \"cancelled\",\n  \"incomplete\"\n]);\nvar annotationSchema = () => {\n  const urlCitation = z18.object({\n    type: z18.literal(\"url_citation\"),\n    url: z18.string().nullish(),\n    title: z18.string().nullish(),\n    start_index: z18.number().nullish(),\n    end_index: z18.number().nullish()\n  }).loose();\n  const fileCitation = z18.object({\n    type: z18.literal(\"file_citation\"),\n    file_name: z18.string().nullish(),\n    document_uri: z18.string().nullish(),\n    url: z18.string().nullish(),\n    page_number: z18.number().nullish(),\n    media_id: z18.string().nullish(),\n    start_index: z18.number().nullish(),\n    end_index: z18.number().nullish(),\n    custom_metadata: z18.record(z18.string(), z18.unknown()).nullish()\n  }).loose();\n  const placeCitation = z18.object({\n    type: z18.literal(\"place_citation\"),\n    name: z18.string().nullish(),\n    url: z18.string().nullish(),\n    place_id: z18.string().nullish(),\n    start_index: z18.number().nullish(),\n    end_index: z18.number().nullish()\n  }).loose();\n  return z18.union([\n    urlCitation,\n    fileCitation,\n    placeCitation,\n    z18.object({ type: z18.string() }).loose()\n  ]);\n};\nvar thoughtSummaryItemSchema = () => z18.object({\n  type: z18.string(),\n  text: z18.string().nullish(),\n  data: z18.string().nullish(),\n  mime_type: z18.string().nullish()\n}).loose();\nvar contentBlockSchema = () => {\n  const textContent = z18.object({\n    type: z18.literal(\"text\"),\n    text: z18.string(),\n    annotations: z18.array(annotationSchema()).nullish()\n  }).loose();\n  const imageContent = z18.object({\n    type: z18.literal(\"image\"),\n    data: z18.string().nullish(),\n    mime_type: z18.string().nullish(),\n    resolution: z18.enum([\"low\", \"medium\", \"high\", \"ultra_high\"]).nullish(),\n    uri: z18.string().nullish()\n  }).loose();\n  const videoContent = z18.object({\n    type: z18.literal(\"video\"),\n    data: z18.string().nullish(),\n    mime_type: z18.string().nullish(),\n    uri: z18.string().nullish()\n  }).loose();\n  return z18.union([\n    textContent,\n    imageContent,\n    videoContent,\n    z18.object({ type: z18.string() }).loose()\n  ]);\n};\nvar BUILTIN_TOOL_CALL_STEP_TYPES = [\n  \"google_search_call\",\n  \"code_execution_call\",\n  \"url_context_call\",\n  \"file_search_call\",\n  \"google_maps_call\",\n  \"mcp_server_tool_call\"\n];\nvar BUILTIN_TOOL_RESULT_STEP_TYPES = [\n  \"google_search_result\",\n  \"code_execution_result\",\n  \"url_context_result\",\n  \"file_search_result\",\n  \"google_maps_result\",\n  \"mcp_server_tool_result\"\n];\nvar stepSchema = () => {\n  const userInputStep = z18.object({\n    type: z18.literal(\"user_input\"),\n    content: z18.array(contentBlockSchema()).nullish()\n  }).loose();\n  const modelOutputStep = z18.object({\n    type: z18.literal(\"model_output\"),\n    content: z18.array(contentBlockSchema()).nullish()\n  }).loose();\n  const functionCallStep = z18.object({\n    type: z18.literal(\"function_call\"),\n    id: z18.string(),\n    name: z18.string(),\n    arguments: z18.record(z18.string(), z18.unknown()).nullish(),\n    signature: z18.string().nullish()\n  }).loose();\n  const thoughtStep = z18.object({\n    type: z18.literal(\"thought\"),\n    signature: z18.string().nullish(),\n    summary: z18.array(thoughtSummaryItemSchema()).nullish()\n  }).loose();\n  const builtinToolCallStep = z18.object({\n    type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),\n    id: z18.string(),\n    arguments: z18.record(z18.string(), z18.unknown()).nullish(),\n    name: z18.string().nullish(),\n    server_name: z18.string().nullish(),\n    search_type: z18.string().nullish(),\n    signature: z18.string().nullish()\n  }).loose();\n  const builtinToolResultStep = z18.object({\n    type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),\n    call_id: z18.string(),\n    result: z18.unknown().nullish(),\n    is_error: z18.boolean().nullish(),\n    name: z18.string().nullish(),\n    server_name: z18.string().nullish(),\n    signature: z18.string().nullish()\n  }).loose();\n  return z18.union([\n    userInputStep,\n    modelOutputStep,\n    functionCallStep,\n    thoughtStep,\n    builtinToolCallStep,\n    builtinToolResultStep,\n    z18.object({ type: z18.string() }).loose()\n  ]);\n};\nvar googleInteractionsResponseSchema = lazySchema15(\n  () => zodSchema15(\n    z18.object({\n      /*\n       * `id` is omitted from the response body when `store: false` (fully\n       * stateless mode) — there is no server-side interaction record for the\n       * client to reference. `nullish` lets the schema accept that shape.\n       */\n      id: z18.string().nullish(),\n      created: z18.string().nullish(),\n      updated: z18.string().nullish(),\n      status: interactionStatusSchema(),\n      model: z18.string().nullish(),\n      agent: z18.string().nullish(),\n      steps: z18.array(stepSchema()).nullish(),\n      usage: usageSchema2().nullish(),\n      service_tier: z18.string().nullish(),\n      previous_interaction_id: z18.string().nullish(),\n      response_modalities: z18.array(z18.string()).nullish()\n    }).loose()\n  )\n);\nvar googleInteractionsEventSchema = lazySchema15(\n  () => zodSchema15(\n    (() => {\n      const status = interactionStatusSchema();\n      const annotation = annotationSchema();\n      const thoughtSummaryItem = thoughtSummaryItemSchema();\n      const interactionCreatedEvent = z18.object({\n        event_type: z18.literal(\"interaction.created\"),\n        event_id: z18.string().nullish(),\n        interaction: z18.object({\n          /*\n           * `id` is omitted when `store: false` (fully stateless mode);\n           * see the matching note on `googleInteractionsResponseSchema.id`.\n           */\n          id: z18.string().nullish(),\n          created: z18.string().nullish(),\n          model: z18.string().nullish(),\n          agent: z18.string().nullish(),\n          status: status.nullish()\n        }).loose()\n      }).loose();\n      const stepStartEvent = z18.object({\n        event_type: z18.literal(\"step.start\"),\n        event_id: z18.string().nullish(),\n        index: z18.number(),\n        step: stepSchema()\n      }).loose();\n      const stepDeltaText = z18.object({\n        type: z18.literal(\"text\"),\n        text: z18.string()\n      }).loose();\n      const stepDeltaThoughtSummary = z18.object({\n        type: z18.literal(\"thought_summary\"),\n        content: thoughtSummaryItem.nullish()\n      }).loose();\n      const stepDeltaThoughtSignature = z18.object({\n        type: z18.literal(\"thought_signature\"),\n        signature: z18.string().nullish()\n      }).loose();\n      const stepDeltaArgumentsDelta = z18.object({\n        type: z18.literal(\"arguments_delta\"),\n        arguments: z18.string().nullish(),\n        id: z18.string().nullish(),\n        signature: z18.string().nullish()\n      }).loose();\n      const stepDeltaTextAnnotation = z18.object({\n        type: z18.enum([\"text_annotation_delta\", \"text_annotation\"]),\n        annotations: z18.array(annotation).nullish()\n      }).loose();\n      const stepDeltaImage = z18.object({\n        type: z18.literal(\"image\"),\n        data: z18.string().nullish(),\n        mime_type: z18.string().nullish(),\n        resolution: z18.enum([\"low\", \"medium\", \"high\", \"ultra_high\"]).nullish(),\n        uri: z18.string().nullish()\n      }).loose();\n      const stepDeltaVideo = z18.object({\n        type: z18.literal(\"video\"),\n        data: z18.string().nullish(),\n        mime_type: z18.string().nullish(),\n        uri: z18.string().nullish()\n      }).loose();\n      const stepDeltaBuiltinToolCall = z18.object({\n        type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),\n        id: z18.string().nullish(),\n        arguments: z18.record(z18.string(), z18.unknown()).nullish(),\n        name: z18.string().nullish(),\n        server_name: z18.string().nullish(),\n        search_type: z18.string().nullish(),\n        signature: z18.string().nullish()\n      }).loose();\n      const stepDeltaBuiltinToolResult = z18.object({\n        type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),\n        call_id: z18.string().nullish(),\n        result: z18.unknown().nullish(),\n        is_error: z18.boolean().nullish(),\n        name: z18.string().nullish(),\n        server_name: z18.string().nullish(),\n        signature: z18.string().nullish()\n      }).loose();\n      const stepDeltaUnknown = z18.object({ type: z18.string() }).loose();\n      const stepDeltaUnion = z18.union([\n        stepDeltaText,\n        stepDeltaImage,\n        stepDeltaVideo,\n        stepDeltaThoughtSummary,\n        stepDeltaThoughtSignature,\n        stepDeltaArgumentsDelta,\n        stepDeltaTextAnnotation,\n        stepDeltaBuiltinToolCall,\n        stepDeltaBuiltinToolResult,\n        stepDeltaUnknown\n      ]);\n      const stepDeltaEvent = z18.object({\n        event_type: z18.literal(\"step.delta\"),\n        event_id: z18.string().nullish(),\n        index: z18.number(),\n        delta: stepDeltaUnion\n      }).loose();\n      const stepStopEvent = z18.object({\n        event_type: z18.literal(\"step.stop\"),\n        event_id: z18.string().nullish(),\n        index: z18.number()\n      }).loose();\n      const interactionStatusUpdateEvent = z18.object({\n        event_type: z18.literal(\"interaction.status_update\"),\n        event_id: z18.string().nullish(),\n        interaction_id: z18.string().nullish(),\n        status: status.nullish()\n      }).loose();\n      const interactionInProgressEvent = z18.object({\n        event_type: z18.literal(\"interaction.in_progress\"),\n        event_id: z18.string().nullish(),\n        interaction_id: z18.string().nullish(),\n        status: status.nullish()\n      }).loose();\n      const interactionRequiresActionEvent = z18.object({\n        event_type: z18.literal(\"interaction.requires_action\"),\n        event_id: z18.string().nullish(),\n        interaction_id: z18.string().nullish(),\n        status: status.nullish()\n      }).loose();\n      const interactionCompletedEvent = z18.object({\n        event_type: z18.literal(\"interaction.completed\"),\n        event_id: z18.string().nullish(),\n        interaction: z18.object({\n          id: z18.string().nullish(),\n          status: status.nullish(),\n          usage: usageSchema2().nullish(),\n          service_tier: z18.string().nullish()\n        }).loose()\n      }).loose();\n      const errorEvent = z18.object({\n        event_type: z18.literal(\"error\"),\n        event_id: z18.string().nullish(),\n        error: z18.object({\n          code: z18.string().nullish(),\n          message: z18.string().nullish()\n        }).loose().nullish()\n      }).loose();\n      const unknownEvent = z18.object({ event_type: z18.string() }).loose();\n      return z18.union([\n        interactionCreatedEvent,\n        stepStartEvent,\n        stepDeltaEvent,\n        stepStopEvent,\n        interactionStatusUpdateEvent,\n        interactionInProgressEvent,\n        interactionRequiresActionEvent,\n        interactionCompletedEvent,\n        errorEvent,\n        unknownEvent\n      ]);\n    })()\n  )\n);\n\n// src/interactions/google-interactions-language-model-options.ts\nimport {\n  lazySchema as lazySchema16,\n  zodSchema as zodSchema16\n} from \"@ai-sdk/provider-utils\";\nimport { z as z19 } from \"zod/v4\";\nvar googleInteractionsLanguageModelOptions = lazySchema16(\n  () => zodSchema16(\n    z19.object({\n      previousInteractionId: z19.string().nullish(),\n      store: z19.boolean().nullish(),\n      agent: z19.string().nullish(),\n      agentConfig: z19.union([\n        z19.object({\n          type: z19.literal(\"dynamic\")\n        }).loose(),\n        z19.object({\n          type: z19.literal(\"deep-research\"),\n          thinkingSummaries: z19.enum([\"auto\", \"none\"]).nullish(),\n          visualization: z19.enum([\"off\", \"auto\"]).nullish(),\n          collaborativePlanning: z19.boolean().nullish()\n        })\n      ]).nullish(),\n      thinkingLevel: z19.enum([\"minimal\", \"low\", \"medium\", \"high\"]).nullish(),\n      thinkingSummaries: z19.enum([\"auto\", \"none\"]).nullish(),\n      /**\n       * Output-format entries that map directly to the API's `response_format`\n       * array. Use this to request image, audio, video, or non-JSON text\n       * outputs with modality-specific controls.\n       *\n       * Entries are sent in order. The AI SDK call-level `responseFormat: {\n       * type: 'json', schema }` still drives JSON-mode and adds a matching\n       * text entry automatically; entries listed here are appended.\n       */\n      responseFormat: z19.array(\n        z19.union([\n          z19.object({\n            type: z19.literal(\"text\"),\n            mimeType: z19.string().nullish(),\n            schema: z19.unknown().nullish()\n          }).loose(),\n          z19.object({\n            type: z19.literal(\"image\"),\n            mimeType: z19.string().nullish(),\n            aspectRatio: z19.enum([\n              \"1:1\",\n              \"2:3\",\n              \"3:2\",\n              \"3:4\",\n              \"4:3\",\n              \"4:5\",\n              \"5:4\",\n              \"9:16\",\n              \"16:9\",\n              \"21:9\",\n              \"1:8\",\n              \"8:1\",\n              \"1:4\",\n              \"4:1\"\n            ]).nullish(),\n            imageSize: z19.enum([\"1K\", \"2K\", \"4K\", \"512\"]).nullish()\n          }).loose(),\n          z19.object({\n            type: z19.literal(\"audio\"),\n            mimeType: z19.string().nullish()\n          }).loose(),\n          z19.object({\n            type: z19.literal(\"video\"),\n            aspectRatio: z19.enum([\"16:9\", \"9:16\"]).nullish(),\n            resolution: z19.enum([\"360p\", \"720p\", \"1080p\", \"4k\"]).nullish(),\n            duration: z19.string().nullish(),\n            delivery: z19.enum([\"inline\", \"uri\"]).nullish(),\n            gcsUri: z19.string().nullish()\n          }).loose()\n        ])\n      ).nullish(),\n      /**\n       * @deprecated Use `responseFormat` with a `{ type: 'image', ... }`\n       * entry instead. Retained for backwards compatibility; the SDK\n       * translates it into a matching `response_format` image entry and\n       * emits a warning when set.\n       */\n      imageConfig: z19.object({\n        aspectRatio: z19.enum([\n          \"1:1\",\n          \"2:3\",\n          \"3:2\",\n          \"3:4\",\n          \"4:3\",\n          \"4:5\",\n          \"5:4\",\n          \"9:16\",\n          \"16:9\",\n          \"21:9\",\n          \"1:8\",\n          \"8:1\",\n          \"1:4\",\n          \"4:1\"\n        ]).nullish(),\n        imageSize: z19.enum([\"1K\", \"2K\", \"4K\", \"512\"]).nullish()\n      }).nullish(),\n      mediaResolution: z19.enum([\"low\", \"medium\", \"high\", \"ultra_high\"]).nullish(),\n      responseModalities: z19.array(z19.enum([\"text\", \"image\", \"audio\", \"video\", \"document\"])).nullish(),\n      serviceTier: z19.enum([\"flex\", \"standard\", \"priority\"]).nullish(),\n      /**\n       * Alternative to AI SDK `system` message. If both are set, the AI SDK\n       * `system` message wins and a warning is emitted.\n       */\n      systemInstruction: z19.string().nullish(),\n      /**\n       * Per-block signature for round-tripping `thought.signature` and\n       * `function_call.signature` blocks. Set by the SDK on output reasoning /\n       * tool-call parts; passed back unchanged on input parts so the API\n       * accepts the prior turn.\n       */\n      signature: z19.string().nullish(),\n      /**\n       * Set by the SDK on output assistant messages. The converter uses it to\n       * decide which messages to drop when compacting under\n       * `previousInteractionId`.\n       */\n      interactionId: z19.string().nullish(),\n      /**\n       * Maximum time, in milliseconds, to poll a background interaction (agent\n       * call) before giving up. Defaults to 30 minutes. Long-running agents\n       * such as deep research can take tens of minutes — increase if needed.\n       */\n      pollingTimeoutMs: z19.number().int().positive().nullish(),\n      /**\n       * Run the interaction in the background. Required for agents whose\n       * server-side workflow cannot complete within a single request/response.\n       * When `true`, the POST returns with a non-terminal status and the SDK\n       * polls `GET /interactions/{id}` until the work completes. Some agents\n       * reject `true`; see the agent's documentation for which mode it\n       * requires.\n       */\n      background: z19.boolean().nullish(),\n      /**\n       * Environment configuration for the agent sandbox. Only applies to agent\n       * calls (`google.interactions({ agent })`); ignored on model-id calls.\n       *\n       *   - `\"remote\"`: provision a fresh sandbox for this call.\n       *   - any other string: an existing `environment_id` to reuse.\n       *   - object: provision a fresh sandbox and optionally preload `sources`\n       *     and/or constrain outbound traffic via `network`.\n       */\n      environment: z19.union([\n        z19.string(),\n        z19.object({\n          type: z19.literal(\"remote\"),\n          sources: z19.array(\n            z19.union([\n              z19.object({\n                type: z19.literal(\"gcs\"),\n                source: z19.string(),\n                target: z19.string().nullish()\n              }),\n              z19.object({\n                type: z19.literal(\"repository\"),\n                source: z19.string(),\n                target: z19.string().nullish()\n              }),\n              z19.object({\n                type: z19.literal(\"inline\"),\n                content: z19.string(),\n                target: z19.string()\n              })\n            ])\n          ).nullish(),\n          network: z19.union([\n            z19.literal(\"disabled\"),\n            z19.object({\n              allowlist: z19.array(\n                z19.object({\n                  domain: z19.string(),\n                  transform: z19.array(z19.record(z19.string(), z19.string())).nullish()\n                })\n              )\n            })\n          ]).nullish()\n        })\n      ]).nullish()\n    })\n  )\n);\n\n// src/interactions/parse-google-interactions-outputs.ts\nfunction googleProviderMetadata({\n  signature,\n  interactionId\n}) {\n  const google2 = {};\n  if (signature != null) {\n    google2.signature = signature;\n  }\n  if (interactionId != null) {\n    google2.interactionId = interactionId;\n  }\n  return Object.keys(google2).length > 0 ? { providerMetadata: { google: google2 } } : {};\n}\nvar BUILTIN_TOOL_CALL_TYPES2 = /* @__PURE__ */ new Set([\n  \"google_search_call\",\n  \"code_execution_call\",\n  \"url_context_call\",\n  \"file_search_call\",\n  \"google_maps_call\",\n  \"mcp_server_tool_call\"\n]);\nvar BUILTIN_TOOL_RESULT_TYPES2 = /* @__PURE__ */ new Set([\n  \"google_search_result\",\n  \"code_execution_result\",\n  \"url_context_result\",\n  \"file_search_result\",\n  \"google_maps_result\",\n  \"mcp_server_tool_result\"\n]);\nfunction builtinToolNameFromCallType2(type) {\n  return type.replace(/_call$/, \"\");\n}\nfunction builtinToolNameFromResultType2(type) {\n  return type.replace(/_result$/, \"\");\n}\nfunction parseGoogleInteractionsOutputs({\n  steps,\n  generateId: generateId3,\n  interactionId\n}) {\n  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;\n  const content = [];\n  let hasFunctionCall = false;\n  if (steps == null) {\n    return { content, hasFunctionCall };\n  }\n  for (const step of steps) {\n    if (step == null || typeof step !== \"object\") continue;\n    const type = step.type;\n    if (typeof type !== \"string\") continue;\n    switch (type) {\n      case \"user_input\": {\n        break;\n      }\n      case \"model_output\": {\n        const blocks = (_a2 = step.content) != null ? _a2 : [];\n        for (const block of blocks) {\n          if (block == null || typeof block !== \"object\") continue;\n          const blockType = block.type;\n          if (blockType === \"text\") {\n            const text = (_b = block.text) != null ? _b : \"\";\n            const annotations = block.annotations;\n            content.push({\n              type: \"text\",\n              text,\n              ...googleProviderMetadata({ interactionId })\n            });\n            const sources = annotationsToSources({ annotations, generateId: generateId3 });\n            for (const source of sources) {\n              content.push(source);\n            }\n          } else if (blockType === \"image\") {\n            const image = block;\n            if (image.data != null && image.data.length > 0) {\n              content.push({\n                type: \"file\",\n                mediaType: (_c = image.mime_type) != null ? _c : \"image/png\",\n                data: image.data,\n                ...googleProviderMetadata({ interactionId })\n              });\n            } else if (image.uri != null && image.uri.length > 0) {\n              content.push({\n                type: \"file\",\n                mediaType: (_d = image.mime_type) != null ? _d : \"image/png\",\n                data: \"\",\n                providerMetadata: {\n                  google: {\n                    ...interactionId != null ? { interactionId } : {},\n                    imageUri: image.uri\n                  }\n                }\n              });\n            }\n          } else if (blockType === \"video\") {\n            const video = block;\n            if (video.data != null && video.data.length > 0) {\n              content.push({\n                type: \"file\",\n                mediaType: (_e = video.mime_type) != null ? _e : \"video/mp4\",\n                data: video.data,\n                ...googleProviderMetadata({ interactionId })\n              });\n            } else if (video.uri != null && video.uri.length > 0) {\n              content.push({\n                type: \"file\",\n                mediaType: (_f = video.mime_type) != null ? _f : \"video/mp4\",\n                data: \"\",\n                providerMetadata: {\n                  google: {\n                    ...interactionId != null ? { interactionId } : {},\n                    videoUri: video.uri\n                  }\n                }\n              });\n            }\n          }\n        }\n        break;\n      }\n      case \"thought\": {\n        const thought = step;\n        const summary = Array.isArray(thought.summary) ? thought.summary : [];\n        const text = summary.filter(\n          (item) => (item == null ? void 0 : item.type) === \"text\" && typeof item.text === \"string\"\n        ).map((item) => item.text).join(\"\\n\");\n        content.push({\n          type: \"reasoning\",\n          text,\n          ...googleProviderMetadata({\n            signature: thought.signature,\n            interactionId\n          })\n        });\n        break;\n      }\n      case \"function_call\": {\n        hasFunctionCall = true;\n        const call = step;\n        content.push({\n          type: \"tool-call\",\n          toolCallId: call.id,\n          toolName: call.name,\n          input: JSON.stringify((_g = call.arguments) != null ? _g : {}),\n          ...googleProviderMetadata({\n            signature: call.signature,\n            interactionId\n          })\n        });\n        break;\n      }\n      default: {\n        if (BUILTIN_TOOL_CALL_TYPES2.has(type)) {\n          const call = step;\n          const toolName = type === \"mcp_server_tool_call\" ? (_h = call.name) != null ? _h : \"mcp_server_tool\" : builtinToolNameFromCallType2(type);\n          const input = JSON.stringify((_i = call.arguments) != null ? _i : {});\n          content.push({\n            type: \"tool-call\",\n            toolCallId: (_j = call.id) != null ? _j : generateId3(),\n            toolName,\n            input,\n            providerExecuted: true\n          });\n        } else if (BUILTIN_TOOL_RESULT_TYPES2.has(type)) {\n          const result = step;\n          const toolName = type === \"mcp_server_tool_result\" ? (_k = result.name) != null ? _k : \"mcp_server_tool\" : builtinToolNameFromResultType2(type);\n          content.push({\n            type: \"tool-result\",\n            toolCallId: (_l = result.call_id) != null ? _l : generateId3(),\n            toolName,\n            result: (_m = result.result) != null ? _m : null\n          });\n          const sources = builtinToolResultToSources({\n            block: step,\n            generateId: generateId3\n          });\n          for (const source of sources) {\n            content.push(source);\n          }\n        }\n        break;\n      }\n    }\n  }\n  return { content, hasFunctionCall };\n}\n\n// src/interactions/poll-google-interactions.ts\nimport {\n  createJsonResponseHandler as createJsonResponseHandler6,\n  delay as delay2,\n  getFromApi as getFromApi2,\n  isAbortError\n} from \"@ai-sdk/provider-utils\";\n\n// src/interactions/cancel-google-interaction.ts\nimport {\n  combineHeaders as combineHeaders6,\n  getRuntimeEnvironmentUserAgent,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\nvar getOriginalFetch = () => globalThis.fetch;\nasync function cancelGoogleInteraction({\n  baseURL,\n  interactionId,\n  headers,\n  fetch = getOriginalFetch()\n}) {\n  if (interactionId == null || interactionId.length === 0) {\n    return;\n  }\n  const url = `${baseURL}/interactions/${encodeURIComponent(interactionId)}/cancel`;\n  try {\n    const response = await fetch(url, {\n      method: \"POST\",\n      headers: withUserAgentSuffix(\n        combineHeaders6({ \"Content-Type\": \"application/json\" }, headers),\n        getRuntimeEnvironmentUserAgent()\n      ),\n      body: \"{}\"\n    });\n    try {\n      await response.text();\n    } catch (e) {\n    }\n  } catch (e) {\n  }\n}\n\n// src/interactions/poll-google-interactions.ts\nvar TERMINAL_STATUSES = /* @__PURE__ */ new Set([\"completed\", \"failed\", \"cancelled\", \"incomplete\"]);\nfunction isTerminalStatus(status) {\n  return status != null && TERMINAL_STATUSES.has(status);\n}\nvar DEFAULT_INITIAL_DELAY_MS = 1e3;\nvar DEFAULT_MAX_DELAY_MS = 1e4;\nvar DEFAULT_TIMEOUT_MS = 30 * 60 * 1e3;\nasync function pollGoogleInteractionUntilTerminal({\n  baseURL,\n  interactionId,\n  headers,\n  fetch,\n  abortSignal,\n  initialDelayMs = DEFAULT_INITIAL_DELAY_MS,\n  maxDelayMs = DEFAULT_MAX_DELAY_MS,\n  timeoutMs = DEFAULT_TIMEOUT_MS\n}) {\n  if (interactionId == null || interactionId.length === 0) {\n    throw new Error(\n      \"google.interactions: cannot poll a background interaction without an id. The POST response did not include an interaction id.\"\n    );\n  }\n  const startedAt = Date.now();\n  let nextDelayMs = initialDelayMs;\n  const url = `${baseURL}/interactions/${encodeURIComponent(interactionId)}`;\n  const cancelOnServer = () => cancelGoogleInteraction({ baseURL, interactionId, headers, fetch });\n  try {\n    while (true) {\n      if (abortSignal == null ? void 0 : abortSignal.aborted) {\n        await cancelOnServer();\n        throw new DOMException(\"Polling was aborted\", \"AbortError\");\n      }\n      if (Date.now() - startedAt > timeoutMs) {\n        throw new Error(\n          `google.interactions: timed out polling interaction ${interactionId} after ${timeoutMs}ms.`\n        );\n      }\n      await delay2(nextDelayMs, { abortSignal });\n      const {\n        value: response,\n        rawValue: rawResponse,\n        responseHeaders\n      } = await getFromApi2({\n        url,\n        headers,\n        failedResponseHandler: googleFailedResponseHandler,\n        successfulResponseHandler: createJsonResponseHandler6(\n          googleInteractionsResponseSchema\n        ),\n        abortSignal,\n        fetch\n      });\n      if (isTerminalStatus(response.status)) {\n        return { response, rawResponse, responseHeaders };\n      }\n      nextDelayMs = Math.min(nextDelayMs * 2, maxDelayMs);\n    }\n  } catch (error) {\n    if (isAbortError(error)) {\n      await cancelOnServer();\n    }\n    throw error;\n  }\n}\n\n// src/interactions/prepare-google-interactions-tools.ts\nfunction prepareGoogleInteractionsTools({\n  tools,\n  toolChoice\n}) {\n  var _a2, _b, _c, _d;\n  const toolWarnings = [];\n  const normalized = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  if (normalized == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings };\n  }\n  const interactionsTools = [];\n  for (const tool of normalized) {\n    if (tool.type === \"function\") {\n      interactionsTools.push({\n        type: \"function\",\n        name: tool.name,\n        description: (_a2 = tool.description) != null ? _a2 : \"\",\n        parameters: tool.inputSchema\n      });\n      continue;\n    }\n    if (tool.type === \"provider\") {\n      const args = (_b = tool.args) != null ? _b : {};\n      switch (tool.id) {\n        case \"google.google_search\": {\n          const searchTypesArg = args.searchTypes;\n          let search_types;\n          if (searchTypesArg != null && typeof searchTypesArg === \"object\") {\n            const list = [];\n            if (searchTypesArg.webSearch != null) list.push(\"web_search\");\n            if (searchTypesArg.imageSearch != null) list.push(\"image_search\");\n            if (list.length > 0) {\n              search_types = list;\n            }\n          }\n          interactionsTools.push({\n            type: \"google_search\",\n            ...search_types != null ? { search_types } : {}\n          });\n          break;\n        }\n        case \"google.code_execution\": {\n          interactionsTools.push({ type: \"code_execution\" });\n          break;\n        }\n        case \"google.url_context\": {\n          interactionsTools.push({ type: \"url_context\" });\n          break;\n        }\n        case \"google.file_search\": {\n          interactionsTools.push({\n            type: \"file_search\",\n            ...args.fileSearchStoreNames != null ? {\n              file_search_store_names: args.fileSearchStoreNames\n            } : {},\n            ...args.topK != null ? { top_k: args.topK } : {},\n            ...args.metadataFilter != null ? { metadata_filter: args.metadataFilter } : {}\n          });\n          break;\n        }\n        case \"google.google_maps\": {\n          interactionsTools.push({\n            type: \"google_maps\",\n            ...args.latitude != null ? { latitude: args.latitude } : {},\n            ...args.longitude != null ? { longitude: args.longitude } : {},\n            ...args.enableWidget != null ? { enable_widget: args.enableWidget } : {}\n          });\n          break;\n        }\n        case \"google.computer_use\": {\n          interactionsTools.push({\n            type: \"computer_use\",\n            environment: (_c = args.environment) != null ? _c : \"browser\",\n            ...args.excludedPredefinedFunctions != null ? {\n              excludedPredefinedFunctions: args.excludedPredefinedFunctions\n            } : {}\n          });\n          break;\n        }\n        case \"google.mcp_server\": {\n          interactionsTools.push({\n            type: \"mcp_server\",\n            ...args.name != null ? { name: args.name } : {},\n            ...args.url != null ? { url: args.url } : {},\n            ...args.headers != null ? { headers: args.headers } : {},\n            ...args.allowedTools != null ? { allowed_tools: args.allowedTools } : {}\n          });\n          break;\n        }\n        case \"google.retrieval\": {\n          const vertexAiSearchConfig = (_d = args.vertexAiSearchConfig) != null ? _d : void 0;\n          interactionsTools.push({\n            type: \"retrieval\",\n            ...args.retrievalTypes != null ? {\n              retrieval_types: args.retrievalTypes\n            } : { retrieval_types: [\"vertex_ai_search\"] },\n            ...vertexAiSearchConfig != null ? { vertex_ai_search_config: vertexAiSearchConfig } : {}\n          });\n          break;\n        }\n        default: {\n          toolWarnings.push({\n            type: \"unsupported\",\n            feature: `provider-defined tool ${tool.id}`,\n            details: `provider-defined tool ${tool.id} is not supported by google.interactions; tool dropped.`\n          });\n          break;\n        }\n      }\n      continue;\n    }\n    toolWarnings.push({\n      type: \"unsupported\",\n      feature: `tool of type ${tool.type}`,\n      details: \"Only function tools and google.* provider-defined tools are supported by google.interactions; tool dropped.\"\n    });\n  }\n  const hasFunctionTool = interactionsTools.some((t) => t.type === \"function\");\n  let mappedToolChoice;\n  if (toolChoice != null && hasFunctionTool) {\n    switch (toolChoice.type) {\n      case \"auto\":\n        mappedToolChoice = \"auto\";\n        break;\n      case \"required\":\n        mappedToolChoice = \"any\";\n        break;\n      case \"none\":\n        mappedToolChoice = \"none\";\n        break;\n      case \"tool\":\n        mappedToolChoice = {\n          allowed_tools: {\n            mode: \"validated\",\n            tools: [toolChoice.toolName]\n          }\n        };\n        break;\n    }\n  }\n  return {\n    tools: interactionsTools.length > 0 ? interactionsTools : void 0,\n    toolChoice: mappedToolChoice,\n    toolWarnings\n  };\n}\n\n// src/interactions/stream-google-interactions.ts\nimport {\n  createEventSourceResponseHandler as createEventSourceResponseHandler2,\n  delay as delay3,\n  getFromApi as getFromApi3,\n  isAbortError as isAbortError2\n} from \"@ai-sdk/provider-utils\";\nvar DEFAULT_MAX_RETRIES = 3;\nvar DEFAULT_RETRY_DELAY_MS = 500;\nfunction streamGoogleInteractionEvents({\n  baseURL,\n  interactionId,\n  headers,\n  fetch,\n  abortSignal,\n  maxRetries = DEFAULT_MAX_RETRIES,\n  retryDelayMs = DEFAULT_RETRY_DELAY_MS\n}) {\n  if (interactionId.length === 0) {\n    throw new Error(\n      \"google.interactions: cannot stream a background interaction without an id.\"\n    );\n  }\n  const eventSourceHeaders = {\n    ...headers,\n    accept: \"text/event-stream\"\n  };\n  let lastEventId;\n  let complete = false;\n  let attempt = 0;\n  let receivedAnyEventThisAttempt = false;\n  let currentReader;\n  const internalAbort = new AbortController();\n  const upstreamAbortHandler = () => internalAbort.abort();\n  if (abortSignal != null) {\n    if (abortSignal.aborted) {\n      internalAbort.abort();\n    } else {\n      abortSignal.addEventListener(\"abort\", upstreamAbortHandler, {\n        once: true\n      });\n    }\n  }\n  const effectiveSignal = internalAbort.signal;\n  function buildUrl() {\n    const base = `${baseURL}/interactions/${encodeURIComponent(interactionId)}`;\n    const params = new URLSearchParams({ stream: \"true\" });\n    if (lastEventId != null) {\n      params.set(\"last_event_id\", lastEventId);\n    }\n    return `${base}?${params.toString()}`;\n  }\n  async function openReader() {\n    const { value: stream } = await getFromApi3({\n      url: buildUrl(),\n      headers: eventSourceHeaders,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler2(\n        googleInteractionsEventSchema\n      ),\n      abortSignal: effectiveSignal,\n      fetch\n    });\n    return stream.getReader();\n  }\n  return new ReadableStream({\n    async start(controller) {\n      try {\n        while (!complete && !effectiveSignal.aborted) {\n          if (currentReader == null) {\n            try {\n              currentReader = await openReader();\n              receivedAnyEventThisAttempt = false;\n            } catch (error) {\n              if (isAbortError2(error) || effectiveSignal.aborted) {\n                controller.error(error);\n                return;\n              }\n              attempt++;\n              if (attempt >= maxRetries) {\n                controller.error(error);\n                return;\n              }\n              await delay3(retryDelayMs * attempt, {\n                abortSignal: effectiveSignal\n              });\n              continue;\n            }\n          }\n          try {\n            const { done, value } = await currentReader.read();\n            if (done) {\n              currentReader = void 0;\n              if (complete) break;\n              if (!receivedAnyEventThisAttempt) {\n                attempt++;\n                if (attempt >= maxRetries) {\n                  controller.error(\n                    new Error(\n                      \"google.interactions: SSE stream closed without producing any events.\"\n                    )\n                  );\n                  return;\n                }\n                await delay3(retryDelayMs * attempt, {\n                  abortSignal: effectiveSignal\n                });\n              } else {\n                attempt = 0;\n              }\n              continue;\n            }\n            receivedAnyEventThisAttempt = true;\n            if (value.success) {\n              const ev = value.value;\n              if (typeof ev.event_id === \"string\" && ev.event_id.length > 0) {\n                lastEventId = ev.event_id;\n              }\n              if (ev.event_type === \"interaction.completed\" || ev.event_type === \"error\") {\n                complete = true;\n              }\n            }\n            controller.enqueue(value);\n          } catch (error) {\n            if (isAbortError2(error) || effectiveSignal.aborted) {\n              controller.error(error);\n              return;\n            }\n            currentReader = void 0;\n            attempt++;\n            if (attempt >= maxRetries) {\n              controller.error(error);\n              return;\n            }\n            await delay3(retryDelayMs * attempt, {\n              abortSignal: effectiveSignal\n            });\n          }\n        }\n        controller.close();\n      } catch (error) {\n        controller.error(error);\n      } finally {\n        if (abortSignal != null) {\n          abortSignal.removeEventListener(\"abort\", upstreamAbortHandler);\n        }\n        currentReader == null ? void 0 : currentReader.cancel().catch(() => {\n        });\n        currentReader = void 0;\n        if (effectiveSignal.aborted && !complete) {\n          await cancelGoogleInteraction({\n            baseURL,\n            interactionId,\n            headers,\n            fetch\n          });\n        }\n      }\n    },\n    cancel() {\n      internalAbort.abort();\n      currentReader == null ? void 0 : currentReader.cancel().catch(() => {\n      });\n      currentReader = void 0;\n    }\n  });\n}\n\n// src/interactions/synthesize-google-interactions-agent-stream.ts\nfunction synthesizeGoogleInteractionsAgentStream({\n  response,\n  warnings,\n  generateId: generateId3,\n  includeRawChunks,\n  headerServiceTier\n}) {\n  return new ReadableStream({\n    start(controller) {\n      var _a2, _b, _c;\n      controller.enqueue({ type: \"stream-start\", warnings });\n      const interactionId = typeof response.id === \"string\" && response.id.length > 0 ? response.id : void 0;\n      let timestamp;\n      const created = response.created;\n      if (typeof created === \"string\") {\n        const parsed = new Date(created);\n        if (!Number.isNaN(parsed.getTime())) {\n          timestamp = parsed;\n        }\n      }\n      controller.enqueue({\n        type: \"response-metadata\",\n        ...interactionId != null ? { id: interactionId } : {},\n        modelId: (_a2 = response.model) != null ? _a2 : void 0,\n        ...timestamp ? { timestamp } : {}\n      });\n      if (includeRawChunks) {\n        controller.enqueue({ type: \"raw\", rawValue: response });\n      }\n      const { content, hasFunctionCall } = parseGoogleInteractionsOutputs({\n        steps: (_b = response.steps) != null ? _b : null,\n        generateId: generateId3,\n        interactionId\n      });\n      let blockCounter = 0;\n      const nextBlockId = () => `${interactionId != null ? interactionId : \"agent\"}:${blockCounter++}`;\n      for (const part of content) {\n        switch (part.type) {\n          case \"text\": {\n            const id = nextBlockId();\n            const providerMetadata2 = part.providerMetadata;\n            controller.enqueue({ type: \"text-start\", id });\n            if (part.text.length > 0) {\n              controller.enqueue({ type: \"text-delta\", id, delta: part.text });\n            }\n            controller.enqueue({\n              type: \"text-end\",\n              id,\n              ...providerMetadata2 ? { providerMetadata: providerMetadata2 } : {}\n            });\n            break;\n          }\n          case \"reasoning\": {\n            const id = nextBlockId();\n            const providerMetadata2 = part.providerMetadata;\n            controller.enqueue({ type: \"reasoning-start\", id });\n            if (part.text.length > 0) {\n              controller.enqueue({\n                type: \"reasoning-delta\",\n                id,\n                delta: part.text\n              });\n            }\n            controller.enqueue({\n              type: \"reasoning-end\",\n              id,\n              ...providerMetadata2 ? { providerMetadata: providerMetadata2 } : {}\n            });\n            break;\n          }\n          case \"tool-call\": {\n            const providerMetadata2 = part.providerMetadata;\n            controller.enqueue({\n              type: \"tool-input-start\",\n              id: part.toolCallId,\n              toolName: part.toolName,\n              ...part.providerExecuted ? { providerExecuted: part.providerExecuted } : {}\n            });\n            controller.enqueue({\n              type: \"tool-input-delta\",\n              id: part.toolCallId,\n              delta: part.input\n            });\n            controller.enqueue({\n              type: \"tool-input-end\",\n              id: part.toolCallId\n            });\n            controller.enqueue({\n              type: \"tool-call\",\n              toolCallId: part.toolCallId,\n              toolName: part.toolName,\n              input: part.input,\n              ...part.providerExecuted ? { providerExecuted: part.providerExecuted } : {},\n              ...providerMetadata2 ? { providerMetadata: providerMetadata2 } : {}\n            });\n            break;\n          }\n          case \"tool-result\": {\n            controller.enqueue({\n              type: \"tool-result\",\n              toolCallId: part.toolCallId,\n              toolName: part.toolName,\n              result: part.result\n            });\n            break;\n          }\n          case \"source\":\n          case \"file\": {\n            controller.enqueue(part);\n            break;\n          }\n          default:\n            break;\n        }\n      }\n      const serviceTier = (_c = response.service_tier) != null ? _c : headerServiceTier;\n      const finishReason = {\n        unified: mapGoogleInteractionsFinishReason({\n          status: response.status,\n          hasFunctionCall\n        }),\n        raw: response.status\n      };\n      const providerMetadata = {\n        google: {\n          ...interactionId != null ? { interactionId } : {},\n          ...serviceTier != null ? { serviceTier } : {}\n        }\n      };\n      controller.enqueue({\n        type: \"finish\",\n        finishReason,\n        usage: convertGoogleInteractionsUsage(response.usage),\n        providerMetadata\n      });\n      controller.close();\n    }\n  });\n}\n\n// src/interactions/google-interactions-language-model.ts\nvar GoogleInteractionsLanguageModel = class {\n  constructor(modelOrAgent, config) {\n    this.specificationVersion = \"v3\";\n    if (typeof modelOrAgent === \"string\") {\n      this.modelId = modelOrAgent;\n      this.agent = void 0;\n    } else if (\"managedAgent\" in modelOrAgent) {\n      this.modelId = modelOrAgent.managedAgent;\n      this.agent = modelOrAgent.managedAgent;\n    } else {\n      this.modelId = modelOrAgent.agent;\n      this.agent = modelOrAgent.agent;\n    }\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  get supportedUrls() {\n    if (this.config.supportedUrls) {\n      return this.config.supportedUrls();\n    }\n    return {\n      \"image/*\": [/^https?:\\/\\/.+/],\n      \"application/pdf\": [/^https?:\\/\\/.+/],\n      \"audio/*\": [/^https?:\\/\\/.+/],\n      \"video/*\": [\n        /^https?:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=.+/,\n        /^https?:\\/\\/youtu\\.be\\/.+/,\n        /^gs:\\/\\/.+/\n      ]\n    };\n  }\n  async getArgs(options) {\n    var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;\n    const warnings = [];\n    const opts = await parseProviderOptions6({\n      provider: \"google\",\n      providerOptions: options.providerOptions,\n      schema: googleInteractionsLanguageModelOptions\n    });\n    const isAgent = this.agent != null;\n    if (!isAgent) {\n      if (options.frequencyPenalty != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"frequencyPenalty\"\n        });\n      }\n      if (options.presencePenalty != null) {\n        warnings.push({\n          type: \"unsupported\",\n          feature: \"presencePenalty\"\n        });\n      }\n    }\n    const hasTools = options.tools != null && options.tools.length > 0;\n    let toolsForBody;\n    let toolChoiceForBody;\n    if (hasTools) {\n      const prepared = prepareGoogleInteractionsTools({\n        tools: options.tools,\n        toolChoice: options.toolChoice\n      });\n      toolsForBody = prepared.tools;\n      toolChoiceForBody = prepared.toolChoice;\n      warnings.push(...prepared.toolWarnings);\n    }\n    const responseFormatEntries = [];\n    if (((_a2 = options.responseFormat) == null ? void 0 : _a2.type) === \"json\") {\n      if (isAgent) {\n        warnings.push({\n          type: \"other\",\n          message: \"google.interactions: structured output (responseFormat) is not supported when an agent is set; responseFormat will be ignored.\"\n        });\n      } else {\n        const entry = {\n          type: \"text\",\n          mime_type: \"application/json\",\n          ...options.responseFormat.schema != null ? { schema: options.responseFormat.schema } : {}\n        };\n        responseFormatEntries.push(entry);\n      }\n    }\n    if ((opts == null ? void 0 : opts.responseFormat) != null) {\n      for (const entry of opts.responseFormat) {\n        if (entry.type === \"text\") {\n          responseFormatEntries.push(\n            pruneUndefined({\n              type: \"text\",\n              mime_type: (_b = entry.mimeType) != null ? _b : void 0,\n              schema: (_c = entry.schema) != null ? _c : void 0\n            })\n          );\n        } else if (entry.type === \"image\") {\n          responseFormatEntries.push(\n            pruneUndefined({\n              type: \"image\",\n              mime_type: (_d = entry.mimeType) != null ? _d : void 0,\n              aspect_ratio: (_e = entry.aspectRatio) != null ? _e : void 0,\n              image_size: (_f = entry.imageSize) != null ? _f : void 0\n            })\n          );\n        } else if (entry.type === \"audio\") {\n          responseFormatEntries.push(\n            pruneUndefined({\n              type: \"audio\",\n              mime_type: (_g = entry.mimeType) != null ? _g : void 0\n            })\n          );\n        } else if (entry.type === \"video\") {\n          responseFormatEntries.push(\n            pruneUndefined({\n              type: \"video\",\n              aspect_ratio: (_h = entry.aspectRatio) != null ? _h : void 0,\n              resolution: (_i = entry.resolution) != null ? _i : void 0,\n              duration: (_j = entry.duration) != null ? _j : void 0,\n              delivery: (_k = entry.delivery) != null ? _k : void 0,\n              gcs_uri: (_l = entry.gcsUri) != null ? _l : void 0\n            })\n          );\n        }\n      }\n    }\n    const {\n      input,\n      systemInstruction: convertedSystemInstruction,\n      warnings: convWarnings\n    } = convertToGoogleInteractionsInput({\n      prompt: options.prompt,\n      previousInteractionId: (_m = opts == null ? void 0 : opts.previousInteractionId) != null ? _m : void 0,\n      store: (_n = opts == null ? void 0 : opts.store) != null ? _n : void 0,\n      mediaResolution: (_o = opts == null ? void 0 : opts.mediaResolution) != null ? _o : void 0\n    });\n    warnings.push(...convWarnings);\n    let systemInstruction = convertedSystemInstruction;\n    const optionSystemInstruction = (_p = opts == null ? void 0 : opts.systemInstruction) != null ? _p : void 0;\n    if (systemInstruction != null && optionSystemInstruction != null) {\n      warnings.push({\n        type: \"other\",\n        message: \"google.interactions: both AI SDK system message and providerOptions.google.systemInstruction were set; using the AI SDK system message.\"\n      });\n    } else if (systemInstruction == null && optionSystemInstruction != null) {\n      systemInstruction = optionSystemInstruction;\n    }\n    let generationConfig;\n    if (isAgent) {\n      const droppedFields = [];\n      if (options.temperature != null) droppedFields.push(\"temperature\");\n      if (options.topP != null) droppedFields.push(\"topP\");\n      if (options.topK != null) droppedFields.push(\"topK\");\n      if (options.frequencyPenalty != null)\n        droppedFields.push(\"frequencyPenalty\");\n      if (options.presencePenalty != null)\n        droppedFields.push(\"presencePenalty\");\n      if (options.seed != null) droppedFields.push(\"seed\");\n      if (options.stopSequences != null && options.stopSequences.length > 0) {\n        droppedFields.push(\"stopSequences\");\n      }\n      if (options.maxOutputTokens != null)\n        droppedFields.push(\"maxOutputTokens\");\n      if ((opts == null ? void 0 : opts.thinkingLevel) != null) droppedFields.push(\"thinkingLevel\");\n      if ((opts == null ? void 0 : opts.thinkingSummaries) != null) {\n        droppedFields.push(\"thinkingSummaries\");\n      }\n      if ((opts == null ? void 0 : opts.imageConfig) != null) droppedFields.push(\"imageConfig\");\n      if (droppedFields.length > 0) {\n        warnings.push({\n          type: \"other\",\n          message: `google.interactions: ${droppedFields.join(\", \")} ${droppedFields.length === 1 ? \"is\" : \"are\"} not supported when an agent is set; use providerOptions.google.agentConfig instead. Dropped from the request body.`\n        });\n      }\n      generationConfig = void 0;\n    } else {\n      generationConfig = pruneUndefined({\n        temperature: (_q = options.temperature) != null ? _q : void 0,\n        top_p: (_r = options.topP) != null ? _r : void 0,\n        top_k: (_s = options.topK) != null ? _s : void 0,\n        seed: (_t = options.seed) != null ? _t : void 0,\n        stop_sequences: options.stopSequences != null && options.stopSequences.length > 0 ? options.stopSequences : void 0,\n        max_output_tokens: (_u = options.maxOutputTokens) != null ? _u : void 0,\n        thinking_level: (_v = opts == null ? void 0 : opts.thinkingLevel) != null ? _v : void 0,\n        thinking_summaries: (_w = opts == null ? void 0 : opts.thinkingSummaries) != null ? _w : void 0,\n        tool_choice: toolChoiceForBody\n      });\n      if ((opts == null ? void 0 : opts.imageConfig) != null) {\n        const alreadyHasImageEntry = responseFormatEntries.some(\n          (entry) => entry.type === \"image\"\n        );\n        warnings.push({\n          type: \"other\",\n          message: alreadyHasImageEntry ? \"google.interactions: providerOptions.google.imageConfig is deprecated and was ignored because providerOptions.google.responseFormat already supplies an image entry. Use responseFormat exclusively.\" : 'google.interactions: providerOptions.google.imageConfig is deprecated. Use providerOptions.google.responseFormat with a { type: \"image\", ... } entry instead.'\n        });\n        if (!alreadyHasImageEntry) {\n          responseFormatEntries.push({\n            type: \"image\",\n            mime_type: \"image/png\",\n            ...opts.imageConfig.aspectRatio != null ? { aspect_ratio: opts.imageConfig.aspectRatio } : {},\n            ...opts.imageConfig.imageSize != null ? { image_size: opts.imageConfig.imageSize } : {}\n          });\n        }\n      }\n    }\n    let agentConfig;\n    if (isAgent && (opts == null ? void 0 : opts.agentConfig) != null) {\n      const ac = opts.agentConfig;\n      if (ac.type === \"deep-research\") {\n        agentConfig = pruneUndefined({\n          type: \"deep-research\",\n          thinking_summaries: (_x = ac.thinkingSummaries) != null ? _x : void 0,\n          visualization: (_y = ac.visualization) != null ? _y : void 0,\n          collaborative_planning: (_z = ac.collaborativePlanning) != null ? _z : void 0\n        });\n      } else if (ac.type === \"dynamic\") {\n        agentConfig = { type: \"dynamic\" };\n      }\n    }\n    let environment;\n    if ((opts == null ? void 0 : opts.environment) != null) {\n      if (!isAgent) {\n        warnings.push({\n          type: \"other\",\n          message: \"google.interactions: environment is only supported when an agent is set; environment will be omitted from the request body.\"\n        });\n      } else if (typeof opts.environment === \"string\") {\n        environment = opts.environment;\n      } else {\n        const env = opts.environment;\n        const sources = (_A = env.sources) == null ? void 0 : _A.map((s) => {\n          var _a3;\n          if (s.type === \"inline\") {\n            return {\n              type: \"inline\",\n              content: s.content,\n              target: s.target\n            };\n          }\n          return pruneUndefined({\n            type: s.type,\n            source: s.source,\n            target: (_a3 = s.target) != null ? _a3 : void 0\n          });\n        });\n        let network;\n        if (env.network === \"disabled\") {\n          network = \"disabled\";\n        } else if (env.network != null) {\n          network = {\n            allowlist: env.network.allowlist.map(\n              (entry) => {\n                var _a3;\n                return pruneUndefined({\n                  domain: entry.domain,\n                  transform: (_a3 = entry.transform) != null ? _a3 : void 0\n                });\n              }\n            )\n          };\n        }\n        environment = pruneUndefined({\n          type: \"remote\",\n          sources: sources != null && sources.length > 0 ? sources : void 0,\n          network\n        });\n      }\n    }\n    const args = pruneUndefined({\n      ...isAgent ? { agent: this.agent } : { model: this.modelId },\n      input,\n      system_instruction: systemInstruction,\n      tools: toolsForBody,\n      response_format: responseFormatEntries.length > 0 ? responseFormatEntries : void 0,\n      response_modalities: (opts == null ? void 0 : opts.responseModalities) != null ? opts.responseModalities : void 0,\n      previous_interaction_id: (_B = opts == null ? void 0 : opts.previousInteractionId) != null ? _B : void 0,\n      service_tier: (_C = opts == null ? void 0 : opts.serviceTier) != null ? _C : void 0,\n      store: (_D = opts == null ? void 0 : opts.store) != null ? _D : void 0,\n      generation_config: generationConfig != null && Object.keys(generationConfig).length > 0 ? generationConfig : void 0,\n      agent_config: agentConfig,\n      environment,\n      background: (_E = opts == null ? void 0 : opts.background) != null ? _E : void 0\n    });\n    return {\n      args,\n      warnings,\n      isAgent,\n      isBackground: (opts == null ? void 0 : opts.background) === true,\n      pollingTimeoutMs: (_F = opts == null ? void 0 : opts.pollingTimeoutMs) != null ? _F : void 0\n    };\n  }\n  async doGenerate(options) {\n    var _a2, _b, _c, _d, _e, _f;\n    const { args, warnings, isAgent, isBackground, pollingTimeoutMs } = await this.getArgs(options);\n    const url = `${this.config.baseURL}/interactions`;\n    const mergedHeaders = combineHeaders7(\n      INTERACTIONS_API_REVISION_HEADER,\n      this.config.headers ? await resolve6(this.config.headers) : void 0,\n      options.headers\n    );\n    const postResult = await postJsonToApi6({\n      url,\n      headers: mergedHeaders,\n      body: args,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler7(\n        googleInteractionsResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = postResult;\n    if ((isAgent || isBackground) && !isTerminalStatus(response.status)) {\n      const polled = await pollGoogleInteractionUntilTerminal({\n        baseURL: this.config.baseURL,\n        interactionId: response.id,\n        headers: mergedHeaders,\n        fetch: this.config.fetch,\n        abortSignal: options.abortSignal,\n        timeoutMs: pollingTimeoutMs\n      });\n      response = polled.response;\n      rawResponse = polled.rawResponse;\n      responseHeaders = (_a2 = polled.responseHeaders) != null ? _a2 : responseHeaders;\n    }\n    const interactionId = typeof response.id === \"string\" && response.id.length > 0 ? response.id : void 0;\n    const { content, hasFunctionCall } = parseGoogleInteractionsOutputs({\n      steps: (_b = response.steps) != null ? _b : null,\n      generateId: (_c = this.config.generateId) != null ? _c : defaultGenerateId2,\n      interactionId\n    });\n    const finishReason = {\n      unified: mapGoogleInteractionsFinishReason({\n        status: response.status,\n        hasFunctionCall\n      }),\n      raw: response.status\n    };\n    const serviceTier = (_e = (_d = response.service_tier) != null ? _d : responseHeaders == null ? void 0 : responseHeaders[\"x-gemini-service-tier\"]) != null ? _e : void 0;\n    const outputTokensByModality = getGoogleInteractionsOutputTokensByModality(\n      response.usage\n    );\n    const providerMetadata = {\n      google: {\n        ...interactionId != null ? { interactionId } : {},\n        ...serviceTier != null ? { serviceTier } : {},\n        ...outputTokensByModality != null ? { outputTokensByModality } : {}\n      }\n    };\n    let timestamp;\n    if (typeof response.created === \"string\") {\n      const parsed = new Date(response.created);\n      if (!Number.isNaN(parsed.getTime())) {\n        timestamp = parsed;\n      }\n    }\n    return {\n      content,\n      finishReason,\n      usage: convertGoogleInteractionsUsage(response.usage),\n      warnings,\n      providerMetadata,\n      request: { body: args },\n      response: {\n        headers: responseHeaders,\n        body: rawResponse,\n        ...interactionId != null ? { id: interactionId } : {},\n        ...timestamp ? { timestamp } : {},\n        modelId: (_f = response.model) != null ? _f : void 0\n      }\n    };\n  }\n  async doStream(options) {\n    var _a2;\n    const { args, warnings, isBackground, pollingTimeoutMs } = await this.getArgs(options);\n    const url = `${this.config.baseURL}/interactions`;\n    const mergedHeaders = combineHeaders7(\n      INTERACTIONS_API_REVISION_HEADER,\n      this.config.headers ? await resolve6(this.config.headers) : void 0,\n      options.headers\n    );\n    if (isBackground) {\n      return this.doStreamBackground({\n        args,\n        warnings,\n        url,\n        mergedHeaders,\n        options,\n        pollingTimeoutMs\n      });\n    }\n    const body = { ...args, stream: true };\n    const { responseHeaders, value: response } = await postJsonToApi6({\n      url,\n      headers: mergedHeaders,\n      body,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler3(\n        googleInteractionsEventSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const headerServiceTier = responseHeaders == null ? void 0 : responseHeaders[\"x-gemini-service-tier\"];\n    const transform = buildGoogleInteractionsStreamTransform({\n      warnings,\n      generateId: (_a2 = this.config.generateId) != null ? _a2 : defaultGenerateId2,\n      includeRawChunks: options.includeRawChunks,\n      serviceTier: headerServiceTier\n    });\n    return {\n      stream: response.pipeThrough(transform),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n  /*\n   * Drive the streaming surface for agent calls. Agents require\n   * `background: true`, which is incompatible with `stream: true` on POST.\n   *\n   * Approach:\n   *   1. POST `/interactions` with `background: true`. The response includes\n   *      the interaction id and an initial (usually non-terminal) status.\n   *   2. If the POST status is already terminal (rare), synthesize a stream\n   *      from the polled outputs and we're done.\n   *   3. Otherwise open `GET /interactions/{id}?stream=true` and pipe the\n   *      SSE events through `buildGoogleInteractionsStreamTransform` so the\n   *      consumer receives text deltas / thinking summaries / tool events as\n   *      they happen instead of all at once at the end.\n   *\n   * The SSE connection can drop while the agent idles between events\n   * (`UND_ERR_BODY_TIMEOUT`); `streamGoogleInteractionEvents` handles the\n   * reconnect-with-`last_event_id` loop transparently.\n   */\n  async doStreamBackground({\n    args,\n    warnings,\n    url,\n    mergedHeaders,\n    options,\n    pollingTimeoutMs\n  }) {\n    var _a2, _b;\n    const postResult = await postJsonToApi6({\n      url,\n      headers: mergedHeaders,\n      body: args,\n      failedResponseHandler: googleFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler7(\n        googleInteractionsResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const { responseHeaders: postHeaders, value: postResponse } = postResult;\n    const interactionId = postResponse.id;\n    if (interactionId == null || interactionId.length === 0) {\n      throw new Error(\n        \"google.interactions: background POST response did not include an interaction id; cannot stream the result.\"\n      );\n    }\n    const headerServiceTier = postHeaders == null ? void 0 : postHeaders[\"x-gemini-service-tier\"];\n    if (isTerminalStatus(postResponse.status)) {\n      const synthesized = synthesizeGoogleInteractionsAgentStream({\n        response: postResponse,\n        warnings,\n        generateId: (_a2 = this.config.generateId) != null ? _a2 : defaultGenerateId2,\n        includeRawChunks: options.includeRawChunks,\n        headerServiceTier\n      });\n      return {\n        stream: synthesized,\n        request: { body: args },\n        response: { headers: postHeaders }\n      };\n    }\n    void pollingTimeoutMs;\n    const events = streamGoogleInteractionEvents({\n      baseURL: this.config.baseURL,\n      interactionId,\n      headers: mergedHeaders,\n      fetch: this.config.fetch,\n      abortSignal: options.abortSignal\n    });\n    const transform = buildGoogleInteractionsStreamTransform({\n      warnings,\n      generateId: (_b = this.config.generateId) != null ? _b : defaultGenerateId2,\n      includeRawChunks: options.includeRawChunks,\n      serviceTier: headerServiceTier\n    });\n    return {\n      stream: events.pipeThrough(transform),\n      request: { body: args },\n      response: { headers: postHeaders }\n    };\n  }\n};\nvar INTERACTIONS_API_REVISION_HEADER = {\n  \"Api-Revision\": \"2026-05-20\"\n};\nfunction pruneUndefined(obj) {\n  const result = {};\n  for (const [key, value] of Object.entries(obj)) {\n    if (value === void 0) continue;\n    result[key] = value;\n  }\n  return result;\n}\n\n// src/google-provider.ts\nvar supportedExternalUrlMediaTypes = [\n  \"text/html\",\n  \"text/css\",\n  \"text/plain\",\n  \"text/xml\",\n  \"text/csv\",\n  \"text/rtf\",\n  \"text/javascript\",\n  \"application/json\",\n  \"application/pdf\",\n  \"image/bmp\",\n  \"image/jpeg\",\n  \"image/png\",\n  \"image/webp\",\n  \"video/mp4\",\n  \"video/mpeg\",\n  \"video/quicktime\",\n  \"video/avi\",\n  \"video/x-flv\",\n  \"video/mpg\",\n  \"video/webm\",\n  \"video/wmv\",\n  \"video/3gpp\"\n];\nvar externalHttpsUrlPattern = /^https:\\/\\/.*$/;\nfunction supportsExternalFileUrls(modelId) {\n  return /(^|\\/)gemini-/.test(modelId) && !/(^|\\/)gemini-2\\.0/.test(modelId);\n}\nfunction createGoogleGenerativeAI(options = {}) {\n  var _a2, _b;\n  const baseURL = (_a2 = withoutTrailingSlash(options.baseURL)) != null ? _a2 : \"https://generativelanguage.googleapis.com/v1beta\";\n  const providerName = (_b = options.name) != null ? _b : \"google.generative-ai\";\n  const getHeaders = () => withUserAgentSuffix2(\n    {\n      \"x-goog-api-key\": loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"GOOGLE_GENERATIVE_AI_API_KEY\",\n        description: \"Google Generative AI\"\n      }),\n      ...options.headers\n    },\n    `ai-sdk/google/${VERSION}`\n  );\n  const createChatModel = (modelId) => {\n    var _a3;\n    return new GoogleGenerativeAILanguageModel(modelId, {\n      provider: providerName,\n      baseURL,\n      headers: getHeaders,\n      generateId: (_a3 = options.generateId) != null ? _a3 : generateId2,\n      supportedUrls: () => ({\n        \"*\": [\n          // Google Generative Language \"files\" endpoint\n          // e.g. https://generativelanguage.googleapis.com/v1beta/files/...\n          new RegExp(`^${baseURL}/files/.*$`),\n          // YouTube URLs (public or unlisted videos)\n          new RegExp(\n            `^https://(?:www\\\\.)?youtube\\\\.com/watch\\\\?v=[\\\\w-]+(?:&[\\\\w=&.-]*)?$`\n          ),\n          new RegExp(`^https://youtu\\\\.be/[\\\\w-]+(?:\\\\?[\\\\w=&.-]*)?$`)\n        ],\n        ...supportsExternalFileUrls(modelId) ? Object.fromEntries(\n          supportedExternalUrlMediaTypes.map((mediaType) => [\n            mediaType,\n            [externalHttpsUrlPattern]\n          ])\n        ) : {}\n      }),\n      fetch: options.fetch\n    });\n  };\n  const createEmbeddingModel = (modelId) => new GoogleGenerativeAIEmbeddingModel(modelId, {\n    provider: providerName,\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createImageModel = (modelId, settings = {}) => new GoogleGenerativeAIImageModel(modelId, settings, {\n    provider: providerName,\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createTranscriptionModel = (modelId) => new GoogleTranscriptionModel(modelId, {\n    provider: `${providerName}.transcription`,\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createVideoModel = (modelId) => {\n    var _a3;\n    return new GoogleGenerativeAIVideoModel(modelId, {\n      provider: providerName,\n      baseURL,\n      headers: getHeaders,\n      fetch: options.fetch,\n      generateId: (_a3 = options.generateId) != null ? _a3 : generateId2\n    });\n  };\n  const createInteractionsModel = (modelIdOrAgent) => {\n    var _a3;\n    return new GoogleInteractionsLanguageModel(\n      modelIdOrAgent,\n      {\n        provider: `${providerName}.interactions`,\n        baseURL,\n        headers: getHeaders,\n        generateId: (_a3 = options.generateId) != null ? _a3 : generateId2,\n        fetch: options.fetch\n      }\n    );\n  };\n  const provider = function(modelId) {\n    if (new.target) {\n      throw new Error(\n        \"The Google Generative AI model function cannot be called with the new keyword.\"\n      );\n    }\n    return createChatModel(modelId);\n  };\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.generativeAI = createChatModel;\n  provider.embedding = createEmbeddingModel;\n  provider.embeddingModel = createEmbeddingModel;\n  provider.textEmbedding = createEmbeddingModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.image = createImageModel;\n  provider.imageModel = createImageModel;\n  provider.transcription = createTranscriptionModel;\n  provider.transcriptionModel = createTranscriptionModel;\n  provider.video = createVideoModel;\n  provider.videoModel = createVideoModel;\n  provider.interactions = createInteractionsModel;\n  provider.tools = googleTools;\n  return provider;\n}\nvar google = createGoogleGenerativeAI();\nexport {\n  GoogleTranscriptionModel,\n  VERSION,\n  createGoogleGenerativeAI,\n  google\n};\n//# sourceMappingURL=index.mjs.map","import { InvalidResponseDataError, NoSuchModelError, UnsupportedFunctionalityError } from \"@ai-sdk/provider\";\nimport { StreamingToolCallTracker, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertBase64ToUint8Array, convertJsonResponseToolStream, convertToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata as getResponseMetadata, createNullLanguageModelUsage, createProviderExecutedToolFactory, createProviderStreamError, generateId, getTopLevelMediaType, isCustomReasoning, lazySchema, loadApiKey, mapReasoningToProviderEffort, mediaTypeToExtension, parseProviderOptions, postFormDataToApi, postJsonToApi, resolve, resolveFullMediaType, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/convert-groq-usage.ts\nfunction convertGroqUsage(usage) {\n\tif (usage == null) return createNullLanguageModelUsage();\n\tconst promptTokens = usage.prompt_tokens ?? 0;\n\tconst cacheReadTokens = usage.prompt_tokens_details?.cached_tokens ?? void 0;\n\tconst completionTokens = usage.completion_tokens ?? 0;\n\tconst reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? void 0;\n\tconst textTokens = reasoningTokens != null ? Math.max(0, completionTokens - reasoningTokens) : completionTokens;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokens,\n\t\t\tnoCache: cacheReadTokens != null ? promptTokens - cacheReadTokens : promptTokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: completionTokens,\n\t\t\ttext: textTokens,\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/convert-to-groq-chat-messages.ts\nfunction convertToGroqChatMessages(prompt) {\n\tconst messages = [];\n\tfor (const { role, content } of prompt) switch (role) {\n\t\tcase \"system\":\n\t\t\tmessages.push({\n\t\t\t\trole: \"system\",\n\t\t\t\tcontent\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"user\":\n\t\t\tif (content.length === 1 && content[0].type === \"text\") {\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"user\",\n\t\t\t\t\tcontent: content[0].text\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmessages.push({\n\t\t\t\trole: \"user\",\n\t\t\t\tcontent: content.map((part) => {\n\t\t\t\t\tswitch (part.type) {\n\t\t\t\t\t\tcase \"text\": return {\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: part.text\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcase \"file\": switch (part.data.type) {\n\t\t\t\t\t\t\tcase \"reference\": throw new UnsupportedFunctionalityError({ functionality: \"file parts with provider references\" });\n\t\t\t\t\t\t\tcase \"text\": throw new UnsupportedFunctionalityError({ functionality: \"text file parts\" });\n\t\t\t\t\t\t\tcase \"url\":\n\t\t\t\t\t\t\tcase \"data\":\n\t\t\t\t\t\t\t\tif (getTopLevelMediaType(part.mediaType) !== \"image\") throw new UnsupportedFunctionalityError({ functionality: \"Non-image file content parts\" });\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\ttype: \"image_url\",\n\t\t\t\t\t\t\t\t\timage_url: { url: part.data.type === \"url\" ? part.data.url.toString() : `data:${resolveFullMediaType({ part })};base64,${convertToBase64(part.data.data)}` }\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"assistant\": {\n\t\t\tlet text = \"\";\n\t\t\tlet reasoning = \"\";\n\t\t\tconst toolCalls = [];\n\t\t\tfor (const part of content) switch (part.type) {\n\t\t\t\tcase \"reasoning\":\n\t\t\t\t\treasoning += part.text;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text\":\n\t\t\t\t\ttext += part.text;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tool-call\": toolCalls.push({\n\t\t\t\t\tid: part.toolCallId,\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tfunction: {\n\t\t\t\t\t\tname: part.toolName,\n\t\t\t\t\t\targuments: JSON.stringify(part.input)\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tmessages.push({\n\t\t\t\trole: \"assistant\",\n\t\t\t\tcontent: text,\n\t\t\t\t...reasoning.length > 0 ? { reasoning } : null,\n\t\t\t\t...toolCalls.length > 0 ? { tool_calls: toolCalls } : null\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"tool\":\n\t\t\tfor (const toolResponse of content) {\n\t\t\t\tif (toolResponse.type === \"tool-approval-response\") continue;\n\t\t\t\tconst output = toolResponse.output;\n\t\t\t\tlet contentValue;\n\t\t\t\tswitch (output.type) {\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\tcase \"error-text\":\n\t\t\t\t\t\tcontentValue = output.value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"execution-denied\":\n\t\t\t\t\t\tcontentValue = output.reason ?? \"Tool call execution denied.\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"content\":\n\t\t\t\t\tcase \"json\":\n\t\t\t\t\tcase \"error-json\": contentValue = JSON.stringify(output.value);\n\t\t\t\t}\n\t\t\t\tmessages.push({\n\t\t\t\t\trole: \"tool\",\n\t\t\t\t\ttool_call_id: toolResponse.toolCallId,\n\t\t\t\t\tcontent: contentValue\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: throw new Error(`Unsupported role: ${role}`);\n\t}\n\treturn messages;\n}\n//#endregion\n//#region src/groq-chat-language-model-options.ts\nconst groqLanguageModelChatOptions = z.object({\n\treasoningFormat: z.enum([\n\t\t\"parsed\",\n\t\t\"raw\",\n\t\t\"hidden\"\n\t]).optional(),\n\t/**\n\t* Specifies the reasoning effort level for model inference.\n\t* @see https://console.groq.com/docs/reasoning#reasoning-effort\n\t*/\n\treasoningEffort: z.enum([\n\t\t\"none\",\n\t\t\"default\",\n\t\t\"low\",\n\t\t\"medium\",\n\t\t\"high\"\n\t]).optional(),\n\t/**\n\t* Whether to enable parallel function calling during tool use. Default to true.\n\t*/\n\tparallelToolCalls: z.boolean().optional(),\n\t/**\n\t* A unique identifier representing your end-user, which can help OpenAI to\n\t* monitor and detect abuse. Learn more.\n\t*/\n\tuser: z.string().optional(),\n\t/**\n\t* Whether to use structured outputs.\n\t*\n\t* @default true\n\t*/\n\tstructuredOutputs: z.boolean().optional(),\n\t/**\n\t* Whether to use strict JSON schema validation.\n\t* When true, the model uses constrained decoding to guarantee schema compliance.\n\t* Only used when structured outputs are enabled and a schema is provided.\n\t*\n\t* @default true\n\t*/\n\tstrictJsonSchema: z.boolean().optional(),\n\t/**\n\t* Service tier for the request.\n\t* - 'on_demand': Default tier with consistent performance and fairness\n\t* - 'performance': Prioritized tier for latency-sensitive workloads\n\t* - 'flex': Higher throughput tier optimized for workloads that can handle occasional request failures\n\t* - 'auto': Uses on_demand rate limits, then falls back to flex tier if exceeded\n\t*\n\t* @default 'on_demand'\n\t*/\n\tserviceTier: z.enum([\n\t\t\"on_demand\",\n\t\t\"performance\",\n\t\t\"flex\",\n\t\t\"auto\"\n\t]).optional()\n});\n//#endregion\n//#region src/groq-error.ts\nconst groqErrorDataSchema = z.object({ error: z.object({\n\tmessage: z.string(),\n\ttype: z.string()\n}) });\nconst groqFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: groqErrorDataSchema,\n\terrorToMessage: (data) => data.error.message\n});\n//#endregion\n//#region src/groq-browser-search-models.ts\nconst modelsWithoutBrowserSearch = /* @__PURE__ */ new Set([\n\t\"gemma2-9b-it\",\n\t\"llama-3.1-8b-instant\",\n\t\"llama-3.3-70b-versatile\",\n\t\"meta-llama/llama-guard-4-12b\",\n\t\"deepseek-r1-distill-llama-70b\",\n\t\"meta-llama/llama-4-maverick-17b-128e-instruct\",\n\t\"meta-llama/llama-4-scout-17b-16e-instruct\",\n\t\"meta-llama/llama-prompt-guard-2-22m\",\n\t\"meta-llama/llama-prompt-guard-2-86m\",\n\t\"moonshotai/kimi-k2-instruct-0905\",\n\t\"qwen/qwen3.6-27b\",\n\t\"llama-guard-3-8b\",\n\t\"llama3-70b-8192\",\n\t\"llama3-8b-8192\",\n\t\"mixtral-8x7b-32768\",\n\t\"qwen-qwq-32b\",\n\t\"qwen-2.5-32b\",\n\t\"deepseek-r1-distill-qwen-32b\"\n]);\nfunction isBrowserSearchSupportedModel(modelId) {\n\treturn !modelsWithoutBrowserSearch.has(modelId);\n}\n//#endregion\n//#region src/groq-prepare-tools.ts\nfunction prepareTools({ tools, toolChoice, modelId }) {\n\ttools = tools?.length ? tools : void 0;\n\tconst toolWarnings = [];\n\tif (tools == null) return {\n\t\ttools: void 0,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst groqTools = [];\n\tfor (const tool of tools) if (tool.type === \"provider\") {\n\t\tif (tool.id === \"groq.browser_search\") {\n\t\t\tif (!isBrowserSearchSupportedModel(modelId)) toolWarnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: `provider-defined tool ${tool.id}`,\n\t\t\t\tdetails: `Browser search is not supported on model ${modelId}.`\n\t\t\t});\n\t\t\telse groqTools.push({ type: \"browser_search\" });\n\t\t} else toolWarnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: `provider-defined tool ${tool.id}`\n\t\t});\n\t} else groqTools.push({\n\t\ttype: \"function\",\n\t\tfunction: {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.inputSchema,\n\t\t\t...tool.strict != null ? { strict: tool.strict } : {}\n\t\t}\n\t});\n\tif (toolChoice == null) return {\n\t\ttools: groqTools,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst type = toolChoice.type;\n\tswitch (type) {\n\t\tcase \"auto\":\n\t\tcase \"none\":\n\t\tcase \"required\": return {\n\t\t\ttools: groqTools,\n\t\t\ttoolChoice: type,\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"tool\": return {\n\t\t\ttools: groqTools,\n\t\t\ttoolChoice: {\n\t\t\t\ttype: \"function\",\n\t\t\t\tfunction: { name: toolChoice.toolName }\n\t\t\t},\n\t\t\ttoolWarnings\n\t\t};\n\t\tdefault: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });\n\t}\n}\n//#endregion\n//#region src/map-groq-finish-reason.ts\nfunction mapGroqFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tcase \"function_call\":\n\t\tcase \"tool_calls\": return \"tool-calls\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/groq-chat-language-model.ts\nfunction createGroqStreamError(error, data) {\n\treturn createProviderStreamError({\n\t\tmessage: error.message,\n\t\ttype: error.type,\n\t\t...getGroqStreamErrorMetadata(error.type),\n\t\tdata\n\t});\n}\nfunction getGroqStreamErrorMetadata(type) {\n\tswitch (type) {\n\t\tcase \"rate_limit_error\": return {\n\t\t\tstatusCode: 429,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"api_error\":\n\t\tcase \"internal_server_error\":\n\t\tcase \"server_error\": return {\n\t\t\tstatusCode: 500,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"overloaded_error\":\n\t\tcase \"service_unavailable\": return {\n\t\t\tstatusCode: 503,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"timeout\":\n\t\tcase \"timeout_error\": return {\n\t\t\tstatusCode: 504,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"authentication_error\":\n\t\tcase \"invalid_api_key\": return {\n\t\t\tstatusCode: 401,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"permission_error\": return {\n\t\t\tstatusCode: 403,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"not_found_error\":\n\t\tcase \"model_not_found\": return {\n\t\t\tstatusCode: 404,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"bad_request\":\n\t\tcase \"context_length_exceeded\":\n\t\tcase \"invalid_request_error\": return {\n\t\t\tstatusCode: 400,\n\t\t\tisRetryable: false\n\t\t};\n\t\tdefault: return {};\n\t}\n}\nvar GroqChatLanguageModel = class GroqChatLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new GroqChatLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.supportedUrls = { \"image/*\": [/^https?:\\/\\/.*$/] };\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tasync getArgs({ prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, reasoning, tools, toolChoice, providerOptions }) {\n\t\tconst warnings = [];\n\t\tconst groqOptions = await parseProviderOptions({\n\t\t\tprovider: \"groq\",\n\t\t\tproviderOptions,\n\t\t\tschema: groqLanguageModelChatOptions\n\t\t});\n\t\tlet jsonResponseTool;\n\t\tif (responseFormat?.type === \"json\" && responseFormat.schema != null && tools?.some((tool) => tool.type === \"function\")) {\n\t\t\tlet name = \"json\";\n\t\t\tfor (let suffix = 1; tools.some((tool) => tool.name === name); suffix++) name = `json_${suffix}`;\n\t\t\tjsonResponseTool = {\n\t\t\t\ttype: \"function\",\n\t\t\t\tname,\n\t\t\t\tdescription: responseFormat.description ?? \"Respond with a JSON object.\",\n\t\t\t\tinputSchema: responseFormat.schema\n\t\t\t};\n\t\t}\n\t\tconst structuredOutputs = groqOptions?.structuredOutputs ?? true;\n\t\tconst strictJsonSchema = groqOptions?.strictJsonSchema ?? true;\n\t\tif (topK != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"topK\"\n\t\t});\n\t\tif (responseFormat?.type === \"json\" && responseFormat.schema != null && !structuredOutputs && jsonResponseTool == null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"responseFormat\",\n\t\t\tdetails: \"JSON response format schema is only supported with structuredOutputs\"\n\t\t});\n\t\tconst { tools: groqTools, toolChoice: groqToolChoice, toolWarnings } = prepareTools({\n\t\t\ttools: jsonResponseTool != null ? [...tools ?? [], jsonResponseTool] : tools,\n\t\t\ttoolChoice: jsonResponseTool == null ? toolChoice : toolChoice?.type === \"tool\" ? toolChoice : toolChoice?.type === \"none\" ? {\n\t\t\t\ttype: \"tool\",\n\t\t\t\ttoolName: jsonResponseTool.name\n\t\t\t} : { type: \"required\" },\n\t\t\tmodelId: this.modelId\n\t\t});\n\t\tlet reasoningEffort = groqOptions?.reasoningEffort;\n\t\tif (reasoningEffort == null && isCustomReasoning(reasoning)) {\n\t\t\tconst supportsNoneReasoning = this.modelId === \"qwen/qwen3.6-27b\";\n\t\t\tconst alwaysReasons = this.modelId.startsWith(\"openai/gpt-oss\");\n\t\t\tif (reasoning === \"none\" && !supportsNoneReasoning && !alwaysReasons) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"reasoning\",\n\t\t\t\tdetails: `reasoning \"${reasoning}\" is not supported by this model.`\n\t\t\t});\n\t\t\telse reasoningEffort = mapReasoningToProviderEffort({\n\t\t\t\treasoning,\n\t\t\t\teffortMap: {\n\t\t\t\t\t...supportsNoneReasoning && { none: \"none\" },\n\t\t\t\t\tlow: \"low\",\n\t\t\t\t\tmedium: \"medium\",\n\t\t\t\t\thigh: \"high\"\n\t\t\t\t},\n\t\t\t\twarnings\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\targs: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tuser: groqOptions?.user,\n\t\t\t\tparallel_tool_calls: jsonResponseTool != null ? false : groqOptions?.parallelToolCalls,\n\t\t\t\tmax_tokens: maxOutputTokens,\n\t\t\t\ttemperature,\n\t\t\t\ttop_p: topP,\n\t\t\t\tfrequency_penalty: frequencyPenalty,\n\t\t\t\tpresence_penalty: presencePenalty,\n\t\t\t\tstop: stopSequences,\n\t\t\t\tseed,\n\t\t\t\tresponse_format: jsonResponseTool == null && responseFormat?.type === \"json\" ? structuredOutputs && responseFormat.schema != null ? {\n\t\t\t\t\ttype: \"json_schema\",\n\t\t\t\t\tjson_schema: {\n\t\t\t\t\t\tschema: responseFormat.schema,\n\t\t\t\t\t\tstrict: strictJsonSchema,\n\t\t\t\t\t\tname: responseFormat.name ?? \"response\",\n\t\t\t\t\t\tdescription: responseFormat.description\n\t\t\t\t\t}\n\t\t\t\t} : { type: \"json_object\" } : void 0,\n\t\t\t\treasoning_format: groqOptions?.reasoningFormat,\n\t\t\t\treasoning_effort: reasoningEffort,\n\t\t\t\tservice_tier: groqOptions?.serviceTier,\n\t\t\t\tmessages: convertToGroqChatMessages(prompt),\n\t\t\t\ttools: groqTools,\n\t\t\t\ttool_choice: groqToolChoice\n\t\t\t},\n\t\t\twarnings: [...warnings, ...toolWarnings],\n\t\t\tjsonResponseToolName: jsonResponseTool?.name\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args, warnings, jsonResponseToolName } = await this.getArgs(options);\n\t\tconst body = JSON.stringify(args);\n\t\tconst { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody: args,\n\t\t\tfailedResponseHandler: groqFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(groqChatResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst choice = response.choices[0];\n\t\tif (choice == null) throw new InvalidResponseDataError({\n\t\t\tdata: rawResponse,\n\t\t\tmessage: \"Response did not contain any choices.\"\n\t\t});\n\t\tconst content = [];\n\t\tconst reasoning = choice.message.reasoning;\n\t\tif (reasoning != null && reasoning.length > 0) content.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: reasoning\n\t\t});\n\t\tconst text = choice.message.content;\n\t\tif (jsonResponseToolName == null && text != null && text.length > 0) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext\n\t\t});\n\t\tif (choice.message.tool_calls != null) for (const toolCall of choice.message.tool_calls) if (toolCall.function.name === jsonResponseToolName) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: toolCall.function.arguments\n\t\t});\n\t\telse content.push({\n\t\t\ttype: \"tool-call\",\n\t\t\ttoolCallId: toolCall.id || generateId(),\n\t\t\ttoolName: toolCall.function.name,\n\t\t\tinput: toolCall.function.arguments\n\t\t});\n\t\treturn {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: jsonResponseToolName != null && content.some((part) => part.type === \"text\") && !content.some((part) => part.type === \"tool-call\") && choice.finish_reason === \"tool_calls\" ? \"stop\" : mapGroqFinishReason(choice.finish_reason),\n\t\t\t\traw: choice.finish_reason ?? void 0\n\t\t\t},\n\t\t\tusage: convertGroqUsage(response.usage),\n\t\t\tresponse: {\n\t\t\t\t...getResponseMetadata(response),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings,\n\t\t\trequest: { body }\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings, jsonResponseToolName } = await this.getArgs(options);\n\t\tconst body = {\n\t\t\t...args,\n\t\t\tstream: true\n\t\t};\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/chat/completions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: groqFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(groqChatChunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet toolCallTracker;\n\t\tlet finishReason = {\n\t\t\tunified: \"interrupted\",\n\t\t\traw: void 0\n\t\t};\n\t\tlet usage = void 0;\n\t\tlet isFirstChunk = true;\n\t\tlet isActiveText = false;\n\t\tlet isActiveReasoning = false;\n\t\tconst result = {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\ttoolCallTracker = new StreamingToolCallTracker(controller, {\n\t\t\t\t\t\tgenerateId,\n\t\t\t\t\t\ttypeValidation: \"required\"\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst value = chunk.value;\n\t\t\t\t\tif (\"error\" in value) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: createGroqStreamError(value.error, value)\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (isFirstChunk) {\n\t\t\t\t\t\tisFirstChunk = false;\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t...getResponseMetadata(value)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (value.x_groq?.usage != null) usage = value.x_groq.usage;\n\t\t\t\t\tconst choice = value.choices[0];\n\t\t\t\t\tif (choice?.finish_reason != null) finishReason = {\n\t\t\t\t\t\tunified: mapGroqFinishReason(choice.finish_reason),\n\t\t\t\t\t\traw: choice.finish_reason\n\t\t\t\t\t};\n\t\t\t\t\tif (choice?.delta == null) return;\n\t\t\t\t\tconst delta = choice.delta;\n\t\t\t\t\tif (delta.reasoning != null && delta.reasoning.length > 0) {\n\t\t\t\t\t\tif (!isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: \"reasoning-0\",\n\t\t\t\t\t\t\tdelta: delta.reasoning\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.content != null && delta.content.length > 0) {\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isActiveText) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveText = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\tid: \"txt-0\",\n\t\t\t\t\t\t\tdelta: delta.content\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tif (delta.tool_calls != null && delta.tool_calls.length > 0) {\n\t\t\t\t\t\tif (isActiveReasoning) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisActiveReasoning = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (const toolCallDelta of delta.tool_calls) toolCallTracker.processDelta(toolCallDelta);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tif (isActiveReasoning) controller.enqueue({\n\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\tid: \"reasoning-0\"\n\t\t\t\t\t});\n\t\t\t\t\tif (isActiveText) controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: \"txt-0\"\n\t\t\t\t\t});\n\t\t\t\t\ttoolCallTracker.flush();\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: convertGroqUsage(usage)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body: JSON.stringify(body) },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t\treturn {\n\t\t\t...result,\n\t\t\tstream: jsonResponseToolName == null ? result.stream : result.stream.pipeThrough(convertJsonResponseToolStream(jsonResponseToolName))\n\t\t};\n\t}\n};\nconst groqChatResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tmessage: z.object({\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\ttype: z.literal(\"function\"),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\targuments: z.string()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}),\n\t\tindex: z.number(),\n\t\tfinish_reason: z.string().nullish()\n\t})),\n\tusage: z.object({\n\t\tprompt_tokens: z.number().nullish(),\n\t\tcompletion_tokens: z.number().nullish(),\n\t\ttotal_tokens: z.number().nullish(),\n\t\tprompt_tokens_details: z.object({ cached_tokens: z.number().nullish() }).nullish(),\n\t\tcompletion_tokens_details: z.object({ reasoning_tokens: z.number().nullish() }).nullish()\n\t}).nullish()\n})));\nconst groqChatChunkSchema = lazySchema(() => zodSchema(z.union([z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tdelta: z.object({\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tindex: z.number(),\n\t\t\t\tid: z.string().nullish(),\n\t\t\t\ttype: z.literal(\"function\").optional(),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string().nullish(),\n\t\t\t\t\targuments: z.string().nullish()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}).nullish(),\n\t\tfinish_reason: z.string().nullable().optional(),\n\t\tindex: z.number()\n\t})),\n\tx_groq: z.object({ usage: z.object({\n\t\tprompt_tokens: z.number().nullish(),\n\t\tcompletion_tokens: z.number().nullish(),\n\t\ttotal_tokens: z.number().nullish(),\n\t\tprompt_tokens_details: z.object({ cached_tokens: z.number().nullish() }).nullish(),\n\t\tcompletion_tokens_details: z.object({ reasoning_tokens: z.number().nullish() }).nullish()\n\t}).nullish() }).nullish()\n}), groqErrorDataSchema])));\n//#endregion\n//#region src/groq-transcription-model-options.ts\nconst groqTranscriptionModelOptions = lazySchema(() => zodSchema(z.object({\n\tlanguage: z.string().nullish(),\n\tprompt: z.string().nullish(),\n\tresponseFormat: z.string().nullish(),\n\ttemperature: z.number().min(0).max(1).nullish(),\n\ttimestampGranularities: z.array(z.string()).nullish()\n})));\n//#endregion\n//#region src/groq-transcription-model.ts\nvar GroqTranscriptionModel = class GroqTranscriptionModel {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new GroqTranscriptionModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t}\n\tasync getArgs({ audio, mediaType, providerOptions }) {\n\t\tconst warnings = [];\n\t\tconst groqOptions = await parseProviderOptions({\n\t\t\tprovider: \"groq\",\n\t\t\tproviderOptions,\n\t\t\tschema: groqTranscriptionModelOptions\n\t\t});\n\t\tconst formData = new FormData();\n\t\tconst blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array(audio)]);\n\t\tformData.append(\"model\", this.modelId);\n\t\tconst fileExtension = mediaTypeToExtension(mediaType);\n\t\tformData.append(\"file\", new File([blob], \"audio\", { type: mediaType }), `audio.${fileExtension}`);\n\t\tif (groqOptions) {\n\t\t\tconst transcriptionModelOptions = {\n\t\t\t\tlanguage: groqOptions.language ?? void 0,\n\t\t\t\tprompt: groqOptions.prompt ?? void 0,\n\t\t\t\tresponse_format: groqOptions.responseFormat ?? void 0,\n\t\t\t\ttemperature: groqOptions.temperature ?? void 0,\n\t\t\t\ttimestamp_granularities: groqOptions.timestampGranularities ?? void 0\n\t\t\t};\n\t\t\tfor (const key in transcriptionModelOptions) {\n\t\t\t\tconst value = transcriptionModelOptions[key];\n\t\t\t\tif (value !== void 0) {\n\t\t\t\t\tif (Array.isArray(value)) for (const item of value) formData.append(`${key}[]`, String(item));\n\t\t\t\t\telse formData.append(key, String(value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tformData,\n\t\t\tresponseFormat: groqOptions?.responseFormat,\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { formData, responseFormat, warnings } = await this.getArgs(options);\n\t\tconst successfulResponseHandler = responseFormat === \"text\" ? groqTextTranscriptionResponseHandler : createJsonResponseHandler(groqTranscriptionResponseSchema);\n\t\tconst { value: response, responseHeaders, rawValue: rawResponse } = await postFormDataToApi({\n\t\t\turl: this.config.url({\n\t\t\t\tpath: \"/audio/transcriptions\",\n\t\t\t\tmodelId: this.modelId\n\t\t\t}),\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tformData,\n\t\t\tfailedResponseHandler: groqFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler,\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\ttext: response.text,\n\t\t\tsegments: response.segments?.map((segment) => ({\n\t\t\t\ttext: segment.text,\n\t\t\t\tstartSecond: segment.start,\n\t\t\t\tendSecond: segment.end\n\t\t\t})) ?? response.words?.map((word) => ({\n\t\t\t\ttext: word.word,\n\t\t\t\tstartSecond: word.start,\n\t\t\t\tendSecond: word.end\n\t\t\t})) ?? [],\n\t\t\tlanguage: response.language ?? void 0,\n\t\t\tdurationInSeconds: response.duration ?? void 0,\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t}\n\t\t};\n\t}\n};\nconst groqTranscriptionResponseSchema = z.object({\n\ttext: z.string(),\n\tx_groq: z.object({ id: z.string() }),\n\ttask: z.string().nullish(),\n\tlanguage: z.string().nullish(),\n\tduration: z.number().nullish(),\n\tsegments: z.array(z.object({\n\t\tid: z.number(),\n\t\tseek: z.number(),\n\t\tstart: z.number(),\n\t\tend: z.number(),\n\t\ttext: z.string(),\n\t\ttokens: z.array(z.number()),\n\t\ttemperature: z.number(),\n\t\tavg_logprob: z.number(),\n\t\tcompression_ratio: z.number(),\n\t\tno_speech_prob: z.number()\n\t})).nullish(),\n\twords: z.array(z.object({\n\t\tword: z.string(),\n\t\tstart: z.number(),\n\t\tend: z.number()\n\t})).nullish()\n});\nconst binaryResponseHandler = createBinaryResponseHandler();\nconst textDecoder = new TextDecoder();\nconst groqTextTranscriptionResponseHandler = async (options) => {\n\tconst { value, responseHeaders } = await binaryResponseHandler(options);\n\tconst text = textDecoder.decode(value);\n\treturn {\n\t\tvalue: { text },\n\t\trawValue: text,\n\t\tresponseHeaders\n\t};\n};\n//#endregion\n//#region src/tool/browser-search.ts\n/**\n* Browser search tool for Groq models.\n*\n* Provides interactive browser search capabilities that go beyond traditional web search\n* by navigating websites interactively and providing more detailed results.\n*\n* Currently supported on:\n* - openai/gpt-oss-20b\n* - openai/gpt-oss-120b\n*\n* @see https://console.groq.com/docs/browser-search\n*/\nconst browserSearch = createProviderExecutedToolFactory({\n\tid: \"groq.browser_search\",\n\tinputSchema: lazySchema(() => zodSchema(z.object({}))),\n\toutputSchema: lazySchema(() => zodSchema(z.object({})))\n});\n//#endregion\n//#region src/groq-tools.ts\nconst groqTools = { browserSearch };\n//#endregion\n//#region src/version.ts\nconst VERSION = \"4.0.74\";\n//#endregion\n//#region src/groq-provider.ts\n/**\n* Create an Groq provider instance.\n*/\nfunction createGroq(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL) ?? \"https://api.groq.com/openai/v1\";\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"GROQ_API_KEY\",\n\t\t\tdescription: \"Groq\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-groq/${VERSION}`));\n\tconst createChatModel = (modelId) => new GroqChatLanguageModel(modelId, {\n\t\tprovider: \"groq.chat\",\n\t\turl: ({ path }) => `${baseURL}${path}`,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createLanguageModel = (modelId) => {\n\t\tif (new.target) throw new Error(\"The Groq model function cannot be called with the new keyword.\");\n\t\treturn createChatModel(modelId);\n\t};\n\tconst createTranscriptionModel = (modelId) => {\n\t\treturn new GroqTranscriptionModel(modelId, {\n\t\t\tprovider: \"groq.transcription\",\n\t\t\turl: ({ path }) => `${baseURL}${path}`,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst provider = function(modelId) {\n\t\treturn createLanguageModel(modelId);\n\t};\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createLanguageModel;\n\tprovider.chat = createChatModel;\n\tprovider.embeddingModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"embeddingModel\"\n\t\t});\n\t};\n\tprovider.textEmbeddingModel = provider.embeddingModel;\n\tprovider.imageModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"imageModel\"\n\t\t});\n\t};\n\tprovider.transcription = createTranscriptionModel;\n\tprovider.transcriptionModel = createTranscriptionModel;\n\tprovider.tools = groqTools;\n\treturn provider;\n}\n/**\n* Default Groq provider instance.\n*/\nconst groq = createGroq();\n//#endregion\nexport { VERSION, browserSearch, createGroq, groq };\n\n//# sourceMappingURL=index.js.map","// src/mistral-provider.ts\nimport {\n  NoSuchModelError\n} from \"@ai-sdk/provider\";\nimport {\n  loadApiKey,\n  withoutTrailingSlash,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\n\n// src/mistral-chat-language-model.ts\nimport {\n  InvalidResponseDataError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3,\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonResponseHandler,\n  generateId,\n  injectJsonInstructionIntoMessages,\n  parseProviderOptions,\n  postJsonToApi\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\n\n// src/convert-mistral-usage.ts\nimport { z } from \"zod/v4\";\nvar mistralPromptTokensDetailsSchema = z.object({\n  messages: z.array(z.json()).nullish(),\n  cached_tokens: z.number().nullish(),\n  audio_tokens: z.number().nullish()\n}).catchall(z.json());\nvar mistralCompletionTokensDetailsSchema = z.object({\n  reasoning_tokens: z.number().nullish()\n}).catchall(z.json());\nvar mistralUsageSchema = z.object({\n  prompt_tokens: z.number(),\n  completion_tokens: z.number(),\n  total_tokens: z.number(),\n  prompt_audio_seconds: z.number().nullish(),\n  request_count: z.number().nullish(),\n  service_tier: z.string().nullish(),\n  num_cached_tokens: z.number().nullish(),\n  prompt_tokens_details: mistralPromptTokensDetailsSchema.nullish(),\n  prompt_token_details: mistralPromptTokensDetailsSchema.nullish(),\n  completion_tokens_details: mistralCompletionTokensDetailsSchema.nullish()\n}).catchall(z.json());\nfunction convertMistralUsage(usage) {\n  var _a, _b, _c, _d, _e;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const promptTokens = usage.prompt_tokens;\n  const completionTokens = usage.completion_tokens;\n  const cacheReadTokens = (_e = (_d = (_b = usage.num_cached_tokens) != null ? _b : (_a = usage.prompt_tokens_details) == null ? void 0 : _a.cached_tokens) != null ? _d : (_c = usage.prompt_token_details) == null ? void 0 : _c.cached_tokens) != null ? _e : 0;\n  return {\n    inputTokens: {\n      total: promptTokens,\n      noCache: promptTokens - cacheReadTokens,\n      cacheRead: cacheReadTokens || void 0,\n      cacheWrite: void 0\n    },\n    outputTokens: {\n      total: completionTokens,\n      text: completionTokens,\n      reasoning: void 0\n    },\n    raw: usage\n  };\n}\n\n// src/convert-to-mistral-chat-messages.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nimport { convertToBase64 } from \"@ai-sdk/provider-utils\";\nfunction formatFileUrl({\n  data,\n  mediaType\n}) {\n  return data instanceof URL ? data.toString() : `data:${mediaType};base64,${convertToBase64(data)}`;\n}\nfunction convertToMistralChatMessages(prompt) {\n  var _a;\n  const messages = [];\n  for (let i = 0; i < prompt.length; i++) {\n    const { role, content } = prompt[i];\n    const isLastMessage = i === prompt.length - 1;\n    switch (role) {\n      case \"system\": {\n        messages.push({ role: \"system\", content });\n        break;\n      }\n      case \"user\": {\n        messages.push({\n          role: \"user\",\n          content: content.map((part) => {\n            switch (part.type) {\n              case \"text\": {\n                return { type: \"text\", text: part.text };\n              }\n              case \"file\": {\n                if (part.mediaType.startsWith(\"image/\")) {\n                  const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n                  return {\n                    type: \"image_url\",\n                    image_url: formatFileUrl({ data: part.data, mediaType })\n                  };\n                } else if (part.mediaType === \"application/pdf\") {\n                  return {\n                    type: \"document_url\",\n                    document_url: formatFileUrl({\n                      data: part.data,\n                      mediaType: \"application/pdf\"\n                    })\n                  };\n                } else {\n                  throw new UnsupportedFunctionalityError({\n                    functionality: \"Only images and PDF file parts are supported\"\n                  });\n                }\n              }\n            }\n          })\n        });\n        break;\n      }\n      case \"assistant\": {\n        let text = \"\";\n        let hasReasoning = false;\n        const contentParts = [];\n        const toolCalls = [];\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\": {\n              text += part.text;\n              contentParts.push({ type: \"text\", text: part.text });\n              break;\n            }\n            case \"tool-call\": {\n              toolCalls.push({\n                id: part.toolCallId,\n                type: \"function\",\n                function: {\n                  name: part.toolName,\n                  arguments: JSON.stringify(part.input)\n                }\n              });\n              break;\n            }\n            case \"reasoning\": {\n              hasReasoning = true;\n              contentParts.push({\n                type: \"thinking\",\n                thinking: [{ type: \"text\", text: part.text }],\n                closed: true\n              });\n              break;\n            }\n            default: {\n              throw new Error(\n                `Unsupported content type in assistant message: ${part.type}`\n              );\n            }\n          }\n        }\n        messages.push({\n          role: \"assistant\",\n          content: hasReasoning ? contentParts : text,\n          prefix: isLastMessage ? true : void 0,\n          tool_calls: toolCalls.length > 0 ? toolCalls : void 0\n        });\n        break;\n      }\n      case \"tool\": {\n        for (const toolResponse of content) {\n          if (toolResponse.type === \"tool-approval-response\") {\n            continue;\n          }\n          const output = toolResponse.output;\n          let contentValue;\n          switch (output.type) {\n            case \"text\":\n            case \"error-text\":\n              contentValue = output.value;\n              break;\n            case \"execution-denied\":\n              contentValue = (_a = output.reason) != null ? _a : \"Tool call execution denied.\";\n              break;\n            case \"content\":\n            case \"json\":\n            case \"error-json\":\n              contentValue = JSON.stringify(output.value);\n              break;\n          }\n          messages.push({\n            role: \"tool\",\n            name: toolResponse.toolName,\n            tool_call_id: toolResponse.toolCallId,\n            content: contentValue\n          });\n        }\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return messages;\n}\n\n// src/get-response-metadata.ts\nfunction getResponseMetadata({\n  id,\n  model,\n  created\n}) {\n  return {\n    id: id != null ? id : void 0,\n    modelId: model != null ? model : void 0,\n    timestamp: created != null ? new Date(created * 1e3) : void 0\n  };\n}\n\n// src/map-mistral-finish-reason.ts\nfunction mapMistralFinishReason(finishReason) {\n  switch (finishReason) {\n    case \"stop\":\n      return \"stop\";\n    case \"length\":\n    case \"model_length\":\n      return \"length\";\n    case \"tool_calls\":\n      return \"tool-calls\";\n    default:\n      return \"other\";\n  }\n}\n\n// src/mistral-chat-options.ts\nimport {\n  lazySchema,\n  zodSchema\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar mistralLanguageModelOptions = lazySchema(\n  () => zodSchema(\n    z2.object({\n      /**\n       * Whether to inject a safety prompt before all conversations.\n       *\n       * Defaults to `false`.\n       */\n      safePrompt: z2.boolean().optional(),\n      documentImageLimit: z2.number().optional(),\n      documentPageLimit: z2.number().optional(),\n      /**\n       * Whether to use structured outputs.\n       *\n       * @default true\n       */\n      structuredOutputs: z2.boolean().optional(),\n      /**\n       * Whether to use strict JSON schema validation.\n       *\n       * @default false\n       */\n      strictJsonSchema: z2.boolean().optional(),\n      /**\n       * Whether to enable parallel function calling during tool use.\n       * When set to false, the model will use at most one tool per response.\n       *\n       * @default true\n       */\n      parallelToolCalls: z2.boolean().optional(),\n      /**\n       * Controls the reasoning effort for models that support adjustable reasoning.\n       *\n       * - `'high'`: Enable reasoning\n       * - `'none'`: Disable reasoning\n       * - `'low'`, `'max'`: Lowest and highest reasoning effort for models that\n       *   support them, e.g. `zai-glm-5-3`, which accepts `'low'`, `'high'`, and\n       *   `'max'` but not `'none'`\n       */\n      reasoningEffort: z2.enum([\"high\", \"none\", \"low\", \"max\"]).optional()\n    })\n  )\n);\n\n// src/mistral-error.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2,\n  createJsonErrorResponseHandler\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\nvar mistralErrorDataSchema = lazySchema2(\n  () => zodSchema2(\n    z3.object({\n      object: z3.literal(\"error\"),\n      message: z3.string(),\n      type: z3.string(),\n      param: z3.string().nullable(),\n      code: z3.string().nullable()\n    })\n  )\n);\nvar mistralFailedResponseHandler = createJsonErrorResponseHandler({\n  errorSchema: mistralErrorDataSchema,\n  errorToMessage: (data) => data.message\n});\n\n// src/mistral-prepare-tools.ts\nimport {\n  UnsupportedFunctionalityError as UnsupportedFunctionalityError2\n} from \"@ai-sdk/provider\";\nfunction prepareTools({\n  tools,\n  toolChoice\n}) {\n  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;\n  const toolWarnings = [];\n  if (tools == null) {\n    return { tools: void 0, toolChoice: void 0, toolWarnings };\n  }\n  const mistralTools = [];\n  for (const tool of tools) {\n    if (tool.type === \"provider\") {\n      toolWarnings.push({\n        type: \"unsupported\",\n        feature: `provider-defined tool ${tool.id}`\n      });\n    } else {\n      mistralTools.push({\n        type: \"function\",\n        function: {\n          name: tool.name,\n          description: tool.description,\n          parameters: tool.inputSchema,\n          ...tool.strict != null ? { strict: tool.strict } : {}\n        }\n      });\n    }\n  }\n  if (toolChoice == null) {\n    return { tools: mistralTools, toolChoice: void 0, toolWarnings };\n  }\n  const type = toolChoice.type;\n  switch (type) {\n    case \"auto\":\n    case \"none\":\n      return { tools: mistralTools, toolChoice: type, toolWarnings };\n    case \"required\":\n      return { tools: mistralTools, toolChoice: \"any\", toolWarnings };\n    // mistral does not support tool mode directly,\n    // so we filter the tools and force the tool choice through 'any'\n    case \"tool\":\n      return {\n        tools: mistralTools.filter(\n          (tool) => tool.function.name === toolChoice.toolName\n        ),\n        toolChoice: \"any\",\n        toolWarnings\n      };\n    default: {\n      const _exhaustiveCheck = type;\n      throw new UnsupportedFunctionalityError2({\n        functionality: `tool choice type: ${_exhaustiveCheck}`\n      });\n    }\n  }\n}\n\n// src/mistral-chat-language-model.ts\nvar MistralChatLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.supportedUrls = {\n      \"application/pdf\": [/^https:\\/\\/.*$/]\n    };\n    var _a;\n    this.modelId = modelId;\n    this.config = config;\n    this.generateId = (_a = config.generateId) != null ? _a : generateId;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    providerOptions,\n    tools,\n    toolChoice\n  }) {\n    var _a, _b, _c, _d;\n    const warnings = [];\n    const options = (_a = await parseProviderOptions({\n      provider: \"mistral\",\n      providerOptions,\n      schema: mistralLanguageModelOptions\n    })) != null ? _a : {};\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    const structuredOutputs = (_b = options.structuredOutputs) != null ? _b : true;\n    const strictJsonSchema = (_c = options.strictJsonSchema) != null ? _c : false;\n    if ((responseFormat == null ? void 0 : responseFormat.type) === \"json\" && !(responseFormat == null ? void 0 : responseFormat.schema)) {\n      prompt = injectJsonInstructionIntoMessages({\n        messages: prompt,\n        schema: responseFormat.schema\n      });\n    }\n    const baseArgs = {\n      // model id:\n      model: this.modelId,\n      // model specific settings:\n      safe_prompt: options.safePrompt,\n      // standardized settings:\n      max_tokens: maxOutputTokens,\n      temperature,\n      top_p: topP,\n      ...frequencyPenalty != null ? { frequency_penalty: frequencyPenalty } : {},\n      ...presencePenalty != null ? { presence_penalty: presencePenalty } : {},\n      stop: stopSequences,\n      random_seed: seed,\n      reasoning_effort: options.reasoningEffort,\n      // response format:\n      response_format: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" ? structuredOutputs && (responseFormat == null ? void 0 : responseFormat.schema) != null ? {\n        type: \"json_schema\",\n        json_schema: {\n          schema: responseFormat.schema,\n          strict: strictJsonSchema,\n          name: (_d = responseFormat.name) != null ? _d : \"response\",\n          description: responseFormat.description\n        }\n      } : { type: \"json_object\" } : void 0,\n      // mistral-specific provider options:\n      document_image_limit: options.documentImageLimit,\n      document_page_limit: options.documentPageLimit,\n      // messages:\n      messages: convertToMistralChatMessages(prompt)\n    };\n    const {\n      tools: mistralTools,\n      toolChoice: mistralToolChoice,\n      toolWarnings\n    } = prepareTools({\n      tools,\n      toolChoice\n    });\n    return {\n      args: {\n        ...baseArgs,\n        tools: mistralTools,\n        tool_choice: mistralToolChoice,\n        ...mistralTools != null && options.parallelToolCalls !== void 0 ? { parallel_tool_calls: options.parallelToolCalls } : {}\n      },\n      warnings: [...warnings, ...toolWarnings]\n    };\n  }\n  async doGenerate(options) {\n    var _a;\n    const { args: body, warnings } = await this.getArgs(options);\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url: `${this.config.baseURL}/chat/completions`,\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: mistralFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler(\n        mistralChatResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    const choice = response.choices[0];\n    const content = [];\n    if (choice.message.content != null && Array.isArray(choice.message.content)) {\n      for (const part of choice.message.content) {\n        if (part.type === \"thinking\") {\n          const reasoningText = extractReasoningContent(part.thinking);\n          if (reasoningText.length > 0) {\n            content.push({ type: \"reasoning\", text: reasoningText });\n          }\n        } else if (part.type === \"text\") {\n          if (part.text.length > 0) {\n            content.push({ type: \"text\", text: part.text });\n          }\n        }\n      }\n    } else {\n      const text = extractTextContent(choice.message.content);\n      if (text != null && text.length > 0) {\n        content.push({ type: \"text\", text });\n      }\n    }\n    if (choice.message.tool_calls != null) {\n      for (const toolCall of choice.message.tool_calls) {\n        content.push({\n          type: \"tool-call\",\n          toolCallId: toolCall.id,\n          toolName: toolCall.function.name,\n          input: toolCall.function.arguments\n        });\n      }\n    }\n    return {\n      content,\n      finishReason: {\n        unified: mapMistralFinishReason(choice.finish_reason),\n        raw: (_a = choice.finish_reason) != null ? _a : void 0\n      },\n      usage: convertMistralUsage(response.usage),\n      request: { body },\n      response: {\n        ...getResponseMetadata(response),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings\n    };\n  }\n  async doStream(options) {\n    const { args, warnings } = await this.getArgs(options);\n    const body = { ...args, stream: true };\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url: `${this.config.baseURL}/chat/completions`,\n      headers: combineHeaders(this.config.headers(), options.headers),\n      body,\n      failedResponseHandler: mistralFailedResponseHandler,\n      successfulResponseHandler: createEventSourceResponseHandler(\n        mistralChatChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage = void 0;\n    let isFirstChunk = true;\n    let activeText = false;\n    let activeReasoningId = null;\n    const toolCalls = /* @__PURE__ */ new Set();\n    const toolCallsById = /* @__PURE__ */ new Map();\n    const toolCallsByIndex = /* @__PURE__ */ new Map();\n    let latestToolCall;\n    const generateId2 = this.generateId;\n    return {\n      stream: response.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            if (isFirstChunk) {\n              isFirstChunk = false;\n              controller.enqueue({\n                type: \"response-metadata\",\n                ...getResponseMetadata(value)\n              });\n            }\n            if (value.usage != null) {\n              usage = value.usage;\n            }\n            const choice = value.choices[0];\n            const delta = choice.delta;\n            const textContent = extractTextContent(delta.content);\n            if (delta.content != null && Array.isArray(delta.content)) {\n              for (const part of delta.content) {\n                if (part.type === \"thinking\") {\n                  const reasoningDelta = extractReasoningContent(part.thinking);\n                  if (reasoningDelta.length > 0) {\n                    if (activeReasoningId == null) {\n                      if (activeText) {\n                        controller.enqueue({ type: \"text-end\", id: \"0\" });\n                        activeText = false;\n                      }\n                      activeReasoningId = generateId2();\n                      controller.enqueue({\n                        type: \"reasoning-start\",\n                        id: activeReasoningId\n                      });\n                    }\n                    controller.enqueue({\n                      type: \"reasoning-delta\",\n                      id: activeReasoningId,\n                      delta: reasoningDelta\n                    });\n                  }\n                }\n              }\n            }\n            if (textContent != null && textContent.length > 0) {\n              if (!activeText) {\n                if (activeReasoningId != null) {\n                  controller.enqueue({\n                    type: \"reasoning-end\",\n                    id: activeReasoningId\n                  });\n                  activeReasoningId = null;\n                }\n                controller.enqueue({ type: \"text-start\", id: \"0\" });\n                activeText = true;\n              }\n              controller.enqueue({\n                type: \"text-delta\",\n                id: \"0\",\n                delta: textContent\n              });\n            }\n            if ((delta == null ? void 0 : delta.tool_calls) != null) {\n              for (const toolCallDelta of delta.tool_calls) {\n                const { id, index } = toolCallDelta;\n                let toolCall = id != null && id.length > 0 ? toolCallsById.get(id) : index != null ? toolCallsByIndex.get(index) : latestToolCall;\n                if (toolCall == null) {\n                  if (id == null) {\n                    throw new InvalidResponseDataError({\n                      data: toolCallDelta,\n                      message: `Expected 'id' to be a string.`\n                    });\n                  }\n                  if (toolCallDelta.function.name == null) {\n                    throw new InvalidResponseDataError({\n                      data: toolCallDelta,\n                      message: `Expected 'function.name' to be a string.`\n                    });\n                  }\n                  toolCall = {\n                    id,\n                    name: toolCallDelta.function.name,\n                    input: (_a = toolCallDelta.function.arguments) != null ? _a : \"\"\n                  };\n                  toolCalls.add(toolCall);\n                  if (id.length > 0) {\n                    toolCallsById.set(id, toolCall);\n                  }\n                  controller.enqueue({\n                    type: \"tool-input-start\",\n                    id,\n                    toolName: toolCall.name\n                  });\n                  if (toolCall.input.length > 0) {\n                    controller.enqueue({\n                      type: \"tool-input-delta\",\n                      id,\n                      delta: toolCall.input\n                    });\n                  }\n                } else if (toolCallDelta.function.arguments != null) {\n                  toolCall.input += toolCallDelta.function.arguments;\n                  controller.enqueue({\n                    type: \"tool-input-delta\",\n                    id: toolCall.id,\n                    delta: toolCallDelta.function.arguments\n                  });\n                }\n                if (index != null) {\n                  toolCallsByIndex.set(index, toolCall);\n                }\n                latestToolCall = toolCall;\n              }\n            }\n            if (choice.finish_reason != null) {\n              finishReason = {\n                unified: mapMistralFinishReason(choice.finish_reason),\n                raw: choice.finish_reason\n              };\n            }\n          },\n          flush(controller) {\n            if (activeReasoningId != null) {\n              controller.enqueue({\n                type: \"reasoning-end\",\n                id: activeReasoningId\n              });\n            }\n            if (activeText) {\n              controller.enqueue({ type: \"text-end\", id: \"0\" });\n            }\n            for (const toolCall of toolCalls) {\n              controller.enqueue({\n                type: \"tool-input-end\",\n                id: toolCall.id\n              });\n              controller.enqueue({\n                type: \"tool-call\",\n                toolCallId: toolCall.id,\n                toolName: toolCall.name,\n                input: toolCall.input\n              });\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertMistralUsage(usage)\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n};\nfunction extractReasoningContent(thinking) {\n  return thinking.filter((chunk) => chunk.type === \"text\").map((chunk) => chunk.text).join(\"\");\n}\nfunction extractTextContent(content) {\n  if (typeof content === \"string\") {\n    return content;\n  }\n  if (content == null) {\n    return void 0;\n  }\n  const textContent = [];\n  for (const chunk of content) {\n    const { type } = chunk;\n    switch (type) {\n      case \"text\":\n        textContent.push(chunk.text);\n        break;\n      case \"thinking\":\n      case \"image_url\":\n      case \"reference\":\n        break;\n      default: {\n        const _exhaustiveCheck = type;\n        throw new Error(`Unsupported type: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return textContent.length ? textContent.join(\"\") : void 0;\n}\nvar mistralContentSchema = () => z4.union([\n  z4.string(),\n  z4.array(\n    z4.discriminatedUnion(\"type\", [\n      z4.object({\n        type: z4.literal(\"text\"),\n        text: z4.string()\n      }),\n      z4.object({\n        type: z4.literal(\"image_url\"),\n        image_url: z4.union([\n          z4.string(),\n          z4.object({\n            url: z4.string(),\n            detail: z4.string().nullable()\n          })\n        ])\n      }),\n      z4.object({\n        type: z4.literal(\"reference\"),\n        reference_ids: z4.array(z4.union([z4.string(), z4.number()]))\n      }),\n      z4.object({\n        type: z4.literal(\"thinking\"),\n        thinking: z4.array(\n          z4.object({\n            type: z4.literal(\"text\"),\n            text: z4.string()\n          })\n        )\n      })\n    ])\n  )\n]).nullish();\nvar mistralChatResponseSchema = lazySchema3(\n  () => zodSchema3(\n    z4.object({\n      id: z4.string().nullish(),\n      created: z4.number().nullish(),\n      model: z4.string().nullish(),\n      choices: z4.array(\n        z4.object({\n          message: z4.object({\n            role: z4.literal(\"assistant\"),\n            content: mistralContentSchema(),\n            tool_calls: z4.array(\n              z4.object({\n                id: z4.string(),\n                function: z4.object({\n                  name: z4.string(),\n                  arguments: z4.string()\n                })\n              })\n            ).nullish()\n          }),\n          index: z4.number(),\n          finish_reason: z4.string().nullish()\n        })\n      ),\n      object: z4.literal(\"chat.completion\"),\n      usage: mistralUsageSchema\n    })\n  )\n);\nvar mistralChatChunkSchema = lazySchema3(\n  () => zodSchema3(\n    z4.object({\n      id: z4.string().nullish(),\n      created: z4.number().nullish(),\n      model: z4.string().nullish(),\n      choices: z4.array(\n        z4.object({\n          delta: z4.object({\n            role: z4.enum([\"assistant\"]).optional(),\n            content: mistralContentSchema(),\n            tool_calls: z4.array(\n              z4.object({\n                index: z4.number().nullish(),\n                id: z4.string().nullish(),\n                function: z4.object({\n                  name: z4.string().nullish(),\n                  arguments: z4.string().nullish()\n                })\n              })\n            ).nullish()\n          }),\n          finish_reason: z4.string().nullish(),\n          index: z4.number()\n        })\n      ),\n      usage: mistralUsageSchema.nullish()\n    })\n  )\n);\n\n// src/mistral-embedding-model.ts\nimport {\n  TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4,\n  combineHeaders as combineHeaders2,\n  createJsonResponseHandler as createJsonResponseHandler2,\n  postJsonToApi as postJsonToApi2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z5 } from \"zod/v4\";\nvar MistralEmbeddingModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.maxEmbeddingsPerCall = 32;\n    this.supportsParallelCalls = false;\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doEmbed({\n    values,\n    abortSignal,\n    headers\n  }) {\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values\n      });\n    }\n    const {\n      responseHeaders,\n      value: response,\n      rawValue\n    } = await postJsonToApi2({\n      url: `${this.config.baseURL}/embeddings`,\n      headers: combineHeaders2(this.config.headers(), headers),\n      body: {\n        model: this.modelId,\n        input: values,\n        encoding_format: \"float\"\n      },\n      failedResponseHandler: mistralFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler2(\n        MistralTextEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      warnings: [],\n      embeddings: response.data.map((item) => item.embedding),\n      usage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,\n      response: { headers: responseHeaders, body: rawValue }\n    };\n  }\n};\nvar MistralTextEmbeddingResponseSchema = lazySchema4(\n  () => zodSchema4(\n    z5.object({\n      data: z5.array(z5.object({ embedding: z5.array(z5.number()) })),\n      usage: z5.object({ prompt_tokens: z5.number() }).nullish()\n    })\n  )\n);\n\n// src/mistral-speech-model.ts\nimport {\n  lazySchema as lazySchema6,\n  zodSchema as zodSchema6,\n  combineHeaders as combineHeaders3,\n  createJsonResponseHandler as createJsonResponseHandler3,\n  parseProviderOptions as parseProviderOptions2,\n  postToApi\n} from \"@ai-sdk/provider-utils\";\nimport { z as z7 } from \"zod/v4\";\n\n// src/mistral-speech-model-options.ts\nimport {\n  lazySchema as lazySchema5,\n  zodSchema as zodSchema5\n} from \"@ai-sdk/provider-utils\";\nimport { z as z6 } from \"zod/v4\";\nvar mistralSpeechModelOptions = lazySchema5(\n  () => zodSchema5(\n    z6.object({\n      /**\n       * Base64-encoded reference audio for one-off voice cloning.\n       *\n       * When provided, this takes precedence over the standard `voice` option.\n       */\n      refAudio: z6.string().min(1).optional(),\n      /**\n       * How expressive the speech is, from 1 to 5. Higher values trade voice\n       * similarity and stability for stronger delivery. Supported by Voxtral 3.\n       */\n      expressiveness: z6.number().min(1).max(5).optional(),\n      /**\n       * Pronunciation hints mapping words to lists of IPA phonemes.\n       * Supported by Voxtral 3.\n       */\n      phonemeHints: z6.record(z6.string().min(1), z6.array(z6.string().min(1)).min(1)).optional()\n    })\n  )\n);\n\n// src/mistral-speech-model.ts\nvar MistralSpeechModel = class {\n  constructor(modelId, config) {\n    this.modelId = modelId;\n    this.config = config;\n    this.specificationVersion = \"v3\";\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async getArgs({\n    text,\n    voice,\n    outputFormat = \"mp3\",\n    instructions,\n    speed,\n    language,\n    providerOptions\n  }) {\n    const warnings = [];\n    const mistralOptions = await parseProviderOptions2({\n      provider: \"mistral\",\n      providerOptions,\n      schema: mistralSpeechModelOptions\n    });\n    let responseFormat = \"mp3\";\n    if ([\"pcm\", \"wav\", \"mp3\", \"flac\", \"opus\"].includes(outputFormat)) {\n      responseFormat = outputFormat;\n    } else {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"outputFormat\",\n        details: `Unsupported output format: ${outputFormat}. Using mp3 instead.`\n      });\n    }\n    if (instructions != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"instructions\",\n        details: \"Mistral speech models do not support the `instructions` option. Use a reference audio clip to guide delivery.\"\n      });\n    }\n    if (speed != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"speed\",\n        details: \"Mistral speech models do not support the `speed` option. It was ignored.\"\n      });\n    }\n    if (language != null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"language\",\n        details: \"Mistral speech models do not support the `language` option. Language is inferred from the input text and voice.\"\n      });\n    }\n    const refAudio = mistralOptions == null ? void 0 : mistralOptions.refAudio;\n    const requestBody = {\n      model: this.modelId,\n      input: text,\n      voice_id: refAudio == null ? voice : void 0,\n      ref_audio: refAudio,\n      expressiveness: mistralOptions == null ? void 0 : mistralOptions.expressiveness,\n      phoneme_hints: mistralOptions == null ? void 0 : mistralOptions.phonemeHints,\n      response_format: responseFormat,\n      stream: false\n    };\n    const requestBodyValues = {\n      ...requestBody,\n      ref_audio: refAudio == null ? void 0 : \"[redacted]\"\n    };\n    return { requestBody, requestBodyValues, warnings };\n  }\n  async doGenerate(options) {\n    var _a, _b, _c, _d, _e;\n    const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();\n    const { requestBody, requestBodyValues, warnings } = await this.getArgs(options);\n    const {\n      value: response,\n      responseHeaders,\n      rawValue: rawResponse\n    } = await postToApi({\n      url: `${this.config.baseURL}/audio/speech`,\n      headers: combineHeaders3(\n        { \"Content-Type\": \"application/json\" },\n        (_e = (_d = this.config).headers) == null ? void 0 : _e.call(_d),\n        options.headers\n      ),\n      body: {\n        content: JSON.stringify(requestBody),\n        values: requestBodyValues\n      },\n      failedResponseHandler: mistralFailedResponseHandler,\n      successfulResponseHandler: createJsonResponseHandler3(\n        mistralSpeechResponseSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    return {\n      audio: response.audio_data,\n      warnings,\n      request: {\n        body: JSON.stringify(requestBodyValues)\n      },\n      response: {\n        timestamp: currentDate,\n        modelId: this.modelId,\n        headers: responseHeaders,\n        body: rawResponse\n      }\n    };\n  }\n};\nvar mistralSpeechResponseSchema = lazySchema6(\n  () => zodSchema6(\n    z7.object({\n      audio_data: z7.string()\n    })\n  )\n);\n\n// src/version.ts\nvar VERSION = true ? \"3.0.78\" : \"0.0.0-test\";\n\n// src/mistral-provider.ts\nfunction createMistral(options = {}) {\n  var _a;\n  const baseURL = (_a = withoutTrailingSlash(options.baseURL)) != null ? _a : \"https://api.mistral.ai/v1\";\n  const getHeaders = () => withUserAgentSuffix(\n    {\n      Authorization: `Bearer ${loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"MISTRAL_API_KEY\",\n        description: \"Mistral\"\n      })}`,\n      ...options.headers\n    },\n    `ai-sdk/mistral/${VERSION}`\n  );\n  const createChatModel = (modelId) => new MistralChatLanguageModel(modelId, {\n    provider: \"mistral.chat\",\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch,\n    generateId: options.generateId\n  });\n  const createEmbeddingModel = (modelId) => new MistralEmbeddingModel(modelId, {\n    provider: \"mistral.embedding\",\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const createSpeechModel = (modelId) => new MistralSpeechModel(modelId, {\n    provider: \"mistral.speech\",\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const provider = function(modelId) {\n    if (new.target) {\n      throw new Error(\n        \"The Mistral model function cannot be called with the new keyword.\"\n      );\n    }\n    return createChatModel(modelId);\n  };\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createChatModel;\n  provider.chat = createChatModel;\n  provider.embedding = createEmbeddingModel;\n  provider.embeddingModel = createEmbeddingModel;\n  provider.textEmbedding = createEmbeddingModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.speech = createSpeechModel;\n  provider.speechModel = createSpeechModel;\n  provider.imageModel = (modelId) => {\n    throw new NoSuchModelError({ modelId, modelType: \"imageModel\" });\n  };\n  return provider;\n}\nvar mistral = createMistral();\nexport {\n  VERSION,\n  createMistral,\n  mistral\n};\n//# sourceMappingURL=index.mjs.map","// src/perplexity-provider.ts\nimport {\n  NoSuchModelError\n} from \"@ai-sdk/provider\";\nimport {\n  generateId,\n  loadApiKey,\n  withoutTrailingSlash,\n  withUserAgentSuffix\n} from \"@ai-sdk/provider-utils\";\n\n// src/perplexity-embedding-model.ts\nimport {\n  TooManyEmbeddingValuesForCallError\n} from \"@ai-sdk/provider\";\nimport {\n  lazySchema as lazySchema4,\n  zodSchema as zodSchema4,\n  combineHeaders as combineHeaders2,\n  convertBase64ToUint8Array,\n  createJsonErrorResponseHandler as createJsonErrorResponseHandler2,\n  createJsonResponseHandler as createJsonResponseHandler2,\n  parseProviderOptions as parseProviderOptions2,\n  postJsonToApi as postJsonToApi2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z4 } from \"zod/v4\";\n\n// src/perplexity-embedding-model-options.ts\nimport {\n  lazySchema,\n  zodSchema\n} from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\nvar perplexityEmbeddingModelOptions = lazySchema(\n  () => zodSchema(\n    z.object({\n      /**\n       * The number of dimensions the resulting output embeddings should have\n       * (Matryoshka truncation). Ranges from 128 up to the model's full size\n       * (1024 for 0.6b models, 2560 for 4b models).\n       */\n      dimensions: z.number().int().positive().optional(),\n      /**\n       * The quantized encoding format returned by the API. Perplexity does not\n       * return floating point embeddings; values are decoded to numbers:\n       * - `base64_int8` (default): signed int8 values, compare via cosine similarity.\n       * - `base64_binary`: packed bits per byte (0-255), compare via Hamming distance.\n       */\n      encodingFormat: z.enum([\"base64_int8\", \"base64_binary\"]).optional()\n    })\n  )\n);\n\n// src/perplexity-language-model.ts\nimport {\n  APICallError\n} from \"@ai-sdk/provider\";\nimport {\n  combineHeaders,\n  createEventSourceResponseHandler,\n  createJsonErrorResponseHandler,\n  createJsonResponseHandler,\n  parseProviderOptions,\n  postJsonToApi\n} from \"@ai-sdk/provider-utils\";\n\n// src/convert-perplexity-usage.ts\nfunction convertPerplexityUsage(usage) {\n  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n  if (usage == null) {\n    return {\n      inputTokens: {\n        total: void 0,\n        noCache: void 0,\n        cacheRead: void 0,\n        cacheWrite: void 0\n      },\n      outputTokens: {\n        total: void 0,\n        text: void 0,\n        reasoning: void 0\n      },\n      raw: void 0\n    };\n  }\n  const inputTokens = (_a = usage.input_tokens) != null ? _a : 0;\n  const outputTokens = (_b = usage.output_tokens) != null ? _b : 0;\n  const cacheReadTokens = (_f = (_e = (_c = usage.input_tokens_details) == null ? void 0 : _c.cache_read_input_tokens) != null ? _e : (_d = usage.input_tokens_details) == null ? void 0 : _d.cached_tokens) != null ? _f : 0;\n  const cacheWriteTokens = (_h = (_g = usage.input_tokens_details) == null ? void 0 : _g.cache_creation_input_tokens) != null ? _h : 0;\n  const reasoningTokens = (_j = (_i = usage.output_tokens_details) == null ? void 0 : _i.reasoning_tokens) != null ? _j : 0;\n  return {\n    inputTokens: {\n      total: inputTokens,\n      noCache: Math.max(0, inputTokens - cacheReadTokens - cacheWriteTokens),\n      cacheRead: cacheReadTokens,\n      cacheWrite: cacheWriteTokens\n    },\n    outputTokens: {\n      total: outputTokens,\n      text: Math.max(0, outputTokens - reasoningTokens),\n      reasoning: reasoningTokens\n    },\n    raw: usage\n  };\n}\n\n// src/convert-to-perplexity-input.ts\nimport {\n  UnsupportedFunctionalityError\n} from \"@ai-sdk/provider\";\nimport { convertUint8ArrayToBase64 } from \"@ai-sdk/provider-utils\";\nfunction serializeToolOutput(output) {\n  var _a;\n  switch (output.type) {\n    case \"text\":\n    case \"error-text\":\n      return output.value;\n    case \"json\":\n    case \"error-json\":\n      return JSON.stringify(output.value);\n    case \"execution-denied\":\n      return (_a = output.reason) != null ? _a : \"Tool call execution denied.\";\n    case \"content\": {\n      if (output.value.some((part) => part.type !== \"text\")) {\n        throw new UnsupportedFunctionalityError({\n          functionality: \"file and custom tool result content\"\n        });\n      }\n      return output.value.map((part) => part.type === \"text\" ? part.text : \"\").join(\"\");\n    }\n    default: {\n      const _exhaustiveCheck = output;\n      throw new Error(`Unsupported tool output: ${_exhaustiveCheck}`);\n    }\n  }\n}\nfunction getTopLevelMediaType(mediaType) {\n  const slashIndex = mediaType.indexOf(\"/\");\n  return slashIndex === -1 ? mediaType : mediaType.substring(0, slashIndex);\n}\nfunction getThoughtSignature(providerOptions) {\n  var _a;\n  const thoughtSignature = (_a = providerOptions == null ? void 0 : providerOptions.perplexity) == null ? void 0 : _a.thoughtSignature;\n  return typeof thoughtSignature === \"string\" ? thoughtSignature : void 0;\n}\nfunction convertToPerplexityInput(prompt) {\n  var _a;\n  const input = [];\n  const warnings = [];\n  for (const { role, content } of prompt) {\n    switch (role) {\n      case \"system\": {\n        input.push({ type: \"message\", role: \"system\", content });\n        break;\n      }\n      case \"user\": {\n        const convertedContent = content.map(\n          (part) => {\n            switch (part.type) {\n              case \"text\":\n                return { type: \"input_text\", text: part.text };\n              case \"file\": {\n                if (getTopLevelMediaType(part.mediaType) !== \"image\") {\n                  throw new UnsupportedFunctionalityError({\n                    functionality: `file part media type ${part.mediaType}`\n                  });\n                }\n                if (part.data instanceof URL) {\n                  return {\n                    type: \"input_image\",\n                    image_url: part.data.toString()\n                  };\n                }\n                const mediaType = part.mediaType === \"image/*\" ? \"image/jpeg\" : part.mediaType;\n                return {\n                  type: \"input_image\",\n                  image_url: `data:${mediaType};base64,${typeof part.data === \"string\" ? part.data : convertUint8ArrayToBase64(part.data)}`\n                };\n              }\n            }\n          }\n        );\n        const isTextOnly = convertedContent.every(\n          (part) => part.type === \"input_text\"\n        );\n        input.push({\n          type: \"message\",\n          role: \"user\",\n          content: isTextOnly ? convertedContent.map((part) => part.type === \"input_text\" ? part.text : \"\").join(\"\") : convertedContent\n        });\n        break;\n      }\n      case \"assistant\": {\n        const text = content.filter((part) => part.type === \"text\").map((part) => part.text).join(\"\");\n        if (text.length > 0) {\n          input.push({ type: \"message\", role: \"assistant\", content: text });\n        }\n        for (const part of content) {\n          switch (part.type) {\n            case \"text\":\n              break;\n            case \"tool-call\":\n              input.push({\n                type: \"function_call\",\n                call_id: part.toolCallId,\n                name: part.toolName,\n                arguments: JSON.stringify((_a = part.input) != null ? _a : {}),\n                thought_signature: getThoughtSignature(part.providerOptions)\n              });\n              break;\n            case \"tool-result\":\n              input.push({\n                type: \"function_call_output\",\n                call_id: part.toolCallId,\n                name: part.toolName,\n                output: serializeToolOutput(part.output),\n                thought_signature: getThoughtSignature(part.providerOptions)\n              });\n              break;\n            case \"reasoning\":\n              warnings.push({\n                type: \"unsupported\",\n                feature: \"reasoning content in prompt\"\n              });\n              break;\n            case \"file\":\n              throw new UnsupportedFunctionalityError({\n                functionality: `assistant ${part.type} parts`\n              });\n            default: {\n              const _exhaustiveCheck = part;\n              throw new Error(\n                `Unsupported assistant part: ${_exhaustiveCheck}`\n              );\n            }\n          }\n        }\n        break;\n      }\n      case \"tool\": {\n        for (const part of content) {\n          if (part.type === \"tool-approval-response\") {\n            throw new UnsupportedFunctionalityError({\n              functionality: \"tool approval responses\"\n            });\n          }\n          input.push({\n            type: \"function_call_output\",\n            call_id: part.toolCallId,\n            name: part.toolName,\n            output: serializeToolOutput(part.output),\n            thought_signature: getThoughtSignature(part.providerOptions)\n          });\n        }\n        break;\n      }\n      default: {\n        const _exhaustiveCheck = role;\n        throw new Error(`Unsupported role: ${_exhaustiveCheck}`);\n      }\n    }\n  }\n  return { input, warnings };\n}\n\n// src/map-perplexity-finish-reason.ts\nfunction mapPerplexityFinishReason({\n  status,\n  incompleteReason,\n  hasFunctionCall\n}) {\n  switch (incompleteReason) {\n    case \"max_output_tokens\":\n      return \"length\";\n    case \"content_filter\":\n      return \"content-filter\";\n  }\n  switch (status) {\n    case \"completed\":\n      return hasFunctionCall ? \"tool-calls\" : \"stop\";\n    case \"requires_action\":\n      return \"tool-calls\";\n    case \"failed\":\n      return \"error\";\n    case \"cancelled\":\n    case \"queued\":\n    case \"in_progress\":\n    default:\n      return hasFunctionCall ? \"tool-calls\" : \"other\";\n  }\n}\n\n// src/perplexity-agent-api.ts\nimport {\n  lazySchema as lazySchema2,\n  zodSchema as zodSchema2\n} from \"@ai-sdk/provider-utils\";\nimport { z as z2 } from \"zod/v4\";\nvar perplexitySearchResultSchema = () => z2.looseObject({\n  id: z2.number().optional(),\n  title: z2.string(),\n  url: z2.string(),\n  snippet: z2.string().optional(),\n  date: z2.string().nullish(),\n  last_updated: z2.string().nullish(),\n  source: z2.string().optional()\n});\nvar perplexityFetchedContentSchema = () => z2.looseObject({\n  title: z2.string(),\n  url: z2.string(),\n  snippet: z2.string().optional()\n});\nvar perplexityContentPartSchema = () => z2.looseObject({\n  type: z2.string(),\n  text: z2.string().optional(),\n  annotations: z2.array(\n    z2.looseObject({\n      type: z2.string().optional(),\n      url: z2.string().optional(),\n      title: z2.string().optional()\n    })\n  ).nullish()\n});\nvar handledOutputTypes = [\n  \"message\",\n  \"search_results\",\n  \"fetch_url_results\",\n  \"function_call\"\n];\nvar perplexityOutputItemSchema = () => z2.union([\n  z2.looseObject({\n    type: z2.literal(\"message\"),\n    id: z2.string().nullish(),\n    content: z2.array(perplexityContentPartSchema()).nullish()\n  }),\n  z2.looseObject({\n    type: z2.literal(\"search_results\"),\n    results: z2.array(perplexitySearchResultSchema()).nullish()\n  }),\n  z2.looseObject({\n    type: z2.literal(\"fetch_url_results\"),\n    contents: z2.array(perplexityFetchedContentSchema()).nullish()\n  }),\n  z2.looseObject({\n    type: z2.literal(\"function_call\"),\n    id: z2.string().nullish(),\n    call_id: z2.string().nullish(),\n    name: z2.string().nullish(),\n    arguments: z2.string().nullish(),\n    thought_signature: z2.string().nullish()\n  }),\n  // Native tool traces remain available in raw responses and raw stream chunks.\n  // Their fields (e.g. finance_results.results) have different shapes. Do not\n  // validate them as search results, or let malformed handled items fall back.\n  z2.object({\n    type: z2.string().refine((type) => !handledOutputTypes.includes(type))\n  }).transform(() => ({ type: \"unhandled\" }))\n]);\nvar perplexityCostSchema = () => z2.looseObject({\n  currency: z2.string().optional(),\n  input_cost: z2.number().optional(),\n  output_cost: z2.number().optional(),\n  total_cost: z2.number().optional(),\n  cache_creation_cost: z2.number().nullish(),\n  cache_read_cost: z2.number().nullish(),\n  tool_calls_cost: z2.number().nullish()\n});\nvar perplexityUsageSchema = () => z2.looseObject({\n  input_tokens: z2.number(),\n  output_tokens: z2.number(),\n  total_tokens: z2.number(),\n  input_tokens_details: z2.looseObject({\n    cached_tokens: z2.number().optional(),\n    cache_creation_input_tokens: z2.number().optional(),\n    cache_read_input_tokens: z2.number().optional()\n  }).nullish(),\n  output_tokens_details: z2.looseObject({\n    reasoning_tokens: z2.number().optional()\n  }).nullish(),\n  tool_calls_details: z2.record(\n    z2.string(),\n    z2.looseObject({\n      invocation: z2.number().optional()\n    })\n  ).nullish(),\n  cost: perplexityCostSchema().nullish()\n});\nvar perplexityAgentResponseSchema = () => z2.looseObject({\n  id: z2.string(),\n  created_at: z2.number(),\n  model: z2.string(),\n  object: z2.literal(\"response\"),\n  output: z2.array(perplexityOutputItemSchema()),\n  status: z2.string(),\n  incomplete_details: z2.looseObject({\n    reason: z2.string()\n  }).nullish(),\n  error: z2.looseObject({\n    code: z2.string().optional(),\n    message: z2.string(),\n    type: z2.string().optional()\n  }).nullish(),\n  usage: perplexityUsageSchema().nullish()\n});\nvar perplexityAgentResponseSchemaValidator = lazySchema2(\n  () => zodSchema2(perplexityAgentResponseSchema())\n);\nvar perplexityAgentChunkSchema = lazySchema2(\n  () => zodSchema2(\n    z2.looseObject({\n      type: z2.string(),\n      sequence_number: z2.number().nullish(),\n      response: perplexityAgentResponseSchema().nullish(),\n      item: perplexityOutputItemSchema().nullish(),\n      output_index: z2.number().nullish(),\n      item_id: z2.string().nullish(),\n      content_index: z2.number().nullish(),\n      delta: z2.string().nullish(),\n      text: z2.string().nullish(),\n      thought: z2.string().nullish(),\n      queries: z2.array(z2.string()).nullish(),\n      urls: z2.array(z2.string()).nullish(),\n      results: z2.array(perplexitySearchResultSchema()).nullish(),\n      contents: z2.array(perplexityFetchedContentSchema()).nullish(),\n      error: z2.looseObject({\n        code: z2.string().nullish(),\n        message: z2.string(),\n        type: z2.string().nullish()\n      }).nullish()\n    })\n  )\n);\nvar perplexityErrorSchema = lazySchema2(\n  () => zodSchema2(\n    z2.looseObject({\n      error: z2.union([\n        z2.string(),\n        z2.looseObject({\n          code: z2.union([z2.string(), z2.number()]).optional(),\n          message: z2.string().nullish(),\n          type: z2.string().nullish()\n        })\n      ]).optional(),\n      detail: z2.union([\n        z2.string(),\n        z2.array(\n          z2.looseObject({\n            msg: z2.string()\n          })\n        )\n      ]).optional(),\n      message: z2.string().optional()\n    })\n  )\n);\nfunction perplexityErrorToMessage(data) {\n  var _a, _b, _c;\n  if (typeof data.error === \"string\") {\n    return data.error;\n  }\n  if (data.error != null) {\n    return (_b = (_a = data.error.message) != null ? _a : data.error.type) != null ? _b : \"unknown error\";\n  }\n  if (typeof data.detail === \"string\") {\n    return data.detail;\n  }\n  if (Array.isArray(data.detail)) {\n    return data.detail.map((detail) => detail.msg).join(\", \");\n  }\n  return (_c = data.message) != null ? _c : \"unknown error\";\n}\n\n// src/perplexity-language-model-options.ts\nimport {\n  lazySchema as lazySchema3,\n  zodSchema as zodSchema3\n} from \"@ai-sdk/provider-utils\";\nimport { z as z3 } from \"zod/v4\";\nvar userLocationSchema = () => z3.looseObject({\n  latitude: z3.number().optional(),\n  longitude: z3.number().optional(),\n  country: z3.string().optional(),\n  city: z3.string().optional(),\n  region: z3.string().optional()\n});\nvar webSearchFiltersSchema = () => z3.looseObject({\n  search_domain_filter: z3.array(z3.string()).optional(),\n  search_recency_filter: z3.enum([\"hour\", \"day\", \"week\", \"month\", \"year\"]).optional(),\n  search_after_date_filter: z3.string().optional(),\n  search_before_date_filter: z3.string().optional(),\n  last_updated_after_filter: z3.string().optional(),\n  last_updated_before_filter: z3.string().optional()\n});\nvar webSearchToolSchema = () => z3.looseObject({\n  type: z3.literal(\"web_search\"),\n  filters: webSearchFiltersSchema().optional(),\n  max_results: z3.number().int().positive().optional(),\n  max_tokens: z3.number().optional(),\n  max_tokens_per_page: z3.number().optional(),\n  search_context_size: z3.enum([\"low\", \"medium\", \"high\"]).optional(),\n  user_location: userLocationSchema().optional()\n});\nvar nativeToolSchema = () => z3.union([\n  webSearchToolSchema(),\n  z3.looseObject({\n    type: z3.literal(\"fetch_url\"),\n    max_urls: z3.number().optional()\n  }),\n  z3.looseObject({ type: z3.literal(\"people_search\") }),\n  z3.looseObject({ type: z3.literal(\"finance_search\") }),\n  z3.looseObject({ type: z3.literal(\"sandbox\") }),\n  z3.looseObject({\n    type: z3.literal(\"mcp\"),\n    server_label: z3.string(),\n    server_url: z3.string(),\n    allowed_tools: z3.array(z3.string()).optional(),\n    authorization: z3.string().optional(),\n    defer_loading: z3.boolean().optional(),\n    headers: z3.record(z3.string(), z3.string()).optional()\n  }),\n  z3.looseObject({\n    type: z3.literal(\"connector\"),\n    id: z3.string(),\n    server_label: z3.string(),\n    server_description: z3.string().optional(),\n    allowed_tools: z3.array(z3.string()).optional()\n  })\n]);\nvar perplexityLanguageModelOptions = lazySchema3(\n  () => zodSchema3(\n    z3.looseObject({\n      /** Top-level Agent API instructions. */\n      instructions: z3.string().optional(),\n      /**\n       * Native Agent API tools. AI SDK function tools can also be supplied through\n       * the top-level `tools` option on `generateText` and `streamText`.\n       */\n      tools: z3.array(nativeToolSchema()).optional(),\n      /** A fallback model list for Agent API routing. */\n      models: z3.array(z3.string()).optional(),\n      /** Maximum number of agentic steps. */\n      max_steps: z3.number().int().positive().optional(),\n      /** Maximum number of native tool calls. */\n      max_tool_calls: z3.number().int().nonnegative().optional(),\n      /** Continue a conversation from an earlier Agent API response. */\n      previous_response_id: z3.string().optional(),\n      /**\n       * Whether the response can be retrieved later. Setting this to false does\n       * not disable persistence or prevent previous_response_id continuations.\n       */\n      store: z3.boolean().optional(),\n      /** Preferred response language as an ISO 639-1 language code. */\n      language_preference: z3.string().optional(),\n      /** Agent API reasoning configuration. */\n      reasoning: z3.looseObject({\n        effort: z3.enum([\"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"]).optional()\n      }).optional(),\n      /** Agent API skill configuration. */\n      skills: z3.array(\n        z3.union([\n          z3.looseObject({\n            type: z3.literal(\"builtin\"),\n            name: z3.enum([\n              \"office\",\n              \"office/docx\",\n              \"office/pdf\",\n              \"office/pptx\",\n              \"office/xlsx\"\n            ])\n          }),\n          z3.looseObject({\n            type: z3.literal(\"inline\"),\n            name: z3.string(),\n            description: z3.string(),\n            instructions: z3.string()\n          })\n        ])\n      ).optional()\n    })\n  )\n);\n\n// src/perplexity-prepare-tools.ts\nfunction preparePerplexityTools({\n  tools,\n  toolChoice\n}) {\n  const preparedTools = [];\n  const warnings = [];\n  for (const tool of tools != null ? tools : []) {\n    if (tool.type === \"provider\") {\n      warnings.push({\n        type: \"unsupported\",\n        feature: `provider-defined tool ${tool.name}`\n      });\n      continue;\n    }\n    preparedTools.push({\n      type: \"function\",\n      name: tool.name,\n      description: tool.description,\n      parameters: tool.inputSchema,\n      strict: tool.strict\n    });\n  }\n  if (toolChoice != null && toolChoice.type !== \"auto\") {\n    warnings.push({\n      type: \"unsupported\",\n      feature: \"toolChoice\",\n      details: \"The Perplexity Agent API currently selects tools automatically.\"\n    });\n  }\n  return { tools: preparedTools, warnings };\n}\n\n// src/perplexity-language-model.ts\nvar presetIds = /* @__PURE__ */ new Set([\n  \"fast\",\n  \"low\",\n  \"medium\",\n  \"high\",\n  \"xhigh\"\n]);\nfunction getModelSelection(modelId) {\n  if (presetIds.has(modelId)) {\n    return { preset: modelId };\n  }\n  return { model: modelId };\n}\nfunction getResponseMetadata(response) {\n  var _a, _b;\n  return {\n    id: (_a = response.id) != null ? _a : void 0,\n    modelId: (_b = response.model) != null ? _b : void 0,\n    timestamp: response.created_at != null ? new Date(response.created_at * 1e3) : void 0\n  };\n}\nfunction getProviderMetadata(usage) {\n  var _a, _b, _c, _d, _e, _f, _g;\n  const cost = usage == null ? void 0 : usage.cost;\n  const numSearchQueries = (usage == null ? void 0 : usage.tool_calls_details) ? Object.entries(usage.tool_calls_details).filter(([name]) => name.includes(\"search\")).reduce((total, [, details]) => {\n    var _a2;\n    return total + ((_a2 = details.invocation) != null ? _a2 : 0);\n  }, 0) : null;\n  return {\n    perplexity: {\n      usage: {\n        citationTokens: null,\n        numSearchQueries\n      },\n      images: null,\n      cost: cost == null ? null : {\n        inputTokensCost: (_a = cost.input_cost) != null ? _a : null,\n        outputTokensCost: (_b = cost.output_cost) != null ? _b : null,\n        requestCost: null,\n        totalCost: (_c = cost.total_cost) != null ? _c : null,\n        currency: (_d = cost.currency) != null ? _d : null,\n        cacheCreationCost: (_e = cost.cache_creation_cost) != null ? _e : null,\n        cacheReadCost: (_f = cost.cache_read_cost) != null ? _f : null,\n        toolCallsCost: (_g = cost.tool_calls_cost) != null ? _g : null\n      },\n      toolCalls: (usage == null ? void 0 : usage.tool_calls_details) == null ? null : Object.fromEntries(\n        Object.entries(usage.tool_calls_details).map(\n          ([name, details]) => {\n            var _a2;\n            return [\n              name,\n              { invocation: (_a2 = details.invocation) != null ? _a2 : null }\n            ];\n          }\n        )\n      )\n    }\n  };\n}\nfunction createSource(result, generateId2) {\n  var _a, _b, _c, _d, _e;\n  return {\n    type: \"source\",\n    sourceType: \"url\",\n    id: result.id == null ? generateId2() : String(result.id),\n    url: result.url,\n    title: result.title,\n    providerMetadata: {\n      perplexity: {\n        resultId: (_a = result.id) != null ? _a : null,\n        snippet: (_b = result.snippet) != null ? _b : null,\n        date: (_c = result.date) != null ? _c : null,\n        lastUpdated: (_d = result.last_updated) != null ? _d : null,\n        source: (_e = result.source) != null ? _e : null\n      }\n    }\n  };\n}\nfunction hasSearchResultId(source) {\n  var _a, _b;\n  return typeof ((_b = (_a = source.providerMetadata) == null ? void 0 : _a.perplexity) == null ? void 0 : _b.resultId) === \"number\";\n}\nfunction getSearchResults(item) {\n  var _a;\n  return item.type === \"search_results\" ? (_a = item.results) != null ? _a : [] : [];\n}\nfunction getFetchedSources(item) {\n  var _a;\n  return item.type === \"fetch_url_results\" ? (_a = item.contents) != null ? _a : [] : [];\n}\nvar PerplexityLanguageModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    this.provider = \"perplexity\";\n    this.supportedUrls = {\n      \"image/*\": [/^https?:\\/\\/.*$/]\n    };\n    this.modelId = modelId;\n    this.config = config;\n  }\n  async getArgs({\n    prompt,\n    maxOutputTokens,\n    temperature,\n    topP,\n    topK,\n    frequencyPenalty,\n    presencePenalty,\n    stopSequences,\n    responseFormat,\n    seed,\n    providerOptions,\n    tools,\n    toolChoice\n  }) {\n    var _a, _b;\n    const warnings = [];\n    const perplexityOptions = (_a = await parseProviderOptions({\n      provider: \"perplexity\",\n      providerOptions,\n      schema: perplexityLanguageModelOptions\n    })) != null ? _a : {};\n    if (topK != null) {\n      warnings.push({ type: \"unsupported\", feature: \"topK\" });\n    }\n    if (frequencyPenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"frequencyPenalty\" });\n    }\n    if (presencePenalty != null) {\n      warnings.push({ type: \"unsupported\", feature: \"presencePenalty\" });\n    }\n    if (stopSequences != null) {\n      warnings.push({ type: \"unsupported\", feature: \"stopSequences\" });\n    }\n    if (seed != null) {\n      warnings.push({ type: \"unsupported\", feature: \"seed\" });\n    }\n    const { tools: nativeTools, ...agentOptions } = perplexityOptions;\n    const modelSelection = getModelSelection(this.modelId);\n    const { input, warnings: inputWarnings } = convertToPerplexityInput(prompt);\n    warnings.push(...inputWarnings);\n    const { tools: functionTools, warnings: toolWarnings } = preparePerplexityTools({ tools, toolChoice });\n    warnings.push(...toolWarnings);\n    const agentTools = [\n      ...nativeTools != null ? nativeTools : [],\n      ...functionTools\n    ];\n    const body = {\n      ...agentOptions,\n      ...modelSelection,\n      input,\n      max_output_tokens: maxOutputTokens,\n      temperature,\n      top_p: topP,\n      response_format: (responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema != null ? {\n        type: \"json_schema\",\n        json_schema: {\n          name: (_b = responseFormat.name) != null ? _b : \"response\",\n          description: responseFormat.description,\n          schema: responseFormat.schema,\n          strict: true\n        }\n      } : void 0,\n      tools: agentTools.length > 0 ? agentTools : void 0\n    };\n    if ((responseFormat == null ? void 0 : responseFormat.type) === \"json\" && responseFormat.schema == null) {\n      warnings.push({\n        type: \"unsupported\",\n        feature: \"JSON response format without a schema\"\n      });\n    }\n    return { args: body, warnings };\n  }\n  async doGenerate(options) {\n    var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;\n    const { args: body, warnings } = await this.getArgs(options);\n    const url = `${this.config.baseURL}/v1/agent`;\n    const {\n      responseHeaders,\n      value: response,\n      rawValue: rawResponse\n    } = await postJsonToApi({\n      url,\n      headers: combineHeaders((_b = (_a = this.config).headers) == null ? void 0 : _b.call(_a), options.headers),\n      body,\n      failedResponseHandler: createJsonErrorResponseHandler({\n        errorSchema: perplexityErrorSchema,\n        errorToMessage: perplexityErrorToMessage\n      }),\n      successfulResponseHandler: createJsonResponseHandler(\n        perplexityAgentResponseSchemaValidator\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    if (response.error != null || response.status === \"failed\") {\n      throw new APICallError({\n        message: (_d = (_c = response.error) == null ? void 0 : _c.message) != null ? _d : \"Perplexity response failed\",\n        url,\n        requestBodyValues: body,\n        statusCode: 400,\n        responseHeaders,\n        responseBody: rawResponse,\n        isRetryable: false\n      });\n    }\n    const content = [];\n    const sourceIndexesByUrl = /* @__PURE__ */ new Map();\n    let hasFunctionCall = false;\n    const addSource = (source) => {\n      const existingIndex = sourceIndexesByUrl.get(source.url);\n      if (existingIndex == null) {\n        sourceIndexesByUrl.set(source.url, content.length);\n        content.push(source);\n      } else if (hasSearchResultId(source) && !hasSearchResultId(content[existingIndex])) {\n        content[existingIndex] = source;\n      }\n    };\n    for (const item of response.output) {\n      if (item.type === \"message\") {\n        for (const part of (_e = item.content) != null ? _e : []) {\n          if (part.type === \"output_text\" && part.text != null) {\n            content.push({ type: \"text\", text: part.text });\n          }\n          for (const annotation of (_f = part.annotations) != null ? _f : []) {\n            if (annotation.url != null) {\n              addSource({\n                type: \"source\",\n                sourceType: \"url\",\n                id: this.config.generateId(),\n                url: annotation.url,\n                title: annotation.title\n              });\n            }\n          }\n        }\n      } else if (item.type === \"search_results\") {\n        for (const result of getSearchResults(item)) {\n          addSource(createSource(result, this.config.generateId));\n        }\n      } else if (item.type === \"fetch_url_results\") {\n        for (const result of getFetchedSources(item)) {\n          addSource({\n            type: \"source\",\n            sourceType: \"url\",\n            id: this.config.generateId(),\n            url: result.url,\n            title: result.title,\n            providerMetadata: {\n              perplexity: { snippet: (_g = result.snippet) != null ? _g : null }\n            }\n          });\n        }\n      } else if (item.type === \"function_call\" && item.call_id != null && item.name != null && item.arguments != null) {\n        hasFunctionCall = true;\n        content.push({\n          type: \"tool-call\",\n          toolCallId: item.call_id,\n          toolName: item.name,\n          input: item.arguments,\n          providerMetadata: {\n            perplexity: {\n              itemId: (_h = item.id) != null ? _h : null,\n              ...item.thought_signature != null && {\n                thoughtSignature: item.thought_signature\n              }\n            }\n          }\n        });\n      }\n    }\n    const finishReason = (_j = (_i = response.incomplete_details) == null ? void 0 : _i.reason) != null ? _j : response.status;\n    return {\n      content,\n      finishReason: {\n        unified: mapPerplexityFinishReason({\n          status: response.status,\n          incompleteReason: (_k = response.incomplete_details) == null ? void 0 : _k.reason,\n          hasFunctionCall\n        }),\n        raw: finishReason\n      },\n      usage: convertPerplexityUsage(response.usage),\n      request: { body },\n      response: {\n        ...getResponseMetadata(response),\n        headers: responseHeaders,\n        body: rawResponse\n      },\n      warnings,\n      providerMetadata: getProviderMetadata(response.usage)\n    };\n  }\n  async doStream(options) {\n    var _a, _b;\n    const { args, warnings } = await this.getArgs(options);\n    const body = { ...args, stream: true };\n    const { responseHeaders, value: response } = await postJsonToApi({\n      url: `${this.config.baseURL}/v1/agent`,\n      headers: combineHeaders((_b = (_a = this.config).headers) == null ? void 0 : _b.call(_a), options.headers),\n      body,\n      failedResponseHandler: createJsonErrorResponseHandler({\n        errorSchema: perplexityErrorSchema,\n        errorToMessage: perplexityErrorToMessage\n      }),\n      successfulResponseHandler: createEventSourceResponseHandler(\n        perplexityAgentChunkSchema\n      ),\n      abortSignal: options.abortSignal,\n      fetch: this.config.fetch\n    });\n    let finishReason = {\n      unified: \"other\",\n      raw: void 0\n    };\n    let usage;\n    let hasFunctionCall = false;\n    let hasResponseMetadata = false;\n    let activeReasoningId;\n    const textStates = /* @__PURE__ */ new Map();\n    const emittedSourceUrls = /* @__PURE__ */ new Set();\n    const pendingSourcesByUrl = /* @__PURE__ */ new Map();\n    const seenFunctionCalls = /* @__PURE__ */ new Set();\n    const generateId2 = this.config.generateId;\n    return {\n      stream: response.pipeThrough(\n        new TransformStream({\n          start(controller) {\n            controller.enqueue({ type: \"stream-start\", warnings });\n          },\n          transform(chunk, controller) {\n            var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;\n            if (options.includeRawChunks) {\n              controller.enqueue({ type: \"raw\", rawValue: chunk.rawValue });\n            }\n            if (!chunk.success) {\n              finishReason = { unified: \"error\", raw: void 0 };\n              controller.enqueue({ type: \"error\", error: chunk.error });\n              return;\n            }\n            const value = chunk.value;\n            const getTextId = (itemId, outputIndex, contentIndex = 0) => {\n              const id = itemId != null ? itemId : String(outputIndex != null ? outputIndex : \"text\");\n              return contentIndex == null || contentIndex === 0 ? id : `${id}:${contentIndex}`;\n            };\n            const emitTextDelta = (id, delta) => {\n              let state = textStates.get(id);\n              if (state == null ? void 0 : state.ended) {\n                return;\n              }\n              if (state == null) {\n                state = { text: \"\", ended: false };\n                textStates.set(id, state);\n                controller.enqueue({ type: \"text-start\", id });\n              }\n              state.text += delta;\n              controller.enqueue({ type: \"text-delta\", id, delta });\n            };\n            const finishText = (id, text) => {\n              var _a3;\n              const state = textStates.get(id);\n              if (state == null ? void 0 : state.ended) {\n                return;\n              }\n              const emittedText = (_a3 = state == null ? void 0 : state.text) != null ? _a3 : \"\";\n              if (text != null && text.startsWith(emittedText) && text.length > emittedText.length) {\n                emitTextDelta(id, text.slice(emittedText.length));\n              }\n              const finalState = textStates.get(id);\n              if (finalState != null) {\n                finalState.ended = true;\n                controller.enqueue({ type: \"text-end\", id });\n              }\n            };\n            const finishOutputText = (item, outputIndex) => {\n              var _a3;\n              if (item.type === \"message\") {\n                for (const [contentIndex, part] of ((_a3 = item.content) != null ? _a3 : []).entries()) {\n                  if (part.type === \"output_text\") {\n                    finishText(\n                      getTextId(item.id, outputIndex, contentIndex),\n                      part.text\n                    );\n                  }\n                }\n              }\n            };\n            const emitSource = (source) => {\n              if (emittedSourceUrls.has(source.url)) {\n                return;\n              }\n              if (hasSearchResultId(source)) {\n                pendingSourcesByUrl.delete(source.url);\n                emittedSourceUrls.add(source.url);\n                controller.enqueue(source);\n              } else if (!pendingSourcesByUrl.has(source.url)) {\n                pendingSourcesByUrl.set(source.url, source);\n              }\n            };\n            const emitReasoningThought = (thought) => {\n              if (activeReasoningId != null && thought != null) {\n                controller.enqueue({\n                  type: \"reasoning-delta\",\n                  id: activeReasoningId,\n                  delta: thought\n                });\n              }\n            };\n            const emitFunctionCall = (item) => {\n              var _a3;\n              if (item.type !== \"function_call\" || item.call_id == null || item.name == null || item.arguments == null || seenFunctionCalls.has(item.call_id)) {\n                return;\n              }\n              seenFunctionCalls.add(item.call_id);\n              hasFunctionCall = true;\n              controller.enqueue({\n                type: \"tool-input-start\",\n                id: item.call_id,\n                toolName: item.name\n              });\n              controller.enqueue({\n                type: \"tool-input-delta\",\n                id: item.call_id,\n                delta: item.arguments\n              });\n              controller.enqueue({ type: \"tool-input-end\", id: item.call_id });\n              controller.enqueue({\n                type: \"tool-call\",\n                toolCallId: item.call_id,\n                toolName: item.name,\n                input: item.arguments,\n                providerMetadata: {\n                  perplexity: {\n                    itemId: (_a3 = item.id) != null ? _a3 : null,\n                    ...item.thought_signature != null && {\n                      thoughtSignature: item.thought_signature\n                    }\n                  }\n                }\n              });\n            };\n            const emitOutputSources = (item) => {\n              var _a3, _b3, _c2;\n              if (item.type === \"message\") {\n                for (const part of (_a3 = item.content) != null ? _a3 : []) {\n                  for (const annotation of (_b3 = part.annotations) != null ? _b3 : []) {\n                    if (annotation.url != null) {\n                      emitSource({\n                        type: \"source\",\n                        sourceType: \"url\",\n                        id: generateId2(),\n                        url: annotation.url,\n                        title: annotation.title\n                      });\n                    }\n                  }\n                }\n              }\n              for (const result of getSearchResults(item)) {\n                emitSource(createSource(result, generateId2));\n              }\n              for (const result of getFetchedSources(item)) {\n                emitSource({\n                  type: \"source\",\n                  sourceType: \"url\",\n                  id: generateId2(),\n                  url: result.url,\n                  title: result.title,\n                  providerMetadata: {\n                    perplexity: { snippet: (_c2 = result.snippet) != null ? _c2 : null }\n                  }\n                });\n              }\n            };\n            switch (value.type) {\n              case \"response.created\":\n              case \"response.in_progress\": {\n                if (!hasResponseMetadata && value.response != null) {\n                  controller.enqueue({\n                    type: \"response-metadata\",\n                    ...getResponseMetadata(value.response)\n                  });\n                  hasResponseMetadata = true;\n                }\n                break;\n              }\n              case \"response.output_text.delta\": {\n                if (value.delta != null) {\n                  emitTextDelta(\n                    getTextId(\n                      value.item_id,\n                      value.output_index,\n                      value.content_index\n                    ),\n                    value.delta\n                  );\n                }\n                break;\n              }\n              case \"response.output_text.done\": {\n                finishText(\n                  getTextId(\n                    value.item_id,\n                    value.output_index,\n                    value.content_index\n                  ),\n                  value.text\n                );\n                break;\n              }\n              case \"response.reasoning.started\": {\n                if (activeReasoningId != null) {\n                  controller.enqueue({\n                    type: \"reasoning-end\",\n                    id: activeReasoningId\n                  });\n                }\n                activeReasoningId = `reasoning-${(_a2 = value.sequence_number) != null ? _a2 : generateId2()}`;\n                controller.enqueue({\n                  type: \"reasoning-start\",\n                  id: activeReasoningId\n                });\n                emitReasoningThought(value.thought);\n                break;\n              }\n              case \"response.reasoning.search_queries\":\n              case \"response.reasoning.fetch_url_queries\": {\n                emitReasoningThought(value.thought);\n                break;\n              }\n              case \"response.reasoning.search_results\": {\n                emitReasoningThought(value.thought);\n                for (const result of (_b2 = value.results) != null ? _b2 : []) {\n                  emitSource(createSource(result, generateId2));\n                }\n                break;\n              }\n              case \"response.reasoning.fetch_url_results\": {\n                emitReasoningThought(value.thought);\n                for (const result of (_c = value.contents) != null ? _c : []) {\n                  emitSource({\n                    type: \"source\",\n                    sourceType: \"url\",\n                    id: generateId2(),\n                    url: result.url,\n                    title: result.title,\n                    providerMetadata: {\n                      perplexity: { snippet: (_d = result.snippet) != null ? _d : null }\n                    }\n                  });\n                }\n                break;\n              }\n              case \"response.reasoning.stopped\": {\n                emitReasoningThought(value.thought);\n                if (activeReasoningId != null) {\n                  controller.enqueue({\n                    type: \"reasoning-end\",\n                    id: activeReasoningId\n                  });\n                  activeReasoningId = void 0;\n                }\n                break;\n              }\n              case \"response.output_item.done\": {\n                if (value.item != null) {\n                  finishOutputText(value.item, value.output_index);\n                  emitOutputSources(value.item);\n                  emitFunctionCall(value.item);\n                }\n                break;\n              }\n              case \"response.completed\":\n              case \"response.incomplete\": {\n                if (value.response != null) {\n                  if (!hasResponseMetadata) {\n                    controller.enqueue({\n                      type: \"response-metadata\",\n                      ...getResponseMetadata(value.response)\n                    });\n                    hasResponseMetadata = true;\n                  }\n                  for (const [\n                    outputIndex,\n                    item\n                  ] of value.response.output.entries()) {\n                    finishOutputText(item, outputIndex);\n                    emitOutputSources(item);\n                    emitFunctionCall(item);\n                  }\n                  usage = (_e = value.response.usage) != null ? _e : void 0;\n                  const rawFinishReason = (_g = (_f = value.response.incomplete_details) == null ? void 0 : _f.reason) != null ? _g : value.response.status;\n                  finishReason = {\n                    unified: mapPerplexityFinishReason({\n                      status: value.response.status,\n                      incompleteReason: (_h = value.response.incomplete_details) == null ? void 0 : _h.reason,\n                      hasFunctionCall\n                    }),\n                    raw: rawFinishReason\n                  };\n                }\n                break;\n              }\n              case \"response.failed\": {\n                finishReason = { unified: \"error\", raw: \"failed\" };\n                controller.enqueue({\n                  type: \"error\",\n                  error: (_i = value.error) != null ? _i : new Error(\"Perplexity response failed\")\n                });\n                break;\n              }\n            }\n          },\n          flush(controller) {\n            for (const source of pendingSourcesByUrl.values()) {\n              controller.enqueue(source);\n            }\n            if (activeReasoningId != null) {\n              controller.enqueue({\n                type: \"reasoning-end\",\n                id: activeReasoningId\n              });\n            }\n            for (const [id, state] of textStates) {\n              if (!state.ended) {\n                controller.enqueue({ type: \"text-end\", id });\n              }\n            }\n            controller.enqueue({\n              type: \"finish\",\n              finishReason,\n              usage: convertPerplexityUsage(usage),\n              providerMetadata: getProviderMetadata(usage)\n            });\n          }\n        })\n      ),\n      request: { body },\n      response: { headers: responseHeaders }\n    };\n  }\n};\n\n// src/perplexity-embedding-model.ts\nvar PerplexityEmbeddingModel = class {\n  constructor(modelId, config) {\n    this.specificationVersion = \"v3\";\n    // https://docs.perplexity.ai/docs/embeddings/standard-embeddings\n    this.maxEmbeddingsPerCall = 512;\n    this.supportsParallelCalls = true;\n    this.modelId = modelId;\n    this.config = config;\n  }\n  get provider() {\n    return this.config.provider;\n  }\n  async doEmbed({\n    values,\n    abortSignal,\n    headers,\n    providerOptions\n  }) {\n    var _a, _b, _c, _d, _e, _f;\n    if (values.length > this.maxEmbeddingsPerCall) {\n      throw new TooManyEmbeddingValuesForCallError({\n        provider: this.provider,\n        modelId: this.modelId,\n        maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n        values\n      });\n    }\n    const perplexityOptions = (_a = await parseProviderOptions2({\n      provider: \"perplexity\",\n      providerOptions,\n      schema: perplexityEmbeddingModelOptions\n    })) != null ? _a : {};\n    const encodingFormat = (_b = perplexityOptions.encodingFormat) != null ? _b : \"base64_int8\";\n    const {\n      responseHeaders,\n      value: response,\n      rawValue\n    } = await postJsonToApi2({\n      url: `${this.config.baseURL}/v1/embeddings`,\n      headers: combineHeaders2(this.config.headers(), headers),\n      body: {\n        model: this.modelId,\n        input: values,\n        dimensions: perplexityOptions.dimensions,\n        encoding_format: encodingFormat\n      },\n      failedResponseHandler: createJsonErrorResponseHandler2({\n        errorSchema: perplexityErrorSchema,\n        errorToMessage: perplexityErrorToMessage\n      }),\n      successfulResponseHandler: createJsonResponseHandler2(\n        perplexityEmbeddingResponseSchema\n      ),\n      abortSignal,\n      fetch: this.config.fetch\n    });\n    const cost = (_c = response.usage) == null ? void 0 : _c.cost;\n    return {\n      embeddings: response.data.map(\n        (item) => decodeEmbedding(item.embedding, encodingFormat)\n      ),\n      usage: response.usage ? { tokens: response.usage.prompt_tokens } : void 0,\n      providerMetadata: cost ? {\n        perplexity: {\n          cost: {\n            inputCost: (_d = cost.input_cost) != null ? _d : null,\n            totalCost: (_e = cost.total_cost) != null ? _e : null,\n            currency: (_f = cost.currency) != null ? _f : null\n          }\n        }\n      } : void 0,\n      response: { headers: responseHeaders, body: rawValue },\n      warnings: []\n    };\n  }\n};\nfunction decodeEmbedding(base64, encodingFormat) {\n  const bytes = convertBase64ToUint8Array(base64);\n  if (encodingFormat === \"base64_int8\") {\n    const int8 = new Int8Array(\n      bytes.buffer,\n      bytes.byteOffset,\n      bytes.byteLength\n    );\n    return Array.from(int8);\n  }\n  return Array.from(bytes);\n}\nvar perplexityEmbeddingResponseSchema = lazySchema4(\n  () => zodSchema4(\n    z4.object({\n      data: z4.array(z4.object({ embedding: z4.string() })),\n      usage: z4.object({\n        prompt_tokens: z4.number(),\n        cost: z4.object({\n          input_cost: z4.number().nullish(),\n          total_cost: z4.number().nullish(),\n          currency: z4.string().nullish()\n        }).nullish()\n      }).nullish()\n    })\n  )\n);\n\n// src/version.ts\nvar VERSION = true ? \"3.1.9\" : \"0.0.0-test\";\n\n// src/perplexity-provider.ts\nfunction createPerplexity(options = {}) {\n  var _a;\n  const getHeaders = () => withUserAgentSuffix(\n    {\n      Authorization: `Bearer ${loadApiKey({\n        apiKey: options.apiKey,\n        environmentVariableName: \"PERPLEXITY_API_KEY\",\n        description: \"Perplexity\"\n      })}`,\n      \"X-Pplx-Integration\": \"vercel-ai-sdk\",\n      ...options.headers\n    },\n    `ai-sdk/perplexity/${VERSION}`\n  );\n  const baseURL = withoutTrailingSlash(\n    (_a = options.baseURL) != null ? _a : \"https://api.perplexity.ai\"\n  );\n  const createLanguageModel = (modelId) => {\n    return new PerplexityLanguageModel(modelId, {\n      baseURL,\n      headers: getHeaders,\n      generateId,\n      fetch: options.fetch\n    });\n  };\n  const createEmbeddingModel = (modelId) => new PerplexityEmbeddingModel(modelId, {\n    provider: \"perplexity.embedding\",\n    baseURL,\n    headers: getHeaders,\n    fetch: options.fetch\n  });\n  const provider = (modelId) => createLanguageModel(modelId);\n  provider.specificationVersion = \"v3\";\n  provider.languageModel = createLanguageModel;\n  provider.embedding = createEmbeddingModel;\n  provider.embeddingModel = createEmbeddingModel;\n  provider.textEmbeddingModel = createEmbeddingModel;\n  provider.imageModel = (modelId) => {\n    throw new NoSuchModelError({ modelId, modelType: \"imageModel\" });\n  };\n  return provider;\n}\nvar perplexity = createPerplexity();\nexport {\n  VERSION,\n  createPerplexity,\n  perplexity\n};\n//# sourceMappingURL=index.mjs.map","import { OpenAICompatibleChatLanguageModel, OpenAICompatibleCompletionLanguageModel, OpenAICompatibleEmbeddingModel } from \"@ai-sdk/openai-compatible\";\nimport { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, convertImageModelFileToDataUri, createJsonErrorResponseHandler, createJsonResponseHandler, lazySchema, loadApiKey, parseProviderOptions, postJsonToApi, resolve, resolveWith, serializeModelOptions, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/reranking/togetherai-reranking-api.ts\nconst togetheraiErrorSchema$1 = lazySchema(() => zodSchema(z.object({ error: z.object({ message: z.string() }) })));\nconst togetheraiRerankingResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string().nullish(),\n\tmodel: z.string().nullish(),\n\tresults: z.array(z.object({\n\t\tindex: z.number(),\n\t\trelevance_score: z.number()\n\t})),\n\tusage: z.object({\n\t\tprompt_tokens: z.number(),\n\t\tcompletion_tokens: z.number(),\n\t\ttotal_tokens: z.number()\n\t})\n})));\n//#endregion\n//#region src/reranking/togetherai-reranking-model-options.ts\nconst togetheraiRerankingModelOptionsSchema = lazySchema(() => zodSchema(z.object({ rankFields: z.array(z.string()).optional() })));\n//#endregion\n//#region src/reranking/togetherai-reranking-model.ts\nvar TogetherAIRerankingModel = class {\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tasync doRerank({ documents, headers, query, topN, abortSignal, providerOptions }) {\n\t\tconst rerankingOptions = await parseProviderOptions({\n\t\t\tprovider: \"togetherai\",\n\t\t\tproviderOptions,\n\t\t\tschema: togetheraiRerankingModelOptionsSchema\n\t\t});\n\t\tconst { responseHeaders, value: response, rawValue } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/rerank`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tdocuments: documents.values,\n\t\t\t\tquery,\n\t\t\t\ttop_n: topN,\n\t\t\t\trank_fields: rerankingOptions?.rankFields,\n\t\t\t\treturn_documents: false\n\t\t\t},\n\t\t\tfailedResponseHandler: createJsonErrorResponseHandler({\n\t\t\t\terrorSchema: togetheraiErrorSchema$1,\n\t\t\t\terrorToMessage: (data) => data.error.message\n\t\t\t}),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(togetheraiRerankingResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\tranking: response.results.map((result) => ({\n\t\t\t\tindex: result.index,\n\t\t\t\trelevanceScore: result.relevance_score\n\t\t\t})),\n\t\t\tresponse: {\n\t\t\t\tid: response.id ?? void 0,\n\t\t\t\tmodelId: response.model ?? void 0,\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawValue\n\t\t\t}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/togetherai-image-model-options.ts\n/**\n* Provider options schema for Together AI image generation.\n*/\nconst togetheraiImageModelOptionsSchema = lazySchema(() => zodSchema(z.looseObject({\n\t/**\n\t* Number of generation steps. Higher values can improve quality.\n\t*/\n\tsteps: z.number().nullish(),\n\t/**\n\t* Guidance scale for image generation.\n\t*/\n\tguidance: z.number().nullish(),\n\t/**\n\t* Negative prompt to guide what to avoid.\n\t*/\n\tnegative_prompt: z.string().nullish(),\n\t/**\n\t* Disable the safety checker for image generation.\n\t* When true, the API will not reject images flagged as potentially NSFW.\n\t* Not available for Flux Schnell Free and Flux Pro models.\n\t*/\n\tdisable_safety_checker: z.boolean().nullish()\n})));\n//#endregion\n//#region src/togetherai-image-model.ts\nconst nonDiffusionImageModels = /* @__PURE__ */ new Set([\"google/gemini-3-pro-image\"]);\nvar TogetherAIImageModel = class TogetherAIImageModel {\n\tget supportsFileInputs() {\n\t\tif ([\n\t\t\t\"black-forest-labs/FLUX.1-kontext-pro\",\n\t\t\t\"black-forest-labs/FLUX.1-kontext-max\",\n\t\t\t\"black-forest-labs/FLUX.1-kontext-dev\",\n\t\t\t\"black-forest-labs/FLUX.1-canny\",\n\t\t\t\"black-forest-labs/FLUX.1-depth\",\n\t\t\t\"black-forest-labs/FLUX.1-redux\",\n\t\t\t\"black-forest-labs/FLUX.2-pro\",\n\t\t\t\"black-forest-labs/FLUX.2-flex\"\n\t\t].includes(this.modelId)) return true;\n\t\treturn [\n\t\t\t\"stabilityai/stable-diffusion-xl-base-1.0\",\n\t\t\t\"black-forest-labs/FLUX.1-dev\",\n\t\t\t\"black-forest-labs/FLUX.1-dev-lora\",\n\t\t\t\"black-forest-labs/FLUX.1-schnell\",\n\t\t\t\"black-forest-labs/FLUX.1.1-pro\",\n\t\t\t\"black-forest-labs/FLUX.1-pro\",\n\t\t\t\"black-forest-labs/FLUX.1-schnell-Free\",\n\t\t\t\"black-forest-labs/FLUX.2-dev\",\n\t\t\t\"google/gemini-3-pro-image\"\n\t\t].includes(this.modelId) ? false : void 0;\n\t}\n\tget supportsMaskInputs() {\n\t\treturn this.supportsFileInputs == null ? void 0 : false;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new TogetherAIImageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxImagesPerCall = 1;\n\t}\n\tasync doGenerate({ prompt, n, size, seed, providerOptions, headers, abortSignal, files, mask }) {\n\t\tconst warnings = [];\n\t\tif (mask != null) throw new Error(\"Together AI does not support mask-based image editing. Use FLUX Kontext models (e.g., black-forest-labs/FLUX.1-kontext-pro) with a reference image and descriptive prompt instead.\");\n\t\tif (size != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"aspectRatio\",\n\t\t\tdetails: \"This model does not support the `aspectRatio` option. Use `size` instead.\"\n\t\t});\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst togetheraiOptions = await parseProviderOptions({\n\t\t\tprovider: \"togetherai\",\n\t\t\tproviderOptions,\n\t\t\tschema: togetheraiImageModelOptionsSchema\n\t\t});\n\t\tconst isNonDiffusionModel = nonDiffusionImageModels.has(this.modelId);\n\t\tconst modelOptions = { ...togetheraiOptions };\n\t\tif (isNonDiffusionModel) {\n\t\t\tdelete modelOptions.steps;\n\t\t\tdelete modelOptions.guidance;\n\t\t\tdelete modelOptions.negative_prompt;\n\t\t\tdelete modelOptions.disable_safety_checker;\n\t\t\tif (seed != null) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"seed\",\n\t\t\t\tdetails: `The ${this.modelId} model does not support the \\`seed\\` option.`\n\t\t\t});\n\t\t}\n\t\tlet imageUrl;\n\t\tif (files != null && files.length > 0) {\n\t\t\timageUrl = convertImageModelFileToDataUri(files[0]);\n\t\t\tif (files.length > 1) warnings.push({\n\t\t\t\ttype: \"other\",\n\t\t\t\tmessage: \"Together AI only supports a single input image. Additional images are ignored.\"\n\t\t\t});\n\t\t}\n\t\tconst splitSize = size?.split(\"x\");\n\t\tconst { value: response, responseHeaders } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/images/generations`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody: {\n\t\t\t\tmodel: this.modelId,\n\t\t\t\tprompt,\n\t\t\t\t...seed != null && !isNonDiffusionModel ? { seed } : {},\n\t\t\t\t...n > 1 ? { n } : {},\n\t\t\t\t...splitSize && {\n\t\t\t\t\twidth: parseInt(splitSize[0]),\n\t\t\t\t\theight: parseInt(splitSize[1])\n\t\t\t\t},\n\t\t\t\t...imageUrl != null ? { image_url: imageUrl } : {},\n\t\t\t\tresponse_format: \"base64\",\n\t\t\t\t...modelOptions\n\t\t\t},\n\t\t\tfailedResponseHandler: createJsonErrorResponseHandler({\n\t\t\t\terrorSchema: togetheraiErrorSchema,\n\t\t\t\terrorToMessage: (data) => data.error.message\n\t\t\t}),\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(togetheraiImageResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\timages: response.data.map((item) => item.b64_json),\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n};\nconst togetheraiImageResponseSchema = z.object({ data: z.array(z.object({ b64_json: z.string() })) });\nconst togetheraiErrorSchema = z.object({ error: z.object({ message: z.string() }) });\n//#endregion\n//#region src/version.ts\nconst VERSION = \"3.0.83\";\n//#endregion\n//#region src/togetherai-provider.ts\nfunction loadDeprecatedApiKey() {\n\tif (typeof process === \"undefined\") return;\n\tif (typeof process.env.TOGETHER_API_KEY === \"string\") return;\n\tconst key = process.env.TOGETHER_AI_API_KEY;\n\tif (typeof key === \"string\") console.warn(\"TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.\");\n\treturn key;\n}\nfunction getModelStructuredOutputSupport(modelId) {\n\treturn modelId === \"deepseek-ai/DeepSeek-V4-Flash-0731\";\n}\nfunction createTogetherAI(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL ?? \"https://api.together.xyz/v1/\");\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey: apiKey ?? loadDeprecatedApiKey(),\n\t\t\tenvironmentVariableName: \"TOGETHER_API_KEY\",\n\t\t\tdescription: \"TogetherAI\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-togetherai/${VERSION}`));\n\tconst getCommonModelConfig = (modelType) => ({\n\t\tprovider: `togetherai.${modelType}`,\n\t\turl: ({ path }) => `${baseURL}${path}`,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createChatModel = (modelId) => {\n\t\treturn new OpenAICompatibleChatLanguageModel(modelId, {\n\t\t\t...getCommonModelConfig(\"chat\"),\n\t\t\tincludeUsage: true,\n\t\t\tsupportsStructuredOutputs: getModelStructuredOutputSupport(modelId)\n\t\t});\n\t};\n\tconst createCompletionModel = (modelId) => new OpenAICompatibleCompletionLanguageModel(modelId, {\n\t\t...getCommonModelConfig(\"completion\"),\n\t\tincludeUsage: true\n\t});\n\tconst createEmbeddingModel = (modelId) => new OpenAICompatibleEmbeddingModel(modelId, getCommonModelConfig(\"embedding\"));\n\tconst createImageModel = (modelId) => new TogetherAIImageModel(modelId, {\n\t\t...getCommonModelConfig(\"image\"),\n\t\tbaseURL: baseURL ?? \"https://api.together.xyz/v1/\"\n\t});\n\tconst createRerankingModel = (modelId) => new TogetherAIRerankingModel(modelId, {\n\t\t...getCommonModelConfig(\"reranking\"),\n\t\tbaseURL: baseURL ?? \"https://api.together.xyz/v1/\"\n\t});\n\tconst provider = (modelId) => createChatModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.completionModel = createCompletionModel;\n\tprovider.languageModel = createChatModel;\n\tprovider.chatModel = createChatModel;\n\tprovider.embeddingModel = createEmbeddingModel;\n\tprovider.textEmbeddingModel = createEmbeddingModel;\n\tprovider.image = createImageModel;\n\tprovider.imageModel = createImageModel;\n\tprovider.reranking = createRerankingModel;\n\tprovider.rerankingModel = createRerankingModel;\n\treturn provider;\n}\nconst togetherai = createTogetherAI();\n//#endregion\nexport { VERSION, createTogetherAI, togetherai };\n\n//# sourceMappingURL=index.js.map","import { AISDKError, APICallError, InvalidArgumentError, NoSuchModelError, UnsupportedFunctionalityError } from \"@ai-sdk/provider\";\nimport { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, combineHeaders, connectToWebSocket, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertInlineFileDataToUint8Array, convertToBase64, convertUint8ArrayToBase64, createBinaryResponseHandler, createBinaryStreamResponseHandler, createEventSourceResponseHandler, createJsonErrorResponseHandler, createJsonResponseHandler, createLanguageModelResponseMetadata, createNullLanguageModelUsage, createProviderExecutedToolFactory, createProviderStreamError, createStatusCodeErrorResponseHandler, deleteFromApi, encodePathSegment, extractResponseHeaders, generateId, getFromApi, getTopLevelMediaType, isCustomReasoning, lazySchema, loadApiKey, mapReasoningToProviderEffort, mediaTypeToExtension, normalizeBatchRequestCounts, parseProviderOptions, postFormDataToApi, postJsonToApi, postMultipartStreamToApi, resolve, resolveFullMediaType, resolveProviderReference, resolveWith, safeParseJSON, safeValidateTypes, serializeModelOptions, toWebSocketUrl, validateTypes, waitForWebSocketBufferDrain, withUserAgentSuffix, withoutTrailingSlash, zodSchema } from \"@ai-sdk/provider-utils\";\nimport { z } from \"zod/v4\";\n//#region src/xai-error.ts\nconst apiErrorSchema = () => z.object({ error: z.object({\n\tmessage: z.string(),\n\ttype: z.string().nullish(),\n\tparam: z.any().nullish(),\n\tcode: z.union([z.string(), z.number()]).nullish()\n}) });\nconst responsesErrorSchema = () => z.object({\n\tcode: z.string(),\n\terror: z.string()\n});\nconst speechErrorSchema = () => z.object({ error: z.string() });\nconst xaiErrorDataSchema = lazySchema(() => zodSchema(z.union([\n\tapiErrorSchema(),\n\tresponsesErrorSchema(),\n\tspeechErrorSchema()\n])));\nconst xaiFailedResponseHandler = createJsonErrorResponseHandler({\n\terrorSchema: xaiErrorDataSchema,\n\terrorToMessage: (data) => {\n\t\tif (typeof data.error === \"string\") return \"code\" in data ? `${data.code}: ${data.error}` : data.error;\n\t\treturn data.error.message;\n\t}\n});\n//#endregion\n//#region src/xai-image-model-options.ts\nconst xaiImageModelOptions = lazySchema(() => zodSchema(z.object({\n\taspect_ratio: z.string().optional(),\n\toutput_format: z.string().optional(),\n\tsync_mode: z.boolean().optional(),\n\tresolution: z.enum([\n\t\t\"1k\",\n\t\t\"1.5k\",\n\t\t\"2k\"\n\t]).optional(),\n\tquality: z.enum([\n\t\t\"low\",\n\t\t\"medium\",\n\t\t\"high\",\n\t\t\"auto\"\n\t]).optional(),\n\tuser: z.string().optional()\n})));\n//#endregion\n//#region src/xai-model-catalog.ts\nconst xaiProviderOptions = {\n\tlanguage: {\n\t\treasoningEffort: { description: \"Reasoning effort for configurable models.\" },\n\t\treasoningSummary: { description: \"Deprecated summary level; xAI ignores this setting.\" },\n\t\tlogprobs: { description: \"Return token log probabilities.\" },\n\t\ttopLogprobs: { description: \"Number of token log probabilities to return.\" },\n\t\tminP: { description: \"Minimum probability sampling threshold.\" },\n\t\tmaxTurns: { description: \"Maximum number of agentic tool-calling turns.\" },\n\t\tparallelToolCalls: { description: \"Allow parallel tool calls.\" },\n\t\tpromptCacheKey: { description: \"Cache affinity key for shared prompt prefixes.\" },\n\t\tsafetyIdentifier: { description: \"End-user identifier for policy violations.\" },\n\t\tserviceTier: { description: \"Default or priority processing tier.\" },\n\t\tstore: { description: \"Store the input and response for later retrieval.\" },\n\t\tpreviousResponseId: { description: \"Previous response ID to continue.\" },\n\t\tuser: { description: \"End-user identifier for abuse monitoring.\" },\n\t\tinclude: { description: \"Additional output data to return.\" }\n\t},\n\timage: {\n\t\taspect_ratio: { description: \"Output aspect ratio, unless aspectRatio is provided.\" },\n\t\toutput_format: { description: \"Output image encoding.\" },\n\t\tsync_mode: { description: \"Wait for image generation to complete.\" },\n\t\tresolution: { description: \"Output image resolution.\" },\n\t\tquality: { description: \"Output image quality.\" },\n\t\tuser: { description: \"End-user identifier.\" }\n\t},\n\tspeech: {\n\t\tsampleRate: { description: \"Output audio sample rate.\" },\n\t\tbitRate: { description: \"MP3 output bit rate.\" },\n\t\toptimizeStreamingLatency: { description: \"Trade quality for lower latency.\" },\n\t\ttextNormalization: { description: \"Normalize written text before synthesis.\" },\n\t\twithTimestamps: { description: \"Return character timings and audio duration.\" },\n\t\treplace: { description: \"Spoken substitutions and pronunciation hints.\" }\n\t},\n\ttranscription: {\n\t\taudioFormat: { description: \"Encoding of raw input audio.\" },\n\t\tsampleRate: { description: \"Input audio sample rate.\" },\n\t\tlanguage: { description: \"Language for inverse text normalization.\" },\n\t\tformat: { description: \"Enable inverse text normalization.\" },\n\t\tmultichannel: { description: \"Transcribe each audio channel separately.\" },\n\t\tchannels: { description: \"Number of interleaved input audio channels.\" },\n\t\tdiarize: { description: \"Enable speaker diarization.\" },\n\t\tkeyterm: { description: \"Terms to bias transcription toward.\" },\n\t\tfillerWords: { description: \"Include filler words in the transcript.\" },\n\t\tvadThreshold: { description: \"Voice activity detection threshold.\" },\n\t\tstreaming: { description: \"WebSocket streaming transcription settings.\" }\n\t}\n};\nconst languageDefinitions = {\n\t\"grok-4.7\": {\n\t\timage: true,\n\t\treasoning: true,\n\t\tefforts: [\n\t\t\t\"low\",\n\t\t\t\"medium\",\n\t\t\t\"high\",\n\t\t\t\"xhigh\"\n\t\t]\n\t},\n\t\"grok-4.6\": {\n\t\timage: true,\n\t\treasoning: true,\n\t\tefforts: [\n\t\t\t\"low\",\n\t\t\t\"medium\",\n\t\t\t\"high\",\n\t\t\t\"xhigh\"\n\t\t]\n\t},\n\t\"grok-4.5\": {\n\t\timage: true,\n\t\treasoning: true,\n\t\tefforts: [\n\t\t\t\"low\",\n\t\t\t\"medium\",\n\t\t\t\"high\"\n\t\t]\n\t},\n\t\"grok-4.20-reasoning\": {\n\t\timage: true,\n\t\treasoning: true\n\t},\n\t\"grok-4.20-non-reasoning\": {\n\t\timage: true,\n\t\treasoning: false\n\t},\n\t\"grok-4-1-fast-reasoning\": {\n\t\timage: true,\n\t\treasoning: true\n\t},\n\t\"grok-4-1-fast-non-reasoning\": {\n\t\timage: true,\n\t\treasoning: false\n\t},\n\t\"grok-4-1\": {\n\t\timage: false,\n\t\treasoning: false\n\t},\n\t\"grok-4-fast-reasoning\": {\n\t\timage: true,\n\t\treasoning: true\n\t},\n\t\"grok-4-fast-non-reasoning\": {\n\t\timage: true,\n\t\treasoning: false\n\t},\n\t\"grok-code-fast-1\": {\n\t\timage: false,\n\t\treasoning: true\n\t},\n\t\"grok-4\": {\n\t\timage: false,\n\t\treasoning: true\n\t},\n\t\"grok-3\": {\n\t\timage: false,\n\t\treasoning: false\n\t},\n\t\"grok-3-mini\": {\n\t\timage: false,\n\t\treasoning: true\n\t}\n};\nconst modelsWithoutReasoningEffort = /^grok-4\\.20(-\\d{4})?-(non-)?reasoning$/;\nconst modelsWithoutNoneReasoningEffort = /^grok-(?:4\\.[5-9](?!\\d)|(?:[5-9]|[1-9]\\d+)(?:[.-]|$))/;\nfunction createLanguageModelEntry(modelId, definition) {\n\tconst configurable = !modelsWithoutReasoningEffort.test(modelId);\n\treturn {\n\t\tcapabilities: { language: {\n\t\t\tinputs: {\n\t\t\t\timage: definition?.image ?? \"unknown\",\n\t\t\t\taudio: \"unknown\"\n\t\t\t},\n\t\t\tobjectGeneration: definition != null ? true : \"unknown\",\n\t\t\ttools: {\n\t\t\t\tusage: definition != null ? true : \"unknown\",\n\t\t\t\tstreaming: definition != null ? true : \"unknown\"\n\t\t\t},\n\t\t\treasoning: {\n\t\t\t\tsupport: definition?.reasoning ?? \"unknown\",\n\t\t\t\tefforts: definition?.efforts,\n\t\t\t\tportable: {\n\t\t\t\t\tconfigurable,\n\t\t\t\t\tnone: !modelsWithoutNoneReasoningEffort.test(modelId),\n\t\t\t\t\txhigh: modelId === \"grok-4.6\"\n\t\t\t\t}\n\t\t\t},\n\t\t\tsampling: {\n\t\t\t\ttemperature: \"unknown\",\n\t\t\t\ttopP: \"unknown\",\n\t\t\t\tlogprobs: \"unknown\"\n\t\t\t}\n\t\t} },\n\t\tproviderOptions: { language: declareProviderOptions(xaiProviderOptions.language, definition != null ? true : \"unknown\", {\n\t\t\treasoningEffort: !configurable ? false : definition != null ? true : \"unknown\",\n\t\t\treasoningSummary: false\n\t\t}) }\n\t};\n}\nconst commonAspectRatios = [\n\t\"1:1\",\n\t\"16:9\",\n\t\"9:16\",\n\t\"4:3\",\n\t\"3:4\",\n\t\"3:2\",\n\t\"2:3\",\n\t\"2:1\",\n\t\"1:2\",\n\t\"19.5:9\",\n\t\"9:19.5\",\n\t\"20:9\",\n\t\"9:20\"\n];\nfunction createImageModelEntry(definition) {\n\treturn {\n\t\tcapabilities: { image: {\n\t\t\tsizes: { description: \"Use aspectRatio and providerOptions.xai.resolution instead of size.\" },\n\t\t\tfileInput: definition != null ? true : \"unknown\",\n\t\t\tmaskInput: definition != null ? false : \"unknown\",\n\t\t\tmaxImagesPerCall: 3,\n\t\t\tresolutions: definition?.resolutions,\n\t\t\taspectRatios: definition?.aspectRatios\n\t\t} },\n\t\tproviderOptions: { image: declareProviderOptions(xaiProviderOptions.image, definition != null ? true : \"unknown\", { quality: definition?.quality ?? \"unknown\" }) }\n\t};\n}\nconst defaultSpeechModelEntry = {\n\tcapabilities: { speech: {\n\t\tinstructions: false,\n\t\tlanguage: true,\n\t\tspeed: true,\n\t\toutputFormats: [\n\t\t\t\"mp3\",\n\t\t\t\"wav\",\n\t\t\t\"pcm\",\n\t\t\t\"mulaw\",\n\t\t\t\"alaw\"\n\t\t]\n\t} },\n\tproviderOptions: { speech: declareProviderOptions(xaiProviderOptions.speech, true, { bitRate: { condition: \"Only supported for MP3 output.\" } }) },\n\trequestConfig: { speech: {\n\t\tvoice: \"eve\",\n\t\tlanguage: \"auto\",\n\t\toutputFormat: \"mp3\"\n\t} }\n};\nfunction createTranscriptionModelEntry(modelId, declared) {\n\tconst support = declared ? true : \"unknown\";\n\treturn {\n\t\tcapabilities: { transcription: {\n\t\t\ttranscription: support,\n\t\t\tstreaming: support,\n\t\t\tduration: support,\n\t\t\tsegments: support,\n\t\t\tlanguage: support,\n\t\t\twordTimestamps: support,\n\t\t\tdiarization: support,\n\t\t\tmultichannel: support\n\t\t} },\n\t\tproviderOptions: { transcription: declareProviderOptions(xaiProviderOptions.transcription, support, {\n\t\t\taudioFormat: { condition: \"Opus encoding is supported for streaming requests only.\" },\n\t\t\tformat: { condition: \"Requires language and a request/response transcription request.\" },\n\t\t\tstreaming: { condition: \"Only supported for streaming transcription.\" }\n\t\t}) },\n\t\trequestConfig: { transcription: { model: modelId || void 0 } }\n\t};\n}\nconst defaultTranscriptionModelEntry = createTranscriptionModelEntry(\"\", true);\nconst xaiModelCatalog = {\n\t...Object.fromEntries(Object.entries(languageDefinitions).map(([modelId, definition]) => [modelId, createLanguageModelEntry(modelId, definition)])),\n\t\"grok-imagine-image-2.0\": createImageModelEntry({\n\t\tresolutions: [\n\t\t\t\"1k\",\n\t\t\t\"1.5k\",\n\t\t\t\"2k\"\n\t\t],\n\t\taspectRatios: [\n\t\t\t...commonAspectRatios,\n\t\t\t\"21:9\",\n\t\t\t\"5:2\",\n\t\t\t\"auto\"\n\t\t],\n\t\tquality: true\n\t}),\n\t\"grok-imagine-image-pro\": createImageModelEntry({\n\t\tresolutions: [\n\t\t\t\"1k\",\n\t\t\t\"1.5k\",\n\t\t\t\"2k\"\n\t\t],\n\t\taspectRatios: [...commonAspectRatios, \"auto\"],\n\t\tquality: \"unknown\"\n\t}),\n\t\"grok-imagine-image\": createImageModelEntry({\n\t\tresolutions: [\"1k\"],\n\t\taspectRatios: [...commonAspectRatios, \"auto\"],\n\t\tquality: \"unknown\"\n\t}),\n\t\"\": {\n\t\tcapabilities: {\n\t\t\t...defaultSpeechModelEntry.capabilities,\n\t\t\t...defaultTranscriptionModelEntry.capabilities\n\t\t},\n\t\tproviderOptions: {\n\t\t\t...defaultSpeechModelEntry.providerOptions,\n\t\t\t...defaultTranscriptionModelEntry.providerOptions\n\t\t},\n\t\trequestConfig: {\n\t\t\t...defaultSpeechModelEntry.requestConfig,\n\t\t\t...defaultTranscriptionModelEntry.requestConfig\n\t\t}\n\t},\n\t\"grok-voice-transcribe-2.0\": createTranscriptionModelEntry(\"grok-voice-transcribe-2.0\", true),\n\t\"grok-voice-latest\": { capabilities: { realtime: {\n\t\tconversation: \"turn-based\",\n\t\ttransports: [\"websocket\"],\n\t\tconnections: [\"client-secret-websocket\"]\n\t} } }\n};\nfunction findModelEntry(modelId) {\n\treturn Object.prototype.hasOwnProperty.call(xaiModelCatalog, modelId) ? xaiModelCatalog[modelId] : void 0;\n}\nfunction getXaiLanguageModelEntry(modelId) {\n\tconst entry = findModelEntry(modelId);\n\treturn entry?.capabilities.language != null && entry.providerOptions?.language != null ? {\n\t\tcapabilities: { language: entry.capabilities.language },\n\t\tproviderOptions: { language: entry.providerOptions.language }\n\t} : createLanguageModelEntry(modelId);\n}\nfunction getXaiImageModelEntry(modelId) {\n\tconst entry = findModelEntry(modelId);\n\treturn entry?.capabilities.image != null && entry.providerOptions?.image != null ? {\n\t\tcapabilities: { image: entry.capabilities.image },\n\t\tproviderOptions: { image: entry.providerOptions.image }\n\t} : createImageModelEntry();\n}\nfunction getXaiSpeechModelEntry() {\n\treturn defaultSpeechModelEntry;\n}\nfunction getXaiTranscriptionModelEntry(modelId) {\n\tconst entry = findModelEntry(modelId);\n\treturn entry?.capabilities.transcription != null && entry.providerOptions?.transcription != null && entry.requestConfig?.transcription != null ? {\n\t\tcapabilities: { transcription: entry.capabilities.transcription },\n\t\tproviderOptions: { transcription: entry.providerOptions.transcription },\n\t\trequestConfig: { transcription: entry.requestConfig.transcription }\n\t} : createTranscriptionModelEntry(modelId, false);\n}\nfunction declareProviderOptions(definitions, support, exceptions) {\n\treturn Object.fromEntries(Object.keys(definitions).map((option) => [option, exceptions[option] ?? support]));\n}\n//#endregion\n//#region src/xai-image-model.ts\nvar XaiImageModel = class XaiImageModel {\n\tget supportsFileInputs() {\n\t\tconst support = getXaiImageModelEntry(this.modelId).capabilities.image.fileInput;\n\t\treturn typeof support === \"boolean\" ? support : void 0;\n\t}\n\tget supportsMaskInputs() {\n\t\tconst support = getXaiImageModelEntry(this.modelId).capabilities.image.maskInput;\n\t\treturn typeof support === \"boolean\" ? support : void 0;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new XaiImageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxImagesPerCall = getXaiImageModelEntry(modelId).capabilities.image.maxImagesPerCall;\n\t}\n\tasync doGenerate({ prompt, n, size, aspectRatio, seed, providerOptions, headers, abortSignal, files, mask }) {\n\t\tconst warnings = [];\n\t\tif (size != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"size\",\n\t\t\tdetails: \"This model does not support the `size` option. Use `aspectRatio` instead.\"\n\t\t});\n\t\tif (seed != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"seed\"\n\t\t});\n\t\tif (mask != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"mask\"\n\t\t});\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions,\n\t\t\tschema: xaiImageModelOptions\n\t\t});\n\t\tconst hasFiles = files != null && files.length > 0;\n\t\tconst imageUrls = hasFiles ? files.map((file) => convertImageModelFileToDataUri(file)) : [];\n\t\tconst endpoint = hasFiles ? \"/images/edits\" : \"/images/generations\";\n\t\tconst body = {\n\t\t\tmodel: this.modelId,\n\t\t\tprompt,\n\t\t\tn,\n\t\t\tresponse_format: \"b64_json\"\n\t\t};\n\t\tif (aspectRatio != null) body.aspect_ratio = aspectRatio;\n\t\tif (xaiOptions?.output_format != null) body.output_format = xaiOptions.output_format;\n\t\tif (xaiOptions?.sync_mode != null) body.sync_mode = xaiOptions.sync_mode;\n\t\tif (xaiOptions?.aspect_ratio != null && aspectRatio == null) body.aspect_ratio = xaiOptions.aspect_ratio;\n\t\tif (xaiOptions?.resolution != null) body.resolution = xaiOptions.resolution;\n\t\tif (xaiOptions?.quality != null) body.quality = xaiOptions.quality;\n\t\tif (xaiOptions?.user != null) body.user = xaiOptions.user;\n\t\tif (imageUrls.length === 1) body.image = {\n\t\t\turl: imageUrls[0],\n\t\t\ttype: \"image_url\"\n\t\t};\n\t\telse if (imageUrls.length > 1) body.images = imageUrls.map((url) => ({\n\t\t\turl,\n\t\t\ttype: \"image_url\"\n\t\t}));\n\t\tconst baseURL = this.config.baseURL ?? \"https://api.x.ai/v1\";\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { value: response, responseHeaders } = await postJsonToApi({\n\t\t\turl: `${baseURL}${endpoint}`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiImageResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tif (response.data.some((image) => image.respect_moderation === false)) throw new Error(\"Image generation was blocked due to a content policy violation.\");\n\t\treturn {\n\t\t\timages: response.data.every((image) => image.b64_json != null) ? response.data.map((image) => image.b64_json) : await Promise.all(response.data.map((image) => this.downloadImage(image.url, abortSignal))),\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t},\n\t\t\tproviderMetadata: { xai: {\n\t\t\t\timages: response.data.map((item) => ({ ...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {} })),\n\t\t\t\t...response.usage?.cost_in_usd_ticks != null ? { costInUsdTicks: response.usage.cost_in_usd_ticks } : {}\n\t\t\t} }\n\t\t};\n\t}\n\tasync downloadImage(url, abortSignal) {\n\t\tconst { value } = await getFromApi({\n\t\t\turl,\n\t\t\tvalidateUrl: true,\n\t\t\ttrustedOrigin: this.config.baseURL,\n\t\t\tabortSignal,\n\t\t\tfailedResponseHandler: createStatusCodeErrorResponseHandler(),\n\t\t\tsuccessfulResponseHandler: createBinaryResponseHandler(),\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn value;\n\t}\n};\nconst xaiImageResponseSchema = lazySchema(() => zodSchema(z.object({\n\tdata: z.array(z.object({\n\t\turl: z.string().nullish(),\n\t\tb64_json: z.string().nullish(),\n\t\trevised_prompt: z.string().nullish(),\n\t\trespect_moderation: z.boolean().nullish()\n\t})),\n\tusage: z.object({ cost_in_usd_ticks: z.number().nullish() }).nullish()\n})));\n//#endregion\n//#region src/get-response-metadata.ts\nfunction getResponseMetadata({ id, model, created, created_at }) {\n\treturn createLanguageModelResponseMetadata({\n\t\tid,\n\t\tmodel,\n\t\tcreated: created ?? created_at\n\t});\n}\n//#endregion\n//#region src/map-xai-finish-reason.ts\nfunction mapXaiFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\": return \"stop\";\n\t\tcase \"length\": return \"length\";\n\t\tcase \"tool_calls\":\n\t\tcase \"function_call\": return \"tool-calls\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/files/xai-files-api.ts\nconst xaiFilesResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string(),\n\tobject: z.string().nullish(),\n\tbytes: z.number().nullish(),\n\tcreated_at: z.number().nullish(),\n\texpires_at: z.number().nullish(),\n\tfilename: z.string().nullish(),\n\tpurpose: z.string().nullish(),\n\tstatus: z.string().nullish()\n})));\nconst xaiFileDeleteResponseSchema = lazySchema(() => zodSchema(z.object({\n\tid: z.string(),\n\tobject: z.string().nullish(),\n\tdeleted: z.boolean()\n})));\n//#endregion\n//#region src/xai-file-part-options.ts\nconst xaiFilePartProviderOptions = lazySchema(() => zodSchema(z.object({ \n/**\n* Controls the resolution at which the model processes the image.\n* `low` processes the image at reduced resolution and consumes fewer\n* input tokens, `high` processes the image at full resolution, and\n* `auto` lets the API decide. Defaults to full resolution when not set.\n*\n* Note: the xAI API silently ignores invalid values, so the value is\n* validated client-side.\n*\n* @see https://docs.x.ai/developers/model-capabilities/images/understanding\n*/\nimageDetail: z.enum([\n\t\"low\",\n\t\"high\",\n\t\"auto\"\n]).optional() })));\n//#endregion\n//#region src/responses/convert-to-xai-responses-input.ts\nasync function convertToXaiResponsesInput({ prompt }) {\n\tconst input = [];\n\tconst inputWarnings = [];\n\tfor (const message of prompt) switch (message.role) {\n\t\tcase \"system\":\n\t\t\tinput.push({\n\t\t\t\trole: \"system\",\n\t\t\t\tcontent: message.content\n\t\t\t});\n\t\t\tbreak;\n\t\tcase \"user\": {\n\t\t\tconst contentParts = [];\n\t\t\tfor (const block of message.content) switch (block.type) {\n\t\t\t\tcase \"text\":\n\t\t\t\t\tcontentParts.push({\n\t\t\t\t\t\ttype: \"input_text\",\n\t\t\t\t\t\ttext: block.text\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"file\":\n\t\t\t\t\tswitch (block.data.type) {\n\t\t\t\t\t\tcase \"reference\":\n\t\t\t\t\t\t\tcontentParts.push({\n\t\t\t\t\t\t\t\ttype: \"input_file\",\n\t\t\t\t\t\t\t\tfile_id: resolveProviderReference({\n\t\t\t\t\t\t\t\t\treference: block.data.reference,\n\t\t\t\t\t\t\t\t\tprovider: \"xai\"\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"text\": throw new UnsupportedFunctionalityError({ functionality: \"text file parts\" });\n\t\t\t\t\t\tcase \"url\":\n\t\t\t\t\t\tcase \"data\": if (getTopLevelMediaType(block.mediaType) === \"image\") {\n\t\t\t\t\t\t\tconst imageUrl = block.data.type === \"url\" ? block.data.url.toString() : `data:${resolveFullMediaType({ part: block })};base64,${convertToBase64(block.data.data)}`;\n\t\t\t\t\t\t\tconst filePartOptions = await parseProviderOptions({\n\t\t\t\t\t\t\t\tprovider: \"xai\",\n\t\t\t\t\t\t\t\tproviderOptions: block.providerOptions,\n\t\t\t\t\t\t\t\tschema: xaiFilePartProviderOptions\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontentParts.push({\n\t\t\t\t\t\t\t\ttype: \"input_image\",\n\t\t\t\t\t\t\t\timage_url: imageUrl,\n\t\t\t\t\t\t\t\t...filePartOptions?.imageDetail != null && { detail: filePartOptions.imageDetail }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else if (block.data.type === \"url\") contentParts.push({\n\t\t\t\t\t\t\ttype: \"input_file\",\n\t\t\t\t\t\t\tfile_url: block.data.url.toString()\n\t\t\t\t\t\t});\n\t\t\t\t\t\telse throw new UnsupportedFunctionalityError({ functionality: `file part media type ${block.mediaType} as inline data (xAI Responses requires a URL or a Files API reference for non-image files)` });\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: inputWarnings.push({\n\t\t\t\t\ttype: \"other\",\n\t\t\t\t\tmessage: \"xAI Responses API does not support this content type in user messages\"\n\t\t\t\t});\n\t\t\t}\n\t\t\tinput.push({\n\t\t\t\trole: \"user\",\n\t\t\t\tcontent: contentParts\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t\tcase \"assistant\":\n\t\t\tfor (const part of message.content) switch (part.type) {\n\t\t\t\tcase \"text\": {\n\t\t\t\t\tconst id = typeof part.providerOptions?.xai?.itemId === \"string\" ? part.providerOptions.xai.itemId : void 0;\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\trole: \"assistant\",\n\t\t\t\t\t\tcontent: part.text,\n\t\t\t\t\t\tid\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"tool-call\": {\n\t\t\t\t\tif (part.providerExecuted) break;\n\t\t\t\t\tconst id = typeof part.providerOptions?.xai?.itemId === \"string\" ? part.providerOptions.xai.itemId : void 0;\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\ttype: \"function_call\",\n\t\t\t\t\t\tid: id ?? part.toolCallId,\n\t\t\t\t\t\tcall_id: part.toolCallId,\n\t\t\t\t\t\tname: part.toolName,\n\t\t\t\t\t\targuments: JSON.stringify(part.input),\n\t\t\t\t\t\tstatus: \"completed\"\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"tool-result\": break;\n\t\t\t\tcase \"reasoning\": {\n\t\t\t\t\tconst itemId = typeof part.providerOptions?.xai?.itemId === \"string\" ? part.providerOptions.xai.itemId : void 0;\n\t\t\t\t\tconst encryptedContent = typeof part.providerOptions?.xai?.reasoningEncryptedContent === \"string\" ? part.providerOptions.xai.reasoningEncryptedContent : void 0;\n\t\t\t\t\tif (itemId != null || encryptedContent != null) {\n\t\t\t\t\t\tconst summaryParts = [];\n\t\t\t\t\t\tif (part.text.length > 0) summaryParts.push({\n\t\t\t\t\t\t\ttype: \"summary_text\",\n\t\t\t\t\t\t\ttext: part.text\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinput.push({\n\t\t\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\t\t\tid: itemId ?? \"\",\n\t\t\t\t\t\t\tsummary: summaryParts,\n\t\t\t\t\t\t\tstatus: \"completed\",\n\t\t\t\t\t\t\t...encryptedContent != null && { encrypted_content: encryptedContent }\n\t\t\t\t\t\t});\n\t\t\t\t\t} else inputWarnings.push({\n\t\t\t\t\t\ttype: \"other\",\n\t\t\t\t\t\tmessage: \"Reasoning parts without itemId or encrypted content cannot be sent back to xAI. Skipping.\"\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"reasoning-file\":\n\t\t\t\tcase \"custom\":\n\t\t\t\tcase \"file\":\n\t\t\t\t\tinputWarnings.push({\n\t\t\t\t\t\ttype: \"other\",\n\t\t\t\t\t\tmessage: `xAI Responses API does not support ${part.type} in assistant messages`\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: inputWarnings.push({\n\t\t\t\t\ttype: \"other\",\n\t\t\t\t\tmessage: \"xAI Responses API does not support this content type in assistant messages\"\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"tool\":\n\t\t\tfor (const part of message.content) {\n\t\t\t\tif (part.type === \"tool-approval-response\") continue;\n\t\t\t\tconst output = part.output;\n\t\t\t\tlet outputValue;\n\t\t\t\tswitch (output.type) {\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\tcase \"error-text\":\n\t\t\t\t\t\toutputValue = output.value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"execution-denied\":\n\t\t\t\t\t\toutputValue = output.reason ?? \"tool execution denied\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"json\":\n\t\t\t\t\tcase \"error-json\":\n\t\t\t\t\t\toutputValue = JSON.stringify(output.value);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"content\":\n\t\t\t\t\t\toutputValue = [];\n\t\t\t\t\t\tfor (const item of output.value) switch (item.type) {\n\t\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t\t\toutputValue.push({\n\t\t\t\t\t\t\t\t\ttype: \"input_text\",\n\t\t\t\t\t\t\t\t\ttext: item.text\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"file\": if (getTopLevelMediaType(item.mediaType) === \"image\" && (item.data.type === \"data\" || item.data.type === \"url\")) outputValue.push({\n\t\t\t\t\t\t\t\ttype: \"input_image\",\n\t\t\t\t\t\t\t\timage_url: item.data.type === \"url\" ? item.data.url.toString() : `data:${resolveFullMediaType({ part: item })};base64,${convertToBase64(item.data.data)}`\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: outputValue = \"\";\n\t\t\t\t}\n\t\t\t\tinput.push({\n\t\t\t\t\ttype: \"function_call_output\",\n\t\t\t\t\tcall_id: part.toolCallId,\n\t\t\t\t\toutput: outputValue\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault: inputWarnings.push({\n\t\t\ttype: \"other\",\n\t\t\tmessage: \"unsupported message role\"\n\t\t});\n\t}\n\treturn {\n\t\tinput,\n\t\tinputWarnings\n\t};\n}\n//#endregion\n//#region src/responses/convert-xai-responses-usage.ts\nfunction convertXaiResponsesUsage(usage) {\n\tconst cacheReadTokens = usage.input_tokens_details?.cached_tokens ?? 0;\n\tconst reasoningTokens = usage.output_tokens_details?.reasoning_tokens ?? 0;\n\tconst inputTokensIncludesCached = cacheReadTokens <= usage.input_tokens;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: inputTokensIncludesCached ? usage.input_tokens : usage.input_tokens + cacheReadTokens,\n\t\t\tnoCache: inputTokensIncludesCached ? usage.input_tokens - cacheReadTokens : usage.input_tokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: usage.output_tokens,\n\t\t\ttext: usage.output_tokens - reasoningTokens,\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/responses/map-xai-responses-finish-reason.ts\nfunction mapXaiResponsesFinishReason(finishReason) {\n\tswitch (finishReason) {\n\t\tcase \"stop\":\n\t\tcase \"completed\": return \"stop\";\n\t\tcase \"length\":\n\t\tcase \"max_output_tokens\": return \"length\";\n\t\tcase \"tool_calls\":\n\t\tcase \"function_call\": return \"tool-calls\";\n\t\tcase \"content_filter\": return \"content-filter\";\n\t\tdefault: return \"other\";\n\t}\n}\n//#endregion\n//#region src/responses/xai-responses-api.ts\nconst annotationSchema = () => z.union([z.object({\n\ttype: z.literal(\"url_citation\"),\n\turl: z.string(),\n\ttitle: z.string().optional()\n}), z.object({ type: z.string() })]);\nconst messageContentPartSchema = () => z.object({\n\ttype: z.string(),\n\ttext: z.string().optional(),\n\tlogprobs: z.array(z.any()).optional(),\n\tannotations: z.array(annotationSchema()).optional()\n});\nconst reasoningSummaryPartSchema = () => z.object({\n\ttype: z.string(),\n\ttext: z.string()\n});\nconst toolCallSchema = () => z.object({\n\tname: z.string().optional(),\n\targuments: z.string().optional(),\n\tinput: z.string().optional(),\n\tcall_id: z.string().optional(),\n\tid: z.string(),\n\tstatus: z.string(),\n\taction: z.any().optional()\n});\nconst webSearchWireSourceSchema = z.object({\n\ttype: z.literal(\"url\"),\n\turl: z.string()\n});\nconst webSearchWireActionSchema = z.discriminatedUnion(\"type\", [\n\tz.object({\n\t\ttype: z.literal(\"search\"),\n\t\tquery: z.string().nullish(),\n\t\tqueries: z.array(z.string()).nullish(),\n\t\tsources: z.array(z.unknown()).nullish()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"open_page\"),\n\t\turl: z.string().nullish(),\n\t\tsources: z.array(z.unknown()).nullish()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"find_in_page\"),\n\t\turl: z.string().nullish(),\n\t\tpattern: z.string().nullish(),\n\t\tsources: z.array(z.unknown()).nullish()\n\t})\n]);\nconst mcpCallSchema = () => z.object({\n\tname: z.string().optional(),\n\targuments: z.string().optional(),\n\toutput: z.string().optional(),\n\terror: z.string().optional(),\n\tid: z.string(),\n\tstatus: z.string(),\n\tserver_label: z.string().optional()\n});\nconst outputItemSchema = () => z.discriminatedUnion(\"type\", [\n\tz.object({\n\t\ttype: z.literal(\"web_search_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"x_search_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"code_interpreter_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"code_execution_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"view_image_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"view_x_video_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"file_search_call\"),\n\t\tid: z.string(),\n\t\tstatus: z.string(),\n\t\tqueries: z.array(z.string()).optional(),\n\t\tresults: z.array(z.object({\n\t\t\tfile_id: z.string(),\n\t\t\tfilename: z.string(),\n\t\t\tscore: z.number(),\n\t\t\ttext: z.string()\n\t\t})).nullish()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"image_generation_call\"),\n\t\tid: z.string(),\n\t\tstatus: z.string(),\n\t\tprompt: z.string().nullish(),\n\t\tresult: z.string().nullish()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"custom_tool_call\"),\n\t\t...toolCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"mcp_call\"),\n\t\t...mcpCallSchema().shape\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"message\"),\n\t\trole: z.string(),\n\t\tcontent: z.array(messageContentPartSchema()),\n\t\tid: z.string(),\n\t\tstatus: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"function_call\"),\n\t\tname: z.string(),\n\t\targuments: z.string(),\n\t\tcall_id: z.string(),\n\t\tid: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"reasoning\"),\n\t\tid: z.string(),\n\t\tsummary: z.array(reasoningSummaryPartSchema()),\n\t\tcontent: z.array(z.object({\n\t\t\ttype: z.string(),\n\t\t\ttext: z.string()\n\t\t})).nullish(),\n\t\tstatus: z.string(),\n\t\tencrypted_content: z.string().nullish()\n\t})\n]);\nconst xaiResponsesUsageSchema = () => z.object({\n\tinput_tokens: z.number(),\n\toutput_tokens: z.number(),\n\ttotal_tokens: z.number().optional(),\n\tinput_tokens_details: z.object({ cached_tokens: z.number().optional() }).catchall(z.json()).optional(),\n\toutput_tokens_details: z.object({ reasoning_tokens: z.number().optional() }).catchall(z.json()).optional(),\n\tnum_sources_used: z.number().optional(),\n\tnum_server_side_tools_used: z.number().optional(),\n\tcost_in_usd_ticks: z.number().nullish()\n}).catchall(z.json());\nconst xaiResponsesResponseSchema = () => z.object({\n\tid: z.string().nullish(),\n\tcreated_at: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tobject: z.literal(\"response\"),\n\toutput: z.array(outputItemSchema()),\n\tusage: xaiResponsesUsageSchema().nullish(),\n\tstatus: z.string(),\n\tservice_tier: z.string().nullish(),\n\tprompt_cache_key: z.string().nullish(),\n\tsafety_identifier: z.string().nullish()\n});\nconst xaiResponsesResponseSchemaValidator = lazySchema(() => zodSchema(xaiResponsesResponseSchema()));\nconst xaiResponsesChunkSchema = lazySchema(() => zodSchema(z.union([\n\tz.object({\n\t\ttype: z.literal(\"response.created\"),\n\t\tresponse: xaiResponsesResponseSchema().partial({\n\t\t\tusage: true,\n\t\t\tstatus: true\n\t\t})\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.in_progress\"),\n\t\tresponse: xaiResponsesResponseSchema().partial({\n\t\t\tusage: true,\n\t\t\tstatus: true\n\t\t})\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.output_item.added\"),\n\t\titem: outputItemSchema(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.output_item.done\"),\n\t\titem: outputItemSchema(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.content_part.added\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\tpart: messageContentPartSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.content_part.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\tpart: messageContentPartSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.output_text.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\tdelta: z.string(),\n\t\tlogprobs: z.array(z.any()).optional()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.output_text.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\ttext: z.string(),\n\t\tlogprobs: z.array(z.any()).optional(),\n\t\tannotations: z.array(annotationSchema()).optional()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.output_text.annotation.added\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\tannotation_index: z.number(),\n\t\tannotation: annotationSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_summary_part.added\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tsummary_index: z.number(),\n\t\tpart: reasoningSummaryPartSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_summary_part.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tsummary_index: z.number(),\n\t\tpart: reasoningSummaryPartSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_summary_text.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tsummary_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_summary_text.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tsummary_index: z.number(),\n\t\ttext: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_text.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.reasoning_text.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcontent_index: z.number(),\n\t\ttext: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.web_search_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.web_search_call.searching\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.web_search_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.x_search_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.x_search_call.searching\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.x_search_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.file_search_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.file_search_call.searching\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.file_search_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.image_generation_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.image_generation_call.generating\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.image_generation_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_execution_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_execution_call.executing\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_execution_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call.executing\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call.interpreting\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call_code.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.code_interpreter_call_code.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tcode: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.custom_tool_call_input.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.custom_tool_call_input.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tinput: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.function_call_arguments.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.function_call_arguments.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\targuments: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call.in_progress\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call.executing\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call.completed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call.failed\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call_arguments.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call_arguments.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\targuments: z.string().optional()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call_output.delta\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\tdelta: z.string()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.mcp_call_output.done\"),\n\t\titem_id: z.string(),\n\t\toutput_index: z.number(),\n\t\toutput: z.string().optional()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.incomplete\"),\n\t\tresponse: z.object({\n\t\t\tincomplete_details: z.object({ reason: z.string() }).nullish(),\n\t\t\tusage: xaiResponsesUsageSchema().nullish(),\n\t\t\tservice_tier: z.string().nullish(),\n\t\t\tprompt_cache_key: z.string().nullish(),\n\t\t\tsafety_identifier: z.string().nullish()\n\t\t})\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.failed\"),\n\t\tresponse: z.object({\n\t\t\terror: z.object({\n\t\t\t\tcode: z.string().nullish(),\n\t\t\t\tmessage: z.string()\n\t\t\t}).nullish(),\n\t\t\tincomplete_details: z.object({ reason: z.string() }).nullish(),\n\t\t\tusage: xaiResponsesUsageSchema().nullish()\n\t\t})\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"error\"),\n\t\tcode: z.string().nullish(),\n\t\tmessage: z.string(),\n\t\tparam: z.string().nullish()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.done\"),\n\t\tresponse: xaiResponsesResponseSchema()\n\t}),\n\tz.object({\n\t\ttype: z.literal(\"response.completed\"),\n\t\tresponse: xaiResponsesResponseSchema()\n\t})\n])));\n//#endregion\n//#region src/responses/xai-responses-language-model-options.ts\n/**\n* @see https://docs.x.ai/docs/api-reference#create-new-response\n*/\nconst xaiLanguageModelResponsesOptions = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Constrains how hard a reasoning model thinks before responding.\n\t* Possible values are `none` (disables reasoning entirely; supported by\n\t* `grok-4.3`), `low` (uses fewer reasoning tokens), `medium`, `high`\n\t* (uses more reasoning tokens), and `xhigh`\n\t* (supported by `grok-4.6` and `grok-4.7`).\n\t*\n\t* @see https://docs.x.ai/docs/guides/reasoning\n\t*/\n\treasoningEffort: z.enum([\n\t\t\"none\",\n\t\t\"low\",\n\t\t\"medium\",\n\t\t\"high\",\n\t\t\"xhigh\"\n\t]).optional(),\n\t/**\n\t* @deprecated xAI ignores the requested summary level and always returns a\n\t* detailed reasoning summary.\n\t*/\n\treasoningSummary: z.enum([\n\t\t\"auto\",\n\t\t\"concise\",\n\t\t\"detailed\"\n\t]).optional(),\n\tlogprobs: z.boolean().optional(),\n\ttopLogprobs: z.number().int().min(0).max(8).optional(),\n\t/** Min-p sampling threshold between 0 and 1. */\n\tminP: z.number().min(0).max(1).optional(),\n\t/** Maximum number of agentic tool-calling turns. */\n\tmaxTurns: z.number().int().optional(),\n\t/** Whether the model may call tools in parallel. @default true */\n\tparallelToolCalls: z.boolean().optional(),\n\t/** Cache key used to route requests with shared prompt prefixes. */\n\tpromptCacheKey: z.string().optional(),\n\t/** Stable identifier used to attribute policy violations to an end user. */\n\tsafetyIdentifier: z.string().optional(),\n\tserviceTier: z.enum([\"default\", \"priority\"]).optional(),\n\t/**\n\t* Whether to store the input message(s) and model response for later retrieval.\n\t* Must be set to `false` for teams with Zero Data Retention (ZDR) enabled,\n\t* otherwise the API will return an error.\n\t* @default true\n\t*/\n\tstore: z.boolean().optional(),\n\t/**\n\t* The ID of the previous response from the model.\n\t*/\n\tpreviousResponseId: z.string().optional(),\n\t/** A unique identifier for the end user, used for abuse monitoring. */\n\tuser: z.string().optional(),\n\t/**\n\t* Specify additional output data to include in the model response.\n\t* Example values: 'file_search_call.results'.\n\t*/\n\tinclude: z.array(z.enum([\n\t\t\"file_search_call.results\",\n\t\t\"web_search_call.action.sources\",\n\t\t\"code_interpreter_call.outputs\",\n\t\t\"reasoning.encrypted_content\",\n\t\t\"no_inline_citations\"\n\t])).nullish()\n})));\n//#endregion\n//#region src/tool/file-search.ts\n/**\n* Schema for file search tool arguments.\n* @see https://docs.x.ai/docs/guides/using-collections/api\n*/\nconst fileSearchArgsSchema = lazySchema(() => zodSchema(z.object({\n\tvectorStoreIds: z.array(z.string()),\n\tmaxNumResults: z.number().optional()\n})));\nconst fileSearchOutputSchema = lazySchema(() => zodSchema(z.object({\n\tqueries: z.array(z.string()),\n\tresults: z.array(z.object({\n\t\tfileId: z.string(),\n\t\tfilename: z.string(),\n\t\tscore: z.number().min(0).max(1),\n\t\ttext: z.string()\n\t})).nullable()\n})));\nconst fileSearchToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.file_search\",\n\tinputSchema: lazySchema(() => zodSchema(z.object({}))),\n\toutputSchema: fileSearchOutputSchema\n});\nconst fileSearch = (args) => fileSearchToolFactory(args);\n//#endregion\n//#region src/tool/image-generation.ts\n/**\n* Schema for image generation tool arguments.\n* @see https://docs.x.ai/developers/tools/overview\n*/\nconst imageGenerationArgsSchema = lazySchema(() => zodSchema(z.object({ action: z.enum([\n\t\"auto\",\n\t\"generate\",\n\t\"edit\"\n]).optional() })));\nconst imageGenerationInputSchema = lazySchema(() => zodSchema(z.object({})));\nconst imageGenerationOutputSchema = lazySchema(() => zodSchema(z.object({\n\tresult: z.string(),\n\tprompt: z.string().optional()\n})));\nconst imageGenerationToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.image_generation\",\n\tinputSchema: imageGenerationInputSchema,\n\toutputSchema: imageGenerationOutputSchema\n});\nconst imageGeneration = (args = {}) => imageGenerationToolFactory(args);\n//#endregion\n//#region src/tool/mcp-server.ts\nconst mcpServerArgsSchema = lazySchema(() => zodSchema(z.object({\n\tserverUrl: z.string().describe(\"The URL of the MCP server\"),\n\tserverLabel: z.string().optional().describe(\"A label for the MCP server\"),\n\tserverDescription: z.string().optional().describe(\"Description of the MCP server\"),\n\tallowedTools: z.array(z.string()).optional().describe(\"List of allowed tool names\"),\n\theaders: z.record(z.string(), z.string()).optional().describe(\"Custom headers to send\"),\n\tauthorization: z.string().optional().describe(\"Authorization header value\")\n})));\nconst mcpServerOutputSchema = lazySchema(() => zodSchema(z.object({\n\tname: z.string(),\n\targuments: z.string(),\n\tresult: z.unknown()\n})));\nconst mcpServerToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.mcp\",\n\tinputSchema: lazySchema(() => zodSchema(z.object({}))),\n\toutputSchema: mcpServerOutputSchema\n});\nconst mcpServer = (args) => mcpServerToolFactory(args);\n//#endregion\n//#region src/tool/web-search.ts\nconst webSearchArgsSchema = lazySchema(() => zodSchema(z.object({\n\tallowedDomains: z.array(z.string()).max(5).optional(),\n\texcludedDomains: z.array(z.string()).max(5).optional(),\n\tenableImageSearch: z.boolean().optional(),\n\tenableImageUnderstanding: z.boolean().optional()\n})));\nconst webSearchOutputSchema = lazySchema(() => zodSchema(z.object({\n\taction: z.discriminatedUnion(\"type\", [\n\t\tz.object({\n\t\t\ttype: z.literal(\"search\"),\n\t\t\tquery: z.string().optional(),\n\t\t\tqueries: z.array(z.string()).optional()\n\t\t}),\n\t\tz.object({\n\t\t\ttype: z.literal(\"openPage\"),\n\t\t\turl: z.string().nullish()\n\t\t}),\n\t\tz.object({\n\t\t\ttype: z.literal(\"findInPage\"),\n\t\t\turl: z.string().nullish(),\n\t\t\tpattern: z.string().nullish()\n\t\t})\n\t]).optional(),\n\tsources: z.array(z.object({\n\t\ttype: z.literal(\"url\"),\n\t\turl: z.string()\n\t})).optional()\n})));\nconst webSearchToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.web_search\",\n\tinputSchema: lazySchema(() => zodSchema(z.object({}))),\n\toutputSchema: webSearchOutputSchema\n});\nconst webSearch = (args = {}) => webSearchToolFactory(args);\n//#endregion\n//#region src/tool/x-search.ts\nconst xSearchArgsSchema = lazySchema(() => zodSchema(z.object({\n\tallowedXHandles: z.array(z.string()).max(20).optional(),\n\texcludedXHandles: z.array(z.string()).max(20).optional(),\n\tfromDate: z.string().optional(),\n\ttoDate: z.string().optional(),\n\tenableImageUnderstanding: z.boolean().optional(),\n\tenableVideoUnderstanding: z.boolean().optional()\n})));\nconst xSearchOutputSchema = lazySchema(() => zodSchema(z.object({\n\tquery: z.string(),\n\tposts: z.array(z.object({\n\t\tauthor: z.string(),\n\t\ttext: z.string(),\n\t\turl: z.string(),\n\t\tlikes: z.number()\n\t}))\n})));\nconst xSearchToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.x_search\",\n\tinputSchema: lazySchema(() => zodSchema(z.object({}))),\n\toutputSchema: xSearchOutputSchema\n});\nconst xSearch = (args = {}) => xSearchToolFactory(args);\n//#endregion\n//#region src/responses/xai-responses-prepare-tools.ts\nasync function prepareResponsesTools({ tools, toolChoice }) {\n\tconst normalizedTools = tools?.length ? tools : void 0;\n\tconst toolWarnings = [];\n\tif (normalizedTools == null) return {\n\t\ttools: void 0,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst xaiTools = [];\n\tconst toolByName = /* @__PURE__ */ new Map();\n\tfor (const tool of normalizedTools) {\n\t\ttoolByName.set(tool.name, tool);\n\t\tif (tool.type === \"provider\") switch (tool.id) {\n\t\t\tcase \"xai.web_search\": {\n\t\t\t\tconst args = await validateTypes({\n\t\t\t\t\tvalue: tool.args,\n\t\t\t\t\tschema: webSearchArgsSchema\n\t\t\t\t});\n\t\t\t\txaiTools.push({\n\t\t\t\t\ttype: \"web_search\",\n\t\t\t\t\tallowed_domains: args.allowedDomains,\n\t\t\t\t\texcluded_domains: args.excludedDomains,\n\t\t\t\t\tenable_image_search: args.enableImageSearch,\n\t\t\t\t\tenable_image_understanding: args.enableImageUnderstanding\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"xai.x_search\": {\n\t\t\t\tconst args = await validateTypes({\n\t\t\t\t\tvalue: tool.args,\n\t\t\t\t\tschema: xSearchArgsSchema\n\t\t\t\t});\n\t\t\t\txaiTools.push({\n\t\t\t\t\ttype: \"x_search\",\n\t\t\t\t\tallowed_x_handles: args.allowedXHandles,\n\t\t\t\t\texcluded_x_handles: args.excludedXHandles,\n\t\t\t\t\tfrom_date: args.fromDate,\n\t\t\t\t\tto_date: args.toDate,\n\t\t\t\t\tenable_image_understanding: args.enableImageUnderstanding,\n\t\t\t\t\tenable_video_understanding: args.enableVideoUnderstanding\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"xai.code_execution\":\n\t\t\t\txaiTools.push({ type: \"code_interpreter\" });\n\t\t\t\tbreak;\n\t\t\tcase \"xai.view_image\":\n\t\t\t\txaiTools.push({ type: \"view_image\" });\n\t\t\t\tbreak;\n\t\t\tcase \"xai.view_x_video\":\n\t\t\t\txaiTools.push({ type: \"view_x_video\" });\n\t\t\t\tbreak;\n\t\t\tcase \"xai.image_generation\": {\n\t\t\t\tconst args = await validateTypes({\n\t\t\t\t\tvalue: tool.args,\n\t\t\t\t\tschema: imageGenerationArgsSchema\n\t\t\t\t});\n\t\t\t\txaiTools.push({\n\t\t\t\t\ttype: \"image_generation\",\n\t\t\t\t\taction: args.action\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"xai.file_search\": {\n\t\t\t\tconst args = await validateTypes({\n\t\t\t\t\tvalue: tool.args,\n\t\t\t\t\tschema: fileSearchArgsSchema\n\t\t\t\t});\n\t\t\t\txaiTools.push({\n\t\t\t\t\ttype: \"file_search\",\n\t\t\t\t\tvector_store_ids: args.vectorStoreIds,\n\t\t\t\t\tmax_num_results: args.maxNumResults\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"xai.mcp\": {\n\t\t\t\tconst args = await validateTypes({\n\t\t\t\t\tvalue: tool.args,\n\t\t\t\t\tschema: mcpServerArgsSchema\n\t\t\t\t});\n\t\t\t\txaiTools.push({\n\t\t\t\t\ttype: \"mcp\",\n\t\t\t\t\tserver_url: args.serverUrl,\n\t\t\t\t\tserver_label: args.serverLabel,\n\t\t\t\t\tserver_description: args.serverDescription,\n\t\t\t\t\tallowed_tools: args.allowedTools,\n\t\t\t\t\theaders: args.headers,\n\t\t\t\t\tauthorization: args.authorization\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: toolWarnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: `provider-defined tool ${tool.name}`\n\t\t\t});\n\t\t}\n\t\telse xaiTools.push({\n\t\t\ttype: \"function\",\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.inputSchema,\n\t\t\t...tool.strict != null ? { strict: tool.strict } : {}\n\t\t});\n\t}\n\tif (toolChoice == null) return {\n\t\ttools: xaiTools,\n\t\ttoolChoice: void 0,\n\t\ttoolWarnings\n\t};\n\tconst type = toolChoice.type;\n\tswitch (type) {\n\t\tcase \"auto\":\n\t\tcase \"none\": return {\n\t\t\ttools: xaiTools,\n\t\t\ttoolChoice: type,\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"required\": return {\n\t\t\ttools: xaiTools,\n\t\t\ttoolChoice: \"required\",\n\t\t\ttoolWarnings\n\t\t};\n\t\tcase \"tool\": {\n\t\t\tconst selectedTool = toolByName.get(toolChoice.toolName);\n\t\t\tif (selectedTool == null) return {\n\t\t\t\ttools: xaiTools,\n\t\t\t\ttoolChoice: void 0,\n\t\t\t\ttoolWarnings\n\t\t\t};\n\t\t\tif (selectedTool.type === \"provider\") {\n\t\t\t\ttoolWarnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: `toolChoice for server-side tool \"${selectedTool.name}\"`\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\ttools: xaiTools,\n\t\t\t\t\ttoolChoice: void 0,\n\t\t\t\t\ttoolWarnings\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\ttools: xaiTools,\n\t\t\t\ttoolChoice: {\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: selectedTool.name\n\t\t\t\t},\n\t\t\t\ttoolWarnings\n\t\t\t};\n\t\t}\n\t\tdefault: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });\n\t}\n}\n//#endregion\n//#region src/responses/xai-responses-language-model.ts\nfunction createXaiResponsesStreamError({ message, code, eventType, data }) {\n\tconst statusCode = getHttpStatusCode(code);\n\treturn createProviderStreamError({\n\t\tmessage,\n\t\ttype: eventType,\n\t\tcode: code ?? void 0,\n\t\t...statusCode != null ? {\n\t\t\tstatusCode,\n\t\t\tisRetryable: isRetryableStatusCode(statusCode)\n\t\t} : getXaiResponsesStreamErrorMetadata(code),\n\t\tdata\n\t});\n}\nfunction getXaiResponsesStreamErrorMetadata(code) {\n\tswitch (code) {\n\t\tcase \"rate_limit_exceeded\":\n\t\tcase \"rate_limit_error\": return {\n\t\t\tstatusCode: 429,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"insufficient_quota\": return {\n\t\t\tstatusCode: 429,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"api_error\":\n\t\tcase \"internal_server_error\":\n\t\tcase \"server_error\": return {\n\t\t\tstatusCode: 500,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"overloaded_error\":\n\t\tcase \"service_unavailable\": return {\n\t\t\tstatusCode: 503,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"timeout\":\n\t\tcase \"timeout_error\": return {\n\t\t\tstatusCode: 504,\n\t\t\tisRetryable: true\n\t\t};\n\t\tcase \"authentication_error\":\n\t\tcase \"invalid_api_key\": return {\n\t\t\tstatusCode: 401,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"permission_error\": return {\n\t\t\tstatusCode: 403,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"not_found_error\":\n\t\tcase \"model_not_found\": return {\n\t\t\tstatusCode: 404,\n\t\t\tisRetryable: false\n\t\t};\n\t\tcase \"bad_request\":\n\t\tcase \"context_length_exceeded\":\n\t\tcase \"invalid_request_error\": return {\n\t\t\tstatusCode: 400,\n\t\t\tisRetryable: false\n\t\t};\n\t\tdefault: return {};\n\t}\n}\nfunction getHttpStatusCode(value) {\n\tconst statusCode = typeof value === \"string\" && /^\\d{3}$/.test(value) ? Number(value) : value;\n\treturn typeof statusCode === \"number\" && Number.isInteger(statusCode) && statusCode >= 400 && statusCode <= 599 ? statusCode : void 0;\n}\nfunction isRetryableStatusCode(statusCode) {\n\treturn statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500;\n}\nconst xaiResponsesSupportedUrls = {\n\t\"image/*\": [/^https?:\\/\\/.*$/],\n\t\"application/pdf\": [/^https?:\\/\\/.*$/],\n\t\"text/*\": [/^https?:\\/\\/.*$/]\n};\nvar XaiResponsesLanguageModel = class XaiResponsesLanguageModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new XaiResponsesLanguageModel(options.modelId, options.config);\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.supportedUrls = xaiResponsesSupportedUrls;\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tstatic async prepareRequest({ modelId, options: { prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, seed, responseFormat, providerOptions, tools, toolChoice, reasoning } }) {\n\t\tconst warnings = [];\n\t\tconst options = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions,\n\t\t\tschema: xaiLanguageModelResponsesOptions\n\t\t}) ?? {};\n\t\tif (frequencyPenalty != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"frequencyPenalty\"\n\t\t});\n\t\tif (presencePenalty != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"presencePenalty\"\n\t\t});\n\t\tif (stopSequences != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"stopSequences\"\n\t\t});\n\t\tconst webSearchToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.web_search\")?.name;\n\t\tconst xSearchToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.x_search\")?.name;\n\t\tconst codeExecutionToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.code_execution\")?.name;\n\t\tconst mcpToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.mcp\")?.name;\n\t\tconst fileSearchToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.file_search\")?.name;\n\t\tconst imageGenerationToolName = tools?.find((tool) => tool.type === \"provider\" && tool.id === \"xai.image_generation\")?.name;\n\t\tconst { input, inputWarnings } = await convertToXaiResponsesInput({\n\t\t\tprompt,\n\t\t\tstore: options.store ?? true\n\t\t});\n\t\twarnings.push(...inputWarnings);\n\t\tconst { tools: xaiTools, toolChoice: xaiToolChoice, toolWarnings } = await prepareResponsesTools({\n\t\t\ttools,\n\t\t\ttoolChoice\n\t\t});\n\t\twarnings.push(...toolWarnings);\n\t\tlet include = options.include ? [...options.include] : void 0;\n\t\tif (options.store === false) {\n\t\t\tif (include == null) include = [\"reasoning.encrypted_content\"];\n\t\t\telse include = [...include, \"reasoning.encrypted_content\"];\n\t\t}\n\t\tconst { portable: reasoningCapabilities } = getXaiLanguageModelEntry(modelId).capabilities.language.reasoning;\n\t\tlet resolvedReasoningEffort = options.reasoningEffort;\n\t\tif (resolvedReasoningEffort == null && isCustomReasoning(reasoning)) {\n\t\t\tif (!reasoningCapabilities.configurable) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"reasoning\",\n\t\t\t\tdetails: `reasoning \"${reasoning}\" is not supported by this model.`\n\t\t\t});\n\t\t\telse resolvedReasoningEffort = mapReasoningToProviderEffort({\n\t\t\t\treasoning,\n\t\t\t\teffortMap: {\n\t\t\t\t\t...reasoningCapabilities.none && { none: \"none\" },\n\t\t\t\t\tlow: \"low\",\n\t\t\t\t\tmedium: \"medium\",\n\t\t\t\t\thigh: \"high\",\n\t\t\t\t\t...reasoningCapabilities.xhigh && { xhigh: \"xhigh\" }\n\t\t\t\t},\n\t\t\t\twarnings\n\t\t\t});\n\t\t}\n\t\tconst baseArgs = {\n\t\t\tmodel: modelId,\n\t\t\tinput,\n\t\t\tlogprobs: options.logprobs === true || options.topLogprobs != null ? true : void 0,\n\t\t\ttop_logprobs: options.topLogprobs,\n\t\t\tmax_output_tokens: maxOutputTokens,\n\t\t\ttemperature,\n\t\t\ttop_p: topP,\n\t\t\ttop_k: topK,\n\t\t\tmin_p: options.minP,\n\t\t\tseed,\n\t\t\t...responseFormat?.type === \"json\" && { text: { format: responseFormat.schema != null ? {\n\t\t\t\ttype: \"json_schema\",\n\t\t\t\tstrict: true,\n\t\t\t\tname: responseFormat.name ?? \"response\",\n\t\t\t\tdescription: responseFormat.description,\n\t\t\t\tschema: responseFormat.schema\n\t\t\t} : { type: \"json_object\" } } },\n\t\t\t...resolvedReasoningEffort != null && { reasoning: { effort: resolvedReasoningEffort } },\n\t\t\t...options.store === false && { store: options.store },\n\t\t\t...include != null && { include },\n\t\t\t...options.previousResponseId != null && { previous_response_id: options.previousResponseId },\n\t\t\t...options.maxTurns != null && { max_turns: options.maxTurns },\n\t\t\t...options.parallelToolCalls != null && { parallel_tool_calls: options.parallelToolCalls },\n\t\t\t...options.promptCacheKey != null && { prompt_cache_key: options.promptCacheKey },\n\t\t\t...options.safetyIdentifier != null && { safety_identifier: options.safetyIdentifier },\n\t\t\t...options.serviceTier != null && { service_tier: options.serviceTier },\n\t\t\t...options.user != null && { user: options.user }\n\t\t};\n\t\tif (xaiTools && xaiTools.length > 0) baseArgs.tools = xaiTools;\n\t\tif (xaiToolChoice != null) baseArgs.tool_choice = xaiToolChoice;\n\t\treturn {\n\t\t\targs: baseArgs,\n\t\t\twarnings,\n\t\t\twebSearchToolName,\n\t\t\txSearchToolName,\n\t\t\tcodeExecutionToolName,\n\t\t\tmcpToolName,\n\t\t\tfileSearchToolName,\n\t\t\timageGenerationToolName\n\t\t};\n\t}\n\tgetArgs(options) {\n\t\treturn XaiResponsesLanguageModel.prepareRequest({\n\t\t\tmodelId: this.modelId,\n\t\t\toptions\n\t\t});\n\t}\n\tasync doGenerate(options) {\n\t\tconst { args: body, warnings, webSearchToolName, xSearchToolName, codeExecutionToolName, mcpToolName, fileSearchToolName, imageGenerationToolName } = await this.getArgs(options);\n\t\tconst { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL ?? \"https://api.x.ai/v1\"}/responses`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiResponsesResponseSchemaValidator),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst content = [];\n\t\tlet hasFunctionCall = false;\n\t\tconst webSearchSubTools = [\n\t\t\t\"web_search\",\n\t\t\t\"web_search_with_snippets\",\n\t\t\t\"browse_page\"\n\t\t];\n\t\tconst xSearchSubTools = [\n\t\t\t\"x_user_search\",\n\t\t\t\"x_keyword_search\",\n\t\t\t\"x_semantic_search\",\n\t\t\t\"x_thread_fetch\"\n\t\t];\n\t\tfor (const part of response.output) {\n\t\t\tif (part.type === \"file_search_call\") {\n\t\t\t\tconst toolName = fileSearchToolName ?? \"file_search\";\n\t\t\t\tcontent.push({\n\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tinput: \"\",\n\t\t\t\t\tproviderExecuted: true\n\t\t\t\t});\n\t\t\t\tcontent.push({\n\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tresult: {\n\t\t\t\t\t\tqueries: part.queries ?? [],\n\t\t\t\t\t\tresults: part.results?.map((result) => ({\n\t\t\t\t\t\t\tfileId: result.file_id,\n\t\t\t\t\t\t\tfilename: result.filename,\n\t\t\t\t\t\t\tscore: result.score,\n\t\t\t\t\t\t\ttext: result.text\n\t\t\t\t\t\t})) ?? null\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (part.type === \"image_generation_call\") {\n\t\t\t\tconst toolName = imageGenerationToolName ?? \"image_generation\";\n\t\t\t\tcontent.push({\n\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tinput: \"{}\",\n\t\t\t\t\tproviderExecuted: true\n\t\t\t\t});\n\t\t\t\tif (part.result != null) content.push({\n\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tresult: {\n\t\t\t\t\t\tresult: part.result,\n\t\t\t\t\t\t...part.prompt != null && { prompt: part.prompt }\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\telse content.push({\n\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tisError: true,\n\t\t\t\t\tresult: `Image generation failed (status: ${part.status}).`\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (part.type === \"web_search_call\" || part.type === \"x_search_call\" || part.type === \"code_interpreter_call\" || part.type === \"code_execution_call\" || part.type === \"view_image_call\" || part.type === \"view_x_video_call\" || part.type === \"custom_tool_call\" || part.type === \"mcp_call\") {\n\t\t\t\tlet toolName = part.name ?? \"\";\n\t\t\t\tif (webSearchSubTools.includes(part.name ?? \"\") || part.type === \"web_search_call\") toolName = webSearchToolName ?? \"web_search\";\n\t\t\t\telse if (xSearchSubTools.includes(part.name ?? \"\") || part.type === \"x_search_call\") toolName = xSearchToolName ?? \"x_search\";\n\t\t\t\telse if (part.name === \"code_execution\" || part.type === \"code_interpreter_call\" || part.type === \"code_execution_call\") toolName = codeExecutionToolName ?? \"code_execution\";\n\t\t\t\telse if (part.type === \"mcp_call\") toolName = mcpToolName ?? part.name ?? \"mcp\";\n\t\t\t\tconst toolInput = part.type === \"custom_tool_call\" ? part.input ?? \"\" : part.type === \"mcp_call\" ? part.arguments ?? \"\" : part.arguments ?? \"\";\n\t\t\t\tcontent.push({\n\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tinput: toolInput,\n\t\t\t\t\tproviderExecuted: true\n\t\t\t\t});\n\t\t\t\tif (part.type === \"web_search_call\") content.push({\n\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\ttoolName,\n\t\t\t\t\tresult: mapWebSearchAction(part.action)\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch (part.type) {\n\t\t\t\tcase \"message\":\n\t\t\t\t\tfor (const contentPart of part.content) {\n\t\t\t\t\t\tif (contentPart.text) content.push({\n\t\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\t\ttext: contentPart.text\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (contentPart.annotations) {\n\t\t\t\t\t\t\tfor (const annotation of contentPart.annotations) if (annotation.type === \"url_citation\" && \"url\" in annotation) content.push({\n\t\t\t\t\t\t\t\ttype: \"source\",\n\t\t\t\t\t\t\t\tsourceType: \"url\",\n\t\t\t\t\t\t\t\tid: this.config.generateId(),\n\t\t\t\t\t\t\t\turl: annotation.url,\n\t\t\t\t\t\t\t\ttitle: annotation.title ?? annotation.url\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"function_call\":\n\t\t\t\t\thasFunctionCall = true;\n\t\t\t\t\tcontent.push({\n\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\ttoolCallId: part.call_id,\n\t\t\t\t\t\ttoolName: part.name,\n\t\t\t\t\t\tinput: part.arguments\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"reasoning\": {\n\t\t\t\t\tconst reasoningText = (part.summary.length > 0 ? part.summary.map((s) => s.text) : (part.content ?? []).map((c) => c.text)).filter((text) => text && text.length > 0).join(\"\");\n\t\t\t\t\tif (reasoningText || part.encrypted_content) {\n\t\t\t\t\t\tconst hasMetadata = part.encrypted_content || part.id;\n\t\t\t\t\t\tcontent.push({\n\t\t\t\t\t\t\ttype: \"reasoning\",\n\t\t\t\t\t\t\ttext: reasoningText,\n\t\t\t\t\t\t\t...hasMetadata && { providerMetadata: { xai: {\n\t\t\t\t\t\t\t\t...part.encrypted_content && { reasoningEncryptedContent: part.encrypted_content },\n\t\t\t\t\t\t\t\t...part.id && { itemId: part.id }\n\t\t\t\t\t\t\t} } }\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: hasFunctionCall ? \"tool-calls\" : mapXaiResponsesFinishReason(response.status),\n\t\t\t\traw: response.status ?? void 0\n\t\t\t},\n\t\t\tusage: response.usage ? convertXaiResponsesUsage(response.usage) : {\n\t\t\t\tinputTokens: {\n\t\t\t\t\ttotal: 0,\n\t\t\t\t\tnoCache: 0,\n\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\tcacheWrite: 0\n\t\t\t\t},\n\t\t\t\toutputTokens: {\n\t\t\t\t\ttotal: 0,\n\t\t\t\t\ttext: 0,\n\t\t\t\t\treasoning: 0\n\t\t\t\t}\n\t\t\t},\n\t\t\t...(response.usage?.cost_in_usd_ticks != null || response.service_tier != null || response.prompt_cache_key != null || response.safety_identifier != null) && { providerMetadata: { xai: {\n\t\t\t\t...response.usage?.cost_in_usd_ticks != null && { costInUsdTicks: response.usage.cost_in_usd_ticks },\n\t\t\t\t...response.service_tier != null && { serviceTier: response.service_tier },\n\t\t\t\t...response.prompt_cache_key != null && { promptCacheKey: response.prompt_cache_key },\n\t\t\t\t...response.safety_identifier != null && { safetyIdentifier: response.safety_identifier }\n\t\t\t} } },\n\t\t\trequest: { body },\n\t\t\tresponse: {\n\t\t\t\t...getResponseMetadata(response),\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst { args, warnings, webSearchToolName, xSearchToolName, codeExecutionToolName, mcpToolName, fileSearchToolName, imageGenerationToolName } = await this.getArgs(options);\n\t\tconst body = {\n\t\t\t...args,\n\t\t\tstream: true\n\t\t};\n\t\tconst { responseHeaders, value: response } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL ?? \"https://api.x.ai/v1\"}/responses`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createEventSourceResponseHandler(xaiResponsesChunkSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet finishReason = {\n\t\t\tunified: \"interrupted\",\n\t\t\traw: void 0\n\t\t};\n\t\tlet hasFunctionCall = false;\n\t\tlet usage = void 0;\n\t\tlet costInUsdTicks = void 0;\n\t\tlet serviceTier = void 0;\n\t\tlet promptCacheKey = void 0;\n\t\tlet safetyIdentifier = void 0;\n\t\tlet isFirstChunk = true;\n\t\tconst contentBlocks = {};\n\t\tconst seenToolCalls = /* @__PURE__ */ new Set();\n\t\tconst ongoingToolCalls = {};\n\t\tconst activeReasoning = {};\n\t\tconst self = this;\n\t\treturn {\n\t\t\tstream: response.pipeThrough(new TransformStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\twarnings\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\ttransform(chunk, controller) {\n\t\t\t\t\tif (options.includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: chunk.rawValue\n\t\t\t\t\t});\n\t\t\t\t\tif (!chunk.success) {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: chunk.error\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst event = chunk.value;\n\t\t\t\t\tif (event.type === \"response.created\" || event.type === \"response.in_progress\") {\n\t\t\t\t\t\tif (isFirstChunk) {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"response-metadata\",\n\t\t\t\t\t\t\t\t...getResponseMetadata(event.response)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tisFirstChunk = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.reasoning_summary_part.added\") {\n\t\t\t\t\t\tconst blockId = `reasoning-${event.item_id}`;\n\t\t\t\t\t\tif (activeReasoning[event.item_id] == null) {\n\t\t\t\t\t\t\tactiveReasoning[event.item_id] = {};\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\t\tproviderMetadata: { xai: { itemId: event.item_id } }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.reasoning_summary_text.delta\") {\n\t\t\t\t\t\tconst blockId = `reasoning-${event.item_id}`;\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\tdelta: event.delta,\n\t\t\t\t\t\t\tproviderMetadata: { xai: { itemId: event.item_id } }\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.reasoning_summary_text.done\") return;\n\t\t\t\t\tif (event.type === \"response.reasoning_text.delta\") {\n\t\t\t\t\t\tconst blockId = `reasoning-${event.item_id}`;\n\t\t\t\t\t\tif (activeReasoning[event.item_id] == null) {\n\t\t\t\t\t\t\tactiveReasoning[event.item_id] = {};\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\t\tproviderMetadata: { xai: { itemId: event.item_id } }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"reasoning-delta\",\n\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\tdelta: event.delta,\n\t\t\t\t\t\t\tproviderMetadata: { xai: { itemId: event.item_id } }\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.reasoning_text.done\") return;\n\t\t\t\t\tif (event.type === \"response.output_text.delta\") {\n\t\t\t\t\t\tconst blockId = `text-${event.item_id}`;\n\t\t\t\t\t\tif (contentBlocks[blockId] == null) {\n\t\t\t\t\t\t\tcontentBlocks[blockId] = { type: \"text\" };\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\tid: blockId\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\tdelta: event.delta\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.output_text.done\") {\n\t\t\t\t\t\tif (event.annotations) {\n\t\t\t\t\t\t\tfor (const annotation of event.annotations) if (annotation.type === \"url_citation\" && \"url\" in annotation) controller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"source\",\n\t\t\t\t\t\t\t\tsourceType: \"url\",\n\t\t\t\t\t\t\t\tid: self.config.generateId(),\n\t\t\t\t\t\t\t\turl: annotation.url,\n\t\t\t\t\t\t\t\ttitle: annotation.title ?? annotation.url\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.output_text.annotation.added\") {\n\t\t\t\t\t\tconst annotation = event.annotation;\n\t\t\t\t\t\tif (annotation.type === \"url_citation\" && \"url\" in annotation) controller.enqueue({\n\t\t\t\t\t\t\ttype: \"source\",\n\t\t\t\t\t\t\tsourceType: \"url\",\n\t\t\t\t\t\t\tid: self.config.generateId(),\n\t\t\t\t\t\t\turl: annotation.url,\n\t\t\t\t\t\t\ttitle: annotation.title ?? annotation.url\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.done\" || event.type === \"response.completed\" || event.type === \"response.incomplete\") {\n\t\t\t\t\t\tconst response = event.response;\n\t\t\t\t\t\tif (response.usage) {\n\t\t\t\t\t\t\tusage = convertXaiResponsesUsage(response.usage);\n\t\t\t\t\t\t\tcostInUsdTicks = response.usage.cost_in_usd_ticks ?? void 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tserviceTier = response.service_tier ?? void 0;\n\t\t\t\t\t\tpromptCacheKey = response.prompt_cache_key ?? void 0;\n\t\t\t\t\t\tsafetyIdentifier = response.safety_identifier ?? void 0;\n\t\t\t\t\t\tif (event.type === \"response.incomplete\") {\n\t\t\t\t\t\t\tconst reason = \"incomplete_details\" in response ? response.incomplete_details?.reason : void 0;\n\t\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\t\tunified: reason ? mapXaiResponsesFinishReason(reason) : \"other\",\n\t\t\t\t\t\t\t\traw: reason ?? \"incomplete\"\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else if (\"status\" in response && response.status) finishReason = {\n\t\t\t\t\t\t\tunified: hasFunctionCall ? \"tool-calls\" : mapXaiResponsesFinishReason(response.status),\n\t\t\t\t\t\t\traw: response.status\n\t\t\t\t\t\t};\n\t\t\t\t\t\telse if (finishReason.unified === \"interrupted\") finishReason = {\n\t\t\t\t\t\t\tunified: \"other\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.failed\") {\n\t\t\t\t\t\tconst reason = event.response.incomplete_details?.reason;\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: reason ? mapXaiResponsesFinishReason(reason) : \"error\",\n\t\t\t\t\t\t\traw: reason ?? \"error\"\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (event.response.usage) usage = convertXaiResponsesUsage(event.response.usage);\n\t\t\t\t\t\tif (event.response.error != null) controller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: createXaiResponsesStreamError({\n\t\t\t\t\t\t\t\tmessage: event.response.error.message,\n\t\t\t\t\t\t\t\tcode: event.response.error.code,\n\t\t\t\t\t\t\t\teventType: event.type,\n\t\t\t\t\t\t\t\tdata: event\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"error\") {\n\t\t\t\t\t\tfinishReason = {\n\t\t\t\t\t\t\tunified: \"error\",\n\t\t\t\t\t\t\traw: void 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\terror: createXaiResponsesStreamError({\n\t\t\t\t\t\t\t\tmessage: event.message,\n\t\t\t\t\t\t\t\tcode: event.code,\n\t\t\t\t\t\t\t\teventType: event.type,\n\t\t\t\t\t\t\t\tdata: event\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.custom_tool_call_input.delta\" || event.type === \"response.custom_tool_call_input.done\") return;\n\t\t\t\t\tif (event.type === \"response.function_call_arguments.delta\") {\n\t\t\t\t\t\tconst toolCall = ongoingToolCalls[event.output_index];\n\t\t\t\t\t\tif (toolCall != null) controller.enqueue({\n\t\t\t\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\t\t\t\tid: toolCall.toolCallId,\n\t\t\t\t\t\t\tdelta: event.delta\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.function_call_arguments.done\") return;\n\t\t\t\t\tif (event.type === \"response.image_generation_call.in_progress\" || event.type === \"response.image_generation_call.generating\" || event.type === \"response.image_generation_call.completed\") {\n\t\t\t\t\t\tif (!seenToolCalls.has(event.item_id)) {\n\t\t\t\t\t\t\tseenToolCalls.add(event.item_id);\n\t\t\t\t\t\t\tconst toolName = imageGenerationToolName ?? \"image_generation\";\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-input-start\",\n\t\t\t\t\t\t\t\tid: event.item_id,\n\t\t\t\t\t\t\t\ttoolName\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\t\t\t\t\tid: event.item_id,\n\t\t\t\t\t\t\t\tdelta: \"{}\"\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-input-end\",\n\t\t\t\t\t\t\t\tid: event.item_id\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\t\t\ttoolCallId: event.item_id,\n\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\tinput: \"{}\",\n\t\t\t\t\t\t\t\tproviderExecuted: true\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.type === \"response.output_item.added\" || event.type === \"response.output_item.done\") {\n\t\t\t\t\t\tconst part = event.item;\n\t\t\t\t\t\tif (part.type === \"reasoning\") {\n\t\t\t\t\t\t\tif (event.type === \"response.output_item.done\") {\n\t\t\t\t\t\t\t\tconst blockId = `reasoning-${part.id}`;\n\t\t\t\t\t\t\t\tif (!(part.id in activeReasoning)) {\n\t\t\t\t\t\t\t\t\tactiveReasoning[part.id] = {};\n\t\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\t\ttype: \"reasoning-start\",\n\t\t\t\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\t\t\t\tproviderMetadata: { xai: { ...part.id && { itemId: part.id } } }\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"reasoning-end\",\n\t\t\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\t\t\tproviderMetadata: { xai: {\n\t\t\t\t\t\t\t\t\t\t...part.encrypted_content && { reasoningEncryptedContent: part.encrypted_content },\n\t\t\t\t\t\t\t\t\t\t...part.id && { itemId: part.id }\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tdelete activeReasoning[part.id];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (part.type === \"file_search_call\") {\n\t\t\t\t\t\t\tconst toolName = fileSearchToolName ?? \"file_search\";\n\t\t\t\t\t\t\tif (!seenToolCalls.has(part.id)) {\n\t\t\t\t\t\t\t\tseenToolCalls.add(part.id);\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-start\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\ttoolName\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\tdelta: \"\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-end\",\n\t\t\t\t\t\t\t\t\tid: part.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\t\tinput: \"\",\n\t\t\t\t\t\t\t\t\tproviderExecuted: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (event.type === \"response.output_item.done\") controller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\tresult: {\n\t\t\t\t\t\t\t\t\tqueries: part.queries ?? [],\n\t\t\t\t\t\t\t\t\tresults: part.results?.map((result) => ({\n\t\t\t\t\t\t\t\t\t\tfileId: result.file_id,\n\t\t\t\t\t\t\t\t\t\tfilename: result.filename,\n\t\t\t\t\t\t\t\t\t\tscore: result.score,\n\t\t\t\t\t\t\t\t\t\ttext: result.text\n\t\t\t\t\t\t\t\t\t})) ?? null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (part.type === \"image_generation_call\") {\n\t\t\t\t\t\t\tconst toolName = imageGenerationToolName ?? \"image_generation\";\n\t\t\t\t\t\t\tif (!seenToolCalls.has(part.id)) {\n\t\t\t\t\t\t\t\tseenToolCalls.add(part.id);\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-start\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\ttoolName\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\tdelta: \"{}\"\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-end\",\n\t\t\t\t\t\t\t\t\tid: part.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\t\tinput: \"{}\",\n\t\t\t\t\t\t\t\t\tproviderExecuted: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (event.type === \"response.output_item.done\") {\n\t\t\t\t\t\t\t\tif (part.result != null) controller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\t\tresult: {\n\t\t\t\t\t\t\t\t\t\tresult: part.result,\n\t\t\t\t\t\t\t\t\t\t...part.prompt != null && { prompt: part.prompt }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\telse controller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\t\tisError: true,\n\t\t\t\t\t\t\t\t\tresult: `Image generation failed (status: ${part.status}).`\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (part.type === \"web_search_call\" || part.type === \"x_search_call\" || part.type === \"code_interpreter_call\" || part.type === \"code_execution_call\" || part.type === \"view_image_call\" || part.type === \"view_x_video_call\" || part.type === \"custom_tool_call\" || part.type === \"mcp_call\") {\n\t\t\t\t\t\t\tconst webSearchSubTools = [\n\t\t\t\t\t\t\t\t\"web_search\",\n\t\t\t\t\t\t\t\t\"web_search_with_snippets\",\n\t\t\t\t\t\t\t\t\"browse_page\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tconst xSearchSubTools = [\n\t\t\t\t\t\t\t\t\"x_user_search\",\n\t\t\t\t\t\t\t\t\"x_keyword_search\",\n\t\t\t\t\t\t\t\t\"x_semantic_search\",\n\t\t\t\t\t\t\t\t\"x_thread_fetch\"\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tlet toolName = part.name ?? \"\";\n\t\t\t\t\t\t\tif (webSearchSubTools.includes(part.name ?? \"\") || part.type === \"web_search_call\") toolName = webSearchToolName ?? \"web_search\";\n\t\t\t\t\t\t\telse if (xSearchSubTools.includes(part.name ?? \"\") || part.type === \"x_search_call\") toolName = xSearchToolName ?? \"x_search\";\n\t\t\t\t\t\t\telse if (part.name === \"code_execution\" || part.type === \"code_interpreter_call\" || part.type === \"code_execution_call\") toolName = codeExecutionToolName ?? \"code_execution\";\n\t\t\t\t\t\t\telse if (part.type === \"mcp_call\") toolName = mcpToolName ?? part.name ?? \"mcp\";\n\t\t\t\t\t\t\tconst toolInput = part.type === \"custom_tool_call\" ? part.input ?? \"\" : part.type === \"mcp_call\" ? part.arguments ?? \"\" : part.arguments ?? \"\";\n\t\t\t\t\t\t\tif ((part.type === \"custom_tool_call\" ? event.type === \"response.output_item.done\" : !seenToolCalls.has(part.id)) && !seenToolCalls.has(part.id)) {\n\t\t\t\t\t\t\t\tseenToolCalls.add(part.id);\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-start\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\ttoolName\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-delta\",\n\t\t\t\t\t\t\t\t\tid: part.id,\n\t\t\t\t\t\t\t\t\tdelta: toolInput\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-end\",\n\t\t\t\t\t\t\t\t\tid: part.id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\t\tinput: toolInput,\n\t\t\t\t\t\t\t\t\tproviderExecuted: true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (event.type === \"response.output_item.done\") controller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"tool-result\",\n\t\t\t\t\t\t\t\ttoolCallId: part.id,\n\t\t\t\t\t\t\t\ttoolName,\n\t\t\t\t\t\t\t\tresult: part.type === \"web_search_call\" ? mapWebSearchAction(part.action) : {}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (part.type === \"message\") {\n\t\t\t\t\t\t\tconst blockId = `text-${part.id}`;\n\t\t\t\t\t\t\tconst streamed = contentBlocks[blockId] != null;\n\t\t\t\t\t\t\tfor (const contentPart of part.content) {\n\t\t\t\t\t\t\t\tif (contentPart.text && contentPart.text.length > 0) {\n\t\t\t\t\t\t\t\t\tif (contentBlocks[blockId] == null) {\n\t\t\t\t\t\t\t\t\t\tcontentBlocks[blockId] = { type: \"text\" };\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\t\t\ttype: \"text-start\",\n\t\t\t\t\t\t\t\t\t\t\tid: blockId\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\t\t\ttype: \"text-delta\",\n\t\t\t\t\t\t\t\t\t\t\tid: blockId,\n\t\t\t\t\t\t\t\t\t\t\tdelta: contentPart.text\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!streamed && contentPart.annotations) {\n\t\t\t\t\t\t\t\t\tfor (const annotation of contentPart.annotations) if (annotation.type === \"url_citation\" && \"url\" in annotation) controller.enqueue({\n\t\t\t\t\t\t\t\t\t\ttype: \"source\",\n\t\t\t\t\t\t\t\t\t\tsourceType: \"url\",\n\t\t\t\t\t\t\t\t\t\tid: self.config.generateId(),\n\t\t\t\t\t\t\t\t\t\turl: annotation.url,\n\t\t\t\t\t\t\t\t\t\ttitle: annotation.title ?? annotation.url\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (part.type === \"function_call\") {\n\t\t\t\t\t\t\tif (event.type === \"response.output_item.added\") {\n\t\t\t\t\t\t\t\tongoingToolCalls[event.output_index] = {\n\t\t\t\t\t\t\t\t\ttoolName: part.name,\n\t\t\t\t\t\t\t\t\ttoolCallId: part.call_id\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-start\",\n\t\t\t\t\t\t\t\t\tid: part.call_id,\n\t\t\t\t\t\t\t\t\ttoolName: part.name\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if (event.type === \"response.output_item.done\") {\n\t\t\t\t\t\t\t\thasFunctionCall = true;\n\t\t\t\t\t\t\t\tongoingToolCalls[event.output_index] = void 0;\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-input-end\",\n\t\t\t\t\t\t\t\t\tid: part.call_id\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"tool-call\",\n\t\t\t\t\t\t\t\t\ttoolCallId: part.call_id,\n\t\t\t\t\t\t\t\t\ttoolName: part.name,\n\t\t\t\t\t\t\t\t\tinput: part.arguments\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tflush(controller) {\n\t\t\t\t\tfor (const [blockId, block] of Object.entries(contentBlocks)) if (block.type === \"text\") controller.enqueue({\n\t\t\t\t\t\ttype: \"text-end\",\n\t\t\t\t\t\tid: blockId\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\t\tfinishReason,\n\t\t\t\t\t\tusage: usage ?? {\n\t\t\t\t\t\t\tinputTokens: {\n\t\t\t\t\t\t\t\ttotal: 0,\n\t\t\t\t\t\t\t\tnoCache: 0,\n\t\t\t\t\t\t\t\tcacheRead: 0,\n\t\t\t\t\t\t\t\tcacheWrite: 0\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\toutputTokens: {\n\t\t\t\t\t\t\t\ttotal: 0,\n\t\t\t\t\t\t\t\ttext: 0,\n\t\t\t\t\t\t\t\treasoning: 0\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...(costInUsdTicks != null || serviceTier != null || promptCacheKey != null || safetyIdentifier != null) && { providerMetadata: { xai: {\n\t\t\t\t\t\t\t...costInUsdTicks != null && { costInUsdTicks },\n\t\t\t\t\t\t\t...serviceTier != null && { serviceTier },\n\t\t\t\t\t\t\t...promptCacheKey != null && { promptCacheKey },\n\t\t\t\t\t\t\t...safetyIdentifier != null && { safetyIdentifier }\n\t\t\t\t\t\t} } }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})),\n\t\t\trequest: { body },\n\t\t\tresponse: { headers: responseHeaders }\n\t\t};\n\t}\n};\nfunction mapWebSearchAction(action) {\n\tconst parsed = webSearchWireActionSchema.safeParse(action);\n\tif (!parsed.success) return {};\n\tconst a = parsed.data;\n\tconst sources = a.sources?.flatMap((s) => {\n\t\tconst source = webSearchWireSourceSchema.safeParse(s);\n\t\treturn source.success ? [source.data] : [];\n\t});\n\tconst sourcesExtra = sources != null && sources.length > 0 ? { sources } : {};\n\tswitch (a.type) {\n\t\tcase \"search\": return {\n\t\t\taction: {\n\t\t\t\ttype: \"search\",\n\t\t\t\t...a.query != null && { query: a.query },\n\t\t\t\t...a.queries != null && { queries: a.queries }\n\t\t\t},\n\t\t\t...sourcesExtra\n\t\t};\n\t\tcase \"open_page\": return {\n\t\t\taction: {\n\t\t\t\ttype: \"openPage\",\n\t\t\t\turl: a.url\n\t\t\t},\n\t\t\t...sourcesExtra\n\t\t};\n\t\tcase \"find_in_page\": return {\n\t\t\taction: {\n\t\t\t\ttype: \"findInPage\",\n\t\t\t\turl: a.url,\n\t\t\t\tpattern: a.pattern\n\t\t\t},\n\t\t\t...sourcesExtra\n\t\t};\n\t}\n}\n//#endregion\n//#region src/xai-batch.ts\nconst xaiBatchEndpoint = \"/v1/responses\";\nconst xaiBatchName = \"ai-sdk-text-batch\";\nconst xaiBatchResultsPageSize = 1e3;\nconst xaiBatchProviderOptionsSchema = lazySchema(() => zodSchema(z.object({ \n/**\n* TTL in seconds for the uploaded batch input file, measured from\n* upload time. xAI accepts integers between 3600 (1 hour) and\n* 2592000 (30 days) inclusive. Without it the file has no expiry.\n*/\ninputFileExpiresAfter: z.number().int().min(3600).max(2592e3).optional() })));\nfunction assertSupportedBatchRequests(requests) {\n\tfor (const request of requests) {\n\t\tconst requestType = request.type;\n\t\tif (requestType !== \"text\" && requestType !== \"image\") throw new UnsupportedFunctionalityError({\n\t\t\tfunctionality: `batch request type: ${requestType}`,\n\t\t\tmessage: `The xAI Batch API does not support batch requests with type \"${requestType}\".`\n\t\t});\n\t}\n}\nconst xaiBatchImageResponseSchema = () => z.object({\n\tdata: z.array(z.object({\n\t\turl: z.string().nullish(),\n\t\tb64_json: z.string().nullish(),\n\t\trevised_prompt: z.string().nullish(),\n\t\trespect_moderation: z.boolean().nullish()\n\t})),\n\tusage: z.object({ cost_in_usd_ticks: z.number().nullish() }).nullish()\n});\nconst xaiBatchResponseZodSchema = () => z.object({\n\tbatch_id: z.string(),\n\tname: z.string().nullish(),\n\tcreate_time: z.string().nullish(),\n\texpire_time: z.string().nullish(),\n\tcancel_time: z.string().nullish(),\n\tcancel_by_xai_message: z.string().nullish(),\n\tstate: z.object({\n\t\tnum_requests: z.number().nullish(),\n\t\tnum_pending: z.number().nullish(),\n\t\tnum_success: z.number().nullish(),\n\t\tnum_error: z.number().nullish(),\n\t\tnum_cancelled: z.number().nullish()\n\t}).nullish()\n});\nconst xaiBatchResponseSchema = lazySchema(() => zodSchema(xaiBatchResponseZodSchema()));\nconst xaiBatchErrorSchema = () => z.object({\n\tcode: z.union([z.string(), z.number()]).nullish(),\n\tmessage: z.string().nullish()\n});\nconst xaiBatchResultSchema = () => z.object({\n\tbatch_request_id: z.string(),\n\tbatch_result: z.object({\n\t\tresponse: z.object({\n\t\t\tchat_get_completion: z.unknown().nullish(),\n\t\t\timage_generation: z.unknown().nullish()\n\t\t}).nullish(),\n\t\terror: xaiBatchErrorSchema().nullish()\n\t}).nullish(),\n\terror_message: z.string().nullish()\n});\nconst xaiBatchTextResponseSchema = () => z.object({\n\tid: z.string().nullish(),\n\tcreated: z.number().nullish(),\n\tmodel: z.string().nullish(),\n\tchoices: z.array(z.object({\n\t\tmessage: z.object({\n\t\t\trole: z.enum([\"assistant\", \"tool\"]),\n\t\t\tcontent: z.string().nullish(),\n\t\t\treasoning_content: z.string().nullish(),\n\t\t\ttool_calls: z.array(z.object({\n\t\t\t\tid: z.string(),\n\t\t\t\ttype: z.literal(\"function\"),\n\t\t\t\tfunction: z.object({\n\t\t\t\t\tname: z.string(),\n\t\t\t\t\targuments: z.string()\n\t\t\t\t})\n\t\t\t})).nullish()\n\t\t}),\n\t\tindex: z.number(),\n\t\tfinish_reason: z.string().nullish()\n\t})).nullish(),\n\tusage: z.object({\n\t\tprompt_tokens: z.number(),\n\t\tcompletion_tokens: z.number(),\n\t\ttotal_tokens: z.number(),\n\t\tcost_in_usd_ticks: z.number().nullish(),\n\t\tprompt_tokens_details: z.object({ cached_tokens: z.number().nullish() }).nullish(),\n\t\tcompletion_tokens_details: z.object({ reasoning_tokens: z.number().nullish() }).nullish()\n\t}).nullish(),\n\tcitations: z.array(z.string().url()).nullish(),\n\tservice_tier: z.string().nullish(),\n\tcode: z.string().nullish(),\n\terror: z.string().nullish()\n});\nconst xaiBatchResultsPageSchema = lazySchema(() => zodSchema(z.object({\n\tresults: z.array(xaiBatchResultSchema()),\n\tpagination_token: z.string().nullish()\n})));\nconst xaiBatchListResponseSchema = lazySchema(() => zodSchema(z.object({\n\tbatches: z.array(xaiBatchResponseZodSchema()),\n\tpagination_token: z.string().nullish()\n})));\nvar XaiBatch = class {\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.supportedUrls = xaiResponsesSupportedUrls;\n\t\tthis.provider = options.provider;\n\t}\n\tasync doStartBatch(options) {\n\t\tassertSupportedBatchRequests(options.requests);\n\t\tconst fileParts = [];\n\t\tconst warnings = options.webhookUrl == null ? [] : [{ warning: {\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"webhookUrl\",\n\t\t\tdetails: \"The xAI Batch API does not support per-batch webhook URLs.\"\n\t\t} }];\n\t\tconst batchOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions: options.providerOptions,\n\t\t\tschema: xaiBatchProviderOptionsSchema\n\t\t});\n\t\tfor (const request of options.requests) {\n\t\t\tconst preparedRequest = await this.prepareRequest(request);\n\t\t\tfileParts.push(JSON.stringify({\n\t\t\t\tcustom_id: request.id,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\turl: preparedRequest.endpoint,\n\t\t\t\tbody: preparedRequest.body\n\t\t\t}), \"\\n\");\n\t\t\tfor (const warning of preparedRequest.warnings) warnings.push({\n\t\t\t\trequestId: request.id,\n\t\t\t\twarning\n\t\t\t});\n\t\t}\n\t\tconst filename = \"batch.jsonl\";\n\t\tconst file = new Blob(fileParts, { type: \"application/jsonl\" });\n\t\tfileParts.length = 0;\n\t\tconst formData = new FormData();\n\t\tif (batchOptions?.inputFileExpiresAfter != null) formData.append(\"expires_after\", String(batchOptions.inputFileExpiresAfter));\n\t\tformData.append(\"file\", file, filename);\n\t\tconst { value: uploadedFile } = await postFormDataToApi({\n\t\t\turl: this.getUrl(\"/files\"),\n\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\tformData,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiFilesResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.options.config.fetch\n\t\t});\n\t\tconst { value: batch } = await postJsonToApi({\n\t\t\turl: this.getUrl(\"/batches\"),\n\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\tbody: {\n\t\t\t\tname: xaiBatchName,\n\t\t\t\tinput_file_id: uploadedFile.id\n\t\t\t},\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiBatchResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.options.config.fetch\n\t\t});\n\t\treturn {\n\t\t\tbatchId: batch.batch_id,\n\t\t\t...convertXaiBatchStatus(batch),\n\t\t\tproviderMetadata: { xai: {\n\t\t\t\tinputFileId: uploadedFile.id,\n\t\t\t\t...uploadedFile.expires_at != null ? { inputFileExpiresAt: (/* @__PURE__ */ new Date(uploadedFile.expires_at * 1e3)).toISOString() } : {}\n\t\t\t} },\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doGetBatchStatus(options) {\n\t\treturn convertXaiBatchStatus(await this.retrieveBatch(options));\n\t}\n\tasync doCancelBatch(options) {\n\t\tawait postJsonToApi({\n\t\t\turl: this.getUrl(`/batches/${encodeURIComponent(options.batchId)}:cancel`),\n\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\tbody: {},\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiBatchResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.options.config.fetch\n\t\t});\n\t\treturn {};\n\t}\n\tasync doListBatches(options) {\n\t\tconst url = new URL(this.getUrl(\"/batches\"));\n\t\tif (options.limit != null) url.searchParams.set(\"limit\", String(options.limit));\n\t\tif (options.cursor != null) url.searchParams.set(\"pagination_token\", options.cursor);\n\t\tconst { value: page } = await getFromApi({\n\t\t\turl: url.toString(),\n\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiBatchListResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.options.config.fetch,\n\t\t\tvalidateUrl: false\n\t\t});\n\t\treturn {\n\t\t\tbatches: page.batches.map((batch) => ({\n\t\t\t\tbatchId: batch.batch_id,\n\t\t\t\t...convertXaiBatchStatus(batch)\n\t\t\t})),\n\t\t\t...page.pagination_token != null ? { nextCursor: page.pagination_token } : {}\n\t\t};\n\t}\n\tasync doGetBatchResults(options) {\n\t\tif (convertXaiBatchStatus(await this.retrieveBatch(options)).status === \"pending\") throw new InvalidArgumentError({\n\t\t\targument: \"batchId\",\n\t\t\tmessage: `xAI batch \"${options.batchId}\" is not complete.`\n\t\t});\n\t\treturn convertAsyncIteratorToReadableStream(this.iterateBatchResults(options));\n\t}\n\tasync retrieveBatch(options) {\n\t\tconst { value: batch } = await getFromApi({\n\t\t\turl: this.getUrl(`/batches/${encodeURIComponent(options.batchId)}`),\n\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiBatchResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.options.config.fetch,\n\t\t\tvalidateUrl: false\n\t\t});\n\t\treturn batch;\n\t}\n\tasync *iterateBatchResults(options) {\n\t\tlet paginationToken;\n\t\tdo {\n\t\t\tconst query = new URLSearchParams({ limit: String(xaiBatchResultsPageSize) });\n\t\t\tif (paginationToken != null) query.set(\"pagination_token\", paginationToken);\n\t\t\tconst { value: page } = await getFromApi({\n\t\t\t\turl: this.getUrl(`/batches/${encodeURIComponent(options.batchId)}/results?${query}`),\n\t\t\t\theaders: combineHeaders(await resolve(this.options.config.headers), options.headers),\n\t\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiBatchResultsPageSchema),\n\t\t\t\tabortSignal: options.abortSignal,\n\t\t\t\tfetch: this.options.config.fetch,\n\t\t\t\tvalidateUrl: false\n\t\t\t});\n\t\t\tfor (const result of page.results) yield await this.convertBatchResult(result, options.abortSignal);\n\t\t\tpaginationToken = page.pagination_token ?? void 0;\n\t\t} while (paginationToken != null);\n\t}\n\tasync convertBatchResult(result, abortSignal) {\n\t\tconst error = result.batch_result?.error;\n\t\tif ((result.error_message?.length ?? 0) > 0 || error?.code != null && error.code !== 0 && error.code !== \"0\" || error?.code == null && (error?.message?.length ?? 0) > 0) {\n\t\t\tconst convertedError = convertXaiBatchError(result);\n\t\t\treturn {\n\t\t\t\ttype: \"text\",\n\t\t\t\tid: result.batch_request_id,\n\t\t\t\tstatus: isXaiCancellationError(error?.code) ? \"cancelled\" : \"failed\",\n\t\t\t\terror: convertedError\n\t\t\t};\n\t\t}\n\t\tconst response = result.batch_result?.response;\n\t\tif (response?.chat_get_completion != null) {\n\t\t\tconst validation = await safeValidateTypes({\n\t\t\t\tvalue: response.chat_get_completion,\n\t\t\t\tschema: zodSchema(xaiBatchTextResponseSchema())\n\t\t\t});\n\t\t\tif (!validation.success) return invalidXaiBatchResult(result.batch_request_id);\n\t\t\tconst conversion = convertXaiBatchTextResponse(validation.value);\n\t\t\treturn conversion.success ? {\n\t\t\t\ttype: \"text\",\n\t\t\t\tid: result.batch_request_id,\n\t\t\t\tstatus: \"succeeded\",\n\t\t\t\tresult: conversion.result\n\t\t\t} : {\n\t\t\t\ttype: \"text\",\n\t\t\t\tid: result.batch_request_id,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: conversion.error\n\t\t\t};\n\t\t}\n\t\tif (response?.image_generation != null) {\n\t\t\tconst validation = await safeValidateTypes({\n\t\t\t\tvalue: response.image_generation,\n\t\t\t\tschema: zodSchema(xaiBatchImageResponseSchema())\n\t\t\t});\n\t\t\tif (!validation.success) return invalidXaiImageBatchResult(result.batch_request_id);\n\t\t\tif (validation.value.data.some((image) => image.respect_moderation === false)) return {\n\t\t\t\ttype: \"image\",\n\t\t\t\tid: result.batch_request_id,\n\t\t\t\tstatus: \"failed\",\n\t\t\t\terror: { message: \"Image generation was blocked due to a content policy violation.\" }\n\t\t\t};\n\t\t\tconst imageResult = await this.convertImageBatchResponse(validation.value, abortSignal);\n\t\t\treturn {\n\t\t\t\ttype: \"image\",\n\t\t\t\tid: result.batch_request_id,\n\t\t\t\tstatus: \"succeeded\",\n\t\t\t\tresult: imageResult\n\t\t\t};\n\t\t}\n\t\treturn invalidXaiBatchResult(result.batch_request_id);\n\t}\n\tasync prepareRequest(request) {\n\t\tif (request.type === \"text\") {\n\t\t\tconst { args: body, warnings } = await XaiResponsesLanguageModel.prepareRequest({\n\t\t\t\tmodelId: request.modelId,\n\t\t\t\toptions: request.options\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tendpoint: xaiBatchEndpoint,\n\t\t\t\tbody,\n\t\t\t\twarnings\n\t\t\t};\n\t\t}\n\t\tconst { prompt, n, size, aspectRatio, seed, files, mask, providerOptions } = request.options;\n\t\tconst warnings = [];\n\t\tif (size != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"size\",\n\t\t\tdetails: \"This model does not support the `size` option. Use `aspectRatio` instead.\"\n\t\t});\n\t\tif (seed != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"seed\"\n\t\t});\n\t\tif (mask != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"mask\"\n\t\t});\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions,\n\t\t\tschema: xaiImageModelOptions\n\t\t});\n\t\tconst imageUrls = (files ?? []).map(convertImageModelFileToDataUri);\n\t\tconst body = {\n\t\t\tmodel: request.modelId,\n\t\t\tprompt,\n\t\t\tn,\n\t\t\tresponse_format: \"b64_json\"\n\t\t};\n\t\tif (aspectRatio != null) body.aspect_ratio = aspectRatio;\n\t\tif (xaiOptions?.output_format != null) body.output_format = xaiOptions.output_format;\n\t\tif (xaiOptions?.sync_mode != null) body.sync_mode = xaiOptions.sync_mode;\n\t\tif (xaiOptions?.aspect_ratio != null && aspectRatio == null) body.aspect_ratio = xaiOptions.aspect_ratio;\n\t\tif (xaiOptions?.resolution != null) body.resolution = xaiOptions.resolution;\n\t\tif (xaiOptions?.quality != null) body.quality = xaiOptions.quality;\n\t\tif (xaiOptions?.user != null) body.user = xaiOptions.user;\n\t\tif (imageUrls.length === 1) body.image = {\n\t\t\turl: imageUrls[0],\n\t\t\ttype: \"image_url\"\n\t\t};\n\t\telse if (imageUrls.length > 1) body.images = imageUrls.map((url) => ({\n\t\t\turl,\n\t\t\ttype: \"image_url\"\n\t\t}));\n\t\treturn {\n\t\t\tendpoint: files?.length ? \"/v1/images/edits\" : \"/v1/images/generations\",\n\t\t\tbody,\n\t\t\twarnings\n\t\t};\n\t}\n\tasync convertImageBatchResponse(response, abortSignal) {\n\t\treturn {\n\t\t\timages: response.data.every((image) => image.b64_json != null) ? response.data.map((image) => image.b64_json) : await Promise.all(response.data.map(async (image) => {\n\t\t\t\tif (image.b64_json != null) return convertBase64ToUint8Array(image.b64_json);\n\t\t\t\tif (image.url == null) throw new InvalidArgumentError({\n\t\t\t\t\targument: \"batchResult\",\n\t\t\t\t\tmessage: \"xAI returned an image without data or a URL.\"\n\t\t\t\t});\n\t\t\t\tconst { value } = await getFromApi({\n\t\t\t\t\turl: image.url,\n\t\t\t\t\tvalidateUrl: true,\n\t\t\t\t\ttrustedOrigin: this.options.config.baseURL,\n\t\t\t\t\tabortSignal,\n\t\t\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\t\t\tsuccessfulResponseHandler: createBinaryResponseHandler(),\n\t\t\t\t\tfetch: this.options.config.fetch\n\t\t\t\t});\n\t\t\t\treturn value;\n\t\t\t})),\n\t\t\twarnings: [],\n\t\t\tresponse: {\n\t\t\t\ttimestamp: /* @__PURE__ */ new Date(),\n\t\t\t\tmodelId: \"\",\n\t\t\t\theaders: void 0\n\t\t\t},\n\t\t\tproviderMetadata: { xai: {\n\t\t\t\timages: response.data.map((item) => item.revised_prompt != null ? { revisedPrompt: item.revised_prompt } : {}),\n\t\t\t\t...response.usage?.cost_in_usd_ticks != null ? { costInUsdTicks: response.usage.cost_in_usd_ticks } : {}\n\t\t\t} }\n\t\t};\n\t}\n\tgetUrl(path) {\n\t\treturn `${this.options.config.baseURL ?? \"https://api.x.ai/v1\"}${path}`;\n\t}\n};\nfunction convertXaiBatchStatus(batch) {\n\tconst requestCounts = normalizeBatchRequestCounts({\n\t\ttotal: batch.state?.num_requests,\n\t\tpending: batch.state?.num_pending,\n\t\tcompleted: batch.state?.num_success,\n\t\tfailed: batch.state?.num_error != null && batch.state?.num_cancelled != null ? batch.state.num_error + batch.state.num_cancelled : void 0\n\t});\n\tconst isCancelled = batch.cancel_time != null || batch.cancel_by_xai_message != null;\n\tconst isExpired = isPastDate(batch.expire_time);\n\treturn {\n\t\tstatus: isCancelled || isExpired ? \"failed\" : requestCounts != null && requestCounts.total > 0 && requestCounts.pending === 0 ? \"completed\" : \"pending\",\n\t\t...requestCounts != null ? { requestCounts } : {},\n\t\t...isCancelled ? { error: {\n\t\t\tmessage: batch.cancel_by_xai_message ?? `xAI batch \"${batch.batch_id}\" was cancelled.`,\n\t\t\tcode: \"batch_cancelled\"\n\t\t} } : isExpired ? { error: {\n\t\t\tmessage: `xAI batch \"${batch.batch_id}\" expired.`,\n\t\t\tcode: \"batch_expired\"\n\t\t} } : {},\n\t\t...batch.create_time != null ? { createdAt: batch.create_time } : {},\n\t\t...batch.expire_time != null ? { expiresAt: batch.expire_time } : {}\n\t};\n}\nfunction isPastDate(value) {\n\tif (value == null) return false;\n\tconst timestamp = Date.parse(value);\n\treturn !Number.isNaN(timestamp) && timestamp <= Date.now();\n}\nfunction convertXaiBatchError(result) {\n\tconst error = result.batch_result?.error;\n\treturn {\n\t\tmessage: result.error_message || error?.message || \"xAI batch request failed.\",\n\t\t...error?.code != null && error.code !== 0 && error.code !== \"0\" ? { code: String(error.code) } : {}\n\t};\n}\nfunction isXaiCancellationError(code) {\n\tconst normalizedCode = String(code).toLowerCase();\n\treturn code === 1 || normalizedCode === \"1\" || normalizedCode === \"cancelled\" || normalizedCode === \"batch_cancelled\";\n}\nfunction invalidXaiBatchResult(id) {\n\treturn {\n\t\ttype: \"text\",\n\t\tid,\n\t\tstatus: \"failed\",\n\t\terror: {\n\t\t\tmessage: \"xAI returned an invalid Responses batch result.\",\n\t\t\tcode: \"invalid_response\"\n\t\t}\n\t};\n}\nfunction invalidXaiImageBatchResult(id) {\n\treturn {\n\t\ttype: \"image\",\n\t\tid,\n\t\tstatus: \"failed\",\n\t\terror: {\n\t\t\tmessage: \"xAI returned an invalid image batch result.\",\n\t\t\tcode: \"invalid_response\"\n\t\t}\n\t};\n}\nfunction convertXaiBatchTextResponse(response) {\n\tif (response.error != null) return {\n\t\tsuccess: false,\n\t\terror: {\n\t\t\tmessage: response.error,\n\t\t\t...response.code != null ? { code: response.code } : {}\n\t\t}\n\t};\n\tconst choices = response.choices;\n\tif (choices == null || choices.length === 0) return {\n\t\tsuccess: false,\n\t\terror: {\n\t\t\tmessage: \"xAI returned a batch response without any choices.\",\n\t\t\tcode: \"invalid_response\"\n\t\t}\n\t};\n\tconst content = [];\n\tconst providerExecutedToolCallIds = new Set(choices.filter((choice) => choice.message.role === \"tool\").flatMap((choice) => (choice.message.tool_calls ?? []).map((toolCall) => toolCall.id)));\n\tlet lastAssistantChoice;\n\tfor (const choice of choices) {\n\t\tif (choice.message.role === \"tool\") {\n\t\t\tif (choice.message.content != null) for (const toolCall of choice.message.tool_calls ?? []) content.push({\n\t\t\t\ttype: \"tool-result\",\n\t\t\t\ttoolCallId: toolCall.id,\n\t\t\t\ttoolName: toolCall.function.name,\n\t\t\t\tresult: choice.message.content,\n\t\t\t\tdynamic: true\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tlastAssistantChoice = choice;\n\t\tif (choice.message.content) content.push({\n\t\t\ttype: \"text\",\n\t\t\ttext: choice.message.content\n\t\t});\n\t\tif (choice.message.reasoning_content) content.push({\n\t\t\ttype: \"reasoning\",\n\t\t\ttext: choice.message.reasoning_content\n\t\t});\n\t\tfor (const toolCall of choice.message.tool_calls ?? []) content.push({\n\t\t\ttype: \"tool-call\",\n\t\t\ttoolCallId: toolCall.id,\n\t\t\ttoolName: toolCall.function.name,\n\t\t\tinput: toolCall.function.arguments,\n\t\t\t...providerExecutedToolCallIds.has(toolCall.id) ? {\n\t\t\t\tproviderExecuted: true,\n\t\t\t\tdynamic: true\n\t\t\t} : {}\n\t\t});\n\t}\n\tfor (const url of response.citations ?? []) content.push({\n\t\ttype: \"source\",\n\t\tsourceType: \"url\",\n\t\tid: url,\n\t\turl\n\t});\n\treturn {\n\t\tsuccess: true,\n\t\tresult: {\n\t\t\tcontent,\n\t\t\tfinishReason: {\n\t\t\t\tunified: mapXaiFinishReason(lastAssistantChoice?.finish_reason),\n\t\t\t\traw: lastAssistantChoice?.finish_reason ?? void 0\n\t\t\t},\n\t\t\tusage: response.usage ? convertXaiBatchTextUsage(response.usage) : createNullLanguageModelUsage(),\n\t\t\tresponse: getResponseMetadata(response),\n\t\t\twarnings: [],\n\t\t\t...(response.usage?.cost_in_usd_ticks != null || response.service_tier != null) && { providerMetadata: { xai: {\n\t\t\t\t...response.usage?.cost_in_usd_ticks != null ? { costInUsdTicks: response.usage.cost_in_usd_ticks } : {},\n\t\t\t\t...response.service_tier != null ? { serviceTier: response.service_tier } : {}\n\t\t\t} } }\n\t\t}\n\t};\n}\nfunction convertXaiBatchTextUsage(usage) {\n\tconst cacheReadTokens = usage.prompt_tokens_details?.cached_tokens ?? 0;\n\tconst reasoningTokens = usage.completion_tokens_details?.reasoning_tokens ?? 0;\n\tconst promptTokensIncludesCached = cacheReadTokens <= usage.prompt_tokens;\n\treturn {\n\t\tinputTokens: {\n\t\t\ttotal: promptTokensIncludesCached ? usage.prompt_tokens : usage.prompt_tokens + cacheReadTokens,\n\t\t\tnoCache: promptTokensIncludesCached ? usage.prompt_tokens - cacheReadTokens : usage.prompt_tokens,\n\t\t\tcacheRead: cacheReadTokens,\n\t\t\tcacheWrite: void 0\n\t\t},\n\t\toutputTokens: {\n\t\t\ttotal: usage.completion_tokens + reasoningTokens,\n\t\t\ttext: usage.completion_tokens,\n\t\t\treasoning: reasoningTokens\n\t\t},\n\t\traw: usage\n\t};\n}\n//#endregion\n//#region src/realtime/xai-realtime-event-mapper.ts\nfunction parseXaiRealtimeServerEvent(raw) {\n\tconst event = raw;\n\tconst type = event.type;\n\tswitch (type) {\n\t\tcase \"session.created\": return {\n\t\t\ttype: \"session-created\",\n\t\t\tsessionId: event.session?.id,\n\t\t\traw\n\t\t};\n\t\tcase \"session.updated\": return {\n\t\t\ttype: \"session-updated\",\n\t\t\traw\n\t\t};\n\t\tcase \"conversation.created\": return {\n\t\t\ttype: \"custom\",\n\t\t\trawType: type,\n\t\t\traw\n\t\t};\n\t\tcase \"input_audio_buffer.speech_started\": return {\n\t\t\ttype: \"speech-started\",\n\t\t\titemId: event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"input_audio_buffer.speech_stopped\": return {\n\t\t\ttype: \"speech-stopped\",\n\t\t\titemId: event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"input_audio_buffer.committed\": return {\n\t\t\ttype: \"audio-committed\",\n\t\t\titemId: event.item_id,\n\t\t\tpreviousItemId: event.previous_item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"conversation.item.added\": return {\n\t\t\ttype: \"conversation-item-added\",\n\t\t\titemId: event.item?.id ?? event.item_id,\n\t\t\titem: event.item,\n\t\t\traw\n\t\t};\n\t\tcase \"conversation.item.input_audio_transcription.completed\": return {\n\t\t\ttype: \"input-transcription-completed\",\n\t\t\titemId: event.item_id,\n\t\t\ttranscript: event.transcript ?? \"\",\n\t\t\traw\n\t\t};\n\t\tcase \"response.created\": return {\n\t\t\ttype: \"response-created\",\n\t\t\tresponseId: event.response?.id ?? event.response_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.done\": return {\n\t\t\ttype: \"response-done\",\n\t\t\tresponseId: event.response?.id ?? event.response_id,\n\t\t\tstatus: event.response?.status ?? \"completed\",\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_item.added\": return {\n\t\t\ttype: \"output-item-added\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item?.id ?? event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_item.done\": return {\n\t\t\ttype: \"output-item-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item?.id ?? event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.content_part.added\": return {\n\t\t\ttype: \"content-part-added\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.content_part.done\": return {\n\t\t\ttype: \"content-part-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_audio.delta\": return {\n\t\t\ttype: \"audio-delta\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\tdelta: event.delta,\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_audio.done\": return {\n\t\t\ttype: \"audio-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_audio_transcript.delta\": return {\n\t\t\ttype: \"audio-transcript-delta\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\tdelta: event.delta,\n\t\t\traw\n\t\t};\n\t\tcase \"response.output_audio_transcript.done\": return {\n\t\t\ttype: \"audio-transcript-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\ttranscript: event.transcript,\n\t\t\traw\n\t\t};\n\t\tcase \"response.text.delta\": return {\n\t\t\ttype: \"text-delta\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\tdelta: event.delta,\n\t\t\traw\n\t\t};\n\t\tcase \"response.text.done\": return {\n\t\t\ttype: \"text-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\ttext: event.text,\n\t\t\traw\n\t\t};\n\t\tcase \"response.function_call_arguments.delta\": return {\n\t\t\ttype: \"function-call-arguments-delta\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\tcallId: event.call_id,\n\t\t\tdelta: event.delta,\n\t\t\traw\n\t\t};\n\t\tcase \"response.function_call_arguments.done\": return {\n\t\t\ttype: \"function-call-arguments-done\",\n\t\t\tresponseId: event.response_id,\n\t\t\titemId: event.item_id,\n\t\t\tcallId: event.call_id,\n\t\t\tname: event.name,\n\t\t\targuments: event.arguments,\n\t\t\traw\n\t\t};\n\t\tcase \"mcp_list_tools.in_progress\":\n\t\tcase \"mcp_list_tools.completed\":\n\t\tcase \"mcp_list_tools.failed\":\n\t\tcase \"response.mcp_call_arguments.delta\":\n\t\tcase \"response.mcp_call_arguments.done\":\n\t\tcase \"response.mcp_call.in_progress\":\n\t\tcase \"response.mcp_call.completed\":\n\t\tcase \"response.mcp_call.failed\": return {\n\t\t\ttype: \"custom\",\n\t\t\trawType: type,\n\t\t\traw\n\t\t};\n\t\tcase \"error\": return {\n\t\t\ttype: \"error\",\n\t\t\tmessage: event.error?.message ?? event.message ?? \"Unknown error\",\n\t\t\tcode: event.error?.code ?? event.code,\n\t\t\traw\n\t\t};\n\t\tdefault: return {\n\t\t\ttype: \"custom\",\n\t\t\trawType: type,\n\t\t\traw\n\t\t};\n\t}\n}\nfunction serializeXaiRealtimeClientEvent(event) {\n\tswitch (event.type) {\n\t\tcase \"session-update\": return {\n\t\t\ttype: \"session.update\",\n\t\t\tsession: buildXaiSessionConfig(event.config)\n\t\t};\n\t\tcase \"input-audio-append\": return {\n\t\t\ttype: \"input_audio_buffer.append\",\n\t\t\taudio: event.audio\n\t\t};\n\t\tcase \"input-audio-commit\": return { type: \"input_audio_buffer.commit\" };\n\t\tcase \"input-audio-clear\": return { type: \"input_audio_buffer.clear\" };\n\t\tcase \"conversation-item-create\": {\n\t\t\tconst item = event.item;\n\t\t\tswitch (item.type) {\n\t\t\t\tcase \"text-message\": return {\n\t\t\t\t\ttype: \"conversation.item.create\",\n\t\t\t\t\titem: {\n\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\trole: item.role,\n\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\ttype: \"input_text\",\n\t\t\t\t\t\t\ttext: item.text\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcase \"audio-message\": return {\n\t\t\t\t\ttype: \"conversation.item.create\",\n\t\t\t\t\titem: {\n\t\t\t\t\t\ttype: \"message\",\n\t\t\t\t\t\trole: item.role,\n\t\t\t\t\t\tcontent: [{\n\t\t\t\t\t\t\ttype: \"input_audio\",\n\t\t\t\t\t\t\taudio: item.audio\n\t\t\t\t\t\t}]\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tcase \"function-call-output\": return {\n\t\t\t\t\ttype: \"conversation.item.create\",\n\t\t\t\t\titem: {\n\t\t\t\t\t\ttype: \"function_call_output\",\n\t\t\t\t\t\tcall_id: item.callId,\n\t\t\t\t\t\toutput: item.output\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"conversation-item-truncate\": return;\n\t\tcase \"response-create\": return {\n\t\t\ttype: \"response.create\",\n\t\t\t...event.options != null ? { response: {\n\t\t\t\t...event.options.modalities != null ? { modalities: event.options.modalities } : {},\n\t\t\t\t...event.options.instructions != null ? { instructions: event.options.instructions } : {}\n\t\t\t} } : {}\n\t\t};\n\t\tcase \"response-cancel\": return { type: \"response.cancel\" };\n\t}\n}\nfunction buildXaiSessionConfig(config) {\n\tconst session = {};\n\tif (config.instructions != null) session.instructions = config.instructions;\n\tif (config.voice != null) session.voice = config.voice;\n\tconst audio = {};\n\tif (config.inputAudioFormat != null) audio.input = { format: {\n\t\ttype: config.inputAudioFormat.type,\n\t\t...config.inputAudioFormat.rate != null ? { rate: config.inputAudioFormat.rate } : {}\n\t} };\n\tif (config.outputAudioFormat != null) audio.output = { format: {\n\t\ttype: config.outputAudioFormat.type,\n\t\t...config.outputAudioFormat.rate != null ? { rate: config.outputAudioFormat.rate } : {}\n\t} };\n\tif (Object.keys(audio).length > 0) session.audio = audio;\n\tif (config.turnDetection != null) {\n\t\tif (config.turnDetection.type === \"disabled\") session.turn_detection = null;\n\t\telse {\n\t\t\tconst td = { type: \"server_vad\" };\n\t\t\tif (config.turnDetection.threshold != null) td.threshold = config.turnDetection.threshold;\n\t\t\tif (config.turnDetection.silenceDurationMs != null) td.silence_duration_ms = config.turnDetection.silenceDurationMs;\n\t\t\tif (config.turnDetection.prefixPaddingMs != null) td.prefix_padding_ms = config.turnDetection.prefixPaddingMs;\n\t\t\tsession.turn_detection = td;\n\t\t}\n\t}\n\tif (config.tools != null && config.tools.length > 0) session.tools = config.tools.map((tool) => ({\n\t\ttype: tool.type,\n\t\tname: tool.name,\n\t\tdescription: tool.description,\n\t\tparameters: tool.parameters\n\t}));\n\tif (config.providerOptions != null) {\n\t\tconst xaiOptions = config.providerOptions;\n\t\tif (Array.isArray(xaiOptions.tools)) session.tools = [...session.tools ?? [], ...xaiOptions.tools];\n\t\tfor (const [key, value] of Object.entries(xaiOptions)) if (key !== \"tools\") session[key] = value;\n\t}\n\treturn session;\n}\n//#endregion\n//#region src/realtime/xai-realtime-model.ts\nvar XaiRealtimeModel = class {\n\tconstructor(modelId, config) {\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.modelId = modelId;\n\t\tthis.provider = config.provider;\n\t\tthis.config = config;\n\t}\n\tasync doCreateClientSecret(options) {\n\t\tconst fetchFn = this.config.fetch ?? fetch;\n\t\tconst url = `${this.config.baseURL}/realtime/client_secrets`;\n\t\tconst body = {};\n\t\tif (options.expiresAfterSeconds != null) body.expires_after = { seconds: options.expiresAfterSeconds };\n\t\tconst response = await fetchFn(url, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t...await resolve(this.config.headers),\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(body)\n\t\t});\n\t\tif (!response.ok) {\n\t\t\tconst text = await response.text();\n\t\t\tthrow new Error(`xAI realtime client secret request failed: ${response.status} ${text}`);\n\t\t}\n\t\tconst data = await response.json();\n\t\treturn {\n\t\t\ttoken: data.value,\n\t\t\turl: `wss://${new URL(this.config.baseURL).host}/v1/realtime?model=${encodeURIComponent(this.modelId)}`,\n\t\t\texpiresAt: data.expires_at\n\t\t};\n\t}\n\tgetWebSocketConfig(options) {\n\t\treturn {\n\t\t\turl: options.url,\n\t\t\tprotocols: [`xai-client-secret.${options.token}`]\n\t\t};\n\t}\n\tparseServerEvent(raw) {\n\t\treturn parseXaiRealtimeServerEvent(raw);\n\t}\n\tserializeClientEvent(event) {\n\t\treturn serializeXaiRealtimeClientEvent(event);\n\t}\n\tbuildSessionConfig(config) {\n\t\treturn buildXaiSessionConfig(config);\n\t}\n};\n//#endregion\n//#region src/tool/code-execution.ts\nconst codeExecutionOutputSchema = lazySchema(() => zodSchema(z.object({\n\toutput: z.string().describe(\"the output of the code execution\"),\n\terror: z.string().optional().describe(\"any error that occurred\")\n})));\nconst codeExecutionToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.code_execution\",\n\tinputSchema: z.object({}).describe(\"no input parameters\"),\n\toutputSchema: codeExecutionOutputSchema\n});\nconst codeExecution = (args = {}) => codeExecutionToolFactory(args);\n//#endregion\n//#region src/tool/view-image.ts\nconst viewImageOutputSchema = lazySchema(() => zodSchema(z.object({\n\tdescription: z.string().describe(\"description of the image\"),\n\tobjects: z.array(z.string()).optional().describe(\"objects detected in the image\")\n})));\nconst viewImageToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.view_image\",\n\tinputSchema: z.object({}).describe(\"no input parameters\"),\n\toutputSchema: viewImageOutputSchema\n});\nconst viewImage = (args = {}) => viewImageToolFactory(args);\n//#endregion\n//#region src/tool/view-x-video.ts\nconst viewXVideoOutputSchema = lazySchema(() => zodSchema(z.object({\n\ttranscript: z.string().optional().describe(\"transcript of the video\"),\n\tdescription: z.string().describe(\"description of the video content\"),\n\tduration: z.number().optional().describe(\"duration in seconds\")\n})));\nconst viewXVideoToolFactory = createProviderExecutedToolFactory({\n\tid: \"xai.view_x_video\",\n\tinputSchema: z.object({}).describe(\"no input parameters\"),\n\toutputSchema: viewXVideoOutputSchema\n});\nconst viewXVideo = (args = {}) => viewXVideoToolFactory(args);\n//#endregion\n//#region src/tool/index.ts\nconst xaiTools = {\n\tcodeExecution,\n\tfileSearch,\n\timageGeneration,\n\tmcpServer,\n\tviewImage,\n\tviewXVideo,\n\twebSearch,\n\txSearch\n};\n//#endregion\n//#region src/version.ts\nconst VERSION = \"5.0.35\";\n//#endregion\n//#region src/files/xai-files-options.ts\nconst xaiFilesOptionsSchema = lazySchema(() => zodSchema(z.looseObject({\n\tteamId: z.string().optional(),\n\tfilePath: z.string().optional(),\n\t/**\n\t* TTL in seconds measured from upload time; xAI accepts integers\n\t* between 3600 (1 hour) and 2592000 (30 days) inclusive.\n\t* Omit to keep the file until it is deleted.\n\t*/\n\texpiresAfter: z.number().int().min(3600).max(2592e3).optional()\n})));\n//#endregion\n//#region src/files/xai-files.ts\nvar XaiFiles = class {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(config) {\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t}\n\tgetFileId(file) {\n\t\tconst fileId = file.xai;\n\t\tif (fileId == null || fileId.trim() === \"\") throw new InvalidArgumentError({\n\t\t\targument: \"file\",\n\t\t\tmessage: \"file reference is missing an 'xai' file id.\"\n\t\t});\n\t\treturn fileId;\n\t}\n\tasync getHeaders(headers) {\n\t\treturn combineHeaders(await resolve(this.config.headers), headers);\n\t}\n\tasync uploadFile({ data, mediaType, filename, abortSignal, headers, providerOptions }) {\n\t\tlet xaiOptions;\n\t\ttry {\n\t\t\txaiOptions = await parseProviderOptions({\n\t\t\t\tprovider: \"xai\",\n\t\t\t\tproviderOptions,\n\t\t\t\tschema: xaiFilesOptionsSchema\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (data.type === \"stream\") await data.stream.cancel(error).catch(() => {});\n\t\t\tthrow error;\n\t\t}\n\t\tconst requestHeaders = await this.getHeaders(headers);\n\t\tconst url = `${this.config.baseURL}/files`;\n\t\tlet response;\n\t\tif (data.type === \"stream\") {\n\t\t\tconst parts = [];\n\t\t\tif (xaiOptions?.expiresAfter != null) parts.push({\n\t\t\t\ttype: \"field\",\n\t\t\t\tname: \"expires_after\",\n\t\t\t\tvalue: String(xaiOptions.expiresAfter)\n\t\t\t});\n\t\t\tif (xaiOptions?.teamId != null) parts.push({\n\t\t\t\ttype: \"field\",\n\t\t\t\tname: \"team_id\",\n\t\t\t\tvalue: xaiOptions.teamId\n\t\t\t});\n\t\t\tparts.push({\n\t\t\t\ttype: \"file\",\n\t\t\t\tname: \"file\",\n\t\t\t\tfilename,\n\t\t\t\tmediaType,\n\t\t\t\tcontent: data.stream\n\t\t\t});\n\t\t\t({value: response} = await postMultipartStreamToApi({\n\t\t\t\turl,\n\t\t\t\theaders: requestHeaders,\n\t\t\t\tparts,\n\t\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiFilesResponseSchema),\n\t\t\t\tabortSignal,\n\t\t\t\tfetch: this.config.fetch\n\t\t\t}));\n\t\t} else {\n\t\t\tconst fileBytes = convertInlineFileDataToUint8Array(data);\n\t\t\tconst blob = new Blob([fileBytes], { type: mediaType });\n\t\t\tconst formData = new FormData();\n\t\t\tif (xaiOptions?.expiresAfter != null) formData.append(\"expires_after\", String(xaiOptions.expiresAfter));\n\t\t\tif (xaiOptions?.teamId != null) formData.append(\"team_id\", xaiOptions.teamId);\n\t\t\tif (filename != null) formData.append(\"file\", blob, filename);\n\t\t\telse formData.append(\"file\", blob);\n\t\t\t({value: response} = await postFormDataToApi({\n\t\t\t\turl,\n\t\t\t\theaders: requestHeaders,\n\t\t\t\tformData,\n\t\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiFilesResponseSchema),\n\t\t\t\tabortSignal,\n\t\t\t\tfetch: this.config.fetch\n\t\t\t}));\n\t\t}\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tproviderReference: { xai: response.id },\n\t\t\t...response.filename ?? filename ? { filename: response.filename ?? filename } : {},\n\t\t\t...mediaType != null ? { mediaType } : {},\n\t\t\t...response.bytes != null ? { byteSize: response.bytes } : {},\n\t\t\t...response.created_at != null ? { createdAt: /* @__PURE__ */ new Date(response.created_at * 1e3) } : {},\n\t\t\t...response.expires_at != null ? { expiresAt: /* @__PURE__ */ new Date(response.expires_at * 1e3) } : {},\n\t\t\tproviderMetadata: { xai: this.toFileMetadata(response) }\n\t\t};\n\t}\n\tasync getFileMetadata({ file, abortSignal, headers }) {\n\t\tconst fileId = this.getFileId(file);\n\t\tconst { value: response } = await getFromApi({\n\t\t\turl: `${this.config.baseURL}/files/${encodePathSegment(fileId)}`,\n\t\t\theaders: await this.getHeaders(headers),\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiFilesResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch,\n\t\t\tvalidateUrl: false\n\t\t});\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tproviderReference: { xai: response.id },\n\t\t\t...response.filename != null ? { filename: response.filename } : {},\n\t\t\t...response.bytes != null ? { byteSize: response.bytes } : {},\n\t\t\t...response.created_at != null ? { createdAt: /* @__PURE__ */ new Date(response.created_at * 1e3) } : {},\n\t\t\t...response.expires_at != null ? { expiresAt: /* @__PURE__ */ new Date(response.expires_at * 1e3) } : {},\n\t\t\tproviderMetadata: { xai: this.toFileMetadata(response) }\n\t\t};\n\t}\n\tasync downloadFile({ file, abortSignal, headers }) {\n\t\tconst fileId = this.getFileId(file);\n\t\tconst { value: content, responseHeaders } = await getFromApi({\n\t\t\turl: `${this.config.baseURL}/files/${encodePathSegment(fileId)}/content`,\n\t\t\theaders: await this.getHeaders(headers),\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createBinaryStreamResponseHandler(),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch,\n\t\t\tvalidateUrl: false\n\t\t});\n\t\tconst mediaType = responseHeaders?.[\"content-type\"]?.split(\";\")[0].trim();\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tcontent,\n\t\t\t...mediaType ? { mediaType } : {}\n\t\t};\n\t}\n\tasync deleteFile({ file, abortSignal, headers }) {\n\t\tconst fileId = this.getFileId(file);\n\t\tconst { value: response } = await deleteFromApi({\n\t\t\turl: `${this.config.baseURL}/files/${encodePathSegment(fileId)}`,\n\t\t\theaders: await this.getHeaders(headers),\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiFileDeleteResponseSchema),\n\t\t\tabortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\twarnings: [],\n\t\t\tproviderReference: { xai: response.id },\n\t\t\tdeleted: response.deleted\n\t\t};\n\t}\n\ttoFileMetadata(response) {\n\t\treturn {\n\t\t\t...response.filename != null ? { filename: response.filename } : {},\n\t\t\t...response.purpose != null ? { purpose: response.purpose } : {},\n\t\t\t...response.bytes != null ? { bytes: response.bytes } : {},\n\t\t\t...response.created_at != null ? { createdAt: response.created_at } : {},\n\t\t\t...response.status != null ? { status: response.status } : {},\n\t\t\t...response.expires_at != null ? { expiresAt: response.expires_at } : {}\n\t\t};\n\t}\n};\n//#endregion\n//#region src/xai-video-model-options.ts\nconst nonEmptyStringSchema = () => z.string().min(1);\nconst resolutionSchema = () => z.enum([\n\t\"480p\",\n\t\"720p\",\n\t\"1080p\"\n]);\nconst modeSchema = () => z.enum([\n\t\"edit-video\",\n\t\"extend-video\",\n\t\"reference-to-video\"\n]);\nconst keyframeSchema = () => z.object({\n\timageUrl: nonEmptyStringSchema(),\n\ttimestampSeconds: z.number().positive()\n});\nconst storageOptionsSchema = () => z.object({\n\tfilename: nonEmptyStringSchema(),\n\texpiresAfter: z.number().int().positive().max(2592e3).optional(),\n\tpublicUrl: z.union([z.boolean(), z.object({ expiresAfter: z.number().int().min(3600).max(2592e3).optional() })]).optional()\n});\nconst baseFields = () => ({\n\tpollIntervalMs: z.number().positive().nullish(),\n\tpollTimeoutMs: z.number().positive().nullish(),\n\tresolution: resolutionSchema().nullish()\n});\nconst runtimeSchema = () => z.looseObject({\n\tmode: modeSchema().optional(),\n\tvideoUrl: nonEmptyStringSchema().optional(),\n\treferenceImageUrls: z.array(nonEmptyStringSchema()).min(1).max(7).optional(),\n\treferenceVoiceIds: z.array(nonEmptyStringSchema()).max(3).optional(),\n\tkeyframes: z.array(keyframeSchema()).max(4).optional(),\n\tstorageOptions: storageOptionsSchema().optional(),\n\tuser: z.string().optional(),\n\t...baseFields()\n});\nconst xaiVideoModelOptionsSchema = lazySchema(() => zodSchema(runtimeSchema()));\n//#endregion\n//#region src/xai-video-model.ts\nconst RESOLUTION_MAP = {\n\t\"1920x1080\": \"1080p\",\n\t\"1280x720\": \"720p\",\n\t\"854x480\": \"480p\",\n\t\"640x480\": \"480p\"\n};\nfunction getFirstFrameImage(options) {\n\treturn options.frameImages?.find((frame) => frame.frameType === \"first_frame\")?.image;\n}\nfunction getLastFrameImage(options) {\n\treturn options.frameImages?.find((frame) => frame.frameType === \"last_frame\")?.image;\n}\nfunction resolveStartImage(options) {\n\treturn getFirstFrameImage(options) ?? options.image;\n}\nconst isVideoFile = (file) => file.mediaType != null && getTopLevelMediaType(file.mediaType) === \"video\";\nconst isImageReference = (file) => file.mediaType == null || getTopLevelMediaType(file.mediaType) === \"image\";\nconst isAudioReference = (file) => file.mediaType != null && getTopLevelMediaType(file.mediaType) === \"audio\";\nfunction fileToXaiUrl(file) {\n\tif (file.type === \"url\") return file.url;\n\tconst base64Data = typeof file.data === \"string\" ? file.data : convertUint8ArrayToBase64(file.data);\n\treturn `data:${file.mediaType};base64,${base64Data}`;\n}\nfunction resolveReferences(options, xaiOptions, warnings) {\n\tif (options.inputReferences != null && options.inputReferences.length > 0) {\n\t\tconst imageFiles = [];\n\t\tfor (const reference of options.inputReferences) {\n\t\t\tif (isAudioReference(reference)) continue;\n\t\t\tif (!isImageReference(reference)) {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: \"inputReferences\",\n\t\t\t\t\tdetails: \"xAI reference-to-video does not accept video references. The video reference was ignored. Use providerOptions.xai.mode \\\"extend-video\\\" to continue from a video.\"\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\timageFiles.push(reference);\n\t\t}\n\t\treturn imageFiles.length > 0 ? imageFiles.map((reference) => ({ url: fileToXaiUrl(reference) })) : void 0;\n\t}\n\tif (xaiOptions?.referenceImageUrls != null && xaiOptions.referenceImageUrls.length > 0) return xaiOptions.referenceImageUrls.map((url) => ({ url }));\n}\nfunction resolveReferenceAudios(options) {\n\tconst audioReferences = options.inputReferences?.filter(isAudioReference);\n\treturn audioReferences != null && audioReferences.length > 0 ? audioReferences.map((reference) => ({ url: fileToXaiUrl(reference) })) : void 0;\n}\nfunction hasImageInputReference(options) {\n\treturn options.inputReferences?.some(isImageReference) ?? false;\n}\nfunction hasAudioInputReference(options) {\n\treturn options.inputReferences?.some(isAudioReference) ?? false;\n}\nfunction resolveVideoMode(options, xaiOptions) {\n\tif (xaiOptions?.mode != null) return xaiOptions.mode;\n\tif (xaiOptions?.videoUrl != null) return \"edit-video\";\n\tconst hasLegacyReferenceUrls = xaiOptions?.referenceImageUrls != null && xaiOptions.referenceImageUrls.length > 0;\n\tif (hasImageInputReference(options) || hasAudioInputReference(options) || hasLegacyReferenceUrls) return \"reference-to-video\";\n}\nvar XaiVideoModel = class {\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t\tthis.maxVideosPerCall = 1;\n\t}\n\tasync buildRequestBody(options) {\n\t\tconst warnings = [];\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions: options.providerOptions,\n\t\t\tschema: xaiVideoModelOptionsSchema\n\t\t});\n\t\tconst effectiveMode = resolveVideoMode(options, xaiOptions);\n\t\tconst isEdit = effectiveMode === \"edit-video\";\n\t\tconst isExtension = effectiveMode === \"extend-video\";\n\t\tconst hasReferenceImages = effectiveMode === \"reference-to-video\";\n\t\tif (options.fps != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"fps\",\n\t\t\tdetails: \"xAI video models do not support custom FPS.\"\n\t\t});\n\t\tif (options.seed != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"seed\",\n\t\t\tdetails: \"xAI video models do not support seed.\"\n\t\t});\n\t\tif (options.n != null && options.n > 1) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"n\",\n\t\t\tdetails: \"xAI video models do not support generating multiple videos per call. Only 1 video will be generated.\"\n\t\t});\n\t\tif (isEdit && options.duration != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"duration\",\n\t\t\tdetails: \"xAI video editing does not support custom duration.\"\n\t\t});\n\t\tif (isEdit && options.aspectRatio != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"aspectRatio\",\n\t\t\tdetails: \"xAI video editing does not support custom aspect ratio.\"\n\t\t});\n\t\tif (isEdit && (xaiOptions?.resolution != null || options.resolution != null)) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"resolution\",\n\t\t\tdetails: \"xAI video editing does not support custom resolution.\"\n\t\t});\n\t\tif (isExtension && options.aspectRatio != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"aspectRatio\",\n\t\t\tdetails: \"xAI video extension does not support custom aspect ratio.\"\n\t\t});\n\t\tif (isExtension && (xaiOptions?.resolution != null || options.resolution != null)) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"resolution\",\n\t\t\tdetails: \"xAI video extension does not support custom resolution.\"\n\t\t});\n\t\tconst body = {\n\t\t\tmodel: this.modelId,\n\t\t\tprompt: options.prompt\n\t\t};\n\t\tconst allowDuration = !isEdit;\n\t\tconst allowAspectRatio = !isEdit && !isExtension;\n\t\tconst allowResolution = !isEdit && !isExtension;\n\t\tif (allowDuration && options.duration != null) body.duration = options.duration;\n\t\tif (allowAspectRatio && options.aspectRatio != null) body.aspect_ratio = options.aspectRatio;\n\t\tif (allowResolution && xaiOptions?.resolution != null) body.resolution = xaiOptions.resolution;\n\t\telse if (allowResolution && options.resolution != null) {\n\t\t\tconst mapped = RESOLUTION_MAP[options.resolution];\n\t\t\tif (mapped != null) body.resolution = mapped;\n\t\t\telse warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"resolution\",\n\t\t\t\tdetails: `Unrecognized resolution \"${options.resolution}\". Use providerOptions.xai.resolution with \"480p\", \"720p\", or \"1080p\" instead.`\n\t\t\t});\n\t\t}\n\t\tif (options.generateAudio != null && !isEdit && !isExtension) body.generate_audio = options.generateAudio;\n\t\telse if (options.generateAudio != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"generateAudio\",\n\t\t\tdetails: `xAI ${isEdit ? \"video editing\" : \"video extension\"} does not support generateAudio.`\n\t\t});\n\t\tif (xaiOptions?.storageOptions != null) {\n\t\t\tconst { filename, expiresAfter, publicUrl } = xaiOptions.storageOptions;\n\t\t\tbody.storage_options = {\n\t\t\t\tfilename,\n\t\t\t\t...expiresAfter != null ? { expires_after: expiresAfter } : {},\n\t\t\t\t...publicUrl != null ? { public_url: typeof publicUrl === \"boolean\" ? publicUrl : { ...publicUrl.expiresAfter != null ? { expires_after: publicUrl.expiresAfter } : {} } } : {}\n\t\t\t};\n\t\t}\n\t\tif (xaiOptions?.keyframes != null && xaiOptions.keyframes.length > 0) {\n\t\t\tif (this.modelId !== \"grok-imagine-video-1.5\" || isEdit || isExtension) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"keyframes\",\n\t\t\t\tdetails: this.modelId !== \"grok-imagine-video-1.5\" ? \"xAI only supports keyframes with \\\"grok-imagine-video-1.5\\\".\" : `xAI ${isEdit ? \"video editing\" : \"video extension\"} does not support keyframes.`\n\t\t\t});\n\t\t\telse body.keyframes = xaiOptions.keyframes.map((keyframe) => ({\n\t\t\t\timage: { url: keyframe.imageUrl },\n\t\t\t\ttimestamp_s: keyframe.timestampSeconds\n\t\t\t}));\n\t\t}\n\t\tif (isEdit) body.video = { url: xaiOptions.videoUrl };\n\t\tif (isExtension) body.video = { url: xaiOptions.videoUrl };\n\t\tconst startImage = resolveStartImage(options);\n\t\tif (startImage != null) {\n\t\t\tif (isVideoFile(startImage)) {\n\t\t\t\tconst fromFrameImages = getFirstFrameImage(options) != null;\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: fromFrameImages ? \"frameImages\" : \"image\",\n\t\t\t\t\tdetails: \"xAI does not accept a video as a start/frame image. The video was ignored. Use providerOptions.xai.mode \\\"extend-video\\\" to continue from a video instead.\"\n\t\t\t\t});\n\t\t\t} else body.image = { url: fileToXaiUrl(startImage) };\n\t\t}\n\t\tconst lastFrameImage = getLastFrameImage(options);\n\t\tif (lastFrameImage != null) {\n\t\t\tif (this.modelId !== \"grok-imagine-video-1.5\" || isEdit || isExtension || isVideoFile(lastFrameImage)) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"frameImages\",\n\t\t\t\tdetails: this.modelId !== \"grok-imagine-video-1.5\" ? \"xAI only supports last_frame with \\\"grok-imagine-video-1.5\\\". The last frame was ignored.\" : \"xAI only accepts an image last_frame for video generation. The last frame was ignored.\"\n\t\t\t});\n\t\t\telse body.last_frame = { url: fileToXaiUrl(lastFrameImage) };\n\t\t}\n\t\tif (hasReferenceImages) {\n\t\t\tconst referenceImages = resolveReferences(options, xaiOptions, warnings);\n\t\t\tconst referenceAudios = resolveReferenceAudios(options);\n\t\t\tif (referenceImages != null) body.reference_images = referenceImages;\n\t\t\telse if (referenceAudios == null) warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"referenceImages\",\n\t\t\t\tdetails: \"xAI reference-to-video requires at least one image reference. The video will be generated without reference images.\"\n\t\t\t});\n\t\t\tconst referenceVoices = (xaiOptions?.referenceVoiceIds)?.map((voiceId) => ({ voice_id: voiceId }));\n\t\t\tconst referenceAudioInputs = [...referenceAudios ?? [], ...referenceVoices ?? []];\n\t\t\tif (referenceAudioInputs.length > 0) {\n\t\t\t\tif (referenceAudioInputs.length > 3) warnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: \"inputReferences\",\n\t\t\t\t\tdetails: \"xAI reference-to-video supports at most 3 audio references. Only the first 3 were used.\"\n\t\t\t\t});\n\t\t\t\tbody.reference_audios = referenceAudioInputs.slice(0, 3);\n\t\t\t}\n\t\t\tif (body.resolution === \"1080p\") {\n\t\t\t\twarnings.push({\n\t\t\t\t\ttype: \"unsupported\",\n\t\t\t\t\tfeature: \"resolution\",\n\t\t\t\t\tdetails: \"xAI reference-to-video is limited to 720p. The request was downgraded from 1080p to 720p.\"\n\t\t\t\t});\n\t\t\t\tbody.resolution = \"720p\";\n\t\t\t}\n\t\t}\n\t\tif (body.resolution === \"1080p\" && this.modelId === \"grok-imagine-video\") warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"resolution\",\n\t\t\tdetails: \"xAI model \\\"grok-imagine-video\\\" does not support 1080p. Use \\\"grok-imagine-video-1.5\\\" for 1080p, or a lower resolution. The request was sent with 1080p.\"\n\t\t});\n\t\tif (options.inputReferences != null && options.inputReferences.length > 0 && !hasReferenceImages) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"inputReferences\",\n\t\t\tdetails: hasImageInputReference(options) || hasAudioInputReference(options) ? \"xAI only supports inputReferences for reference-to-video generation. The references were ignored.\" : \"xAI reference-to-video requires at least one image or audio reference. The references were ignored.\"\n\t\t});\n\t\tif (xaiOptions?.referenceVoiceIds != null && xaiOptions.referenceVoiceIds.length > 0 && !hasReferenceImages) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"referenceVoiceIds\",\n\t\t\tdetails: \"xAI only supports reference voices for reference-to-video generation. The reference voices were ignored.\"\n\t\t});\n\t\tif (!isExtension && xaiOptions?.user !== void 0) body.user = xaiOptions.user;\n\t\tif (xaiOptions != null) {\n\t\t\tfor (const [key, value] of Object.entries(xaiOptions)) if (![\n\t\t\t\t\"mode\",\n\t\t\t\t\"pollIntervalMs\",\n\t\t\t\t\"pollTimeoutMs\",\n\t\t\t\t\"resolution\",\n\t\t\t\t\"videoUrl\",\n\t\t\t\t\"referenceImageUrls\",\n\t\t\t\t\"referenceVoiceIds\",\n\t\t\t\t\"keyframes\",\n\t\t\t\t\"storageOptions\",\n\t\t\t\t\"user\"\n\t\t\t].includes(key)) body[key] = value;\n\t\t}\n\t\treturn {\n\t\t\tbody,\n\t\t\twarnings,\n\t\t\txaiOptions,\n\t\t\tisEdit,\n\t\t\tisExtension,\n\t\t\thasReferenceImages,\n\t\t\teffectiveMode\n\t\t};\n\t}\n\tasync doStart(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { body, warnings, isEdit, isExtension } = await this.buildRequestBody(options);\n\t\tconst baseURL = this.config.baseURL ?? \"https://api.x.ai/v1\";\n\t\tlet endpoint;\n\t\tif (isEdit) endpoint = `${baseURL}/videos/edits`;\n\t\telse if (isExtension) endpoint = `${baseURL}/videos/extensions`;\n\t\telse endpoint = `${baseURL}/videos/generations`;\n\t\tconst { value: createResponse, responseHeaders } = await postJsonToApi({\n\t\t\turl: endpoint,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tbody,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiCreateVideoResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tconst requestId = createResponse.request_id;\n\t\tif (!requestId) throw new AISDKError({\n\t\t\tname: \"XAI_VIDEO_GENERATION_ERROR\",\n\t\t\tmessage: `No request_id returned from xAI API.`\n\t\t});\n\t\treturn {\n\t\t\toperation: { requestId },\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n\tasync doStatus(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { requestId } = options.operation;\n\t\tconst baseURL = this.config.baseURL ?? \"https://api.x.ai/v1\";\n\t\tconst { value: statusResponse, responseHeaders } = await getFromApi({\n\t\t\turl: `${baseURL}/videos/${encodePathSegment(requestId)}`,\n\t\t\tvalidateUrl: false,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tsuccessfulResponseHandler: xaiVideoStatusResponseHandler,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tif (statusResponse.status === \"expired\") return {\n\t\t\tstatus: \"error\",\n\t\t\terror: \"Video generation request expired.\",\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t\tif (statusResponse.status === \"failed\") {\n\t\t\tconst errorDetails = statusResponse.error?.message ?? statusResponse.error?.code;\n\t\t\treturn {\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror: errorDetails != null ? `Video generation failed: ${errorDetails}` : \"Video generation failed.\",\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\tif (statusResponse.status === \"done\" || statusResponse.status == null && statusResponse.video?.url) {\n\t\t\tconst video = statusResponse.video;\n\t\t\tif (video?.respect_moderation === false) return {\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror: \"Video generation was blocked due to a content policy violation.\",\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst videoUrl = video?.url ?? video?.file_output?.public_url ?? void 0;\n\t\t\tif (!videoUrl) return {\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror: \"Video generation completed but no video URL was returned.\",\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tstatus: \"completed\",\n\t\t\t\tvideos: [{\n\t\t\t\t\ttype: \"url\",\n\t\t\t\t\turl: videoUrl,\n\t\t\t\t\tmediaType: \"video/mp4\"\n\t\t\t\t}],\n\t\t\t\twarnings: [],\n\t\t\t\tresponse: {\n\t\t\t\t\ttimestamp: currentDate,\n\t\t\t\t\tmodelId: this.modelId,\n\t\t\t\t\theaders: responseHeaders\n\t\t\t\t},\n\t\t\t\tproviderMetadata: { xai: {\n\t\t\t\t\trequestId,\n\t\t\t\t\tvideoUrl,\n\t\t\t\t\t...video?.duration != null ? { duration: video.duration } : {},\n\t\t\t\t\t...statusResponse.usage?.cost_in_usd_ticks != null ? { costInUsdTicks: statusResponse.usage.cost_in_usd_ticks } : {},\n\t\t\t\t\t...statusResponse.progress != null ? { progress: statusResponse.progress } : {},\n\t\t\t\t\t...video?.file_output != null ? { fileOutput: {\n\t\t\t\t\t\tfileId: video.file_output.file_id,\n\t\t\t\t\t\tfilename: video.file_output.filename,\n\t\t\t\t\t\t...video.file_output.expires_at != null ? { expiresAt: video.file_output.expires_at } : {},\n\t\t\t\t\t\t...video.file_output.public_url != null ? { publicUrl: video.file_output.public_url } : {},\n\t\t\t\t\t\t...video.file_output.public_url_error != null ? { publicUrlError: video.file_output.public_url_error } : {},\n\t\t\t\t\t\t...video.file_output.public_url_expires_at != null ? { publicUrlExpiresAt: video.file_output.public_url_expires_at } : {}\n\t\t\t\t\t} } : {},\n\t\t\t\t\t...video?.storage_error != null ? { storageError: video.storage_error } : {}\n\t\t\t\t} }\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tstatus: \"pending\",\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders\n\t\t\t}\n\t\t};\n\t}\n};\nconst xaiCreateVideoResponseSchema = lazySchema(() => zodSchema(z.object({ request_id: z.string().nullish() })));\nconst xaiVideoStatusResponseSchema = lazySchema(() => zodSchema(z.object({\n\tstatus: z.string().nullish(),\n\tvideo: z.object({\n\t\turl: z.string().nullish(),\n\t\tduration: z.number().nullish(),\n\t\trespect_moderation: z.boolean().nullish(),\n\t\tfile_output: z.object({\n\t\t\tfile_id: z.string(),\n\t\t\tfilename: z.string(),\n\t\t\texpires_at: z.number().nullish(),\n\t\t\tpublic_url: z.string().nullish(),\n\t\t\tpublic_url_error: z.string().nullish(),\n\t\t\tpublic_url_expires_at: z.number().nullish()\n\t\t}).nullish(),\n\t\tstorage_error: z.string().nullish()\n\t}).nullish(),\n\tmodel: z.string().nullish(),\n\tusage: z.object({ cost_in_usd_ticks: z.number().nullish() }).nullish(),\n\tprogress: z.number().nullish(),\n\terror: z.object({\n\t\tcode: z.string().nullish(),\n\t\tmessage: z.string().nullish()\n\t}).nullish()\n})));\nconst xaiVideoStatusJsonResponseHandler = createJsonResponseHandler(xaiVideoStatusResponseSchema);\nconst MAX_PENDING_BODY_BYTES = 1048576;\nconst textDecoder = new TextDecoder();\nasync function readPendingBody({ response, url, requestBodyValues }) {\n\tif (response.body == null) return \"\";\n\tconst reader = response.body.getReader();\n\tconst chunks = [];\n\tlet totalBytes = 0;\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = await reader.read();\n\t\t\tif (done) break;\n\t\t\ttotalBytes += value.length;\n\t\t\tif (totalBytes > MAX_PENDING_BODY_BYTES) throw new APICallError({\n\t\t\t\tmessage: `xAI video status response exceeded ${MAX_PENDING_BODY_BYTES} bytes`,\n\t\t\t\turl,\n\t\t\t\trequestBodyValues,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\tresponseHeaders: extractResponseHeaders(response)\n\t\t\t});\n\t\t\tchunks.push(value);\n\t\t}\n\t} finally {\n\t\treader.releaseLock();\n\t}\n\tconst merged = new Uint8Array(totalBytes);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tmerged.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn textDecoder.decode(merged);\n}\nconst xaiVideoStatusResponseHandler = async (options) => {\n\tif (options.response.status === 202) {\n\t\tconst responseHeaders = extractResponseHeaders(options.response);\n\t\tconst text = await readPendingBody(options);\n\t\tif (text.trim().length === 0) return {\n\t\t\tresponseHeaders,\n\t\t\tvalue: { status: \"pending\" }\n\t\t};\n\t\tconst parsed = await safeParseJSON({\n\t\t\ttext,\n\t\t\tschema: xaiVideoStatusResponseSchema\n\t\t});\n\t\treturn {\n\t\t\tresponseHeaders,\n\t\t\tvalue: parsed.success ? parsed.value : { status: \"pending\" }\n\t\t};\n\t}\n\treturn xaiVideoStatusJsonResponseHandler(options);\n};\n//#endregion\n//#region src/xai-speech-model-options.ts\nconst xaiSpeechModelOptionsSchema = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Sample rate of the generated audio in Hz.\n\t*/\n\tsampleRate: z.union([\n\t\tz.literal(8e3),\n\t\tz.literal(16e3),\n\t\tz.literal(22050),\n\t\tz.literal(24e3),\n\t\tz.literal(44100),\n\t\tz.literal(48e3)\n\t]).nullish(),\n\t/**\n\t* MP3 bit rate in bits per second. Only applies when outputFormat is mp3.\n\t*/\n\tbitRate: z.union([\n\t\tz.literal(32e3),\n\t\tz.literal(64e3),\n\t\tz.literal(96e3),\n\t\tz.literal(128e3),\n\t\tz.literal(192e3)\n\t]).nullish(),\n\t/**\n\t* Reduce time to first audio chunk, trading some quality for latency.\n\t*/\n\toptimizeStreamingLatency: z.union([\n\t\tz.literal(0),\n\t\tz.literal(1),\n\t\tz.literal(2)\n\t]).nullish(),\n\t/**\n\t* Normalize written-form text into spoken-form text before synthesis.\n\t*/\n\ttextNormalization: z.boolean().nullish(),\n\t/**\n\t* Return character-level timing metadata alongside the audio. When\n\t* enabled, the response carries per-character start/end times and the\n\t* total duration, exposed via `providerMetadata.xai`.\n\t*/\n\twithTimestamps: z.boolean().nullish(),\n\t/**\n\t* Map of phrases to spoken substitutions applied before synthesis.\n\t* Values may be respellings (`{ 'Acme Mobile': 'Acme Mobull' }`) or IPA\n\t* phonetics (`{ nginx: '/ˈɛndʒɪn ˈɛks/' }`).\n\t*/\n\treplace: z.record(z.string(), z.string()).nullish()\n})));\n//#endregion\n//#region src/xai-speech-model.ts\nconst speechDefaults = getXaiSpeechModelEntry().requestConfig.speech;\nvar XaiSpeechModel = class XaiSpeechModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new XaiSpeechModel(options.modelId, options.config);\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t}\n\tasync getArgs({ text, voice = speechDefaults.voice, outputFormat = speechDefaults.outputFormat, instructions, speed, language = speechDefaults.language, providerOptions }) {\n\t\tconst warnings = [];\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions,\n\t\t\tschema: xaiSpeechModelOptionsSchema\n\t\t});\n\t\tconst { speech } = getXaiSpeechModelEntry().capabilities;\n\t\tlet codec = speechDefaults.outputFormat;\n\t\tif (speech.outputFormats.includes(outputFormat)) codec = outputFormat;\n\t\telse warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"outputFormat\",\n\t\t\tdetails: `Unsupported output format: ${outputFormat}. Using mp3 instead.`\n\t\t});\n\t\tif (speech.instructions === false && instructions != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"instructions\",\n\t\t\tdetails: \"xAI speech models do not support the `instructions` option. Use xAI speech tags in `text` to control delivery.\"\n\t\t});\n\t\tconst output_format = { codec };\n\t\tif (xaiOptions?.sampleRate != null) output_format.sample_rate = xaiOptions.sampleRate;\n\t\tif (xaiOptions?.bitRate != null) {\n\t\t\tif (codec === \"mp3\") output_format.bit_rate = xaiOptions.bitRate;\n\t\t\telse warnings.push({\n\t\t\t\ttype: \"unsupported\",\n\t\t\t\tfeature: \"providerOptions\",\n\t\t\t\tdetails: \"xAI `bitRate` is supported only for mp3 output. It was ignored.\"\n\t\t\t});\n\t\t}\n\t\treturn {\n\t\t\trequestBody: {\n\t\t\t\ttext,\n\t\t\t\tvoice_id: voice,\n\t\t\t\tlanguage,\n\t\t\t\toutput_format,\n\t\t\t\tspeed,\n\t\t\t\toptimize_streaming_latency: xaiOptions?.optimizeStreamingLatency,\n\t\t\t\ttext_normalization: xaiOptions?.textNormalization,\n\t\t\t\twith_timestamps: xaiOptions?.withTimestamps,\n\t\t\t\treplace: xaiOptions?.replace\n\t\t\t},\n\t\t\twarnings,\n\t\t\twithTimestamps: xaiOptions?.withTimestamps === true\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { requestBody, warnings, withTimestamps } = await this.getArgs(options);\n\t\tconst { value, responseHeaders, rawValue } = await postJsonToApi({\n\t\t\turl: `${this.config.baseURL}/tts`,\n\t\t\theaders: combineHeaders(this.config.headers ? await resolve(this.config.headers) : void 0, options.headers),\n\t\t\tbody: requestBody,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: withTimestamps ? createJsonResponseHandler(xaiSpeechTimestampsResponseSchema) : createBinaryResponseHandler(),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\tlet audio;\n\t\tlet envelope;\n\t\tif (value instanceof Uint8Array) audio = value;\n\t\telse {\n\t\t\tenvelope = value;\n\t\t\taudio = envelope.audio != null ? convertBase64ToUint8Array(envelope.audio) : /* @__PURE__ */ new Uint8Array(0);\n\t\t}\n\t\tconst traceId = responseHeaders?.[\"x-trace-id\"];\n\t\treturn {\n\t\t\taudio,\n\t\t\twarnings,\n\t\t\trequest: { body: JSON.stringify(requestBody) },\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawValue\n\t\t\t},\n\t\t\tproviderMetadata: { xai: {\n\t\t\t\t...traceId != null ? { traceId } : {},\n\t\t\t\t...envelope?.duration != null ? { duration: envelope.duration } : {},\n\t\t\t\t...envelope?.content_type != null ? { contentType: envelope.content_type } : {},\n\t\t\t\t...envelope?.audio_timestamps != null ? { audioTimestamps: {\n\t\t\t\t\tgraphChars: envelope.audio_timestamps.graph_chars,\n\t\t\t\t\tgraphTimes: envelope.audio_timestamps.graph_times\n\t\t\t\t} } : {}\n\t\t\t} }\n\t\t};\n\t}\n};\nconst xaiSpeechTimestampsResponseSchema = lazySchema(() => zodSchema(z.object({\n\taudio: z.string().nullish(),\n\tcontent_type: z.string().nullish(),\n\tduration: z.number().nullish(),\n\taudio_timestamps: z.object({\n\t\tgraph_chars: z.array(z.string()),\n\t\tgraph_times: z.array(z.tuple([z.number(), z.number()]))\n\t}).nullish()\n})));\n//#endregion\n//#region src/xai-transcription-model-options.ts\nconst xaiTranscriptionModelOptionsSchema = lazySchema(() => zodSchema(z.object({\n\t/**\n\t* Input audio encoding for raw, headerless audio: `pcm`, `mulaw`, or\n\t* `alaw`. Container formats such as Ogg/Opus are auto-detected, so do\n\t* not set this for them. `opus` is for streaming only, with one raw Opus\n\t* packet per chunk.\n\t*/\n\taudioFormat: z.enum([\n\t\t\"pcm\",\n\t\t\"mulaw\",\n\t\t\"alaw\",\n\t\t\"opus\"\n\t]).nullish(),\n\t/**\n\t* Sample rate of the input audio in Hz.\n\t*/\n\tsampleRate: z.union([\n\t\tz.literal(8e3),\n\t\tz.literal(16e3),\n\t\tz.literal(22050),\n\t\tz.literal(24e3),\n\t\tz.literal(44100),\n\t\tz.literal(48e3)\n\t]).nullish(),\n\t/**\n\t* Language code used for inverse text normalization.\n\t*/\n\tlanguage: z.string().nullish(),\n\t/**\n\t* Enable inverse text normalization. Requires `language`.\n\t*/\n\tformat: z.boolean().nullish(),\n\t/**\n\t* Enable per-channel transcription for multichannel audio.\n\t*/\n\tmultichannel: z.boolean().nullish(),\n\t/**\n\t* Number of interleaved audio channels.\n\t*/\n\tchannels: z.number().int().min(2).max(8).nullish(),\n\t/**\n\t* Enable speaker diarization.\n\t*/\n\tdiarize: z.boolean().nullish(),\n\t/**\n\t* Terms to bias transcription toward.\n\t*/\n\tkeyterm: z.union([z.string(), z.array(z.string())]).nullish(),\n\t/**\n\t* Include filler words such as \"uh\" and \"um\" in the transcript.\n\t*/\n\tfillerWords: z.boolean().nullish(),\n\t/**\n\t* Voice activity detection threshold between 0 and 1. Defaults to 0.5\n\t* for `transcribe` and 0.08 for streaming. 0 disables the filter.\n\t*/\n\tvadThreshold: z.number().min(0).max(1).optional(),\n\t/**\n\t* Options for streaming speech-to-text over WebSocket.\n\t*/\n\tstreaming: z.object({\n\t\t/**\n\t\t* Emit interim transcript results while speech is being processed.\n\t\t*/\n\t\tinterimResults: z.boolean().optional(),\n\t\t/**\n\t\t* Silence duration in milliseconds before an utterance-final event.\n\t\t*/\n\t\tendpointing: z.number().int().min(0).max(5e3).optional(),\n\t\t/**\n\t\t* End-of-turn detection threshold. When set, enables Smart Turn.\n\t\t*/\n\t\tsmartTurn: z.number().min(0).max(1).optional(),\n\t\t/**\n\t\t* Maximum silence duration in milliseconds before forcing speech_final.\n\t\t*/\n\t\tsmartTurnTimeout: z.number().int().min(1).max(5e3).optional()\n\t}).optional()\n})));\n//#endregion\n//#region src/xai-transcription-model.ts\nvar XaiTranscriptionModel = class XaiTranscriptionModel {\n\tstatic [WORKFLOW_SERIALIZE](model) {\n\t\treturn serializeModelOptions({\n\t\t\tmodelId: model.modelId,\n\t\t\tconfig: model.config\n\t\t});\n\t}\n\tstatic [WORKFLOW_DESERIALIZE](options) {\n\t\treturn new XaiTranscriptionModel(options.modelId, options.config);\n\t}\n\tget provider() {\n\t\treturn this.config.provider;\n\t}\n\tconstructor(modelId, config) {\n\t\tthis.modelId = modelId;\n\t\tthis.config = config;\n\t\tthis.specificationVersion = \"v4\";\n\t}\n\tasync getArgs({ audio, mediaType, providerOptions }) {\n\t\tconst warnings = [];\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions,\n\t\t\tschema: xaiTranscriptionModelOptionsSchema\n\t\t});\n\t\tconst formData = new FormData();\n\t\tappendXaiSttParams(formData, {\n\t\t\t...getXaiSttParams(this.modelId, xaiOptions),\n\t\t\taudio_format: xaiOptions?.audioFormat,\n\t\t\tformat: xaiOptions?.format\n\t\t});\n\t\tconst blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array(audio)]);\n\t\tconst fileExtension = mediaTypeToExtension(mediaType);\n\t\tformData.append(\"file\", new File([blob], \"audio\", { type: mediaType }), `audio.${fileExtension}`);\n\t\treturn {\n\t\t\tformData,\n\t\t\twarnings\n\t\t};\n\t}\n\tasync doGenerate(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst { formData, warnings } = await this.getArgs(options);\n\t\tconst { value: response, responseHeaders, rawValue: rawResponse } = await postFormDataToApi({\n\t\t\turl: `${this.config.baseURL ?? \"https://api.x.ai/v1\"}/stt`,\n\t\t\theaders: combineHeaders(await resolve(this.config.headers), options.headers),\n\t\t\tformData,\n\t\t\tfailedResponseHandler: xaiFailedResponseHandler,\n\t\t\tsuccessfulResponseHandler: createJsonResponseHandler(xaiTranscriptionResponseSchema),\n\t\t\tabortSignal: options.abortSignal,\n\t\t\tfetch: this.config.fetch\n\t\t});\n\t\treturn {\n\t\t\ttext: response.text,\n\t\t\tsegments: response.words?.map((word) => ({\n\t\t\t\ttext: word.text,\n\t\t\t\tstartSecond: word.start,\n\t\t\t\tendSecond: word.end\n\t\t\t})) ?? [],\n\t\t\tlanguage: response.language || void 0,\n\t\t\tdurationInSeconds: response.duration ?? void 0,\n\t\t\twarnings,\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId,\n\t\t\t\theaders: responseHeaders,\n\t\t\t\tbody: rawResponse\n\t\t\t},\n\t\t\t...response.words?.some((word) => word.speaker != null) && { providerMetadata: { xai: { words: response.words } } }\n\t\t};\n\t}\n\tasync doStream(options) {\n\t\tconst currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();\n\t\tconst warnings = [];\n\t\tconst xaiOptions = await parseProviderOptions({\n\t\t\tprovider: \"xai\",\n\t\t\tproviderOptions: options.providerOptions,\n\t\t\tschema: xaiTranscriptionModelOptionsSchema\n\t\t});\n\t\tif (xaiOptions?.multichannel === true && xaiOptions.channels == null) throw new InvalidArgumentError({\n\t\t\targument: \"providerOptions\",\n\t\t\tmessage: \"providerOptions.xai.channels is required when providerOptions.xai.multichannel is true\"\n\t\t});\n\t\tif (xaiOptions?.format != null) warnings.push({\n\t\t\ttype: \"unsupported\",\n\t\t\tfeature: \"providerOptions.xai.format\",\n\t\t\tdetails: \"xAI streaming transcription does not support format.\"\n\t\t});\n\t\tif (xaiOptions?.audioFormat == null && !inputAudioFormatEncodings.has(options.inputAudioFormat.type)) warnings.push({\n\t\t\ttype: \"other\",\n\t\t\tmessage: `Unrecognized inputAudioFormat.type \"${options.inputAudioFormat.type}\"; falling back to raw PCM encoding. Use ${[...inputAudioFormatEncodings.keys()].join(\", \")}, or set providerOptions.xai.audioFormat explicitly.`\n\t\t});\n\t\tconst url = buildXaiStreamingTranscriptionUrl({\n\t\t\tbaseURL: this.config.baseURL ?? \"https://api.x.ai/v1\",\n\t\t\tmodelId: this.modelId,\n\t\t\tinputAudioFormat: options.inputAudioFormat,\n\t\t\tproviderOptions: xaiOptions\n\t\t});\n\t\tconst headers = combineHeaders(await resolve(this.config.headers), options.headers);\n\t\treturn {\n\t\t\trequest: { body: url.toString() },\n\t\t\tresponse: {\n\t\t\t\ttimestamp: currentDate,\n\t\t\t\tmodelId: this.modelId\n\t\t\t},\n\t\t\tstream: createXaiStreamingTranscriptionStream({\n\t\t\t\twebSocket: this.config.webSocket,\n\t\t\t\turl,\n\t\t\t\theaders,\n\t\t\t\twarnings,\n\t\t\t\tlanguage: xaiOptions?.language ?? void 0,\n\t\t\t\texpectedDoneCount: xaiOptions?.multichannel === true ? xaiOptions.channels : 1,\n\t\t\t\taudio: options.audio,\n\t\t\t\tabortSignal: options.abortSignal,\n\t\t\t\tincludeRawChunks: options.includeRawChunks\n\t\t\t})\n\t\t};\n\t}\n};\nfunction createXaiStreamingTranscriptionStream({ webSocket, url, headers, warnings, language, expectedDoneCount, audio, abortSignal, includeRawChunks }) {\n\tlet finished = false;\n\tlet cleanup = () => {};\n\treturn new ReadableStream({\n\t\tstart: (controller) => {\n\t\t\tconst doneTexts = /* @__PURE__ */ new Map();\n\t\t\tconst finalizedTexts = /* @__PURE__ */ new Map();\n\t\t\tconst pendingTexts = /* @__PURE__ */ new Map();\n\t\t\tlet doneDuration;\n\t\t\tlet audioReader;\n\t\t\tlet connection;\n\t\t\tcleanup = (closeCode) => {\n\t\t\t\tif (audioReader != null) audioReader.cancel().catch(() => {});\n\t\t\t\telse audio.cancel().catch(() => {});\n\t\t\t\tconnection?.close(closeCode);\n\t\t\t};\n\t\t\tconst finishWithError = (error) => {\n\t\t\t\tif (finished) return;\n\t\t\t\tfinished = true;\n\t\t\t\tcleanup();\n\t\t\t\tcontroller.error(error);\n\t\t\t};\n\t\t\tconst maybeFinish = () => {\n\t\t\t\tif (finished || doneTexts.size < expectedDoneCount) return;\n\t\t\t\tfinished = true;\n\t\t\t\tconst text = [...doneTexts.entries()].sort(([a], [b]) => a - b).map(([, value]) => value).join(\"\\n\");\n\t\t\t\tcontroller.enqueue({\n\t\t\t\t\ttype: \"finish\",\n\t\t\t\t\ttext,\n\t\t\t\t\tsegments: [],\n\t\t\t\t\tlanguage,\n\t\t\t\t\tdurationInSeconds: doneDuration\n\t\t\t\t});\n\t\t\t\tcontroller.close();\n\t\t\t\tcleanup(1e3);\n\t\t\t};\n\t\t\tconst sendAudio = async (socket) => {\n\t\t\t\taudioReader = audio.getReader();\n\t\t\t\ttry {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst { done, value } = await audioReader.read();\n\t\t\t\t\t\tif (done || finished) break;\n\t\t\t\t\t\tsocket.send(value instanceof Uint8Array ? value : convertBase64ToUint8Array(value));\n\t\t\t\t\t\tawait waitForWebSocketBufferDrain(socket);\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\taudioReader.releaseLock();\n\t\t\t\t\taudioReader = void 0;\n\t\t\t\t}\n\t\t\t\tif (!finished) socket.send(JSON.stringify({ type: \"audio.done\" }));\n\t\t\t};\n\t\t\tconnection = connectToWebSocket({\n\t\t\t\turl,\n\t\t\t\theaders,\n\t\t\t\twebSocket,\n\t\t\t\tabortSignal,\n\t\t\t\tonAbort: finishWithError,\n\t\t\t\tonProcessingError: finishWithError,\n\t\t\t\tonMessageText: async (text) => {\n\t\t\t\t\tconst parsed = await safeParseJSON({ text });\n\t\t\t\t\tif (!parsed.success) return;\n\t\t\t\t\tconst raw = parsed.value;\n\t\t\t\t\tif (includeRawChunks) controller.enqueue({\n\t\t\t\t\t\ttype: \"raw\",\n\t\t\t\t\t\trawValue: raw\n\t\t\t\t\t});\n\t\t\t\t\tswitch (raw.type) {\n\t\t\t\t\t\tcase \"transcript.created\": {\n\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\ttype: \"stream-start\",\n\t\t\t\t\t\t\t\twarnings\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tconst socket = connection?.socket;\n\t\t\t\t\t\t\tif (socket == null) {\n\t\t\t\t\t\t\t\tfinishWithError(/* @__PURE__ */ new Error(\"WebSocket is not connected.\"));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsendAudio(socket).catch(finishWithError);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"transcript.partial\": {\n\t\t\t\t\t\t\tconst id = channelId(raw.channel_index);\n\t\t\t\t\t\t\tconst channelIndex = raw.channel_index ?? 0;\n\t\t\t\t\t\t\tif (raw.is_final && raw.speech_final) {\n\t\t\t\t\t\t\t\tconst timing = timingFromXaiEvent(raw);\n\t\t\t\t\t\t\t\tif (raw.text) finalizedTexts.set(channelIndex, [...finalizedTexts.get(channelIndex) ?? [], raw.text]);\n\t\t\t\t\t\t\t\tpendingTexts.delete(channelIndex);\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"transcript-final\",\n\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\ttext: raw.text ?? \"\",\n\t\t\t\t\t\t\t\t\t...timing,\n\t\t\t\t\t\t\t\t\tchannelIndex: raw.channel_index\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpendingTexts.set(channelIndex, raw.text ?? \"\");\n\t\t\t\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\t\t\t\ttype: \"transcript-partial\",\n\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\ttext: raw.text ?? \"\",\n\t\t\t\t\t\t\t\t\tstartSecond: raw.start,\n\t\t\t\t\t\t\t\t\tdurationInSeconds: raw.duration,\n\t\t\t\t\t\t\t\t\tchannelIndex: raw.channel_index\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"transcript.done\": {\n\t\t\t\t\t\t\tconst channelIndex = raw.channel_index ?? 0;\n\t\t\t\t\t\t\tconst accumulated = [...finalizedTexts.get(channelIndex) ?? [], ...pendingTexts.get(channelIndex) ? [pendingTexts.get(channelIndex)] : []].join(\" \");\n\t\t\t\t\t\t\tdoneTexts.set(channelIndex, raw.text || accumulated);\n\t\t\t\t\t\t\tdoneDuration = raw.duration ?? doneDuration;\n\t\t\t\t\t\t\tmaybeFinish();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase \"error\": finishWithError(new Error(raw.message ?? \"xAI STT error\"));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonSocketError: () => {\n\t\t\t\t\tfinishWithError(/* @__PURE__ */ new Error(\"xAI streaming transcription error.\" + (webSocket == null ? \" Note: the native WebSocket implementation in browsers, Node.js, Deno, and Bun cannot send the Authorization header required by xAI. Pass a header-capable WebSocket implementation (e.g. the 'ws' package) via createXai({ webSocket }).\" : \"\")));\n\t\t\t\t},\n\t\t\t\tonClose: () => {\n\t\t\t\t\tif (finished) return;\n\t\t\t\t\tfinished = true;\n\t\t\t\t\tcleanup();\n\t\t\t\t\tcontroller.close();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tcancel: () => {\n\t\t\tif (finished) return;\n\t\t\tfinished = true;\n\t\t\tcleanup();\n\t\t}\n\t});\n}\nfunction buildXaiStreamingTranscriptionUrl({ baseURL, modelId, inputAudioFormat, providerOptions }) {\n\tconst url = toWebSocketUrl(`${baseURL}/stt`);\n\tconst params = getXaiSttParams(modelId, providerOptions);\n\tappendXaiSttParams(url.searchParams, {\n\t\t...params,\n\t\tsample_rate: params.sample_rate ?? inputAudioFormat.rate,\n\t\tencoding: providerOptions?.audioFormat ?? inputAudioFormatEncodings.get(inputAudioFormat.type) ?? \"pcm\",\n\t\tinterim_results: providerOptions?.streaming?.interimResults,\n\t\tendpointing: providerOptions?.streaming?.endpointing,\n\t\tsmart_turn: providerOptions?.streaming?.smartTurn,\n\t\tsmart_turn_timeout: providerOptions?.streaming?.smartTurnTimeout\n\t});\n\treturn url;\n}\nfunction getXaiSttParams(modelId, options) {\n\treturn {\n\t\tmodel: getXaiTranscriptionModelEntry(modelId).requestConfig.transcription.model,\n\t\tsample_rate: options?.sampleRate,\n\t\tlanguage: options?.language,\n\t\tmultichannel: options?.multichannel,\n\t\tchannels: options?.channels,\n\t\tdiarize: options?.diarize,\n\t\tfiller_words: options?.fillerWords,\n\t\tvad_threshold: options?.vadThreshold,\n\t\tkeyterm: options?.keyterm\n\t};\n}\nfunction appendXaiSttParams(target, params) {\n\tfor (const [key, value] of Object.entries(params)) for (const item of Array.isArray(value) ? value : [value]) if (item != null) target.append(key, String(item));\n}\nconst inputAudioFormatEncodings = /* @__PURE__ */ new Map([\n\t[\"audio/pcm\", \"pcm\"],\n\t[\"audio/pcmu\", \"mulaw\"],\n\t[\"audio/pcma\", \"alaw\"],\n\t[\"audio/opus\", \"opus\"]\n]);\nfunction channelId(channelIndex) {\n\treturn channelIndex == null ? void 0 : `channel-${channelIndex}`;\n}\nfunction timingFromXaiEvent(event) {\n\treturn {\n\t\t...event.start != null ? { startSecond: event.start } : {},\n\t\t...event.start != null && event.duration != null ? { endSecond: event.start + event.duration } : {}\n\t};\n}\nconst xaiTranscriptionResponseSchema = lazySchema(() => zodSchema(z.object({\n\ttext: z.string(),\n\tlanguage: z.string().nullish(),\n\tduration: z.number().nullish(),\n\twords: z.array(z.object({\n\t\ttext: z.string(),\n\t\tstart: z.number(),\n\t\tend: z.number(),\n\t\tspeaker: z.number().nullish()\n\t})).nullish()\n})));\n//#endregion\n//#region src/xai-provider.ts\nfunction createXai(options = {}) {\n\tconst baseURL = withoutTrailingSlash(options.baseURL ?? \"https://api.x.ai/v1\");\n\tconst getHeaders = () => resolveWith(options.apiKey, (apiKey) => withUserAgentSuffix({\n\t\tAuthorization: `Bearer ${loadApiKey({\n\t\t\tapiKey,\n\t\t\tenvironmentVariableName: \"XAI_API_KEY\",\n\t\t\tdescription: \"xAI API key\"\n\t\t})}`,\n\t\t...options.headers\n\t}, `ai-sdk-xai/${VERSION}`));\n\tconst createResponsesLanguageModel = (modelId) => {\n\t\treturn new XaiResponsesLanguageModel(modelId, {\n\t\t\tprovider: \"xai.responses\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tgenerateId,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst createImageModel = (modelId) => {\n\t\treturn new XaiImageModel(modelId, {\n\t\t\tprovider: \"xai.image\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst createVideoModel = (modelId) => {\n\t\treturn new XaiVideoModel(modelId, {\n\t\t\tprovider: \"xai.video\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst createRealtimeModel = (modelId) => {\n\t\treturn new XaiRealtimeModel(modelId, {\n\t\t\tprovider: \"xai.realtime\",\n\t\t\tbaseURL: baseURL ?? \"https://api.x.ai/v1\",\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst createSpeechModel = () => {\n\t\treturn new XaiSpeechModel(\"\", {\n\t\t\tprovider: \"xai.speech\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch\n\t\t});\n\t};\n\tconst createTranscriptionModel = (modelId = \"\") => {\n\t\treturn new XaiTranscriptionModel(modelId, {\n\t\t\tprovider: \"xai.transcription\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tfetch: options.fetch,\n\t\t\twebSocket: options.webSocket\n\t\t});\n\t};\n\tconst experimentalRealtimeFactory = Object.assign((modelId) => createRealtimeModel(modelId), { getToken: async (tokenOptions) => {\n\t\tconst secret = await createRealtimeModel(tokenOptions.model).doCreateClientSecret({\n\t\t\tsessionConfig: tokenOptions.sessionConfig,\n\t\t\texpiresAfterSeconds: tokenOptions.expiresAfterSeconds\n\t\t});\n\t\treturn {\n\t\t\ttoken: secret.token,\n\t\t\turl: secret.url,\n\t\t\texpiresAt: secret.expiresAt\n\t\t};\n\t} });\n\tconst createFiles = () => new XaiFiles({\n\t\tprovider: \"xai.files\",\n\t\tbaseURL,\n\t\theaders: getHeaders,\n\t\tfetch: options.fetch\n\t});\n\tconst createBatch = () => new XaiBatch({\n\t\tprovider: \"xai.batch\",\n\t\tconfig: {\n\t\t\tprovider: \"xai.responses\",\n\t\t\tbaseURL,\n\t\t\theaders: getHeaders,\n\t\t\tgenerateId,\n\t\t\tfetch: options.fetch\n\t\t}\n\t});\n\tconst provider = (modelId) => createResponsesLanguageModel(modelId);\n\tprovider.specificationVersion = \"v4\";\n\tprovider.languageModel = createResponsesLanguageModel;\n\tprovider.responses = createResponsesLanguageModel;\n\tprovider.embeddingModel = (modelId) => {\n\t\tthrow new NoSuchModelError({\n\t\t\tmodelId,\n\t\t\tmodelType: \"embeddingModel\"\n\t\t});\n\t};\n\tprovider.textEmbeddingModel = provider.embeddingModel;\n\tprovider.imageModel = createImageModel;\n\tprovider.image = createImageModel;\n\tprovider.videoModel = createVideoModel;\n\tprovider.video = createVideoModel;\n\tprovider.experimental_realtime = experimentalRealtimeFactory;\n\tprovider.speechModel = createSpeechModel;\n\tprovider.speech = createSpeechModel;\n\tprovider.transcriptionModel = createTranscriptionModel;\n\tprovider.transcription = createTranscriptionModel;\n\tprovider.files = createFiles;\n\tprovider.experimental_batch = createBatch;\n\tprovider.tools = xaiTools;\n\treturn provider;\n}\nconst xai = createXai();\n//#endregion\nexport { XaiRealtimeModel as Experimental_XaiRealtimeModel, VERSION, codeExecution, createXai, imageGeneration, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };\n\n//# sourceMappingURL=index.js.map","export type ResolvedModelConfig = {\n  url: string | false;\n  headers: Record<string, string>;\n  resolvedModelId: string;\n  fullModelId: string;\n};\n\nexport function parseModelRouterId(routerId: string, gatewayPrefix?: string): { providerId: string; modelId: string } {\n  if (gatewayPrefix && !routerId.startsWith(`${gatewayPrefix}/`)) {\n    throw new Error(`Expected ${gatewayPrefix}/ in model router ID ${routerId}`);\n  }\n\n  const idParts = routerId.split('/');\n\n  // Azure OpenAI uses 2-part format (azure-openai/deployment), others use 3-part (gateway/provider/model)\n  if (gatewayPrefix === 'azure-openai') {\n    const modelId = idParts.slice(1).join('/');\n    if (!modelId) {\n      throw new Error(`Expected format azure-openai/deployment-name, but got ${routerId}`);\n    }\n    return {\n      providerId: 'azure-openai',\n      modelId, // Deployment name\n    };\n  }\n\n  // Provider-equals-gateway: a gateway whose provider id is the same as its\n  // gateway id (e.g. amazon-bedrock) uses a 2-part router id (gateway/model),\n  // because there is no separate provider segment to namespace. Catalog ids\n  // for such gateways are always two parts (model ids contain no slashes).\n  if (gatewayPrefix && idParts.length === 2 && idParts[0] === gatewayPrefix) {\n    const modelId = idParts[1];\n    if (!modelId) {\n      throw new Error(`Expected format ${gatewayPrefix}/model, but got ${routerId}`);\n    }\n    return {\n      providerId: gatewayPrefix,\n      modelId,\n    };\n  }\n\n  // Standard 3-part format for other prefixed gateways (Netlify, etc.)\n  if (gatewayPrefix && idParts.length < 3) {\n    throw new Error(\n      `Expected atleast 3 id parts ${gatewayPrefix}/provider/model, but only saw ${idParts.length} in ${routerId}`,\n    );\n  }\n\n  const providerId = idParts.at(gatewayPrefix ? 1 : 0);\n  const modelId = idParts.slice(gatewayPrefix ? 2 : 1).join(`/`);\n\n  if (!routerId.includes(`/`) || !providerId || !modelId) {\n    throw new Error(\n      `Attempted to parse provider/model from ${routerId} but this ID doesn't appear to contain a provider`,\n    );\n  }\n\n  return {\n    providerId,\n    modelId,\n  };\n}\n","export function interpolateUrlTemplate(url: string, envVars?: typeof process.env): string {\n  return url.replace(/\\$\\{([^}]+)\\}/g, (_match, envVarName: string) => {\n    const key = envVarName.trim();\n    const value = envVars?.[key] ?? process.env[key];\n\n    if (value === undefined || value === null) {\n      throw new Error(`Missing environment variable ${envVarName} required to build provider URL`);\n    }\n\n    return value;\n  });\n}\n","import { createAlibaba } from '@ai-sdk/alibaba-v7';\nimport { createAnthropic } from '@ai-sdk/anthropic-v6';\nimport { createCerebras } from '@ai-sdk/cerebras-v7';\nimport { createDeepInfra } from '@ai-sdk/deepinfra-v7';\nimport { createDeepSeek } from '@ai-sdk/deepseek-v7';\nimport { createGoogleGenerativeAI } from '@ai-sdk/google-v6';\nimport { createGroq } from '@ai-sdk/groq-v7';\nimport { createMistral } from '@ai-sdk/mistral-v6';\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible-v6';\nimport { createOpenAI } from '@ai-sdk/openai-v6';\nimport { createPerplexity } from '@ai-sdk/perplexity-v6';\nimport { createTogetherAI } from '@ai-sdk/togetherai-v7';\nimport { createXai } from '@ai-sdk/xai-v7';\nimport { createGateway } from '@internal/ai-v6';\nimport { createOpenRouter } from '@openrouter/ai-sdk-provider-v6';\nimport { parseModelRouterId } from '../gateway-resolver.js';\nimport { MastraModelGateway } from './base.js';\nimport type {\n  AttachmentCapabilities,\n  GatewayLanguageModel,\n  ModelProviderOverride,\n  ModelReasoningOption,\n  ProviderConfig,\n  ReasoningCapabilities,\n  StructuredOutputCapabilities,\n  TemperatureCapabilities,\n} from './base.js';\nimport { EXCLUDED_PROVIDERS, MASTRA_USER_AGENT, PROVIDERS_WITH_INSTALLED_PACKAGES } from './constants.js';\nimport { interpolateUrlTemplate } from './url-template.js';\n\ninterface ModelsDevModelInfo {\n  id: string;\n  name?: string;\n  status?: string;\n  release_date?: string;\n  modalities?: { input?: string[]; output?: string[] };\n  attachment?: boolean;\n  temperature?: boolean;\n  structured_output?: boolean;\n  // Per-model endpoint/shape/SDK override (models.dev model `provider` block).\n  provider?: { api?: string; shape?: 'responses' | 'completions'; npm?: string };\n  [key: string]: unknown;\n}\n\nfunction stringItems(value: unknown): string[] {\n  return Array.isArray(value) ? value.filter(item => typeof item === 'string') : [];\n}\n\nfunction isOptionalNumber(value: unknown): value is number | undefined {\n  return value === undefined || typeof value === 'number';\n}\n\nfunction toReasoningOption(raw: unknown): ModelReasoningOption | undefined {\n  if (!raw || typeof raw !== 'object' || !('type' in raw)) return undefined;\n  if (raw.type === 'toggle') return { type: 'toggle' };\n  if (raw.type === 'effort') {\n    const values = 'values' in raw ? stringItems(raw.values) : [];\n    return values.length > 0 ? { type: 'effort', values } : undefined;\n  }\n  if (raw.type === 'budget_tokens') {\n    const min = 'min' in raw ? raw.min : undefined;\n    const max = 'max' in raw ? raw.max : undefined;\n    if (!isOptionalNumber(min) || !isOptionalNumber(max)) return undefined;\n    return { type: 'budget_tokens', ...(min !== undefined ? { min } : {}), ...(max !== undefined ? { max } : {}) };\n  }\n  return undefined;\n}\n\nfunction parseReasoningOptions(raw: unknown): ModelReasoningOption[] {\n  if (!Array.isArray(raw)) return [];\n  return raw.map(toReasoningOption).filter(option => option !== undefined);\n}\n\ninterface ModelsDevProviderInfo {\n  id: string;\n  name: string;\n  models: Record<string, ModelsDevModelInfo>;\n  env?: string[]; // Array of env var names\n  api?: string; // Base API URL\n  npm?: string; // NPM package name\n  doc?: string; // Documentation URL\n}\n\ninterface ModelsDevResponse {\n  [providerId: string]: ModelsDevProviderInfo;\n}\n\nfunction selectApiKeyEnvVar({ envVars, providerId }: { envVars?: string[]; providerId: string }): string {\n  const fallbackEnvVar = `${providerId.toUpperCase().replace(/-/g, '_')}_API_KEY`;\n  if (!envVars?.length) return fallbackEnvVar;\n\n  const suffixPreferences = ['_API_TOKEN', '_API_KEY', '_TOKEN', '_KEY', '_PAT'];\n\n  for (const suffix of suffixPreferences) {\n    const preferredEnvVar = envVars.find(envVar => envVar.endsWith(suffix));\n    if (preferredEnvVar) return preferredEnvVar;\n  }\n\n  return envVars[0] || fallbackEnvVar;\n}\n\nfunction resolveApiKeyFromEnv(apiKeyEnvVar: ProviderConfig['apiKeyEnvVar']): string | undefined {\n  const envVars = Array.isArray(apiKeyEnvVar) ? apiKeyEnvVar : [apiKeyEnvVar];\n\n  for (const envVar of envVars) {\n    const apiKey = process.env[envVar];\n    if (apiKey) return apiKey;\n  }\n}\n\n// Provider-specific overrides for URL, npm package, and other config.\n// These take priority over what models.dev returns (e.g. correct base URLs, SDK packages).\n// This constant is ONLY used during generation in fetchProviders() to determine\n// which providers from models.dev should be included in the registry.\n// At runtime, buildUrl() and buildHeaders() use the pre-generated PROVIDER_REGISTRY instead.\nconst PROVIDER_OVERRIDES: Record<string, Partial<ProviderConfig>> = {\n  google: {\n    apiKeyEnvVar: ['GOOGLE_API_KEY', 'GOOGLE_GENERATIVE_AI_API_KEY'],\n  },\n  mistral: {\n    url: 'https://api.mistral.ai/v1',\n  },\n  groq: {\n    url: 'https://api.groq.com/openai/v1',\n  },\n  // moonshotai uses Anthropic-compatible API, not OpenAI-compatible\n  moonshotai: {\n    url: 'https://api.moonshot.ai/anthropic/v1',\n    npm: '@ai-sdk/anthropic',\n  },\n  // moonshotai-cn (China version) also uses Anthropic-compatible API\n  'moonshotai-cn': {\n    url: 'https://api.moonshot.cn/anthropic/v1',\n    npm: '@ai-sdk/anthropic',\n  },\n};\n\nexport class ModelsDevGateway extends MastraModelGateway {\n  readonly id = 'models.dev';\n  readonly name = 'models.dev';\n\n  private providerConfigs: Record<string, ProviderConfig> = {};\n  private attachmentCapabilities: AttachmentCapabilities = {};\n  private temperatureCapabilities: TemperatureCapabilities = {};\n  private structuredOutputCapabilities: StructuredOutputCapabilities = {};\n  private reasoningCapabilities: ReasoningCapabilities = {};\n\n  constructor(providerConfigs?: Record<string, ProviderConfig>) {\n    super();\n    if (providerConfigs) this.providerConfigs = providerConfigs;\n  }\n\n  async fetchProviders(): Promise<Record<string, ProviderConfig>> {\n    const response = await fetch('https://models.dev/api.json');\n    if (!response.ok) {\n      throw new Error(`Failed to fetch from models.dev: ${response.statusText}`);\n    }\n\n    const data = (await response.json()) as ModelsDevResponse;\n\n    // Reset capability maps so removed providers/models are not retained across syncs\n    this.attachmentCapabilities = {};\n    this.temperatureCapabilities = {};\n    this.structuredOutputCapabilities = {};\n    this.reasoningCapabilities = {};\n\n    const providerConfigs: Record<string, ProviderConfig> = {};\n\n    for (const [providerId, providerInfo] of Object.entries(data)) {\n      // Skip excluded providers\n      if (EXCLUDED_PROVIDERS.includes(providerId)) continue;\n      // Skip non-provider entries (if any)\n      if (!providerInfo || typeof providerInfo !== 'object' || !providerInfo.models) continue;\n\n      // Use provider ID as-is (keep hyphens for consistency)\n      const normalizedId = providerId;\n\n      // Check if this is OpenAI-compatible based on npm package or overrides\n      const isOpenAICompatible =\n        providerInfo.npm === '@ai-sdk/openai-compatible' ||\n        providerInfo.npm === '@ai-sdk/gateway' || // Vercel AI Gateway is OpenAI-compatible\n        normalizedId in PROVIDER_OVERRIDES;\n\n      // these have their ai sdk provider package installed and don't use openai-compat\n      const hasInstalledPackage = PROVIDERS_WITH_INSTALLED_PACKAGES.includes(providerId);\n\n      // Also include providers that have an API URL and env vars (likely OpenAI-compatible)\n      const hasApiAndEnv = providerInfo.api && providerInfo.env && providerInfo.env.length > 0;\n\n      if (isOpenAICompatible || hasInstalledPackage || hasApiAndEnv) {\n        // Get model IDs from the models object.\n        //\n        // Deprecated models are retained rather than dropped. On models.dev,\n        // `status: 'deprecated'` means \"still served, scheduled for retirement\" —\n        // not \"removed\". Filtering them out here would break existing users: the\n        // generated model-id union would stop type-checking their configured model,\n        // and the model would silently lose its capability flags and per-model\n        // endpoint/shape overrides (i.e. it would route with provider defaults).\n        // They are reported separately via `deprecatedModels` so surfaces that\n        // offer models for *new* selection can hide or mark them.\n        const allModels = Object.entries(providerInfo.models);\n        const modelIds = allModels.map(([modelId]) => modelId).sort();\n        const modelReleaseDates = Object.fromEntries(\n          allModels.flatMap(([modelId, info]) =>\n            typeof info?.release_date === 'string' && info.release_date ? [[modelId, info.release_date]] : [],\n          ),\n        );\n        const deprecatedModelIds = allModels\n          .filter(([, modelInfo]) => modelInfo?.status === 'deprecated')\n          .map(([modelId]) => modelId)\n          .sort();\n\n        // Collect model IDs that support attachments\n        const attachmentModels = allModels\n          .filter(([, modelInfo]) => modelInfo?.attachment === true)\n          .map(([modelId]) => modelId)\n          .sort();\n\n        // Collect model IDs that support temperature sampling\n        const temperatureModels = allModels\n          .filter(([, modelInfo]) => modelInfo?.temperature === true)\n          .map(([modelId]) => modelId)\n          .sort();\n\n        const structuredOutputModels = allModels\n          .filter(([, modelInfo]) => modelInfo?.structured_output === true)\n          .map(([modelId]) => modelId)\n          .sort();\n\n        const reasoningByModel: Record<string, ModelReasoningOption[]> = {};\n        for (const [modelId, modelInfo] of allModels) {\n          const reasoningOptions = parseReasoningOptions(modelInfo?.reasoning_options);\n          if (reasoningOptions.length > 0) reasoningByModel[modelId] = reasoningOptions;\n        }\n\n        // Collect per-model endpoint/shape/SDK overrides. Some providers serve\n        // individual models over a different endpoint or request shape than the\n        // provider default (e.g. OpenAI Responses vs chat-completions).\n        const modelOverrides: Record<string, ModelProviderOverride> = {};\n        for (const [modelId, modelInfo] of allModels) {\n          const ov = modelInfo?.provider;\n          if (ov && (ov.api || ov.shape || ov.npm)) {\n            modelOverrides[modelId] = { api: ov.api, shape: ov.shape, npm: ov.npm };\n          }\n        }\n\n        // Get the API URL - overrides take priority over models.dev data\n        const url = PROVIDER_OVERRIDES[normalizedId]?.url || providerInfo.api;\n\n        // Skip if we don't have a URL\n        if (!hasInstalledPackage && !url) {\n          continue;\n        }\n\n        // Prefer auth-like env vars over identifiers already consumed by the URL template.\n        const apiKeyEnvVar =\n          PROVIDER_OVERRIDES[normalizedId]?.apiKeyEnvVar ||\n          selectApiKeyEnvVar({\n            envVars: providerInfo.env,\n            providerId: normalizedId,\n          });\n\n        // Determine the API key header (special case for Anthropic)\n        const apiKeyHeader = !hasInstalledPackage\n          ? PROVIDER_OVERRIDES[normalizedId]?.apiKeyHeader || 'Authorization'\n          : undefined;\n\n        providerConfigs[normalizedId] = {\n          url,\n          apiKeyEnvVar,\n          apiKeyHeader,\n          name: providerInfo.name || providerId.charAt(0).toUpperCase() + providerId.slice(1),\n          models: modelIds,\n          ...(Object.keys(modelReleaseDates).length > 0 ? { modelReleaseDates } : {}),\n          docUrl: providerInfo.doc, // Include documentation URL if available\n          gateway: `models.dev`,\n          // Only store npm when it's a non-default SDK (not openai-compatible/gateway) to keep the registry small\n          // Overrides take priority (e.g., moonshotai uses @ai-sdk/anthropic, not the openai-compatible listed in models.dev)\n          npm:\n            PROVIDER_OVERRIDES[normalizedId]?.npm ||\n            (providerInfo.npm &&\n            providerInfo.npm !== '@ai-sdk/openai-compatible' &&\n            providerInfo.npm !== '@ai-sdk/gateway'\n              ? providerInfo.npm\n              : undefined),\n          modelOverrides: Object.keys(modelOverrides).length > 0 ? modelOverrides : undefined,\n          deprecatedModels: deprecatedModelIds.length > 0 ? deprecatedModelIds : undefined,\n        };\n        if (attachmentModels.length > 0) {\n          this.attachmentCapabilities[normalizedId] = attachmentModels;\n        }\n        if (temperatureModels.length > 0) {\n          this.temperatureCapabilities[normalizedId] = temperatureModels;\n        }\n        if (structuredOutputModels.length > 0) {\n          this.structuredOutputCapabilities[normalizedId] = structuredOutputModels;\n        }\n        if (Object.keys(reasoningByModel).length > 0) {\n          this.reasoningCapabilities[normalizedId] = reasoningByModel;\n        }\n      }\n    }\n\n    // Store for later use in buildUrl and buildHeaders\n    this.providerConfigs = providerConfigs;\n\n    return providerConfigs;\n  }\n\n  /**\n   * Return attachment capabilities collected during the last `fetchProviders()` call.\n   * Maps provider ID → list of model IDs that support attachments.\n   */\n  getAttachmentCapabilities(): AttachmentCapabilities {\n    return this.attachmentCapabilities;\n  }\n\n  getTemperatureCapabilities(): TemperatureCapabilities {\n    return this.temperatureCapabilities;\n  }\n\n  getStructuredOutputCapabilities(): StructuredOutputCapabilities {\n    return this.structuredOutputCapabilities;\n  }\n\n  getReasoningCapabilities(): ReasoningCapabilities {\n    return this.reasoningCapabilities;\n  }\n\n  buildUrl(routerId: string, envVars?: typeof process.env): string | undefined {\n    const { providerId, modelId } = parseModelRouterId(routerId);\n\n    const config = this.providerConfigs[providerId];\n\n    // A per-model override may point this model at a different endpoint than the\n    // provider default; prefer it when present.\n    const perModelApi = config?.modelOverrides?.[modelId]?.api;\n    const template = perModelApi ?? config?.url;\n\n    // Explicit <PROVIDER>_BASE_URL override wins, even for providers without a registry url template\n    const baseUrlEnvVar = `${providerId.toUpperCase().replace(/-/g, '_')}_BASE_URL`;\n    const customBaseUrl = envVars?.[baseUrlEnvVar] || process.env[baseUrlEnvVar];\n    if (customBaseUrl) {\n      return customBaseUrl;\n    }\n\n    if (!template) {\n      return;\n    }\n\n    return interpolateUrlTemplate(template, envVars);\n  }\n\n  getApiKey(modelId: string): Promise<string> {\n    const [provider, model] = modelId.split('/');\n    if (!provider || !model) {\n      throw new Error(`Could not identify provider from model id ${modelId}`);\n    }\n    const config = this.providerConfigs[provider];\n\n    if (!config) {\n      throw new Error(`Could not find config for provider ${provider} with model id ${modelId}`);\n    }\n\n    const apiKey = resolveApiKeyFromEnv(config.apiKeyEnvVar);\n\n    if (!apiKey) {\n      const envVarDisplay = Array.isArray(config.apiKeyEnvVar) ? config.apiKeyEnvVar.join(' or ') : config.apiKeyEnvVar;\n      throw new Error(`Could not find API key process.env.${envVarDisplay} for model id ${modelId}`);\n    }\n\n    return Promise.resolve(apiKey);\n  }\n\n  async resolveLanguageModel({\n    modelId,\n    providerId,\n    apiKey,\n    headers,\n  }: {\n    modelId: string;\n    providerId: string;\n    apiKey: string;\n    headers?: Record<string, string>;\n  }): Promise<GatewayLanguageModel> {\n    const baseURL = this.buildUrl(`${providerId}/${modelId}`);\n\n    const mastraHeaders = { 'User-Agent': MASTRA_USER_AGENT, ...headers };\n\n    // Per-model override: a model may be served over a different request shape\n    // than its provider default (e.g. the OpenAI Responses API while the provider\n    // default is chat-completions). Honor `shape` for any provider.\n    const override = this.providerConfigs[providerId]?.modelOverrides?.[modelId];\n    if (override?.shape === 'responses') {\n      return createOpenAI({ apiKey, baseURL, headers: mastraHeaders }).responses(modelId);\n    }\n\n    switch (providerId) {\n      case 'openai':\n        return createOpenAI({ apiKey, baseURL, headers: mastraHeaders }).responses(modelId);\n      case 'gemini':\n      case 'google':\n        return createGoogleGenerativeAI({ apiKey, baseURL, headers: mastraHeaders }).chat(modelId);\n      case 'anthropic':\n        return createAnthropic({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'mistral':\n        return createMistral({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'groq':\n        return createGroq({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'openrouter':\n        return createOpenRouter({ apiKey, baseURL, headers: mastraHeaders })(\n          modelId,\n        ) as unknown as GatewayLanguageModel;\n      case 'xai':\n        return createXai({ apiKey, baseURL, headers: mastraHeaders }).responses(modelId);\n      case 'deepseek':\n        return createDeepSeek({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'perplexity': {\n        const hasIntegrationHeader = Object.keys(mastraHeaders).some(key => key.toLowerCase() === 'x-pplx-integration');\n        const perplexityHeaders = hasIntegrationHeader\n          ? mastraHeaders\n          : { 'X-Pplx-Integration': MASTRA_USER_AGENT, ...mastraHeaders };\n        return createPerplexity({ apiKey, baseURL, headers: perplexityHeaders })(modelId);\n      }\n      case 'cerebras':\n        return createCerebras({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'togetherai':\n        return createTogetherAI({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'deepinfra':\n        return createDeepInfra({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'vercel':\n        return createGateway({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      case 'moonshotai':\n      case 'moonshotai-cn': {\n        // moonshotai uses Anthropic-compatible API endpoint\n        if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n        return createAnthropic({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n      }\n      default: {\n        // Check if this provider uses a specific SDK package (e.g., kimi-for-coding uses @ai-sdk/anthropic).\n        // A per-model override wins over the provider default.\n        const config = this.providerConfigs[providerId];\n        const npm = override?.npm ?? config?.npm;\n\n        // Pattern match for any alibaba variant (alibaba, alibaba-cn, alibaba-coding-plan, etc.)\n        if (providerId.includes('alibaba')) {\n          if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n          return createAlibaba({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n        }\n\n        if (npm === '@ai-sdk/anthropic') {\n          if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n          return createAnthropic({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n        }\n\n        if (npm === '@ai-sdk/openai') {\n          if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n          return createOpenAI({ apiKey, baseURL, headers: mastraHeaders }).chat(modelId);\n        }\n\n        if (npm === '@ai-sdk/google') {\n          if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n          return createGoogleGenerativeAI({ apiKey, baseURL, headers: mastraHeaders }).chat(modelId);\n        }\n\n        if (npm === '@ai-sdk/mistral') {\n          if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n          return createMistral({ apiKey, baseURL, headers: mastraHeaders })(modelId);\n        }\n\n        if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);\n        return createOpenAICompatible({\n          name: providerId,\n          apiKey,\n          baseURL,\n          headers: mastraHeaders,\n          supportsStructuredOutputs: true,\n          // Kimi's coding endpoint only reports usage at the standard top level of a stream chunk when\n          // asked; without stream_options.include_usage it nests usage inside choices[0], which the AI\n          // SDK never reads, so every Kimi step's token counts came back undefined (r325).\n          ...(providerId.startsWith('kimi-code-plan') ? { includeUsage: true } : {}),\n        }).chatModel(modelId);\n      }\n    }\n  }\n}\n","import { createAnthropic } from '@ai-sdk/anthropic-v6';\nimport { createGoogleGenerativeAI } from '@ai-sdk/google-v6';\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible-v6';\nimport { createOpenAI } from '@ai-sdk/openai-v6';\nimport { InMemoryServerCache } from '../../../cache/inmemory.js';\nimport { MastraError } from '../../../error/index.js';\nimport { MastraModelGateway } from './base.js';\nimport type { ProviderConfig, GatewayLanguageModel } from './base.js';\nimport { MASTRA_USER_AGENT } from './constants.js';\n\ninterface NetlifyProviderResponse {\n  token_env_var: string;\n  url_env_var: string;\n  models: string[];\n}\ninterface NetlifyResponse {\n  providers: Record<string, NetlifyProviderResponse>;\n}\n\ninterface NetlifyTokenResponse {\n  token: string;\n  url: string;\n  expires_at: number;\n}\n\ninterface CachedToken {\n  token: string;\n  url: string;\n  expiresAt: number;\n}\n\ninterface TokenData {\n  token: string;\n  url: string;\n}\n\nexport class NetlifyGateway extends MastraModelGateway {\n  readonly id = 'netlify';\n  readonly name = 'Netlify AI Gateway';\n  private tokenCache = new InMemoryServerCache();\n\n  async fetchProviders(): Promise<Record<string, ProviderConfig>> {\n    const response = await fetch('https://api.netlify.com/api/v1/ai-gateway/providers');\n    if (!response.ok) {\n      throw new Error(`Failed to fetch from Netlify: ${response.statusText}`);\n    }\n    const data = (await response.json()) as NetlifyResponse;\n    const config: ProviderConfig = {\n      apiKeyEnvVar: ['NETLIFY_TOKEN', 'NETLIFY_SITE_ID'],\n      apiKeyHeader: 'Authorization',\n      name: `Netlify`,\n      gateway: `netlify`,\n      models: [],\n      docUrl: 'https://docs.netlify.com/build/ai-gateway/overview/',\n    };\n    // Convert Netlify format to our standard format\n    for (const [providerId, provider] of Object.entries(data.providers)) {\n      for (const model of provider.models) {\n        config.models.push(`${providerId}/${model}`);\n      }\n    }\n    // Return with gateway ID as key - registry generator will detect this and avoid doubling the prefix\n    return { netlify: config };\n  }\n\n  async buildUrl(routerId: string, envVars?: typeof process.env): Promise<string> {\n    // Check for Netlify site ID first (for token exchange)\n    const siteId = envVars?.['NETLIFY_SITE_ID'] || process.env['NETLIFY_SITE_ID'];\n    const netlifyToken = envVars?.['NETLIFY_TOKEN'] || process.env['NETLIFY_TOKEN'];\n\n    if (!netlifyToken) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_NO_TOKEN',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Missing NETLIFY_TOKEN environment variable required for model: ${routerId}`,\n      });\n    }\n\n    if (!siteId) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_NO_SITE_ID',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Missing NETLIFY_SITE_ID environment variable required for model: ${routerId}`,\n      });\n    }\n\n    try {\n      const tokenData = await this.getOrFetchToken(siteId, netlifyToken);\n      return tokenData.url.endsWith(`/`) ? tokenData.url.substring(0, tokenData.url.length - 1) : tokenData.url;\n    } catch (error) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_TOKEN_ERROR',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Failed to get Netlify AI Gateway token for model ${routerId}: ${error instanceof Error ? error.message : String(error)}`,\n      });\n    }\n  }\n\n  /**\n   * Get cached token or fetch a new site-specific AI Gateway token from Netlify\n   */\n  private async getOrFetchToken(siteId: string, netlifyToken: string): Promise<TokenData> {\n    const cacheKey = `netlify-token:${siteId}:${netlifyToken}`;\n\n    // Check cache first\n    const cached = (await this.tokenCache.get(cacheKey)) as CachedToken | undefined;\n    if (cached && cached.expiresAt > Date.now() / 1000 + 60) {\n      // Return cached token if it won't expire in the next minute\n      return { token: cached.token, url: cached.url };\n    }\n\n    // Fetch new token\n    const response = await fetch(`https://api.netlify.com/api/v1/sites/${siteId}/ai-gateway/token`, {\n      method: 'GET',\n      headers: {\n        Authorization: `Bearer ${netlifyToken}`,\n      },\n    });\n\n    if (!response.ok) {\n      const error = await response.text();\n      throw new Error(`Failed to get Netlify AI Gateway token: ${response.status} ${error}`);\n    }\n\n    const tokenResponse = (await response.json()) as NetlifyTokenResponse;\n\n    // Cache the token - InMemoryServerCache will handle the TTL\n    await this.tokenCache.set(cacheKey, {\n      token: tokenResponse.token,\n      url: tokenResponse.url,\n      expiresAt: tokenResponse.expires_at,\n    });\n\n    return { token: tokenResponse.token, url: tokenResponse.url };\n  }\n\n  /**\n   * Get cached token or fetch a new site-specific AI Gateway token from Netlify\n   */\n  async getApiKey(modelId: string): Promise<string> {\n    const siteId = process.env['NETLIFY_SITE_ID'];\n    const netlifyToken = process.env['NETLIFY_TOKEN'];\n\n    if (!netlifyToken) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_NO_TOKEN',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Missing NETLIFY_TOKEN environment variable required for model: ${modelId}`,\n      });\n    }\n\n    if (!siteId) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_NO_SITE_ID',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Missing NETLIFY_SITE_ID environment variable required for model: ${modelId}`,\n      });\n    }\n\n    try {\n      return (await this.getOrFetchToken(siteId, netlifyToken)).token;\n    } catch (error) {\n      throw new MastraError({\n        id: 'NETLIFY_GATEWAY_TOKEN_ERROR',\n        domain: 'LLM',\n        category: 'UNKNOWN',\n        text: `Failed to get Netlify AI Gateway token for model ${modelId}: ${error instanceof Error ? error.message : String(error)}`,\n      });\n    }\n  }\n\n  async resolveLanguageModel({\n    modelId,\n    providerId,\n    apiKey,\n    headers,\n  }: {\n    modelId: string;\n    providerId: string;\n    apiKey: string;\n    headers?: Record<string, string>;\n  }): Promise<GatewayLanguageModel> {\n    const baseURL = await this.buildUrl(`${providerId}/${modelId}`);\n\n    const mastraHeaders = { 'User-Agent': MASTRA_USER_AGENT, ...headers };\n\n    switch (providerId) {\n      case 'openai':\n        return createOpenAI({ apiKey, baseURL, headers: mastraHeaders }).responses(modelId);\n      case 'gemini':\n        return createGoogleGenerativeAI({\n          baseURL: `${baseURL}/v1beta/`,\n          apiKey,\n          headers: {\n            'user-agent': 'google-genai-sdk/',\n            ...mastraHeaders,\n          },\n        }).chat(modelId);\n      case 'anthropic':\n        return createAnthropic({\n          apiKey,\n          baseURL: `${baseURL}/v1/`,\n          headers: {\n            'anthropic-version': '2023-06-01',\n            ...mastraHeaders,\n          },\n        })(modelId);\n      default:\n        return createOpenAICompatible({\n          name: providerId,\n          apiKey,\n          baseURL,\n          headers: mastraHeaders,\n          supportsStructuredOutputs: true,\n        }).chatModel(modelId);\n    }\n  }\n}\n"],"ignoreList":[0,1,2,3,4,5,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"mappings":";;;;;;;;;;;AACA,IAAIA,YAAS;AACb,IAAIC,YAAS,OAAO,IAAID,SAAM;AAC9B,IAAIE;AAAIC,IAAAA;AACR,IAAIC,eAAa,MAAM,qBAAqB,OAAK,OAAO,OAAKH,WAAQE,KAAAA,CAAI;;;;;;;;;CASvE,YAAY,EACV,MAAM,QACN,SACA,SACC;EACD,MAAM,OAAO;EACb,KAAKD,QAAM;EACX,KAAK,OAAO;EACZ,KAAK,QAAQ;CACf;;;;;;CAMA,OAAO,WAAW,OAAO;EACvB,OAAO,YAAY,UAAU,OAAOF,SAAM;CAC5C;CACA,OAAO,UAAU,OAAO,UAAU;EAChC,MAAM,eAAe,OAAO,IAAI,QAAQ;EACxC,OAAO,SAAS,QAAQ,OAAO,UAAU,YAAY,gBAAgB,SAAS,OAAO,MAAM,kBAAkB,aAAa,MAAM,kBAAkB;CACpJ;AACF;AAGA,IAAIK,UAAO;AACX,IAAIC,YAAU,mBAAmBD;AACjC,IAAIE,YAAU,OAAO,IAAID,SAAO;AAChC,I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B,KAAK;EAAO,CAAC;CACvE;AACF;AAGA,SAAS8G,OAAK,OAAO;CACnB,OAAO;AACT;AAMA,SAASC,4BAA0B,EACjC,IACA,eACC;CACD,QAAQ,EACN,SACA,cACA,eACA,eACA,cACA,cACA,kBACA,GAAG,WACCD,OAAK;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AACA,SAAS,0CAA0C,EACjD,IACA,aACA,cACA,2BACC;CACD,QAAQ,EACN,SACA,eACA,eACA,cACA,cACA,kBACA,GAAG,WACCA,OAAK;EACT,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH;AAUA,eAAeE,UAAQ,OAAO;CAC5B,IAAI,OAAO,UAAU,YACnB,QAAQ,MAAM;CAEhB,OAAO;AACT;AAmFA,IAAIC,gBAAc,IAAI,YAAY;AAClC,SAASC,yBAAuB,EAC9B,QACA,KACA,mBACA,YACA,mBACC;CACD,MAAM,SAAS,OAAO,UAAU;CAChC,IAAI,iBAAiB;CACrB,MAAM,sBAAsB;EAC1B,IAAI,CAAC,gBAAgB;GACnB,OAAO,YAAY;GACnB,iBAAiB;EACnB;CACF;CACA,OAAO,IAAI,eAAe;EACxB,MAAM,KAAK,YAAY;GACrB,IAAI;IACF,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,KAAK;IAC1C,IAAI,MAAM;KACR,cAAc;KACd,WAAW,MAAM;IACnB,OACE,WAAW,QAAQ,KAAK;GAE5B,SAAS,OAAO;IACd,cAAc;IACd,IAAItH,eAAa,KAAK,GAAG;KACvB,WAAW,MAAM,KAAK;KACtB;IACF;IACA,WAAW,MACTI,mBAAiB;KACf,OAAO,IAAImH,eAAc;MACvB,SAAS;MACT,OAAO;MACP;MACA;MACA;MACA;KACF,CAAC;KACD;KACA;IACF,CAAC,CACH;GACF;EACF;EACA,MAAM,OAAO,QAAQ;GACnB,IAAI;IACF,MAAM,OAAO,O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vB;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;CACD;AACD;AACA,MAAM,8BAA8B,CAAC;CACpC,WAAW;CACX,aAAa;EACZ;EACA;EACA;EACA;CACD;AACD,CAAC;AACD,MAAM,qCAAqC;CAC1C;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa,CAAC,KAAK,GAAG;CACvB;CACA;EACC,WAAW;EACX,aAAa;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;CACD;CACA;EACC,WAAW;EACX,aAAa;GACZ;G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