@openclaw/ai 2026.8.1-beta.3 → 2026.9.1-beta.1

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 (79) hide show
  1. package/dist/{anthropic-B8KwTtlb.mjs → anthropic-DI4PZKKB.mjs} +18 -16
  2. package/dist/{anthropic-compaction-replay-4Zx7-aCr.mjs → anthropic-compaction-replay-nhKaCXu6.mjs} +8 -12
  3. package/dist/{anthropic-payload-policy-CSx7MoKH.d.mts → anthropic-payload-policy-B_0n0enE.d.mts} +2 -1
  4. package/dist/{api-registry-DFxSnFqG.d.mts → api-registry-CTd8NzcD.d.mts} +2 -1
  5. package/dist/{azure-openai-responses-Aa4mVcYG.mjs → azure-openai-responses-D8dI0ekg.mjs} +3 -3
  6. package/dist/diagnostics.d.mts +0 -1
  7. package/dist/diagnostics.mjs +1 -1
  8. package/dist/event-stream-BKp4fOt_.d.mts +1 -0
  9. package/dist/{event-stream-D91-ohD_.d.mts → event-stream-LiXePESD.d.mts} +1 -2
  10. package/dist/event-stream.d.mts +2 -1
  11. package/dist/{google-yDRnipeq.mjs → google-Od-LLdVK.mjs} +3 -3
  12. package/dist/{google-shared-M1dl64nz.mjs → google-shared-Bgr9lFPw.mjs} +14 -7
  13. package/dist/{google-vertex-DCJHM_a5.mjs → google-vertex-aerRSXc4.mjs} +4 -4
  14. package/dist/{host-DF_yxOsA.mjs → host-D51fmkH6.mjs} +4 -8
  15. package/dist/{host-DJq_FGcz.d.mts → host-DsbPMFU6.d.mts} +3 -3
  16. package/dist/index-Qbej8io0.d.mts +3 -0
  17. package/dist/index.d.mts +6 -6
  18. package/dist/index.mjs +2 -3
  19. package/dist/internal/anthropic.d.mts +5 -4
  20. package/dist/internal/anthropic.mjs +4 -4
  21. package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
  22. package/dist/internal/openai-responses-payload-policy.mjs +2 -2
  23. package/dist/internal/openai.d.mts +5 -5
  24. package/dist/internal/openai.mjs +8 -7
  25. package/dist/internal/runtime.d.mts +16 -5
  26. package/dist/internal/runtime.mjs +6 -6
  27. package/dist/internal/shared.d.mts +2 -2
  28. package/dist/internal/shared.mjs +3 -3
  29. package/dist/{json-parse-CDnesDM_.mjs → json-parse-BuAJEbdW.mjs} +18 -2
  30. package/dist/{mistral-D6hRXI7A.mjs → mistral-EiHdymeb.mjs} +17 -21
  31. package/dist/{openai-chatgpt-responses-C339VIfT.mjs → openai-chatgpt-responses-DHpF9o1e.mjs} +28 -11
  32. package/dist/openai-completions-EFPiUGfS.mjs +399 -0
  33. package/dist/{openai-completions-compat-B0KTleXp.d.mts → openai-completions-compat-BefmHT26.d.mts} +3 -3
  34. package/dist/openai-completions-stream-DUlGwRMz.mjs +1621 -0
  35. package/dist/{openai-responses-BXEcr-Tp.mjs → openai-responses-BogP8OjX.mjs} +6 -5
  36. package/dist/{openai-responses-contracts-CD75pQ0m.d.mts → openai-responses-contracts-Dvj_UtPy.d.mts} +3 -3
  37. package/dist/{openai-responses-contracts-DvILoqBk.mjs → openai-responses-contracts-QUY12X0B.mjs} +4 -18
  38. package/dist/{openai-responses-payload-policy-BDo8CQsx.mjs → openai-responses-payload-policy-D8EdimYe.mjs} +3 -7
  39. package/dist/{openai-responses-prompt-observer-internal-BG-1AsBI.mjs → openai-responses-prompt-observer-internal-Cd4hJG-S.mjs} +3 -2
  40. package/dist/{openai-responses-shared-Cvt5MgEm.mjs → openai-responses-shared-DJThc6jW.mjs} +150 -1362
  41. package/dist/openai-stop-reason-Drnn_6Qj.mjs +28 -0
  42. package/dist/openai-tool-schema-ho-hIkQf.mjs +1695 -0
  43. package/dist/{provider-error-C8mBRJDl.mjs → provider-error-DDOs_Bz0.mjs} +1 -3
  44. package/dist/{provider-options-Cc5ZQ6Aa.d.mts → provider-options-MdMBLzlU.d.mts} +4 -3
  45. package/dist/{provider-transcript-transform--gtf0ZbR.mjs → provider-transcript-transform-C01bQ5a3.mjs} +1 -1
  46. package/dist/provider-types.d.mts +5 -3
  47. package/dist/providers.d.mts +1 -2
  48. package/dist/providers.mjs +9 -9
  49. package/dist/{sanitize-unicode-BP7HLLZn.mjs → sanitize-unicode-DCkltN94.mjs} +1 -2
  50. package/dist/simple-options-CFj7x3J4.mjs +118 -0
  51. package/dist/{anthropic-BQXQudmA.mjs → src-Bu3FiFAG.mjs} +1 -0
  52. package/dist/{streaming-byte-guard-BrbkbwUu.mjs → streaming-byte-guard-CC-HMn_u.mjs} +5 -6
  53. package/dist/string-normalization--fwJ4S2q.mjs +16 -0
  54. package/dist/{tool-schema-json-projection-FEr-jOoZ.mjs → tool-schema-json-projection-qvTEs5Am.mjs} +2 -2
  55. package/dist/{simple-options-oqsXB6U3.mjs → transport-stream-shared-ljShVIZB.mjs} +10 -118
  56. package/dist/transport-stream-shared-rvaCyFYt.d.mts +138 -0
  57. package/dist/{transport-utils-Bv0FHkd0.mjs → transport-utils-LJ1_rbi-.mjs} +8 -5
  58. package/dist/transports.d.mts +23 -117
  59. package/dist/transports.mjs +43 -1038
  60. package/dist/{types-DTAP49HF.d.mts → types-DhLoJbFm.d.mts} +34 -17
  61. package/dist/types-GiAjXatj.d.mts +1 -0
  62. package/dist/types.d.mts +4 -3
  63. package/dist/types.mjs +1 -2
  64. package/dist/utf16-slice-qz3nsy87.mjs +84 -0
  65. package/dist/{validation-DYNNrU9u.d.mts → validation-Dk7q7NMN.d.mts} +1 -2
  66. package/dist/validation.d.mts +1 -1
  67. package/package.json +5 -5
  68. package/dist/event-stream-BVVgDSdq.d.mts +0 -1
  69. package/dist/headers-B_e4-1J0.mjs +0 -9
  70. package/dist/index-BVVgDSdq.d.mts +0 -1
  71. package/dist/openai-completions-D88orSJ9.mjs +0 -632
  72. package/dist/openai-stop-reason-9OONKyAm.mjs +0 -579
  73. package/dist/openai-tool-projection-CHGLt03m.mjs +0 -426
  74. package/dist/record-coerce-DdXsgUd_.mjs +0 -23
  75. package/dist/src-D2H6yKkH.mjs +0 -2
  76. package/dist/stream-first-event-timeout-DvDeSucC.d.mts +0 -29
  77. package/dist/string-coerce-fsri9iCu.mjs +0 -34
  78. package/dist/types-BVVgDSdq.d.mts +0 -1
  79. package/dist/utf16-slice-CvGodqok.mjs +0 -29
@@ -1,6 +1,5 @@
1
1
  import { t as AssistantMessageDiagnostic } from "./diagnostics-BaTA9eVl.mjs";
2
2
  import { TSchema } from "typebox";
3
-
4
3
  //#region packages/llm-core/src/types.d.ts
5
4
  /** Provider API families with first-class request/stream adapters in OpenClaw. */
6
5
  type KnownApi = "openai-completions" | "mistral-conversations" | "openai-responses" | "azure-openai-responses" | "openai-chatgpt-responses" | "anthropic-messages" | "bedrock-converse-stream" | "google-generative-ai" | "google-vertex";
@@ -251,7 +250,8 @@ interface Usage {
251
250
  output: number;
252
251
  cacheRead: number;
253
252
  cacheWrite: number;
254
- total: number; /** Provenance for the recorded total cost; provider-billed totals are authoritative. */
253
+ total: number;
254
+ /** Provenance for the recorded total cost; provider-billed totals are authoritative. */
255
255
  totalOrigin?: "provider-billed";
256
256
  };
257
257
  }
@@ -290,8 +290,10 @@ interface AssistantMessage {
290
290
  openclawDelivery?: {
291
291
  audioAsVoice?: true;
292
292
  replyToCurrent?: true;
293
- replyToId?: string; /** Provider text phase is unresolved until the assistant turn reaches terminal state. */
294
- textPhaseRequiresTerminal?: true; /** Parsed once at the assistant write boundary; delivery resolves policy from these facts. */
293
+ replyToId?: string;
294
+ /** Provider text phase is unresolved until the assistant turn reaches terminal state. */
295
+ textPhaseRequiresTerminal?: true;
296
+ /** Parsed once at the assistant write boundary; delivery resolves policy from these facts. */
295
297
  tts?: AssistantDeliveryTtsFacts;
296
298
  };
297
299
  api: Api;
@@ -371,13 +373,13 @@ type AssistantMessageEvent = {
371
373
  type: "text_start";
372
374
  contentIndex: number;
373
375
  partial: AssistantMessage;
374
- }
376
+ } |
375
377
  /**
376
378
  * Plain text deltas may omit `partial` to avoid retaining one full assistant
377
379
  * snapshot per token. Consumers that need current text should replay `delta`
378
380
  * from the latest start/end partial checkpoint.
379
381
  */
380
- | {
382
+ {
381
383
  type: "text_delta";
382
384
  contentIndex: number;
383
385
  delta: string;
@@ -549,29 +551,44 @@ interface OpenRouterRouting {
549
551
  quantizations?: string[];
550
552
  /** Sorting strategy. Can be a string (e.g., "price", "throughput", "latency") or an object with `by` and `partition`. */
551
553
  sort?: string | {
552
- /** The sorting metric: "price", "throughput", "latency". */by?: string; /** Partitioning strategy: "model" (default) or "none". */
554
+ /** The sorting metric: "price", "throughput", "latency". */
555
+ by?: string;
556
+ /** Partitioning strategy: "model" (default) or "none". */
553
557
  partition?: string | null;
554
558
  };
555
559
  /** Maximum price per million tokens (USD). */
556
560
  max_price?: {
557
- /** Price per million prompt tokens. */prompt?: number | string; /** Price per million completion tokens. */
558
- completion?: number | string; /** Price per image. */
559
- image?: number | string; /** Price per audio unit. */
560
- audio?: number | string; /** Price per request. */
561
+ /** Price per million prompt tokens. */
562
+ prompt?: number | string;
563
+ /** Price per million completion tokens. */
564
+ completion?: number | string;
565
+ /** Price per image. */
566
+ image?: number | string;
567
+ /** Price per audio unit. */
568
+ audio?: number | string;
569
+ /** Price per request. */
561
570
  request?: number | string;
562
571
  };
563
572
  /** Preferred minimum throughput (tokens/second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
564
573
  preferred_min_throughput?: number | {
565
- /** Minimum tokens/second at the 50th percentile. */p50?: number; /** Minimum tokens/second at the 75th percentile. */
566
- p75?: number; /** Minimum tokens/second at the 90th percentile. */
567
- p90?: number; /** Minimum tokens/second at the 99th percentile. */
574
+ /** Minimum tokens/second at the 50th percentile. */
575
+ p50?: number;
576
+ /** Minimum tokens/second at the 75th percentile. */
577
+ p75?: number;
578
+ /** Minimum tokens/second at the 90th percentile. */
579
+ p90?: number;
580
+ /** Minimum tokens/second at the 99th percentile. */
568
581
  p99?: number;
569
582
  };
570
583
  /** Preferred maximum latency (seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
571
584
  preferred_max_latency?: number | {
572
- /** Maximum latency in seconds at the 50th percentile. */p50?: number; /** Maximum latency in seconds at the 75th percentile. */
573
- p75?: number; /** Maximum latency in seconds at the 90th percentile. */
574
- p90?: number; /** Maximum latency in seconds at the 99th percentile. */
585
+ /** Maximum latency in seconds at the 50th percentile. */
586
+ p50?: number;
587
+ /** Maximum latency in seconds at the 75th percentile. */
588
+ p75?: number;
589
+ /** Maximum latency in seconds at the 90th percentile. */
590
+ p90?: number;
591
+ /** Maximum latency in seconds at the 99th percentile. */
575
592
  p99?: number;
576
593
  };
577
594
  }
@@ -0,0 +1 @@
1
+ import "./index-Qbej8io0.mjs";
package/dist/types.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-BECQCNdF.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 Transport, A as OpenAIResponsesCompat, B as StopReason, C as KnownImagesApi, D as Model, E as Message, F as ProviderImagesOptions, G as TextSignatureV1, H as StreamFunction, I as ProviderReplayState, J as ThinkingLevel, K as ThinkingBudgets, L as ProviderResponse, M as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, N as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, O as ModelThinkingLevel, P as Provider, Q as ToolResultMessage, R as ProviderStreamOptions, S as KnownApi, T as MaybePromise, U as StreamOptions, V as StreamFn, W as TextContent, X as Tool, Y as ThinkingLevelMap, Z as ToolCall, _ as ImagesModel, a as AssistantMessage, b as ImagesProvider, c as AssistantMessageEventStreamLike, d as Context, et as Usage, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, j as OpenRouterRouting, k as OpenAICompletionsCompat, l as CacheRetention, m as ImagesContext, n as Api, nt as ValidateToolArgumentsFn, o as AssistantMessageEvent, p as ImagesApi, q as ThinkingContent, r as AssistantDeliveryTtsFacts, rt as VercelGatewayRouting, s as AssistantMessageEventStreamContract, t as AnthropicMessagesCompat, tt as UserMessage, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as SimpleStreamOptions } from "./types-DTAP49HF.mjs";
4
- import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-D91-ohD_.mjs";
5
- import { n as validateToolCall, t as validateToolArguments } from "./validation-DYNNrU9u.mjs";
3
+ import { $ as Transport, A as OpenAIResponsesCompat, B as StopReason, C as KnownImagesApi, D as Model, E as Message, F as ProviderImagesOptions, G as TextSignatureV1, H as StreamFunction, I as ProviderReplayState, J as ThinkingLevel, K as ThinkingBudgets, L as ProviderResponse, M as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, N as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, O as ModelThinkingLevel, P as Provider, Q as ToolResultMessage, R as ProviderStreamOptions, S as KnownApi, T as MaybePromise, U as StreamOptions, V as StreamFn, W as TextContent, X as Tool, Y as ThinkingLevelMap, Z as ToolCall, _ as ImagesModel, a as AssistantMessage, b as ImagesProvider, c as AssistantMessageEventStreamLike, d as Context, et as Usage, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, j as OpenRouterRouting, k as OpenAICompletionsCompat, l as CacheRetention, m as ImagesContext, n as Api, nt as ValidateToolArgumentsFn, o as AssistantMessageEvent, p as ImagesApi, q as ThinkingContent, r as AssistantDeliveryTtsFacts, rt as VercelGatewayRouting, s as AssistantMessageEventStreamContract, t as AnthropicMessagesCompat, tt as UserMessage, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as SimpleStreamOptions } from "./types-DhLoJbFm.mjs";
4
+ import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-LiXePESD.mjs";
5
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-Dk7q7NMN.mjs";
6
+ import "./types-GiAjXatj.mjs";
6
7
  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, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
package/dist/types.mjs CHANGED
@@ -1,7 +1,6 @@
1
- import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./anthropic-BQXQudmA.mjs";
1
+ import { a as requiresClaudeMandatoryAdaptiveThinking, c as resolveClaudeMythos5ModelIdentity, d as resolveClaudeSonnet5ModelIdentity, f as supportsClaude1MContext, g as supportsClaudeNativeXhighEffort, h as supportsClaudeNativeMaxEffort, i as requiresClaudeDefaultSampling, l as resolveClaudeNativeThinkingLevelMap, m as supportsClaudeFastMode, n as CLAUDE_OPUS_5_THINKING_PROFILE, o as resolveClaudeFable5ModelIdentity, p as supportsClaudeAdaptiveThinking, r as CLAUDE_SONNET_5_THINKING_PROFILE, s as resolveClaudeModelIdentity, t as CLAUDE_FABLE_5_THINKING_PROFILE, u as resolveClaudeOpus5ModelIdentity } from "./src-Bu3FiFAG.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
5
  import { n as validateToolCall, t as validateToolArguments } from "./validation-B61OhAio.mjs";
6
- import "./src-D2H6yKkH.mjs";
7
6
  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, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
@@ -0,0 +1,84 @@
1
+ //#region packages/normalization-core/src/string-coerce.ts
2
+ /** Reads a value only when it is already a string, preserving whitespace. */
3
+ function readStringValue(value) {
4
+ return typeof value === "string" ? value : void 0;
5
+ }
6
+ /** Trims string input and returns null for non-strings or empty strings. */
7
+ function normalizeNullableString(value) {
8
+ if (typeof value !== "string") return null;
9
+ const trimmed = value.trim();
10
+ return trimmed ? trimmed : null;
11
+ }
12
+ /** Trims string input and returns undefined for non-strings or empty strings. */
13
+ function normalizeOptionalString(value) {
14
+ return normalizeNullableString(value) ?? void 0;
15
+ }
16
+ /** Stringifies primitive ids/flags before applying optional string normalization. */
17
+ function normalizeStringifiedOptionalString(value) {
18
+ if (typeof value === "string") return normalizeOptionalString(value);
19
+ if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return normalizeOptionalString(String(value));
20
+ }
21
+ /** Lowercases a normalized optional string. */
22
+ function normalizeOptionalLowercaseString(value) {
23
+ return normalizeOptionalString(value)?.toLowerCase();
24
+ }
25
+ /** Lowercases a normalized string or returns an empty string when absent. */
26
+ function normalizeLowercaseStringOrEmpty(value) {
27
+ return normalizeOptionalLowercaseString(value) ?? "";
28
+ }
29
+ /** Type guard for strings that remain non-empty after trimming. */
30
+ function hasNonEmptyString(value) {
31
+ return normalizeOptionalString(value) !== void 0;
32
+ }
33
+ //#endregion
34
+ //#region packages/normalization-core/src/record-coerce.ts
35
+ /** Type guard for non-array object records at browser-safe boundaries. */
36
+ function isRecord(value) {
37
+ return value !== null && typeof value === "object" && !Array.isArray(value);
38
+ }
39
+ /** Returns a non-array record or undefined. */
40
+ function asOptionalRecord(value) {
41
+ return isRecord(value) ? value : void 0;
42
+ }
43
+ /** Returns a non-array record or a fresh ordinary empty record. */
44
+ function asNonArrayRecord(value) {
45
+ return asOptionalRecord(value) ?? {};
46
+ }
47
+ /** Returns a non-array record or null. */
48
+ function asNullableRecord(value) {
49
+ return isRecord(value) ? value : null;
50
+ }
51
+ /** Returns any object-backed record, including arrays, or undefined. */
52
+ function asOptionalObjectRecord(value) {
53
+ return value && typeof value === "object" ? value : void 0;
54
+ }
55
+ //#endregion
56
+ //#region packages/normalization-core/src/utf16-slice.ts
57
+ function isHighSurrogate(codeUnit) {
58
+ return codeUnit >= 55296 && codeUnit <= 56319;
59
+ }
60
+ function isLowSurrogate(codeUnit) {
61
+ return codeUnit >= 56320 && codeUnit <= 57343;
62
+ }
63
+ /** Slices a UTF-16 string without returning dangling surrogate halves at either edge. */
64
+ function sliceUtf16Safe(input, start, end) {
65
+ const len = input.length;
66
+ let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
67
+ let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
68
+ if (to <= from) return "";
69
+ if (from > 0 && from < len) {
70
+ if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
71
+ }
72
+ if (to > 0 && to < len) {
73
+ if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
74
+ }
75
+ return input.slice(from, to);
76
+ }
77
+ /** Truncates a UTF-16 string without cutting a surrogate pair in half. */
78
+ function truncateUtf16Safe(input, maxLen) {
79
+ const limit = Math.max(0, Math.floor(maxLen));
80
+ if (input.length <= limit) return input;
81
+ return sliceUtf16Safe(input, 0, limit);
82
+ }
83
+ //#endregion
84
+ export { asOptionalRecord as a, normalizeLowercaseStringOrEmpty as c, normalizeOptionalString as d, normalizeStringifiedOptionalString as f, asOptionalObjectRecord as i, normalizeNullableString as l, asNonArrayRecord as n, isRecord as o, readStringValue as p, asNullableRecord as r, hasNonEmptyString as s, truncateUtf16Safe as t, normalizeOptionalLowercaseString as u };
@@ -1,5 +1,4 @@
1
- import { X as Tool, Z as ToolCall } from "./types-DTAP49HF.mjs";
2
-
1
+ import { X as Tool, Z as ToolCall } from "./types-DhLoJbFm.mjs";
3
2
  //#region packages/llm-core/src/validation.d.ts
4
3
  /** Finds the target tool and validates/coerces a model-emitted tool call. */
5
4
  declare function validateToolCall(tools: Tool[], toolCall: ToolCall): unknown;
@@ -1,2 +1,2 @@
1
- import { n as validateToolCall, t as validateToolArguments } from "./validation-DYNNrU9u.mjs";
1
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-Dk7q7NMN.mjs";
2
2
  export { validateToolArguments, validateToolCall };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/ai",
3
- "version": "2026.8.1-beta.3",
3
+ "version": "2026.9.1-beta.1",
4
4
  "description": "Reusable model provider adapters and streaming runtime from OpenClaw",
5
5
  "keywords": [
6
6
  "ai",
@@ -103,12 +103,12 @@
103
103
  }
104
104
  },
105
105
  "dependencies": {
106
- "@anthropic-ai/sdk": "0.115.0",
107
- "@google/genai": "2.13.0",
106
+ "@anthropic-ai/sdk": "0.118.0",
107
+ "@google/genai": "2.17.1",
108
108
  "@mistralai/mistralai": "2.5.0",
109
- "openai": "6.49.0",
109
+ "openai": "7.5.0",
110
110
  "partial-json": "0.1.7",
111
- "typebox": "1.3.6"
111
+ "typebox": "1.3.16"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@openclaw/model-catalog-core": "0.0.0-private",
@@ -1 +0,0 @@
1
- export { };
@@ -1,9 +0,0 @@
1
- //#region packages/ai/src/utils/headers.ts
2
- /** Converts a Headers object to a plain record for provider request handling. */
3
- function headersToRecord(headers) {
4
- const result = {};
5
- for (const [key, value] of headers.entries()) result[key] = value;
6
- return result;
7
- }
8
- //#endregion
9
- export { headersToRecord as t };
@@ -1 +0,0 @@
1
- export { };