@openclaw/ai 2026.9.5 → 2026.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-COtDvgtt.mjs → anthropic-DZQ_7gD1.mjs} +35 -35
- package/dist/{anthropic-payload-policy-5Erq1Nzy.d.mts → anthropic-payload-policy-DyfwikYJ.d.mts} +4 -4
- package/dist/{anthropic-stream-reducer-BvdYYWL8.mjs → anthropic-stream-reducer-D6ZI1wwj.mjs} +32 -16
- package/dist/{api-registry-Ba2Cv-ut.d.mts → api-registry-C2T3lTV7.d.mts} +2 -2
- package/dist/{assistant-output-BsEkB-vU.mjs → assistant-output-DM1JBNs1.mjs} +1 -1
- package/dist/{azure-openai-responses-YrgnD583.mjs → azure-openai-responses-DS86GYzq.mjs} +5 -5
- package/dist/{base64-BQOzsvUH.mjs → base64-CPmadnUf.mjs} +8 -8
- package/dist/{diagnostics-Dm4bisWG.mjs → diagnostics-CH8j2wIG.mjs} +55 -10
- package/dist/{diagnostics-CPeq9F7y.mjs → diagnostics-DzrF1h4J.mjs} +18 -1
- package/dist/diagnostics.d.mts +11 -5
- package/dist/diagnostics.mjs +4 -4
- package/dist/event-stream-C0nsgbj2.d.mts +1 -0
- package/dist/{event-stream-CCoa-qSI.d.mts → event-stream-CjnIZZst.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-BuhpRO9r.mjs → google-BZJFjhuC.mjs} +5 -5
- package/dist/{google-messages-CyWnYlh0.mjs → google-messages-DB7GKkDk.mjs} +3 -3
- package/dist/{google-shared-BT5ZeNer.mjs → google-shared-Bok4I6zB.mjs} +5 -5
- package/dist/{google-vertex-C7EplRvt.mjs → google-vertex-3eVNR2qW.mjs} +4 -4
- package/dist/{host-FZ1RA_qD.d.mts → host-DH-Z-LDb.d.mts} +3 -3
- package/dist/{host-policy-DUnXSx0I.mjs → host-policy-DZO3oPPk.mjs} +1 -1
- package/dist/{host-B4MeUNBc.mjs → host-yTvBrYM2.mjs} +41 -7
- package/dist/{index-DaF2QbwS.d.mts → index-C25RT6bP.d.mts} +36 -8
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +12 -8
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +22 -8
- package/dist/internal/openai.mjs +11 -10
- package/dist/internal/runtime.d.mts +6 -6
- package/dist/internal/runtime.mjs +5 -5
- package/dist/internal/shared.d.mts +5 -4
- package/dist/internal/shared.mjs +4 -4
- package/dist/internal/tool-schema.d.mts +1 -1
- package/dist/internal/tool-schema.mjs +1 -1
- package/dist/{mistral-moA-mbwl.mjs → mistral-C_13dVBn.mjs} +5 -5
- package/dist/{model-transport-url-DKocrEsb.d.mts → model-transport-url-C5f59L3Y.d.mts} +1 -1
- package/dist/{openai-chatgpt-responses-DWID3EFO.mjs → openai-chatgpt-responses-sTxPl4zM.mjs} +107 -84
- package/dist/{openai-completions-DJ1Vm-CD.mjs → openai-completions-BO6D_hrB.mjs} +10 -10
- package/dist/{openai-completions-compat-CkwdxTZx.mjs → openai-completions-compat-CUollwl6.mjs} +1 -1
- package/dist/{openai-completions-compat-JE7gqxb9.d.mts → openai-completions-compat-DfJG1wSO.d.mts} +3 -3
- package/dist/{openai-completions-stream-Bu98b0Hv.mjs → openai-completions-stream-BpuJ0ZOA.mjs} +38 -25
- package/dist/{openai-prompt-cache-CJ_xEevu.d.mts → openai-prompt-cache-C4RHdN4n.d.mts} +2 -2
- package/dist/{openai-prompt-cache-1wfaIszn.mjs → openai-prompt-cache-CjV_2IRI.mjs} +1 -1
- package/dist/{openai-provider-client-DPo0Hmak.mjs → openai-provider-client-BP8J1aeg.mjs} +2 -2
- package/dist/{openai-reasoning-effort-NlFZmfEu.mjs → openai-reasoning-effort-ash8dPrd.mjs} +12 -4
- package/dist/{openai-responses-BejZzQCP.mjs → openai-responses-BJ_IEoMU.mjs} +7 -7
- package/dist/{openai-responses-compaction-window-D6P5oZP5.mjs → openai-responses-compaction-window-BiNCT0bS.mjs} +3 -3
- package/dist/{openai-responses-contracts-Dflvrfa8.d.mts → openai-responses-contracts-B1ENJFpI.d.mts} +4 -4
- package/dist/{openai-responses-prompt-observer-internal-C15_-OwV.mjs → openai-responses-prompt-observer-internal-DPHWgbBH.mjs} +14 -11
- package/dist/openai-responses-request-lifecycle-DFuyO1pQ.mjs +36 -0
- package/dist/{openai-responses-shared-CwsziD_m.mjs → openai-responses-shared-DvSqtJ6_.mjs} +481 -410
- package/dist/{openai-responses-terminal-usage-Dl3J6zrf.d.mts → openai-responses-terminal-usage-BNFbvY9f.d.mts} +2 -2
- package/dist/{openai-tool-schema-BO8rwyAD.mjs → openai-tool-schema-D4BMcj2D.mjs} +171 -95
- package/dist/{openai-transport-params-DQeuAvBl.mjs → openai-transport-params-DZKOTSfH.mjs} +9 -9
- package/dist/{positive-integer-DtjCkbue.mjs → positive-integer-BiUxrd71.mjs} +1 -1
- package/dist/{provider-error-DDqw9Qda.mjs → provider-error-CRhW7lkJ.mjs} +40 -7
- package/dist/{provider-error-CzNw4BWX.d.mts → provider-error-xumb1V3F.d.mts} +3 -1
- package/dist/{provider-options-DprLsWh9.d.mts → provider-options-DZYq53lj.d.mts} +6 -4
- package/dist/{provider-replay-context-CnUSOwhr.mjs → provider-replay-context-DPr3w20a.mjs} +1 -1
- package/dist/{provider-transcript-transform-BsRAhuWJ.mjs → provider-transcript-transform-BTocjCRs.mjs} +1 -1
- package/dist/{provider-transport-turn-state-CkGToCD2.mjs → provider-transport-turn-state-lrXEFkYr.mjs} +1 -1
- package/dist/{provider-types-CAKRC7N5.d.mts → provider-types-w1rEqrGP.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{reasoning-tag-text-partitioner-Dy9IO8Dc.mjs → reasoning-tag-text-partitioner-Di38crhI.mjs} +154 -35
- package/dist/{simple-options-C6cFWj_f.mjs → simple-options-np1XPuhm.mjs} +2 -2
- package/dist/{src-DeKjbE8I.mjs → src-DwGYYyZp.mjs} +15 -6
- package/dist/{stream-first-event-timeout-C9ZadkJW.mjs → stream-first-event-timeout-BeptfRL6.mjs} +1 -1
- package/dist/{transport-stream-shared-D-6FQSHm.mjs → transport-stream-shared-B5RioB_Q.mjs} +5 -13
- package/dist/{transport-stream-shared-BbUkFaHi.d.mts → transport-stream-shared-B7Z9oCYg.d.mts} +5 -5
- package/dist/{transport-utils-1cyq5Y7x.mjs → transport-utils-03Qi0CN2.mjs} +3 -3
- package/dist/transports.d.mts +11 -11
- package/dist/transports.mjs +70 -45
- package/dist/types-DTvddOfm.d.mts +1 -0
- package/dist/{types-4_uVs5WH.d.mts → types-qZFbaDbK.d.mts} +2 -0
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +3 -3
- package/dist/{validation-Ctzu2DhF.d.mts → validation-DhQhmt6t.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +5 -5
- package/dist/event-stream-DmSCpi1T.d.mts +0 -1
- package/dist/types-DkJfb4W3.d.mts +0 -1
package/dist/transports.mjs
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as resolveClaudeSonnet5ModelIdentity, g as resolveClaudeOpus5ModelIdentity, y as supportsClaudeAdaptiveThinking } from "./src-DwGYYyZp.mjs";
|
|
2
2
|
import { n as normalizeLowercaseStringOrEmpty, t as hasNonEmptyString } from "./string-coerce-fsri9iCu.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
4
|
-
import { E as resolveAnthropicThinkingEffort, O as usesClaudeFable5MessagesContract, S as defaultsClaudeAdaptiveThinking, T as requiresClaudeAdaptiveThinking, b as
|
|
4
|
+
import { E as resolveAnthropicThinkingEffort, O as usesClaudeFable5MessagesContract, S as defaultsClaudeAdaptiveThinking, T as requiresClaudeAdaptiveThinking, b as applyClaudeRequestContract, k as usesClaudeStreamingRefusalContract, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as prepareClaudeNoPrefillRequestContext, x as buildAnthropicClaudeCodeIdentity } from "./host-yTvBrYM2.mjs";
|
|
5
5
|
import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
|
|
6
|
-
import { a as redactDiagnosticText, o as stableStringify } from "./provider-error-
|
|
7
|
-
import { a as resolveModelSseDebugMode, i as resolveModelPayloadDebugMode,
|
|
8
|
-
import { a as readResponseTextSnippet, i as isCodeModeModelVisibleToolName, n as createAbortError$1, s as resolveModelHeaderSentinels, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
-
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { i as resolveProviderEndpoint, s as transformTransportMessages, t as buildGuardedModelFetch } from "./host-policy-
|
|
11
|
-
import { B as logAnthropicContextEdits, C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, F as applyAnthropicPayloadPolicyToParams, G as resolveAnthropicServerCompactionPlan, H as resolveAnthropicContextManagementBetaHeader, I as applyAnthropicRequestCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as buildAnthropicSystemBlocks, N as applyAnthropicContextManagementToRequest, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, P as applyAnthropicEphemeralCacheControlMarkers, R as isAnthropicServerToolClearingEnabled, U as resolveAnthropicEphemeralCacheControl, V as resolveAnthropicCacheOptions, W as resolveAnthropicPayloadPolicy, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, l as buildAnthropicGenerationParams, m as resolveNewestAnthropicCompaction, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as isDirectAnthropicModel } from "./anthropic-stream-reducer-
|
|
6
|
+
import { a as redactDiagnosticText, o as stableStringify } from "./provider-error-CRhW7lkJ.mjs";
|
|
7
|
+
import { a as resolveModelSseDebugMode, i as resolveModelPayloadDebugMode, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, u as hasOnlyResponsesFunctionTools, v as toErrorObject } from "./diagnostics-CH8j2wIG.mjs";
|
|
8
|
+
import { a as readResponseTextSnippet, i as isCodeModeModelVisibleToolName, n as createAbortError$1, s as resolveModelHeaderSentinels, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-03Qi0CN2.mjs";
|
|
9
|
+
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-CUollwl6.mjs";
|
|
10
|
+
import { i as resolveProviderEndpoint, s as transformTransportMessages, t as buildGuardedModelFetch } from "./host-policy-DZO3oPPk.mjs";
|
|
11
|
+
import { B as logAnthropicContextEdits, C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, F as applyAnthropicPayloadPolicyToParams, G as resolveAnthropicServerCompactionPlan, H as resolveAnthropicContextManagementBetaHeader, I as applyAnthropicRequestCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as buildAnthropicSystemBlocks, N as applyAnthropicContextManagementToRequest, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, P as applyAnthropicEphemeralCacheControlMarkers, R as isAnthropicServerToolClearingEnabled, U as resolveAnthropicEphemeralCacheControl, V as resolveAnthropicCacheOptions, W as resolveAnthropicPayloadPolicy, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, l as buildAnthropicGenerationParams, m as resolveNewestAnthropicCompaction, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as isDirectAnthropicModel } from "./anthropic-stream-reducer-D6ZI1wwj.mjs";
|
|
12
12
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
13
|
-
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy, t as adjustMaxTokensForThinking, v as sortPromptCacheToolsByName } from "./simple-options-
|
|
14
|
-
import { A as resolvePromptCacheKey, C as isOpenAICompletionsThinkingEnabled, D as readOpenAICompletionsContentDeltas, E as parseOpenAICompletionsUsage, M as redactIdentifier, N as sha256Hex, O as readOpenAICompletionsReasoningBatch, S as createResponseModelTracker, T as measureUtf8AppendBytes, _ as resolveOpenAIReasoningEffortMap, a as enforceCodeModeResponsesToolSurface, b as createOpenAIProviderAcceptanceHook, c as readCodeModePayloadToolName, i as buildOpenAISdkRequestOptions, j as throwIfModelStreamAborted, k as resolveOpenAIClientBaseUrl, 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 log, x as createOpenAIResponseHook, y as createModelStreamCooperativeScheduler } from "./openai-transport-params-
|
|
13
|
+
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy, t as adjustMaxTokensForThinking, v as sortPromptCacheToolsByName } from "./simple-options-np1XPuhm.mjs";
|
|
14
|
+
import { A as resolvePromptCacheKey, C as isOpenAICompletionsThinkingEnabled, D as readOpenAICompletionsContentDeltas, E as parseOpenAICompletionsUsage, M as redactIdentifier, N as sha256Hex, O as readOpenAICompletionsReasoningBatch, S as createResponseModelTracker, T as measureUtf8AppendBytes, _ as resolveOpenAIReasoningEffortMap, a as enforceCodeModeResponsesToolSurface, b as createOpenAIProviderAcceptanceHook, c as readCodeModePayloadToolName, i as buildOpenAISdkRequestOptions, j as throwIfModelStreamAborted, k as resolveOpenAIClientBaseUrl, 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 log, x as createOpenAIResponseHook, y as createModelStreamCooperativeScheduler } from "./openai-transport-params-DZKOTSfH.mjs";
|
|
15
15
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
16
|
-
import { C as quoteUnsafeIntegerLiterals, S as parseJsonPreservingUnsafeIntegers, _ as sanitizeTransportPayloadText, a as createEmptyTransportUsage, b as withProviderResponseHook, c as finalizeTerminalToolCallArguments, d as mergeTransportMetadata, f as notifyProviderHttpMetadata, g as sanitizeNonEmptyTransportPayloadText, h as parseTerminalToolCallArguments, i as copyProviderAcceptanceObserver, l as finalizeTransportStream, m as notifyProviderStreamOpened, n as assignTransportErrorDetails, o as createWritableTransportEventStream, p as notifyProviderHttpResponse, r as coerceTransportToolCallArguments, s as failTransportStream, t as IncompleteToolCallError, u as mergeTransportHeaders, v as transportAbortError, x as parseJsonObjectPreservingUnsafeIntegers, y as withProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
16
|
+
import { C as quoteUnsafeIntegerLiterals, S as parseJsonPreservingUnsafeIntegers, _ as sanitizeTransportPayloadText, a as createEmptyTransportUsage, b as withProviderResponseHook, c as finalizeTerminalToolCallArguments, d as mergeTransportMetadata, f as notifyProviderHttpMetadata, g as sanitizeNonEmptyTransportPayloadText, h as parseTerminalToolCallArguments, i as copyProviderAcceptanceObserver, l as finalizeTransportStream, m as notifyProviderStreamOpened, n as assignTransportErrorDetails, o as createWritableTransportEventStream, p as notifyProviderHttpResponse, r as coerceTransportToolCallArguments, s as failTransportStream, t as IncompleteToolCallError, u as mergeTransportHeaders, v as transportAbortError, x as parseJsonObjectPreservingUnsafeIntegers, y as withProviderAcceptanceObserver } from "./transport-stream-shared-B5RioB_Q.mjs";
|
|
17
17
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
18
|
-
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
18
|
+
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-DPr3w20a.mjs";
|
|
19
19
|
import { a as tagUnresolvedTextAsCommentary } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
20
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
20
|
+
import { t as createAssistantOutput } from "./assistant-output-DM1JBNs1.mjs";
|
|
21
21
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
22
|
-
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-
|
|
23
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
24
|
-
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-
|
|
22
|
+
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-BpuJ0ZOA.mjs";
|
|
23
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-DB7GKkDk.mjs";
|
|
24
|
+
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-BeptfRL6.mjs";
|
|
25
25
|
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-DWrfMODE.mjs";
|
|
26
|
-
import { r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
27
|
-
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-
|
|
28
|
-
import { A as
|
|
26
|
+
import { r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-lrXEFkYr.mjs";
|
|
27
|
+
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-BiNCT0bS.mjs";
|
|
28
|
+
import { A as summarizeOpenAITransportError, B as resolveResponsesContinuationRequest, C as createResponsesStreamWithEncryptedContentRetry, D as ResponsesStreamFailure, E as resolveNextResponsesEncryptedContentAttempt, G as supportsResponsesReasoningUpdate, H as responsesContinuationRequestFingerprint, I as createOpenAIResponsesAssistantOutput, J as captureOpenAIResponsesCompaction, K as CompactionReplayRefreshRequiredError, L as recordResponsesInputReplay, M as recordResponsesContextUsage, N as resolveResponsesContextUsageBoundary, O as logResponsesFailedNoDetails, Q as resolveReplayableResponsesMessageId, R as responsesInputFingerprint, T as resolveAzureOpenAIApiVersion, U as isConfigurationUpdate, V as responsesContinuationPrefixFingerprint, W as replayResponsesReasoningUpdates, X as resolveNewestOpenAIResponsesCompactionReplay, Y as isOpenAIResponsesReplayContext, Z as suppressOpenAIResponsesCompaction, j as summarizeResponsesPayload, k as safeDebugValue, l as processResponsesStream, n as applyResponsesServiceTierPricing, q as buildOpenAIResponsesReasoningReplayMetadata, u as observeResponsesStream, w as isInvalidEncryptedContentError, z as claimOpenAIResponsesHttpContinuation } from "./openai-responses-shared-DvSqtJ6_.mjs";
|
|
29
29
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
30
30
|
import { n as registerSessionResourceCleanup } from "./session-resources-CkR4WWy1.mjs";
|
|
31
|
-
import { a as sanitizeOpenAICodexResponsesParams, n as buildOpenAIResponsesCompactSystemMessage, r as buildOpenAIResponsesParams, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-
|
|
31
|
+
import { a as sanitizeOpenAICodexResponsesParams, n as buildOpenAIResponsesCompactSystemMessage, r as buildOpenAIResponsesParams, t as createResponsesPromptEgressObserver } from "./openai-responses-prompt-observer-internal-DPHWgbBH.mjs";
|
|
32
|
+
import { n as withResponsesRequestAcceptance, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-DFuyO1pQ.mjs";
|
|
32
33
|
import { randomUUID } from "node:crypto";
|
|
33
34
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
34
35
|
import { ResponsesWS } from "openai/resources/responses/ws.js";
|
|
@@ -273,21 +274,17 @@ function createAnthropicTransportClient(params) {
|
|
|
273
274
|
if (needsInterleavedBeta) betaFeatures.push("interleaved-thinking-2025-05-14");
|
|
274
275
|
if (isAnthropicOAuthApiKey(apiKey)) {
|
|
275
276
|
const betaHeader = buildAnthropicBetaHeader(model, betaFeatures, { oauth: true });
|
|
277
|
+
const identity = buildAnthropicClaudeCodeIdentity(betaHeader, model.headers, optionHeaders);
|
|
276
278
|
return {
|
|
277
279
|
client: createAnthropicMessagesClient({
|
|
278
280
|
apiKey: null,
|
|
279
281
|
authToken: apiKey,
|
|
280
282
|
baseURL: model.baseUrl,
|
|
281
|
-
defaultHeaders:
|
|
282
|
-
accept: "application/json",
|
|
283
|
-
"anthropic-dangerous-direct-browser-access": "true",
|
|
284
|
-
...betaHeader ? { "anthropic-beta": betaHeader } : {},
|
|
285
|
-
"user-agent": `claude-cli/${ANTHROPIC_CLAUDE_CODE_VERSION}`,
|
|
286
|
-
"x-app": "cli"
|
|
287
|
-
}, model.headers, optionHeaders),
|
|
283
|
+
defaultHeaders: identity.headers,
|
|
288
284
|
fetch
|
|
289
285
|
}),
|
|
290
|
-
isOAuthToken: true
|
|
286
|
+
isOAuthToken: true,
|
|
287
|
+
claudeCodeVersion: identity.version
|
|
291
288
|
};
|
|
292
289
|
}
|
|
293
290
|
if (useAnthropicServerSideFallback(model)) betaFeatures.push(ANTHROPIC_SERVER_SIDE_FALLBACK_BETA);
|
|
@@ -308,7 +305,7 @@ function createAnthropicTransportClient(params) {
|
|
|
308
305
|
directApiKeyBetaHeader: isDirectAnthropicModel(model) ? new Headers(defaultHeaders).get("anthropic-beta") ?? "" : void 0
|
|
309
306
|
};
|
|
310
307
|
}
|
|
311
|
-
async function buildAnthropicParams(model, context, isOAuthToken, options) {
|
|
308
|
+
async function buildAnthropicParams(model, context, isOAuthToken, options, claudeCodeVersion) {
|
|
312
309
|
const replayThinkingEnabled = requiresClaudeAdaptiveThinking(model) || options?.thinkingEnabled === true;
|
|
313
310
|
const maxTokens = resolveAnthropicMessagesMaxTokens({
|
|
314
311
|
modelContextWindow: model.contextWindow,
|
|
@@ -338,7 +335,7 @@ async function buildAnthropicParams(model, context, isOAuthToken, options) {
|
|
|
338
335
|
stream: true
|
|
339
336
|
};
|
|
340
337
|
if (!isOAuthToken && useAnthropicServerSideFallback(model)) params.fallbacks = ANTHROPIC_SERVER_SIDE_FALLBACKS;
|
|
341
|
-
const system = buildAnthropicSystemBlocks(context.systemPrompt, isOAuthToken, cacheControl);
|
|
338
|
+
const system = buildAnthropicSystemBlocks(context.systemPrompt, isOAuthToken, cacheControl, claudeCodeVersion);
|
|
342
339
|
if (system) params.system = system;
|
|
343
340
|
const convertedTools = context.tools ? convertAnthropicTools(context.tools, isOAuthToken) : void 0;
|
|
344
341
|
const toolProjection = convertedTools?.projection;
|
|
@@ -425,13 +422,13 @@ function createAnthropicMessagesTransportStreamFn() {
|
|
|
425
422
|
if (!apiKey) throw new Error(`No API key for provider: ${model.provider}`);
|
|
426
423
|
const transportOptions = resolveAnthropicTransportOptions(model, options, apiKey);
|
|
427
424
|
const requestContext = prepareClaudeNoPrefillRequestContext(model, context);
|
|
428
|
-
const { client, isOAuthToken, directApiKeyBetaHeader } = createAnthropicTransportClient({
|
|
425
|
+
const { client, isOAuthToken, directApiKeyBetaHeader, claudeCodeVersion } = createAnthropicTransportClient({
|
|
429
426
|
model,
|
|
430
427
|
context: requestContext,
|
|
431
428
|
apiKey,
|
|
432
429
|
options: transportOptions
|
|
433
430
|
});
|
|
434
|
-
const builtParams = await buildAnthropicParams(model, requestContext, isOAuthToken, transportOptions);
|
|
431
|
+
const builtParams = await buildAnthropicParams(model, requestContext, isOAuthToken, transportOptions, claudeCodeVersion);
|
|
435
432
|
usedCompactionReplay = builtParams.usedCompactionReplay;
|
|
436
433
|
let params = builtParams.params;
|
|
437
434
|
applyAnthropicContextManagementToRequest(params, model, transportOptions, directApiKeyBetaHeader);
|
|
@@ -1337,6 +1334,36 @@ function restoreResponsesReasoningState(context, model, identity, request) {
|
|
|
1337
1334
|
return prepared;
|
|
1338
1335
|
}
|
|
1339
1336
|
//#endregion
|
|
1337
|
+
//#region packages/ai/src/transports/openai-responses-request-fetch.ts
|
|
1338
|
+
function withDefaultResponsesStreamEncoding(fetch) {
|
|
1339
|
+
return (input, init) => {
|
|
1340
|
+
const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : void 0));
|
|
1341
|
+
if (headers.has("accept-encoding")) return fetch(input, init);
|
|
1342
|
+
headers.set("accept-encoding", "identity");
|
|
1343
|
+
return fetch(input, {
|
|
1344
|
+
...init,
|
|
1345
|
+
headers
|
|
1346
|
+
});
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
/** Preserve the existing fetch policy while binding explicit continuation dispatch to its signal. */
|
|
1350
|
+
function createResponsesRequestFetch(model, options) {
|
|
1351
|
+
const lifecycle = options.lifecycle;
|
|
1352
|
+
if (lifecycle && options.compact) throw new Error("Provider review continuation cannot replace its reviewed input with compaction");
|
|
1353
|
+
let fetchOverride = options.compact ? createBoundedOpenAIResponsesCompactionFetch(buildGuardedModelFetch(model)) : options.stream ? withDefaultResponsesStreamEncoding(buildGuardedModelFetch(model)) : void 0;
|
|
1354
|
+
if (lifecycle) {
|
|
1355
|
+
const dispatchFetch = fetchOverride ?? buildGuardedModelFetch(model);
|
|
1356
|
+
fetchOverride = async (input, init) => {
|
|
1357
|
+
const signal = init?.signal ?? (input instanceof Request ? input.signal : void 0);
|
|
1358
|
+
await lifecycle.beforeDispatch(signal ?? void 0);
|
|
1359
|
+
signal?.throwIfAborted();
|
|
1360
|
+
lifecycle.assertCurrent();
|
|
1361
|
+
return dispatchFetch(input, init);
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
return fetchOverride;
|
|
1365
|
+
}
|
|
1366
|
+
//#endregion
|
|
1340
1367
|
//#region packages/ai/src/transports/openai-responses-client.ts
|
|
1341
1368
|
function resolveNativeOpenAIResponsesWebSocketMode(model, transport) {
|
|
1342
1369
|
if (transport !== "websocket" && transport !== "websocket-cached" && transport !== "auto") return;
|
|
@@ -1362,17 +1389,6 @@ function createOpenAIResponsesClient(model, apiKey, defaultHeaders, fetchOverrid
|
|
|
1362
1389
|
...buildOpenAISdkClientOptions(model)
|
|
1363
1390
|
});
|
|
1364
1391
|
}
|
|
1365
|
-
function withDefaultResponsesStreamEncoding(fetch) {
|
|
1366
|
-
return (input, init) => {
|
|
1367
|
-
const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : void 0));
|
|
1368
|
-
if (headers.has("accept-encoding")) return fetch(input, init);
|
|
1369
|
-
headers.set("accept-encoding", "identity");
|
|
1370
|
-
return fetch(input, {
|
|
1371
|
-
...init,
|
|
1372
|
-
headers
|
|
1373
|
-
});
|
|
1374
|
-
};
|
|
1375
|
-
}
|
|
1376
1392
|
function createResponsesTransportExecutor(config) {
|
|
1377
1393
|
return (model, context, options) => {
|
|
1378
1394
|
const responsesOptions = options;
|
|
@@ -1382,6 +1398,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
1382
1398
|
const output = createOpenAIResponsesAssistantOutput(model, config.outputApi);
|
|
1383
1399
|
let firstEventAbort;
|
|
1384
1400
|
let continuationClaim;
|
|
1401
|
+
const requestLifecycle = responsesRequestLifecycle.get(options);
|
|
1385
1402
|
try {
|
|
1386
1403
|
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
|
1387
1404
|
const websocketMode = resolveNativeOpenAIResponsesWebSocketMode(model, responsesOptions?.transport);
|
|
@@ -1396,7 +1413,12 @@ function createResponsesTransportExecutor(config) {
|
|
|
1396
1413
|
const websocketTurnHeaders = filterProviderTurnHeadersForExplicitOpencodeSession(model, options, websocketSessionPolicy?.headers);
|
|
1397
1414
|
const websocketHeaders = websocketMode ? buildOpenAIClientHeaders(model, context, options?.headers, websocketTurnHeaders, options?.sessionId, options?.cacheRetention) : void 0;
|
|
1398
1415
|
const httpHeaders = buildOpenAIClientHeaders(model, context, options?.headers, httpTurnHeaders, options?.sessionId, options?.cacheRetention);
|
|
1399
|
-
const
|
|
1416
|
+
const fetchOverride = createResponsesRequestFetch(model, {
|
|
1417
|
+
compact: Boolean(compactRequest),
|
|
1418
|
+
stream: config.streamRequest,
|
|
1419
|
+
lifecycle: requestLifecycle
|
|
1420
|
+
});
|
|
1421
|
+
const client = config.createClient(model, apiKey, httpHeaders, fetchOverride);
|
|
1400
1422
|
const nativeAstra = model.id === "gpt-6-astra" && supportsNativeOpenAIResponsesEndpoint(model);
|
|
1401
1423
|
const asyncToolExecutionEligible = nativeAstra && options?.asyncToolExecution === true && !responsesOptions?.openclawCodeModeToolSurface;
|
|
1402
1424
|
const prepareRequest = async (request) => {
|
|
@@ -1592,7 +1614,9 @@ function createResponsesTransportExecutor(config) {
|
|
|
1592
1614
|
}
|
|
1593
1615
|
else responseStream = await createSseStream();
|
|
1594
1616
|
try {
|
|
1595
|
-
const
|
|
1617
|
+
const acceptedResponseStream = withResponsesRequestAcceptance(responseStream, requestLifecycle, transport === "websocket" ? websocketSignal : firstEvent.signal);
|
|
1618
|
+
const terminal = await processResponsesStream(acceptedResponseStream, output, stream, model, {
|
|
1619
|
+
canRetryIdentityConflict: () => hasOnlyResponsesFunctionTools(transport === "websocket" ? websocketBaseline : continuationBaseline),
|
|
1596
1620
|
...config.pricingOptions?.(responsesOptions, model),
|
|
1597
1621
|
firstEventTimeoutMs: getFirstStreamEventTimeoutMs(options) ?? config.firstEventTimeoutMs,
|
|
1598
1622
|
abortFirstEventStream: firstEvent.abort,
|
|
@@ -1623,6 +1647,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
1623
1647
|
signal: options?.signal
|
|
1624
1648
|
});
|
|
1625
1649
|
} catch (error) {
|
|
1650
|
+
if (requestLifecycle) await requestLifecycle.settle().catch(() => void 0);
|
|
1626
1651
|
if (compactRequest) {
|
|
1627
1652
|
compactRequest.reject(error);
|
|
1628
1653
|
failTransportStream({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index-C25RT6bP.mjs";
|
|
@@ -610,6 +610,8 @@ interface OpenAICompletionsCompat {
|
|
|
610
610
|
}
|
|
611
611
|
/** Compatibility settings for OpenAI Responses APIs. */
|
|
612
612
|
interface OpenAIResponsesCompat {
|
|
613
|
+
/** Whether a compatible provider accepts the `strict` tool field. Default: auto-detected from the endpoint. */
|
|
614
|
+
supportsStrictMode?: boolean;
|
|
613
615
|
/** Whether the provider supports the `developer` role (vs `system`). Default: true. */
|
|
614
616
|
supportsDeveloperRole?: boolean;
|
|
615
617
|
/** Whether to send reasoning effort settings. Defaults to the model's known capabilities. */
|
package/dist/types.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
-
import "./types-
|
|
6
|
-
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
1
|
+
import { C as supportsClaudeFastMode, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeXhighEffort, _ as resolveClaudeNativeThinkingLevelMap, a as ProviderRefusalReview, b as resolveClaudeSonnet5ModelIdentity, c as CLAUDE_OPUS_55_THINKING_PROFILE, d as bindsClaudeThinkingPrefix, f as requiresClaudeDefaultSampling, g as resolveClaudeMythos5ModelIdentity, h as resolveClaudeModelIdentity, i as normalizeResolvedPricing, l as CLAUDE_OPUS_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as calculateUsageCost, o as readProviderRefusalReview, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeModelCostConfig, s as CLAUDE_FABLE_5_THINKING_PROFILE, u as CLAUDE_SONNET_5_THINKING_PROFILE, v as resolveClaudeOpus55ModelIdentity, w as supportsClaudeNativeMaxEffort, x as supportsClaude1MContext, y as resolveClaudeOpus5ModelIdentity } from "./index-C25RT6bP.mjs";
|
|
2
|
+
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-qZFbaDbK.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CjnIZZst.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DhQhmt6t.mjs";
|
|
5
|
+
import "./types-DTvddOfm.mjs";
|
|
6
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, type ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/types.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, a as CLAUDE_OPUS_55_THINKING_PROFILE, b as supportsClaudeFastMode, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeOpus5ModelIdentity, h as resolveClaudeOpus55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as normalizeModelCostConfig, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeResolvedPricing, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as calculateUsageCost, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaude1MContext, x as supportsClaudeNativeMaxEffort, y as supportsClaudeAdaptiveThinking } from "./src-DwGYYyZp.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
|
-
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
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-D8PARQfL.mjs";
|
|
5
5
|
import { n as validateToolCall, t as validateToolArguments } from "./validation-Dw7cb6BV.mjs";
|
|
6
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_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, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
6
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_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, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nt as Tool, rt as ToolCall } from "./types-
|
|
1
|
+
import { nt as Tool, rt as ToolCall } from "./types-qZFbaDbK.mjs";
|
|
2
2
|
//#region packages/llm-core/src/validation.d.ts
|
|
3
3
|
/** Finds the target tool and validates/coerces a model-emitted tool call. */
|
|
4
4
|
declare function validateToolCall(tools: Tool[], toolCall: ToolCall): unknown;
|
package/dist/validation.d.mts
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-DhQhmt6t.mjs";
|
|
2
2
|
export { validateToolArguments, validateToolCall };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/ai",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.6",
|
|
4
4
|
"description": "Reusable model provider adapters and streaming runtime from OpenClaw",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@anthropic-ai/sdk": "0.
|
|
122
|
-
"@google/genai": "2.
|
|
123
|
-
"@mistralai/mistralai": "2.
|
|
124
|
-
"openai": "7.
|
|
121
|
+
"@anthropic-ai/sdk": "0.125.0",
|
|
122
|
+
"@google/genai": "2.22.0",
|
|
123
|
+
"@mistralai/mistralai": "2.7.0",
|
|
124
|
+
"openai": "7.15.0",
|
|
125
125
|
"partial-json": "0.1.7",
|
|
126
126
|
"typebox": "1.3.30"
|
|
127
127
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./event-stream-CCoa-qSI.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./index-DaF2QbwS.mjs";
|