@openclaw/ai 2026.11.1 → 2026.11.2
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-Do60LsIj.mjs → anthropic-CUVqVXTe.mjs} +6 -6
- package/dist/{anthropic-stream-reducer-UI5_Ta6I.mjs → anthropic-stream-reducer-yWDb5Cct.mjs} +8 -8
- package/dist/{anthropic-tool-projection-DA_KeluM.mjs → anthropic-tool-projection-DZOKfAmL.mjs} +1 -1
- package/dist/{assistant-output-BdFoDBYQ.mjs → assistant-output-BnQm3fov.mjs} +2 -2
- package/dist/{azure-openai-responses-DojP0OrF.mjs → azure-openai-responses-I97-HnAv.mjs} +4 -4
- package/dist/{diagnostics-Cv7cW3pS.mjs → diagnostics-v7oVEW59.mjs} +17 -1
- package/dist/diagnostics.mjs +1 -1
- package/dist/{google-D0QA9Xum.mjs → google-Cpi_cLKZ.mjs} +2 -2
- package/dist/{google-interactions-B7mZhG4e.mjs → google-interactions-BYRQ49MR.mjs} +8 -8
- package/dist/{google-messages-B-svbJuN.mjs → google-messages-DQMgG5yG.mjs} +9 -3
- package/dist/{google-provider-stream-C43bhKMi.mjs → google-provider-stream-BHd0cST9.mjs} +6 -6
- package/dist/{google-shared-B-jv5dQ9.mjs → google-shared-vtag8bj5.mjs} +5 -5
- package/dist/{google-vertex-sjKMbIUP.mjs → google-vertex-eKoUnW7N.mjs} +2 -2
- package/dist/{host-rCxf5Tjd.mjs → host-CWt55nnF.mjs} +12 -8
- package/dist/{host-policy-Ci1cKluf.mjs → host-policy-Dm7PM6AD.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-completions-compat.d.mts +4 -0
- package/dist/internal/openai-completions-compat.mjs +3 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.mjs +2 -2
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{mistral-CXSRuQbO.mjs → mistral-CQ7aoWg2.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-C97WXCjm.mjs → openai-chatgpt-responses-DgDVhpUI.mjs} +12 -12
- package/dist/{openai-completions-BXUVMZXy.mjs → openai-completions-BdfBhFjx.mjs} +3 -3
- package/dist/{openai-completions-compat-CJ0OXZgi.mjs → openai-completions-compat-bNQXF1y9.mjs} +2 -2
- package/dist/openai-completions-reasoning-replay-BwT1xwRI.mjs +45 -0
- package/dist/{openai-completions-transport-BVV8L-MO.mjs → openai-completions-transport-CnFaKYO-.mjs} +21 -64
- package/dist/{openai-prompt-cache-h8vXRiaH.mjs → openai-prompt-cache-B9AvdoEo.mjs} +1 -1
- package/dist/{openai-responses-ytmKcG9V.mjs → openai-responses-5KI4v8DN.mjs} +6 -6
- package/dist/{openai-responses-contracts-DCG51Us0.mjs → openai-responses-contracts-B5mGAbR6.mjs} +1 -1
- package/dist/{openai-responses-endpoint-JbBT8IDv.mjs → openai-responses-endpoint-CfKR6N5f.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-CsBFQkiW.mjs → openai-responses-request-lifecycle-WKXjj_th.mjs} +7 -7
- package/dist/{openai-responses-shared-CD3Sd1NC.mjs → openai-responses-shared-iWBHb0Sq.mjs} +48 -17
- package/dist/{openai-tool-schema-CGhEl7ao.mjs → openai-tool-schema-BTEU2xmN.mjs} +2 -2
- package/dist/{provider-replay-context-BC23HyZo.mjs → provider-replay-context-4vxI7p4V.mjs} +1 -1
- package/dist/{provider-transport-turn-state-Dm6Qh366.mjs → provider-transport-turn-state-BbaD56A1.mjs} +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-BdJJbzZk.mjs → simple-options-xJkqrG_E.mjs} +3 -3
- package/dist/{stream-DQqGjhbq.mjs → stream-C4YDqhFj.mjs} +1 -1
- package/dist/{tool-schema-json-projection-Cvq69Ajp.mjs → tool-schema-json-projection-B1sTYwfH.mjs} +1 -1
- package/dist/{transport-stream-shared-DdnJGEj0.mjs → transport-stream-shared-lhgkTOz3.mjs} +2 -2
- package/dist/{transport-utils-CcCAuFVS.mjs → transport-utils-DwOpuTjL.mjs} +2 -2
- package/dist/transports.mjs +14 -14
- package/package.json +1 -1
package/dist/{openai-completions-transport-BVV8L-MO.mjs → openai-completions-transport-CnFaKYO-.mjs}
RENAMED
|
@@ -5,37 +5,38 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
5
5
|
import { i as asOptionalRecord, o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
6
6
|
import { c as readNonEmptyStringPreservingWhitespace, t as hasNonEmptyString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
7
7
|
import { n as asNonNegativeFiniteNumber, r as asPositiveFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
|
|
8
|
-
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
9
|
-
import {
|
|
8
|
+
import { N as isImageWithMediaPayload, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
9
|
+
import { L as resolveOpenAIThinkingApi, _ as responsesServiceTierObserver, b as applyOpenAICompletionsToolReasoning, d as OpenAIResponsesWebSocketSafeRetryError, h as parseOpenAIResponsesWebSocketServerError, j as supportsOpenAITemperature, l as OpenAIResponsesWebSocketPostDispatchError, r as OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS, t as AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS, u as OpenAIResponsesWebSocketPreDispatchError, v as isResponsesServiceTierRejection, w as isOpenAIGpt6Model, y as nextResponsesServiceTier } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
12
|
-
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
13
|
-
import {
|
|
14
|
-
import { c as supportsModelTools, n as estimateStringChars } from "./transport-utils-
|
|
15
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
16
|
-
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-
|
|
12
|
+
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
13
|
+
import { i as emitModelTransportError, p as hasOnlyResponsesFunctionTools, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, u as DegenerateToolCallArgumentsError } from "./diagnostics-v7oVEW59.mjs";
|
|
14
|
+
import { c as supportsModelTools, n as estimateStringChars } from "./transport-utils-DwOpuTjL.mjs";
|
|
15
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, l as shouldOmitOllamaCompatResponseFormat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, s as resolveOpenAICompletionsResponseFormat, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
16
|
+
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
17
17
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
18
18
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
19
19
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
20
|
-
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, f as extractToolResultText, g as reasoningTagTextPolicy, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, m as codeModeToolSurfaceObserver, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
21
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, h as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, v as sanitizeTransportPayloadText, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
22
|
-
import { C as redactIdentifier, w as sha256Hex } from "./tool-schema-json-projection-
|
|
20
|
+
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, f as extractToolResultText, g as reasoningTagTextPolicy, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, m as codeModeToolSurfaceObserver, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
21
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, h as notifyProviderStreamOpened, l as finalizeTerminalToolCallArguments, s as createWritableTransportEventStream, u as finalizeTransportStream, v as sanitizeTransportPayloadText, y as throwIfModelStreamAborted } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
22
|
+
import { C as redactIdentifier, w as sha256Hex } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
23
23
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
24
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
25
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
24
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-4vxI7p4V.mjs";
|
|
25
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
26
26
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
27
27
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
28
28
|
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
29
29
|
import "./types.mjs";
|
|
30
|
-
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as isOpenAICompletionsThinkingEnabled, B as recordResponsesInputReplay, C as readResponsesRecoveryEvent, Ct as reconcileOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolveOpenAIClientBaseUrl, K as responsesContinuationRequestFingerprint, Lt as resolvePromptCacheKey, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, O as safeDebugValue, Ot as createResponseModelTracker, P as buildResponsesInputMessage, Pt as readOpenAICompletionsContentDeltas, Rt as withOpenAIErrorResponseHook, S as isInvalidEncryptedContentError, St as reconcileOpenAICompletionsToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as prepareOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as log, k as summarizeOpenAITransportError, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as resolveAzureOpenAIApiVersion, wt as toOpenAIResponsesToolChoice, x as createResponsesStreamWithRecovery, xt as projectOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-
|
|
31
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
30
|
+
import { $ as isConfigurationUpdate, A as summarizeResponsesPayload, At as isOpenAICompletionsThinkingEnabled, B as recordResponsesInputReplay, C as readResponsesRecoveryEvent, Ct as reconcileOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, G as responsesContinuationPrefixFingerprint, H as claimOpenAIResponsesHttpContinuation, I as convertResponsesMessages, It as resolveOpenAIClientBaseUrl, K as responsesContinuationRequestFingerprint, Lt as resolvePromptCacheKey, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, O as safeDebugValue, Ot as createResponseModelTracker, P as buildResponsesInputMessage, Pt as readOpenAICompletionsContentDeltas, Rt as withOpenAIErrorResponseHook, S as isInvalidEncryptedContentError, St as reconcileOpenAICompletionsToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, U as recordResponsesContinuationState, V as responsesInputFingerprint, W as resolveResponsesContinuationRequest, _t as resolveOpenAIRequestReasoning, a as prepareResponsesTools, bt as prepareOpenAITools, c as observeResponsesStream, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, et as replayResponsesReasoningUpdates, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, j as recordResponsesContextUsage, jt as log, k as summarizeOpenAITransportError, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, n as applyResponsesServiceTierPricing, ot as suppressOpenAIResponsesCompaction, pt as getCompat, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, st as assertCodeModeResponsesToolSurface, tt as supportsResponsesReasoningUpdate, ut as buildOpenAISdkRequestOptions, vt as resolveOpenAISimpleReasoningEffort, w as resolveAzureOpenAIApiVersion, wt as toOpenAIResponsesToolChoice, x as createResponsesStreamWithRecovery, xt as projectOpenAITools, z as readResponsesInputReplayState } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
31
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-BbaD56A1.mjs";
|
|
32
32
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
33
33
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
34
|
-
import { b as prepareOpenAIFunctionTool, f as normalizeToolSchema, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-
|
|
34
|
+
import { b as prepareOpenAIFunctionTool, f as normalizeToolSchema, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-BTEU2xmN.mjs";
|
|
35
|
+
import { t as requiresReasoningContentReplay } from "./openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
35
36
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
36
37
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
37
|
-
import { a as isOpenAIResponsesCompactionOutput, c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, i as getOpenAIResponsesCompactionOutputError, n as supportsNativeOpenAIResponsesEndpoint, r as createBoundedOpenAIResponsesCompactionFetch, s as sanitizeResponsesImagePayload, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-
|
|
38
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
38
|
+
import { a as isOpenAIResponsesCompactionOutput, c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, i as getOpenAIResponsesCompactionOutputError, n as supportsNativeOpenAIResponsesEndpoint, r as createBoundedOpenAIResponsesCompactionFetch, s as sanitizeResponsesImagePayload, t as isOfficialOpenAIResponsesBaseUrl } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
39
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-WKXjj_th.mjs";
|
|
39
40
|
import { randomUUID } from "node:crypto";
|
|
40
41
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
41
42
|
import { ResponsesWS } from "openai/resources/responses/ws.js";
|
|
@@ -882,54 +883,9 @@ function sanitizeOpenRouterReasoningReplayFields(record) {
|
|
|
882
883
|
if (typeof reasoningText === "string" && reasoningText.length > 0 && typeof record.reasoning !== "string" && typeof record.reasoning_content !== "string") record.reasoning = reasoningText;
|
|
883
884
|
delete record.reasoning_text;
|
|
884
885
|
}
|
|
885
|
-
const REASONING_CONTENT_REPLAY_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
886
|
-
"deepseek-v4-flash",
|
|
887
|
-
"deepseek-v4-pro",
|
|
888
|
-
"kimi-for-coding",
|
|
889
|
-
"kimi-k2.5",
|
|
890
|
-
"kimi-k2.6",
|
|
891
|
-
"kimi-k2.7-code",
|
|
892
|
-
"kimi-k2.7-code-highspeed",
|
|
893
|
-
"kimi-k3",
|
|
894
|
-
"kimi-k3.1-pro",
|
|
895
|
-
"kimi-k3.1-pro-highspeed",
|
|
896
|
-
"kimi-k2-thinking",
|
|
897
|
-
"kimi-k2-thinking-turbo",
|
|
898
|
-
"mimo-v2-pro",
|
|
899
|
-
"mimo-v2-omni",
|
|
900
|
-
"mimo-v2.5",
|
|
901
|
-
"mimo-v2.5-pro",
|
|
902
|
-
"mimo-v2.6-flash",
|
|
903
|
-
"mimo-v2.6-pro",
|
|
904
|
-
"mimo-v2.6-pro-ultraspeed"
|
|
905
|
-
]);
|
|
906
|
-
const REASONING_CONTENT_REPLAY_TIER_SUFFIXES = [
|
|
907
|
-
"-free",
|
|
908
|
-
"-paid",
|
|
909
|
-
"-trial"
|
|
910
|
-
];
|
|
911
|
-
function stripReasoningContentReplayTierSuffix(modelId) {
|
|
912
|
-
for (const suffix of REASONING_CONTENT_REPLAY_TIER_SUFFIXES) if (modelId.length > suffix.length && modelId.endsWith(suffix)) return modelId.slice(0, -suffix.length);
|
|
913
|
-
return modelId;
|
|
914
|
-
}
|
|
915
|
-
function getReasoningContentReplayModelIdCandidates(modelId) {
|
|
916
|
-
if (typeof modelId !== "string") return [];
|
|
917
|
-
const normalized = modelId.trim().toLowerCase();
|
|
918
|
-
if (!normalized) return [];
|
|
919
|
-
const parts = normalized.split("/").filter(Boolean);
|
|
920
|
-
const finalPart = parts[parts.length - 1] ?? normalized;
|
|
921
|
-
const candidates = [finalPart];
|
|
922
|
-
const colonParts = finalPart.split(":").filter(Boolean);
|
|
923
|
-
if (colonParts.length > 1) candidates.push(colonParts[0] ?? "", colonParts[colonParts.length - 1] ?? "");
|
|
924
|
-
for (const candidate of candidates.slice()) {
|
|
925
|
-
const stripped = stripReasoningContentReplayTierSuffix(candidate);
|
|
926
|
-
if (stripped !== candidate) candidates.push(stripped);
|
|
927
|
-
}
|
|
928
|
-
return uniqueStrings(candidates.filter(Boolean));
|
|
929
|
-
}
|
|
930
886
|
function shouldPreserveReasoningContentReplay(model, compat) {
|
|
931
887
|
if (compat.requiresReasoningContentOnAssistantMessages || compat.thinkingFormat === "deepseek" || compat.thinkingFormat === "zai" || shouldTrustReasoningContentReplayMetadata(model)) return true;
|
|
932
|
-
return
|
|
888
|
+
return requiresReasoningContentReplay(model.id);
|
|
933
889
|
}
|
|
934
890
|
function shouldPreserveOpenRouterReasoningReplay(model) {
|
|
935
891
|
if (model.provider !== "openrouter") return true;
|
|
@@ -3060,6 +3016,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
3060
3016
|
signal: options?.signal
|
|
3061
3017
|
});
|
|
3062
3018
|
} catch (error) {
|
|
3019
|
+
if (error instanceof DegenerateToolCallArgumentsError) firstEventAbort?.abort(error);
|
|
3063
3020
|
if (requestLifecycle) await requestLifecycle.settle().catch(() => void 0);
|
|
3064
3021
|
if (compactRequest) {
|
|
3065
3022
|
compactRequest.reject(error);
|
|
@@ -3073,7 +3030,7 @@ function createResponsesTransportExecutor(config) {
|
|
|
3073
3030
|
}
|
|
3074
3031
|
if (error instanceof ResponsesStreamFailure && error.observation) logResponsesFailedNoDetails(error.observation);
|
|
3075
3032
|
const incompleteReason = output.diagnostics?.find(({ type }) => type === "openai_responses_terminal")?.details?.incompleteReason;
|
|
3076
|
-
emitModelTransportError(log, "responses", `provider=${model.provider} api=${model.api} model=${model.id} ` + summarizeOpenAITransportError(error) + (typeof incompleteReason === "string" ? ` incompleteReason=${incompleteReason}` : ""), options?.signal);
|
|
3033
|
+
emitModelTransportError(log, "responses", `provider=${model.provider} api=${model.api} model=${model.id} ` + summarizeOpenAITransportError(error, firstEventAbort?.signal ?? options?.signal) + (typeof incompleteReason === "string" ? ` incompleteReason=${incompleteReason}` : ""), options?.signal);
|
|
3077
3034
|
failTransportStream({
|
|
3078
3035
|
stream,
|
|
3079
3036
|
output,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-
|
|
1
|
+
import { n as isNativeOpenAIEndpoint } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
2
2
|
//#region packages/normalization-core/src/code-points.ts
|
|
3
3
|
/** Truncates to a nonnegative code-point budget; grapheme clusters may be split. */
|
|
4
4
|
function truncateCodePoints(text, maxCodePoints) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-
|
|
4
|
-
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
4
|
+
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
6
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
+
import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
|
|
7
7
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
8
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
9
|
-
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
8
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
9
|
+
import { F as convertProviderResponsesMessages, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-BbaD56A1.mjs";
|
|
11
11
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
|
12
12
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
13
13
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-responses-contracts-DCG51Us0.mjs → openai-responses-contracts-B5mGAbR6.mjs}
RENAMED
|
@@ -405,4 +405,4 @@ const responsesServiceTierObserver = {
|
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
407
|
//#endregion
|
|
408
|
-
export { supportsOpenAIReasoningEffort as A, isOpenAIGpt56Model as C, resolveOpenAIReasoningEffortForModel as D, resolveOpenAIModelReasoningEfforts as E,
|
|
408
|
+
export { supportsOpenAIReasoningEffort as A, isOpenAIGpt56Model as C, resolveOpenAIReasoningEffortForModel as D, resolveOpenAIModelReasoningEfforts as E, listMappedModelThinkingLevels as F, resolveModelServiceTierContextTokens as I, resolveOpenAIThinkingApi as L, normalizeStringEntries as M, uniqueValues as N, resolveOpenAIReasoningEffortMapping as O, MODEL_CATALOG_THINKING_LEVELS as P, isOpenAIGpt55Model as S, normalizeOpenAIReasoningEffort as T, responsesServiceTierObserver as _, OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE as a, applyOpenAICompletionsToolReasoning as b, OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE as c, OpenAIResponsesWebSocketSafeRetryError as d, RESPONSES_RETAINED_USER as f, responsesPromptObserver as g, parseOpenAIResponsesWebSocketServerError as h, OPENAI_RESPONSES_APIS as i, supportsOpenAITemperature as j, resolveOpenAISupportedReasoningEfforts as k, OpenAIResponsesWebSocketPostDispatchError as l, isPreviousResponseRejection as m, DEFAULT_AZURE_OPENAI_API_VERSION as n, OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY as o, RESPONSE_FAILED_NO_DETAILS_MESSAGE as p, OPENAI_CODEX_RESPONSES_DEFAULT_INSTRUCTIONS as r, OPENAI_RESPONSES_REASONING_REPLAY_META_KEY as s, AZURE_RESPONSES_FIRST_EVENT_TIMEOUT_MS as t, OpenAIResponsesWebSocketPreDispatchError as u, isResponsesServiceTierRejection as v, isOpenAIGpt6Model as w, isOpenAIGpt54MiniModel as x, nextResponsesServiceTier as y };
|
package/dist/{openai-responses-endpoint-JbBT8IDv.mjs → openai-responses-endpoint-CfKR6N5f.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { a as normalizeOptionalLowercaseString, l as readStringValue, n as normalizeFastMode, r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
3
|
-
import { A as supportsOpenAIReasoningEffort,
|
|
3
|
+
import { A as supportsOpenAIReasoningEffort, I as resolveModelServiceTierContextTokens, i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
4
4
|
import { t as canonicalizeBase64 } from "./base64-C8CdcsjU.mjs";
|
|
5
5
|
import { t as parsePositiveInteger } from "./positive-integer-Bb4Evc7L.mjs";
|
|
6
6
|
import { n as createSseByteGuard } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { f as RESPONSES_RETAINED_USER, g as responsesPromptObserver } from "./openai-responses-contracts-
|
|
2
|
+
import { f as RESPONSES_RETAINED_USER, g as responsesPromptObserver } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
3
3
|
import { c as stableStringify, d as estimateTokensFromChars, u as estimateStringChars } from "./provider-error-qtZD2inE.mjs";
|
|
4
|
-
import "./transport-utils-
|
|
5
|
-
import { w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
6
|
-
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
7
|
-
import { w as sha256Hex } from "./tool-schema-json-projection-
|
|
8
|
-
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-
|
|
9
|
-
import { a as isOpenAIResponsesCompactionOutput, s as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-
|
|
4
|
+
import "./transport-utils-DwOpuTjL.mjs";
|
|
5
|
+
import { w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
6
|
+
import { v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
7
|
+
import { w as sha256Hex } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
8
|
+
import { rt as buildOpenAIResponsesReasoningReplayMetadata } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
9
|
+
import { a as isOpenAIResponsesCompactionOutput, s as sanitizeResponsesImagePayload } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
10
10
|
//#region packages/ai/src/transports/openai-responses-compact-request.ts
|
|
11
11
|
const COMPACT_REQUEST = Symbol("openaiResponsesCompactRequest");
|
|
12
12
|
function claimResponsesCompactRequest(options) {
|
|
@@ -5,26 +5,26 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
5
5
|
import { o as isRecord, r as asOptionalObjectRecord } from "./record-coerce-CNDovvft.mjs";
|
|
6
6
|
import { l as readStringValue, o as normalizeOptionalString, r as normalizeLowercaseStringOrEmpty, s as normalizeStringifiedOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
7
7
|
import { t as asFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
|
|
8
|
-
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
9
|
-
import { A as supportsOpenAIReasoningEffort, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts,
|
|
8
|
+
import { D as applyProviderReportedUsageCost, E as headersToRecord, N as isImageWithMediaPayload, O as calculateCost, a as resolveAiTransportHeaderSentinels, k as clampThinkingLevel, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
9
|
+
import { A as supportsOpenAIReasoningEffort, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, L as resolveOpenAIThinkingApi, O as resolveOpenAIReasoningEffortMapping, P as MODEL_CATALOG_THINKING_LEVELS, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, a as OPENAI_RESPONSES_COMPACTION_REPLAY_TYPE, c as OPENAI_RESPONSES_RETAINED_COMPACTION_REPLAY_TYPE, f as RESPONSES_RETAINED_USER, i as OPENAI_RESPONSES_APIS, j as supportsOpenAITemperature, m as isPreviousResponseRejection, o as OPENAI_RESPONSES_REASONING_REPLAY_BLOCK_META_KEY, p as RESPONSE_FAILED_NO_DETAILS_MESSAGE, s as OPENAI_RESPONSES_REASONING_REPLAY_META_KEY, v as isResponsesServiceTierRejection, y as nextResponsesServiceTier } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
10
10
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
12
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
13
|
-
import { _ as
|
|
14
|
-
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-
|
|
15
|
-
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-
|
|
16
|
-
import { r as resolveModelRequestTimeoutMs } from "./host-policy-
|
|
12
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
13
|
+
import { _ as mapResponsesTerminalUsage, a as resolveModelPayloadDebugMode, d as ResponsesOutputIdentityError, f as countToolCallTrailingWhitespace, m as isResponsesProviderTool, p as hasOnlyResponsesFunctionTools, r as emitModelTransportDebug, v as readResponsesReasoningTokens, y as resolveResponsesTerminalStopReason } from "./diagnostics-v7oVEW59.mjs";
|
|
14
|
+
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-DwOpuTjL.mjs";
|
|
15
|
+
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
16
|
+
import { r as resolveModelRequestTimeoutMs } from "./host-policy-Dm7PM6AD.mjs";
|
|
17
17
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
18
|
-
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
19
|
-
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
20
|
-
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-
|
|
21
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
22
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
18
|
+
import { d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, r as clampMaxTokensToModel, s as prepareModelRequestBody, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
19
|
+
import { A as shortHash, C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, S as withProviderResponseHook, b as transportAbortError, c as failTransportStream, d as iterateModelStream, g as parseTerminalToolCallArguments, m as notifyProviderHttpResponse, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
20
|
+
import { C as redactIdentifier, n as prepareRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, w as sha256Hex } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
21
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-4vxI7p4V.mjs";
|
|
22
|
+
import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
|
|
23
23
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
24
24
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
25
25
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
26
|
-
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-
|
|
27
|
-
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-
|
|
26
|
+
import { a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, p as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters, t as findOpenAIStrictToolProjectionDiagnostics } from "./openai-tool-schema-BTEU2xmN.mjs";
|
|
27
|
+
import { a as isOpenAIResponsesCompactionOutput, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
29
29
|
import { Stream } from "openai/core/streaming";
|
|
30
30
|
//#region packages/ai/src/transports/openai-transport-shared.ts
|
|
@@ -2085,11 +2085,11 @@ function summarizeResponsesPayload(params) {
|
|
|
2085
2085
|
if (resolveModelPayloadDebugMode() === "full-redacted") parts.push(`payload=${stringifyRedactedPayload(record)}`);
|
|
2086
2086
|
return parts.join(" ");
|
|
2087
2087
|
}
|
|
2088
|
-
function summarizeOpenAITransportError(error) {
|
|
2088
|
+
function summarizeOpenAITransportError(error, signal) {
|
|
2089
2089
|
if (!error || typeof error !== "object") return `type=${typeof error} message=${safeDebugValue(error)}`;
|
|
2090
2090
|
const record = error;
|
|
2091
2091
|
const cause = record.cause && typeof record.cause === "object" ? record.cause : void 0;
|
|
2092
|
-
|
|
2092
|
+
const parts = [
|
|
2093
2093
|
`name=${safeDebugValue(record.name)}`,
|
|
2094
2094
|
`status=${safeDebugValue(record.status)}`,
|
|
2095
2095
|
`code=${safeDebugValue(record.code)}`,
|
|
@@ -2097,7 +2097,35 @@ function summarizeOpenAITransportError(error) {
|
|
|
2097
2097
|
`causeName=${safeDebugValue(cause?.name)}`,
|
|
2098
2098
|
`causeCode=${safeDebugValue(cause?.code)}`,
|
|
2099
2099
|
`message=${error instanceof Error ? error.message : safeDebugValue(error)}`
|
|
2100
|
-
]
|
|
2100
|
+
];
|
|
2101
|
+
if (signal?.aborted) {
|
|
2102
|
+
const reason = isRecord(signal.reason) ? signal.reason : void 0;
|
|
2103
|
+
let abortReason = reason?.name === "TimeoutError" ? "request_deadline" : "caller_abort";
|
|
2104
|
+
switch (reason?.code ?? reason?.name) {
|
|
2105
|
+
case "LlmIdleTimeoutError":
|
|
2106
|
+
abortReason = "idle_timeout";
|
|
2107
|
+
break;
|
|
2108
|
+
case "LlmNoProgressError":
|
|
2109
|
+
abortReason = "no_progress";
|
|
2110
|
+
break;
|
|
2111
|
+
case "FirstStreamEventTimeoutError":
|
|
2112
|
+
abortReason = "first_event_timeout";
|
|
2113
|
+
break;
|
|
2114
|
+
case "OPENCLAW_SESSION_WATCHDOG":
|
|
2115
|
+
abortReason = "session_watchdog";
|
|
2116
|
+
break;
|
|
2117
|
+
case "degenerate_output":
|
|
2118
|
+
abortReason = "degenerate_output";
|
|
2119
|
+
break;
|
|
2120
|
+
case "OPENCLAW_RESTART_ABORT":
|
|
2121
|
+
case "ERR_STALE_GATEWAY_LIFECYCLE":
|
|
2122
|
+
abortReason = "restart";
|
|
2123
|
+
break;
|
|
2124
|
+
case "AGENT_RUN_SUPERSEDED_ABORT": abortReason = "superseded";
|
|
2125
|
+
}
|
|
2126
|
+
parts.push(`abortReason=${abortReason}`);
|
|
2127
|
+
}
|
|
2128
|
+
return parts.join(" ");
|
|
2101
2129
|
}
|
|
2102
2130
|
//#endregion
|
|
2103
2131
|
//#region packages/ai/src/transports/openai-responses-replay-internal.ts
|
|
@@ -3104,6 +3132,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3104
3132
|
argumentStreamReliable: true,
|
|
3105
3133
|
argumentsStreamed: false,
|
|
3106
3134
|
previewSchedule: createToolArgumentPreviewSchedule(),
|
|
3135
|
+
trailingWhitespaceChars: countToolCallTrailingWhitespace(toolCallBlock.partialJson),
|
|
3107
3136
|
...readResponsesToolCallItemIdentity(item)
|
|
3108
3137
|
};
|
|
3109
3138
|
streamingToolCalls.register(event, toolCallState);
|
|
@@ -3178,6 +3207,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3178
3207
|
}
|
|
3179
3208
|
let delta;
|
|
3180
3209
|
if (event.type === "response.function_call_arguments.delta") {
|
|
3210
|
+
toolCall.trailingWhitespaceChars = countToolCallTrailingWhitespace(event.delta, toolCall.trailingWhitespaceChars);
|
|
3181
3211
|
toolCall.block.partialJson += event.delta;
|
|
3182
3212
|
toolCall.argumentsStreamed = true;
|
|
3183
3213
|
if (toolCall.previewSchedule(toolCall.block.partialJson.length)) toolCall.block.arguments = parseStreamingJson(toolCall.block.partialJson);
|
|
@@ -3186,6 +3216,7 @@ async function processResponsesStream(openaiStream, output, sink, model, options
|
|
|
3186
3216
|
const previousPartialJson = toolCall.block.partialJson;
|
|
3187
3217
|
const doneArguments = typeof event.arguments === "string" ? event.arguments : void 0;
|
|
3188
3218
|
if (doneArguments !== void 0 && (doneArguments.length > 0 || previousPartialJson === "")) {
|
|
3219
|
+
toolCall.trailingWhitespaceChars = countToolCallTrailingWhitespace(doneArguments);
|
|
3189
3220
|
toolCall.block.partialJson = doneArguments;
|
|
3190
3221
|
toolCall.block.arguments = parseStreamingJson(toolCall.block.partialJson);
|
|
3191
3222
|
toolCall.argumentStreamReliable = true;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { M as normalizeStringEntries,
|
|
5
|
-
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-
|
|
4
|
+
import { M as normalizeStringEntries, N as uniqueValues } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
5
|
+
import { S as walkSchemaValue, _ as SCHEMA_MAP_KEYS, a as SCHEMA_LITERAL_KEYS, b as evaluateSchemaWalk, c as inlineLocalToolSchemaRefs, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, l as setOwnSchemaProperty, m as truncateToolSchemaDepth, o as canPreserveRootSchemaRefs, s as copySchemaMeta$1, t as getPublishedRuntimeToolInputSchema, v as SCHEMA_NESTED_KEYS, x as walkSchemaArray, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-function-tool.ts
|
|
7
7
|
const preparedTools = /* @__PURE__ */ new WeakMap();
|
|
8
8
|
const MAX_DESCRIPTOR_VARIANTS = 8;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { A as shortHash } from "./transport-stream-shared-
|
|
2
|
+
import { A as shortHash } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
3
3
|
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
4
4
|
function isProviderReplayContext(value) {
|
|
5
5
|
return isRecord(value) && typeof value.provider === "string" && typeof value.api === "string" && typeof value.model === "string" && (value.baseUrlHash === void 0 || typeof value.baseUrlHash === "string") && (value.sessionHash === void 0 || typeof value.sessionHash === "string") && (value.authProfileHash === void 0 || typeof value.authProfileHash === "string");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-Dttf8jKq.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
|
-
import { It as resolveOpenAIClientBaseUrl, Rt as withOpenAIErrorResponseHook } from "./openai-responses-shared-
|
|
4
|
+
import { It as resolveOpenAIClientBaseUrl, Rt as withOpenAIErrorResponseHook } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
|
7
7
|
//#region packages/ai/src/providers/openai-provider-client.ts
|
package/dist/providers.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { n as projectProviderError } from "./provider-error-qtZD2inE.mjs";
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
4
4
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/register-builtins.ts
|
|
6
6
|
/** Source id used for built-in API provider registrations. */
|
|
@@ -50,39 +50,39 @@ function createLazyRegistration(api, importModule, select) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const registerBuiltIns = [
|
|
53
|
-
createLazyRegistration("anthropic-messages", () => import("./anthropic-
|
|
53
|
+
createLazyRegistration("anthropic-messages", () => import("./anthropic-CUVqVXTe.mjs").then((n) => n.t), (module) => ({
|
|
54
54
|
stream: module.streamAnthropic,
|
|
55
55
|
streamSimple: module.streamSimpleAnthropic
|
|
56
56
|
})),
|
|
57
|
-
createLazyRegistration("openai-completions", () => import("./openai-completions-
|
|
57
|
+
createLazyRegistration("openai-completions", () => import("./openai-completions-BdfBhFjx.mjs").then((n) => n.t), (module) => ({
|
|
58
58
|
stream: module.streamOpenAICompletions,
|
|
59
59
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
60
60
|
})),
|
|
61
|
-
createLazyRegistration("mistral-conversations", () => import("./mistral-
|
|
61
|
+
createLazyRegistration("mistral-conversations", () => import("./mistral-CQ7aoWg2.mjs"), (module) => ({
|
|
62
62
|
stream: module.streamMistral,
|
|
63
63
|
streamSimple: module.streamSimpleMistral
|
|
64
64
|
})),
|
|
65
|
-
createLazyRegistration("openai-responses", () => import("./openai-responses-
|
|
65
|
+
createLazyRegistration("openai-responses", () => import("./openai-responses-5KI4v8DN.mjs").then((n) => n.t), (module) => ({
|
|
66
66
|
stream: module.streamOpenAIResponses,
|
|
67
67
|
streamSimple: module.streamSimpleOpenAIResponses
|
|
68
68
|
})),
|
|
69
|
-
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-
|
|
69
|
+
createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-I97-HnAv.mjs"), (module) => ({
|
|
70
70
|
stream: module.streamAzureOpenAIResponses,
|
|
71
71
|
streamSimple: module.streamSimpleAzureOpenAIResponses
|
|
72
72
|
})),
|
|
73
|
-
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-
|
|
73
|
+
createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-DgDVhpUI.mjs"), (module) => ({
|
|
74
74
|
stream: module.streamOpenAICodexResponses,
|
|
75
75
|
streamSimple: module.streamSimpleOpenAICodexResponses
|
|
76
76
|
})),
|
|
77
|
-
createLazyRegistration("google-generative-ai", () => import("./google-
|
|
77
|
+
createLazyRegistration("google-generative-ai", () => import("./google-Cpi_cLKZ.mjs"), (module) => ({
|
|
78
78
|
stream: module.streamGoogle,
|
|
79
79
|
streamSimple: module.streamSimpleGoogle
|
|
80
80
|
})),
|
|
81
|
-
createLazyRegistration("google-interactions", () => import("./google-interactions-
|
|
81
|
+
createLazyRegistration("google-interactions", () => import("./google-interactions-BYRQ49MR.mjs"), (module) => ({
|
|
82
82
|
stream: module.streamGoogleInteractions,
|
|
83
83
|
streamSimple: module.streamSimpleGoogleInteractions
|
|
84
84
|
})),
|
|
85
|
-
createLazyRegistration("google-vertex", () => import("./google-vertex-
|
|
85
|
+
createLazyRegistration("google-vertex", () => import("./google-vertex-eKoUnW7N.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { M as hasMediaPayload } from "./host-
|
|
3
|
-
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-
|
|
2
|
+
import { M as hasMediaPayload } from "./host-CWt55nnF.mjs";
|
|
3
|
+
import { _ as responsesServiceTierObserver } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
4
4
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
6
6
|
import { n as normalizeStructuredPromptSection } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
7
|
-
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-
|
|
7
|
+
import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
8
8
|
//#region packages/ai/src/utils/system-prompt-cache-boundary.ts
|
|
9
9
|
const SYSTEM_PROMPT_CACHE_BOUNDARY = "\n<!-- OPENCLAW_CACHE_BOUNDARY -->\n";
|
|
10
10
|
/** Producer-delimited Runtime facts; instructions must remain outside this region. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as bindAssistantMessageEventStream, o as getEventStreamCompletion } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-
|
|
2
|
+
import { i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, s as supportsScopedAiTransportHosts } from "./host-CWt55nnF.mjs";
|
|
3
3
|
import { t as cleanupSessionResources } from "./session-resources-vKvGIE3J.mjs";
|
|
4
4
|
//#region packages/ai/src/api-registry.ts
|
|
5
5
|
function wrapStream(api, stream) {
|
package/dist/{tool-schema-json-projection-Cvq69Ajp.mjs → tool-schema-json-projection-B1sTYwfH.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as asRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as parseLocalSchemaRefPointer } from "./validation-9FSkE8T-.mjs";
|
|
3
3
|
import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { r as getAiTransportHost } from "./host-
|
|
4
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
5
|
import { hash } from "node:crypto";
|
|
6
6
|
import { types } from "node:util";
|
|
7
7
|
//#region packages/normalization-core/src/node-crypto.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as createAssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
3
|
import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
|
-
import { E as headersToRecord, r as getAiTransportHost } from "./host-
|
|
4
|
+
import { E as headersToRecord, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
5
|
import { a as projectDiagnosticValue, n as projectProviderError } from "./provider-error-qtZD2inE.mjs";
|
|
6
|
-
import { l as isTransientNetworkError } from "./diagnostics-
|
|
6
|
+
import { l as isTransientNetworkError } from "./diagnostics-v7oVEW59.mjs";
|
|
7
7
|
import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
|
|
8
8
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
9
9
|
import { parse } from "partial-json";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
3
3
|
import "./internal/retry-after.mjs";
|
|
4
|
-
import { N as raceWithTimeout } from "./transport-stream-shared-
|
|
4
|
+
import { N as raceWithTimeout } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
5
5
|
import "./positive-integer-Bb4Evc7L.mjs";
|
|
6
6
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
7
7
|
async function consumeResponseBytes(options) {
|
package/dist/transports.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.mjs";
|
|
2
2
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
4
|
-
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-
|
|
5
|
-
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
|
+
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
6
6
|
import { o as redactDiagnosticText, s as truncateUtf16Safe } from "./provider-error-qtZD2inE.mjs";
|
|
7
|
-
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl,
|
|
8
|
-
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
-
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-
|
|
10
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
11
|
-
import { A as resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-
|
|
7
|
+
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, x as toErrorObject } from "./diagnostics-v7oVEW59.mjs";
|
|
8
|
+
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DwOpuTjL.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-bNQXF1y9.mjs";
|
|
10
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
11
|
+
import { A as resolveAnthropicCacheOptions, C as applyAnthropicEphemeralCacheControlMarkers, D as isAnthropicServerToolClearingEnabled, E as buildAnthropicSystemBlocks, F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, M as resolveAnthropicPayloadPolicy, N as resolveAnthropicRequestBetaHeader, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, S as applyAnthropicContextManagementToRequest, T as applyAnthropicRequestCacheControl, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, b as resolveNewestAnthropicCompaction, f as resolveAnthropicTransportOptions, j as resolveAnthropicEphemeralCacheControl, k as logAnthropicContextEdits, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, w as applyAnthropicPayloadPolicyToParams, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-yWDb5Cct.mjs";
|
|
12
12
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
13
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-
|
|
13
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, j as createAbortError$1, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, o as createModelStreamCooperativeScheduler, p as notifyProviderHttpMetadata, r as coerceTransportToolCallArguments, s as createWritableTransportEventStream, t as IncompleteToolCallError, u as finalizeTransportStream, v as sanitizeTransportPayloadText, w as parseJsonPreservingUnsafeIntegers, x as withProviderAcceptanceObserver, y as throwIfModelStreamAborted } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
14
14
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
15
15
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
16
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
16
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
17
17
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
18
|
-
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-
|
|
19
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
20
|
-
import { At as isOpenAICompletionsThinkingEnabled, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, It as resolveOpenAIClientBaseUrl, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as resolvePromptCacheKey, M as resolveResponsesContextUsageBoundary, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, Ot as createResponseModelTracker, Pt as readOpenAICompletionsContentDeltas, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Rt as withOpenAIErrorResponseHook, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as log, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-
|
|
21
|
-
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-
|
|
22
|
-
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-
|
|
18
|
+
import { c as flattenCompletionMessagesToStringContent, d as hasOpenAICompatibleConversationTurn, f as canonicalizeMaxTokensParam, i as createOpenAIResponsesTransportStreamFn, l as stripCompletionMessagesToRoleContent, m as createDeepSeekTextFilter, o as buildOpenAICompletionsParams, p as resolveMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, t as createOpenAICompletionsTransportStreamFn, u as applyCompletionsAnthropicCacheControl } from "./openai-completions-transport-CnFaKYO-.mjs";
|
|
19
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-DQMgG5yG.mjs";
|
|
20
|
+
import { At as isOpenAICompletionsThinkingEnabled, Dt as createOpenAIResponseHook, Et as createOpenAIProviderAcceptanceHook, Ft as readOpenAICompletionsReasoningBatch, It as resolveOpenAIClientBaseUrl, J as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, L as normalizeOpenAIResponsesReasoningReplayItem, Lt as resolvePromptCacheKey, M as resolveResponsesContextUsageBoundary, Mt as measureUtf8AppendBytes, Nt as parseOpenAICompletionsUsage, Ot as createResponseModelTracker, Pt as readOpenAICompletionsContentDeltas, Q as splitOpenAIFunctionCallPairing, R as resolveReplayableResponsesMessageId, Rt as withOpenAIErrorResponseHook, Tt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, X as normalizeOpenAIResponsesFunctionCallId, Y as OPENAI_RESPONSES_ID_MAX_LENGTH, Z as shouldNormalizeOpenAIResponsesToolCallId, at as resolveNewestOpenAIResponsesCompactionReplay, ct as buildOpenAIClientHeaders, dt as enforceCodeModeResponsesToolSurface, ft as filterCodeModePayloadTools, gt as resolveOpenAIStrictToolFlagWithDiagnostics, ht as resolveCodeModeResponsesVisibleToolNames, it as captureOpenAIResponsesCompaction, jt as log, kt as detachPartialSnapshot, lt as buildOpenAISdkClientOptions, mt as readCodeModePayloadToolName, nt as CompactionReplayRefreshRequiredError, pt as getCompat, q as OPENAI_RESPONSES_CALL_ID_RE, st as assertCodeModeResponsesToolSurface, ut as buildOpenAISdkRequestOptions, yt as resolveOpenAIReasoningEffortMap } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
21
|
+
import { c as applyOpenAIResponsesPayloadPolicy, d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, p as resolveOpenAIResponsesServerCompactionPlan, s as sanitizeResponsesImagePayload, u as resolveOpenAIResponsesCompactEndpointPlan } from "./openai-responses-endpoint-CfKR6N5f.mjs";
|
|
22
|
+
import { c as requestPreparedOpenAIResponsesCompaction } from "./openai-responses-request-lifecycle-WKXjj_th.mjs";
|
|
23
23
|
import { n as createGoogleVideoPlaceholder, r as materializeGoogleVideoSlots, t as GOOGLE_VIDEO_SLOT_OMISSION } from "./google-video-slots-D8tPH8wX.mjs";
|
|
24
24
|
import { randomUUID } from "node:crypto";
|
|
25
25
|
//#region packages/ai/src/transports/anthropic-transport-stream.ts
|