@openclaw/ai 2026.9.3 → 2026.9.4
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-CZy5U0NY.mjs → anthropic-C4Qu4H0Z.mjs} +14 -13
- package/dist/{anthropic-payload-policy-wuRCb6MH.d.mts → anthropic-payload-policy-BZ8umAbk.d.mts} +3 -3
- package/dist/{anthropic-stream-reducer-B_yo_7pf.mjs → anthropic-stream-reducer-CILWF7JD.mjs} +17 -12
- package/dist/{api-registry-CB1-1oQ2.d.mts → api-registry-ByUwIR0e.d.mts} +2 -2
- package/dist/{assistant-output-iqnlJCV2.mjs → assistant-output-tLt4H-iQ.mjs} +1 -1
- package/dist/{azure-openai-responses-Crpa40QR.mjs → azure-openai-responses-BAlqlKKc.mjs} +4 -4
- package/dist/{diagnostics-dV98PqIy.mjs → diagnostics-QuErwCIl.mjs} +1 -1
- package/dist/diagnostics.mjs +2 -2
- package/dist/{event-stream-C1Z2piyk.d.mts → event-stream-Bt5Y4Pav.d.mts} +1 -1
- package/dist/event-stream-C3WGFsum.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-BDPriaVe.mjs → google-DPBAOaOW.mjs} +6 -6
- package/dist/{google-messages-CVn9eFpF.mjs → google-messages-6JkpHrhJ.mjs} +3 -4
- package/dist/{google-shared-BedY23XS.mjs → google-shared-BvBeW9aq.mjs} +5 -5
- package/dist/{google-vertex-DMz8XQCn.mjs → google-vertex-k-TMCAYD.mjs} +4 -4
- package/dist/{host-DK3wmS3e.d.mts → host-4atIX-2V.d.mts} +5 -3
- package/dist/{host-CWuF-sS3.mjs → host-B8YfDGd4.mjs} +140 -5
- package/dist/{host-policy-CAopLRKA.mjs → host-policy-Zcg_cNz8.mjs} +1 -1
- package/dist/{index-CQ6LTHw8.d.mts → index-DdD3qerf.d.mts} +4 -4
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +5 -4
- package/dist/internal/anthropic.d.mts +5 -5
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-responses-payload-policy.d.mts +3 -3
- package/dist/internal/openai-responses-payload-policy.mjs +3 -2
- package/dist/internal/openai.d.mts +6 -6
- package/dist/internal/openai.mjs +8 -9
- package/dist/internal/runtime.d.mts +43 -8
- package/dist/internal/runtime.mjs +3 -5
- package/dist/internal/shared.d.mts +32 -3
- package/dist/internal/shared.mjs +3 -4
- package/dist/{mistral--m-Jm6VZ.mjs → mistral-CxUZ1jUb.mjs} +5 -8
- package/dist/{openai-chatgpt-responses-nDZccFW-.mjs → openai-chatgpt-responses-CgO6kZfo.mjs} +13 -14
- package/dist/{openai-completions-compat-CXn3T1we.d.mts → openai-completions-compat-eHgh5UPE.d.mts} +3 -3
- package/dist/{openai-completions-stream-BQk3SkLD.mjs → openai-completions-stream-Da2vvl-S.mjs} +45 -14
- package/dist/{openai-completions-KuoZyx0d.mjs → openai-completions-yJuk7eis.mjs} +10 -10
- package/dist/{openai-prompt-cache-rrutvqxq.d.mts → openai-prompt-cache-B4eYo2-I.d.mts} +2 -2
- package/dist/{openai-prompt-cache-BI0rkM-5.mjs → openai-prompt-cache-Bds-n_9Q.mjs} +1 -1
- package/dist/{openai-provider-client-ha_WxTyj.mjs → openai-provider-client-S2gCrM2Z.mjs} +2 -2
- package/dist/{openai-responses-D99dOzKI.mjs → openai-responses-DaYwH05E.mjs} +7 -7
- package/dist/{openai-responses-compaction-window-D5jbzCi3.mjs → openai-responses-compaction-window-CIhBAkkq.mjs} +3 -80
- package/dist/{openai-responses-contracts-B55afwRo.d.mts → openai-responses-contracts-BjBAqAg_.d.mts} +5 -38
- package/dist/{openai-reasoning-effort-BK7FbcLT.mjs → openai-responses-contracts-DDOHA62Y.mjs} +79 -1
- package/dist/{openai-responses-prompt-observer-internal-tApyTLVu.mjs → openai-responses-prompt-observer-internal-f8J7wpsk.mjs} +3 -3
- package/dist/{openai-responses-shared-ZyQEzS5i.mjs → openai-responses-shared-B8RdBPCv.mjs} +18 -18
- package/dist/{openai-transport-params-DNasp2fU.mjs → openai-transport-params-9aPuV5YY.mjs} +11 -10
- package/dist/positive-integer-41zhOdcV.mjs +8 -0
- package/dist/{provider-error-C6TbKiey.mjs → provider-error-BA-v_tKd.mjs} +47 -5
- package/dist/{provider-options-BXr9Ec83.d.mts → provider-options-Ceqv1OKk.d.mts} +2 -2
- package/dist/{provider-replay-context-BuSUaAk5.mjs → provider-replay-context-CJ_YvcEW.mjs} +1 -1
- package/dist/{provider-transcript-transform-pPmUIwKt.mjs → provider-transcript-transform-V5YzU9zh.mjs} +1 -1
- package/dist/provider-transport-turn-state-D5EXOFL2.mjs +42 -0
- package/dist/{provider-types-CAV0Og3m.d.mts → provider-types-CVjKjsuq.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{reasoning-tag-text-partitioner-BQBi4B9d.mjs → reasoning-tag-text-partitioner-BcR5pztD.mjs} +1 -8
- package/dist/{session-affinity-CCH7eYdB.mjs → session-affinity-Bcunsn4I.mjs} +5 -2
- package/dist/{simple-options-tcKOqnpF.mjs → simple-options-BQbb4yQL.mjs} +23 -4
- package/dist/src-DDmEryvj.mjs +2 -0
- package/dist/{transport-stream-shared-DOxpGJ-H.d.mts → transport-stream-shared-DNvmoWnv.d.mts} +20 -36
- package/dist/{transport-stream-shared-Cu3ZPhNW.mjs → transport-stream-shared-zHll9BxO.mjs} +223 -11
- package/dist/{transport-utils-CCooe-cr.mjs → transport-utils-zrYjICLZ.mjs} +4 -7
- package/dist/transports.d.mts +35 -163
- package/dist/transports.mjs +66 -82
- package/dist/types-DlfwzH3T.d.mts +1 -0
- package/dist/types-LFWwv0cF.mjs +8 -0
- package/dist/{types-Dy1q0CSu.d.mts → types-Ntv5z2g2.d.mts} +3 -1
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +4 -3
- package/dist/{src-B2Q_6G8V.mjs → usage-cost-BNWbbXav.mjs} +0 -1
- package/dist/{validation-CaFUZN9B.d.mts → validation-B0t_G2H6.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/package.json +1 -1
- package/dist/event-stream-I_GlBsuZ.d.mts +0 -1
- package/dist/hash-CHgqbJmD.mjs +0 -16
- package/dist/json-parse-Dw_hnxsA.mjs +0 -146
- package/dist/sanitize-unicode-Bb-v9meu.mjs +0 -83
- package/dist/types-BADKjDBI.d.mts +0 -1
- package/dist/types-BDdaOVi2.mjs +0 -6
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
-
import { _ as supportsClaudeAdaptiveThinking, h as resolveClaudeSonnet5ModelIdentity, m as resolveClaudeOpus5ModelIdentity } from "./
|
|
2
|
+
import { _ as supportsClaudeAdaptiveThinking, h as resolveClaudeSonnet5ModelIdentity, m as resolveClaudeOpus5ModelIdentity } from "./usage-cost-BNWbbXav.mjs";
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-
|
|
6
|
-
import { C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, H as resolveAnthropicContextManagementBetaHeader, I as applyAnthropicRequestCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as buildAnthropicSystemBlocks, N as applyAnthropicContextManagementToRequest, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, V as resolveAnthropicCacheOptions, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, l as buildAnthropicGenerationParams, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as isDirectAnthropicModel } from "./anthropic-stream-reducer-
|
|
4
|
+
import { E as resolveAnthropicThinkingEffort, O as usesClaudeFable5MessagesContract, T as requiresClaudeAdaptiveThinking, b as ANTHROPIC_CLAUDE_CODE_VERSION, k as usesClaudeStreamingRefusalContract, n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, w as prepareClaudeNoPrefillRequestContext, x as applyClaudeRequestContract } from "./host-B8YfDGd4.mjs";
|
|
5
|
+
import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-zrYjICLZ.mjs";
|
|
6
|
+
import { C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, H as resolveAnthropicContextManagementBetaHeader, I as applyAnthropicRequestCacheControl, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, L as buildAnthropicSystemBlocks, N as applyAnthropicContextManagementToRequest, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, V as resolveAnthropicCacheOptions, d as convertAnthropicTools, f as buildAnthropicReplayPlan, g as normalizeAnthropicToolCallId, h as suppressAnthropicCompaction, l as buildAnthropicGenerationParams, p as isAnthropicReplayRejection, q as omitFoundryBearerCredentialHeaders, t as consumeAnthropicStream, u as convertAnthropicMessages, z as isDirectAnthropicModel } from "./anthropic-stream-reducer-CILWF7JD.mjs";
|
|
7
7
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
8
|
-
import { n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking } from "./simple-options-
|
|
8
|
+
import { n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking } from "./simple-options-BQbb4yQL.mjs";
|
|
9
9
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { T as parseJsonWithRepair, l as finalizeTransportStream, n as assignTransportErrorDetails, p as notifyProviderHttpResponse } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
11
11
|
import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
|
|
12
|
-
import { n as parseJsonWithRepair } from "./json-parse-Dw_hnxsA.mjs";
|
|
13
12
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
14
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
15
|
-
import {
|
|
16
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
13
|
+
import { t as createAssistantOutput } from "./assistant-output-tLt4H-iQ.mjs";
|
|
14
|
+
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
15
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-V5YzU9zh.mjs";
|
|
17
16
|
import { i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
18
17
|
import Anthropic from "@anthropic-ai/sdk";
|
|
19
18
|
import { Stream } from "@anthropic-ai/sdk/core/streaming.js";
|
|
@@ -107,7 +106,7 @@ const streamAnthropic = (model, context, options) => {
|
|
|
107
106
|
...requestOptions?.signal ? { signal: requestOptions.signal } : {},
|
|
108
107
|
...requestOptions?.timeoutMs !== void 0 ? { timeout: requestOptions.timeoutMs } : {},
|
|
109
108
|
maxRetries: 0,
|
|
110
|
-
headers: applyAnthropicThinkingBindingControls(params, betaHeader) ?? (betaHeader
|
|
109
|
+
headers: applyAnthropicThinkingBindingControls(params, betaHeader) ?? (betaHeader ? { "anthropic-beta": betaHeader } : void 0)
|
|
111
110
|
};
|
|
112
111
|
const response = await client.messages.create({
|
|
113
112
|
...params,
|
|
@@ -342,13 +341,15 @@ async function buildParams(model, context, isOAuthTokenResult, options, serverSi
|
|
|
342
341
|
authProfileId: options?.authProfileId,
|
|
343
342
|
sessionId: options?.sessionId
|
|
344
343
|
});
|
|
344
|
+
const cacheBreakpointOptOutMessageIndexes = /* @__PURE__ */ new Set();
|
|
345
345
|
const params = {
|
|
346
346
|
model: model.id,
|
|
347
347
|
messages: await convertAnthropicMessages(transformProviderMessages(replayPlan.messages, model, normalizeAnthropicToolCallId), model, isOAuthTokenResult, {
|
|
348
348
|
profile: "provider",
|
|
349
349
|
allowEmptySignature: compat.allowEmptySignature,
|
|
350
350
|
compaction: replayPlan.compaction,
|
|
351
|
-
replayThinkingEnabled
|
|
351
|
+
replayThinkingEnabled,
|
|
352
|
+
cacheBreakpointOptOutMessageIndexes
|
|
352
353
|
}),
|
|
353
354
|
max_tokens: options?.maxTokens ?? model.maxTokens,
|
|
354
355
|
stream: true
|
|
@@ -362,7 +363,7 @@ async function buildParams(model, context, isOAuthTokenResult, options, serverSi
|
|
|
362
363
|
toolProjection,
|
|
363
364
|
profile: "provider"
|
|
364
365
|
}));
|
|
365
|
-
applyAnthropicRequestCacheControl(params, cacheControl, supportsCacheControlOnTools);
|
|
366
|
+
applyAnthropicRequestCacheControl(params, cacheControl, supportsCacheControlOnTools, cacheBreakpointOptOutMessageIndexes);
|
|
366
367
|
return {
|
|
367
368
|
params,
|
|
368
369
|
toolProjection,
|
package/dist/{anthropic-payload-policy-wuRCb6MH.d.mts → anthropic-payload-policy-BZ8umAbk.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { t as AnthropicContextManagementOptions } from "./provider-options-
|
|
1
|
+
import "./index-DdD3qerf.mjs";
|
|
2
|
+
import { O as Model } from "./types-Ntv5z2g2.mjs";
|
|
3
|
+
import { t as AnthropicContextManagementOptions } from "./provider-options-Ceqv1OKk.mjs";
|
|
4
4
|
import { TextBlockParam } from "@anthropic-ai/sdk/resources/messages.js";
|
|
5
5
|
//#region packages/ai/src/transports/anthropic-payload-policy.d.ts
|
|
6
6
|
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
package/dist/{anthropic-stream-reducer-B_yo_7pf.mjs → anthropic-stream-reducer-CILWF7JD.mjs}
RENAMED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { _ as supportsClaudeAdaptiveThinking, b as supportsClaudeNativeXhighEffort, d as resolveClaudeModelIdentity, m as resolveClaudeOpus5ModelIdentity, u as resolveClaudeFable5ModelIdentity } from "./
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, b as supportsClaudeNativeXhighEffort, d as resolveClaudeModelIdentity, m as resolveClaudeOpus5ModelIdentity, s as bindsClaudeThinkingPrefix, u as resolveClaudeFable5ModelIdentity } from "./usage-cost-BNWbbXav.mjs";
|
|
2
2
|
import { r as appendAssistantThinking } from "./event-stream-D8PARQfL.mjs";
|
|
3
3
|
import { i as normalizeOptionalLowercaseString, r as normalizeNullableString } from "./string-coerce-fsri9iCu.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, n as getAiTransportHost, s as extractToolResultBlockText, v as requiresClaudeAdaptiveThinking } from "./host-CWuF-sS3.mjs";
|
|
4
|
+
import { C as mapAnthropicStopReason, T as requiresClaudeAdaptiveThinking, _ as isImageWithMediaPayload, d as describeToolResultMediaPlaceholder, j as calculateCost, m as extractToolResultText, n as getAiTransportHost, p as extractToolResultBlockText, v as sanitizeSurrogates, y as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK } from "./host-B8YfDGd4.mjs";
|
|
6
5
|
import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStringField } from "./record-coerce-DwRYMj3t.mjs";
|
|
7
6
|
import { i as asNonNegativeFiniteNumber, n as estimateBase64DecodedBytes } from "./base64-D-su8YVo.mjs";
|
|
8
|
-
import
|
|
9
|
-
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-
|
|
7
|
+
import "./transport-utils-zrYjICLZ.mjs";
|
|
8
|
+
import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-Zcg_cNz8.mjs";
|
|
10
9
|
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
11
|
-
import {
|
|
10
|
+
import { f as splitSystemPromptCacheBoundary, h as stripSystemPromptRelocatableBoundary, m as stripSystemPromptCacheBoundary, v as sortPromptCacheToolsByName } from "./simple-options-BQbb4yQL.mjs";
|
|
11
|
+
import { t as parsePositiveInteger } from "./positive-integer-41zhOdcV.mjs";
|
|
12
12
|
import { t as projectRuntimeToolInputSchema } from "./tool-schema-json-projection-ClptDdAO.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-
|
|
13
|
+
import { E as parseStreamingJson, _ as sanitizeTransportPayloadText, c as finalizeTerminalToolCallArguments, g as sanitizeNonEmptyTransportPayloadText, r as coerceTransportToolCallArguments, v as transportAbortError, w as createToolArgumentPreviewSchedule, x as parseJsonObjectPreservingUnsafeIntegers } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
14
|
+
import { n as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-CJ_YvcEW.mjs";
|
|
15
15
|
import { i as tagPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
16
|
-
import { r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "./json-parse-Dw_hnxsA.mjs";
|
|
17
16
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
18
17
|
//#region packages/ai/src/providers/anthropic-auth-headers.ts
|
|
19
18
|
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
@@ -148,11 +147,14 @@ function applyAnthropicCacheControlToSystem(system, cacheControl) {
|
|
|
148
147
|
continue;
|
|
149
148
|
}
|
|
150
149
|
const record = block;
|
|
151
|
-
|
|
150
|
+
const blockText = record.text;
|
|
151
|
+
if (record.type !== "text" || typeof blockText !== "string") {
|
|
152
152
|
normalizedBlocks.push(block);
|
|
153
153
|
continue;
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const text = stripSystemPromptRelocatableBoundary(blockText);
|
|
156
|
+
record.text = text;
|
|
157
|
+
const split = splitSystemPromptCacheBoundary(text);
|
|
156
158
|
if (!split) {
|
|
157
159
|
if (record.cache_control === void 0) record.cache_control = cacheControl;
|
|
158
160
|
normalizedBlocks.push(record);
|
|
@@ -856,6 +858,7 @@ async function convertContentBlocks(content, model, imageBudget, profile, isErro
|
|
|
856
858
|
}
|
|
857
859
|
async function convertAnthropicMessages(transformedMessages, model, isOAuthToken, options) {
|
|
858
860
|
const params = [];
|
|
861
|
+
const retainRuntimeContext = bindsClaudeThinkingPrefix(model);
|
|
859
862
|
const imageBudget = createAnthropicInlineImageBudget();
|
|
860
863
|
const allowReasoningContentReplay = options.allowReasoningContentReplay === true;
|
|
861
864
|
const replayThinkingEnabled = options.replayThinkingEnabled !== false;
|
|
@@ -867,6 +870,7 @@ async function convertAnthropicMessages(transformedMessages, model, isOAuthToken
|
|
|
867
870
|
if (msg.role === "user") {
|
|
868
871
|
if (typeof msg.content === "string") {
|
|
869
872
|
if (msg.content.trim().length > 0) {
|
|
873
|
+
if (msg.runtimeContextCarrier && !retainRuntimeContext) options.cacheBreakpointOptOutMessageIndexes?.add(params.length);
|
|
870
874
|
const userParam = {
|
|
871
875
|
role: "user",
|
|
872
876
|
content: sanitizeTransportPayloadText(msg.content)
|
|
@@ -892,6 +896,7 @@ async function convertAnthropicMessages(transformedMessages, model, isOAuthToken
|
|
|
892
896
|
let filteredBlocks = !managed || model.input.includes("image") ? blocks : blocks.filter((block) => block.type !== "image");
|
|
893
897
|
filteredBlocks = filteredBlocks.filter((block) => block.type !== "text" || block.text.trim().length > 0);
|
|
894
898
|
if (filteredBlocks.length === 0) continue;
|
|
899
|
+
if (msg.runtimeContextCarrier && !retainRuntimeContext) options.cacheBreakpointOptOutMessageIndexes?.add(params.length);
|
|
895
900
|
const userParam = {
|
|
896
901
|
role: "user",
|
|
897
902
|
content: filteredBlocks
|
|
@@ -1648,7 +1653,7 @@ async function consumeAnthropicStream(params) {
|
|
|
1648
1653
|
if (options.signal?.aborted) throw transportAbortError(options.signal);
|
|
1649
1654
|
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error(output.errorMessage ?? "An unknown error occurred");
|
|
1650
1655
|
if ([...blockIndexes.values()].some((index) => blocks[index]?.type === "toolCall")) throw new Error("Provider completed stream with an incomplete tool call");
|
|
1651
|
-
finalizeTerminalToolCallArguments(sealedToolCalls.map(({ block }) => block), (block) => block.partialJson && block.partialJson.length > 0 ? block.partialJson : seededToolArguments.get(block));
|
|
1656
|
+
finalizeTerminalToolCallArguments(sealedToolCalls.map(({ block }) => block), (block) => block.partialJson && block.partialJson.length > 0 ? block.partialJson : seededToolArguments.get(block), void 0, { repairStringLiterals: true });
|
|
1652
1657
|
for (const sealed of sealedToolCalls) {
|
|
1653
1658
|
delete sealed.block.partialJson;
|
|
1654
1659
|
eventSink.push({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
1
|
+
import "./index-DdD3qerf.mjs";
|
|
2
|
+
import { G as SimpleStreamOptions, J as StreamFunction, O as Model, Y as StreamOptions, d as Context, n as Api, s as AssistantMessageEventStreamContract } from "./types-Ntv5z2g2.mjs";
|
|
3
3
|
//#region packages/ai/src/api-registry.d.ts
|
|
4
4
|
/** Runtime stream adapter signature stored in the API provider registry. */
|
|
5
5
|
type ApiStreamFunction = (model: Model, context: Context, options?: StreamOptions) => AssistantMessageEventStreamContract;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as createEmptyTransportUsage } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/assistant-output.ts
|
|
3
3
|
function createAssistantOutput(model, api = model.api) {
|
|
4
4
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
2
|
-
import { n as getAiTransportHost } from "./host-
|
|
3
|
-
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
2
|
+
import { n as getAiTransportHost } from "./host-B8YfDGd4.mjs";
|
|
3
|
+
import { n as clampOpenAIPromptCacheKey } from "./openai-prompt-cache-Bds-n_9Q.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-BQbb4yQL.mjs";
|
|
5
5
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
6
|
-
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, r as convertResponsesMessages, s as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
6
|
+
import { a as resolveResponsesReasoningEffort, i as createResponsesAssistantOutput, r as convertResponsesMessages, s as runResponsesStreamLifecycle, t as applyCommonResponsesParams } from "./openai-responses-shared-B8RdBPCv.mjs";
|
|
7
7
|
import { i as resolveAzureDeploymentNameFromMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
8
8
|
import OpenAI, { AzureOpenAI } from "openai";
|
|
9
9
|
//#region packages/ai/src/providers/azure-openai-responses.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
2
|
-
import "./provider-error-
|
|
2
|
+
import "./provider-error-BA-v_tKd.mjs";
|
|
3
3
|
//#region packages/normalization-core/src/error-coercion.ts
|
|
4
4
|
function readProperty(value, key) {
|
|
5
5
|
try {
|
package/dist/diagnostics.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
|
|
2
|
-
import { r as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-
|
|
3
|
-
import { c as isTransientNetworkError, n as formatModelTransportDebugUrl, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, r as emitModelTransportDebug, s as hasRetryableConnectionErrorCode, t as formatModelTransportDebugBaseUrl } from "./diagnostics-
|
|
2
|
+
import { r as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-BA-v_tKd.mjs";
|
|
3
|
+
import { c as isTransientNetworkError, n as formatModelTransportDebugUrl, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, r as emitModelTransportDebug, s as hasRetryableConnectionErrorCode, t as formatModelTransportDebugBaseUrl } from "./diagnostics-QuErwCIl.mjs";
|
|
4
4
|
export { WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, appendAssistantMessageDiagnostic, configureProviderErrorRedactor, createAssistantMessageDiagnostic, emitModelTransportDebug, extractDiagnosticError, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, formatThrownValue, hasRetryableConnectionErrorCode, isProviderRefusalAssistantError, isTransientNetworkError, projectDiagnosticValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as ThinkingContent, a as AssistantMessage, o as AssistantMessageEvent, s as AssistantMessageEventStreamContract } from "./types-Ntv5z2g2.mjs";
|
|
2
2
|
//#region packages/llm-core/src/utils/event-stream.d.ts
|
|
3
3
|
/** Returns only an append whose current and previously observed snapshots still match. */
|
|
4
4
|
declare function readAssistantThinkingAppend(block: ThinkingContent, previous: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./event-stream-Bt5Y4Pav.mjs";
|
package/dist/event-stream.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
2
|
-
import "./event-stream-
|
|
1
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-Bt5Y4Pav.mjs";
|
|
2
|
+
import "./event-stream-C3WGFsum.mjs";
|
|
3
3
|
export { AssistantMessageEventStream, EventStream, createAssistantMessageEventStream };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
2
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
3
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
2
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-B8YfDGd4.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-BQbb4yQL.mjs";
|
|
4
4
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
7
|
-
import {
|
|
8
|
-
import { n as buildGoogleSimpleThinking, r as runGoogleGenerateContentLifecycle, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
5
|
+
import { u as mergeTransportHeaders } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-tLt4H-iQ.mjs";
|
|
7
|
+
import { n as resolveOpencodeSessionHeaders } from "./session-affinity-Bcunsn4I.mjs";
|
|
8
|
+
import { n as buildGoogleSimpleThinking, r as runGoogleGenerateContentLifecycle, t as buildGoogleGenerateContentParams } from "./google-shared-BvBeW9aq.mjs";
|
|
9
9
|
import { GoogleGenAI } from "@google/genai";
|
|
10
10
|
//#region packages/ai/src/providers/google.ts
|
|
11
11
|
let toolCallCounter = 0;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { r as appendAssistantThinking } from "./event-stream-D8PARQfL.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { _ as transportAbortError, g as sanitizeTransportPayloadText, n as coerceTransportToolCallArguments } from "./transport-stream-shared-Cu3ZPhNW.mjs";
|
|
2
|
+
import { _ as isImageWithMediaPayload, d as describeToolResultMediaPlaceholder, j as calculateCost, m as extractToolResultText, v as sanitizeSurrogates } from "./host-B8YfDGd4.mjs";
|
|
3
|
+
import { v as sortPromptCacheToolsByName } from "./simple-options-BQbb4yQL.mjs";
|
|
4
|
+
import { _ as sanitizeTransportPayloadText, r as coerceTransportToolCallArguments, v as transportAbortError } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
6
5
|
import { t as notifyLlmRequestActivity } from "./llm-request-activity-BjtkplhG.mjs";
|
|
7
6
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
8
7
|
/** Returns whether a Gemini Flash model accepts the MINIMAL thinking level. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
5
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
1
|
+
import { M as clampThinkingLevel, v as sanitizeSurrogates } from "./host-B8YfDGd4.mjs";
|
|
2
|
+
import { m as stripSystemPromptCacheBoundary } from "./simple-options-BQbb4yQL.mjs";
|
|
3
|
+
import { m as notifyProviderStreamOpened, n as assignTransportErrorDetails, v as transportAbortError } from "./transport-stream-shared-zHll9BxO.mjs";
|
|
4
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-6JkpHrhJ.mjs";
|
|
5
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-V5YzU9zh.mjs";
|
|
6
6
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-shared.ts
|
|
8
8
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
2
2
|
import { a as normalizeOptionalString } from "./string-coerce-fsri9iCu.mjs";
|
|
3
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { t as createAssistantOutput } from "./assistant-output-
|
|
6
|
-
import { n as buildGoogleSimpleThinking, r as runGoogleGenerateContentLifecycle, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
3
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-B8YfDGd4.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-BQbb4yQL.mjs";
|
|
5
|
+
import { t as createAssistantOutput } from "./assistant-output-tLt4H-iQ.mjs";
|
|
6
|
+
import { n as buildGoogleSimpleThinking, r as runGoogleGenerateContentLifecycle, t as buildGoogleGenerateContentParams } from "./google-shared-BvBeW9aq.mjs";
|
|
7
7
|
import { GoogleGenAI, ResourceScope } from "@google/genai";
|
|
8
8
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
9
9
|
const API_VERSION = "v1";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import "./index-DdD3qerf.mjs";
|
|
2
|
+
import { O as Model, d as Context, n as Api, q as StreamFn } from "./types-Ntv5z2g2.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-ByUwIR0e.mjs";
|
|
4
4
|
//#region packages/ai/src/host.d.ts
|
|
5
5
|
/** Provider capability facts needed by the package-owned transports. */
|
|
6
6
|
interface AiProviderRequestCapabilities {
|
|
@@ -104,6 +104,8 @@ type AiInlineContentBlock = AiInlineTextBlock | AiInlineImageBlock;
|
|
|
104
104
|
type AnthropicInlineContentNormalizer = (content: readonly AiInlineContentBlock[]) => Promise<AiInlineContentBlock[]>;
|
|
105
105
|
/** Narrow host ports consumed by the built-in provider adapters. */
|
|
106
106
|
interface AiTransportHost {
|
|
107
|
+
/** Retains accepted lifecycle work after its caller observes cancellation. */
|
|
108
|
+
observePendingProviderWork?: (pending: Promise<unknown>) => void;
|
|
107
109
|
/**
|
|
108
110
|
* Builds a policy-guarded fetch for one model request.
|
|
109
111
|
* Returning undefined keeps the provider SDK's default fetch.
|
|
@@ -1,8 +1,64 @@
|
|
|
1
|
-
import { b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, f as resolveClaudeMythos5ModelIdentity, h as resolveClaudeSonnet5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, p as resolveClaudeNativeThinkingLevelMap, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "./
|
|
1
|
+
import { b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, f as resolveClaudeMythos5ModelIdentity, h as resolveClaudeSonnet5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, p as resolveClaudeNativeThinkingLevelMap, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "./usage-cost-BNWbbXav.mjs";
|
|
2
|
+
import "./src-DDmEryvj.mjs";
|
|
2
3
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
3
|
-
import { i as
|
|
4
|
-
import { o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
4
|
+
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
5
5
|
import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
|
|
6
|
+
//#region packages/ai/src/model-utils.ts
|
|
7
|
+
/** Calculates and stores model cost fields from token usage and per-million pricing. */
|
|
8
|
+
function calculateCost(model, usage) {
|
|
9
|
+
Object.assign(usage.cost, calculateUsageCost(usage, model.cost));
|
|
10
|
+
return usage.cost;
|
|
11
|
+
}
|
|
12
|
+
/** Replaces the catalog estimate when the provider reports an authoritative billed total. */
|
|
13
|
+
function applyProviderReportedUsageCost(usage, reportedCost) {
|
|
14
|
+
if (typeof reportedCost !== "number" || !Number.isFinite(reportedCost) || reportedCost < 0) return;
|
|
15
|
+
usage.cost.total = reportedCost;
|
|
16
|
+
usage.cost.totalOrigin = "provider-billed";
|
|
17
|
+
}
|
|
18
|
+
const EXTENDED_THINKING_LEVELS = [
|
|
19
|
+
"off",
|
|
20
|
+
"minimal",
|
|
21
|
+
"low",
|
|
22
|
+
"medium",
|
|
23
|
+
"high",
|
|
24
|
+
"xhigh",
|
|
25
|
+
"max"
|
|
26
|
+
];
|
|
27
|
+
function resolveThinkingLevelMap(model) {
|
|
28
|
+
return model.api === "anthropic-messages" ? resolveClaudeNativeThinkingLevelMap(model) ?? model.thinkingLevelMap : model.thinkingLevelMap;
|
|
29
|
+
}
|
|
30
|
+
/** Returns thinking levels exposed by a reasoning-capable model. */
|
|
31
|
+
function getSupportedThinkingLevels(model) {
|
|
32
|
+
const mandatoryAdaptiveContract = model.api === "anthropic-messages" && requiresClaudeMandatoryAdaptiveThinking(model);
|
|
33
|
+
if (!model.reasoning && !mandatoryAdaptiveContract) return ["off"];
|
|
34
|
+
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
35
|
+
return EXTENDED_THINKING_LEVELS.filter((level) => {
|
|
36
|
+
const mapped = thinkingLevelMap?.[level];
|
|
37
|
+
if (mapped === null) return false;
|
|
38
|
+
if (level === "xhigh" || level === "max") return mapped !== void 0;
|
|
39
|
+
return true;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Clamps a requested thinking level to the closest supported level for a model. */
|
|
43
|
+
function clampThinkingLevel(model, level) {
|
|
44
|
+
const availableLevels = getSupportedThinkingLevels(model);
|
|
45
|
+
if (availableLevels.includes(level)) return level;
|
|
46
|
+
const requestedIndex = EXTENDED_THINKING_LEVELS.indexOf(level);
|
|
47
|
+
if (requestedIndex === -1) return availableLevels[0] ?? "off";
|
|
48
|
+
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
49
|
+
if ((level === "xhigh" || level === "max") && thinkingLevelMap?.[level] === null) {
|
|
50
|
+
for (const candidate of EXTENDED_THINKING_LEVELS.slice(0, requestedIndex).toReversed()) if (availableLevels.includes(candidate)) return candidate;
|
|
51
|
+
}
|
|
52
|
+
for (const candidate of EXTENDED_THINKING_LEVELS.slice(requestedIndex)) if (availableLevels.includes(candidate)) return candidate;
|
|
53
|
+
for (const candidate of EXTENDED_THINKING_LEVELS.slice(0, requestedIndex).toReversed()) if (availableLevels.includes(candidate)) return candidate;
|
|
54
|
+
return availableLevels[0] ?? "off";
|
|
55
|
+
}
|
|
56
|
+
/** Compares model identity by provider and id. */
|
|
57
|
+
function modelsAreEqual(a, b) {
|
|
58
|
+
if (!a || !b) return false;
|
|
59
|
+
return a.id === b.id && a.provider === b.provider;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
6
62
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
7
63
|
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
8
64
|
const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = `x-anthropic-billing-header: cc_version=${ANTHROPIC_CLAUDE_CODE_VERSION}; cc_entrypoint=sdk-cli;`;
|
|
@@ -135,6 +191,31 @@ function resolveModelBoundThinkingReplayMode(params) {
|
|
|
135
191
|
return sourceApi === targetApi && sourceIdentity === targetIdentity ? "preserve" : "drop";
|
|
136
192
|
}
|
|
137
193
|
//#endregion
|
|
194
|
+
//#region packages/ai/src/utils/sanitize-unicode.ts
|
|
195
|
+
/**
|
|
196
|
+
* Removes unpaired Unicode surrogate characters from a string.
|
|
197
|
+
*
|
|
198
|
+
* Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
|
|
199
|
+
* or vice versa) cause JSON serialization errors in many API providers.
|
|
200
|
+
*
|
|
201
|
+
* Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
|
|
202
|
+
* surrogates and will NOT be affected by this function.
|
|
203
|
+
*
|
|
204
|
+
* @param text - The text to sanitize
|
|
205
|
+
* @returns The sanitized text with unpaired surrogates removed
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* // Valid emoji (properly paired surrogates) are preserved
|
|
209
|
+
* sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
|
|
210
|
+
*
|
|
211
|
+
* // Unpaired high surrogate is removed
|
|
212
|
+
* const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
|
|
213
|
+
* sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
|
|
214
|
+
*/
|
|
215
|
+
function sanitizeSurrogates(text) {
|
|
216
|
+
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
138
219
|
//#region packages/ai/src/providers/tool-result-text.ts
|
|
139
220
|
const STRUCTURED_TOOL_RESULT_MAX_CHARS = 8e3;
|
|
140
221
|
const IMAGE_TOOL_RESULT_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -275,6 +356,49 @@ function formatToolResultText(params) {
|
|
|
275
356
|
return `${params.isError ? "[tool error] " : ""}${body}`;
|
|
276
357
|
}
|
|
277
358
|
//#endregion
|
|
359
|
+
//#region packages/ai/src/replay-turn-classification.ts
|
|
360
|
+
/** Returns true when an assistant turn contains only provider reasoning and blank text. */
|
|
361
|
+
function hasOnlyAssistantReasoningContent(message) {
|
|
362
|
+
if (message.role !== "assistant") return false;
|
|
363
|
+
const content = Array.isArray(message.content) ? message.content : message.content != null && typeof message.content === "object" ? [message.content] : [];
|
|
364
|
+
let hasThinking = false;
|
|
365
|
+
for (const block of content) {
|
|
366
|
+
if (!block || typeof block !== "object") return false;
|
|
367
|
+
if (!("type" in block)) return false;
|
|
368
|
+
if (block.type === "thinking" || block.type === "redacted_thinking") {
|
|
369
|
+
hasThinking = true;
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
if (block.type === "text" && "text" in block && typeof block.text === "string" && !block.text.trim()) continue;
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
return hasThinking;
|
|
376
|
+
}
|
|
377
|
+
/** Returns true when a token-limited turn contains only incomplete provider reasoning. */
|
|
378
|
+
function isReasoningOnlyLengthAssistantTurn(message) {
|
|
379
|
+
return message.stopReason === "length" && hasOnlyAssistantReasoningContent(message);
|
|
380
|
+
}
|
|
381
|
+
const STREAM_ERROR_FALLBACK_TEXT = "[assistant turn failed before producing content]";
|
|
382
|
+
function isStreamErrorFallbackContent(content) {
|
|
383
|
+
if (content == null) return true;
|
|
384
|
+
if (typeof content === "string") return !content.trim() || content.trim() === "[assistant turn failed before producing content]";
|
|
385
|
+
return Array.isArray(content) && content.every((value) => {
|
|
386
|
+
const block = asOptionalRecord(value);
|
|
387
|
+
return block && (block.type === "text" || block.type === "input_text" || block.type === "output_text") && typeof block.text === "string" && isStreamErrorFallbackContent(block.text);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const FAILED_ASSISTANT_REPLAY_TEXT = "[This turn failed before it completed. Do not redo its work without confirming with the user first.]";
|
|
391
|
+
/** Classify failed source content before model-specific thinking or tool projection. */
|
|
392
|
+
function resolveFailedAssistantReplay(message, options) {
|
|
393
|
+
if (message.role !== "assistant" || message.stopReason !== "error" && message.stopReason !== "aborted") return "keep";
|
|
394
|
+
const content = Array.isArray(message.content) ? message.content : [];
|
|
395
|
+
if (content.some((block) => asOptionalRecord(block)?.type === "toolCall")) return options.pairingAware ? "keep" : "drop";
|
|
396
|
+
return content.some((block) => {
|
|
397
|
+
const record = asOptionalRecord(block);
|
|
398
|
+
return record?.type === "text" && typeof record.text === "string" && !isStreamErrorFallbackContent(record.text);
|
|
399
|
+
}) ? "marker" : "drop";
|
|
400
|
+
}
|
|
401
|
+
//#endregion
|
|
278
402
|
//#region packages/ai/src/transcript-transform.ts
|
|
279
403
|
const NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)";
|
|
280
404
|
const NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)";
|
|
@@ -390,9 +514,20 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
390
514
|
content: []
|
|
391
515
|
};
|
|
392
516
|
if (message.role === "assistant") {
|
|
517
|
+
const failedReplay = resolveFailedAssistantReplay(message, { pairingAware: false });
|
|
393
518
|
message = transformAssistant(message, model, toolCallIdMap, normalizeToolCallId);
|
|
394
519
|
flushToolCalls();
|
|
395
|
-
if (
|
|
520
|
+
if (failedReplay === "drop") continue;
|
|
521
|
+
if (failedReplay === "marker") {
|
|
522
|
+
result.push({
|
|
523
|
+
...message,
|
|
524
|
+
content: [{
|
|
525
|
+
type: "text",
|
|
526
|
+
text: FAILED_ASSISTANT_REPLAY_TEXT
|
|
527
|
+
}]
|
|
528
|
+
});
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
396
531
|
pendingToolCalls = message.content.filter((block) => {
|
|
397
532
|
if (block.type !== "toolCall") return false;
|
|
398
533
|
if (block.async) {
|
|
@@ -520,4 +655,4 @@ function resolveAiTransportHeaderSentinels(headers) {
|
|
|
520
655
|
return resolvedHeaders ?? headers;
|
|
521
656
|
}
|
|
522
657
|
//#endregion
|
|
523
|
-
export {
|
|
658
|
+
export { applyProviderReportedUsageCost as A, mapAnthropicStopReason as C, resolveModelBoundThinkingReplayMode as D, resolveAnthropicThinkingEffort as E, clampThinkingLevel as M, getSupportedThinkingLevels as N, usesClaudeFable5MessagesContract as O, modelsAreEqual as P, defaultsClaudeAdaptiveThinking as S, requiresClaudeAdaptiveThinking as T, isImageWithMediaPayload as _, FAILED_ASSISTANT_REPLAY_TEXT as a, ANTHROPIC_CLAUDE_CODE_VERSION as b, isReasoningOnlyLengthAssistantTurn as c, describeToolResultMediaPlaceholder as d, describeUnsupportedToolResultMedia as f, hasMediaPayload as g, formatToolResultText as h, transformMessages as i, calculateCost as j, usesClaudeStreamingRefusalContract as k, isStreamErrorFallbackContent as l, extractToolResultText as m, getAiTransportHost as n, STREAM_ERROR_FALLBACK_TEXT as o, extractToolResultBlockText as p, resolveAiTransportHeaderSentinels as r, hasOnlyAssistantReasoningContent as s, configureAiTransportHost as t, resolveFailedAssistantReplay as u, sanitizeSurrogates as v, prepareClaudeNoPrefillRequestContext as w, applyClaudeRequestContract as x, ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-B8YfDGd4.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, et as ThinkingLevel, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-Ntv5z2g2.mjs";
|
|
2
2
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-Bt5Y4Pav.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-B0t_G2H6.mjs";
|
|
5
5
|
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
6
|
type ClaudeModelRef = {
|
|
7
7
|
id?: string;
|
|
@@ -111,7 +111,7 @@ declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): Mo
|
|
|
111
111
|
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
112
112
|
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
113
113
|
declare namespace index_d_exports {
|
|
114
|
-
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
114
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
115
115
|
}
|
|
116
116
|
//#endregion
|
|
117
117
|
export { supportsClaude1MContext as _, CLAUDE_FABLE_5_THINKING_PROFILE as a, supportsClaudeNativeMaxEffort as b, bindsClaudeThinkingPrefix as c, resolveClaudeFable5ModelIdentity as d, resolveClaudeModelIdentity as f, resolveClaudeSonnet5ModelIdentity as g, resolveClaudeOpus5ModelIdentity as h, normalizeResolvedPricing as i, requiresClaudeDefaultSampling as l, resolveClaudeNativeThinkingLevelMap as m, calculateUsageCost as n, CLAUDE_OPUS_5_THINKING_PROFILE as o, resolveClaudeMythos5ModelIdentity as p, normalizeModelCostConfig as r, CLAUDE_SONNET_5_THINKING_PROFILE as s, index_d_exports as t, requiresClaudeMandatoryAdaptiveThinking as u, supportsClaudeAdaptiveThinking as v, supportsClaudeNativeXhighEffort as x, supportsClaudeFastMode as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-
|
|
2
|
-
import { $ as
|
|
1
|
+
import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-DdD3qerf.mjs";
|
|
2
|
+
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, et as ThinkingLevel, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-Ntv5z2g2.mjs";
|
|
3
3
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-
|
|
7
|
-
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-Bt5Y4Pav.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-B0t_G2H6.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-ByUwIR0e.mjs";
|
|
7
|
+
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-4atIX-2V.mjs";
|
|
8
8
|
//#region packages/ai/src/stream.d.ts
|
|
9
9
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
10
10
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -22,4 +22,4 @@ export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
|
22
22
|
};
|
|
23
23
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
25
|
+
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|