@openclaw/ai 2026.11.5 → 2026.11.10-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 (157) hide show
  1. package/README.md +15 -3
  2. package/dist/{anthropic-CNEzO12C.mjs → anthropic-CBz5v2U3.mjs} +16 -15
  3. package/dist/{anthropic-payload-policy-DVk38bnY.d.mts → anthropic-payload-policy-BTrHSS_v.d.mts} +4 -8
  4. package/dist/{anthropic-stream-lifecycle-DJUtasDB.mjs → anthropic-stream-lifecycle-96vq-4V9.mjs} +154 -88
  5. package/dist/{anthropic-tool-projection-DcvsDiyX.mjs → anthropic-tool-projection-A9GceDnD.mjs} +4 -5
  6. package/dist/{anthropic-tool-projection-DKAlondV.d.mts → anthropic-tool-projection-DCOX8qai.d.mts} +1 -3
  7. package/dist/{api-registry-DY2MLUyg.d.mts → api-registry-DUEK-a3o.d.mts} +2 -4
  8. package/dist/{assistant-message-events-CHMJgbhs.mjs → assistant-message-events-DtSjIQmB.mjs} +1 -2
  9. package/dist/{assistant-output-C3czmoN4.mjs → assistant-output-kYOaiso5.mjs} +2 -3
  10. package/dist/{azure-openai-responses-client-compat-D0dvJMbZ.mjs → azure-deployment-map-hwDQc3uL.mjs} +2 -16
  11. package/dist/{azure-openai-responses-DRkduRmW.mjs → azure-openai-responses-CZheDTt_.mjs} +12 -12
  12. package/dist/azure-openai-responses-client-compat-DLsS6V6z.mjs +13 -0
  13. package/dist/{base64-C8CdcsjU.mjs → base64-FdymvxN9.mjs} +1 -2
  14. package/dist/cloudflare-BCLfDuew.mjs +15 -0
  15. package/dist/{credential-redaction-DrgndwTJ.d.mts → credential-redaction-BNv5SWQz.d.mts} +0 -2
  16. package/dist/{deferred-event-buffer-tIGkTkTm.mjs → deferred-event-buffer-BgT1IIfq.mjs} +1 -2
  17. package/dist/{diagnostics-CloVGQiK.mjs → diagnostics-BNlb1zlT.mjs} +12 -19
  18. package/dist/{diagnostics-o1PrVNQb.mjs → diagnostics-DP1SXgAW.mjs} +1 -2
  19. package/dist/diagnostics.d.mts +6 -10
  20. package/dist/diagnostics.mjs +3 -3
  21. package/dist/{env-api-keys-BuHc86ya.mjs → env-api-keys-DlUbTgKq.mjs} +1 -2
  22. package/dist/{event-stream-BYmtRe8-.d.mts → event-stream-BJS9Q8G_.d.mts} +1 -3
  23. package/dist/{event-stream-X2gmsUWv.mjs → event-stream-Bf6cK7-d.mjs} +1 -2
  24. package/dist/event-stream-CPiqa8PI.d.mts +1 -0
  25. package/dist/event-stream.d.mts +2 -2
  26. package/dist/event-stream.mjs +1 -1
  27. package/dist/{expect-lbe3Hgrh.mjs → expect-DqyhV9d8.mjs} +1 -2
  28. package/dist/github-copilot-headers-CqLRrd-i.mjs +22 -0
  29. package/dist/{github-copilot-request-facts-BZ_EMo7X.mjs → github-copilot-request-facts-BxuLEdNF.mjs} +2 -3
  30. package/dist/{google-DqG05iBa.mjs → google-BUgkXPYL.mjs} +6 -7
  31. package/dist/{google-interactions-BE7cxFPc.mjs → google-interactions-84f0xFly.mjs} +36 -25
  32. package/dist/{google-messages-p2iBzsAp.mjs → google-messages-Dip5zphv.mjs} +16 -20
  33. package/dist/{google-provider-stream-DZ6tqteU.mjs → google-provider-stream-COaKMdQv.mjs} +14 -15
  34. package/dist/{google-shared-BMYt1xSI.mjs → google-shared-Dooy5JJL.mjs} +11 -14
  35. package/dist/{google-vertex-CAq2q1Ln.mjs → google-vertex--S8AlXUD.mjs} +4 -5
  36. package/dist/{google-video-slots-Bxt-OXO8.mjs → google-video-slots-CzdrKzrO.mjs} +2 -3
  37. package/dist/{host-DqX-64Pb.mjs → host-Cf7zb-48.mjs} +73 -89
  38. package/dist/{host-ccbwPC3A.d.mts → host-Dgpzj407.d.mts} +3 -5
  39. package/dist/{host-policy-Bk85E9ue.mjs → host-policy-B1qzS7Xe.mjs} +2 -3
  40. package/dist/{index-Bczt0MnO.d.mts → index-BDF5kurq.d.mts} +10 -10
  41. package/dist/index.d.mts +8 -10
  42. package/dist/index.mjs +11 -11
  43. package/dist/internal/anthropic.d.mts +10 -21
  44. package/dist/internal/anthropic.mjs +6 -6
  45. package/dist/internal/google-model-family.d.mts +1 -3
  46. package/dist/internal/google-model-family.mjs +2 -3
  47. package/dist/internal/google.d.mts +3 -5
  48. package/dist/internal/google.mjs +1 -1
  49. package/dist/internal/model-request-body.d.mts +5 -5
  50. package/dist/internal/model-request-body.mjs +19 -6
  51. package/dist/internal/openai-completions-compat.d.mts +1 -3
  52. package/dist/internal/openai-completions-compat.mjs +2 -2
  53. package/dist/internal/openai-responses-payload-policy.d.mts +2 -4
  54. package/dist/internal/openai-responses-payload-policy.mjs +2 -2
  55. package/dist/internal/openai.d.mts +10 -32
  56. package/dist/internal/openai.mjs +12 -11
  57. package/dist/internal/reasoning-tag-text-partitioner.d.mts +0 -4
  58. package/dist/internal/reasoning-tag-text-partitioner.mjs +64 -125
  59. package/dist/internal/retry-after.d.mts +1 -1
  60. package/dist/internal/retry-after.mjs +1 -2
  61. package/dist/internal/runtime.d.mts +9 -43
  62. package/dist/internal/runtime.mjs +14 -15
  63. package/dist/internal/session-resources.d.mts +11 -0
  64. package/dist/{session-resources-vKvGIE3J.mjs → internal/session-resources.mjs} +2 -3
  65. package/dist/internal/shared.d.mts +17 -26
  66. package/dist/internal/shared.mjs +10 -10
  67. package/dist/internal/tool-schema.d.mts +2 -22
  68. package/dist/internal/tool-schema.mjs +3 -3
  69. package/dist/{llm-request-activity-DzaHoRAU.mjs → llm-request-activity-v1liRqNt.mjs} +1 -2
  70. package/dist/{mistral-DIGInqJI.mjs → mistral-BAps5cN2.mjs} +713 -299
  71. package/dist/{model-transport-url-BdksnBqu.d.mts → model-transport-url-Dad-sfx2.d.mts} +0 -4
  72. package/dist/{number-coercion-C7HsBgUL.mjs → number-coercion-BO6bhGm6.mjs} +2 -3
  73. package/dist/{observe-async-iterator-DgmegcZR.mjs → observe-async-iterator-DdOlbgrr.mjs} +1 -2
  74. package/dist/{observe-async-iterator-AlARO5wS.d.mts → observe-async-iterator-DeB_Vxes.d.mts} +14 -7
  75. package/dist/openai-BtJTmLWF.mjs +21460 -0
  76. package/dist/{openai-chatgpt-jwt-KWcgd0d_.mjs → openai-chatgpt-jwt-v5F5jJmX.mjs} +1 -2
  77. package/dist/{openai-chatgpt-responses-C6rEZcsZ.mjs → openai-chatgpt-responses-CYXMKG89.mjs} +53 -49
  78. package/dist/{openai-completions-B93R3N3b.mjs → openai-completions-Bi4Ghg3V.mjs} +6 -7
  79. package/dist/{openai-completions-compat-CJ-NsDzg.d.mts → openai-completions-compat-BJBQ682M.d.mts} +10 -5
  80. package/dist/{openai-completions-compat-CS3dlDBR.mjs → openai-completions-compat-DZLGotNt.mjs} +19 -16
  81. package/dist/{openai-completions-reasoning-replay-BwT1xwRI.mjs → openai-completions-reasoning-replay-DyH5XzNo.mjs} +1 -2
  82. package/dist/{openai-completions-transport-DHTFq-BM.mjs → openai-completions-transport-otONaRhv.mjs} +160 -527
  83. package/dist/{openai-prompt-cache-BZGaIWYh.d.mts → openai-prompt-cache-C5rwtmA_.d.mts} +2 -4
  84. package/dist/{openai-prompt-cache-3H_Fz0ya.mjs → openai-prompt-cache-CJv1bvw0.mjs} +3 -5
  85. package/dist/openai-provider-client-apBsWo9b.mjs +51 -0
  86. package/dist/{openai-responses-DSxPKV0U.mjs → openai-responses-CiIAm8fJ.mjs} +14 -14
  87. package/dist/{openai-responses-compaction-replay-DXF5BjD2.d.mts → openai-responses-compaction-replay-CUw4owu9.d.mts} +6 -7
  88. package/dist/{openai-responses-contracts-Cb1IIRRG.d.mts → openai-responses-contracts-bYtvXSvv.d.mts} +7 -12
  89. package/dist/{openai-responses-contracts-xU-n9AJJ.mjs → openai-responses-contracts-eppTI5DQ.mjs} +11 -18
  90. package/dist/{openai-responses-endpoint-CqO3ejTe.mjs → openai-responses-endpoint-AeVu3HmP.mjs} +80 -34
  91. package/dist/{openai-responses-payload-policy-BsQaD-gD.d.mts → openai-responses-payload-policy-Cihgy9fC.d.mts} +0 -2
  92. package/dist/{openai-responses-request-lifecycle-C_3FKkl7.mjs → openai-responses-request-lifecycle-DfE4xNHj.mjs} +120 -20
  93. package/dist/{openai-responses-shared-En3Jf0Vg.mjs → openai-responses-shared-BAJzOqwt.mjs} +1649 -312
  94. package/dist/{openai-responses-terminal-usage-D7IhRA6i.d.mts → openai-responses-terminal-usage-BYXQTt9u.d.mts} +2 -4
  95. package/dist/openai-responses-websocket-DywDiO81.mjs +8143 -0
  96. package/dist/{openai-stop-reason-8s70vDXj.mjs → openai-stop-reason-cA0GUHlU.mjs} +4 -3
  97. package/dist/{openai-tool-schema-CvxySRyf.mjs → openai-tool-schema-Ca74_fkR.mjs} +17 -26
  98. package/dist/openai.LICENSE +201 -0
  99. package/dist/{otel-B2u5HGvm.mjs → otel-C5Cn7IFQ.mjs} +8 -8
  100. package/dist/{overflow-CpApyjG2.mjs → overflow-CM0yZomw.mjs} +2 -3
  101. package/dist/{positive-integer-DiqE5vNi.mjs → positive-integer-AM4ltyhP.mjs} +2 -3
  102. package/dist/{prompt-cache-stability-w-ICeyOI.mjs → prompt-cache-stability-oTx0nIsh.mjs} +3 -4
  103. package/dist/{prompt-cache-stability-Cwcjv_fx.d.mts → prompt-cache-stability-xNfkD-3g.d.mts} +0 -2
  104. package/dist/{provider-error-DD-fo4Rz.mjs → provider-error-B7aKA_dg.mjs} +24 -23
  105. package/dist/{provider-error-CnaWYTRY.d.mts → provider-error-DZMru0Jv.d.mts} +0 -2
  106. package/dist/{provider-options-BQ2Msop2.d.mts → provider-options-CR_UfgUE.d.mts} +15 -11
  107. package/dist/{provider-replay-context--QGWotXx.mjs → provider-replay-context-CHJQzB0n.mjs} +3 -4
  108. package/dist/{provider-transcript-transform-Hr1kCoMX.mjs → provider-transcript-transform-C-WfgiLJ.mjs} +2 -3
  109. package/dist/{provider-transport-turn-state-DyaOKAYm.mjs → provider-transport-turn-state-BdMA1v46.mjs} +4 -27
  110. package/dist/{provider-types-B1e98js5.d.mts → provider-types-CfiTmXyw.d.mts} +3 -5
  111. package/dist/provider-types.d.mts +7 -7
  112. package/dist/provider-types.mjs +1 -2
  113. package/dist/providers.d.mts +2 -4
  114. package/dist/providers.mjs +14 -15
  115. package/dist/{record-coerce-BQaoiN3r.mjs → record-coerce-BgUo6bj4.mjs} +1 -2
  116. package/dist/{request-headers-DO4Mqhw1.mjs → request-headers-DJ4QrMC_.mjs} +1 -2
  117. package/dist/{required-api-key-2zZTkmsi.mjs → required-api-key-BniLGxy4.mjs} +2 -3
  118. package/dist/{retry-after-DnHBlFS2.d.mts → retry-after-f3ZIm8TA.d.mts} +0 -2
  119. package/dist/rolldown-runtime-DYf_mQCB.mjs +34 -0
  120. package/dist/{sanitize-unicode-CRGuMONI.mjs → sanitize-unicode-B3kUqQ-q.mjs} +1 -2
  121. package/dist/{sanitize-unicode-BISmUlUv.d.mts → sanitize-unicode-DlVtgmsw.d.mts} +2 -6
  122. package/dist/{session-affinity-DA4WHv1h.mjs → session-affinity-Czm9tjAm.mjs} +1 -2
  123. package/dist/{simple-options-CQNPKCEb.mjs → simple-options-D8CTqHvk.mjs} +40 -16
  124. package/dist/src-CNWvILd1.mjs +2 -0
  125. package/dist/{src-CQ7nH2mL.mjs → src-CmBmaGOV.mjs} +87 -20
  126. package/dist/{stable-stringify-CchQEmeA.mjs → stable-stringify-CGB-o900.mjs} +10 -8
  127. package/dist/{stream-DM-q0y5H.mjs → stream-BEE5qy7Z.mjs} +5 -7
  128. package/dist/{stream-first-event-timeout-B7RcufAV.mjs → stream-first-event-timeout-CWiv_y--.mjs} +2 -3
  129. package/dist/{streaming-byte-guard-DBXr1XYn.mjs → streaming-byte-guard-gOcUrHJF.mjs} +1 -2
  130. package/dist/{string-coerce-BCuWMIrk.mjs → string-coerce-CpcyRbc6.mjs} +1 -2
  131. package/dist/{string-normalization-B8TDDBX_.mjs → string-normalization-CS77PHD3.mjs} +2 -3
  132. package/dist/{telemetry-DJibfNKZ.mjs → telemetry-Cd4i-clM.mjs} +6 -8
  133. package/dist/{tool-schema-json-projection-BSHb4gaJ.mjs → tool-schema-json-projection-C13fPskA.mjs} +11 -16
  134. package/dist/{transport-stream-shared-CBVh6QEc.mjs → transport-stream-shared-DEpLe9fG.mjs} +24 -30
  135. package/dist/{transport-stream-shared-D3IAU4jn.d.mts → transport-stream-shared-DW4DoJLv.d.mts} +7 -8
  136. package/dist/{transport-utils-rxOHnq9y.mjs → transport-utils-Cx9L80PZ.mjs} +6 -8
  137. package/dist/transports.d.mts +29 -82
  138. package/dist/transports.mjs +39 -38
  139. package/dist/{types-BVdTf0YV.d.mts → types-BNp71XKW.d.mts} +11 -6
  140. package/dist/types-CwcLeW-7.d.mts +1 -0
  141. package/dist/{types-OVEWUaDh.mjs → types-DIBUKaTM.mjs} +1 -2
  142. package/dist/types.d.mts +7 -7
  143. package/dist/types.mjs +9 -9
  144. package/dist/{usage-CJH5D6Ea.mjs → usage-B8ggJtuG.mjs} +1 -2
  145. package/dist/{validation-QmyD0E5A.d.mts → validation-BFNWNeUl.d.mts} +1 -3
  146. package/dist/{validation-DGXqfvkj.mjs → validation-BO7nCOKO.mjs} +5 -8
  147. package/dist/validation.d.mts +1 -1
  148. package/dist/validation.mjs +1 -1
  149. package/dist/ws.LICENSE +20 -0
  150. package/dist/x509-transport-state-D4gFbgWG.mjs +40 -0
  151. package/package.json +13 -7
  152. package/dist/.source-module-urls/fe058cc430242ce2ab0dfbcbe153e240a52cf9c3072c3dc0a73e5f956b6ba49b.json +0 -1
  153. package/dist/cloudflare-BJ2_Xabx.mjs +0 -39
  154. package/dist/event-stream-B4ZcSvsu.d.mts +0 -1
  155. package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
  156. package/dist/src-BUsVkrNt.mjs +0 -105
  157. package/dist/types-Cb3-5WM9.d.mts +0 -1
@@ -1,6 +1,6 @@
1
- import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
2
- import { D as shortHash } from "./transport-stream-shared-CBVh6QEc.mjs";
3
- //#region packages/ai/src/transports/provider-replay-context.ts
1
+ import { o as isRecord } from "./record-coerce-BgUo6bj4.mjs";
2
+ import { O as shortHash } from "./transport-stream-shared-DEpLe9fG.mjs";
3
+ // packages/ai/src/transports/provider-replay-context.ts
4
4
  function isProviderReplayContext(value) {
5
5
  return isRecord(value) && typeof value.provider === "string" && typeof value.api === "string" && typeof value.model === "string" && (value.baseUrlHash === void 0 || typeof value.baseUrlHash === "string") && (value.sessionHash === void 0 || typeof value.sessionHash === "string") && (value.authProfileHash === void 0 || typeof value.authProfileHash === "string");
6
6
  }
@@ -20,5 +20,4 @@ function buildProviderReplayContext(model, options) {
20
20
  function providerReplayContextMatches(state, context) {
21
21
  return state.provider === context.provider && state.api === context.api && state.baseUrlHash === context.baseUrlHash && state.sessionHash === context.sessionHash;
22
22
  }
23
- //#endregion
24
23
  export { isProviderReplayContext as n, providerReplayContextMatches as r, buildProviderReplayContext as t };
@@ -1,5 +1,5 @@
1
- import { c as transformMessages } from "./host-DqX-64Pb.mjs";
2
- //#region packages/ai/src/provider-transcript-transform.ts
1
+ import { c as transformMessages } from "./host-Cf7zb-48.mjs";
2
+ // packages/ai/src/provider-transcript-transform.ts
3
3
  const IMAGE_OMISSION = "(image omitted: model does not support images)";
4
4
  const VIDEO_OMISSION = "(video omitted: provider does not support video input)";
5
5
  function transformProviderMessages(messages, model, normalizeToolCallId) {
@@ -28,5 +28,4 @@ function transformProviderMessages(messages, model, normalizeToolCallId) {
28
28
  return Object.isFrozen(message) && Object.isFrozen(content) && result.length === content.length && result.every((block, index) => block === content[index]) ? message : Object.assign({}, message, { content: result });
29
29
  }), target, normalizeToolCallId);
30
30
  }
31
- //#endregion
32
31
  export { transformProviderMessages as t };
@@ -1,29 +1,7 @@
1
- import { r as getAiTransportHost } from "./host-DqX-64Pb.mjs";
2
- import { n as resolveCloudflareBaseUrl, t as isCloudflareProvider } from "./cloudflare-BJ2_Xabx.mjs";
3
- import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-DA4WHv1h.mjs";
4
- import { Ft as resolveOpenAIClientBaseUrl, Lt as withOpenAIErrorResponseHook } from "./openai-responses-shared-En3Jf0Vg.mjs";
1
+ import { r as getAiTransportHost } from "./host-Cf7zb-48.mjs";
2
+ import { n as resolveOpencodeSessionHeaders, t as hasOpencodeSessionHeader } from "./session-affinity-Czm9tjAm.mjs";
5
3
  import { randomUUID } from "node:crypto";
6
- import OpenAI from "openai";
7
- //#region packages/ai/src/providers/openai-provider-client.ts
8
- function createOpenAIProviderClient(model, apiKey, headers, optionsHeaders, onResponse) {
9
- if (optionsHeaders) Object.assign(headers, optionsHeaders);
10
- const defaultHeaders = model.provider === "cloudflare-ai-gateway" ? {
11
- ...headers,
12
- Authorization: headers.Authorization ?? null,
13
- "cf-aig-authorization": `Bearer ${apiKey}`
14
- } : headers;
15
- const baseUrl = isCloudflareProvider(model.provider) ? resolveCloudflareBaseUrl(model) : model.baseUrl;
16
- return new OpenAI({
17
- apiKey,
18
- baseURL: resolveOpenAIClientBaseUrl(model, baseUrl),
19
- dangerouslyAllowBrowser: true,
20
- defaultHeaders,
21
- maxRetries: 0,
22
- fetch: withOpenAIErrorResponseHook(getAiTransportHost().buildModelFetch(model) ?? globalThis.fetch, onResponse, model)
23
- });
24
- }
25
- //#endregion
26
- //#region packages/ai/src/transports/provider-transport-turn-state.ts
4
+ // packages/ai/src/transports/provider-transport-turn-state.ts
27
5
  function resolveProviderTransportTurnState(model, params) {
28
6
  const normalizedProvider = model.provider.trim().toLowerCase();
29
7
  const allowRuntimePluginLoad = normalizedProvider === "openai" || normalizedProvider === "azure-openai" || normalizedProvider === "azure-openai-responses";
@@ -60,5 +38,4 @@ function resolveProviderSimpleCompletionHeaders(model, options) {
60
38
  ...optionHeaders
61
39
  };
62
40
  }
63
- //#endregion
64
- export { createOpenAIProviderClient as i, resolveProviderSimpleCompletionHeaders as n, resolveProviderTransportTurnState as r, filterProviderTurnHeadersForExplicitOpencodeSession as t };
41
+ export { resolveProviderSimpleCompletionHeaders as n, resolveProviderTransportTurnState as r, filterProviderTurnHeadersForExplicitOpencodeSession as t };
@@ -1,7 +1,6 @@
1
- import { _t as UserMessage, a as AssistantMessage, at as StreamOptions, d as Context, k as Model, mt as ToolResultMessage, n as Api, ot as TextContent, p as ImageContent, s as AssistantMessageEventStreamContract } from "./types-BVdTf0YV.mjs";
2
- import "./index-Bczt0MnO.mjs";
3
- import "./types-Cb3-5WM9.mjs";
4
- //#region packages/ai/src/provider-types.d.ts
1
+ import { _t as UserMessage, a as AssistantMessage, at as StreamOptions, d as Context, k as Model, mt as ToolResultMessage, n as Api, ot as TextContent, p as ImageContent, s as AssistantMessageEventStreamContract } from "./types-BNp71XKW.mjs";
2
+ import "./index-BDF5kurq.mjs";
3
+ import "./types-CwcLeW-7.mjs";
5
4
  declare const PROVIDER_CONTEXT_HANDOFF: unique symbol;
6
5
  declare const PROVIDER_MODEL_INPUT: unique symbol;
7
6
  type VideoContent = Omit<ImageContent, "type"> & {
@@ -27,5 +26,4 @@ type ProviderStreamOptions = StreamOptions & {
27
26
  type ProviderStreamFunction<TApi extends Api = Api, TOptions extends StreamOptions = ProviderStreamOptions> = (model: ProviderModel<TApi>, context: ProviderContext, options?: TOptions) => AssistantMessageEventStreamContract;
28
27
  /** Resolves provider-only context without widening the canonical call contract. */
29
28
  declare function resolveProviderContext(context: Context | ProviderContext, options?: ProviderStreamOptions): Promise<ProviderContext>;
30
- //#endregion
31
29
  export { ProviderContext as a, ProviderModel as c, ProviderUserMessage as d, VideoContent as f, PROVIDER_MODEL_INPUT as i, ProviderStreamFunction as l, ModelInputContent as n, ProviderContextHandoff as o, resolveProviderContext as p, PROVIDER_CONTEXT_HANDOFF as r, ProviderMessage as s, MediaContent as t, ProviderStreamOptions as u };
@@ -1,7 +1,7 @@
1
- import { C as supportsClaudeFastMode, D as supportsClaudeServerCompaction, E as supportsClaudeNativeXhighEffort, S as supportsClaudeAdaptiveThinking, T as supportsClaudeNativeMaxEffort, _ as resolveClaudeOpus55ModelIdentity, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as resolveClaudeSonnet5ModelIdentity, c as bindsClaudeThinkingPrefix, d as requiresClaudeMandatoryAdaptiveThinking, f as resolveClaudeFable5ModelIdentity, g as resolveClaudeNativeThinkingLevelMap, h as resolveClaudeMythos5ModelIdentity, i as CLAUDE_OPUS_55_THINKING_PROFILE, l as requiresClaudeBetweenToolsThinking, m as resolveClaudeModelIdentity, n as CLAUDE_FABLE_5_THINKING_PROFILE, o as CLAUDE_SONNET_55_THINKING_PROFILE, p as resolveClaudeHaiku55ModelIdentity, r as CLAUDE_HAIKU_55_THINKING_PROFILE, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as observeAsyncIterator, u as requiresClaudeDefaultSampling, v as resolveClaudeOpus5ModelIdentity, w as supportsClaudeInHistorySystemMessages, x as supportsClaude1MContext, y as resolveClaudeSonnet55ModelIdentity } from "./observe-async-iterator-AlARO5wS.mjs";
2
- import { $ as RawPricingTier, A as ModelCostConfig, At as DiagnosticErrorInfo, B as PricingTier, C as KnownApi, Ct as isRuntimeContextMessage, D as MaybePromise, Dt as runtimeContextContentToText, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as readRuntimeContextMetadata, F as OpenAIResponsesCompat, Ft as formatThrownValue, H as ProviderImagesOptions, I as OpenRouterRouting, It as isProviderRefusalAssistantError, J as RUNTIME_CONTEXT_CUSTOM_TYPE, K as REPETITIVE_OUTPUT_ERROR_CODE, L as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Lt as readProviderRefusalReview, M as ModelRequestHeaders, Mt as appendAssistantMessageDiagnostic, N as ModelThinkingLevel, Nt as createAssistantMessageDiagnostic, Ot as setRuntimeContextRetention, P as OpenAICompletionsCompat, Pt as extractDiagnosticError, Q as RawModelCostConfig, R as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Rt as recordSuppressedReasoning, S as ImagesStopReason, St as hasRuntimeContextMarker, T as KnownImagesProvider, Tt as labelRuntimeContextText, U as ProviderReplayState, V as Provider, W as ProviderResponse, X as RUNTIME_CONTEXT_FOOTER, Y as RUNTIME_CONTEXT_END_MARKER, Z as RUNTIME_CONTEXT_HEADER, _ as ImagesInputContent, _t as UserMessage, a as AssistantMessage, at as StreamOptions, b as ImagesOutputContent, bt as escapeRuntimeContextFooter, c as AssistantMessageEventStreamLike, ct as ThinkingBudgets, dt as ThinkingLevelMap, et as RuntimeContextMessage, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Tool, g as ImagesFunction, gt as Usage, h as ImagesContext, ht as Transport, i as AssistantImages, j as ModelCostRates, jt as ProviderRefusalReview, kt as AssistantMessageDiagnostic, l as CacheRetention, lt as ThinkingContent, m as ImagesApi, mt as ToolResultMessage, n as Api, nt as StopReason, o as AssistantMessageEvent, ot as TextContent, p as ImageContent, pt as ToolCall, q as RUNTIME_CONTEXT_BEGIN_MARKER, r as AssistantDeliveryTtsFacts, rt as StreamFn, s as AssistantMessageEventStreamContract, st as TextSignatureV1, t as AnthropicMessagesCompat, tt as SimpleStreamOptions, u as CompleteSimpleFn, ut as ThinkingLevel, v as ImagesModel, vt as ValidateToolArgumentsFn, w as KnownImagesApi, wt as labelRuntimeContextContent, x as ImagesProvider, xt as hasLegacyRuntimeContextEnvelope, y as ImagesOptions, yt as VercelGatewayRouting, z as PreparedSystemPrompt } from "./types-BVdTf0YV.mjs";
3
- import { a as normalizeResolvedPricing, i as normalizeModelCostConfig, n as appendTextDeltaToAssistantMessage, r as calculateUsageCost, t as omitNullRequestHeaders } from "./index-Bczt0MnO.mjs";
4
- import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BYmtRe8-.mjs";
5
- import { n as validateToolCall, t as validateToolArguments } from "./validation-QmyD0E5A.mjs";
6
- import { a as ProviderContext, c as ProviderModel, d as ProviderUserMessage, f as VideoContent, i as PROVIDER_MODEL_INPUT, l as ProviderStreamFunction, n as ModelInputContent, o as ProviderContextHandoff, p as resolveProviderContext, r as PROVIDER_CONTEXT_HANDOFF, s as ProviderMessage, t as MediaContent, u as ProviderStreamOptions } from "./provider-types-B1e98js5.mjs";
7
- export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_HAIKU_55_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelRequestHeaders, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_MODEL_INPUT, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PreparedSystemPrompt, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type REPETITIVE_OUTPUT_ERROR_CODE, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type appendTextDeltaToAssistantMessage, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type observeAsyncIterator, type omitNullRequestHeaders, type readProviderRefusalReview, type readRuntimeContextMetadata, type recordSuppressedReasoning, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeHaiku55ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type supportsClaudeServerCompaction, type validateToolArguments, type validateToolCall };
1
+ import { A as usesClaude5RequestContract, C as supportsClaude1MContext, D as supportsClaudeNativeMaxEffort, E as supportsClaudeInHistorySystemMessages, O as supportsClaudeNativeXhighEffort, S as resolveClaudeSonnet5ModelIdentity, T as supportsClaudeFastMode, _ as resolveClaudeMythos5ModelIdentity, a as CLAUDE_OPUS_5_THINKING_PROFILE, b as resolveClaudeOpus5ModelIdentity, c as bindsClaudeThinkingPrefix, d as requiresClaudeBetweenToolsThinking, f as requiresClaudeDefaultSampling, g as resolveClaudeModelIdentity, h as resolveClaudeHaiku55ModelIdentity, i as CLAUDE_OPUS_55_THINKING_PROFILE, k as supportsClaudeServerCompaction, l as isReleasedAdaptiveClaudeGeneration, m as resolveClaudeFable5ModelIdentity, n as CLAUDE_FABLE_5_THINKING_PROFILE, o as CLAUDE_SONNET_55_THINKING_PROFILE, p as requiresClaudeMandatoryAdaptiveThinking, r as CLAUDE_HAIKU_55_THINKING_PROFILE, s as CLAUDE_SONNET_5_THINKING_PROFILE, t as observeAsyncIterator, u as rejectsClaudeAssistantPrefill, v as resolveClaudeNativeThinkingLevelMap, w as supportsClaudeAdaptiveThinking, x as resolveClaudeSonnet55ModelIdentity, y as resolveClaudeOpus55ModelIdentity } from "./observe-async-iterator-DeB_Vxes.mjs";
2
+ import { $ as RawPricingTier, A as ModelCostConfig, At as DiagnosticErrorInfo, B as PricingTier, C as KnownApi, Ct as isRuntimeContextMessage, D as MaybePromise, Dt as runtimeContextContentToText, E as MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, Et as readRuntimeContextMetadata, F as OpenAIResponsesCompat, Ft as formatThrownValue, H as ProviderImagesOptions, I as OpenRouterRouting, It as isProviderRefusalAssistantError, J as RUNTIME_CONTEXT_CUSTOM_TYPE, K as REPETITIVE_OUTPUT_ERROR_CODE, L as PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, Lt as readProviderRefusalReview, M as ModelRequestHeaders, Mt as appendAssistantMessageDiagnostic, N as ModelThinkingLevel, Nt as createAssistantMessageDiagnostic, Ot as setRuntimeContextRetention, P as OpenAICompletionsCompat, Pt as extractDiagnosticError, Q as RawModelCostConfig, R as PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, Rt as recordSuppressedReasoning, S as ImagesStopReason, St as hasRuntimeContextMarker, T as KnownImagesProvider, Tt as labelRuntimeContextText, U as ProviderReplayState, V as Provider, W as ProviderResponse, X as RUNTIME_CONTEXT_FOOTER, Y as RUNTIME_CONTEXT_END_MARKER, Z as RUNTIME_CONTEXT_HEADER, _ as ImagesInputContent, _t as UserMessage, a as AssistantMessage, at as StreamOptions, b as ImagesOutputContent, bt as escapeRuntimeContextFooter, c as AssistantMessageEventStreamLike, ct as ThinkingBudgets, dt as ThinkingLevelMap, et as RuntimeContextMessage, f as DEFAULT_MISSING_TOOL_RESULT_TEXT, ft as Tool, g as ImagesFunction, gt as Usage, h as ImagesContext, ht as Transport, i as AssistantImages, j as ModelCostRates, jt as ProviderRefusalReview, kt as AssistantMessageDiagnostic, l as CacheRetention, lt as ThinkingContent, m as ImagesApi, mt as ToolResultMessage, n as Api, nt as StopReason, o as AssistantMessageEvent, ot as TextContent, p as ImageContent, pt as ToolCall, q as RUNTIME_CONTEXT_BEGIN_MARKER, r as AssistantDeliveryTtsFacts, rt as StreamFn, s as AssistantMessageEventStreamContract, st as TextSignatureV1, t as AnthropicMessagesCompat, tt as SimpleStreamOptions, u as CompleteSimpleFn, ut as ThinkingLevel, v as ImagesModel, vt as ValidateToolArgumentsFn, w as KnownImagesApi, wt as labelRuntimeContextContent, x as ImagesProvider, xt as hasLegacyRuntimeContextEnvelope, y as ImagesOptions, yt as VercelGatewayRouting, z as PreparedSystemPrompt } from "./types-BNp71XKW.mjs";
3
+ import { a as extractEmbeddingUsage, i as calculateUsageCost, n as appendTextDeltaToAssistantMessage, o as normalizeModelCostConfig, r as EmbeddingUsage, s as normalizeResolvedPricing, t as omitNullRequestHeaders } from "./index-BDF5kurq.mjs";
4
+ import { n as EventStream, r as createAssistantMessageEventStream, t as AssistantMessageEventStream } from "./event-stream-BJS9Q8G_.mjs";
5
+ import { n as validateToolCall, t as validateToolArguments } from "./validation-BFNWNeUl.mjs";
6
+ import { a as ProviderContext, c as ProviderModel, d as ProviderUserMessage, f as VideoContent, i as PROVIDER_MODEL_INPUT, l as ProviderStreamFunction, n as ModelInputContent, o as ProviderContextHandoff, p as resolveProviderContext, r as PROVIDER_CONTEXT_HANDOFF, s as ProviderMessage, t as MediaContent, u as ProviderStreamOptions } from "./provider-types-CfiTmXyw.mjs";
7
+ export { type AnthropicMessagesCompat, type Api, type AssistantDeliveryTtsFacts, type AssistantImages, type AssistantMessage, type AssistantMessageDiagnostic, type AssistantMessageEvent, type AssistantMessageEventStream, type AssistantMessageEventStreamContract, type AssistantMessageEventStreamLike, type CLAUDE_FABLE_5_THINKING_PROFILE, type CLAUDE_HAIKU_55_THINKING_PROFILE, type CLAUDE_OPUS_55_THINKING_PROFILE, type CLAUDE_OPUS_5_THINKING_PROFILE, type CLAUDE_SONNET_55_THINKING_PROFILE, type CLAUDE_SONNET_5_THINKING_PROFILE, type CacheRetention, type CompleteSimpleFn, type ProviderContext as Context, ProviderContext, type DEFAULT_MISSING_TOOL_RESULT_TEXT, type DiagnosticErrorInfo, type EmbeddingUsage, type EventStream, type ImageContent, type ImagesApi, type ImagesContext, type ImagesFunction, type ImagesInputContent, type ImagesModel, type ImagesOptions, type ImagesOutputContent, type ImagesProvider, type ImagesStopReason, type KnownApi, type KnownImagesApi, type KnownImagesProvider, type MALFORMED_TOOL_CALL_ARGUMENTS_ERROR_CODE, type MaybePromise, MediaContent, type ProviderMessage as Message, ProviderMessage, type ProviderModel as Model, ProviderModel, type ModelCostConfig, type ModelCostRates, ModelInputContent, type ModelRequestHeaders, type ModelThinkingLevel, type OpenAICompletionsCompat, type OpenAIResponsesCompat, type OpenRouterRouting, PROVIDER_CONTEXT_HANDOFF, type PROVIDER_FAILURE_WITH_OUTPUT_ERROR_CODE, PROVIDER_MODEL_INPUT, type PROVIDER_POST_DISPATCH_AMBIGUITY_ERROR_CODE, type PreparedSystemPrompt, type PricingTier, type Provider, ProviderContextHandoff, type ProviderImagesOptions, type ProviderRefusalReview, type ProviderReplayState, type ProviderResponse, ProviderStreamFunction, type ProviderStreamFunction as StreamFunction, ProviderStreamOptions, ProviderUserMessage, type REPETITIVE_OUTPUT_ERROR_CODE, type RUNTIME_CONTEXT_BEGIN_MARKER, type RUNTIME_CONTEXT_CUSTOM_TYPE, type RUNTIME_CONTEXT_END_MARKER, type RUNTIME_CONTEXT_FOOTER, type RUNTIME_CONTEXT_HEADER, type RawModelCostConfig, type RawPricingTier, type RuntimeContextMessage, type SimpleStreamOptions, type StopReason, type StreamFn, type StreamOptions, type TextContent, type TextSignatureV1, type ThinkingBudgets, type ThinkingContent, type ThinkingLevel, type ThinkingLevelMap, type Tool, type ToolCall, type ToolResultMessage, type Transport, type Usage, type UserMessage, type ValidateToolArgumentsFn, type VercelGatewayRouting, VideoContent, type appendAssistantMessageDiagnostic, type appendTextDeltaToAssistantMessage, type bindsClaudeThinkingPrefix, type calculateUsageCost, type createAssistantMessageDiagnostic, type createAssistantMessageEventStream, type escapeRuntimeContextFooter, type extractDiagnosticError, type extractEmbeddingUsage, type formatThrownValue, type hasLegacyRuntimeContextEnvelope, type hasRuntimeContextMarker, type isProviderRefusalAssistantError, type isReleasedAdaptiveClaudeGeneration, type isRuntimeContextMessage, type labelRuntimeContextContent, type labelRuntimeContextText, type normalizeModelCostConfig, type normalizeResolvedPricing, type observeAsyncIterator, type omitNullRequestHeaders, type readProviderRefusalReview, type readRuntimeContextMetadata, type recordSuppressedReasoning, type rejectsClaudeAssistantPrefill, type requiresClaudeBetweenToolsThinking, type requiresClaudeDefaultSampling, type requiresClaudeMandatoryAdaptiveThinking, type resolveClaudeFable5ModelIdentity, type resolveClaudeHaiku55ModelIdentity, type resolveClaudeModelIdentity, type resolveClaudeMythos5ModelIdentity, type resolveClaudeNativeThinkingLevelMap, type resolveClaudeOpus55ModelIdentity, type resolveClaudeOpus5ModelIdentity, type resolveClaudeSonnet55ModelIdentity, type resolveClaudeSonnet5ModelIdentity, resolveProviderContext, type runtimeContextContentToText, type setRuntimeContextRetention, type supportsClaude1MContext, type supportsClaudeAdaptiveThinking, type supportsClaudeFastMode, type supportsClaudeInHistorySystemMessages, type supportsClaudeNativeMaxEffort, type supportsClaudeNativeXhighEffort, type supportsClaudeServerCompaction, type usesClaude5RequestContract, type validateToolArguments, type validateToolCall };
@@ -1,9 +1,8 @@
1
- //#region packages/ai/src/provider-types.ts
1
+ // packages/ai/src/provider-types.ts
2
2
  const PROVIDER_CONTEXT_HANDOFF = Symbol("providerContextHandoff");
3
3
  const PROVIDER_MODEL_INPUT = Symbol("providerModelInput");
4
4
  /** Resolves provider-only context without widening the canonical call contract. */
5
5
  async function resolveProviderContext(context, options) {
6
6
  return options?.[PROVIDER_CONTEXT_HANDOFF]?.() ?? context;
7
7
  }
8
- //#endregion
9
8
  export { PROVIDER_CONTEXT_HANDOFF, PROVIDER_MODEL_INPUT, resolveProviderContext };
@@ -1,11 +1,9 @@
1
- import { n as ApiRegistry } from "./api-registry-DY2MLUyg.mjs";
2
- import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-BZGaIWYh.mjs";
3
- //#region packages/ai/src/providers/register-builtins.d.ts
1
+ import { n as ApiRegistry } from "./api-registry-DUEK-a3o.mjs";
2
+ import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-C5rwtmA_.mjs";
4
3
  /** Source id used for built-in API provider registrations. */
5
4
  export declare const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
6
5
  /** Registers every built-in API provider in one runtime registry. */
7
6
  export declare function registerBuiltInApiProviders(registry: ApiRegistry): void;
8
7
  /** Restores the built-in provider registry state for tests. */
9
8
  export declare function resetApiProviders(registry: ApiRegistry): void;
10
- //#endregion
11
9
  export { OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, clampOpenAIPromptCacheKey };
@@ -1,8 +1,8 @@
1
- import { t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
2
- import { n as projectProviderError } from "./provider-error-DD-fo4Rz.mjs";
3
- import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-3H_Fz0ya.mjs";
4
- import { t as createZeroUsage } from "./usage-CJH5D6Ea.mjs";
5
- //#region packages/ai/src/providers/register-builtins.ts
1
+ import { t as AssistantMessageEventStream } from "./event-stream-Bf6cK7-d.mjs";
2
+ import { n as projectProviderError } from "./provider-error-B7aKA_dg.mjs";
3
+ import { n as clampOpenAIPromptCacheKey, t as OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH } from "./openai-prompt-cache-CJv1bvw0.mjs";
4
+ import { t as createZeroUsage } from "./usage-B8ggJtuG.mjs";
5
+ // packages/ai/src/providers/register-builtins.ts
6
6
  /** Source id used for built-in API provider registrations. */
7
7
  const BUILT_IN_API_PROVIDER_SOURCE_ID = "core:built-in";
8
8
  function createLazyStream(load, select) {
@@ -47,39 +47,39 @@ function createLazyRegistration(api, importModule, select) {
47
47
  };
48
48
  }
49
49
  const registerBuiltIns = [
50
- createLazyRegistration("anthropic-messages", () => import("./anthropic-CNEzO12C.mjs").then((n) => n.t), (module) => ({
50
+ createLazyRegistration("anthropic-messages", () => import("./anthropic-CBz5v2U3.mjs").then((n) => n.t), (module) => ({
51
51
  stream: module.streamAnthropic,
52
52
  streamSimple: module.streamSimpleAnthropic
53
53
  })),
54
- createLazyRegistration("openai-completions", () => import("./openai-completions-B93R3N3b.mjs").then((n) => n.t), (module) => ({
54
+ createLazyRegistration("openai-completions", () => import("./openai-completions-Bi4Ghg3V.mjs").then((n) => n.t), (module) => ({
55
55
  stream: module.streamOpenAICompletions,
56
56
  streamSimple: module.streamSimpleOpenAICompletions
57
57
  })),
58
- createLazyRegistration("mistral-conversations", () => import("./mistral-DIGInqJI.mjs").then((n) => n.t), (module) => ({
58
+ createLazyRegistration("mistral-conversations", () => import("./mistral-BAps5cN2.mjs").then((n) => n.t), (module) => ({
59
59
  stream: module.streamMistral,
60
60
  streamSimple: module.streamSimpleMistral
61
61
  })),
62
- createLazyRegistration("openai-responses", () => import("./openai-responses-DSxPKV0U.mjs").then((n) => n.t), (module) => ({
62
+ createLazyRegistration("openai-responses", () => import("./openai-responses-CiIAm8fJ.mjs").then((n) => n.t), (module) => ({
63
63
  stream: module.streamOpenAIResponses,
64
64
  streamSimple: module.streamSimpleOpenAIResponses
65
65
  })),
66
- createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-DRkduRmW.mjs"), (module) => ({
66
+ createLazyRegistration("azure-openai-responses", () => import("./azure-openai-responses-CZheDTt_.mjs"), (module) => ({
67
67
  stream: module.streamAzureOpenAIResponses,
68
68
  streamSimple: module.streamSimpleAzureOpenAIResponses
69
69
  })),
70
- createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-C6rEZcsZ.mjs"), (module) => ({
70
+ createLazyRegistration("openai-chatgpt-responses", () => import("./openai-chatgpt-responses-CYXMKG89.mjs"), (module) => ({
71
71
  stream: module.streamOpenAICodexResponses,
72
72
  streamSimple: module.streamSimpleOpenAICodexResponses
73
73
  })),
74
- createLazyRegistration("google-generative-ai", () => import("./google-DqG05iBa.mjs"), (module) => ({
74
+ createLazyRegistration("google-generative-ai", () => import("./google-BUgkXPYL.mjs"), (module) => ({
75
75
  stream: module.streamGoogle,
76
76
  streamSimple: module.streamSimpleGoogle
77
77
  })),
78
- createLazyRegistration("google-interactions", () => import("./google-interactions-BE7cxFPc.mjs"), (module) => ({
78
+ createLazyRegistration("google-interactions", () => import("./google-interactions-84f0xFly.mjs"), (module) => ({
79
79
  stream: module.streamGoogleInteractions,
80
80
  streamSimple: module.streamSimpleGoogleInteractions
81
81
  })),
82
- createLazyRegistration("google-vertex", () => import("./google-vertex-CAq2q1Ln.mjs"), (module) => ({
82
+ createLazyRegistration("google-vertex", () => import("./google-vertex--S8AlXUD.mjs"), (module) => ({
83
83
  stream: module.streamGoogleVertex,
84
84
  streamSimple: module.streamSimpleGoogleVertex
85
85
  }))
@@ -93,5 +93,4 @@ function resetApiProviders(registry) {
93
93
  registry.unregisterApiProviders(BUILT_IN_API_PROVIDER_SOURCE_ID);
94
94
  registerBuiltInApiProviders(registry);
95
95
  }
96
- //#endregion
97
96
  export { BUILT_IN_API_PROVIDER_SOURCE_ID, OPENAI_PROMPT_CACHE_KEY_MAX_LENGTH, clampOpenAIPromptCacheKey, registerBuiltInApiProviders, resetApiProviders };
@@ -1,4 +1,4 @@
1
- //#region packages/normalization-core/src/record-coerce.ts
1
+ // packages/normalization-core/src/record-coerce.ts
2
2
  /** Type guard for non-array object records at browser-safe boundaries. */
3
3
  function isRecord(value) {
4
4
  return value !== null && typeof value === "object" && !Array.isArray(value);
@@ -31,5 +31,4 @@ function asNullableRecord(value) {
31
31
  function asOptionalObjectRecord(value) {
32
32
  return value && typeof value === "object" ? value : void 0;
33
33
  }
34
- //#endregion
35
34
  export { asRecord as a, readStringField as c, asOptionalRecord as i, asNullableRecord as n, isRecord as o, asOptionalObjectRecord as r, isStringArray as s, asNonArrayRecord as t };
@@ -1,4 +1,4 @@
1
- //#region packages/llm-core/src/utils/request-headers.ts
1
+ // packages/llm-core/src/utils/request-headers.ts
2
2
  /** Materialize merged overrides for HTTP clients that cannot consume SDK deletion sentinels. */
3
3
  function omitNullRequestHeaders(headers) {
4
4
  if (!headers) return;
@@ -6,5 +6,4 @@ function omitNullRequestHeaders(headers) {
6
6
  for (const [name, value] of Object.entries(headers)) if (value !== null) result[name] = value;
7
7
  return result;
8
8
  }
9
- //#endregion
10
9
  export { omitNullRequestHeaders as t };
@@ -1,9 +1,8 @@
1
- import { n as getEnvApiKey } from "./env-api-keys-BuHc86ya.mjs";
2
- //#region packages/ai/src/utils/required-api-key.ts
1
+ import { n as getEnvApiKey } from "./env-api-keys-DlUbTgKq.mjs";
2
+ // packages/ai/src/utils/required-api-key.ts
3
3
  function requireApiKey(provider, apiKey) {
4
4
  const resolved = apiKey || getEnvApiKey(provider);
5
5
  if (!resolved) throw new Error(`No API key for provider: ${provider}`);
6
6
  return resolved;
7
7
  }
8
- //#endregion
9
8
  export { requireApiKey as t };
@@ -1,4 +1,3 @@
1
- //#region packages/ai/src/internal/retry-after.d.ts
2
1
  type HttpDateInstant = {
3
2
  timestampMs: number;
4
3
  leapSecond: boolean;
@@ -41,5 +40,4 @@ declare function resolveProviderErrorRetrySeconds(error: unknown, nowMs?: number
41
40
  declare function parseRetryAfterHttpDateMs(value: string, nowMs?: number): number | undefined;
42
41
  /** Parse all three HTTP-date forms while retaining leap-second ordering. */
43
42
  declare function parseHttpDateInstant(value: string, nowMs?: number): HttpDateInstant | undefined;
44
- //#endregion
45
43
  export { parseHttpDateInstant as a, parseRetryAfterHeadersSeconds as c, parseRetryAfterTextSeconds as d, resolveProviderErrorRetrySeconds as f, parseGoogleRetryDelaySeconds as i, parseRetryAfterHeadersTiming as l, RetryAfterTiming as n, parseRetryAfterErrorSeconds as o, hasExplicitRetryText as r, parseRetryAfterErrorTiming as s, RETRY_AFTER_TEXT_RE as t, parseRetryAfterHttpDateMs as u };
@@ -0,0 +1,34 @@
1
+ import { createRequire } from "node:module";
2
+ // \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
10
+ var __exportAll = (all, no_symbols) => {
11
+ let target = {};
12
+ for (var name in all) __defProp(target, name, {
13
+ get: all[name],
14
+ enumerable: true
15
+ });
16
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
17
+ return target;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
21
+ key = keys[i];
22
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
23
+ get: ((k) => from[k]).bind(null, key),
24
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
+ });
26
+ }
27
+ return to;
28
+ };
29
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
34
+ export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
@@ -1,8 +1,7 @@
1
- //#region packages/ai/src/utils/sanitize-unicode.ts
1
+ // packages/ai/src/utils/sanitize-unicode.ts
2
2
  /** Remove unpaired surrogates rejected by providers; preserve valid Unicode pairs. */
3
3
  function sanitizeSurrogates(text) {
4
4
  if (text.isWellFormed()) return text;
5
5
  return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
6
6
  }
7
- //#endregion
8
7
  export { sanitizeSurrogates as t };
@@ -1,6 +1,5 @@
1
- import { a as AssistantMessage } from "./types-BVdTf0YV.mjs";
2
- import "./types-Cb3-5WM9.mjs";
3
- //#region packages/ai/src/utils/overflow.d.ts
1
+ import { a as AssistantMessage } from "./types-BNp71XKW.mjs";
2
+ import "./types-CwcLeW-7.mjs";
4
3
  declare const CONTEXT_OVERFLOW_PATTERN_SCOPES: {
5
4
  readonly "assistant-error": RegExp[];
6
5
  readonly "failover-explicit": RegExp[];
@@ -19,9 +18,6 @@ declare function matchesContextOverflowMessage(errorMessage: string, scope: Cont
19
18
  * a length stop remains undetectable because the original token count is unknown.
20
19
  */
21
20
  declare function isContextOverflow(message: AssistantMessage, contextWindow?: number): boolean;
22
- //#endregion
23
- //#region packages/ai/src/utils/sanitize-unicode.d.ts
24
21
  /** Remove unpaired surrogates rejected by providers; preserve valid Unicode pairs. */
25
22
  declare function sanitizeSurrogates(text: string): string;
26
- //#endregion
27
23
  export { isContextOverflow as n, matchesContextOverflowMessage as r, sanitizeSurrogates as t };
@@ -1,4 +1,4 @@
1
- //#region packages/ai/src/transports/session-affinity.ts
1
+ // packages/ai/src/transports/session-affinity.ts
2
2
  function isOpencodeEndpoint(baseUrl) {
3
3
  const url = URL.parse(baseUrl);
4
4
  return url?.protocol === "https:" && url.hostname.replace(/\.$/, "") === "opencode.ai";
@@ -15,5 +15,4 @@ function resolveOpencodeSessionHeaders(model, options) {
15
15
  function hasOpencodeSessionHeader(model, options) {
16
16
  return [model.headers, options?.headers].some((headers) => Object.keys(headers ?? {}).some((name) => name.toLowerCase() === "x-opencode-session"));
17
17
  }
18
- //#endregion
19
18
  export { resolveOpencodeSessionHeaders as n, hasOpencodeSessionHeader as t };
@@ -1,13 +1,13 @@
1
- import { o as isRecord } from "./record-coerce-BQaoiN3r.mjs";
2
- import { F as hasMediaPayload } from "./host-DqX-64Pb.mjs";
3
- import { y as responsesServiceTierObserver } from "./openai-responses-contracts-xU-n9AJJ.mjs";
4
- import { c as truncateUtf16Safe } from "./provider-error-DD-fo4Rz.mjs";
5
- import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
6
- import { n as normalizeStructuredPromptSection } from "./prompt-cache-stability-w-ICeyOI.mjs";
7
- import { i as copyProviderAcceptanceObserver } from "./transport-stream-shared-CBVh6QEc.mjs";
1
+ import { o as isRecord } from "./record-coerce-BgUo6bj4.mjs";
2
+ import { I as hasMediaPayload } from "./host-Cf7zb-48.mjs";
3
+ import { y as responsesServiceTierObserver } from "./openai-responses-contracts-eppTI5DQ.mjs";
4
+ import { c as truncateUtf16Safe } from "./provider-error-B7aKA_dg.mjs";
5
+ import { t as sanitizeSurrogates } from "./sanitize-unicode-B3kUqQ-q.mjs";
6
+ import { n as normalizeStructuredPromptSection } from "./prompt-cache-stability-oTx0nIsh.mjs";
7
+ import { a as copyProviderAcceptanceObserver } from "./transport-stream-shared-DEpLe9fG.mjs";
8
8
  import { modelRequestBodyState } from "./internal/model-request-body.mjs";
9
9
  import { PROVIDER_CONTEXT_HANDOFF, PROVIDER_MODEL_INPUT } from "./provider-types.mjs";
10
- //#region packages/ai/src/utils/system-prompt-cache-boundary.ts
10
+ // packages/ai/src/utils/system-prompt-cache-boundary.ts
11
11
  const SYSTEM_PROMPT_CACHE_BOUNDARY = "\n<!-- OPENCLAW_CACHE_BOUNDARY -->\n";
12
12
  /** Producer-delimited Runtime facts; instructions must remain outside this region. */
13
13
  const SYSTEM_PROMPT_RELOCATABLE_BOUNDARY = "\n<!-- OPENCLAW-RELOCATABLE-BOUNDARY -->\n";
@@ -79,6 +79,23 @@ function splitSystemPromptCacheBoundary(text) {
79
79
  dynamicSuffix: text.slice(boundaryIndex + 34).trimStart()
80
80
  };
81
81
  }
82
+ /** Keep the stripped prompt's separator in wire text while marking its stable prefix. */
83
+ function splitSystemPromptCacheBoundaryForWire(text) {
84
+ const split = splitSystemPromptCacheBoundary(text);
85
+ if (!split) return;
86
+ const wireText = text.replaceAll(SYSTEM_PROMPT_CACHE_BOUNDARY, "\n");
87
+ if (!split.stablePrefix) return {
88
+ stablePrefix: "",
89
+ dynamicSuffix: wireText
90
+ };
91
+ return split.dynamicSuffix ? {
92
+ stablePrefix: split.stablePrefix,
93
+ dynamicSuffix: wireText.slice(split.stablePrefix.length)
94
+ } : {
95
+ stablePrefix: wireText,
96
+ dynamicSuffix: ""
97
+ };
98
+ }
82
99
  /** Keep explicit cache breakpoints while removing relocation metadata. */
83
100
  function stripSystemPromptRelocatableBoundary(text) {
84
101
  return text.replaceAll(SYSTEM_PROMPT_RELOCATABLE_BOUNDARY, "\n").replaceAll(SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END, "").replaceAll(SYSTEM_PROMPT_RELOCATABLE_BOUNDARY.trim(), "").replaceAll(SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END.trim(), "");
@@ -92,8 +109,7 @@ function prependSystemPromptAdditionAfterCacheBoundary(params) {
92
109
  const dynamicSuffix = split.dynamicSuffix ? normalizeStructuredPromptSection(split.dynamicSuffix) : "";
93
110
  return `${split.stablePrefix}${SYSTEM_PROMPT_CACHE_BOUNDARY}${systemPromptAddition}${dynamicSuffix ? `\n\n${dynamicSuffix}` : ""}`;
94
111
  }
95
- //#endregion
96
- //#region packages/ai/src/provider-options.ts
112
+ // packages/ai/src/provider-options.ts
97
113
  const measuredRequestPressures = /* @__PURE__ */ new WeakMap();
98
114
  /** Request-local pressure admitted by the host's matched provider-usage owner. */
99
115
  const measuredRequestPressure = {
@@ -170,8 +186,18 @@ const preparedRequestSuffix = {
170
186
  return ids && !ids.has(id) && ids.has(normalized) ? normalized : id;
171
187
  }
172
188
  };
173
- //#endregion
174
- //#region packages/ai/src/providers/tool-result-text.ts
189
+ const UNCACHED_SUFFIX_MESSAGE = Symbol("uncachedSuffixMessage");
190
+ /** A side request's own suffix: transports place no prompt-cache checkpoint on or after it. */
191
+ const uncachedSuffixMessage = {
192
+ mark(message) {
193
+ Reflect.set(message, UNCACHED_SUFFIX_MESSAGE, true);
194
+ return message;
195
+ },
196
+ has(message) {
197
+ return Reflect.get(message, UNCACHED_SUFFIX_MESSAGE) === true;
198
+ }
199
+ };
200
+ // packages/ai/src/providers/tool-result-text.ts
175
201
  const STRUCTURED_TOOL_RESULT_MAX_CHARS = 8e3;
176
202
  const IMAGE_TOOL_RESULT_TYPES = /* @__PURE__ */ new Set([
177
203
  "image",
@@ -296,8 +322,7 @@ function formatToolResultText(params) {
296
322
  const body = params.text.trim() ? `${params.text}${params.omittedMediaPlaceholder ? `\n${params.omittedMediaPlaceholder}` : ""}` : params.omittedMediaPlaceholder ?? params.mediaPlaceholder ?? "(no tool output)";
297
323
  return `${params.isError ? "[tool error] " : ""}${body}`;
298
324
  }
299
- //#endregion
300
- //#region packages/ai/src/providers/simple-options.ts
325
+ // packages/ai/src/providers/simple-options.ts
301
326
  function buildBaseOptions(model, options, apiKey) {
302
327
  const firstEventOptions = options;
303
328
  const baseOptions = {
@@ -354,5 +379,4 @@ function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLeve
354
379
  thinkingBudget
355
380
  };
356
381
  }
357
- //#endregion
358
- export { stripSystemPromptCacheBoundary as C, splitSystemPromptRelocatableBoundary as S, createSystemPromptCacheBoundaryStripper as _, describeToolResultMediaPlaceholder as a, prependSystemPromptAdditionAfterCacheBoundary as b, extractToolResultText as c, measuredRequestPressure as d, preparedRequestSuffix as f, SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END as g, SYSTEM_PROMPT_RELOCATABLE_BOUNDARY as h, clampReasoning as i, formatToolResultText as l, SYSTEM_PROMPT_CACHE_BOUNDARY as m, buildBaseOptions as n, describeUnsupportedToolResultMedia as o, reasoningTagTextPolicy as p, clampMaxTokensToModel as r, extractToolResultBlockText as s, adjustMaxTokensForThinking as t, codeModeToolSurfaceObserver as u, ensureSystemPromptCacheBoundary as v, stripSystemPromptRelocatableBoundary as w, splitSystemPromptCacheBoundary as x, prepareSystemPrompt as y };
382
+ export { splitSystemPromptCacheBoundaryForWire as C, stripSystemPromptRelocatableBoundary as E, splitSystemPromptCacheBoundary as S, stripSystemPromptCacheBoundary as T, SYSTEM_PROMPT_RELOCATABLE_BOUNDARY_END as _, describeToolResultMediaPlaceholder as a, prepareSystemPrompt as b, extractToolResultText as c, measuredRequestPressure as d, preparedRequestSuffix as f, SYSTEM_PROMPT_RELOCATABLE_BOUNDARY as g, SYSTEM_PROMPT_CACHE_BOUNDARY as h, clampReasoning as i, formatToolResultText as l, uncachedSuffixMessage as m, buildBaseOptions as n, describeUnsupportedToolResultMedia as o, reasoningTagTextPolicy as p, clampMaxTokensToModel as r, extractToolResultBlockText as s, adjustMaxTokensForThinking as t, codeModeToolSurfaceObserver as u, createSystemPromptCacheBoundaryStripper as v, splitSystemPromptRelocatableBoundary as w, prependSystemPromptAdditionAfterCacheBoundary as x, ensureSystemPromptCacheBoundary as y };
@@ -0,0 +1,2 @@
1
+ import "./number-coercion-BO6bhGm6.mjs";
2
+ export {};