@openclaw/ai 2026.9.3 → 2026.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{anthropic-CZy5U0NY.mjs → anthropic-COtDvgtt.mjs} +16 -16
- package/dist/{anthropic-payload-policy-wuRCb6MH.d.mts → anthropic-payload-policy-5Erq1Nzy.d.mts} +3 -3
- package/dist/{anthropic-stream-reducer-B_yo_7pf.mjs → anthropic-stream-reducer-BvdYYWL8.mjs} +56 -47
- package/dist/{api-registry-CB1-1oQ2.d.mts → api-registry-Ba2Cv-ut.d.mts} +2 -2
- package/dist/{assistant-output-iqnlJCV2.mjs → assistant-output-BsEkB-vU.mjs} +1 -1
- package/dist/{azure-openai-responses-Crpa40QR.mjs → azure-openai-responses-YrgnD583.mjs} +6 -9
- package/dist/{base64-D-su8YVo.mjs → base64-BQOzsvUH.mjs} +4 -4
- package/dist/credential-redaction-BKv49aiv.d.mts +24 -0
- package/dist/{diagnostics-dV98PqIy.mjs → diagnostics-Dm4bisWG.mjs} +89 -2
- package/dist/diagnostics.d.mts +4 -23
- package/dist/diagnostics.mjs +3 -3
- package/dist/{event-stream-C1Z2piyk.d.mts → event-stream-CCoa-qSI.d.mts} +1 -1
- package/dist/event-stream-DmSCpi1T.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/expect-lbe3Hgrh.mjs +8 -0
- package/dist/{google-BDPriaVe.mjs → google-BuhpRO9r.mjs} +7 -10
- package/dist/{google-messages-CVn9eFpF.mjs → google-messages-CyWnYlh0.mjs} +3 -4
- package/dist/{google-shared-BedY23XS.mjs → google-shared-BT5ZeNer.mjs} +13 -13
- package/dist/{google-vertex-DMz8XQCn.mjs → google-vertex-C7EplRvt.mjs} +5 -8
- package/dist/{host-CWuF-sS3.mjs → host-B4MeUNBc.mjs} +145 -12
- package/dist/{host-DK3wmS3e.d.mts → host-FZ1RA_qD.d.mts} +7 -3
- package/dist/{host-policy-CAopLRKA.mjs → host-policy-DUnXSx0I.mjs} +1 -1
- package/dist/{index-CQ6LTHw8.d.mts → index-DaF2QbwS.d.mts} +5 -10
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +5 -5
- package/dist/internal/anthropic.d.mts +6 -7
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/openai-completions-compat.d.mts +2 -0
- package/dist/internal/openai-completions-compat.mjs +2 -0
- 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 +10 -53
- package/dist/internal/openai.mjs +11 -10
- package/dist/internal/runtime.d.mts +43 -10
- package/dist/internal/runtime.mjs +5 -11
- package/dist/internal/shared.d.mts +35 -5
- package/dist/internal/shared.mjs +4 -4
- package/dist/internal/tool-schema.d.mts +3 -3
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{mistral--m-Jm6VZ.mjs → mistral-moA-mbwl.mjs} +9 -16
- package/dist/{openai-chatgpt-responses-nDZccFW-.mjs → openai-chatgpt-responses-DWID3EFO.mjs} +76 -33
- package/dist/{openai-completions-KuoZyx0d.mjs → openai-completions-DJ1Vm-CD.mjs} +12 -13
- package/dist/{openai-prompt-cache-BI0rkM-5.mjs → openai-completions-compat-CkwdxTZx.mjs} +5 -50
- package/dist/{openai-completions-compat-CXn3T1we.d.mts → openai-completions-compat-JE7gqxb9.d.mts} +4 -4
- package/dist/{openai-completions-stream-BQk3SkLD.mjs → openai-completions-stream-Bu98b0Hv.mjs} +128 -99
- package/dist/openai-prompt-cache-1wfaIszn.mjs +46 -0
- package/dist/{openai-prompt-cache-rrutvqxq.d.mts → openai-prompt-cache-CJ_xEevu.d.mts} +2 -2
- package/dist/{openai-provider-client-ha_WxTyj.mjs → openai-provider-client-DPo0Hmak.mjs} +2 -2
- package/dist/{openai-reasoning-effort-BK7FbcLT.mjs → openai-reasoning-effort-NlFZmfEu.mjs} +87 -19
- package/dist/{openai-responses-D99dOzKI.mjs → openai-responses-BejZzQCP.mjs} +9 -13
- package/dist/{openai-responses-compaction-window-D5jbzCi3.mjs → openai-responses-compaction-window-D6P5oZP5.mjs} +21 -140
- package/dist/openai-responses-contracts-DWrfMODE.mjs +81 -0
- package/dist/{openai-responses-contracts-B55afwRo.d.mts → openai-responses-contracts-Dflvrfa8.d.mts} +10 -39
- package/dist/{openai-responses-payload-policy-rLRPsSmB.d.mts → openai-responses-payload-policy-C7GsA1y0.d.mts} +5 -3
- package/dist/openai-responses-prompt-observer-internal-C15_-OwV.mjs +195 -0
- package/dist/{openai-responses-shared-ZyQEzS5i.mjs → openai-responses-shared-CwsziD_m.mjs} +390 -183
- package/dist/openai-responses-terminal-usage-Dl3J6zrf.d.mts +47 -0
- package/dist/{openai-tool-schema-CzjyYXun.mjs → openai-tool-schema-BO8rwyAD.mjs} +92 -68
- package/dist/{openai-transport-params-DNasp2fU.mjs → openai-transport-params-DQeuAvBl.mjs} +162 -51
- package/dist/positive-integer-DtjCkbue.mjs +8 -0
- package/dist/{provider-error-C6TbKiey.mjs → provider-error-DDqw9Qda.mjs} +140 -36
- package/dist/{provider-options-BXr9Ec83.d.mts → provider-options-DprLsWh9.d.mts} +9 -6
- package/dist/{provider-replay-context-BuSUaAk5.mjs → provider-replay-context-CnUSOwhr.mjs} +1 -1
- package/dist/{provider-transcript-transform-pPmUIwKt.mjs → provider-transcript-transform-BsRAhuWJ.mjs} +1 -1
- package/dist/provider-transport-turn-state-CkGToCD2.mjs +42 -0
- package/dist/{provider-types-CAV0Og3m.d.mts → provider-types-CAKRC7N5.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -7
- 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-Dy9IO8Dc.mjs} +15 -14
- package/dist/{session-affinity-CCH7eYdB.mjs → session-affinity-Bcunsn4I.mjs} +5 -2
- package/dist/{simple-options-tcKOqnpF.mjs → simple-options-C6cFWj_f.mjs} +26 -5
- package/dist/{src-B2Q_6G8V.mjs → src-DeKjbE8I.mjs} +3 -6
- package/dist/{stream-first-event-timeout-2hfrquuz.mjs → stream-first-event-timeout-C9ZadkJW.mjs} +1 -1
- package/dist/{string-normalization-CmLIasuf.mjs → string-normalization-J9ZiLfGO.mjs} +13 -1
- package/dist/tool-schema-json-projection-CD9c_fK8.mjs +134 -0
- package/dist/{transport-stream-shared-DOxpGJ-H.d.mts → transport-stream-shared-BbUkFaHi.d.mts} +20 -36
- package/dist/{transport-stream-shared-Cu3ZPhNW.mjs → transport-stream-shared-D-6FQSHm.mjs} +223 -11
- package/dist/{transport-utils-CCooe-cr.mjs → transport-utils-1cyq5Y7x.mjs} +4 -7
- package/dist/transports.d.mts +51 -165
- package/dist/transports.mjs +172 -507
- package/dist/{types-Dy1q0CSu.d.mts → types-4_uVs5WH.d.mts} +49 -3
- package/dist/types-DkJfb4W3.d.mts +1 -0
- package/dist/types-LFWwv0cF.mjs +8 -0
- package/dist/types.d.mts +6 -7
- package/dist/types.mjs +4 -4
- package/dist/{validation-CaFUZN9B.d.mts → validation-Ctzu2DhF.d.mts} +1 -1
- package/dist/{validation-BDzVDnTs.mjs → validation-Dw7cb6BV.mjs} +1 -0
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +10 -5
- package/dist/diagnostics-DnPnOui6.d.mts +0 -29
- 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/openai-responses-prompt-observer-internal-tApyTLVu.mjs +0 -32
- package/dist/sanitize-unicode-Bb-v9meu.mjs +0 -83
- package/dist/tool-schema-json-projection-ClptDdAO.mjs +0 -82
- package/dist/types-BADKjDBI.d.mts +0 -1
- package/dist/types-BDdaOVi2.mjs +0 -6
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 {
|
|
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-
|
|
4
|
-
export { WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, appendAssistantMessageDiagnostic, configureProviderErrorRedactor, createAssistantMessageDiagnostic, emitModelTransportDebug, extractDiagnosticError, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, formatThrownValue, hasRetryableConnectionErrorCode, isProviderRefusalAssistantError, isTransientNetworkError, projectDiagnosticValue };
|
|
2
|
+
import { i as projectDiagnosticValue, t as configureProviderErrorRedactor } from "./provider-error-DDqw9Qda.mjs";
|
|
3
|
+
import { c as isTransientNetworkError, l as isResponsesOutputLimitToolCallError, n as formatModelTransportDebugUrl, o as WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, r as emitModelTransportDebug, s as hasRetryableConnectionErrorCode, t as formatModelTransportDebugBaseUrl } from "./diagnostics-Dm4bisWG.mjs";
|
|
4
|
+
export { WEBSOCKET_NON_RETRYABLE_CLOSE_ERROR_CODE, appendAssistantMessageDiagnostic, configureProviderErrorRedactor, createAssistantMessageDiagnostic, emitModelTransportDebug, extractDiagnosticError, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, formatThrownValue, hasRetryableConnectionErrorCode, isProviderRefusalAssistantError, isResponsesOutputLimitToolCallError, isTransientNetworkError, projectDiagnosticValue };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as ThinkingContent, a as AssistantMessage, o as AssistantMessageEvent, s as AssistantMessageEventStreamContract } from "./types-4_uVs5WH.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-CCoa-qSI.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-CCoa-qSI.mjs";
|
|
2
|
+
import "./event-stream-DmSCpi1T.mjs";
|
|
3
3
|
export { AssistantMessageEventStream, EventStream, createAssistantMessageEventStream };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region packages/normalization-core/src/expect.ts
|
|
2
|
+
/** Returns the value or throws with the named context; use for genuine invariants only. */
|
|
3
|
+
function expectDefined(value, context) {
|
|
4
|
+
if (value === null || value === void 0) throw new Error("expected " + context + " to be defined");
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { expectDefined as t };
|
|
@@ -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-B4MeUNBc.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-C6cFWj_f.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-D-6FQSHm.mjs";
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-BsEkB-vU.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-BT5ZeNer.mjs";
|
|
9
9
|
import { GoogleGenAI } from "@google/genai";
|
|
10
10
|
//#region packages/ai/src/providers/google.ts
|
|
11
11
|
let toolCallCounter = 0;
|
|
@@ -31,10 +31,7 @@ const streamSimpleGoogle = (model, context, options) => {
|
|
|
31
31
|
const base = buildBaseOptions(model, options, apiKey);
|
|
32
32
|
return streamGoogle(model, context, {
|
|
33
33
|
...base,
|
|
34
|
-
thinking: buildGoogleSimpleThinking(model, options
|
|
35
|
-
includeGemma4ThinkingLevel: true,
|
|
36
|
-
useFlashLiteBudgets: true
|
|
37
|
-
})
|
|
34
|
+
thinking: buildGoogleSimpleThinking(model, options)
|
|
38
35
|
});
|
|
39
36
|
};
|
|
40
37
|
function createClient(model, apiKey, optionsHeaders) {
|
|
@@ -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-B4MeUNBc.mjs";
|
|
3
|
+
import { v as sortPromptCacheToolsByName } from "./simple-options-C6cFWj_f.mjs";
|
|
4
|
+
import { _ as sanitizeTransportPayloadText, r as coerceTransportToolCallArguments, v as transportAbortError } from "./transport-stream-shared-D-6FQSHm.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-B4MeUNBc.mjs";
|
|
2
|
+
import { m as stripSystemPromptCacheBoundary } from "./simple-options-C6cFWj_f.mjs";
|
|
3
|
+
import { m as notifyProviderStreamOpened, n as assignTransportErrorDetails, v as transportAbortError } from "./transport-stream-shared-D-6FQSHm.mjs";
|
|
4
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-CyWnYlh0.mjs";
|
|
5
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-BsRAhuWJ.mjs";
|
|
6
6
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-shared.ts
|
|
8
8
|
/**
|
|
@@ -97,7 +97,7 @@ function buildGoogleGenerateContentParams(model, context, options = {}) {
|
|
|
97
97
|
function isAdaptiveGoogleReasoningLevel(value) {
|
|
98
98
|
return value === "adaptive";
|
|
99
99
|
}
|
|
100
|
-
function buildGoogleSimpleThinking(model, options
|
|
100
|
+
function buildGoogleSimpleThinking(model, options) {
|
|
101
101
|
if (!options?.reasoning || options.reasoning === "off") return { enabled: false };
|
|
102
102
|
if (isAdaptiveGoogleReasoningLevel(options.reasoning)) {
|
|
103
103
|
if (!model.reasoning) return { enabled: false };
|
|
@@ -113,13 +113,13 @@ function buildGoogleSimpleThinking(model, options, config) {
|
|
|
113
113
|
const clampedReasoning = clampThinkingLevel(model, options.reasoning);
|
|
114
114
|
if (clampedReasoning === "off") return { enabled: false };
|
|
115
115
|
const effort = clampedReasoning === "max" ? "high" : clampedReasoning;
|
|
116
|
-
if (isGemini3ProModel(model) || isGemini3FlashModel(model) ||
|
|
116
|
+
if (isGemini3ProModel(model) || isGemini3FlashModel(model) || isGemma4Model(model)) return {
|
|
117
117
|
enabled: true,
|
|
118
|
-
level: getGoogleThinkingLevel(effort, model
|
|
118
|
+
level: getGoogleThinkingLevel(effort, model)
|
|
119
119
|
};
|
|
120
120
|
return {
|
|
121
121
|
enabled: true,
|
|
122
|
-
budgetTokens: getGoogleBudget(model, effort, options.thinkingBudgets
|
|
122
|
+
budgetTokens: getGoogleBudget(model, effort, options.thinkingBudgets)
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
function getDisabledGoogleThinkingConfig(model) {
|
|
@@ -138,14 +138,14 @@ function isGemini3ProModel(model) {
|
|
|
138
138
|
function isGemini3FlashModel(model) {
|
|
139
139
|
return /gemini-(?:3(?:\.\d+)?-flash|flash(?:-lite)?-latest)/.test(model.id.toLowerCase());
|
|
140
140
|
}
|
|
141
|
-
function getGoogleThinkingLevel(effort, model
|
|
141
|
+
function getGoogleThinkingLevel(effort, model) {
|
|
142
142
|
if (isGemini3ProModel(model)) switch (effort) {
|
|
143
143
|
case "minimal":
|
|
144
144
|
case "low": return ThinkingLevel.LOW;
|
|
145
145
|
case "medium":
|
|
146
146
|
case "high": return ThinkingLevel.HIGH;
|
|
147
147
|
}
|
|
148
|
-
if (
|
|
148
|
+
if (isGemma4Model(model)) switch (effort) {
|
|
149
149
|
case "minimal":
|
|
150
150
|
case "low": return ThinkingLevel.MINIMAL;
|
|
151
151
|
case "medium":
|
|
@@ -159,7 +159,7 @@ function getGoogleThinkingLevel(effort, model, config) {
|
|
|
159
159
|
}
|
|
160
160
|
return ThinkingLevel.HIGH;
|
|
161
161
|
}
|
|
162
|
-
function getGoogleBudget(model, effort, customBudgets
|
|
162
|
+
function getGoogleBudget(model, effort, customBudgets) {
|
|
163
163
|
if (customBudgets?.[effort] !== void 0) return customBudgets[effort];
|
|
164
164
|
if (model.id.includes("2.5-pro")) return {
|
|
165
165
|
minimal: 128,
|
|
@@ -167,7 +167,7 @@ function getGoogleBudget(model, effort, customBudgets, config) {
|
|
|
167
167
|
medium: 8192,
|
|
168
168
|
high: 32768
|
|
169
169
|
}[effort];
|
|
170
|
-
if (
|
|
170
|
+
if (model.id.includes("2.5-flash-lite")) return {
|
|
171
171
|
minimal: 512,
|
|
172
172
|
low: 2048,
|
|
173
173
|
medium: 8192,
|
|
@@ -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-B4MeUNBc.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-C6cFWj_f.mjs";
|
|
5
|
+
import { t as createAssistantOutput } from "./assistant-output-BsEkB-vU.mjs";
|
|
6
|
+
import { n as buildGoogleSimpleThinking, r as runGoogleGenerateContentLifecycle, t as buildGoogleGenerateContentParams } from "./google-shared-BT5ZeNer.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";
|
|
@@ -30,10 +30,7 @@ const streamSimpleGoogleVertex = (model, context, options) => {
|
|
|
30
30
|
const base = buildBaseOptions(model, options, void 0);
|
|
31
31
|
return streamGoogleVertex(model, context, {
|
|
32
32
|
...base,
|
|
33
|
-
thinking: buildGoogleSimpleThinking(model, options
|
|
34
|
-
includeGemma4ThinkingLevel: true,
|
|
35
|
-
useFlashLiteBudgets: true
|
|
36
|
-
})
|
|
33
|
+
thinking: buildGoogleSimpleThinking(model, options)
|
|
37
34
|
});
|
|
38
35
|
};
|
|
39
36
|
function createClient(model, project, location, optionsHeaders) {
|
|
@@ -1,8 +1,55 @@
|
|
|
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 "./src-
|
|
1
|
+
import { b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, f as resolveClaudeMythos5ModelIdentity, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, p as resolveClaudeNativeThinkingLevelMap, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "./src-DeKjbE8I.mjs";
|
|
2
2
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
3
|
-
import { i as
|
|
4
|
-
import {
|
|
3
|
+
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
4
|
+
import { a as resolveOpenAIModelReasoningEfforts, d as MODEL_CATALOG_THINKING_LEVELS, f as listMappedModelThinkingLevels, p as resolveOpenAIThinkingApi } from "./openai-reasoning-effort-NlFZmfEu.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
|
+
function resolveThinkingLevelMap(model) {
|
|
19
|
+
return model.api === "anthropic-messages" ? resolveClaudeNativeThinkingLevelMap(model) ?? model.thinkingLevelMap : model.thinkingLevelMap;
|
|
20
|
+
}
|
|
21
|
+
/** Returns thinking levels exposed by a reasoning-capable model. */
|
|
22
|
+
function getSupportedThinkingLevels(model) {
|
|
23
|
+
const mandatoryAdaptiveContract = model.api === "anthropic-messages" && requiresClaudeMandatoryAdaptiveThinking(model);
|
|
24
|
+
if (!model.reasoning && !mandatoryAdaptiveContract) return ["off"];
|
|
25
|
+
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
26
|
+
const reasoningEfforts = resolveOpenAIThinkingApi(model.api) ? resolveOpenAIModelReasoningEfforts(model) : void 0;
|
|
27
|
+
const mappedLevels = listMappedModelThinkingLevels(model);
|
|
28
|
+
return MODEL_CATALOG_THINKING_LEVELS.filter((level) => {
|
|
29
|
+
const mapped = thinkingLevelMap?.[level];
|
|
30
|
+
if (mapped === null) return false;
|
|
31
|
+
if (level === "xhigh" || level === "max") return reasoningEfforts?.length !== 0 && (mapped !== void 0 || mappedLevels.includes(level) || reasoningEfforts?.includes(level) === true);
|
|
32
|
+
return true;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Clamps a requested thinking level to the closest supported level for a model. */
|
|
36
|
+
function clampThinkingLevel(model, level) {
|
|
37
|
+
const availableLevels = getSupportedThinkingLevels(model);
|
|
38
|
+
if (availableLevels.includes(level)) return level;
|
|
39
|
+
const requestedIndex = MODEL_CATALOG_THINKING_LEVELS.indexOf(level);
|
|
40
|
+
if (requestedIndex === -1) return availableLevels[0] ?? "off";
|
|
41
|
+
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
42
|
+
const lowerFirst = (level === "xhigh" || level === "max") && thinkingLevelMap?.[level] === null;
|
|
43
|
+
const lowerLevels = MODEL_CATALOG_THINKING_LEVELS.slice(0, requestedIndex).toReversed();
|
|
44
|
+
const upperLevels = MODEL_CATALOG_THINKING_LEVELS.slice(requestedIndex);
|
|
45
|
+
return (lowerFirst ? [...lowerLevels, ...upperLevels] : [...upperLevels, ...lowerLevels]).find((candidate) => availableLevels.includes(candidate)) ?? availableLevels[0] ?? "off";
|
|
46
|
+
}
|
|
47
|
+
/** Compares model identity by provider and id. */
|
|
48
|
+
function modelsAreEqual(a, b) {
|
|
49
|
+
if (!a || !b) return false;
|
|
50
|
+
return a.id === b.id && a.provider === b.provider;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
6
53
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
7
54
|
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
8
55
|
const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = `x-anthropic-billing-header: cc_version=${ANTHROPIC_CLAUDE_CODE_VERSION}; cc_entrypoint=sdk-cli;`;
|
|
@@ -30,13 +77,13 @@ function requiresClaudeAdaptiveThinking(model) {
|
|
|
30
77
|
if (normalizeApi(model.api) !== "anthropic-messages") return false;
|
|
31
78
|
return requiresClaudeMandatoryAdaptiveThinking(model);
|
|
32
79
|
}
|
|
33
|
-
/** Return whether omitted thinking should default to adaptive
|
|
80
|
+
/** Return whether omitted thinking should default to adaptive mode. */
|
|
34
81
|
function defaultsClaudeAdaptiveThinking(model) {
|
|
35
82
|
return requiresClaudeAdaptiveThinking(model) || normalizeApi(model.api) === "anthropic-messages" && (resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0);
|
|
36
83
|
}
|
|
37
84
|
/** Resolve provider-native effort once for direct and managed Claude requests. */
|
|
38
85
|
function resolveAnthropicThinkingEffort(model, level) {
|
|
39
|
-
const requestedLevel = level;
|
|
86
|
+
const requestedLevel = level ?? (resolveClaudeFable5ModelIdentity(model) ? CLAUDE_FABLE_5_THINKING_PROFILE.defaultLevel : void 0);
|
|
40
87
|
const thinkingLevelMap = resolveClaudeNativeThinkingLevelMap(model);
|
|
41
88
|
const clampModel = {
|
|
42
89
|
...model,
|
|
@@ -135,6 +182,31 @@ function resolveModelBoundThinkingReplayMode(params) {
|
|
|
135
182
|
return sourceApi === targetApi && sourceIdentity === targetIdentity ? "preserve" : "drop";
|
|
136
183
|
}
|
|
137
184
|
//#endregion
|
|
185
|
+
//#region packages/ai/src/utils/sanitize-unicode.ts
|
|
186
|
+
/**
|
|
187
|
+
* Removes unpaired Unicode surrogate characters from a string.
|
|
188
|
+
*
|
|
189
|
+
* Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
|
|
190
|
+
* or vice versa) cause JSON serialization errors in many API providers.
|
|
191
|
+
*
|
|
192
|
+
* Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
|
|
193
|
+
* surrogates and will NOT be affected by this function.
|
|
194
|
+
*
|
|
195
|
+
* @param text - The text to sanitize
|
|
196
|
+
* @returns The sanitized text with unpaired surrogates removed
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* // Valid emoji (properly paired surrogates) are preserved
|
|
200
|
+
* sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
|
|
201
|
+
*
|
|
202
|
+
* // Unpaired high surrogate is removed
|
|
203
|
+
* const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
|
|
204
|
+
* sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
|
|
205
|
+
*/
|
|
206
|
+
function sanitizeSurrogates(text) {
|
|
207
|
+
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
138
210
|
//#region packages/ai/src/providers/tool-result-text.ts
|
|
139
211
|
const STRUCTURED_TOOL_RESULT_MAX_CHARS = 8e3;
|
|
140
212
|
const IMAGE_TOOL_RESULT_TYPES = /* @__PURE__ */ new Set([
|
|
@@ -248,15 +320,22 @@ function extractToolResultBlockText(block) {
|
|
|
248
320
|
}
|
|
249
321
|
function extractToolResultText(blocks, options) {
|
|
250
322
|
const explicitTexts = [];
|
|
251
|
-
const
|
|
323
|
+
const structuredBlocks = [];
|
|
252
324
|
for (const block of blocks) {
|
|
325
|
+
if (!block || typeof block !== "object") continue;
|
|
326
|
+
if (block.type === "text") {
|
|
327
|
+
const text = extractToolResultBlockText(block);
|
|
328
|
+
if (text) explicitTexts.push(text);
|
|
329
|
+
} else structuredBlocks.push(block);
|
|
330
|
+
}
|
|
331
|
+
if (explicitTexts.length > 0 && !options?.includeStructured) return explicitTexts.join("\n");
|
|
332
|
+
const structuredTexts = [];
|
|
333
|
+
for (const block of structuredBlocks) {
|
|
253
334
|
const text = extractToolResultBlockText(block);
|
|
254
|
-
if (
|
|
255
|
-
if (block.type === "text") explicitTexts.push(text);
|
|
256
|
-
else structuredTexts.push(text);
|
|
335
|
+
if (text) structuredTexts.push(text);
|
|
257
336
|
}
|
|
258
337
|
if (explicitTexts.length > 0) {
|
|
259
|
-
if (
|
|
338
|
+
if (structuredTexts.length > 0) explicitTexts.push(truncateStructuredToolText(structuredTexts.join("\n")));
|
|
260
339
|
return explicitTexts.join("\n");
|
|
261
340
|
}
|
|
262
341
|
return truncateStructuredToolText(structuredTexts.join("\n"));
|
|
@@ -275,6 +354,49 @@ function formatToolResultText(params) {
|
|
|
275
354
|
return `${params.isError ? "[tool error] " : ""}${body}`;
|
|
276
355
|
}
|
|
277
356
|
//#endregion
|
|
357
|
+
//#region packages/ai/src/replay-turn-classification.ts
|
|
358
|
+
/** Returns true when an assistant turn contains only provider reasoning and blank text. */
|
|
359
|
+
function hasOnlyAssistantReasoningContent(message) {
|
|
360
|
+
if (message.role !== "assistant") return false;
|
|
361
|
+
const content = Array.isArray(message.content) ? message.content : message.content != null && typeof message.content === "object" ? [message.content] : [];
|
|
362
|
+
let hasThinking = false;
|
|
363
|
+
for (const block of content) {
|
|
364
|
+
if (!block || typeof block !== "object") return false;
|
|
365
|
+
if (!("type" in block)) return false;
|
|
366
|
+
if (block.type === "thinking" || block.type === "redacted_thinking") {
|
|
367
|
+
hasThinking = true;
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
if (block.type === "text" && "text" in block && typeof block.text === "string" && !block.text.trim()) continue;
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
return hasThinking;
|
|
374
|
+
}
|
|
375
|
+
/** Returns true when a token-limited turn contains only incomplete provider reasoning. */
|
|
376
|
+
function isReasoningOnlyLengthAssistantTurn(message) {
|
|
377
|
+
return message.stopReason === "length" && hasOnlyAssistantReasoningContent(message);
|
|
378
|
+
}
|
|
379
|
+
const STREAM_ERROR_FALLBACK_TEXT = "[assistant turn failed before producing content]";
|
|
380
|
+
function isStreamErrorFallbackContent(content) {
|
|
381
|
+
if (content == null) return true;
|
|
382
|
+
if (typeof content === "string") return !content.trim() || content.trim() === "[assistant turn failed before producing content]";
|
|
383
|
+
return Array.isArray(content) && content.every((value) => {
|
|
384
|
+
const block = asOptionalRecord(value);
|
|
385
|
+
return block && (block.type === "text" || block.type === "input_text" || block.type === "output_text") && typeof block.text === "string" && isStreamErrorFallbackContent(block.text);
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
const FAILED_ASSISTANT_REPLAY_TEXT = "[This turn failed before it completed. Do not redo its work without confirming with the user first.]";
|
|
389
|
+
/** Classify failed source content before model-specific thinking or tool projection. */
|
|
390
|
+
function resolveFailedAssistantReplay(message, options) {
|
|
391
|
+
if (message.role !== "assistant" || message.stopReason !== "error" && message.stopReason !== "aborted") return "keep";
|
|
392
|
+
const content = Array.isArray(message.content) ? message.content : [];
|
|
393
|
+
if (content.some((block) => asOptionalRecord(block)?.type === "toolCall")) return options.pairingAware ? "keep" : "drop";
|
|
394
|
+
return content.some((block) => {
|
|
395
|
+
const record = asOptionalRecord(block);
|
|
396
|
+
return record?.type === "text" && typeof record.text === "string" && !isStreamErrorFallbackContent(record.text);
|
|
397
|
+
}) ? "marker" : "drop";
|
|
398
|
+
}
|
|
399
|
+
//#endregion
|
|
278
400
|
//#region packages/ai/src/transcript-transform.ts
|
|
279
401
|
const NON_VISION_USER_IMAGE_PLACEHOLDER = "(image omitted: model does not support images)";
|
|
280
402
|
const NON_VISION_TOOL_IMAGE_PLACEHOLDER = "(tool image omitted: model does not support images)";
|
|
@@ -390,9 +512,20 @@ function transformMessages(messages, model, normalizeToolCallId) {
|
|
|
390
512
|
content: []
|
|
391
513
|
};
|
|
392
514
|
if (message.role === "assistant") {
|
|
515
|
+
const failedReplay = resolveFailedAssistantReplay(message, { pairingAware: false });
|
|
393
516
|
message = transformAssistant(message, model, toolCallIdMap, normalizeToolCallId);
|
|
394
517
|
flushToolCalls();
|
|
395
|
-
if (
|
|
518
|
+
if (failedReplay === "drop") continue;
|
|
519
|
+
if (failedReplay === "marker") {
|
|
520
|
+
result.push({
|
|
521
|
+
...message,
|
|
522
|
+
content: [{
|
|
523
|
+
type: "text",
|
|
524
|
+
text: FAILED_ASSISTANT_REPLAY_TEXT
|
|
525
|
+
}]
|
|
526
|
+
});
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
396
529
|
pendingToolCalls = message.content.filter((block) => {
|
|
397
530
|
if (block.type !== "toolCall") return false;
|
|
398
531
|
if (block.async) {
|
|
@@ -520,4 +653,4 @@ function resolveAiTransportHeaderSentinels(headers) {
|
|
|
520
653
|
return resolvedHeaders ?? headers;
|
|
521
654
|
}
|
|
522
655
|
//#endregion
|
|
523
|
-
export {
|
|
656
|
+
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,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import "./index-DaF2QbwS.mjs";
|
|
2
|
+
import { O as Model, d as Context, n as Api, q as StreamFn } from "./types-4_uVs5WH.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-Ba2Cv-ut.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.
|
|
@@ -113,6 +115,8 @@ interface AiTransportHost {
|
|
|
113
115
|
}): typeof fetch | undefined;
|
|
114
116
|
/** Resolves host-owned process-local secret sentinel substrings immediately before egress. */
|
|
115
117
|
resolveSecretSentinel(value: string): string;
|
|
118
|
+
/** Resolves visible headers and host-private request overrides before plugin handoff. */
|
|
119
|
+
unwrapModelTransportSentinels?<T extends Model>(model: T, boundary: string): T;
|
|
116
120
|
/** Redacts model-visible tool results without treating ordinary source assignments as secrets. */
|
|
117
121
|
redactModelVisibleSecrets<T>(value: T): T;
|
|
118
122
|
/** Redacts secret-bearing text in tool payload strings. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getAiTransportHost } from "./host-
|
|
1
|
+
import { n as getAiTransportHost } from "./host-B4MeUNBc.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,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-CaFUZN9B.mjs";
|
|
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, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-4_uVs5WH.mjs";
|
|
2
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CCoa-qSI.mjs";
|
|
3
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Ctzu2DhF.mjs";
|
|
5
4
|
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
5
|
type ClaudeModelRef = {
|
|
7
6
|
id?: string;
|
|
@@ -12,8 +11,6 @@ type ClaudeEffortModelRef = ClaudeModelRef & {
|
|
|
12
11
|
};
|
|
13
12
|
declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
14
13
|
readonly levels: readonly [{
|
|
15
|
-
readonly id: "minimal";
|
|
16
|
-
}, {
|
|
17
14
|
readonly id: "low";
|
|
18
15
|
}, {
|
|
19
16
|
readonly id: "medium";
|
|
@@ -21,12 +18,10 @@ declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
|
21
18
|
readonly id: "high";
|
|
22
19
|
}, {
|
|
23
20
|
readonly id: "xhigh";
|
|
24
|
-
}, {
|
|
25
|
-
readonly id: "adaptive";
|
|
26
21
|
}, {
|
|
27
22
|
readonly id: "max";
|
|
28
23
|
}];
|
|
29
|
-
readonly defaultLevel: "
|
|
24
|
+
readonly defaultLevel: "medium";
|
|
30
25
|
readonly preserveWhenCatalogReasoningFalse: true;
|
|
31
26
|
};
|
|
32
27
|
declare const CLAUDE_SONNET_5_THINKING_PROFILE: {
|
|
@@ -111,7 +106,7 @@ declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): Mo
|
|
|
111
106
|
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
112
107
|
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
113
108
|
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 };
|
|
109
|
+
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
110
|
}
|
|
116
111
|
//#endregion
|
|
117
112
|
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,9 @@
|
|
|
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
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import { a as
|
|
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-DK3wmS3e.mjs";
|
|
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-DaF2QbwS.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, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-4_uVs5WH.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CCoa-qSI.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Ctzu2DhF.mjs";
|
|
5
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-Ba2Cv-ut.mjs";
|
|
6
|
+
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-FZ1RA_qD.mjs";
|
|
8
7
|
//#region packages/ai/src/stream.d.ts
|
|
9
8
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
10
9
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -22,4 +21,4 @@ export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
|
22
21
|
};
|
|
23
22
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
24
23
|
//#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 };
|
|
24
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeResolvedPricing, s as bindsClaudeThinkingPrefix, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./src-
|
|
2
|
-
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeResolvedPricing, s as bindsClaudeThinkingPrefix, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./src-DeKjbE8I.mjs";
|
|
2
|
+
import { n as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE } from "./types-LFWwv0cF.mjs";
|
|
3
3
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
|
|
4
4
|
import { i as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Dw7cb6BV.mjs";
|
|
6
6
|
import { n as createApiRegistry, t as createLlmRuntime } from "./stream-CREqxHgU.mjs";
|
|
7
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-
|
|
8
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
7
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-B4MeUNBc.mjs";
|
|
8
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort } from "../index-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import
|
|
5
|
-
import "../
|
|
6
|
-
import { p as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-wuRCb6MH.mjs";
|
|
1
|
+
import { b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort } from "../index-DaF2QbwS.mjs";
|
|
2
|
+
import { G as SimpleStreamOptions, J as StreamFunction, K as StopReason, O as Model, d as Context, ot as Usage, ut as AssistantMessageDiagnostic } from "../types-4_uVs5WH.mjs";
|
|
3
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-DprLsWh9.mjs";
|
|
4
|
+
import "../types-DkJfb4W3.mjs";
|
|
5
|
+
import { p as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-5Erq1Nzy.mjs";
|
|
7
6
|
import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
|
|
8
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
9
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
@@ -53,7 +52,7 @@ export declare function requiresClaudeAdaptiveThinking(model: {
|
|
|
53
52
|
params?: Record<string, unknown>;
|
|
54
53
|
api?: string;
|
|
55
54
|
}): boolean;
|
|
56
|
-
/** Return whether omitted thinking should default to adaptive
|
|
55
|
+
/** Return whether omitted thinking should default to adaptive mode. */
|
|
57
56
|
export declare function defaultsClaudeAdaptiveThinking(model: {
|
|
58
57
|
id?: string;
|
|
59
58
|
params?: Record<string, unknown>;
|