@openclaw/ai 2026.8.33 → 2026.8.34

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.
@@ -5,7 +5,7 @@ import { o as isRecord } from "./utf16-slice-qz3nsy87.mjs";
5
5
  import { r as calculateCost, t as sanitizeSurrogates } from "./sanitize-unicode-Cfcaqa9V.mjs";
6
6
  import { S as usesClaudeStreamingRefusalContract, _ as prepareClaudeNoPrefillRequestContext, a as describeToolResultMediaPlaceholder, c as extractToolResultText, d as isImageWithMediaPayload, f as ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, g as mapAnthropicStopReason, m as applyClaudeRequestContract, n as getAiTransportHost, p as ANTHROPIC_CLAUDE_CODE_VERSION, r as resolveAiTransportHeaderSentinels, s as extractToolResultBlockText, v as requiresClaudeAdaptiveThinking, x as usesClaudeFable5MessagesContract, y as resolveAnthropicThinkingEffort } from "./host-DhlhmyR6.mjs";
7
7
  import { n as projectProviderError } from "./provider-error-BI8kIViN.mjs";
8
- import { A as createAnthropicInlineImageBudget, B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, M as resolveAnthropicImageMediaType, N as applyAnthropicCacheControlToMessages, O as resolveAnthropicFallbackServingModelCost, S as readAnthropicInputTransformations, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as findActiveAnthropicToolTurnAssistantIndex, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, j as normalizeAnthropicInlineContent, k as applyAnthropicRefusal, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "./anthropic-compaction-replay-B6sEzXhr.mjs";
8
+ import { A as createAnthropicInlineImageBudget, B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, M as resolveAnthropicImageMediaType, N as applyAnthropicCacheControlToMessages, O as resolveAnthropicFallbackServingModelCost, S as readAnthropicInputTransformations, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as findActiveAnthropicToolTurnAssistantIndex, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, j as normalizeAnthropicInlineContent, k as applyAnthropicRefusal, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "./anthropic-compaction-replay-DKGjPxYr.mjs";
9
9
  import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
10
10
  import { d as stripSystemPromptCacheBoundary, n as buildBaseOptions, r as clampMaxTokensToModel, t as adjustMaxTokensForThinking, u as splitSystemPromptCacheBoundary } from "./simple-options-Bwi0x0bX.mjs";
11
11
  import { t as MALFORMED_STREAMING_FRAGMENT_ERROR_MESSAGE } from "./transport-utils-DdLjoPMb.mjs";
@@ -408,7 +408,7 @@ const streamAnthropic = (model, context, options) => {
408
408
  if (event.delta.stop_reason === "refusal") applyAnthropicRefusal(output, event.delta.stop_details, model.provider);
409
409
  else output.stopReason = mapAnthropicStopReason(event.delta.stop_reason);
410
410
  }
411
- if (event.usage) applyAnthropicMessageDeltaUsage(output.usage, event.usage, messageStartPromptUsage);
411
+ applyAnthropicMessageDeltaUsage(output.usage, event.usage, messageStartPromptUsage);
412
412
  calculateCost(costModel, output.usage);
413
413
  }
414
414
  }
@@ -685,9 +685,9 @@ function applyAnthropicMessageStartUsage(target, payload) {
685
685
  };
686
686
  return promptTokens > 0 ? promptUsage : void 0;
687
687
  }
688
- /** Keep cumulative billing separate from the final server-side iteration context. */
689
- function applyAnthropicMessageDeltaUsage(target, payload, messageStartPromptUsage) {
690
- const usage = payload ?? {};
688
+ /** Keep billing and context distinct; omitted usage preserves the last snapshot. */
689
+ function applyAnthropicMessageDeltaUsage(target, usage, messageStartPromptUsage) {
690
+ if (!usage) return;
691
691
  const billedIterations = readAnthropicCompactionBilledUsage(usage.iterations);
692
692
  const inputTokens = readAnthropicUsageTokenCount(usage.input_tokens);
693
693
  const outputTokens = readAnthropicUsageTokenCount(usage.output_tokens);
@@ -225,7 +225,7 @@ export declare function readAnthropicPromptUsageSnapshot(usage: AnthropicUsagePa
225
225
  export declare function readLastAnthropicIterationUsage(usage: AnthropicUsagePayload): AnthropicIterationUsageResult;
226
226
  /** Record independent billing buckets without treating zero placeholders as context proof. */
227
227
  export declare function applyAnthropicMessageStartUsage(target: Usage, payload: AnthropicUsagePayload): AnthropicPromptUsageSnapshot | undefined;
228
- /** Keep cumulative billing separate from the final server-side iteration context. */
229
- export declare function applyAnthropicMessageDeltaUsage(target: Usage, payload: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
228
+ /** Keep billing and context distinct; omitted usage preserves the last snapshot. */
229
+ export declare function applyAnthropicMessageDeltaUsage(target: Usage, usage: AnthropicUsagePayload | undefined, messageStartPromptUsage: AnthropicPromptUsageSnapshot | undefined): void;
230
230
  //#endregion
231
231
  export { type AnthropicEffort, type AnthropicOptions, type AnthropicThinkingDisplay, bindsClaudeThinkingPrefix, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicServerCompactionPlan, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort };
@@ -1,5 +1,5 @@
1
1
  import { b as supportsClaudeNativeMaxEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, l as requiresClaudeMandatoryAdaptiveThinking, p as resolveClaudeNativeThinkingLevelMap, s as bindsClaudeThinkingPrefix, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort } from "../src-BhgSqnbz.mjs";
2
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-DhlhmyR6.mjs";
3
- import { B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, O as resolveAnthropicFallbackServingModelCost, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, T as CLAUDE_OPUS_FALLBACK_MODEL_COST, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, b as findActiveAnthropicToolTurnAssistantIndex, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as applyAnthropicRefusal, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "../anthropic-compaction-replay-B6sEzXhr.mjs";
4
- import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-BNeFhAh3.mjs";
3
+ import { B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, O as resolveAnthropicFallbackServingModelCost, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, T as CLAUDE_OPUS_FALLBACK_MODEL_COST, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, b as findActiveAnthropicToolTurnAssistantIndex, c as readAnthropicCacheWriteUsage, d as readLastAnthropicIterationUsage, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, k as applyAnthropicRefusal, l as readAnthropicPromptUsageSnapshot, m as projectAnthropicTools, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, s as applyAnthropicMessageStartUsage, u as readAnthropicUsageTokenCount, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "../anthropic-compaction-replay-DKGjPxYr.mjs";
4
+ import { n as streamAnthropic, r as streamSimpleAnthropic } from "../anthropic-Dhl0np0g.mjs";
5
5
  export { ANTHROPIC_CLAUDE_CODE_BILLING_SYSTEM_BLOCK, ANTHROPIC_CLAUDE_CODE_VERSION, ANTHROPIC_OMITTED_REASONING_TEXT, ANTHROPIC_SERVER_SIDE_FALLBACKS, ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, CLAUDE_OPUS_FALLBACK_MODEL_COST, applyAnthropicFallbackBoundary, applyAnthropicMessageDeltaUsage, applyAnthropicMessageStartUsage, applyAnthropicRefusal, applyAnthropicThinkingBindingControls, applyClaudeRequestContract, bindsClaudeThinkingPrefix, defaultsClaudeAdaptiveThinking, findActiveAnthropicToolTurnAssistantIndex, isAnthropicOAuthApiKey, logAnthropicThinkingDrops, mapAnthropicStopReason, normalizeAnthropicToolCallId, normalizeAnthropicToolChoice, omitFoundryBearerCredentialHeaders, prepareClaudeNoPrefillRequestContext, projectAnthropicTools, readAnthropicCacheWriteUsage, readAnthropicFallbackBoundary, readAnthropicInputTransformations, readAnthropicPromptUsageSnapshot, readAnthropicUsageTokenCount, readLastAnthropicIterationUsage, reconcileAnthropicToolChoice, requiresClaudeAdaptiveThinking, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveAnthropicFallbackServingModelCost, resolveAnthropicServerCompactionPlan, resolveAnthropicThinkingEffort, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, resolveModelBoundThinkingReplayMode, resolveOriginalAnthropicToolName, streamAnthropic, streamSimpleAnthropic, supportsClaudeAdaptiveThinking, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, toClaudeCodeToolName, usesClaudeFable5MessagesContract, usesClaudeStreamingRefusalContract, usesFoundryBearerAuth };
@@ -62,7 +62,7 @@ function createLazyRegistration(api, importModule, select) {
62
62
  };
63
63
  }
64
64
  const registerBuiltIns = [
65
- createLazyRegistration("anthropic-messages", () => import("./anthropic-BNeFhAh3.mjs").then((n) => n.t), (module) => ({
65
+ createLazyRegistration("anthropic-messages", () => import("./anthropic-Dhl0np0g.mjs").then((n) => n.t), (module) => ({
66
66
  stream: module.streamAnthropic,
67
67
  streamSimple: module.streamSimpleAnthropic
68
68
  })),
@@ -7,7 +7,7 @@ import { n as toErrorObject, t as createResponsesPromptEgressObserver } from "./
7
7
  import { a as asNonNegativeFiniteNumber } from "./base64-CEFBpSkN.mjs";
8
8
  import { n as uniqueStrings } from "./string-normalization--fwJ4S2q.mjs";
9
9
  import { r as resolveOpenAIResponsesCacheParams } from "./openai-prompt-cache-CGnVB74a.mjs";
10
- import { A as createAnthropicInlineImageBudget, B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, F as applyAnthropicPayloadPolicyToParams, I as resolveAnthropicEphemeralCacheControl, L as resolveAnthropicPayloadPolicy, M as resolveAnthropicImageMediaType, N as applyAnthropicCacheControlToMessages, O as resolveAnthropicFallbackServingModelCost, P as applyAnthropicEphemeralCacheControlMarkers, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as findActiveAnthropicToolTurnAssistantIndex, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, i as resolveNewestAnthropicCompaction, j as normalizeAnthropicInlineContent, k as applyAnthropicRefusal, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "./anthropic-compaction-replay-B6sEzXhr.mjs";
10
+ import { A as createAnthropicInlineImageBudget, B as omitFoundryBearerCredentialHeaders, C as ANTHROPIC_SERVER_SIDE_FALLBACKS, D as readAnthropicFallbackBoundary, E as applyAnthropicFallbackBoundary, F as applyAnthropicPayloadPolicyToParams, I as resolveAnthropicEphemeralCacheControl, L as resolveAnthropicPayloadPolicy, M as resolveAnthropicImageMediaType, N as applyAnthropicCacheControlToMessages, O as resolveAnthropicFallbackServingModelCost, P as applyAnthropicEphemeralCacheControlMarkers, R as resolveAnthropicServerCompactionPlan, S as readAnthropicInputTransformations, V as usesFoundryBearerAuth, _ as toClaudeCodeToolName, a as suppressAnthropicCompaction, b as findActiveAnthropicToolTurnAssistantIndex, f as normalizeAnthropicToolCallId, g as resolveOriginalAnthropicToolName, h as reconcileAnthropicToolChoice, i as resolveNewestAnthropicCompaction, j as normalizeAnthropicInlineContent, k as applyAnthropicRefusal, m as projectAnthropicTools, n as createCompactionCapture, o as applyAnthropicMessageDeltaUsage, p as normalizeAnthropicToolChoice, r as isAnthropicReplayRejection, s as applyAnthropicMessageStartUsage, t as buildAnthropicReplayPlan, v as ANTHROPIC_OMITTED_REASONING_TEXT, w as ANTHROPIC_SERVER_SIDE_FALLBACK_BETA, x as logAnthropicThinkingDrops, y as applyAnthropicThinkingBindingControls, z as isAnthropicOAuthApiKey } from "./anthropic-compaction-replay-DKGjPxYr.mjs";
11
11
  import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
12
12
  import { a as codeModeToolSurfaceObserver, d as stripSystemPromptCacheBoundary, m as sortPromptCacheToolsByName, o as reasoningTagTextPolicy, t as adjustMaxTokensForThinking } from "./simple-options-Bwi0x0bX.mjs";
13
13
  import { a as resolveProviderEndpoint, c as transformTransportMessages, i as resolveOpenAIStrictToolSetting, n as buildGuardedModelFetch } from "./tool-schema-json-projection-_gcOC21Y.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/ai",
3
- "version": "2026.8.33",
3
+ "version": "2026.8.34",
4
4
  "description": "Reusable model provider adapters and streaming runtime from OpenClaw",
5
5
  "keywords": [
6
6
  "ai",