@openclaw/ai 2026.10.2 → 2026.10.4
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-C4qygbtf.mjs → anthropic-DloU96D6.mjs} +2 -2
- package/dist/{anthropic-stream-reducer-CWyWE21W.mjs → anthropic-stream-reducer-Djl4yqrc.mjs} +2 -3
- package/dist/{assistant-text-phase-DVZOxbuR.mjs → assistant-text-phase-DzvV7Oso.mjs} +1 -1
- package/dist/{azure-openai-responses-DO-Fv8ha.mjs → azure-openai-responses-CAyTrcy6.mjs} +1 -2
- package/dist/internal/anthropic.mjs +2 -2
- package/dist/internal/openai.mjs +5 -7
- package/dist/{openai-chatgpt-responses-CHdn8YJ_.mjs → openai-chatgpt-responses-vk4XdUjX.mjs} +6 -7
- package/dist/{openai-completions-BZfHIaZ7.mjs → openai-completions-XvUwdvJc.mjs} +1 -1
- package/dist/{openai-completions-transport-CuoQfnKV.mjs → openai-completions-transport-QYABn8Uz.mjs} +1180 -29
- package/dist/{openai-responses-BhAZFsL9.mjs → openai-responses-DNWY56mK.mjs} +2 -3
- package/dist/{openai-responses-prompt-observer-internal-CefUzh8M.mjs → openai-responses-request-lifecycle-Dskvtz_Z.mjs} +36 -1
- package/dist/{openai-responses-shared-CKNmC3vC.mjs → openai-responses-shared-BMx2NAS-.mjs} +805 -67
- package/dist/{provider-transport-turn-state-BX6TfCyW.mjs → provider-transport-turn-state-1T3vwTvn.mjs} +1 -1
- package/dist/providers.mjs +5 -5
- package/dist/{text-signature-D_vRrx-z.mjs → text-signature-CbqxIB8B.mjs} +25 -2
- package/dist/transports.mjs +11 -1148
- package/package.json +1 -1
- package/dist/openai-responses-request-lifecycle-Fsag-IGZ.mjs +0 -36
- package/dist/openai-transport-params-D7JMUPjf.mjs +0 -735
- package/dist/openai-web-search-tools-Cfu0uLyN.mjs +0 -14
- package/dist/provider-replay-context-CO_Eplnc.mjs +0 -25
|
@@ -2,8 +2,8 @@ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
|
2
2
|
import { w as supportsClaudeAdaptiveThinking } from "./src-VWy9E7DZ.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
|
|
4
4
|
import { S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost, v as defaultsClaudeAdaptiveThinking, x as requiresClaudeAdaptiveThinking } from "./host-u3o8XiAp.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { C as isAnthropicReplayRejection, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as isDirectAnthropicModel, T as suppressAnthropicCompaction, l as buildAnthropicRequest, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as supportsAnthropicServerSideFallback } from "./anthropic-stream-reducer-
|
|
5
|
+
import { a as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./text-signature-CbqxIB8B.mjs";
|
|
6
|
+
import { C as isAnthropicReplayRejection, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as isDirectAnthropicModel, T as suppressAnthropicCompaction, l as buildAnthropicRequest, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as supportsAnthropicServerSideFallback } from "./anthropic-stream-reducer-Djl4yqrc.mjs";
|
|
7
7
|
import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
8
8
|
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-CCR7hSW0.mjs";
|
|
9
9
|
import { n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking } from "./simple-options-7QuSKriJ.mjs";
|
package/dist/{anthropic-stream-reducer-CWyWE21W.mjs → anthropic-stream-reducer-Djl4yqrc.mjs}
RENAMED
|
@@ -5,17 +5,16 @@ import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStr
|
|
|
5
5
|
import { i as normalizeOptionalLowercaseString, r as normalizeNullableString } from "./string-coerce-CtgOVOSv.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-V8-BhME4.mjs";
|
|
7
7
|
import { N as isImageWithMediaPayload, O as calculateCost, S as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-u3o8XiAp.mjs";
|
|
8
|
-
import "./text-signature-
|
|
8
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-CbqxIB8B.mjs";
|
|
9
9
|
import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
|
|
10
10
|
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-BwhNNGQR.mjs";
|
|
11
11
|
import { i as resolveCacheRetention } from "./cloudflare-5qSGvIUH.mjs";
|
|
12
12
|
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, _ as sanitizeNonEmptyTransportPayloadText, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-CCR7hSW0.mjs";
|
|
13
13
|
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, t as adjustMaxTokensForThinking, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-7QuSKriJ.mjs";
|
|
14
14
|
import { t as parsePositiveInteger } from "./positive-integer-CwLi8LUL.mjs";
|
|
15
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-CO_Eplnc.mjs";
|
|
16
15
|
import { n as transformProviderMessages } from "./assistant-output-D5762GPH.mjs";
|
|
17
16
|
import { i as SCHEMA_MAP_KEYS, n as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-Ct8SeBeJ.mjs";
|
|
18
|
-
import { i as tagPendingCommentaryText } from "./assistant-text-phase-
|
|
17
|
+
import { i as tagPendingCommentaryText } from "./assistant-text-phase-DzvV7Oso.mjs";
|
|
19
18
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-D8f_oxHj.mjs";
|
|
20
19
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
21
20
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as encodeTextSignatureV1 } from "./text-signature-
|
|
1
|
+
import { t as encodeTextSignatureV1 } from "./text-signature-CbqxIB8B.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region packages/ai/src/utils/assistant-text-phase.ts
|
|
4
4
|
const EMPTY_ASSISTANT_TEXT_BLOCK_SET = /* @__PURE__ */ new Set();
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
|
|
2
2
|
import { r as getAiTransportHost } from "./host-u3o8XiAp.mjs";
|
|
3
3
|
import { n as buildBaseOptions } from "./simple-options-7QuSKriJ.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { P as convertProviderResponsesMessages, Pt as resolvePromptCacheKey, gt as resolveOpenAISimpleReasoningEffort, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-BMx2NAS-.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CyX4VKGO.mjs";
|
|
6
6
|
import { t as createAssistantOutput } from "./assistant-output-D5762GPH.mjs";
|
|
7
|
-
import { P as convertProviderResponsesMessages, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-CKNmC3vC.mjs";
|
|
8
7
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
9
8
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
10
9
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-VWy9E7DZ.mjs";
|
|
2
2
|
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-u3o8XiAp.mjs";
|
|
3
|
-
import { B as ANTHROPIC_SERVER_SIDE_FALLBACKS, G as resolveAnthropicFallbackServingModelCost, H as CLAUDE_OPUS_FALLBACK_MODEL_COST, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as isDirectAnthropicModel, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, U as applyAnthropicFallbackBoundary, V as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as readAnthropicFallbackBoundary, _ as toClaudeCodeToolName, a as readAnthropicPromptUsageSnapshot, b as findActiveAnthropicToolTurnAssistantIndex, c as applyAnthropicRefusal, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as projectAnthropicTools, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, p as normalizeAnthropicToolChoice, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as ANTHROPIC_OMITTED_REASONING_TEXT, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls } from "../anthropic-stream-reducer-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
3
|
+
import { B as ANTHROPIC_SERVER_SIDE_FALLBACKS, G as resolveAnthropicFallbackServingModelCost, H as CLAUDE_OPUS_FALLBACK_MODEL_COST, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as isDirectAnthropicModel, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, U as applyAnthropicFallbackBoundary, V as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as readAnthropicFallbackBoundary, _ as toClaudeCodeToolName, a as readAnthropicPromptUsageSnapshot, b as findActiveAnthropicToolTurnAssistantIndex, c as applyAnthropicRefusal, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as projectAnthropicTools, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, p as normalizeAnthropicToolChoice, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as ANTHROPIC_OMITTED_REASONING_TEXT, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls } from "../anthropic-stream-reducer-Djl4yqrc.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DloU96D6.mjs";
|
|
5
5
|
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -2,13 +2,11 @@ import { C as resolveOpenAIReasoningEffortForModel, D as supportsOpenAITemperatu
|
|
|
2
2
|
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-BK6E2g4Q.mjs";
|
|
3
3
|
import { g as resolveResponsesTerminalStopReason, h as readResponsesReasoningTokens, m as mapResponsesTerminalUsage, p as isResponsesOutputLimitToolCallError } from "../diagnostics-Caj-4RBA.mjs";
|
|
4
4
|
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-7QuSKriJ.mjs";
|
|
5
|
-
import { f as
|
|
6
|
-
import {
|
|
5
|
+
import { M as bindResponsesInputMessage, _ as isResponsesTextContentPartType, bt as reconcileOpenAICompletionsToolChoice, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as reconcileOpenAIResponsesToolChoice, y as resolveResponsesMessageSnapshotCollapse, yt as projectOpenAITools } from "../openai-responses-shared-BMx2NAS-.mjs";
|
|
6
|
+
import { c as convertMessages, o as hasResponsesWebSearchTool } from "../openai-completions-transport-QYABn8Uz.mjs";
|
|
7
7
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
8
|
-
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-CKNmC3vC.mjs";
|
|
9
8
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
10
|
-
import { t as
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-BhAZFsL9.mjs";
|
|
9
|
+
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-Dskvtz_Z.mjs";
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-XvUwdvJc.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-DNWY56mK.mjs";
|
|
14
12
|
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
package/dist/{openai-chatgpt-responses-CHdn8YJ_.mjs → openai-chatgpt-responses-vk4XdUjX.mjs}
RENAMED
|
@@ -7,18 +7,16 @@ import { D as supportsOpenAITemperature, h as responsesPromptObserver } from "./
|
|
|
7
7
|
import { r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8C.mjs";
|
|
8
8
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-BK6E2g4Q.mjs";
|
|
9
9
|
import { _ as extractErrorCodeOrErrno, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as toErrorObject } from "./diagnostics-Caj-4RBA.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { a as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./text-signature-CbqxIB8B.mjs";
|
|
11
11
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
12
12
|
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-GMN8A0fm.mjs";
|
|
13
13
|
import { n as buildManagedModelFetch } from "./host-policy-BwhNNGQR.mjs";
|
|
14
14
|
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-CCR7hSW0.mjs";
|
|
15
15
|
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-7QuSKriJ.mjs";
|
|
16
|
-
import {
|
|
16
|
+
import { A as recordResponsesContextUsage, Et as createResponseModelTracker, P as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as ResponsesStreamFailure, Tt as createOpenAIResponseHook, b as commitResponsesEncryptedContentAttempt, gt as resolveOpenAISimpleReasoningEffort, ht as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, it as suppressOpenAIResponsesCompaction, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, s as processResponsesStream, tt as buildOpenAIResponsesReasoningReplayMetadata, w as resolveNextResponsesEncryptedContentAttempt, wt as createOpenAIProviderAcceptanceHook } from "./openai-responses-shared-BMx2NAS-.mjs";
|
|
17
17
|
import { t as createAssistantOutput } from "./assistant-output-D5762GPH.mjs";
|
|
18
18
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D9ZmL_s9.mjs";
|
|
19
|
-
import {
|
|
20
|
-
import { t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-CefUzh8M.mjs";
|
|
21
|
-
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Fsag-IGZ.mjs";
|
|
19
|
+
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-Dskvtz_Z.mjs";
|
|
22
20
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
23
21
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
24
22
|
//#region packages/ai/src/providers/openai-chatgpt-responses-events.ts
|
|
@@ -294,7 +292,8 @@ const os = loadNodeOs();
|
|
|
294
292
|
const REQUEST_COMPRESSION_ZSTD_LEVEL = 3;
|
|
295
293
|
const CODEX_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "opencode"]);
|
|
296
294
|
const WEBSOCKET_TRANSPORT_ERROR_CODE = "ERR_WEBSOCKET_TRANSPORT";
|
|
297
|
-
const
|
|
295
|
+
const RETRYABLE_CLOSE_CODES = /* @__PURE__ */ new Set([
|
|
296
|
+
1e3,
|
|
298
297
|
1001,
|
|
299
298
|
1005,
|
|
300
299
|
1006,
|
|
@@ -832,7 +831,7 @@ function extractWebSocketCloseError(event) {
|
|
|
832
831
|
let reasonText = typeof reason === "string" && reason.length > 0 ? ` ${reason}` : "";
|
|
833
832
|
if (!reasonText && code === WEBSOCKET_MESSAGE_TOO_BIG_CLOSE_CODE) reasonText = " message too big";
|
|
834
833
|
const message = `WebSocket closed${codeText}${reasonText}`;
|
|
835
|
-
const error = typeof code === "number" &&
|
|
834
|
+
const error = typeof code === "number" && RETRYABLE_CLOSE_CODES.has(code) ? createWebSocketTransportError(message) : Object.assign(new Error(message), { code: WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE });
|
|
836
835
|
return Object.assign(error, {
|
|
837
836
|
name: "WebSocketCloseError",
|
|
838
837
|
closeCode: typeof code === "number" ? code : void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { k as clampThinkingLevel } from "./host-u3o8XiAp.mjs";
|
|
3
3
|
import { n as buildBaseOptions } from "./simple-options-7QuSKriJ.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { c as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-QYABn8Uz.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-D4kn3252.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|