@openclaw/ai 2026.10.5-beta.4 → 2026.10.5
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-BalhAzs-.mjs → anthropic-DIIiiz99.mjs} +2 -2
- package/dist/{anthropic-stream-reducer-DkKeXXx4.mjs → anthropic-stream-reducer-DfMVFm-r.mjs} +7 -2
- package/dist/{assistant-text-phase-Bn1hbvK9.mjs → assistant-text-phase-mvdMcrY-.mjs} +1 -1
- package/dist/{azure-openai-responses-DfT9Ndd8.mjs → azure-openai-responses-DGQnXRMs.mjs} +1 -1
- package/dist/{google-sYI2wnY6.mjs → google-BlbTC1Xp.mjs} +1 -1
- package/dist/{google-interactions-9SSqsJg9.mjs → google-interactions-zIz70M2e.mjs} +14 -11
- package/dist/{google-messages-DsB7fmoQ.mjs → google-messages-CNbUJK5E.mjs} +3 -1
- package/dist/{google-provider-stream-CcEI2-MC.mjs → google-provider-stream-Cn0XF1MG.mjs} +1 -1
- package/dist/{google-shared-zGR0QUyS.mjs → google-shared-BPnWP4tT.mjs} +9 -14
- package/dist/{google-vertex-Dw_abY1w.mjs → google-vertex-XQ7OQtaM.mjs} +1 -1
- package/dist/internal/anthropic.mjs +2 -2
- package/dist/internal/google-model-family.d.mts +2 -0
- package/dist/internal/google-model-family.mjs +6 -2
- package/dist/internal/openai.mjs +4 -4
- package/dist/{openai-chatgpt-responses-BHI3uCcA.mjs → openai-chatgpt-responses-D8-q7cgy.mjs} +2 -2
- package/dist/{openai-completions-CrVgnFrV.mjs → openai-completions-CMN24pza.mjs} +1 -1
- package/dist/{openai-completions-transport-Dy4CZo9Q.mjs → openai-completions-transport-DuXQOxrH.mjs} +9 -8
- package/dist/{openai-responses-D5oiAUOG.mjs → openai-responses-BMxoJdTC.mjs} +2 -2
- package/dist/{openai-responses-shared-D-aDYAkJ.mjs → openai-responses-shared-afo9-s16.mjs} +18 -5
- package/dist/{provider-transport-turn-state-BOpxgm-J.mjs → provider-transport-turn-state-BYrELw8H.mjs} +1 -1
- package/dist/providers.mjs +8 -8
- package/dist/text-signature-CUXnvk_c.mjs +34 -0
- package/dist/{text-signature-Drb4Erb8.mjs → transport-utils-34BQoXq3.mjs} +2 -34
- package/dist/transports.d.mts +2 -1
- package/dist/transports.mjs +6 -6
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
|
2
2
|
import { w as supportsClaudeAdaptiveThinking } from "./src-C44MKrW5.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
4
4
|
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { D as suppressAnthropicCompaction, J as isAnthropicOAuthApiKey, P as isDirectAnthropicModel, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest } from "./anthropic-stream-reducer-
|
|
5
|
+
import { s as streamFragmentError } from "./transport-utils-34BQoXq3.mjs";
|
|
6
|
+
import { D as suppressAnthropicCompaction, J as isAnthropicOAuthApiKey, P as isDirectAnthropicModel, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest } from "./anthropic-stream-reducer-DfMVFm-r.mjs";
|
|
7
7
|
import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
8
8
|
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
9
9
|
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-BAu4B54D.mjs";
|
package/dist/{anthropic-stream-reducer-DkKeXXx4.mjs → anthropic-stream-reducer-DfMVFm-r.mjs}
RENAMED
|
@@ -5,16 +5,17 @@ import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStr
|
|
|
5
5
|
import { i as normalizeOptionalLowercaseString, r as normalizeNullableString } from "./string-coerce-CtgOVOSv.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-C3hztWoY.mjs";
|
|
7
7
|
import { N as isImageWithMediaPayload, O as calculateCost, S as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-Bf3NjYNj.mjs";
|
|
8
|
-
import
|
|
8
|
+
import "./transport-utils-34BQoXq3.mjs";
|
|
9
9
|
import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
|
|
10
10
|
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-BzZluO6_.mjs";
|
|
11
11
|
import { i as resolveCacheRetention } from "./cloudflare-5qSGvIUH.mjs";
|
|
12
12
|
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, P as sanitizeSurrogates, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
13
13
|
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, p as extractToolResultBlockText, t as adjustMaxTokensForThinking, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-BAu4B54D.mjs";
|
|
14
14
|
import { t as parsePositiveInteger } from "./positive-integer-CqWjqSi9.mjs";
|
|
15
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-CUXnvk_c.mjs";
|
|
15
16
|
import { n as transformProviderMessages } from "./assistant-output-BuhRpLeD.mjs";
|
|
16
17
|
import { i as SCHEMA_MAP_KEYS, n as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-B8sG1I9v.mjs";
|
|
17
|
-
import { i as tagPendingCommentaryText } from "./assistant-text-phase-
|
|
18
|
+
import { i as tagPendingCommentaryText } from "./assistant-text-phase-mvdMcrY-.mjs";
|
|
18
19
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
19
20
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
20
21
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
@@ -925,6 +926,10 @@ async function convertContentBlocks(content, model, imageBudget, profile, isErro
|
|
|
925
926
|
async function convertAnthropicMessages(transformedMessages, model, isOAuthToken, options) {
|
|
926
927
|
const params = [];
|
|
927
928
|
const appendMessage = (message) => {
|
|
929
|
+
if (message.role === "system" && (!params.length || params.at(-1)?.role === "assistant")) params.push({
|
|
930
|
+
role: "user",
|
|
931
|
+
content: "."
|
|
932
|
+
});
|
|
928
933
|
if (message.role === "user" && params.at(-1)?.role === "system") params.push({
|
|
929
934
|
role: "assistant",
|
|
930
935
|
content: [{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as encodeTextSignatureV1 } from "./text-signature-
|
|
1
|
+
import { t as encodeTextSignatureV1 } from "./text-signature-CUXnvk_c.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region packages/ai/src/utils/assistant-text-phase.ts
|
|
4
4
|
const EMPTY_ASSISTANT_TEXT_BLOCK_SET = /* @__PURE__ */ new Set();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
3
3
|
import { n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
4
|
-
import { F as convertProviderResponsesMessages,
|
|
4
|
+
import { F as convertProviderResponsesMessages, It as resolvePromptCacheKey, _t as resolveOpenAISimpleReasoningEffort, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-afo9-s16.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
6
6
|
import { t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
7
7
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
@@ -2,7 +2,7 @@ import { r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
|
2
2
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
4
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
5
|
-
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-
|
|
5
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-Cn0XF1MG.mjs";
|
|
6
6
|
import { GoogleGenAI } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google.ts
|
|
8
8
|
const { stream: streamGoogle, streamSimple: streamSimpleGoogle } = createGoogleGenerateContentStreams("google-generative-ai", (model, options) => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { a as asRecord, i as asOptionalRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
3
3
|
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
4
|
+
import { s as streamFragmentError } from "./transport-utils-34BQoXq3.mjs";
|
|
4
5
|
import { t as buildGuardedModelFetch } from "./host-policy-BzZluO6_.mjs";
|
|
5
6
|
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
6
7
|
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
7
8
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
8
9
|
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
9
|
-
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-
|
|
10
|
+
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-BPnWP4tT.mjs";
|
|
10
11
|
import { createRequire } from "node:module";
|
|
11
12
|
//#region packages/ai/src/providers/google-interactions-request.ts
|
|
12
13
|
const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
@@ -359,14 +360,16 @@ async function runGoogleInteractionsLifecycle(params) {
|
|
|
359
360
|
let sawCompletion = false;
|
|
360
361
|
while (!streamDone) {
|
|
361
362
|
const { done, value } = await reader.read();
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
363
|
+
buffer += decoder.decode(value, { stream: !done });
|
|
364
|
+
const frames = buffer.split(/(?:\r\n|\r(?!\n)|\n)(?:\r\n|\r(?!\n)|\n)/);
|
|
365
|
+
buffer = frames.pop() ?? "";
|
|
366
|
+
if (done) {
|
|
367
|
+
if (/[\r\n]$/.test(buffer)) frames.push(buffer);
|
|
368
|
+
streamDone = true;
|
|
369
|
+
}
|
|
370
|
+
for (const frame of frames) {
|
|
371
|
+
const dataStr = frame.split(/\r\n|\r|\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5)).join("\n").trim();
|
|
372
|
+
if (!dataStr) continue;
|
|
370
373
|
if (dataStr === "[DONE]") {
|
|
371
374
|
streamDone = true;
|
|
372
375
|
break;
|
|
@@ -374,8 +377,8 @@ async function runGoogleInteractionsLifecycle(params) {
|
|
|
374
377
|
let event;
|
|
375
378
|
try {
|
|
376
379
|
event = asRecord(parseJsonPreservingUnsafeIntegers(dataStr));
|
|
377
|
-
} catch {
|
|
378
|
-
|
|
380
|
+
} catch (error) {
|
|
381
|
+
throw streamFragmentError(error);
|
|
379
382
|
}
|
|
380
383
|
const eventType = event.event_type || event.type;
|
|
381
384
|
logGoogleInteractionsDebug("stream event", { eventType: typeof eventType === "string" ? eventType : "unknown" });
|
|
@@ -3,9 +3,11 @@ import { N as isImageWithMediaPayload, O as calculateCost } from "./host-Bf3NjYN
|
|
|
3
3
|
import { P as sanitizeSurrogates, a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
4
4
|
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-BAu4B54D.mjs";
|
|
5
5
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
6
|
+
import { isGoogleGemini4Model } from "./internal/google-model-family.mjs";
|
|
6
7
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
7
|
-
/**
|
|
8
|
+
/** Reports MINIMAL support for Gemini Flash and Gemini 4 models. */
|
|
8
9
|
function googleFlashSupportsMinimalThinking(modelId) {
|
|
10
|
+
if (isGoogleGemini4Model(modelId)) return false;
|
|
9
11
|
const match = modelId.toLowerCase().match(/(?:^|\/)gemini-3\.(\d+)-flash(?:-|$)/);
|
|
10
12
|
if (!match) return true;
|
|
11
13
|
return Number.parseInt(match[1] ?? "0", 10) < 7;
|
|
@@ -4,7 +4,7 @@ import { n as buildManagedModelFetch } from "./host-policy-BzZluO6_.mjs";
|
|
|
4
4
|
import { f as mergeTransportHeaders } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
5
5
|
import { n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
6
6
|
import { t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
7
|
-
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
7
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-BPnWP4tT.mjs";
|
|
8
8
|
import { ResourceScope } from "@google/genai";
|
|
9
9
|
//#region packages/ai/src/providers/google-http-options.ts
|
|
10
10
|
function buildGoogleHttpOptions(model, optionsHeaders, profile) {
|
|
@@ -2,7 +2,8 @@ import { k as clampThinkingLevel } from "./host-Bf3NjYNj.mjs";
|
|
|
2
2
|
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
3
3
|
import { C as stripSystemPromptCacheBoundary } from "./simple-options-BAu4B54D.mjs";
|
|
4
4
|
import { n as transformProviderMessages } from "./assistant-output-BuhRpLeD.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
6
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-CNbUJK5E.mjs";
|
|
6
7
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
7
8
|
//#region packages/ai/src/providers/google-shared.ts
|
|
8
9
|
function convertMessages(model, context) {
|
|
@@ -10,7 +11,7 @@ function convertMessages(model, context) {
|
|
|
10
11
|
model,
|
|
11
12
|
messages: transformProviderMessages(context.messages, model, (id) => requiresGoogleToolCallId(model.id) ? id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64) : id),
|
|
12
13
|
replay: "signed-parts",
|
|
13
|
-
requiresToolCallSignature: model.provider !== "google-gemini-cli" && (
|
|
14
|
+
requiresToolCallSignature: model.provider !== "google-gemini-cli" && isGoogleGemini3ThinkingLevelModel(model.id)
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
17
|
function mapToolChoice(choice) {
|
|
@@ -89,7 +90,7 @@ function buildGoogleSimpleThinking(model, options) {
|
|
|
89
90
|
enabled: true,
|
|
90
91
|
level: ThinkingLevel.HIGH
|
|
91
92
|
};
|
|
92
|
-
return
|
|
93
|
+
return isGoogleGemini3ThinkingLevelModel(model.id) ? { enabled: true } : {
|
|
93
94
|
enabled: true,
|
|
94
95
|
budgetTokens: -1
|
|
95
96
|
};
|
|
@@ -97,7 +98,7 @@ function buildGoogleSimpleThinking(model, options) {
|
|
|
97
98
|
const clampedReasoning = clampThinkingLevel(model, options.reasoning);
|
|
98
99
|
if (clampedReasoning === "off") return { enabled: false };
|
|
99
100
|
const effort = clampedReasoning === "max" ? "high" : clampedReasoning;
|
|
100
|
-
if (
|
|
101
|
+
if (isGoogleGemini3ThinkingLevelModel(model.id) || isGemma4Model(model)) return {
|
|
101
102
|
enabled: true,
|
|
102
103
|
level: getGoogleThinkingLevel(effort, model)
|
|
103
104
|
};
|
|
@@ -129,8 +130,8 @@ function buildGoogleInteractionsSimpleThinking(model, options) {
|
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
function getDisabledGoogleThinkingConfig(model) {
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
133
|
+
if (isGoogleGemini3ProModel(model.id)) return { thinkingLevel: ThinkingLevel.LOW };
|
|
134
|
+
if (isGoogleGemini3ThinkingLevelModel(model.id)) return { thinkingLevel: googleFlashSupportsMinimalThinking(model.id) ? ThinkingLevel.MINIMAL : ThinkingLevel.LOW };
|
|
134
135
|
if (isGemma4Model(model) || model.id.toLowerCase().includes("gemini-2.5-pro")) return {};
|
|
135
136
|
return { thinkingBudget: 0 };
|
|
136
137
|
}
|
|
@@ -138,18 +139,12 @@ function getDisabledGoogleThinkingConfig(model) {
|
|
|
138
139
|
function isGemma4Model(model) {
|
|
139
140
|
return /gemma-?4/.test(model.id.toLowerCase());
|
|
140
141
|
}
|
|
141
|
-
function isGemini3ProModel(model) {
|
|
142
|
-
return /gemini-(?:3(?:\.\d+)?-pro|pro-latest)/.test(model.id.toLowerCase());
|
|
143
|
-
}
|
|
144
|
-
function isGemini3FlashModel(model) {
|
|
145
|
-
return /gemini-(?:3(?:\.\d+)?-flash|flash(?:-lite)?-latest)/.test(model.id.toLowerCase());
|
|
146
|
-
}
|
|
147
142
|
function getGoogleThinkingLevel(effort, model) {
|
|
148
143
|
const lowEffort = effort === "minimal" || effort === "low";
|
|
149
|
-
if (
|
|
144
|
+
if (isGoogleGemini3ProModel(model.id)) return lowEffort ? ThinkingLevel.LOW : ThinkingLevel.HIGH;
|
|
150
145
|
if (isGemma4Model(model)) return lowEffort ? ThinkingLevel.MINIMAL : ThinkingLevel.HIGH;
|
|
151
146
|
switch (effort) {
|
|
152
|
-
case "minimal": return
|
|
147
|
+
case "minimal": return googleFlashSupportsMinimalThinking(model.id) ? ThinkingLevel.MINIMAL : ThinkingLevel.LOW;
|
|
153
148
|
case "low": return ThinkingLevel.LOW;
|
|
154
149
|
case "medium": return ThinkingLevel.MEDIUM;
|
|
155
150
|
case "high": return ThinkingLevel.HIGH;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as normalizeOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
2
2
|
import { r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
3
|
-
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-
|
|
3
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-Cn0XF1MG.mjs";
|
|
4
4
|
import { GoogleGenAI } from "@google/genai";
|
|
5
5
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
6
6
|
const API_VERSION = "v1";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-C44MKrW5.mjs";
|
|
2
2
|
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-Bf3NjYNj.mjs";
|
|
3
|
-
import { B as resolveAnthropicServerCompactionPlan, C as logAnthropicThinkingDrops, G as applyAnthropicFallbackBoundary, H as ANTHROPIC_SERVER_SIDE_FALLBACKS, J as isAnthropicOAuthApiKey, K as readAnthropicFallbackBoundary, P as isDirectAnthropicModel, S as findActiveAnthropicToolTurnAssistantIndex, U as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as CLAUDE_OPUS_FALLBACK_MODEL_COST, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, _ as reconcileAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as ANTHROPIC_OMITTED_REASONING_TEXT, c as applyAnthropicRefusal, g as projectAnthropicTools, h as normalizeAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as normalizeAnthropicToolCallId, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as resolveAnthropicFallbackServingModelCost, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as resolveOriginalAnthropicToolName, w as readAnthropicInputTransformations, x as applyAnthropicThinkingBindingControls, y as toClaudeCodeToolName } from "../anthropic-stream-reducer-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
3
|
+
import { B as resolveAnthropicServerCompactionPlan, C as logAnthropicThinkingDrops, G as applyAnthropicFallbackBoundary, H as ANTHROPIC_SERVER_SIDE_FALLBACKS, J as isAnthropicOAuthApiKey, K as readAnthropicFallbackBoundary, P as isDirectAnthropicModel, S as findActiveAnthropicToolTurnAssistantIndex, U as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as CLAUDE_OPUS_FALLBACK_MODEL_COST, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, _ as reconcileAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as ANTHROPIC_OMITTED_REASONING_TEXT, c as applyAnthropicRefusal, g as projectAnthropicTools, h as normalizeAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as normalizeAnthropicToolCallId, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as resolveAnthropicFallbackServingModelCost, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as resolveOriginalAnthropicToolName, w as readAnthropicInputTransformations, x as applyAnthropicThinkingBindingControls, y as toClaudeCodeToolName } from "../anthropic-stream-reducer-DfMVFm-r.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DIIiiz99.mjs";
|
|
5
5
|
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
//#region packages/ai/src/internal/google-model-family.d.ts
|
|
2
2
|
export declare function isGoogleGemini3ProModel(modelId: string): boolean;
|
|
3
3
|
export declare function isGoogleGemini3FlashModel(modelId: string): boolean;
|
|
4
|
+
export declare function isGoogleGemini4Model(modelId: string): boolean;
|
|
5
|
+
/** Identifies thinkingLevel-family Gemini models (3.x and 4). */
|
|
4
6
|
export declare function isGoogleGemini3ThinkingLevelModel(modelId: string): boolean;
|
|
5
7
|
//#endregion
|
|
@@ -8,8 +8,12 @@ function isGoogleGemini3FlashModel(modelId) {
|
|
|
8
8
|
const normalized = normalizeLowercaseStringOrEmpty(modelId);
|
|
9
9
|
return /(?:^|\/)gemini-(?:3(?:\.\d+)?-flash|flash(?:-lite)?-latest)(?:-|$)/.test(normalized);
|
|
10
10
|
}
|
|
11
|
+
function isGoogleGemini4Model(modelId) {
|
|
12
|
+
return /(?:^|\/)gemini-4(?:[-.]|$)/.test(normalizeLowercaseStringOrEmpty(modelId));
|
|
13
|
+
}
|
|
14
|
+
/** Identifies thinkingLevel-family Gemini models (3.x and 4). */
|
|
11
15
|
function isGoogleGemini3ThinkingLevelModel(modelId) {
|
|
12
|
-
return isGoogleGemini3ProModel(modelId) || isGoogleGemini3FlashModel(modelId);
|
|
16
|
+
return isGoogleGemini3ProModel(modelId) || isGoogleGemini3FlashModel(modelId) || isGoogleGemini4Model(modelId);
|
|
13
17
|
}
|
|
14
18
|
//#endregion
|
|
15
|
-
export { isGoogleGemini3FlashModel, isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel };
|
|
19
|
+
export { isGoogleGemini3FlashModel, isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel, isGoogleGemini4Model };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { C as normalizeOpenAIReasoningEffort, D as resolveOpenAISupportedReasoni
|
|
|
2
2
|
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-r93BJhjm.mjs";
|
|
3
3
|
import { _ as resolveResponsesTerminalStopReason, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, m as isResponsesOutputLimitToolCallError } from "../diagnostics-tQasYct1.mjs";
|
|
4
4
|
import { a as encodedModelRequestBodyStream, c as serializeModelRequestBody, l as codeModeToolSurfaceObserver, o as modelRequestBodyState, u as reasoningTagTextPolicy } from "../simple-options-BAu4B54D.mjs";
|
|
5
|
-
import { N as bindResponsesInputMessage, St as reconcileOpenAIResponsesToolChoice, _ as isResponsesTextContentPartType, bt as projectOpenAITools, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as reconcileOpenAICompletionsToolChoice, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
6
|
-
import { c as convertMessages, o as hasResponsesWebSearchTool } from "../openai-completions-transport-
|
|
5
|
+
import { N as bindResponsesInputMessage, St as reconcileOpenAIResponsesToolChoice, _ as isResponsesTextContentPartType, bt as projectOpenAITools, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as reconcileOpenAICompletionsToolChoice, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-afo9-s16.mjs";
|
|
6
|
+
import { c as convertMessages, o as hasResponsesWebSearchTool } from "../openai-completions-transport-DuXQOxrH.mjs";
|
|
7
7
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-8s70vDXj.mjs";
|
|
8
8
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
9
9
|
import { t as responsesRequestLifecycle } from "../openai-responses-request-lifecycle-NSIJo9jY.mjs";
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-CMN24pza.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-BMxoJdTC.mjs";
|
|
12
12
|
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, modelRequestBodyState, normalizeOpenAIReasoningEffort, parseAzureDeploymentNameMap, projectOpenAITools, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, responsesPromptObserver, responsesRequestLifecycle, responsesServiceTierObserver, serializeModelRequestBody, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
package/dist/{openai-chatgpt-responses-BHI3uCcA.mjs → openai-chatgpt-responses-D8-q7cgy.mjs}
RENAMED
|
@@ -8,13 +8,13 @@ import { r as registerSessionResourceCleanup } from "./session-resources-D1wgDQ8
|
|
|
8
8
|
import "./provider-error-CF9GWCs2.mjs";
|
|
9
9
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-r93BJhjm.mjs";
|
|
10
10
|
import { s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, v as extractErrorCodeOrErrno, y as toErrorObject } from "./diagnostics-tQasYct1.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { l as consumeResponseBytes, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-34BQoXq3.mjs";
|
|
12
12
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
13
13
|
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-CYX18uDk.mjs";
|
|
14
14
|
import { n as buildManagedModelFetch } from "./host-policy-BzZluO6_.mjs";
|
|
15
15
|
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
16
16
|
import { C as stripSystemPromptCacheBoundary, n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
17
|
-
import { Dt as createResponseModelTracker, E as ResponsesStreamFailure, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAISimpleReasoningEffort, at as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, gt as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, o as readOpenAIMisalignmentReview, s as processResponsesStream } from "./openai-responses-shared-
|
|
17
|
+
import { Dt as createResponseModelTracker, E as ResponsesStreamFailure, Et as createOpenAIResponseHook, F as convertProviderResponsesMessages, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, _t as resolveOpenAISimpleReasoningEffort, at as suppressOpenAIResponsesCompaction, b as commitResponsesEncryptedContentAttempt, gt as resolveOpenAIRequestReasoning, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, o as readOpenAIMisalignmentReview, s as processResponsesStream } from "./openai-responses-shared-afo9-s16.mjs";
|
|
18
18
|
import { t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
19
19
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-Dc42hKv6.mjs";
|
|
20
20
|
import { n as withResponsesRequestAcceptance, r as createResponsesPromptEgressObserver, t as responsesRequestLifecycle } from "./openai-responses-request-lifecycle-NSIJo9jY.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
2
|
import { k as clampThinkingLevel } from "./host-Bf3NjYNj.mjs";
|
|
3
3
|
import { n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
4
|
-
import { c as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-
|
|
4
|
+
import { c as convertMessages, n as streamOpenAICompletionsRequest } from "./openai-completions-transport-DuXQOxrH.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-transport-Dy4CZo9Q.mjs → openai-completions-transport-DuXQOxrH.mjs}
RENAMED
|
@@ -10,24 +10,25 @@ import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } f
|
|
|
10
10
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
11
11
|
import { r as resolveOpenAIPromptCacheParams } from "./openai-prompt-cache-r93BJhjm.mjs";
|
|
12
12
|
import { d as hasOnlyResponsesFunctionTools, i as emitModelTransportError, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./diagnostics-tQasYct1.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { c as supportsModelTools, n as estimateStringChars } from "./transport-utils-34BQoXq3.mjs";
|
|
14
14
|
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-CYX18uDk.mjs";
|
|
15
15
|
import { i as resolveProviderEndpoint, t as buildGuardedModelFetch } from "./host-policy-BzZluO6_.mjs";
|
|
16
16
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
17
17
|
import { E as createToolArgumentPreviewSchedule, M as racePromiseWithAbortSignal, O as parseStreamingJson, P as sanitizeSurrogates, 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-CWGOuLcA.mjs";
|
|
18
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-BAu4B54D.mjs";
|
|
19
|
-
import { $ as replayResponsesReasoningUpdates, A as summarizeResponsesPayload, At as
|
|
18
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, S as splitSystemPromptRelocatableBoundary, d as describeToolResultMediaPlaceholder, l as codeModeToolSurfaceObserver, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody, u as reasoningTagTextPolicy, w as stripSystemPromptRelocatableBoundary, x as splitSystemPromptCacheBoundary } from "./simple-options-BAu4B54D.mjs";
|
|
19
|
+
import { $ as replayResponsesReasoningUpdates, A as summarizeResponsesPayload, At as log, B as responsesInputFingerprint, C as readResponsesRecoveryEvent, Ct as toOpenAIResponsesToolChoice, D as logResponsesFailedNoDetails, Dt as createResponseModelTracker, E as ResponsesStreamFailure, Ft as resolveOpenAIClientBaseUrl, G as responsesContinuationRequestFingerprint, H as recordResponsesContinuationState, I as convertResponsesMessages, It as resolvePromptCacheKey, Lt as redactIdentifier, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, O as safeDebugValue, Ot as detachPartialSnapshot, P as buildResponsesInputMessage, Pt as readOpenAICompletionsReasoningBatch, Q as isConfigurationUpdate, R as readResponsesInputReplayState, Rt as sha256Hex, S as isInvalidEncryptedContentError, St as reconcileOpenAIResponsesToolChoice, T as resolveNextResponsesEncryptedContentAttempt, Tt as createOpenAIProviderAcceptanceHook, U as resolveResponsesContinuationRequest, V as claimOpenAIResponsesHttpContinuation, W as responsesContinuationPrefixFingerprint, _t as resolveOpenAISimpleReasoningEffort, a as prepareResponsesTools, at as suppressOpenAIResponsesCompaction, bt as projectOpenAITools, c as observeResponsesStream, ct as buildOpenAISdkClientOptions, et as supportsResponsesReasoningUpdate, ft as getCompat, gt as resolveOpenAIRequestReasoning, ht as resolveOpenAIStrictToolFlagWithDiagnostics, j as recordResponsesContextUsage, jt as measureUtf8AppendBytes, k as summarizeOpenAITransportError, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, n as applyResponsesServiceTierPricing, nt as buildOpenAIResponsesReasoningReplayMetadata, ot as assertCodeModeResponsesToolSurface, s as processResponsesStream, st as buildOpenAIClientHeaders, ut as enforceCodeModeResponsesToolSurface, w as resolveAzureOpenAIApiVersion, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, x as createResponsesStreamWithRecovery, xt as reconcileOpenAICompletionsToolChoice, yt as prepareOpenAITools, z as recordResponsesInputReplay } from "./openai-responses-shared-afo9-s16.mjs";
|
|
20
20
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
21
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext } from "./text-signature-CUXnvk_c.mjs";
|
|
21
22
|
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
22
|
-
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-
|
|
23
|
+
import { a as tagUnresolvedTextAsCommentary, i as tagPendingCommentaryText, n as rememberPendingCommentaryTags, r as tagInterruptedTextPhases, t as clearPendingCommentaryText } from "./assistant-text-phase-mvdMcrY-.mjs";
|
|
23
24
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
24
25
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
26
|
+
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
25
27
|
import "./types.mjs";
|
|
26
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-
|
|
28
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders, r as resolveProviderTransportTurnState, t as filterProviderTurnHeadersForExplicitOpencodeSession } from "./provider-transport-turn-state-BYrELw8H.mjs";
|
|
27
29
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-Dc42hKv6.mjs";
|
|
28
30
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
29
31
|
import { f as withPreparedToolSchemaNormalization, r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-DDPXsvJP.mjs";
|
|
30
|
-
import { isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
31
32
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
|
32
33
|
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-CpOy9-IQ.mjs";
|
|
33
34
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
@@ -1471,7 +1472,7 @@ async function processCompletionsStream(responseStream, output, model, stream, o
|
|
|
1471
1472
|
let chunkPushedEvent = false;
|
|
1472
1473
|
const pushStreamEvent = (event) => {
|
|
1473
1474
|
chunkPushedEvent = true;
|
|
1474
|
-
stream.push(event);
|
|
1475
|
+
stream.push(detachPartialSnapshot(event));
|
|
1475
1476
|
};
|
|
1476
1477
|
const appendToolCallBlock = (block) => {
|
|
1477
1478
|
output.content.push(block);
|
|
@@ -1947,7 +1948,7 @@ function buildOpenAIResponsesParams(model, context, options, metadata, replayMod
|
|
|
1947
1948
|
...metadata ? { metadata } : {}
|
|
1948
1949
|
};
|
|
1949
1950
|
const effectiveMaxTokens = options?.maxTokens || model.maxTokens;
|
|
1950
|
-
if (effectiveMaxTokens) params.max_output_tokens = Math.max(effectiveMaxTokens, 16);
|
|
1951
|
+
if (effectiveMaxTokens) params.max_output_tokens = clampMaxTokensToModel(model, Math.max(effectiveMaxTokens, 16));
|
|
1951
1952
|
if (options?.temperature !== void 0 && supportsOpenAITemperature(model)) params.temperature = options.temperature;
|
|
1952
1953
|
if (options?.topP !== void 0 && (!isOpenAIGpt6Model(model) || resolveOpenAIThinkingApi(model.api) === "azure-openai-responses")) params.top_p = options.topP;
|
|
1953
1954
|
if (options?.responseFormat !== void 0) params.text = {
|
|
@@ -4,10 +4,10 @@ import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams } f
|
|
|
4
4
|
import { i as resolveOpenAICompletionsCompat } from "./openai-completions-compat-CYX18uDk.mjs";
|
|
5
5
|
import { i as resolveCacheRetention, r as buildCopilotDynamicHeaders } from "./cloudflare-5qSGvIUH.mjs";
|
|
6
6
|
import { n as buildBaseOptions } from "./simple-options-BAu4B54D.mjs";
|
|
7
|
-
import { F as convertProviderResponsesMessages, _t as resolveOpenAISimpleReasoningEffort, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
7
|
+
import { F as convertProviderResponsesMessages, _t as resolveOpenAISimpleReasoningEffort, n as applyResponsesServiceTierPricing, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-afo9-s16.mjs";
|
|
8
8
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
9
9
|
import { t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
10
|
-
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-
|
|
10
|
+
import { i as createOpenAIProviderClient, n as resolveProviderSimpleCompletionHeaders } from "./provider-transport-turn-state-BYrELw8H.mjs";
|
|
11
11
|
import { t as requireApiKey } from "./required-api-key-CFJvcFy_.mjs";
|
|
12
12
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
13
13
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -11,11 +11,12 @@ import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup } f
|
|
|
11
11
|
import { c as stableStringify, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
12
12
|
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-r93BJhjm.mjs";
|
|
13
13
|
import { _ as resolveResponsesTerminalStopReason, a as resolveModelPayloadDebugMode, d as hasOnlyResponsesFunctionTools, f as isResponsesProviderTool, g as readResponsesReasoningTokens, h as mapResponsesTerminalUsage, o as resolveModelSseDebugMode, r as emitModelTransportDebug, u as ResponsesOutputIdentityError } from "./diagnostics-tQasYct1.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { a as redactSensitiveText, r as isCodeModeModelVisibleToolName } from "./transport-utils-34BQoXq3.mjs";
|
|
15
15
|
import { c as resolveOpenAIResponsesTextFormat, i as resolveOpenAICompletionsCompat, o as usesNativeOpenAICodexResponsesBackend } from "./openai-completions-compat-CYX18uDk.mjs";
|
|
16
16
|
import { r as resolveModelRequestTimeoutMs } from "./host-policy-BzZluO6_.mjs";
|
|
17
17
|
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-CWGOuLcA.mjs";
|
|
18
|
-
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, s as prepareModelRequestBody } from "./simple-options-BAu4B54D.mjs";
|
|
18
|
+
import { C as stripSystemPromptCacheBoundary, D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText, r as clampMaxTokensToModel, s as prepareModelRequestBody } from "./simple-options-BAu4B54D.mjs";
|
|
19
|
+
import { i as providerReplayContextMatches, n as buildProviderReplayContext, r as isProviderReplayContext, t as encodeTextSignatureV1 } from "./text-signature-CUXnvk_c.mjs";
|
|
19
20
|
import { n as transformProviderMessages } from "./assistant-output-BuhRpLeD.mjs";
|
|
20
21
|
import { n as projectRuntimeToolInputSchema, t as prepareRuntimeToolInputSchema } from "./tool-schema-json-projection-B8sG1I9v.mjs";
|
|
21
22
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
@@ -198,6 +199,18 @@ function readOpenAICompletionsReasoningBatch(delta, visibleReasoningDetailTypes)
|
|
|
198
199
|
hasVisibleText: mirroredThinking.length < deltas.length
|
|
199
200
|
};
|
|
200
201
|
}
|
|
202
|
+
function detachPartialSnapshot(event) {
|
|
203
|
+
const source = event;
|
|
204
|
+
if (!source.partial) return event;
|
|
205
|
+
const partial = source.partial;
|
|
206
|
+
return {
|
|
207
|
+
...event,
|
|
208
|
+
partial: {
|
|
209
|
+
...partial,
|
|
210
|
+
content: partial.content.map((block) => block.type === "text" ? Object.assign({}, block) : block)
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}
|
|
201
214
|
function parseOpenAICompletionsUsage(rawUsage, model, options) {
|
|
202
215
|
const cacheRead = rawUsage.prompt_tokens_details?.cached_tokens ?? rawUsage.prompt_cache_hit_tokens ?? 0;
|
|
203
216
|
const cacheWrite = rawUsage.prompt_tokens_details?.cache_write_tokens ?? rawUsage.prompt_tokens_details?.cache_creation_input_tokens ?? rawUsage.cache_creation_input_tokens ?? 0;
|
|
@@ -2316,7 +2329,7 @@ function createResponsesOutputTracker(params) {
|
|
|
2316
2329
|
trackStream(sink) {
|
|
2317
2330
|
return { push(event) {
|
|
2318
2331
|
visibleTextEmitted ||= event.type === "text_delta" && event.delta.length > 0 || event.type === "text_end" && event.content.length > 0;
|
|
2319
|
-
sink.push(event);
|
|
2332
|
+
sink.push(detachPartialSnapshot(event));
|
|
2320
2333
|
} };
|
|
2321
2334
|
},
|
|
2322
2335
|
observeEvent(event) {
|
|
@@ -3246,7 +3259,7 @@ function applyResponsesServiceTierPricing(usage, serviceTier, model) {
|
|
|
3246
3259
|
usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
|
|
3247
3260
|
}
|
|
3248
3261
|
function applyCommonResponsesParams(params, model, context, options, config) {
|
|
3249
|
-
if (options?.maxTokens) params.max_output_tokens = Math.max(options.maxTokens, 16);
|
|
3262
|
+
if (options?.maxTokens) params.max_output_tokens = clampMaxTokensToModel(model, Math.max(options.maxTokens, 16));
|
|
3250
3263
|
if (options?.temperature !== void 0 && supportsOpenAITemperature(model)) params.temperature = options.temperature;
|
|
3251
3264
|
if (options?.responseFormat !== void 0) params.text = {
|
|
3252
3265
|
...params.text,
|
|
@@ -3380,4 +3393,4 @@ async function runResponsesStreamLifecycle(params) {
|
|
|
3380
3393
|
}
|
|
3381
3394
|
}
|
|
3382
3395
|
//#endregion
|
|
3383
|
-
export { replayResponsesReasoningUpdates as $, summarizeResponsesPayload as A,
|
|
3396
|
+
export { replayResponsesReasoningUpdates as $, summarizeResponsesPayload as A, log as At, responsesInputFingerprint as B, readResponsesRecoveryEvent as C, toOpenAIResponsesToolChoice as Ct, logResponsesFailedNoDetails as D, createResponseModelTracker as Dt, ResponsesStreamFailure as E, createOpenAIResponseHook as Et, convertProviderResponsesMessages as F, resolveOpenAIClientBaseUrl as Ft, responsesContinuationRequestFingerprint as G, recordResponsesContinuationState as H, convertResponsesMessages as I, resolvePromptCacheKey as It, OPENAI_RESPONSES_ID_MAX_LENGTH as J, OPENAI_RESPONSES_CALL_ID_RE as K, resolveReplayableResponsesMessageId as L, redactIdentifier as Lt, resolveResponsesContextUsageBoundary as M, parseOpenAICompletionsUsage as Mt, bindResponsesInputMessage as N, readOpenAICompletionsContentDeltas as Nt, safeDebugValue as O, detachPartialSnapshot as Ot, buildResponsesInputMessage as P, readOpenAICompletionsReasoningBatch as Pt, isConfigurationUpdate as Q, readResponsesInputReplayState as R, sha256Hex as Rt, isInvalidEncryptedContentError as S, reconcileOpenAIResponsesToolChoice as St, resolveNextResponsesEncryptedContentAttempt as T, createOpenAIProviderAcceptanceHook as Tt, resolveResponsesContinuationRequest as U, claimOpenAIResponsesHttpContinuation as V, responsesContinuationPrefixFingerprint as W, shouldNormalizeOpenAIResponsesToolCallId as X, normalizeOpenAIResponsesFunctionCallId as Y, splitOpenAIFunctionCallPairing as Z, isResponsesTextContentPartType as _, resolveOpenAISimpleReasoningEffort as _t, prepareResponsesTools as a, suppressOpenAIResponsesCompaction as at, commitResponsesEncryptedContentAttempt as b, projectOpenAITools as bt, observeResponsesStream as c, buildOpenAISdkClientOptions as ct, AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE as d, filterCodeModePayloadTools as dt, supportsResponsesReasoningUpdate as et, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE as f, getCompat as ft, isAzureResponsesTextDeltaEventType as g, resolveOpenAIRequestReasoning as gt, isAzureResponsesTextDeltaEvent as h, resolveOpenAIStrictToolFlagWithDiagnostics as ht, convertResponsesToolPayload as i, resolveNewestOpenAIResponsesCompactionReplay as it, recordResponsesContextUsage as j, measureUtf8AppendBytes as jt, summarizeOpenAITransportError as k, isOpenAICompletionsThinkingEnabled as kt, createResponsesToolCallTracker as l, buildOpenAISdkRequestOptions as lt, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE as m, resolveCodeModeResponsesVisibleToolNames as mt, applyResponsesServiceTierPricing as n, buildOpenAIResponsesReasoningReplayMetadata as nt, readOpenAIMisalignmentReview as o, assertCodeModeResponsesToolSurface as ot, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE as p, readCodeModePayloadToolName as pt, OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE as q, runResponsesStreamLifecycle as r, captureOpenAIResponsesCompaction as rt, processResponsesStream as s, buildOpenAIClientHeaders as st, applyCommonResponsesParams as t, CompactionReplayRefreshRequiredError as tt, readResponsesToolCallItemIdentity as u, enforceCodeModeResponsesToolSurface as ut, isResponsesTextDeltaEventType as v, resolveOpenAIReasoningEffortMap as vt, resolveAzureOpenAIApiVersion as w, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP as wt, createResponsesStreamWithRecovery as x, reconcileOpenAICompletionsToolChoice as xt, resolveResponsesMessageSnapshotCollapse as y, prepareOpenAITools as yt, recordResponsesInputReplay as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
2
2
|
import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-5qSGvIUH.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Ft as resolveOpenAIClientBaseUrl } from "./openai-responses-shared-afo9-s16.mjs";
|
|
4
4
|
import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import OpenAI from "openai";
|
package/dist/providers.mjs
CHANGED
|
@@ -50,11 +50,11 @@ 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-DIIiiz99.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-CMN24pza.mjs").then((n) => n.t), (module) => ({
|
|
58
58
|
stream: module.streamOpenAICompletions,
|
|
59
59
|
streamSimple: module.streamSimpleOpenAICompletions
|
|
60
60
|
})),
|
|
@@ -62,27 +62,27 @@ const registerBuiltIns = [
|
|
|
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-BMxoJdTC.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-DGQnXRMs.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-D8-q7cgy.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-BlbTC1Xp.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-zIz70M2e.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-XQ7OQtaM.mjs"), (module) => ({
|
|
86
86
|
stream: module.streamGoogleVertex,
|
|
87
87
|
streamSimple: module.streamSimpleGoogleVertex
|
|
88
88
|
}))
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
+
import { A as shortHash } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
3
|
+
//#region packages/ai/src/transports/provider-replay-context.ts
|
|
4
|
+
function isProviderReplayContext(value) {
|
|
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");
|
|
6
|
+
}
|
|
7
|
+
function hashReplayContextValue(value) {
|
|
8
|
+
const normalized = value?.trim();
|
|
9
|
+
return normalized ? shortHash(normalized) : void 0;
|
|
10
|
+
}
|
|
11
|
+
function buildProviderReplayContext(model, options) {
|
|
12
|
+
return {
|
|
13
|
+
provider: model.provider,
|
|
14
|
+
api: model.api,
|
|
15
|
+
model: model.id,
|
|
16
|
+
baseUrlHash: hashReplayContextValue(model.baseUrl),
|
|
17
|
+
sessionHash: hashReplayContextValue(options?.sessionId),
|
|
18
|
+
authProfileHash: hashReplayContextValue(options?.authProfileId)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function providerReplayContextMatches(state, context) {
|
|
22
|
+
return state.provider === context.provider && state.api === context.api && state.model === context.model && state.baseUrlHash === context.baseUrlHash && state.sessionHash === context.sessionHash && state.authProfileHash === context.authProfileHash;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region packages/ai/src/utils/text-signature.ts
|
|
26
|
+
function encodeTextSignatureV1(id, phase) {
|
|
27
|
+
return JSON.stringify({
|
|
28
|
+
v: 1,
|
|
29
|
+
id,
|
|
30
|
+
...phase ? { phase } : {}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { providerReplayContextMatches as i, buildProviderReplayContext as n, isProviderReplayContext as r, encodeTextSignatureV1 as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
1
|
import { r as getAiTransportHost } from "./host-Bf3NjYNj.mjs";
|
|
3
2
|
import { s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
4
3
|
import "./internal/retry-after.mjs";
|
|
5
|
-
import {
|
|
4
|
+
import { N as raceWithTimeout } from "./transport-stream-shared-CWGOuLcA.mjs";
|
|
6
5
|
import "./positive-integer-CqWjqSi9.mjs";
|
|
7
6
|
//#region packages/normalization-core/src/response-bytes.ts
|
|
8
7
|
async function consumeResponseBytes(options) {
|
|
@@ -110,35 +109,4 @@ async function readResponseTextSnippet(response, options) {
|
|
|
110
109
|
return truncated ? `${collapsed}…` : collapsed;
|
|
111
110
|
}
|
|
112
111
|
//#endregion
|
|
113
|
-
|
|
114
|
-
function isProviderReplayContext(value) {
|
|
115
|
-
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");
|
|
116
|
-
}
|
|
117
|
-
function hashReplayContextValue(value) {
|
|
118
|
-
const normalized = value?.trim();
|
|
119
|
-
return normalized ? shortHash(normalized) : void 0;
|
|
120
|
-
}
|
|
121
|
-
function buildProviderReplayContext(model, options) {
|
|
122
|
-
return {
|
|
123
|
-
provider: model.provider,
|
|
124
|
-
api: model.api,
|
|
125
|
-
model: model.id,
|
|
126
|
-
baseUrlHash: hashReplayContextValue(model.baseUrl),
|
|
127
|
-
sessionHash: hashReplayContextValue(options?.sessionId),
|
|
128
|
-
authProfileHash: hashReplayContextValue(options?.authProfileId)
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
function providerReplayContextMatches(state, context) {
|
|
132
|
-
return state.provider === context.provider && state.api === context.api && state.model === context.model && state.baseUrlHash === context.baseUrlHash && state.sessionHash === context.sessionHash && state.authProfileHash === context.authProfileHash;
|
|
133
|
-
}
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region packages/ai/src/utils/text-signature.ts
|
|
136
|
-
function encodeTextSignatureV1(id, phase) {
|
|
137
|
-
return JSON.stringify({
|
|
138
|
-
v: 1,
|
|
139
|
-
id,
|
|
140
|
-
...phase ? { phase } : {}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
export { MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE as a, readResponseTextSnippet as c, streamFragmentError as d, supportsModelTools as f, providerReplayContextMatches as i, redactSensitiveText as l, buildProviderReplayContext as n, estimateStringChars as o, consumeResponseBytes as p, isProviderReplayContext as r, isCodeModeModelVisibleToolName as s, encodeTextSignatureV1 as t, resolveModelHeaderSentinels as u };
|
|
112
|
+
export { redactSensitiveText as a, supportsModelTools as c, readResponseTextSnippet as i, consumeResponseBytes as l, estimateStringChars as n, resolveModelHeaderSentinels as o, isCodeModeModelVisibleToolName as r, streamFragmentError as s, MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE as t };
|
package/dist/transports.d.mts
CHANGED
|
@@ -45,7 +45,7 @@ export declare function createDeepSeekTextFilter(): {
|
|
|
45
45
|
};
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region packages/ai/src/transports/google-thinking-level.d.ts
|
|
48
|
-
/**
|
|
48
|
+
/** Reports MINIMAL support for Gemini Flash and Gemini 4 models. */
|
|
49
49
|
export declare function googleFlashSupportsMinimalThinking(modelId: string): boolean;
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region packages/ai/src/transports/json-unsafe-integers.d.ts
|
|
@@ -142,6 +142,7 @@ export type MutableAssistantOutput = Omit<AssistantMessage, "content" | "usage">
|
|
|
142
142
|
reasoningTokens?: number;
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
|
+
export declare function detachPartialSnapshot<TEvent>(event: TEvent): TEvent;
|
|
145
146
|
export declare function parseOpenAICompletionsUsage(rawUsage: NonNullable<ChatCompletionChunk["usage"]> & {
|
|
146
147
|
cost?: unknown;
|
|
147
148
|
cache_creation_input_tokens?: number;
|
package/dist/transports.mjs
CHANGED
|
@@ -5,19 +5,19 @@ import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeI
|
|
|
5
5
|
import { i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-DlKMMTxK.mjs";
|
|
6
6
|
import { o as redactDiagnosticText, s as truncateUtf16Safe } from "./provider-error-CF9GWCs2.mjs";
|
|
7
7
|
import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl, y as toErrorObject } from "./diagnostics-tQasYct1.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { i as readResponseTextSnippet, o as resolveModelHeaderSentinels, r as isCodeModeModelVisibleToolName, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-34BQoXq3.mjs";
|
|
9
9
|
import { a as resolveOpenAIPromptCacheKeySupport, i as resolveOpenAICompletionsCompat, n as isNativeOpenAIEndpoint, o as usesNativeOpenAICodexResponsesBackend, r as isOpenAICodexResponsesModel, t as detectOpenAICompletionsCompat } from "./openai-completions-compat-CYX18uDk.mjs";
|
|
10
10
|
import { t as buildGuardedModelFetch } from "./host-policy-BzZluO6_.mjs";
|
|
11
|
-
import { A as applyAnthropicPayloadPolicyToParams, B as resolveAnthropicServerCompactionPlan, D as suppressAnthropicCompaction, E as resolveNewestAnthropicCompaction, F as logAnthropicContextEdits, I as resolveAnthropicCacheOptions, J as isAnthropicOAuthApiKey, L as resolveAnthropicEphemeralCacheControl, M as buildAnthropicSystemBlocks, N as isAnthropicServerToolClearingEnabled, O as applyAnthropicContextManagementToRequest, P as isDirectAnthropicModel, R as resolveAnthropicPayloadPolicy, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, f as resolveAnthropicTransportOptions, j as applyAnthropicRequestCacheControl, k as applyAnthropicEphemeralCacheControlMarkers, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as resolveAnthropicRequestBetaHeader } from "./anthropic-stream-reducer-
|
|
11
|
+
import { A as applyAnthropicPayloadPolicyToParams, B as resolveAnthropicServerCompactionPlan, D as suppressAnthropicCompaction, E as resolveNewestAnthropicCompaction, F as logAnthropicContextEdits, I as resolveAnthropicCacheOptions, J as isAnthropicOAuthApiKey, L as resolveAnthropicEphemeralCacheControl, M as buildAnthropicSystemBlocks, N as isAnthropicServerToolClearingEnabled, O as applyAnthropicContextManagementToRequest, P as isDirectAnthropicModel, R as resolveAnthropicPayloadPolicy, T as isAnthropicReplayRejection, V as supportsAnthropicServerSideFallback, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, f as resolveAnthropicTransportOptions, j as applyAnthropicRequestCacheControl, k as applyAnthropicEphemeralCacheControlMarkers, l as buildAnthropicRequest, p as resolveCompletionTokenReservation, t as consumeAnthropicStream, u as prepareAnthropicRequest, z as resolveAnthropicRequestBetaHeader } from "./anthropic-stream-reducer-DfMVFm-r.mjs";
|
|
12
12
|
import { C as parseJsonObjectPreservingUnsafeIntegers, S as withProviderResponseHook, T as quoteUnsafeIntegerLiterals, _ as sanitizeNonEmptyTransportPayloadText, a as createEmptyTransportUsage, b as transportAbortError, c as failTransportStream, d as iterateModelStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, i as copyProviderAcceptanceObserver, 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-CWGOuLcA.mjs";
|
|
13
13
|
import { D as sortPromptCacheToolsByName } from "./simple-options-BAu4B54D.mjs";
|
|
14
|
-
import { At as
|
|
14
|
+
import { At as log, Dt as createResponseModelTracker, Et as createOpenAIResponseHook, Ft as resolveOpenAIClientBaseUrl, It as resolvePromptCacheKey, J as OPENAI_RESPONSES_ID_MAX_LENGTH, K as OPENAI_RESPONSES_CALL_ID_RE, L as resolveReplayableResponsesMessageId, M as resolveResponsesContextUsageBoundary, Mt as parseOpenAICompletionsUsage, Nt as readOpenAICompletionsContentDeltas, Ot as detachPartialSnapshot, Pt as readOpenAICompletionsReasoningBatch, Tt as createOpenAIProviderAcceptanceHook, X as shouldNormalizeOpenAIResponsesToolCallId, Y as normalizeOpenAIResponsesFunctionCallId, Z as splitOpenAIFunctionCallPairing, ct as buildOpenAISdkClientOptions, dt as filterCodeModePayloadTools, ft as getCompat, ht as resolveOpenAIStrictToolFlagWithDiagnostics, it as resolveNewestOpenAIResponsesCompactionReplay, jt as measureUtf8AppendBytes, kt as isOpenAICompletionsThinkingEnabled, lt as buildOpenAISdkRequestOptions, mt as resolveCodeModeResponsesVisibleToolNames, ot as assertCodeModeResponsesToolSurface, pt as readCodeModePayloadToolName, q as OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, rt as captureOpenAIResponsesCompaction, st as buildOpenAIClientHeaders, tt as CompactionReplayRefreshRequiredError, ut as enforceCodeModeResponsesToolSurface, vt as resolveOpenAIReasoningEffortMap, wt as GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP } from "./openai-responses-shared-afo9-s16.mjs";
|
|
15
15
|
import { n as getEnvApiKey } from "./env-api-keys-CrxwdylR.mjs";
|
|
16
16
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
17
17
|
import { t as createAssistantOutput } from "./assistant-output-BuhRpLeD.mjs";
|
|
18
18
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
19
|
-
import { a as requestPreparedOpenAIResponsesCompaction, d as applyCompletionsAnthropicCacheControl, f as hasOpenAICompatibleConversationTurn, h as createDeepSeekTextFilter, i as createOpenAIResponsesTransportStreamFn, l as flattenCompletionMessagesToStringContent, m as resolveMaxTokensParam, p as canonicalizeMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, s as buildOpenAICompletionsParams, t as createOpenAICompletionsTransportStreamFn, u as stripCompletionMessagesToRoleContent } from "./openai-completions-transport-
|
|
20
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
19
|
+
import { a as requestPreparedOpenAIResponsesCompaction, d as applyCompletionsAnthropicCacheControl, f as hasOpenAICompatibleConversationTurn, h as createDeepSeekTextFilter, i as createOpenAIResponsesTransportStreamFn, l as flattenCompletionMessagesToStringContent, m as resolveMaxTokensParam, p as canonicalizeMaxTokensParam, r as createAzureOpenAIResponsesTransportStreamFn, s as buildOpenAICompletionsParams, t as createOpenAICompletionsTransportStreamFn, u as stripCompletionMessagesToRoleContent } from "./openai-completions-transport-DuXQOxrH.mjs";
|
|
20
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-CNbUJK5E.mjs";
|
|
21
21
|
import { c as resolveOpenAIResponsesCompactEndpointPlan, l as resolveOpenAIResponsesPayloadPolicy, o as sanitizeResponsesImagePayload, s as applyOpenAIResponsesPayloadPolicy, u as resolveOpenAIResponsesServerCompactionPlan } from "./openai-responses-endpoint-CinGh4VZ.mjs";
|
|
22
22
|
import { randomUUID } from "node:crypto";
|
|
23
23
|
//#region packages/ai/src/transports/anthropic-transport-stream.ts
|
|
@@ -704,4 +704,4 @@ function prepareModelForSimpleCompletion(params) {
|
|
|
704
704
|
return wrap(model);
|
|
705
705
|
}
|
|
706
706
|
//#endregion
|
|
707
|
-
export { CompactionReplayRefreshRequiredError, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, IncompleteToolCallError, MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, OPENAI_RESPONSES_CALL_ID_RE, OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, OPENAI_RESPONSES_ID_MAX_LENGTH, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyCompletionsAnthropicCacheControl, applyOpenAIResponsesPayloadPolicy, assertCodeModeResponsesToolSurface, assignTransportErrorDetails, buildAnthropicSystemBlocks, buildOpenAIClientHeaders, buildOpenAICompletionsParams, buildOpenAISdkClientOptions, buildOpenAISdkRequestOptions, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, createTransportAwareStreamFnForModel, canonicalizeMaxTokensParam, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, consumeGoogleGenerateContentStream, convertGoogleTools, copyProviderAcceptanceObserver, createAnthropicMessagesTransportStreamFn, createAzureOpenAIResponsesTransportStreamFn, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createDeepSeekTextFilter, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createOpenAICompletionsTransportStreamFn, createOpenAIProviderAcceptanceHook, createOpenAIResponseHook, createOpenAIResponsesTransportStreamFn, createResponseModelTracker, createWritableTransportEventStream, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, enforceCodeModeResponsesToolSurface, failTransportStream, filterCodeModePayloadTools, finalizeTerminalToolCallArguments, finalizeTransportStream, flattenCompletionMessagesToStringContent, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, getCompat, googleFlashSupportsMinimalThinking, hasOpenAICompatibleConversationTurn, isAnthropicServerToolClearingEnabled, isCodeModeModelVisibleToolName, isCompactionReplayCheckpoint, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, isOpenAICompletionsThinkingEnabled, iterateModelStream, log, logAnthropicContextEdits, measureUtf8AppendBytes, mergeTransportHeaders, normalizeCodexResponsesBaseUrlForOpenAISdk, normalizeOpenAIResponsesFunctionCallId, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseJsonObjectPreservingUnsafeIntegers, parseJsonPreservingUnsafeIntegers, parseOpenAICompletionsUsage, parseTerminalToolCallArguments, prepareHeadersForSimpleCompletion, prepareModelForSimpleCompletion, prepareTransportAwareSimpleModel, preserveCompactionReplayWindow, projectGoogleMessages, quoteUnsafeIntegerLiterals, readCodeModePayloadToolName, readOpenAICompletionsContentDeltas, readOpenAICompletionsReasoningBatch, replaceCompactionReplayOwnerContent, requestPreparedOpenAIResponsesCompaction, requiresCompactionReplayRefresh, requiresGoogleToolCallId, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicMessagesUrl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveCodeModeResponsesVisibleToolNames, resolveCompactionReplayEligibility, resolveCompactionReplayPressure, resolveCompletionTokenReservation, resolveMaxTokensParam, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAIClientBaseUrl, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIReasoningEffortMap, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, resolveOpenAIStrictToolFlagWithDiagnostics, resolvePromptCacheKey, resolveReplayableResponsesMessageId, resolveTransportAwareSimpleApi, sanitizeNonEmptyTransportPayloadText, sanitizeResponsesImagePayload, sanitizeTransportPayloadText, shouldNormalizeOpenAIResponsesToolCallId, sortPromptCacheToolsByName as sortTransportToolsByName, splitOpenAIFunctionCallPairing, stripCompactionReplayCheckpoint, stripCompactionReplayCheckpointInPlace, stripCompletionMessagesToRoleContent, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withProviderAcceptanceObserver, withProviderResponseHook };
|
|
707
|
+
export { CompactionReplayRefreshRequiredError, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, IncompleteToolCallError, MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE, OPENAI_RESPONSES_CALL_ID_RE, OPENAI_RESPONSES_FUNCTION_CALL_ITEM_ID_RE, OPENAI_RESPONSES_ID_MAX_LENGTH, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyCompletionsAnthropicCacheControl, applyOpenAIResponsesPayloadPolicy, assertCodeModeResponsesToolSurface, assignTransportErrorDetails, buildAnthropicSystemBlocks, buildOpenAIClientHeaders, buildOpenAICompletionsParams, buildOpenAISdkClientOptions, buildOpenAISdkRequestOptions, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, createTransportAwareStreamFnForModel, canonicalizeMaxTokensParam, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, consumeGoogleGenerateContentStream, convertGoogleTools, copyProviderAcceptanceObserver, createAnthropicMessagesTransportStreamFn, createAzureOpenAIResponsesTransportStreamFn, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createDeepSeekTextFilter, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createOpenAICompletionsTransportStreamFn, createOpenAIProviderAcceptanceHook, createOpenAIResponseHook, createOpenAIResponsesTransportStreamFn, createResponseModelTracker, createWritableTransportEventStream, detachPartialSnapshot, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, enforceCodeModeResponsesToolSurface, failTransportStream, filterCodeModePayloadTools, finalizeTerminalToolCallArguments, finalizeTransportStream, flattenCompletionMessagesToStringContent, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, getCompat, googleFlashSupportsMinimalThinking, hasOpenAICompatibleConversationTurn, isAnthropicServerToolClearingEnabled, isCodeModeModelVisibleToolName, isCompactionReplayCheckpoint, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, isOpenAICompletionsThinkingEnabled, iterateModelStream, log, logAnthropicContextEdits, measureUtf8AppendBytes, mergeTransportHeaders, normalizeCodexResponsesBaseUrlForOpenAISdk, normalizeOpenAIResponsesFunctionCallId, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseJsonObjectPreservingUnsafeIntegers, parseJsonPreservingUnsafeIntegers, parseOpenAICompletionsUsage, parseTerminalToolCallArguments, prepareHeadersForSimpleCompletion, prepareModelForSimpleCompletion, prepareTransportAwareSimpleModel, preserveCompactionReplayWindow, projectGoogleMessages, quoteUnsafeIntegerLiterals, readCodeModePayloadToolName, readOpenAICompletionsContentDeltas, readOpenAICompletionsReasoningBatch, replaceCompactionReplayOwnerContent, requestPreparedOpenAIResponsesCompaction, requiresCompactionReplayRefresh, requiresGoogleToolCallId, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicMessagesUrl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveCodeModeResponsesVisibleToolNames, resolveCompactionReplayEligibility, resolveCompactionReplayPressure, resolveCompletionTokenReservation, resolveMaxTokensParam, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAIClientBaseUrl, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIReasoningEffortMap, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, resolveOpenAIStrictToolFlagWithDiagnostics, resolvePromptCacheKey, resolveReplayableResponsesMessageId, resolveTransportAwareSimpleApi, sanitizeNonEmptyTransportPayloadText, sanitizeResponsesImagePayload, sanitizeTransportPayloadText, shouldNormalizeOpenAIResponsesToolCallId, sortPromptCacheToolsByName as sortTransportToolsByName, splitOpenAIFunctionCallPairing, stripCompactionReplayCheckpoint, stripCompactionReplayCheckpointInPlace, stripCompletionMessagesToRoleContent, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withProviderAcceptanceObserver, withProviderResponseHook };
|