@openclaw/ai 2026.10.5 → 2026.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-DIIiiz99.mjs → anthropic-DusktpKG.mjs} +6 -6
- package/dist/{anthropic-payload-policy-DGblkHL5.d.mts → anthropic-payload-policy-DVv20UCL.d.mts} +1 -1
- package/dist/{anthropic-stream-reducer-DfMVFm-r.mjs → anthropic-stream-reducer-BY-gN9EE.mjs} +8 -8
- package/dist/{assistant-output-BuhRpLeD.mjs → assistant-output-DDZq4a3j.mjs} +2 -2
- package/dist/{assistant-text-phase-mvdMcrY-.mjs → assistant-text-phase-CgpXhaLS.mjs} +1 -1
- package/dist/{azure-openai-responses-DGQnXRMs.mjs → azure-openai-responses-yuBKi0s4.mjs} +4 -4
- package/dist/{google-BlbTC1Xp.mjs → google-NMkwYgCy.mjs} +2 -2
- package/dist/{google-interactions-zIz70M2e.mjs → google-interactions-BEV3C85P.mjs} +7 -7
- package/dist/{google-messages-CNbUJK5E.mjs → google-messages-BhdxpH4K.mjs} +3 -3
- package/dist/{google-provider-stream-Cn0XF1MG.mjs → google-provider-stream-B0GeAuTB.mjs} +6 -6
- package/dist/{google-shared-BPnWP4tT.mjs → google-shared-Cpz8bSTL.mjs} +5 -5
- package/dist/{google-vertex-XQ7OQtaM.mjs → google-vertex-DJvQwNgr.mjs} +2 -2
- package/dist/{host-Bf3NjYNj.mjs → host-CIzdzpBn.mjs} +1 -1
- package/dist/{host-policy-BzZluO6_.mjs → host-policy-C0y3BC9R.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +2 -2
- package/dist/internal/anthropic.mjs +3 -3
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +5 -5
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/runtime.mjs +4 -4
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-dCDCR5ur.mjs → mistral-CDK7WGwC.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-D8-q7cgy.mjs → openai-chatgpt-responses-BjfLWIK6.mjs} +11 -11
- package/dist/{openai-completions-CMN24pza.mjs → openai-completions-BkRt2Iy4.mjs} +3 -3
- package/dist/{openai-completions-compat-i-nLZxFy.d.mts → openai-completions-compat-B86jN9ii.d.mts} +2 -0
- package/dist/{openai-completions-compat-CYX18uDk.mjs → openai-completions-compat-CpeOT7jH.mjs} +3 -1
- package/dist/{openai-completions-transport-DuXQOxrH.mjs → openai-completions-transport-BRjxCG1C.mjs} +25 -25
- package/dist/{openai-prompt-cache-r93BJhjm.mjs → openai-prompt-cache-CvftfMfD.mjs} +1 -1
- package/dist/{openai-responses-BMxoJdTC.mjs → openai-responses-BUDpkW8I.mjs} +6 -6
- package/dist/{openai-responses-compaction-replay-B2FE4Nw8.d.mts → openai-responses-compaction-replay-DtEbZJbU.d.mts} +2 -2
- package/dist/{openai-responses-contracts-DKqMJ1Ct.d.mts → openai-responses-contracts-Cm1QilsO.d.mts} +1 -1
- package/dist/{openai-responses-contracts-DlKMMTxK.mjs → openai-responses-contracts-DbD7sGP-.mjs} +7 -1
- package/dist/{openai-responses-endpoint-CinGh4VZ.mjs → openai-responses-endpoint-COHJK1MR.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-NSIJo9jY.mjs → openai-responses-request-lifecycle-Cx2nKN1G.mjs} +3 -3
- package/dist/{openai-responses-shared-afo9-s16.mjs → openai-responses-shared-C1GHTB0q.mjs} +11 -11
- package/dist/{provider-options-CVrXZBtA.d.mts → provider-options-DTuD2UNR.d.mts} +6 -1
- package/dist/{provider-transport-turn-state-BYrELw8H.mjs → provider-transport-turn-state-O5JWdUL4.mjs} +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-BAu4B54D.mjs → simple-options-CmtE6whA.mjs} +3 -3
- package/dist/{stream-Dd8DwRFL.mjs → stream-BBjz-Jw2.mjs} +1 -1
- package/dist/{text-signature-CUXnvk_c.mjs → text-signature-an0fgbDz.mjs} +1 -1
- package/dist/{transport-stream-shared-CWGOuLcA.mjs → transport-stream-shared-Dr_GBa9K.mjs} +1 -1
- package/dist/{transport-utils-34BQoXq3.mjs → transport-utils-DmYqQcG7.mjs} +2 -2
- package/dist/transports.d.mts +6 -5
- package/dist/transports.mjs +13 -13
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { w as supportsClaudeAdaptiveThinking } from "./src-C44MKrW5.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
4
|
-
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-
|
|
5
|
-
import { s as streamFragmentError } from "./transport-utils-
|
|
6
|
-
import { D as suppressAnthropicCompaction, J as isAnthropicOAuthApiKey, P as isDirectAnthropicModel, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest } from "./anthropic-stream-reducer-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
5
|
+
import { s as streamFragmentError } from "./transport-utils-DmYqQcG7.mjs";
|
|
6
|
+
import { D as suppressAnthropicCompaction, J as isAnthropicOAuthApiKey, P as isDirectAnthropicModel, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest } from "./anthropic-stream-reducer-BY-gN9EE.mjs";
|
|
7
7
|
import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
8
|
-
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
9
|
-
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
8
|
+
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
9
|
+
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-CmtE6whA.mjs";
|
|
10
10
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
11
11
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
12
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
12
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
13
13
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
14
14
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
15
15
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
package/dist/{anthropic-payload-policy-DGblkHL5.d.mts → anthropic-payload-policy-DVv20UCL.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./index-BYDvopUB.mjs";
|
|
2
2
|
import { k as Model } from "./types-Bd2T86VJ.mjs";
|
|
3
|
-
import { t as AnthropicContextManagementOptions } from "./provider-options-
|
|
3
|
+
import { t as AnthropicContextManagementOptions } from "./provider-options-DTuD2UNR.mjs";
|
|
4
4
|
import { TextBlockParam } from "@anthropic-ai/sdk/resources/messages.js";
|
|
5
5
|
//#region packages/ai/src/transports/anthropic-payload-policy.d.ts
|
|
6
6
|
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
package/dist/{anthropic-stream-reducer-DfMVFm-r.mjs → anthropic-stream-reducer-BY-gN9EE.mjs}
RENAMED
|
@@ -4,18 +4,18 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
4
4
|
import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
5
5
|
import { i as normalizeOptionalLowercaseString, r as normalizeNullableString } from "./string-coerce-CtgOVOSv.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-C3hztWoY.mjs";
|
|
7
|
-
import { N as isImageWithMediaPayload, O as calculateCost, S as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-
|
|
8
|
-
import "./transport-utils-
|
|
7
|
+
import { N as isImageWithMediaPayload, O as calculateCost, S as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-CIzdzpBn.mjs";
|
|
8
|
+
import "./transport-utils-DmYqQcG7.mjs";
|
|
9
9
|
import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
|
|
10
|
-
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-
|
|
10
|
+
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-C0y3BC9R.mjs";
|
|
11
11
|
import { i as resolveCacheRetention } from "./cloudflare-5qSGvIUH.mjs";
|
|
12
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
13
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, t as adjustMaxTokensForThinking, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
12
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
13
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, t as adjustMaxTokensForThinking, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-CmtE6whA.mjs";
|
|
14
14
|
import { t as parsePositiveInteger } from "./positive-integer-CqWjqSi9.mjs";
|
|
15
|
-
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-
|
|
16
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
15
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-an0fgbDz.mjs";
|
|
16
|
+
import { n as transformProviderMessages } from "./assistant-output-DDZq4a3j.mjs";
|
|
17
17
|
import { i as SCHEMA_MAP_KEYS, n as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-B8sG1I9v.mjs";
|
|
18
|
-
import { i as tagPendingCommentaryText } from "./assistant-text-phase-
|
|
18
|
+
import { i as tagPendingCommentaryText } from "./assistant-text-phase-CgpXhaLS.mjs";
|
|
19
19
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
20
20
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
21
21
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as transformMessages } from "./host-
|
|
2
|
-
import { a as createEmptyTransportUsage } from "./transport-stream-shared-
|
|
1
|
+
import { c as transformMessages } from "./host-CIzdzpBn.mjs";
|
|
2
|
+
import { a as createEmptyTransportUsage } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
3
3
|
//#region packages/ai/src/provider-transcript-transform.ts
|
|
4
4
|
const IMAGE_OMISSION = "(image omitted: model does not support images)";
|
|
5
5
|
const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as encodeTextSignatureV1 } from "./text-signature-
|
|
1
|
+
import { t as encodeTextSignatureV1 } from "./text-signature-an0fgbDz.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region packages/ai/src/utils/assistant-text-phase.ts
|
|
4
4
|
const EMPTY_ASSISTANT_TEXT_BLOCK_SET = /* @__PURE__ */ new Set();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { r as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { F as convertProviderResponsesMessages, It as resolvePromptCacheKey, _t as resolveOpenAISimpleReasoningEffort, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
4
|
+
import { F as convertProviderResponsesMessages, It as resolvePromptCacheKey, _t as resolveOpenAISimpleReasoningEffort, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
6
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
7
7
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
8
8
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
9
9
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
2
2
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
4
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
5
|
-
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-
|
|
5
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-B0GeAuTB.mjs";
|
|
6
6
|
import { GoogleGenAI } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google.ts
|
|
8
8
|
const { stream: streamGoogle, streamSimple: streamSimpleGoogle } = createGoogleGenerateContentStreams("google-generative-ai", (model, options) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { a as asRecord, i as asOptionalRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
4
|
-
import { s as streamFragmentError } from "./transport-utils-
|
|
5
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
6
|
-
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-
|
|
7
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
3
|
+
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
4
|
+
import { s as streamFragmentError } from "./transport-utils-DmYqQcG7.mjs";
|
|
5
|
+
import { t as buildGuardedModelFetch } from "./host-policy-C0y3BC9R.mjs";
|
|
6
|
+
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
7
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
9
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
10
|
-
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-
|
|
9
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
10
|
+
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-Cpz8bSTL.mjs";
|
|
11
11
|
import { createRequire } from "node:module";
|
|
12
12
|
//#region packages/ai/src/providers/google-interactions-request.ts
|
|
13
13
|
const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-
|
|
3
|
-
import { P as sanitizeSurrogates, a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
4
|
-
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { P as sanitizeSurrogates, a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
4
|
+
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-CmtE6whA.mjs";
|
|
5
5
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
6
6
|
import { isGoogleGemini4Model } from "./internal/google-model-family.mjs";
|
|
7
7
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { a as resolveAiTransportHeaderSentinels } from "./host-
|
|
3
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
4
|
-
import { f as mergeTransportHeaders } from "./transport-stream-shared-
|
|
5
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
7
|
-
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
2
|
+
import { a as resolveAiTransportHeaderSentinels } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { n as buildManagedModelFetch } from "./host-policy-C0y3BC9R.mjs";
|
|
4
|
+
import { f as mergeTransportHeaders } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
5
|
+
import { n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
7
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-Cpz8bSTL.mjs";
|
|
8
8
|
import { ResourceScope } from "@google/genai";
|
|
9
9
|
//#region packages/ai/src/providers/google-http-options.ts
|
|
10
10
|
function buildGoogleHttpOptions(model, optionsHeaders, profile) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { k as clampThinkingLevel } from "./host-
|
|
2
|
-
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-
|
|
3
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
4
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
1
|
+
import { k as clampThinkingLevel } from "./host-CIzdzpBn.mjs";
|
|
2
|
+
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
3
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-CmtE6whA.mjs";
|
|
4
|
+
import { n as transformProviderMessages } from "./assistant-output-DDZq4a3j.mjs";
|
|
5
5
|
import { isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
6
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
6
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-BhdxpH4K.mjs";
|
|
7
7
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
8
8
|
//#region packages/ai/src/providers/google-shared.ts
|
|
9
9
|
function convertMessages(model, context) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as normalizeOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
2
|
-
import { r as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-B0GeAuTB.mjs";
|
|
4
4
|
import { GoogleGenAI } from "@google/genai";
|
|
5
5
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
6
6
|
const API_VERSION = "v1";
|
|
@@ -2,7 +2,7 @@ import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffor
|
|
|
2
2
|
import { t as DEFAULT_MISSING_TOOL_RESULT_TEXT } from "./types-CQc6JNG4.mjs";
|
|
3
3
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { M as listMappedModelThinkingLevels, N as resolveOpenAIThinkingApi, T as resolveOpenAIModelReasoningEfforts, i as OPENAI_RESPONSES_APIS, j as MODEL_CATALOG_THINKING_LEVELS } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
6
6
|
//#region packages/ai/src/media-payload.ts
|
|
7
7
|
/** Media metadata alone is not an attachment; provider emitters need inline bytes. */
|
|
8
8
|
function hasMediaPayload(block) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,6 @@ import { t as appendTextDeltaToAssistantMessage } from "./assistant-message-even
|
|
|
4
4
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
5
5
|
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
6
6
|
import { n as validateToolCall, t as validateToolArguments } from "./validation-ZX_sPVV0.mjs";
|
|
7
|
-
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-
|
|
8
|
-
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-
|
|
7
|
+
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-BBjz-Jw2.mjs";
|
|
8
|
+
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
9
9
|
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, createNodeLlmRuntime, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as resolveClaudeOpus55ModelIdentity, E as resolveClaudeSonnet5ModelIdentity, M as supportsClaudeNativeXhighEffort, O as supportsClaudeAdaptiveThinking, S as resolveClaudeNativeThinkingLevelMap, T as resolveClaudeSonnet55ModelIdentity, _ as requiresClaudeMandatoryAdaptiveThinking, b as resolveClaudeModelIdentity, g as requiresClaudeDefaultSampling, h as requiresClaudeBetweenToolsThinking, j as supportsClaudeNativeMaxEffort, m as bindsClaudeThinkingPrefix, v as resolveClaudeFable5ModelIdentity, w as resolveClaudeOpus5ModelIdentity, x as resolveClaudeMythos5ModelIdentity, y as resolveClaudeHaiku55ModelIdentity } from "../index-BYDvopUB.mjs";
|
|
2
2
|
import { $ as StopReason, Et as AssistantMessageDiagnostic, Q as SimpleStreamOptions, d as Context, k as Model, pt as Usage, tt as StreamFunction } from "../types-Bd2T86VJ.mjs";
|
|
3
|
-
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-
|
|
3
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-DTuD2UNR.mjs";
|
|
4
4
|
import "../types-Kdfw_04V.mjs";
|
|
5
|
-
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-
|
|
5
|
+
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-DVv20UCL.mjs";
|
|
6
6
|
import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-C44MKrW5.mjs";
|
|
2
|
-
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-
|
|
3
|
-
import { B as resolveAnthropicServerCompactionPlan, C as logAnthropicThinkingDrops, G as applyAnthropicFallbackBoundary, H as ANTHROPIC_SERVER_SIDE_FALLBACKS, J as isAnthropicOAuthApiKey, K as readAnthropicFallbackBoundary, P as isDirectAnthropicModel, S as findActiveAnthropicToolTurnAssistantIndex, U as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as CLAUDE_OPUS_FALLBACK_MODEL_COST, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, _ as reconcileAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as ANTHROPIC_OMITTED_REASONING_TEXT, c as applyAnthropicRefusal, g as projectAnthropicTools, h as normalizeAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as normalizeAnthropicToolCallId, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as resolveAnthropicFallbackServingModelCost, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as resolveOriginalAnthropicToolName, w as readAnthropicInputTransformations, x as applyAnthropicThinkingBindingControls, y as toClaudeCodeToolName } from "../anthropic-stream-reducer-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
2
|
+
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-CIzdzpBn.mjs";
|
|
3
|
+
import { B as resolveAnthropicServerCompactionPlan, C as logAnthropicThinkingDrops, G as applyAnthropicFallbackBoundary, H as ANTHROPIC_SERVER_SIDE_FALLBACKS, J as isAnthropicOAuthApiKey, K as readAnthropicFallbackBoundary, P as isDirectAnthropicModel, S as findActiveAnthropicToolTurnAssistantIndex, U as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as CLAUDE_OPUS_FALLBACK_MODEL_COST, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, _ as reconcileAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as ANTHROPIC_OMITTED_REASONING_TEXT, c as applyAnthropicRefusal, g as projectAnthropicTools, h as normalizeAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as normalizeAnthropicToolCallId, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as resolveAnthropicFallbackServingModelCost, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as resolveOriginalAnthropicToolName, w as readAnthropicInputTransformations, x as applyAnthropicThinkingBindingControls, y as toClaudeCodeToolName } from "../anthropic-stream-reducer-BY-gN9EE.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DusktpKG.mjs";
|
|
5
5
|
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-B86jN9ii.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-CpeOT7jH.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS, u as readOpenAIResponsesCompactionWindow } from "../openai-responses-contracts-
|
|
1
|
+
import { l as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS, u as readOpenAIResponsesCompactionWindow } from "../openai-responses-contracts-Cm1QilsO.mjs";
|
|
2
2
|
import { i as resolveOpenAIResponsesServerCompactionPlan, r as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-payload-policy-C7GsA1y0.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/openai-responses-endpoint.d.ts
|
|
4
4
|
export declare function supportsNativeOpenAIResponsesEndpoint(params: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import { a as readOpenAIResponsesCompactionWindow, l as resolveOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, u as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-DbD7sGP-.mjs";
|
|
2
|
+
import { a as readOpenAIResponsesCompactionWindow, l as resolveOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, u as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-COHJK1MR.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "../index-BYDvopUB.mjs";
|
|
2
2
|
import { $ as StopReason, Q as SimpleStreamOptions, d as Context, k as Model, tt as StreamFunction } from "../types-Bd2T86VJ.mjs";
|
|
3
|
-
import { C as
|
|
3
|
+
import { C as supportsOpenAIReasoningEffort, S as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt6Model, a as BaseOpenAIStreamOptions, b as resolveOpenAIReasoningEffortForModel, d as OpenAIApiReasoningEffort, f as OpenAIReasoningEffort, g as isOpenAIGpt56Model, h as isOpenAIGpt55Model, l as codeModeToolSurfaceObserver, m as isOpenAIGpt54MiniModel, o as CodeModeToolSurfaceObservation, p as applyOpenAICompletionsToolReasoning, s as OpenAICompletionsOptions, u as reasoningTagTextPolicy, v as normalizeOpenAIReasoningEffort, w as supportsOpenAITemperature, x as resolveOpenAIReasoningEffortMapping, y as resolveOpenAIModelReasoningEfforts } from "../provider-options-DTuD2UNR.mjs";
|
|
4
4
|
import { a as reconcileOpenAIResponsesToolChoice, i as reconcileOpenAICompletionsToolChoice, n as OpenAIToolProjection, r as projectOpenAITools, t as OpenAICompletionsToolChoice } from "../openai-tool-projection-793cE3QX.mjs";
|
|
5
5
|
import "../types-Kdfw_04V.mjs";
|
|
6
|
-
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
7
|
-
import { a as ResponsesPromptObservation, c as responsesServiceTierObserver, d as OpenAIRequestReasoningEffort, o as ResponsesServiceTierObservation, s as responsesPromptObserver } from "../openai-responses-contracts-
|
|
6
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-B86jN9ii.mjs";
|
|
7
|
+
import { a as ResponsesPromptObservation, c as responsesServiceTierObserver, d as OpenAIRequestReasoningEffort, o as ResponsesServiceTierObservation, s as responsesPromptObserver } from "../openai-responses-contracts-Cm1QilsO.mjs";
|
|
8
8
|
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-DIPMrMFy.mjs";
|
|
9
9
|
import { a as resolveResponsesTerminalStopReason, i as readResponsesReasoningTokens, n as isResponsesOutputLimitToolCallError, r as mapResponsesTerminalUsage, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-BygjiAdi.mjs";
|
|
10
|
-
import "../openai-responses-compaction-replay-
|
|
10
|
+
import "../openai-responses-compaction-replay-DtEbZJbU.mjs";
|
|
11
11
|
import { ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
12
12
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
13
13
|
//#region packages/ai/src/providers/azure-deployment-map.d.ts
|
|
@@ -162,4 +162,4 @@ export declare function modelRequestBodyState(options: object, inheritFrom?: obj
|
|
|
162
162
|
export declare function serializeModelRequestBody(payload: unknown): EncodedModelRequestBody;
|
|
163
163
|
export declare function encodedModelRequestBodyStream(body: unknown): boolean | undefined;
|
|
164
164
|
//#endregion
|
|
165
|
-
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, type ResponsesServiceTierObservation, ResponsesTerminalUsagePayload, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesServiceTierObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
165
|
+
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, type ResponsesServiceTierObservation, ResponsesTerminalUsagePayload, applyOpenAICompletionsToolReasoning, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesServiceTierObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
1
|
+
import { A as supportsOpenAITemperature, C as isOpenAIGpt6Model, D as resolveOpenAIReasoningEffortMapping, E as resolveOpenAIReasoningEffortForModel, O as resolveOpenAISupportedReasoningEfforts, S as isOpenAIGpt56Model, T as resolveOpenAIModelReasoningEfforts, b as isOpenAIGpt54MiniModel, g as responsesServiceTierObserver, h as responsesPromptObserver, k as supportsOpenAIReasoningEffort, w as normalizeOpenAIReasoningEffort, x as isOpenAIGpt55Model, y as applyOpenAICompletionsToolReasoning } from "../openai-responses-contracts-DbD7sGP-.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-CvftfMfD.mjs";
|
|
3
3
|
import { _ as resolveResponsesTerminalStopReason, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, m as isResponsesOutputLimitToolCallError } from "../diagnostics-tQasYct1.mjs";
|
|
4
|
-
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-
|
|
5
|
-
import { N as bindResponsesInputMessage, St as reconcileOpenAIResponsesToolChoice, _ as isResponsesTextContentPartType, bt as projectOpenAITools, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as reconcileOpenAICompletionsToolChoice, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
6
|
-
import { c as convertMessages, o as hasResponsesWebSearchTool } from "../openai-completions-transport-
|
|
4
|
+
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-CmtE6whA.mjs";
|
|
5
|
+
import { N as bindResponsesInputMessage, St as reconcileOpenAIResponsesToolChoice, _ as isResponsesTextContentPartType, bt as projectOpenAITools, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as reconcileOpenAICompletionsToolChoice, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-C1GHTB0q.mjs";
|
|
6
|
+
import { c as convertMessages, o as hasResponsesWebSearchTool } from "../openai-completions-transport-BRjxCG1C.mjs";
|
|
7
7
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
8
8
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
9
|
-
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
12
|
-
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
9
|
+
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-Cx2nKN1G.mjs";
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-BkRt2Iy4.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-BUDpkW8I.mjs";
|
|
12
|
+
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, applyOpenAICompletionsToolReasoning, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError } from "../diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { o as getEventStreamCompletion } from "../event-stream-X2gmsUWv.mjs";
|
|
3
|
-
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-
|
|
4
|
-
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-
|
|
3
|
+
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-BBjz-Jw2.mjs";
|
|
4
|
+
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-CIzdzpBn.mjs";
|
|
5
5
|
import { i as registerSessionResourceCleanupObserver, n as getSessionResourceOwnerId, r as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-D1wgDQ8C.mjs";
|
|
6
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-
|
|
6
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-Dr_GBa9K.mjs";
|
|
7
7
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-CrxwdylR.mjs";
|
|
8
8
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
9
9
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-CfMuh5cC.mjs";
|
|
@@ -48,7 +48,7 @@ const CONTEXT_OVERFLOW_PATTERN_SCOPES = {
|
|
|
48
48
|
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,
|
|
49
49
|
/exceeds the limit of \d+/i,
|
|
50
50
|
/(?:exceeds the available context size|context size has been exceeded)/i,
|
|
51
|
-
/greater than the context length/i,
|
|
51
|
+
/greater than the context length|model is loaded with context length of only \d[\d,]* tokens, which is not enough/i,
|
|
52
52
|
/context window exceeds limit/i,
|
|
53
53
|
/exceeded model token limit/i,
|
|
54
54
|
/tokens? in request more than max tokens? allowed/i,
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { s as readAssistantThinkingAppend } from "../event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { M as hasMediaPayload, N as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-
|
|
2
|
+
import { M as hasMediaPayload, N as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-CIzdzpBn.mjs";
|
|
3
3
|
import { i as isCredentialFieldName, n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-CF9GWCs2.mjs";
|
|
4
|
-
import { P as sanitizeSurrogates } from "../transport-stream-shared-
|
|
5
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-
|
|
4
|
+
import { P as sanitizeSurrogates } from "../transport-stream-shared-Dr_GBa9K.mjs";
|
|
5
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-CmtE6whA.mjs";
|
|
6
6
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-DEE6gcB9.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/tls-certificate-errors.ts
|
|
8
8
|
const HOSTNAME_MISMATCH_CODES = /* @__PURE__ */ new Set(["ERR_TLS_CERT_ALTNAME_INVALID", "HOSTNAME_MISMATCH"]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
3
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
4
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
5
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
4
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-CmtE6whA.mjs";
|
|
5
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
6
6
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
7
7
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
package/dist/{openai-chatgpt-responses-D8-q7cgy.mjs → openai-chatgpt-responses-BjfLWIK6.mjs}
RENAMED
|
@@ -2,22 +2,22 @@ import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as app
|
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { i as clampPositiveTimerTimeoutMs } from "./number-coercion-C3hztWoY.mjs";
|
|
5
|
-
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
6
|
-
import {
|
|
5
|
+
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
6
|
+
import { A as supportsOpenAITemperature, h as responsesPromptObserver } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
7
7
|
import { r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8C.mjs";
|
|
8
8
|
import "./provider-error-CF9GWCs2.mjs";
|
|
9
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
9
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-CvftfMfD.mjs";
|
|
10
10
|
import { s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as extractErrorCodeOrErrno, y as toErrorObject } from "./diagnostics-tQasYct1.mjs";
|
|
11
|
-
import { l as consumeResponseBytes, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
11
|
+
import { l as consumeResponseBytes, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DmYqQcG7.mjs";
|
|
12
12
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
13
|
-
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
14
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
15
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
16
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
17
|
-
import { Dt as createResponseModelTracker, E as ResponsesStreamFailure, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAISimpleReasoningEffort, at as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, gt as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, o as readOpenAIMisalignmentReview, s as processResponsesStream } from "./openai-responses-shared-
|
|
18
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
13
|
+
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
14
|
+
import { n as buildManagedModelFetch } from "./host-policy-C0y3BC9R.mjs";
|
|
15
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
16
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
17
|
+
import { Dt as createResponseModelTracker, E as ResponsesStreamFailure, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAISimpleReasoningEffort, at as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, gt as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, o as readOpenAIMisalignmentReview, s as processResponsesStream } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
18
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
19
19
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-Dc42hKv6.mjs";
|
|
20
|
-
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-
|
|
20
|
+
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Cx2nKN1G.mjs";
|
|
21
21
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
22
22
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
23
23
|
//#region packages/ai/src/providers/openai-chatgpt-responses-events.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { k as clampThinkingLevel } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { c as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-
|
|
2
|
+
import { k as clampThinkingLevel } from "./host-CIzdzpBn.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
4
|
+
import { c as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-BRjxCG1C.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-compat-i-nLZxFy.d.mts → openai-completions-compat-B86jN9ii.d.mts}
RENAMED
|
@@ -10,6 +10,7 @@ type OpenAICompletionsCompatDefaults = {
|
|
|
10
10
|
supportsUsageInStreaming: boolean;
|
|
11
11
|
maxTokensField: "max_completion_tokens" | "max_tokens";
|
|
12
12
|
thinkingFormat: "openai" | "openrouter" | "deepseek" | "together" | "zai";
|
|
13
|
+
emitsDsmlToolCalls: boolean;
|
|
13
14
|
visibleReasoningDetailTypes: string[];
|
|
14
15
|
supportsStrictMode: boolean;
|
|
15
16
|
supportsJsonSchemaResponseFormat: boolean;
|
|
@@ -24,6 +25,7 @@ type ResolvedOpenAICompletionsCompat = Omit<Required<OpenAICompletionsCompat>, "
|
|
|
24
25
|
openRouterRouting?: OpenAICompletionsCompat["openRouterRouting"];
|
|
25
26
|
sessionAffinity: OpenAICompletionsSessionAffinity;
|
|
26
27
|
visibleReasoningDetailTypes: string[];
|
|
28
|
+
emitsDsmlToolCalls: boolean;
|
|
27
29
|
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
28
30
|
configuredSupportsLongCacheRetention?: boolean;
|
|
29
31
|
reasoningEffortForOff: "none" | null;
|
package/dist/{openai-completions-compat-CYX18uDk.mjs → openai-completions-compat-CpeOT7jH.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { a as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { a as resolveProviderRequestCapabilities } from "./host-policy-C0y3BC9R.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/openai-response-format.ts
|
|
4
4
|
const JSON_SCHEMA_RESPONSE_FORMAT_NAME = "openclaw_response";
|
|
5
5
|
const OLLAMA_CLOUD_ORIGIN = "https://ollama.com";
|
|
@@ -109,6 +109,7 @@ function resolveOpenAICompletionsCompatDefaults(input) {
|
|
|
109
109
|
supportsReasoningEffort: !isZai && !isTogether && !isMistral && endpointClass !== "xai-native" && (!usesExplicitProxyLikeEndpoint || input.reasoning === true),
|
|
110
110
|
supportsUsageInStreaming: supportsOpenAICompletionsStreamingUsageCompat || !isNonStandard && (isLocalEndpoint || !usesConfiguredNonOpenAIEndpoint || supportsNativeStreamingUsageCompat),
|
|
111
111
|
maxTokensField: usesMaxTokens ? "max_tokens" : "max_completion_tokens",
|
|
112
|
+
emitsDsmlToolCalls: isDeepSeek || isXiaomi || /(?:^|\/)deepseek(?:[-/]|$)/i.test(modelId ?? ""),
|
|
112
113
|
thinkingFormat: isDeepSeek || isXiaomi ? "deepseek" : isZai ? "zai" : isTogether ? "together" : isOpenRouterLike ? "openrouter" : "openai",
|
|
113
114
|
visibleReasoningDetailTypes: isOpenRouterLike ? ["response.output_text", "response.text"] : [],
|
|
114
115
|
supportsStrictMode: !isZai && !usesConfiguredNonOpenAIEndpoint,
|
|
@@ -166,6 +167,7 @@ function resolveOpenAICompletionsCompat(model, resolveCapabilities) {
|
|
|
166
167
|
requiresThinkingAsText: configured?.requiresThinkingAsText ?? false,
|
|
167
168
|
requiresReasoningContentOnAssistantMessages: configured?.requiresReasoningContentOnAssistantMessages ?? defaults.requiresReasoningContentOnAssistantMessages,
|
|
168
169
|
thinkingFormat,
|
|
170
|
+
emitsDsmlToolCalls: configured?.thinkingFormat === "deepseek" || defaults.emitsDsmlToolCalls,
|
|
169
171
|
openRouterRouting: configured?.openRouterRouting,
|
|
170
172
|
vercelGatewayRouting: configured?.vercelGatewayRouting ?? {},
|
|
171
173
|
zaiToolStream: configured?.zaiToolStream ?? false,
|
package/dist/{openai-completions-transport-DuXQOxrH.mjs → openai-completions-transport-BRjxCG1C.mjs}
RENAMED
|
@@ -3,37 +3,37 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
3
3
|
import { i as asOptionalRecord, o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { s as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-CtgOVOSv.mjs";
|
|
5
5
|
import { n as asNonNegativeFiniteNumber, r as asPositiveFiniteNumber } from "./number-coercion-C3hztWoY.mjs";
|
|
6
|
-
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
7
|
-
import {
|
|
6
|
+
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
7
|
+
import { A as supportsOpenAITemperature, C as isOpenAIGpt6Model, N as resolveOpenAIThinkingApi, _ as isResponsesServiceTierRejection, d as OpenAIResponsesWebSocketSafeRetryError, g as responsesServiceTierObserver, l as OpenAIResponsesWebSocketPostDispatchError, m as parseOpenAIResponsesWebSocketServerError, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPreDispatchError, v as nextResponsesServiceTier, y as applyOpenAICompletionsToolReasoning } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
8
8
|
import { r as uniqueStrings } from "./string-normalization-I3ux50s9.mjs";
|
|
9
9
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8C.mjs";
|
|
10
10
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
11
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
11
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-CvftfMfD.mjs";
|
|
12
12
|
import { d as hasOnlyResponsesFunctionTools, i as emitModelTransportError, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./diagnostics-tQasYct1.mjs";
|
|
13
|
-
import { c as supportsModelTools, n as estimateStringChars } from "./transport-utils-
|
|
14
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
15
|
-
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-
|
|
13
|
+
import { c as supportsModelTools, n as estimateStringChars } from "./transport-utils-DmYqQcG7.mjs";
|
|
14
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
15
|
+
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-C0y3BC9R.mjs";
|
|
16
16
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
17
|
-
import { E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, P as sanitizeSurrogates, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, h as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, v as sanitizeTransportPayloadText, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
18
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
19
|
-
import { $ as replayResponsesReasoningUpdates, A as summarizeResponsesPayload, At as log, B as responsesInputFingerprint, C as readResponsesRecoveryEvent, Ct as toOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, Dt as createResponseModelTracker, E as ResponsesStreamFailure, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationRequestFingerprint, H as recordResponsesContinuationState, I as convertResponsesMessages, It as resolvePromptCacheKey, Lt as redactIdentifier, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as safeDebugValue, Ot as detachPartialSnapshot, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, Q as isConfigurationUpdate, R as readResponsesInputReplayState, Rt as sha256Hex, S as isInvalidEncryptedContentError, St as reconcileOpenAIResponsesToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, U as resolveResponsesContinuationRequest, V as claimOpenAIResponsesHttpContinuation, W as responsesContinuationPrefixFingerprint, _t as resolveOpenAISimpleReasoningEffort, a as prepareResponsesTools, at as suppressOpenAIResponsesCompaction, bt as projectOpenAITools, c as observeResponsesStream, ct as buildOpenAISdkClientOptions, et as supportsResponsesReasoningUpdate, ft as getCompat, gt as resolveOpenAIRequestReasoning, ht as resolveOpenAIStrictToolFlagWithDiagnostics, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as summarizeOpenAITransportError, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, ot as assertCodeModeResponsesToolSurface, s as processResponsesStream, st as buildOpenAIClientHeaders, ut as enforceCodeModeResponsesToolSurface, w as resolveAzureOpenAIApiVersion, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, x as createResponsesStreamWithRecovery, xt as reconcileOpenAICompletionsToolChoice, yt as prepareOpenAITools, z as recordResponsesInputReplay } from "./openai-responses-shared-
|
|
17
|
+
import { E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, P as sanitizeSurrogates, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, h as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, v as sanitizeTransportPayloadText, y as throwIfModelStreamAborted } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
18
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-CmtE6whA.mjs";
|
|
19
|
+
import { $ as replayResponsesReasoningUpdates, A as summarizeResponsesPayload, At as log, B as responsesInputFingerprint, C as readResponsesRecoveryEvent, Ct as toOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, Dt as createResponseModelTracker, E as ResponsesStreamFailure, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationRequestFingerprint, H as recordResponsesContinuationState, I as convertResponsesMessages, It as resolvePromptCacheKey, Lt as redactIdentifier, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as safeDebugValue, Ot as detachPartialSnapshot, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, Q as isConfigurationUpdate, R as readResponsesInputReplayState, Rt as sha256Hex, S as isInvalidEncryptedContentError, St as reconcileOpenAIResponsesToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, U as resolveResponsesContinuationRequest, V as claimOpenAIResponsesHttpContinuation, W as responsesContinuationPrefixFingerprint, _t as resolveOpenAISimpleReasoningEffort, a as prepareResponsesTools, at as suppressOpenAIResponsesCompaction, bt as projectOpenAITools, c as observeResponsesStream, ct as buildOpenAISdkClientOptions, et as supportsResponsesReasoningUpdate, ft as getCompat, gt as resolveOpenAIRequestReasoning, ht as resolveOpenAIStrictToolFlagWithDiagnostics, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as summarizeOpenAITransportError, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, ot as assertCodeModeResponsesToolSurface, s as processResponsesStream, st as buildOpenAIClientHeaders, ut as enforceCodeModeResponsesToolSurface, w as resolveAzureOpenAIApiVersion, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, x as createResponsesStreamWithRecovery, xt as reconcileOpenAICompletionsToolChoice, yt as prepareOpenAITools, z as recordResponsesInputReplay } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
20
20
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
21
|
-
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-
|
|
22
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
23
|
-
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-
|
|
21
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-an0fgbDz.mjs";
|
|
22
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
23
|
+
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-CgpXhaLS.mjs";
|
|
24
24
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
25
25
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
26
26
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
27
27
|
import "./types.mjs";
|
|
28
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
28
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-O5JWdUL4.mjs";
|
|
29
29
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-Dc42hKv6.mjs";
|
|
30
30
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
31
31
|
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-DDPXsvJP.mjs";
|
|
32
32
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
33
33
|
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-CpOy9-IQ.mjs";
|
|
34
34
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
35
|
-
import { i as isOpenAIResponsesCompactionOutput, l as resolveOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, o as sanitizeResponsesImagePayload, r as createBoundedOpenAIResponsesCompactionFetch, s as applyOpenAIResponsesPayloadPolicy, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-
|
|
36
|
-
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-
|
|
35
|
+
import { i as isOpenAIResponsesCompactionOutput, l as resolveOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, o as sanitizeResponsesImagePayload, r as createBoundedOpenAIResponsesCompactionFetch, s as applyOpenAIResponsesPayloadPolicy, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-COHJK1MR.mjs";
|
|
36
|
+
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Cx2nKN1G.mjs";
|
|
37
37
|
import { randomUUID } from "node:crypto";
|
|
38
38
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
39
39
|
import { ResponsesWS } from "openai/resources/responses/ws.js";
|
|
@@ -1079,10 +1079,7 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
applyCompletionsReasoningAndRouting(params, model, reasoning, compat, policy.mode);
|
|
1081
1081
|
if (policy.mode === "managed" && compat.cacheControlFormat === "anthropic") applyCompletionsAnthropicCacheControl(params, cacheControl ?? null, cacheOptOutIndexes, markTools, !managedCompat?.requiresStringContent);
|
|
1082
|
-
if (params.tools?.length && isKnownOpenAICompletionsEndpoint(model))
|
|
1083
|
-
if (isOpenAIGpt56Model(model)) params.reasoning_effort = "none";
|
|
1084
|
-
else if (isOpenAIGpt54MiniModel(model) || isOpenAIGpt55Model(model)) delete params.reasoning_effort;
|
|
1085
|
-
}
|
|
1082
|
+
if (params.tools?.length && isKnownOpenAICompletionsEndpoint(model)) applyOpenAICompletionsToolReasoning(params, model);
|
|
1086
1083
|
return params;
|
|
1087
1084
|
}
|
|
1088
1085
|
//#endregion
|
|
@@ -1445,9 +1442,8 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1445
1442
|
const openAIModel = model;
|
|
1446
1443
|
const compat = getCompat(openAIModel);
|
|
1447
1444
|
const visibleReasoningDetailTypes = new Set(compat.visibleReasoningDetailTypes);
|
|
1448
|
-
const
|
|
1449
|
-
const
|
|
1450
|
-
const deepSeekToolCallRecoverer = !directMode && shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1445
|
+
const deepSeekTextFilter = compat.emitsDsmlToolCalls ? createDeepSeekTextFilter() : null;
|
|
1446
|
+
const deepSeekToolCallRecoverer = !directMode && compat.emitsDsmlToolCalls ? createDsmlRecoverer() : null;
|
|
1451
1447
|
const gemmaToolCallRecoverer = !directMode && /gemma-?4/i.test(model.id) ? createGemmaToolCallRecoverer() : null;
|
|
1452
1448
|
const reasoningTagTextPartitioner = createReasoningTagTextPartitioner();
|
|
1453
1449
|
if (options?.strictReasoningTags) reasoningTagTextPartitioner.markStrict();
|
|
@@ -1462,7 +1458,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1462
1458
|
const toolCallBlocksById = /* @__PURE__ */ new Map();
|
|
1463
1459
|
const encryptedReasoning = createOpenAIEncryptedToolCallReasoningTracker();
|
|
1464
1460
|
const toolArgumentPreviewSchedules = /* @__PURE__ */ new WeakMap();
|
|
1465
|
-
const provisionalCommentaryTags = directMode ? options.provisionalCommentaryTags : /* @__PURE__ */ new Map();
|
|
1461
|
+
const provisionalCommentaryTags = directMode && options.provisionalCommentaryTags ? options.provisionalCommentaryTags : /* @__PURE__ */ new Map();
|
|
1466
1462
|
const blockIndices = /* @__PURE__ */ new WeakMap();
|
|
1467
1463
|
let explicitVisibleTextBlocks;
|
|
1468
1464
|
const normalizeToolCallDeltas = createOpenAICompletionsToolCallDeltaNormalizer();
|
|
@@ -1575,6 +1571,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1575
1571
|
} : delta);
|
|
1576
1572
|
}
|
|
1577
1573
|
};
|
|
1574
|
+
const recoveredToolCallBlocks = /* @__PURE__ */ new Set();
|
|
1578
1575
|
const appendRecoveredToolCall = (toolCall) => {
|
|
1579
1576
|
if (currentBlock?.type === "toolCall") {
|
|
1580
1577
|
currentBlock = null;
|
|
@@ -1588,6 +1585,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1588
1585
|
arguments: toolCall.arguments,
|
|
1589
1586
|
partialArgs: toolCall.partialArgs
|
|
1590
1587
|
};
|
|
1588
|
+
recoveredToolCallBlocks.add(block);
|
|
1591
1589
|
currentBlock = block;
|
|
1592
1590
|
appendToolCallBlock(block);
|
|
1593
1591
|
pushStreamEvent({
|
|
@@ -1801,6 +1799,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1801
1799
|
for (const part of deepSeekTextFilter?.flush() ?? []) appendVisibleTextDelta(part);
|
|
1802
1800
|
currentBlock = null;
|
|
1803
1801
|
flushPendingPostToolCallDeltas();
|
|
1802
|
+
if (sawNativeToolCallDelta && recoveredToolCallBlocks.size > 0) output.content = output.content.filter((block) => block.type !== "toolCall" || !recoveredToolCallBlocks.has(block));
|
|
1804
1803
|
finalizeOpenAICompletionsToolCalls(output, {
|
|
1805
1804
|
allowSilentToolCallPromotion: finishReason === "stop" || sawNativeToolCallDelta && (options?.sawStreamDONE?.() ?? false),
|
|
1806
1805
|
onConfirmedToolCall(block, contentIndex) {
|
|
@@ -2774,15 +2773,16 @@ function createResponsesTransportExecutor(config) {
|
|
|
2774
2773
|
}
|
|
2775
2774
|
const sessionId = options?.sessionId;
|
|
2776
2775
|
if (config.httpContinuation && !websocketMode && !getAiTransportHost().requiresManagedTransport(model) && (supportsNativeOpenAIResponsesEndpoint(model) || resolveOpenAIResponsesPayloadPolicy(model).explicitContinuationOptIn) && sessionId && (params.store === true || supportsResponsesReasoningUpdate(params)) && !params.previous_response_id) {
|
|
2776
|
+
const restoreRequest = () => restoreResponsesReasoningState(context, model, responsesOptions, params);
|
|
2777
2777
|
continuationClaim = claimOpenAIResponsesHttpContinuation({
|
|
2778
2778
|
sessionId,
|
|
2779
2779
|
apiKey,
|
|
2780
2780
|
baseUrl: model.baseUrl,
|
|
2781
2781
|
headers: httpHeaders,
|
|
2782
2782
|
request: params,
|
|
2783
|
-
restoreRequest
|
|
2783
|
+
restoreRequest
|
|
2784
2784
|
});
|
|
2785
|
-
|
|
2785
|
+
params = continuationClaim?.fullRequest ?? restoreRequest();
|
|
2786
2786
|
}
|
|
2787
2787
|
const observePrompt = createResponsesPromptEgressObserver(responsesOptions, context.systemPrompt);
|
|
2788
2788
|
const requestStartedAt = Date.now();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
2
2
|
//#region packages/normalization-core/src/code-points.ts
|
|
3
3
|
/** Truncates to a nonnegative code-point budget; grapheme clusters may be split. */
|
|
4
4
|
function truncateCodePoints(text, maxCodePoints) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-CvftfMfD.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
7
|
-
import { F as convertProviderResponsesMessages, _t as resolveOpenAISimpleReasoningEffort, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-CmtE6whA.mjs";
|
|
7
|
+
import { F as convertProviderResponsesMessages, _t as resolveOpenAISimpleReasoningEffort, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
9
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
9
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-O5JWdUL4.mjs";
|
|
11
11
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
12
12
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
13
13
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index-BYDvopUB.mjs";
|
|
2
2
|
import { a as AssistantMessage, k as Model } from "./types-Bd2T86VJ.mjs";
|
|
3
|
-
import "./provider-options-
|
|
4
|
-
import { i as ReplayableResponseCompactionItem, l as OpenAIResponsesCompactionOutput, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-
|
|
3
|
+
import "./provider-options-DTuD2UNR.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, l as OpenAIResponsesCompactionOutput, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-Cm1QilsO.mjs";
|
|
5
5
|
import "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/transports/openai-responses-compaction-replay.d.ts
|
|
7
7
|
declare function captureOpenAIResponsesCompaction(output: Pick<AssistantMessage, "providerReplay">, item: ReplayableResponseCompactionItem, boundary: number | "retained-users", model: Model, captureMetadata?: OpenAIResponsesReasoningReplayMetadata, compactedOutput?: OpenAIResponsesCompactionOutput): void;
|
package/dist/{openai-responses-contracts-DKqMJ1Ct.d.mts → openai-responses-contracts-Cm1QilsO.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./index-BYDvopUB.mjs";
|
|
2
2
|
import { M as ModelThinkingLevel, k as Model, n as Api } from "./types-Bd2T86VJ.mjs";
|
|
3
|
-
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-
|
|
3
|
+
import { a as BaseOpenAIStreamOptions, f as OpenAIReasoningEffort } from "./provider-options-DTuD2UNR.mjs";
|
|
4
4
|
import "./types-Kdfw_04V.mjs";
|
|
5
5
|
import { ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/providers/openai-request-reasoning.d.ts
|
package/dist/{openai-responses-contracts-DlKMMTxK.mjs → openai-responses-contracts-DbD7sGP-.mjs}
RENAMED
|
@@ -159,6 +159,12 @@ function isOpenAIGpt56Model(model) {
|
|
|
159
159
|
const name = normalizeModelId(typeof model.name === "string" ? model.name : void 0);
|
|
160
160
|
return /^gpt-5\.6(?:-|$)/u.test(id) || /^gpt-5\.6(?:\s|\(|-|$)/u.test(name);
|
|
161
161
|
}
|
|
162
|
+
/** Apply the native Chat Completions tool contract after callers qualify the endpoint and model ID. */
|
|
163
|
+
function applyOpenAICompletionsToolReasoning(payload, model) {
|
|
164
|
+
if (!Array.isArray(payload.tools) || payload.tools.length === 0) return;
|
|
165
|
+
if (isOpenAIGpt56Model(model)) payload.reasoning_effort = "none";
|
|
166
|
+
else if (isOpenAIGpt54MiniModel(model) || isOpenAIGpt55Model(model)) delete payload.reasoning_effort;
|
|
167
|
+
}
|
|
162
168
|
/** Return whether a model has a known GPT-6 reasoning and sampling contract. */
|
|
163
169
|
function isOpenAIGpt6Model(model) {
|
|
164
170
|
const id = normalizeModelId(typeof model.id === "string" ? model.id : void 0);
|
|
@@ -360,4 +366,4 @@ const responsesServiceTierObserver = {
|
|
|
360
366
|
}
|
|
361
367
|
};
|
|
362
368
|
//#endregion
|
|
363
|
-
export {
|
|
369
|
+
export { supportsOpenAITemperature as A, isOpenAIGpt6Model as C, resolveOpenAIReasoningEffortMapping as D, resolveOpenAIReasoningEffortForModel as E, listMappedModelThinkingLevels as M, resolveOpenAIThinkingApi as N, resolveOpenAISupportedReasoningEfforts as O, isOpenAIGpt56Model as S, resolveOpenAIModelReasoningEfforts as T, isResponsesServiceTierRejection as _, OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE as a, isOpenAIGpt54MiniModel as b, OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE as c, OpenAIResponsesWebSocketSafeRetryError as d, RESPONSE_FAILED_NO_DETAILS_MESSAGE as f, responsesServiceTierObserver as g, responsesPromptObserver as h, OPENAI_RESPONSES_APIS as i, MODEL_CATALOG_THINKING_LEVELS as j, supportsOpenAIReasoningEffort as k, OpenAIResponsesWebSocketPostDispatchError as l, parseOpenAIResponsesWebSocketServerError as m, DEFAULT_AZURE_OPENAI_API_VERSION as n, OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY as o, isPreviousResponseRejection as p, OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS as r, OPENAI_RESPONSES_REASONING_REPLAY_META_KEY as s, AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS as t, OpenAIResponsesWebSocketPreDispatchError as u, nextResponsesServiceTier as v, normalizeOpenAIReasoningEffort as w, isOpenAIGpt55Model as x, applyOpenAICompletionsToolReasoning as y };
|
package/dist/{openai-responses-endpoint-CinGh4VZ.mjs → openai-responses-endpoint-COHJK1MR.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { c as readStringValue, i as normalizeOptionalLowercaseString, n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { i as OPENAI_RESPONSES_APIS, k as supportsOpenAIReasoningEffort } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
4
4
|
import { t as canonicalizeBase64 } from "./base64-C8CdcsjU.mjs";
|
|
5
5
|
import { t as parsePositiveInteger } from "./positive-integer-CqWjqSi9.mjs";
|
|
6
6
|
import { n as createSseByteGuard } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { h as responsesPromptObserver } from "./openai-responses-contracts-
|
|
3
|
-
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
4
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
2
|
+
import { h as responsesPromptObserver } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
3
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
4
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-CmtE6whA.mjs";
|
|
5
5
|
//#region packages/ai/src/transports/openai-responses-prompt-observer-internal.ts
|
|
6
6
|
function readFinalResponsesPrompt(request) {
|
|
7
7
|
if (typeof request.instructions === "string") return ["instructions", request.instructions];
|
|
@@ -5,25 +5,25 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
5
5
|
import { o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
6
6
|
import { a as normalizeOptionalString, c as readStringValue, n as normalizeLowercaseStringOrEmpty, o as normalizeStringifiedOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
7
7
|
import { t as asFiniteNumber } from "./number-coercion-C3hztWoY.mjs";
|
|
8
|
-
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
9
|
-
import { A as
|
|
8
|
+
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
9
|
+
import { A as supportsOpenAITemperature, D as resolveOpenAIReasoningEffortMapping, E as resolveOpenAIReasoningEffortForModel, N as resolveOpenAIThinkingApi, T as resolveOpenAIModelReasoningEfforts, _ as isResponsesServiceTierRejection, a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, f as RESPONSE_FAILED_NO_DETAILS_MESSAGE, g as responsesServiceTierObserver, i as OPENAI_RESPONSES_APIS, j as MODEL_CATALOG_THINKING_LEVELS, k as supportsOpenAIReasoningEffort, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as isPreviousResponseRejection, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, v as nextResponsesServiceTier, w as normalizeOpenAIReasoningEffort } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8C.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
12
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
12
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-CvftfMfD.mjs";
|
|
13
13
|
import { _ as resolveResponsesTerminalStopReason, a as resolveModelPayloadDebugMode, d as hasOnlyResponsesFunctionTools, f as isResponsesProviderTool, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, o as resolveModelSseDebugMode, r as emitModelTransportDebug, u as ResponsesOutputIdentityError } from "./diagnostics-tQasYct1.mjs";
|
|
14
|
-
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-
|
|
15
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
16
|
-
import { r as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
17
|
-
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
18
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody } from "./simple-options-
|
|
19
|
-
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext, t as encodeTextSignatureV1 } from "./text-signature-
|
|
20
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
14
|
+
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-DmYqQcG7.mjs";
|
|
15
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
16
|
+
import { r as resolveModelRequestTimeoutMs } from "./host-policy-C0y3BC9R.mjs";
|
|
17
|
+
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
18
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody } from "./simple-options-CmtE6whA.mjs";
|
|
19
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext, t as encodeTextSignatureV1 } from "./text-signature-an0fgbDz.mjs";
|
|
20
|
+
import { n as transformProviderMessages } from "./assistant-output-DDZq4a3j.mjs";
|
|
21
21
|
import { n as projectRuntimeToolInputSchema, t as prepareRuntimeToolInputSchema } from "./tool-schema-json-projection-B8sG1I9v.mjs";
|
|
22
22
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
23
23
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
24
24
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-Dc42hKv6.mjs";
|
|
25
25
|
import { a as resolveOpenAIProjectedToolsStrictToolFlag, f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-DDPXsvJP.mjs";
|
|
26
|
-
import { a as readOpenAIResponsesCompactionWindow, i as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint } from "./openai-responses-endpoint-
|
|
26
|
+
import { a as readOpenAIResponsesCompactionWindow, i as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint } from "./openai-responses-endpoint-COHJK1MR.mjs";
|
|
27
27
|
import { hash, randomUUID } from "node:crypto";
|
|
28
28
|
//#region packages/normalization-core/src/node-crypto.ts
|
|
29
29
|
function sha256Hex(input) {
|
|
@@ -20,6 +20,11 @@ declare function isOpenAIGpt54MiniModel(model: OpenAIReasoningModel): boolean;
|
|
|
20
20
|
declare function isOpenAIGpt55Model(model: OpenAIReasoningModel): boolean;
|
|
21
21
|
/** Return whether a model is the GPT-5.6 family. */
|
|
22
22
|
declare function isOpenAIGpt56Model(model: OpenAIReasoningModel): boolean;
|
|
23
|
+
/** Apply the native Chat Completions tool contract after callers qualify the endpoint and model ID. */
|
|
24
|
+
declare function applyOpenAICompletionsToolReasoning(payload: Record<string, unknown>, model: {
|
|
25
|
+
id: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
}): void;
|
|
23
28
|
/** Return whether a model has a known GPT-6 reasoning and sampling contract. */
|
|
24
29
|
declare function isOpenAIGpt6Model(model: OpenAIReasoningModel): boolean;
|
|
25
30
|
/** Normalize user-facing reasoning effort names to API effort names. */
|
|
@@ -149,4 +154,4 @@ type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
|
|
|
149
154
|
reasoningEffort?: OpenAIReasoningEffort | "off";
|
|
150
155
|
};
|
|
151
156
|
//#endregion
|
|
152
|
-
export {
|
|
157
|
+
export { supportsOpenAIReasoningEffort as C, resolveOpenAISupportedReasoningEfforts as S, isOpenAIGpt6Model as _, BaseOpenAIStreamOptions as a, resolveOpenAIReasoningEffortForModel as b, OpenAIResponsesCompactionRejection as c, OpenAIApiReasoningEffort as d, OpenAIReasoningEffort as f, isOpenAIGpt56Model as g, isOpenAIGpt55Model as h, AnthropicThinkingDisplay as i, codeModeToolSurfaceObserver as l, isOpenAIGpt54MiniModel as m, AnthropicEffort as n, CodeModeToolSurfaceObservation as o, applyOpenAICompletionsToolReasoning as p, AnthropicOptions as r, OpenAICompletionsOptions as s, AnthropicContextManagementOptions as t, reasoningTagTextPolicy as u, normalizeOpenAIReasoningEffort as v, supportsOpenAITemperature as w, resolveOpenAIReasoningEffortMapping as x, resolveOpenAIModelReasoningEfforts as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-5qSGvIUH.mjs";
|
|
3
|
-
import { Ft as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-
|
|
3
|
+
import { Ft as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
4
4
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { n as projectProviderError } from "./provider-error-CF9GWCs2.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-CvftfMfD.mjs";
|
|
4
4
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
6
6
|
/** Source id used for built-in API provider registrations. */
|
|
@@ -50,39 +50,39 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const registerBuiltIns = [
|
|
53
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
53
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-DusktpKG.mjs").then((n) => n.t), (module) => ({
|
|
54
54
|
stream: module.streamAnthropic,
|
|
55
55
|
streamSimple: module.streamSimpleAnthropic
|
|
56
56
|
})),
|
|
57
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
57
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-BkRt2Iy4.mjs").then((n) => n.t), (module) => ({
|
|
58
58
|
stream: module.streamOpenAICompletions,
|
|
59
59
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
60
60
|
})),
|
|
61
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
61
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-CDK7WGwC.mjs"), (module) => ({
|
|
62
62
|
stream: module.streamMistral,
|
|
63
63
|
streamSimple: module.streamSimpleMistral
|
|
64
64
|
})),
|
|
65
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
65
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-BUDpkW8I.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamOpenAIResponses,
|
|
67
67
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
69
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-yuBKi0s4.mjs"), (module) => ({
|
|
70
70
|
stream: module.streamAzureOpenAIResponses,
|
|
71
71
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
73
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-BjfLWIK6.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamOpenAICodexResponses,
|
|
75
75
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
77
|
+
createLazyRegistration("google-generative-ai", () => import("./google-NMkwYgCy.mjs"), (module) => ({
|
|
78
78
|
stream: module.streamGoogle,
|
|
79
79
|
streamSimple: module.streamSimpleGoogle
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("google-interactions", () => import("./google-interactions-
|
|
81
|
+
createLazyRegistration("google-interactions", () => import("./google-interactions-BEV3C85P.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamGoogleInteractions,
|
|
83
83
|
streamSimple: module.streamSimpleGoogleInteractions
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
85
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-DJvQwNgr.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
3
|
-
import { M as hasMediaPayload, r as getAiTransportHost } from "./host-
|
|
4
|
-
import { g as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
3
|
+
import { M as hasMediaPayload, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
4
|
+
import { g as responsesServiceTierObserver } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
5
5
|
import { s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
6
|
-
import { P as sanitizeSurrogates, i as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
6
|
+
import { P as sanitizeSurrogates, i as copyProviderAcceptanceObserver } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/prompt-cache-stability.ts
|
|
8
8
|
/**
|
|
9
9
|
* Prompt-cache normalization helpers. They keep generated prompt sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as bindAssistantMessageEventStream, o as getEventStreamCompletion } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-
|
|
2
|
+
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-CIzdzpBn.mjs";
|
|
3
3
|
import { i as registerSessionResourceCleanupObserver, t as cleanupSessionResources } from "./session-resources-D1wgDQ8C.mjs";
|
|
4
4
|
//#region packages/ai/src/api-registry.ts
|
|
5
5
|
function wrapStream(api, stream) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { A as shortHash } from "./transport-stream-shared-
|
|
2
|
+
import { A as shortHash } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
4
4
|
function isProviderReplayContext(value) {
|
|
5
5
|
return isRecord(value) && typeof value.provider === "string" && typeof value.api === "string" && typeof value.model === "string" && (value.baseUrlHash === void 0 || typeof value.baseUrlHash === "string") && (value.sessionHash === void 0 || typeof value.sessionHash === "string") && (value.authProfileHash === void 0 || typeof value.authProfileHash === "string");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as createAssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
3
|
import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { E as headersToRecord, r as getAiTransportHost } from "./host-
|
|
4
|
+
import { E as headersToRecord, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
5
5
|
import { a as projectDiagnosticValue, n as projectProviderError } from "./provider-error-CF9GWCs2.mjs";
|
|
6
6
|
import { l as isTransientNetworkError } from "./diagnostics-tQasYct1.mjs";
|
|
7
7
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
2
2
|
import { s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
3
3
|
import "./internal/retry-after.mjs";
|
|
4
|
-
import { N as raceWithTimeout } from "./transport-stream-shared-
|
|
4
|
+
import { N as raceWithTimeout } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
5
5
|
import "./positive-integer-CqWjqSi9.mjs";
|
|
6
6
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
7
7
|
async function consumeResponseBytes(options) {
|
package/dist/transports.d.mts
CHANGED
|
@@ -2,14 +2,14 @@ import "./index-BYDvopUB.mjs";
|
|
|
2
2
|
import { $ as StopReason, N as OpenAICompletionsCompat, Nt as ModelDataThinkingFormat, Q as SimpleStreamOptions, V as ProviderReplayState, a as AssistantMessage, d as Context, et as StreamFn, gt as VercelGatewayRouting, k as Model, l as CacheRetention, lt as Tool, n as Api, nt as StreamOptions, ot as ThinkingContent, pt as Usage, rt as TextContent, ut as ToolCall } from "./types-Bd2T86VJ.mjs";
|
|
3
3
|
import { n as ApiRegistry } from "./api-registry-BhXXYdRA.mjs";
|
|
4
4
|
import { o as AiProviderStreamHookContext } from "./host-CTDz7LXD.mjs";
|
|
5
|
-
import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-
|
|
5
|
+
import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-DTuD2UNR.mjs";
|
|
6
6
|
import { n as OpenAIToolProjection } from "./openai-tool-projection-793cE3QX.mjs";
|
|
7
7
|
import "./types-Kdfw_04V.mjs";
|
|
8
|
-
import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicPayloadPolicy, f as resolveAnthropicRequestBetaHeader, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, m as supportsAnthropicServerSideFallback, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicEphemeralCacheControl } from "./anthropic-payload-policy-
|
|
9
|
-
import { a as resolveOpenAICompletionsCompat, i as isOpenAICodexResponsesModel, n as detectOpenAICompletionsCompat, o as resolveOpenAIPromptCacheKeySupport, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { l as OpenAIResponsesCompactionOutput, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-
|
|
8
|
+
import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicPayloadPolicy, f as resolveAnthropicRequestBetaHeader, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, m as supportsAnthropicServerSideFallback, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicEphemeralCacheControl } from "./anthropic-payload-policy-DVv20UCL.mjs";
|
|
9
|
+
import { a as resolveOpenAICompletionsCompat, i as isOpenAICodexResponsesModel, n as detectOpenAICompletionsCompat, o as resolveOpenAIPromptCacheKeySupport, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-B86jN9ii.mjs";
|
|
10
|
+
import { l as OpenAIResponsesCompactionOutput, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-Cm1QilsO.mjs";
|
|
11
11
|
import { i as resolveOpenAIResponsesServerCompactionPlan, n as resolveOpenAIResponsesCompactEndpointPlan, r as resolveOpenAIResponsesPayloadPolicy, t as applyOpenAIResponsesPayloadPolicy } from "./openai-responses-payload-policy-C7GsA1y0.mjs";
|
|
12
|
-
import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-
|
|
12
|
+
import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-DtEbZJbU.mjs";
|
|
13
13
|
import { C as withProviderAcceptanceObserver, S as transportAbortError, _ as notifyProviderStreamOpened, a as coerceTransportToolCallArguments, b as sanitizeTransportPayloadText, c as createModelStreamCooperativeScheduler, d as finalizeTerminalToolCallArguments, f as finalizeTransportStream, g as notifyProviderHttpResponse, h as notifyProviderHttpMetadata, i as assignTransportErrorDetails, l as createWritableTransportEventStream, m as mergeTransportHeaders, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as iterateModelStream, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as failTransportStream, v as parseTerminalToolCallArguments, w as withProviderResponseHook, x as throwIfModelStreamAborted, y as sanitizeNonEmptyTransportPayloadText } from "./transport-stream-shared-BmpzDtdQ.mjs";
|
|
14
14
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
|
|
15
15
|
import { r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-a5ysBBga.mjs";
|
|
@@ -288,6 +288,7 @@ export declare function getCompat(model: OpenAIModeModel): {
|
|
|
288
288
|
cacheControlFormat?: OpenAICompletionsCompat["cacheControlFormat"];
|
|
289
289
|
sessionAffinity: "none" | "openai" | "openrouter";
|
|
290
290
|
visibleReasoningDetailTypes: string[];
|
|
291
|
+
emitsDsmlToolCalls: boolean;
|
|
291
292
|
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
292
293
|
configuredSupportsLongCacheRetention?: boolean;
|
|
293
294
|
reasoningEffortForOff: "none" | null;
|
package/dist/transports.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { w as supportsClaudeAdaptiveThinking } from "./src-C44MKrW5.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
4
|
-
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-
|
|
5
|
-
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CIzdzpBn.mjs";
|
|
5
|
+
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DbD7sGP-.mjs";
|
|
6
6
|
import { o as redactDiagnosticText, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
7
7
|
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, y as toErrorObject } from "./diagnostics-tQasYct1.mjs";
|
|
8
|
-
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
-
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
11
|
-
import { A as applyAnthropicPayloadPolicyToParams, B as resolveAnthropicServerCompactionPlan, D as suppressAnthropicCompaction, E as resolveNewestAnthropicCompaction, F as logAnthropicContextEdits, I as resolveAnthropicCacheOptions, J as isAnthropicOAuthApiKey, L as resolveAnthropicEphemeralCacheControl, M as buildAnthropicSystemBlocks, N as isAnthropicServerToolClearingEnabled, O as applyAnthropicContextManagementToRequest, P as isDirectAnthropicModel, R as resolveAnthropicPayloadPolicy, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, f as resolveAnthropicTransportOptions, j as applyAnthropicRequestCacheControl, k as applyAnthropicEphemeralCacheControlMarkers, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as resolveAnthropicRequestBetaHeader } from "./anthropic-stream-reducer-
|
|
12
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
13
|
-
import { D as sortPromptCacheToolsByName } from "./simple-options-
|
|
14
|
-
import { At as log, Dt as createResponseModelTracker, Et as createOpenAIResponseHook, Ft as resolveOpenAIClientBaseUrl, It as resolvePromptCacheKey, J as OPENAI_RESPONSES_ID_MAX_LENGTH, K as OPENAI_RESPONSES_CALL_ID_RE, L as resolveReplayableResponsesMessageId, M as resolveResponsesContextUsageBoundary, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, Ot as detachPartialSnapshot, Pt as readOpenAICompletionsReasoningBatch, Tt as createOpenAIProviderAcceptanceHook, X as shouldNormalizeOpenAIResponsesToolCallId, Y as normalizeOpenAIResponsesFunctionCallId, Z as splitOpenAIFunctionCallPairing, ct as buildOpenAISdkClientOptions, dt as filterCodeModePayloadTools, ft as getCompat, ht as resolveOpenAIStrictToolFlagWithDiagnostics, it as resolveNewestOpenAIResponsesCompactionReplay, jt as measureUtf8AppendBytes, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, ot as assertCodeModeResponsesToolSurface, pt as readCodeModePayloadToolName, q as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, rt as captureOpenAIResponsesCompaction, st as buildOpenAIClientHeaders, tt as CompactionReplayRefreshRequiredError, ut as enforceCodeModeResponsesToolSurface, vt as resolveOpenAIReasoningEffortMap, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP } from "./openai-responses-shared-
|
|
8
|
+
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DmYqQcG7.mjs";
|
|
9
|
+
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-CpeOT7jH.mjs";
|
|
10
|
+
import { t as buildGuardedModelFetch } from "./host-policy-C0y3BC9R.mjs";
|
|
11
|
+
import { A as applyAnthropicPayloadPolicyToParams, B as resolveAnthropicServerCompactionPlan, D as suppressAnthropicCompaction, E as resolveNewestAnthropicCompaction, F as logAnthropicContextEdits, I as resolveAnthropicCacheOptions, J as isAnthropicOAuthApiKey, L as resolveAnthropicEphemeralCacheControl, M as buildAnthropicSystemBlocks, N as isAnthropicServerToolClearingEnabled, O as applyAnthropicContextManagementToRequest, P as isDirectAnthropicModel, R as resolveAnthropicPayloadPolicy, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, f as resolveAnthropicTransportOptions, j as applyAnthropicRequestCacheControl, k as applyAnthropicEphemeralCacheControlMarkers, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as resolveAnthropicRequestBetaHeader } from "./anthropic-stream-reducer-BY-gN9EE.mjs";
|
|
12
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-Dr_GBa9K.mjs";
|
|
13
|
+
import { D as sortPromptCacheToolsByName } from "./simple-options-CmtE6whA.mjs";
|
|
14
|
+
import { At as log, Dt as createResponseModelTracker, Et as createOpenAIResponseHook, Ft as resolveOpenAIClientBaseUrl, It as resolvePromptCacheKey, J as OPENAI_RESPONSES_ID_MAX_LENGTH, K as OPENAI_RESPONSES_CALL_ID_RE, L as resolveReplayableResponsesMessageId, M as resolveResponsesContextUsageBoundary, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, Ot as detachPartialSnapshot, Pt as readOpenAICompletionsReasoningBatch, Tt as createOpenAIProviderAcceptanceHook, X as shouldNormalizeOpenAIResponsesToolCallId, Y as normalizeOpenAIResponsesFunctionCallId, Z as splitOpenAIFunctionCallPairing, ct as buildOpenAISdkClientOptions, dt as filterCodeModePayloadTools, ft as getCompat, ht as resolveOpenAIStrictToolFlagWithDiagnostics, it as resolveNewestOpenAIResponsesCompactionReplay, jt as measureUtf8AppendBytes, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, ot as assertCodeModeResponsesToolSurface, pt as readCodeModePayloadToolName, q as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, rt as captureOpenAIResponsesCompaction, st as buildOpenAIClientHeaders, tt as CompactionReplayRefreshRequiredError, ut as enforceCodeModeResponsesToolSurface, vt as resolveOpenAIReasoningEffortMap, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP } from "./openai-responses-shared-C1GHTB0q.mjs";
|
|
15
15
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
16
16
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
17
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
17
|
+
import { t as createAssistantOutput } from "./assistant-output-DDZq4a3j.mjs";
|
|
18
18
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
19
|
-
import { a as requestPreparedOpenAIResponsesCompaction, d as applyCompletionsAnthropicCacheControl, f as hasOpenAICompatibleConversationTurn, h as createDeepSeekTextFilter, i as createOpenAIResponsesTransportStreamFn, l as flattenCompletionMessagesToStringContent, m as resolveMaxTokensParam, p as canonicalizeMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, s as buildOpenAICompletionsParams, t as createOpenAICompletionsTransportStreamFn, u as stripCompletionMessagesToRoleContent } from "./openai-completions-transport-
|
|
20
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
21
|
-
import { c as resolveOpenAIResponsesCompactEndpointPlan, l as resolveOpenAIResponsesPayloadPolicy, o as sanitizeResponsesImagePayload, s as applyOpenAIResponsesPayloadPolicy, u as resolveOpenAIResponsesServerCompactionPlan } from "./openai-responses-endpoint-
|
|
19
|
+
import { a as requestPreparedOpenAIResponsesCompaction, d as applyCompletionsAnthropicCacheControl, f as hasOpenAICompatibleConversationTurn, h as createDeepSeekTextFilter, i as createOpenAIResponsesTransportStreamFn, l as flattenCompletionMessagesToStringContent, m as resolveMaxTokensParam, p as canonicalizeMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, s as buildOpenAICompletionsParams, t as createOpenAICompletionsTransportStreamFn, u as stripCompletionMessagesToRoleContent } from "./openai-completions-transport-BRjxCG1C.mjs";
|
|
20
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-BhdxpH4K.mjs";
|
|
21
|
+
import { c as resolveOpenAIResponsesCompactEndpointPlan, l as resolveOpenAIResponsesPayloadPolicy, o as sanitizeResponsesImagePayload, s as applyOpenAIResponsesPayloadPolicy, u as resolveOpenAIResponsesServerCompactionPlan } from "./openai-responses-endpoint-COHJK1MR.mjs";
|
|
22
22
|
import { randomUUID } from "node:crypto";
|
|
23
23
|
//#region packages/ai/src/transports/anthropic-transport-stream.ts
|
|
24
24
|
const ANTHROPIC_MESSAGES_ERROR_BODY_MAX_BYTES = 8192;
|