@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,25 +1,25 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import "./src-CQ7nH2mL.mjs";
3
- import { t as omitNullRequestHeaders } from "./request-headers-DO4Mqhw1.mjs";
4
- import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-X2gmsUWv.mjs";
5
- import { I as isImageWithMediaPayload, M as clampThinkingLevel, j as calculateCost, r as getAiTransportHost } from "./host-DqX-64Pb.mjs";
6
- import { t as sanitizeSurrogates } from "./sanitize-unicode-CRGuMONI.mjs";
7
- import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-w-ICeyOI.mjs";
8
- import { C as stripSystemPromptCacheBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, l as formatToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-CQNPKCEb.mjs";
9
- import { A as parseStreamingJson, D as shortHash, O as createToolArgumentPreviewSchedule, h as notifyProviderHttpResponse, l as finalizeTerminalToolCallArguments, n as assignTransportErrorDetails, p as mergeTransportHeaders, u as finalizeTransportStream } from "./transport-stream-shared-CBVh6QEc.mjs";
10
- import { t as getPublishedRuntimeToolInputSchema } from "./tool-schema-json-projection-BSHb4gaJ.mjs";
11
- import { t as notifyLlmRequestActivity } from "./llm-request-activity-DzaHoRAU.mjs";
12
- import { t as transformProviderMessages } from "./provider-transcript-transform-Hr1kCoMX.mjs";
13
- import { t as createAssistantOutput } from "./assistant-output-C3czmoN4.mjs";
14
- import { t as boundResponseBody } from "./streaming-byte-guard-DBXr1XYn.mjs";
15
- import { t as mapOpenAIStopReason } from "./openai-stop-reason-8s70vDXj.mjs";
16
- import { t as requireApiKey } from "./required-api-key-2zZTkmsi.mjs";
1
+ import { n as __exportAll } from "./rolldown-runtime-DYf_mQCB.mjs";
2
+ import "./src-CmBmaGOV.mjs";
3
+ import { t as omitNullRequestHeaders } from "./request-headers-DJ4QrMC_.mjs";
4
+ import { r as appendAssistantThinking, t as AssistantMessageEventStream } from "./event-stream-Bf6cK7-d.mjs";
5
+ import { L as isImageWithMediaPayload, M as calculateCost, N as clampThinkingLevel, r as getAiTransportHost } from "./host-Cf7zb-48.mjs";
6
+ import { t as sanitizeSurrogates } from "./sanitize-unicode-B3kUqQ-q.mjs";
7
+ import { r as sortPromptCacheToolsByName } from "./prompt-cache-stability-oTx0nIsh.mjs";
8
+ import { T as stripSystemPromptCacheBoundary, a as describeToolResultMediaPlaceholder, c as extractToolResultText, l as formatToolResultText, n as buildBaseOptions, r as clampMaxTokensToModel } from "./simple-options-D8CTqHvk.mjs";
9
+ import { O as shortHash, d as finalizeTransportStream, g as notifyProviderHttpResponse, j as parseStreamingJson, k as createToolArgumentPreviewSchedule, m as mergeTransportHeaders, n as assignTransportErrorDetails, r as awaitProviderLifecycleCallback, u as finalizeTerminalToolCallArguments } from "./transport-stream-shared-DEpLe9fG.mjs";
10
+ import { t as getPublishedRuntimeToolInputSchema } from "./tool-schema-json-projection-C13fPskA.mjs";
11
+ import { t as notifyLlmRequestActivity } from "./llm-request-activity-v1liRqNt.mjs";
12
+ import { t as transformProviderMessages } from "./provider-transcript-transform-C-WfgiLJ.mjs";
13
+ import { t as createAssistantOutput } from "./assistant-output-kYOaiso5.mjs";
14
+ import { t as mapOpenAIStopReason } from "./openai-stop-reason-cA0GUHlU.mjs";
15
+ import { t as boundResponseBody } from "./streaming-byte-guard-gOcUrHJF.mjs";
16
+ import { t as requireApiKey } from "./required-api-key-BniLGxy4.mjs";
17
17
  import { randomUUID } from "node:crypto";
18
18
  import * as z$1 from "zod/v4";
19
19
  import { z } from "zod/v4";
20
20
  import * as z$2 from "zod/v4/core";
21
21
  import { zodToJsonSchema } from "zod-to-json-schema";
22
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/extra/observability/provider.js
22
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/extra/observability/provider.js
23
23
  let registeredTracerProvider;
24
24
  /**
25
25
  * Route SDK tracing spans to a specific OpenTelemetry tracer provider.
@@ -33,8 +33,7 @@ function registerTracerProvider(tracerProvider) {
33
33
  function getRegisteredTracerProvider() {
34
34
  return registeredTracerProvider;
35
35
  }
36
- //#endregion
37
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/sdkvalidationerror.js
36
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/sdkvalidationerror.js
38
37
  var SDKValidationError = class extends Error {
39
38
  /**
40
39
  * The raw value that failed validation.
@@ -72,8 +71,7 @@ var SDKValidationError = class extends Error {
72
71
  function formatZodError(err) {
73
72
  return z$2.prettifyError(err);
74
73
  }
75
- //#endregion
76
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/fp.js
74
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/fp.js
77
75
  function OK(value) {
78
76
  return {
79
77
  ok: true,
@@ -95,8 +93,7 @@ async function unwrapAsync(pr) {
95
93
  if (!r.ok) throw r.error;
96
94
  return r.value;
97
95
  }
98
- //#endregion
99
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/schemas.js
96
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/schemas.js
100
97
  /**
101
98
  * Utility function that executes some code which may result in a ZodError. It
102
99
  * intercepts this error and converts it to an SDKValidationError so as to not
@@ -109,8 +106,7 @@ function safeParse(rawValue, fn, errorMessage) {
109
106
  return ERR(new SDKValidationError(errorMessage, err, rawValue));
110
107
  }
111
108
  }
112
- //#endregion
113
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/primitives.js
109
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/primitives.js
114
110
  /**
115
111
  * Converts or omits an object's keys according to a mapping.
116
112
  *
@@ -131,13 +127,57 @@ function remap(inp, mappings) {
131
127
  }
132
128
  return out;
133
129
  }
130
+ function combineSignals(...signals) {
131
+ const filtered = [];
132
+ for (const signal of signals) if (signal) filtered.push(signal);
133
+ switch (filtered.length) {
134
+ case 0:
135
+ case 1: return filtered[0] || null;
136
+ default:
137
+ if ("any" in AbortSignal && typeof AbortSignal.any === "function") return AbortSignal.any(filtered);
138
+ return abortSignalAny(filtered);
139
+ }
140
+ }
141
+ function abortSignalAny(signals) {
142
+ const controller = new AbortController();
143
+ const result = controller.signal;
144
+ if (!signals.length) return controller.signal;
145
+ if (signals.length === 1) return signals[0] || controller.signal;
146
+ for (const signal of signals) if (signal.aborted) return signal;
147
+ function abort() {
148
+ controller.abort(this.reason);
149
+ clean();
150
+ }
151
+ const signalRefs = [];
152
+ function clean() {
153
+ for (const signalRef of signalRefs) {
154
+ const signal = signalRef.deref();
155
+ if (signal) signal.removeEventListener("abort", abort);
156
+ }
157
+ }
158
+ for (const signal of signals) {
159
+ signalRefs.push(new WeakRef(signal));
160
+ signal.addEventListener("abort", abort);
161
+ }
162
+ return result;
163
+ }
134
164
  function compactMap(values) {
135
165
  const out = {};
136
166
  for (const [k, v] of Object.entries(values)) if (typeof v !== "undefined") out[k] = v;
137
167
  return out;
138
168
  }
139
- //#endregion
140
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/unrecognized.js
169
+ function isPlainObject(value) {
170
+ if (value === null || typeof value !== "object") return false;
171
+ if (Object.prototype.toString.call(value) !== "[object Object]") return false;
172
+ const proto = Object.getPrototypeOf(value);
173
+ if (proto === null || proto === Object.prototype) return true;
174
+ try {
175
+ return Object.getPrototypeOf(proto) === null;
176
+ } catch {
177
+ return false;
178
+ }
179
+ }
180
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/unrecognized.js
141
181
  function unrecognized(value) {
142
182
  globalCount++;
143
183
  return value;
@@ -161,8 +201,7 @@ end: (delta) => {
161
201
  return count;
162
202
  } };
163
203
  }
164
- //#endregion
165
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/enums.js
204
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/enums.js
166
205
  function inboundSchema(enumObj) {
167
206
  const options = Object.values(enumObj);
168
207
  return z$1.union([...options.map((x) => z$1.literal(x)), z$1.string().transform((x) => unrecognized(x))]);
@@ -170,8 +209,34 @@ function inboundSchema(enumObj) {
170
209
  function outboundSchema(_) {
171
210
  return z$1.string();
172
211
  }
173
- //#endregion
174
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/discriminatedUnion.js
212
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/chatcompletionresponsetokenlogprobs.js
213
+ /** @internal */
214
+ const ChatCompletionResponseTokenLogprobs$inboundSchema = z$1.object({
215
+ token: z$1.string(),
216
+ logprob: z$1.number(),
217
+ bytes: z$1.array(z$1.int()),
218
+ token_id: z$1.int()
219
+ }).transform((v) => {
220
+ return remap(v, { "token_id": "tokenId" });
221
+ });
222
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/chatcompletionresponsetokenlogprobstopk.js
223
+ /** @internal */
224
+ const ChatCompletionResponseTokenLogprobsTopK$inboundSchema = z$1.object({
225
+ token: z$1.string(),
226
+ logprob: z$1.number(),
227
+ bytes: z$1.array(z$1.int()),
228
+ token_id: z$1.int(),
229
+ top_logprobs: z$1.nullable(z$1.array(ChatCompletionResponseTokenLogprobs$inboundSchema)).optional()
230
+ }).transform((v) => {
231
+ return remap(v, {
232
+ "token_id": "tokenId",
233
+ "top_logprobs": "topLogprobs"
234
+ });
235
+ });
236
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/chatcompletionresponsechoicelogprobs.js
237
+ /** @internal */
238
+ const ChatCompletionResponseChoiceLogprobs$inboundSchema = z$1.object({ content: z$1.array(ChatCompletionResponseTokenLogprobsTopK$inboundSchema) });
239
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/discriminatedUnion.js
175
240
  const UNKNOWN = Symbol("UNKNOWN");
176
241
  function isUnknown(value) {
177
242
  return typeof value === "object" && value !== null && UNKNOWN in value;
@@ -217,8 +282,7 @@ function discriminatedUnion(inputPropertyName, options, opts = {}) {
217
282
  return result.data;
218
283
  });
219
284
  }
220
- //#endregion
221
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/rfcdate.js
285
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/rfcdate.js
222
286
  const dateRE = /^\d{4}-\d{2}-\d{2}$/;
223
287
  var RFCDate = class RFCDate {
224
288
  serialized;
@@ -252,8 +316,7 @@ var RFCDate = class RFCDate {
252
316
  return this.serialized;
253
317
  }
254
318
  };
255
- //#endregion
256
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/smartUnion.js
319
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/smartUnion.js
257
320
  /**
258
321
  * Smart union parser that tries all schemas and returns the best match
259
322
  * based on the number of populated fields.
@@ -331,8 +394,7 @@ function countFieldsRecursive(parsed) {
331
394
  }
332
395
  return fieldCount;
333
396
  }
334
- //#endregion
335
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/audiochunk.js
397
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/audiochunk.js
336
398
  /** @internal */
337
399
  const AudioChunk$inboundSchema = z$1.object({
338
400
  type: z$1.literal("input_audio"),
@@ -347,8 +409,7 @@ const AudioChunk$outboundSchema = z$1.object({
347
409
  }).transform((v) => {
348
410
  return remap(v, { inputAudio: "input_audio" });
349
411
  });
350
- //#endregion
351
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/documenturlchunk.js
412
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/documenturlchunk.js
352
413
  /** @internal */
353
414
  const DocumentURLChunk$inboundSchema = z$1.object({
354
415
  type: z$1.literal("document_url").default("document_url"),
@@ -371,8 +432,7 @@ const DocumentURLChunk$outboundSchema = z$1.object({
371
432
  documentName: "document_name"
372
433
  });
373
434
  });
374
- //#endregion
375
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/filechunk.js
435
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/filechunk.js
376
436
  /** @internal */
377
437
  const FileChunk$inboundSchema = z$1.object({
378
438
  type: z$1.literal("file").default("file"),
@@ -387,8 +447,7 @@ const FileChunk$outboundSchema = z$1.object({
387
447
  }).transform((v) => {
388
448
  return remap(v, { fileId: "file_id" });
389
449
  });
390
- //#endregion
391
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/imagedetail.js
450
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/imagedetail.js
392
451
  const ImageDetail = {
393
452
  Low: "low",
394
453
  Auto: "auto",
@@ -398,8 +457,7 @@ const ImageDetail = {
398
457
  const ImageDetail$inboundSchema = inboundSchema(ImageDetail);
399
458
  /** @internal */
400
459
  const ImageDetail$outboundSchema = outboundSchema(ImageDetail);
401
- //#endregion
402
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/imageurl.js
460
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/imageurl.js
403
461
  /** @internal */
404
462
  const ImageURL$inboundSchema = z$1.object({
405
463
  url: z$1.string(),
@@ -442,8 +500,7 @@ const ReferenceChunk$outboundSchema = z$1.object({
442
500
  }).transform((v) => {
443
501
  return remap(v, { referenceIds: "reference_ids" });
444
502
  });
445
- //#endregion
446
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/textchunk.js
503
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/textchunk.js
447
504
  /** @internal */
448
505
  const TextChunk$inboundSchema = z$1.object({
449
506
  type: z$1.literal("text").default("text"),
@@ -454,14 +511,68 @@ const TextChunk$outboundSchema = z$1.object({
454
511
  type: z$1.literal("text").default("text"),
455
512
  text: z$1.string()
456
513
  });
457
- //#endregion
458
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/builtinconnectors.js
514
+ discriminatedUnion("type", {
515
+ text: TextChunk$inboundSchema.and(z$1.object({ type: z$1.literal("text") })),
516
+ image_url: ImageURLChunk$inboundSchema.and(z$1.object({ type: z$1.literal("image_url") }))
517
+ });
518
+ z$1.union([TextChunk$outboundSchema.and(z$1.object({ type: z$1.literal("text") })), ImageURLChunk$outboundSchema.and(z$1.object({ type: z$1.literal("image_url") }))]);
519
+ /** @internal */
520
+ const ResourceChunk$inboundSchema = z$1.object({
521
+ type: z$1.literal("resource"),
522
+ uri: z$1.string(),
523
+ content: discriminatedUnion("type", {
524
+ text: TextChunk$inboundSchema.and(z$1.object({ type: z$1.literal("text") })),
525
+ image_url: ImageURLChunk$inboundSchema.and(z$1.object({ type: z$1.literal("image_url") }))
526
+ })
527
+ });
528
+ /** @internal */
529
+ const ResourceChunk$outboundSchema = z$1.object({
530
+ type: z$1.literal("resource"),
531
+ uri: z$1.string(),
532
+ content: z$1.union([TextChunk$outboundSchema.and(z$1.object({ type: z$1.literal("text") })), ImageURLChunk$outboundSchema.and(z$1.object({ type: z$1.literal("image_url") }))])
533
+ });
534
+ smartUnion([
535
+ z$1.string(),
536
+ z$1.int(),
537
+ z$1.number(),
538
+ z$1.boolean()
539
+ ]);
540
+ smartUnion([
541
+ z$1.string(),
542
+ z$1.int(),
543
+ z$1.number(),
544
+ z$1.boolean()
545
+ ]);
546
+ /** @internal */
547
+ const ResourceLinkChunk$inboundSchema = z$1.object({
548
+ type: z$1.literal("resource_link"),
549
+ uri: z$1.string(),
550
+ metadata: z$1.nullable(z$1.record(z$1.string(), smartUnion([
551
+ z$1.string(),
552
+ z$1.int(),
553
+ z$1.number(),
554
+ z$1.boolean()
555
+ ]))).optional()
556
+ });
557
+ /** @internal */
558
+ const ResourceLinkChunk$outboundSchema = z$1.object({
559
+ type: z$1.literal("resource_link"),
560
+ uri: z$1.string(),
561
+ metadata: z$1.nullable(z$1.record(z$1.string(), smartUnion([
562
+ z$1.string(),
563
+ z$1.int(),
564
+ z$1.number(),
565
+ z$1.boolean()
566
+ ]))).optional()
567
+ });
568
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/builtinconnectors.js
459
569
  const BuiltInConnectors = {
460
570
  WebSearch: "web_search",
461
571
  WebSearchPremium: "web_search_premium",
462
572
  CodeInterpreter: "code_interpreter",
463
573
  ImageGeneration: "image_generation",
464
- DocumentLibrary: "document_library"
574
+ DocumentLibrary: "document_library",
575
+ MistralMcp: "mistral_mcp"
465
576
  };
466
577
  /** @internal */
467
578
  const BuiltInConnectors$inboundSchema = inboundSchema(BuiltInConnectors);
@@ -519,8 +630,7 @@ const ThinkChunk$outboundSchema = z$1.object({
519
630
  signature: z$1.nullable(z$1.string()).optional(),
520
631
  closed: z$1.boolean().optional()
521
632
  });
522
- //#endregion
523
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/contentchunk.js
633
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/contentchunk.js
524
634
  /** @internal */
525
635
  const ContentChunk$inboundSchema = discriminatedUnion("type", {
526
636
  image_url: ImageURLChunk$inboundSchema.and(z$1.object({ type: z$1.literal("image_url") })),
@@ -529,7 +639,9 @@ const ContentChunk$inboundSchema = discriminatedUnion("type", {
529
639
  reference: ReferenceChunk$inboundSchema.and(z$1.object({ type: z$1.literal("reference") })),
530
640
  file: FileChunk$inboundSchema.and(z$1.object({ type: z$1.literal("file") })),
531
641
  thinking: ThinkChunk$inboundSchema.and(z$1.object({ type: z$1.literal("thinking") })),
532
- input_audio: AudioChunk$inboundSchema
642
+ input_audio: AudioChunk$inboundSchema,
643
+ resource: ResourceChunk$inboundSchema,
644
+ resource_link: ResourceLinkChunk$inboundSchema
533
645
  });
534
646
  /** @internal */
535
647
  const ContentChunk$outboundSchema = z$1.union([
@@ -539,7 +651,9 @@ const ContentChunk$outboundSchema = z$1.union([
539
651
  ReferenceChunk$outboundSchema.and(z$1.object({ type: z$1.literal("reference") })),
540
652
  FileChunk$outboundSchema.and(z$1.object({ type: z$1.literal("file") })),
541
653
  ThinkChunk$outboundSchema.and(z$1.object({ type: z$1.literal("thinking") })),
542
- AudioChunk$outboundSchema
654
+ AudioChunk$outboundSchema,
655
+ ResourceChunk$outboundSchema,
656
+ ResourceLinkChunk$outboundSchema
543
657
  ]);
544
658
  smartUnion([z$1.record(z$1.string(), z$1.any()), z$1.string()]);
545
659
  smartUnion([z$1.record(z$1.string(), z$1.any()), z$1.string()]);
@@ -553,26 +667,18 @@ const FunctionCall$outboundSchema = z$1.object({
553
667
  name: z$1.string(),
554
668
  arguments: smartUnion([z$1.record(z$1.string(), z$1.any()), z$1.string()])
555
669
  });
556
- //#endregion
557
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/tooltypes.js
558
- const ToolTypes = { Function: "function" };
559
- /** @internal */
560
- const ToolTypes$inboundSchema = inboundSchema(ToolTypes);
561
- /** @internal */
562
- const ToolTypes$outboundSchema = outboundSchema(ToolTypes);
563
- //#endregion
564
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/toolcall.js
670
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/toolcall.js
565
671
  /** @internal */
566
672
  const ToolCall$inboundSchema = z$1.object({
567
673
  id: z$1.string().default("null"),
568
- type: ToolTypes$inboundSchema.default("function"),
674
+ type: z$1.string().default("function"),
569
675
  function: FunctionCall$inboundSchema,
570
676
  index: z$1.int().default(0)
571
677
  });
572
678
  /** @internal */
573
679
  const ToolCall$outboundSchema = z$1.object({
574
680
  id: z$1.string().default("null"),
575
- type: ToolTypes$outboundSchema.default("function"),
681
+ type: z$1.string().default("function"),
576
682
  function: FunctionCall$outboundSchema,
577
683
  index: z$1.int().default(0)
578
684
  });
@@ -602,12 +708,16 @@ const CompletionResponseStreamChoiceFinishReason$inboundSchema = inboundSchema({
602
708
  const CompletionResponseStreamChoice$inboundSchema = z$1.object({
603
709
  index: z$1.int(),
604
710
  delta: DeltaMessage$inboundSchema,
605
- finish_reason: z$1.nullable(CompletionResponseStreamChoiceFinishReason$inboundSchema)
711
+ finish_reason: z$1.nullable(CompletionResponseStreamChoiceFinishReason$inboundSchema),
712
+ logprobs: z$1.nullable(ChatCompletionResponseChoiceLogprobs$inboundSchema).optional(),
713
+ prompt_logprobs: z$1.nullable(ChatCompletionResponseChoiceLogprobs$inboundSchema).optional()
606
714
  }).transform((v) => {
607
- return remap(v, { "finish_reason": "finishReason" });
715
+ return remap(v, {
716
+ "finish_reason": "finishReason",
717
+ "prompt_logprobs": "promptLogprobs"
718
+ });
608
719
  });
609
- //#endregion
610
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/usageinfo.js
720
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/usageinfo.js
611
721
  /** @internal */
612
722
  const UsageInfo$inboundSchema = z$1.object({
613
723
  prompt_tokens: z$1.int().default(0),
@@ -640,8 +750,7 @@ const UsageInfo$outboundSchema = z$1.object({
640
750
  serviceTier: "service_tier"
641
751
  }) };
642
752
  });
643
- //#endregion
644
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/completionchunk.js
753
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/completionchunk.js
645
754
  /** @internal */
646
755
  const CompletionChunk$inboundSchema = z$1.object({
647
756
  id: z$1.string(),
@@ -654,18 +763,17 @@ const CompletionChunk$inboundSchema = z$1.object({
654
763
  function completionChunkFromJSON(jsonString) {
655
764
  return safeParse(jsonString, (x) => CompletionChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompletionChunk' from JSON`);
656
765
  }
657
- //#endregion
658
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/http.js
766
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/http.js
659
767
  const DEFAULT_FETCHER = (input, init) => {
660
768
  if (init == null) return fetch(input);
661
769
  else return fetch(input, init);
662
770
  };
663
771
  var HTTPClient = class HTTPClient {
664
- options;
665
772
  fetcher;
666
773
  requestHooks = [];
667
774
  requestErrorHooks = [];
668
775
  responseHooks = [];
776
+ options;
669
777
  constructor(options = {}) {
670
778
  this.options = options;
671
779
  this.fetcher = options.fetcher || DEFAULT_FETCHER;
@@ -776,22 +884,21 @@ function isAbortError(err) {
776
884
  const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnaborted";
777
885
  return isNative || isLegacyNative || isGenericErr;
778
886
  }
779
- //#endregion
780
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/reasoningeffort.js
887
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/reasoningeffort.js
781
888
  const ReasoningEffort = {
782
889
  None: "none",
783
890
  Minimal: "minimal",
784
891
  Low: "low",
785
892
  Medium: "medium",
786
893
  High: "high",
787
- Xhigh: "xhigh"
894
+ Xhigh: "xhigh",
895
+ Max: "max"
788
896
  };
789
897
  /** @internal */
790
898
  const ReasoningEffort$inboundSchema = inboundSchema(ReasoningEffort);
791
899
  /** @internal */
792
900
  const ReasoningEffort$outboundSchema = outboundSchema(ReasoningEffort);
793
- //#endregion
794
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/base64.js
901
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/base64.js
795
902
  function bytesToBase64(u8arr) {
796
903
  return btoa(String.fromCodePoint(...u8arr));
797
904
  }
@@ -806,12 +913,16 @@ function stringToBase64(str) {
806
913
  }
807
914
  z$1.custom((x) => x instanceof Uint8Array).or(z$1.string().transform(stringToBytes));
808
915
  z$1.custom((x) => x instanceof Uint8Array).or(z$1.string().transform(bytesFromBase64));
809
- //#endregion
810
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/is-plain-object.js
811
- function isPlainObject(value) {
812
- if (typeof value !== "object" || value === null) return false;
813
- const prototype = Object.getPrototypeOf(value);
814
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
916
+ const reservedEscapes = /%(2[346bcf]|3[abdf]|40|5[bd])/gi;
917
+ function encodeKeyChars(v, charEncoding) {
918
+ return encodeChars(v, charEncoding === "percentExceptReserved" ? "percent" : charEncoding);
919
+ }
920
+ function encodeChars(v, charEncoding) {
921
+ switch (charEncoding) {
922
+ case "percent": return encodeURIComponent(v);
923
+ case "percentExceptReserved": return encodeURIComponent(v).replace(reservedEscapes, (m) => decodeURIComponent(m));
924
+ default: return v;
925
+ }
815
926
  }
816
927
  function formEncoder(sep) {
817
928
  return (key, value, options) => {
@@ -819,7 +930,7 @@ function formEncoder(sep) {
819
930
  const pairs = options?.explode ? explode(key, value) : [[key, value]];
820
931
  if (pairs.every(([_, v]) => v == null)) return;
821
932
  const encodeString = (v) => {
822
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
933
+ return encodeChars(v, options?.charEncoding);
823
934
  };
824
935
  const encodeValue = (v) => encodeString(serializeValue(v));
825
936
  const encodedSep = encodeString(sep);
@@ -833,7 +944,7 @@ function formEncoder(sep) {
833
944
  })?.join(encodedSep);
834
945
  else encValue = `${encodeValue(pv)}`;
835
946
  if (encValue == null) return;
836
- tmp = `${encodeString(pk)}=${encValue}`;
947
+ tmp = `${encodeKeyChars(pk, options?.charEncoding)}=${encValue}`;
837
948
  if (!tmp || tmp === "=") return;
838
949
  out += `&${tmp}`;
839
950
  });
@@ -844,10 +955,10 @@ const encodeForm = formEncoder(",");
844
955
  function encodeJSON(key, value, options) {
845
956
  if (typeof value === "undefined") return;
846
957
  const encodeString = (v) => {
847
- return options?.charEncoding === "percent" ? encodeURIComponent(v) : v;
958
+ return encodeChars(v, options?.charEncoding);
848
959
  };
849
960
  const encVal = encodeString(JSON.stringify(value, jsonReplacer));
850
- return options?.explode ? encVal : `${encodeString(key)}=${encVal}`;
961
+ return options?.explode ? encVal : `${encodeKeyChars(key, options?.charEncoding)}=${encVal}`;
851
962
  }
852
963
  function explode(key, value) {
853
964
  if (Array.isArray(value)) return value.map((v) => [key, v]);
@@ -885,8 +996,7 @@ function mapDefinedEntries(inp, mapper) {
885
996
  }
886
997
  return acc.length ? acc : null;
887
998
  }
888
- //#endregion
889
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/mistralerror.js
999
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/mistralerror.js
890
1000
  /** The base class for all HTTP error responses */
891
1001
  var MistralError = class extends Error {
892
1002
  /** HTTP status code */
@@ -909,8 +1019,7 @@ var MistralError = class extends Error {
909
1019
  this.name = "MistralError";
910
1020
  }
911
1021
  };
912
- //#endregion
913
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/responsevalidationerror.js
1022
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/responsevalidationerror.js
914
1023
  var ResponseValidationError = class extends MistralError {
915
1024
  /**
916
1025
  * The raw value that failed validation.
@@ -937,8 +1046,7 @@ var ResponseValidationError = class extends MistralError {
937
1046
  else return this.toString();
938
1047
  }
939
1048
  };
940
- //#endregion
941
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/sdkerror.js
1049
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/sdkerror.js
942
1050
  /** The fallback error class if no more specific error class is matched */
943
1051
  var SDKError = class extends MistralError {
944
1052
  constructor(message, httpMeta) {
@@ -956,8 +1064,7 @@ var SDKError = class extends MistralError {
956
1064
  this.name = "SDKError";
957
1065
  }
958
1066
  };
959
- //#endregion
960
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/matchers.js
1067
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/matchers.js
961
1068
  const DEFAULT_CONTENT_TYPES = {
962
1069
  jsonl: "application/jsonl",
963
1070
  json: "application/json",
@@ -1123,30 +1230,7 @@ function safeParseResponse(rawValue, fn, errorMessage, httpMeta) {
1123
1230
  }));
1124
1231
  }
1125
1232
  }
1126
- //#endregion
1127
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/dlv.js
1128
- /**
1129
- * @param obj The object to walk
1130
- * @param key The key path to walk the object with
1131
- * @param def A default value to return if the result is undefined
1132
- *
1133
- * @example
1134
- * dlv(obj, "a.b.c.d")
1135
- * @example
1136
- * dlv(object, ["a", "b", "c", "d"])
1137
- * @example
1138
- * dlv(object, "foo.bar.baz", "Hello, default value!")
1139
- */
1140
- function dlv(obj, key, def, p, undef) {
1141
- key = Array.isArray(key) ? key : key.split(".");
1142
- for (p = 0; p < key.length; p++) {
1143
- const k = key[p];
1144
- obj = k != null && obj ? obj[k] : undef;
1145
- }
1146
- return obj === undef ? def : obj;
1147
- }
1148
- //#endregion
1149
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/env.js
1233
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/env.js
1150
1234
  const envSchema = z$1.object({
1151
1235
  MISTRAL_API_KEY: z$1.string().optional(),
1152
1236
  MISTRAL_DEBUG: z$1.coerce.boolean().optional()
@@ -1165,19 +1249,18 @@ let envMemo = void 0;
1165
1249
  */
1166
1250
  function env() {
1167
1251
  if (envMemo) return envMemo;
1252
+ const globals = globalThis;
1168
1253
  let envObject = {};
1169
- if (isDeno()) envObject = globalThis.Deno?.env?.toObject?.() ?? {};
1170
- else envObject = dlv(globalThis, "process.env") ?? {};
1254
+ if (isDeno()) envObject = globals.Deno?.env?.toObject?.() ?? {};
1255
+ else envObject = globals.process?.env ?? {};
1171
1256
  envMemo = envSchema.parse(envObject);
1172
1257
  return envMemo;
1173
1258
  }
1174
- //#endregion
1175
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/security.js
1176
- var SecurityErrorCode;
1177
- (function(SecurityErrorCode) {
1178
- SecurityErrorCode["Incomplete"] = "incomplete";
1179
- SecurityErrorCode["UnrecognisedSecurityType"] = "unrecognized_security_type";
1180
- })(SecurityErrorCode || (SecurityErrorCode = {}));
1259
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/security.js
1260
+ const SecurityErrorCode = {
1261
+ Incomplete: "incomplete",
1262
+ UnrecognisedSecurityType: "unrecognized_security_type"
1263
+ };
1181
1264
  var SecurityError = class SecurityError extends Error {
1182
1265
  code;
1183
1266
  constructor(code, message) {
@@ -1275,8 +1358,7 @@ async function extractSecurity(sec) {
1275
1358
  if (sec == null) return;
1276
1359
  return typeof sec === "function" ? sec() : sec;
1277
1360
  }
1278
- //#endregion
1279
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/url.js
1361
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/url.js
1280
1362
  const hasOwn = Object.prototype.hasOwnProperty;
1281
1363
  function pathToFunc(pathPattern, options) {
1282
1364
  const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
@@ -1289,8 +1371,7 @@ function pathToFunc(pathPattern, options) {
1289
1371
  }).replace(/^\/+/, "");
1290
1372
  };
1291
1373
  }
1292
- //#endregion
1293
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/toolconfiguration.js
1374
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/toolconfiguration.js
1294
1375
  /** @internal */
1295
1376
  const ToolConfiguration$inboundSchema = z$1.object({
1296
1377
  exclude: z$1.nullable(z$1.array(z$1.string())).optional(),
@@ -1307,19 +1388,6 @@ const ToolConfiguration$outboundSchema = z$1.object({
1307
1388
  }).transform((v) => {
1308
1389
  return remap(v, { requiresConfirmation: "requires_confirmation" });
1309
1390
  });
1310
- z$1.object({
1311
- tool_configuration: z$1.nullable(ToolConfiguration$inboundSchema).optional(),
1312
- type: z$1.literal("code_interpreter")
1313
- }).transform((v) => {
1314
- return remap(v, { "tool_configuration": "toolConfiguration" });
1315
- });
1316
- /** @internal */
1317
- const CodeInterpreterTool$outboundSchema = z$1.object({
1318
- toolConfiguration: z$1.nullable(ToolConfiguration$outboundSchema).optional(),
1319
- type: z$1.literal("code_interpreter")
1320
- }).transform((v) => {
1321
- return remap(v, { toolConfiguration: "tool_configuration" });
1322
- });
1323
1391
  z$1.object({
1324
1392
  type: z$1.literal("content").default("content"),
1325
1393
  content: z$1.string().default("")
@@ -1329,8 +1397,7 @@ const Prediction$outboundSchema = z$1.object({
1329
1397
  type: z$1.literal("content").default("content"),
1330
1398
  content: z$1.string().default("")
1331
1399
  });
1332
- //#endregion
1333
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/jsonschema.js
1400
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/jsonschema.js
1334
1401
  /** @internal */
1335
1402
  const JsonSchema$inboundSchema = z$1.object({
1336
1403
  name: z$1.string(),
@@ -1349,8 +1416,7 @@ const JsonSchema$outboundSchema = z$1.object({
1349
1416
  }).transform((v) => {
1350
1417
  return remap(v, { schemaDefinition: "schema" });
1351
1418
  });
1352
- //#endregion
1353
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/responseformats.js
1419
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/responseformats.js
1354
1420
  const ResponseFormats = {
1355
1421
  Text: "text",
1356
1422
  JsonObject: "json_object",
@@ -1373,8 +1439,7 @@ const ResponseFormat$outboundSchema = z$1.object({
1373
1439
  }).transform((v) => {
1374
1440
  return remap(v, { jsonSchema: "json_schema" });
1375
1441
  });
1376
- //#endregion
1377
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/toolchoiceenum.js
1442
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/toolchoiceenum.js
1378
1443
  const ToolChoiceEnum = {
1379
1444
  Auto: "auto",
1380
1445
  None: "none",
@@ -1384,8 +1449,7 @@ const ToolChoiceEnum = {
1384
1449
  inboundSchema(ToolChoiceEnum);
1385
1450
  /** @internal */
1386
1451
  const ToolChoiceEnum$outboundSchema = outboundSchema(ToolChoiceEnum);
1387
- //#endregion
1388
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/apikeyauth.js
1452
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/apikeyauth.js
1389
1453
  /** @internal */
1390
1454
  const APIKeyAuth$inboundSchema = z$1.object({
1391
1455
  type: z$1.literal("api-key"),
@@ -1396,8 +1460,7 @@ const APIKeyAuth$outboundSchema = z$1.object({
1396
1460
  type: z$1.literal("api-key"),
1397
1461
  value: z$1.string()
1398
1462
  });
1399
- //#endregion
1400
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/oauth2tokenauth.js
1463
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/oauth2tokenauth.js
1401
1464
  /** @internal */
1402
1465
  const OAuth2TokenAuth$inboundSchema = z$1.object({
1403
1466
  type: z$1.literal("oauth2-token"),
@@ -1460,10 +1523,7 @@ const DocumentLibraryTool$outboundSchema = z$1.object({
1460
1523
  libraryIds: "library_ids"
1461
1524
  });
1462
1525
  });
1463
- //#endregion
1464
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/function.js
1465
- /** @internal */
1466
- const FunctionT$inboundSchema = z$1.object({
1526
+ z$1.object({
1467
1527
  name: z$1.string(),
1468
1528
  description: z$1.string().optional(),
1469
1529
  strict: z$1.boolean().optional(),
@@ -1476,8 +1536,7 @@ const FunctionT$outboundSchema = z$1.object({
1476
1536
  strict: z$1.boolean().optional(),
1477
1537
  parameters: z$1.record(z$1.string(), z$1.any())
1478
1538
  });
1479
- //#endregion
1480
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/moderationllmaction.js
1539
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/moderationllmaction.js
1481
1540
  const ModerationLLMAction = {
1482
1541
  None: "none",
1483
1542
  Block: "block"
@@ -1486,8 +1545,7 @@ const ModerationLLMAction = {
1486
1545
  const ModerationLLMAction$inboundSchema = inboundSchema(ModerationLLMAction);
1487
1546
  /** @internal */
1488
1547
  const ModerationLLMAction$outboundSchema = outboundSchema(ModerationLLMAction);
1489
- //#endregion
1490
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv1categorythresholds.js
1548
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv1categorythresholds.js
1491
1549
  /** @internal */
1492
1550
  const ModerationLlmv1CategoryThresholds$inboundSchema = z$1.object({
1493
1551
  sexual: z$1.nullable(z$1.number()).optional(),
@@ -1524,8 +1582,7 @@ const ModerationLlmv1CategoryThresholds$outboundSchema = z$1.object({
1524
1582
  dangerousAndCriminalContent: "dangerous_and_criminal_content"
1525
1583
  });
1526
1584
  });
1527
- //#endregion
1528
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv1config.js
1585
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv1config.js
1529
1586
  /** @internal */
1530
1587
  const ModerationLlmv1Config$inboundSchema = z$1.object({
1531
1588
  model_name: z$1.string().default("mistral-moderation-2411"),
@@ -1552,8 +1609,7 @@ const ModerationLlmv1Config$outboundSchema = z$1.object({
1552
1609
  ignoreOtherCategories: "ignore_other_categories"
1553
1610
  });
1554
1611
  });
1555
- //#endregion
1556
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv2categorythresholds.js
1612
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv2categorythresholds.js
1557
1613
  /** @internal */
1558
1614
  const ModerationLlmv2CategoryThresholds$inboundSchema = z$1.object({
1559
1615
  sexual: z$1.nullable(z$1.number()).optional(),
@@ -1592,8 +1648,7 @@ const ModerationLlmv2CategoryThresholds$outboundSchema = z$1.object({
1592
1648
  violenceAndThreats: "violence_and_threats"
1593
1649
  });
1594
1650
  });
1595
- //#endregion
1596
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv2config.js
1651
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/moderationllmv2config.js
1597
1652
  /** @internal */
1598
1653
  const ModerationLlmv2Config$inboundSchema = z$1.object({
1599
1654
  model_name: z$1.string().default("mistral-moderation-2603"),
@@ -1656,32 +1711,6 @@ const ImageGenerationTool$outboundSchema = z$1.object({
1656
1711
  }).transform((v) => {
1657
1712
  return remap(v, { toolConfiguration: "tool_configuration" });
1658
1713
  });
1659
- z$1.object({
1660
- tool_configuration: z$1.nullable(ToolConfiguration$inboundSchema).optional(),
1661
- type: z$1.literal("web_search_premium")
1662
- }).transform((v) => {
1663
- return remap(v, { "tool_configuration": "toolConfiguration" });
1664
- });
1665
- /** @internal */
1666
- const WebSearchPremiumTool$outboundSchema = z$1.object({
1667
- toolConfiguration: z$1.nullable(ToolConfiguration$outboundSchema).optional(),
1668
- type: z$1.literal("web_search_premium")
1669
- }).transform((v) => {
1670
- return remap(v, { toolConfiguration: "tool_configuration" });
1671
- });
1672
- z$1.object({
1673
- tool_configuration: z$1.nullable(ToolConfiguration$inboundSchema).optional(),
1674
- type: z$1.literal("web_search")
1675
- }).transform((v) => {
1676
- return remap(v, { "tool_configuration": "toolConfiguration" });
1677
- });
1678
- /** @internal */
1679
- const WebSearchTool$outboundSchema = z$1.object({
1680
- toolConfiguration: z$1.nullable(ToolConfiguration$outboundSchema).optional(),
1681
- type: z$1.literal("web_search")
1682
- }).transform((v) => {
1683
- return remap(v, { toolConfiguration: "tool_configuration" });
1684
- });
1685
1714
  smartUnion([z$1.string(), z$1.array(ContentChunk$inboundSchema)]);
1686
1715
  smartUnion([z$1.string(), z$1.array(ContentChunk$outboundSchema)]);
1687
1716
  /** @internal */
@@ -1709,8 +1738,7 @@ const RequestedServiceTier$outboundSchema = z$1.enum({
1709
1738
  Auto: "auto",
1710
1739
  StandardOnly: "standard_only"
1711
1740
  });
1712
- //#endregion
1713
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/systemmessagecontentchunks.js
1741
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/systemmessagecontentchunks.js
1714
1742
  /** @internal */
1715
1743
  const SystemMessageContentChunks$outboundSchema = z$1.union([TextChunk$outboundSchema.and(z$1.object({ type: z$1.literal("text") })), ThinkChunk$outboundSchema.and(z$1.object({ type: z$1.literal("thinking") }))]);
1716
1744
  smartUnion([z$1.string(), z$1.array(SystemMessageContentChunks$outboundSchema)]);
@@ -1719,24 +1747,19 @@ const SystemMessage$outboundSchema = z$1.object({
1719
1747
  role: z$1.literal("system"),
1720
1748
  content: smartUnion([z$1.string(), z$1.array(SystemMessageContentChunks$outboundSchema)])
1721
1749
  });
1722
- z$1.object({
1723
- type: ToolTypes$inboundSchema.default("function"),
1724
- function: FunctionT$inboundSchema
1725
- });
1750
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/tool.js
1726
1751
  /** @internal */
1727
1752
  const Tool$outboundSchema = z$1.object({
1728
- type: ToolTypes$outboundSchema.default("function"),
1753
+ type: z$1.literal("function"),
1729
1754
  function: FunctionT$outboundSchema
1730
1755
  });
1731
- //#endregion
1732
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/functionname.js
1756
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/functionname.js
1733
1757
  /** @internal */
1734
1758
  const FunctionName$outboundSchema = z$1.object({ name: z$1.string() });
1735
- //#endregion
1736
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/toolchoice.js
1759
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/toolchoice.js
1737
1760
  /** @internal */
1738
1761
  const ToolChoice$outboundSchema = z$1.object({
1739
- type: ToolTypes$outboundSchema.default("function"),
1762
+ type: z$1.string().default("function"),
1740
1763
  function: FunctionName$outboundSchema
1741
1764
  });
1742
1765
  smartUnion([z$1.string(), z$1.array(ContentChunk$outboundSchema)]);
@@ -1768,9 +1791,14 @@ const ChatCompletionChoice$inboundSchema = z$1.object({
1768
1791
  index: z$1.int(),
1769
1792
  message: AssistantMessage$inboundSchema.optional(),
1770
1793
  messages: z$1.array(DeltaMessage$inboundSchema).optional(),
1771
- finish_reason: ChatCompletionChoiceFinishReason$inboundSchema
1794
+ finish_reason: ChatCompletionChoiceFinishReason$inboundSchema,
1795
+ logprobs: z$1.nullable(ChatCompletionResponseChoiceLogprobs$inboundSchema).optional(),
1796
+ prompt_logprobs: z$1.nullable(ChatCompletionResponseChoiceLogprobs$inboundSchema).optional()
1772
1797
  }).transform((v) => {
1773
- return remap(v, { "finish_reason": "finishReason" });
1798
+ return remap(v, {
1799
+ "finish_reason": "finishReason",
1800
+ "prompt_logprobs": "promptLogprobs"
1801
+ });
1774
1802
  });
1775
1803
  smartUnion([z$1.string(), z$1.array(z$1.string())]);
1776
1804
  z$1.union([
@@ -1780,10 +1808,7 @@ z$1.union([
1780
1808
  UserMessage$outboundSchema
1781
1809
  ]);
1782
1810
  z$1.union([
1783
- Tool$outboundSchema.and(z$1.object({ type: z$1.literal("function") })),
1784
- WebSearchTool$outboundSchema,
1785
- WebSearchPremiumTool$outboundSchema,
1786
- CodeInterpreterTool$outboundSchema,
1811
+ Tool$outboundSchema,
1787
1812
  ImageGenerationTool$outboundSchema,
1788
1813
  DocumentLibraryTool$outboundSchema,
1789
1814
  CustomConnector$outboundSchema
@@ -1807,10 +1832,7 @@ const ChatCompletionRequest$outboundSchema = z$1.object({
1807
1832
  ])),
1808
1833
  responseFormat: ResponseFormat$outboundSchema.optional(),
1809
1834
  tools: z$1.nullable(z$1.array(z$1.union([
1810
- Tool$outboundSchema.and(z$1.object({ type: z$1.literal("function") })),
1811
- WebSearchTool$outboundSchema,
1812
- WebSearchPremiumTool$outboundSchema,
1813
- CodeInterpreterTool$outboundSchema,
1835
+ Tool$outboundSchema,
1814
1836
  ImageGenerationTool$outboundSchema,
1815
1837
  DocumentLibraryTool$outboundSchema,
1816
1838
  CustomConnector$outboundSchema
@@ -1818,6 +1840,13 @@ const ChatCompletionRequest$outboundSchema = z$1.object({
1818
1840
  toolChoice: smartUnion([ToolChoice$outboundSchema, ToolChoiceEnum$outboundSchema]).optional(),
1819
1841
  presencePenalty: z$1.nullable(z$1.number()).optional(),
1820
1842
  frequencyPenalty: z$1.nullable(z$1.number()).optional(),
1843
+ minTokens: z$1.nullable(z$1.int()).optional(),
1844
+ repetitionPenalty: z$1.nullable(z$1.number()).optional(),
1845
+ topK: z$1.nullable(z$1.int()).optional(),
1846
+ logprobs: z$1.nullable(z$1.boolean()).optional(),
1847
+ topLogprobs: z$1.nullable(z$1.int()).optional(),
1848
+ promptLogprobs: z$1.nullable(z$1.boolean()).optional(),
1849
+ topPromptLogprobs: z$1.nullable(z$1.int()).optional(),
1821
1850
  n: z$1.nullable(z$1.int()).optional(),
1822
1851
  prediction: Prediction$outboundSchema.optional(),
1823
1852
  parallelToolCalls: z$1.boolean().optional(),
@@ -1836,6 +1865,12 @@ const ChatCompletionRequest$outboundSchema = z$1.object({
1836
1865
  toolChoice: "tool_choice",
1837
1866
  presencePenalty: "presence_penalty",
1838
1867
  frequencyPenalty: "frequency_penalty",
1868
+ minTokens: "min_tokens",
1869
+ repetitionPenalty: "repetition_penalty",
1870
+ topK: "top_k",
1871
+ topLogprobs: "top_logprobs",
1872
+ promptLogprobs: "prompt_logprobs",
1873
+ topPromptLogprobs: "top_prompt_logprobs",
1839
1874
  parallelToolCalls: "parallel_tool_calls",
1840
1875
  reasoningEffort: "reasoning_effort",
1841
1876
  promptMode: "prompt_mode",
@@ -1844,8 +1879,7 @@ const ChatCompletionRequest$outboundSchema = z$1.object({
1844
1879
  safePrompt: "safe_prompt"
1845
1880
  });
1846
1881
  });
1847
- //#endregion
1848
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/chatcompletionresponse.js
1882
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/chatcompletionresponse.js
1849
1883
  /** @internal */
1850
1884
  const ChatCompletionResponse$inboundSchema = z$1.object({
1851
1885
  id: z$1.string(),
@@ -1863,10 +1897,7 @@ z$1.union([
1863
1897
  UserMessage$outboundSchema
1864
1898
  ]);
1865
1899
  z$1.union([
1866
- Tool$outboundSchema.and(z$1.object({ type: z$1.literal("function") })),
1867
- WebSearchTool$outboundSchema,
1868
- WebSearchPremiumTool$outboundSchema,
1869
- CodeInterpreterTool$outboundSchema,
1900
+ Tool$outboundSchema,
1870
1901
  ImageGenerationTool$outboundSchema,
1871
1902
  DocumentLibraryTool$outboundSchema,
1872
1903
  CustomConnector$outboundSchema
@@ -1890,10 +1921,7 @@ const ChatCompletionStreamRequest$outboundSchema = z$1.object({
1890
1921
  ])),
1891
1922
  responseFormat: ResponseFormat$outboundSchema.optional(),
1892
1923
  tools: z$1.nullable(z$1.array(z$1.union([
1893
- Tool$outboundSchema.and(z$1.object({ type: z$1.literal("function") })),
1894
- WebSearchTool$outboundSchema,
1895
- WebSearchPremiumTool$outboundSchema,
1896
- CodeInterpreterTool$outboundSchema,
1924
+ Tool$outboundSchema,
1897
1925
  ImageGenerationTool$outboundSchema,
1898
1926
  DocumentLibraryTool$outboundSchema,
1899
1927
  CustomConnector$outboundSchema
@@ -1901,6 +1929,13 @@ const ChatCompletionStreamRequest$outboundSchema = z$1.object({
1901
1929
  toolChoice: smartUnion([ToolChoice$outboundSchema, ToolChoiceEnum$outboundSchema]).optional(),
1902
1930
  presencePenalty: z$1.nullable(z$1.number()).optional(),
1903
1931
  frequencyPenalty: z$1.nullable(z$1.number()).optional(),
1932
+ minTokens: z$1.nullable(z$1.int()).optional(),
1933
+ repetitionPenalty: z$1.nullable(z$1.number()).optional(),
1934
+ topK: z$1.nullable(z$1.int()).optional(),
1935
+ logprobs: z$1.nullable(z$1.boolean()).optional(),
1936
+ topLogprobs: z$1.nullable(z$1.int()).optional(),
1937
+ promptLogprobs: z$1.nullable(z$1.boolean()).optional(),
1938
+ topPromptLogprobs: z$1.nullable(z$1.int()).optional(),
1904
1939
  n: z$1.nullable(z$1.int()).optional(),
1905
1940
  prediction: Prediction$outboundSchema.optional(),
1906
1941
  parallelToolCalls: z$1.boolean().optional(),
@@ -1919,6 +1954,12 @@ const ChatCompletionStreamRequest$outboundSchema = z$1.object({
1919
1954
  toolChoice: "tool_choice",
1920
1955
  presencePenalty: "presence_penalty",
1921
1956
  frequencyPenalty: "frequency_penalty",
1957
+ minTokens: "min_tokens",
1958
+ repetitionPenalty: "repetition_penalty",
1959
+ topK: "top_k",
1960
+ topLogprobs: "top_logprobs",
1961
+ promptLogprobs: "prompt_logprobs",
1962
+ topPromptLogprobs: "top_prompt_logprobs",
1922
1963
  parallelToolCalls: "parallel_tool_calls",
1923
1964
  reasoningEffort: "reasoning_effort",
1924
1965
  promptMode: "prompt_mode",
@@ -1927,10 +1968,10 @@ const ChatCompletionStreamRequest$outboundSchema = z$1.object({
1927
1968
  safePrompt: "safe_prompt"
1928
1969
  });
1929
1970
  });
1930
- //#endregion
1931
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/components/completionevent.js
1971
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/components/completionevent.js
1932
1972
  /** @internal */
1933
- const CompletionEvent$inboundSchema = z$1.object({ data: z$1.string().transform((v, ctx) => {
1973
+ const CompletionEvent$inboundSchema = z$1.object({ data: z$1.unknown().transform((v, ctx) => {
1974
+ if (typeof v !== "string") return v;
1934
1975
  try {
1935
1976
  return JSON.parse(v);
1936
1977
  } catch (err) {
@@ -1953,8 +1994,7 @@ const ValidationError$inboundSchema = z$1.object({
1953
1994
  input: z$1.any().optional(),
1954
1995
  ctx: z$1.lazy(() => Context$inboundSchema).optional()
1955
1996
  });
1956
- //#endregion
1957
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/httpclienterrors.js
1997
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/httpclienterrors.js
1958
1998
  /**
1959
1999
  * Base class for all HTTP errors.
1960
2000
  */
@@ -2001,8 +2041,7 @@ var RequestTimeoutError = class extends HTTPClientError {
2001
2041
  var ConnectionError = class extends HTTPClientError {
2002
2042
  name = "ConnectionError";
2003
2043
  };
2004
- //#endregion
2005
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/models/errors/httpvalidationerror.js
2044
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/models/errors/httpvalidationerror.js
2006
2045
  var HTTPValidationError = class extends MistralError {
2007
2046
  detail;
2008
2047
  /** The original data that was passed to this error instance. */
@@ -2028,8 +2067,7 @@ const HTTPValidationError$inboundSchema = z$1.object({
2028
2067
  body: v.body$
2029
2068
  });
2030
2069
  });
2031
- //#endregion
2032
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/types/async.js
2070
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/types/async.js
2033
2071
  var APIPromise = class {
2034
2072
  #promise;
2035
2073
  #unwrapped;
@@ -2054,8 +2092,7 @@ var APIPromise = class {
2054
2092
  return this.#promise;
2055
2093
  }
2056
2094
  };
2057
- //#endregion
2058
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/funcs/chatComplete.js
2095
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/funcs/chatComplete.js
2059
2096
  /**
2060
2097
  * Chat Completion
2061
2098
  */
@@ -2129,27 +2166,42 @@ async function $do$1(client, request, options) {
2129
2166
  response
2130
2167
  }];
2131
2168
  }
2132
- //#endregion
2133
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/event-streams.js
2169
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/event-streams.js
2134
2170
  var EventStream = class extends ReadableStream {
2135
2171
  constructor(responseBody, parse, opts) {
2136
2172
  const upstream = responseBody.getReader();
2137
- let buffer = /* @__PURE__ */ new Uint8Array();
2173
+ let buffer = /* @__PURE__ */ new Uint8Array(4096);
2174
+ let bufferLen = 0;
2175
+ let searchStart = 0;
2138
2176
  const state = { eventId: void 0 };
2139
2177
  const dataRequired = opts?.dataRequired ?? true;
2140
2178
  super({
2141
2179
  async pull(downstream) {
2142
2180
  try {
2143
2181
  while (true) {
2144
- const match = findBoundary$1(buffer);
2182
+ const match = findBoundary$1(buffer, bufferLen, searchStart);
2145
2183
  if (!match) {
2184
+ searchStart = Math.max(0, bufferLen - MAX_BOUNDARY_LEN + 1);
2146
2185
  const chunk = await upstream.read();
2147
2186
  if (chunk.done) return downstream.close();
2148
- buffer = concatBuffer$1(buffer, chunk.value);
2187
+ if (bufferLen + chunk.value.length > buffer.length) {
2188
+ const grown = new Uint8Array(Math.max(buffer.length * 2, bufferLen + chunk.value.length));
2189
+ grown.set(buffer.subarray(0, bufferLen));
2190
+ buffer = grown;
2191
+ }
2192
+ buffer.set(chunk.value, bufferLen);
2193
+ bufferLen += chunk.value.length;
2149
2194
  continue;
2150
2195
  }
2151
2196
  const message = buffer.slice(0, match.index);
2152
- buffer = buffer.slice(match.index + match.length);
2197
+ buffer.copyWithin(0, match.index + match.length, bufferLen);
2198
+ bufferLen -= match.index + match.length;
2199
+ if (buffer.length > 4096 && bufferLen <= buffer.length >> 2) {
2200
+ const shrunk = new Uint8Array(Math.max(4096, bufferLen * 2));
2201
+ shrunk.set(buffer.subarray(0, bufferLen));
2202
+ buffer = shrunk;
2203
+ }
2204
+ searchStart = 0;
2153
2205
  const item = parseMessage(message, parse, state, dataRequired);
2154
2206
  if (item && !item.done) return downstream.enqueue(item.value);
2155
2207
  if (item?.done) {
@@ -2206,12 +2258,6 @@ var EventStream = class extends ReadableStream {
2206
2258
  };
2207
2259
  }
2208
2260
  };
2209
- function concatBuffer$1(a, b) {
2210
- const c = new Uint8Array(a.length + b.length);
2211
- c.set(a, 0);
2212
- c.set(b, a.length);
2213
- return c;
2214
- }
2215
2261
  const CR$1 = 13;
2216
2262
  const LF$1 = 10;
2217
2263
  const BOUNDARIES$1 = [
@@ -2245,9 +2291,9 @@ const BOUNDARIES$1 = [
2245
2291
  [LF$1, CR$1],
2246
2292
  [LF$1, LF$1]
2247
2293
  ];
2248
- function findBoundary$1(buf) {
2249
- const len = buf.length;
2250
- for (let i = 0; i < len; i++) {
2294
+ const MAX_BOUNDARY_LEN = BOUNDARIES$1.reduce((m, b) => Math.max(m, b.length), 0);
2295
+ function findBoundary$1(buf, len, from) {
2296
+ for (let i = from; i < len; i++) {
2251
2297
  if (buf[i] !== CR$1 && buf[i] !== LF$1) continue;
2252
2298
  for (const boundary of BOUNDARIES$1) {
2253
2299
  if (i + boundary.length > len) continue;
@@ -2290,8 +2336,7 @@ function parseMessage(chunk, parse, state, dataRequired) {
2290
2336
  else if (dataRequired) return;
2291
2337
  return parse(ret);
2292
2338
  }
2293
- //#endregion
2294
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/funcs/chatStream.js
2339
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/funcs/chatStream.js
2295
2340
  /**
2296
2341
  * Stream chat completion
2297
2342
  *
@@ -2400,12 +2445,11 @@ function serverURLFromOptions(options) {
2400
2445
  const SDK_METADATA = {
2401
2446
  language: "typescript",
2402
2447
  openapiDocVersion: "1.0.0",
2403
- sdkVersion: "2.7.0",
2404
- genVersion: "2.884.13",
2405
- userAgent: "speakeasy-sdk/typescript 2.7.0 2.884.13 1.0.0 @mistralai/mistralai"
2448
+ sdkVersion: "3.4.0",
2449
+ genVersion: "2.935.1",
2450
+ userAgent: "speakeasy-sdk/typescript 3.4.0 2.935.1 1.0.0 @mistralai/mistralai"
2406
2451
  };
2407
- //#endregion
2408
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/custom_user_agent.js
2452
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/custom_user_agent.js
2409
2453
  var CustomUserAgentHook = class {
2410
2454
  beforeRequest(_, request) {
2411
2455
  const ua = `mistral-client-typescript/${SDK_METADATA.sdkVersion}`;
@@ -2414,8 +2458,7 @@ var CustomUserAgentHook = class {
2414
2458
  return request;
2415
2459
  }
2416
2460
  };
2417
- //#endregion
2418
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/deprecation_warning.js
2461
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/deprecation_warning.js
2419
2462
  const HEADER_MODEL_DEPRECATION_TIMESTAMP = "x-model-deprecation-timestamp";
2420
2463
  var DeprecationWarningHook = class {
2421
2464
  afterSuccess(_, response) {
@@ -2426,14 +2469,136 @@ var DeprecationWarningHook = class {
2426
2469
  return response;
2427
2470
  }
2428
2471
  };
2429
- //#endregion
2430
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/tracing.js
2472
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/service_account_auth.js
2473
+ const SA_TOKEN_PATH_ENV = "MISTRAL_SA_TOKEN_PATH";
2474
+ /** Thrown when the configured service-account token file cannot be read. */
2475
+ var ServiceAccountTokenError = class extends Error {
2476
+ constructor(message, options) {
2477
+ super(message, options);
2478
+ this.name = "ServiceAccountTokenError";
2479
+ }
2480
+ };
2481
+ function serviceAccountTokenPath() {
2482
+ return globalThis.process?.env?.[SA_TOKEN_PATH_ENV] || null;
2483
+ }
2484
+ /**
2485
+ * Read the mounted service-account token, or null when no path is configured.
2486
+ *
2487
+ * Re-read on every call so kubelet rotation is picked up. `node:fs` is imported lazily so it stays
2488
+ * out of browser bundles, where there is no `process.env` to configure a path in the first place.
2489
+ */
2490
+ async function readServiceAccountToken() {
2491
+ const path = serviceAccountTokenPath();
2492
+ if (path === null) return null;
2493
+ let contents;
2494
+ try {
2495
+ const { readFile } = await import("node:fs/promises");
2496
+ contents = await readFile(path, "utf8");
2497
+ } catch (cause) {
2498
+ throw new ServiceAccountTokenError(`Failed to read service-account token from ${path}`, { cause });
2499
+ }
2500
+ const token = contents.trim();
2501
+ if (!token) throw new ServiceAccountTokenError(`Service-account token file is empty: ${path}`);
2502
+ return token;
2503
+ }
2504
+ function bearerHeader(token) {
2505
+ return token.slice(0, 7).toLowerCase() === "bearer " ? token : `Bearer ${token}`;
2506
+ }
2507
+ function envAuthorization() {
2508
+ const apiKey = env().MISTRAL_API_KEY;
2509
+ return apiKey ? bearerHeader(apiKey) : null;
2510
+ }
2511
+ /**
2512
+ * Authenticates requests from a mounted service-account token when no apiKey was passed.
2513
+ *
2514
+ * Yields the precedence per-request headers > explicit `apiKey` > `MISTRAL_SA_TOKEN_PATH` >
2515
+ * `MISTRAL_API_KEY`. The generated client already covers the explicit key and `MISTRAL_API_KEY`.
2516
+ */
2517
+ var ServiceAccountAuthHook = class {
2518
+ async beforeRequest(hookCtx, request) {
2519
+ if (hookCtx.securitySource != null) return request;
2520
+ const existing = request.headers.get("Authorization");
2521
+ if (existing !== null && existing !== envAuthorization()) return request;
2522
+ const token = await readServiceAccountToken();
2523
+ if (token === null) return request;
2524
+ request.headers.set("Authorization", bearerHeader(token));
2525
+ return request;
2526
+ }
2527
+ };
2528
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/traceparent.js
2529
+ const EXECUTE_OPERATION_IDS = /* @__PURE__ */ new Set(["execute_workflow_v1_workflows__workflow_identifier__execute_post", "execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post"]);
2530
+ const SAMPLED_FLAG = 1;
2531
+ let otelApi;
2532
+ async function getOTelApi() {
2533
+ if (otelApi !== void 0) return otelApi;
2534
+ try {
2535
+ otelApi = await import("@opentelemetry/api");
2536
+ } catch {
2537
+ otelApi = null;
2538
+ }
2539
+ return otelApi;
2540
+ }
2541
+ function isSampled(traceparent) {
2542
+ const parts = traceparent.split("-");
2543
+ if (parts.length !== 4 || !/^[0-9a-f]+$/i.test(parts[3])) return false;
2544
+ return (Number.parseInt(parts[3], 16) & SAMPLED_FLAG) !== 0;
2545
+ }
2546
+ function randomHex$1(bytes) {
2547
+ return Array.from(crypto.getRandomValues(new Uint8Array(bytes)), (byte) => byte.toString(16).padStart(2, "0")).join("");
2548
+ }
2549
+ async function sampledTraceparent() {
2550
+ const api = await getOTelApi();
2551
+ if (api) {
2552
+ const carrier = {};
2553
+ api.propagation.inject(api.context.active(), carrier);
2554
+ const traceparent = carrier["traceparent"] ?? "";
2555
+ if (isSampled(traceparent)) return traceparent;
2556
+ }
2557
+ return `00-${randomHex$1(16)}-${randomHex$1(8)}-01`;
2558
+ }
2559
+ async function jsonBody(request) {
2560
+ if (!(request.headers.get("content-type") ?? "").toLowerCase().includes("application/json")) return null;
2561
+ try {
2562
+ const body = await request.clone().json();
2563
+ return isPlainObject(body) ? body : null;
2564
+ } catch {
2565
+ return null;
2566
+ }
2567
+ }
2568
+ /**
2569
+ * Sends a sampled traceparent on /execute requests so worker traces are
2570
+ * always recorded, like the Python client's `TraceparentInjectionHook`.
2571
+ *
2572
+ * Sent in both the request body and the header. The body param is
2573
+ * authoritative; the header is kept for API versions that predate it.
2574
+ */
2575
+ var TraceparentInjectionHook = class {
2576
+ #traceparents = /* @__PURE__ */ new WeakMap();
2577
+ async beforeRequest(hookCtx, request) {
2578
+ if (!EXECUTE_OPERATION_IDS.has(hookCtx.operationID)) return request;
2579
+ const body = await jsonBody(request);
2580
+ const callerTraceparent = body?.["traceparent"] || request.headers.get("traceparent");
2581
+ const traceparent = typeof callerTraceparent === "string" ? callerTraceparent : this.#traceparents.get(hookCtx) ?? await sampledTraceparent();
2582
+ this.#traceparents.set(hookCtx, traceparent);
2583
+ const headers = new Headers(request.headers);
2584
+ headers.set("traceparent", traceparent);
2585
+ if (body === null || body["traceparent"]) return new Request(request, { headers });
2586
+ body["traceparent"] = traceparent;
2587
+ headers.delete("content-length");
2588
+ return new Request(request, {
2589
+ method: request.method,
2590
+ headers,
2591
+ body: JSON.stringify(body)
2592
+ });
2593
+ }
2594
+ };
2595
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/tracing.js
2431
2596
  let observabilityModule;
2432
2597
  let telemetryModule;
2433
2598
  async function getObservabilityModule() {
2434
2599
  if (observabilityModule !== void 0) return observabilityModule;
2435
2600
  try {
2436
- observabilityModule = await import("./otel-B2u5HGvm.mjs");
2601
+ observabilityModule = await import("./otel-C5Cn7IFQ.mjs");
2437
2602
  } catch {
2438
2603
  observabilityModule = null;
2439
2604
  }
@@ -2442,7 +2607,7 @@ async function getObservabilityModule() {
2442
2607
  async function getTelemetryModule() {
2443
2608
  if (telemetryModule !== void 0) return telemetryModule;
2444
2609
  try {
2445
- telemetryModule = await import("./telemetry-DJibfNKZ.mjs");
2610
+ telemetryModule = await import("./telemetry-Cd4i-clM.mjs");
2446
2611
  } catch {
2447
2612
  telemetryModule = null;
2448
2613
  }
@@ -2538,8 +2703,236 @@ var TracingHook = class {
2538
2703
  return observability.getResponseAndError(span, response, error);
2539
2704
  }
2540
2705
  };
2541
- //#endregion
2542
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/workflow_stream_error.js
2706
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/extra/workflows/encoding/ids.js
2707
+ const NAMESPACE_DNS = new Uint8Array([
2708
+ 107,
2709
+ 167,
2710
+ 184,
2711
+ 16,
2712
+ 157,
2713
+ 173,
2714
+ 17,
2715
+ 209,
2716
+ 128,
2717
+ 180,
2718
+ 0,
2719
+ 192,
2720
+ 79,
2721
+ 212,
2722
+ 48,
2723
+ 200
2724
+ ]);
2725
+ /** Python's `uuid.uuid5(uuid.NAMESPACE_DNS, name).hex`. */
2726
+ async function uuid5DnsHex(name) {
2727
+ const nameBytes = new TextEncoder().encode(name);
2728
+ const input = new Uint8Array(NAMESPACE_DNS.length + nameBytes.length);
2729
+ input.set(NAMESPACE_DNS, 0);
2730
+ input.set(nameBytes, NAMESPACE_DNS.length);
2731
+ const bytes = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-1", input)).slice(0, 16);
2732
+ bytes[6] = bytes[6] & 15 | 80;
2733
+ bytes[8] = bytes[8] & 63 | 128;
2734
+ return Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
2735
+ }
2736
+ function randomHex() {
2737
+ return globalThis.crypto.randomUUID().replace(/-/g, "");
2738
+ }
2739
+ /**
2740
+ * Generates a unique ID composed of two parts derived from seeds, like the
2741
+ * Python client's `generate_two_part_id`. Missing seeds are random.
2742
+ */
2743
+ async function generateTwoPartId(primarySeed, secondarySeed) {
2744
+ return `${await uuid5DnsHex(primarySeed || randomHex())}${await uuid5DnsHex(secondarySeed || randomHex())}`;
2745
+ }
2746
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/workflow_encoding.js
2747
+ /**
2748
+ * Port of the Python client's `WorkflowEncodingHook`
2749
+ * (`mistralai.client._hooks.workflow_encoding_hook`).
2750
+ *
2751
+ * Once a client is configured with `configureWorkflowEncoding()`, this hook
2752
+ * encodes workflow inputs before they are sent (encryption, compression,
2753
+ * blob storage offloading) and decodes workflow results and event payloads
2754
+ * (including SSE streams) when they are received.
2755
+ */
2756
+ const EXECUTE_WORKFLOW_OPERATION_ID = "execute_workflow_v1_workflows__workflow_identifier__execute_post";
2757
+ const EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID = "execute_workflow_registration_v1_workflows_registrations__workflow_registration_id__execute_post";
2758
+ const SCHEDULE_WORKFLOW_OPERATION_ID = "schedule_workflow_v1_workflows_schedules_post";
2759
+ const UPDATE_SCHEDULE_OPERATION_ID = "update_schedule_v1_workflows_schedules__schedule_id__patch";
2760
+ const EXECUTE_OPERATIONS = /* @__PURE__ */ new Set([EXECUTE_WORKFLOW_OPERATION_ID, EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID]);
2761
+ const SCHEDULE_OPERATIONS = /* @__PURE__ */ new Set([SCHEDULE_WORKFLOW_OPERATION_ID, UPDATE_SCHEDULE_OPERATION_ID]);
2762
+ const OPERATIONS_ENCODE_INPUT = /* @__PURE__ */ new Set([
2763
+ EXECUTE_WORKFLOW_OPERATION_ID,
2764
+ EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID,
2765
+ "signal_workflow_execution_v1_workflows_executions__execution_id__signals_post",
2766
+ "query_workflow_execution_v1_workflows_executions__execution_id__queries_post",
2767
+ "update_workflow_execution_v1_workflows_executions__execution_id__updates_post",
2768
+ SCHEDULE_WORKFLOW_OPERATION_ID,
2769
+ UPDATE_SCHEDULE_OPERATION_ID
2770
+ ]);
2771
+ const OPERATIONS_DECODE_RESULT = /* @__PURE__ */ new Set([
2772
+ EXECUTE_WORKFLOW_OPERATION_ID,
2773
+ EXECUTE_WORKFLOW_REGISTRATION_OPERATION_ID,
2774
+ "get_workflow_execution_v1_workflows_executions__execution_id__get",
2775
+ "query_workflow_execution_v1_workflows_executions__execution_id__queries_post",
2776
+ "update_workflow_execution_v1_workflows_executions__execution_id__updates_post"
2777
+ ]);
2778
+ const OPERATIONS_DECODE_EVENTS = /* @__PURE__ */ new Set(["get_workflow_events_v1_workflows_events_list_get"]);
2779
+ const OPERATIONS_DECODE_EVENTS_STREAM = /* @__PURE__ */ new Set(["get_stream_events_v1_workflows_events_stream_get", "stream_v1_workflows_executions__execution_id__stream_get"]);
2780
+ const SCHEDULE_CORRELATION_ID_PLACEHOLDER = "__scheduled_workflow__";
2781
+ /** Whether a value is a JSONPayload or JSONPatchPayload: `{type, value}`. */
2782
+ function isPayloadType(value) {
2783
+ return isPlainObject(value) && (value["type"] === "json" || value["type"] === "json_patch") && "value" in value;
2784
+ }
2785
+ function extractExecutionIdFromUrl(url) {
2786
+ return /\/executions\/([^/]+)/.exec(url)?.[1];
2787
+ }
2788
+ function extractWorkflowIdentifierFromExecuteUrl(url) {
2789
+ return /\/(?:workflows|registrations)\/([^/]+)\/execute/.exec(url)?.[1];
2790
+ }
2791
+ async function decryptEventAttributes(attributes, payloadEncoder) {
2792
+ for (const [fieldName, fieldValue] of Object.entries(attributes)) {
2793
+ if (!isPayloadType(fieldValue)) continue;
2794
+ const encodingOptions = fieldValue["encoding_options"];
2795
+ if (!Array.isArray(encodingOptions) || encodingOptions.length === 0) continue;
2796
+ attributes[fieldName] = await payloadEncoder.decodeEventPayload(fieldValue);
2797
+ }
2798
+ }
2799
+ async function decryptSseLine(line, payloadEncoder) {
2800
+ if (!line.startsWith("data:")) return line;
2801
+ const dataPart = line.slice(5).trim();
2802
+ if (!dataPart) return line;
2803
+ let eventWrapper;
2804
+ try {
2805
+ eventWrapper = JSON.parse(dataPart);
2806
+ } catch {
2807
+ return line;
2808
+ }
2809
+ if (!isPlainObject(eventWrapper)) return line;
2810
+ const data = eventWrapper["data"];
2811
+ if (!isPlainObject(data) || !isPlainObject(data["attributes"])) return line;
2812
+ await decryptEventAttributes(data["attributes"], payloadEncoder);
2813
+ return `data: ${JSON.stringify(eventWrapper)}`;
2814
+ }
2815
+ /** Headers for a rebuilt body: the SDK reads it already decompressed. */
2816
+ function rebuiltBodyHeaders(headers) {
2817
+ const result = new Headers(headers);
2818
+ result.delete("content-encoding");
2819
+ result.delete("content-length");
2820
+ return result;
2821
+ }
2822
+ function jsonResponse(response, body) {
2823
+ return new Response(JSON.stringify(body), {
2824
+ status: response.status,
2825
+ statusText: response.statusText,
2826
+ headers: rebuiltBodyHeaders(response.headers)
2827
+ });
2828
+ }
2829
+ function decryptingSseResponse(response, payloadEncoder) {
2830
+ const decoder = new TextDecoder();
2831
+ const encoder = new TextEncoder();
2832
+ let buffer = "";
2833
+ const transform = new TransformStream({
2834
+ async transform(chunk, controller) {
2835
+ buffer += decoder.decode(chunk, { stream: true });
2836
+ const lines = buffer.split("\n");
2837
+ buffer = lines.pop() ?? "";
2838
+ for (const line of lines) {
2839
+ const decrypted = await decryptSseLine(line, payloadEncoder);
2840
+ controller.enqueue(encoder.encode(`${decrypted}\n`));
2841
+ }
2842
+ },
2843
+ async flush(controller) {
2844
+ buffer += decoder.decode();
2845
+ if (buffer) controller.enqueue(encoder.encode(await decryptSseLine(buffer, payloadEncoder)));
2846
+ }
2847
+ });
2848
+ return new Response(response.body?.pipeThrough(transform) ?? null, {
2849
+ status: response.status,
2850
+ statusText: response.statusText,
2851
+ headers: rebuiltBodyHeaders(response.headers)
2852
+ });
2853
+ }
2854
+ var WorkflowEncodingHook = class {
2855
+ /**
2856
+ * Identifies this hook without `instanceof`: bundlers can load the
2857
+ * `extra/workflows` entry and the main SDK entry as separate module graphs,
2858
+ * each with its own copy of this class.
2859
+ */
2860
+ _mistralWorkflowEncodingHook = true;
2861
+ #config;
2862
+ #executionIds = /* @__PURE__ */ new WeakMap();
2863
+ /**
2864
+ * Enables payload encoding for the client this hook is registered on.
2865
+ *
2866
+ * @param namespace - The workflow namespace, under which inputs are
2867
+ * offloaded.
2868
+ */
2869
+ configure(payloadEncoder, namespace) {
2870
+ this.#config = {
2871
+ payloadEncoder,
2872
+ namespace
2873
+ };
2874
+ }
2875
+ async beforeRequest(hookCtx, request) {
2876
+ const config = this.#config;
2877
+ if (!config || !OPERATIONS_ENCODE_INPUT.has(hookCtx.operationID)) return request;
2878
+ if (!(request.headers.get("content-type") ?? "").includes("application/json")) return request;
2879
+ const body = await request.clone().json();
2880
+ if (!isPlainObject(body)) return request;
2881
+ const inputHolder = SCHEDULE_OPERATIONS.has(hookCtx.operationID) ? body["schedule"] : body;
2882
+ if (!isPlainObject(inputHolder) || inputHolder["input"] == null) return request;
2883
+ let executionId = body["execution_id"] || extractExecutionIdFromUrl(request.url);
2884
+ if (!executionId && EXECUTE_OPERATIONS.has(hookCtx.operationID)) {
2885
+ executionId = this.#executionIds.get(hookCtx) ?? await generateTwoPartId(extractWorkflowIdentifierFromExecuteUrl(request.url));
2886
+ this.#executionIds.set(hookCtx, executionId);
2887
+ body["execution_id"] = executionId;
2888
+ }
2889
+ if (!executionId && SCHEDULE_OPERATIONS.has(hookCtx.operationID)) executionId = SCHEDULE_CORRELATION_ID_PLACEHOLDER;
2890
+ if (!executionId) throw new Error(`WorkflowEncoding: Could not extract execution_id for ${hookCtx.operationID}`);
2891
+ const encodedInput = await config.payloadEncoder.encodeNetworkInput(inputHolder["input"], {
2892
+ namespace: config.namespace,
2893
+ executionId
2894
+ });
2895
+ if (EXECUTE_OPERATIONS.has(hookCtx.operationID)) {
2896
+ body["encoded_input"] = encodedInput;
2897
+ body["input"] = null;
2898
+ } else inputHolder["input"] = encodedInput;
2899
+ const headers = new Headers(request.headers);
2900
+ headers.delete("content-length");
2901
+ return new Request(request, {
2902
+ method: request.method,
2903
+ headers,
2904
+ body: JSON.stringify(body)
2905
+ });
2906
+ }
2907
+ async afterSuccess(hookCtx, response) {
2908
+ const payloadEncoder = this.#config?.payloadEncoder;
2909
+ if (!payloadEncoder) return response;
2910
+ const contentType = response.headers.get("content-type") ?? "";
2911
+ if (OPERATIONS_DECODE_EVENTS_STREAM.has(hookCtx.operationID)) {
2912
+ if (contentType.includes("text/event-stream") && response.body) return decryptingSseResponse(response, payloadEncoder);
2913
+ return response;
2914
+ }
2915
+ if (!contentType.includes("application/json")) return response;
2916
+ if (OPERATIONS_DECODE_RESULT.has(hookCtx.operationID)) {
2917
+ const body = await response.clone().json();
2918
+ if (!isPlainObject(body)) return response;
2919
+ const result = body["result"];
2920
+ if (result == null || !payloadEncoder.checkIsPayloadEncoded(result)) return response;
2921
+ const decoded = await payloadEncoder.decodeNetworkResult(result);
2922
+ if (decoded instanceof Uint8Array) throw new Error("WorkflowEncoding: decoded result is not valid JSON");
2923
+ body["result"] = decoded;
2924
+ return jsonResponse(response, body);
2925
+ }
2926
+ if (OPERATIONS_DECODE_EVENTS.has(hookCtx.operationID)) {
2927
+ const body = await response.clone().json();
2928
+ if (!isPlainObject(body) || !Array.isArray(body["events"])) return response;
2929
+ for (const event of body["events"]) if (isPlainObject(event) && isPlainObject(event["attributes"])) await decryptEventAttributes(event["attributes"], payloadEncoder);
2930
+ return jsonResponse(response, body);
2931
+ }
2932
+ return response;
2933
+ }
2934
+ };
2935
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/workflow_stream_error.js
2543
2936
  const STREAM_OPERATIONS_WITH_ERROR_EVENT = /* @__PURE__ */ new Set([
2544
2937
  "get_stream_events_v1_workflows_events_stream_get",
2545
2938
  "stream_v1_workflows_executions__execution_id__stream_get",
@@ -2731,13 +3124,19 @@ var WorkflowStreamErrorHook = class {
2731
3124
  return createErrorDetectingResponse(response);
2732
3125
  }
2733
3126
  };
2734
- //#endregion
2735
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/registration.js
3127
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/registration.js
2736
3128
  function initHooks(hooks) {
3129
+ const serviceAccountAuthHook = new ServiceAccountAuthHook();
3130
+ hooks.registerBeforeRequestHook(serviceAccountAuthHook);
2737
3131
  const customUserAgentHook = new CustomUserAgentHook();
2738
3132
  hooks.registerBeforeRequestHook(customUserAgentHook);
3133
+ const traceparentInjectionHook = new TraceparentInjectionHook();
3134
+ hooks.registerBeforeRequestHook(traceparentInjectionHook);
2739
3135
  const deprecationWarningHook = new DeprecationWarningHook();
2740
3136
  hooks.registerAfterSuccessHook(deprecationWarningHook);
3137
+ const workflowEncodingHook = new WorkflowEncodingHook();
3138
+ hooks.registerBeforeRequestHook(workflowEncodingHook);
3139
+ hooks.registerAfterSuccessHook(workflowEncodingHook);
2741
3140
  const workflowStreamErrorHook = new WorkflowStreamErrorHook();
2742
3141
  hooks.registerAfterSuccessHook(workflowStreamErrorHook);
2743
3142
  const tracingHook = new TracingHook();
@@ -2746,8 +3145,7 @@ function initHooks(hooks) {
2746
3145
  hooks.registerAfterErrorHook(tracingHook);
2747
3146
  hooks.registerSDKInitHook(tracingHook);
2748
3147
  }
2749
- //#endregion
2750
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/hooks/hooks.js
3148
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/hooks/hooks.js
2751
3149
  var SDKHooks = class {
2752
3150
  sdkInitHooks = [];
2753
3151
  beforeCreateRequestHooks = [];
@@ -2811,8 +3209,7 @@ var SDKHooks = class {
2811
3209
  };
2812
3210
  }
2813
3211
  };
2814
- //#endregion
2815
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/retries.js
3212
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/retries.js
2816
3213
  const defaultBackoff = {
2817
3214
  initialInterval: 500,
2818
3215
  maxInterval: 6e4,
@@ -2903,6 +3300,11 @@ async function retryBackoff(fn, strategy) {
2903
3300
  }
2904
3301
  }
2905
3302
  function retryIntervalFromResponse(res) {
3303
+ const retryAfterMsVal = res.headers.get("retry-after-ms");
3304
+ if (retryAfterMsVal) {
3305
+ const parsedMs = Number(retryAfterMsVal);
3306
+ if (Number.isFinite(parsedMs) && parsedMs >= 0) return parsedMs;
3307
+ }
2906
3308
  const retryVal = res.headers.get("retry-after") || "";
2907
3309
  if (!retryVal) return 0;
2908
3310
  const parsedNumber = Number(retryVal);
@@ -2917,8 +3319,7 @@ function retryIntervalFromResponse(res) {
2917
3319
  async function delay(delay) {
2918
3320
  return new Promise((resolve) => setTimeout(resolve, delay));
2919
3321
  }
2920
- //#endregion
2921
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/lib/sdks.js
3322
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/lib/sdks.js
2922
3323
  const gt = typeof globalThis === "undefined" ? null : globalThis;
2923
3324
  const isBrowserLike = typeof gt === "object" && gt != null && "importScripts" in gt && typeof gt["importScripts"] === "function" || typeof navigator !== "undefined" && "serviceWorker" in navigator || typeof window === "object" && typeof window.document !== "undefined";
2924
3325
  var ClientSDK = class {
@@ -2955,19 +3356,28 @@ var ClientSDK = class {
2955
3356
  if (path) {
2956
3357
  baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
2957
3358
  reqURL = new URL(path, baseURL);
3359
+ if (!reqURL.search && baseURL.search) reqURL.search = baseURL.search;
2958
3360
  } else reqURL = baseURL;
2959
3361
  reqURL.hash = "";
2960
- let finalQuery = query || "";
2961
- const secQuery = [];
2962
- for (const [k, v] of Object.entries(security?.queryParams || {})) {
2963
- const q = encodeForm(k, v, { charEncoding: "percent" });
2964
- if (typeof q !== "undefined") secQuery.push(q);
2965
- }
2966
- if (secQuery.length) finalQuery += `&${secQuery.join("&")}`;
2967
- if (finalQuery) {
2968
- const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery;
2969
- reqURL.search = `?${q}`;
2970
- }
3362
+ const mergeQuery = (current, additions) => {
3363
+ if (!additions) return current;
3364
+ const additionKeys = new Set(additions.split("&").filter((pair) => pair !== "").map((pair) => pair.split("=")[0] ?? ""));
3365
+ return [...current.split("&").filter((pair) => {
3366
+ return pair !== "" && !additionKeys.has(pair.split("=")[0] ?? "");
3367
+ }), additions].join("&");
3368
+ };
3369
+ const encodeQueryRecord = (record) => {
3370
+ return Object.entries(record).map(([k, v]) => {
3371
+ if (v == null) return;
3372
+ const value = v;
3373
+ return encodeForm(k, value, {
3374
+ explode: Array.isArray(value),
3375
+ charEncoding: "percent"
3376
+ });
3377
+ }).filter((pair) => typeof pair !== "undefined").join("&");
3378
+ };
3379
+ const finalQuery = [query || "", encodeQueryRecord(security?.queryParams || {})].reduce(mergeQuery, reqURL.search.slice(1));
3380
+ if (finalQuery) reqURL.search = `?${finalQuery}`;
2971
3381
  const headers = new Headers(opHeaders);
2972
3382
  const username = security?.basic.username;
2973
3383
  const password = security?.basic.password;
@@ -2988,7 +3398,7 @@ var ClientSDK = class {
2988
3398
  ...options?.fetchOptions,
2989
3399
  ...options
2990
3400
  };
2991
- if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) fetchOptions.signal = AbortSignal.timeout(conf.timeoutMs);
3401
+ if (!fetchOptions?.signal && conf.timeoutMs != null && conf.timeoutMs > 0) context.timeoutMs = conf.timeoutMs;
2992
3402
  if (conf.body instanceof ReadableStream) Object.assign(fetchOptions, { duplex: "half" });
2993
3403
  let input;
2994
3404
  try {
@@ -3008,8 +3418,16 @@ var ClientSDK = class {
3008
3418
  }
3009
3419
  async _do(request, options) {
3010
3420
  const { context, isErrorStatusCode } = options;
3421
+ const timeoutMs = context.timeoutMs;
3011
3422
  return retry(async () => {
3012
- const req = await this.#hooks.beforeRequest(context, request.clone());
3423
+ const cloned = request.clone();
3424
+ let attempt = cloned;
3425
+ if (timeoutMs != null && timeoutMs > 0) {
3426
+ const timeoutSignal = AbortSignal.timeout(timeoutMs);
3427
+ const combined = combineSignals(cloned.signal, timeoutSignal) ?? timeoutSignal;
3428
+ attempt = new Request(cloned, { signal: combined });
3429
+ }
3430
+ const req = await this.#hooks.beforeRequest(context, attempt);
3013
3431
  await logRequest(this.#logger, req).catch((e) => this.#logger?.log("Failed to log request:", e));
3014
3432
  let response = await this.#httpClient.request(req);
3015
3433
  try {
@@ -3100,8 +3518,7 @@ async function logResponse(logger, res, req) {
3100
3518
  logger.groupEnd();
3101
3519
  logger.groupEnd();
3102
3520
  }
3103
- //#endregion
3104
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/extra/structChat.js
3521
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/extra/structChat.js
3105
3522
  /**
3106
3523
  * Recursively makes a JSON schema strict-mode compatible:
3107
3524
  * - Sets additionalProperties: false on all objects
@@ -3215,8 +3632,7 @@ function responseFormatFromZodObject(responseFormat) {
3215
3632
  }
3216
3633
  };
3217
3634
  }
3218
- //#endregion
3219
- //#region node_modules/.pnpm/@mistralai+mistralai@2.7.0_@opentelemetry+api@1.9.1_@opentelemetry+exporter-trace-otlp-_ef8dce160c897b96339bfd78f5c612fa/node_modules/@mistralai/mistralai/esm/sdk/chat.js
3635
+ // node_modules/.pnpm/@mistralai+mistralai@3.4.0_@aws-sdk+client-s3@3.1161.0_@azure+identity@4.14.1_supports-_16bd8ad5369b63d330551c8b3f594697/node_modules/@mistralai/mistralai/esm/sdk/chat.js
3220
3636
  var Chat = class extends ClientSDK {
3221
3637
  /**
3222
3638
  * Chat Completion with the response parsed in the same format as the input requestFormat.
@@ -3255,8 +3671,7 @@ var Chat = class extends ClientSDK {
3255
3671
  return unwrapAsync(chatStream(this, request, options));
3256
3672
  }
3257
3673
  };
3258
- //#endregion
3259
- //#region packages/ai/src/providers/mistral.ts
3674
+ // packages/ai/src/providers/mistral.ts
3260
3675
  var mistral_exports = /* @__PURE__ */ __exportAll({
3261
3676
  createBoundedMistralFetcher: () => createBoundedMistralFetcher,
3262
3677
  streamMistral: () => streamMistral,
@@ -3349,7 +3764,7 @@ const streamMistral = (model, context, options) => {
3349
3764
  role: "system",
3350
3765
  content: sanitizeSurrogates(stripSystemPromptCacheBoundary(context.systemPrompt))
3351
3766
  });
3352
- const nextPayload = await options?.onPayload?.(payload, model);
3767
+ const nextPayload = await awaitProviderLifecycleCallback(options?.onPayload ? () => options.onPayload?.(payload, model) : void 0, options?.signal);
3353
3768
  if (nextPayload !== void 0) payload = nextPayload;
3354
3769
  const headers = mergeTransportHeaders(model.headers, options?.headers) ?? {};
3355
3770
  if (resolveMistralPromptCacheKey(options) && options?.sessionId) {
@@ -3737,5 +4152,4 @@ function mapToolChoice(choice, convertedToolNames) {
3737
4152
  function: { name: toolName }
3738
4153
  };
3739
4154
  }
3740
- //#endregion
3741
4155
  export { registerTracerProvider as a, createBoundedMistralFetcher, getRegisteredTracerProvider as i, completionChunkFromJSON as n, UsageInfo$outboundSchema as r, streamMistral, streamSimpleMistral, mistral_exports as t };