@openclaw/ai 2026.8.1-beta.3 → 2026.8.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-B8KwTtlb.mjs → anthropic-DTGZ4VMY.mjs} +25 -23
- package/dist/{anthropic-compaction-replay-4Zx7-aCr.mjs → anthropic-compaction-replay-CKCDrZJv.mjs} +34 -35
- package/dist/{anthropic-payload-policy-CSx7MoKH.d.mts → anthropic-payload-policy-BTzmNC14.d.mts} +3 -2
- package/dist/{api-registry-DFxSnFqG.d.mts → api-registry-BbUHEKER.d.mts} +2 -1
- package/dist/{azure-openai-responses-Aa4mVcYG.mjs → azure-openai-responses-BmqaDXM1.mjs} +6 -5
- package/dist/{number-coercion-H9qHik3g.mjs → base64-CEFBpSkN.mjs} +73 -1
- package/dist/diagnostics.d.mts +2 -3
- package/dist/diagnostics.mjs +1 -1
- package/dist/{env-api-keys-DrgeBuva.mjs → env-api-keys-bktO00EJ.mjs} +2 -15
- package/dist/{event-stream-D91-ohD_.d.mts → event-stream-DcvAPSBe.d.mts} +1 -2
- package/dist/event-stream-pXT3FI6X.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -1
- package/dist/{google-yDRnipeq.mjs → google-CqjVZMwo.mjs} +8 -6
- package/dist/{google-shared-M1dl64nz.mjs → google-shared-Bnqni5j3.mjs} +34 -25
- package/dist/{google-vertex-DCJHM_a5.mjs → google-vertex-D_WREEJi.mjs} +8 -6
- package/dist/{host-DF_yxOsA.mjs → host-BIaiBURL.mjs} +4 -8
- package/dist/{host-DJq_FGcz.d.mts → host-DKFUAmCn.d.mts} +3 -3
- package/dist/index-CefaUGSS.d.mts +111 -0
- package/dist/index.d.mts +9 -10
- package/dist/index.mjs +4 -5
- package/dist/internal/anthropic.d.mts +51 -49
- 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 +65 -63
- package/dist/internal/openai.mjs +10 -9
- package/dist/internal/retry-after.d.mts +2 -3
- package/dist/internal/runtime.d.mts +51 -40
- package/dist/internal/runtime.mjs +9 -9
- package/dist/internal/shared.d.mts +25 -25
- package/dist/internal/shared.mjs +3 -3
- package/dist/{json-parse-CDnesDM_.mjs → json-parse-BuAJEbdW.mjs} +18 -2
- package/dist/{mistral-D6hRXI7A.mjs → mistral-C24jVd6f.mjs} +34 -32
- package/dist/{openai-chatgpt-responses-C339VIfT.mjs → openai-chatgpt-responses-Czum0oXz.mjs} +38 -20
- package/dist/openai-completions-BfFwac6f.mjs +404 -0
- package/dist/{openai-completions-compat-B0KTleXp.d.mts → openai-completions-compat-SZhi0Lf4.d.mts} +3 -3
- package/dist/openai-completions-stream-DGOvau4J.mjs +1625 -0
- package/dist/{openai-responses-BXEcr-Tp.mjs → openai-responses-BAryVEJM.mjs} +11 -7
- package/dist/openai-responses-compaction-window-DO7yV7az.mjs +686 -0
- package/dist/{openai-responses-contracts-CD75pQ0m.d.mts → openai-responses-contracts-BthRXano.d.mts} +14 -5
- 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-BG-1AsBI.mjs → openai-responses-prompt-observer-internal--R0kZLOZ.mjs} +3 -2
- package/dist/{openai-responses-shared-Cvt5MgEm.mjs → openai-responses-shared-CxgdGBvm.mjs} +332 -1484
- package/dist/openai-stop-reason-Drnn_6Qj.mjs +28 -0
- package/dist/openai-tool-schema-CSMh5e9O.mjs +1697 -0
- package/dist/{provider-error-C8mBRJDl.mjs → provider-error-BI8kIViN.mjs} +14 -88
- package/dist/{provider-options-Cc5ZQ6Aa.d.mts → provider-options-DJd_9euj.d.mts} +13 -4
- package/dist/{provider-transcript-transform--gtf0ZbR.mjs → provider-transcript-transform-WvJmFUAf.mjs} +1 -1
- package/dist/provider-types.d.mts +18 -17
- package/dist/providers.d.mts +5 -6
- package/dist/providers.mjs +9 -9
- package/dist/{reasoning-tag-text-partitioner-5ygO2rZc.mjs → reasoning-tag-text-partitioner-BsUX44Tq.mjs} +30 -20
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{sanitize-unicode-BP7HLLZn.mjs → sanitize-unicode-S6binQG-.mjs} +2 -9
- package/dist/simple-options-rdOPzr7Z.mjs +155 -0
- package/dist/{anthropic-BQXQudmA.mjs → src-C8U7lkoa.mjs} +75 -1
- package/dist/{stream-first-event-timeout-MK28puvq.mjs → stream-first-event-timeout-DcNjoFQE.mjs} +1 -1
- package/dist/{streaming-byte-guard-BrbkbwUu.mjs → streaming-byte-guard-CC-HMn_u.mjs} +5 -6
- package/dist/string-normalization--fwJ4S2q.mjs +16 -0
- package/dist/{tool-schema-json-projection-FEr-jOoZ.mjs → tool-schema-json-projection-BtZiml7r.mjs} +22 -32
- package/dist/transport-stream-shared-BbG7PThh.d.mts +138 -0
- package/dist/{simple-options-oqsXB6U3.mjs → transport-stream-shared-D8nQWCUo.mjs} +10 -118
- package/dist/{transport-utils-Bv0FHkd0.mjs → transport-utils-CtuS1Upe.mjs} +10 -10
- package/dist/transports.d.mts +130 -189
- package/dist/transports.mjs +227 -1249
- package/dist/{types-DTAP49HF.d.mts → types-Beemor2E.d.mts} +58 -24
- package/dist/types-COdhCX0U.d.mts +1 -0
- package/dist/types.d.mts +6 -5
- package/dist/types.mjs +3 -4
- package/dist/utf16-slice-qz3nsy87.mjs +84 -0
- package/dist/{validation-DYNNrU9u.d.mts → validation-CC6s7Smp.d.mts} +1 -2
- 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 +6 -6
- package/dist/anthropic-BECQCNdF.d.mts +0 -98
- package/dist/event-stream-BVVgDSdq.d.mts +0 -1
- package/dist/headers-B_e4-1J0.mjs +0 -9
- package/dist/index-BVVgDSdq.d.mts +0 -1
- package/dist/openai-completions-D88orSJ9.mjs +0 -632
- package/dist/openai-responses-contracts-DvILoqBk.mjs +0 -247
- package/dist/openai-responses-payload-policy-BDo8CQsx.mjs +0 -208
- package/dist/openai-stop-reason-9OONKyAm.mjs +0 -579
- package/dist/openai-tool-projection-CHGLt03m.mjs +0 -426
- package/dist/provider-options-AvldWZt8.mjs +0 -21
- package/dist/record-coerce-DdXsgUd_.mjs +0 -23
- package/dist/src-D2H6yKkH.mjs +0 -2
- package/dist/stream-first-event-timeout-DvDeSucC.d.mts +0 -29
- package/dist/string-coerce-fsri9iCu.mjs +0 -34
- package/dist/types-BVVgDSdq.d.mts +0 -1
- package/dist/utf16-slice-CvGodqok.mjs +0 -29
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-
|
|
4
|
-
import { n as buildBaseOptions } from "./simple-options-
|
|
5
|
-
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-
|
|
2
|
+
import { d as normalizeOptionalString } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
+
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-BIaiBURL.mjs";
|
|
4
|
+
import { n as buildBaseOptions } from "./simple-options-rdOPzr7Z.mjs";
|
|
5
|
+
import { i as runGoogleGenerateContentLifecycle, n as buildGoogleSimpleThinking, r as createGoogleAssistantOutput, t as buildGoogleGenerateContentParams } from "./google-shared-Bnqni5j3.mjs";
|
|
6
6
|
import { GoogleGenAI, ResourceScope } from "@google/genai";
|
|
7
7
|
//#region packages/ai/src/providers/google-vertex.ts
|
|
8
8
|
const API_VERSION = "v1";
|
|
@@ -10,10 +10,11 @@ const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
|
|
|
10
10
|
let toolCallCounter = 0;
|
|
11
11
|
const streamGoogleVertex = (model, context, options) => {
|
|
12
12
|
const stream = new AssistantMessageEventStream();
|
|
13
|
+
const output = createGoogleAssistantOutput(model, "google-vertex");
|
|
13
14
|
runGoogleGenerateContentLifecycle({
|
|
14
15
|
stream,
|
|
15
16
|
model,
|
|
16
|
-
output
|
|
17
|
+
output,
|
|
17
18
|
options,
|
|
18
19
|
createClient: () => {
|
|
19
20
|
const apiKey = resolveApiKey(options);
|
|
@@ -44,9 +45,10 @@ function createClient(model, project, location, optionsHeaders) {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
function createClientWithApiKey(model, apiKey, optionsHeaders) {
|
|
48
|
+
const resolvedApiKey = getAiTransportHost().resolveSecretSentinel(apiKey);
|
|
47
49
|
return new GoogleGenAI({
|
|
48
50
|
vertexai: true,
|
|
49
|
-
apiKey:
|
|
51
|
+
apiKey: resolvedApiKey,
|
|
50
52
|
apiVersion: API_VERSION,
|
|
51
53
|
httpOptions: buildHttpOptions(model, optionsHeaders)
|
|
52
54
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-BP7HLLZn.mjs";
|
|
5
|
-
import { a as isRecord } from "./record-coerce-DdXsgUd_.mjs";
|
|
6
|
-
import { t as truncateUtf16Safe } from "./utf16-slice-CvGodqok.mjs";
|
|
1
|
+
import { c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, s as requiresClaudeDefaultSampling, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "./src-C8U7lkoa.mjs";
|
|
2
|
+
import { c as normalizeLowercaseStringOrEmpty, o as isRecord, t as truncateUtf16Safe } from "./utf16-slice-qz3nsy87.mjs";
|
|
3
|
+
import { i as clampThinkingLevel, t as sanitizeSurrogates } from "./sanitize-unicode-S6binQG-.mjs";
|
|
7
4
|
//#region packages/ai/src/providers/anthropic-model-contract.ts
|
|
8
5
|
const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
9
6
|
const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = `x-anthropic-billing-header: cc_version=${ANTHROPIC_CLAUDE_CODE_VERSION}; cc_entrypoint=sdk-cli;`;
|
|
@@ -257,8 +254,7 @@ function describeUnsupportedToolResultMedia(blocks, support) {
|
|
|
257
254
|
return omittedImage ? "[unsupported tool-result image omitted]" : void 0;
|
|
258
255
|
}
|
|
259
256
|
function formatToolResultText(params) {
|
|
260
|
-
const
|
|
261
|
-
const body = trimmed ? `${trimmed}${params.omittedMediaPlaceholder ? `\n${params.omittedMediaPlaceholder}` : ""}` : params.omittedMediaPlaceholder ?? params.mediaPlaceholder ?? "(no tool output)";
|
|
257
|
+
const body = params.text.trim() ? `${params.text}${params.omittedMediaPlaceholder ? `\n${params.omittedMediaPlaceholder}` : ""}` : params.omittedMediaPlaceholder ?? params.mediaPlaceholder ?? "(no tool output)";
|
|
262
258
|
return `${params.isError ? "[tool error] " : ""}${body}`;
|
|
263
259
|
}
|
|
264
260
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
1
|
+
import "./index-CefaUGSS.mjs";
|
|
2
|
+
import { D as Model, K as StreamFn, d as Context, n as Api } from "./types-Beemor2E.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-BbUHEKER.mjs";
|
|
4
4
|
//#region packages/ai/src/host.d.ts
|
|
5
5
|
/** Provider capability facts needed by the package-owned transports. */
|
|
6
6
|
interface AiProviderRequestCapabilities {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
2
|
+
import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-Beemor2E.mjs";
|
|
3
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcvAPSBe.mjs";
|
|
4
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CC6s7Smp.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
|
+
/** Return whether a Claude model requires adaptive thinking instead of manual budgets. */
|
|
79
|
+
declare function requiresClaudeMandatoryAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
80
|
+
/** Resolve Claude Sonnet 5 through direct ids, cloud ids, or deployment metadata. */
|
|
81
|
+
declare function resolveClaudeSonnet5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
82
|
+
/** Resolve Claude Opus 5 through aliases, direct ids, cloud ids, or deployment metadata. */
|
|
83
|
+
declare function resolveClaudeOpus5ModelIdentity(ref: ClaudeModelRef): string | undefined;
|
|
84
|
+
/** Return whether a Claude model supports adaptive thinking. */
|
|
85
|
+
declare function supportsClaudeAdaptiveThinking(ref: ClaudeModelRef): boolean;
|
|
86
|
+
/** Return whether a Claude model has a native 1M-token context window. */
|
|
87
|
+
declare function supportsClaude1MContext(ref: ClaudeModelRef): boolean;
|
|
88
|
+
/** Return whether a Claude model supports Anthropic's native fast mode. */
|
|
89
|
+
declare function supportsClaudeFastMode(ref: ClaudeModelRef): boolean;
|
|
90
|
+
/** Return whether a Claude model supports native max effort. */
|
|
91
|
+
declare function supportsClaudeNativeMaxEffort(ref: ClaudeModelRef): boolean;
|
|
92
|
+
/** Return whether a Claude model supports native xhigh effort. */
|
|
93
|
+
declare function supportsClaudeNativeXhighEffort(ref: ClaudeModelRef): boolean;
|
|
94
|
+
/** Return whether a Claude model rejects caller-selected sampling parameters. */
|
|
95
|
+
declare function requiresClaudeDefaultSampling(ref: ClaudeModelRef): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Fill native Claude effort mappings only when the provider did not publish a
|
|
98
|
+
* narrower route-specific contract.
|
|
99
|
+
*/
|
|
100
|
+
declare function resolveClaudeNativeThinkingLevelMap(ref: ClaudeEffortModelRef): Record<string, string | null | undefined> | undefined;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region packages/llm-core/src/usage-cost.d.ts
|
|
103
|
+
declare function normalizeModelCostConfig(cost: RawModelCostConfig): ModelCostConfig;
|
|
104
|
+
declare function normalizeResolvedPricing(cost: Partial<RawModelCostConfig>): ModelCostConfig;
|
|
105
|
+
/** Price one model call, selecting its tier before billing the separate token buckets. */
|
|
106
|
+
declare function calculateUsageCost(usage: Partial<Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "cacheWrite1h">>, pricing: RawModelCostConfig): Usage["cost"];
|
|
107
|
+
declare namespace index_d_exports {
|
|
108
|
+
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, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { supportsClaudeAdaptiveThinking as _, CLAUDE_FABLE_5_THINKING_PROFILE as a, supportsClaudeNativeXhighEffort as b, requiresClaudeDefaultSampling as c, resolveClaudeModelIdentity as d, resolveClaudeMythos5ModelIdentity as f, supportsClaude1MContext as g, resolveClaudeSonnet5ModelIdentity as h, normalizeResolvedPricing as i, requiresClaudeMandatoryAdaptiveThinking as l, resolveClaudeOpus5ModelIdentity as m, calculateUsageCost as n, CLAUDE_OPUS_5_THINKING_PROFILE as o, resolveClaudeNativeThinkingLevelMap as p, normalizeModelCostConfig as r, CLAUDE_SONNET_5_THINKING_PROFILE as s, index_d_exports as t, resolveClaudeFable5ModelIdentity as u, supportsClaudeFastMode as v, supportsClaudeNativeMaxEffort as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./index-CefaUGSS.mjs";
|
|
2
2
|
import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import { $ as
|
|
4
|
-
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-
|
|
7
|
-
import { a as AiProviderRequestPolicyInput, c as AiTransportHost, d as configureAiTransportHost, f as getAiTransportHost, i as AiProviderRequestCapabilities, l as AiTransportPluginHost, n as AiInlineImageBlock, o as AiProviderStreamHookContext, p as resolveAiTransportHeaderSentinels, r as AiInlineTextBlock, s as AiTransformTransportMessages, t as AiInlineContentBlock, u as OpenAIStrictToolSettingOptions } from "./host-
|
|
8
|
-
|
|
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-Beemor2E.mjs";
|
|
4
|
+
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DcvAPSBe.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CC6s7Smp.mjs";
|
|
6
|
+
import { a as RegisteredApiProvider, i as ApiStreamSimpleFunction, n as ApiRegistry, o as createApiRegistry, r as ApiStreamFunction, t as ApiProvider } from "./api-registry-BbUHEKER.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-DKFUAmCn.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, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, getAiTransportHost, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { _ as supportsClaudeFastMode, a as CLAUDE_OPUS_5_THINKING_PROFILE, c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, g as supportsClaudeAdaptiveThinking, h as supportsClaude1MContext, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeOpus5ModelIdentity, r as normalizeResolvedPricing, s as requiresClaudeDefaultSampling, t as calculateUsageCost, u as resolveClaudeModelIdentity, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "./src-C8U7lkoa.mjs";
|
|
2
2
|
import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
|
|
3
3
|
import { i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-COpOtRwq.mjs";
|
|
4
4
|
import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-uSMZJ3FA.mjs";
|
|
5
|
-
import { n as validateToolCall, t as validateToolArguments } from "./validation-
|
|
6
|
-
import "./src-D2H6yKkH.mjs";
|
|
5
|
+
import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.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, 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-BIaiBURL.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, calculateUsageCost, configureAiTransportHost, createApiRegistry, createAssistantMessageDiagnostic, createAssistantMessageEventStream, createLlmRuntime, extractDiagnosticError, formatThrownValue, getAiTransportHost, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAiTransportHeaderSentinels, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import {
|
|
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, u as resolveClaudeFable5ModelIdentity, y as supportsClaudeNativeMaxEffort } from "../index-CefaUGSS.mjs";
|
|
2
2
|
import { t as AssistantMessageDiagnostic } from "../diagnostics-BaTA9eVl.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-
|
|
5
|
-
import
|
|
6
|
-
|
|
3
|
+
import { D as Model, G as StopReason, W as SimpleStreamOptions, at as Usage, d as Context, q as StreamFunction } from "../types-Beemor2E.mjs";
|
|
4
|
+
import { n as AnthropicOptions, r as AnthropicThinkingDisplay, t as AnthropicEffort } from "../provider-options-DJd_9euj.mjs";
|
|
5
|
+
import "../types-COdhCX0U.mjs";
|
|
6
|
+
import { o as resolveAnthropicServerCompactionPlan } from "../anthropic-payload-policy-BTzmNC14.mjs";
|
|
7
7
|
//#region packages/ai/src/providers/anthropic.d.ts
|
|
8
8
|
type AnthropicCompactionOptions = AnthropicOptions & {
|
|
9
9
|
anthropicServerCompaction?: boolean;
|
|
10
10
|
authProfileId?: string;
|
|
11
11
|
};
|
|
12
|
-
declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicCompactionOptions>;
|
|
12
|
+
export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicCompactionOptions>;
|
|
13
13
|
type AnthropicSimpleStreamOptions = SimpleStreamOptions & {
|
|
14
14
|
anthropicServerCompaction?: boolean;
|
|
15
15
|
authProfileId?: string;
|
|
16
16
|
toolChoice?: AnthropicCompactionOptions["toolChoice"];
|
|
17
17
|
};
|
|
18
|
-
declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", AnthropicSimpleStreamOptions>;
|
|
18
|
+
export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", AnthropicSimpleStreamOptions>;
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region packages/ai/src/providers/anthropic-auth-headers.d.ts
|
|
21
|
+
/** Inspect resolved credential shape for auth routing without exposing its value. */
|
|
22
|
+
export declare function isAnthropicOAuthApiKey(apiKey: unknown): boolean;
|
|
21
23
|
type AnthropicAuthModel = {
|
|
22
24
|
provider?: string;
|
|
23
25
|
authHeader?: boolean;
|
|
24
26
|
headers?: Record<string, string>;
|
|
25
27
|
};
|
|
26
|
-
declare function usesFoundryBearerAuth(model: AnthropicAuthModel): boolean;
|
|
27
|
-
declare function omitFoundryBearerCredentialHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
|
|
28
|
+
export declare function usesFoundryBearerAuth(model: AnthropicAuthModel): boolean;
|
|
29
|
+
export declare function omitFoundryBearerCredentialHeaders(headers?: Record<string, string>): Record<string, string> | undefined;
|
|
28
30
|
//#endregion
|
|
29
31
|
//#region packages/ai/src/providers/anthropic-model-contract.d.ts
|
|
30
|
-
declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
31
|
-
declare const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = "x-anthropic-billing-header: cc_version=2.1.75; cc_entrypoint=sdk-cli;";
|
|
32
|
+
export declare const ANTHROPIC_CLAUDE_CODE_VERSION = "2.1.75";
|
|
33
|
+
export declare const ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK = "x-anthropic-billing-header: cc_version=2.1.75; cc_entrypoint=sdk-cli;";
|
|
32
34
|
type ReplayModelRef = {
|
|
33
35
|
provider?: string;
|
|
34
36
|
api?: string;
|
|
@@ -36,46 +38,46 @@ type ReplayModelRef = {
|
|
|
36
38
|
responseModelId?: string;
|
|
37
39
|
modelParams?: Record<string, unknown>;
|
|
38
40
|
};
|
|
39
|
-
declare function usesClaudeFable5MessagesContract(model: {
|
|
41
|
+
export declare function usesClaudeFable5MessagesContract(model: {
|
|
40
42
|
id?: string;
|
|
41
43
|
params?: Record<string, unknown>;
|
|
42
44
|
api?: string;
|
|
43
45
|
}): boolean;
|
|
44
46
|
/** Return whether streamed output must wait for the terminal refusal decision. */
|
|
45
|
-
declare function usesClaudeStreamingRefusalContract(model: {
|
|
47
|
+
export declare function usesClaudeStreamingRefusalContract(model: {
|
|
46
48
|
id?: string;
|
|
47
49
|
params?: Record<string, unknown>;
|
|
48
50
|
api?: string;
|
|
49
51
|
}): boolean;
|
|
50
|
-
declare function requiresClaudeAdaptiveThinking(model: {
|
|
52
|
+
export declare function requiresClaudeAdaptiveThinking(model: {
|
|
51
53
|
id?: string;
|
|
52
54
|
params?: Record<string, unknown>;
|
|
53
55
|
api?: string;
|
|
54
56
|
}): boolean;
|
|
55
57
|
/** Return whether omitted thinking should default to adaptive/high. */
|
|
56
|
-
declare function defaultsClaudeAdaptiveThinking(model: {
|
|
58
|
+
export declare function defaultsClaudeAdaptiveThinking(model: {
|
|
57
59
|
id?: string;
|
|
58
60
|
params?: Record<string, unknown>;
|
|
59
61
|
api?: string;
|
|
60
62
|
}): boolean;
|
|
61
63
|
/** Resolve provider-native effort once for direct and managed Claude requests. */
|
|
62
|
-
declare function resolveAnthropicThinkingEffort(model: Model<"anthropic-messages">, level: SimpleStreamOptions["reasoning"]): AnthropicEffort;
|
|
64
|
+
export declare function resolveAnthropicThinkingEffort(model: Model<"anthropic-messages">, level: SimpleStreamOptions["reasoning"]): AnthropicEffort;
|
|
63
65
|
/** Normalize Anthropic and Anthropic-compatible terminal reasons identically. */
|
|
64
|
-
declare function mapAnthropicStopReason(reason: string | undefined): StopReason;
|
|
66
|
+
export declare function mapAnthropicStopReason(reason: string | undefined): StopReason;
|
|
65
67
|
/** Remove unsupported assistant prefills while preserving completed tool-use turns. */
|
|
66
|
-
declare function prepareClaudeNoPrefillRequestContext(model: Model, context: Context): Context;
|
|
68
|
+
export declare function prepareClaudeNoPrefillRequestContext(model: Model, context: Context): Context;
|
|
67
69
|
type ClaudeSamplingRequestParams = {
|
|
68
70
|
temperature?: unknown;
|
|
69
71
|
top_p?: unknown;
|
|
70
72
|
top_k?: unknown;
|
|
71
73
|
service_tier?: unknown;
|
|
72
74
|
};
|
|
73
|
-
declare function applyClaudeRequestContract(params: ClaudeSamplingRequestParams, model: {
|
|
75
|
+
export declare function applyClaudeRequestContract(params: ClaudeSamplingRequestParams, model: {
|
|
74
76
|
id?: string;
|
|
75
77
|
params?: Record<string, unknown>;
|
|
76
78
|
api?: string;
|
|
77
79
|
}): void;
|
|
78
|
-
declare function resolveModelBoundThinkingReplayMode(params: {
|
|
80
|
+
export declare function resolveModelBoundThinkingReplayMode(params: {
|
|
79
81
|
source: ReplayModelRef;
|
|
80
82
|
target: ReplayModelRef;
|
|
81
83
|
}): "default" | "preserve" | "drop";
|
|
@@ -86,36 +88,36 @@ type AnthropicRefusalOutput = {
|
|
|
86
88
|
errorMessage?: string;
|
|
87
89
|
diagnostics?: AssistantMessageDiagnostic[];
|
|
88
90
|
};
|
|
89
|
-
declare function applyAnthropicRefusal(output: AnthropicRefusalOutput, stopDetails: unknown, provider: string): void;
|
|
91
|
+
export declare function applyAnthropicRefusal(output: AnthropicRefusalOutput, stopDetails: unknown, provider: string): void;
|
|
90
92
|
//#endregion
|
|
91
93
|
//#region packages/ai/src/providers/anthropic-server-fallback.d.ts
|
|
92
94
|
/** Anthropic beta that re-serves safety refusals on an allowed fallback model. */
|
|
93
|
-
declare const ANTHROPIC_SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
95
|
+
export declare const ANTHROPIC_SERVER_SIDE_FALLBACK_BETA = "server-side-fallback-2026-07-01";
|
|
94
96
|
/** Let Anthropic select the recommended model for each refusal category. */
|
|
95
|
-
declare const ANTHROPIC_SERVER_SIDE_FALLBACKS: "default";
|
|
96
|
-
declare const CLAUDE_OPUS_FALLBACK_MODEL_COST: {
|
|
97
|
+
export declare const ANTHROPIC_SERVER_SIDE_FALLBACKS: "default";
|
|
98
|
+
export declare const CLAUDE_OPUS_FALLBACK_MODEL_COST: {
|
|
97
99
|
readonly input: 5;
|
|
98
100
|
readonly output: 25;
|
|
99
101
|
readonly cacheRead: 0.5;
|
|
100
102
|
readonly cacheWrite: 6.25;
|
|
101
103
|
};
|
|
102
|
-
type AnthropicFallbackBoundary = {
|
|
104
|
+
export type AnthropicFallbackBoundary = {
|
|
103
105
|
fromModel: string | null;
|
|
104
106
|
toModel: string | null;
|
|
105
107
|
};
|
|
106
108
|
/** Resolve billed rates from the serving model reported by Anthropic's fallback stream. */
|
|
107
|
-
declare function resolveAnthropicFallbackServingModelCost(params: {
|
|
109
|
+
export declare function resolveAnthropicFallbackServingModelCost(params: {
|
|
108
110
|
requestedModelId: string;
|
|
109
111
|
servingModelId: string | null;
|
|
110
112
|
requestedCost: Model["cost"];
|
|
111
113
|
}): Model["cost"];
|
|
112
114
|
/** Reads a `fallback` content block marking where one model's output gives way to the next. */
|
|
113
|
-
declare function readAnthropicFallbackBoundary(block: unknown): AnthropicFallbackBoundary | null;
|
|
115
|
+
export declare function readAnthropicFallbackBoundary(block: unknown): AnthropicFallbackBoundary | null;
|
|
114
116
|
/**
|
|
115
117
|
* Drops pre-fallback thinking/tool calls while preserving the text prefix that
|
|
116
118
|
* the serving model continued. Dropped tool calls must never execute or replay.
|
|
117
119
|
*/
|
|
118
|
-
declare function applyAnthropicFallbackBoundary(params: {
|
|
120
|
+
export declare function applyAnthropicFallbackBoundary(params: {
|
|
119
121
|
output: {
|
|
120
122
|
content: Array<{
|
|
121
123
|
type: string;
|
|
@@ -128,12 +130,12 @@ declare function applyAnthropicFallbackBoundary(params: {
|
|
|
128
130
|
}): void;
|
|
129
131
|
//#endregion
|
|
130
132
|
//#region packages/ai/src/providers/anthropic-thinking-replay.d.ts
|
|
131
|
-
declare const ANTHROPIC_OMITTED_REASONING_TEXT = "[assistant reasoning omitted]";
|
|
133
|
+
export declare const ANTHROPIC_OMITTED_REASONING_TEXT = "[assistant reasoning omitted]";
|
|
132
134
|
/**
|
|
133
135
|
* Anthropic tool results continue the preceding assistant turn. Preserve that
|
|
134
136
|
* turn's signed thinking even when the next request disables new thinking.
|
|
135
137
|
*/
|
|
136
|
-
declare function findActiveAnthropicToolTurnAssistantIndex(messages: readonly unknown[]): number;
|
|
138
|
+
export declare function findActiveAnthropicToolTurnAssistantIndex(messages: readonly unknown[]): number;
|
|
137
139
|
//#endregion
|
|
138
140
|
//#region packages/ai/src/providers/anthropic-tool-projection.d.ts
|
|
139
141
|
type AnthropicToolDescriptor = {
|
|
@@ -151,7 +153,7 @@ type AnthropicProjectedTool = {
|
|
|
151
153
|
readonly required: string[];
|
|
152
154
|
};
|
|
153
155
|
};
|
|
154
|
-
type AnthropicToolProjection = {
|
|
156
|
+
export type AnthropicToolProjection = {
|
|
155
157
|
readonly inputToolCount: number;
|
|
156
158
|
readonly unavailableOriginalNames: ReadonlySet<string>;
|
|
157
159
|
readonly tools: readonly AnthropicProjectedTool[];
|
|
@@ -159,7 +161,7 @@ type AnthropicToolProjection = {
|
|
|
159
161
|
type AnthropicParallelToolChoice = {
|
|
160
162
|
readonly disable_parallel_tool_use?: boolean;
|
|
161
163
|
};
|
|
162
|
-
type AnthropicProjectedToolChoice = ({
|
|
164
|
+
export type AnthropicProjectedToolChoice = ({
|
|
163
165
|
readonly type: "auto";
|
|
164
166
|
} & AnthropicParallelToolChoice) | ({
|
|
165
167
|
readonly type: "any";
|
|
@@ -170,17 +172,17 @@ type AnthropicProjectedToolChoice = ({
|
|
|
170
172
|
readonly name: string;
|
|
171
173
|
} & AnthropicParallelToolChoice);
|
|
172
174
|
/** Preserve Claude Code's canonical tool casing for subscription OAuth requests. */
|
|
173
|
-
declare function toClaudeCodeToolName(name: string): string;
|
|
175
|
+
export declare function toClaudeCodeToolName(name: string): string;
|
|
174
176
|
/** Anthropic rejects forced tools while extended thinking is enabled. */
|
|
175
|
-
declare function normalizeAnthropicToolChoice(thinkingEnabled: boolean, toolChoice: NonNullable<AnthropicOptions["toolChoice"]>): AnthropicProjectedToolChoice;
|
|
177
|
+
export declare function normalizeAnthropicToolChoice(thinkingEnabled: boolean, toolChoice: NonNullable<AnthropicOptions["toolChoice"]>): AnthropicProjectedToolChoice;
|
|
176
178
|
/** Anthropic tool identifiers accept only ASCII word characters and dashes. */
|
|
177
|
-
declare function normalizeAnthropicToolCallId(id: string): string;
|
|
179
|
+
export declare function normalizeAnthropicToolCallId(id: string): string;
|
|
178
180
|
/** Snapshots direct/custom tool descriptors before Anthropic payload construction. */
|
|
179
|
-
declare function projectAnthropicTools(tools: readonly AnthropicToolDescriptor[], toWireName: (name: string) => string): AnthropicToolProjection;
|
|
181
|
+
export declare function projectAnthropicTools(tools: readonly AnthropicToolDescriptor[], toWireName: (name: string) => string): AnthropicToolProjection;
|
|
180
182
|
/** Keeps forced Anthropic tool choices aligned with the projected wire names. */
|
|
181
|
-
declare function reconcileAnthropicToolChoice(choice: AnthropicProjectedToolChoice, projection: AnthropicToolProjection): AnthropicProjectedToolChoice | undefined;
|
|
183
|
+
export declare function reconcileAnthropicToolChoice(choice: AnthropicProjectedToolChoice, projection: AnthropicToolProjection): AnthropicProjectedToolChoice | undefined;
|
|
182
184
|
/** Maps Claude Code wire names without trusting every direct/custom descriptor. */
|
|
183
|
-
declare function resolveOriginalAnthropicToolName(name: string, projection: AnthropicToolProjection | undefined): string;
|
|
185
|
+
export declare function resolveOriginalAnthropicToolName(name: string, projection: AnthropicToolProjection | undefined): string;
|
|
184
186
|
//#endregion
|
|
185
187
|
//#region packages/ai/src/providers/anthropic-usage.d.ts
|
|
186
188
|
type AnthropicUsagePayload = {
|
|
@@ -191,20 +193,20 @@ type AnthropicUsagePayload = {
|
|
|
191
193
|
cache_creation?: unknown;
|
|
192
194
|
iterations?: unknown;
|
|
193
195
|
};
|
|
194
|
-
type AnthropicCacheWriteUsage = {
|
|
196
|
+
export type AnthropicCacheWriteUsage = {
|
|
195
197
|
cacheWrite5m?: number;
|
|
196
198
|
cacheWrite1h?: number;
|
|
197
199
|
};
|
|
198
|
-
type AnthropicPromptUsageSnapshot = {
|
|
200
|
+
export type AnthropicPromptUsageSnapshot = {
|
|
199
201
|
input: number;
|
|
200
202
|
cacheRead: number;
|
|
201
203
|
cacheWrite: number;
|
|
202
204
|
};
|
|
203
|
-
type AnthropicIterationUsageSnapshot = {
|
|
205
|
+
export type AnthropicIterationUsageSnapshot = {
|
|
204
206
|
contextPromptTokens: number;
|
|
205
207
|
totalTokens: number;
|
|
206
208
|
};
|
|
207
|
-
type AnthropicIterationUsageResult = {
|
|
209
|
+
export type AnthropicIterationUsageResult = {
|
|
208
210
|
state: "absent";
|
|
209
211
|
} | {
|
|
210
212
|
state: "invalid";
|
|
@@ -212,13 +214,13 @@ type AnthropicIterationUsageResult = {
|
|
|
212
214
|
state: "valid";
|
|
213
215
|
usage: AnthropicIterationUsageSnapshot;
|
|
214
216
|
};
|
|
215
|
-
declare function readAnthropicUsageTokenCount(value: unknown): number | undefined;
|
|
216
|
-
declare function readAnthropicCacheWriteUsage(usage: AnthropicUsagePayload): AnthropicCacheWriteUsage;
|
|
217
|
-
declare function readAnthropicPromptUsageSnapshot(usage: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
218
|
-
declare function readLastAnthropicIterationUsage(usage: AnthropicUsagePayload): AnthropicIterationUsageResult;
|
|
217
|
+
export declare function readAnthropicUsageTokenCount(value: unknown): number | undefined;
|
|
218
|
+
export declare function readAnthropicCacheWriteUsage(usage: AnthropicUsagePayload): AnthropicCacheWriteUsage;
|
|
219
|
+
export declare function readAnthropicPromptUsageSnapshot(usage: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
220
|
+
export declare function readLastAnthropicIterationUsage(usage: AnthropicUsagePayload): AnthropicIterationUsageResult;
|
|
219
221
|
/** Record independent billing buckets without treating zero placeholders as context proof. */
|
|
220
|
-
declare function applyAnthropicMessageStartUsage(target: Usage, payload: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
222
|
+
export declare function applyAnthropicMessageStartUsage(target: Usage, payload: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
|
|
221
223
|
/** Keep cumulative billing separate from the final server-side iteration context. */
|
|
222
|
-
declare function applyAnthropicMessageDeltaUsage(target: Usage, payload: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
224
|
+
export declare function applyAnthropicMessageDeltaUsage(target: Usage, payload: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
|
|
223
225
|
//#endregion
|
|
224
|
-
export {
|
|
226
|
+
export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, 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 { c as requiresClaudeMandatoryAdaptiveThinking, d as resolveClaudeMythos5ModelIdentity, f as resolveClaudeNativeThinkingLevelMap, g as supportsClaudeAdaptiveThinking, l as resolveClaudeFable5ModelIdentity, m as resolveClaudeSonnet5ModelIdentity, p as resolveClaudeOpus5ModelIdentity, s as requiresClaudeDefaultSampling, u as resolveClaudeModelIdentity, v as supportsClaudeNativeMaxEffort, y as supportsClaudeNativeXhighEffort } from "../src-C8U7lkoa.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-BIaiBURL.mjs";
|
|
3
|
+
import { C as applyAnthropicFallbackBoundary, E as applyAnthropicRefusal, F as resolveAnthropicServerCompactionPlan, I as isAnthropicOAuthApiKey, L as omitFoundryBearerCredentialHeaders, R as usesFoundryBearerAuth, S as CLAUDE_OPUS_FALLBACK_MODEL_COST, T as resolveAnthropicFallbackServingModelCost, _ as toClaudeCodeToolName, b as ANTHROPIC_SERVER_SIDE_FALLBACKS, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, 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 readAnthropicFallbackBoundary, x as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, y as findActiveAnthropicToolTurnAssistantIndex } from "../anthropic-compaction-replay-CKCDrZJv.mjs";
|
|
4
|
+
import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-DTGZ4VMY.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, applyClaudeRequestContract, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
|
|
@@ -1,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-BthRXano.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-DO7yV7az.mjs";
|
|
2
|
+
export { OPENAI_RESPONSES_APIS, readOpenAIResponsesCompactionWindow, resolveOpenAIResponsesServerCompactionPlan };
|