@openclaw/ai 2026.9.2 → 2026.9.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 (115) hide show
  1. package/README.md +3 -2
  2. package/dist/anthropic-C4Qu4H0Z.mjs +377 -0
  3. package/dist/{anthropic-payload-policy-d46X2pR0.d.mts → anthropic-payload-policy-BZ8umAbk.d.mts} +16 -6
  4. package/dist/{anthropic-compaction-replay-DB2FGLQc.mjs → anthropic-stream-reducer-CILWF7JD.mjs} +931 -184
  5. package/dist/{api-registry-DWtPjzyn.d.mts → api-registry-ByUwIR0e.d.mts} +2 -2
  6. package/dist/assistant-output-tLt4H-iQ.mjs +16 -0
  7. package/dist/assistant-text-phase-C20rxWwP.mjs +55 -0
  8. package/dist/{azure-openai-responses-C5bZRfAP.mjs → azure-openai-responses-BAlqlKKc.mjs} +5 -5
  9. package/dist/{base64-CEFBpSkN.mjs → base64-D-su8YVo.mjs} +1 -27
  10. package/dist/{diagnostics-DfFyKeX_.mjs → diagnostics-QuErwCIl.mjs} +96 -21
  11. package/dist/diagnostics.d.mts +3 -1
  12. package/dist/diagnostics.mjs +3 -3
  13. package/dist/{event-stream-BhT5T1Ay.d.mts → event-stream-Bt5Y4Pav.d.mts} +11 -3
  14. package/dist/event-stream-C3WGFsum.d.mts +1 -0
  15. package/dist/{event-stream-BgDvQeum.mjs → event-stream-D8PARQfL.mjs} +45 -1
  16. package/dist/event-stream.d.mts +2 -2
  17. package/dist/event-stream.mjs +1 -1
  18. package/dist/{github-copilot-headers-NCJtz9i0.mjs → github-copilot-headers-B37TB3rB.mjs} +3 -10
  19. package/dist/github-copilot-request-facts-BTEBMeOv.mjs +16 -0
  20. package/dist/{google-4qeuE8iX.mjs → google-DPBAOaOW.mjs} +10 -10
  21. package/dist/google-messages-6JkpHrhJ.mjs +448 -0
  22. package/dist/google-shared-BvBeW9aq.mjs +185 -0
  23. package/dist/{google-vertex-O9BcnB6X.mjs → google-vertex-k-TMCAYD.mjs} +7 -6
  24. package/dist/{host-DjzGmdZ2.d.mts → host-4atIX-2V.d.mts} +5 -3
  25. package/dist/{host-CEvLw30U.mjs → host-B8YfDGd4.mjs} +181 -41
  26. package/dist/host-policy-Zcg_cNz8.mjs +37 -0
  27. package/dist/{index-FnHM2FcI.d.mts → index-DdD3qerf.d.mts} +4 -4
  28. package/dist/index.d.mts +7 -7
  29. package/dist/index.mjs +7 -6
  30. package/dist/internal/anthropic.d.mts +7 -7
  31. package/dist/internal/anthropic.mjs +4 -4
  32. package/dist/internal/google-model-family.d.mts +5 -0
  33. package/dist/internal/google-model-family.mjs +15 -0
  34. package/dist/internal/openai-responses-payload-policy.d.mts +3 -3
  35. package/dist/internal/openai-responses-payload-policy.mjs +3 -2
  36. package/dist/internal/openai.d.mts +8 -103
  37. package/dist/internal/openai.mjs +9 -10
  38. package/dist/internal/retry-after.d.mts +2 -4
  39. package/dist/internal/retry-after.mjs +57 -8
  40. package/dist/internal/runtime.d.mts +43 -7
  41. package/dist/internal/runtime.mjs +6 -7
  42. package/dist/internal/shared.d.mts +43 -3
  43. package/dist/internal/shared.mjs +5 -4
  44. package/dist/internal/tool-schema.d.mts +63 -0
  45. package/dist/internal/tool-schema.mjs +3 -0
  46. package/dist/{mistral-Tb6oalqH.mjs → mistral-CxUZ1jUb.mjs} +10 -37
  47. package/dist/model-transport-url-DKocrEsb.d.mts +28 -0
  48. package/dist/{openai-chatgpt-responses-yUXjPNfu.mjs → openai-chatgpt-responses-CgO6kZfo.mjs} +50 -41
  49. package/dist/{openai-completions-compat-CpjYUArk.d.mts → openai-completions-compat-eHgh5UPE.d.mts} +26 -4
  50. package/dist/{openai-completions-stream-BsrBe3Gg.mjs → openai-completions-stream-Da2vvl-S.mjs} +654 -453
  51. package/dist/openai-completions-yJuk7eis.mjs +187 -0
  52. package/dist/openai-prompt-cache-B4eYo2-I.d.mts +16 -0
  53. package/dist/openai-prompt-cache-Bds-n_9Q.mjs +220 -0
  54. package/dist/openai-provider-client-S2gCrM2Z.mjs +24 -0
  55. package/dist/{openai-responses-CCL41ALM.mjs → openai-responses-DaYwH05E.mjs} +14 -29
  56. package/dist/{openai-responses-compaction-window-BMVHFOtq.mjs → openai-responses-compaction-window-CIhBAkkq.mjs} +6 -246
  57. package/dist/{openai-responses-contracts-rF5DDRNS.d.mts → openai-responses-contracts-BjBAqAg_.d.mts} +5 -38
  58. package/dist/openai-responses-contracts-DDOHA62Y.mjs +245 -0
  59. package/dist/{openai-responses-prompt-observer-internal-D0bhBfgL.mjs → openai-responses-prompt-observer-internal-f8J7wpsk.mjs} +3 -3
  60. package/dist/{openai-responses-shared-Bmma_3Qc.mjs → openai-responses-shared-B8RdBPCv.mjs} +47 -118
  61. package/dist/openai-tool-projection-793cE3QX.d.mts +37 -0
  62. package/dist/{openai-tool-schema-_pTAJqKF.mjs → openai-tool-schema-CzjyYXun.mjs} +38 -556
  63. package/dist/openai-tool-schema-ynZBgqW-.d.mts +38 -0
  64. package/dist/openai-transport-params-9aPuV5YY.mjs +675 -0
  65. package/dist/positive-integer-41zhOdcV.mjs +8 -0
  66. package/dist/{provider-error-9TraxGvt.mjs → provider-error-BA-v_tKd.mjs} +70 -11
  67. package/dist/{provider-options-Bcc_p-TU.d.mts → provider-options-Ceqv1OKk.d.mts} +4 -39
  68. package/dist/{provider-replay-context-BuSUaAk5.mjs → provider-replay-context-CJ_YvcEW.mjs} +1 -1
  69. package/dist/{provider-transcript-transform-BaMbI1hr.mjs → provider-transcript-transform-V5YzU9zh.mjs} +1 -1
  70. package/dist/provider-transport-turn-state-D5EXOFL2.mjs +42 -0
  71. package/dist/provider-types-CVjKjsuq.d.mts +29 -0
  72. package/dist/provider-types.d.mts +6 -31
  73. package/dist/providers.d.mts +2 -2
  74. package/dist/providers.mjs +11 -11
  75. package/dist/{reasoning-tag-text-partitioner-DLCNXki6.mjs → reasoning-tag-text-partitioner-BcR5pztD.mjs} +19 -19
  76. package/dist/record-coerce-DwRYMj3t.mjs +32 -0
  77. package/dist/retry-after-CdCURCVg.d.mts +15 -0
  78. package/dist/session-affinity-Bcunsn4I.mjs +23 -0
  79. package/dist/{simple-options-BjHCCh4v.mjs → simple-options-BQbb4yQL.mjs} +24 -5
  80. package/dist/src-DDmEryvj.mjs +2 -0
  81. package/dist/{stream-first-event-timeout-DcNjoFQE.mjs → stream-first-event-timeout-2hfrquuz.mjs} +1 -1
  82. package/dist/string-coerce-fsri9iCu.mjs +34 -0
  83. package/dist/{string-normalization--fwJ4S2q.mjs → string-normalization-CmLIasuf.mjs} +1 -1
  84. package/dist/{tool-schema-json-projection-mJhXDcyz.mjs → tool-schema-json-projection-ClptDdAO.mjs} +2 -38
  85. package/dist/{transport-stream-shared-xnaqxmbP.d.mts → transport-stream-shared-DNvmoWnv.d.mts} +20 -36
  86. package/dist/{transport-stream-shared-CZqMhfIw.mjs → transport-stream-shared-zHll9BxO.mjs} +225 -13
  87. package/dist/transport-utils-zrYjICLZ.mjs +118 -0
  88. package/dist/transports.d.mts +137 -193
  89. package/dist/transports.mjs +204 -1334
  90. package/dist/types-DlfwzH3T.d.mts +1 -0
  91. package/dist/types-LFWwv0cF.mjs +8 -0
  92. package/dist/{types-CJ1-Ht7A.d.mts → types-Ntv5z2g2.d.mts} +74 -57
  93. package/dist/types.d.mts +6 -6
  94. package/dist/types.mjs +6 -5
  95. package/dist/{src-2qBGKg8O.mjs → usage-cost-BNWbbXav.mjs} +0 -1
  96. package/dist/utf16-slice-CvGodqok.mjs +29 -0
  97. package/dist/{validation-AKZBDGQd.d.mts → validation-B0t_G2H6.d.mts} +1 -1
  98. package/dist/{validation-CJZtym2g.mjs → validation-BDzVDnTs.mjs} +9 -1
  99. package/dist/validation.d.mts +1 -1
  100. package/dist/validation.mjs +1 -1
  101. package/package.json +13 -3
  102. package/dist/anthropic-BDdqdVLK.mjs +0 -886
  103. package/dist/event-stream-zctLx0yr.d.mts +0 -1
  104. package/dist/google-shared-CWeG8RIl.mjs +0 -636
  105. package/dist/google-thinking-level-C-V3tecN.mjs +0 -9
  106. package/dist/hash-CHgqbJmD.mjs +0 -16
  107. package/dist/json-parse-BuAJEbdW.mjs +0 -146
  108. package/dist/openai-completions-BIUV3RDT.mjs +0 -403
  109. package/dist/openai-prompt-cache-CGnVB74a.mjs +0 -21
  110. package/dist/openai-prompt-cache-CNoIfHYC.d.mts +0 -16
  111. package/dist/sanitize-unicode-D6xUvZaS.mjs +0 -83
  112. package/dist/transport-utils-7il795_9.mjs +0 -138
  113. package/dist/types-3Lnm-QSJ.d.mts +0 -1
  114. package/dist/types-BDdaOVi2.mjs +0 -6
  115. package/dist/utf16-slice-qz3nsy87.mjs +0 -84
@@ -0,0 +1 @@
1
+ import "./index-DdD3qerf.mjs";
@@ -0,0 +1,8 @@
1
+ //#region packages/llm-core/src/types.ts
2
+ /** Stable error codes for provider outcomes that cannot be replayed safely. */
3
+ const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
4
+ const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
5
+ /** Pre-dispatch argument rejection; callers still enforce output and effect guards. */
6
+ const MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE = "malformed_tool_call_arguments";
7
+ //#endregion
8
+ export { PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as n, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as r, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE as t };
@@ -1,5 +1,64 @@
1
1
  import { t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
2
2
  import { TSchema } from "typebox";
3
+ //#region packages/llm-core/src/model-data.d.ts
4
+ declare const MODEL_DATA_THINKING_FORMATS: readonly ["openai", "openrouter", "deepseek", "together", "qwen", "qwen-chat-template", "zai"];
5
+ type ModelDataThinkingFormat = (typeof MODEL_DATA_THINKING_FORMATS)[number];
6
+ declare const MODEL_DATA_THINKING_LEVELS: readonly ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
7
+ type ModelDataThinkingLevel = (typeof MODEL_DATA_THINKING_LEVELS)[number];
8
+ type ModelDataThinkingLevelMap = Partial<Record<ModelDataThinkingLevel, string | null>>;
9
+ type ModelDataImageInputConfig = {
10
+ /** Provider-documented maximum encoded image payload size. */
11
+ maxBytes?: number;
12
+ /** Provider-documented maximum accepted input pixels. */
13
+ maxPixels?: number;
14
+ /** Provider-documented maximum accepted width/height in pixels. */
15
+ maxSidePx?: number;
16
+ /** Preferred resize side for the default balanced compression policy. */
17
+ preferredSidePx?: number;
18
+ /** Token accounting style, used as documentation for provider-owned policy. */
19
+ tokenMode?: "tile" | "detail" | "provider";
20
+ };
21
+ type ModelDataMediaInputConfig = {
22
+ /** Image input limits and accounting hints for this model. */
23
+ image?: ModelDataImageInputConfig;
24
+ };
25
+ /** Per-million-token rates for separately billed token buckets. */
26
+ type ModelDataCostRates = {
27
+ input: number;
28
+ output: number;
29
+ cacheRead: number;
30
+ cacheWrite: number;
31
+ };
32
+ type ModelDataRawPricingTier = ModelDataCostRates & {
33
+ /** Half-open prompt-token interval; `[start]` is an open-ended upper tier. */
34
+ range: [number, number] | [number];
35
+ };
36
+ type ModelRoutingSortConfig = {
37
+ /** The sorting metric: "price", "throughput", "latency". */
38
+ by?: string;
39
+ /** Partitioning strategy: "model" (default) or "none". */
40
+ partition?: string | null;
41
+ };
42
+ type ModelRoutingMaxPrice = {
43
+ /** Price per million prompt tokens. */
44
+ prompt?: number | string;
45
+ /** Price per million completion tokens. */
46
+ completion?: number | string;
47
+ /** Price per image. */
48
+ image?: number | string;
49
+ /** Price per audio unit. */
50
+ audio?: number | string;
51
+ /** Price per request. */
52
+ request?: number | string;
53
+ };
54
+ /** Percentile targets in the owning field's throughput or latency units. */
55
+ type ModelRoutingPercentiles = {
56
+ p50?: number;
57
+ p75?: number;
58
+ p90?: number;
59
+ p99?: number;
60
+ };
61
+ //#endregion
3
62
  //#region packages/llm-core/src/types.d.ts
4
63
  /** Provider API families with first-class request/stream adapters in OpenClaw. */
5
64
  type KnownApi = "openai-completions" | "mistral-conversations" | "openai-responses" | "azure-openai-responses" | "openai-chatgpt-responses" | "anthropic-messages" | "bedrock-converse-stream" | "google-generative-ai" | "google-vertex";
@@ -16,11 +75,11 @@ type KnownImagesProvider = "openrouter";
16
75
  /** Image provider id used for routing, diagnostics, and config lookups. */
17
76
  type ImagesProvider = string;
18
77
  /** Normalized reasoning-effort levels shared across provider-specific knobs. */
19
- type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
78
+ type ThinkingLevel = Exclude<ModelDataThinkingLevel, "off">;
20
79
  /** Model thinking setting including explicit disabled state. */
21
- type ModelThinkingLevel = "off" | ThinkingLevel;
80
+ type ModelThinkingLevel = ModelDataThinkingLevel;
22
81
  /** Provider-specific values for normalized thinking levels. */
23
- type ThinkingLevelMap = Partial<Record<ModelThinkingLevel, string | null>>;
82
+ type ThinkingLevelMap = ModelDataThinkingLevelMap;
24
83
  /** Token budgets for each thinking level (token-based providers only) */
25
84
  interface ThinkingBudgets {
26
85
  minimal?: number;
@@ -272,16 +331,13 @@ interface Usage {
272
331
  };
273
332
  }
274
333
  /** Per-million-token rates for separately billed token buckets. */
275
- type ModelCostRates = Pick<Usage["cost"], "input" | "output" | "cacheRead" | "cacheWrite">;
334
+ type ModelCostRates = ModelDataCostRates;
276
335
  /** One whole-request tier on the cache-inclusive prompt-token axis. */
277
336
  type PricingTier = ModelCostRates & {
278
337
  /** Half-open prompt-token interval `[start, end)`. */
279
338
  range: [number, number];
280
339
  };
281
- type RawPricingTier = ModelCostRates & {
282
- /** `[start]` is an open-ended upper tier. */
283
- range: [number, number] | [number];
284
- };
340
+ type RawPricingTier = ModelDataRawPricingTier;
285
341
  /** Normalized pricing used by token accounting and usage summaries. */
286
342
  type ModelCostConfig = ModelCostRates & {
287
343
  tieredPricing?: PricingTier[];
@@ -294,6 +350,8 @@ type StopReason = "stop" | "length" | "toolUse" | "error" | "aborted";
294
350
  /** Stable error codes for provider outcomes that cannot be replayed safely. */
295
351
  declare const PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE = "PROVIDER_POST_DISPATCH_AMBIGUITY";
296
352
  declare const PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE = "PROVIDER_FAILURE_WITH_OUTPUT";
353
+ /** Pre-dispatch argument rejection; callers still enforce output and effect guards. */
354
+ declare const MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE = "malformed_tool_call_arguments";
297
355
  /** User turn in a text-model conversation. */
298
356
  interface UserMessage {
299
357
  role: "user";
@@ -497,7 +555,7 @@ interface OpenAICompletionsCompat {
497
555
  /** Whether all replayed assistant messages must include an empty reasoning_content field when reasoning is enabled. Default: auto-detected from URL. */
498
556
  requiresReasoningContentOnAssistantMessages?: boolean;
499
557
  /** Format for reasoning/thinking parameter. "openai" uses reasoning_effort, "openrouter" uses reasoning: { effort }, "deepseek" uses thinking: { type } plus reasoning_effort, "together" uses reasoning: { enabled } plus reasoning_effort when supported, "zai" uses top-level enable_thinking: boolean, "qwen" uses top-level enable_thinking: boolean, and "qwen-chat-template" uses chat_template_kwargs.enable_thinking. Default: "openai". */
500
- thinkingFormat?: "openai" | "openrouter" | "deepseek" | "together" | "zai" | "qwen" | "qwen-chat-template";
558
+ thinkingFormat?: ModelDataThinkingFormat;
501
559
  /** OpenRouter-specific routing preferences. Only used when baseUrl points to OpenRouter. */
502
560
  openRouterRouting?: OpenRouterRouting;
503
561
  /** Vercel AI Gateway routing preferences. Only used when baseUrl points to Vercel AI Gateway. */
@@ -569,6 +627,7 @@ interface AnthropicMessagesCompat {
569
627
  * OpenRouter provider routing preferences.
570
628
  * Controls which upstream providers OpenRouter routes requests to.
571
629
  * Sent as the `provider` field in the OpenRouter API request body.
630
+ * Own member declarations preserve existing module-augmentation semantics.
572
631
  * @see https://openrouter.ai/docs/guides/routing/provider-selection
573
632
  */
574
633
  interface OpenRouterRouting {
@@ -591,47 +650,13 @@ interface OpenRouterRouting {
591
650
  /** A list of quantization levels to filter providers by (e.g., ["fp16", "bf16", "fp8", "fp6", "int8", "int4", "fp4", "fp32"]). */
592
651
  quantizations?: string[];
593
652
  /** Sorting strategy. Can be a string (e.g., "price", "throughput", "latency") or an object with `by` and `partition`. */
594
- sort?: string | {
595
- /** The sorting metric: "price", "throughput", "latency". */
596
- by?: string;
597
- /** Partitioning strategy: "model" (default) or "none". */
598
- partition?: string | null;
599
- };
653
+ sort?: string | ModelRoutingSortConfig;
600
654
  /** Maximum price per million tokens (USD). */
601
- max_price?: {
602
- /** Price per million prompt tokens. */
603
- prompt?: number | string;
604
- /** Price per million completion tokens. */
605
- completion?: number | string;
606
- /** Price per image. */
607
- image?: number | string;
608
- /** Price per audio unit. */
609
- audio?: number | string;
610
- /** Price per request. */
611
- request?: number | string;
612
- };
655
+ max_price?: ModelRoutingMaxPrice;
613
656
  /** Preferred minimum throughput (tokens/second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
614
- preferred_min_throughput?: number | {
615
- /** Minimum tokens/second at the 50th percentile. */
616
- p50?: number;
617
- /** Minimum tokens/second at the 75th percentile. */
618
- p75?: number;
619
- /** Minimum tokens/second at the 90th percentile. */
620
- p90?: number;
621
- /** Minimum tokens/second at the 99th percentile. */
622
- p99?: number;
623
- };
657
+ preferred_min_throughput?: number | ModelRoutingPercentiles;
624
658
  /** Preferred maximum latency (seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. */
625
- preferred_max_latency?: number | {
626
- /** Maximum latency in seconds at the 50th percentile. */
627
- p50?: number;
628
- /** Maximum latency in seconds at the 75th percentile. */
629
- p75?: number;
630
- /** Maximum latency in seconds at the 90th percentile. */
631
- p90?: number;
632
- /** Maximum latency in seconds at the 99th percentile. */
633
- p99?: number;
634
- };
659
+ preferred_max_latency?: number | ModelRoutingPercentiles;
635
660
  }
636
661
  /**
637
662
  * Vercel AI Gateway routing preferences.
@@ -674,15 +699,7 @@ interface Model<TApi extends Api = Api> {
674
699
  /** Compatibility overrides for OpenAI-compatible APIs. If not set, auto-detected from baseUrl. */
675
700
  compat?: TApi extends "openai-completions" ? OpenAICompletionsCompat : TApi extends "openai-responses" | "azure-openai-responses" | "openai-codex-responses" ? OpenAIResponsesCompat : TApi extends "anthropic-messages" ? AnthropicMessagesCompat : never;
676
701
  /** Provider-documented media input limits used by attachment preprocessing. */
677
- mediaInput?: {
678
- image?: {
679
- maxBytes?: number;
680
- maxPixels?: number;
681
- maxSidePx?: number;
682
- preferredSidePx?: number;
683
- tokenMode?: "tile" | "detail" | "provider";
684
- };
685
- };
702
+ mediaInput?: ModelDataMediaInputConfig;
686
703
  }
687
704
  interface ImagesModel<TApi extends ImagesApi = ImagesApi> extends Omit<Model, "api" | "provider" | "reasoning" | "contextWindow" | "maxTokens" | "compat"> {
688
705
  api: TApi;
@@ -693,4 +710,4 @@ type StreamFn = (model: Model, context: Context, options?: SimpleStreamOptions)
693
710
  type CompleteSimpleFn = (model: Model, context: Pick<Context, "systemPrompt" | "messages">, options?: SimpleStreamOptions) => Promise<AssistantMessage>;
694
711
  type ValidateToolArgumentsFn = (tool: Tool, toolCall: ToolCall) => unknown;
695
712
  //#endregion
696
- export { ThinkingLevel as $, ModelThinkingLevel as A, ProviderResponse as B, KnownImagesApi as C, Model as D, Message as E, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as F, StopReason as G, RawModelCostConfig as H, PricingTier as I, StreamOptions as J, StreamFn as K, Provider as L, OpenAIResponsesCompat as M, OpenRouterRouting as N, ModelCostConfig as O, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as P, ThinkingContent as Q, ProviderImagesOptions as R, KnownApi as S, MaybePromise as T, RawPricingTier as U, ProviderStreamOptions as V, SimpleStreamOptions as W, TextSignatureV1 as X, TextContent as Y, ThinkingBudgets as Z, ImagesModel as _, AssistantMessage as a, Usage as at, ImagesProvider as b, AssistantMessageEventStreamLike as c, VercelGatewayRouting as ct, Context as d, ThinkingLevelMap as et, ImageContent as f, ImagesInputContent as g, ImagesFunction as h, AssistantImages as i, Transport as it, OpenAICompletionsCompat as j, ModelCostRates as k, CacheRetention as l, ImagesContext as m, Api as n, ToolCall as nt, AssistantMessageEvent as o, UserMessage as ot, ImagesApi as p, StreamFunction as q, AssistantDeliveryTtsFacts as r, ToolResultMessage as rt, AssistantMessageEventStreamContract as s, ValidateToolArgumentsFn as st, AnthropicMessagesCompat as t, Tool as tt, CompleteSimpleFn as u, ImagesOptions as v, KnownImagesProvider as w, ImagesStopReason as x, ImagesOutputContent as y, ProviderReplayState as z };
713
+ export { ThinkingContent as $, ModelCostRates as A, ProviderReplayState as B, KnownImagesApi as C, Message as D, MaybePromise as E, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE as F, SimpleStreamOptions as G, ProviderStreamOptions as H, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE as I, StreamFunction as J, StopReason as K, PricingTier as L, OpenAICompletionsCompat as M, OpenAIResponsesCompat as N, Model as O, OpenRouterRouting as P, ThinkingBudgets as Q, Provider as R, KnownApi as S, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE as T, RawModelCostConfig as U, ProviderResponse as V, RawPricingTier as W, TextContent as X, StreamOptions as Y, TextSignatureV1 as Z, ImagesModel as _, AssistantMessage as a, Transport as at, ImagesProvider as b, AssistantMessageEventStreamLike as c, ValidateToolArgumentsFn as ct, Context as d, ThinkingLevel as et, ImageContent as f, ImagesInputContent as g, ImagesFunction as h, AssistantImages as i, ToolResultMessage as it, ModelThinkingLevel as j, ModelCostConfig as k, CacheRetention as l, VercelGatewayRouting as lt, ImagesContext as m, Api as n, Tool as nt, AssistantMessageEvent as o, Usage as ot, ImagesApi as p, StreamFn as q, AssistantDeliveryTtsFacts as r, ToolCall as rt, AssistantMessageEventStreamContract as s, UserMessage as st, AnthropicMessagesCompat as t, ThinkingLevelMap as tt, CompleteSimpleFn as u, ModelDataThinkingFormat as ut, ImagesOptions as v, KnownImagesProvider as w, ImagesStopReason as x, ImagesOutputContent as y, ProviderImagesOptions as z };
package/dist/types.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-FnHM2FcI.mjs";
1
+ import { _ as supportsClaude1MContext, a as CLAUDE_FABLE_5_THINKING_PROFILE, b as supportsClaudeNativeMaxEffort, c as bindsClaudeThinkingPrefix, d as resolveClaudeFable5ModelIdentity, f as resolveClaudeModelIdentity, g as resolveClaudeSonnet5ModelIdentity, h as resolveClaudeOpus5ModelIdentity, i as normalizeResolvedPricing, l as requiresClaudeDefaultSampling, m as resolveClaudeNativeThinkingLevelMap, n as calculateUsageCost, o as CLAUDE_OPUS_5_THINKING_PROFILE, p as resolveClaudeMythos5ModelIdentity, r as normalizeModelCostConfig, s as CLAUDE_SONNET_5_THINKING_PROFILE, u as requiresClaudeMandatoryAdaptiveThinking, v as supportsClaudeAdaptiveThinking, x as supportsClaudeNativeXhighEffort, y as supportsClaudeFastMode } from "./index-DdD3qerf.mjs";
2
+ import { $ as ThinkingContent, A as ModelCostRates, B as ProviderReplayState, C as KnownImagesApi, D as Message, E as MaybePromise, F as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, G as SimpleStreamOptions, H as ProviderStreamOptions, I as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, J as StreamFunction, K as StopReason, L as PricingTier, M as OpenAICompletionsCompat, N as OpenAIResponsesCompat, O as Model, P as OpenRouterRouting, Q as ThinkingBudgets, R as Provider, S as KnownApi, T as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, U as RawModelCostConfig, V as ProviderResponse, W as RawPricingTier, X as TextContent, Y as StreamOptions, Z as TextSignatureV1, _ as ImagesModel, a as AssistantMessage, at as Transport, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as ValidateToolArgumentsFn, d as Context, et as ThinkingLevel, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as ToolResultMessage, j as ModelThinkingLevel, k as ModelCostConfig, l as CacheRetention, lt as VercelGatewayRouting, m as ImagesContext, n as Api, nt as Tool, o as AssistantMessageEvent, ot as Usage, p as ImagesApi, q as StreamFn, r as AssistantDeliveryTtsFacts, rt as ToolCall, s as AssistantMessageEventStreamContract, st as UserMessage, t as AnthropicMessagesCompat, tt as ThinkingLevelMap, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderImagesOptions } from "./types-Ntv5z2g2.mjs";
2
3
  import { a as extractDiagnosticError, i as createAssistantMessageDiagnostic, n as DiagnosticErrorInfo, o as formatThrownValue, r as appendAssistantMessageDiagnostic, s as isProviderRefusalAssistantError, t as AssistantMessageDiagnostic } from "./diagnostics-DnPnOui6.mjs";
3
- import { $ as ThinkingLevel, A as ModelThinkingLevel, B as ProviderResponse, C as KnownImagesApi, D as Model, E as Message, F as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, G as StopReason, H as RawModelCostConfig, I as PricingTier, J as StreamOptions, K as StreamFn, L as Provider, M as OpenAIResponsesCompat, N as OpenRouterRouting, O as ModelCostConfig, P as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Q as ThinkingContent, R as ProviderImagesOptions, S as KnownApi, T as MaybePromise, U as RawPricingTier, V as ProviderStreamOptions, W as SimpleStreamOptions, X as TextSignatureV1, Y as TextContent, Z as ThinkingBudgets, _ as ImagesModel, a as AssistantMessage, at as Usage, b as ImagesProvider, c as AssistantMessageEventStreamLike, ct as VercelGatewayRouting, d as Context, et as ThinkingLevelMap, f as ImageContent, g as ImagesInputContent, h as ImagesFunction, i as AssistantImages, it as Transport, j as OpenAICompletionsCompat, k as ModelCostRates, l as CacheRetention, m as ImagesContext, n as Api, nt as ToolCall, o as AssistantMessageEvent, ot as UserMessage, p as ImagesApi, q as StreamFunction, r as AssistantDeliveryTtsFacts, rt as ToolResultMessage, s as AssistantMessageEventStreamContract, st as ValidateToolArgumentsFn, t as AnthropicMessagesCompat, tt as Tool, u as CompleteSimpleFn, v as ImagesOptions, w as KnownImagesProvider, x as ImagesStopReason, y as ImagesOutputContent, z as ProviderReplayState } from "./types-CJ1-Ht7A.mjs";
4
- import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BhT5T1Ay.mjs";
5
- import { n as validateToolCall, t as validateToolArguments } from "./validation-AKZBDGQd.mjs";
6
- import "./types-3Lnm-QSJ.mjs";
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, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
4
+ import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-Bt5Y4Pav.mjs";
5
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-B0t_G2H6.mjs";
6
+ import "./types-DlfwzH3T.mjs";
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, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, MaybePromise, Message, Model, ModelCostConfig, ModelCostRates, ModelThinkingLevel, OpenAICompletionsCompat, OpenAIResponsesCompat, OpenRouterRouting, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, PricingTier, Provider, ProviderImagesOptions, ProviderReplayState, ProviderResponse, ProviderStreamOptions, RawModelCostConfig, RawPricingTier, SimpleStreamOptions, StopReason, StreamFn, StreamFunction, StreamOptions, TextContent, TextSignatureV1, ThinkingBudgets, ThinkingContent, ThinkingLevel, ThinkingLevelMap, Tool, ToolCall, ToolResultMessage, Transport, Usage, UserMessage, ValidateToolArgumentsFn, VercelGatewayRouting, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
package/dist/types.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeResolvedPricing, s as bindsClaudeThinkingPrefix, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./src-2qBGKg8O.mjs";
2
- import { n as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE } from "./types-BDdaOVi2.mjs";
1
+ import { _ as supportsClaudeAdaptiveThinking, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as supportsClaudeNativeXhighEffort, c as requiresClaudeDefaultSampling, d as resolveClaudeModelIdentity, f as resolveClaudeMythos5ModelIdentity, g as supportsClaude1MContext, h as resolveClaudeSonnet5ModelIdentity, i as CLAUDE_FABLE_5_THINKING_PROFILE, l as requiresClaudeMandatoryAdaptiveThinking, m as resolveClaudeOpus5ModelIdentity, n as normalizeModelCostConfig, o as CLAUDE_SONNET_5_THINKING_PROFILE, p as resolveClaudeNativeThinkingLevelMap, r as normalizeResolvedPricing, s as bindsClaudeThinkingPrefix, t as calculateUsageCost, u as resolveClaudeFable5ModelIdentity, v as supportsClaudeFastMode, y as supportsClaudeNativeMaxEffort } from "./usage-cost-BNWbbXav.mjs";
2
+ import { n as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, r as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, t as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE } from "./types-LFWwv0cF.mjs";
3
3
  import { a as isProviderRefusalAssistantError, i as formatThrownValue, n as createAssistantMessageDiagnostic, r as extractDiagnosticError, t as appendAssistantMessageDiagnostic } from "./diagnostics-CPeq9F7y.mjs";
4
- import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BgDvQeum.mjs";
5
- import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.mjs";
6
- export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
4
+ import { i as createAssistantMessageEventStream, n as EventStream, t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
5
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-BDzVDnTs.mjs";
6
+ import "./src-DDmEryvj.mjs";
7
+ export { AssistantMessageEventStream, CLAUDE_FABLE_5_THINKING_PROFILE, CLAUDE_OPUS_5_THINKING_PROFILE, CLAUDE_SONNET_5_THINKING_PROFILE, EventStream, MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, appendAssistantMessageDiagnostic, bindsClaudeThinkingPrefix, calculateUsageCost, createAssistantMessageDiagnostic, createAssistantMessageEventStream, extractDiagnosticError, formatThrownValue, isProviderRefusalAssistantError, normalizeModelCostConfig, normalizeResolvedPricing, requiresClaudeDefaultSampling, requiresClaudeMandatoryAdaptiveThinking, resolveClaudeFable5ModelIdentity, resolveClaudeModelIdentity, resolveClaudeMythos5ModelIdentity, resolveClaudeNativeThinkingLevelMap, resolveClaudeOpus5ModelIdentity, resolveClaudeSonnet5ModelIdentity, supportsClaude1MContext, supportsClaudeAdaptiveThinking, supportsClaudeFastMode, supportsClaudeNativeMaxEffort, supportsClaudeNativeXhighEffort, validateToolArguments, validateToolCall };
@@ -1,4 +1,3 @@
1
- import "./validation-CJZtym2g.mjs";
2
1
  //#region packages/llm-core/src/model-contracts/anthropic.ts
3
2
  function normalizeClaudeModelId(modelId) {
4
3
  const normalized = modelId?.trim().toLowerCase() ?? "";
@@ -0,0 +1,29 @@
1
+ //#region packages/normalization-core/src/utf16-slice.ts
2
+ function isHighSurrogate(codeUnit) {
3
+ return codeUnit >= 55296 && codeUnit <= 56319;
4
+ }
5
+ function isLowSurrogate(codeUnit) {
6
+ return codeUnit >= 56320 && codeUnit <= 57343;
7
+ }
8
+ /** Slices a UTF-16 string without returning dangling surrogate halves at either edge. */
9
+ function sliceUtf16Safe(input, start, end) {
10
+ const len = input.length;
11
+ let from = start < 0 ? Math.max(len + start, 0) : Math.min(start, len);
12
+ let to = end === void 0 ? len : end < 0 ? Math.max(len + end, 0) : Math.min(end, len);
13
+ if (to <= from) return "";
14
+ if (from > 0 && from < len) {
15
+ if (isLowSurrogate(input.charCodeAt(from)) && isHighSurrogate(input.charCodeAt(from - 1))) from += 1;
16
+ }
17
+ if (to > 0 && to < len) {
18
+ if (isHighSurrogate(input.charCodeAt(to - 1)) && isLowSurrogate(input.charCodeAt(to))) to -= 1;
19
+ }
20
+ return input.slice(from, to);
21
+ }
22
+ /** Truncates a UTF-16 string without cutting a surrogate pair in half. */
23
+ function truncateUtf16Safe(input, maxLen) {
24
+ const limit = Math.max(0, Math.floor(maxLen));
25
+ if (input.length <= limit) return input;
26
+ return sliceUtf16Safe(input, 0, limit);
27
+ }
28
+ //#endregion
29
+ export { truncateUtf16Safe as t };
@@ -1,4 +1,4 @@
1
- import { nt as ToolCall, tt as Tool } from "./types-CJ1-Ht7A.mjs";
1
+ import { nt as Tool, rt as ToolCall } from "./types-Ntv5z2g2.mjs";
2
2
  //#region packages/llm-core/src/validation.d.ts
3
3
  /** Finds the target tool and validates/coerces a model-emitted tool call. */
4
4
  declare function validateToolCall(tools: Tool[], toolCall: ToolCall): unknown;
@@ -127,6 +127,8 @@ function coerceWithUnionSchema(value, schemas) {
127
127
  }
128
128
  }
129
129
  for (const schema of schemas) {
130
+ const types = getSchemaTypes(schema);
131
+ if (value !== null && types.length === 1 && types[0] === "null") continue;
130
132
  const coerced = coerceWithJsonSchema(structuredClone(value), schema);
131
133
  if (getSubSchemaValidator(schema)?.Check(coerced)) return coerced;
132
134
  }
@@ -174,11 +176,15 @@ function validateToolCall(tools, toolCall) {
174
176
  if (!tool) throw new Error(`Tool "${toolCall.name}" not found`);
175
177
  return validateToolArguments(tool, toolCall);
176
178
  }
179
+ function introducesNullValue(previous, converted) {
180
+ if (converted === null) return previous !== null;
181
+ if (!isObjectBackedRecord(previous) || !isObjectBackedRecord(converted)) return false;
182
+ return Object.entries(converted).some(([key, value]) => introducesNullValue(previous[key], value));
183
+ }
177
184
  /** Validates tool arguments against TypeBox or plain JSON-schema parameters. */
178
185
  function validateToolArguments(tool, toolCall) {
179
186
  const args = structuredClone(toolCall.arguments);
180
187
  const validator = getValidator(tool.parameters);
181
- validator.Convert(args);
182
188
  if (isJsonSchemaObject(tool.parameters)) {
183
189
  const coerced = coerceWithJsonSchema(args, tool.parameters);
184
190
  if (coerced !== args) {
@@ -189,6 +195,8 @@ function validateToolArguments(tool, toolCall) {
189
195
  }
190
196
  }
191
197
  if (validator.Check(args)) return args;
198
+ const converted = validator.Convert(structuredClone(args));
199
+ if (!introducesNullValue(args, converted) && validator.Check(converted)) return converted;
192
200
  const errors = validator.Errors(args).map((error) => ` - ${formatValidationPath(error)}: ${error.message}`).join("\n") || "Unknown validation error";
193
201
  throw new Error(`Validation failed for tool "${toolCall.name}":\n${errors}\n\nReceived arguments:\n${JSON.stringify(toolCall.arguments, null, 2)}`);
194
202
  }
@@ -1,2 +1,2 @@
1
- import { n as validateToolCall, t as validateToolArguments } from "./validation-AKZBDGQd.mjs";
1
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-B0t_G2H6.mjs";
2
2
  export { validateToolArguments, validateToolCall };
@@ -1,2 +1,2 @@
1
- import { n as validateToolCall, t as validateToolArguments } from "./validation-CJZtym2g.mjs";
1
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-BDzVDnTs.mjs";
2
2
  export { validateToolArguments, validateToolCall };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/ai",
3
- "version": "2026.9.2",
3
+ "version": "2026.9.4",
4
4
  "description": "Reusable model provider adapters and streaming runtime from OpenClaw",
5
5
  "keywords": [
6
6
  "ai",
@@ -76,6 +76,11 @@
76
76
  "import": "./dist/internal/anthropic.mjs",
77
77
  "default": "./dist/internal/anthropic.mjs"
78
78
  },
79
+ "./internal/google-model-family": {
80
+ "types": "./dist/internal/google-model-family.d.mts",
81
+ "import": "./dist/internal/google-model-family.mjs",
82
+ "default": "./dist/internal/google-model-family.mjs"
83
+ },
79
84
  "./internal/openai": {
80
85
  "types": "./dist/internal/openai.d.mts",
81
86
  "import": "./dist/internal/openai.mjs",
@@ -100,13 +105,18 @@
100
105
  "types": "./dist/internal/shared.d.mts",
101
106
  "import": "./dist/internal/shared.mjs",
102
107
  "default": "./dist/internal/shared.mjs"
108
+ },
109
+ "./internal/tool-schema": {
110
+ "types": "./dist/internal/tool-schema.d.mts",
111
+ "import": "./dist/internal/tool-schema.mjs",
112
+ "default": "./dist/internal/tool-schema.mjs"
103
113
  }
104
114
  },
105
115
  "dependencies": {
106
116
  "@anthropic-ai/sdk": "0.120.0",
107
- "@google/genai": "2.18.0",
117
+ "@google/genai": "2.19.0",
108
118
  "@mistralai/mistralai": "2.6.4",
109
- "openai": "7.5.0",
119
+ "openai": "7.8.0",
110
120
  "partial-json": "0.1.7",
111
121
  "typebox": "1.3.18"
112
122
  },