@openclaw/ai 2026.9.4 → 2026.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{anthropic-C4Qu4H0Z.mjs → anthropic-DZQ_7gD1.mjs} +37 -38
- package/dist/{anthropic-payload-policy-BZ8umAbk.d.mts → anthropic-payload-policy-DyfwikYJ.d.mts} +4 -4
- package/dist/{anthropic-stream-reducer-CILWF7JD.mjs → anthropic-stream-reducer-D6ZI1wwj.mjs} +70 -50
- package/dist/{api-registry-ByUwIR0e.d.mts → api-registry-C2T3lTV7.d.mts} +2 -2
- package/dist/{assistant-output-tLt4H-iQ.mjs → assistant-output-DM1JBNs1.mjs} +1 -1
- package/dist/{azure-openai-responses-BAlqlKKc.mjs → azure-openai-responses-DS86GYzq.mjs} +6 -9
- package/dist/{base64-D-su8YVo.mjs → base64-CPmadnUf.mjs} +12 -12
- package/dist/credential-redaction-BKv49aiv.d.mts +24 -0
- package/dist/{diagnostics-QuErwCIl.mjs → diagnostics-CH8j2wIG.mjs} +139 -7
- package/dist/{diagnostics-CPeq9F7y.mjs → diagnostics-DzrF1h4J.mjs} +18 -1
- package/dist/diagnostics.d.mts +11 -24
- package/dist/diagnostics.mjs +4 -4
- package/dist/event-stream-C0nsgbj2.d.mts +1 -0
- package/dist/{event-stream-Bt5Y4Pav.d.mts → event-stream-CjnIZZst.d.mts} +1 -1
- package/dist/event-stream.d.mts +2 -2
- package/dist/expect-lbe3Hgrh.mjs +8 -0
- package/dist/{google-DPBAOaOW.mjs → google-BZJFjhuC.mjs} +6 -9
- package/dist/{google-messages-6JkpHrhJ.mjs → google-messages-DB7GKkDk.mjs} +3 -3
- package/dist/{google-shared-BvBeW9aq.mjs → google-shared-Bok4I6zB.mjs} +13 -13
- package/dist/{google-vertex-k-TMCAYD.mjs → google-vertex-3eVNR2qW.mjs} +5 -8
- package/dist/{host-4atIX-2V.d.mts → host-DH-Z-LDb.d.mts} +5 -3
- package/dist/{host-policy-Zcg_cNz8.mjs → host-policy-DZO3oPPk.mjs} +1 -1
- package/dist/{host-B8YfDGd4.mjs → host-yTvBrYM2.mjs} +63 -31
- package/dist/{index-DdD3qerf.d.mts → index-C25RT6bP.d.mts} +37 -14
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +5 -6
- package/dist/internal/anthropic.d.mts +13 -10
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-completions-compat.d.mts +2 -0
- package/dist/internal/openai-completions-compat.mjs +2 -0
- package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
- package/dist/internal/openai-responses-payload-policy.mjs +2 -2
- package/dist/internal/openai.d.mts +24 -53
- package/dist/internal/openai.mjs +12 -9
- package/dist/internal/runtime.d.mts +6 -8
- package/dist/internal/runtime.mjs +6 -10
- package/dist/internal/shared.d.mts +7 -5
- package/dist/internal/shared.mjs +4 -3
- package/dist/internal/tool-schema.d.mts +4 -4
- package/dist/internal/tool-schema.mjs +2 -2
- package/dist/{mistral-CxUZ1jUb.mjs → mistral-C_13dVBn.mjs} +9 -13
- package/dist/{model-transport-url-DKocrEsb.d.mts → model-transport-url-C5f59L3Y.d.mts} +1 -1
- package/dist/{openai-chatgpt-responses-CgO6kZfo.mjs → openai-chatgpt-responses-sTxPl4zM.mjs} +150 -83
- package/dist/{openai-completions-yJuk7eis.mjs → openai-completions-BO6D_hrB.mjs} +11 -12
- package/dist/{openai-prompt-cache-Bds-n_9Q.mjs → openai-completions-compat-CUollwl6.mjs} +5 -50
- package/dist/{openai-completions-compat-eHgh5UPE.d.mts → openai-completions-compat-DfJG1wSO.d.mts} +4 -4
- package/dist/{openai-completions-stream-Da2vvl-S.mjs → openai-completions-stream-BpuJ0ZOA.mjs} +117 -106
- package/dist/{openai-prompt-cache-B4eYo2-I.d.mts → openai-prompt-cache-C4RHdN4n.d.mts} +2 -2
- package/dist/openai-prompt-cache-CjV_2IRI.mjs +46 -0
- package/dist/{openai-provider-client-S2gCrM2Z.mjs → openai-provider-client-BP8J1aeg.mjs} +2 -2
- package/dist/openai-reasoning-effort-ash8dPrd.mjs +243 -0
- package/dist/{openai-responses-DaYwH05E.mjs → openai-responses-BJ_IEoMU.mjs} +8 -12
- package/dist/{openai-responses-compaction-window-CIhBAkkq.mjs → openai-responses-compaction-window-BiNCT0bS.mjs} +20 -62
- package/dist/{openai-responses-contracts-BjBAqAg_.d.mts → openai-responses-contracts-B1ENJFpI.d.mts} +9 -5
- package/dist/openai-responses-contracts-DWrfMODE.mjs +81 -0
- package/dist/{openai-responses-payload-policy-rLRPsSmB.d.mts → openai-responses-payload-policy-C7GsA1y0.d.mts} +5 -3
- package/dist/openai-responses-prompt-observer-internal-DPHWgbBH.mjs +198 -0
- package/dist/openai-responses-request-lifecycle-DFuyO1pQ.mjs +36 -0
- package/dist/{openai-responses-shared-B8RdBPCv.mjs → openai-responses-shared-DvSqtJ6_.mjs} +859 -581
- package/dist/openai-responses-terminal-usage-BNFbvY9f.d.mts +47 -0
- package/dist/{openai-tool-schema-CzjyYXun.mjs → openai-tool-schema-D4BMcj2D.mjs} +262 -162
- package/dist/{openai-transport-params-9aPuV5YY.mjs → openai-transport-params-DZKOTSfH.mjs} +157 -47
- package/dist/{positive-integer-41zhOdcV.mjs → positive-integer-BiUxrd71.mjs} +1 -1
- package/dist/{provider-error-BA-v_tKd.mjs → provider-error-CRhW7lkJ.mjs} +139 -44
- package/dist/{provider-error-CzNw4BWX.d.mts → provider-error-xumb1V3F.d.mts} +3 -1
- package/dist/{provider-options-Ceqv1OKk.d.mts → provider-options-DZYq53lj.d.mts} +12 -7
- package/dist/{provider-replay-context-CJ_YvcEW.mjs → provider-replay-context-DPr3w20a.mjs} +1 -1
- package/dist/{provider-transcript-transform-V5YzU9zh.mjs → provider-transcript-transform-BTocjCRs.mjs} +1 -1
- package/dist/{provider-transport-turn-state-D5EXOFL2.mjs → provider-transport-turn-state-lrXEFkYr.mjs} +1 -1
- package/dist/{provider-types-CVjKjsuq.d.mts → provider-types-w1rEqrGP.d.mts} +3 -3
- package/dist/provider-types.d.mts +6 -7
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +10 -10
- package/dist/{reasoning-tag-text-partitioner-BcR5pztD.mjs → reasoning-tag-text-partitioner-Di38crhI.mjs} +167 -40
- package/dist/{simple-options-BQbb4yQL.mjs → simple-options-np1XPuhm.mjs} +5 -3
- package/dist/{usage-cost-BNWbbXav.mjs → src-DwGYYyZp.mjs} +18 -11
- package/dist/{stream-first-event-timeout-2hfrquuz.mjs → stream-first-event-timeout-BeptfRL6.mjs} +1 -1
- package/dist/{string-normalization-CmLIasuf.mjs → string-normalization-J9ZiLfGO.mjs} +13 -1
- package/dist/tool-schema-json-projection-CD9c_fK8.mjs +134 -0
- package/dist/{transport-stream-shared-zHll9BxO.mjs → transport-stream-shared-B5RioB_Q.mjs} +16 -24
- package/dist/{transport-stream-shared-DNvmoWnv.d.mts → transport-stream-shared-B7Z9oCYg.d.mts} +5 -5
- package/dist/{transport-utils-zrYjICLZ.mjs → transport-utils-03Qi0CN2.mjs} +3 -3
- package/dist/transports.d.mts +27 -13
- package/dist/transports.mjs +168 -462
- package/dist/types-DTvddOfm.d.mts +1 -0
- package/dist/{types-Ntv5z2g2.d.mts → types-qZFbaDbK.d.mts} +49 -3
- package/dist/types.d.mts +6 -7
- package/dist/types.mjs +4 -5
- package/dist/{validation-B0t_G2H6.d.mts → validation-DhQhmt6t.d.mts} +1 -1
- package/dist/{validation-BDzVDnTs.mjs → validation-Dw7cb6BV.mjs} +1 -0
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +11 -6
- package/dist/diagnostics-DnPnOui6.d.mts +0 -29
- package/dist/event-stream-C3WGFsum.d.mts +0 -1
- package/dist/openai-responses-contracts-DDOHA62Y.mjs +0 -245
- package/dist/openai-responses-prompt-observer-internal-f8J7wpsk.mjs +0 -32
- package/dist/src-DDmEryvj.mjs +0 -2
- package/dist/tool-schema-json-projection-ClptDdAO.mjs +0 -82
- package/dist/types-DlfwzH3T.d.mts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./src-DDmEryvj.mjs";
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, a as CLAUDE_OPUS_55_THINKING_PROFILE, d as resolveClaudeFable5ModelIdentity, g as resolveClaudeOpus5ModelIdentity, h as resolveClaudeOpus55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, t as calculateUsageCost, u as requiresClaudeMandatoryAdaptiveThinking, x as supportsClaudeNativeMaxEffort } from "./src-DwGYYyZp.mjs";
|
|
3
2
|
import { n as normalizeLowercaseStringOrEmpty } from "./string-coerce-fsri9iCu.mjs";
|
|
4
3
|
import { i as asOptionalRecord, o as isRecord } from "./record-coerce-DwRYMj3t.mjs";
|
|
4
|
+
import { f as MODEL_CATALOG_THINKING_LEVELS, m as resolveOpenAIThinkingApi, o as resolveOpenAIModelReasoningEfforts, p as listMappedModelThinkingLevels } from "./openai-reasoning-effort-ash8dPrd.mjs";
|
|
5
5
|
import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
|
|
6
6
|
//#region packages/ai/src/model-utils.ts
|
|
7
7
|
/** Calculates and stores model cost fields from token usage and per-million pricing. */
|
|
@@ -15,15 +15,6 @@ function applyProviderReportedUsageCost(usage, reportedCost) {
|
|
|
15
15
|
usage.cost.total = reportedCost;
|
|
16
16
|
usage.cost.totalOrigin = "provider-billed";
|
|
17
17
|
}
|
|
18
|
-
const EXTENDED_THINKING_LEVELS = [
|
|
19
|
-
"off",
|
|
20
|
-
"minimal",
|
|
21
|
-
"low",
|
|
22
|
-
"medium",
|
|
23
|
-
"high",
|
|
24
|
-
"xhigh",
|
|
25
|
-
"max"
|
|
26
|
-
];
|
|
27
18
|
function resolveThinkingLevelMap(model) {
|
|
28
19
|
return model.api === "anthropic-messages" ? resolveClaudeNativeThinkingLevelMap(model) ?? model.thinkingLevelMap : model.thinkingLevelMap;
|
|
29
20
|
}
|
|
@@ -32,10 +23,12 @@ function getSupportedThinkingLevels(model) {
|
|
|
32
23
|
const mandatoryAdaptiveContract = model.api === "anthropic-messages" && requiresClaudeMandatoryAdaptiveThinking(model);
|
|
33
24
|
if (!model.reasoning && !mandatoryAdaptiveContract) return ["off"];
|
|
34
25
|
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
35
|
-
|
|
26
|
+
const reasoningEfforts = resolveOpenAIThinkingApi(model.api) ? resolveOpenAIModelReasoningEfforts(model) : void 0;
|
|
27
|
+
const mappedLevels = listMappedModelThinkingLevels(model);
|
|
28
|
+
return MODEL_CATALOG_THINKING_LEVELS.filter((level) => {
|
|
36
29
|
const mapped = thinkingLevelMap?.[level];
|
|
37
30
|
if (mapped === null) return false;
|
|
38
|
-
if (level === "xhigh" || level === "max") return mapped !== void 0;
|
|
31
|
+
if (level === "xhigh" || level === "max") return reasoningEfforts?.length !== 0 && (mapped !== void 0 || mappedLevels.includes(level) || reasoningEfforts?.includes(level) === true);
|
|
39
32
|
return true;
|
|
40
33
|
});
|
|
41
34
|
}
|
|
@@ -43,15 +36,13 @@ function getSupportedThinkingLevels(model) {
|
|
|
43
36
|
function clampThinkingLevel(model, level) {
|
|
44
37
|
const availableLevels = getSupportedThinkingLevels(model);
|
|
45
38
|
if (availableLevels.includes(level)) return level;
|
|
46
|
-
const requestedIndex =
|
|
39
|
+
const requestedIndex = MODEL_CATALOG_THINKING_LEVELS.indexOf(level);
|
|
47
40
|
if (requestedIndex === -1) return availableLevels[0] ?? "off";
|
|
48
41
|
const thinkingLevelMap = resolveThinkingLevelMap(model);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
for (const candidate of EXTENDED_THINKING_LEVELS.slice(0, requestedIndex).toReversed()) if (availableLevels.includes(candidate)) return candidate;
|
|
54
|
-
return availableLevels[0] ?? "off";
|
|
42
|
+
const lowerFirst = (level === "xhigh" || level === "max") && thinkingLevelMap?.[level] === null;
|
|
43
|
+
const lowerLevels = MODEL_CATALOG_THINKING_LEVELS.slice(0, requestedIndex).toReversed();
|
|
44
|
+
const upperLevels = MODEL_CATALOG_THINKING_LEVELS.slice(requestedIndex);
|
|
45
|
+
return (lowerFirst ? [...lowerLevels, ...upperLevels] : [...upperLevels, ...lowerLevels]).find((candidate) => availableLevels.includes(candidate)) ?? availableLevels[0] ?? "off";
|
|
55
46
|
}
|
|
56
47
|
/** Compares model identity by provider and id. */
|
|
57
48
|
function modelsAreEqual(a, b) {
|
|
@@ -59,9 +50,41 @@ function modelsAreEqual(a, b) {
|
|
|
59
50
|
return a.id === b.id && a.provider === b.provider;
|
|
60
51
|
}
|
|
61
52
|
//#endregion
|
|
53
|
+
//#region packages/ai/src/utils/headers.ts
|
|
54
|
+
/** Converts a Headers object to a plain record for provider request handling. */
|
|
55
|
+
function headersToRecord(headers) {
|
|
56
|
+
const result = {};
|
|
57
|
+
for (const [key, value] of headers.entries()) result[key] = value;
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
62
61
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
63
|
-
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.
|
|
64
|
-
|
|
62
|
+
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.278";
|
|
63
|
+
/** Build OAuth headers and the matching billing identity from one request snapshot. */
|
|
64
|
+
function buildAnthropicClaudeCodeIdentity(betaHeader, ...headerSources) {
|
|
65
|
+
const headers = new Headers({
|
|
66
|
+
accept: "application/json",
|
|
67
|
+
"anthropic-dangerous-direct-browser-access": "true",
|
|
68
|
+
...betaHeader ? { "anthropic-beta": betaHeader } : {},
|
|
69
|
+
"x-app": "cli"
|
|
70
|
+
});
|
|
71
|
+
for (const source of headerSources) for (const [name, value] of Object.entries(source ?? {})) headers.set(name, value);
|
|
72
|
+
let version = ANTHROPIC_CLAUDE_CODE_VERSION;
|
|
73
|
+
const candidate = headers.get("user-agent")?.match(/^claude-cli\/(\d+\.\d+\.\d+)$/)?.[1];
|
|
74
|
+
if (candidate) {
|
|
75
|
+
const components = candidate.split(".").map(Number);
|
|
76
|
+
const minimum = version.split(".").map(Number);
|
|
77
|
+
const differing = components.findIndex((component, index) => component !== minimum[index]);
|
|
78
|
+
const component = components[differing];
|
|
79
|
+
const minimumComponent = minimum[differing];
|
|
80
|
+
if (components.every(Number.isSafeInteger) && component !== void 0 && minimumComponent !== void 0 && component > minimumComponent) version = candidate;
|
|
81
|
+
}
|
|
82
|
+
headers.set("user-agent", `claude-cli/${version}`);
|
|
83
|
+
return {
|
|
84
|
+
headers: headersToRecord(headers),
|
|
85
|
+
version
|
|
86
|
+
};
|
|
87
|
+
}
|
|
65
88
|
function normalizeModelId(modelId) {
|
|
66
89
|
const normalized = normalizeLowercaseStringOrEmpty(modelId);
|
|
67
90
|
return (normalized.startsWith("anthropic/") ? normalized.slice(10) : normalized).replace(/[._\s]+/g, "-");
|
|
@@ -86,13 +109,13 @@ function requiresClaudeAdaptiveThinking(model) {
|
|
|
86
109
|
if (normalizeApi(model.api) !== "anthropic-messages") return false;
|
|
87
110
|
return requiresClaudeMandatoryAdaptiveThinking(model);
|
|
88
111
|
}
|
|
89
|
-
/** Return whether omitted thinking should default to adaptive
|
|
112
|
+
/** Return whether omitted thinking should default to adaptive mode. */
|
|
90
113
|
function defaultsClaudeAdaptiveThinking(model) {
|
|
91
114
|
return requiresClaudeAdaptiveThinking(model) || normalizeApi(model.api) === "anthropic-messages" && (resolveClaudeOpus5ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0);
|
|
92
115
|
}
|
|
93
116
|
/** Resolve provider-native effort once for direct and managed Claude requests. */
|
|
94
117
|
function resolveAnthropicThinkingEffort(model, level) {
|
|
95
|
-
const requestedLevel = level;
|
|
118
|
+
const requestedLevel = level ?? (resolveClaudeOpus55ModelIdentity(model) ? CLAUDE_OPUS_55_THINKING_PROFILE.defaultLevel : resolveClaudeFable5ModelIdentity(model) ? CLAUDE_FABLE_5_THINKING_PROFILE.defaultLevel : void 0);
|
|
96
119
|
const thinkingLevelMap = resolveClaudeNativeThinkingLevelMap(model);
|
|
97
120
|
const clampModel = {
|
|
98
121
|
...model,
|
|
@@ -119,7 +142,8 @@ function mapAnthropicStopReason(reason) {
|
|
|
119
142
|
case "pause_turn":
|
|
120
143
|
case "compaction":
|
|
121
144
|
case "stop_sequence": return "stop";
|
|
122
|
-
case "max_tokens":
|
|
145
|
+
case "max_tokens":
|
|
146
|
+
case "model_context_window_exceeded": return "length";
|
|
123
147
|
case "tool_use": return "toolUse";
|
|
124
148
|
case "refusal":
|
|
125
149
|
case "sensitive": return "error";
|
|
@@ -213,6 +237,7 @@ function resolveModelBoundThinkingReplayMode(params) {
|
|
|
213
237
|
* sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
|
|
214
238
|
*/
|
|
215
239
|
function sanitizeSurrogates(text) {
|
|
240
|
+
if (text.isWellFormed()) return text;
|
|
216
241
|
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
217
242
|
}
|
|
218
243
|
//#endregion
|
|
@@ -329,15 +354,22 @@ function extractToolResultBlockText(block) {
|
|
|
329
354
|
}
|
|
330
355
|
function extractToolResultText(blocks, options) {
|
|
331
356
|
const explicitTexts = [];
|
|
332
|
-
const
|
|
357
|
+
const structuredBlocks = [];
|
|
333
358
|
for (const block of blocks) {
|
|
359
|
+
if (!block || typeof block !== "object") continue;
|
|
360
|
+
if (block.type === "text") {
|
|
361
|
+
const text = extractToolResultBlockText(block);
|
|
362
|
+
if (text) explicitTexts.push(text);
|
|
363
|
+
} else structuredBlocks.push(block);
|
|
364
|
+
}
|
|
365
|
+
if (explicitTexts.length > 0 && !options?.includeStructured) return explicitTexts.join("\n");
|
|
366
|
+
const structuredTexts = [];
|
|
367
|
+
for (const block of structuredBlocks) {
|
|
334
368
|
const text = extractToolResultBlockText(block);
|
|
335
|
-
if (
|
|
336
|
-
if (block.type === "text") explicitTexts.push(text);
|
|
337
|
-
else structuredTexts.push(text);
|
|
369
|
+
if (text) structuredTexts.push(text);
|
|
338
370
|
}
|
|
339
371
|
if (explicitTexts.length > 0) {
|
|
340
|
-
if (
|
|
372
|
+
if (structuredTexts.length > 0) explicitTexts.push(truncateStructuredToolText(structuredTexts.join("\n")));
|
|
341
373
|
return explicitTexts.join("\n");
|
|
342
374
|
}
|
|
343
375
|
return truncateStructuredToolText(structuredTexts.join("\n"));
|
|
@@ -655,4 +687,4 @@ function resolveAiTransportHeaderSentinels(headers) {
|
|
|
655
687
|
return resolvedHeaders ?? headers;
|
|
656
688
|
}
|
|
657
689
|
//#endregion
|
|
658
|
-
export {
|
|
690
|
+
export { headersToRecord as A, mapAnthropicStopReason as C, resolveModelBoundThinkingReplayMode as D, resolveAnthropicThinkingEffort as E, modelsAreEqual as F, calculateCost as M, clampThinkingLevel as N, usesClaudeFable5MessagesContract as O, getSupportedThinkingLevels as P, defaultsClaudeAdaptiveThinking as S, requiresClaudeAdaptiveThinking as T, isImageWithMediaPayload as _, FAILED_ASSISTANT_REPLAY_TEXT as a, applyClaudeRequestContract as b, isReasoningOnlyLengthAssistantTurn as c, describeToolResultMediaPlaceholder as d, describeUnsupportedToolResultMedia as f, hasMediaPayload as g, formatToolResultText as h, transformMessages as i, applyProviderReportedUsageCost as j, usesClaudeStreamingRefusalContract as k, isStreamErrorFallbackContent as l, extractToolResultText as m, getAiTransportHost as n, STREAM_ERROR_FALLBACK_TEXT as o, extractToolResultBlockText as p, resolveAiTransportHeaderSentinels as r, hasOnlyAssistantReasoningContent as s, configureAiTransportHost as t, resolveFailedAssistantReplay as u, sanitizeSurrogates as v, prepareClaudeNoPrefillRequestContext as w, buildAnthropicClaudeCodeIdentity as x, ANTHROPIC_CLAUDE_CODE_VERSION as y };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, et as ThinkingLevel, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-B0t_G2H6.mjs";
|
|
1
|
+
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-qZFbaDbK.mjs";
|
|
2
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CjnIZZst.mjs";
|
|
3
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DhQhmt6t.mjs";
|
|
5
4
|
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
5
|
type ClaudeModelRef = {
|
|
7
6
|
id?: string;
|
|
@@ -12,8 +11,6 @@ type ClaudeEffortModelRef = ClaudeModelRef & {
|
|
|
12
11
|
};
|
|
13
12
|
declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
14
13
|
readonly levels: readonly [{
|
|
15
|
-
readonly id: "minimal";
|
|
16
|
-
}, {
|
|
17
14
|
readonly id: "low";
|
|
18
15
|
}, {
|
|
19
16
|
readonly id: "medium";
|
|
@@ -21,12 +18,10 @@ declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
|
21
18
|
readonly id: "high";
|
|
22
19
|
}, {
|
|
23
20
|
readonly id: "xhigh";
|
|
24
|
-
}, {
|
|
25
|
-
readonly id: "adaptive";
|
|
26
21
|
}, {
|
|
27
22
|
readonly id: "max";
|
|
28
23
|
}];
|
|
29
|
-
readonly defaultLevel: "
|
|
24
|
+
readonly defaultLevel: "medium";
|
|
30
25
|
readonly preserveWhenCatalogReasoningFalse: true;
|
|
31
26
|
};
|
|
32
27
|
declare const CLAUDE_SONNET_5_THINKING_PROFILE: {
|
|
@@ -69,6 +64,21 @@ declare const CLAUDE_OPUS_5_THINKING_PROFILE: {
|
|
|
69
64
|
}];
|
|
70
65
|
readonly defaultLevel: "high";
|
|
71
66
|
};
|
|
67
|
+
declare const CLAUDE_OPUS_55_THINKING_PROFILE: {
|
|
68
|
+
readonly levels: readonly [{
|
|
69
|
+
readonly id: "low";
|
|
70
|
+
}, {
|
|
71
|
+
readonly id: "medium";
|
|
72
|
+
}, {
|
|
73
|
+
readonly id: "high";
|
|
74
|
+
}, {
|
|
75
|
+
readonly id: "xhigh";
|
|
76
|
+
}, {
|
|
77
|
+
readonly id: "max";
|
|
78
|
+
}];
|
|
79
|
+
readonly defaultLevel: "medium";
|
|
80
|
+
readonly preserveWhenCatalogReasoningFalse: true;
|
|
81
|
+
};
|
|
72
82
|
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
73
83
|
declare function resolveClaudeModelIdentity(ref: ClaudeModelRef): string;
|
|
74
84
|
/** Resolve Claude Fable 5 through direct ids, cloud ids, or deployment metadata. */
|
|
@@ -76,9 +86,8 @@ declare function resolveClaudeFable5ModelIdentity(ref: ClaudeModelRef): string |
|
|
|
76
86
|
/** Resolve Claude Mythos 5 through direct ids, cloud ids, or deployment metadata. */
|
|
77
87
|
declare function resolveClaudeMythos5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
78
88
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* new model (Mythos 5.1 is unregistered here and unproven).
|
|
89
|
+
* Prefix-bound thinking requires append-only runtime context. Extend this list
|
|
90
|
+
* only with live replay proof for the model (Mythos 5.1 remains unproven).
|
|
82
91
|
*/
|
|
83
92
|
declare function bindsClaudeThinkingPrefix(ref: ClaudeModelRef): boolean;
|
|
84
93
|
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
@@ -87,6 +96,8 @@ declare function requiresClaudeMandatoryAdaptiveThinking(ref: ClaudeModelRef): b
|
|
|
87
96
|
declare function resolveClaudeSonnet5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
88
97
|
/** Resolve Claude Opus 5 through aliases, direct ids, cloud ids, or deployment metadata. */
|
|
89
98
|
declare function resolveClaudeOpus5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
99
|
+
/** Resolve the Opus 5.5 contract without matching other Opus 5 generations. */
|
|
100
|
+
declare function resolveClaudeOpus55ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
90
101
|
/** Return whether a Claude model supports adaptive thinking. */
|
|
91
102
|
declare function supportsClaudeAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
92
103
|
/** Return whether a Claude model has a native 1M-token context window. */
|
|
@@ -105,13 +116,25 @@ declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
|
105
116
|
*/
|
|
106
117
|
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
107
118
|
//#endregion
|
|
119
|
+
//#region packages/llm-core/src/utils/provider-refusal.d.ts
|
|
120
|
+
/** Provider-authored findings; continuation is offered only after explicit user review. */
|
|
121
|
+
type ProviderRefusalReview = {
|
|
122
|
+
explanation: string;
|
|
123
|
+
continuation?: {
|
|
124
|
+
message: string;
|
|
125
|
+
};
|
|
126
|
+
errorType?: string;
|
|
127
|
+
};
|
|
128
|
+
/** Keep exact provider text. Truncation must never make an invalid continuation usable. */
|
|
129
|
+
declare function readProviderRefusalReview(value: unknown): ProviderRefusalReview | undefined;
|
|
130
|
+
//#endregion
|
|
108
131
|
//#region packages/llm-core/src/usage-cost.d.ts
|
|
109
132
|
declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostConfig;
|
|
110
133
|
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
111
134
|
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
112
135
|
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
113
136
|
declare namespace index_d_exports {
|
|
114
|
-
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
137
|
+
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_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
115
138
|
}
|
|
116
139
|
//#endregion
|
|
117
|
-
export {
|
|
140
|
+
export { supportsClaudeFastMode as C, supportsClaudeAdaptiveThinking as S, supportsClaudeNativeXhighEffort as T, resolveClaudeNativeThinkingLevelMap as _, ProviderRefusalReview as a, resolveClaudeSonnet5ModelIdentity as b, CLAUDE_OPUS_55_THINKING_PROFILE as c, bindsClaudeThinkingPrefix as d, requiresClaudeDefaultSampling as f, resolveClaudeMythos5ModelIdentity as g, resolveClaudeModelIdentity as h, normalizeResolvedPricing as i, CLAUDE_OPUS_5_THINKING_PROFILE as l, resolveClaudeFable5ModelIdentity as m, calculateUsageCost as n, readProviderRefusalReview as o, requiresClaudeMandatoryAdaptiveThinking as p, normalizeModelCostConfig as r, CLAUDE_FABLE_5_THINKING_PROFILE as s, index_d_exports as t, CLAUDE_SONNET_5_THINKING_PROFILE as u, resolveClaudeOpus55ModelIdentity as v, supportsClaudeNativeMaxEffort as w, supportsClaude1MContext as x, resolveClaudeOpus5ModelIdentity as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, et as ThinkingLevel, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import { a as
|
|
7
|
-
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-4atIX-2V.mjs";
|
|
1
|
+
import { C as supportsClaudeFastMode, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeXhighEffort, _ as resolveClaudeNativeThinkingLevelMap, a as ProviderRefusalReview, b as resolveClaudeSonnet5ModelIdentity, c as CLAUDE_OPUS_55_THINKING_PROFILE, d as bindsClaudeThinkingPrefix, f as requiresClaudeDefaultSampling, g as resolveClaudeMythos5ModelIdentity, h as resolveClaudeModelIdentity, i as normalizeResolvedPricing, l as CLAUDE_OPUS_5_THINKING_PROFILE, m as resolveClaudeFable5ModelIdentity, n as calculateUsageCost, o as readProviderRefusalReview, p as requiresClaudeMandatoryAdaptiveThinking, r as normalizeModelCostConfig, s as CLAUDE_FABLE_5_THINKING_PROFILE, u as CLAUDE_SONNET_5_THINKING_PROFILE, v as resolveClaudeOpus55ModelIdentity, w as supportsClaudeNativeMaxEffort, x as supportsClaude1MContext, y as resolveClaudeOpus5ModelIdentity } from "./index-C25RT6bP.mjs";
|
|
2
|
+
import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, dt as DiagnosticErrorInfo, et as ThinkingLevel, f as ImageContent, ft as appendAssistantMessageDiagnostic, g as ImagesInputContent, gt as isProviderRefusalAssistantError, h as ImagesFunction, ht as formatThrownValue, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, mt as extractDiagnosticError, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, pt as createAssistantMessageDiagnostic, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, ut as AssistantMessageDiagnostic, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-qZFbaDbK.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-CjnIZZst.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-DhQhmt6t.mjs";
|
|
5
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-C2T3lTV7.mjs";
|
|
6
|
+
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-DH-Z-LDb.mjs";
|
|
8
7
|
//#region packages/ai/src/stream.d.ts
|
|
9
8
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
10
9
|
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
@@ -22,4 +21,4 @@ export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
|
22
21
|
};
|
|
23
22
|
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
24
23
|
//#endregion
|
|
25
|
-
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
24
|
+
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, type ProviderRefusalReview, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, a as CLAUDE_OPUS_55_THINKING_PROFILE, b as supportsClaudeFastMode, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeOpus5ModelIdentity, h as resolveClaudeOpus55ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as normalizeModelCostConfig, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeResolvedPricing, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as calculateUsageCost, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaude1MContext, x as supportsClaudeNativeMaxEffort, y as supportsClaudeAdaptiveThinking } from "./src-DwGYYyZp.mjs";
|
|
2
2
|
import { n as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE } from "./types-LFWwv0cF.mjs";
|
|
3
|
-
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
3
|
+
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, o as readProviderRefusalReview, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
|
|
4
4
|
import { i as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import "./src-DDmEryvj.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-Dw7cb6BV.mjs";
|
|
7
6
|
import { n as createApiRegistry, t as createLlmRuntime } from "./stream-CREqxHgU.mjs";
|
|
8
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-
|
|
9
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
7
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-yTvBrYM2.mjs";
|
|
8
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_55_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, readProviderRefusalReview, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { G as SimpleStreamOptions, J as StreamFunction, K as StopReason, O as Model, d as Context, ot as Usage } from "../types-
|
|
3
|
-
import { t as
|
|
4
|
-
import
|
|
5
|
-
import "../
|
|
6
|
-
import { p as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-BZ8umAbk.mjs";
|
|
1
|
+
import { S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeXhighEffort, _ as resolveClaudeNativeThinkingLevelMap, b as resolveClaudeSonnet5ModelIdentity, d as bindsClaudeThinkingPrefix, f as requiresClaudeDefaultSampling, g as resolveClaudeMythos5ModelIdentity, h as resolveClaudeModelIdentity, m as resolveClaudeFable5ModelIdentity, p as requiresClaudeMandatoryAdaptiveThinking, v as resolveClaudeOpus55ModelIdentity, w as supportsClaudeNativeMaxEffort, y as resolveClaudeOpus5ModelIdentity } from "../index-C25RT6bP.mjs";
|
|
2
|
+
import { G as SimpleStreamOptions, J as StreamFunction, K as StopReason, O as Model, d as Context, ot as Usage, ut as AssistantMessageDiagnostic } from "../types-qZFbaDbK.mjs";
|
|
3
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-DZYq53lj.mjs";
|
|
4
|
+
import "../types-DTvddOfm.mjs";
|
|
5
|
+
import { p as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-DyfwikYJ.mjs";
|
|
7
6
|
import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
|
|
8
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
9
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
@@ -28,8 +27,12 @@ export declare function usesFoundryBearerAuth(model: AnthropicAuthModel): boolea
|
|
|
28
27
|
export declare function omitFoundryBearerCredentialHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region packages/ai/src/providers/anthropic-model-contract.d.ts
|
|
31
|
-
export declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.
|
|
32
|
-
|
|
30
|
+
export declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.278";
|
|
31
|
+
/** Build OAuth headers and the matching billing identity from one request snapshot. */
|
|
32
|
+
export declare function buildAnthropicClaudeCodeIdentity(betaHeader: string | undefined, ...headerSources: (Record<string, string> | undefined)[]): {
|
|
33
|
+
headers: Record<string, string>;
|
|
34
|
+
version: string;
|
|
35
|
+
};
|
|
33
36
|
type ReplayModelRef = {
|
|
34
37
|
provider?: string;
|
|
35
38
|
api?: string;
|
|
@@ -53,7 +56,7 @@ export declare function requiresClaudeAdaptiveThinking(model: {
|
|
|
53
56
|
params?: Record<string, unknown>;
|
|
54
57
|
api?: string;
|
|
55
58
|
}): boolean;
|
|
56
|
-
/** Return whether omitted thinking should default to adaptive
|
|
59
|
+
/** Return whether omitted thinking should default to adaptive mode. */
|
|
57
60
|
export declare function defaultsClaudeAdaptiveThinking(model: {
|
|
58
61
|
id?: string;
|
|
59
62
|
params?: Record<string, unknown>;
|
|
@@ -226,4 +229,4 @@ export declare function applyAnthropicMessageStartUsage(target: Usage, payload:
|
|
|
226
229
|
/** Keep billing and context distinct; omitted usage preserves the last snapshot. */
|
|
227
230
|
export declare function applyAnthropicMessageDeltaUsage(target: Usage, usage: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
228
231
|
//#endregion
|
|
229
|
-
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
232
|
+
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as mapAnthropicStopReason, D as resolveModelBoundThinkingReplayMode, E as resolveAnthropicThinkingEffort, O as usesClaudeFable5MessagesContract, S as defaultsClaudeAdaptiveThinking, T as requiresClaudeAdaptiveThinking, b as
|
|
3
|
-
import { A as applyAnthropicFallbackBoundary, C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, E as readAnthropicInputTransformations, G as resolveAnthropicServerCompactionPlan, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as resolveAnthropicFallbackServingModelCost, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, S as ANTHROPIC_OMITTED_REASONING_TEXT, T as logAnthropicThinkingDrops, _ as normalizeAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as resolveOriginalAnthropicToolName, c as applyAnthropicRefusal, g as normalizeAnthropicToolCallId, i as readAnthropicCacheWriteUsage, j as readAnthropicFallbackBoundary, k as CLAUDE_OPUS_FALLBACK_MODEL_COST, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as projectAnthropicTools, w as findActiveAnthropicToolTurnAssistantIndex, x as toClaudeCodeToolName, y as reconcileAnthropicToolChoice } from "../anthropic-stream-reducer-
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
5
|
-
export {
|
|
1
|
+
import { S as supportsClaudeNativeXhighEffort, _ as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeOpus5ModelIdentity, h as resolveClaudeOpus55ModelIdentity, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, u as requiresClaudeMandatoryAdaptiveThinking, x as supportsClaudeNativeMaxEffort, y as supportsClaudeAdaptiveThinking } from "../src-DwGYYyZp.mjs";
|
|
2
|
+
import { C as mapAnthropicStopReason, D as resolveModelBoundThinkingReplayMode, E as resolveAnthropicThinkingEffort, O as usesClaudeFable5MessagesContract, S as defaultsClaudeAdaptiveThinking, T as requiresClaudeAdaptiveThinking, b as applyClaudeRequestContract, k as usesClaudeStreamingRefusalContract, w as prepareClaudeNoPrefillRequestContext, x as buildAnthropicClaudeCodeIdentity, y as ANTHROPIC_CLAUDE_CODE_VERSION } from "../host-yTvBrYM2.mjs";
|
|
3
|
+
import { A as applyAnthropicFallbackBoundary, C as applyAnthropicThinkingBindingControls, D as ANTHROPIC_SERVER_SIDE_FALLBACKS, E as readAnthropicInputTransformations, G as resolveAnthropicServerCompactionPlan, J as usesFoundryBearerAuth, K as isAnthropicOAuthApiKey, M as resolveAnthropicFallbackServingModelCost, O as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, S as ANTHROPIC_OMITTED_REASONING_TEXT, T as logAnthropicThinkingDrops, _ as normalizeAnthropicToolChoice, a as readAnthropicPromptUsageSnapshot, b as resolveOriginalAnthropicToolName, c as applyAnthropicRefusal, g as normalizeAnthropicToolCallId, i as readAnthropicCacheWriteUsage, j as readAnthropicFallbackBoundary, k as CLAUDE_OPUS_FALLBACK_MODEL_COST, n as applyAnthropicMessageDeltaUsage, o as readAnthropicUsageTokenCount, q as omitFoundryBearerCredentialHeaders, r as applyAnthropicMessageStartUsage, s as readLastAnthropicIterationUsage, v as projectAnthropicTools, w as findActiveAnthropicToolTurnAssistantIndex, x as toClaudeCodeToolName, y as reconcileAnthropicToolChoice } from "../anthropic-stream-reducer-D6ZI1wwj.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DZQ_7gD1.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, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus55ModelIdentity, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as readOpenAIResponsesCompactionWindow, s as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import { i as resolveOpenAIResponsesServerCompactionPlan, r as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-payload-policy-
|
|
1
|
+
import { c as readOpenAIResponsesCompactionWindow, s as OpenAIResponsesCompactionOutput, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-B1ENJFpI.mjs";
|
|
2
|
+
import { i as resolveOpenAIResponsesServerCompactionPlan, r as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-payload-policy-C7GsA1y0.mjs";
|
|
3
3
|
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 { c as resolveOpenAIResponsesServerCompactionPlan, r as readOpenAIResponsesCompactionWindow, s as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-compaction-window-
|
|
1
|
+
import { i as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-DWrfMODE.mjs";
|
|
2
|
+
import { c as resolveOpenAIResponsesServerCompactionPlan, r as readOpenAIResponsesCompactionWindow, s as resolveOpenAIResponsesPayloadPolicy } from "../openai-responses-compaction-window-BiNCT0bS.mjs";
|
|
3
3
|
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { G as SimpleStreamOptions, J as StreamFunction, K as StopReason, O as Model, d as Context
|
|
2
|
-
import { _ as
|
|
1
|
+
import { G as SimpleStreamOptions, J as StreamFunction, K as StopReason, O as Model, d as Context } from "../types-qZFbaDbK.mjs";
|
|
2
|
+
import { C as supportsOpenAITemperature, S as supportsOpenAIReasoningEffort, _ as normalizeOpenAIReasoningEffort, a as BaseOpenAIStreamOptions, b as resolveOpenAIReasoningEffortMapping, d as OpenAIApiReasoningEffort, f as OpenAIReasoningEffort, g as isOpenAIGpt6Model, h as isOpenAIGpt56Model, l as codeModeToolSurfaceObserver, m as isOpenAIGpt55Model, o as CodeModeToolSurfaceObservation, p as isOpenAIGpt54MiniModel, s as OpenAICompletionsOptions, u as reasoningTagTextPolicy, v as resolveOpenAIModelReasoningEfforts, x as resolveOpenAISupportedReasoningEfforts, y as resolveOpenAIReasoningEffortForModel } from "../provider-options-DZYq53lj.mjs";
|
|
3
3
|
import { a as reconcileOpenAIResponsesToolChoice, i as reconcileOpenAICompletionsToolChoice, n as OpenAIToolProjection, r as projectOpenAITools, t as OpenAICompletionsToolChoice } from "../openai-tool-projection-793cE3QX.mjs";
|
|
4
|
-
import "../types-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-
|
|
8
|
-
import
|
|
4
|
+
import "../types-DTvddOfm.mjs";
|
|
5
|
+
import { t as ResolvedOpenAICompletionsCompat } from "../openai-completions-compat-DfJG1wSO.mjs";
|
|
6
|
+
import { a as ResponsesPromptObservation, l as OpenAIRequestReasoningEffort, o as responsesPromptObserver } from "../openai-responses-contracts-B1ENJFpI.mjs";
|
|
7
|
+
import { n as clampOpenAIPromptCacheKey, r as resolveOpenAIPromptCacheParams, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "../openai-prompt-cache-C4RHdN4n.mjs";
|
|
8
|
+
import { a as resolveResponsesTerminalStopReason, i as readResponsesReasoningTokens, n as isResponsesOutputLimitToolCallError, r as mapResponsesTerminalUsage, t as ResponsesTerminalUsagePayload } from "../openai-responses-terminal-usage-BNFbvY9f.mjs";
|
|
9
9
|
import { ResponseCreateParamsStreaming } from "openai/resources/responses/responses.js";
|
|
10
10
|
import { ChatCompletionMessageParam } from "openai/resources/chat/completions.js";
|
|
11
11
|
//#region packages/ai/src/providers/azure-deployment-map.d.ts
|
|
@@ -40,14 +40,11 @@ export declare const streamSimpleOpenAICompletions: StreamFunction<"openai-compl
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region packages/ai/src/providers/openai-responses.d.ts
|
|
42
42
|
export interface OpenAIResponsesOptions extends BaseOpenAIStreamOptions {
|
|
43
|
-
reasoningEffort?:
|
|
43
|
+
reasoningEffort?: OpenAIRequestReasoningEffort;
|
|
44
44
|
reasoningSummary?: "auto" | "detailed" | "concise" | null;
|
|
45
45
|
replayResponsesItemIds?: boolean;
|
|
46
46
|
serviceTier?: ResponseCreateParamsStreaming["service_tier"];
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Generate function for OpenAI Responses API
|
|
50
|
-
*/
|
|
51
48
|
export declare const streamOpenAIResponses: StreamFunction<"openai-responses", OpenAIResponsesOptions>;
|
|
52
49
|
export declare const streamSimpleOpenAIResponses: StreamFunction<"openai-responses", SimpleStreamOptions>;
|
|
53
50
|
//#endregion
|
|
@@ -88,47 +85,6 @@ export declare function resolveResponsesMessageSnapshotCollapse(params: {
|
|
|
88
85
|
nextPhase: string | undefined;
|
|
89
86
|
}): ResponsesMessageSnapshotCollapse;
|
|
90
87
|
//#endregion
|
|
91
|
-
//#region packages/ai/src/providers/openai-responses-terminal-usage.d.ts
|
|
92
|
-
/** Terminal usage payload, modeled structurally so untyped callers can pass raw records. */
|
|
93
|
-
export type ResponsesTerminalUsagePayload = {
|
|
94
|
-
input_tokens?: number | null;
|
|
95
|
-
output_tokens?: number | null;
|
|
96
|
-
total_tokens?: number | null;
|
|
97
|
-
input_tokens_details?: {
|
|
98
|
-
cached_tokens?: number | null;
|
|
99
|
-
cache_write_tokens?: number | null;
|
|
100
|
-
} | null;
|
|
101
|
-
output_tokens_details?: {
|
|
102
|
-
reasoning_tokens?: number | null;
|
|
103
|
-
} | null;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Split a terminal usage payload into the priced buckets.
|
|
107
|
-
*
|
|
108
|
-
* OpenAI includes cache reads and writes in `input_tokens`, so both are subtracted out of the
|
|
109
|
-
* billable input bucket. `total_tokens` comes from the payload, but never below the sum of the
|
|
110
|
-
* split buckets: proxies routinely omit it (reporting 0 would understate the turn), and a payload
|
|
111
|
-
* whose `cached_tokens` exceeds `input_tokens` clamps the input bucket, leaving the reported total
|
|
112
|
-
* short of what the buckets actually price.
|
|
113
|
-
*/
|
|
114
|
-
export declare function mapResponsesTerminalUsage(usage: ResponsesTerminalUsagePayload | undefined | null): Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "contextUsage" | "totalTokens"> | undefined;
|
|
115
|
-
/** Reasoning tokens are reported by the agent path only; the package path does not track them. */
|
|
116
|
-
export declare function readResponsesReasoningTokens(usage: ResponsesTerminalUsagePayload | undefined | null): number | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* Resolve the terminal stop reason, including the two overrides every Responses path shares: a
|
|
119
|
-
* content-filtered turn is a provider error rather than a truncated answer, and a turn that
|
|
120
|
-
* produced tool calls reports `toolUse` instead of a plain stop.
|
|
121
|
-
*/
|
|
122
|
-
export declare function resolveResponsesTerminalStopReason(params: {
|
|
123
|
-
status: OpenAI.Responses.ResponseStatus | undefined;
|
|
124
|
-
terminalEventType?: "response.completed" | "response.incomplete";
|
|
125
|
-
incompleteReason?: string;
|
|
126
|
-
hasToolCall: boolean;
|
|
127
|
-
}): {
|
|
128
|
-
stopReason: StopReason;
|
|
129
|
-
errorMessage?: string;
|
|
130
|
-
};
|
|
131
|
-
//#endregion
|
|
132
88
|
//#region packages/ai/src/providers/openai-responses-tool-call-tracker.d.ts
|
|
133
89
|
export type ResponsesToolCallIdentity = {
|
|
134
90
|
itemId?: string;
|
|
@@ -136,6 +92,7 @@ export type ResponsesToolCallIdentity = {
|
|
|
136
92
|
};
|
|
137
93
|
export type ResponsesToolCallState = ResponsesToolCallIdentity & {
|
|
138
94
|
argumentStreamReliable: boolean;
|
|
95
|
+
argumentsStreamed: boolean;
|
|
139
96
|
outputIndex?: number;
|
|
140
97
|
};
|
|
141
98
|
type ResponsesToolCallEvent = {
|
|
@@ -164,4 +121,18 @@ export declare function mapOpenAIStopReason(reason: string | null, options?: {
|
|
|
164
121
|
allowSingularToolCall?: boolean;
|
|
165
122
|
}): OpenAIStopReasonResult;
|
|
166
123
|
//#endregion
|
|
167
|
-
|
|
124
|
+
//#region packages/ai/src/transports/openai-responses-request-lifecycle.d.ts
|
|
125
|
+
/** Host-owned authority for a single explicitly acknowledged Responses request. */
|
|
126
|
+
type ResponsesRequestLifecycle = {
|
|
127
|
+
beforeDispatch(signal?: AbortSignal): Promise<void>;
|
|
128
|
+
assertCurrent(): void;
|
|
129
|
+
accepted(responseId: string, signal?: AbortSignal): Promise<void>;
|
|
130
|
+
settle(): Promise<void>;
|
|
131
|
+
};
|
|
132
|
+
/** Private transport carrier: serialized options cannot mint host authority. */
|
|
133
|
+
export declare const responsesRequestLifecycle: {
|
|
134
|
+
set(options: object, lifecycle: ResponsesRequestLifecycle): void;
|
|
135
|
+
get(options: object | undefined): ResponsesRequestLifecycle | undefined;
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
export { type CodeModeToolSurfaceObservation, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, OpenAIApiReasoningEffort, type OpenAICompletionsOptions, type OpenAICompletionsToolChoice, OpenAIReasoningEffort, type OpenAIToolProjection, type ResponsesPromptObservation, ResponsesTerminalUsagePayload, clampOpenAIPromptCacheKey, codeModeToolSurfaceObserver, isOpenAIGpt54MiniModel, isOpenAIGpt55Model, isOpenAIGpt56Model, isOpenAIGpt6Model, isResponsesOutputLimitToolCallError, mapResponsesTerminalUsage, normalizeOpenAIReasoningEffort, projectOpenAITools, readResponsesReasoningTokens, reasoningTagTextPolicy, reconcileOpenAICompletionsToolChoice, reconcileOpenAIResponsesToolChoice, resolveOpenAIModelReasoningEfforts, resolveOpenAIPromptCacheParams, resolveOpenAIReasoningEffortForModel, resolveOpenAIReasoningEffortMapping, resolveOpenAISupportedReasoningEfforts, resolveResponsesTerminalStopReason, responsesPromptObserver, supportsOpenAIReasoningEffort, supportsOpenAITemperature };
|