@openclaw/ai 2026.9.1-beta.1 → 2026.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-DI4PZKKB.mjs → anthropic-BDdqdVLK.mjs} +222 -216
- package/dist/{anthropic-compaction-replay-nhKaCXu6.mjs → anthropic-compaction-replay-DB2FGLQc.mjs} +160 -68
- package/dist/{anthropic-payload-policy-B_0n0enE.d.mts → anthropic-payload-policy-d46X2pR0.d.mts} +28 -4
- package/dist/{api-registry-CTd8NzcD.d.mts → api-registry-DWtPjzyn.d.mts} +2 -2
- package/dist/{azure-openai-responses-D8dI0ekg.mjs → azure-openai-responses-C5bZRfAP.mjs} +12 -9
- package/dist/{number-coercion-H9qHik3g.mjs → base64-CEFBpSkN.mjs} +73 -1
- package/dist/{diagnostics-COpOtRwq.mjs → diagnostics-CPeq9F7y.mjs} +5 -1
- package/dist/diagnostics-DfFyKeX_.mjs +136 -0
- package/dist/{diagnostics-BaTA9eVl.d.mts → diagnostics-DnPnOui6.d.mts} +5 -1
- package/dist/diagnostics.d.mts +8 -3
- package/dist/diagnostics.mjs +4 -3
- package/dist/{env-api-keys-DrgeBuva.mjs → env-api-keys-bktO00EJ.mjs} +2 -15
- package/dist/{event-stream-uSMZJ3FA.mjs → event-stream-BgDvQeum.mjs} +3 -9
- package/dist/{event-stream-LiXePESD.d.mts → event-stream-BhT5T1Ay.d.mts} +1 -1
- package/dist/event-stream-zctLx0yr.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{google-Od-LLdVK.mjs → google-4qeuE8iX.mjs} +9 -7
- package/dist/{google-shared-Bgr9lFPw.mjs → google-shared-CWeG8RIl.mjs} +27 -23
- package/dist/{google-vertex-aerRSXc4.mjs → google-vertex-O9BcnB6X.mjs} +8 -6
- package/dist/{host-D51fmkH6.mjs → host-CEvLw30U.mjs} +54 -9
- package/dist/{host-DsbPMFU6.d.mts → host-DjzGmdZ2.d.mts} +3 -3
- package/dist/index-FnHM2FcI.d.mts +117 -0
- package/dist/index.d.mts +10 -11
- package/dist/index.mjs +6 -6
- package/dist/internal/anthropic.d.mts +59 -55
- package/dist/internal/anthropic.mjs +5 -5
- package/dist/internal/openai-responses-payload-policy.d.mts +3 -3
- package/dist/internal/openai-responses-payload-policy.mjs +2 -3
- package/dist/internal/openai.d.mts +66 -64
- package/dist/internal/openai.mjs +10 -10
- package/dist/internal/retry-after.d.mts +2 -3
- package/dist/internal/runtime.d.mts +43 -43
- package/dist/internal/runtime.mjs +10 -8
- package/dist/internal/shared.d.mts +25 -25
- package/dist/internal/shared.mjs +95 -4
- package/dist/{mistral-EiHdymeb.mjs → mistral-Tb6oalqH.mjs} +30 -23
- package/dist/{openai-chatgpt-responses-DHpF9o1e.mjs → openai-chatgpt-responses-yUXjPNfu.mjs} +76 -137
- package/dist/{openai-completions-EFPiUGfS.mjs → openai-completions-BIUV3RDT.mjs} +26 -22
- package/dist/{openai-completions-compat-BefmHT26.d.mts → openai-completions-compat-CpjYUArk.d.mts} +5 -5
- package/dist/{openai-completions-stream-DUlGwRMz.mjs → openai-completions-stream-BsrBe3Gg.mjs} +103 -96
- package/dist/openai-prompt-cache-CGnVB74a.mjs +21 -0
- package/dist/openai-prompt-cache-CNoIfHYC.d.mts +16 -0
- package/dist/{openai-responses-BogP8OjX.mjs → openai-responses-CCL41ALM.mjs} +15 -14
- package/dist/openai-responses-compaction-window-BMVHFOtq.mjs +697 -0
- package/dist/{openai-responses-contracts-Dvj_UtPy.d.mts → openai-responses-contracts-rF5DDRNS.d.mts} +23 -6
- package/dist/{openai-responses-payload-policy-CNGFT9zr.d.mts → openai-responses-payload-policy-rLRPsSmB.d.mts} +1 -0
- package/dist/{openai-responses-prompt-observer-internal-Cd4hJG-S.mjs → openai-responses-prompt-observer-internal-D0bhBfgL.mjs} +4 -18
- package/dist/{openai-responses-shared-DJThc6jW.mjs → openai-responses-shared-Bmma_3Qc.mjs} +438 -309
- package/dist/{openai-tool-schema-ho-hIkQf.mjs → openai-tool-schema-_pTAJqKF.mjs} +30 -40
- package/dist/{provider-error-DDOs_Bz0.mjs → provider-error-9TraxGvt.mjs} +20 -92
- package/dist/{provider-options-MdMBLzlU.d.mts → provider-options-Bcc_p-TU.d.mts} +26 -6
- package/dist/provider-replay-context-BuSUaAk5.mjs +21 -0
- package/dist/{provider-transcript-transform-C01bQ5a3.mjs → provider-transcript-transform-BaMbI1hr.mjs} +1 -1
- package/dist/provider-types.d.mts +19 -20
- package/dist/providers.d.mts +6 -6
- package/dist/providers.mjs +11 -11
- package/dist/{reasoning-tag-text-partitioner-5ygO2rZc.mjs → reasoning-tag-text-partitioner-DLCNXki6.mjs} +158 -94
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{sanitize-unicode-DCkltN94.mjs → sanitize-unicode-D6xUvZaS.mjs} +2 -8
- package/dist/{simple-options-CFj7x3J4.mjs → simple-options-BjHCCh4v.mjs} +42 -6
- package/dist/{src-Bu3FiFAG.mjs → src-2qBGKg8O.mjs} +83 -2
- package/dist/{stream-first-event-timeout-MK28puvq.mjs → stream-first-event-timeout-DcNjoFQE.mjs} +1 -1
- package/dist/{tool-schema-json-projection-qvTEs5Am.mjs → tool-schema-json-projection-mJhXDcyz.mjs} +21 -31
- package/dist/{transport-stream-shared-ljShVIZB.mjs → transport-stream-shared-CZqMhfIw.mjs} +19 -6
- package/dist/{transport-stream-shared-rvaCyFYt.d.mts → transport-stream-shared-xnaqxmbP.d.mts} +5 -5
- package/dist/{transport-utils-LJ1_rbi-.mjs → transport-utils-7il795_9.mjs} +5 -8
- package/dist/transports.d.mts +121 -85
- package/dist/transports.mjs +747 -464
- package/dist/types-3Lnm-QSJ.d.mts +1 -0
- package/dist/{types-DhLoJbFm.d.mts → types-CJ1-Ht7A.d.mts} +55 -19
- package/dist/types.d.mts +7 -7
- package/dist/types.mjs +5 -5
- package/dist/{validation-Dk7q7NMN.d.mts → validation-AKZBDGQd.d.mts} +1 -1
- package/dist/{validation-B61OhAio.mjs → validation-CJZtym2g.mjs} +7 -5
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +5 -5
- package/dist/anthropic-BECQCNdF.d.mts +0 -98
- package/dist/event-stream-BKp4fOt_.d.mts +0 -1
- package/dist/index-Qbej8io0.d.mts +0 -3
- package/dist/openai-prompt-cache-2uo_1OR1.d.mts +0 -7
- package/dist/openai-prompt-cache-mZTCdRPo.mjs +0 -12
- package/dist/openai-responses-contracts-QUY12X0B.mjs +0 -233
- package/dist/openai-responses-payload-policy-D8EdimYe.mjs +0 -204
- package/dist/provider-options-AvldWZt8.mjs +0 -21
- package/dist/tls-certificate-errors-DXSpluKI.mjs +0 -93
- package/dist/types-GiAjXatj.d.mts +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
|
|
2
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-CJ1-Ht7A.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BhT5T1Ay.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-AKZBDGQd.mjs";
|
|
5
|
+
//#region packages/llm-core/src/model-contracts/anthropic.d.ts
|
|
6
|
+
type ClaudeModelRef = {
|
|
7
|
+
id?: string;
|
|
8
|
+
params?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
type ClaudeEffortModelRef = ClaudeModelRef & {
|
|
11
|
+
thinkingLevelMap?: Record<string, string | null | undefined>;
|
|
12
|
+
};
|
|
13
|
+
declare const CLAUDE_FABLE_5_THINKING_PROFILE: {
|
|
14
|
+
readonly levels: readonly [{
|
|
15
|
+
readonly id: "minimal";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "low";
|
|
18
|
+
}, {
|
|
19
|
+
readonly id: "medium";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "high";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "xhigh";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "adaptive";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "max";
|
|
28
|
+
}];
|
|
29
|
+
readonly defaultLevel: "high";
|
|
30
|
+
readonly preserveWhenCatalogReasoningFalse: true;
|
|
31
|
+
};
|
|
32
|
+
declare const CLAUDE_SONNET_5_THINKING_PROFILE: {
|
|
33
|
+
readonly levels: readonly [{
|
|
34
|
+
readonly id: "off";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "minimal";
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "low";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "medium";
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "high";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "xhigh";
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "adaptive";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "max";
|
|
49
|
+
}];
|
|
50
|
+
readonly defaultLevel: "high";
|
|
51
|
+
};
|
|
52
|
+
declare const CLAUDE_OPUS_5_THINKING_PROFILE: {
|
|
53
|
+
readonly levels: readonly [{
|
|
54
|
+
readonly id: "off";
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "minimal";
|
|
57
|
+
}, {
|
|
58
|
+
readonly id: "low";
|
|
59
|
+
}, {
|
|
60
|
+
readonly id: "medium";
|
|
61
|
+
}, {
|
|
62
|
+
readonly id: "high";
|
|
63
|
+
}, {
|
|
64
|
+
readonly id: "xhigh";
|
|
65
|
+
}, {
|
|
66
|
+
readonly id: "adaptive";
|
|
67
|
+
}, {
|
|
68
|
+
readonly id: "max";
|
|
69
|
+
}];
|
|
70
|
+
readonly defaultLevel: "high";
|
|
71
|
+
};
|
|
72
|
+
/** Resolve the canonical normalized Claude model id for one runtime model ref. */
|
|
73
|
+
declare function resolveClaudeModelIdentity(ref: ClaudeModelRef): string;
|
|
74
|
+
/** Resolve Claude Fable 5 through direct ids, cloud ids, or deployment metadata. */
|
|
75
|
+
declare function resolveClaudeFable5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
76
|
+
/** Resolve Claude Mythos 5 through direct ids, cloud ids, or deployment metadata. */
|
|
77
|
+
declare function resolveClaudeMythos5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Anthropic binds thinking to the conversation prefix starting with Fable 5.1 and
|
|
80
|
+
* plans to enforce it on later models. Extend only with live replay proof for the
|
|
81
|
+
* new model (Mythos 5.1 is unregistered here and unproven).
|
|
82
|
+
*/
|
|
83
|
+
declare function bindsClaudeThinkingPrefix(ref: ClaudeModelRef): boolean;
|
|
84
|
+
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
85
|
+
declare function requiresClaudeMandatoryAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
86
|
+
/** Resolve Claude Sonnet 5 through direct ids, cloud ids, or deployment metadata. */
|
|
87
|
+
declare function resolveClaudeSonnet5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
88
|
+
/** Resolve Claude Opus 5 through aliases, direct ids, cloud ids, or deployment metadata. */
|
|
89
|
+
declare function resolveClaudeOpus5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
90
|
+
/** Return whether a Claude model supports adaptive thinking. */
|
|
91
|
+
declare function supportsClaudeAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
92
|
+
/** Return whether a Claude model has a native 1M-token context window. */
|
|
93
|
+
declare function supportsClaude1MContext(ref: ClaudeModelRef): boolean;
|
|
94
|
+
/** Return whether a Claude model supports Anthropic's native fast mode. */
|
|
95
|
+
declare function supportsClaudeFastMode(ref: ClaudeModelRef): boolean;
|
|
96
|
+
/** Return whether a Claude model supports native max effort. */
|
|
97
|
+
declare function supportsClaudeNativeMaxEffort(ref: ClaudeModelRef): boolean;
|
|
98
|
+
/** Return whether a Claude model supports native xhigh effort. */
|
|
99
|
+
declare function supportsClaudeNativeXhighEffort(ref: ClaudeModelRef): boolean;
|
|
100
|
+
/** Return whether a Claude model rejects caller-selected sampling parameters. */
|
|
101
|
+
declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Fill native Claude effort mappings only when the provider did not publish a
|
|
104
|
+
* narrower route-specific contract.
|
|
105
|
+
*/
|
|
106
|
+
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region packages/llm-core/src/usage-cost.d.ts
|
|
109
|
+
declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostConfig;
|
|
110
|
+
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
111
|
+
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
112
|
+
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
113
|
+
declare namespace index_d_exports {
|
|
114
|
+
export { AnthropicMessagesCompat, Api, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { supportsClaude1MContext as _, CLAUDE_FABLE_5_THINKING_PROFILE as a, supportsClaudeNativeMaxEffort as b, bindsClaudeThinkingPrefix as c, resolveClaudeFable5ModelIdentity as d, resolveClaudeModelIdentity as f, resolveClaudeSonnet5ModelIdentity as g, resolveClaudeOpus5ModelIdentity as h, normalizeResolvedPricing as i, requiresClaudeDefaultSampling as l, resolveClaudeNativeThinkingLevelMap as m, calculateUsageCost as n, CLAUDE_OPUS_5_THINKING_PROFILE as o, resolveClaudeMythos5ModelIdentity as p, normalizeModelCostConfig as r, CLAUDE_SONNET_5_THINKING_PROFILE as s, index_d_exports as t, requiresClaudeMandatoryAdaptiveThinking as u, supportsClaudeAdaptiveThinking as v, supportsClaudeNativeXhighEffort as x, supportsClaudeFastMode as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-
|
|
3
|
-
import { $ as
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import "./
|
|
7
|
-
import { a as
|
|
8
|
-
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-DsbPMFU6.mjs";
|
|
1
|
+
import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-FnHM2FcI.mjs";
|
|
2
|
+
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
|
|
3
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-CJ1-Ht7A.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BhT5T1Ay.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-AKZBDGQd.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-DWtPjzyn.mjs";
|
|
7
|
+
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-DjzGmdZ2.mjs";
|
|
9
8
|
//#region packages/ai/src/stream.d.ts
|
|
10
9
|
/** Creates an isolated LLM runtime backed by the supplied provider registry. */
|
|
11
|
-
declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
10
|
+
export declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
12
11
|
registry: {
|
|
13
12
|
registerApiProvider: <TApi extends Api, TOptions extends StreamOptions>(provider: ApiProvider<TApi, TOptions>, sourceId?: string) => void;
|
|
14
13
|
getApiProvider: (api: Api) => RegisteredApiProvider | undefined;
|
|
@@ -21,6 +20,6 @@ declare function createLlmRuntime(registry?: ApiRegistry): {
|
|
|
21
20
|
streamSimple: <TApi extends Api>(model: Model<TApi>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStreamContract;
|
|
22
21
|
completeSimple: <TApi extends Api>(model: Model<TApi>, context: Context, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
|
|
23
22
|
};
|
|
24
|
-
type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
23
|
+
export type LlmRuntime = ReturnType<typeof createLlmRuntime>;
|
|
25
24
|
//#endregion
|
|
26
|
-
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,
|
|
25
|
+
export { AiInlineContentBlock, AiInlineImageBlock, AiInlineTextBlock, AiProviderRequestCapabilities, AiProviderRequestPolicyInput, AiProviderStreamHookContext, AiTransformTransportMessages, AiTransportHost, AiTransportPluginHost, AnthropicMessagesCompat, Api, ApiProvider, ApiRegistry, ApiStreamFunction, ApiStreamSimpleFunction, AssistantDeliveryTtsFacts, AssistantImages, AssistantMessage, AssistantMessageDiagnostic, AssistantMessageEvent, AssistantMessageEventStream, AssistantMessageEventStreamContract, AssistantMessageEventStreamLike, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, CacheRetention, CompleteSimpleFn, Context, DiagnosticErrorInfo, EventStream, ImageContent, ImagesApi, ImagesContext, ImagesFunction, ImagesInputContent, ImagesModel, ImagesOptions, ImagesOutputContent, ImagesProvider, ImagesStopReason, KnownApi, KnownImagesApi, KnownImagesProvider, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenAIStrictToolSettingOptions, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, RegisteredApiProvider, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeResolvedPricing, s as bindsClaudeThinkingPrefix, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./src-2qBGKg8O.mjs";
|
|
2
2
|
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
|
|
3
|
-
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
3
|
+
import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BgDvQeum.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.mjs";
|
|
6
6
|
import { n as createApiRegistry, t as createLlmRuntime } from "./stream-CREqxHgU.mjs";
|
|
7
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-
|
|
8
|
-
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
7
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels, t as configureAiTransportHost } from "./host-CEvLw30U.mjs";
|
|
8
|
+
export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as AssistantMessageDiagnostic } from "../diagnostics-
|
|
3
|
-
import {
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import "../
|
|
7
|
-
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-B_0n0enE.mjs";
|
|
1
|
+
import { b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, p as resolveClaudeMythos5ModelIdentity, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort } from "../index-FnHM2FcI.mjs";
|
|
2
|
+
import { t as AssistantMessageDiagnostic } from "../diagnostics-DnPnOui6.mjs";
|
|
3
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-CJ1-Ht7A.mjs";
|
|
4
|
+
import { i as AnthropicThinkingDisplay, n as AnthropicEffort, r as AnthropicOptions, t as AnthropicContextManagementOptions } from "../provider-options-Bcc_p-TU.mjs";
|
|
5
|
+
import "../types-3Lnm-QSJ.mjs";
|
|
6
|
+
import { d as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-d46X2pR0.mjs";
|
|
8
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
9
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
10
|
-
anthropicServerCompaction?: boolean;
|
|
11
9
|
authProfileId?: string;
|
|
12
10
|
};
|
|
13
|
-
declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicCompactionOptions>;
|
|
14
|
-
type AnthropicSimpleStreamOptions = SimpleStreamOptions & {
|
|
15
|
-
anthropicServerCompaction?: boolean;
|
|
11
|
+
export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicCompactionOptions>;
|
|
12
|
+
type AnthropicSimpleStreamOptions = SimpleStreamOptions & AnthropicContextManagementOptions & {
|
|
16
13
|
authProfileId?: string;
|
|
17
14
|
toolChoice?: AnthropicCompactionOptions["toolChoice"];
|
|
18
15
|
};
|
|
19
|
-
declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", AnthropicSimpleStreamOptions>;
|
|
16
|
+
export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", AnthropicSimpleStreamOptions>;
|
|
20
17
|
//#endregion
|
|
21
18
|
//#region packages/ai/src/providers/anthropic-auth-headers.d.ts
|
|
19
|
+
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
20
|
+
export declare function isAnthropicOAuthApiKey(apiKey: unknown): boolean;
|
|
22
21
|
type AnthropicAuthModel = {
|
|
23
22
|
provider?: string;
|
|
24
23
|
authHeader?: boolean;
|
|
25
24
|
headers?: Record<string, string>;
|
|
26
25
|
};
|
|
27
|
-
declare function usesFoundryBearerAuth(model: AnthropicAuthModel): boolean;
|
|
28
|
-
declare function omitFoundryBearerCredentialHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
|
|
26
|
+
export declare function usesFoundryBearerAuth(model: AnthropicAuthModel): boolean;
|
|
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
|
-
declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
32
|
-
declare const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = "x-anthropic-billing-header: cc_version=2.1.75; cc_entrypoint=sdk-cli;";
|
|
30
|
+
export declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
31
|
+
export declare const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = "x-anthropic-billing-header: cc_version=2.1.75; cc_entrypoint=sdk-cli;";
|
|
33
32
|
type ReplayModelRef = {
|
|
34
33
|
provider?: string;
|
|
35
34
|
api?: string;
|
|
@@ -37,46 +36,46 @@ type ReplayModelRef = {
|
|
|
37
36
|
responseModelId?: string;
|
|
38
37
|
modelParams?: Record<string, unknown>;
|
|
39
38
|
};
|
|
40
|
-
declare function usesClaudeFable5MessagesContract(model: {
|
|
39
|
+
export declare function usesClaudeFable5MessagesContract(model: {
|
|
41
40
|
id?: string;
|
|
42
41
|
params?: Record<string, unknown>;
|
|
43
42
|
api?: string;
|
|
44
43
|
}): boolean;
|
|
45
44
|
/** Return whether streamed output must wait for the terminal refusal decision. */
|
|
46
|
-
declare function usesClaudeStreamingRefusalContract(model: {
|
|
45
|
+
export declare function usesClaudeStreamingRefusalContract(model: {
|
|
47
46
|
id?: string;
|
|
48
47
|
params?: Record<string, unknown>;
|
|
49
48
|
api?: string;
|
|
50
49
|
}): boolean;
|
|
51
|
-
declare function requiresClaudeAdaptiveThinking(model: {
|
|
50
|
+
export declare function requiresClaudeAdaptiveThinking(model: {
|
|
52
51
|
id?: string;
|
|
53
52
|
params?: Record<string, unknown>;
|
|
54
53
|
api?: string;
|
|
55
54
|
}): boolean;
|
|
56
55
|
/** Return whether omitted thinking should default to adaptive/high. */
|
|
57
|
-
declare function defaultsClaudeAdaptiveThinking(model: {
|
|
56
|
+
export declare function defaultsClaudeAdaptiveThinking(model: {
|
|
58
57
|
id?: string;
|
|
59
58
|
params?: Record<string, unknown>;
|
|
60
59
|
api?: string;
|
|
61
60
|
}): boolean;
|
|
62
61
|
/** Resolve provider-native effort once for direct and managed Claude requests. */
|
|
63
|
-
declare function resolveAnthropicThinkingEffort(model: Model<"anthropic-messages">, level: SimpleStreamOptions["reasoning"]): AnthropicEffort;
|
|
62
|
+
export declare function resolveAnthropicThinkingEffort(model: Model<"anthropic-messages">, level: SimpleStreamOptions["reasoning"]): AnthropicEffort;
|
|
64
63
|
/** Normalize Anthropic and Anthropic-compatible terminal reasons identically. */
|
|
65
|
-
declare function mapAnthropicStopReason(reason: string | undefined): StopReason;
|
|
64
|
+
export declare function mapAnthropicStopReason(reason: string | undefined): StopReason;
|
|
66
65
|
/** Remove unsupported assistant prefills while preserving completed tool-use turns. */
|
|
67
|
-
declare function prepareClaudeNoPrefillRequestContext(model: Model, context: Context): Context;
|
|
66
|
+
export declare function prepareClaudeNoPrefillRequestContext(model: Model, context: Context): Context;
|
|
68
67
|
type ClaudeSamplingRequestParams = {
|
|
69
68
|
temperature?: unknown;
|
|
70
69
|
top_p?: unknown;
|
|
71
70
|
top_k?: unknown;
|
|
72
71
|
service_tier?: unknown;
|
|
73
72
|
};
|
|
74
|
-
declare function applyClaudeRequestContract(params: ClaudeSamplingRequestParams, model: {
|
|
73
|
+
export declare function applyClaudeRequestContract(params: ClaudeSamplingRequestParams, model: {
|
|
75
74
|
id?: string;
|
|
76
75
|
params?: Record<string, unknown>;
|
|
77
76
|
api?: string;
|
|
78
77
|
}): void;
|
|
79
|
-
declare function resolveModelBoundThinkingReplayMode(params: {
|
|
78
|
+
export declare function resolveModelBoundThinkingReplayMode(params: {
|
|
80
79
|
source: ReplayModelRef;
|
|
81
80
|
target: ReplayModelRef;
|
|
82
81
|
}): "default" | "preserve" | "drop";
|
|
@@ -87,36 +86,36 @@ type AnthropicRefusalOutput = {
|
|
|
87
86
|
errorMessage?: string;
|
|
88
87
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
89
88
|
};
|
|
90
|
-
declare function applyAnthropicRefusal(output: AnthropicRefusalOutput, stopDetails: unknown, provider: string): void;
|
|
89
|
+
export declare function applyAnthropicRefusal(output: AnthropicRefusalOutput, stopDetails: unknown, provider: string): void;
|
|
91
90
|
//#endregion
|
|
92
91
|
//#region packages/ai/src/providers/anthropic-server-fallback.d.ts
|
|
93
92
|
/** Anthropic beta that re-serves safety refusals on an allowed fallback model. */
|
|
94
|
-
declare const ANTHROPIC_SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
93
|
+
export declare const ANTHROPIC_SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
95
94
|
/** Let Anthropic select the recommended model for each refusal category. */
|
|
96
|
-
declare const ANTHROPIC_SERVER_SIDE_FALLBACKS: "default";
|
|
97
|
-
declare const CLAUDE_OPUS_FALLBACK_MODEL_COST: {
|
|
95
|
+
export declare const ANTHROPIC_SERVER_SIDE_FALLBACKS: "default";
|
|
96
|
+
export declare const CLAUDE_OPUS_FALLBACK_MODEL_COST: {
|
|
98
97
|
readonly input: 5;
|
|
99
98
|
readonly output: 25;
|
|
100
99
|
readonly cacheRead: 0.5;
|
|
101
100
|
readonly cacheWrite: 6.25;
|
|
102
101
|
};
|
|
103
|
-
type AnthropicFallbackBoundary = {
|
|
102
|
+
export type AnthropicFallbackBoundary = {
|
|
104
103
|
fromModel: string | null;
|
|
105
104
|
toModel: string | null;
|
|
106
105
|
};
|
|
107
106
|
/** Resolve billed rates from the serving model reported by Anthropic's fallback stream. */
|
|
108
|
-
declare function resolveAnthropicFallbackServingModelCost(params: {
|
|
107
|
+
export declare function resolveAnthropicFallbackServingModelCost(params: {
|
|
109
108
|
requestedModelId: string;
|
|
110
109
|
servingModelId: string | null;
|
|
111
110
|
requestedCost: Model["cost"];
|
|
112
111
|
}): Model["cost"];
|
|
113
112
|
/** Reads a `fallback` content block marking where one model's output gives way to the next. */
|
|
114
|
-
declare function readAnthropicFallbackBoundary(block: unknown): AnthropicFallbackBoundary | null;
|
|
113
|
+
export declare function readAnthropicFallbackBoundary(block: unknown): AnthropicFallbackBoundary | null;
|
|
115
114
|
/**
|
|
116
115
|
* Drops pre-fallback thinking/tool calls while preserving the text prefix that
|
|
117
116
|
* the serving model continued. Dropped tool calls must never execute or replay.
|
|
118
117
|
*/
|
|
119
|
-
declare function applyAnthropicFallbackBoundary(params: {
|
|
118
|
+
export declare function applyAnthropicFallbackBoundary(params: {
|
|
120
119
|
output: {
|
|
121
120
|
content: Array<{
|
|
122
121
|
type: string;
|
|
@@ -129,12 +128,17 @@ declare function applyAnthropicFallbackBoundary(params: {
|
|
|
129
128
|
}): void;
|
|
130
129
|
//#endregion
|
|
131
130
|
//#region packages/ai/src/providers/anthropic-thinking-replay.d.ts
|
|
132
|
-
declare const ANTHROPIC_OMITTED_REASONING_TEXT = "[assistant reasoning omitted]";
|
|
131
|
+
export declare const ANTHROPIC_OMITTED_REASONING_TEXT = "[assistant reasoning omitted]";
|
|
132
|
+
export declare function applyAnthropicThinkingBindingControls(params: {
|
|
133
|
+
thinking?: unknown;
|
|
134
|
+
}, directApiKeyBetaHeader: string | undefined): Record<string, string> | undefined;
|
|
135
|
+
export declare function readAnthropicInputTransformations(event: unknown): unknown[] | undefined;
|
|
136
|
+
export declare function logAnthropicThinkingDrops(transformations: unknown[] | undefined): void;
|
|
133
137
|
/**
|
|
134
138
|
* Anthropic tool results continue the preceding assistant turn. Preserve that
|
|
135
139
|
* turn's signed thinking even when the next request disables new thinking.
|
|
136
140
|
*/
|
|
137
|
-
declare function findActiveAnthropicToolTurnAssistantIndex(messages: readonly unknown[]): number;
|
|
141
|
+
export declare function findActiveAnthropicToolTurnAssistantIndex(messages: readonly unknown[]): number;
|
|
138
142
|
//#endregion
|
|
139
143
|
//#region packages/ai/src/providers/anthropic-tool-projection.d.ts
|
|
140
144
|
type AnthropicToolDescriptor = {
|
|
@@ -152,7 +156,7 @@ type AnthropicProjectedTool = {
|
|
|
152
156
|
readonly required: string[];
|
|
153
157
|
};
|
|
154
158
|
};
|
|
155
|
-
type AnthropicToolProjection = {
|
|
159
|
+
export type AnthropicToolProjection = {
|
|
156
160
|
readonly inputToolCount: number;
|
|
157
161
|
readonly unavailableOriginalNames: ReadonlySet<string>;
|
|
158
162
|
readonly tools: readonly AnthropicProjectedTool[];
|
|
@@ -160,7 +164,7 @@ type AnthropicToolProjection = {
|
|
|
160
164
|
type AnthropicParallelToolChoice = {
|
|
161
165
|
readonly disable_parallel_tool_use?: boolean;
|
|
162
166
|
};
|
|
163
|
-
type AnthropicProjectedToolChoice = ({
|
|
167
|
+
export type AnthropicProjectedToolChoice = ({
|
|
164
168
|
readonly type: "auto";
|
|
165
169
|
} & AnthropicParallelToolChoice) | ({
|
|
166
170
|
readonly type: "any";
|
|
@@ -171,17 +175,17 @@ type AnthropicProjectedToolChoice = ({
|
|
|
171
175
|
readonly name: string;
|
|
172
176
|
} & AnthropicParallelToolChoice);
|
|
173
177
|
/** Preserve Claude Code's canonical tool casing for subscription OAuth requests. */
|
|
174
|
-
declare function toClaudeCodeToolName(name: string): string;
|
|
178
|
+
export declare function toClaudeCodeToolName(name: string): string;
|
|
175
179
|
/** Anthropic rejects forced tools while extended thinking is enabled. */
|
|
176
|
-
declare function normalizeAnthropicToolChoice(thinkingEnabled: boolean, toolChoice: NonNullable<AnthropicOptions["toolChoice"]>): AnthropicProjectedToolChoice;
|
|
180
|
+
export declare function normalizeAnthropicToolChoice(thinkingEnabled: boolean, toolChoice: NonNullable<AnthropicOptions["toolChoice"]>): AnthropicProjectedToolChoice;
|
|
177
181
|
/** Anthropic tool identifiers accept only ASCII word characters and dashes. */
|
|
178
|
-
declare function normalizeAnthropicToolCallId(id: string): string;
|
|
182
|
+
export declare function normalizeAnthropicToolCallId(id: string): string;
|
|
179
183
|
/** Snapshots direct/custom tool descriptors before Anthropic payload construction. */
|
|
180
|
-
declare function projectAnthropicTools(tools: readonly AnthropicToolDescriptor[], toWireName: (name: string) => string): AnthropicToolProjection;
|
|
184
|
+
export declare function projectAnthropicTools(tools: readonly AnthropicToolDescriptor[], toWireName: (name: string) => string): AnthropicToolProjection;
|
|
181
185
|
/** Keeps forced Anthropic tool choices aligned with the projected wire names. */
|
|
182
|
-
declare function reconcileAnthropicToolChoice(choice: AnthropicProjectedToolChoice, projection: AnthropicToolProjection): AnthropicProjectedToolChoice | undefined;
|
|
186
|
+
export declare function reconcileAnthropicToolChoice(choice: AnthropicProjectedToolChoice, projection: AnthropicToolProjection): AnthropicProjectedToolChoice | undefined;
|
|
183
187
|
/** Maps Claude Code wire names without trusting every direct/custom descriptor. */
|
|
184
|
-
declare function resolveOriginalAnthropicToolName(name: string, projection: AnthropicToolProjection | undefined): string;
|
|
188
|
+
export declare function resolveOriginalAnthropicToolName(name: string, projection: AnthropicToolProjection | undefined): string;
|
|
185
189
|
//#endregion
|
|
186
190
|
//#region packages/ai/src/providers/anthropic-usage.d.ts
|
|
187
191
|
type AnthropicUsagePayload = {
|
|
@@ -192,20 +196,20 @@ type AnthropicUsagePayload = {
|
|
|
192
196
|
cache_creation?: unknown;
|
|
193
197
|
iterations?: unknown;
|
|
194
198
|
};
|
|
195
|
-
type AnthropicCacheWriteUsage = {
|
|
199
|
+
export type AnthropicCacheWriteUsage = {
|
|
196
200
|
cacheWrite5m?: number;
|
|
197
201
|
cacheWrite1h?: number;
|
|
198
202
|
};
|
|
199
|
-
type AnthropicPromptUsageSnapshot = {
|
|
203
|
+
export type AnthropicPromptUsageSnapshot = {
|
|
200
204
|
input: number;
|
|
201
205
|
cacheRead: number;
|
|
202
206
|
cacheWrite: number;
|
|
203
207
|
};
|
|
204
|
-
type AnthropicIterationUsageSnapshot = {
|
|
208
|
+
export type AnthropicIterationUsageSnapshot = {
|
|
205
209
|
contextPromptTokens: number;
|
|
206
210
|
totalTokens: number;
|
|
207
211
|
};
|
|
208
|
-
type AnthropicIterationUsageResult = {
|
|
212
|
+
export type AnthropicIterationUsageResult = {
|
|
209
213
|
state: "absent";
|
|
210
214
|
} | {
|
|
211
215
|
state: "invalid";
|
|
@@ -213,13 +217,13 @@ type AnthropicIterationUsageResult = {
|
|
|
213
217
|
state: "valid";
|
|
214
218
|
usage: AnthropicIterationUsageSnapshot;
|
|
215
219
|
};
|
|
216
|
-
declare function readAnthropicUsageTokenCount(value: unknown): number | undefined;
|
|
217
|
-
declare function readAnthropicCacheWriteUsage(usage: AnthropicUsagePayload): AnthropicCacheWriteUsage;
|
|
218
|
-
declare function readAnthropicPromptUsageSnapshot(usage: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
219
|
-
declare function readLastAnthropicIterationUsage(usage: AnthropicUsagePayload): AnthropicIterationUsageResult;
|
|
220
|
+
export declare function readAnthropicUsageTokenCount(value: unknown): number | undefined;
|
|
221
|
+
export declare function readAnthropicCacheWriteUsage(usage: AnthropicUsagePayload): AnthropicCacheWriteUsage;
|
|
222
|
+
export declare function readAnthropicPromptUsageSnapshot(usage: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
223
|
+
export declare function readLastAnthropicIterationUsage(usage: AnthropicUsagePayload): AnthropicIterationUsageResult;
|
|
220
224
|
/** Record independent billing buckets without treating zero placeholders as context proof. */
|
|
221
|
-
declare function applyAnthropicMessageStartUsage(target: Usage, payload: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
222
|
-
/** Keep
|
|
223
|
-
declare function applyAnthropicMessageDeltaUsage(target: Usage,
|
|
225
|
+
export declare function applyAnthropicMessageStartUsage(target: Usage, payload: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
226
|
+
/** Keep billing and context distinct; omitted usage preserves the last snapshot. */
|
|
227
|
+
export declare function applyAnthropicMessageDeltaUsage(target: Usage, usage: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
224
228
|
//#endregion
|
|
225
|
-
export {
|
|
229
|
+
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-
|
|
3
|
-
import { C as
|
|
4
|
-
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-
|
|
5
|
-
export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyClaudeRequestContract, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, h as resolveClaudeSonnet5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, p as resolveClaudeNativeThinkingLevelMap, s as bindsClaudeThinkingPrefix, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "../src-2qBGKg8O.mjs";
|
|
2
|
+
import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, b as resolveModelBoundThinkingReplayMode, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, h as defaultsClaudeAdaptiveThinking, m as applyClaudeRequestContract, p as ANTHROPIC_CLAUDE_CODE_VERSION, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "../host-CEvLw30U.mjs";
|
|
3
|
+
import { C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, G as omitFoundryBearerCredentialHeaders, K as usesFoundryBearerAuth, O as resolveAnthropicFallbackServingModelCost, S as readAnthropicInputTransformations, T as CLAUDE_OPUS_FALLBACK_MODEL_COST, U as resolveAnthropicServerCompactionPlan, W as isAnthropicOAuthApiKey, _ as toClaudeCodeToolName, b as findActiveAnthropicToolTurnAssistantIndex, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as applyAnthropicRefusal, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls } from "../anthropic-compaction-replay-DB2FGLQc.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-BDdqdVLK.mjs";
|
|
5
|
+
export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-
|
|
2
|
-
import { i as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-payload-policy-
|
|
3
|
-
export { OPENAI_RESPONSES_APIS, resolveOpenAIResponsesServerCompactionPlan };
|
|
1
|
+
import { c as OpenAIResponsesCompactionOutput, l as readOpenAIResponsesCompactionWindow, t as OPENAI_RESPONSES_APIS } from "../openai-responses-contracts-rF5DDRNS.mjs";
|
|
2
|
+
import { i as resolveOpenAIResponsesServerCompactionPlan } from "../openai-responses-payload-policy-rLRPsSmB.mjs";
|
|
3
|
+
export { OPENAI_RESPONSES_APIS, type OpenAIResponsesCompactionOutput, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export { OPENAI_RESPONSES_APIS, resolveOpenAIResponsesServerCompactionPlan };
|
|
1
|
+
import { c as resolveOpenAIResponsesServerCompactionPlan, f as OPENAI_RESPONSES_APIS, r as readOpenAIResponsesCompactionWindow } from "../openai-responses-compaction-window-BMVHFOtq.mjs";
|
|
2
|
+
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|