@openclaw/ai 2026.11.1 → 2026.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-Do60LsIj.mjs → anthropic-CUVqVXTe.mjs} +6 -6
- package/dist/{anthropic-stream-reducer-UI5_Ta6I.mjs → anthropic-stream-reducer-yWDb5Cct.mjs} +8 -8
- package/dist/{anthropic-tool-projection-DA_KeluM.mjs → anthropic-tool-projection-DZOKfAmL.mjs} +1 -1
- package/dist/{assistant-output-BdFoDBYQ.mjs → assistant-output-BnQm3fov.mjs} +2 -2
- package/dist/{azure-openai-responses-DojP0OrF.mjs → azure-openai-responses-I97-HnAv.mjs} +4 -4
- package/dist/{diagnostics-Cv7cW3pS.mjs → diagnostics-v7oVEW59.mjs} +17 -1
- package/dist/diagnostics.mjs +1 -1
- package/dist/{google-D0QA9Xum.mjs → google-Cpi_cLKZ.mjs} +2 -2
- package/dist/{google-interactions-B7mZhG4e.mjs → google-interactions-BYRQ49MR.mjs} +8 -8
- package/dist/{google-messages-B-svbJuN.mjs → google-messages-DQMgG5yG.mjs} +9 -3
- package/dist/{google-provider-stream-C43bhKMi.mjs → google-provider-stream-BHd0cST9.mjs} +6 -6
- package/dist/{google-shared-B-jv5dQ9.mjs → google-shared-vtag8bj5.mjs} +5 -5
- package/dist/{google-vertex-sjKMbIUP.mjs → google-vertex-eKoUnW7N.mjs} +2 -2
- package/dist/{host-rCxf5Tjd.mjs → host-CWt55nnF.mjs} +12 -8
- package/dist/{host-policy-Ci1cKluf.mjs → host-policy-Dm7PM6AD.mjs} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-completions-compat.d.mts +4 -0
- package/dist/internal/openai-completions-compat.mjs +3 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.mjs +9 -9
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.mjs +2 -2
- package/dist/internal/tool-schema.mjs +3 -3
- package/dist/{mistral-CXSRuQbO.mjs → mistral-CQ7aoWg2.mjs} +4 -4
- package/dist/{openai-chatgpt-responses-C97WXCjm.mjs → openai-chatgpt-responses-DgDVhpUI.mjs} +12 -12
- package/dist/{openai-completions-BXUVMZXy.mjs → openai-completions-BdfBhFjx.mjs} +3 -3
- package/dist/{openai-completions-compat-CJ0OXZgi.mjs → openai-completions-compat-bNQXF1y9.mjs} +2 -2
- package/dist/openai-completions-reasoning-replay-BwT1xwRI.mjs +45 -0
- package/dist/{openai-completions-transport-BVV8L-MO.mjs → openai-completions-transport-CnFaKYO-.mjs} +21 -64
- package/dist/{openai-prompt-cache-h8vXRiaH.mjs → openai-prompt-cache-B9AvdoEo.mjs} +1 -1
- package/dist/{openai-responses-ytmKcG9V.mjs → openai-responses-5KI4v8DN.mjs} +6 -6
- package/dist/{openai-responses-contracts-DCG51Us0.mjs → openai-responses-contracts-B5mGAbR6.mjs} +1 -1
- package/dist/{openai-responses-endpoint-JbBT8IDv.mjs → openai-responses-endpoint-CfKR6N5f.mjs} +1 -1
- package/dist/{openai-responses-request-lifecycle-CsBFQkiW.mjs → openai-responses-request-lifecycle-WKXjj_th.mjs} +7 -7
- package/dist/{openai-responses-shared-CD3Sd1NC.mjs → openai-responses-shared-iWBHb0Sq.mjs} +48 -17
- package/dist/{openai-tool-schema-CGhEl7ao.mjs → openai-tool-schema-BTEU2xmN.mjs} +2 -2
- package/dist/{provider-replay-context-BC23HyZo.mjs → provider-replay-context-4vxI7p4V.mjs} +1 -1
- package/dist/{provider-transport-turn-state-Dm6Qh366.mjs → provider-transport-turn-state-BbaD56A1.mjs} +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{simple-options-BdJJbzZk.mjs → simple-options-xJkqrG_E.mjs} +3 -3
- package/dist/{stream-DQqGjhbq.mjs → stream-C4YDqhFj.mjs} +1 -1
- package/dist/{tool-schema-json-projection-Cvq69Ajp.mjs → tool-schema-json-projection-B1sTYwfH.mjs} +1 -1
- package/dist/{transport-stream-shared-DdnJGEj0.mjs → transport-stream-shared-lhgkTOz3.mjs} +2 -2
- package/dist/{transport-utils-CcCAuFVS.mjs → transport-utils-DwOpuTjL.mjs} +2 -2
- package/dist/transports.mjs +14 -14
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as __exportAll } from "./reasoning-tag-text-partitioner-DzlRubwU.mjs";
|
|
2
2
|
import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
4
|
-
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-
|
|
5
|
-
import { s as streamFragmentError } from "./transport-utils-
|
|
6
|
-
import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-
|
|
4
|
+
import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
5
|
+
import { s as streamFragmentError } from "./transport-utils-DwOpuTjL.mjs";
|
|
6
|
+
import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-yWDb5Cct.mjs";
|
|
7
7
|
import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
|
|
8
|
-
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-
|
|
9
|
-
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-
|
|
8
|
+
import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-xJkqrG_E.mjs";
|
|
9
|
+
import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
10
10
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
11
11
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
12
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
12
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
13
13
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
14
14
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
15
15
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
package/dist/{anthropic-stream-reducer-UI5_Ta6I.mjs → anthropic-stream-reducer-yWDb5Cct.mjs}
RENAMED
|
@@ -4,18 +4,18 @@ import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
|
4
4
|
import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
|
|
5
5
|
import { a as normalizeOptionalLowercaseString, i as normalizeNullableString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
6
6
|
import { n as asNonNegativeFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
|
|
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-
|
|
8
|
-
import "./transport-utils-
|
|
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-CWt55nnF.mjs";
|
|
8
|
+
import "./transport-utils-DwOpuTjL.mjs";
|
|
9
9
|
import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
|
|
10
|
-
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-
|
|
10
|
+
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-Dm7PM6AD.mjs";
|
|
11
11
|
import { i as resolveCacheRetention } from "./cloudflare-Dttf8jKq.mjs";
|
|
12
12
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
13
|
-
import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
14
|
-
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
13
|
+
import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
14
|
+
import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
15
15
|
import { t as parsePositiveInteger } from "./positive-integer-Bb4Evc7L.mjs";
|
|
16
|
-
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
17
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
18
|
-
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-
|
|
16
|
+
import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-4vxI7p4V.mjs";
|
|
17
|
+
import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
|
|
18
|
+
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-DZOKfAmL.mjs";
|
|
19
19
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
20
20
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
21
21
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
package/dist/{anthropic-tool-projection-DA_KeluM.mjs → anthropic-tool-projection-DZOKfAmL.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
2
2
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
3
|
-
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-
|
|
3
|
+
import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-B1sTYwfH.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/anthropic-tool-projection.ts
|
|
5
5
|
const CLAUDE_CODE_TOOL_LOOKUP = new Map([
|
|
6
6
|
"Read",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as transformMessages } from "./host-
|
|
2
|
-
import { a as createEmptyTransportUsage } from "./transport-stream-shared-
|
|
1
|
+
import { c as transformMessages } from "./host-CWt55nnF.mjs";
|
|
2
|
+
import { a as createEmptyTransportUsage } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
3
3
|
//#region packages/ai/src/provider-transcript-transform.ts
|
|
4
4
|
const IMAGE_OMISSION = "(image omitted: model does not support images)";
|
|
5
5
|
const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { r as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
|
|
4
4
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
5
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
6
|
-
import { F as convertProviderResponsesMessages, Lt as resolvePromptCacheKey, Rt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-
|
|
5
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
6
|
+
import { F as convertProviderResponsesMessages, Lt as resolvePromptCacheKey, Rt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-iWBHb0Sq.mjs";
|
|
7
7
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
|
|
8
8
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
|
|
9
9
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
@@ -167,6 +167,22 @@ function resolveResponsesTerminalStopReason(params) {
|
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region packages/ai/src/transports/openai-responses-stream-errors.ts
|
|
169
169
|
const OUTPUT_IDENTITY_ERROR_CODE = "responses_output_identity_conflict";
|
|
170
|
+
const TOOL_CALL_WHITESPACE = /\s/u;
|
|
171
|
+
var DegenerateToolCallArgumentsError = class extends Error {
|
|
172
|
+
constructor() {
|
|
173
|
+
super("Tool-call argument stream exceeded the consecutive whitespace limit");
|
|
174
|
+
this.code = "degenerate_output";
|
|
175
|
+
this.name = "DegenerateToolCallArgumentsError";
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
function countToolCallTrailingWhitespace(delta, previous = 0) {
|
|
179
|
+
const limit = 32768;
|
|
180
|
+
let tail = 0;
|
|
181
|
+
for (let index = delta.length - 1; index >= 0 && tail < limit && TOOL_CALL_WHITESPACE.test(delta.charAt(index)); index--) tail += 1;
|
|
182
|
+
const count = tail === delta.length ? previous + tail : tail;
|
|
183
|
+
if (count >= limit) throw new DegenerateToolCallArgumentsError();
|
|
184
|
+
return count;
|
|
185
|
+
}
|
|
170
186
|
function outputType(type) {
|
|
171
187
|
return type === "reasoning" || type === "message" || type === "function_call" || type === "compaction" ? type : "other";
|
|
172
188
|
}
|
|
@@ -329,4 +345,4 @@ function formatModelTransportDebugBaseUrl(rawUrl) {
|
|
|
329
345
|
return rawUrl ? formatModelTransportDebugUrl(rawUrl) : "default";
|
|
330
346
|
}
|
|
331
347
|
//#endregion
|
|
332
|
-
export {
|
|
348
|
+
export { mapResponsesTerminalUsage as _, resolveModelPayloadDebugMode as a, extractErrorCodeOrErrno as b, hasRetryableConnectionErrorCode as c, ResponsesOutputIdentityError as d, countToolCallTrailingWhitespace as f, isResponsesOutputLimitToolCallError as g, resolveResponsesOutputIdentityRetry as h, emitModelTransportError as i, isTransientNetworkError as l, isResponsesProviderTool as m, formatModelTransportDebugUrl as n, resolveModelSseDebugMode as o, hasOnlyResponsesFunctionTools as p, emitModelTransportDebug as r, WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE as s, formatModelTransportDebugBaseUrl as t, DegenerateToolCallArgumentsError as u, readResponsesReasoningTokens as v, toErrorObject as x, resolveResponsesTerminalStopReason as y };
|
package/dist/diagnostics.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
2
2
|
import { a as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-qtZD2inE.mjs";
|
|
3
|
-
import { c as hasRetryableConnectionErrorCode,
|
|
3
|
+
import { c as hasRetryableConnectionErrorCode, g as isResponsesOutputLimitToolCallError, h as resolveResponsesOutputIdentityRetry, i as emitModelTransportError, l as isTransientNetworkError, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, s as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, t as formatModelTransportDebugBaseUrl } from "./diagnostics-v7oVEW59.mjs";
|
|
4
4
|
export { WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, appendAssistantMessageDiagnostic, configureProviderErrorRedactor, createAssistantMessageDiagnostic, emitModelTransportDebug, emitModelTransportError, extractDiagnosticError, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, formatThrownValue, hasRetryableConnectionErrorCode, isProviderRefusalAssistantError, isResponsesOutputLimitToolCallError, isTransientNetworkError, projectDiagnosticValue, readProviderRefusalReview, resolveResponsesOutputIdentityRetry };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
3
3
|
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
|
|
4
4
|
import { t as requireApiKey } from "./required-api-key-D088S4Cd.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-BHd0cST9.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,18 +1,18 @@
|
|
|
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
|
-
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-
|
|
4
|
-
import { s as streamFragmentError } from "./transport-utils-
|
|
5
|
-
import { t as buildGuardedModelFetch } from "./host-policy-
|
|
3
|
+
import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
4
|
+
import { s as streamFragmentError } from "./transport-utils-DwOpuTjL.mjs";
|
|
5
|
+
import { t as buildGuardedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
6
6
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
7
|
-
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
8
|
-
import { b as transportAbortError, c as failTransportStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-
|
|
7
|
+
import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
8
|
+
import { b as transportAbortError, c as failTransportStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
9
9
|
import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
|
|
10
|
-
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-
|
|
10
|
+
import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
11
11
|
import { n as createGoogleVideoPlaceholder, r as materializeGoogleVideoSlots, t as GOOGLE_VIDEO_SLOT_OMISSION } from "./google-video-slots-D8tPH8wX.mjs";
|
|
12
12
|
import { PROVIDER_CONTEXT_HANDOFF, PROVIDER_MODEL_INPUT, resolveProviderContext } from "./provider-types.mjs";
|
|
13
|
-
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-
|
|
13
|
+
import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-vtag8bj5.mjs";
|
|
14
14
|
//#region packages/ai/package.json
|
|
15
|
-
var version = "2026.11.
|
|
15
|
+
var version = "2026.11.2";
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region packages/ai/src/providers/google-interactions-request.ts
|
|
18
18
|
const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { f as hasRuntimeContextMarker } from "./types-BXd0kI8-.mjs";
|
|
1
2
|
import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-
|
|
3
|
+
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-CWt55nnF.mjs";
|
|
3
4
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
4
5
|
import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
|
|
5
|
-
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-
|
|
6
|
-
import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
6
|
+
import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-xJkqrG_E.mjs";
|
|
7
|
+
import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
7
8
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
8
9
|
import { isGoogleGemini4Model } from "./internal/google-model-family.mjs";
|
|
10
|
+
import "./types.mjs";
|
|
9
11
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
10
12
|
/** Reports MINIMAL support for Gemini Flash and Gemini 4 models. */
|
|
11
13
|
function googleFlashSupportsMinimalThinking(modelId) {
|
|
@@ -311,6 +313,10 @@ function projectGoogleMessages(params) {
|
|
|
311
313
|
});
|
|
312
314
|
const visibleParts = managed && !model.input.includes("image") ? parts.filter((part) => !part.inlineData) : parts;
|
|
313
315
|
if (visibleParts.length === 0) visibleParts.push({ text: " " });
|
|
316
|
+
if (hasRuntimeContextMarker(msg)) {
|
|
317
|
+
visibleParts.unshift({ text: "The following is runtime context, not a user request. Do not respond to or acknowledge this context." });
|
|
318
|
+
visibleParts.push({ text: "Use this context to continue responding to the user's request." });
|
|
319
|
+
}
|
|
314
320
|
contents.push({
|
|
315
321
|
role: "user",
|
|
316
322
|
parts: visibleParts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
2
|
import { a as asRecord } from "./record-coerce-CNDovvft.mjs";
|
|
3
|
-
import { a as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
-
import { n as buildManagedModelFetch } from "./host-policy-
|
|
5
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
6
|
-
import { f as mergeTransportHeaders } from "./transport-stream-shared-
|
|
7
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
8
|
-
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
3
|
+
import { a as resolveAiTransportHeaderSentinels } from "./host-CWt55nnF.mjs";
|
|
4
|
+
import { n as buildManagedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
|
|
5
|
+
import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
|
|
6
|
+
import { f as mergeTransportHeaders } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
7
|
+
import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
|
|
8
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-vtag8bj5.mjs";
|
|
9
9
|
import { ResourceScope } from "@google/genai";
|
|
10
10
|
//#region packages/ai/src/providers/google-http-options.ts
|
|
11
11
|
function buildGoogleHttpOptions(model, optionsHeaders, profile) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { k as clampThinkingLevel } from "./host-
|
|
1
|
+
import { k as clampThinkingLevel } from "./host-CWt55nnF.mjs";
|
|
2
2
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
|
|
3
|
-
import { w as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
4
|
-
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-
|
|
5
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
3
|
+
import { w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
|
|
4
|
+
import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-lhgkTOz3.mjs";
|
|
5
|
+
import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
|
|
6
6
|
import { isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
|
|
7
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
7
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-DQMgG5yG.mjs";
|
|
8
8
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
9
9
|
//#region packages/ai/src/providers/google-shared.ts
|
|
10
10
|
function convertMessages(model, context) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
|
|
2
|
-
import { r as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-
|
|
2
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
3
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-BHd0cST9.mjs";
|
|
4
4
|
import { GoogleGenAI } from "@google/genai";
|
|
5
5
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
6
6
|
const API_VERSION = "v1";
|
|
@@ -2,7 +2,7 @@ import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffor
|
|
|
2
2
|
import { t as DEFAULT_MISSING_TOOL_RESULT_TEXT } from "./types-BXd0kI8-.mjs";
|
|
3
3
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { r as normalizeLowercaseStringOrEmpty } from "./string-coerce-Cj8sqWHx.mjs";
|
|
5
|
-
import { E as resolveOpenAIModelReasoningEfforts, F as
|
|
5
|
+
import { E as resolveOpenAIModelReasoningEfforts, F as listMappedModelThinkingLevels, L as resolveOpenAIThinkingApi, P as MODEL_CATALOG_THINKING_LEVELS, i as OPENAI_RESPONSES_APIS } from "./openai-responses-contracts-B5mGAbR6.mjs";
|
|
6
6
|
//#region packages/ai/src/media-payload.ts
|
|
7
7
|
/** Media metadata alone is not an attachment; provider emitters need inline bytes. */
|
|
8
8
|
function hasMediaPayload(block) {
|
|
@@ -372,7 +372,7 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
372
372
|
let pendingToolCalls = [];
|
|
373
373
|
let existingToolResultIds = /* @__PURE__ */ new Set();
|
|
374
374
|
const flushToolCalls = () => {
|
|
375
|
-
for (const call of pendingToolCalls) if (!existingToolResultIds.has(call.id)) result.push({
|
|
375
|
+
for (const { call, timestamp } of pendingToolCalls) if (!existingToolResultIds.has(call.id)) result.push({
|
|
376
376
|
role: "toolResult",
|
|
377
377
|
toolCallId: call.id,
|
|
378
378
|
toolName: call.name,
|
|
@@ -382,7 +382,7 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
382
382
|
}],
|
|
383
383
|
details: { openclawSyntheticMissingToolResult: true },
|
|
384
384
|
isError: true,
|
|
385
|
-
timestamp
|
|
385
|
+
timestamp
|
|
386
386
|
});
|
|
387
387
|
pendingToolCalls = [];
|
|
388
388
|
existingToolResultIds = /* @__PURE__ */ new Set();
|
|
@@ -407,13 +407,17 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
407
407
|
});
|
|
408
408
|
continue;
|
|
409
409
|
}
|
|
410
|
-
pendingToolCalls = message.content.
|
|
411
|
-
if (block.type !== "toolCall") return
|
|
410
|
+
pendingToolCalls = message.content.flatMap((block) => {
|
|
411
|
+
if (block.type !== "toolCall") return [];
|
|
412
|
+
const pending = {
|
|
413
|
+
call: block,
|
|
414
|
+
timestamp: message.timestamp ?? 0
|
|
415
|
+
};
|
|
412
416
|
if (block.async) {
|
|
413
|
-
pendingAsyncCalls.set(block.id,
|
|
414
|
-
return
|
|
417
|
+
pendingAsyncCalls.set(block.id, pending);
|
|
418
|
+
return [];
|
|
415
419
|
}
|
|
416
|
-
return
|
|
420
|
+
return [pending];
|
|
417
421
|
});
|
|
418
422
|
} else {
|
|
419
423
|
if (!supportsImages && typeof message.content !== "string") message = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,6 @@ import { t as appendTextDeltaToAssistantMessage } from "./assistant-message-even
|
|
|
4
4
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
5
5
|
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
6
6
|
import { n as validateToolCall, t as validateToolArguments } from "./validation-9FSkE8T-.mjs";
|
|
7
|
-
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-
|
|
8
|
-
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-
|
|
7
|
+
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-C4YDqhFj.mjs";
|
|
8
|
+
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-CWt55nnF.mjs";
|
|
9
9
|
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, createNodeLlmRuntime, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsClaudeServerCompaction, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
@@ -1,6 +1,6 @@
|
|
|
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-CyA0zJnt.mjs";
|
|
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-
|
|
3
|
-
import { B as readAnthropicFallbackBoundary, E as buildAnthropicSystemBlocks, H as isAnthropicOAuthApiKey, I as ANTHROPIC_SERVER_SIDE_FALLBACKS, L as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, R as CLAUDE_OPUS_FALLBACK_MODEL_COST, U as omitFoundryBearerCredentialHeaders, V as resolveAnthropicFallbackServingModelCost, W as usesFoundryBearerAuth, _ as logAnthropicThinkingDrops, a as readAnthropicPromptUsageSnapshot, c as applyAnthropicRefusal, g as findActiveAnthropicToolTurnAssistantIndex, h as applyAnthropicThinkingBindingControls, i as readAnthropicCacheWriteUsage, m as ANTHROPIC_OMITTED_REASONING_TEXT, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as readAnthropicInputTransformations, z as applyAnthropicFallbackBoundary } from "../anthropic-stream-reducer-
|
|
4
|
-
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-
|
|
5
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
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-CWt55nnF.mjs";
|
|
3
|
+
import { B as readAnthropicFallbackBoundary, E as buildAnthropicSystemBlocks, H as isAnthropicOAuthApiKey, I as ANTHROPIC_SERVER_SIDE_FALLBACKS, L as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, O as isDirectAnthropicModel, P as resolveAnthropicServerCompactionPlan, R as CLAUDE_OPUS_FALLBACK_MODEL_COST, U as omitFoundryBearerCredentialHeaders, V as resolveAnthropicFallbackServingModelCost, W as usesFoundryBearerAuth, _ as logAnthropicThinkingDrops, a as readAnthropicPromptUsageSnapshot, c as applyAnthropicRefusal, g as findActiveAnthropicToolTurnAssistantIndex, h as applyAnthropicThinkingBindingControls, i as readAnthropicCacheWriteUsage, m as ANTHROPIC_OMITTED_REASONING_TEXT, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as readAnthropicInputTransformations, z as applyAnthropicFallbackBoundary } from "../anthropic-stream-reducer-yWDb5Cct.mjs";
|
|
4
|
+
import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, r as prepareAnthropicInputSchema, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "../anthropic-tool-projection-DZOKfAmL.mjs";
|
|
5
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-CUVqVXTe.mjs";
|
|
6
6
|
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, buildAnthropicSystemBlocks, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareAnthropicInputSchema, 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,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,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-C97WXCjm.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 };
|