@openclaw/ai 2026.10.1-beta.2 → 2026.10.5-beta.1
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 +6 -0
- package/dist/{anthropic-CZv6XFER.mjs → anthropic-BAHKgWam.mjs} +30 -59
- package/dist/{anthropic-payload-policy-BhCcgNdm.d.mts → anthropic-payload-policy-DGblkHL5.d.mts} +19 -16
- package/dist/{anthropic-stream-reducer-BQ1tjd7x.mjs → anthropic-stream-reducer-g6w1YVii.mjs} +197 -285
- package/dist/{api-registry-DpU0Rj-I.d.mts → api-registry-BhXXYdRA.d.mts} +2 -2
- package/dist/assistant-message-events-CHMJgbhs.mjs +18 -0
- package/dist/{assistant-output-OLm-Oln0.mjs → assistant-output-CUEeSotf.mjs} +2 -2
- package/dist/{assistant-text-phase-Bl1aDCB7.mjs → assistant-text-phase-BrV8KdFO.mjs} +7 -6
- package/dist/{azure-openai-responses-DH7bd3QT.mjs → azure-openai-responses-C7qBuR23.mjs} +8 -9
- package/dist/{credential-redaction-BKv49aiv.d.mts → credential-redaction-BHxruEH6.d.mts} +3 -1
- package/dist/{diagnostics-Caj-4RBA.mjs → diagnostics-tQasYct1.mjs} +10 -3
- package/dist/diagnostics.d.mts +7 -7
- package/dist/diagnostics.mjs +3 -3
- package/dist/{env-api-keys-CyX4VKGO.mjs → env-api-keys-CrxwdylR.mjs} +24 -35
- package/dist/event-stream-6UNs-AhN.d.mts +1 -0
- package/dist/{event-stream-DrRM_90c.d.mts → event-stream-BcqWLo_u.d.mts} +1 -1
- package/dist/{event-stream-C5AbCAaZ.mjs → event-stream-X2gmsUWv.mjs} +5 -8
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/google-Boz2QcpK.mjs +20 -0
- package/dist/{google-interactions-wrnE6MLw.mjs → google-interactions-tjAb1mc5.mjs} +52 -84
- package/dist/{google-messages-BwPPycw6.mjs → google-messages-C-RZzloH.mjs} +25 -35
- package/dist/google-provider-stream-CMImyxbX.mjs +58 -0
- package/dist/{google-shared-Eql1OMPU.mjs → google-shared-OyAtMTZv.mjs} +6 -15
- package/dist/google-vertex-hCxTJea7.mjs +40 -0
- package/dist/{host-BinBeGcQ.d.mts → host-CTDz7LXD.d.mts} +6 -3
- package/dist/{host-DCW52iHe.mjs → host-JWXZWa-c.mjs} +12 -8
- package/dist/{host-policy-B3jc4Rpn.mjs → host-policy-q4Azym9F.mjs} +1 -1
- package/dist/{index-a8e_oKnu.d.mts → index-BYDvopUB.d.mts} +27 -6
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +7 -6
- package/dist/internal/anthropic.d.mts +6 -6
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-completions-compat.d.mts +1 -1
- package/dist/internal/openai-completions-compat.mjs +1 -1
- package/dist/internal/openai-responses-payload-policy.d.mts +8 -1
- package/dist/internal/openai-responses-payload-policy.mjs +3 -3
- package/dist/internal/openai.d.mts +9 -9
- package/dist/internal/openai.mjs +9 -11
- package/dist/internal/runtime.d.mts +14 -11
- package/dist/internal/runtime.mjs +10 -13
- package/dist/internal/shared.d.mts +5 -5
- package/dist/internal/shared.mjs +6 -7
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{llm-request-activity-D8f_oxHj.mjs → llm-request-activity-CfMuh5cC.mjs} +2 -2
- package/dist/{mistral-DSt4vQAO.mjs → mistral-DUveP4hF.mjs} +71 -146
- package/dist/{model-transport-url-C5f59L3Y.d.mts → model-transport-url-BrsjjdjR.d.mts} +5 -1
- package/dist/{number-coercion-V8-BhME4.mjs → number-coercion-C3hztWoY.mjs} +5 -4
- package/dist/{openai-chatgpt-responses-BC2x0Oqx.mjs → openai-chatgpt-responses-OCwckGhY.mjs} +173 -242
- package/dist/{openai-completions-DNyHnXKg.mjs → openai-completions-DOltBUe9.mjs} +7 -6
- package/dist/{openai-completions-compat-BYdYpXhU.d.mts → openai-completions-compat-i-nLZxFy.d.mts} +10 -11
- package/dist/{openai-completions-compat-BdmlhD4u.mjs → openai-completions-compat-pg1q4uNG.mjs} +10 -6
- package/dist/openai-completions-transport-OMrn7gnZ.mjs +3319 -0
- package/dist/{openai-prompt-cache-I8YQTzf8.mjs → openai-prompt-cache-Cr2xKVrS.mjs} +1 -1
- package/dist/{openai-prompt-cache-45-AH_xv.d.mts → openai-prompt-cache-DIPMrMFy.d.mts} +2 -2
- package/dist/{openai-responses-uZ5oWSp7.mjs → openai-responses-BSBJUA19.mjs} +9 -10
- package/dist/{openai-responses-compaction-replay-BClApUIf.d.mts → openai-responses-compaction-replay-B2FE4Nw8.d.mts} +4 -4
- package/dist/{openai-responses-contracts-Br5IIw_h.d.mts → openai-responses-contracts-DKqMJ1Ct.d.mts} +9 -4
- package/dist/{openai-responses-contracts-BKu8O7l4.mjs → openai-responses-contracts-DlKMMTxK.mjs} +26 -6
- package/dist/{openai-responses-compaction-window-m878aVpU.mjs → openai-responses-endpoint-CinGh4VZ.mjs} +14 -4
- package/dist/{openai-responses-prompt-observer-internal-CCg7B6l4.mjs → openai-responses-request-lifecycle-D2IFiI0-.mjs} +39 -4
- package/dist/{openai-responses-shared-C7oVyjED.mjs → openai-responses-shared-DVGhq5xF.mjs} +1036 -327
- package/dist/{openai-responses-terminal-usage-DgImcyJu.d.mts → openai-responses-terminal-usage-BygjiAdi.d.mts} +2 -2
- package/dist/{openai-tool-schema-DYNePiF8.mjs → openai-tool-schema-DDPXsvJP.mjs} +236 -399
- package/dist/{positive-integer-CwLi8LUL.mjs → positive-integer-CqWjqSi9.mjs} +1 -1
- package/dist/{provider-error-DQBE1bUQ.mjs → provider-error-CF9GWCs2.mjs} +5 -3
- package/dist/{provider-options-D5ABCV_l.d.mts → provider-options-CVrXZBtA.d.mts} +3 -2
- package/dist/{provider-transport-turn-state-_M2kLdUE.mjs → provider-transport-turn-state-LuCaTsSO.mjs} +2 -2
- package/dist/{provider-types-F8Mqc9Ma.d.mts → provider-types-CHtRx0dI.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -6
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +12 -12
- package/dist/{reasoning-tag-text-partitioner-Ju9VpUGl.mjs → reasoning-tag-text-partitioner-0-Rsezog.mjs} +13 -12
- package/dist/{required-api-key-D4kn3252.mjs → required-api-key-CFJvcFy_.mjs} +1 -1
- package/dist/{simple-options-BkKTXxhp.mjs → simple-options-BARFAzk9.mjs} +9 -11
- package/dist/{src-B0NIt2UK.mjs → src-C_wfIUmV.mjs} +35 -10
- package/dist/{stream-DSdzKsDK.mjs → stream-DwrETW0_.mjs} +12 -21
- package/dist/{stream-first-event-timeout-D9ZmL_s9.mjs → stream-first-event-timeout-Dc42hKv6.mjs} +8 -21
- package/dist/{streaming-byte-guard-CC-HMn_u.mjs → streaming-byte-guard-DBXr1XYn.mjs} +16 -1
- package/dist/{string-normalization-PN10hf6d.mjs → string-normalization-I3ux50s9.mjs} +1 -1
- package/dist/{text-signature-MLwfi6fq.mjs → text-signature-B_MB6U_9.mjs} +32 -5
- package/dist/{tool-schema-json-projection-Ct8SeBeJ.mjs → tool-schema-json-projection-B8sG1I9v.mjs} +29 -23
- package/dist/{transport-stream-shared-BcAKh2XH.d.mts → transport-stream-shared-BmpzDtdQ.d.mts} +4 -4
- package/dist/{transport-stream-shared-CxXXz_Dd.mjs → transport-stream-shared-DH08b7Il.mjs} +31 -20
- package/dist/transports.d.mts +33 -22
- package/dist/transports.mjs +73 -1234
- package/dist/{types-DvzmWW8J.d.mts → types-Bd2T86VJ.d.mts} +5 -23
- package/dist/types-Kdfw_04V.d.mts +1 -0
- package/dist/types.d.mts +6 -6
- package/dist/types.mjs +5 -4
- package/dist/{validation-B3lQt_VE.d.mts → validation-DdGB1yy3.d.mts} +1 -1
- package/dist/{validation-DbqlIfDn.mjs → validation-opC2pjk9.mjs} +2 -3
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +4 -4
- package/dist/event-stream-DqDQWqiy.d.mts +0 -1
- package/dist/google-1WLOtb8w.mjs +0 -54
- package/dist/google-vertex-0LrlRoO3.mjs +0 -88
- package/dist/openai-completions-transport-DWM2mQDB.mjs +0 -2081
- package/dist/openai-responses-request-lifecycle-Fsag-IGZ.mjs +0 -36
- package/dist/openai-transport-params-JFsnIyto.mjs +0 -735
- package/dist/openai-web-search-tools-Cfu0uLyN.mjs +0 -14
- package/dist/provider-replay-context-C7Bmi84a.mjs +0 -25
- package/dist/types-BuiEBM3u.d.mts +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as appendAssistantThinking } from "./event-stream-
|
|
2
|
-
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-
|
|
3
|
-
import { P as sanitizeSurrogates, a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-
|
|
4
|
-
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-
|
|
5
|
-
import { t as notifyLlmRequestActivity } from "./llm-request-activity-
|
|
1
|
+
import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
+
import { N as isImageWithMediaPayload, O as calculateCost } from "./host-JWXZWa-c.mjs";
|
|
3
|
+
import { P as sanitizeSurrogates, a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-DH08b7Il.mjs";
|
|
4
|
+
import { D as sortPromptCacheToolsByName, d as describeToolResultMediaPlaceholder, m as extractToolResultText } from "./simple-options-BARFAzk9.mjs";
|
|
5
|
+
import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
|
|
6
6
|
//#region packages/ai/src/transports/google-thinking-level.ts
|
|
7
7
|
/** Returns whether a Gemini Flash model accepts the MINIMAL thinking level. */
|
|
8
8
|
function googleFlashSupportsMinimalThinking(modelId) {
|
|
@@ -217,6 +217,10 @@ async function consumeGoogleGenerateContentStream(params) {
|
|
|
217
217
|
}
|
|
218
218
|
endCurrentBlock();
|
|
219
219
|
if (params.signal?.aborted) throw transportAbortError(params.signal);
|
|
220
|
+
if (!sawTerminalReason) terminalGenerationError = Object.assign(/* @__PURE__ */ new Error("Google stream ended before a terminal finish reason"), {
|
|
221
|
+
code: "STREAM_INCOMPLETE",
|
|
222
|
+
type: "google_incomplete_stream"
|
|
223
|
+
});
|
|
220
224
|
if (terminalGenerationError) {
|
|
221
225
|
if (preserveParts) {
|
|
222
226
|
params.output.errorCode = terminalGenerationError.code;
|
|
@@ -224,16 +228,6 @@ async function consumeGoogleGenerateContentStream(params) {
|
|
|
224
228
|
}
|
|
225
229
|
throw terminalGenerationError;
|
|
226
230
|
}
|
|
227
|
-
if (!sawTerminalReason) {
|
|
228
|
-
if (preserveParts) {
|
|
229
|
-
params.output.errorCode = "STREAM_INCOMPLETE";
|
|
230
|
-
params.output.errorType = "google_incomplete_stream";
|
|
231
|
-
}
|
|
232
|
-
throw Object.assign(/* @__PURE__ */ new Error("Google stream ended before a terminal finish reason"), {
|
|
233
|
-
code: "STREAM_INCOMPLETE",
|
|
234
|
-
type: "google_incomplete_stream"
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
231
|
if (params.output.stopReason === "aborted" || params.output.stopReason === "error") throw new Error("An unknown error occurred");
|
|
238
232
|
params.stream.push({
|
|
239
233
|
type: "done",
|
|
@@ -291,27 +285,23 @@ function projectGoogleMessages(params) {
|
|
|
291
285
|
for (const msg of transformedMessages) {
|
|
292
286
|
if (msg.role !== "toolResult") flushToolResultRun();
|
|
293
287
|
if (msg.role === "user") {
|
|
294
|
-
const
|
|
295
|
-
|
|
288
|
+
const parts = (typeof msg.content === "string" ? [{
|
|
289
|
+
type: "text",
|
|
290
|
+
text: msg.content
|
|
291
|
+
}] : msg.content).map((item) => {
|
|
292
|
+
if (item.type === "text") return { text: sanitizeText(item.text) || " " };
|
|
293
|
+
if (managed && item.type === "video") return params.videoPart?.(item) ?? { text: "(video omitted: native video slot unavailable)" };
|
|
294
|
+
return { inlineData: {
|
|
295
|
+
mimeType: item.mimeType,
|
|
296
|
+
data: item.data
|
|
297
|
+
} };
|
|
298
|
+
});
|
|
299
|
+
const visibleParts = managed && !model.input.includes("image") ? parts.filter((part) => !part.inlineData) : parts;
|
|
300
|
+
if (visibleParts.length === 0) visibleParts.push({ text: " " });
|
|
301
|
+
contents.push({
|
|
296
302
|
role: "user",
|
|
297
|
-
parts:
|
|
303
|
+
parts: visibleParts
|
|
298
304
|
});
|
|
299
|
-
else {
|
|
300
|
-
const parts = sourceContent.map((item) => {
|
|
301
|
-
if (item.type === "text") return { text: sanitizeText(item.text) || " " };
|
|
302
|
-
if (managed && item.type === "video") return params.videoPart?.(item) ?? { text: "(video omitted: native video slot unavailable)" };
|
|
303
|
-
return { inlineData: {
|
|
304
|
-
mimeType: item.mimeType,
|
|
305
|
-
data: item.data
|
|
306
|
-
} };
|
|
307
|
-
});
|
|
308
|
-
const visibleParts = managed && !model.input.includes("image") ? parts.filter((part) => !part.inlineData) : parts;
|
|
309
|
-
if (visibleParts.length === 0) visibleParts.push({ text: " " });
|
|
310
|
-
contents.push({
|
|
311
|
-
role: "user",
|
|
312
|
-
parts: visibleParts
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
305
|
} else if (msg.role === "assistant") {
|
|
316
306
|
const parts = [];
|
|
317
307
|
let sawFunctionCall = false;
|
|
@@ -357,7 +347,7 @@ function projectGoogleMessages(params) {
|
|
|
357
347
|
const hasImages = imageContent.length > 0;
|
|
358
348
|
const mediaPlaceholder = describeToolResultMediaPlaceholder(msg.content);
|
|
359
349
|
const modelSupportsMultimodalFunctionResponse = supportsMultimodalFunctionResponse(model.id);
|
|
360
|
-
const responseValue = hasText ?
|
|
350
|
+
const responseValue = hasText ? textResult : mediaPlaceholder ?? "";
|
|
361
351
|
const imageParts = imageContent.map((imageBlock) => ({ inlineData: {
|
|
362
352
|
mimeType: imageBlock.mimeType,
|
|
363
353
|
data: imageBlock.data
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
2
|
+
import { a as resolveAiTransportHeaderSentinels } from "./host-JWXZWa-c.mjs";
|
|
3
|
+
import { n as buildManagedModelFetch } from "./host-policy-q4Azym9F.mjs";
|
|
4
|
+
import { f as mergeTransportHeaders } from "./transport-stream-shared-DH08b7Il.mjs";
|
|
5
|
+
import { n as buildBaseOptions } from "./simple-options-BARFAzk9.mjs";
|
|
6
|
+
import { t as createAssistantOutput } from "./assistant-output-CUEeSotf.mjs";
|
|
7
|
+
import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-OyAtMTZv.mjs";
|
|
8
|
+
import { ResourceScope } from "@google/genai";
|
|
9
|
+
//#region packages/ai/src/providers/google-http-options.ts
|
|
10
|
+
function buildGoogleHttpOptions(model, optionsHeaders, profile) {
|
|
11
|
+
const httpOptions = {};
|
|
12
|
+
const fetcher = buildManagedModelFetch(model);
|
|
13
|
+
if (fetcher) httpOptions.fetch = fetcher;
|
|
14
|
+
if (profile === "vertex") {
|
|
15
|
+
const baseUrl = model.baseUrl.trim();
|
|
16
|
+
if (baseUrl && !baseUrl.includes("{location}")) {
|
|
17
|
+
httpOptions.baseUrl = baseUrl;
|
|
18
|
+
httpOptions.baseUrlResourceScope = ResourceScope.COLLECTION;
|
|
19
|
+
const url = URL.parse(baseUrl);
|
|
20
|
+
if (url ? url.pathname.split("/").some((part) => /^v\d+(?:beta\d*)?$/.test(part)) : /(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(baseUrl)) httpOptions.apiVersion = "";
|
|
21
|
+
}
|
|
22
|
+
} else if (model.baseUrl) {
|
|
23
|
+
httpOptions.baseUrl = model.baseUrl;
|
|
24
|
+
httpOptions.apiVersion = "";
|
|
25
|
+
}
|
|
26
|
+
if (model.headers || optionsHeaders) httpOptions.headers = resolveAiTransportHeaderSentinels(profile === "vertex" ? {
|
|
27
|
+
...model.headers,
|
|
28
|
+
...optionsHeaders
|
|
29
|
+
} : mergeTransportHeaders(model.headers, optionsHeaders));
|
|
30
|
+
return Object.keys(httpOptions).length > 0 ? httpOptions : void 0;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region packages/ai/src/providers/google-provider-stream.ts
|
|
34
|
+
function createGoogleGenerateContentStreams(api, createClient, resolveSimpleApiKey) {
|
|
35
|
+
let toolCallCounter = 0;
|
|
36
|
+
const stream = (model, context, options) => {
|
|
37
|
+
const events = new AssistantMessageEventStream();
|
|
38
|
+
runGoogleGenerateContentLifecycle({
|
|
39
|
+
stream: events,
|
|
40
|
+
model,
|
|
41
|
+
output: createAssistantOutput(model, api),
|
|
42
|
+
options,
|
|
43
|
+
createClient: () => createClient(model, options),
|
|
44
|
+
buildParams: () => buildGoogleGenerateContentParams(model, context, options),
|
|
45
|
+
nextToolCallId: (name) => `${name}_${Date.now()}_${++toolCallCounter}`
|
|
46
|
+
});
|
|
47
|
+
return events;
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
stream,
|
|
51
|
+
streamSimple: (model, context, options) => stream(model, context, {
|
|
52
|
+
...buildBaseOptions(model, options, resolveSimpleApiKey?.(model, options)),
|
|
53
|
+
thinking: buildGoogleSimpleThinking(model, options)
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { buildGoogleHttpOptions as n, createGoogleGenerateContentStreams as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { k as clampThinkingLevel } from "./host-
|
|
2
|
-
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-
|
|
3
|
-
import { C as stripSystemPromptCacheBoundary } from "./simple-options-
|
|
4
|
-
import { n as transformProviderMessages } from "./assistant-output-
|
|
5
|
-
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-
|
|
1
|
+
import { k as clampThinkingLevel } from "./host-JWXZWa-c.mjs";
|
|
2
|
+
import { P as sanitizeSurrogates, b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-DH08b7Il.mjs";
|
|
3
|
+
import { C as stripSystemPromptCacheBoundary } from "./simple-options-BARFAzk9.mjs";
|
|
4
|
+
import { n as transformProviderMessages } from "./assistant-output-CUEeSotf.mjs";
|
|
5
|
+
import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-C-RZzloH.mjs";
|
|
6
6
|
import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-shared.ts
|
|
8
8
|
function convertMessages(model, context) {
|
|
@@ -13,17 +13,8 @@ function convertMessages(model, context) {
|
|
|
13
13
|
requiresToolCallSignature: model.provider !== "google-gemini-cli" && (isGemini3ProModel(model) || isGemini3FlashModel(model))
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Map tool choice string to Gemini FunctionCallingConfigMode.
|
|
18
|
-
* @internal Directly tested provider implementation detail.
|
|
19
|
-
*/
|
|
20
16
|
function mapToolChoice(choice) {
|
|
21
|
-
|
|
22
|
-
case "auto": return FunctionCallingConfigMode.AUTO;
|
|
23
|
-
case "none": return FunctionCallingConfigMode.NONE;
|
|
24
|
-
case "any": return FunctionCallingConfigMode.ANY;
|
|
25
|
-
default: return FunctionCallingConfigMode.AUTO;
|
|
26
|
-
}
|
|
17
|
+
return choice === "none" ? FunctionCallingConfigMode.NONE : choice === "any" ? FunctionCallingConfigMode.ANY : FunctionCallingConfigMode.AUTO;
|
|
27
18
|
}
|
|
28
19
|
async function runGoogleGenerateContentLifecycle(params) {
|
|
29
20
|
const { stream, model, output, options } = params;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { a as normalizeOptionalString } from "./string-coerce-CtgOVOSv.mjs";
|
|
2
|
+
import { r as getAiTransportHost } from "./host-JWXZWa-c.mjs";
|
|
3
|
+
import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-CMImyxbX.mjs";
|
|
4
|
+
import { GoogleGenAI } from "@google/genai";
|
|
5
|
+
//#region packages/ai/src/providers/google-vertex.ts
|
|
6
|
+
const API_VERSION = "v1";
|
|
7
|
+
const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
8
|
+
const streams = createGoogleGenerateContentStreams("google-vertex", createClient);
|
|
9
|
+
const streamGoogleVertex = streams.stream;
|
|
10
|
+
const streamSimpleGoogleVertex = streams.streamSimple;
|
|
11
|
+
function createClient(model, options) {
|
|
12
|
+
const apiKey = resolveApiKey(options);
|
|
13
|
+
const credentials = apiKey ? { apiKey: getAiTransportHost().resolveSecretSentinel(apiKey) } : {
|
|
14
|
+
project: resolveProject(options),
|
|
15
|
+
location: resolveLocation(options)
|
|
16
|
+
};
|
|
17
|
+
return new GoogleGenAI({
|
|
18
|
+
vertexai: true,
|
|
19
|
+
...credentials,
|
|
20
|
+
apiVersion: API_VERSION,
|
|
21
|
+
httpOptions: buildGoogleHttpOptions(model, options?.headers, "vertex")
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function resolveApiKey(options) {
|
|
25
|
+
const apiKey = options?.apiKey?.trim() || process.env.GOOGLE_CLOUD_API_KEY?.trim();
|
|
26
|
+
if (!apiKey || apiKey === GCP_VERTEX_CREDENTIALS_MARKER || /^<[^>]+>$/.test(apiKey)) return;
|
|
27
|
+
return apiKey;
|
|
28
|
+
}
|
|
29
|
+
function resolveProject(options) {
|
|
30
|
+
const project = normalizeOptionalString(options?.project) || normalizeOptionalString(process.env.GOOGLE_CLOUD_PROJECT) || normalizeOptionalString(process.env.GCLOUD_PROJECT);
|
|
31
|
+
if (!project) throw new Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");
|
|
32
|
+
return project;
|
|
33
|
+
}
|
|
34
|
+
function resolveLocation(options) {
|
|
35
|
+
const location = normalizeOptionalString(options?.location) || normalizeOptionalString(process.env.GOOGLE_CLOUD_LOCATION);
|
|
36
|
+
if (!location) throw new Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");
|
|
37
|
+
return location;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { streamGoogleVertex, streamSimpleGoogleVertex };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { d as Context, et as StreamFn, k as Model, n as Api } from "./types-
|
|
3
|
-
import { n as ApiRegistry } from "./api-registry-
|
|
1
|
+
import "./index-BYDvopUB.mjs";
|
|
2
|
+
import { d as Context, et as StreamFn, k as Model, n as Api } from "./types-Bd2T86VJ.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-BhXXYdRA.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 {
|
|
@@ -110,6 +110,8 @@ type AiInlineContentBlock = AiInlineTextBlock | AiInlineImageBlock;
|
|
|
110
110
|
type AnthropicInlineContentNormalizer = (content: readonly AiInlineContentBlock[]) => Promise<AiInlineContentBlock[]>;
|
|
111
111
|
/** Narrow host ports consumed by the built-in provider adapters. */
|
|
112
112
|
interface AiTransportHost {
|
|
113
|
+
/** Creates background resources outside the embedding application's request contexts. */
|
|
114
|
+
runInDetachedAsyncContext<T>(run: () => T): T;
|
|
113
115
|
/** Retains accepted lifecycle work after its caller observes cancellation. */
|
|
114
116
|
observePendingProviderWork?: (pending: Promise<unknown>) => void;
|
|
115
117
|
/**
|
|
@@ -118,6 +120,7 @@ interface AiTransportHost {
|
|
|
118
120
|
*/
|
|
119
121
|
buildModelFetch(model: Model, timeoutMs?: number, options?: {
|
|
120
122
|
sanitizeSse?: boolean;
|
|
123
|
+
onSseComment?: () => void;
|
|
121
124
|
}): typeof fetch | undefined;
|
|
122
125
|
/** Resolves host-owned process-local secret sentinel substrings immediately before egress. */
|
|
123
126
|
resolveSecretSentinel(value: string): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, f as requiresClaudeDefaultSampling, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, t as calculateUsageCost, v as resolveClaudeNativeThinkingLevelMap, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-C_wfIUmV.mjs";
|
|
2
2
|
import { t as DEFAULT_MISSING_TOOL_RESULT_TEXT } from "./types-CQc6JNG4.mjs";
|
|
3
3
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
|
|
4
4
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-CtgOVOSv.mjs";
|
|
5
|
-
import { A as
|
|
5
|
+
import { A as MODEL_CATALOG_THINKING_LEVELS, M as resolveOpenAIThinkingApi, i as OPENAI_RESPONSES_APIS, j as listMappedModelThinkingLevels, w as resolveOpenAIModelReasoningEfforts } from "./openai-responses-contracts-DlKMMTxK.mjs";
|
|
6
6
|
//#region packages/ai/src/media-payload.ts
|
|
7
7
|
/** Media metadata alone is not an attachment; provider emitters need inline bytes. */
|
|
8
8
|
function hasMediaPayload(block) {
|
|
@@ -113,7 +113,7 @@ function usesClaudeFable5MessagesContract(model) {
|
|
|
113
113
|
/** Return whether streamed output must wait for the terminal refusal decision. */
|
|
114
114
|
function usesClaudeStreamingRefusalContract(model) {
|
|
115
115
|
if (normalizeApi(model.api) !== "anthropic-messages") return false;
|
|
116
|
-
return resolveClaudeFable5ModelIdentity(model) !== void 0 || resolveClaudeMythos5ModelIdentity(model) !== void 0 || resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0;
|
|
116
|
+
return resolveClaudeHaiku55ModelIdentity(model) !== void 0 || resolveClaudeFable5ModelIdentity(model) !== void 0 || resolveClaudeMythos5ModelIdentity(model) !== void 0 || resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0;
|
|
117
117
|
}
|
|
118
118
|
function requiresClaudeAdaptiveThinking(model) {
|
|
119
119
|
if (normalizeApi(model.api) !== "anthropic-messages") return false;
|
|
@@ -121,11 +121,11 @@ function requiresClaudeAdaptiveThinking(model) {
|
|
|
121
121
|
}
|
|
122
122
|
/** Return whether omitted thinking should default to adaptive mode. */
|
|
123
123
|
function defaultsClaudeAdaptiveThinking(model) {
|
|
124
|
-
return requiresClaudeAdaptiveThinking(model) || normalizeApi(model.api) === "anthropic-messages" && (resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0);
|
|
124
|
+
return requiresClaudeAdaptiveThinking(model) || normalizeApi(model.api) === "anthropic-messages" && (resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeHaiku55ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0);
|
|
125
125
|
}
|
|
126
126
|
/** Resolve provider-native effort once for direct and managed Claude requests. */
|
|
127
127
|
function resolveAnthropicThinkingEffort(model, level) {
|
|
128
|
-
const requestedLevel = level ?? (resolveClaudeOpus55ModelIdentity(model) ? CLAUDE_OPUS_55_THINKING_PROFILE.defaultLevel : resolveClaudeSonnet55ModelIdentity(model) ? CLAUDE_SONNET_55_THINKING_PROFILE.defaultLevel : resolveClaudeFable5ModelIdentity(model) ? CLAUDE_FABLE_5_THINKING_PROFILE.defaultLevel : void 0);
|
|
128
|
+
const requestedLevel = level ?? (resolveClaudeHaiku55ModelIdentity(model) ? CLAUDE_HAIKU_55_THINKING_PROFILE.defaultLevel : resolveClaudeOpus55ModelIdentity(model) ? CLAUDE_OPUS_55_THINKING_PROFILE.defaultLevel : resolveClaudeSonnet55ModelIdentity(model) ? CLAUDE_SONNET_55_THINKING_PROFILE.defaultLevel : resolveClaudeFable5ModelIdentity(model) ? CLAUDE_FABLE_5_THINKING_PROFILE.defaultLevel : void 0);
|
|
129
129
|
const thinkingLevelMap = resolveClaudeNativeThinkingLevelMap(model);
|
|
130
130
|
const clampModel = {
|
|
131
131
|
...model,
|
|
@@ -162,7 +162,7 @@ function mapAnthropicStopReason(reason) {
|
|
|
162
162
|
}
|
|
163
163
|
/** Remove unsupported assistant prefills while preserving completed tool-use turns. */
|
|
164
164
|
function prepareClaudeNoPrefillRequestContext(model, context) {
|
|
165
|
-
if (!resolveClaudeOpus5ModelIdentity(model) && !resolveClaudeSonnet5ModelIdentity(model)) return context;
|
|
165
|
+
if (!resolveClaudeOpus5ModelIdentity(model) && !resolveClaudeSonnet5ModelIdentity(model) && !resolveClaudeHaiku55ModelIdentity(model)) return context;
|
|
166
166
|
let end = context.messages.length;
|
|
167
167
|
while (end > 0) {
|
|
168
168
|
const message = context.messages[end - 1];
|
|
@@ -178,11 +178,12 @@ function applyClaudeRequestContract(params, model) {
|
|
|
178
178
|
if (normalizeApi(model.api) !== "anthropic-messages") return;
|
|
179
179
|
const opus5 = resolveClaudeOpus5ModelIdentity(model) !== void 0;
|
|
180
180
|
const sonnet5 = resolveClaudeSonnet5ModelIdentity(model) !== void 0;
|
|
181
|
+
const haiku55 = resolveClaudeHaiku55ModelIdentity(model) !== void 0;
|
|
181
182
|
if (!requiresClaudeDefaultSampling(model) && !opus5 && !sonnet5) return;
|
|
182
183
|
delete params.temperature;
|
|
183
184
|
delete params.top_p;
|
|
184
185
|
delete params.top_k;
|
|
185
|
-
if (opus5 || sonnet5) delete params.service_tier;
|
|
186
|
+
if (opus5 || sonnet5 || haiku55) delete params.service_tier;
|
|
186
187
|
}
|
|
187
188
|
function resolveReplayModelBoundIdentity(ref) {
|
|
188
189
|
if (normalizeApi(ref.api) !== "anthropic-messages") return;
|
|
@@ -191,6 +192,8 @@ function resolveReplayModelBoundIdentity(ref) {
|
|
|
191
192
|
params: ref.modelParams
|
|
192
193
|
};
|
|
193
194
|
const fableIdentity = resolveClaudeFable5ModelIdentity(modelRef);
|
|
195
|
+
const haikuIdentity = resolveClaudeHaiku55ModelIdentity(modelRef);
|
|
196
|
+
if (haikuIdentity) return `haiku:${haikuIdentity}`;
|
|
194
197
|
if (fableIdentity) return `fable:${fableIdentity}`;
|
|
195
198
|
const mythosIdentity = resolveClaudeMythos5ModelIdentity(modelRef);
|
|
196
199
|
if (mythosIdentity) return `mythos:${mythosIdentity}`;
|
|
@@ -210,7 +213,7 @@ const SONNET_55_REPLAY_IDENTITY = /^sonnet:claude-sonnet-5-5(?=$|[^a-z0-9])/;
|
|
|
210
213
|
*/
|
|
211
214
|
function readsPriorClaudeThinking(targetIdentity, sourceIdentity) {
|
|
212
215
|
if (targetIdentity === void 0) return false;
|
|
213
|
-
if (FABLE_51_REPLAY_IDENTITY.test(targetIdentity)) return sourceIdentity === void 0 || !SONNET_55_REPLAY_IDENTITY.test(sourceIdentity);
|
|
216
|
+
if (FABLE_51_REPLAY_IDENTITY.test(targetIdentity)) return sourceIdentity === void 0 || !SONNET_55_REPLAY_IDENTITY.test(sourceIdentity) && !sourceIdentity.startsWith("haiku:");
|
|
214
217
|
if (SONNET_55_REPLAY_IDENTITY.test(targetIdentity)) return sourceIdentity === void 0 || sourceIdentity.startsWith("sonnet:");
|
|
215
218
|
return false;
|
|
216
219
|
}
|
|
@@ -453,6 +456,7 @@ function queueCustomApiRegistration(registry, api, streamFn) {
|
|
|
453
456
|
return false;
|
|
454
457
|
}
|
|
455
458
|
const inertAiTransportHost = {
|
|
459
|
+
runInDetachedAsyncContext: (run) => run(),
|
|
456
460
|
buildModelFetch: () => void 0,
|
|
457
461
|
resolveSecretSentinel: (value) => value,
|
|
458
462
|
redactModelVisibleSecrets: (value) => value,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as getAiTransportHost } from "./host-
|
|
1
|
+
import { r as getAiTransportHost } from "./host-JWXZWa-c.mjs";
|
|
2
2
|
//#region packages/ai/src/transports/host-policy.ts
|
|
3
3
|
function buildGuardedModelFetch(model, timeoutMs, options) {
|
|
4
4
|
const host = getAiTransportHost();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, O as Message, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, U as ProviderStreamOptions, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, d as Context, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, k as Model, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, tt as StreamFunction, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-
|
|
2
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
3
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
1
|
+
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, O as Message, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, U as ProviderStreamOptions, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, d as Context, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, k as Model, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, tt as StreamFunction, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-Bd2T86VJ.mjs";
|
|
2
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BcqWLo_u.mjs";
|
|
3
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DdGB1yy3.mjs";
|
|
4
4
|
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
5
5
|
type ClaudeModelRef = {
|
|
6
6
|
id?: string;
|
|
@@ -95,6 +95,24 @@ declare const CLAUDE_SONNET_55_THINKING_PROFILE: {
|
|
|
95
95
|
}];
|
|
96
96
|
readonly defaultLevel: "high";
|
|
97
97
|
};
|
|
98
|
+
declare const CLAUDE_HAIKU_55_THINKING_PROFILE: {
|
|
99
|
+
readonly levels: readonly [{
|
|
100
|
+
readonly id: "off";
|
|
101
|
+
}, {
|
|
102
|
+
readonly id: "low";
|
|
103
|
+
}, {
|
|
104
|
+
readonly id: "medium";
|
|
105
|
+
}, {
|
|
106
|
+
readonly id: "high";
|
|
107
|
+
}, {
|
|
108
|
+
readonly id: "xhigh";
|
|
109
|
+
}, {
|
|
110
|
+
readonly id: "max";
|
|
111
|
+
}];
|
|
112
|
+
readonly defaultLevel: "medium";
|
|
113
|
+
};
|
|
114
|
+
/** Resolve Haiku 5.5 through direct ids, cloud ids, aliases, or deployment metadata. */
|
|
115
|
+
declare function resolveClaudeHaiku55ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
98
116
|
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
99
117
|
declare function resolveClaudeModelIdentity(ref: ClaudeModelRef): string;
|
|
100
118
|
/** Resolve Claude Fable 5 through direct ids, cloud ids, or deployment metadata. */
|
|
@@ -102,7 +120,7 @@ declare function resolveClaudeFable5ModelIdentity(ref: ClaudeModelRef): string |
|
|
|
102
120
|
/** Resolve Claude Mythos 5 through direct ids, cloud ids, or deployment metadata. */
|
|
103
121
|
declare function resolveClaudeMythos5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
104
122
|
/**
|
|
105
|
-
* Opus 5.5, Sonnet 5.5, and Fable 5.1 require append-only runtime context.
|
|
123
|
+
* Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 require append-only runtime context.
|
|
106
124
|
* Extend only with live replay proof (Mythos 5.1 remains unproven).
|
|
107
125
|
*/
|
|
108
126
|
declare function bindsClaudeThinkingPrefix(ref: ClaudeModelRef): boolean;
|
|
@@ -155,8 +173,11 @@ declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostCo
|
|
|
155
173
|
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
156
174
|
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
157
175
|
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region packages/llm-core/src/utils/assistant-message-events.d.ts
|
|
178
|
+
declare function appendTextDeltaToAssistantMessage(message: AssistantMessage, contentIndex: number, delta: string): AssistantMessage;
|
|
158
179
|
declare namespace index_d_exports {
|
|
159
|
-
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, 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, ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
180
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, 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, ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
160
181
|
}
|
|
161
182
|
//#endregion
|
|
162
|
-
export {
|
|
183
|
+
export { supportsClaudeInHistorySystemMessages as A, resolveClaudeOpus55ModelIdentity as C, supportsClaude1MContext as D, resolveClaudeSonnet5ModelIdentity as E, supportsClaudeNativeXhighEffort as M, supportsClaudeAdaptiveThinking as O, resolveClaudeNativeThinkingLevelMap as S, resolveClaudeSonnet55ModelIdentity as T, requiresClaudeMandatoryAdaptiveThinking as _, normalizeResolvedPricing as a, resolveClaudeModelIdentity as b, CLAUDE_FABLE_5_THINKING_PROFILE as c, CLAUDE_OPUS_5_THINKING_PROFILE as d, CLAUDE_SONNET_55_THINKING_PROFILE as f, requiresClaudeDefaultSampling as g, requiresClaudeBetweenToolsThinking as h, normalizeModelCostConfig as i, supportsClaudeNativeMaxEffort as j, supportsClaudeFastMode as k, CLAUDE_HAIKU_55_THINKING_PROFILE as l, bindsClaudeThinkingPrefix as m, appendTextDeltaToAssistantMessage as n, ProviderRefusalReview as o, CLAUDE_SONNET_5_THINKING_PROFILE as p, calculateUsageCost as r, readProviderRefusalReview as s, index_d_exports as t, CLAUDE_OPUS_55_THINKING_PROFILE as u, resolveClaudeFable5ModelIdentity as v, resolveClaudeOpus5ModelIdentity as w, resolveClaudeMythos5ModelIdentity as x, resolveClaudeHaiku55ModelIdentity as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, O as Message, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, U as ProviderStreamOptions, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, d as Context, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, k as Model, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, tt as StreamFunction, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-
|
|
3
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
5
|
-
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-
|
|
6
|
-
import { _ as supportsScopedAiTransportHosts, a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as createAiTransportHost, g as runWithAiTransportHost, h as resolveAiTransportHeaderSentinels, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, m as getDefaultAiTransportHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as getAiTransportHost, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-
|
|
1
|
+
import { A as supportsClaudeInHistorySystemMessages, C as resolveClaudeOpus55ModelIdentity, D as supportsClaude1MContext, E as resolveClaudeSonnet5ModelIdentity, M as supportsClaudeNativeXhighEffort, O as supportsClaudeAdaptiveThinking, S as resolveClaudeNativeThinkingLevelMap, T as resolveClaudeSonnet55ModelIdentity, _ as requiresClaudeMandatoryAdaptiveThinking, a as normalizeResolvedPricing, b as resolveClaudeModelIdentity, c as CLAUDE_FABLE_5_THINKING_PROFILE, d as CLAUDE_OPUS_5_THINKING_PROFILE, f as CLAUDE_SONNET_55_THINKING_PROFILE, g as requiresClaudeDefaultSampling, h as requiresClaudeBetweenToolsThinking, i as normalizeModelCostConfig, j as supportsClaudeNativeMaxEffort, k as supportsClaudeFastMode, l as CLAUDE_HAIKU_55_THINKING_PROFILE, m as bindsClaudeThinkingPrefix, n as appendTextDeltaToAssistantMessage, o as ProviderRefusalReview, p as CLAUDE_SONNET_5_THINKING_PROFILE, r as calculateUsageCost, s as readProviderRefusalReview, u as CLAUDE_OPUS_55_THINKING_PROFILE, v as resolveClaudeFable5ModelIdentity, w as resolveClaudeOpus5ModelIdentity, x as resolveClaudeMythos5ModelIdentity, y as resolveClaudeHaiku55ModelIdentity } from "./index-BYDvopUB.mjs";
|
|
2
|
+
import { $ as StopReason, A as ModelCostConfig, At as extractDiagnosticError, B as ProviderImagesOptions, C as KnownApi, Ct as readRuntimeContextMetadata, D as MaybePromise, Dt as DiagnosticErrorInfo, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as AssistantMessageDiagnostic, F as OpenRouterRouting, G as RUNTIME_CONTEXT_CUSTOM_TYPE, H as ProviderResponse, I as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, J as RUNTIME_CONTEXT_HEADER, K as RUNTIME_CONTEXT_END_MARKER, L as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, M as ModelThinkingLevel, Mt as isProviderRefusalAssistantError, N as OpenAICompletionsCompat, O as Message, Ot as appendAssistantMessageDiagnostic, P as OpenAIResponsesCompat, Q as SimpleStreamOptions, R as PricingTier, S as ImagesStopReason, St as labelRuntimeContextText, T as KnownImagesProvider, Tt as setRuntimeContextRetention, U as ProviderStreamOptions, V as ProviderReplayState, W as RUNTIME_CONTEXT_BEGIN_MARKER, X as RawPricingTier, Y as RawModelCostConfig, Z as RuntimeContextMessage, _ as ImagesInputContent, _t as escapeRuntimeContextFooter, a as AssistantMessage, at as ThinkingBudgets, b as ImagesOutputContent, bt as isRuntimeContextMessage, c as AssistantMessageEventStreamLike, ct as ThinkingLevelMap, d as Context, dt as ToolResultMessage, et as StreamFn, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Transport, g as ImagesFunction, gt as VercelGatewayRouting, h as ImagesContext, ht as ValidateToolArgumentsFn, i as AssistantImages, it as TextSignatureV1, j as ModelCostRates, jt as formatThrownValue, k as Model, kt as createAssistantMessageDiagnostic, l as CacheRetention, lt as Tool, m as ImagesApi, mt as UserMessage, n as Api, nt as StreamOptions, o as AssistantMessageEvent, ot as ThinkingContent, p as ImageContent, pt as Usage, q as RUNTIME_CONTEXT_FOOTER, r as AssistantDeliveryTtsFacts, rt as TextContent, s as AssistantMessageEventStreamContract, st as ThinkingLevel, t as AnthropicMessagesCompat, tt as StreamFunction, u as CompleteSimpleFn, ut as ToolCall, v as ImagesModel, vt as hasLegacyRuntimeContextEnvelope, w as KnownImagesApi, wt as runtimeContextContentToText, x as ImagesProvider, xt as labelRuntimeContextContent, y as ImagesOptions, yt as hasRuntimeContextMarker, z as Provider } from "./types-Bd2T86VJ.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BcqWLo_u.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DdGB1yy3.mjs";
|
|
5
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-BhXXYdRA.mjs";
|
|
6
|
+
import { _ as supportsScopedAiTransportHosts, a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as createAiTransportHost, g as runWithAiTransportHost, h as resolveAiTransportHeaderSentinels, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, m as getDefaultAiTransportHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as getAiTransportHost, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-CTDz7LXD.mjs";
|
|
7
7
|
//#region packages/ai/src/stream.d.ts
|
|
8
8
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
9
9
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -37,4 +37,4 @@ export declare function createNodeLlmRuntime(registry?: ApiRegistry, transportHo
|
|
|
37
37
|
};
|
|
38
38
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
39
39
|
//#endregion
|
|
40
|
-
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_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, 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, type ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
40
|
+
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_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DEFAULT_MISSING_TOOL_RESULT_TEXT, 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, type ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, RuntimeContextMessage, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_HAIKU_55_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as CLAUDE_SONNET_55_THINKING_PROFILE, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as CLAUDE_SONNET_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_OPUS_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeResolvedPricing, s as CLAUDE_OPUS_5_THINKING_PROFILE, t as calculateUsageCost, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-C_wfIUmV.mjs";
|
|
2
2
|
import { _ as runtimeContextContentToText, a as RUNTIME_CONTEXT_BEGIN_MARKER, c as RUNTIME_CONTEXT_FOOTER, d as hasLegacyRuntimeContextEnvelope, f as hasRuntimeContextMarker, g as readRuntimeContextMetadata, h as labelRuntimeContextText, i as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, l as RUNTIME_CONTEXT_HEADER, m as labelRuntimeContextContent, n as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, o as RUNTIME_CONTEXT_CUSTOM_TYPE, p as isRuntimeContextMessage, r as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, s as RUNTIME_CONTEXT_END_MARKER, t as DEFAULT_MISSING_TOOL_RESULT_TEXT, u as escapeRuntimeContextFooter, v as setRuntimeContextRetention } from "./types-CQc6JNG4.mjs";
|
|
3
|
+
import { t as appendTextDeltaToAssistantMessage } from "./assistant-message-events-CHMJgbhs.mjs";
|
|
3
4
|
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
4
|
-
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-
|
|
7
|
-
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-
|
|
8
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, createNodeLlmRuntime, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
5
|
+
import { a as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
|
|
6
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-opC2pjk9.mjs";
|
|
7
|
+
import { n as createNodeLlmRuntime, r as createApiRegistry, t as createLlmRuntime } from "./stream-DwrETW0_.mjs";
|
|
8
|
+
import { a as resolveAiTransportHeaderSentinels, i as getDefaultAiTransportHost, n as createAiTransportHost, o as runWithAiTransportHost, r as getAiTransportHost, s as supportsScopedAiTransportHosts, t as configureAiTransportHost } from "./host-JWXZWa-c.mjs";
|
|
9
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_HAIKU_55_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_55_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, DEFAULT_MISSING_TOOL_RESULT_TEXT, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, RUNTIME_CONTEXT_BEGIN_MARKER, RUNTIME_CONTEXT_CUSTOM_TYPE, RUNTIME_CONTEXT_END_MARKER, RUNTIME_CONTEXT_FOOTER, RUNTIME_CONTEXT_HEADER, appendAssistantMessageDiagnostic, appendTextDeltaToAssistantMessage, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, createNodeLlmRuntime, escapeRuntimeContextFooter, extractDiagnosticError, formatThrownValue, getAiTransportHost, getDefaultAiTransportHost, hasLegacyRuntimeContextEnvelope, hasRuntimeContextMarker, isProviderRefusalAssistantError, isRuntimeContextMessage, labelRuntimeContextContent, labelRuntimeContextText, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, readRuntimeContextMetadata, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, runWithAiTransportHost, runtimeContextContentToText, setRuntimeContextRetention, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeInHistorySystemMessages, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, supportsScopedAiTransportHosts, validateToolArguments, validateToolCall };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as resolveClaudeSonnet5ModelIdentity, O as
|
|
2
|
-
import { $ as StopReason, Et as AssistantMessageDiagnostic, Q as SimpleStreamOptions, d as Context, k as Model, pt as Usage, tt as StreamFunction } from "../types-
|
|
3
|
-
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-
|
|
4
|
-
import "../types-
|
|
5
|
-
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-
|
|
1
|
+
import { C as resolveClaudeOpus55ModelIdentity, E as resolveClaudeSonnet5ModelIdentity, M as supportsClaudeNativeXhighEffort, O as supportsClaudeAdaptiveThinking, S as resolveClaudeNativeThinkingLevelMap, T as resolveClaudeSonnet55ModelIdentity, _ as requiresClaudeMandatoryAdaptiveThinking, b as resolveClaudeModelIdentity, g as requiresClaudeDefaultSampling, h as requiresClaudeBetweenToolsThinking, j as supportsClaudeNativeMaxEffort, m as bindsClaudeThinkingPrefix, v as resolveClaudeFable5ModelIdentity, w as resolveClaudeOpus5ModelIdentity, x as resolveClaudeMythos5ModelIdentity, y as resolveClaudeHaiku55ModelIdentity } from "../index-BYDvopUB.mjs";
|
|
2
|
+
import { $ as StopReason, Et as AssistantMessageDiagnostic, Q as SimpleStreamOptions, d as Context, k as Model, pt as Usage, tt as StreamFunction } from "../types-Bd2T86VJ.mjs";
|
|
3
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-CVrXZBtA.mjs";
|
|
4
|
+
import "../types-Kdfw_04V.mjs";
|
|
5
|
+
import { p as resolveAnthropicServerCompactionPlan, s as isDirectAnthropicModel } from "../anthropic-payload-policy-DGblkHL5.mjs";
|
|
6
6
|
import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
@@ -230,4 +230,4 @@ export declare function applyAnthropicMessageStartUsage(target: Usage, payload:
|
|
|
230
230
|
/** Keep billing and context distinct; omitted usage preserves the last snapshot. */
|
|
231
231
|
export declare function applyAnthropicMessageDeltaUsage(target: Usage, usage: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
232
232
|
//#endregion
|
|
233
|
-
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, isDirectAnthropicModel, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
233
|
+
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, isDirectAnthropicModel, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-
|
|
3
|
-
import { B as
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
5
|
-
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
1
|
+
import { D as supportsClaudeNativeMaxEffort, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, _ as resolveClaudeMythos5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "../src-C_wfIUmV.mjs";
|
|
2
|
+
import { C as resolveModelBoundThinkingReplayMode, S as resolveAnthropicThinkingEffort, T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, b as prepareClaudeNoPrefillRequestContext, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "../host-JWXZWa-c.mjs";
|
|
3
|
+
import { B as resolveAnthropicServerCompactionPlan, C as logAnthropicThinkingDrops, G as applyAnthropicFallbackBoundary, H as ANTHROPIC_SERVER_SIDE_FALLBACKS, J as isAnthropicOAuthApiKey, K as readAnthropicFallbackBoundary, P as isDirectAnthropicModel, S as findActiveAnthropicToolTurnAssistantIndex, U as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, W as CLAUDE_OPUS_FALLBACK_MODEL_COST, X as usesFoundryBearerAuth, Y as omitFoundryBearerCredentialHeaders, _ as reconcileAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as ANTHROPIC_OMITTED_REASONING_TEXT, c as applyAnthropicRefusal, g as projectAnthropicTools, h as normalizeAnthropicToolChoice, i as readAnthropicCacheWriteUsage, m as normalizeAnthropicToolCallId, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as resolveAnthropicFallbackServingModelCost, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as resolveOriginalAnthropicToolName, w as readAnthropicInputTransformations, x as applyAnthropicThinkingBindingControls, y as toClaudeCodeToolName } from "../anthropic-stream-reducer-g6w1YVii.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-BAHKgWam.mjs";
|
|
5
|
+
export { ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, buildAnthropicClaudeCodeIdentity, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, isDirectAnthropicModel, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeBetweenToolsThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeHaiku55ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet55ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { a as resolveOpenAICompletionsCompat } from "../openai-completions-compat-i-nLZxFy.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-
|
|
1
|
+
import { i as resolveOpenAICompletionsCompat } from "../openai-completions-compat-pg1q4uNG.mjs";
|
|
2
2
|
export { resolveOpenAICompletionsCompat };
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
import { l as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS, u as readOpenAIResponsesCompactionWindow } from "../openai-responses-contracts-
|
|
1
|
+
import { l as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS, u as readOpenAIResponsesCompactionWindow } from "../openai-responses-contracts-DKqMJ1Ct.mjs";
|
|
2
2
|
import { i as resolveOpenAIResponsesServerCompactionPlan, r as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-payload-policy-C7GsA1y0.mjs";
|
|
3
|
+
//#region packages/ai/src/transports/openai-responses-endpoint.d.ts
|
|
4
|
+
export declare function supportsNativeOpenAIResponsesEndpoint(params: {
|
|
5
|
+
provider: string;
|
|
6
|
+
api: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
}): boolean;
|
|
9
|
+
//#endregion
|
|
3
10
|
export { OPENAI_RESPONSES_APIS, type OpenAIResponsesCompactionOutput, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import {
|
|
3
|
-
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan };
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-DlKMMTxK.mjs";
|
|
2
|
+
import { a as readOpenAIResponsesCompactionWindow, l as resolveOpenAIResponsesPayloadPolicy, n as supportsNativeOpenAIResponsesEndpoint, u as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-endpoint-CinGh4VZ.mjs";
|
|
3
|
+
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, supportsNativeOpenAIResponsesEndpoint };
|