@openclaw/ai 2026.10.1 → 2026.10.5-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 (106) hide show
  1. package/README.md +6 -0
  2. package/dist/{anthropic-BDfXKgF1.mjs → anthropic-BAHKgWam.mjs} +30 -59
  3. package/dist/{anthropic-payload-policy-BZUAchqb.d.mts → anthropic-payload-policy-DGblkHL5.d.mts} +19 -16
  4. package/dist/{anthropic-stream-reducer-DHt9uFWX.mjs → anthropic-stream-reducer-g6w1YVii.mjs} +195 -283
  5. package/dist/{api-registry-DcEP_o4h.d.mts → api-registry-BhXXYdRA.d.mts} +2 -2
  6. package/dist/assistant-message-events-CHMJgbhs.mjs +18 -0
  7. package/dist/{assistant-output-mJ9cL4Qg.mjs → assistant-output-CUEeSotf.mjs} +2 -2
  8. package/dist/{assistant-text-phase-DAv1BdTm.mjs → assistant-text-phase-BrV8KdFO.mjs} +7 -6
  9. package/dist/{azure-openai-responses-gn9hMf8x.mjs → azure-openai-responses-C7qBuR23.mjs} +8 -9
  10. package/dist/{credential-redaction-BKv49aiv.d.mts → credential-redaction-BHxruEH6.d.mts} +3 -1
  11. package/dist/{diagnostics-Caj-4RBA.mjs → diagnostics-tQasYct1.mjs} +10 -3
  12. package/dist/diagnostics.d.mts +7 -7
  13. package/dist/diagnostics.mjs +3 -3
  14. package/dist/{env-api-keys-CyX4VKGO.mjs → env-api-keys-CrxwdylR.mjs} +24 -35
  15. package/dist/event-stream-6UNs-AhN.d.mts +1 -0
  16. package/dist/{event-stream-DrRM_90c.d.mts → event-stream-BcqWLo_u.d.mts} +1 -1
  17. package/dist/{event-stream-C5AbCAaZ.mjs → event-stream-X2gmsUWv.mjs} +5 -8
  18. package/dist/event-stream.d.mts +2 -2
  19. package/dist/event-stream.mjs +1 -1
  20. package/dist/google-Boz2QcpK.mjs +20 -0
  21. package/dist/{google-interactions-DXu4IYGb.mjs → google-interactions-tjAb1mc5.mjs} +52 -84
  22. package/dist/{google-messages-Bmheetdg.mjs → google-messages-C-RZzloH.mjs} +25 -35
  23. package/dist/google-provider-stream-CMImyxbX.mjs +58 -0
  24. package/dist/{google-shared-DE_ddfsC.mjs → google-shared-OyAtMTZv.mjs} +6 -15
  25. package/dist/google-vertex-hCxTJea7.mjs +40 -0
  26. package/dist/{host-BjIYEjwT.d.mts → host-CTDz7LXD.d.mts} +6 -3
  27. package/dist/{host-JpNulOOs.mjs → host-JWXZWa-c.mjs} +3 -2
  28. package/dist/{host-policy-CC5H0iRZ.mjs → host-policy-q4Azym9F.mjs} +1 -1
  29. package/dist/{index-DJrNQnKw.d.mts → index-BYDvopUB.d.mts} +8 -5
  30. package/dist/index.d.mts +7 -7
  31. package/dist/index.mjs +7 -6
  32. package/dist/internal/anthropic.d.mts +5 -5
  33. package/dist/internal/anthropic.mjs +4 -4
  34. package/dist/internal/openai-completions-compat.d.mts +1 -1
  35. package/dist/internal/openai-completions-compat.mjs +1 -1
  36. package/dist/internal/openai-responses-payload-policy.d.mts +8 -1
  37. package/dist/internal/openai-responses-payload-policy.mjs +3 -3
  38. package/dist/internal/openai.d.mts +9 -9
  39. package/dist/internal/openai.mjs +9 -11
  40. package/dist/internal/runtime.d.mts +31 -13
  41. package/dist/internal/runtime.mjs +10 -13
  42. package/dist/internal/shared.d.mts +5 -5
  43. package/dist/internal/shared.mjs +6 -7
  44. package/dist/internal/tool-schema.mjs +2 -2
  45. package/dist/{llm-request-activity-D8f_oxHj.mjs → llm-request-activity-CfMuh5cC.mjs} +2 -2
  46. package/dist/{mistral-1Bnbneg1.mjs → mistral-DUveP4hF.mjs} +71 -146
  47. package/dist/{model-transport-url-C5f59L3Y.d.mts → model-transport-url-BrsjjdjR.d.mts} +5 -1
  48. package/dist/{number-coercion-V8-BhME4.mjs → number-coercion-C3hztWoY.mjs} +5 -4
  49. package/dist/{openai-chatgpt-responses-CB1JwNFF.mjs → openai-chatgpt-responses-OCwckGhY.mjs} +164 -234
  50. package/dist/{openai-completions-BPadHHKe.mjs → openai-completions-DOltBUe9.mjs} +7 -6
  51. package/dist/{openai-completions-compat-CJ0ktmGy.d.mts → openai-completions-compat-i-nLZxFy.d.mts} +10 -11
  52. package/dist/{openai-completions-compat-D7hWYB0G.mjs → openai-completions-compat-pg1q4uNG.mjs} +10 -6
  53. package/dist/{openai-completions-transport-DITBEALX.mjs → openai-completions-transport-OMrn7gnZ.mjs} +1429 -294
  54. package/dist/{openai-prompt-cache-Dj8qeOHT.mjs → openai-prompt-cache-Cr2xKVrS.mjs} +1 -1
  55. package/dist/{openai-prompt-cache-C-Q1Ksfs.d.mts → openai-prompt-cache-DIPMrMFy.d.mts} +2 -2
  56. package/dist/{openai-responses-1_TvcWI3.mjs → openai-responses-BSBJUA19.mjs} +9 -10
  57. package/dist/{openai-responses-compaction-replay-BB2SWdsx.d.mts → openai-responses-compaction-replay-B2FE4Nw8.d.mts} +4 -4
  58. package/dist/{openai-responses-contracts-sAvdqNjS.d.mts → openai-responses-contracts-DKqMJ1Ct.d.mts} +9 -4
  59. package/dist/{openai-responses-contracts-BKu8O7l4.mjs → openai-responses-contracts-DlKMMTxK.mjs} +26 -6
  60. package/dist/{openai-responses-compaction-window-m878aVpU.mjs → openai-responses-endpoint-CinGh4VZ.mjs} +14 -4
  61. package/dist/{openai-responses-prompt-observer-internal-CbH84xIS.mjs → openai-responses-request-lifecycle-D2IFiI0-.mjs} +39 -4
  62. package/dist/{openai-responses-shared-TCJRAoMW.mjs → openai-responses-shared-DVGhq5xF.mjs} +1036 -327
  63. package/dist/{openai-responses-terminal-usage-BVvyXZ8u.d.mts → openai-responses-terminal-usage-BygjiAdi.d.mts} +2 -2
  64. package/dist/{openai-tool-schema-DYNePiF8.mjs → openai-tool-schema-DDPXsvJP.mjs} +236 -399
  65. package/dist/{positive-integer-CwLi8LUL.mjs → positive-integer-CqWjqSi9.mjs} +1 -1
  66. package/dist/{provider-error-DQBE1bUQ.mjs → provider-error-CF9GWCs2.mjs} +5 -3
  67. package/dist/{provider-options-Dk4PeQV3.d.mts → provider-options-CVrXZBtA.d.mts} +3 -2
  68. package/dist/{provider-transport-turn-state-8c_Nj2NS.mjs → provider-transport-turn-state-LuCaTsSO.mjs} +2 -2
  69. package/dist/{provider-types-De8PRdR0.d.mts → provider-types-CHtRx0dI.d.mts} +3 -3
  70. package/dist/provider-types.d.mts +6 -6
  71. package/dist/providers.d.mts +2 -2
  72. package/dist/providers.mjs +12 -12
  73. package/dist/{reasoning-tag-text-partitioner-Ju9VpUGl.mjs → reasoning-tag-text-partitioner-0-Rsezog.mjs} +13 -12
  74. package/dist/{required-api-key-D4kn3252.mjs → required-api-key-CFJvcFy_.mjs} +1 -1
  75. package/dist/{simple-options-wW3117Fu.mjs → simple-options-BARFAzk9.mjs} +9 -11
  76. package/dist/{src-DWJq14pn.mjs → src-C_wfIUmV.mjs} +19 -4
  77. package/dist/{stream-CElngO8h.mjs → stream-DwrETW0_.mjs} +12 -21
  78. package/dist/{stream-first-event-timeout-D9ZmL_s9.mjs → stream-first-event-timeout-Dc42hKv6.mjs} +8 -21
  79. package/dist/{streaming-byte-guard-CC-HMn_u.mjs → streaming-byte-guard-DBXr1XYn.mjs} +16 -1
  80. package/dist/{string-normalization-PN10hf6d.mjs → string-normalization-I3ux50s9.mjs} +1 -1
  81. package/dist/{text-signature-rOn31nxc.mjs → text-signature-B_MB6U_9.mjs} +32 -5
  82. package/dist/{tool-schema-json-projection-Ct8SeBeJ.mjs → tool-schema-json-projection-B8sG1I9v.mjs} +29 -23
  83. package/dist/{transport-stream-shared-CAxkgOSj.d.mts → transport-stream-shared-BmpzDtdQ.d.mts} +4 -4
  84. package/dist/{transport-stream-shared-C5TAc3U_.mjs → transport-stream-shared-DH08b7Il.mjs} +8 -16
  85. package/dist/transports.d.mts +33 -22
  86. package/dist/transports.mjs +73 -1234
  87. package/dist/{types-DvzmWW8J.d.mts → types-Bd2T86VJ.d.mts} +5 -23
  88. package/dist/types-Kdfw_04V.d.mts +1 -0
  89. package/dist/types.d.mts +6 -6
  90. package/dist/types.mjs +5 -4
  91. package/dist/{validation-B3lQt_VE.d.mts → validation-DdGB1yy3.d.mts} +1 -1
  92. package/dist/{validation-DbqlIfDn.mjs → validation-opC2pjk9.mjs} +2 -3
  93. package/dist/validation.d.mts +1 -1
  94. package/dist/validation.mjs +1 -1
  95. package/package.json +4 -9
  96. package/dist/env-api-keys-BR0MUYYD.d.mts +0 -17
  97. package/dist/event-stream-DqDQWqiy.d.mts +0 -1
  98. package/dist/google-CyMz2jF_.mjs +0 -54
  99. package/dist/google-vertex-BEW0OQIA.mjs +0 -88
  100. package/dist/internal/env-api-keys.d.mts +0 -2
  101. package/dist/internal/env-api-keys.mjs +0 -2
  102. package/dist/openai-responses-request-lifecycle-Fsag-IGZ.mjs +0 -36
  103. package/dist/openai-transport-params-ildrm49s.mjs +0 -735
  104. package/dist/openai-web-search-tools-Cfu0uLyN.mjs +0 -14
  105. package/dist/provider-replay-context-ywPKKLjL.mjs +0 -25
  106. package/dist/types-Dlz-8qcy.d.mts +0 -1
@@ -1,4 +1,4 @@
1
- import { o as isRecord } from "./record-coerce-CNDovvft.mjs";
1
+ import { a as asRecord, o as isRecord } from "./record-coerce-CNDovvft.mjs";
2
2
  import { t as expectDefined } from "./expect-lbe3Hgrh.mjs";
3
3
  import { types } from "node:util";
4
4
  //#region packages/ai/src/providers/schema-walk.ts
@@ -33,6 +33,22 @@ const SCHEMA_ARRAY_KEYS = /* @__PURE__ */ new Set([
33
33
  "oneOf",
34
34
  "prefixItems"
35
35
  ]);
36
+ const SCHEMA_NESTED_KEYS = new Set([...SCHEMA_OBJECT_KEYS, ...SCHEMA_ARRAY_KEYS].toSorted());
37
+ function* walkSchemaArray(schemas, visit, result = []) {
38
+ result.length = schemas.length;
39
+ for (let index = 0; index < result.length; index += 1) if (index in schemas) result[index] = yield visit(schemas[index]);
40
+ return result;
41
+ }
42
+ function* walkSchemaValue(schema, ancestors, visitObject) {
43
+ if (!schema || typeof schema !== "object") return schema;
44
+ if (ancestors.has(schema)) throw new TypeError("Tool schema contains a circular reference.");
45
+ ancestors.add(schema);
46
+ try {
47
+ return yield Array.isArray(schema) ? walkSchemaArray(schema, (entry) => walkSchemaValue(entry, ancestors, visitObject)) : visitObject(asRecord(schema));
48
+ } finally {
49
+ ancestors.delete(schema);
50
+ }
51
+ }
36
52
  /** Resume child schema walks on a heap stack, never through recursive yield delegation. */
37
53
  function evaluateSchemaWalk(walk) {
38
54
  const parents = [];
@@ -64,7 +80,7 @@ function isNonFiniteNumberValue(value) {
64
80
  if (value === null || typeof value !== "object" || !types.isNumberObject(value)) return false;
65
81
  return !Number.isFinite(Number.prototype.valueOf.call(value));
66
82
  }
67
- function serializeToolInputSchema(value, path, captureJson) {
83
+ function projectToolInputSchema(value, path, captureJson) {
68
84
  const nonFiniteNumber = { path: null };
69
85
  const ancestors = [];
70
86
  const pathLengths = [];
@@ -102,9 +118,16 @@ function serializeToolInputSchema(value, path, captureJson) {
102
118
  };
103
119
  const schema = JSON.parse(text);
104
120
  captureJson?.(text);
121
+ const violations = [];
122
+ if (!isRecord(schema)) violations.push(`${path} must be a JSON object schema`);
123
+ else if (schema.type !== void 0 && schema.type !== "object") violations.push(`${path}.type must be "object"`);
124
+ if (!inspectJsonSchema(schema, [path], violations)) return {
125
+ schema: {},
126
+ violations: [`${path} is not a JSON value`]
127
+ };
105
128
  return {
106
129
  schema,
107
- violations: []
130
+ violations
108
131
  };
109
132
  }
110
133
  function inspectJsonSchema(schema, path, violations) {
@@ -120,14 +143,11 @@ function inspectJsonSchema(schema, path, violations) {
120
143
  }
121
144
  if (!isRecord(schema)) return typeof schema !== "number" || Number.isFinite(schema);
122
145
  for (const key of ["$dynamicRef", "$dynamicAnchor"]) if (key in schema) violations.push(`${path.join("")}.${key}`);
123
- for (const key of Object.keys(schema)) {
124
- const value = schema[key];
146
+ for (const [key, value] of Object.entries(schema)) {
125
147
  if (typeof value === "number" && !Number.isFinite(value)) return false;
126
148
  if (!value || typeof value !== "object") continue;
127
149
  path.push(".", key);
128
- if (SCHEMA_MAP_KEYS.has(key) && isRecord(value)) for (const schemaName of Object.keys(value)) {
129
- const childSchema = value[schemaName];
130
- if (childSchema === void 0) return false;
150
+ if (SCHEMA_MAP_KEYS.has(key) && isRecord(value)) for (const [schemaName, childSchema] of Object.entries(value)) {
131
151
  path.push(".", schemaName);
132
152
  const valid = inspectJsonSchema(childSchema, path, violations);
133
153
  path.length -= 2;
@@ -156,19 +176,5 @@ function prepareRuntimeToolInputSchema(schema, path) {
156
176
  } } : {}
157
177
  };
158
178
  }
159
- function projectToolInputSchema(schema, path, captureJson) {
160
- const projection = serializeToolInputSchema(schema, path, captureJson);
161
- const violations = [...projection.violations];
162
- if (!isRecord(projection.schema)) violations.push(`${path} must be a JSON object schema`);
163
- else if (projection.schema.type !== void 0 && projection.schema.type !== "object") violations.push(`${path}.type must be "object"`);
164
- if (!inspectJsonSchema(projection.schema, [path], violations)) return {
165
- schema: {},
166
- violations: [`${path} is not a JSON value`]
167
- };
168
- return {
169
- schema: projection.schema,
170
- violations
171
- };
172
- }
173
179
  //#endregion
174
- export { SCHEMA_OBJECT_KEYS as a, SCHEMA_MAP_KEYS as i, projectRuntimeToolInputSchema as n, evaluateSchemaWalk as o, SCHEMA_ARRAY_KEYS as r, prepareRuntimeToolInputSchema as t };
180
+ export { SCHEMA_NESTED_KEYS as a, walkSchemaArray as c, SCHEMA_MAP_KEYS as i, walkSchemaValue as l, projectRuntimeToolInputSchema as n, SCHEMA_OBJECT_KEYS as o, SCHEMA_ARRAY_KEYS as r, evaluateSchemaWalk as s, prepareRuntimeToolInputSchema as t };
@@ -1,7 +1,7 @@
1
- import "./index-DJrNQnKw.mjs";
2
- import { H as ProviderResponse, a as AssistantMessage, k as Model, nt as StreamOptions, pt as Usage } from "./types-DvzmWW8J.mjs";
3
- import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-DrRM_90c.mjs";
4
- import "./event-stream-DqDQWqiy.mjs";
1
+ import "./index-BYDvopUB.mjs";
2
+ import { H as ProviderResponse, a as AssistantMessage, k as Model, nt as StreamOptions, pt as Usage } from "./types-Bd2T86VJ.mjs";
3
+ import { r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BcqWLo_u.mjs";
4
+ import "./event-stream-6UNs-AhN.mjs";
5
5
  import { t as ProviderErrorProjection } from "./provider-error-xumb1V3F.mjs";
6
6
  //#region packages/ai/src/transports/transport-stream-shared.d.ts
7
7
  type TransportUsage = Pick<Usage, "input" | "output" | "cacheRead" | "cacheWrite" | "contextUsage" | "totalTokens"> & {
@@ -1,9 +1,9 @@
1
1
  import { n as createAssistantMessageDiagnostic, t as appendAssistantMessageDiagnostic } from "./diagnostics-DzrF1h4J.mjs";
2
- import { a as createAssistantMessageEventStream } from "./event-stream-C5AbCAaZ.mjs";
2
+ import { a as createAssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
3
3
  import { i as asOptionalRecord, n as asNullableRecord, t as asNonArrayRecord } from "./record-coerce-CNDovvft.mjs";
4
- import { E as headersToRecord, r as getAiTransportHost } from "./host-JpNulOOs.mjs";
5
- import { i as projectDiagnosticValue, n as projectProviderError } from "./provider-error-DQBE1bUQ.mjs";
6
- import { c as isTransientNetworkError } from "./diagnostics-Caj-4RBA.mjs";
4
+ import { E as headersToRecord, r as getAiTransportHost } from "./host-JWXZWa-c.mjs";
5
+ import { a as projectDiagnosticValue, n as projectProviderError } from "./provider-error-CF9GWCs2.mjs";
6
+ import { l as isTransientNetworkError } from "./diagnostics-tQasYct1.mjs";
7
7
  import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
8
8
  import { parse } from "partial-json";
9
9
  //#region packages/ai/src/utils/sanitize-unicode.ts
@@ -208,7 +208,7 @@ function shortHash(str) {
208
208
  }
209
209
  //#endregion
210
210
  //#region packages/ai/src/utils/json-parse.ts
211
- const VALID_JSON_ESCAPES = /* @__PURE__ */ new Set([
211
+ const SIMPLE_JSON_ESCAPES = /* @__PURE__ */ new Set([
212
212
  "\"",
213
213
  "\\",
214
214
  "/",
@@ -216,8 +216,7 @@ const VALID_JSON_ESCAPES = /* @__PURE__ */ new Set([
216
216
  "f",
217
217
  "n",
218
218
  "r",
219
- "t",
220
- "u"
219
+ "t"
221
220
  ]);
222
221
  const JSON_CONTROL_ESCAPES = /* @__PURE__ */ new Set([
223
222
  "b",
@@ -226,10 +225,6 @@ const JSON_CONTROL_ESCAPES = /* @__PURE__ */ new Set([
226
225
  "r",
227
226
  "t"
228
227
  ]);
229
- function isControlCharacter(char) {
230
- const codePoint = char.codePointAt(0);
231
- return codePoint !== void 0 && codePoint >= 0 && codePoint <= 31;
232
- }
233
228
  /**
234
229
  * Repairs malformed JSON string literals by:
235
230
  * - escaping raw control characters inside strings
@@ -276,9 +271,6 @@ function repairJson(json, options) {
276
271
  index += 5;
277
272
  continue;
278
273
  }
279
- repaired += "\\\\";
280
- stringValuePrefix += "\\";
281
- continue;
282
274
  }
283
275
  if (!preserveValidControlEscapes && JSON_CONTROL_ESCAPES.has(nextChar)) {
284
276
  stringValuePrefix = stringValuePrefix.slice(-160);
@@ -288,7 +280,7 @@ function repairJson(json, options) {
288
280
  continue;
289
281
  }
290
282
  }
291
- if (VALID_JSON_ESCAPES.has(nextChar)) {
283
+ if (SIMPLE_JSON_ESCAPES.has(nextChar)) {
292
284
  repaired += `\\${nextChar}`;
293
285
  stringValuePrefix += nextChar === "\\" ? "\\" : `\\${nextChar}`;
294
286
  index += 1;
@@ -298,7 +290,7 @@ function repairJson(json, options) {
298
290
  stringValuePrefix += "\\";
299
291
  continue;
300
292
  }
301
- repaired += isControlCharacter(char) ? JSON.stringify(char).slice(1, -1) : char;
293
+ repaired += char.charCodeAt(0) <= 31 ? JSON.stringify(char).slice(1, -1) : char;
302
294
  stringValuePrefix += char;
303
295
  }
304
296
  return repaired;
@@ -1,20 +1,20 @@
1
- import "./index-DJrNQnKw.mjs";
2
- import { $ as StopReason, N as OpenAICompletionsCompat, Nt as ModelDataThinkingFormat, V as ProviderReplayState, a as AssistantMessage, d as Context, et as StreamFn, k as Model, l as CacheRetention, lt as Tool, n as Api, nt as StreamOptions, ot as ThinkingContent, pt as Usage, rt as TextContent, ut as ToolCall } from "./types-DvzmWW8J.mjs";
3
- import { n as ApiRegistry } from "./api-registry-DcEP_o4h.mjs";
4
- import { o as AiProviderStreamHookContext } from "./host-BjIYEjwT.mjs";
5
- import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-Dk4PeQV3.mjs";
1
+ import "./index-BYDvopUB.mjs";
2
+ import { $ as StopReason, N as OpenAICompletionsCompat, Nt as ModelDataThinkingFormat, Q as SimpleStreamOptions, V as ProviderReplayState, a as AssistantMessage, d as Context, et as StreamFn, gt as VercelGatewayRouting, k as Model, l as CacheRetention, lt as Tool, n as Api, nt as StreamOptions, ot as ThinkingContent, pt as Usage, rt as TextContent, ut as ToolCall } from "./types-Bd2T86VJ.mjs";
3
+ import { n as ApiRegistry } from "./api-registry-BhXXYdRA.mjs";
4
+ import { o as AiProviderStreamHookContext } from "./host-CTDz7LXD.mjs";
5
+ import { a as BaseOpenAIStreamOptions, c as OpenAIResponsesCompactionRejection, o as CodeModeToolSurfaceObservation, s as OpenAICompletionsOptions } from "./provider-options-CVrXZBtA.mjs";
6
6
  import { n as OpenAIToolProjection } from "./openai-tool-projection-793cE3QX.mjs";
7
- import "./types-Dlz-8qcy.mjs";
8
- import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicPayloadPolicy, f as resolveAnthropicRequestBetaHeader, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, m as supportsAnthropicServerSideFallback, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicEphemeralCacheControl } from "./anthropic-payload-policy-BZUAchqb.mjs";
9
- import { a as resolveOpenAICompletionsCompat, i as isOpenAICodexResponsesModel, n as detectOpenAICompletionsCompat, o as resolveOpenAIPromptCacheKeySupport, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-CJ0ktmGy.mjs";
10
- import { l as OpenAIResponsesCompactionOutput, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-sAvdqNjS.mjs";
7
+ import "./types-Kdfw_04V.mjs";
8
+ import { a as buildAnthropicSystemBlocks, c as logAnthropicContextEdits, d as resolveAnthropicPayloadPolicy, f as resolveAnthropicRequestBetaHeader, i as applyAnthropicRequestCacheControl, l as resolveAnthropicCacheOptions, m as supportsAnthropicServerSideFallback, n as applyAnthropicEphemeralCacheControlMarkers, o as isAnthropicServerToolClearingEnabled, p as resolveAnthropicServerCompactionPlan, r as applyAnthropicPayloadPolicyToParams, s as isDirectAnthropicModel, t as applyAnthropicContextManagementToRequest, u as resolveAnthropicEphemeralCacheControl } from "./anthropic-payload-policy-DGblkHL5.mjs";
9
+ import { a as resolveOpenAICompletionsCompat, i as isOpenAICodexResponsesModel, n as detectOpenAICompletionsCompat, o as resolveOpenAIPromptCacheKeySupport, r as isNativeOpenAIEndpoint, s as usesNativeOpenAICodexResponsesBackend, t as ResolvedOpenAICompletionsCompat } from "./openai-completions-compat-i-nLZxFy.mjs";
10
+ import { l as OpenAIResponsesCompactionOutput, n as OpenAIResponsesOptions, r as OpenAIResponsesReasoningReplayMetadata } from "./openai-responses-contracts-DKqMJ1Ct.mjs";
11
11
  import { i as resolveOpenAIResponsesServerCompactionPlan, n as resolveOpenAIResponsesCompactEndpointPlan, r as resolveOpenAIResponsesPayloadPolicy, t as applyOpenAIResponsesPayloadPolicy } from "./openai-responses-payload-policy-C7GsA1y0.mjs";
12
- import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-BB2SWdsx.mjs";
13
- import { C as withProviderAcceptanceObserver, S as transportAbortError, _ as notifyProviderStreamOpened, a as coerceTransportToolCallArguments, b as sanitizeTransportPayloadText, c as createModelStreamCooperativeScheduler, d as finalizeTerminalToolCallArguments, f as finalizeTransportStream, g as notifyProviderHttpResponse, h as notifyProviderHttpMetadata, i as assignTransportErrorDetails, l as createWritableTransportEventStream, m as mergeTransportHeaders, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as iterateModelStream, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as failTransportStream, v as parseTerminalToolCallArguments, w as withProviderResponseHook, x as throwIfModelStreamAborted, y as sanitizeNonEmptyTransportPayloadText } from "./transport-stream-shared-CAxkgOSj.mjs";
12
+ import { n as captureOpenAIResponsesCompaction, t as CompactionReplayRefreshRequiredError } from "./openai-responses-compaction-replay-B2FE4Nw8.mjs";
13
+ import { C as withProviderAcceptanceObserver, S as transportAbortError, _ as notifyProviderStreamOpened, a as coerceTransportToolCallArguments, b as sanitizeTransportPayloadText, c as createModelStreamCooperativeScheduler, d as finalizeTerminalToolCallArguments, f as finalizeTransportStream, g as notifyProviderHttpResponse, h as notifyProviderHttpMetadata, i as assignTransportErrorDetails, l as createWritableTransportEventStream, m as mergeTransportHeaders, n as ProviderAcceptance, o as copyProviderAcceptanceObserver, p as iterateModelStream, r as WritableTransportStream, s as createEmptyTransportUsage, t as IncompleteToolCallError, u as failTransportStream, v as parseTerminalToolCallArguments, w as withProviderResponseHook, x as throwIfModelStreamAborted, y as sanitizeNonEmptyTransportPayloadText } from "./transport-stream-shared-BmpzDtdQ.mjs";
14
14
  import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-Cwcjv_fx.mjs";
15
15
  import { r as normalizeOpenAIStrictToolParameters } from "./openai-tool-schema-a5ysBBga.mjs";
16
- import { d as VideoContent, i as ProviderContext, s as ProviderModel } from "./provider-types-De8PRdR0.mjs";
17
- import { a as resolveModelSseDebugMode, i as resolveModelPayloadDebugMode, n as formatModelTransportDebugUrl, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./model-transport-url-C5f59L3Y.mjs";
16
+ import { d as VideoContent, i as ProviderContext, s as ProviderModel } from "./provider-types-CHtRx0dI.mjs";
17
+ import { a as resolveModelPayloadDebugMode, i as emitModelTransportError, n as formatModelTransportDebugUrl, o as resolveModelSseDebugMode, r as emitModelTransportDebug, t as formatModelTransportDebugBaseUrl } from "./model-transport-url-BrsjjdjR.mjs";
18
18
  import OpenAI from "openai";
19
19
  import { Part } from "@google/genai";
20
20
  import { ChatCompletionChunk } from "openai/resources/chat/completions.js";
@@ -24,15 +24,25 @@ export declare function resolveAnthropicMessagesUrl(baseUrl?: string): string;
24
24
  /** Create the stream function used by Anthropic Messages transport models. */
25
25
  export declare function createAnthropicMessagesTransportStreamFn(): StreamFn;
26
26
  //#endregion
27
+ //#region packages/ai/src/transports/anthropic-transport-options.d.ts
28
+ /**
29
+ * Largest completion a request may ask for once transport thinking options
30
+ * apply, for callers that size the prompt before dispatch. Claude transports
31
+ * (Anthropic Messages, Vertex, Bedrock, Bedrock Mantle) may add a thinking
32
+ * budget to `maxTokens`, capped at the model's output limit; some add it even
33
+ * for adaptive models, and their Claude detection is plugin-owned, so every
34
+ * request on these APIs reserves the default budget for its level. Other
35
+ * transports keep `maxTokens` as the total output limit. Over-reserving only
36
+ * shrinks the prompt; it never overflows the window.
37
+ */
38
+ export declare function resolveCompletionTokenReservation(model: Model, maxTokens: number, reasoning: SimpleStreamOptions["reasoning"]): number;
39
+ //#endregion
27
40
  //#region packages/ai/src/transports/deepseek-text-filter.d.ts
28
- interface DeepSeekTextFilter {
29
- /** Push one streamed text chunk and receive any safe visible text segments. */
41
+ /** Create an incremental text filter that strips DeepSeek DSML tool blocks. */
42
+ export declare function createDeepSeekTextFilter(): {
30
43
  push(chunk: string): string[];
31
- /** Flush buffered text at stream end, dropping any unterminated DSML block. */
32
44
  flush(): string[];
33
- }
34
- /** Create an incremental text filter that strips DeepSeek DSML tool blocks. */
35
- export declare function createDeepSeekTextFilter(): DeepSeekTextFilter;
45
+ };
36
46
  //#endregion
37
47
  //#region packages/ai/src/transports/google-thinking-level.d.ts
38
48
  /** Returns whether a Gemini Flash model accepts the MINIMAL thinking level. */
@@ -170,7 +180,7 @@ export declare function buildOpenAICompletionsParams(model: OpenAIModeModel, con
170
180
  type CompletionsRequest = Record<string, unknown> & {
171
181
  model: string;
172
182
  messages: unknown[];
173
- stream: true;
183
+ stream: boolean;
174
184
  tools?: ReturnType<typeof convertTools>["tools"];
175
185
  };
176
186
  //#endregion
@@ -268,6 +278,7 @@ export declare function getCompat(model: OpenAIModeModel): {
268
278
  requiresThinkingAsText: boolean;
269
279
  requiresReasoningContentOnAssistantMessages: boolean;
270
280
  thinkingFormat: ModelDataThinkingFormat;
281
+ vercelGatewayRouting: VercelGatewayRouting;
271
282
  zaiToolStream: boolean;
272
283
  supportsStrictMode: boolean;
273
284
  supportsJsonSchemaResponseFormat: boolean;
@@ -278,9 +289,9 @@ export declare function getCompat(model: OpenAIModeModel): {
278
289
  visibleReasoningDetailTypes: string[];
279
290
  requiresNonEmptyUserOrAssistantMessage: boolean;
280
291
  configuredSupportsLongCacheRetention?: boolean;
292
+ reasoningEffortForOff: "none" | null;
281
293
  reasoningEffortMap: Record<string, string>;
282
294
  openRouterRouting: Record<string, unknown>;
283
- vercelGatewayRouting: Record<string, unknown>;
284
295
  requiresStringContent: boolean;
285
296
  strictMessageKeys: boolean;
286
297
  };
@@ -431,4 +442,4 @@ export declare function convertGoogleTools(tools: Tool[]): {
431
442
  functionDeclarations: Record<string, unknown>[];
432
443
  }[] | undefined;
433
444
  //#endregion
434
- export { CompactionReplayRefreshRequiredError, type GoogleStreamChunk, IncompleteToolCallError, type OpenAICompletionsOptions, type OpenAIResponsesCompactionRejection, ProviderAcceptance, ResolvedOpenAICompletionsCompat, WritableTransportStream, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyOpenAIResponsesPayloadPolicy, assignTransportErrorDetails, buildAnthropicSystemBlocks, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, copyProviderAcceptanceObserver, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createWritableTransportEventStream, detectOpenAICompletionsCompat, emitModelTransportDebug, failTransportStream, finalizeTerminalToolCallArguments, finalizeTransportStream, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, isAnthropicServerToolClearingEnabled, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, iterateModelStream, logAnthropicContextEdits, mergeTransportHeaders, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseTerminalToolCallArguments, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, sanitizeNonEmptyTransportPayloadText, sanitizeTransportPayloadText, sortPromptCacheToolsByName as sortTransportToolsByName, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withProviderAcceptanceObserver, withProviderResponseHook };
445
+ export { CompactionReplayRefreshRequiredError, type GoogleStreamChunk, IncompleteToolCallError, type OpenAICompletionsOptions, type OpenAIResponsesCompactionRejection, ProviderAcceptance, ResolvedOpenAICompletionsCompat, WritableTransportStream, applyAnthropicContextManagementToRequest, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyAnthropicRequestCacheControl, applyOpenAIResponsesPayloadPolicy, assignTransportErrorDetails, buildAnthropicSystemBlocks, createTransportAwareStreamFnForModel as buildTransportAwareSimpleStreamFn, captureOpenAIResponsesCompaction, coerceTransportToolCallArguments, copyProviderAcceptanceObserver, createSupportedTransportStreamFn as createBoundaryAwareStreamFnForModel, createSupportedTransportStreamFn as createOpenClawTransportStreamFnForModel, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createWritableTransportEventStream, detectOpenAICompletionsCompat, emitModelTransportDebug, emitModelTransportError, failTransportStream, finalizeTerminalToolCallArguments, finalizeTransportStream, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, isAnthropicServerToolClearingEnabled, isDirectAnthropicModel, isNativeOpenAIEndpoint, isOpenAICodexResponsesModel, iterateModelStream, logAnthropicContextEdits, mergeTransportHeaders, notifyProviderHttpMetadata, notifyProviderHttpResponse, notifyProviderStreamOpened, parseTerminalToolCallArguments, resolveAnthropicCacheOptions, resolveAnthropicEphemeralCacheControl, resolveAnthropicPayloadPolicy, resolveAnthropicRequestBetaHeader, resolveAnthropicServerCompactionPlan, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAICompletionsCompat, resolveOpenAIPromptCacheKeySupport, resolveOpenAIResponsesCompactEndpointPlan, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIResponsesServerCompactionPlan, sanitizeNonEmptyTransportPayloadText, sanitizeTransportPayloadText, sortPromptCacheToolsByName as sortTransportToolsByName, supportsAnthropicServerSideFallback, throwIfModelStreamAborted, transportAbortError, usesNativeOpenAICodexResponsesBackend, withProviderAcceptanceObserver, withProviderResponseHook };