@openclaw/ai 2026.8.1 → 2026.8.33
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-Djj7L1rx.mjs → anthropic-BNeFhAh3.mjs} +197 -185
- package/dist/{anthropic-compaction-replay-CY4tkD4V.mjs → anthropic-compaction-replay-B6sEzXhr.mjs} +24 -7
- package/dist/{anthropic-payload-policy-i_5_inWe.d.mts → anthropic-payload-policy-kkq8L7tJ.d.mts} +2 -2
- package/dist/{api-registry-C9-wZd_W.d.mts → api-registry-CAK4bNkq.d.mts} +2 -2
- package/dist/{azure-openai-responses-Bj3czHNa.mjs → azure-openai-responses-CPvqFff1.mjs} +6 -5
- package/dist/diagnostics.mjs +1 -1
- package/dist/event-stream-CDHaMazK.d.mts +1 -0
- package/dist/{event-stream-UhnxHuqt.d.mts → event-stream-DcQzYRWO.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/{google-0Ca6TYbw.mjs → google-B6pXyWB0.mjs} +7 -5
- package/dist/{google-shared-DVfL9COU.mjs → google-shared-C_3CT37v.mjs} +25 -23
- package/dist/{google-vertex-5dAMxprN.mjs → google-vertex-BA2c1toq.mjs} +7 -5
- package/dist/{host-DoPJJ1KD.d.mts → host-DL2Zd9ep.d.mts} +3 -3
- package/dist/{host-D51fmkH6.mjs → host-DhlhmyR6.mjs} +17 -2
- package/dist/index-DcGDVDnC.d.mts +118 -0
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +11 -6
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +7 -7
- package/dist/internal/openai.mjs +10 -10
- package/dist/internal/runtime.d.mts +5 -5
- package/dist/internal/runtime.mjs +3 -3
- package/dist/internal/shared.d.mts +2 -2
- package/dist/internal/shared.mjs +3 -3
- package/dist/{mistral-BCnrI-kV.mjs → mistral-CTcM9TGz.mjs} +18 -13
- package/dist/{openai-chatgpt-responses-CGBGWSqr.mjs → openai-chatgpt-responses-QqHf1o9v.mjs} +17 -16
- package/dist/{openai-completions-BaTuwID7.mjs → openai-completions-BCmKwgsc.mjs} +17 -14
- package/dist/{openai-completions-compat-DB7FFq7k.d.mts → openai-completions-compat-BJE92duO.d.mts} +3 -3
- package/dist/{openai-completions-stream-Bpns6uNc.mjs → openai-completions-stream-0mm4YUag.mjs} +30 -27
- package/dist/openai-prompt-cache-BUJI5cW-.d.mts +16 -0
- package/dist/openai-prompt-cache-CGnVB74a.mjs +21 -0
- package/dist/{openai-responses-compaction-window-DwydGZI8.mjs → openai-responses-compaction-window-vuCaZYLS.mjs} +3 -3
- package/dist/{openai-responses-contracts-DgaR3t5T.d.mts → openai-responses-contracts-DFJOyjd1.d.mts} +6 -3
- package/dist/{openai-responses-1GBcQujk.mjs → openai-responses-pMJVxhHW.mjs} +11 -12
- package/dist/{openai-responses-prompt-observer-internal-_nhGTn2b.mjs → openai-responses-prompt-observer-internal-COaImuDp.mjs} +3 -3
- package/dist/{openai-responses-shared-zPmKnhF5.mjs → openai-responses-shared-CZTRmOFP.mjs} +27 -26
- package/dist/{openai-tool-schema-Dgl4H2MU.mjs → openai-tool-schema-DjS9-DHe.mjs} +14 -12
- package/dist/{provider-error-jZP5NMTZ.mjs → provider-error-BI8kIViN.mjs} +11 -11
- package/dist/{provider-options-HvA_slFa.d.mts → provider-options-CedgbINH.d.mts} +2 -2
- package/dist/{provider-transcript-transform-C01bQ5a3.mjs → provider-transcript-transform-BnsgCK8K.mjs} +1 -1
- 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-CwzKb0bA.mjs → reasoning-tag-text-partitioner-BsUX44Tq.mjs} +29 -19
- package/dist/{sanitize-unicode-DCkltN94.mjs → sanitize-unicode-Cfcaqa9V.mjs} +2 -8
- package/dist/{simple-options-DKx86yX9.mjs → simple-options-Bwi0x0bX.mjs} +2 -2
- package/dist/{src-Bu3FiFAG.mjs → src-BhgSqnbz.mjs} +88 -2
- package/dist/{tool-schema-json-projection-qvTEs5Am.mjs → tool-schema-json-projection-_gcOC21Y.mjs} +21 -31
- package/dist/{transport-stream-shared-NjwWNaRY.d.mts → transport-stream-shared-B38NWYTa.d.mts} +4 -4
- package/dist/{transport-stream-shared-CT5ycdzn.mjs → transport-stream-shared-y1YR1k5K.mjs} +2 -2
- package/dist/{transport-utils-BHx9z8Cl.mjs → transport-utils-DdLjoPMb.mjs} +2 -2
- package/dist/transports.d.mts +12 -9
- package/dist/transports.mjs +91 -73
- package/dist/types-DmdQ-xcq.d.mts +1 -0
- package/dist/{types-h38Azne1.d.mts → types-DmeScJQe.d.mts} +25 -13
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +3 -3
- package/dist/{validation-B61OhAio.mjs → validation-CJZtym2g.mjs} +7 -5
- package/dist/{validation-C68lP2uy.d.mts → validation-DPDgbaD3.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +2 -2
- package/dist/event-stream-C988TSLe.d.mts +0 -1
- package/dist/index-N3zr6__t.d.mts +0 -105
- package/dist/openai-prompt-cache-2uo_1OR1.d.mts +0 -7
- package/dist/openai-prompt-cache-mZTCdRPo.mjs +0 -12
- package/dist/types-DtGu2d3C.d.mts +0 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.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-DhlhmyR6.mjs";
|
|
3
|
+
import { n as buildBaseOptions } from "./simple-options-Bwi0x0bX.mjs";
|
|
4
4
|
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
5
|
-
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
5
|
+
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-C_3CT37v.mjs";
|
|
6
6
|
import { GoogleGenAI } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google.ts
|
|
8
8
|
let toolCallCounter = 0;
|
|
9
9
|
const streamGoogle = (model, context, options) => {
|
|
10
10
|
const stream = new AssistantMessageEventStream();
|
|
11
|
+
const output = createGoogleAssistantOutput(model, "google-generative-ai");
|
|
11
12
|
runGoogleGenerateContentLifecycle({
|
|
12
13
|
stream,
|
|
13
14
|
model,
|
|
14
|
-
output
|
|
15
|
+
output,
|
|
15
16
|
options,
|
|
16
17
|
createClient: () => {
|
|
17
18
|
return createClient(model, options?.apiKey || getEnvApiKey(model.provider) || "", options?.headers);
|
|
@@ -43,8 +44,9 @@ function createClient(model, apiKey, optionsHeaders) {
|
|
|
43
44
|
...model.headers,
|
|
44
45
|
...optionsHeaders
|
|
45
46
|
});
|
|
47
|
+
const resolvedApiKey = apiKey ? getAiTransportHost().resolveSecretSentinel(apiKey) : void 0;
|
|
46
48
|
return new GoogleGenAI({
|
|
47
|
-
apiKey:
|
|
49
|
+
apiKey: resolvedApiKey,
|
|
48
50
|
httpOptions: Object.keys(httpOptions).length > 0 ? httpOptions : void 0
|
|
49
51
|
});
|
|
50
52
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as clampThinkingLevel, r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
2
|
-
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload } from "./host-
|
|
3
|
-
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-
|
|
4
|
-
import { _ as transportAbortError, n as coerceTransportToolCallArguments, p as notifyProviderStreamOpened, t as assignTransportErrorDetails } from "./transport-stream-shared-
|
|
1
|
+
import { i as clampThinkingLevel, r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-Cfcaqa9V.mjs";
|
|
2
|
+
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload } from "./host-DhlhmyR6.mjs";
|
|
3
|
+
import { d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName } from "./simple-options-Bwi0x0bX.mjs";
|
|
4
|
+
import { _ as transportAbortError, n as coerceTransportToolCallArguments, p as notifyProviderStreamOpened, t as assignTransportErrorDetails } from "./transport-stream-shared-y1YR1k5K.mjs";
|
|
5
5
|
import { t as googleFlashSupportsMinimalThinking } from "./google-thinking-level-C-V3tecN.mjs";
|
|
6
|
-
import { t as transformProviderMessages } from "./provider-transcript-transform-
|
|
6
|
+
import { t as transformProviderMessages } from "./provider-transcript-transform-BnsgCK8K.mjs";
|
|
7
7
|
import { FinishReason, FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
8
8
|
//#region packages/ai/src/providers/google-shared.ts
|
|
9
9
|
/**
|
|
@@ -94,25 +94,26 @@ function convertMessages(model, context) {
|
|
|
94
94
|
};
|
|
95
95
|
for (const msg of transformedMessages) {
|
|
96
96
|
if (msg.role !== "toolResult") flushToolResultRun();
|
|
97
|
-
if (msg.role === "user")
|
|
98
|
-
|
|
99
|
-
parts: [{ text: sanitizeSurrogates(msg.content) || " " }]
|
|
100
|
-
});
|
|
101
|
-
else {
|
|
102
|
-
const parts = msg.content.map((item) => {
|
|
103
|
-
if (item.type === "text") return { text: sanitizeSurrogates(item.text) || " " };
|
|
104
|
-
return { inlineData: {
|
|
105
|
-
mimeType: item.mimeType,
|
|
106
|
-
data: item.data
|
|
107
|
-
} };
|
|
108
|
-
});
|
|
109
|
-
if (parts.length === 0) parts.push({ text: " " });
|
|
110
|
-
contents.push({
|
|
97
|
+
if (msg.role === "user") {
|
|
98
|
+
if (typeof msg.content === "string") contents.push({
|
|
111
99
|
role: "user",
|
|
112
|
-
parts
|
|
100
|
+
parts: [{ text: sanitizeSurrogates(msg.content) || " " }]
|
|
113
101
|
});
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
else {
|
|
103
|
+
const parts = msg.content.map((item) => {
|
|
104
|
+
if (item.type === "text") return { text: sanitizeSurrogates(item.text) || " " };
|
|
105
|
+
return { inlineData: {
|
|
106
|
+
mimeType: item.mimeType,
|
|
107
|
+
data: item.data
|
|
108
|
+
} };
|
|
109
|
+
});
|
|
110
|
+
if (parts.length === 0) parts.push({ text: " " });
|
|
111
|
+
contents.push({
|
|
112
|
+
role: "user",
|
|
113
|
+
parts
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} else if (msg.role === "assistant") {
|
|
116
117
|
const parts = [];
|
|
117
118
|
let sawFunctionCall = false;
|
|
118
119
|
const isSameProviderAndModel = msg.provider === model.provider && msg.api === model.api && msg.model === model.id;
|
|
@@ -265,7 +266,8 @@ async function runGoogleGenerateContentLifecycle(params) {
|
|
|
265
266
|
});
|
|
266
267
|
} catch (error) {
|
|
267
268
|
for (const block of output.content) if ("index" in block) delete block.index;
|
|
268
|
-
|
|
269
|
+
const failure = options?.signal?.aborted ? transportAbortError(options.signal) : error;
|
|
270
|
+
assignTransportErrorDetails(output, failure, options?.signal);
|
|
269
271
|
stream.push({
|
|
270
272
|
type: "error",
|
|
271
273
|
reason: output.stopReason === "aborted" ? "aborted" : "error",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
2
|
import { d as normalizeOptionalString } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
3
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-DhlhmyR6.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-Bwi0x0bX.mjs";
|
|
5
|
+
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-C_3CT37v.mjs";
|
|
6
6
|
import { GoogleGenAI, ResourceScope } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
8
8
|
const API_VERSION = "v1";
|
|
@@ -10,10 +10,11 @@ const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
|
10
10
|
let toolCallCounter = 0;
|
|
11
11
|
const streamGoogleVertex = (model, context, options) => {
|
|
12
12
|
const stream = new AssistantMessageEventStream();
|
|
13
|
+
const output = createGoogleAssistantOutput(model, "google-vertex");
|
|
13
14
|
runGoogleGenerateContentLifecycle({
|
|
14
15
|
stream,
|
|
15
16
|
model,
|
|
16
|
-
output
|
|
17
|
+
output,
|
|
17
18
|
options,
|
|
18
19
|
createClient: () => {
|
|
19
20
|
const apiKey = resolveApiKey(options);
|
|
@@ -44,9 +45,10 @@ function createClient(model, project, location, optionsHeaders) {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
function createClientWithApiKey(model, apiKey, optionsHeaders) {
|
|
48
|
+
const resolvedApiKey = getAiTransportHost().resolveSecretSentinel(apiKey);
|
|
47
49
|
return new GoogleGenAI({
|
|
48
50
|
vertexai: true,
|
|
49
|
-
apiKey:
|
|
51
|
+
apiKey: resolvedApiKey,
|
|
50
52
|
apiVersion: API_VERSION,
|
|
51
53
|
httpOptions: buildHttpOptions(model, optionsHeaders)
|
|
52
54
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model,
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import "./index-DcGDVDnC.mjs";
|
|
2
|
+
import { D as Model, K as StreamFn, d as Context, n as Api } from "./types-DmeScJQe.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-CAK4bNkq.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 {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as supportsClaudeNativeMaxEffort, c as requiresClaudeDefaultSampling, f as resolveClaudeMythos5ModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, p as resolveClaudeNativeThinkingLevelMap, u as resolveClaudeFable5ModelIdentity, x as supportsClaudeNativeXhighEffort } from "./src-BhgSqnbz.mjs";
|
|
2
2
|
import { c as normalizeLowercaseStringOrEmpty, o as isRecord, t as truncateUtf16Safe } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
-
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-
|
|
3
|
+
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-Cfcaqa9V.mjs";
|
|
4
4
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
5
5
|
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
6
6
|
const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = `x-anthropic-billing-header: cc_version=${ANTHROPIC_CLAUDE_CODE_VERSION}; cc_entrypoint=sdk-cli;`;
|
|
@@ -107,6 +107,20 @@ function resolveReplayModelBoundIdentity(ref) {
|
|
|
107
107
|
const sonnetIdentity = resolveClaudeSonnet5ModelIdentity(modelRef);
|
|
108
108
|
return sonnetIdentity ? `sonnet:${sonnetIdentity}` : void 0;
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Fable 5.1 reads thinking from every earlier Claude generation (verified live:
|
|
112
|
+
* Opus 5, Sonnet 5, Opus 4.8 replay with no drops), while the API silently
|
|
113
|
+
* drops anything it cannot read. Moving onto it therefore keeps prior reasoning;
|
|
114
|
+
* every other cross-identity move, including unregistered Mythos targets, is
|
|
115
|
+
* still dropped here until its replay contract is proven separately.
|
|
116
|
+
*/
|
|
117
|
+
function readsPriorClaudeThinking(targetIdentity) {
|
|
118
|
+
return targetIdentity !== void 0 && /^fable:claude-fable-5-1(?=$|[^a-z0-9])/.test(targetIdentity);
|
|
119
|
+
}
|
|
120
|
+
function isClaudeReplaySource(ref) {
|
|
121
|
+
const modelId = hasConcreteResponseModel(ref) ? ref.responseModelId : ref.modelId;
|
|
122
|
+
return /(?:^|[-/])claude-/.test(normalizeModelId(modelId));
|
|
123
|
+
}
|
|
110
124
|
function resolveModelBoundThinkingReplayMode(params) {
|
|
111
125
|
const sourceApi = normalizeApi(params.source.api);
|
|
112
126
|
const targetApi = normalizeApi(params.target.api);
|
|
@@ -114,6 +128,7 @@ function resolveModelBoundThinkingReplayMode(params) {
|
|
|
114
128
|
const targetIdentity = resolveReplayModelBoundIdentity(params.target);
|
|
115
129
|
const sameRoute = normalizeLowercaseStringOrEmpty(params.source.provider) === normalizeLowercaseStringOrEmpty(params.target.provider) && sourceApi === targetApi && normalizeModelId(params.source.modelId) === normalizeModelId(params.target.modelId);
|
|
116
130
|
if (!sourceIdentity && !targetIdentity) return "default";
|
|
131
|
+
if (sourceApi === targetApi && readsPriorClaudeThinking(targetIdentity) && isClaudeReplaySource(params.source)) return "preserve";
|
|
117
132
|
if (!sourceIdentity && !hasConcreteResponseModel(params.source) && targetIdentity && sameRoute) return "preserve";
|
|
118
133
|
return sourceApi === targetApi && sourceIdentity === targetIdentity ? "preserve" : "drop";
|
|
119
134
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
2
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-DmeScJQe.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcQzYRWO.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DPDgbaD3.mjs";
|
|
5
|
+
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
|
+
type ClaudeModelRef = {
|
|
7
|
+
id?: string;
|
|
8
|
+
params?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
type ClaudeEffortModelRef = ClaudeModelRef & {
|
|
11
|
+
thinkingLevelMap?: Record<string, string | null | undefined>;
|
|
12
|
+
};
|
|
13
|
+
declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
14
|
+
readonly levels: readonly [{
|
|
15
|
+
readonly id: "minimal";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "low";
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "medium";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "high";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "xhigh";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "adaptive";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "max";
|
|
28
|
+
}];
|
|
29
|
+
readonly defaultLevel: "high";
|
|
30
|
+
readonly preserveWhenCatalogReasoningFalse: true;
|
|
31
|
+
};
|
|
32
|
+
declare const CLAUDE_SONNET_5_THINKING_PROFILE: {
|
|
33
|
+
readonly levels: readonly [{
|
|
34
|
+
readonly id: "off";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "minimal";
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "low";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "medium";
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "high";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "xhigh";
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "adaptive";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "max";
|
|
49
|
+
}];
|
|
50
|
+
readonly defaultLevel: "high";
|
|
51
|
+
};
|
|
52
|
+
declare const CLAUDE_OPUS_5_THINKING_PROFILE: {
|
|
53
|
+
readonly levels: readonly [{
|
|
54
|
+
readonly id: "off";
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "minimal";
|
|
57
|
+
}, {
|
|
58
|
+
readonly id: "low";
|
|
59
|
+
}, {
|
|
60
|
+
readonly id: "medium";
|
|
61
|
+
}, {
|
|
62
|
+
readonly id: "high";
|
|
63
|
+
}, {
|
|
64
|
+
readonly id: "xhigh";
|
|
65
|
+
}, {
|
|
66
|
+
readonly id: "adaptive";
|
|
67
|
+
}, {
|
|
68
|
+
readonly id: "max";
|
|
69
|
+
}];
|
|
70
|
+
readonly defaultLevel: "high";
|
|
71
|
+
};
|
|
72
|
+
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
73
|
+
declare function resolveClaudeModelIdentity(ref: ClaudeModelRef): string;
|
|
74
|
+
/** Resolve Claude Fable 5 through direct ids, cloud ids, or deployment metadata. */
|
|
75
|
+
declare function resolveClaudeFable5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
76
|
+
/** Resolve Claude Mythos 5 through direct ids, cloud ids, or deployment metadata. */
|
|
77
|
+
declare function resolveClaudeMythos5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
78
|
+
/** Resolve the Opus 5.5 contract without matching other Opus 5 generations. */
|
|
79
|
+
declare function resolveClaudeOpus55ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Prefix-bound thinking requires append-only runtime context. Extend this list
|
|
82
|
+
* only with live replay proof for the model (Mythos 5.1 remains unproven).
|
|
83
|
+
*/
|
|
84
|
+
declare function bindsClaudeThinkingPrefix(ref: ClaudeModelRef): boolean;
|
|
85
|
+
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
86
|
+
declare function requiresClaudeMandatoryAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
87
|
+
/** Resolve Claude Sonnet 5 through direct ids, cloud ids, or deployment metadata. */
|
|
88
|
+
declare function resolveClaudeSonnet5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
89
|
+
/** Resolve Claude Opus 5 through aliases, direct ids, cloud ids, or deployment metadata. */
|
|
90
|
+
declare function resolveClaudeOpus5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
91
|
+
/** Return whether a Claude model supports adaptive thinking. */
|
|
92
|
+
declare function supportsClaudeAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
93
|
+
/** Return whether a Claude model has a native 1M-token context window. */
|
|
94
|
+
declare function supportsClaude1MContext(ref: ClaudeModelRef): boolean;
|
|
95
|
+
/** Return whether a Claude model supports Anthropic's native fast mode. */
|
|
96
|
+
declare function supportsClaudeFastMode(ref: ClaudeModelRef): boolean;
|
|
97
|
+
/** Return whether a Claude model supports native max effort. */
|
|
98
|
+
declare function supportsClaudeNativeMaxEffort(ref: ClaudeModelRef): boolean;
|
|
99
|
+
/** Return whether a Claude model supports native xhigh effort. */
|
|
100
|
+
declare function supportsClaudeNativeXhighEffort(ref: ClaudeModelRef): boolean;
|
|
101
|
+
/** Return whether a Claude model rejects caller-selected sampling parameters. */
|
|
102
|
+
declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Fill native Claude effort mappings only when the provider did not publish a
|
|
105
|
+
* narrower route-specific contract.
|
|
106
|
+
*/
|
|
107
|
+
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region packages/llm-core/src/usage-cost.d.ts
|
|
110
|
+
declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostConfig;
|
|
111
|
+
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
112
|
+
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
113
|
+
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
114
|
+
declare namespace index_d_exports {
|
|
115
|
+
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, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
export { supportsClaudeNativeXhighEffort as S, resolveClaudeSonnet5ModelIdentity as _, CLAUDE_FABLE_5_THINKING_PROFILE as a, supportsClaudeFastMode as b, bindsClaudeThinkingPrefix as c, resolveClaudeFable5ModelIdentity as d, resolveClaudeModelIdentity as f, resolveClaudeOpus5ModelIdentity as g, resolveClaudeOpus55ModelIdentity 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, supportsClaude1MContext as v, supportsClaudeNativeMaxEffort as x, supportsClaudeAdaptiveThinking as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeFastMode, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeOpus5ModelIdentity, h as resolveClaudeOpus55ModelIdentity, 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 supportsClaude1MContext, x as supportsClaudeNativeMaxEffort, y as supportsClaudeAdaptiveThinking } from "./index-DcGDVDnC.mjs";
|
|
2
2
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import { $ as
|
|
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-
|
|
3
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-DmeScJQe.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcQzYRWO.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DPDgbaD3.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-CAK4bNkq.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-DL2Zd9ep.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, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, 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, 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, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaude1MContext, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus55ModelIdentity, 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 supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./src-BhgSqnbz.mjs";
|
|
2
2
|
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
|
|
3
3
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
4
4
|
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.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, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, 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-DhlhmyR6.mjs";
|
|
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, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeOpus5ModelIdentity, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, u as requiresClaudeMandatoryAdaptiveThinking, x as supportsClaudeNativeMaxEffort, y as supportsClaudeAdaptiveThinking } from "../index-DcGDVDnC.mjs";
|
|
2
2
|
import { t as AssistantMessageDiagnostic } from "../diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-
|
|
5
|
-
import "../types-
|
|
6
|
-
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-
|
|
3
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-DmeScJQe.mjs";
|
|
4
|
+
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-CedgbINH.mjs";
|
|
5
|
+
import "../types-DmdQ-xcq.mjs";
|
|
6
|
+
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-kkq8L7tJ.mjs";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
9
9
|
anthropicServerCompaction?: boolean;
|
|
@@ -131,6 +131,11 @@ export declare function applyAnthropicFallbackBoundary(params: {
|
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region packages/ai/src/providers/anthropic-thinking-replay.d.ts
|
|
133
133
|
export declare const ANTHROPIC_OMITTED_REASONING_TEXT = "[assistant reasoning omitted]";
|
|
134
|
+
export declare function applyAnthropicThinkingBindingControls(params: {
|
|
135
|
+
thinking?: unknown;
|
|
136
|
+
}, directApiKeyBetaHeader: string | undefined): Record<string, string> | undefined;
|
|
137
|
+
export declare function readAnthropicInputTransformations(event: unknown): unknown[] | undefined;
|
|
138
|
+
export declare function logAnthropicThinkingDrops(transformations: unknown[] | undefined): void;
|
|
134
139
|
/**
|
|
135
140
|
* Anthropic tool results continue the preceding assistant turn. Preserve that
|
|
136
141
|
* turn's signed thinking even when the next request disables new thinking.
|
|
@@ -223,4 +228,4 @@ export declare function applyAnthropicMessageStartUsage(target: Usage, payload:
|
|
|
223
228
|
/** Keep cumulative billing separate from the final server-side iteration context. */
|
|
224
229
|
export declare function applyAnthropicMessageDeltaUsage(target: Usage, payload: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
225
230
|
//#endregion
|
|
226
|
-
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
231
|
+
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-
|
|
3
|
-
import {
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
5
|
-
export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyClaudeRequestContract, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
1
|
+
import { b as supportsClaudeNativeMaxEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, p as resolveClaudeNativeThinkingLevelMap, s as bindsClaudeThinkingPrefix, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort } from "../src-BhgSqnbz.mjs";
|
|
2
|
+
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-DhlhmyR6.mjs";
|
|
3
|
+
import { B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, O as resolveAnthropicFallbackServingModelCost, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, T as CLAUDE_OPUS_FALLBACK_MODEL_COST, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, b as findActiveAnthropicToolTurnAssistantIndex, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as applyAnthropicRefusal, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "../anthropic-compaction-replay-B6sEzXhr.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-BNeFhAh3.mjs";
|
|
5
|
+
export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as OpenAIResponsesCompactionOutput, l as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
1
|
+
import { c as OpenAIResponsesCompactionOutput, l as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-DFJOyjd1.mjs";
|
|
2
2
|
import { i as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-payload-policy-rLRPsSmB.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, type OpenAIResponsesCompactionOutput, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as resolveOpenAIResponsesServerCompactionPlan, f as OPENAI_RESPONSES_APIS, r as readOpenAIResponsesCompactionWindow } from "../openai-responses-compaction-window-
|
|
1
|
+
import { c as resolveOpenAIResponsesServerCompactionPlan, f as OPENAI_RESPONSES_APIS, r as readOpenAIResponsesCompactionWindow } from "../openai-responses-compaction-window-vuCaZYLS.mjs";
|
|
2
2
|
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as supportsOpenAIReasoningEffort, S as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt54MiniModel, a as CodeModeToolSurfaceObservation, b as normalizeOpenAIReasoningEffort, c as codeModeToolSurfaceObserver, d as OpenAIToolProjection, f as projectOpenAITools, g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions, l as reasoningTagTextPolicy, m as reconcileOpenAIResponsesToolChoice, o as OpenAICompletionsOptions, p as reconcileOpenAICompletionsToolChoice, u as OpenAICompletionsToolChoice, v as isOpenAIGpt55Model, w as supportsOpenAITemperature, x as resolveOpenAIReasoningEffortForModel, y as isOpenAIGpt56Model } from "../provider-options-
|
|
3
|
-
import "../types-
|
|
4
|
-
import { o as ResponsesPromptObservation, s as responsesPromptObserver } from "../openai-responses-contracts-
|
|
5
|
-
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
6
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
1
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-DmeScJQe.mjs";
|
|
2
|
+
import { C as supportsOpenAIReasoningEffort, S as resolveOpenAISupportedReasoningEfforts, _ as isOpenAIGpt54MiniModel, a as CodeModeToolSurfaceObservation, b as normalizeOpenAIReasoningEffort, c as codeModeToolSurfaceObserver, d as OpenAIToolProjection, f as projectOpenAITools, g as OpenAIReasoningEffort, h as OpenAIApiReasoningEffort, i as BaseOpenAIStreamOptions, l as reasoningTagTextPolicy, m as reconcileOpenAIResponsesToolChoice, o as OpenAICompletionsOptions, p as reconcileOpenAICompletionsToolChoice, u as OpenAICompletionsToolChoice, v as isOpenAIGpt55Model, w as supportsOpenAITemperature, x as resolveOpenAIReasoningEffortForModel, y as isOpenAIGpt56Model } from "../provider-options-CedgbINH.mjs";
|
|
3
|
+
import "../types-DmdQ-xcq.mjs";
|
|
4
|
+
import { o as ResponsesPromptObservation, s as responsesPromptObserver } from "../openai-responses-contracts-DFJOyjd1.mjs";
|
|
5
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-BJE92duO.mjs";
|
|
6
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIResponsesCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-BUJI5cW-.mjs";
|
|
7
7
|
import OpenAI from "openai";
|
|
8
8
|
import { TSchema } from "typebox";
|
|
9
9
|
import { ResponseCreateParamsStreaming } from "openai/resources/responses/responses.js";
|
|
@@ -259,4 +259,4 @@ export type RuntimeToolInputSchemaProjection = {
|
|
|
259
259
|
/** Projects one runtime tool input schema to JSON and reports runtime incompatibilities. */
|
|
260
260
|
export declare function projectRuntimeToolInputSchema(schema: unknown, path?: string): RuntimeToolInputSchemaProjection;
|
|
261
261
|
//#endregion
|
|
262
|
-
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, OpenAICompletionsToolChoice, OpenAIReasoningEffort, OpenAIToolProjection, type ResponsesPromptObservation, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, normalizeOpenAIReasoningEffort, projectOpenAITools, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIReasoningEffortForModel, resolveOpenAISupportedReasoningEfforts, responsesPromptObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
262
|
+
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, OpenAICompletionsToolChoice, OpenAIReasoningEffort, OpenAIToolProjection, type ResponsesPromptObservation, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, normalizeOpenAIReasoningEffort, projectOpenAITools, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIReasoningEffortForModel, resolveOpenAIResponsesCacheParams, resolveOpenAISupportedReasoningEfforts, responsesPromptObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
package/dist/internal/openai.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
2
|
-
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy } from "../simple-options-
|
|
3
|
-
import { t as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-
|
|
4
|
-
import { g as convertMessages } from "../openai-completions-stream-
|
|
5
|
-
import { A as isAzureResponsesTextDeltaEvent, D as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, E as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, M as isResponsesTextContentPartType, N as isResponsesTextDeltaEventType, O as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, P as resolveResponsesMessageSnapshotCollapse, T as readResponsesToolCallItemIdentity, d as resolveResponsesTerminalStopReason, j as isAzureResponsesTextDeltaEventType, k as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as mapResponsesTerminalUsage, u as readResponsesReasoningTokens, w as createResponsesToolCallTracker } from "../openai-responses-shared-
|
|
6
|
-
import { _ as cleanSchemaForGemini, a as resolveOpenAIProjectedToolsStrictToolFlag, b as reconcileOpenAIResponsesToolChoice, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, f as stripUnsupportedSchemaKeywords, g as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, h as findLlamacppGbnfSchemaViolations, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as cleanSchemaForLlamacppGbnf, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as projectOpenAITools, y as reconcileOpenAICompletionsToolChoice } from "../openai-tool-schema-
|
|
7
|
-
import { A as supportsOpenAITemperature, C as isOpenAIGpt54MiniModel, D as resolveOpenAIReasoningEffortForModel, E as normalizeOpenAIReasoningEffort, O as resolveOpenAISupportedReasoningEfforts, S as responsesPromptObserver, T as isOpenAIGpt56Model, k as supportsOpenAIReasoningEffort, w as isOpenAIGpt55Model } from "../openai-responses-compaction-window-
|
|
1
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIResponsesCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-CGnVB74a.mjs";
|
|
2
|
+
import { a as codeModeToolSurfaceObserver, o as reasoningTagTextPolicy } from "../simple-options-Bwi0x0bX.mjs";
|
|
3
|
+
import { t as projectRuntimeToolInputSchema } from "../tool-schema-json-projection-_gcOC21Y.mjs";
|
|
4
|
+
import { g as convertMessages } from "../openai-completions-stream-0mm4YUag.mjs";
|
|
5
|
+
import { A as isAzureResponsesTextDeltaEvent, D as AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, E as AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, M as isResponsesTextContentPartType, N as isResponsesTextDeltaEventType, O as OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, P as resolveResponsesMessageSnapshotCollapse, T as readResponsesToolCallItemIdentity, d as resolveResponsesTerminalStopReason, j as isAzureResponsesTextDeltaEventType, k as OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, l as mapResponsesTerminalUsage, u as readResponsesReasoningTokens, w as createResponsesToolCallTracker } from "../openai-responses-shared-CZTRmOFP.mjs";
|
|
6
|
+
import { _ as cleanSchemaForGemini, a as resolveOpenAIProjectedToolsStrictToolFlag, b as reconcileOpenAIResponsesToolChoice, c as extractToolSchemaModelCompat, d as shouldOmitEmptyArrayItems, f as stripUnsupportedSchemaKeywords, g as GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, h as findLlamacppGbnfSchemaViolations, i as normalizeStrictOpenAIJsonSchema, l as normalizeToolParameterSchema, m as cleanSchemaForLlamacppGbnf, n as isStrictOpenAIJsonSchemaCompatible, o as findOpenAIStrictSchemaViolations, p as LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, r as normalizeOpenAIStrictToolParameters, s as normalizeOpenAIStrictCompatSchema, t as findOpenAIStrictToolProjectionDiagnostics, u as resolveUnsupportedToolSchemaKeywords, v as projectOpenAITools, y as reconcileOpenAICompletionsToolChoice } from "../openai-tool-schema-DjS9-DHe.mjs";
|
|
7
|
+
import { A as supportsOpenAITemperature, C as isOpenAIGpt54MiniModel, D as resolveOpenAIReasoningEffortForModel, E as normalizeOpenAIReasoningEffort, O as resolveOpenAISupportedReasoningEfforts, S as responsesPromptObserver, T as isOpenAIGpt56Model, k as supportsOpenAIReasoningEffort, w as isOpenAIGpt55Model } from "../openai-responses-compaction-window-vuCaZYLS.mjs";
|
|
8
8
|
import { t as mapOpenAIStopReason } from "../openai-stop-reason-Drnn_6Qj.mjs";
|
|
9
9
|
import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, r as parseAzureDeploymentNameMap, t as isOpenAICompatibleAzureResponsesBaseUrl } from "../azure-openai-responses-client-compat-C7K7QfUE.mjs";
|
|
10
|
-
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-
|
|
11
|
-
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-
|
|
12
|
-
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, clampOpenAIPromptCacheKey, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isStrictOpenAIJsonSchemaCompatible, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, parseAzureDeploymentNameMap, projectOpenAITools, projectRuntimeToolInputSchema, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIProjectedToolsStrictToolFlag, resolveOpenAIReasoningEffortForModel, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, resolveUnsupportedToolSchemaKeywords, responsesPromptObserver, shouldOmitEmptyArrayItems, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, stripUnsupportedSchemaKeywords, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
10
|
+
import { n as streamOpenAICompletions, r as streamSimpleOpenAICompletions } from "../openai-completions-BCmKwgsc.mjs";
|
|
11
|
+
import { n as streamOpenAIResponses, r as streamSimpleOpenAIResponses } from "../openai-responses-pMJVxhHW.mjs";
|
|
12
|
+
export { AZURE_RESPONSES_TEXT_CONTENT_PART_TYPE, AZURE_RESPONSES_TEXT_DELTA_EVENT_TYPE, GEMINI_UNSUPPORTED_SCHEMA_KEYWORDS, LLAMACPP_GBNF_MAX_REPETITION_THRESHOLD, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OPENAI_RESPONSES_OUTPUT_TEXT_CONTENT_PART_TYPE, OPENAI_RESPONSES_OUTPUT_TEXT_DELTA_EVENT_TYPE, clampOpenAIPromptCacheKey, cleanSchemaForGemini, cleanSchemaForLlamacppGbnf, codeModeToolSurfaceObserver, convertMessages, createResponsesToolCallTracker, extractToolSchemaModelCompat, findLlamacppGbnfSchemaViolations, findOpenAIStrictSchemaViolations, findOpenAIStrictToolProjectionDiagnostics, isAzureResponsesTextDeltaEvent, isAzureResponsesTextDeltaEventType, isOpenAICompatibleAzureResponsesBaseUrl, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isResponsesTextContentPartType, isResponsesTextDeltaEventType, isStrictOpenAIJsonSchemaCompatible, isTraditionalAzureOpenAIHost, mapOpenAIStopReason, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, normalizeOpenAIStrictCompatSchema, normalizeOpenAIStrictToolParameters, normalizeStrictOpenAIJsonSchema, normalizeToolParameterSchema, parseAzureDeploymentNameMap, projectOpenAITools, projectRuntimeToolInputSchema, readResponsesReasoningTokens, readResponsesToolCallItemIdentity, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveAzureDeploymentNameFromMap, resolveOpenAIProjectedToolsStrictToolFlag, resolveOpenAIReasoningEffortForModel, resolveOpenAIResponsesCacheParams, resolveOpenAISupportedReasoningEfforts, resolveResponsesMessageSnapshotCollapse, resolveResponsesTerminalStopReason, resolveUnsupportedToolSchemaKeywords, responsesPromptObserver, shouldOmitEmptyArrayItems, streamOpenAICompletions, streamOpenAIResponses, streamSimpleOpenAICompletions, streamSimpleOpenAIResponses, stripUnsupportedSchemaKeywords, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import { D as Model,
|
|
3
|
-
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-
|
|
4
|
-
import "../types-
|
|
1
|
+
import "../index-DcGDVDnC.mjs";
|
|
2
|
+
import { A as ModelThinkingLevel, D as Model, J as StreamOptions, V as ProviderStreamOptions, W as SimpleStreamOptions, a as AssistantMessage, at as Usage, d as Context, n as Api, s as AssistantMessageEventStreamContract } from "../types-DmeScJQe.mjs";
|
|
3
|
+
import { a as RegisteredApiProvider, t as ApiProvider } from "../api-registry-CAK4bNkq.mjs";
|
|
4
|
+
import "../types-DmdQ-xcq.mjs";
|
|
5
5
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
6
|
-
import { C as FirstStreamEventInternalOptions, D as getFirstStreamEventTimeoutHandler, E as createFirstStreamEventTimeoutError, O as getFirstStreamEventTimeoutMs, S as FirstStreamEventAbortController, T as createFirstStreamEventAbortController, g as parseTerminalToolCallArguments, k as withFirstStreamEventTimeout, w as FirstStreamEventTimeoutContext } from "../transport-stream-shared-
|
|
6
|
+
import { C as FirstStreamEventInternalOptions, D as getFirstStreamEventTimeoutHandler, E as createFirstStreamEventTimeoutError, O as getFirstStreamEventTimeoutMs, S as FirstStreamEventAbortController, T as createFirstStreamEventAbortController, g as parseTerminalToolCallArguments, k as withFirstStreamEventTimeout, w as FirstStreamEventTimeoutContext } from "../transport-stream-shared-B38NWYTa.mjs";
|
|
7
7
|
//#region packages/ai/src/internal/default-runtime.d.ts
|
|
8
8
|
export declare const defaultApiRegistry: {
|
|
9
9
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { n as createApiRegistry, t as createLlmRuntime } from "../stream-CREqxHgU.mjs";
|
|
2
|
-
import { a as getSupportedThinkingLevels, i as clampThinkingLevel, n as applyProviderReportedUsageCost, o as modelsAreEqual, r as calculateCost, t as sanitizeSurrogates } from "../sanitize-unicode-
|
|
2
|
+
import { a as getSupportedThinkingLevels, i as clampThinkingLevel, n as applyProviderReportedUsageCost, o as modelsAreEqual, r as calculateCost, t as sanitizeSurrogates } from "../sanitize-unicode-Cfcaqa9V.mjs";
|
|
3
3
|
import { n as getEnvApiKey, t as findEnvKeys } from "../env-api-keys-bktO00EJ.mjs";
|
|
4
|
-
import { C as headersToRecord, m as parseTerminalToolCallArguments } from "../transport-stream-shared-
|
|
4
|
+
import { C as headersToRecord, m as parseTerminalToolCallArguments } from "../transport-stream-shared-y1YR1k5K.mjs";
|
|
5
5
|
import { t as createDeferredEventBuffer } from "../deferred-event-buffer-DAvyP7qA.mjs";
|
|
6
6
|
import { i as repairJson, n as parseJsonWithRepair, r as parseStreamingJson, t as createToolArgumentPreviewSchedule } from "../json-parse-BuAJEbdW.mjs";
|
|
7
7
|
import { n as onLlmRequestActivity, t as notifyLlmRequestActivity } from "../llm-request-activity-BjtkplhG.mjs";
|
|
8
8
|
import { t as shortHash } from "../hash-CHgqbJmD.mjs";
|
|
9
9
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, n as createFirstStreamEventTimeoutError, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "../stream-first-event-timeout-DcNjoFQE.mjs";
|
|
10
|
-
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-
|
|
10
|
+
import { t as createReasoningTagTextPartitioner } from "../reasoning-tag-text-partitioner-BsUX44Tq.mjs";
|
|
11
11
|
import { t as createSseByteGuard } from "../streaming-byte-guard-CC-HMn_u.mjs";
|
|
12
12
|
import { n as registerSessionResourceCleanup, t as cleanupSessionResources } from "../session-resources-CkR4WWy1.mjs";
|
|
13
13
|
import { n as resolveOpenAICodexAccountId, t as decodeOpenAICodexJwtPayload } from "../openai-chatgpt-jwt-KWcgd0d_.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as Model, E as Message, J as
|
|
2
|
-
import "../types-
|
|
1
|
+
import { $ as ThinkingLevel, D as Model, E as Message, J as StreamOptions, W as SimpleStreamOptions, Z as ThinkingBudgets, a as AssistantMessage, n as Api } from "../types-DmeScJQe.mjs";
|
|
2
|
+
import "../types-DmdQ-xcq.mjs";
|
|
3
3
|
import { t as sanitizeSurrogates } from "../sanitize-unicode-BZiVbGwK.mjs";
|
|
4
4
|
import { n as normalizeStructuredPromptSection, r as sortPromptCacheToolsByName, t as normalizePromptCapabilityIds } from "../prompt-cache-stability-Cwcjv_fx.mjs";
|
|
5
5
|
//#region packages/ai/src/providers/simple-options.d.ts
|
package/dist/internal/shared.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as sanitizeSurrogates } from "../sanitize-unicode-
|
|
2
|
-
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, i as transformMessages, l as formatToolResultText, o as describeUnsupportedToolResultMedia, s as extractToolResultBlockText, u as hasMediaPayload } from "../host-
|
|
3
|
-
import { c as ensureSystemPromptCacheBoundary, d as stripSystemPromptCacheBoundary, f as normalizePromptCapabilityIds, i as clampReasoning, l as prependSystemPromptAdditionAfterCacheBoundary, m as sortPromptCacheToolsByName, n as buildBaseOptions, p as normalizeStructuredPromptSection, r as clampMaxTokensToModel, s as SYSTEM_PROMPT_CACHE_BOUNDARY, t as adjustMaxTokensForThinking, u as splitSystemPromptCacheBoundary } from "../simple-options-
|
|
1
|
+
import { t as sanitizeSurrogates } from "../sanitize-unicode-Cfcaqa9V.mjs";
|
|
2
|
+
import { a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, i as transformMessages, l as formatToolResultText, o as describeUnsupportedToolResultMedia, s as extractToolResultBlockText, u as hasMediaPayload } from "../host-DhlhmyR6.mjs";
|
|
3
|
+
import { c as ensureSystemPromptCacheBoundary, d as stripSystemPromptCacheBoundary, f as normalizePromptCapabilityIds, i as clampReasoning, l as prependSystemPromptAdditionAfterCacheBoundary, m as sortPromptCacheToolsByName, n as buildBaseOptions, p as normalizeStructuredPromptSection, r as clampMaxTokensToModel, s as SYSTEM_PROMPT_CACHE_BOUNDARY, t as adjustMaxTokensForThinking, u as splitSystemPromptCacheBoundary } from "../simple-options-Bwi0x0bX.mjs";
|
|
4
4
|
import { t as inspectTlsCertificateError } from "../tls-certificate-errors-DXSpluKI.mjs";
|
|
5
5
|
export { SYSTEM_PROMPT_CACHE_BOUNDARY, adjustMaxTokensForThinking, buildBaseOptions, clampMaxTokensToModel, clampReasoning, describeToolResultMediaPlaceholder, describeUnsupportedToolResultMedia, ensureSystemPromptCacheBoundary, extractToolResultBlockText, extractToolResultText, formatToolResultText, hasMediaPayload, inspectTlsCertificateError, isImageWithMediaPayload, normalizePromptCapabilityIds, normalizeStructuredPromptSection, prependSystemPromptAdditionAfterCacheBoundary, sanitizeSurrogates, sortPromptCacheToolsByName, splitSystemPromptCacheBoundary, stripSystemPromptCacheBoundary, transformMessages };
|