@openclaw/ai 2026.9.9 → 2026.9.33
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-DfsDsNJl.mjs → anthropic-a0uD7NUz.mjs} +7 -7
- package/dist/{anthropic-stream-reducer-CiVXqWLP.mjs → anthropic-stream-reducer-Cis7c1sm.mjs} +7 -7
- package/dist/{azure-openai-responses-DUQuNQL6.mjs → azure-openai-responses-CqWvI8x6.mjs} +6 -6
- package/dist/{google-CyeM7l4M.mjs → google-BfYNxKpG.mjs} +5 -5
- package/dist/{google-interactions-BvbVUFzr.mjs → google-interactions-BJNj0ugu.mjs} +6 -6
- package/dist/{google-messages-BAiONu4V.mjs → google-messages-C4ZiLG1P.mjs} +3 -3
- package/dist/{google-shared-tpqMugao.mjs → google-shared-6u4WCDyl.mjs} +5 -5
- package/dist/{google-vertex-BTwRIP8v.mjs → google-vertex-CX1QaTs3.mjs} +4 -4
- package/dist/{host-l5VGgsa2.mjs → host-DqhMLv8J.mjs} +1 -1
- package/dist/{host-policy-D8HBI2Pv.mjs → host-policy-B3DuH3Le.mjs} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai.mjs +7 -7
- package/dist/internal/runtime.mjs +2 -2
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-Cxbukk9d.mjs → mistral-ytNCcQhM.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-CUuh4TkA.mjs → openai-chatgpt-responses-L0Jc-0DF.mjs} +12 -11
- package/dist/{openai-completions-compat-W0ykoT4z.mjs → openai-completions-compat-D1q02qdx.mjs} +1 -1
- package/dist/{openai-completions-CVwOQW-U.mjs → openai-completions-gyTpI3xG.mjs} +9 -9
- package/dist/{openai-completions-stream-Crkc597h.mjs → openai-completions-stream-BrsoGafc.mjs} +19 -25
- package/dist/{openai-prompt-cache-D0e4t5-3.mjs → openai-prompt-cache-DHxMpeRz.mjs} +1 -1
- package/dist/{openai-provider-client-evrjHyOl.mjs → openai-provider-client-D1gd0dfR.mjs} +2 -2
- package/dist/{openai-responses-cNWyKDF8.mjs → openai-responses-DluFZzn_.mjs} +8 -8
- package/dist/{openai-responses-prompt-observer-internal-Do_oXZf7.mjs → openai-responses-prompt-observer-internal-C5WB2Kxf.mjs} +7 -7
- package/dist/{openai-responses-shared-6QypGhvL.mjs → openai-responses-shared-BpGnmnV8.mjs} +8 -8
- package/dist/{openai-transport-params-a_8s6k6d.mjs → openai-transport-params-C4eZAXf2.mjs} +6 -6
- package/dist/{provider-replay-context-Cy7RdZ2C.mjs → provider-replay-context-BwVRJUQZ.mjs} +1 -1
- package/dist/{provider-transcript-transform-B-bAzjo8.mjs → provider-transcript-transform-Cg-36VSt.mjs} +2 -2
- package/dist/{provider-transport-turn-state-CE0dp-UO.mjs → provider-transport-turn-state-CUUfdJPN.mjs} +1 -1
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-ueGsZ3Rz.mjs → simple-options-B9u6-CF3.mjs} +2 -2
- package/dist/{src-Dw59CBue.mjs → src-Dq6VRdeL.mjs} +1 -1
- package/dist/{transport-stream-shared-Bz9YwuQ0.mjs → transport-stream-shared-Dt7VrJFd.mjs} +1 -1
- package/dist/{transport-utils-CEKSacZh.mjs → transport-utils-CnxX8hPj.mjs} +1 -1
- package/dist/transports.mjs +16 -16
- package/dist/types.mjs +2 -2
- package/dist/{validation-BFZc40Ig.mjs → validation-Fe6RtKI6.mjs} +1 -6
- package/dist/validation.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { b as resolveClaudeOpus5ModelIdentity, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity } from "./src-
|
|
2
|
+
import { b as resolveClaudeOpus5ModelIdentity, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
4
|
-
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, m as defaultsClaudeAdaptiveThinking, n as getAiTransportHost, p as buildAnthropicClaudeCodeIdentity, r as resolveAiTransportHeaderSentinels, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract } from "./host-
|
|
5
|
-
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
6
|
-
import { A as applyAnthropicRequestCacheControl, B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, D as applyAnthropicContextManagementToRequest, F as resolveAnthropicCacheOptions, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, N as isDirectAnthropicModel, R as resolveAnthropicRequestBetaHeader, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, j as buildAnthropicSystemBlocks, l as buildAnthropicGenerationParams, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages } from "./anthropic-stream-reducer-
|
|
4
|
+
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, m as defaultsClaudeAdaptiveThinking, n as getAiTransportHost, p as buildAnthropicClaudeCodeIdentity, r as resolveAiTransportHeaderSentinels, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract } from "./host-DqhMLv8J.mjs";
|
|
5
|
+
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-CnxX8hPj.mjs";
|
|
6
|
+
import { A as applyAnthropicRequestCacheControl, B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, D as applyAnthropicContextManagementToRequest, F as resolveAnthropicCacheOptions, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, N as isDirectAnthropicModel, R as resolveAnthropicRequestBetaHeader, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, j as buildAnthropicSystemBlocks, l as buildAnthropicGenerationParams, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages } from "./anthropic-stream-reducer-Cis7c1sm.mjs";
|
|
7
7
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
8
|
-
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
9
|
-
import { n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking } from "./simple-options-
|
|
8
|
+
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
9
|
+
import { n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking } from "./simple-options-B9u6-CF3.mjs";
|
|
10
10
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
11
11
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
12
12
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
13
|
-
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-
|
|
13
|
+
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
14
14
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
15
15
|
import { i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
16
16
|
import Anthropic from "@anthropic-ai/sdk";
|
package/dist/{anthropic-stream-reducer-CiVXqWLP.mjs → anthropic-stream-reducer-Cis7c1sm.mjs}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { D as supportsClaudeNativeXhighEffort, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, u as bindsClaudeThinkingPrefix, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
1
|
+
import { D as supportsClaudeNativeXhighEffort, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, u as bindsClaudeThinkingPrefix, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
2
2
|
import { r as appendAssistantThinking } from "./event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { _ as requiresClaudeAdaptiveThinking, d as ANTHROPIC_CLAUDE_CODE_VERSION, h as mapAnthropicStopReason, k as isImageWithMediaPayload, n as getAiTransportHost, v as resolveAnthropicThinkingEffort, w as calculateCost } from "./host-
|
|
4
|
+
import { _ as requiresClaudeAdaptiveThinking, d as ANTHROPIC_CLAUDE_CODE_VERSION, h as mapAnthropicStopReason, k as isImageWithMediaPayload, n as getAiTransportHost, v as resolveAnthropicThinkingEffort, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
5
5
|
import { i as normalizeOptionalLowercaseString, r as normalizeNullableString } from "./string-coerce-fsri9iCu.mjs";
|
|
6
6
|
import { i as asNonNegativeFiniteNumber, n as estimateBase64DecodedBytes } from "./base64-C1PsYcRQ.mjs";
|
|
7
|
-
import "./transport-utils-
|
|
8
|
-
import { i as resolveProviderRequestCapabilities, r as resolveProviderEndpoint } from "./host-policy-
|
|
7
|
+
import "./transport-utils-CnxX8hPj.mjs";
|
|
8
|
+
import { i as resolveProviderRequestCapabilities, r as resolveProviderEndpoint } from "./host-policy-B3DuH3Le.mjs";
|
|
9
9
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
10
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
11
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
10
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
11
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-B9u6-CF3.mjs";
|
|
12
12
|
import { t as parsePositiveInteger } from "./positive-integer-CjN5OJbH.mjs";
|
|
13
13
|
import { i as SCHEMA_MAP_KEYS, n as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-Ct8SeBeJ.mjs";
|
|
14
|
-
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
14
|
+
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BwVRJUQZ.mjs";
|
|
15
15
|
import { i as tagPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
16
16
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
17
17
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
5
|
+
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
6
6
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
7
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
8
|
-
import { P as convertProviderResponsesMessages, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
7
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
8
|
+
import { P as convertProviderResponsesMessages, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-BpGnmnV8.mjs";
|
|
9
9
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
10
10
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
11
11
|
//#region packages/ai/src/providers/azure-openai-responses.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
3
|
-
import { f as mergeTransportHeaders } from "./transport-stream-shared-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
2
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-DqhMLv8J.mjs";
|
|
3
|
+
import { f as mergeTransportHeaders } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
6
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
6
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
7
7
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
8
|
-
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
8
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-6u4WCDyl.mjs";
|
|
9
9
|
import { GoogleGenAI } from "@google/genai";
|
|
10
10
|
//#region packages/ai/src/providers/google.ts
|
|
11
11
|
let toolCallCounter = 0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
2
|
import { a as asRecord, i as asOptionalRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as calculateCost } from "./host-
|
|
4
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
5
|
-
import { b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, j as sanitizeSurrogates, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-
|
|
6
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
3
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
4
|
+
import { t as buildGuardedModelFetch } from "./host-policy-B3DuH3Le.mjs";
|
|
5
|
+
import { b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, j as sanitizeSurrogates, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
6
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
8
|
-
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-
|
|
9
|
-
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-
|
|
8
|
+
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
9
|
+
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-6u4WCDyl.mjs";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
//#region packages/ai/src/providers/google-interactions-request.ts
|
|
12
12
|
const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { k as isImageWithMediaPayload, w as calculateCost } from "./host-
|
|
3
|
-
import { a as createEmptyTransportUsage, b as transportAbortError, j as sanitizeSurrogates, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
4
|
-
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-
|
|
2
|
+
import { k as isImageWithMediaPayload, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
3
|
+
import { a as createEmptyTransportUsage, b as transportAbortError, j as sanitizeSurrogates, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
4
|
+
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-B9u6-CF3.mjs";
|
|
5
5
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
6
6
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
7
7
|
/** Returns whether a Gemini Flash model accepts the MINIMAL thinking level. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as clampThinkingLevel } from "./host-
|
|
2
|
-
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened, j as sanitizeSurrogates } from "./transport-stream-shared-
|
|
3
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
4
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
5
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
1
|
+
import { T as clampThinkingLevel } from "./host-DqhMLv8J.mjs";
|
|
2
|
+
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened, j as sanitizeSurrogates } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
3
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-B9u6-CF3.mjs";
|
|
4
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
5
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-C4ZiLG1P.mjs";
|
|
6
6
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-shared.ts
|
|
8
8
|
function convertMessages(model, context) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
2
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-DqhMLv8J.mjs";
|
|
3
3
|
import { a as normalizeOptionalString } from "./string-coerce-fsri9iCu.mjs";
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
6
|
-
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
5
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
6
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-6u4WCDyl.mjs";
|
|
7
7
|
import { GoogleGenAI, ResourceScope } from "@google/genai";
|
|
8
8
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
9
9
|
const API_VERSION = "v1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, f as requiresClaudeDefaultSampling, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, t as calculateUsageCost, v as resolveClaudeNativeThinkingLevelMap, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
1
|
+
import { D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, f as requiresClaudeDefaultSampling, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, t as calculateUsageCost, v as resolveClaudeNativeThinkingLevelMap, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
2
2
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
4
4
|
import { f as MODEL_CATALOG_THINKING_LEVELS, m as resolveOpenAIThinkingApi, o as resolveOpenAIModelReasoningEfforts, p as listMappedModelThinkingLevels } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as supportsClaude1MContext, D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
1
|
+
import { C as supportsClaude1MContext, D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
2
2
|
import { n as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE } from "./types-LFWwv0cF.mjs";
|
|
3
3
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
4
4
|
import { i as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Fe6RtKI6.mjs";
|
|
6
6
|
import { n as createApiRegistry, t as createLlmRuntime } from "./stream-DDsCBgd-.mjs";
|
|
7
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-
|
|
7
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
8
8
|
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, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, 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-
|
|
2
|
-
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, d as ANTHROPIC_CLAUDE_CODE_VERSION, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, h as mapAnthropicStopReason, m as defaultsClaudeAdaptiveThinking, p as buildAnthropicClaudeCodeIdentity, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract, y as resolveModelBoundThinkingReplayMode } from "../host-
|
|
3
|
-
import { B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, E as readAnthropicInputTransformations, G as resolveAnthropicFallbackServingModelCost, H as CLAUDE_OPUS_FALLBACK_MODEL_COST, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, S as ANTHROPIC_OMITTED_REASONING_TEXT, T as logAnthropicThinkingDrops, U as applyAnthropicFallbackBoundary, V as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as readAnthropicFallbackBoundary, _ as normalizeAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as resolveOriginalAnthropicToolName, c as applyAnthropicRefusal, g as normalizeAnthropicToolCallId, i as readAnthropicCacheWriteUsage, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as projectAnthropicTools, w as findActiveAnthropicToolTurnAssistantIndex, x as toClaudeCodeToolName, y as reconcileAnthropicToolChoice, z as resolveAnthropicServerCompactionPlan } from "../anthropic-stream-reducer-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
1
|
+
import { D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, 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-Dq6VRdeL.mjs";
|
|
2
|
+
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, d as ANTHROPIC_CLAUDE_CODE_VERSION, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, h as mapAnthropicStopReason, m as defaultsClaudeAdaptiveThinking, p as buildAnthropicClaudeCodeIdentity, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract, y as resolveModelBoundThinkingReplayMode } from "../host-DqhMLv8J.mjs";
|
|
3
|
+
import { B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, E as readAnthropicInputTransformations, G as resolveAnthropicFallbackServingModelCost, H as CLAUDE_OPUS_FALLBACK_MODEL_COST, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, S as ANTHROPIC_OMITTED_REASONING_TEXT, T as logAnthropicThinkingDrops, U as applyAnthropicFallbackBoundary, V as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as readAnthropicFallbackBoundary, _ as normalizeAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as resolveOriginalAnthropicToolName, c as applyAnthropicRefusal, g as normalizeAnthropicToolCallId, i as readAnthropicCacheWriteUsage, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as projectAnthropicTools, w as findActiveAnthropicToolTurnAssistantIndex, x as toClaudeCodeToolName, y as reconcileAnthropicToolChoice, z as resolveAnthropicServerCompactionPlan } from "../anthropic-stream-reducer-Cis7c1sm.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-a0uD7NUz.mjs";
|
|
5
5
|
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-D1q02qdx.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as normalizeOpenAIReasoningEffort, c as resolveOpenAIReasoningEffortMapping, d as supportsOpenAITemperature, i as isOpenAIGpt6Model, l as resolveOpenAISupportedReasoningEfforts, n as isOpenAIGpt55Model, o as resolveOpenAIModelReasoningEfforts, r as isOpenAIGpt56Model, s as resolveOpenAIReasoningEffortForModel, t as isOpenAIGpt54MiniModel, u as supportsOpenAIReasoningEffort } from "../openai-reasoning-effort-C_0p3psG.mjs";
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-DHxMpeRz.mjs";
|
|
3
3
|
import { g as resolveResponsesTerminalStopReason, h as readResponsesReasoningTokens, m as mapResponsesTerminalUsage, p as isResponsesOutputLimitToolCallError } from "../diagnostics-CJaB6g8J.mjs";
|
|
4
|
-
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-
|
|
5
|
-
import { f as projectOpenAITools, m as reconcileOpenAIResponsesToolChoice, p as reconcileOpenAICompletionsToolChoice } from "../openai-transport-params-
|
|
6
|
-
import { a as convertMessages } from "../openai-completions-stream-
|
|
4
|
+
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-B9u6-CF3.mjs";
|
|
5
|
+
import { f as projectOpenAITools, m as reconcileOpenAIResponsesToolChoice, p as reconcileOpenAICompletionsToolChoice } from "../openai-transport-params-C4eZAXf2.mjs";
|
|
6
|
+
import { a as convertMessages } from "../openai-completions-stream-BrsoGafc.mjs";
|
|
7
7
|
import { h as responsesPromptObserver } from "../openai-responses-contracts-CLxnqS9p.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
9
|
-
import { M as bindResponsesInputMessage, _ 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, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
9
|
+
import { M as bindResponsesInputMessage, _ 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, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-BpGnmnV8.mjs";
|
|
10
10
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
11
11
|
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
12
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
13
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
12
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-gyTpI3xG.mjs";
|
|
13
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-DluFZzn_.mjs";
|
|
14
14
|
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, 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, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError } from "../diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as getEventStreamCompletion } from "../event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { n as createApiRegistry, t as createLlmRuntime } from "../stream-DDsCBgd-.mjs";
|
|
4
|
-
import { C as applyProviderReportedUsageCost, D as modelsAreEqual, E as getSupportedThinkingLevels, S as headersToRecord, T as clampThinkingLevel, w as calculateCost } from "../host-
|
|
5
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, j as sanitizeSurrogates, k as repairJson } from "../transport-stream-shared-
|
|
4
|
+
import { C as applyProviderReportedUsageCost, D as modelsAreEqual, E as getSupportedThinkingLevels, S as headersToRecord, T as clampThinkingLevel, w as calculateCost } from "../host-DqhMLv8J.mjs";
|
|
5
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, j as sanitizeSurrogates, k as repairJson } from "../transport-stream-shared-Dt7VrJFd.mjs";
|
|
6
6
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-CyX4VKGO.mjs";
|
|
7
7
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
8
8
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-BjtkplhG.mjs";
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as readAssistantThinkingAppend } from "../event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { O as hasMediaPayload, a as FAILED_ASSISTANT_REPLAY_TEXT, c as isReasoningOnlyLengthAssistantTurn, i as transformMessages, k as isImageWithMediaPayload, l as isStreamErrorFallbackContent, o as STREAM_ERROR_FALLBACK_TEXT, s as hasOnlyAssistantReasoningContent, u as resolveFailedAssistantReplay } from "../host-
|
|
2
|
+
import { O as hasMediaPayload, a as FAILED_ASSISTANT_REPLAY_TEXT, c as isReasoningOnlyLengthAssistantTurn, i as transformMessages, k as isImageWithMediaPayload, l as isStreamErrorFallbackContent, o as STREAM_ERROR_FALLBACK_TEXT, s as hasOnlyAssistantReasoningContent, u as resolveFailedAssistantReplay } from "../host-DqhMLv8J.mjs";
|
|
3
3
|
import { n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-CwT_j2v0.mjs";
|
|
4
|
-
import { j as sanitizeSurrogates } from "../transport-stream-shared-
|
|
5
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-
|
|
4
|
+
import { j as sanitizeSurrogates } from "../transport-stream-shared-Dt7VrJFd.mjs";
|
|
5
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, E as normalizeStructuredPromptSection, S as splitSystemPromptRelocatableBoundary, T as normalizePromptCapabilityIds, _ as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, b as prependSystemPromptAdditionAfterCacheBoundary, d as describeToolResultMediaPlaceholder, f as describeUnsupportedToolResultMedia, g as SYSTEM_PROMPT_CACHE_BOUNDARY, h as formatToolResultText, i as clampReasoning, m as extractToolResultText, n as buildBaseOptions, p as extractToolResultBlockText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary, y as ensureSystemPromptCacheBoundary } from "../simple-options-B9u6-CF3.mjs";
|
|
6
6
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-BTEBMeOv.mjs";
|
|
7
7
|
//#region packages/ai/src/utils/tls-certificate-errors.ts
|
|
8
8
|
const HOSTNAME_MISMATCH_CODES = /* @__PURE__ */ new Set(["ERR_TLS_CERT_ALTNAME_INVALID", "HOSTNAME_MISMATCH"]);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
|
-
import { T as clampThinkingLevel, k as isImageWithMediaPayload, n as getAiTransportHost, w as calculateCost } from "./host-
|
|
3
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
4
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
2
|
+
import { T as clampThinkingLevel, k as isImageWithMediaPayload, n as getAiTransportHost, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
3
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
4
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, h as formatToolResultText, m as extractToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-B9u6-CF3.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
6
6
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
7
|
-
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-
|
|
7
|
+
import { n as createAssistantOutput, t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
9
9
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
package/dist/{openai-chatgpt-responses-CUuh4TkA.mjs → openai-chatgpt-responses-L0Jc-0DF.mjs}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { S as headersToRecord, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
+
import { S as headersToRecord, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-DqhMLv8J.mjs";
|
|
5
5
|
import { d as supportsOpenAITemperature } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
6
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
6
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
7
7
|
import { _ as extractErrorCodeOrErrno, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as toErrorObject } from "./diagnostics-CJaB6g8J.mjs";
|
|
8
8
|
import { s as resolveTimerTimeoutMs } from "./base64-C1PsYcRQ.mjs";
|
|
9
|
-
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
+
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-CnxX8hPj.mjs";
|
|
10
10
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
11
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
12
|
-
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-
|
|
13
|
-
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
11
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
12
|
+
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
13
|
+
import { b as createOpenAIResponseHook, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
14
14
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
15
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
15
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
16
16
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
17
17
|
import { h as responsesPromptObserver } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
18
|
-
import { A as recordResponsesContextUsage, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, q as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-
|
|
18
|
+
import { A as recordResponsesContextUsage, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Z as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, q as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, w as resolveNextResponsesEncryptedContentAttempt } from "./openai-responses-shared-BpGnmnV8.mjs";
|
|
19
19
|
import { t as createSseByteGuard } from "./streaming-byte-guard-CC-HMn_u.mjs";
|
|
20
20
|
import { n as registerSessionResourceCleanup } from "./session-resources-CkR4WWy1.mjs";
|
|
21
|
-
import { i as resolveOpenAIResponsesTextFormat, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-
|
|
21
|
+
import { i as resolveOpenAIResponsesTextFormat, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-C5WB2Kxf.mjs";
|
|
22
22
|
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
23
23
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
24
24
|
//#region packages/ai/src/providers/openai-chatgpt-responses-events.ts
|
|
@@ -150,7 +150,8 @@ const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
|
150
150
|
const REQUEST_COMPRESSION_ZSTD_LEVEL = 3;
|
|
151
151
|
const CODEX_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "opencode"]);
|
|
152
152
|
const WEBSOCKET_TRANSPORT_ERROR_CODE = "ERR_WEBSOCKET_TRANSPORT";
|
|
153
|
-
const
|
|
153
|
+
const RETRYABLE_CLOSE_CODES = /* @__PURE__ */ new Set([
|
|
154
|
+
1e3,
|
|
154
155
|
1001,
|
|
155
156
|
1005,
|
|
156
157
|
1006,
|
|
@@ -763,7 +764,7 @@ function extractWebSocketCloseError(event) {
|
|
|
763
764
|
let reasonText = typeof reason === "string" && reason.length > 0 ? ` ${reason}` : "";
|
|
764
765
|
if (!reasonText && code === WEBSOCKET_MESSAGE_TOO_BIG_CLOSE_CODE) reasonText = " message too big";
|
|
765
766
|
const message = `WebSocket closed${codeText}${reasonText}`;
|
|
766
|
-
const error = typeof code === "number" &&
|
|
767
|
+
const error = typeof code === "number" && RETRYABLE_CLOSE_CODES.has(code) ? createWebSocketTransportError(message) : Object.assign(new Error(message), { code: WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE });
|
|
767
768
|
return Object.assign(error, {
|
|
768
769
|
name: "WebSocketCloseError",
|
|
769
770
|
closeCode: typeof code === "number" ? code : void 0,
|
package/dist/{openai-completions-compat-W0ykoT4z.mjs → openai-completions-compat-D1q02qdx.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { i as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { i as resolveProviderRequestCapabilities } from "./host-policy-B3DuH3Le.mjs";
|
|
3
3
|
//#region packages/ai/src/providers/openai-response-format.ts
|
|
4
4
|
const JSON_SCHEMA_RESPONSE_FORMAT_NAME = "openclaw_response";
|
|
5
5
|
const OLLAMA_CLOUD_ORIGIN = "https://ollama.com";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
|
-
import { T as clampThinkingLevel } from "./host-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { T as clampThinkingLevel } from "./host-DqhMLv8J.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { S as withProviderResponseHook, b as transportAbortError, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
7
|
-
import { n as buildBaseOptions, s as prepareModelRequestBody, u as reasoningTagTextPolicy } from "./simple-options-
|
|
8
|
-
import { S as isOpenAICompletionsThinkingEnabled, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
6
|
+
import { S as withProviderResponseHook, b as transportAbortError, n as assignTransportErrorDetails } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
7
|
+
import { n as buildBaseOptions, s as prepareModelRequestBody, u as reasoningTagTextPolicy } from "./simple-options-B9u6-CF3.mjs";
|
|
8
|
+
import { S as isOpenAICompletionsThinkingEnabled, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
9
9
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
10
10
|
import { a as tagUnresolvedTextAsCommentary, t as clearPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
11
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
12
|
-
import { a as convertMessages, i as buildOpenAICompletionsRequest, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream } from "./openai-completions-stream-
|
|
11
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
12
|
+
import { a as convertMessages, i as buildOpenAICompletionsRequest, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream } from "./openai-completions-stream-BrsoGafc.mjs";
|
|
13
13
|
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
14
|
-
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
14
|
+
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-CUUfdJPN.mjs";
|
|
15
15
|
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
16
|
-
import { t as createOpenAIProviderClient } from "./openai-provider-client-
|
|
16
|
+
import { t as createOpenAIProviderClient } from "./openai-provider-client-D1gd0dfR.mjs";
|
|
17
17
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
18
18
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
|
19
19
|
convertMessages: () => convertMessages,
|
package/dist/{openai-completions-stream-Crkc597h.mjs → openai-completions-stream-BrsoGafc.mjs}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-vd9UnCAU.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { k as isImageWithMediaPayload, n as getAiTransportHost } from "./host-
|
|
3
|
+
import { k as isImageWithMediaPayload, n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
4
4
|
import { n as isOpenAIGpt55Model, r as isOpenAIGpt56Model, t as isOpenAIGpt54MiniModel } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
5
5
|
import { r as uniqueStrings } from "./string-normalization-J9ZiLfGO.mjs";
|
|
6
6
|
import { o as truncateUtf16Safe } from "./provider-error-CwT_j2v0.mjs";
|
|
7
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
7
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
8
8
|
import { r as emitModelTransportDebug } from "./diagnostics-CJaB6g8J.mjs";
|
|
9
9
|
import { i as asNonNegativeFiniteNumber } from "./base64-C1PsYcRQ.mjs";
|
|
10
|
-
import { c as supportsModelTools, r as estimateStringChars } from "./transport-utils-
|
|
11
|
-
import { c as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
12
|
-
import { r as resolveProviderEndpoint } from "./host-policy-
|
|
10
|
+
import { c as supportsModelTools, r as estimateStringChars } from "./transport-utils-CnxX8hPj.mjs";
|
|
11
|
+
import { c as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
12
|
+
import { r as resolveProviderEndpoint } from "./host-policy-B3DuH3Le.mjs";
|
|
13
13
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
14
|
-
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
15
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, m as extractToolResultText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-
|
|
16
|
-
import { C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, d as prepareOpenAITools, f as projectOpenAITools, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, k as resolvePromptCacheKey, p as reconcileOpenAICompletionsToolChoice, s as getCompat, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes } from "./openai-transport-params-
|
|
14
|
+
import { E as createToolArgumentPreviewSchedule, O as parseStreamingJson, d as iterateModelStream, j as sanitizeSurrogates, l as finalizeTerminalToolCallArguments, y as throwIfModelStreamAborted } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
15
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, m as extractToolResultText, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-B9u6-CF3.mjs";
|
|
16
|
+
import { C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, d as prepareOpenAITools, f as projectOpenAITools, g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, k as resolvePromptCacheKey, p as reconcileOpenAICompletionsToolChoice, s as getCompat, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
17
17
|
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
18
18
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
19
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
19
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
20
20
|
import { a as withFirstStreamEventTimeout } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
21
21
|
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-vsl-cE-n.mjs";
|
|
22
22
|
import { isGoogleGemini3FlashModel, isGoogleGemini3ProModel } from "./internal/google-model-family.mjs";
|
|
@@ -28,7 +28,13 @@ const DEEPSEEK_DSML_MARKERS = [
|
|
|
28
28
|
"|",
|
|
29
29
|
"|",
|
|
30
30
|
"||"
|
|
31
|
-
].
|
|
31
|
+
].flatMap((bar) => [`${bar}DSML${bar}`, `${bar}DSML${bar} `]);
|
|
32
|
+
const DEEPSEEK_DSML_TOOL_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => [
|
|
33
|
+
"calls",
|
|
34
|
+
"tool_calls",
|
|
35
|
+
"tool_call",
|
|
36
|
+
"function_calls"
|
|
37
|
+
].map((kind) => `<${marker}${kind}>`));
|
|
32
38
|
const DEEPSEEK_DSML_MARKER_PATTERN = `(${DEEPSEEK_DSML_MARKERS.map((marker) => marker.replaceAll("|", "\\|")).join("|")})`;
|
|
33
39
|
function findEarliestDsmlToken(text, tokens, fromIndex = 0) {
|
|
34
40
|
let best = null;
|
|
@@ -56,13 +62,7 @@ function longestDsmlTokenPrefixSuffixLength(text, tokens, maxTokenLength) {
|
|
|
56
62
|
* Removes provider-emitted DSML tool markup while buffering split tag prefixes
|
|
57
63
|
* across streamed chunks.
|
|
58
64
|
*/
|
|
59
|
-
const
|
|
60
|
-
"tool_use_error",
|
|
61
|
-
"tool_calls",
|
|
62
|
-
"tool_call",
|
|
63
|
-
"function_calls"
|
|
64
|
-
];
|
|
65
|
-
const DSML_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => DSML_KINDS.map((kind) => `<${marker}${kind}>`));
|
|
65
|
+
const DSML_OPEN_TOKENS = [...DEEPSEEK_DSML_TOOL_OPEN_TOKENS, ...DEEPSEEK_DSML_MARKERS.map((marker) => `<${marker}tool_use_error>`)];
|
|
66
66
|
const MAX_OPEN_TOKEN_LEN = Math.max(...DSML_OPEN_TOKENS.map((token) => token.length));
|
|
67
67
|
/** Create an incremental text filter that strips DeepSeek DSML tool blocks. */
|
|
68
68
|
function createDeepSeekTextFilter() {
|
|
@@ -1111,12 +1111,6 @@ function buildOpenAICompletionsRequest(model, context, options, policy) {
|
|
|
1111
1111
|
}
|
|
1112
1112
|
//#endregion
|
|
1113
1113
|
//#region packages/ai/src/transports/openai-completions-dsml.ts
|
|
1114
|
-
const DEEPSEEK_DSML_TOOL_KINDS = [
|
|
1115
|
-
"tool_calls",
|
|
1116
|
-
"tool_call",
|
|
1117
|
-
"function_calls"
|
|
1118
|
-
];
|
|
1119
|
-
const DEEPSEEK_DSML_TOOL_OPEN_TOKENS = DEEPSEEK_DSML_MARKERS.flatMap((marker) => DEEPSEEK_DSML_TOOL_KINDS.map((kind) => `<${marker}${kind}>`));
|
|
1120
1114
|
const DEEPSEEK_DSML_INVOKE_OPEN_PREFIXES = DEEPSEEK_DSML_MARKERS.map((marker) => `<${marker}invoke`);
|
|
1121
1115
|
const DEEPSEEK_DSML_INVOKE_OPEN_TAG = new RegExp(`^<${DEEPSEEK_DSML_MARKER_PATTERN}invoke\\b[^<>]*>$`);
|
|
1122
1116
|
const DEEPSEEK_DSML_TOOL_MAX_OPEN_TOKEN_LEN = Math.max(...DEEPSEEK_DSML_TOOL_OPEN_TOKENS.map((token) => token.length));
|
|
@@ -1374,9 +1368,9 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1374
1368
|
const emitReasoning = options?.emitReasoning ?? true;
|
|
1375
1369
|
const compat = getCompat(model);
|
|
1376
1370
|
const visibleReasoningDetailTypes = new Set(compat.visibleReasoningDetailTypes);
|
|
1377
|
-
const shouldFilterDeepSeekDsmlText =
|
|
1371
|
+
const shouldFilterDeepSeekDsmlText = compat.thinkingFormat === "deepseek";
|
|
1378
1372
|
const deepSeekTextFilter = shouldFilterDeepSeekDsmlText ? createDeepSeekTextFilter() : null;
|
|
1379
|
-
const deepSeekToolCallRecoverer = shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1373
|
+
const deepSeekToolCallRecoverer = !directMode && shouldFilterDeepSeekDsmlText ? createDsmlRecoverer() : null;
|
|
1380
1374
|
const reasoningTagTextPartitioner = createReasoningTagTextPartitioner();
|
|
1381
1375
|
if (options?.strictReasoningTags) reasoningTagTextPartitioner.markStrict();
|
|
1382
1376
|
let currentBlock = null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-D1q02qdx.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,5 +1,5 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
-
import { O as resolveOpenAIClientBaseUrl } from "./openai-transport-params-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
2
|
+
import { O as resolveOpenAIClientBaseUrl } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
3
3
|
import { i as resolveCloudflareBaseUrl, r as isCloudflareProvider } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
4
4
|
import OpenAI from "openai";
|
|
5
5
|
//#region packages/ai/src/providers/openai-provider-client.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.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-DHxMpeRz.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
5
5
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
7
|
-
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-B9u6-CF3.mjs";
|
|
7
|
+
import { g as resolveOpenAISimpleReasoningEffort } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
9
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
10
|
-
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
11
|
-
import { P as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
9
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
10
|
+
import { n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-CUUfdJPN.mjs";
|
|
11
|
+
import { P as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-BpGnmnV8.mjs";
|
|
12
12
|
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
13
|
-
import { t as createOpenAIProviderClient } from "./openai-provider-client-
|
|
13
|
+
import { t as createOpenAIProviderClient } from "./openai-provider-client-D1gd0dfR.mjs";
|
|
14
14
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
15
15
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
16
16
|
streamOpenAIResponses: () => streamOpenAIResponses,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
3
3
|
import { d as supportsOpenAITemperature, i as isOpenAIGpt6Model, m as resolveOpenAIThinkingApi } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
4
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
5
|
-
import { o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
4
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
5
|
+
import { o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
6
6
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
7
|
-
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
8
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
9
|
-
import { g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, k as resolvePromptCacheKey, m as reconcileOpenAIResponsesToolChoice, s as getCompat } from "./openai-transport-params-
|
|
7
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
8
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-B9u6-CF3.mjs";
|
|
9
|
+
import { g as resolveOpenAISimpleReasoningEffort, h as resolveOpenAIRequestReasoning, k as resolvePromptCacheKey, m as reconcileOpenAIResponsesToolChoice, s as getCompat } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
10
10
|
import { h as responsesPromptObserver, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
11
11
|
import { a as applyOpenAIResponsesPayloadPolicy, s as resolveOpenAIResponsesPayloadPolicy } from "./openai-responses-compaction-window-CYGCjAQz.mjs";
|
|
12
|
-
import { F as convertResponsesMessages, N as buildResponsesInputMessage, a as prepareResponsesTools } from "./openai-responses-shared-
|
|
12
|
+
import { F as convertResponsesMessages, N as buildResponsesInputMessage, a as prepareResponsesTools } from "./openai-responses-shared-BpGnmnV8.mjs";
|
|
13
13
|
//#region packages/ai/src/transports/openai-responses-params-internal.ts
|
|
14
14
|
const OPENAI_RESPONSES_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set([
|
|
15
15
|
"openai",
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { o as readProviderRefusalReview, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { r as appendAssistantThinking } from "./event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { k as isImageWithMediaPayload, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as calculateCost } from "./host-
|
|
4
|
+
import { k as isImageWithMediaPayload, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
5
5
|
import { a as normalizeOptionalString, o as normalizeStringifiedOptionalString, s as readStringValue } from "./string-coerce-fsri9iCu.mjs";
|
|
6
6
|
import { d as supportsOpenAITemperature } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
7
7
|
import { o as truncateUtf16Safe, s as stableStringify } from "./provider-error-CwT_j2v0.mjs";
|
|
8
8
|
import { a as resolveModelSseDebugMode, d as isResponsesProviderTool, g as resolveResponsesTerminalStopReason, h as readResponsesReasoningTokens, i as resolveModelPayloadDebugMode, l as ResponsesOutputIdentityError, m as mapResponsesTerminalUsage, r as emitModelTransportDebug, u as hasOnlyResponsesFunctionTools } from "./diagnostics-CJaB6g8J.mjs";
|
|
9
|
-
import { o as redactSensitiveText } from "./transport-utils-
|
|
10
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
11
|
-
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
12
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, s as prepareModelRequestBody } from "./simple-options-
|
|
13
|
-
import { A as redactIdentifier, C as log, d as prepareOpenAITools, h as resolveOpenAIRequestReasoning, j as sha256Hex, u as resolveOpenAIStrictToolFlagWithDiagnostics, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
14
|
-
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
9
|
+
import { o as redactSensitiveText } from "./transport-utils-CnxX8hPj.mjs";
|
|
10
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
11
|
+
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
12
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, s as prepareModelRequestBody } from "./simple-options-B9u6-CF3.mjs";
|
|
13
|
+
import { A as redactIdentifier, C as log, d as prepareOpenAITools, h as resolveOpenAIRequestReasoning, j as sha256Hex, u as resolveOpenAIStrictToolFlagWithDiagnostics, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
14
|
+
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BwVRJUQZ.mjs";
|
|
15
15
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
16
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
16
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
17
17
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
18
18
|
import { a as resolveOpenAIProjectedToolsStrictToolFlag, f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-vsl-cE-n.mjs";
|
|
19
19
|
import { a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, f as RESPONSE_FAILED_NO_DETAILS_MESSAGE, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as isPreviousResponseRejection, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { C as applyProviderReportedUsageCost, S as headersToRecord, T as clampThinkingLevel, n as getAiTransportHost, w as calculateCost } from "./host-
|
|
2
|
+
import { C as applyProviderReportedUsageCost, S as headersToRecord, T as clampThinkingLevel, n as getAiTransportHost, w as calculateCost } from "./host-DqhMLv8J.mjs";
|
|
3
3
|
import { a as normalizeOptionalString, n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
4
4
|
import { a as normalizeOpenAIReasoningEffort, c as resolveOpenAIReasoningEffortMapping, f as MODEL_CATALOG_THINKING_LEVELS, m as resolveOpenAIThinkingApi, o as resolveOpenAIModelReasoningEfforts, s as resolveOpenAIReasoningEffortForModel, u as supportsOpenAIReasoningEffort } from "./openai-reasoning-effort-C_0p3psG.mjs";
|
|
5
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
6
|
-
import { i as isCodeModeModelVisibleToolName } from "./transport-utils-
|
|
7
|
-
import { i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
8
|
-
import { n as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
9
|
-
import { m as notifyProviderHttpResponse } from "./transport-stream-shared-
|
|
5
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-DHxMpeRz.mjs";
|
|
6
|
+
import { i as isCodeModeModelVisibleToolName } from "./transport-utils-CnxX8hPj.mjs";
|
|
7
|
+
import { i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
8
|
+
import { n as resolveModelRequestTimeoutMs } from "./host-policy-B3DuH3Le.mjs";
|
|
9
|
+
import { m as notifyProviderHttpResponse } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
10
10
|
import { n as projectRuntimeToolInputSchema, t as prepareRuntimeToolInputSchema } from "./tool-schema-json-projection-Ct8SeBeJ.mjs";
|
|
11
11
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
12
12
|
import { a as resolveOpenAIProjectedToolsStrictToolFlag, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-vsl-cE-n.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as shortHash } from "./transport-stream-shared-
|
|
1
|
+
import { A as shortHash } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
3
3
|
function hashReplayContextValue(value) {
|
|
4
4
|
const normalized = value?.trim();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as transformMessages } from "./host-
|
|
2
|
-
import { a as createEmptyTransportUsage } from "./transport-stream-shared-
|
|
1
|
+
import { i as transformMessages } from "./host-DqhMLv8J.mjs";
|
|
2
|
+
import { a as createEmptyTransportUsage } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/assistant-output.ts
|
|
4
4
|
function createAssistantOutput(model, api = model.api) {
|
|
5
5
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
2
2
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-Bcunsn4I.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region packages/ai/src/transports/provider-transport-turn-state.ts
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
2
2
|
import { n as projectProviderError } from "./provider-error-CwT_j2v0.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-DHxMpeRz.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
5
5
|
/** Source id used for built-in API provider registrations. */
|
|
6
6
|
const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
|
|
@@ -62,39 +62,39 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
const registerBuiltIns = [
|
|
65
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
65
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-a0uD7NUz.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamAnthropic,
|
|
67
67
|
streamSimple: module.streamSimpleAnthropic
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
69
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-gyTpI3xG.mjs").then((n) => n.t), (module) => ({
|
|
70
70
|
stream: module.streamOpenAICompletions,
|
|
71
71
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
73
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-ytNCcQhM.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamMistral,
|
|
75
75
|
streamSimple: module.streamSimpleMistral
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
77
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-DluFZzn_.mjs").then((n) => n.t), (module) => ({
|
|
78
78
|
stream: module.streamOpenAIResponses,
|
|
79
79
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
81
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-CqWvI8x6.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamAzureOpenAIResponses,
|
|
83
83
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
85
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-L0Jc-0DF.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamOpenAICodexResponses,
|
|
87
87
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
88
88
|
})),
|
|
89
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
89
|
+
createLazyRegistration("google-generative-ai", () => import("./google-BfYNxKpG.mjs"), (module) => ({
|
|
90
90
|
stream: module.streamGoogle,
|
|
91
91
|
streamSimple: module.streamSimpleGoogle
|
|
92
92
|
})),
|
|
93
|
-
createLazyRegistration("google-interactions", () => import("./google-interactions-
|
|
93
|
+
createLazyRegistration("google-interactions", () => import("./google-interactions-BJNj0ugu.mjs"), (module) => ({
|
|
94
94
|
stream: module.streamGoogleInteractions,
|
|
95
95
|
streamSimple: module.streamSimpleGoogleInteractions
|
|
96
96
|
})),
|
|
97
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
97
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-CX1QaTs3.mjs"), (module) => ({
|
|
98
98
|
stream: module.streamGoogleVertex,
|
|
99
99
|
streamSimple: module.streamSimpleGoogleVertex
|
|
100
100
|
}))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { O as hasMediaPayload, n as getAiTransportHost } from "./host-
|
|
2
|
+
import { O as hasMediaPayload, n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
3
3
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
4
4
|
import { o as truncateUtf16Safe } from "./provider-error-CwT_j2v0.mjs";
|
|
5
|
-
import { i as copyProviderAcceptanceObserver, j as sanitizeSurrogates } from "./transport-stream-shared-
|
|
5
|
+
import { i as copyProviderAcceptanceObserver, j as sanitizeSurrogates } from "./transport-stream-shared-Dt7VrJFd.mjs";
|
|
6
6
|
//#region packages/ai/src/utils/prompt-cache-stability.ts
|
|
7
7
|
/**
|
|
8
8
|
* Prompt-cache normalization helpers. They keep generated prompt sections
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./diagnostics-DzrF1h4J.mjs";
|
|
2
|
-
import "./validation-
|
|
2
|
+
import "./validation-Fe6RtKI6.mjs";
|
|
3
3
|
//#region packages/llm-core/src/model-contracts/anthropic.ts
|
|
4
4
|
function normalizeClaudeModelId(modelId) {
|
|
5
5
|
const normalized = modelId?.trim().toLowerCase() ?? "";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { i as createAssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
3
3
|
import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { S as headersToRecord, n as getAiTransportHost } from "./host-
|
|
4
|
+
import { S as headersToRecord, n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
5
5
|
import { i as projectDiagnosticValue, n as projectProviderError } from "./provider-error-CwT_j2v0.mjs";
|
|
6
6
|
import { c as isTransientNetworkError } from "./diagnostics-CJaB6g8J.mjs";
|
|
7
7
|
import { parse } from "partial-json";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-DqhMLv8J.mjs";
|
|
2
2
|
import { o as truncateUtf16Safe } from "./provider-error-CwT_j2v0.mjs";
|
|
3
3
|
import "./internal/retry-after.mjs";
|
|
4
4
|
import "./positive-integer-CjN5OJbH.mjs";
|
package/dist/transports.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { S as resolveClaudeSonnet5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, h as resolveClaudeHaiku55ModelIdentity, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity } from "./src-
|
|
1
|
+
import { S as resolveClaudeSonnet5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, h as resolveClaudeHaiku55ModelIdentity, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, m as defaultsClaudeAdaptiveThinking, n as getAiTransportHost, p as buildAnthropicClaudeCodeIdentity, r as resolveAiTransportHeaderSentinels, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract } from "./host-
|
|
3
|
+
import { _ as requiresClaudeAdaptiveThinking, b as usesClaudeFable5MessagesContract, f as applyClaudeRequestContract, g as prepareClaudeNoPrefillRequestContext, m as defaultsClaudeAdaptiveThinking, n as getAiTransportHost, p as buildAnthropicClaudeCodeIdentity, r as resolveAiTransportHeaderSentinels, v as resolveAnthropicThinkingEffort, x as usesClaudeStreamingRefusalContract } from "./host-DqhMLv8J.mjs";
|
|
4
4
|
import { n as normalizeLowercaseStringOrEmpty, t as hasNonEmptyString } from "./string-coerce-fsri9iCu.mjs";
|
|
5
5
|
import { a as redactDiagnosticText, o as truncateUtf16Safe, s as stableStringify } from "./provider-error-CwT_j2v0.mjs";
|
|
6
6
|
import { a as resolveModelSseDebugMode, i as resolveModelPayloadDebugMode, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, u as hasOnlyResponsesFunctionTools, v as toErrorObject } from "./diagnostics-CJaB6g8J.mjs";
|
|
7
|
-
import { a as readResponseTextSnippet, i as isCodeModeModelVisibleToolName, n as createAbortError$1, s as resolveModelHeaderSentinels, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
8
|
-
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
9
|
-
import { r as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-
|
|
10
|
-
import { A as applyAnthropicRequestCacheControl, B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, D as applyAnthropicContextManagementToRequest, F as resolveAnthropicCacheOptions, I as resolveAnthropicEphemeralCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as resolveAnthropicPayloadPolicy, M as isAnthropicServerToolClearingEnabled, N as isDirectAnthropicModel, O as applyAnthropicEphemeralCacheControlMarkers, P as logAnthropicContextEdits, R as resolveAnthropicRequestBetaHeader, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, j as buildAnthropicSystemBlocks, k as applyAnthropicPayloadPolicyToParams, l as buildAnthropicGenerationParams, m as resolveNewestAnthropicCompaction, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as resolveAnthropicServerCompactionPlan } from "./anthropic-stream-reducer-
|
|
7
|
+
import { a as readResponseTextSnippet, i as isCodeModeModelVisibleToolName, n as createAbortError$1, s as resolveModelHeaderSentinels, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-CnxX8hPj.mjs";
|
|
8
|
+
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-D1q02qdx.mjs";
|
|
9
|
+
import { r as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-B3DuH3Le.mjs";
|
|
10
|
+
import { A as applyAnthropicRequestCacheControl, B as ANTHROPIC_SERVER_SIDE_FALLBACKS, C as applyAnthropicThinkingBindingControls, D as applyAnthropicContextManagementToRequest, F as resolveAnthropicCacheOptions, I as resolveAnthropicEphemeralCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as resolveAnthropicPayloadPolicy, M as isAnthropicServerToolClearingEnabled, N as isDirectAnthropicModel, O as applyAnthropicEphemeralCacheControlMarkers, P as logAnthropicContextEdits, R as resolveAnthropicRequestBetaHeader, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, j as buildAnthropicSystemBlocks, k as applyAnthropicPayloadPolicyToParams, l as buildAnthropicGenerationParams, m as resolveNewestAnthropicCompaction, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as resolveAnthropicServerCompactionPlan } from "./anthropic-stream-reducer-Cis7c1sm.mjs";
|
|
11
11
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
12
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
13
|
-
import { D as sortPromptCacheToolsByName, l as codeModeToolSurfaceObserver, s as prepareModelRequestBody, t as adjustMaxTokensForThinking, u as reasoningTagTextPolicy } from "./simple-options-
|
|
14
|
-
import { A as redactIdentifier, C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, O as resolveOpenAIClientBaseUrl, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, _ as resolveOpenAIReasoningEffortMap, a as enforceCodeModeResponsesToolSurface, b as createOpenAIResponseHook, c as readCodeModePayloadToolName, i as buildOpenAISdkRequestOptions, j as sha256Hex, k as resolvePromptCacheKey, l as resolveCodeModeResponsesVisibleToolNames, n as buildOpenAIClientHeaders, o as filterCodeModePayloadTools, r as buildOpenAISdkClientOptions, s as getCompat, t as assertCodeModeResponsesToolSurface, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-
|
|
12
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, 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-Dt7VrJFd.mjs";
|
|
13
|
+
import { D as sortPromptCacheToolsByName, l as codeModeToolSurfaceObserver, s as prepareModelRequestBody, t as adjustMaxTokensForThinking, u as reasoningTagTextPolicy } from "./simple-options-B9u6-CF3.mjs";
|
|
14
|
+
import { A as redactIdentifier, C as log, D as readOpenAICompletionsReasoningBatch, E as readOpenAICompletionsContentDeltas, O as resolveOpenAIClientBaseUrl, S as isOpenAICompletionsThinkingEnabled, T as parseOpenAICompletionsUsage, _ as resolveOpenAIReasoningEffortMap, a as enforceCodeModeResponsesToolSurface, b as createOpenAIResponseHook, c as readCodeModePayloadToolName, i as buildOpenAISdkRequestOptions, j as sha256Hex, k as resolvePromptCacheKey, l as resolveCodeModeResponsesVisibleToolNames, n as buildOpenAIClientHeaders, o as filterCodeModePayloadTools, r as buildOpenAISdkClientOptions, s as getCompat, t as assertCodeModeResponsesToolSurface, u as resolveOpenAIStrictToolFlagWithDiagnostics, v as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, w as measureUtf8AppendBytes, x as createResponseModelTracker, y as createOpenAIProviderAcceptanceHook } from "./openai-transport-params-C4eZAXf2.mjs";
|
|
15
15
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
16
16
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
17
|
-
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
17
|
+
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BwVRJUQZ.mjs";
|
|
18
18
|
import { a as tagUnresolvedTextAsCommentary } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
19
|
-
import { n as createAssistantOutput } from "./provider-transcript-transform-
|
|
19
|
+
import { n as createAssistantOutput } from "./provider-transcript-transform-Cg-36VSt.mjs";
|
|
20
20
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
21
|
-
import { c as flattenCompletionMessagesToStringContent, d as canonicalizeMaxTokensParam, f as resolveMaxTokensParam, l as stripCompletionMessagesToRoleContent, n as shouldEmitOpenAICompletionsReasoning, o as isAzureOpenAICompatibleHost, p as createDeepSeekTextFilter, r as buildOpenAICompletionsParams, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-stream-
|
|
22
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
21
|
+
import { c as flattenCompletionMessagesToStringContent, d as canonicalizeMaxTokensParam, f as resolveMaxTokensParam, l as stripCompletionMessagesToRoleContent, n as shouldEmitOpenAICompletionsReasoning, o as isAzureOpenAICompatibleHost, p as createDeepSeekTextFilter, r as buildOpenAICompletionsParams, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-stream-BrsoGafc.mjs";
|
|
22
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-C4ZiLG1P.mjs";
|
|
23
23
|
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-B9o0S4SZ.mjs";
|
|
24
24
|
import { d as OpenAIResponsesWebSocketSafeRetryError, i as OPENAI_RESPONSES_APIS, l as OpenAIResponsesWebSocketPostDispatchError, m as parseOpenAIResponsesWebSocketServerError, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPreDispatchError } from "./openai-responses-contracts-CLxnqS9p.mjs";
|
|
25
|
-
import { r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
25
|
+
import { r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-CUUfdJPN.mjs";
|
|
26
26
|
import { a as applyOpenAIResponsesPayloadPolicy, c as resolveOpenAIResponsesServerCompactionPlan, i as sanitizeResponsesImagePayload, n as isOpenAIResponsesCompactionOutput, o as resolveOpenAIResponsesCompactEndpointPlan, s as resolveOpenAIResponsesPayloadPolicy, t as createBoundedOpenAIResponsesCompactionFetch } from "./openai-responses-compaction-window-CYGCjAQz.mjs";
|
|
27
|
-
import { $ as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, A as recordResponsesContextUsage, B as resolveResponsesContinuationRequest, C as resolveAzureOpenAIApiVersion, D as safeDebugValue, E as logResponsesFailedNoDetails, G as supportsResponsesReasoningUpdate, H as responsesContinuationRequestFingerprint, I as recordResponsesInputReplay, J as captureOpenAIResponsesCompaction, K as CompactionReplayRefreshRequiredError, L as responsesInputFingerprint, O as summarizeOpenAITransportError, Q as OPENAI_RESPONSES_CALL_ID_RE, R as claimOpenAIResponsesHttpContinuation, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, U as isConfigurationUpdate, V as responsesContinuationPrefixFingerprint, W as replayResponsesReasoningUpdates, X as resolveNewestOpenAIResponsesCompactionReplay, Y as isOpenAIResponsesReplayContext, Z as suppressOpenAIResponsesCompaction, c as observeResponsesStream, et as OPENAI_RESPONSES_ID_MAX_LENGTH, it as resolveReplayableResponsesMessageId, j as resolveResponsesContextUsageBoundary, k as summarizeResponsesPayload, n as applyResponsesServiceTierPricing, nt as shouldNormalizeOpenAIResponsesToolCallId, q as buildOpenAIResponsesReasoningReplayMetadata, rt as splitOpenAIFunctionCallPairing, s as processResponsesStream, tt as normalizeOpenAIResponsesFunctionCallId, w as resolveNextResponsesEncryptedContentAttempt, x as createResponsesStreamWithEncryptedContentRetry, z as recordResponsesContinuationState } from "./openai-responses-shared-
|
|
27
|
+
import { $ as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, A as recordResponsesContextUsage, B as resolveResponsesContinuationRequest, C as resolveAzureOpenAIApiVersion, D as safeDebugValue, E as logResponsesFailedNoDetails, G as supportsResponsesReasoningUpdate, H as responsesContinuationRequestFingerprint, I as recordResponsesInputReplay, J as captureOpenAIResponsesCompaction, K as CompactionReplayRefreshRequiredError, L as responsesInputFingerprint, O as summarizeOpenAITransportError, Q as OPENAI_RESPONSES_CALL_ID_RE, R as claimOpenAIResponsesHttpContinuation, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, U as isConfigurationUpdate, V as responsesContinuationPrefixFingerprint, W as replayResponsesReasoningUpdates, X as resolveNewestOpenAIResponsesCompactionReplay, Y as isOpenAIResponsesReplayContext, Z as suppressOpenAIResponsesCompaction, c as observeResponsesStream, et as OPENAI_RESPONSES_ID_MAX_LENGTH, it as resolveReplayableResponsesMessageId, j as resolveResponsesContextUsageBoundary, k as summarizeResponsesPayload, n as applyResponsesServiceTierPricing, nt as shouldNormalizeOpenAIResponsesToolCallId, q as buildOpenAIResponsesReasoningReplayMetadata, rt as splitOpenAIFunctionCallPairing, s as processResponsesStream, tt as normalizeOpenAIResponsesFunctionCallId, w as resolveNextResponsesEncryptedContentAttempt, x as createResponsesStreamWithEncryptedContentRetry, z as recordResponsesContinuationState } from "./openai-responses-shared-BpGnmnV8.mjs";
|
|
28
28
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
29
29
|
import { n as registerSessionResourceCleanup } from "./session-resources-CkR4WWy1.mjs";
|
|
30
|
-
import { a as sanitizeOpenAICodexResponsesParams, n as buildOpenAIResponsesCompactSystemMessage, r as buildOpenAIResponsesParams, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-
|
|
30
|
+
import { a as sanitizeOpenAICodexResponsesParams, n as buildOpenAIResponsesCompactSystemMessage, r as buildOpenAIResponsesParams, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-C5WB2Kxf.mjs";
|
|
31
31
|
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
32
32
|
import { randomUUID } from "node:crypto";
|
|
33
33
|
import OpenAI, { AzureOpenAI } from "openai";
|
package/dist/types.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as supportsClaude1MContext, D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-
|
|
1
|
+
import { C as supportsClaude1MContext, D as supportsClaudeNativeXhighEffort, E as supportsClaudeNativeMaxEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-Dq6VRdeL.mjs";
|
|
2
2
|
import { n as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE } from "./types-LFWwv0cF.mjs";
|
|
3
3
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
4
4
|
import { i as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-vd9UnCAU.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Fe6RtKI6.mjs";
|
|
6
6
|
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, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -131,12 +131,7 @@ function applySchemaArrayCoercion(value, schema, root) {
|
|
|
131
131
|
if (isJsonSchemaObject(schema.items)) for (let index = 0; index < value.length; index++) value[index] = coerceWithJsonSchema(value[index], schema.items, root);
|
|
132
132
|
}
|
|
133
133
|
function coerceWithUnionSchema(value, schemas, root, refs) {
|
|
134
|
-
if (value
|
|
135
|
-
for (const schema of schemas) if (getSchemaTypes(schema, root).includes("null")) {
|
|
136
|
-
const validator = getSubSchemaValidator(schema, root);
|
|
137
|
-
if (!validator || validator.Check(value)) return value;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
134
|
+
for (const schema of schemas) if (getSubSchemaValidator(schema, root)?.Check(value)) return value;
|
|
140
135
|
for (const schema of schemas) {
|
|
141
136
|
const types = getSchemaTypes(schema, root);
|
|
142
137
|
if (value !== null && types.length === 1 && types[0] === "null") continue;
|
package/dist/validation.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
1
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Fe6RtKI6.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|