@openclaw/ai 2026.11.3 → 2026.11.4

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.
Files changed (76) hide show
  1. package/README.md +2 -1
  2. package/dist/{anthropic-lueA8LUg.mjs → anthropic-C8cQsW5d.mjs} +45 -25
  3. package/dist/{anthropic-payload-policy-C0ki72BT.d.mts → anthropic-payload-policy-BCp4dUJR.d.mts} +2 -2
  4. package/dist/{anthropic-stream-reducer-yWDb5Cct.mjs → anthropic-stream-reducer-BgAICq34.mjs} +11 -10
  5. package/dist/{anthropic-tool-projection-DZOKfAmL.mjs → anthropic-tool-projection-CrsCkF4k.mjs} +1 -1
  6. package/dist/{anthropic-tool-projection-C2-d1eZ3.d.mts → anthropic-tool-projection-CzSSQzZL.d.mts} +1 -1
  7. package/dist/{api-registry-gDt0faai.d.mts → api-registry-CkmxPPac.d.mts} +1 -1
  8. package/dist/{assistant-output-BnQm3fov.mjs → assistant-output-Hl3b-ViJ.mjs} +2 -2
  9. package/dist/{azure-openai-responses-BvvXzZbi.mjs → azure-openai-responses-CZKrN3aq.mjs} +5 -5
  10. package/dist/diagnostics.d.mts +3 -3
  11. package/dist/{google-Cpi_cLKZ.mjs → google-DuI8TLy0.mjs} +2 -2
  12. package/dist/{google-interactions-CGINbsjO.mjs → google-interactions-jbqgn8zL.mjs} +8 -8
  13. package/dist/{google-messages-DQMgG5yG.mjs → google-messages-BWhsZ167.mjs} +3 -3
  14. package/dist/{google-provider-stream-BHd0cST9.mjs → google-provider-stream-DL0bXgX5.mjs} +6 -6
  15. package/dist/{google-shared-vtag8bj5.mjs → google-shared-DXizMtnG.mjs} +5 -5
  16. package/dist/{google-vertex-eKoUnW7N.mjs → google-vertex-DnjRWo-M.mjs} +2 -2
  17. package/dist/{host-jJOffdlW.d.mts → host-B03VqZdH.d.mts} +2 -2
  18. package/dist/{host-CWt55nnF.mjs → host-CyGba3M8.mjs} +99 -80
  19. package/dist/{host-policy-Dm7PM6AD.mjs → host-policy-CNQztzZm.mjs} +1 -1
  20. package/dist/{index-DSprYWaz.d.mts → index-B8ODIVmA.d.mts} +15 -4
  21. package/dist/index.d.mts +4 -4
  22. package/dist/index.mjs +4 -4
  23. package/dist/internal/anthropic.d.mts +15 -5
  24. package/dist/internal/anthropic.mjs +6 -6
  25. package/dist/internal/openai-completions-compat.d.mts +1 -1
  26. package/dist/internal/openai-completions-compat.mjs +1 -1
  27. package/dist/internal/openai-responses-payload-policy.d.mts +2 -2
  28. package/dist/internal/openai-responses-payload-policy.mjs +1 -1
  29. package/dist/internal/openai.d.mts +8 -8
  30. package/dist/internal/openai.mjs +7 -7
  31. package/dist/internal/runtime.d.mts +6 -6
  32. package/dist/internal/runtime.mjs +3 -3
  33. package/dist/internal/shared.d.mts +3 -3
  34. package/dist/internal/shared.mjs +2 -2
  35. package/dist/internal/tool-schema.d.mts +2 -2
  36. package/dist/internal/tool-schema.mjs +3 -3
  37. package/dist/{mistral-CQ7aoWg2.mjs → mistral-BgamhpFG.mjs} +4 -4
  38. package/dist/{openai-CiRi-nVE.mjs → openai-DAGvHDxa.mjs} +1 -1
  39. package/dist/{openai-chatgpt-responses-BZa3SySh.mjs → openai-chatgpt-responses-CWIwGLDZ.mjs} +10 -10
  40. package/dist/{openai-completions-compat-bNQXF1y9.mjs → openai-completions-compat-D9KEUevM.mjs} +1 -1
  41. package/dist/{openai-completions-compat-CBvb2eld.d.mts → openai-completions-compat-DTe2EXPi.d.mts} +2 -2
  42. package/dist/{openai-completions-CCZ_UHCk.mjs → openai-completions-kAWkz3bl.mjs} +3 -3
  43. package/dist/{openai-completions-transport-DFvSBbUT.mjs → openai-completions-transport-bgZfY_xa.mjs} +16 -16
  44. package/dist/{openai-prompt-cache-B9AvdoEo.mjs → openai-prompt-cache-CAo-Mah6.mjs} +1 -1
  45. package/dist/{openai-prompt-cache-DgjD-UL5.d.mts → openai-prompt-cache-k7EPMLa0.d.mts} +1 -1
  46. package/dist/{openai-responses-compaction-replay-_sUXtcwU.d.mts → openai-responses-compaction-replay-DOJaDCUl.d.mts} +3 -3
  47. package/dist/{openai-responses-contracts-B1nkeLL6.d.mts → openai-responses-contracts-DHtim7d_.d.mts} +3 -3
  48. package/dist/{openai-responses-endpoint-CfKR6N5f.mjs → openai-responses-endpoint-DJwbSy3n.mjs} +3 -1
  49. package/dist/{openai-responses-payload-policy-BzM52TTH.d.mts → openai-responses-payload-policy-cIaYG5ZQ.d.mts} +1 -0
  50. package/dist/{openai-responses-request-lifecycle-CTqHc02t.mjs → openai-responses-request-lifecycle-CQBkk3bx.mjs} +6 -6
  51. package/dist/{openai-responses-shared-wx9v1MCn.mjs → openai-responses-shared-C8C1myRt.mjs} +13 -13
  52. package/dist/{openai-responses-terminal-usage-CpVjkqn-.d.mts → openai-responses-terminal-usage-BDGDBGuA.d.mts} +1 -1
  53. package/dist/{openai-responses-DQsZKUoI.mjs → openai-responses-wWDdPeKC.mjs} +6 -6
  54. package/dist/{openai-tool-schema-BTEU2xmN.mjs → openai-tool-schema-D913am3I.mjs} +3 -2
  55. package/dist/{provider-options-DAzsyi49.d.mts → provider-options-DFjnfImJ.d.mts} +7 -1
  56. package/dist/{provider-replay-context-4vxI7p4V.mjs → provider-replay-context-BWgW0iTm.mjs} +1 -1
  57. package/dist/{provider-transport-turn-state-D_GjPJHe.mjs → provider-transport-turn-state-CxXS1_Cv.mjs} +3 -3
  58. package/dist/{provider-types-CWl4VXvE.d.mts → provider-types-C-67EZr8.d.mts} +2 -2
  59. package/dist/provider-types.d.mts +3 -3
  60. package/dist/providers.d.mts +2 -2
  61. package/dist/providers.mjs +10 -10
  62. package/dist/{sanitize-unicode-ZqVLLEKC.d.mts → sanitize-unicode-CkejzD2f.d.mts} +1 -1
  63. package/dist/{simple-options-xJkqrG_E.mjs → simple-options-Bd0STwu7.mjs} +2 -2
  64. package/dist/{src-CyA0zJnt.mjs → src--qsViR3j.mjs} +60 -12
  65. package/dist/{stream-C4YDqhFj.mjs → stream-BRecd0FZ.mjs} +1 -1
  66. package/dist/{tool-schema-json-projection-B1sTYwfH.mjs → tool-schema-json-projection-DU-FFSa7.mjs} +1 -1
  67. package/dist/{transport-stream-shared-lhgkTOz3.mjs → transport-stream-shared-C1AtJhZA.mjs} +1 -1
  68. package/dist/{transport-stream-shared-8ru8eX4s.d.mts → transport-stream-shared-Dhx_37f1.d.mts} +1 -1
  69. package/dist/{transport-utils-DwOpuTjL.mjs → transport-utils-4xPfuKp2.mjs} +2 -2
  70. package/dist/transports.d.mts +12 -12
  71. package/dist/transports.mjs +61 -41
  72. package/dist/types-BFfXm_Jr.d.mts +1 -0
  73. package/dist/types.d.mts +3 -3
  74. package/dist/types.mjs +2 -2
  75. package/package.json +1 -1
  76. package/dist/types-CBJthzJX.d.mts +0 -1
package/README.md CHANGED
@@ -31,7 +31,8 @@ provider plugin hooks, and diagnostics logging) can be injected with
31
31
  `configureAiTransportHost`; the defaults are inert. Node callers that need
32
32
  runtime-local policy can use `createNodeLlmRuntime`; it preserves that host across
33
33
  provider work without replacing the process default. `createLlmRuntime` continues
34
- to use the process-default host.
34
+ to use the process-default host. The default host and its asynchronous scope are
35
+ shared across duplicate package module instances, including native plugins.
35
36
 
36
37
  OpenAI HTTP adapters report rejected response status and headers through
37
38
  `onResponse` before consuming the error body. Successful streaming responses
@@ -1,15 +1,15 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-B4iAMlE-.mjs";
2
- import { w as supportsClaudeAdaptiveThinking } from "./src-CyA0zJnt.mjs";
2
+ import { E as supportsClaudeAdaptiveThinking } from "./src--qsViR3j.mjs";
3
3
  import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
4
- import { T as usesClaudeStreamingRefusalContract, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
5
- import { s as streamFragmentError } from "./transport-utils-DwOpuTjL.mjs";
6
- import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-yWDb5Cct.mjs";
4
+ import { O as usesClaudeStreamingRefusalContract, S as readRequiredClaudeCodeVersion, _ as buildAnthropicClaudeCodeIdentity, a as resolveAiTransportHeaderSentinels, b as prepareClaudeNoPrefillRequestContext, r as getAiTransportHost, x as raiseClaudeCodeVersionFloor } from "./host-CyGba3M8.mjs";
5
+ import { s as streamFragmentError } from "./transport-utils-4xPfuKp2.mjs";
6
+ import { F as supportsAnthropicServerSideFallback, H as isAnthropicOAuthApiKey, O as isDirectAnthropicModel, U as omitFoundryBearerCredentialHeaders, W as usesFoundryBearerAuth, d as applyAnthropicThinkingOptions, l as buildAnthropicRequest, t as consumeAnthropicStream, u as prepareAnthropicRequest, x as suppressAnthropicCompaction, y as isAnthropicReplayRejection } from "./anthropic-stream-reducer-BgAICq34.mjs";
7
7
  import { i as resolveCacheRetention, n as resolveCloudflareBaseUrl, r as buildCopilotDynamicHeaders } from "./cloudflare-Dttf8jKq.mjs";
8
- import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-xJkqrG_E.mjs";
9
- import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-lhgkTOz3.mjs";
8
+ import { n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-Bd0STwu7.mjs";
9
+ import { D as parseJsonWithRepair, m as notifyProviderHttpResponse, n as assignTransportErrorDetails, u as finalizeTransportStream } from "./transport-stream-shared-C1AtJhZA.mjs";
10
10
  import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
11
11
  import { t as createDeferredEventBuffer } from "./deferred-event-buffer-DAvyP7qA.mjs";
12
- import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
12
+ import { t as createAssistantOutput } from "./assistant-output-Hl3b-ViJ.mjs";
13
13
  import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
14
14
  import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
15
15
  import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
@@ -61,25 +61,44 @@ const streamAnthropic = (model, context, options) => {
61
61
  const refusalBuffer = usesClaudeStreamingRefusalContract(model) ? createDeferredEventBuffer(stream) : void 0;
62
62
  let replayedCompaction;
63
63
  try {
64
- const { client, isOAuthToken, serverSideFallback, directApiKeyBetaHeader, claudeCodeVersion } = createClient(model, requestContext, requestOptions);
65
- const builtParams = await buildAnthropicRequest(model, requestContext, requestOptions, "provider", isOAuthToken, serverSideFallback, claudeCodeVersion);
66
- replayedCompaction = builtParams.replayedCompaction;
67
- const { params, headers } = await prepareAnthropicRequest(builtParams.params, model, requestOptions, directApiKeyBetaHeader);
68
- const sdkRequestOptions = {
69
- ...requestOptions?.signal ? { signal: requestOptions.signal } : {},
70
- ...requestOptions?.timeoutMs !== void 0 ? { timeout: requestOptions.timeoutMs } : {},
71
- maxRetries: 0,
72
- headers
64
+ const send = async (canRetry) => {
65
+ const { client, isOAuthToken, serverSideFallback, directApiKeyBetaHeader, claudeCodeVersion } = createClient(model, requestContext, requestOptions);
66
+ const builtParams = await buildAnthropicRequest(model, requestContext, requestOptions, "provider", isOAuthToken, serverSideFallback, claudeCodeVersion);
67
+ replayedCompaction = builtParams.replayedCompaction;
68
+ const { params, headers } = await prepareAnthropicRequest(builtParams.params, model, requestOptions, directApiKeyBetaHeader);
69
+ const sdkRequestOptions = {
70
+ ...requestOptions?.signal ? { signal: requestOptions.signal } : {},
71
+ ...requestOptions?.timeoutMs !== void 0 ? { timeout: requestOptions.timeoutMs } : {},
72
+ maxRetries: 0,
73
+ headers
74
+ };
75
+ try {
76
+ const response = await client.messages.create({
77
+ ...params,
78
+ stream: true
79
+ }, sdkRequestOptions).asResponse();
80
+ await notifyProviderHttpResponse({
81
+ options: requestOptions,
82
+ response,
83
+ model
84
+ });
85
+ return {
86
+ response,
87
+ isOAuthToken,
88
+ builtParams
89
+ };
90
+ } catch (error) {
91
+ const required = isOAuthToken ? readRequiredClaudeCodeVersion(error) : void 0;
92
+ if (canRetry && required && raiseClaudeCodeVersionFloor(required)) {
93
+ try {
94
+ requestOptions?.onClaudeCodeVersionRequired?.(required);
95
+ } catch {}
96
+ return send(false);
97
+ }
98
+ throw error;
99
+ }
73
100
  };
74
- const response = await client.messages.create({
75
- ...params,
76
- stream: true
77
- }, sdkRequestOptions).asResponse();
78
- await notifyProviderHttpResponse({
79
- options: requestOptions,
80
- response,
81
- model
82
- });
101
+ const { response, isOAuthToken, builtParams } = await send(true);
83
102
  await consumeAnthropicStream({
84
103
  events: iterateAnthropicEvents(response, requestOptions?.signal),
85
104
  model,
@@ -133,6 +152,7 @@ const streamSimpleAnthropic = (model, context, options) => {
133
152
  anthropicCompactThreshold: options?.anthropicCompactThreshold,
134
153
  cacheTtlPruning: options?.cacheTtlPruning,
135
154
  onCompactionRejected: options?.onCompactionRejected,
155
+ onClaudeCodeVersionRequired: options?.onClaudeCodeVersionRequired,
136
156
  authProfileId: options?.authProfileId,
137
157
  maxTokens: clampMaxTokensToModel(model, options?.maxTokens ?? model.maxTokens),
138
158
  toolChoice: options?.toolChoice,
@@ -1,6 +1,6 @@
1
- import "./index-DSprYWaz.mjs";
1
+ import "./index-B8ODIVmA.mjs";
2
2
  import { k as Model } from "./types-CVYzKrMl.mjs";
3
- import { t as AnthropicContextManagementOptions } from "./provider-options-DAzsyi49.mjs";
3
+ import { t as AnthropicContextManagementOptions } from "./provider-options-DFjnfImJ.mjs";
4
4
  import { TextBlockParam } from "@anthropic-ai/sdk/resources/messages.js";
5
5
  //#region packages/ai/src/transports/anthropic-payload-policy.d.ts
6
6
  /** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
@@ -1,21 +1,21 @@
1
- import { E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, b as resolveClaudeOpus5ModelIdentity, d as requiresClaudeBetweenToolsThinking, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, k as supportsClaudeServerCompaction, m as resolveClaudeFable5ModelIdentity, u as bindsClaudeThinkingPrefix, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./src-CyA0zJnt.mjs";
1
+ import { A as supportsClaudeNativeXhighEffort, C as resolveClaudeSonnet55ModelIdentity, E as supportsClaudeAdaptiveThinking, M as usesClaude5RequestContract, O as supportsClaudeInHistorySystemMessages, S as resolveClaudeOpus5ModelIdentity, _ as resolveClaudeHaiku55ModelIdentity, g as resolveClaudeFable5ModelIdentity, j as supportsClaudeServerCompaction, p as requiresClaudeBetweenToolsThinking, u as bindsClaudeThinkingPrefix, v as resolveClaudeModelIdentity, x as resolveClaudeOpus55ModelIdentity } from "./src--qsViR3j.mjs";
2
2
  import { f as hasRuntimeContextMarker } from "./types-BXd0kI8-.mjs";
3
3
  import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
4
4
  import { a as asRecord, o as isRecord, r as asOptionalObjectRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
5
5
  import { a as normalizeOptionalLowercaseString, i as normalizeNullableString } from "./string-coerce-Cj8sqWHx.mjs";
6
6
  import { n as asNonNegativeFiniteNumber } from "./number-coercion-37gmNkuA.mjs";
7
- import { N as isImageWithMediaPayload, O as calculateCost, S as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, w as usesClaudeFable5MessagesContract, x as requiresClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-CWt55nnF.mjs";
8
- import "./transport-utils-DwOpuTjL.mjs";
7
+ import { C as requiresClaudeAdaptiveThinking, D as usesClaudeFable5MessagesContract, I as isImageWithMediaPayload, T as resolveAnthropicThinkingEffort, g as applyClaudeRequestContract, h as ANTHROPIC_CLAUDE_CODE_VERSION, j as calculateCost, r as getAiTransportHost, u as STREAM_ERROR_FALLBACK_TEXT, v as defaultsClaudeAdaptiveThinking, y as mapAnthropicStopReason } from "./host-CyGba3M8.mjs";
8
+ import "./transport-utils-4xPfuKp2.mjs";
9
9
  import { n as estimateBase64DecodedBytes } from "./base64-C8CdcsjU.mjs";
10
- import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-Dm7PM6AD.mjs";
10
+ import { a as resolveProviderRequestCapabilities, i as resolveProviderEndpoint } from "./host-policy-CNQztzZm.mjs";
11
11
  import { i as resolveCacheRetention } from "./cloudflare-Dttf8jKq.mjs";
12
12
  import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
13
- import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
14
- import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
13
+ import { S as splitSystemPromptCacheBoundary, T as stripSystemPromptRelocatableBoundary, d as extractToolResultBlockText, f as extractToolResultText, h as preparedRequestSuffix, l as describeToolResultMediaPlaceholder, t as adjustMaxTokensForThinking, w as stripSystemPromptCacheBoundary } from "./simple-options-Bd0STwu7.mjs";
14
+ import { C as parseJsonObjectPreservingUnsafeIntegers, E as createToolArgumentPreviewSchedule, O as parseStreamingJson, b as transportAbortError, d as iterateModelStream, i as copyProviderAcceptanceObserver, l as finalizeTerminalToolCallArguments, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-C1AtJhZA.mjs";
15
15
  import { t as parsePositiveInteger } from "./positive-integer-Bb4Evc7L.mjs";
16
- import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-4vxI7p4V.mjs";
17
- import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
18
- import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-DZOKfAmL.mjs";
16
+ import { n as isProviderReplayContext, r as providerReplayContextMatches, t as buildProviderReplayContext } from "./provider-replay-context-BWgW0iTm.mjs";
17
+ import { n as transformProviderMessages } from "./assistant-output-Hl3b-ViJ.mjs";
18
+ import { a as reconcileAnthropicToolChoice, i as projectAnthropicTools, n as normalizeAnthropicToolChoice, o as resolveOriginalAnthropicToolName, s as toClaudeCodeToolName, t as normalizeAnthropicToolCallId } from "./anthropic-tool-projection-CrsCkF4k.mjs";
19
19
  import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
20
20
  //#region packages/ai/src/providers/anthropic-auth-headers.ts
21
21
  /** Inspect resolved credential shape for auth routing without exposing its value. */
@@ -660,7 +660,7 @@ function resolveAnthropicTransportOptions(model, options, apiKey) {
660
660
  modelContextWindow: model.contextWindow,
661
661
  modelMaxTokens: model.maxTokens,
662
662
  requestedMaxTokens: options?.maxTokens,
663
- useModelDefault: resolveClaudeHaiku55ModelIdentity(model) !== void 0 || resolveClaudeSonnet5ModelIdentity(model) !== void 0 || resolveClaudeOpus5ModelIdentity(model) !== void 0
663
+ useModelDefault: usesClaude5RequestContract(model)
664
664
  });
665
665
  if (baseMaxTokens === void 0) throw new Error(`Anthropic Messages transport requires a positive maxTokens value for ${model.provider}/${model.id}`);
666
666
  const resolved = copyProviderAcceptanceObserver(options, {
@@ -684,6 +684,7 @@ function resolveAnthropicTransportOptions(model, options, apiKey) {
684
684
  anthropicServerCompaction: options?.anthropicServerCompaction,
685
685
  anthropicCompactThreshold: options?.anthropicCompactThreshold,
686
686
  cacheTtlPruning: options?.cacheTtlPruning,
687
+ onClaudeCodeVersionRequired: options?.onClaudeCodeVersionRequired,
687
688
  ...options?.authProfileId ? { authProfileId: options.authProfileId } : {}
688
689
  });
689
690
  resolved.reasoning = applyAnthropicThinkingOptions(model, resolved, options, "transport");
@@ -1,6 +1,6 @@
1
1
  import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
2
2
  import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
3
- import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-B1sTYwfH.mjs";
3
+ import { _ as SCHEMA_MAP_KEYS, d as inheritToolSchemaTruncation, g as SCHEMA_ARRAY_KEYS, i as publishRuntimeToolInputSchema, r as projectRuntimeToolInputSchema, t as getPublishedRuntimeToolInputSchema, y as SCHEMA_OBJECT_KEYS } from "./tool-schema-json-projection-DU-FFSa7.mjs";
4
4
  //#region packages/ai/src/providers/anthropic-tool-projection.ts
5
5
  const CLAUDE_CODE_TOOL_LOOKUP = new Map([
6
6
  "Read",
@@ -1,4 +1,4 @@
1
- import { r as AnthropicOptions } from "./provider-options-DAzsyi49.mjs";
1
+ import { r as AnthropicOptions } from "./provider-options-DFjnfImJ.mjs";
2
2
  import { Tool } from "@anthropic-ai/sdk/resources/messages.js";
3
3
  //#region packages/ai/src/providers/anthropic-tool-projection.d.ts
4
4
  type AnthropicToolDescriptor = {
@@ -1,4 +1,4 @@
1
- import "./index-DSprYWaz.mjs";
1
+ import "./index-B8ODIVmA.mjs";
2
2
  import { Q as SimpleStreamOptions, n as Api, nt as StreamOptions, tt as StreamFunction } from "./types-CVYzKrMl.mjs";
3
3
  //#region packages/ai/src/api-registry.d.ts
4
4
  /** Runtime stream adapter signature stored in the API provider registry. */
@@ -1,5 +1,5 @@
1
- import { c as transformMessages } from "./host-CWt55nnF.mjs";
2
- import { a as createEmptyTransportUsage } from "./transport-stream-shared-lhgkTOz3.mjs";
1
+ import { c as transformMessages } from "./host-CyGba3M8.mjs";
2
+ import { a as createEmptyTransportUsage } from "./transport-stream-shared-C1AtJhZA.mjs";
3
3
  //#region packages/ai/src/provider-transcript-transform.ts
4
4
  const IMAGE_OMISSION = "(image omitted: model does not support images)";
5
5
  const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
@@ -1,10 +1,10 @@
1
1
  import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
2
- import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
3
- import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
2
+ import { r as getAiTransportHost } from "./host-CyGba3M8.mjs";
3
+ import { n as buildBaseOptions } from "./simple-options-Bd0STwu7.mjs";
4
4
  import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
5
- import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
6
- import { F as convertProviderResponsesMessages, Lt as resolvePromptCacheKey, Rt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-wx9v1MCn.mjs";
7
- import { n as OpenAI, t as AzureOpenAI } from "./openai-CiRi-nVE.mjs";
5
+ import { t as createAssistantOutput } from "./assistant-output-Hl3b-ViJ.mjs";
6
+ import { F as convertProviderResponsesMessages, Lt as resolvePromptCacheKey, Rt as withOpenAIErrorResponseHook, r as runResponsesStreamLifecycle, t as applyCommonResponsesParams, vt as resolveOpenAISimpleReasoningEffort } from "./openai-responses-shared-C8C1myRt.mjs";
7
+ import { n as OpenAI, t as AzureOpenAI } from "./openai-DAGvHDxa.mjs";
8
8
  import { i as resolveAzureDeploymentNameFromMap, n as isTraditionalAzureOpenAIHost, t as isOpenAICompatibleAzureResponsesBaseUrl } from "./azure-openai-responses-client-compat-D0dvJMbZ.mjs";
9
9
  import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
10
10
  //#region packages/ai/src/providers/azure-openai-responses.ts
@@ -1,7 +1,7 @@
1
- import { o as ProviderRefusalReview, s as readProviderRefusalReview } from "./index-DSprYWaz.mjs";
1
+ import { o as ProviderRefusalReview, s as readProviderRefusalReview } from "./index-B8ODIVmA.mjs";
2
2
  import { At as extractDiagnosticError, Dt as DiagnosticErrorInfo, Et as AssistantMessageDiagnostic, Mt as isProviderRefusalAssistantError, Ot as appendAssistantMessageDiagnostic, a as AssistantMessage, jt as formatThrownValue, kt as createAssistantMessageDiagnostic } from "./types-CVYzKrMl.mjs";
3
- import "./types-CBJthzJX.mjs";
4
- import { n as isResponsesOutputLimitToolCallError } from "./openai-responses-terminal-usage-CpVjkqn-.mjs";
3
+ import "./types-BFfXm_Jr.mjs";
4
+ import { n as isResponsesOutputLimitToolCallError } from "./openai-responses-terminal-usage-BDGDBGuA.mjs";
5
5
  import { n as ProviderErrorRedactor, r as configureProviderErrorRedactor } from "./provider-error-CnaWYTRY.mjs";
6
6
  import { i as projectDiagnosticValue, t as DiagnosticProjectionPolicy } from "./credential-redaction-XvsPf7Yi.mjs";
7
7
  import { i as emitModelTransportError, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./model-transport-url-BrsjjdjR.mjs";
@@ -1,8 +1,8 @@
1
- import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
1
+ import { r as getAiTransportHost } from "./host-CyGba3M8.mjs";
2
2
  import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
3
3
  import { n as resolveOpencodeSessionHeaders } from "./session-affinity-DA4WHv1h.mjs";
4
4
  import { t as requireApiKey } from "./required-api-key-D088S4Cd.mjs";
5
- import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-BHd0cST9.mjs";
5
+ import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-DL0bXgX5.mjs";
6
6
  import { GoogleGenAI } from "@google/genai";
7
7
  //#region packages/ai/src/providers/google.ts
8
8
  const { stream: streamGoogle, streamSimple: streamSimpleGoogle } = createGoogleGenerateContentStreams("google-generative-ai", (model, options) => {
@@ -1,18 +1,18 @@
1
1
  import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
2
2
  import { a as asRecord, i as asOptionalRecord, s as readStringField } from "./record-coerce-CNDovvft.mjs";
3
- import { O as calculateCost, a as resolveAiTransportHeaderSentinels, r as getAiTransportHost } from "./host-CWt55nnF.mjs";
4
- import { s as streamFragmentError } from "./transport-utils-DwOpuTjL.mjs";
5
- import { t as buildGuardedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
3
+ import { a as resolveAiTransportHeaderSentinels, j as calculateCost, r as getAiTransportHost } from "./host-CyGba3M8.mjs";
4
+ import { s as streamFragmentError } from "./transport-utils-4xPfuKp2.mjs";
5
+ import { t as buildGuardedModelFetch } from "./host-policy-CNQztzZm.mjs";
6
6
  import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
7
- import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
8
- import { b as transportAbortError, c as failTransportStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-lhgkTOz3.mjs";
7
+ import { n as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./simple-options-Bd0STwu7.mjs";
8
+ import { b as transportAbortError, c as failTransportStream, f as mergeTransportHeaders, g as parseTerminalToolCallArguments, h as notifyProviderStreamOpened, m as notifyProviderHttpResponse, w as parseJsonPreservingUnsafeIntegers } from "./transport-stream-shared-C1AtJhZA.mjs";
9
9
  import { n as getEnvApiKey } from "./env-api-keys-Xd8dm_aV.mjs";
10
- import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
10
+ import { n as transformProviderMessages, t as createAssistantOutput } from "./assistant-output-Hl3b-ViJ.mjs";
11
11
  import { n as createGoogleVideoPlaceholder, r as materializeGoogleVideoSlots, t as GOOGLE_VIDEO_SLOT_OMISSION } from "./google-video-slots-D8tPH8wX.mjs";
12
12
  import { PROVIDER_CONTEXT_HANDOFF, PROVIDER_MODEL_INPUT, resolveProviderContext } from "./provider-types.mjs";
13
- import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-vtag8bj5.mjs";
13
+ import { n as buildGoogleInteractionsSimpleThinking } from "./google-shared-DXizMtnG.mjs";
14
14
  //#region packages/ai/package.json
15
- var version = "2026.11.3";
15
+ var version = "2026.11.4";
16
16
  //#endregion
17
17
  //#region packages/ai/src/providers/google-interactions-request.ts
18
18
  const DEFAULT_GOOGLE_API_BASE_URL = "https://generativelanguage.googleapis.com";
@@ -1,10 +1,10 @@
1
1
  import { f as hasRuntimeContextMarker } from "./types-BXd0kI8-.mjs";
2
2
  import { r as appendAssistantThinking } from "./event-stream-X2gmsUWv.mjs";
3
- import { N as isImageWithMediaPayload, O as calculateCost } from "./host-CWt55nnF.mjs";
3
+ import { I as isImageWithMediaPayload, j as calculateCost } from "./host-CyGba3M8.mjs";
4
4
  import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
5
5
  import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-D_MeCQFI.mjs";
6
- import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-xJkqrG_E.mjs";
7
- import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-lhgkTOz3.mjs";
6
+ import { f as extractToolResultText, l as describeToolResultMediaPlaceholder } from "./simple-options-Bd0STwu7.mjs";
7
+ import { a as createEmptyTransportUsage, b as transportAbortError, r as coerceTransportToolCallArguments, v as sanitizeTransportPayloadText } from "./transport-stream-shared-C1AtJhZA.mjs";
8
8
  import { t as notifyLlmRequestActivity } from "./llm-request-activity-CfMuh5cC.mjs";
9
9
  import { isGoogleGemini4Model } from "./internal/google-model-family.mjs";
10
10
  import "./types.mjs";
@@ -1,11 +1,11 @@
1
1
  import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
2
2
  import { a as asRecord } from "./record-coerce-CNDovvft.mjs";
3
- import { a as resolveAiTransportHeaderSentinels } from "./host-CWt55nnF.mjs";
4
- import { n as buildManagedModelFetch } from "./host-policy-Dm7PM6AD.mjs";
5
- import { n as buildBaseOptions } from "./simple-options-xJkqrG_E.mjs";
6
- import { f as mergeTransportHeaders } from "./transport-stream-shared-lhgkTOz3.mjs";
7
- import { t as createAssistantOutput } from "./assistant-output-BnQm3fov.mjs";
8
- import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-vtag8bj5.mjs";
3
+ import { a as resolveAiTransportHeaderSentinels } from "./host-CyGba3M8.mjs";
4
+ import { n as buildManagedModelFetch } from "./host-policy-CNQztzZm.mjs";
5
+ import { n as buildBaseOptions } from "./simple-options-Bd0STwu7.mjs";
6
+ import { f as mergeTransportHeaders } from "./transport-stream-shared-C1AtJhZA.mjs";
7
+ import { t as createAssistantOutput } from "./assistant-output-Hl3b-ViJ.mjs";
8
+ import { i as runGoogleGenerateContentLifecycle, r as buildGoogleSimpleThinking, t as buildGoogleGenerateContentParams } from "./google-shared-DXizMtnG.mjs";
9
9
  import { ResourceScope } from "@google/genai";
10
10
  //#region packages/ai/src/providers/google-http-options.ts
11
11
  function buildGoogleHttpOptions(model, optionsHeaders, profile) {
@@ -1,10 +1,10 @@
1
- import { k as clampThinkingLevel } from "./host-CWt55nnF.mjs";
1
+ import { M as clampThinkingLevel } from "./host-CyGba3M8.mjs";
2
2
  import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
3
- import { w as stripSystemPromptCacheBoundary } from "./simple-options-xJkqrG_E.mjs";
4
- import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-lhgkTOz3.mjs";
5
- import { n as transformProviderMessages } from "./assistant-output-BnQm3fov.mjs";
3
+ import { w as stripSystemPromptCacheBoundary } from "./simple-options-Bd0STwu7.mjs";
4
+ import { b as transportAbortError, c as failTransportStream, h as notifyProviderStreamOpened } from "./transport-stream-shared-C1AtJhZA.mjs";
5
+ import { n as transformProviderMessages } from "./assistant-output-Hl3b-ViJ.mjs";
6
6
  import { isGoogleGemini3ProModel, isGoogleGemini3ThinkingLevelModel } from "./internal/google-model-family.mjs";
7
- import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-DQMgG5yG.mjs";
7
+ import { a as googleFlashSupportsMinimalThinking, i as consumeGoogleGenerateContentStream, n as projectGoogleMessages, r as requiresGoogleToolCallId, t as convertGoogleTools } from "./google-messages-BWhsZ167.mjs";
8
8
  import { FunctionCallingConfigMode, ThinkingLevel } from "@google/genai";
9
9
  //#region packages/ai/src/providers/google-shared.ts
10
10
  function convertMessages(model, context) {
@@ -1,6 +1,6 @@
1
1
  import { o as normalizeOptionalString } from "./string-coerce-Cj8sqWHx.mjs";
2
- import { r as getAiTransportHost } from "./host-CWt55nnF.mjs";
3
- import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-BHd0cST9.mjs";
2
+ import { r as getAiTransportHost } from "./host-CyGba3M8.mjs";
3
+ import { n as buildGoogleHttpOptions, t as createGoogleGenerateContentStreams } from "./google-provider-stream-DL0bXgX5.mjs";
4
4
  import { GoogleGenAI } from "@google/genai";
5
5
  //#region packages/ai/src/providers/google-vertex.ts
6
6
  const API_VERSION = "v1";
@@ -1,6 +1,6 @@
1
- import "./index-DSprYWaz.mjs";
1
+ import "./index-B8ODIVmA.mjs";
2
2
  import { d as Context, et as StreamFn, k as Model, n as Api } from "./types-CVYzKrMl.mjs";
3
- import { n as ApiRegistry } from "./api-registry-gDt0faai.mjs";
3
+ import { n as ApiRegistry } from "./api-registry-CkmxPPac.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 {