@openclaw/ai 2026.10.10 → 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-B54Ts1tV.mjs → anthropic-CUVqVXTe.mjs} +6 -6
- package/dist/{anthropic-stream-reducer-C__ByTq1.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-DbgdWAhJ.mjs → assistant-output-BnQm3fov.mjs} +3 -3
- package/dist/{azure-openai-responses-DHzTwi-y.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-CZ6uGVkV.mjs → google-Cpi_cLKZ.mjs} +2 -2
- package/dist/{google-interactions-qd4flmND.mjs → google-interactions-BYRQ49MR.mjs} +91 -30
- package/dist/{google-messages-B-svbJuN.mjs → google-messages-DQMgG5yG.mjs} +9 -3
- package/dist/{google-provider-stream-DlhaCvCf.mjs → google-provider-stream-BHd0cST9.mjs} +16 -11
- package/dist/{google-shared-Cif7nve-.mjs → google-shared-vtag8bj5.mjs} +6 -5
- package/dist/{google-vertex-BZTcYnWU.mjs → google-vertex-eKoUnW7N.mjs} +2 -2
- package/dist/google-video-slots-D8tPH8wX.mjs +29 -0
- 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.d.mts +2 -2
- package/dist/internal/anthropic.mjs +5 -5
- 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/retry-after.d.mts +2 -2
- package/dist/internal/retry-after.mjs +75 -1
- 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-C_ImzxlK.mjs → mistral-CQ7aoWg2.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-iGYDPbmc.mjs → openai-chatgpt-responses-DgDVhpUI.mjs} +12 -12
- package/dist/{openai-completions-CDy5u1mv.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-DLrm5EWi.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-Cp2QPq7K.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-DuMpdA6y.mjs → openai-responses-request-lifecycle-WKXjj_th.mjs} +7 -7
- package/dist/{openai-responses-shared-CNfHudFg.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-B11rmZpv.mjs → provider-transport-turn-state-BbaD56A1.mjs} +2 -2
- package/dist/{provider-types-ODq57rG_.d.mts → provider-types-CWl4VXvE.d.mts} +3 -1
- package/dist/provider-types.d.mts +2 -2
- package/dist/provider-types.mjs +2 -1
- package/dist/providers.mjs +10 -10
- package/dist/retry-after-BrmTv0jL.d.mts +25 -0
- 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.d.mts +11 -2
- package/dist/transports.mjs +16 -15
- package/package.json +1 -1
- package/dist/retry-after-sw-XX8aC.d.mts +0 -15
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-CBvb2eld.mjs";
|
|
2
|
+
//#region packages/ai/src/transports/openai-completions-reasoning-replay.d.ts
|
|
3
|
+
/** Shared by history sanitization and wire replay, including stale model metadata. */
|
|
4
|
+
export declare function requiresReasoningContentReplay(modelId: unknown): boolean;
|
|
5
|
+
//#endregion
|
|
2
6
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
2
|
-
|
|
1
|
+
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-bNQXF1y9.mjs";
|
|
2
|
+
import { t as requiresReasoningContentReplay } from "../openai-completions-reasoning-replay-BwT1xwRI.mjs";
|
|
3
|
+
export { requiresReasoningContentReplay, resolveOpenAICompletionsCompat };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import { d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-B5mGAbR6.mjs";
|
|
2
|
+
import { d as resolveOpenAIResponsesPayloadPolicy, f as resolveOpenAIResponsesRequestContextTokens, l as normalizeOpenAIServiceTier, n as supportsNativeOpenAIResponsesEndpoint, o as readOpenAIResponsesCompactionWindow, p as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-CfKR6N5f.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, normalizeOpenAIServiceTier, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesRequestContextTokens, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as supportsOpenAIReasoningEffort, C as isOpenAIGpt56Model, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, O as resolveOpenAIReasoningEffortMapping, S as isOpenAIGpt55Model, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, b as applyOpenAICompletionsToolReasoning, g as responsesPromptObserver, j as supportsOpenAITemperature, k as resolveOpenAISupportedReasoningEfforts, w as isOpenAIGpt6Model, x as isOpenAIGpt54MiniModel } from "../openai-responses-contracts-
|
|
2
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as encodedModelRequestBodyStream, g as reasoningTagTextPolicy, m as codeModeToolSurfaceObserver, o as modelRequestBodyState } from "../simple-options-
|
|
5
|
-
import { a as hasResponsesWebSearchTool, s as convertMessages } from "../openai-completions-transport-
|
|
6
|
-
import { Ct as reconcileOpenAIResponsesToolChoice, N as bindResponsesInputMessage, St as reconcileOpenAICompletionsToolChoice, _ as isResponsesTextContentPartType, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as projectOpenAITools, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-
|
|
1
|
+
import { A as supportsOpenAIReasoningEffort, C as isOpenAIGpt56Model, D as resolveOpenAIReasoningEffortForModel, E as resolveOpenAIModelReasoningEfforts, O as resolveOpenAIReasoningEffortMapping, S as isOpenAIGpt55Model, T as normalizeOpenAIReasoningEffort, _ as responsesServiceTierObserver, b as applyOpenAICompletionsToolReasoning, g as responsesPromptObserver, j as supportsOpenAITemperature, k as resolveOpenAISupportedReasoningEfforts, w as isOpenAIGpt6Model, x as isOpenAIGpt54MiniModel } from "../openai-responses-contracts-B5mGAbR6.mjs";
|
|
2
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-B9AvdoEo.mjs";
|
|
3
|
+
import { _ as mapResponsesTerminalUsage, g as isResponsesOutputLimitToolCallError, v as readResponsesReasoningTokens, y as resolveResponsesTerminalStopReason } from "../diagnostics-v7oVEW59.mjs";
|
|
4
|
+
import { a as encodedModelRequestBodyStream, g as reasoningTagTextPolicy, m as codeModeToolSurfaceObserver, o as modelRequestBodyState } from "../simple-options-xJkqrG_E.mjs";
|
|
5
|
+
import { a as hasResponsesWebSearchTool, s as convertMessages } from "../openai-completions-transport-CnFaKYO-.mjs";
|
|
6
|
+
import { Ct as reconcileOpenAIResponsesToolChoice, N as bindResponsesInputMessage, St as reconcileOpenAICompletionsToolChoice, _ as isResponsesTextContentPartType, d as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, f as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, g as isAzureResponsesTextDeltaEventType, h as isAzureResponsesTextDeltaEvent, l as createResponsesToolCallTracker, m as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, p as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, u as readResponsesToolCallItemIdentity, v as isResponsesTextDeltaEventType, xt as projectOpenAITools, y as resolveResponsesMessageSnapshotCollapse } from "../openai-responses-shared-iWBHb0Sq.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
|
-
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
9
|
+
import { n as responsesRequestLifecycle, t as independentResponsesRequest } from "../openai-responses-request-lifecycle-WKXjj_th.mjs";
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-BdfBhFjx.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-5KI4v8DN.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, applyOpenAICompletionsToolReasoning, bindResponsesInputMessage, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, encodedModelRequestBodyStream, hasResponsesWebSearchTool, independentResponsesRequest, 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, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
export { parseHttpDateInstant, parseRetryAfterErrorSeconds, parseRetryAfterHeadersSeconds, parseRetryAfterHttpDateMs };
|
|
1
|
+
import { a as parseRetryAfterHeadersSeconds, i as parseRetryAfterErrorSeconds, n as parseGoogleRetryDelaySeconds, o as parseRetryAfterHttpDateMs, r as parseHttpDateInstant, s as parseRetryAfterTextSeconds, t as RETRY_AFTER_TEXT_RE } from "../retry-after-BrmTv0jL.mjs";
|
|
2
|
+
export { RETRY_AFTER_TEXT_RE, parseGoogleRetryDelaySeconds, parseHttpDateInstant, parseRetryAfterErrorSeconds, parseRetryAfterHeadersSeconds, parseRetryAfterHttpDateMs, parseRetryAfterTextSeconds };
|
|
@@ -110,6 +110,80 @@ function parseRetryAfterErrorSeconds(error, nowMs = Date.now()) {
|
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
+
function maxDefined(...values) {
|
|
114
|
+
let floor;
|
|
115
|
+
for (const value of values) if (value !== void 0) floor = Math.max(floor ?? 0, value);
|
|
116
|
+
return floor;
|
|
117
|
+
}
|
|
118
|
+
/** Provider prose such as "Please try again in 6s", "retry in 32s" or "Retry-After: 7". */
|
|
119
|
+
const RETRY_AFTER_TEXT_RE = /\b(?:retry[- ]after\b\s*:?\s*(?:in\b\s*)?|(?:please\s+)?(?:try again|retry) in\s+)([^\r\n;]+)/i;
|
|
120
|
+
const RETRY_TEXT_NUMBER_RE = /^(\d+(?:\.\d+)?|Infinity)\s*([a-z]+)?\b/i;
|
|
121
|
+
const MS_PER_SECOND = 1e3;
|
|
122
|
+
const RETRY_TEXT_UNIT_MS = new Map([
|
|
123
|
+
["milliseconds millisecond msecs msec ms", 1],
|
|
124
|
+
["seconds second secs sec s", MS_PER_SECOND],
|
|
125
|
+
["minutes minute mins min m", 60 * MS_PER_SECOND],
|
|
126
|
+
["hours hour hrs hr h", 3600 * MS_PER_SECOND],
|
|
127
|
+
["days day d", 86400 * MS_PER_SECOND]
|
|
128
|
+
].flatMap(([aliases, milliseconds]) => aliases.split(" ").map((alias) => [alias, milliseconds])));
|
|
129
|
+
/** Seconds named by a captured retry-text value: a number with an optional time unit, or an HTTP-date. */
|
|
130
|
+
function parseRetryAfterTextSeconds(valueText, nowMs = Date.now()) {
|
|
131
|
+
const secondsMatch = RETRY_TEXT_NUMBER_RE.exec(valueText);
|
|
132
|
+
if (secondsMatch?.[1]) {
|
|
133
|
+
const value = /^infinity$/i.test(secondsMatch[1]) ? Infinity : Number(secondsMatch[1]);
|
|
134
|
+
if (Number.isNaN(value) || value < 0) return;
|
|
135
|
+
const unitMilliseconds = RETRY_TEXT_UNIT_MS.get(secondsMatch[2]?.toLowerCase() ?? "s");
|
|
136
|
+
if (unitMilliseconds === void 0) return;
|
|
137
|
+
return unitMilliseconds === 1 ? value / MS_PER_SECOND : value * (unitMilliseconds / MS_PER_SECOND);
|
|
138
|
+
}
|
|
139
|
+
const retryAtMs = parseRetryAfterHttpDateMs(valueText, nowMs);
|
|
140
|
+
return retryAtMs === void 0 ? void 0 : Math.max(0, (retryAtMs - nowMs) / MS_PER_SECOND);
|
|
141
|
+
}
|
|
142
|
+
const GOOGLE_RETRY_DELAY_TEXT_RE = /"retryDelay"\s*:\s*"(\d+(?:\.\d{1,9})?)s"/g;
|
|
143
|
+
const GOOGLE_RETRY_DELAY_VALUE_RE = /^(\d+(?:\.\d{1,9})?)s$/;
|
|
144
|
+
const GOOGLE_RETRY_INFO_TYPE = "type.googleapis.com/google.rpc.RetryInfo";
|
|
145
|
+
const MAX_GOOGLE_ERROR_DETAILS = 16;
|
|
146
|
+
function googleRetryDelayTextSeconds(text) {
|
|
147
|
+
let floor;
|
|
148
|
+
for (const match of text.matchAll(GOOGLE_RETRY_DELAY_TEXT_RE)) floor = maxDefined(floor, Number(match[1]));
|
|
149
|
+
return floor;
|
|
150
|
+
}
|
|
151
|
+
function googleStatusRetryDelaySeconds(status) {
|
|
152
|
+
if (typeof status === "string") return googleRetryDelayTextSeconds(status);
|
|
153
|
+
const details = ownDataValue(status, "details");
|
|
154
|
+
if (!Array.isArray(details)) return;
|
|
155
|
+
let floor;
|
|
156
|
+
for (let index = 0; index < Math.min(details.length, MAX_GOOGLE_ERROR_DETAILS); index += 1) {
|
|
157
|
+
const detail = ownDataValue(details, String(index));
|
|
158
|
+
if (ownDataValue(detail, "@type") !== GOOGLE_RETRY_INFO_TYPE) continue;
|
|
159
|
+
const delay = ownDataValue(detail, "retryDelay");
|
|
160
|
+
const match = typeof delay === "string" ? GOOGLE_RETRY_DELAY_VALUE_RE.exec(delay) : null;
|
|
161
|
+
floor = maxDefined(floor, match?.[1] ? Number(match[1]) : void 0);
|
|
162
|
+
}
|
|
163
|
+
return floor;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Reads google.rpc.RetryInfo delays from raw error text or a google.rpc.Status-shaped body
|
|
167
|
+
* in any key order, with a fixed number of descriptor reads and no getters. Pass the
|
|
168
|
+
* untruncated body: Gemini puts RetryInfo after its QuotaFailure details.
|
|
169
|
+
*/
|
|
170
|
+
function parseGoogleRetryDelaySeconds(value) {
|
|
171
|
+
try {
|
|
172
|
+
if (typeof value === "string") return googleRetryDelayTextSeconds(value);
|
|
173
|
+
const response = ownDataValue(value, "response");
|
|
174
|
+
return maxDefined(...[
|
|
175
|
+
value,
|
|
176
|
+
ownDataValue(value, "error"),
|
|
177
|
+
ownDataValue(value, "message"),
|
|
178
|
+
ownDataValue(value, "errorBody"),
|
|
179
|
+
ownDataValue(value, "body"),
|
|
180
|
+
ownDataValue(response, "body"),
|
|
181
|
+
ownDataValue(response, "data")
|
|
182
|
+
].flatMap((candidate) => [googleStatusRetryDelaySeconds(candidate), typeof candidate === "string" ? void 0 : googleStatusRetryDelaySeconds(ownDataValue(candidate, "error"))]));
|
|
183
|
+
} catch {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
113
187
|
/** Round leap seconds forward for Retry-After so an unrepresentable instant cannot retry early. */
|
|
114
188
|
function parseRetryAfterHttpDateMs(value, nowMs = Date.now()) {
|
|
115
189
|
return parseHttpDateInstant(value, nowMs)?.timestampMs;
|
|
@@ -172,4 +246,4 @@ function parseHttpDateCalendarMs(components) {
|
|
|
172
246
|
return seconds === 60 ? timestamp + 1e3 : timestamp;
|
|
173
247
|
}
|
|
174
248
|
//#endregion
|
|
175
|
-
export { parseHttpDateInstant, parseRetryAfterErrorSeconds, parseRetryAfterHeadersSeconds, parseRetryAfterHttpDateMs };
|
|
249
|
+
export { RETRY_AFTER_TEXT_RE, parseGoogleRetryDelaySeconds, parseHttpDateInstant, parseRetryAfterErrorSeconds, parseRetryAfterHeadersSeconds, parseRetryAfterHttpDateMs, parseRetryAfterTextSeconds };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
2
|
import { o as getEventStreamCompletion } from "../event-stream-X2gmsUWv.mjs";
|
|
3
|
-
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-
|
|
4
|
-
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-
|
|
3
|
+
import { r as createApiRegistry, t as createLlmRuntime } from "../stream-C4YDqhFj.mjs";
|
|
4
|
+
import { A as getSupportedThinkingLevels, D as applyProviderReportedUsageCost, E as headersToRecord, O as calculateCost, j as modelsAreEqual, k as clampThinkingLevel } from "../host-CWt55nnF.mjs";
|
|
5
5
|
import { n as getSessionResourceOwnerId, r as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-vKvGIE3J.mjs";
|
|
6
6
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
7
|
-
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-
|
|
7
|
+
import { A as shortHash, D as parseJsonWithRepair, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, g as parseTerminalToolCallArguments, k as repairJson } from "../transport-stream-shared-lhgkTOz3.mjs";
|
|
8
8
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-Xd8dm_aV.mjs";
|
|
9
9
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
10
10
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-CfMuh5cC.mjs";
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { s as readAssistantThinkingAppend } from "../event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { M as hasMediaPayload, N as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-
|
|
2
|
+
import { M as hasMediaPayload, N as isImageWithMediaPayload, c as transformMessages, d as hasOnlyAssistantReasoningContent, f as isReasoningOnlyLengthAssistantTurn, l as FAILED_ASSISTANT_REPLAY_TEXT, m as resolveFailedAssistantReplay, p as isStreamErrorFallbackContent, u as STREAM_ERROR_FALLBACK_TEXT } from "../host-CWt55nnF.mjs";
|
|
3
3
|
import { i as isCredentialFieldName, n as projectProviderError, r as createDiagnosticRecord } from "../provider-error-qtZD2inE.mjs";
|
|
4
4
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-CRGuMONI.mjs";
|
|
5
5
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-D_MeCQFI.mjs";
|
|
6
|
-
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, _ as SYSTEM_PROMPT_CACHE_BOUNDARY, b as ensureSystemPromptCacheBoundary, c as serializeModelRequestBody, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, i as clampReasoning, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as describeUnsupportedToolResultMedia, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, w as stripSystemPromptCacheBoundary, x as prependSystemPromptAdditionAfterCacheBoundary, y as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END } from "../simple-options-
|
|
6
|
+
import { C as splitSystemPromptRelocatableBoundary, S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, _ as SYSTEM_PROMPT_CACHE_BOUNDARY, b as ensureSystemPromptCacheBoundary, c as serializeModelRequestBody, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, i as clampReasoning, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as describeUnsupportedToolResultMedia, v as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, w as stripSystemPromptCacheBoundary, x as prependSystemPromptAdditionAfterCacheBoundary, y as SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END } from "../simple-options-xJkqrG_E.mjs";
|
|
7
7
|
import { t as projectCopilotRequestFacts } from "../github-copilot-request-facts-F-EmvkpW.mjs";
|
|
8
8
|
import { n as matchesContextOverflowMessage } from "../overflow-OF3PgPbw.mjs";
|
|
9
9
|
//#region packages/ai/src/utils/tls-certificate-errors.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, m as truncateToolSchemaDepth, p as toolSchemaChildPosition, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, u as MAX_TOOL_SCHEMA_DEPTH, v as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-
|
|
2
|
-
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-
|
|
3
|
-
import { _ as findLlamacppGbnfSchemaViolations, a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as cleanSchemaForLlamacppGbnf, h as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as stripUnsupportedSchemaKeywords, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, y as cleanSchemaForGemini } from "../openai-tool-schema-
|
|
1
|
+
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, f as reportToolSchemaTruncation, h as wasToolSchemaTruncated, i as publishRuntimeToolInputSchema, m as truncateToolSchemaDepth, p as toolSchemaChildPosition, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, u as MAX_TOOL_SCHEMA_DEPTH, v as SCHEMA_NESTED_KEYS } from "../tool-schema-json-projection-B1sTYwfH.mjs";
|
|
2
|
+
import { r as prepareAnthropicInputSchema } from "../anthropic-tool-projection-DZOKfAmL.mjs";
|
|
3
|
+
import { _ as findLlamacppGbnfSchemaViolations, a as resolveOpenAIProjectedToolsStrictToolFlag, b as prepareOpenAIFunctionTool, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, g as cleanSchemaForLlamacppGbnf, h as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as stripUnsupportedSchemaKeywords, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, y as cleanSchemaForGemini } from "../openai-tool-schema-BTEU2xmN.mjs";
|
|
4
4
|
export { GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, MAX_TOOL_SCHEMA_DEPTH, SCHEMA_MAP_KEYS, SCHEMA_NESTED_KEYS, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, getPublishedRuntimeToolInputSchema, inheritToolSchemaTruncation, isStrictOpenAIJsonSchemaCompatible, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, prepareAnthropicInputSchema, prepareOpenAIFunctionTool, projectRuntimeToolInputSchema, publishRuntimeToolInputSchema, reportToolSchemaTruncation, resolveOpenAIProjectedToolsStrictToolFlag, resolveUnsupportedToolSchemaKeywords, shouldOmitEmptyArrayItems, stripUnsupportedSchemaKeywords, toolSchemaChildPosition, truncateToolSchemaDepth, wasToolSchemaTruncated };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost, k as clampThinkingLevel, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
3
3
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
4
4
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
5
|
-
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
6
|
-
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
7
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
5
|
+
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder, n as buildBaseOptions, p as formatToolResultText, r as clampMaxTokensToModel, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
6
|
+
import { A as shortHash, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, l as finalizeTerminalToolCallArguments, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
7
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
8
8
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
9
9
|
import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
|
|
10
10
|
import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
|
package/dist/{openai-chatgpt-responses-iGYDPbmc.mjs → openai-chatgpt-responses-DgDVhpUI.mjs}
RENAMED
|
@@ -2,22 +2,22 @@ import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as app
|
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
3
3
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { i as clampPositiveTimerTimeoutMs } from "./number-coercion-37gmNkuA.mjs";
|
|
5
|
-
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
6
|
-
import { g as responsesPromptObserver, j as supportsOpenAITemperature } from "./openai-responses-contracts-
|
|
5
|
+
import { E as headersToRecord, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
6
|
+
import { g as responsesPromptObserver, j as supportsOpenAITemperature } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
7
7
|
import { r as registerSessionResourceCleanup } from "./session-resources-vKvGIE3J.mjs";
|
|
8
8
|
import "./provider-error-qtZD2inE.mjs";
|
|
9
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
10
|
-
import {
|
|
11
|
-
import { l as consumeResponseBytes, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
9
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-B9AvdoEo.mjs";
|
|
10
|
+
import { b as extractErrorCodeOrErrno, s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, x as toErrorObject } from "./diagnostics-v7oVEW59.mjs";
|
|
11
|
+
import { l as consumeResponseBytes, s as streamFragmentError, t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DwOpuTjL.mjs";
|
|
12
12
|
import { parseRetryAfterHeadersSeconds } from "./internal/retry-after.mjs";
|
|
13
|
-
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-
|
|
14
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
15
|
-
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
16
|
-
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
17
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
18
|
-
import { Dt as createOpenAIResponseHook, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, F as convertProviderResponsesMessages, Ot as createResponseModelTracker, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, _t as resolveOpenAIRequestReasoning, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
13
|
+
import { c as resolveOpenAIResponsesTextFormat } from "./openai-completions-compat-bNQXF1y9.mjs";
|
|
14
|
+
import { n as buildManagedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
15
|
+
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
16
|
+
import { S as withProviderResponseHook, b as transportAbortError, h as notifyProviderStreamOpened, n as assignTransportErrorDetails } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
17
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
18
|
+
import { Dt as createOpenAIResponseHook, E as ResponsesStreamFailure, Et as createOpenAIProviderAcceptanceHook, F as convertProviderResponsesMessages, Ot as createResponseModelTracker, S as isInvalidEncryptedContentError, T as resolveNextResponsesEncryptedContentAttempt, _t as resolveOpenAIRequestReasoning, b as commitResponsesEncryptedContentAttempt, i as convertResponsesToolPayload, j as recordResponsesContextUsage, n as applyResponsesServiceTierPricing, o as readOpenAIMisalignmentReview, ot as suppressOpenAIResponsesCompaction, rt as buildOpenAIResponsesReasoningReplayMetadata, s as processResponsesStream, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
19
19
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-D_TfJHRJ.mjs";
|
|
20
|
-
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-
|
|
20
|
+
import { a as createResponsesV2CompactionCollector, i as createResponsesPromptEgressObserver, n as responsesRequestLifecycle, o as claimResponsesCompactRequest, r as withResponsesRequestAcceptance, s as copyResponsesCompactRequest, t as independentResponsesRequest } from "./openai-responses-request-lifecycle-WKXjj_th.mjs";
|
|
21
21
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
|
22
22
|
import { n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
23
23
|
//#region packages/ai/src/providers/openai-chatgpt-responses-events.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
|
-
import { k as clampThinkingLevel } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
4
|
-
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-
|
|
2
|
+
import { k as clampThinkingLevel } from "./host-CWt55nnF.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
|
|
4
|
+
import { n as streamOpenAICompletionsRequest, s as convertMessages } from "./openai-completions-transport-CnFaKYO-.mjs";
|
|
5
5
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
|
6
6
|
//#region packages/ai/src/providers/openai-completions.ts
|
|
7
7
|
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
package/dist/{openai-completions-compat-CJ0OXZgi.mjs → openai-completions-compat-bNQXF1y9.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
|
-
import { A as supportsOpenAIReasoningEffort, O as resolveOpenAIReasoningEffortMapping } from "./openai-responses-contracts-
|
|
3
|
-
import { a as resolveProviderRequestCapabilities } from "./host-policy-
|
|
2
|
+
import { A as supportsOpenAIReasoningEffort, O as resolveOpenAIReasoningEffortMapping } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
3
|
+
import { a as resolveProviderRequestCapabilities } from "./host-policy-Dm7PM6AD.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/openai-response-format.ts
|
|
5
5
|
const JSON_SCHEMA_RESPONSE_FORMAT_NAME = "openclaw_response";
|
|
6
6
|
const OLLAMA_CLOUD_ORIGIN = "https://ollama.com";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region packages/ai/src/transports/openai-completions-reasoning-replay.ts
|
|
2
|
+
const REASONING_CONTENT_REPLAY_MODEL_IDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"deepseek-v4-flash",
|
|
4
|
+
"deepseek-v4-pro",
|
|
5
|
+
"kimi-for-coding",
|
|
6
|
+
"kimi-k2.5",
|
|
7
|
+
"kimi-k2.6",
|
|
8
|
+
"kimi-k2.7-code",
|
|
9
|
+
"kimi-k2.7-code-highspeed",
|
|
10
|
+
"kimi-k3",
|
|
11
|
+
"kimi-k3.1-pro",
|
|
12
|
+
"kimi-k3.1-pro-highspeed",
|
|
13
|
+
"kimi-k2-thinking",
|
|
14
|
+
"kimi-k2-thinking-turbo",
|
|
15
|
+
"mimo-v2-pro",
|
|
16
|
+
"mimo-v2-omni",
|
|
17
|
+
"mimo-v2.5",
|
|
18
|
+
"mimo-v2.5-pro",
|
|
19
|
+
"mimo-v2.6-flash",
|
|
20
|
+
"mimo-v2.6-pro",
|
|
21
|
+
"mimo-v2.6-pro-ultraspeed"
|
|
22
|
+
]);
|
|
23
|
+
const REASONING_CONTENT_REPLAY_TIER_SUFFIXES = [
|
|
24
|
+
"-free",
|
|
25
|
+
"-paid",
|
|
26
|
+
"-trial"
|
|
27
|
+
];
|
|
28
|
+
function stripReasoningContentReplayTierSuffix(modelId) {
|
|
29
|
+
for (const suffix of REASONING_CONTENT_REPLAY_TIER_SUFFIXES) if (modelId.length > suffix.length && modelId.endsWith(suffix)) return modelId.slice(0, -suffix.length);
|
|
30
|
+
return modelId;
|
|
31
|
+
}
|
|
32
|
+
/** Shared by history sanitization and wire replay, including stale model metadata. */
|
|
33
|
+
function requiresReasoningContentReplay(modelId) {
|
|
34
|
+
if (typeof modelId !== "string") return false;
|
|
35
|
+
const normalized = modelId.trim().toLowerCase();
|
|
36
|
+
if (!normalized) return false;
|
|
37
|
+
const parts = normalized.split("/").filter(Boolean);
|
|
38
|
+
const finalPart = parts[parts.length - 1] ?? normalized;
|
|
39
|
+
const candidates = [finalPart];
|
|
40
|
+
const colonParts = finalPart.split(":").filter(Boolean);
|
|
41
|
+
if (colonParts.length > 1) candidates.push(colonParts[0] ?? "", colonParts[colonParts.length - 1] ?? "");
|
|
42
|
+
return candidates.some((candidate) => REASONING_CONTENT_REPLAY_MODEL_IDS.has(candidate) || REASONING_CONTENT_REPLAY_MODEL_IDS.has(stripReasoningContentReplayTierSuffix(candidate)));
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { requiresReasoningContentReplay as t };
|
package/dist/{openai-completions-transport-DLrm5EWi.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) {
|