@openclaw/ai 2026.10.10-beta.2 → 2026.10.10-beta.3
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-D6spfBri.mjs → anthropic-16B3dgU4.mjs} +6 -6
- package/dist/{anthropic-payload-policy-Cr8xjazC.d.mts → anthropic-payload-policy-rqCq9sT_.d.mts} +1 -1
- package/dist/{anthropic-stream-reducer-CzPXOaLM.mjs → anthropic-stream-reducer-kxyYeesU.mjs} +7 -7
- package/dist/{anthropic-tool-projection-BdAS3rtJ.mjs → anthropic-tool-projection-DA_KeluM.mjs} +1 -1
- package/dist/{anthropic-tool-projection-DKH-aEWU.d.mts → anthropic-tool-projection-JTvMo4KG.d.mts} +1 -1
- package/dist/{assistant-output-6iFA1nbC.mjs → assistant-output-DbgdWAhJ.mjs} +2 -2
- package/dist/{azure-openai-responses-0TqHwnlD.mjs → azure-openai-responses-DFcmh7LD.mjs} +4 -4
- package/dist/{google-zWpkDSeN.mjs → google-CZ6uGVkV.mjs} +2 -2
- package/dist/{google-interactions-DVQ7AaSF.mjs → google-interactions-G1sECmlf.mjs} +7 -7
- package/dist/{google-messages-DfpHVTaD.mjs → google-messages-B-svbJuN.mjs} +3 -3
- package/dist/{google-provider-stream-DJ8ANfsS.mjs → google-provider-stream-DlhaCvCf.mjs} +6 -6
- package/dist/{google-shared-VTcCJLW3.mjs → google-shared-Cif7nve-.mjs} +5 -5
- package/dist/{google-vertex-Bkfizj7M.mjs → google-vertex-BZTcYnWU.mjs} +2 -2
- package/dist/{host-policy-mpqGhbeM.mjs → host-policy-Ci1cKluf.mjs} +1 -1
- package/dist/{host-B2gk-d1H.mjs → host-rCxf5Tjd.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.d.mts +3 -3
- package/dist/internal/anthropic.mjs +4 -4
- 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 +4 -4
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +1 -1
- package/dist/internal/shared.mjs +2 -2
- package/dist/internal/tool-schema.d.mts +2 -2
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{mistral-CATJrwne.mjs → mistral-C_ImzxlK.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-CtdnpWwe.mjs → openai-chatgpt-responses-CZH7am6J.mjs} +11 -11
- package/dist/{openai-completions-B6sET3oI.mjs → openai-completions-BKHzrKjZ.mjs} +3 -3
- package/dist/{openai-completions-compat-CFhQ3UVU.mjs → openai-completions-compat-BaSOvO4F.mjs} +2 -2
- package/dist/{openai-completions-transport-DviPEqw3.mjs → openai-completions-transport-PLb2fTJW.mjs} +16 -19
- package/dist/{openai-prompt-cache-DJ_P143P.mjs → openai-prompt-cache-C9l8FtID.mjs} +1 -1
- package/dist/{openai-responses-BXsJK-mD.mjs → openai-responses-6GnBON7Q.mjs} +6 -6
- package/dist/{openai-responses-compaction-replay-Cvnl_nCq.d.mts → openai-responses-compaction-replay-C-yvB5g5.d.mts} +2 -2
- package/dist/{openai-responses-contracts-CQ4_AWjL.d.mts → openai-responses-contracts-D-VwWWjx.d.mts} +1 -1
- package/dist/{openai-responses-contracts-Bx-16mnf.mjs → openai-responses-contracts-DCG51Us0.mjs} +7 -1
- package/dist/{openai-responses-endpoint-D4v-eeYy.mjs → openai-responses-endpoint-JbBT8IDv.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-CTdAb2v1.mjs → openai-responses-request-lifecycle-GbTsoa3_.mjs} +7 -7
- package/dist/{openai-responses-shared-Bv_1NtH9.mjs → openai-responses-shared-Bl7Bm4Tn.mjs} +12 -12
- package/dist/{openai-tool-schema-Buv0GXFb.mjs → openai-tool-schema-CGhEl7ao.mjs} +2 -2
- package/dist/{provider-options-DeYeaflL.d.mts → provider-options-Bo8GzTGX.d.mts} +6 -1
- package/dist/{provider-replay-context-J6CfU3m1.mjs → provider-replay-context-BGueqVCi.mjs} +2 -2
- package/dist/{provider-transport-turn-state-Jxppzuc2.mjs → provider-transport-turn-state-DM9Mbjfp.mjs} +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-BYgC6kse.mjs → simple-options-BdJJbzZk.mjs} +3 -3
- package/dist/{stream-DLBirT0e.mjs → stream-DQqGjhbq.mjs} +1 -1
- package/dist/{tool-schema-json-projection-B0hHDV7N.mjs → tool-schema-json-projection-Cvq69Ajp.mjs} +1 -1
- package/dist/{transport-stream-shared-CzQlAzJH.mjs → transport-stream-shared-DdnJGEj0.mjs} +1 -1
- package/dist/transports.d.mts +4 -4
- package/dist/transports.mjs +13 -13
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
2
|
import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.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 { u as streamFragmentError } from "./provider-replay-context-
|
|
6
|
-
import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
5
|
+
import { u as streamFragmentError } from "./provider-replay-context-BGueqVCi.mjs";
|
|
6
|
+
import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-kxyYeesU.mjs";
|
|
7
7
|
import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
8
|
-
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
9
|
-
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
8
|
+
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-BdJJbzZk.mjs";
|
|
9
|
+
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
10
10
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.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-DbgdWAhJ.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-D088S4Cd.mjs";
|
package/dist/{anthropic-payload-policy-Cr8xjazC.d.mts → anthropic-payload-policy-rqCq9sT_.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./index-DSprYWaz.mjs";
|
|
2
2
|
import { k as Model } from "./types-CVYzKrMl.mjs";
|
|
3
|
-
import { t as AnthropicContextManagementOptions } from "./provider-options-
|
|
3
|
+
import { t as AnthropicContextManagementOptions } from "./provider-options-Bo8GzTGX.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-CzPXOaLM.mjs → anthropic-stream-reducer-kxyYeesU.mjs}
RENAMED
|
@@ -4,17 +4,17 @@ 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 { a as normalizeOptionalLowercaseString, i as normalizeNullableString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-37gmNkuA.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 { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
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-rCxf5Tjd.mjs";
|
|
8
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BGueqVCi.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-Ci1cKluf.mjs";
|
|
11
11
|
import { i as resolveCacheRetention } from "./cloudflare-Dttf8jKq.mjs";
|
|
12
12
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
13
|
-
import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
14
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
13
|
+
import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
14
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
15
15
|
import { t as parsePositiveInteger } from "./positive-integer-Bb4Evc7L.mjs";
|
|
16
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
17
|
-
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-
|
|
16
|
+
import { n as transformProviderMessages } from "./assistant-output-DbgdWAhJ.mjs";
|
|
17
|
+
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-DA_KeluM.mjs";
|
|
18
18
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
19
19
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
20
20
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
package/dist/{anthropic-tool-projection-BdAS3rtJ.mjs → anthropic-tool-projection-DA_KeluM.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
3
|
-
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-
|
|
3
|
+
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/anthropic-tool-projection.ts
|
|
5
5
|
const CLAUDE_CODE_TOOL_LOOKUP = new Map([
|
|
6
6
|
"Read",
|
package/dist/{anthropic-tool-projection-DKH-aEWU.d.mts → anthropic-tool-projection-JTvMo4KG.d.mts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as AnthropicOptions } from "./provider-options-
|
|
1
|
+
import { r as AnthropicOptions } from "./provider-options-Bo8GzTGX.mjs";
|
|
2
2
|
import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
|
|
3
3
|
//#region packages/ai/src/providers/anthropic-tool-projection.d.ts
|
|
4
4
|
type AnthropicToolDescriptor = {
|
|
@@ -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-rCxf5Tjd.mjs";
|
|
2
|
+
import { a as createEmptyTransportUsage } from "./transport-stream-shared-DdnJGEj0.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,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-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-BdJJbzZk.mjs";
|
|
4
4
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
5
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
6
|
-
import { F as convertProviderResponsesMessages, It as resolvePromptCacheKey, Lt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
5
|
+
import { t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
6
|
+
import { F as convertProviderResponsesMessages, It as resolvePromptCacheKey, Lt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-Bl7Bm4Tn.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-D088S4Cd.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-rCxf5Tjd.mjs";
|
|
2
2
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
4
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.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-DlhaCvCf.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,15 +1,15 @@
|
|
|
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 { t as buildGuardedModelFetch } from "./host-policy-
|
|
3
|
+
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
4
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Ci1cKluf.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
6
|
-
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
7
|
-
import { b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-
|
|
6
|
+
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
7
|
+
import { b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.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-DbgdWAhJ.mjs";
|
|
10
|
+
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-Cif7nve-.mjs";
|
|
11
11
|
//#region packages/ai/package.json
|
|
12
|
-
var version = "2026.10.10-beta.
|
|
12
|
+
var version = "2026.10.10-beta.3";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region packages/ai/src/providers/google-interactions-request.ts
|
|
15
15
|
const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-rCxf5Tjd.mjs";
|
|
3
3
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
4
4
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
5
|
-
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-
|
|
6
|
-
import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
5
|
+
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-BdJJbzZk.mjs";
|
|
6
|
+
import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
7
7
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
8
8
|
import { isGoogleGemini4Model } from "./internal/google-model-family.mjs";
|
|
9
9
|
//#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 { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { f as mergeTransportHeaders } from "./transport-stream-shared-
|
|
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-rCxf5Tjd.mjs";
|
|
3
|
+
import { n as buildManagedModelFetch } from "./host-policy-Ci1cKluf.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-BdJJbzZk.mjs";
|
|
5
|
+
import { f as mergeTransportHeaders } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
7
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-Cif7nve-.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,10 +1,10 @@
|
|
|
1
|
-
import { k as clampThinkingLevel } from "./host-
|
|
1
|
+
import { k as clampThinkingLevel } from "./host-rCxf5Tjd.mjs";
|
|
2
2
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
3
|
-
import { w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
4
|
-
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-
|
|
5
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
3
|
+
import { w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
4
|
+
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
5
|
+
import { n as transformProviderMessages } from "./assistant-output-DbgdWAhJ.mjs";
|
|
6
6
|
import { isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
7
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
7
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-B-svbJuN.mjs";
|
|
8
8
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
9
9
|
//#region packages/ai/src/providers/google-shared.ts
|
|
10
10
|
function convertMessages(model, context) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.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-rCxf5Tjd.mjs";
|
|
3
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-DlhaCvCf.mjs";
|
|
4
4
|
import { GoogleGenAI } from "@google/genai";
|
|
5
5
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
6
6
|
const API_VERSION = "v1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
|
@@ -2,7 +2,7 @@ import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffor
|
|
|
2
2
|
import { t as DEFAULT_MISSING_TOOL_RESULT_TEXT } from "./types-BXd0kI8-.mjs";
|
|
3
3
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { E as resolveOpenAIModelReasoningEfforts, F as MODEL_CATALOG_THINKING_LEVELS, I as listMappedModelThinkingLevels, R as resolveOpenAIThinkingApi, i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DCG51Us0.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) {
|
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-9FSkE8T-.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-DQqGjhbq.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-rCxf5Tjd.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, supportsClaudeServerCompaction, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
@@ -1,9 +1,9 @@
|
|
|
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-DSprYWaz.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-CVYzKrMl.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-Bo8GzTGX.mjs";
|
|
4
4
|
import "../types-CBJthzJX.mjs";
|
|
5
|
-
import { a as prepareAnthropicInputSchema, c as resolveOriginalAnthropicToolName, i as normalizeAnthropicToolChoice, l as toClaudeCodeToolName, n as AnthropicToolProjection, o as projectAnthropicTools, r as normalizeAnthropicToolCallId, s as reconcileAnthropicToolChoice, t as AnthropicProjectedToolChoice } from "../anthropic-tool-projection-
|
|
6
|
-
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-
|
|
5
|
+
import { a as prepareAnthropicInputSchema, c as resolveOriginalAnthropicToolName, i as normalizeAnthropicToolChoice, l as toClaudeCodeToolName, n as AnthropicToolProjection, o as projectAnthropicTools, r as normalizeAnthropicToolCallId, s as reconcileAnthropicToolChoice, t as AnthropicProjectedToolChoice } from "../anthropic-tool-projection-JTvMo4KG.mjs";
|
|
6
|
+
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-rqCq9sT_.mjs";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
9
9
|
authProfileId?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
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-CyA0zJnt.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 readAnthropicFallbackBoundary, H as isAnthropicOAuthApiKey, I as ANTHROPIC_SERVER_SIDE_FALLBACKS, L as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, R as CLAUDE_OPUS_FALLBACK_MODEL_COST, U as omitFoundryBearerCredentialHeaders, V as resolveAnthropicFallbackServingModelCost, W as usesFoundryBearerAuth, _ as logAnthropicThinkingDrops, a as readAnthropicPromptUsageSnapshot, c as applyAnthropicRefusal, g as findActiveAnthropicToolTurnAssistantIndex, h as applyAnthropicThinkingBindingControls, i as readAnthropicCacheWriteUsage, m as ANTHROPIC_OMITTED_REASONING_TEXT, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as readAnthropicInputTransformations, z as applyAnthropicFallbackBoundary } from "../anthropic-stream-reducer-
|
|
4
|
-
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-
|
|
5
|
-
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-rCxf5Tjd.mjs";
|
|
3
|
+
import { B as readAnthropicFallbackBoundary, H as isAnthropicOAuthApiKey, I as ANTHROPIC_SERVER_SIDE_FALLBACKS, L as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, R as CLAUDE_OPUS_FALLBACK_MODEL_COST, U as omitFoundryBearerCredentialHeaders, V as resolveAnthropicFallbackServingModelCost, W as usesFoundryBearerAuth, _ as logAnthropicThinkingDrops, a as readAnthropicPromptUsageSnapshot, c as applyAnthropicRefusal, g as findActiveAnthropicToolTurnAssistantIndex, h as applyAnthropicThinkingBindingControls, i as readAnthropicCacheWriteUsage, m as ANTHROPIC_OMITTED_REASONING_TEXT, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as readAnthropicInputTransformations, z as applyAnthropicFallbackBoundary } from "../anthropic-stream-reducer-kxyYeesU.mjs";
|
|
4
|
+
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-DA_KeluM.mjs";
|
|
5
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-16B3dgU4.mjs";
|
|
6
6
|
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, prepareAnthropicInputSchema, 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 { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-BaSOvO4F.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-
|
|
1
|
+
import { d as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS, u as OpenAIResponsesCompactionOutput } from "../openai-responses-contracts-D-VwWWjx.mjs";
|
|
2
2
|
import { a as resolveOpenAIResponsesPayloadPolicy, o as resolveOpenAIResponsesRequestContextTokens, r as normalizeOpenAIServiceTier, s as resolveOpenAIResponsesServerCompactionPlan, t as OpenAIServiceTier } from "../openai-responses-payload-policy-BzM52TTH.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 { d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-DCG51Us0.mjs";
|
|
2
|
+
import { d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-JbBT8IDv.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, normalizeOpenAIServiceTier, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "../index-DSprYWaz.mjs";
|
|
2
2
|
import { $ as StopReason, Q as SimpleStreamOptions, d as Context, k as Model, tt as StreamFunction } from "../types-CVYzKrMl.mjs";
|
|
3
|
-
import { A as
|
|
3
|
+
import { A as supportsOpenAIReasoningEffort, C as isOpenAIGpt56Model, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, O as resolveOpenAIReasoningEffortMapping, S as isOpenAIGpt55Model, T as normalizeOpenAIReasoningEffort, _ as reconcileOpenAIResponsesToolChoice, a as BaseOpenAIStreamOptions, b as applyOpenAICompletionsToolReasoning, c as OpenAICompletionsOptions, f as reasoningTagTextPolicy, g as reconcileOpenAICompletionsToolChoice, h as projectOpenAITools, j as supportsOpenAITemperature, k as resolveOpenAISupportedReasoningEfforts, m as OpenAIToolProjection, o as CodeModeToolSurfaceObservation, p as OpenAICompletionsToolChoice, u as codeModeToolSurfaceObserver, v as OpenAIApiReasoningEffort, w as isOpenAIGpt6Model, x as isOpenAIGpt54MiniModel, y as OpenAIReasoningEffort } from "../provider-options-Bo8GzTGX.mjs";
|
|
4
4
|
import "../types-CBJthzJX.mjs";
|
|
5
5
|
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-1gsjP-KO.mjs";
|
|
6
|
-
import { c as responsesPromptObserver, f as OpenAIRequestReasoningEffort, l as responsesServiceTierObserver, o as ResponsesPromptObservation, s as ResponsesServiceTierObservation } from "../openai-responses-contracts-
|
|
6
|
+
import { c as responsesPromptObserver, f as OpenAIRequestReasoningEffort, l as responsesServiceTierObserver, o as ResponsesPromptObservation, s as ResponsesServiceTierObservation } from "../openai-responses-contracts-D-VwWWjx.mjs";
|
|
7
7
|
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-DgjD-UL5.mjs";
|
|
8
8
|
import { a as resolveResponsesTerminalStopReason, i as readResponsesReasoningTokens, n as isResponsesOutputLimitToolCallError, r as mapResponsesTerminalUsage, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-CpVjkqn-.mjs";
|
|
9
|
-
import "../openai-responses-compaction-replay-
|
|
9
|
+
import "../openai-responses-compaction-replay-C-yvB5g5.mjs";
|
|
10
10
|
import { n as modelRequestBodyState, t as encodedModelRequestBodyStream } from "../model-request-body-BD5vy4rP.mjs";
|
|
11
11
|
import { ResponseCreateParamsStreaming, ResponseInputItem } from "openai/resources/responses/responses.js";
|
|
12
12
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
@@ -153,4 +153,4 @@ export declare function bindResponsesInputMessage(source: Extract<Context["messa
|
|
|
153
153
|
role: "user";
|
|
154
154
|
}>): (input: unknown) => boolean;
|
|
155
155
|
//#endregion
|
|
156
|
-
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, type ResponsesServiceTierObservation, ResponsesTerminalUsagePayload, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, encodedModelRequestBodyStream, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesServiceTierObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
156
|
+
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, encodedModelRequestBodyStream, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, modelRequestBodyState, 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 { A 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 supportsOpenAIReasoningEffort, C as isOpenAIGpt56Model, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, O as resolveOpenAIReasoningEffortMapping, S as isOpenAIGpt55Model, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, b as applyOpenAICompletionsToolReasoning, g as responsesPromptObserver, j as supportsOpenAITemperature, k as resolveOpenAISupportedReasoningEfforts, w as isOpenAIGpt6Model, x as isOpenAIGpt54MiniModel } from "../openai-responses-contracts-DCG51Us0.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-C9l8FtID.mjs";
|
|
3
3
|
import { _ as resolveResponsesTerminalStopReason, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, m as isResponsesOutputLimitToolCallError } from "../diagnostics-Cv7cW3pS.mjs";
|
|
4
|
-
import { a as encodedModelRequestBodyStream, g as reasoningTagTextPolicy, m as codeModeToolSurfaceObserver, o as modelRequestBodyState } from "../simple-options-
|
|
5
|
-
import { a as hasResponsesWebSearchTool, s as convertMessages } from "../openai-completions-transport-
|
|
6
|
-
import { Ct as reconcileOpenAIResponsesToolChoice, N as bindResponsesInputMessage, St as reconcileOpenAICompletionsToolChoice, _ as isResponsesTextContentPartType, 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 projectOpenAITools, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
4
|
+
import { a as encodedModelRequestBodyStream, g as reasoningTagTextPolicy, m as codeModeToolSurfaceObserver, o as modelRequestBodyState } from "../simple-options-BdJJbzZk.mjs";
|
|
5
|
+
import { a as hasResponsesWebSearchTool, s as convertMessages } from "../openai-completions-transport-PLb2fTJW.mjs";
|
|
6
|
+
import { Ct as reconcileOpenAIResponsesToolChoice, N as bindResponsesInputMessage, St as reconcileOpenAICompletionsToolChoice, _ as isResponsesTextContentPartType, 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 projectOpenAITools, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-Bl7Bm4Tn.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 { n as responsesRequestLifecycle, t as independentResponsesRequest } 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, independentResponsesRequest, 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, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
9
|
+
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-GbTsoa3_.mjs";
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-BKHzrKjZ.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-6GnBON7Q.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, independentResponsesRequest, 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, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-DzlRubwU.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-DQqGjhbq.mjs";
|
|
4
|
+
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-rCxf5Tjd.mjs";
|
|
5
5
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-vKvGIE3J.mjs";
|
|
6
6
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
7
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-
|
|
7
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-DdnJGEj0.mjs";
|
|
8
8
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-Xd8dm_aV.mjs";
|
|
9
9
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
10
10
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-CfMuh5cC.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { O as Message, Q as SimpleStreamOptions, a as AssistantMessage, at as ThinkingBudgets, k as Model, n as Api, nt as StreamOptions, st as ThinkingLevel } from "../types-CVYzKrMl.mjs";
|
|
2
2
|
import { a as readAssistantThinkingAppend } from "../event-stream-CzpE1g_o.mjs";
|
|
3
|
-
import { d as preparedRequestSuffix } from "../provider-options-
|
|
3
|
+
import { d as preparedRequestSuffix } from "../provider-options-Bo8GzTGX.mjs";
|
|
4
4
|
import "../types-CBJthzJX.mjs";
|
|
5
5
|
import { r as serializeModelRequestBody } from "../model-request-body-BD5vy4rP.mjs";
|
|
6
6
|
import { r as matchesContextOverflowMessage, t as sanitizeSurrogates } from "../sanitize-unicode-ZqVLLEKC.mjs";
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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-rCxf5Tjd.mjs";
|
|
3
3
|
import { i as isCredentialFieldName, n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-qtZD2inE.mjs";
|
|
4
4
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
5
5
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-D_MeCQFI.mjs";
|
|
6
|
-
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, _ as SYSTEM_PROMPT_CACHE_BOUNDARY, b as ensureSystemPromptCacheBoundary, c as serializeModelRequestBody, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, i as clampReasoning, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as describeUnsupportedToolResultMedia, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, w as stripSystemPromptCacheBoundary, x as prependSystemPromptAdditionAfterCacheBoundary, y as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END } from "../simple-options-
|
|
6
|
+
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, _ as SYSTEM_PROMPT_CACHE_BOUNDARY, b as ensureSystemPromptCacheBoundary, c as serializeModelRequestBody, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, i as clampReasoning, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as describeUnsupportedToolResultMedia, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, w as stripSystemPromptCacheBoundary, x as prependSystemPromptAdditionAfterCacheBoundary, y as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END } from "../simple-options-BdJJbzZk.mjs";
|
|
7
7
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-F-EmvkpW.mjs";
|
|
8
8
|
import { n as matchesContextOverflowMessage } from "../overflow-DJHXTNBQ.mjs";
|
|
9
9
|
//#region packages/ai/src/utils/tls-certificate-errors.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as OpenAIToolProjection } from "../provider-options-
|
|
2
|
-
import { a as prepareAnthropicInputSchema } from "../anthropic-tool-projection-
|
|
1
|
+
import { m as OpenAIToolProjection } from "../provider-options-Bo8GzTGX.mjs";
|
|
2
|
+
import { a as prepareAnthropicInputSchema } from "../anthropic-tool-projection-JTvMo4KG.mjs";
|
|
3
3
|
import { TSchema } from "typebox";
|
|
4
4
|
//#region packages/ai/src/providers/agent-tools-parameter-schema.d.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, m as truncateToolSchemaDepth, p as toolSchemaChildPosition, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, u as MAX_TOOL_SCHEMA_DEPTH, v as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-
|
|
2
|
-
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-
|
|
3
|
-
import { _ as findLlamacppGbnfSchemaViolations, a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as cleanSchemaForLlamacppGbnf, h as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as stripUnsupportedSchemaKeywords, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, y as cleanSchemaForGemini } from "../openai-tool-schema-
|
|
1
|
+
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, m as truncateToolSchemaDepth, p as toolSchemaChildPosition, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, u as MAX_TOOL_SCHEMA_DEPTH, v as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
2
|
+
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DA_KeluM.mjs";
|
|
3
|
+
import { _ as findLlamacppGbnfSchemaViolations, a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as cleanSchemaForLlamacppGbnf, h as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as stripUnsupportedSchemaKeywords, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, y as cleanSchemaForGemini } from "../openai-tool-schema-CGhEl7ao.mjs";
|
|
4
4
|
export { GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, MAX_TOOL_SCHEMA_DEPTH, SCHEMA_MAP_KEYS, SCHEMA_NESTED_KEYS, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, getPublishedRuntimeToolInputSchema, inheritToolSchemaTruncation, isStrictOpenAIJsonSchemaCompatible, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, prepareAnthropicInputSchema, prepareOpenAIFunctionTool, projectRuntimeToolInputSchema, publishRuntimeToolInputSchema, reportToolSchemaTruncation, resolveOpenAIProjectedToolsStrictToolFlag, resolveUnsupportedToolSchemaKeywords, shouldOmitEmptyArrayItems, stripUnsupportedSchemaKeywords, toolSchemaChildPosition, truncateToolSchemaDepth, wasToolSchemaTruncated };
|
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
3
3
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
4
4
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
5
|
-
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
6
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
7
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
5
|
+
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
6
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
7
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
8
8
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
9
9
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
10
10
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
package/dist/{openai-chatgpt-responses-CtdnpWwe.mjs → openai-chatgpt-responses-CZH7am6J.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-37gmNkuA.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-rCxf5Tjd.mjs";
|
|
6
|
+
import { g as responsesPromptObserver, j as supportsOpenAITemperature } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
7
7
|
import { r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
8
8
|
import "./provider-error-qtZD2inE.mjs";
|
|
9
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
9
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-C9l8FtID.mjs";
|
|
10
10
|
import { s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as extractErrorCodeOrErrno, y as toErrorObject } from "./diagnostics-Cv7cW3pS.mjs";
|
|
11
|
-
import { f as consumeResponseBytes, i as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, u as streamFragmentError } from "./provider-replay-context-
|
|
11
|
+
import { f as consumeResponseBytes, i as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, u as streamFragmentError } from "./provider-replay-context-BGueqVCi.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 { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
16
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
17
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
18
|
-
import { Dt as createOpenAIResponseHook, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, F as convertProviderResponsesMessages, Ot as createResponseModelTracker, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, _t as resolveOpenAIRequestReasoning, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
13
|
+
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-BaSOvO4F.mjs";
|
|
14
|
+
import { n as buildManagedModelFetch } from "./host-policy-Ci1cKluf.mjs";
|
|
15
|
+
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
16
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
17
|
+
import { t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
18
|
+
import { Dt as createOpenAIResponseHook, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, F as convertProviderResponsesMessages, Ot as createResponseModelTracker, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, _t as resolveOpenAIRequestReasoning, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
19
19
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
20
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
20
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-GbTsoa3_.mjs";
|
|
21
21
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.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 { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
|
-
import { k as clampThinkingLevel } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-
|
|
2
|
+
import { k as clampThinkingLevel } from "./host-rCxf5Tjd.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-BdJJbzZk.mjs";
|
|
4
|
+
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-PLb2fTJW.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-compat-CFhQ3UVU.mjs → openai-completions-compat-BaSOvO4F.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { a as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { A as supportsOpenAIReasoningEffort, O as resolveOpenAIReasoningEffortMapping } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
3
|
+
import { a as resolveProviderRequestCapabilities } from "./host-policy-Ci1cKluf.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/openai-response-format.ts
|
|
5
5
|
const JSON_SCHEMA_RESPONSE_FORMAT_NAME = "openclaw_response";
|
|
6
6
|
const OLLAMA_CLOUD_ORIGIN = "https://ollama.com";
|
package/dist/{openai-completions-transport-DviPEqw3.mjs → openai-completions-transport-PLb2fTJW.mjs}
RENAMED
|
@@ -5,36 +5,36 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
5
5
|
import { i as asOptionalRecord, o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
6
6
|
import { c as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
7
7
|
import { n as asNonNegativeFiniteNumber, r as asPositiveFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
|
|
8
|
-
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
9
|
-
import {
|
|
8
|
+
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
9
|
+
import { N as uniqueStrings, R as resolveOpenAIThinkingApi, _ as responsesServiceTierObserver, b as applyOpenAICompletionsToolReasoning, d as OpenAIResponsesWebSocketSafeRetryError, h as parseOpenAIResponsesWebSocketServerError, j as supportsOpenAITemperature, l as OpenAIResponsesWebSocketPostDispatchError, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPreDispatchError, v as isResponsesServiceTierRejection, w as isOpenAIGpt6Model, y as nextResponsesServiceTier } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
12
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
12
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-C9l8FtID.mjs";
|
|
13
13
|
import { d as hasOnlyResponsesFunctionTools, i as emitModelTransportError, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./diagnostics-Cv7cW3pS.mjs";
|
|
14
|
-
import { a as estimateStringChars, d as supportsModelTools, n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
15
|
-
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-
|
|
16
|
-
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-
|
|
14
|
+
import { a as estimateStringChars, d as supportsModelTools, n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BGueqVCi.mjs";
|
|
15
|
+
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-BaSOvO4F.mjs";
|
|
16
|
+
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-Ci1cKluf.mjs";
|
|
17
17
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
18
18
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
19
19
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
20
|
-
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, f as extractToolResultText, g as reasoningTagTextPolicy, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, m as codeModeToolSurfaceObserver, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
21
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, 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-
|
|
22
|
-
import { C as redactIdentifier, w as sha256Hex } from "./tool-schema-json-projection-
|
|
20
|
+
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, f as extractToolResultText, g as reasoningTagTextPolicy, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, m as codeModeToolSurfaceObserver, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
21
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, 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-DdnJGEj0.mjs";
|
|
22
|
+
import { C as redactIdentifier, w as sha256Hex } from "./tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
23
23
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
24
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
24
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
25
25
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
26
26
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
27
27
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
28
28
|
import "./types.mjs";
|
|
29
|
-
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as log, B as recordResponsesInputReplay, C as readResponsesRecoveryEvent, Ct as reconcileOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolvePromptCacheKey, K as responsesContinuationRequestFingerprint, Lt as withOpenAIErrorResponseHook, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as safeDebugValue, Ot as createResponseModelTracker, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, S as isInvalidEncryptedContentError, St as reconcileOpenAICompletionsToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as prepareOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as summarizeOpenAITransportError, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as resolveAzureOpenAIApiVersion, wt as toOpenAIResponsesToolChoice, x as createResponsesStreamWithRecovery, xt as projectOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-
|
|
30
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
29
|
+
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as log, B as recordResponsesInputReplay, C as readResponsesRecoveryEvent, Ct as reconcileOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolvePromptCacheKey, K as responsesContinuationRequestFingerprint, Lt as withOpenAIErrorResponseHook, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as safeDebugValue, Ot as createResponseModelTracker, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, S as isInvalidEncryptedContentError, St as reconcileOpenAICompletionsToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as prepareOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as summarizeOpenAITransportError, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as resolveAzureOpenAIApiVersion, wt as toOpenAIResponsesToolChoice, x as createResponsesStreamWithRecovery, xt as projectOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
30
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-DM9Mbjfp.mjs";
|
|
31
31
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
32
32
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
33
|
-
import { b as prepareOpenAIFunctionTool, f as normalizeToolSchema, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-
|
|
33
|
+
import { b as prepareOpenAIFunctionTool, f as normalizeToolSchema, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-CGhEl7ao.mjs";
|
|
34
34
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
35
35
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
36
|
-
import { a as isOpenAIResponsesCompactionOutput, c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, i as getOpenAIResponsesCompactionOutputError, n as supportsNativeOpenAIResponsesEndpoint, r as createBoundedOpenAIResponsesCompactionFetch, s as sanitizeResponsesImagePayload, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-
|
|
37
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
36
|
+
import { a as isOpenAIResponsesCompactionOutput, c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, i as getOpenAIResponsesCompactionOutputError, n as supportsNativeOpenAIResponsesEndpoint, r as createBoundedOpenAIResponsesCompactionFetch, s as sanitizeResponsesImagePayload, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-JbBT8IDv.mjs";
|
|
37
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-GbTsoa3_.mjs";
|
|
38
38
|
import { randomUUID } from "node:crypto";
|
|
39
39
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
40
40
|
import { ResponsesWS } from "openai/resources/responses/ws.js";
|
|
@@ -1188,10 +1188,7 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
applyCompletionsReasoningAndRouting(params, model, reasoning, compat, policy.mode);
|
|
1190
1190
|
if (policy.mode === "managed" && compat.cacheControlFormat === "anthropic") applyCompletionsAnthropicCacheControl(params, cacheControl ?? null, cacheOptOutIndexes, markTools, !managedCompat?.requiresStringContent);
|
|
1191
|
-
if (params.tools?.length && isKnownOpenAICompletionsEndpoint(model))
|
|
1192
|
-
if (isOpenAIGpt56Model(model)) params.reasoning_effort = "none";
|
|
1193
|
-
else if (isOpenAIGpt54MiniModel(model) || isOpenAIGpt55Model(model)) delete params.reasoning_effort;
|
|
1194
|
-
}
|
|
1191
|
+
if (params.tools?.length && isKnownOpenAICompletionsEndpoint(model)) applyOpenAICompletionsToolReasoning(params, model);
|
|
1195
1192
|
if (contextOutputCap !== void 0) contextOutputBudgets.set(params, {
|
|
1196
1193
|
model: params.model,
|
|
1197
1194
|
cap: contextOutputCap,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-BaSOvO4F.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 { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.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-C9l8FtID.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-BaSOvO4F.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-BdJJbzZk.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
8
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
9
|
-
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
8
|
+
import { t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
9
|
+
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-DM9Mbjfp.mjs";
|
|
11
11
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.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-DSprYWaz.mjs";
|
|
2
2
|
import { a as AssistantMessage, k as Model } from "./types-CVYzKrMl.mjs";
|
|
3
|
-
import "./provider-options-
|
|
4
|
-
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-
|
|
3
|
+
import "./provider-options-Bo8GzTGX.mjs";
|
|
4
|
+
import { i as ReplayableResponseCompactionItem, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-D-VwWWjx.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, outputTokens?: number): void;
|
package/dist/{openai-responses-contracts-CQ4_AWjL.d.mts → openai-responses-contracts-D-VwWWjx.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./index-DSprYWaz.mjs";
|
|
2
2
|
import { M as ModelThinkingLevel, k as Model, n as Api } from "./types-CVYzKrMl.mjs";
|
|
3
|
-
import { a as BaseOpenAIStreamOptions, y as OpenAIReasoningEffort } from "./provider-options-
|
|
3
|
+
import { a as BaseOpenAIStreamOptions, y as OpenAIReasoningEffort } from "./provider-options-Bo8GzTGX.mjs";
|
|
4
4
|
import "./types-CBJthzJX.mjs";
|
|
5
5
|
import { Response, ResponseCompactionItem, ResponseCreateParamsStreaming, ResponseInputItem, ResponseOutputMessage, ResponseReasoningItem } from "openai/resources/responses/responses.js";
|
|
6
6
|
//#region packages/ai/src/providers/openai-request-reasoning.d.ts
|
package/dist/{openai-responses-contracts-Bx-16mnf.mjs → openai-responses-contracts-DCG51Us0.mjs}
RENAMED
|
@@ -191,6 +191,12 @@ function isOpenAIGpt56Model(model) {
|
|
|
191
191
|
const name = normalizeModelId(typeof model.name === "string" ? model.name : void 0);
|
|
192
192
|
return /^gpt-5\.6(?:-|$)/u.test(id) || /^gpt-5\.6(?:\s|\(|-|$)/u.test(name);
|
|
193
193
|
}
|
|
194
|
+
/** Apply the native Chat Completions tool contract after callers qualify the endpoint and model ID. */
|
|
195
|
+
function applyOpenAICompletionsToolReasoning(payload, model) {
|
|
196
|
+
if (!Array.isArray(payload.tools) || payload.tools.length === 0) return;
|
|
197
|
+
if (isOpenAIGpt56Model(model)) payload.reasoning_effort = "none";
|
|
198
|
+
else if (isOpenAIGpt54MiniModel(model) || isOpenAIGpt55Model(model)) delete payload.reasoning_effort;
|
|
199
|
+
}
|
|
194
200
|
/** Return whether a model has a known GPT-6 reasoning and sampling contract. */
|
|
195
201
|
function isOpenAIGpt6Model(model) {
|
|
196
202
|
const id = normalizeModelId(typeof model.id === "string" ? model.id : void 0);
|
|
@@ -399,4 +405,4 @@ const responsesServiceTierObserver = {
|
|
|
399
405
|
}
|
|
400
406
|
};
|
|
401
407
|
//#endregion
|
|
402
|
-
export {
|
|
408
|
+
export { supportsOpenAIReasoningEffort as A, isOpenAIGpt56Model as C, resolveOpenAIReasoningEffortForModel as D, resolveOpenAIModelReasoningEfforts as E, MODEL_CATALOG_THINKING_LEVELS as F, listMappedModelThinkingLevels as I, resolveModelServiceTierContextTokens as L, normalizeStringEntries as M, uniqueStrings as N, resolveOpenAIReasoningEffortMapping as O, uniqueValues as P, resolveOpenAIThinkingApi as R, isOpenAIGpt55Model as S, normalizeOpenAIReasoningEffort as T, responsesServiceTierObserver as _, OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE as a, applyOpenAICompletionsToolReasoning as b, OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE as c, OpenAIResponsesWebSocketSafeRetryError as d, RESPONSES_RETAINED_USER as f, responsesPromptObserver as g, parseOpenAIResponsesWebSocketServerError as h, OPENAI_RESPONSES_APIS as i, supportsOpenAITemperature as j, resolveOpenAISupportedReasoningEfforts as k, OpenAIResponsesWebSocketPostDispatchError as l, isPreviousResponseRejection as m, DEFAULT_AZURE_OPENAI_API_VERSION as n, OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY as o, RESPONSE_FAILED_NO_DETAILS_MESSAGE 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, isResponsesServiceTierRejection as v, isOpenAIGpt6Model as w, isOpenAIGpt54MiniModel as x, nextResponsesServiceTier as y };
|
package/dist/{openai-responses-endpoint-D4v-eeYy.mjs → openai-responses-endpoint-JbBT8IDv.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { a as normalizeOptionalLowercaseString, l as readStringValue, n as normalizeFastMode, r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { A as supportsOpenAIReasoningEffort, L as resolveModelServiceTierContextTokens, i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
4
4
|
import { t as canonicalizeBase64 } from "./base64-C8CdcsjU.mjs";
|
|
5
5
|
import { t as parsePositiveInteger } from "./positive-integer-Bb4Evc7L.mjs";
|
|
6
6
|
import { n as createSseByteGuard } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { f as RESPONSES_RETAINED_USER, g as responsesPromptObserver } from "./openai-responses-contracts-
|
|
2
|
+
import { f as RESPONSES_RETAINED_USER, g as responsesPromptObserver } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
3
3
|
import { c as stableStringify, d as estimateTokensFromChars, u as estimateStringChars } from "./provider-error-qtZD2inE.mjs";
|
|
4
|
-
import "./provider-replay-context-
|
|
5
|
-
import { w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
6
|
-
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
7
|
-
import { w as sha256Hex } from "./tool-schema-json-projection-
|
|
8
|
-
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-
|
|
9
|
-
import { a as isOpenAIResponsesCompactionOutput, s as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-
|
|
4
|
+
import "./provider-replay-context-BGueqVCi.mjs";
|
|
5
|
+
import { w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
6
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
7
|
+
import { w as sha256Hex } from "./tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
8
|
+
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
9
|
+
import { a as isOpenAIResponsesCompactionOutput, s as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-JbBT8IDv.mjs";
|
|
10
10
|
//#region packages/ai/src/transports/openai-responses-compact-request.ts
|
|
11
11
|
const COMPACT_REQUEST = Symbol("openaiResponsesCompactRequest");
|
|
12
12
|
function claimResponsesCompactRequest(options) {
|
|
@@ -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 { l as readStringValue, o as normalizeOptionalString, r as normalizeLowercaseStringOrEmpty, s as normalizeStringifiedOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
7
7
|
import { t as asFiniteNumber } from "./number-coercion-37gmNkuA.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-rCxf5Tjd.mjs";
|
|
9
|
+
import { A as supportsOpenAIReasoningEffort, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, F as MODEL_CATALOG_THINKING_LEVELS, O as resolveOpenAIReasoningEffortMapping, R as resolveOpenAIThinkingApi, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, f as RESPONSES_RETAINED_USER, i as OPENAI_RESPONSES_APIS, j as supportsOpenAITemperature, m as isPreviousResponseRejection, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as RESPONSE_FAILED_NO_DETAILS_MESSAGE, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, v as isResponsesServiceTierRejection, y as nextResponsesServiceTier } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
12
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
12
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-C9l8FtID.mjs";
|
|
13
13
|
import { _ as resolveResponsesTerminalStopReason, a as resolveModelPayloadDebugMode, d as hasOnlyResponsesFunctionTools, f as isResponsesProviderTool, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, r as emitModelTransportDebug, u as ResponsesOutputIdentityError } from "./diagnostics-Cv7cW3pS.mjs";
|
|
14
|
-
import { c as redactSensitiveText, n as isProviderReplayContext, o as isCodeModeModelVisibleToolName, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
15
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
16
|
-
import { r as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
14
|
+
import { c as redactSensitiveText, n as isProviderReplayContext, o as isCodeModeModelVisibleToolName, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BGueqVCi.mjs";
|
|
15
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-BaSOvO4F.mjs";
|
|
16
|
+
import { r as resolveModelRequestTimeoutMs } from "./host-policy-Ci1cKluf.mjs";
|
|
17
17
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
18
|
-
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
19
|
-
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-
|
|
20
|
-
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-
|
|
21
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
18
|
+
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-BdJJbzZk.mjs";
|
|
19
|
+
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-DdnJGEj0.mjs";
|
|
20
|
+
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
21
|
+
import { n as transformProviderMessages } from "./assistant-output-DbgdWAhJ.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-D_TfJHRJ.mjs";
|
|
25
|
-
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-
|
|
26
|
-
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-
|
|
25
|
+
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-CGhEl7ao.mjs";
|
|
26
|
+
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-JbBT8IDv.mjs";
|
|
27
27
|
import { randomUUID } from "node:crypto";
|
|
28
28
|
import { Stream } from "openai/core/streaming";
|
|
29
29
|
//#region packages/ai/src/transports/openai-transport-shared.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-
|
|
4
|
+
import { M as normalizeStringEntries, P as uniqueValues } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
5
|
+
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-Cvq69Ajp.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-function-tool.ts
|
|
7
7
|
const preparedTools = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const MAX_DESCRIPTOR_VARIANTS = 8;
|
|
@@ -21,6 +21,11 @@ declare function isOpenAIGpt54MiniModel(model: OpenAIReasoningModel): boolean;
|
|
|
21
21
|
declare function isOpenAIGpt55Model(model: OpenAIReasoningModel): boolean;
|
|
22
22
|
/** Return whether a model is the GPT-5.6 family. */
|
|
23
23
|
declare function isOpenAIGpt56Model(model: OpenAIReasoningModel): boolean;
|
|
24
|
+
/** Apply the native Chat Completions tool contract after callers qualify the endpoint and model ID. */
|
|
25
|
+
declare function applyOpenAICompletionsToolReasoning(payload: Record<string, unknown>, model: {
|
|
26
|
+
id: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
}): void;
|
|
24
29
|
/** Return whether a model has a known GPT-6 reasoning and sampling contract. */
|
|
25
30
|
declare function isOpenAIGpt6Model(model: OpenAIReasoningModel): boolean;
|
|
26
31
|
/** Normalize user-facing reasoning effort names to API effort names. */
|
|
@@ -195,4 +200,4 @@ type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
|
|
|
195
200
|
reasoningEffort?: OpenAIReasoningEffort | "off";
|
|
196
201
|
};
|
|
197
202
|
//#endregion
|
|
198
|
-
export {
|
|
203
|
+
export { supportsOpenAIReasoningEffort as A, isOpenAIGpt56Model as C, resolveOpenAIReasoningEffortForModel as D, resolveOpenAIModelReasoningEfforts as E, resolveOpenAIReasoningEffortMapping as O, isOpenAIGpt55Model as S, normalizeOpenAIReasoningEffort as T, reconcileOpenAIResponsesToolChoice as _, BaseOpenAIStreamOptions as a, applyOpenAICompletionsToolReasoning as b, OpenAICompletionsOptions as c, preparedRequestSuffix as d, reasoningTagTextPolicy as f, reconcileOpenAICompletionsToolChoice as g, projectOpenAITools as h, AnthropicThinkingDisplay as i, supportsOpenAITemperature as j, resolveOpenAISupportedReasoningEfforts as k, OpenAIResponsesCompactionRejection as l, OpenAIToolProjection as m, AnthropicEffort as n, CodeModeToolSurfaceObservation as o, OpenAICompletionsToolChoice as p, AnthropicOptions as r, CompactionReplayRejection as s, AnthropicContextManagementOptions as t, codeModeToolSurfaceObserver as u, OpenAIApiReasoningEffort as v, isOpenAIGpt6Model as w, isOpenAIGpt54MiniModel as x, OpenAIReasoningEffort as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { r as getAiTransportHost } from "./host-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
3
3
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
4
4
|
import "./internal/retry-after.mjs";
|
|
5
|
-
import { A as shortHash, N as raceWithTimeout } from "./transport-stream-shared-
|
|
5
|
+
import { A as shortHash, N as raceWithTimeout } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
6
6
|
import "./positive-integer-Bb4Evc7L.mjs";
|
|
7
7
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
8
8
|
async function consumeResponseBytes(options) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-Dttf8jKq.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
|
-
import { Ft as resolveOpenAIClientBaseUrl, Lt as withOpenAIErrorResponseHook } from "./openai-responses-shared-
|
|
4
|
+
import { Ft as resolveOpenAIClientBaseUrl, Lt as withOpenAIErrorResponseHook } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
|
7
7
|
//#region packages/ai/src/providers/openai-provider-client.ts
|
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-qtZD2inE.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-C9l8FtID.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-16B3dgU4.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-BKHzrKjZ.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-C_ImzxlK.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-6GnBON7Q.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-DFcmh7LD.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-CZH7am6J.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-CZ6uGVkV.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-G1sECmlf.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-BZTcYnWU.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { M as hasMediaPayload } from "./host-
|
|
3
|
-
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
2
|
+
import { M as hasMediaPayload } from "./host-rCxf5Tjd.mjs";
|
|
3
|
+
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
4
4
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
6
6
|
import { n as normalizeStructuredPromptSection } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
7
|
-
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
7
|
+
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-DdnJGEj0.mjs";
|
|
8
8
|
//#region packages/ai/src/utils/system-prompt-cache-boundary.ts
|
|
9
9
|
const SYSTEM_PROMPT_CACHE_BOUNDARY = "\n<!-- OPENCLAW_CACHE_BOUNDARY -->\n";
|
|
10
10
|
/** Producer-delimited Runtime facts; instructions must remain outside this region. */
|
|
@@ -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-rCxf5Tjd.mjs";
|
|
3
3
|
import { t as cleanupSessionResources } from "./session-resources-vKvGIE3J.mjs";
|
|
4
4
|
//#region packages/ai/src/api-registry.ts
|
|
5
5
|
function wrapStream(api, stream) {
|
package/dist/{tool-schema-json-projection-B0hHDV7N.mjs → tool-schema-json-projection-Cvq69Ajp.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as asRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { r as getAiTransportHost } from "./host-
|
|
4
|
+
import { r as getAiTransportHost } from "./host-rCxf5Tjd.mjs";
|
|
5
5
|
import { hash } from "node:crypto";
|
|
6
6
|
import { types } from "node:util";
|
|
7
7
|
//#region packages/normalization-core/src/node-crypto.ts
|
|
@@ -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-rCxf5Tjd.mjs";
|
|
5
5
|
import { a as projectDiagnosticValue, n as projectProviderError } from "./provider-error-qtZD2inE.mjs";
|
|
6
6
|
import { l as isTransientNetworkError } from "./diagnostics-Cv7cW3pS.mjs";
|
|
7
7
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
package/dist/transports.d.mts
CHANGED
|
@@ -2,13 +2,13 @@ import "./index-DSprYWaz.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-CVYzKrMl.mjs";
|
|
3
3
|
import { n as ApiRegistry } from "./api-registry-gDt0faai.mjs";
|
|
4
4
|
import { o as AiProviderStreamHookContext } from "./host-jJOffdlW.mjs";
|
|
5
|
-
import { a as BaseOpenAIStreamOptions, c as OpenAICompletionsOptions, l as OpenAIResponsesCompactionRejection, m as OpenAIToolProjection, o as CodeModeToolSurfaceObservation, s as CompactionReplayRejection } from "./provider-options-
|
|
5
|
+
import { a as BaseOpenAIStreamOptions, c as OpenAICompletionsOptions, l as OpenAIResponsesCompactionRejection, m as OpenAIToolProjection, o as CodeModeToolSurfaceObservation, s as CompactionReplayRejection } from "./provider-options-Bo8GzTGX.mjs";
|
|
6
6
|
import "./types-CBJthzJX.mjs";
|
|
7
|
-
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-
|
|
7
|
+
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-rqCq9sT_.mjs";
|
|
8
8
|
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-1gsjP-KO.mjs";
|
|
9
|
-
import { a as ReplayableResponseReasoningItem, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-
|
|
9
|
+
import { a as ReplayableResponseReasoningItem, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata, u as OpenAIResponsesCompactionOutput } from "./openai-responses-contracts-D-VwWWjx.mjs";
|
|
10
10
|
import { a as resolveOpenAIResponsesPayloadPolicy, i as resolveOpenAIResponsesCompactEndpointPlan, n as applyOpenAIResponsesPayloadPolicy, o as resolveOpenAIResponsesRequestContextTokens, r as normalizeOpenAIServiceTier, s as resolveOpenAIResponsesServerCompactionPlan, t as OpenAIServiceTier } from "./openai-responses-payload-policy-BzM52TTH.mjs";
|
|
11
|
-
import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-
|
|
11
|
+
import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-C-yvB5g5.mjs";
|
|
12
12
|
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-8ru8eX4s.mjs";
|
|
13
13
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
|
|
14
14
|
import { d as VideoContent, i as ProviderContext, s as ProviderModel } from "./provider-types-ODq57rG_.mjs";
|
package/dist/transports.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.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-rCxf5Tjd.mjs";
|
|
5
|
+
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DCG51Us0.mjs";
|
|
6
6
|
import { o as redactDiagnosticText, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.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-Cv7cW3pS.mjs";
|
|
8
|
-
import { i as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, l as resolveModelHeaderSentinels, o as isCodeModeModelVisibleToolName, s as readResponseTextSnippet, u as streamFragmentError } from "./provider-replay-context-
|
|
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 resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-
|
|
8
|
+
import { i as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, l as resolveModelHeaderSentinels, o as isCodeModeModelVisibleToolName, s as readResponseTextSnippet, u as streamFragmentError } from "./provider-replay-context-BGueqVCi.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-BaSOvO4F.mjs";
|
|
10
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Ci1cKluf.mjs";
|
|
11
|
+
import { A as resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-kxyYeesU.mjs";
|
|
12
12
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
13
|
-
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 { 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-DdnJGEj0.mjs";
|
|
14
14
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
15
15
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
16
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
16
|
+
import { t as createAssistantOutput } from "./assistant-output-DbgdWAhJ.mjs";
|
|
17
17
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
18
|
-
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-
|
|
19
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
20
|
-
import { At as log, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as resolveOpenAIClientBaseUrl, It as resolvePromptCacheKey, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as withOpenAIErrorResponseHook, M as resolveResponsesContextUsageBoundary, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, Ot as createResponseModelTracker, Pt as readOpenAICompletionsReasoningBatch, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as measureUtf8AppendBytes, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-
|
|
21
|
-
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-
|
|
22
|
-
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-
|
|
18
|
+
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-PLb2fTJW.mjs";
|
|
19
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-B-svbJuN.mjs";
|
|
20
|
+
import { At as log, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as resolveOpenAIClientBaseUrl, It as resolvePromptCacheKey, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as withOpenAIErrorResponseHook, M as resolveResponsesContextUsageBoundary, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, Ot as createResponseModelTracker, Pt as readOpenAICompletionsReasoningBatch, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as measureUtf8AppendBytes, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-Bl7Bm4Tn.mjs";
|
|
21
|
+
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-JbBT8IDv.mjs";
|
|
22
|
+
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-GbTsoa3_.mjs";
|
|
23
23
|
import { randomUUID } from "node:crypto";
|
|
24
24
|
//#region packages/ai/src/transports/anthropic-transport-stream.ts
|
|
25
25
|
const ANTHROPIC_MESSAGES_ERROR_BODY_MAX_BYTES = 8192;
|