maka-agent 0.2.0-dev.62.20260928 → 0.2.0-dev.64.20260929

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 (723) hide show
  1. package/LICENSE +15 -15
  2. package/THIRD_PARTY_NOTICES.txt +26 -26
  3. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  4. package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +12 -12
  5. package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +52 -0
  6. package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +5 -4
  7. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +7 -0
  8. package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +51 -8
  9. package/node_modules/@agentclientprotocol/sdk/package.json +2 -2
  10. package/node_modules/@agentclientprotocol/sdk/schema/schema.json +90 -2
  11. package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +103 -12
  12. package/node_modules/@ai-sdk/anthropic/CHANGELOG.md +140 -0
  13. package/node_modules/@ai-sdk/anthropic/README.md +1 -1
  14. package/node_modules/@ai-sdk/anthropic/dist/index.js +1622 -868
  15. package/node_modules/@ai-sdk/anthropic/dist/internal/index.js +1516 -763
  16. package/node_modules/@ai-sdk/anthropic/docs/05-anthropic.mdx +483 -62
  17. package/node_modules/@ai-sdk/anthropic/package.json +4 -4
  18. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/approval-continuation.js +0 -1
  19. package/node_modules/@ai-sdk/code-mode/dist/code-mode-tool.js +59 -0
  20. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/errors.js +0 -8
  21. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/interrupt-continuation.js +0 -2
  22. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/tool-prompt.js +43 -15
  23. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/package.json +3 -3
  24. package/node_modules/@ai-sdk/cohere/CHANGELOG.md +99 -0
  25. package/node_modules/@ai-sdk/cohere/README.md +1 -1
  26. package/node_modules/@ai-sdk/cohere/dist/index.js +35 -49
  27. package/node_modules/@ai-sdk/cohere/docs/25-cohere.mdx +11 -9
  28. package/node_modules/@ai-sdk/cohere/package.json +4 -4
  29. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/CHANGELOG.md +183 -0
  30. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/README.md +1 -1
  31. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/dist/index.js +587 -245
  32. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/docs/00-ai-gateway.mdx +235 -30
  33. package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/gateway/package.json +4 -4
  34. package/node_modules/@ai-sdk/google/CHANGELOG.md +180 -0
  35. package/node_modules/@ai-sdk/google/README.md +1 -1
  36. package/node_modules/@ai-sdk/google/dist/index.js +1147 -1130
  37. package/node_modules/@ai-sdk/google/dist/internal/index.js +809 -889
  38. package/node_modules/@ai-sdk/google/docs/15-google.mdx +224 -41
  39. package/node_modules/@ai-sdk/google/package.json +4 -4
  40. package/node_modules/@ai-sdk/open-responses/CHANGELOG.md +109 -0
  41. package/node_modules/@ai-sdk/open-responses/dist/index.js +419 -183
  42. package/node_modules/@ai-sdk/open-responses/docs/06-open-responses.mdx +121 -6
  43. package/node_modules/@ai-sdk/open-responses/package.json +4 -4
  44. package/node_modules/@ai-sdk/openai/CHANGELOG.md +147 -0
  45. package/node_modules/@ai-sdk/openai/README.md +27 -2
  46. package/node_modules/@ai-sdk/openai/dist/index.js +2445 -1828
  47. package/node_modules/@ai-sdk/openai/dist/internal/index.js +2170 -2041
  48. package/node_modules/@ai-sdk/openai/docs/03-openai.mdx +311 -102
  49. package/node_modules/@ai-sdk/openai/package.json +4 -4
  50. package/node_modules/@ai-sdk/openai-compatible/CHANGELOG.md +110 -0
  51. package/node_modules/@ai-sdk/openai-compatible/dist/index.js +120 -130
  52. package/node_modules/@ai-sdk/openai-compatible/dist/internal/index.js +22 -14
  53. package/node_modules/@ai-sdk/openai-compatible/docs/index.mdx +2 -0
  54. package/node_modules/@ai-sdk/openai-compatible/package.json +4 -4
  55. package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/CHANGELOG.md +47 -0
  56. package/node_modules/@ai-sdk/{cohere/node_modules/@ai-sdk/provider → provider}/dist/index.js +127 -102
  57. package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/package.json +1 -1
  58. package/node_modules/@ai-sdk/provider-utils/CHANGELOG.md +99 -0
  59. package/node_modules/@ai-sdk/provider-utils/dist/experimental-evaluation/index.js +1618 -0
  60. package/node_modules/@ai-sdk/provider-utils/dist/index.js +470 -268
  61. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
  62. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
  63. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/core/request.js +23 -2
  64. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  65. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  66. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
  67. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/dispatcher/client.js +6 -2
  68. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/cache-handler.js +21 -5
  69. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/handler/retry-handler.js +109 -23
  70. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/cache.js +20 -1
  71. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/decompress.js +338 -46
  72. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/interceptor/dump.js +10 -23
  73. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  74. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/connection.js +19 -9
  75. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  76. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  77. package/node_modules/@ai-sdk/provider-utils/node_modules/undici/package.json +1 -1
  78. package/node_modules/@ai-sdk/provider-utils/package.json +7 -2
  79. package/node_modules/@earendil-works/pi-tui/README.md +8 -2
  80. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +18 -11
  81. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +7 -6
  82. package/node_modules/@earendil-works/pi-tui/dist/fuzzy.js +23 -22
  83. package/node_modules/@earendil-works/pi-tui/dist/index.js +2 -0
  84. package/node_modules/@earendil-works/pi-tui/dist/latex.js +109 -16
  85. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -44
  86. package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
  87. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +2 -20
  88. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +25 -6
  89. package/node_modules/@earendil-works/pi-tui/dist/utils.js +4 -0
  90. package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
  91. package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
  92. package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
  93. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  94. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
  95. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
  96. package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
  97. package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
  98. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  99. package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  100. package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
  101. package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
  102. package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
  103. package/node_modules/@earendil-works/pi-tui/native/win32/README.md +16 -7
  104. package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
  105. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  106. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  107. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
  108. package/node_modules/@earendil-works/pi-tui/package.json +11 -4
  109. package/node_modules/@larksuiteoapi/node-sdk/README.md +20 -0
  110. package/node_modules/@larksuiteoapi/node-sdk/README.zh.md +20 -0
  111. package/node_modules/@larksuiteoapi/node-sdk/es/index.js +33 -1
  112. package/node_modules/@larksuiteoapi/node-sdk/lib/index.js +33 -1
  113. package/node_modules/@larksuiteoapi/node-sdk/package.json +1 -1
  114. package/node_modules/@maka/acp-executor-plugin/dist/plugin.mjs +17 -0
  115. package/node_modules/@maka/acp-executor-plugin/package.json +1 -1
  116. package/node_modules/@maka/core/dist/model-web-search.js +2 -3
  117. package/node_modules/@maka/core/dist/relative-time.js +19 -20
  118. package/node_modules/@maka/eval/harbor/egress_filter.py +64 -47
  119. package/node_modules/@maka/eval/harbor/eval_framework.py +3 -3
  120. package/node_modules/@maka/eval/harbor/run_trial.py +2 -2
  121. package/node_modules/@maka/eval/node_modules/undici/README.md +10 -1
  122. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Agent.md +8 -8
  123. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  124. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  125. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Errors.md +25 -0
  126. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  127. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
  128. package/node_modules/@maka/eval/node_modules/undici/docs/docs/api/Pool.md +5 -6
  129. package/node_modules/@maka/eval/node_modules/undici/docs/docs/index.md +10 -1
  130. package/node_modules/@maka/eval/node_modules/undici/lib/api/readable.js +1 -2
  131. package/node_modules/@maka/eval/node_modules/undici/lib/core/request.js +23 -2
  132. package/node_modules/@maka/eval/node_modules/undici/lib/core/util.js +0 -39
  133. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
  134. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
  135. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/client.js +6 -1
  136. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  137. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  138. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/pool.js +90 -7
  139. package/node_modules/@maka/eval/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
  140. package/node_modules/@maka/eval/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
  141. package/node_modules/@maka/eval/node_modules/undici/lib/handler/redirect-handler.js +5 -0
  142. package/node_modules/@maka/eval/node_modules/undici/lib/handler/retry-handler.js +72 -13
  143. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/cache.js +4 -1
  144. package/node_modules/@maka/eval/node_modules/undici/lib/interceptor/decompress.js +236 -69
  145. package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cache.js +17 -8
  146. package/node_modules/@maka/eval/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  147. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/index.js +19 -7
  148. package/node_modules/@maka/eval/node_modules/undici/lib/web/cookies/util.js +3 -1
  149. package/node_modules/@maka/eval/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
  150. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/body.js +22 -15
  151. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  152. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  153. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/headers.js +34 -31
  154. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/index.js +46 -25
  155. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/request.js +74 -79
  156. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/response.js +43 -44
  157. package/node_modules/@maka/eval/node_modules/undici/lib/web/fetch/util.js +7 -7
  158. package/node_modules/@maka/eval/node_modules/undici/lib/web/infra/index.js +16 -1
  159. package/node_modules/@maka/eval/node_modules/undici/lib/web/webidl/index.js +2 -14
  160. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/connection.js +33 -12
  161. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/events.js +43 -26
  162. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  163. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  164. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
  165. package/node_modules/@maka/eval/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  166. package/node_modules/@maka/eval/node_modules/undici/package.json +1 -1
  167. package/node_modules/@maka/mcp/package.json +1 -1
  168. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +15 -3
  169. package/node_modules/@maka/runtime/dist/ai-sdk-message-projection.js +33 -3
  170. package/node_modules/@maka/runtime/dist/deepseek-web-search-codec.js +71 -0
  171. package/node_modules/@maka/runtime/dist/history-compaction.js +11 -4
  172. package/node_modules/@maka/runtime/dist/model-adapter.js +9 -5
  173. package/node_modules/@maka/runtime/dist/model-factory.js +4 -0
  174. package/node_modules/@maka/runtime/dist/plugin-agent-service.js +5 -13
  175. package/node_modules/@maka/runtime/dist/plugin-attachment-service.js +5 -13
  176. package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +26 -36
  177. package/node_modules/@maka/runtime/dist/plugin-data-services.js +9 -26
  178. package/node_modules/@maka/runtime/dist/plugin-fs-service.js +5 -13
  179. package/node_modules/@maka/runtime/dist/plugin-goal-service.js +5 -13
  180. package/node_modules/@maka/runtime/dist/plugin-internals.js +78 -0
  181. package/node_modules/@maka/runtime/dist/plugin-llm-service.js +5 -13
  182. package/node_modules/@maka/runtime/dist/plugin-runtime.js +4 -32
  183. package/node_modules/@maka/runtime/dist/plugin-session-query-service.js +5 -13
  184. package/node_modules/@maka/runtime/dist/plugin-shell-service.js +5 -13
  185. package/node_modules/@maka/runtime/dist/plugin-web-service.js +5 -13
  186. package/node_modules/@maka/runtime/dist/stream-graph-coordinator.js +3 -3
  187. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +161 -104
  188. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +3 -1
  189. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/docs/docs/api/Dispatcher.md +1 -0
  190. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/core/request.js +23 -2
  191. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
  192. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h1.js +23 -8
  193. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client-h2.js +84 -19
  194. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/dispatcher/client.js +6 -2
  195. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/cache-handler.js +21 -5
  196. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/handler/retry-handler.js +109 -23
  197. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/cache.js +20 -1
  198. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/decompress.js +338 -46
  199. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/interceptor/dump.js +10 -23
  200. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
  201. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/connection.js +19 -9
  202. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
  203. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
  204. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/node_modules/undici/package.json +1 -1
  205. package/node_modules/@maka/runtime/node_modules/@slack/socket-mode/package.json +1 -1
  206. package/node_modules/@maka/runtime/node_modules/undici/README.md +10 -1
  207. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Agent.md +8 -8
  208. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  209. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  210. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Errors.md +25 -0
  211. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  212. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
  213. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/api/Pool.md +5 -6
  214. package/node_modules/@maka/runtime/node_modules/undici/docs/docs/index.md +10 -1
  215. package/node_modules/@maka/runtime/node_modules/undici/lib/api/readable.js +1 -2
  216. package/node_modules/@maka/runtime/node_modules/undici/lib/core/request.js +23 -2
  217. package/node_modules/@maka/runtime/node_modules/undici/lib/core/util.js +0 -39
  218. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
  219. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
  220. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/client.js +6 -1
  221. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  222. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  223. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/pool.js +90 -7
  224. package/node_modules/@maka/runtime/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
  225. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
  226. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/redirect-handler.js +5 -0
  227. package/node_modules/@maka/runtime/node_modules/undici/lib/handler/retry-handler.js +72 -13
  228. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/cache.js +4 -1
  229. package/node_modules/@maka/runtime/node_modules/undici/lib/interceptor/decompress.js +236 -69
  230. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cache.js +17 -8
  231. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  232. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/index.js +19 -7
  233. package/node_modules/@maka/runtime/node_modules/undici/lib/web/cookies/util.js +3 -1
  234. package/node_modules/@maka/runtime/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
  235. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/body.js +22 -15
  236. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  237. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  238. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/headers.js +34 -31
  239. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/index.js +46 -25
  240. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/request.js +74 -79
  241. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/response.js +43 -44
  242. package/node_modules/@maka/runtime/node_modules/undici/lib/web/fetch/util.js +7 -7
  243. package/node_modules/@maka/runtime/node_modules/undici/lib/web/infra/index.js +16 -1
  244. package/node_modules/@maka/runtime/node_modules/undici/lib/web/webidl/index.js +2 -14
  245. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/connection.js +33 -12
  246. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/events.js +43 -26
  247. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  248. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  249. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
  250. package/node_modules/@maka/runtime/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  251. package/node_modules/@maka/runtime/node_modules/undici/package.json +1 -1
  252. package/node_modules/@maka/runtime/package.json +11 -11
  253. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +3 -7
  254. package/node_modules/@maka/runtime-host/dist/candidate-cli.js +7 -7
  255. package/node_modules/@maka/runtime-host/dist/protocol/turn.js +20 -8
  256. package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +107 -63
  257. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +1 -3
  258. package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +51 -16
  259. package/node_modules/@maka/runtime-host/package.json +2 -2
  260. package/node_modules/@maka/storage/dist/project-catalog.js +13 -20
  261. package/node_modules/@modelcontextprotocol/client/dist/index-BCtJi0p5.d.mts.map +1 -0
  262. package/node_modules/@modelcontextprotocol/client/dist/index-CEk3qkZM.d.cts.map +1 -0
  263. package/node_modules/@modelcontextprotocol/client/dist/index.cjs +375 -60
  264. package/node_modules/@modelcontextprotocol/client/dist/index.d.cts.map +1 -1
  265. package/node_modules/@modelcontextprotocol/client/dist/index.d.mts.map +1 -1
  266. package/node_modules/@modelcontextprotocol/client/dist/index.mjs +369 -61
  267. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.cjs +1 -1
  268. package/node_modules/@modelcontextprotocol/client/dist/shimsWorkerd.mjs +1 -1
  269. package/node_modules/@modelcontextprotocol/client/dist/{src-NAgB4Mp8.cjs → src-D0qEN74R.cjs} +111 -38
  270. package/node_modules/@modelcontextprotocol/client/dist/{src-D_zzAWoS.mjs → src-DDAAhLnO.mjs} +106 -33
  271. package/node_modules/@modelcontextprotocol/client/dist/stdio.cjs +8 -2
  272. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.cts.map +1 -1
  273. package/node_modules/@modelcontextprotocol/client/dist/stdio.d.mts.map +1 -1
  274. package/node_modules/@modelcontextprotocol/client/dist/stdio.mjs +8 -2
  275. package/node_modules/@modelcontextprotocol/{core/dist/auth-hYtaIUZm.d.cts.map → client/node_modules/@modelcontextprotocol/core/dist/auth--n_Yzytt.d.cts.map} +1 -1
  276. package/node_modules/@modelcontextprotocol/{core/dist/auth-CfDMXiII.cjs → client/node_modules/@modelcontextprotocol/core/dist/auth-4-zilcqg.cjs} +3 -2
  277. package/node_modules/@modelcontextprotocol/{core/dist/auth-CUe6YdwF.mjs → client/node_modules/@modelcontextprotocol/core/dist/auth-CGP0BDVq.mjs} +3 -2
  278. package/node_modules/@modelcontextprotocol/{core/dist/auth-BWdKR39I.d.mts.map → client/node_modules/@modelcontextprotocol/core/dist/auth-YUQV3RRv.d.mts.map} +1 -1
  279. package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/index.cjs +1 -1
  280. package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/index.mjs +1 -1
  281. package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.cjs +1 -1
  282. package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.mjs +1 -1
  283. package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/package.json +1 -1
  284. package/node_modules/@modelcontextprotocol/client/package.json +4 -4
  285. package/node_modules/@types/node/README.md +2 -2
  286. package/node_modules/@types/node/package.json +2 -17
  287. package/node_modules/{@maka/runtime/node_modules/ai → ai}/CHANGELOG.md +311 -0
  288. package/node_modules/{@maka/runtime/node_modules/ai → ai}/README.md +6 -6
  289. package/node_modules/{@maka/runtime/node_modules/ai → ai}/dist/index.js +4830 -1974
  290. package/node_modules/{@maka/runtime/node_modules/ai → ai}/dist/internal/index.js +694 -332
  291. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/00-introduction/index.mdx +1 -1
  292. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/02-providers-and-models.mdx +5 -0
  293. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/03-prompts.mdx +1 -1
  294. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/04-tools.mdx +2 -2
  295. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/06-provider-options.mdx +11 -11
  296. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/00-choosing-a-provider.mdx +4 -4
  297. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/02-nextjs-app-router.mdx +3 -3
  298. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/03-nextjs-pages-router.mdx +4 -4
  299. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/04-svelte.mdx +7 -7
  300. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/05-nuxt.mdx +8 -8
  301. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/06-nodejs.mdx +3 -3
  302. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/07-expo.mdx +10 -3
  303. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/08-tanstack-start.mdx +3 -3
  304. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/09-coding-agents.mdx +1 -1
  305. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/02-building-agents.mdx +2 -2
  306. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/03-workflows.mdx +2 -2
  307. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/04-loop-control.mdx +1 -1
  308. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/05-configuring-call-options.mdx +4 -2
  309. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-memory.mdx +2 -2
  310. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-policy-tool-approvals.mdx +2 -2
  311. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-tool-approvals.mdx +16 -0
  312. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/07-workflow-agent.mdx +12 -12
  313. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/08-terminal-ui.mdx +14 -10
  314. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/05-generating-text.mdx +2 -2
  315. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/15-tools-and-tool-calling.mdx +6 -1
  316. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/16-mcp-tools.mdx +31 -0
  317. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/17-mcp-apps.mdx +2 -2
  318. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/18-code-mode.mdx +50 -0
  319. package/node_modules/ai/docs/03-ai-sdk-core/19-tool-search.mdx +82 -0
  320. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/20-prompt-engineering.mdx +1 -1
  321. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/26-reasoning.mdx +15 -14
  322. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/31-reranking.mdx +12 -10
  323. package/node_modules/ai/docs/03-ai-sdk-core/32-evaluation.mdx +287 -0
  324. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/35-image-generation.mdx +40 -2
  325. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-realtime.mdx +41 -18
  326. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-transcription.mdx +1 -0
  327. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/37-speech.mdx +8 -6
  328. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/39-file-uploads.mdx +1 -1
  329. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/40-middleware.mdx +92 -7
  330. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/41-skill-uploads.mdx +1 -1
  331. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/42-batch.mdx +2 -3
  332. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/45-provider-management.mdx +31 -21
  333. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/55-testing.mdx +75 -0
  334. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/60-telemetry.mdx +57 -4
  335. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/65-devtools.mdx +3 -3
  336. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +132 -7
  337. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/index.mdx +6 -0
  338. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/01-overview.mdx +3 -2
  339. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/02-harness-agent.mdx +151 -112
  340. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/03-tools.mdx +47 -22
  341. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/04-skills.mdx +0 -4
  342. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/05-harness-adapters.mdx +3 -3
  343. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/06-workflow-utilities.mdx +43 -9
  344. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/07-ui.mdx +33 -30
  345. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +8 -6
  346. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/01-overview.mdx +1 -1
  347. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/02-chatbot.mdx +47 -21
  348. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-message-persistence.mdx +46 -3
  349. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-resume-streams.mdx +11 -4
  350. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +10 -1
  351. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/05-completion.mdx +1 -1
  352. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/08-object-generation.mdx +4 -1
  353. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/21-error-handling.mdx +28 -2
  354. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/21-transport.mdx +1 -1
  355. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/02-streaming-react-components.mdx +5 -5
  356. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/04-multistep-interfaces.mdx +2 -2
  357. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/06-loading-state.mdx +1 -1
  358. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/10-migrating-to-ui.mdx +3 -3
  359. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/02-stopping-streams.mdx +8 -0
  360. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/04-caching.mdx +2 -1
  361. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/11-secure-url-fetching.mdx +47 -2
  362. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/01-generate-text.mdx +13 -4
  363. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/02-stream-text.mdx +16 -7
  364. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/06-rerank.mdx +5 -5
  365. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-transcribe.mdx +1 -1
  366. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/12-generate-speech.mdx +3 -3
  367. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/14-evaluate.mdx +74 -0
  368. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/16-tool-loop-agent.mdx +4 -2
  369. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/20-start-batch.mdx +1 -1
  370. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/20-tool.mdx +7 -0
  371. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/22-dynamic-tool.mdx +7 -0
  372. package/node_modules/ai/docs/07-reference/01-ai-sdk-core/23-tool-search.mdx +76 -0
  373. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/32-validate-ui-messages.mdx +30 -0
  374. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/33-safe-validate-ui-messages.mdx +12 -0
  375. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +19 -1
  376. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +22 -4
  377. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/60-wrap-language-model.mdx +1 -1
  378. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/61-wrap-image-model.mdx +17 -2
  379. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/index.mdx +6 -0
  380. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +1 -1
  381. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/03-use-object.mdx +4 -1
  382. package/node_modules/ai/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +563 -0
  383. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/31-convert-to-model-messages.mdx +12 -0
  384. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/40-create-ui-message-stream.mdx +9 -3
  385. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/50-direct-chat-transport.mdx +3 -3
  386. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +2 -1
  387. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/02-create-ai.mdx +1 -1
  388. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/03-create-streamable-ui.mdx +1 -1
  389. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +8 -8
  390. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/02-workflow-chat-transport.mdx +4 -4
  391. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-api-call-error.mdx +4 -0
  392. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/ai-evaluation-unsupported-question-type-error.mdx +31 -0
  393. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +4 -0
  394. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +4 -0
  395. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-ui-message-stream-error.mdx +6 -2
  396. package/node_modules/ai/docs/07-reference/05-ai-sdk-errors/index.mdx +138 -0
  397. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/06-ai-sdk-tui/01-run-agent-tui.mdx +13 -9
  398. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/29-migration-guide-4-0.mdx +5 -5
  399. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/37-migration-guide-3-3.mdx +1 -1
  400. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/11-use-chat-custom-request-options.mdx +3 -3
  401. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/13-repeated-assistant-messages.mdx +2 -2
  402. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/17-use-chat-stale-body-data.mdx +1 -1
  403. package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/70-high-memory-usage-with-images.mdx +2 -2
  404. package/node_modules/{@maka/runtime/node_modules/ai → ai}/package.json +13 -13
  405. package/node_modules/image-dimensions/cli.js +18 -3
  406. package/node_modules/image-dimensions/index.js +7 -5
  407. package/node_modules/image-dimensions/package.json +4 -1
  408. package/node_modules/image-dimensions/readme.md +2 -1
  409. package/node_modules/image-dimensions/types/avif.js +2 -24
  410. package/node_modules/image-dimensions/types/heic.js +2 -24
  411. package/node_modules/image-dimensions/types/jpeg.js +28 -7
  412. package/node_modules/image-dimensions/types/png.js +13 -2
  413. package/node_modules/image-dimensions/types/webp.js +20 -36
  414. package/node_modules/image-dimensions/utilities.js +184 -60
  415. package/node_modules/ip-address/README.md +145 -135
  416. package/node_modules/ip-address/dist/common.js +48 -0
  417. package/node_modules/ip-address/dist/ipv4.js +117 -11
  418. package/node_modules/ip-address/dist/ipv6.js +162 -48
  419. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  420. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  421. package/node_modules/ip-address/package.json +1 -1
  422. package/node_modules/marked/README.md +1 -0
  423. package/node_modules/marked/lib/marked.esm.js +30 -29
  424. package/node_modules/marked/lib/marked.umd.js +30 -29
  425. package/node_modules/marked/man/marked.1 +1 -1
  426. package/node_modules/marked/package.json +11 -11
  427. package/node_modules/systeminformation/lib/battery.js +32 -11
  428. package/node_modules/systeminformation/lib/cpu.js +23 -23
  429. package/node_modules/systeminformation/lib/filesystem.js +14 -8
  430. package/node_modules/systeminformation/lib/memory.js +3 -5
  431. package/node_modules/systeminformation/lib/network.js +8 -2
  432. package/node_modules/systeminformation/lib/osinfo.js +17 -3
  433. package/node_modules/systeminformation/lib/util.js +7 -0
  434. package/node_modules/systeminformation/package.json +1 -1
  435. package/node_modules/undici/README.md +10 -1
  436. package/node_modules/undici/docs/docs/api/Agent.md +8 -8
  437. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  438. package/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
  439. package/node_modules/undici/docs/docs/api/Errors.md +25 -0
  440. package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  441. package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
  442. package/node_modules/undici/docs/docs/api/Pool.md +5 -6
  443. package/node_modules/undici/docs/docs/index.md +10 -1
  444. package/node_modules/undici/lib/api/readable.js +1 -2
  445. package/node_modules/undici/lib/core/request.js +23 -2
  446. package/node_modules/undici/lib/core/util.js +0 -39
  447. package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
  448. package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
  449. package/node_modules/undici/lib/dispatcher/client.js +6 -1
  450. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  451. package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
  452. package/node_modules/undici/lib/dispatcher/pool.js +90 -7
  453. package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
  454. package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
  455. package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
  456. package/node_modules/undici/lib/handler/retry-handler.js +72 -13
  457. package/node_modules/undici/lib/interceptor/cache.js +4 -1
  458. package/node_modules/undici/lib/interceptor/decompress.js +236 -69
  459. package/node_modules/undici/lib/web/cache/cache.js +17 -8
  460. package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  461. package/node_modules/undici/lib/web/cookies/index.js +19 -7
  462. package/node_modules/undici/lib/web/cookies/util.js +3 -1
  463. package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
  464. package/node_modules/undici/lib/web/fetch/body.js +22 -15
  465. package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  466. package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  467. package/node_modules/undici/lib/web/fetch/headers.js +34 -31
  468. package/node_modules/undici/lib/web/fetch/index.js +46 -25
  469. package/node_modules/undici/lib/web/fetch/request.js +74 -79
  470. package/node_modules/undici/lib/web/fetch/response.js +43 -44
  471. package/node_modules/undici/lib/web/fetch/util.js +7 -7
  472. package/node_modules/undici/lib/web/infra/index.js +16 -1
  473. package/node_modules/undici/lib/web/webidl/index.js +2 -14
  474. package/node_modules/undici/lib/web/websocket/connection.js +33 -12
  475. package/node_modules/undici/lib/web/websocket/events.js +43 -26
  476. package/node_modules/undici/lib/web/websocket/receiver.js +2 -0
  477. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  478. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
  479. package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  480. package/node_modules/undici/package.json +1 -1
  481. package/package.json +4 -4
  482. package/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  483. package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  484. package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/README.md +0 -1
  485. package/node_modules/@ai-sdk/cohere/node_modules/@ai-sdk/provider/package.json +0 -63
  486. package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  487. package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/README.md +0 -1
  488. package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  489. package/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +0 -63
  490. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  491. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/README.md +0 -1
  492. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  493. package/node_modules/@ai-sdk/open-responses/node_modules/@ai-sdk/provider/package.json +0 -63
  494. package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  495. package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/LICENSE +0 -13
  496. package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/README.md +0 -1
  497. package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  498. package/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +0 -63
  499. package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  500. package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/LICENSE +0 -13
  501. package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/README.md +0 -1
  502. package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  503. package/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +0 -63
  504. package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  505. package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/LICENSE +0 -13
  506. package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/README.md +0 -1
  507. package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  508. package/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +0 -63
  509. package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
  510. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  511. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  512. package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
  513. package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/LICENSE +0 -13
  514. package/node_modules/@maka/runtime/node_modules/@ai-sdk/code-mode/dist/code-mode-tool.js +0 -40
  515. package/node_modules/@maka/runtime/node_modules/@ai-sdk/gateway/LICENSE +0 -13
  516. package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/CHANGELOG.md +0 -1262
  517. package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/LICENSE +0 -13
  518. package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/README.md +0 -1
  519. package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/dist/index.js +0 -426
  520. package/node_modules/@maka/runtime/node_modules/@ai-sdk/provider/package.json +0 -63
  521. package/node_modules/@maka/runtime/node_modules/ai/LICENSE +0 -13
  522. package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/02-ai-sdk-ui/05-use-realtime.mdx +0 -247
  523. package/node_modules/@maka/runtime/node_modules/ai/docs/07-reference/05-ai-sdk-errors/index.mdx +0 -43
  524. package/node_modules/@modelcontextprotocol/client/dist/index-CHhhk6PQ.d.cts.map +0 -1
  525. package/node_modules/@modelcontextprotocol/client/dist/index-D4xIIEF6.d.mts.map +0 -1
  526. /package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → code-mode}/LICENSE +0 -0
  527. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/README.md +0 -0
  528. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/approval.js +0 -0
  529. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/continuation-capability.js +0 -0
  530. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/direct-tool-call.js +0 -0
  531. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/host-interrupt.js +0 -0
  532. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/index.js +0 -0
  533. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/run-code-mode.js +0 -0
  534. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/tool-invocation.js +0 -0
  535. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/types.js +0 -0
  536. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/dist/utils/serialization.js +0 -0
  537. /package/node_modules/{@maka/runtime/node_modules/@ai-sdk → @ai-sdk}/code-mode/src/tsconfig.json +0 -0
  538. /package/node_modules/@ai-sdk/{cohere/node_modules/@ai-sdk/provider → gateway}/LICENSE +0 -0
  539. /package/node_modules/@ai-sdk/{google/node_modules/@ai-sdk/provider → provider}/LICENSE +0 -0
  540. /package/node_modules/@ai-sdk/{anthropic/node_modules/@ai-sdk/provider → provider}/README.md +0 -0
  541. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/LICENSE +0 -0
  542. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/README.md +0 -0
  543. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.cts.map +0 -0
  544. /package/node_modules/@modelcontextprotocol/{core → client/node_modules/@modelcontextprotocol/core}/dist/internal.d.mts.map +0 -0
  545. /package/node_modules/{@ai-sdk/open-responses/node_modules/@ai-sdk/provider → ai}/LICENSE +0 -0
  546. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/01-overview.mdx +0 -0
  547. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/05-streaming.mdx +0 -0
  548. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-foundations/index.mdx +0 -0
  549. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/01-navigating-the-library.mdx +0 -0
  550. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/02-getting-started/index.mdx +0 -0
  551. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/01-overview.mdx +0 -0
  552. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/06-subagents.mdx +0 -0
  553. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-agents/index.mdx +0 -0
  554. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/01-overview.mdx +0 -0
  555. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/10-generating-structured-data.mdx +0 -0
  556. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/17-runtime-and-tool-context.mdx +0 -0
  557. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/25-settings.mdx +0 -0
  558. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/30-embeddings.mdx +0 -0
  559. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/36-translation.mdx +0 -0
  560. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/38-video-generation.mdx +0 -0
  561. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-core/50-error-handling.mdx +0 -0
  562. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/03-ai-sdk-harnesses/index.mdx +0 -0
  563. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/04-generative-user-interfaces.mdx +0 -0
  564. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/20-streaming-data.mdx +0 -0
  565. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/24-reading-ui-message-streams.mdx +0 -0
  566. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/25-message-metadata.mdx +0 -0
  567. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/50-stream-protocol.mdx +0 -0
  568. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/04-ai-sdk-ui/index.mdx +0 -0
  569. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/01-overview.mdx +0 -0
  570. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/03-generative-ui-state.mdx +0 -0
  571. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/03-saving-and-restoring-states.mdx +0 -0
  572. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/05-streaming-values.mdx +0 -0
  573. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/08-error-handling.mdx +0 -0
  574. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/09-authentication.mdx +0 -0
  575. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/05-ai-sdk-rsc/index.mdx +0 -0
  576. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/01-prompt-engineering.mdx +0 -0
  577. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/03-backpressure.mdx +0 -0
  578. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/05-multiple-streamables.mdx +0 -0
  579. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/06-rate-limiting.mdx +0 -0
  580. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/07-rendering-ui-with-language-models.mdx +0 -0
  581. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/08-model-as-router.mdx +0 -0
  582. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/09-multistep-interfaces.mdx +0 -0
  583. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/09-sequential-generations.mdx +0 -0
  584. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/10-vercel-deployment-guide.mdx +0 -0
  585. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/06-advanced/index.mdx +0 -0
  586. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/05-embed.mdx +0 -0
  587. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/06-embed-many.mdx +0 -0
  588. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/10-generate-image.mdx +0 -0
  589. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-stream-transcribe.mdx +0 -0
  590. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/11-stream-translate.mdx +0 -0
  591. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/13-generate-video.mdx +0 -0
  592. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/14-upload-file.mdx +0 -0
  593. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/14-upload-skill.mdx +0 -0
  594. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/15-agent.mdx +0 -0
  595. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/17-create-agent-ui-stream.mdx +0 -0
  596. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/18-create-agent-ui-stream-response.mdx +0 -0
  597. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/18-pipe-agent-ui-stream-to-response.mdx +0 -0
  598. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/21-get-batch-status.mdx +0 -0
  599. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/22-get-batch-results.mdx +0 -0
  600. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-cancel-batch.mdx +0 -0
  601. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +0 -0
  602. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/23-get-realtime-tool-definitions.mdx +0 -0
  603. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-list-batches.mdx +0 -0
  604. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-mcp-apps.mdx +0 -0
  605. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/24-mcp-stdio-transport.mdx +0 -0
  606. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/25-json-schema.mdx +0 -0
  607. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/26-zod-schema.mdx +0 -0
  608. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/27-valibot-schema.mdx +0 -0
  609. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/28-output.mdx +0 -0
  610. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/29-filter-active-tools.mdx +0 -0
  611. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/30-model-message.mdx +0 -0
  612. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +0 -0
  613. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/34-sandbox.mdx +0 -0
  614. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/50-cosine-similarity.mdx +0 -0
  615. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/65-language-model-v2-middleware.mdx +0 -0
  616. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +0 -0
  617. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/67-simulate-streaming-middleware.mdx +0 -0
  618. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/68-default-instructions-middleware.mdx +0 -0
  619. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/68-default-settings-middleware.mdx +0 -0
  620. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/69-add-tool-input-examples-middleware.mdx +0 -0
  621. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/70-extract-json-middleware.mdx +0 -0
  622. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/70-is-step-count.mdx +0 -0
  623. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/71-has-tool-call.mdx +0 -0
  624. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/72-loop-finished.mdx +0 -0
  625. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/75-simulate-readable-stream.mdx +0 -0
  626. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/80-smooth-stream.mdx +0 -0
  627. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/90-generate-id.mdx +0 -0
  628. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/91-create-id-generator.mdx +0 -0
  629. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/01-ai-sdk-core/92-default-generated-file.mdx +0 -0
  630. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/02-use-completion.mdx +0 -0
  631. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/32-prune-messages.mdx +0 -0
  632. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/41-create-ui-message-stream-response.mdx +0 -0
  633. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/42-pipe-ui-message-stream-to-response.mdx +0 -0
  634. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/43-read-ui-message-stream.mdx +0 -0
  635. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/46-infer-ui-tools.mdx +0 -0
  636. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/47-infer-ui-tool.mdx +0 -0
  637. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/48-mcp-app-renderer.mdx +0 -0
  638. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/02-ai-sdk-ui/index.mdx +0 -0
  639. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/04-create-streamable-value.mdx +0 -0
  640. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/05-read-streamable-value.mdx +0 -0
  641. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/06-get-ai-state.mdx +0 -0
  642. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/07-get-mutable-ai-state.mdx +0 -0
  643. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/08-use-ai-state.mdx +0 -0
  644. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/09-use-actions.mdx +0 -0
  645. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/10-use-ui-state.mdx +0 -0
  646. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/11-use-streamable-value.mdx +0 -0
  647. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/20-render.mdx +0 -0
  648. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/03-ai-sdk-rsc/index.mdx +0 -0
  649. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/03-generate-video.mdx +0 -0
  650. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/04-ai-sdk-workflow/index.mdx +0 -0
  651. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-download-error.mdx +0 -0
  652. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-empty-response-body-error.mdx +0 -0
  653. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-argument-error.mdx +0 -0
  654. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-data-content-error.mdx +0 -0
  655. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-message-role-error.mdx +0 -0
  656. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-prompt-error.mdx +0 -0
  657. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-response-data-error.mdx +0 -0
  658. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-error.mdx +0 -0
  659. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-approval-signature-error.mdx +0 -0
  660. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-invalid-tool-input-error.mdx +0 -0
  661. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-json-parse-error.mdx +0 -0
  662. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-load-api-key-error.mdx +0 -0
  663. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-load-setting-error.mdx +0 -0
  664. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-message-conversion-error.mdx +0 -0
  665. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-content-generated-error.mdx +0 -0
  666. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-image-generated-error.mdx +0 -0
  667. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-object-generated-error.mdx +0 -0
  668. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-output-generated-error.mdx +0 -0
  669. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-speech-generated-error.mdx +0 -0
  670. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-reference-error.mdx +0 -0
  671. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-such-tool-error.mdx +0 -0
  672. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-transcript-generated-error.mdx +0 -0
  673. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-translation-generated-error.mdx +0 -0
  674. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-no-video-generated-error.mdx +0 -0
  675. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-retry-error.mdx +0 -0
  676. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-stream-provider-error.mdx +0 -0
  677. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-too-many-embedding-values-for-call-error.mdx +0 -0
  678. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-not-found-for-approval-error.mdx +0 -0
  679. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-call-repair-error.mdx +0 -0
  680. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-tool-choice-violation-error.mdx +0 -0
  681. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-type-validation-error.mdx +0 -0
  682. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/05-ai-sdk-errors/ai-unsupported-functionality-error.mdx +0 -0
  683. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/06-ai-sdk-tui/index.mdx +0 -0
  684. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/07-reference/index.mdx +0 -0
  685. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/00-versioning.mdx +0 -0
  686. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/23-migration-guide-7-0.mdx +0 -0
  687. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/24-migration-guide-6-0.mdx +0 -0
  688. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/25-migration-guide-5-0-data.mdx +0 -0
  689. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/26-migration-guide-5-0.mdx +0 -0
  690. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/27-migration-guide-4-2.mdx +0 -0
  691. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/28-migration-guide-4-1.mdx +0 -0
  692. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/36-migration-guide-3-4.mdx +0 -0
  693. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/38-migration-guide-3-2.mdx +0 -0
  694. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/39-migration-guide-3-1.mdx +0 -0
  695. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/08-migration-guides/index.mdx +0 -0
  696. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/01-azure-stream-slow.mdx +0 -0
  697. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/03-server-actions-in-client-components.mdx +0 -0
  698. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/04-strange-stream-output.mdx +0 -0
  699. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/05-streamable-ui-errors.mdx +0 -0
  700. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +0 -0
  701. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-streaming-not-working-when-deployed.mdx +0 -0
  702. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-streaming-not-working-when-proxied.mdx +0 -0
  703. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/06-timeout-on-vercel.mdx +0 -0
  704. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/07-unclosed-streams.mdx +0 -0
  705. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/08-use-chat-failed-to-parse-stream.mdx +0 -0
  706. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/09-client-stream-error.mdx +0 -0
  707. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/10-use-chat-tools-no-response.mdx +0 -0
  708. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/12-typescript-performance-zod.mdx +0 -0
  709. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/12-use-chat-an-error-occurred.mdx +0 -0
  710. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/14-stream-abort-handling.mdx +0 -0
  711. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/14-tool-calling-with-structured-outputs.mdx +0 -0
  712. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/15-abort-breaks-resumable-streams.mdx +0 -0
  713. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/15-stream-text-not-working.mdx +0 -0
  714. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/16-streaming-status-delay.mdx +0 -0
  715. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/18-ontoolcall-type-narrowing.mdx +0 -0
  716. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/19-unsupported-model-version.mdx +0 -0
  717. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/20-no-object-generated-content-filter.mdx +0 -0
  718. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/21-missing-tool-results-error.mdx +0 -0
  719. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/30-model-is-not-assignable-to-type.mdx +0 -0
  720. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/40-typescript-cannot-find-namespace-jsx.mdx +0 -0
  721. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/50-react-maximum-update-depth-exceeded.mdx +0 -0
  722. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/60-jest-cannot-find-module-ai-rsc.mdx +0 -0
  723. /package/node_modules/{@maka/runtime/node_modules/ai → ai}/docs/09-troubleshooting/index.mdx +0 -0
@@ -15,7 +15,7 @@ function getGatewayTranscriptionProtocols(token, options) {
15
15
  }
16
16
  function buildGatewayProtocols(marker12, token, options) {
17
17
  const protocols = [marker12, `${GATEWAY_AUTH_SUBPROTOCOL_PREFIX}${token}`];
18
- if (options == null ? void 0 : options.teamIdOrSlug) {
18
+ if (options?.teamIdOrSlug) {
19
19
  protocols.push(
20
20
  `${GATEWAY_TEAM_SUBPROTOCOL_PREFIX}${encodeSubprotocolValue(options.teamIdOrSlug)}`
21
21
  );
@@ -23,26 +23,24 @@ function buildGatewayProtocols(marker12, token, options) {
23
23
  return protocols;
24
24
  }
25
25
  function getGatewayRealtimeAuthToken(secWebSocketProtocol) {
26
- var _a12;
27
- return ((_a12 = findProtocol(secWebSocketProtocol, GATEWAY_AUTH_SUBPROTOCOL_PREFIX)) == null ? void 0 : _a12.slice(
26
+ return findProtocol(secWebSocketProtocol, GATEWAY_AUTH_SUBPROTOCOL_PREFIX)?.slice(
28
27
  GATEWAY_AUTH_SUBPROTOCOL_PREFIX.length
29
- )) || void 0;
28
+ ) || void 0;
30
29
  }
31
30
  function getGatewayRealtimeTeamIdOrSlug(secWebSocketProtocol) {
32
- var _a12;
33
- const encoded = (_a12 = findProtocol(
31
+ const encoded = findProtocol(
34
32
  secWebSocketProtocol,
35
33
  GATEWAY_TEAM_SUBPROTOCOL_PREFIX
36
- )) == null ? void 0 : _a12.slice(GATEWAY_TEAM_SUBPROTOCOL_PREFIX.length);
34
+ )?.slice(GATEWAY_TEAM_SUBPROTOCOL_PREFIX.length);
37
35
  if (!encoded) return void 0;
38
36
  try {
39
37
  return decodeSubprotocolValue(encoded) || void 0;
40
- } catch (e) {
38
+ } catch {
41
39
  return void 0;
42
40
  }
43
41
  }
44
42
  function findProtocol(secWebSocketProtocol, prefix) {
45
- return secWebSocketProtocol == null ? void 0 : secWebSocketProtocol.split(",").map((protocol) => protocol.trim()).find((protocol) => protocol.startsWith(prefix));
43
+ return secWebSocketProtocol?.split(",").map((protocol) => protocol.trim()).find((protocol) => protocol.startsWith(prefix));
46
44
  }
47
45
  function encodeSubprotocolValue(value) {
48
46
  const bytes = new TextEncoder().encode(value);
@@ -62,11 +60,11 @@ function decodeSubprotocolValue(value) {
62
60
 
63
61
  // src/gateway-provider.ts
64
62
  import {
65
- createJsonErrorResponseHandler as createJsonErrorResponseHandler12,
66
- createJsonResponseHandler as createJsonResponseHandler12,
67
- getErrorMessage as getErrorMessage12,
63
+ createJsonErrorResponseHandler as createJsonErrorResponseHandler13,
64
+ createJsonResponseHandler as createJsonResponseHandler13,
65
+ getErrorMessage as getErrorMessage13,
68
66
  loadOptionalSetting,
69
- postJsonToApi as postJsonToApi9,
67
+ postJsonToApi as postJsonToApi10,
70
68
  withoutTrailingSlash,
71
69
  withUserAgentSuffix
72
70
  } from "@ai-sdk/provider-utils";
@@ -430,7 +428,6 @@ async function createGatewayErrorFromResponse({
430
428
  authMethod,
431
429
  isRetryable
432
430
  }) {
433
- var _a12;
434
431
  const parseResult = await safeValidateTypes({
435
432
  value: response,
436
433
  schema: gatewayErrorResponseSchema
@@ -450,7 +447,7 @@ async function createGatewayErrorFromResponse({
450
447
  const validatedResponse = parseResult.value;
451
448
  const errorType = validatedResponse.error.type;
452
449
  const message = validatedResponse.error.message;
453
- const generationId = (_a12 = validatedResponse.generationId) != null ? _a12 : void 0;
450
+ const generationId = validatedResponse.generationId ?? void 0;
454
451
  switch (errorType) {
455
452
  case "authentication_error":
456
453
  return GatewayAuthenticationError.createContextualError({
@@ -553,7 +550,7 @@ function extractApiCallResponse(error) {
553
550
  if (error.responseBody != null) {
554
551
  try {
555
552
  return secureJsonParse(error.responseBody);
556
- } catch (e) {
553
+ } catch {
557
554
  return error.responseBody;
558
555
  }
559
556
  }
@@ -619,7 +616,6 @@ function isTimeoutError(error) {
619
616
  return false;
620
617
  }
621
618
  async function asGatewayError(error, authMethod) {
622
- var _a12;
623
619
  if (GatewayError.isInstance(error)) {
624
620
  return error;
625
621
  }
@@ -638,7 +634,7 @@ async function asGatewayError(error, authMethod) {
638
634
  }
639
635
  return await createGatewayErrorFromResponse({
640
636
  response: extractApiCallResponse(error),
641
- statusCode: (_a12 = error.statusCode) != null ? _a12 : 500,
637
+ statusCode: error.statusCode ?? 500,
642
638
  defaultMessage: "Gateway request failed",
643
639
  cause: error,
644
640
  authMethod,
@@ -689,6 +685,7 @@ import {
689
685
  // src/gateway-model-entry.ts
690
686
  var KNOWN_MODEL_TYPES = [
691
687
  "embedding",
688
+ "evaluation",
692
689
  "image",
693
690
  "language",
694
691
  "realtime",
@@ -714,10 +711,7 @@ var GatewayFetchMetadata = class {
714
711
  ),
715
712
  failedResponseHandler: createJsonErrorResponseHandler({
716
713
  errorSchema: z.any(),
717
- errorToMessage: (data) => {
718
- var _a12;
719
- return (_a12 = getErrorMessage(data)) != null ? _a12 : "unknown error";
720
- }
714
+ errorToMessage: (data) => getErrorMessage(data) ?? "unknown error"
721
715
  }),
722
716
  fetch: this.config.fetch
723
717
  });
@@ -738,10 +732,7 @@ var GatewayFetchMetadata = class {
738
732
  ),
739
733
  failedResponseHandler: createJsonErrorResponseHandler({
740
734
  errorSchema: z.any(),
741
- errorToMessage: (data) => {
742
- var _a12;
743
- return (_a12 = getErrorMessage(data)) != null ? _a12 : "unknown error";
744
- }
735
+ errorToMessage: (data) => getErrorMessage(data) ?? "unknown error"
745
736
  }),
746
737
  fetch: this.config.fetch
747
738
  });
@@ -849,10 +840,7 @@ var GatewaySpendReport = class {
849
840
  ),
850
841
  failedResponseHandler: createJsonErrorResponseHandler2({
851
842
  errorSchema: z.any(),
852
- errorToMessage: (data) => {
853
- var _a12;
854
- return (_a12 = getErrorMessage2(data)) != null ? _a12 : "unknown error";
855
- }
843
+ errorToMessage: (data) => getErrorMessage2(data) ?? "unknown error"
856
844
  }),
857
845
  fetch: this.config.fetch
858
846
  });
@@ -938,10 +926,7 @@ var GatewayGenerationInfoFetcher = class {
938
926
  ),
939
927
  failedResponseHandler: createJsonErrorResponseHandler3({
940
928
  errorSchema: z.any(),
941
- errorToMessage: (data) => {
942
- var _a12;
943
- return (_a12 = getErrorMessage3(data)) != null ? _a12 : "unknown error";
944
- }
929
+ errorToMessage: (data) => getErrorMessage3(data) ?? "unknown error"
945
930
  }),
946
931
  fetch: this.config.fetch
947
932
  });
@@ -1047,7 +1032,6 @@ var GatewayBatch = class {
1047
1032
  abortSignal,
1048
1033
  webhookUrl
1049
1034
  }) {
1050
- var _a12;
1051
1035
  assertTextBatchRequests(requests);
1052
1036
  const modelId = validateSingleModel(requests);
1053
1037
  const resolvedHeaders = this.config.headers ? await resolve4(this.config.headers) : void 0;
@@ -1080,10 +1064,7 @@ var GatewayBatch = class {
1080
1064
  ),
1081
1065
  failedResponseHandler: createJsonErrorResponseHandler4({
1082
1066
  errorSchema: z.any(),
1083
- errorToMessage: (data) => {
1084
- var _a13;
1085
- return (_a13 = getErrorMessage4(data)) != null ? _a13 : "unknown error";
1086
- }
1067
+ errorToMessage: (data) => getErrorMessage4(data) ?? "unknown error"
1087
1068
  }),
1088
1069
  ...abortSignal && { abortSignal },
1089
1070
  fetch: this.config.fetch
@@ -1091,7 +1072,7 @@ var GatewayBatch = class {
1091
1072
  return {
1092
1073
  batchId: responseBody.batchId,
1093
1074
  ...convertGatewayBatchStatus(responseBody),
1094
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : []
1075
+ warnings: responseBody.warnings ?? []
1095
1076
  };
1096
1077
  } catch (error) {
1097
1078
  if (isAbortOrTimeoutError(error)) {
@@ -1099,7 +1080,7 @@ var GatewayBatch = class {
1099
1080
  }
1100
1081
  throw await asGatewayError(
1101
1082
  error,
1102
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1083
+ await parseAuthMethod(resolvedHeaders ?? {})
1103
1084
  );
1104
1085
  }
1105
1086
  }
@@ -1127,10 +1108,7 @@ var GatewayBatch = class {
1127
1108
  ),
1128
1109
  failedResponseHandler: createJsonErrorResponseHandler4({
1129
1110
  errorSchema: z.any(),
1130
- errorToMessage: (data) => {
1131
- var _a12;
1132
- return (_a12 = getErrorMessage4(data)) != null ? _a12 : "unknown error";
1133
- }
1111
+ errorToMessage: (data) => getErrorMessage4(data) ?? "unknown error"
1134
1112
  }),
1135
1113
  ...abortSignal && { abortSignal },
1136
1114
  fetch: this.config.fetch
@@ -1142,7 +1120,7 @@ var GatewayBatch = class {
1142
1120
  }
1143
1121
  throw await asGatewayError(
1144
1122
  error,
1145
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1123
+ await parseAuthMethod(resolvedHeaders ?? {})
1146
1124
  );
1147
1125
  }
1148
1126
  }
@@ -1173,10 +1151,7 @@ var GatewayBatch = class {
1173
1151
  ),
1174
1152
  failedResponseHandler: createJsonErrorResponseHandler4({
1175
1153
  errorSchema: z.any(),
1176
- errorToMessage: (data) => {
1177
- var _a12;
1178
- return (_a12 = getErrorMessage4(data)) != null ? _a12 : "unknown error";
1179
- }
1154
+ errorToMessage: (data) => getErrorMessage4(data) ?? "unknown error"
1180
1155
  }),
1181
1156
  ...abortSignal && { abortSignal },
1182
1157
  fetch: this.config.fetch
@@ -1190,7 +1165,48 @@ var GatewayBatch = class {
1190
1165
  }
1191
1166
  throw await asGatewayError(
1192
1167
  error,
1193
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1168
+ await parseAuthMethod(resolvedHeaders ?? {})
1169
+ );
1170
+ }
1171
+ }
1172
+ /** Requests cancellation; status and partial results remain separate reads. */
1173
+ async doCancelBatch({
1174
+ batchId,
1175
+ headers,
1176
+ abortSignal
1177
+ }) {
1178
+ const resolvedHeaders = this.config.headers ? await resolve4(this.config.headers) : void 0;
1179
+ try {
1180
+ const { value: responseBody } = await postJsonToApi({
1181
+ url: this.getBatchUrl("cancel"),
1182
+ headers: combineHeaders(
1183
+ resolvedHeaders,
1184
+ headers,
1185
+ await resolve4(this.config.o11yHeaders)
1186
+ ),
1187
+ body: { batchId },
1188
+ successfulResponseHandler: createJsonResponseHandler4(
1189
+ gatewayBatchStatusResponseSchema
1190
+ ),
1191
+ failedResponseHandler: createJsonErrorResponseHandler4({
1192
+ errorSchema: z.any(),
1193
+ errorToMessage: (data) => getErrorMessage4(data) ?? "unknown error"
1194
+ }),
1195
+ ...abortSignal && { abortSignal },
1196
+ fetch: this.config.fetch
1197
+ });
1198
+ return {
1199
+ ...responseBody.providerMetadata != null && {
1200
+ providerMetadata: responseBody.providerMetadata
1201
+ }
1202
+ };
1203
+ } catch (error) {
1204
+ if (isAbortOrTimeoutError(error)) {
1205
+ throw error;
1206
+ }
1207
+ throw await asGatewayError(
1208
+ error,
1209
+ await parseAuthMethod(resolvedHeaders ?? {})
1194
1210
  );
1195
1211
  }
1196
1212
  }
@@ -1227,8 +1243,7 @@ function maybeBase64EncodeFileData(data) {
1227
1243
  return data;
1228
1244
  }
1229
1245
  function validateSingleModel(requests) {
1230
- var _a12;
1231
- const modelId = (_a12 = requests[0]) == null ? void 0 : _a12.modelId;
1246
+ const modelId = requests[0]?.modelId;
1232
1247
  if (modelId == null) {
1233
1248
  throw new InvalidArgumentError({
1234
1249
  argument: "requests",
@@ -1257,7 +1272,7 @@ function assertTextBatchRequests(requests) {
1257
1272
  }
1258
1273
  }
1259
1274
  function getGatewayBatchIdempotencyKey(providerOptions) {
1260
- const gatewayOptions = providerOptions == null ? void 0 : providerOptions.gateway;
1275
+ const gatewayOptions = providerOptions?.gateway;
1261
1276
  if (gatewayOptions == null || typeof gatewayOptions !== "object" || Array.isArray(gatewayOptions)) {
1262
1277
  return void 0;
1263
1278
  }
@@ -1265,7 +1280,7 @@ function getGatewayBatchIdempotencyKey(providerOptions) {
1265
1280
  return typeof key === "string" && key.length > 0 ? key : void 0;
1266
1281
  }
1267
1282
  function omitGatewayIdempotencyKey(providerOptions) {
1268
- const gatewayOptions = providerOptions == null ? void 0 : providerOptions.gateway;
1283
+ const gatewayOptions = providerOptions?.gateway;
1269
1284
  if (gatewayOptions == null || typeof gatewayOptions !== "object" || Array.isArray(gatewayOptions) || !("idempotencyKey" in gatewayOptions)) {
1270
1285
  return providerOptions;
1271
1286
  }
@@ -1288,12 +1303,11 @@ function isAbortOrTimeoutError(error) {
1288
1303
  return error.name === "AbortError" || error.name === "TimeoutError";
1289
1304
  }
1290
1305
  function convertGatewayBatchStatus(body) {
1291
- var _a12, _b12, _c, _d;
1292
1306
  const requestCounts = normalizeBatchRequestCounts({
1293
- total: (_a12 = body.requestCounts) == null ? void 0 : _a12.total,
1294
- pending: (_b12 = body.requestCounts) == null ? void 0 : _b12.pending,
1295
- completed: (_c = body.requestCounts) == null ? void 0 : _c.completed,
1296
- failed: (_d = body.requestCounts) == null ? void 0 : _d.failed
1307
+ total: body.requestCounts?.total,
1308
+ pending: body.requestCounts?.pending,
1309
+ completed: body.requestCounts?.completed,
1310
+ failed: body.requestCounts?.failed
1297
1311
  });
1298
1312
  return {
1299
1313
  status: body.status,
@@ -1317,11 +1331,10 @@ function convertGatewayBatchStatus(body) {
1317
1331
  };
1318
1332
  }
1319
1333
  async function* convertGatewayBatchResultLines(lines) {
1320
- var _a12;
1321
1334
  for await (const line of lines) {
1322
1335
  const item = line;
1323
1336
  if (item.status === "succeeded") {
1324
- const response = (_a12 = item.result) == null ? void 0 : _a12.response;
1337
+ const response = item.result?.response;
1325
1338
  if (response !== void 0 && typeof response.timestamp === "string") {
1326
1339
  response.timestamp = new Date(response.timestamp);
1327
1340
  }
@@ -1410,7 +1423,6 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
1410
1423
  };
1411
1424
  }
1412
1425
  async doGenerate(options) {
1413
- var _a12;
1414
1426
  const { args, warnings } = await this.getArgs(options);
1415
1427
  const { abortSignal } = options;
1416
1428
  const resolvedHeaders = this.config.headers ? await resolve5(this.config.headers) : void 0;
@@ -1431,10 +1443,7 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
1431
1443
  successfulResponseHandler: createJsonResponseHandler5(z.any()),
1432
1444
  failedResponseHandler: createJsonErrorResponseHandler5({
1433
1445
  errorSchema: z.any(),
1434
- errorToMessage: (data) => {
1435
- var _a13;
1436
- return (_a13 = getErrorMessage5(data)) != null ? _a13 : "unknown error";
1437
- }
1446
+ errorToMessage: (data) => getErrorMessage5(data) ?? "unknown error"
1438
1447
  }),
1439
1448
  ...abortSignal && { abortSignal },
1440
1449
  fetch: this.config.fetch
@@ -1443,12 +1452,12 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
1443
1452
  ...responseBody,
1444
1453
  request: { body: args },
1445
1454
  response: { headers: responseHeaders, body: rawResponse },
1446
- warnings: [...(_a12 = responseBody.warnings) != null ? _a12 : [], ...warnings]
1455
+ warnings: [...responseBody.warnings ?? [], ...warnings]
1447
1456
  };
1448
1457
  } catch (error) {
1449
1458
  throw await asGatewayError(
1450
1459
  error,
1451
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1460
+ await parseAuthMethod(resolvedHeaders ?? {})
1452
1461
  );
1453
1462
  }
1454
1463
  }
@@ -1469,10 +1478,7 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
1469
1478
  successfulResponseHandler: createEventSourceResponseHandler(z.any()),
1470
1479
  failedResponseHandler: createJsonErrorResponseHandler5({
1471
1480
  errorSchema: z.any(),
1472
- errorToMessage: (data) => {
1473
- var _a12;
1474
- return (_a12 = getErrorMessage5(data)) != null ? _a12 : "unknown error";
1475
- }
1481
+ errorToMessage: (data) => getErrorMessage5(data) ?? "unknown error"
1476
1482
  }),
1477
1483
  ...abortSignal && { abortSignal },
1478
1484
  fetch: this.config.fetch
@@ -1509,7 +1515,7 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
1509
1515
  } catch (error) {
1510
1516
  throw await asGatewayError(
1511
1517
  error,
1512
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1518
+ await parseAuthMethod(resolvedHeaders ?? {})
1513
1519
  );
1514
1520
  }
1515
1521
  }
@@ -1598,7 +1604,6 @@ var GatewayEmbeddingModel = class _GatewayEmbeddingModel {
1598
1604
  abortSignal,
1599
1605
  providerOptions
1600
1606
  }) {
1601
- var _a12, _b12;
1602
1607
  const resolvedHeaders = this.config.headers ? await resolve6(this.config.headers) : void 0;
1603
1608
  try {
1604
1609
  const {
@@ -1609,7 +1614,7 @@ var GatewayEmbeddingModel = class _GatewayEmbeddingModel {
1609
1614
  url: this.getUrl(),
1610
1615
  headers: combineHeaders3(
1611
1616
  resolvedHeaders,
1612
- headers != null ? headers : {},
1617
+ headers ?? {},
1613
1618
  this.getModelConfigHeaders(),
1614
1619
  await resolve6(this.config.o11yHeaders)
1615
1620
  ),
@@ -1622,25 +1627,22 @@ var GatewayEmbeddingModel = class _GatewayEmbeddingModel {
1622
1627
  ),
1623
1628
  failedResponseHandler: createJsonErrorResponseHandler6({
1624
1629
  errorSchema: z.any(),
1625
- errorToMessage: (data) => {
1626
- var _a13;
1627
- return (_a13 = getErrorMessage6(data)) != null ? _a13 : "unknown error";
1628
- }
1630
+ errorToMessage: (data) => getErrorMessage6(data) ?? "unknown error"
1629
1631
  }),
1630
1632
  ...abortSignal && { abortSignal },
1631
1633
  fetch: this.config.fetch
1632
1634
  });
1633
1635
  return {
1634
1636
  embeddings: responseBody.embeddings,
1635
- usage: (_a12 = responseBody.usage) != null ? _a12 : void 0,
1637
+ usage: responseBody.usage ?? void 0,
1636
1638
  providerMetadata: responseBody.providerMetadata,
1637
1639
  response: { headers: responseHeaders, body: rawValue },
1638
- warnings: (_b12 = responseBody.warnings) != null ? _b12 : []
1640
+ warnings: responseBody.warnings ?? []
1639
1641
  };
1640
1642
  } catch (error) {
1641
1643
  throw await asGatewayError(
1642
1644
  error,
1643
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1645
+ await parseAuthMethod(resolvedHeaders ?? {})
1644
1646
  );
1645
1647
  }
1646
1648
  }
@@ -1731,14 +1733,13 @@ var GatewayImageModel = class _GatewayImageModel {
1731
1733
  headers,
1732
1734
  abortSignal
1733
1735
  }) {
1734
- var _a12, _b12, _c, _d;
1735
1736
  const resolvedHeaders = this.config.headers ? await resolve7(this.config.headers) : void 0;
1736
1737
  try {
1737
1738
  const { responseHeaders, value: responseBody } = await postJsonToApi4({
1738
1739
  url: this.getUrl(),
1739
1740
  headers: combineHeaders4(
1740
1741
  resolvedHeaders,
1741
- headers != null ? headers : {},
1742
+ headers ?? {},
1742
1743
  this.getModelConfigHeaders(),
1743
1744
  await resolve7(this.config.o11yHeaders)
1744
1745
  ),
@@ -1759,10 +1760,7 @@ var GatewayImageModel = class _GatewayImageModel {
1759
1760
  ),
1760
1761
  failedResponseHandler: createJsonErrorResponseHandler7({
1761
1762
  errorSchema: z.any(),
1762
- errorToMessage: (data) => {
1763
- var _a13;
1764
- return (_a13 = getErrorMessage7(data)) != null ? _a13 : "unknown error";
1765
- }
1763
+ errorToMessage: (data) => getErrorMessage7(data) ?? "unknown error"
1766
1764
  }),
1767
1765
  ...abortSignal && { abortSignal },
1768
1766
  fetch: this.config.fetch
@@ -1773,7 +1771,7 @@ var GatewayImageModel = class _GatewayImageModel {
1773
1771
  ...responseBody.isRetryable != null && {
1774
1772
  isRetryable: responseBody.isRetryable
1775
1773
  },
1776
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : [],
1774
+ warnings: responseBody.warnings ?? [],
1777
1775
  providerMetadata: responseBody.providerMetadata,
1778
1776
  response: {
1779
1777
  timestamp: /* @__PURE__ */ new Date(),
@@ -1782,16 +1780,16 @@ var GatewayImageModel = class _GatewayImageModel {
1782
1780
  },
1783
1781
  ...responseBody.usage != null && {
1784
1782
  usage: {
1785
- inputTokens: (_b12 = responseBody.usage.inputTokens) != null ? _b12 : void 0,
1786
- outputTokens: (_c = responseBody.usage.outputTokens) != null ? _c : void 0,
1787
- totalTokens: (_d = responseBody.usage.totalTokens) != null ? _d : void 0
1783
+ inputTokens: responseBody.usage.inputTokens ?? void 0,
1784
+ outputTokens: responseBody.usage.outputTokens ?? void 0,
1785
+ totalTokens: responseBody.usage.totalTokens ?? void 0
1788
1786
  }
1789
1787
  }
1790
1788
  };
1791
1789
  } catch (error) {
1792
1790
  throw await asGatewayError(
1793
1791
  error,
1794
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1792
+ await parseAuthMethod(resolvedHeaders ?? {})
1795
1793
  );
1796
1794
  }
1797
1795
  }
@@ -1878,7 +1876,6 @@ var GatewayVideoModel = class {
1878
1876
  return this.config.provider;
1879
1877
  }
1880
1878
  async doGenerate(options) {
1881
- var _a12, _b12;
1882
1879
  const { headers, abortSignal } = options;
1883
1880
  const resolvedHeaders = this.config.headers ? await resolve8(this.config.headers) : void 0;
1884
1881
  try {
@@ -1886,7 +1883,7 @@ var GatewayVideoModel = class {
1886
1883
  url: this.getUrl(),
1887
1884
  headers: combineHeaders5(
1888
1885
  resolvedHeaders,
1889
- headers != null ? headers : {},
1886
+ headers ?? {},
1890
1887
  this.getModelConfigHeaders(),
1891
1888
  await resolve8(this.config.o11yHeaders),
1892
1889
  { accept: "text/event-stream" }
@@ -1958,18 +1955,15 @@ var GatewayVideoModel = class {
1958
1955
  },
1959
1956
  failedResponseHandler: createJsonErrorResponseHandler8({
1960
1957
  errorSchema: z.any(),
1961
- errorToMessage: (data) => {
1962
- var _a13;
1963
- return (_a13 = getErrorMessage8(data)) != null ? _a13 : "unknown error";
1964
- }
1958
+ errorToMessage: (data) => getErrorMessage8(data) ?? "unknown error"
1965
1959
  }),
1966
1960
  ...abortSignal && { abortSignal },
1967
1961
  fetch: this.config.fetch
1968
1962
  });
1969
1963
  return {
1970
1964
  videos: responseBody.videos,
1971
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : [],
1972
- providerMetadata: (_b12 = responseBody.providerMetadata) != null ? _b12 : void 0,
1965
+ warnings: responseBody.warnings ?? [],
1966
+ providerMetadata: responseBody.providerMetadata ?? void 0,
1973
1967
  response: {
1974
1968
  timestamp: /* @__PURE__ */ new Date(),
1975
1969
  modelId: this.modelId,
@@ -1979,7 +1973,7 @@ var GatewayVideoModel = class {
1979
1973
  } catch (error) {
1980
1974
  throw await asGatewayError(
1981
1975
  error,
1982
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
1976
+ await parseAuthMethod(resolvedHeaders ?? {})
1983
1977
  );
1984
1978
  }
1985
1979
  }
@@ -1992,7 +1986,6 @@ var GatewayVideoModel = class {
1992
1986
  return { webhookUrl: url, received };
1993
1987
  }
1994
1988
  async doStart(options) {
1995
- var _a12, _b12;
1996
1989
  const { headers, abortSignal, webhookUrl } = options;
1997
1990
  const resolvedHeaders = this.config.headers ? await resolve8(this.config.headers) : void 0;
1998
1991
  try {
@@ -2000,7 +1993,7 @@ var GatewayVideoModel = class {
2000
1993
  url: this.getStartUrl(),
2001
1994
  headers: combineHeaders5(
2002
1995
  resolvedHeaders,
2003
- headers != null ? headers : {},
1996
+ headers ?? {},
2004
1997
  this.getModelConfigHeaders(),
2005
1998
  await resolve8(this.config.o11yHeaders)
2006
1999
  ),
@@ -2015,18 +2008,15 @@ var GatewayVideoModel = class {
2015
2008
  ),
2016
2009
  failedResponseHandler: createJsonErrorResponseHandler8({
2017
2010
  errorSchema: z.any(),
2018
- errorToMessage: (data) => {
2019
- var _a13;
2020
- return (_a13 = getErrorMessage8(data)) != null ? _a13 : "unknown error";
2021
- }
2011
+ errorToMessage: (data) => getErrorMessage8(data) ?? "unknown error"
2022
2012
  }),
2023
2013
  ...abortSignal && { abortSignal },
2024
2014
  fetch: this.config.fetch
2025
2015
  });
2026
2016
  return {
2027
2017
  operation: responseBody.operation,
2028
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : [],
2029
- providerMetadata: (_b12 = responseBody.providerMetadata) != null ? _b12 : void 0,
2018
+ warnings: responseBody.warnings ?? [],
2019
+ providerMetadata: responseBody.providerMetadata ?? void 0,
2030
2020
  response: {
2031
2021
  timestamp: /* @__PURE__ */ new Date(),
2032
2022
  modelId: this.modelId,
@@ -2036,7 +2026,7 @@ var GatewayVideoModel = class {
2036
2026
  } catch (error) {
2037
2027
  throw await asGatewayError(
2038
2028
  error,
2039
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
2029
+ await parseAuthMethod(resolvedHeaders ?? {})
2040
2030
  );
2041
2031
  }
2042
2032
  }
@@ -2045,14 +2035,13 @@ var GatewayVideoModel = class {
2045
2035
  abortSignal,
2046
2036
  headers
2047
2037
  }) {
2048
- var _a12, _b12, _c, _d, _e, _f;
2049
2038
  const resolvedHeaders = this.config.headers ? await resolve8(this.config.headers) : void 0;
2050
2039
  try {
2051
2040
  const { responseHeaders, value: responseBody } = await postJsonToApi5({
2052
2041
  url: this.getStatusUrl(),
2053
2042
  headers: combineHeaders5(
2054
2043
  resolvedHeaders,
2055
- headers != null ? headers : {},
2044
+ headers ?? {},
2056
2045
  this.getModelConfigHeaders(),
2057
2046
  await resolve8(this.config.o11yHeaders)
2058
2047
  ),
@@ -2062,10 +2051,7 @@ var GatewayVideoModel = class {
2062
2051
  ),
2063
2052
  failedResponseHandler: createJsonErrorResponseHandler8({
2064
2053
  errorSchema: z.any(),
2065
- errorToMessage: (data) => {
2066
- var _a13;
2067
- return (_a13 = getErrorMessage8(data)) != null ? _a13 : "unknown error";
2068
- }
2054
+ errorToMessage: (data) => getErrorMessage8(data) ?? "unknown error"
2069
2055
  }),
2070
2056
  ...abortSignal && { abortSignal },
2071
2057
  fetch: this.config.fetch
@@ -2079,8 +2065,8 @@ var GatewayVideoModel = class {
2079
2065
  return {
2080
2066
  status: "completed",
2081
2067
  videos: responseBody.videos,
2082
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : [],
2083
- providerMetadata: (_b12 = responseBody.providerMetadata) != null ? _b12 : void 0,
2068
+ warnings: responseBody.warnings ?? [],
2069
+ providerMetadata: responseBody.providerMetadata ?? void 0,
2084
2070
  response
2085
2071
  };
2086
2072
  }
@@ -2088,7 +2074,7 @@ var GatewayVideoModel = class {
2088
2074
  return {
2089
2075
  status: "error",
2090
2076
  error: responseBody.error,
2091
- providerMetadata: (_c = responseBody.providerMetadata) != null ? _c : void 0,
2077
+ providerMetadata: responseBody.providerMetadata ?? void 0,
2092
2078
  response
2093
2079
  };
2094
2080
  }
@@ -2096,20 +2082,20 @@ var GatewayVideoModel = class {
2096
2082
  return {
2097
2083
  status: "error",
2098
2084
  error: "Video generation was cancelled.",
2099
- providerMetadata: (_d = responseBody.providerMetadata) != null ? _d : void 0,
2085
+ providerMetadata: responseBody.providerMetadata ?? void 0,
2100
2086
  response
2101
2087
  };
2102
2088
  }
2103
2089
  return {
2104
2090
  status: "pending",
2105
- warnings: (_e = responseBody.warnings) != null ? _e : [],
2106
- providerMetadata: (_f = responseBody.providerMetadata) != null ? _f : void 0,
2091
+ warnings: responseBody.warnings ?? [],
2092
+ providerMetadata: responseBody.providerMetadata ?? void 0,
2107
2093
  response
2108
2094
  };
2109
2095
  } catch (error) {
2110
2096
  throw await asGatewayError(
2111
2097
  error,
2112
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
2098
+ await parseAuthMethod(resolvedHeaders ?? {})
2113
2099
  );
2114
2100
  }
2115
2101
  }
@@ -2255,16 +2241,250 @@ var gatewayVideoStatusResponseSchema = z.discriminatedUnion("status", [
2255
2241
  })
2256
2242
  ]);
2257
2243
 
2258
- // src/gateway-reranking-model.ts
2244
+ // src/gateway-evaluation-model.ts
2259
2245
  import {
2260
2246
  combineHeaders as combineHeaders6,
2261
2247
  createJsonErrorResponseHandler as createJsonErrorResponseHandler9,
2262
2248
  createJsonResponseHandler as createJsonResponseHandler9,
2263
2249
  getErrorMessage as getErrorMessage9,
2264
- lazySchema as lazySchema9,
2250
+ lazySchema as lazySchema10,
2251
+ parseProviderOptions,
2265
2252
  postJsonToApi as postJsonToApi6,
2266
2253
  resolve as resolve9,
2267
- zodSchema as zodSchema9
2254
+ zodSchema as zodSchema10
2255
+ } from "@ai-sdk/provider-utils";
2256
+
2257
+ // src/gateway-provider-options.ts
2258
+ import { lazySchema as lazySchema9, zodSchema as zodSchema9 } from "@ai-sdk/provider-utils";
2259
+ var EVALUATION_FALLBACK_MAX_CONDITION_DEPTH = 5;
2260
+ var EVALUATION_FALLBACK_MAX_CONDITIONS_PER_LIST = 20;
2261
+ var EVALUATION_FALLBACK_MAX_QUESTION_LENGTH = 256;
2262
+ var gatewayEvaluationProviderOptionsSchema = lazySchema9(
2263
+ () => zodSchema9(
2264
+ z.object({
2265
+ models: gatewayModelFallbacksSchema.optional()
2266
+ }).catchall(z.unknown())
2267
+ )
2268
+ );
2269
+ var probabilitySchema = z.number().finite().min(0).max(1);
2270
+ var questionSchema = z.string().min(1).max(EVALUATION_FALLBACK_MAX_QUESTION_LENGTH);
2271
+ var directConditionSchema = z.union([
2272
+ z.object({
2273
+ question: questionSchema.optional(),
2274
+ confidenceBelow: probabilitySchema
2275
+ }).strict(),
2276
+ z.object({
2277
+ question: questionSchema.optional(),
2278
+ probabilityBetween: z.array(probabilitySchema).length(2).refine(([minimum, maximum]) => minimum <= maximum, {
2279
+ message: "probabilityBetween minimum must be less than or equal to maximum"
2280
+ })
2281
+ }).strict()
2282
+ ]);
2283
+ var groupBeyondMaxDepthSchema = z.union([
2284
+ z.object({ any: z.unknown() }),
2285
+ z.object({ all: z.unknown() }),
2286
+ z.object({ atLeast: z.unknown() })
2287
+ ]).superRefine((_, context) => {
2288
+ context.addIssue({
2289
+ code: "custom",
2290
+ message: `conditions can be nested at most ${EVALUATION_FALLBACK_MAX_CONDITION_DEPTH} levels deep`
2291
+ });
2292
+ });
2293
+ var conditionalModelFallbackSchema = z.object({
2294
+ model: z.string().min(1),
2295
+ when: conditionSchema(1)
2296
+ }).strict();
2297
+ var gatewayModelFallbacksSchema = z.array(z.union([z.string(), conditionalModelFallbackSchema])).superRefine((entries, context) => {
2298
+ const conditionalIndexes = entries.flatMap(
2299
+ (entry, index) => typeof entry === "string" ? [] : [index]
2300
+ );
2301
+ if (conditionalIndexes.length > 1) {
2302
+ context.addIssue({
2303
+ code: "custom",
2304
+ message: "models supports at most one conditional evaluation fallback"
2305
+ });
2306
+ }
2307
+ if (conditionalIndexes[0] !== void 0 && conditionalIndexes[0] !== 0) {
2308
+ context.addIssue({
2309
+ code: "custom",
2310
+ message: "a conditional evaluation fallback must be the first models entry",
2311
+ path: [conditionalIndexes[0]]
2312
+ });
2313
+ }
2314
+ });
2315
+ function conditionSchema(depth) {
2316
+ if (depth === EVALUATION_FALLBACK_MAX_CONDITION_DEPTH) {
2317
+ return z.union([
2318
+ directConditionSchema,
2319
+ groupBeyondMaxDepthSchema
2320
+ ]);
2321
+ }
2322
+ const childConditionSchema = conditionSchema(depth + 1);
2323
+ const conditionListSchema = z.array(childConditionSchema).min(1).max(EVALUATION_FALLBACK_MAX_CONDITIONS_PER_LIST);
2324
+ return z.union([
2325
+ directConditionSchema,
2326
+ z.object({ any: conditionListSchema }).strict(),
2327
+ z.object({ all: conditionListSchema }).strict(),
2328
+ z.object({
2329
+ atLeast: z.object({
2330
+ count: z.number().int().min(1),
2331
+ conditions: conditionListSchema
2332
+ }).strict().refine(({ count, conditions }) => count <= conditions.length, {
2333
+ message: "atLeast count cannot exceed the number of conditions",
2334
+ path: ["count"]
2335
+ })
2336
+ }).strict()
2337
+ ]);
2338
+ }
2339
+
2340
+ // src/gateway-evaluation-model.ts
2341
+ var GatewayEvaluationModel = class {
2342
+ constructor(modelId, config) {
2343
+ this.modelId = modelId;
2344
+ this.config = config;
2345
+ this.specificationVersion = "v4";
2346
+ this.supportedQuestionTypes = ["choice", "score", "boolean"];
2347
+ }
2348
+ get provider() {
2349
+ return this.config.provider;
2350
+ }
2351
+ async doEvaluate({
2352
+ state,
2353
+ questions,
2354
+ headers,
2355
+ abortSignal,
2356
+ providerOptions
2357
+ }) {
2358
+ const gatewayOptions = await parseProviderOptions({
2359
+ provider: "gateway",
2360
+ providerOptions,
2361
+ schema: gatewayEvaluationProviderOptionsSchema
2362
+ });
2363
+ const validatedProviderOptions = gatewayOptions == null ? providerOptions : { ...providerOptions, gateway: gatewayOptions };
2364
+ const resolvedHeaders = this.config.headers ? await resolve9(this.config.headers) : void 0;
2365
+ try {
2366
+ const {
2367
+ responseHeaders,
2368
+ value: responseBody,
2369
+ rawValue
2370
+ } = await postJsonToApi6({
2371
+ url: this.getUrl(),
2372
+ headers: combineHeaders6(
2373
+ resolvedHeaders,
2374
+ headers ?? {},
2375
+ this.getModelConfigHeaders(),
2376
+ await resolve9(this.config.o11yHeaders)
2377
+ ),
2378
+ body: {
2379
+ state,
2380
+ questions,
2381
+ ...validatedProviderOptions ? { providerOptions: validatedProviderOptions } : {}
2382
+ },
2383
+ successfulResponseHandler: createJsonResponseHandler9(
2384
+ gatewayEvaluationResponseSchema
2385
+ ),
2386
+ failedResponseHandler: createJsonErrorResponseHandler9({
2387
+ errorSchema: z.any(),
2388
+ errorToMessage: (data) => getErrorMessage9(data) ?? "unknown error"
2389
+ }),
2390
+ ...abortSignal && { abortSignal },
2391
+ fetch: this.config.fetch
2392
+ });
2393
+ return {
2394
+ answers: responseBody.answers,
2395
+ ...responseBody.rounding ? { rounding: responseBody.rounding } : {},
2396
+ ...responseBody.usage ? { usage: responseBody.usage } : {},
2397
+ warnings: responseBody.warnings ?? [],
2398
+ providerMetadata: responseBody.providerMetadata,
2399
+ response: {
2400
+ modelId: responseBody.model ?? this.modelId,
2401
+ headers: responseHeaders,
2402
+ body: rawValue
2403
+ }
2404
+ };
2405
+ } catch (error) {
2406
+ throw await asGatewayError(
2407
+ error,
2408
+ await parseAuthMethod(resolvedHeaders ?? {})
2409
+ );
2410
+ }
2411
+ }
2412
+ getUrl() {
2413
+ return `${this.config.baseURL}/evaluation-model`;
2414
+ }
2415
+ getModelConfigHeaders() {
2416
+ return {
2417
+ "ai-evaluation-model-specification-version": "4",
2418
+ "ai-model-id": this.modelId
2419
+ };
2420
+ }
2421
+ };
2422
+ var gatewayEvaluationAnswerSchema = z.discriminatedUnion("type", [
2423
+ z.object({
2424
+ type: z.literal("choice"),
2425
+ choice: z.string(),
2426
+ probabilities: z.record(z.string(), z.number()).optional()
2427
+ }),
2428
+ z.object({
2429
+ type: z.literal("score"),
2430
+ score: z.number(),
2431
+ probabilities: z.record(z.string(), z.number()).optional()
2432
+ }),
2433
+ z.object({
2434
+ type: z.literal("boolean"),
2435
+ probability: z.number()
2436
+ })
2437
+ ]);
2438
+ var gatewayEvaluationWarningSchema = z.discriminatedUnion("type", [
2439
+ z.object({
2440
+ type: z.literal("unsupported"),
2441
+ feature: z.string(),
2442
+ details: z.string().optional()
2443
+ }),
2444
+ z.object({
2445
+ type: z.literal("compatibility"),
2446
+ feature: z.string(),
2447
+ details: z.string().optional()
2448
+ }),
2449
+ z.object({
2450
+ type: z.literal("deprecated"),
2451
+ setting: z.string(),
2452
+ message: z.string()
2453
+ }),
2454
+ z.object({
2455
+ type: z.literal("other"),
2456
+ message: z.string()
2457
+ })
2458
+ ]);
2459
+ var gatewayEvaluationResponseSchema = lazySchema10(
2460
+ () => zodSchema10(
2461
+ z.object({
2462
+ answers: z.record(z.string(), gatewayEvaluationAnswerSchema),
2463
+ model: z.string().optional(),
2464
+ rounding: z.object({
2465
+ probabilityDecimals: z.number().optional(),
2466
+ scoreDecimals: z.number().optional()
2467
+ }).optional(),
2468
+ usage: z.object({
2469
+ inputTokens: z.number().optional(),
2470
+ outputTokens: z.number().optional()
2471
+ }).optional(),
2472
+ warnings: z.array(gatewayEvaluationWarningSchema).optional(),
2473
+ providerMetadata: z.record(z.string(), z.record(z.string(), z.unknown())).optional()
2474
+ })
2475
+ )
2476
+ );
2477
+
2478
+ // src/gateway-reranking-model.ts
2479
+ import {
2480
+ combineHeaders as combineHeaders7,
2481
+ createJsonErrorResponseHandler as createJsonErrorResponseHandler10,
2482
+ createJsonResponseHandler as createJsonResponseHandler10,
2483
+ getErrorMessage as getErrorMessage10,
2484
+ lazySchema as lazySchema11,
2485
+ postJsonToApi as postJsonToApi7,
2486
+ resolve as resolve10,
2487
+ zodSchema as zodSchema11
2268
2488
  } from "@ai-sdk/provider-utils";
2269
2489
  var GatewayRerankingModel = class {
2270
2490
  constructor(modelId, config) {
@@ -2283,20 +2503,19 @@ var GatewayRerankingModel = class {
2283
2503
  abortSignal,
2284
2504
  providerOptions
2285
2505
  }) {
2286
- var _a12;
2287
- const resolvedHeaders = this.config.headers ? await resolve9(this.config.headers) : void 0;
2506
+ const resolvedHeaders = this.config.headers ? await resolve10(this.config.headers) : void 0;
2288
2507
  try {
2289
2508
  const {
2290
2509
  responseHeaders,
2291
2510
  value: responseBody,
2292
2511
  rawValue
2293
- } = await postJsonToApi6({
2512
+ } = await postJsonToApi7({
2294
2513
  url: this.getUrl(),
2295
- headers: combineHeaders6(
2514
+ headers: combineHeaders7(
2296
2515
  resolvedHeaders,
2297
- headers != null ? headers : {},
2516
+ headers ?? {},
2298
2517
  this.getModelConfigHeaders(),
2299
- await resolve9(this.config.o11yHeaders)
2518
+ await resolve10(this.config.o11yHeaders)
2300
2519
  ),
2301
2520
  body: {
2302
2521
  documents,
@@ -2304,15 +2523,12 @@ var GatewayRerankingModel = class {
2304
2523
  ...topN != null ? { topN } : {},
2305
2524
  ...providerOptions ? { providerOptions } : {}
2306
2525
  },
2307
- successfulResponseHandler: createJsonResponseHandler9(
2526
+ successfulResponseHandler: createJsonResponseHandler10(
2308
2527
  gatewayRerankingResponseSchema
2309
2528
  ),
2310
- failedResponseHandler: createJsonErrorResponseHandler9({
2529
+ failedResponseHandler: createJsonErrorResponseHandler10({
2311
2530
  errorSchema: z.any(),
2312
- errorToMessage: (data) => {
2313
- var _a13;
2314
- return (_a13 = getErrorMessage9(data)) != null ? _a13 : "unknown error";
2315
- }
2531
+ errorToMessage: (data) => getErrorMessage10(data) ?? "unknown error"
2316
2532
  }),
2317
2533
  ...abortSignal && { abortSignal },
2318
2534
  fetch: this.config.fetch
@@ -2321,12 +2537,12 @@ var GatewayRerankingModel = class {
2321
2537
  ranking: responseBody.ranking,
2322
2538
  providerMetadata: responseBody.providerMetadata,
2323
2539
  response: { headers: responseHeaders, body: rawValue },
2324
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : []
2540
+ warnings: responseBody.warnings ?? []
2325
2541
  };
2326
2542
  } catch (error) {
2327
2543
  throw await asGatewayError(
2328
2544
  error,
2329
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
2545
+ await parseAuthMethod(resolvedHeaders ?? {})
2330
2546
  );
2331
2547
  }
2332
2548
  }
@@ -2361,8 +2577,8 @@ var gatewayRerankingWarningSchema = z.discriminatedUnion("type", [
2361
2577
  message: z.string()
2362
2578
  })
2363
2579
  ]);
2364
- var gatewayRerankingResponseSchema = lazySchema9(
2365
- () => zodSchema9(
2580
+ var gatewayRerankingResponseSchema = lazySchema11(
2581
+ () => zodSchema11(
2366
2582
  z.object({
2367
2583
  ranking: z.array(
2368
2584
  z.object({
@@ -2378,12 +2594,12 @@ var gatewayRerankingResponseSchema = lazySchema9(
2378
2594
 
2379
2595
  // src/gateway-speech-model.ts
2380
2596
  import {
2381
- combineHeaders as combineHeaders7,
2382
- createJsonErrorResponseHandler as createJsonErrorResponseHandler10,
2383
- createJsonResponseHandler as createJsonResponseHandler10,
2384
- getErrorMessage as getErrorMessage10,
2385
- postJsonToApi as postJsonToApi7,
2386
- resolve as resolve10
2597
+ combineHeaders as combineHeaders8,
2598
+ createJsonErrorResponseHandler as createJsonErrorResponseHandler11,
2599
+ createJsonResponseHandler as createJsonResponseHandler11,
2600
+ getErrorMessage as getErrorMessage11,
2601
+ postJsonToApi as postJsonToApi8,
2602
+ resolve as resolve11
2387
2603
  } from "@ai-sdk/provider-utils";
2388
2604
  var GatewaySpeechModel = class {
2389
2605
  constructor(modelId, config) {
@@ -2405,20 +2621,19 @@ var GatewaySpeechModel = class {
2405
2621
  headers,
2406
2622
  abortSignal
2407
2623
  }) {
2408
- var _a12;
2409
- const resolvedHeaders = this.config.headers ? await resolve10(this.config.headers) : void 0;
2624
+ const resolvedHeaders = this.config.headers ? await resolve11(this.config.headers) : void 0;
2410
2625
  try {
2411
2626
  const {
2412
2627
  responseHeaders,
2413
2628
  value: responseBody,
2414
2629
  rawValue
2415
- } = await postJsonToApi7({
2630
+ } = await postJsonToApi8({
2416
2631
  url: this.getUrl(),
2417
- headers: combineHeaders7(
2632
+ headers: combineHeaders8(
2418
2633
  resolvedHeaders,
2419
- headers != null ? headers : {},
2634
+ headers ?? {},
2420
2635
  this.getModelConfigHeaders(),
2421
- await resolve10(this.config.o11yHeaders)
2636
+ await resolve11(this.config.o11yHeaders)
2422
2637
  ),
2423
2638
  body: {
2424
2639
  text,
@@ -2429,22 +2644,19 @@ var GatewaySpeechModel = class {
2429
2644
  ...language && { language },
2430
2645
  ...providerOptions && { providerOptions }
2431
2646
  },
2432
- successfulResponseHandler: createJsonResponseHandler10(
2647
+ successfulResponseHandler: createJsonResponseHandler11(
2433
2648
  gatewaySpeechResponseSchema
2434
2649
  ),
2435
- failedResponseHandler: createJsonErrorResponseHandler10({
2650
+ failedResponseHandler: createJsonErrorResponseHandler11({
2436
2651
  errorSchema: z.any(),
2437
- errorToMessage: (data) => {
2438
- var _a13;
2439
- return (_a13 = getErrorMessage10(data)) != null ? _a13 : "unknown error";
2440
- }
2652
+ errorToMessage: (data) => getErrorMessage11(data) ?? "unknown error"
2441
2653
  }),
2442
2654
  ...abortSignal && { abortSignal },
2443
2655
  fetch: this.config.fetch
2444
2656
  });
2445
2657
  return {
2446
2658
  audio: responseBody.audio,
2447
- warnings: (_a12 = responseBody.warnings) != null ? _a12 : [],
2659
+ warnings: responseBody.warnings ?? [],
2448
2660
  providerMetadata: responseBody.providerMetadata,
2449
2661
  response: {
2450
2662
  timestamp: /* @__PURE__ */ new Date(),
@@ -2456,7 +2668,7 @@ var GatewaySpeechModel = class {
2456
2668
  } catch (error) {
2457
2669
  throw await asGatewayError(
2458
2670
  error,
2459
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
2671
+ await parseAuthMethod(resolvedHeaders ?? {})
2460
2672
  );
2461
2673
  }
2462
2674
  }
@@ -2500,19 +2712,19 @@ var gatewaySpeechResponseSchema = z.object({
2500
2712
 
2501
2713
  // src/gateway-transcription-model.ts
2502
2714
  import {
2503
- getErrorMessage as getErrorMessage11
2715
+ getErrorMessage as getErrorMessage12
2504
2716
  } from "@ai-sdk/provider";
2505
2717
  import {
2506
- combineHeaders as combineHeaders8,
2718
+ combineHeaders as combineHeaders9,
2507
2719
  convertBase64ToUint8Array,
2508
2720
  convertUint8ArrayToBase64 as convertUint8ArrayToBase643,
2509
- createJsonErrorResponseHandler as createJsonErrorResponseHandler11,
2510
- createJsonResponseHandler as createJsonResponseHandler11,
2721
+ createJsonErrorResponseHandler as createJsonErrorResponseHandler12,
2722
+ createJsonResponseHandler as createJsonResponseHandler12,
2511
2723
  connectToWebSocket,
2512
2724
  normalizeHeaders,
2513
2725
  experimental_parseTranscriptionStreamPart as parseTranscriptionStreamPart,
2514
- postJsonToApi as postJsonToApi8,
2515
- resolve as resolve11,
2726
+ postJsonToApi as postJsonToApi9,
2727
+ resolve as resolve12,
2516
2728
  EXPERIMENTAL_TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE as TRANSCRIPTION_STREAM_AUDIO_DONE_FRAME_TYPE,
2517
2729
  waitForWebSocketBufferDrain,
2518
2730
  EXPERIMENTAL_TRANSCRIPTION_STREAM_START_FRAME_TYPE as TRANSCRIPTION_STREAM_START_FRAME_TYPE
@@ -2533,45 +2745,41 @@ var GatewayTranscriptionModel = class {
2533
2745
  headers,
2534
2746
  abortSignal
2535
2747
  }) {
2536
- var _a12, _b12, _c, _d;
2537
- const resolvedHeaders = this.config.headers ? await resolve11(this.config.headers) : void 0;
2748
+ const resolvedHeaders = this.config.headers ? await resolve12(this.config.headers) : void 0;
2538
2749
  try {
2539
2750
  const {
2540
2751
  responseHeaders,
2541
2752
  value: responseBody,
2542
2753
  rawValue
2543
- } = await postJsonToApi8({
2754
+ } = await postJsonToApi9({
2544
2755
  url: this.getUrl(),
2545
- headers: combineHeaders8(
2756
+ headers: combineHeaders9(
2546
2757
  resolvedHeaders,
2547
- headers != null ? headers : {},
2758
+ headers ?? {},
2548
2759
  this.getModelConfigHeaders(),
2549
- await resolve11(this.config.o11yHeaders)
2760
+ await resolve12(this.config.o11yHeaders)
2550
2761
  ),
2551
2762
  body: {
2552
2763
  audio: audio instanceof Uint8Array ? convertUint8ArrayToBase643(audio) : audio,
2553
2764
  mediaType,
2554
2765
  ...providerOptions && { providerOptions }
2555
2766
  },
2556
- successfulResponseHandler: createJsonResponseHandler11(
2767
+ successfulResponseHandler: createJsonResponseHandler12(
2557
2768
  gatewayTranscriptionResponseSchema
2558
2769
  ),
2559
- failedResponseHandler: createJsonErrorResponseHandler11({
2770
+ failedResponseHandler: createJsonErrorResponseHandler12({
2560
2771
  errorSchema: z.any(),
2561
- errorToMessage: (data) => {
2562
- var _a13;
2563
- return (_a13 = getErrorMessage11(data)) != null ? _a13 : "unknown error";
2564
- }
2772
+ errorToMessage: (data) => getErrorMessage12(data) ?? "unknown error"
2565
2773
  }),
2566
2774
  ...abortSignal && { abortSignal },
2567
2775
  fetch: this.config.fetch
2568
2776
  });
2569
2777
  return {
2570
2778
  text: responseBody.text,
2571
- segments: (_a12 = responseBody.segments) != null ? _a12 : [],
2572
- language: (_b12 = responseBody.language) != null ? _b12 : void 0,
2573
- durationInSeconds: (_c = responseBody.durationInSeconds) != null ? _c : void 0,
2574
- warnings: (_d = responseBody.warnings) != null ? _d : [],
2779
+ segments: responseBody.segments ?? [],
2780
+ language: responseBody.language ?? void 0,
2781
+ durationInSeconds: responseBody.durationInSeconds ?? void 0,
2782
+ warnings: responseBody.warnings ?? [],
2575
2783
  providerMetadata: responseBody.providerMetadata,
2576
2784
  response: {
2577
2785
  timestamp: /* @__PURE__ */ new Date(),
@@ -2583,18 +2791,17 @@ var GatewayTranscriptionModel = class {
2583
2791
  } catch (error) {
2584
2792
  throw await asGatewayError(
2585
2793
  error,
2586
- await parseAuthMethod(resolvedHeaders != null ? resolvedHeaders : {})
2794
+ await parseAuthMethod(resolvedHeaders ?? {})
2587
2795
  );
2588
2796
  }
2589
2797
  }
2590
2798
  async doStream(options) {
2591
- var _a12, _b12, _c, _d, _e;
2592
- const currentDate = (_c = (_b12 = (_a12 = this.config._internal) == null ? void 0 : _a12.currentDate) == null ? void 0 : _b12.call(_a12)) != null ? _c : /* @__PURE__ */ new Date();
2593
- const headers = combineHeaders8(
2594
- await resolve11((_d = this.config.headers) != null ? _d : {}),
2595
- (_e = options.headers) != null ? _e : {},
2799
+ const currentDate = this.config._internal?.currentDate?.() ?? /* @__PURE__ */ new Date();
2800
+ const headers = combineHeaders9(
2801
+ await resolve12(this.config.headers ?? {}),
2802
+ options.headers ?? {},
2596
2803
  this.getModelConfigHeaders(),
2597
- await resolve11(this.config.o11yHeaders)
2804
+ await resolve12(this.config.o11yHeaders)
2598
2805
  );
2599
2806
  const authMethod = await parseAuthMethod(headers);
2600
2807
  const startFrame = {
@@ -2640,7 +2847,7 @@ function toGatewayTranscriptionUrl(baseURL, modelId) {
2640
2847
  function getProtocolsFromHeaders(headers) {
2641
2848
  const normalizedHeaders = normalizeHeaders(headers);
2642
2849
  const authorization = normalizedHeaders.authorization;
2643
- const token = (authorization == null ? void 0 : authorization.startsWith("Bearer ")) ? authorization.slice("Bearer ".length) : void 0;
2850
+ const token = authorization?.startsWith("Bearer ") ? authorization.slice("Bearer ".length) : void 0;
2644
2851
  return token == null ? [GATEWAY_TRANSCRIPTION_SUBPROTOCOL] : getGatewayTranscriptionProtocols(token, {
2645
2852
  teamIdOrSlug: normalizedHeaders[VERCEL_AI_GATEWAY_TEAM_HEADER]
2646
2853
  });
@@ -2674,7 +2881,7 @@ function createGatewayTranscriptionStream({
2674
2881
  void audio.cancel().catch(() => {
2675
2882
  });
2676
2883
  }
2677
- connection == null ? void 0 : connection.close(closeCode);
2884
+ connection?.close(closeCode);
2678
2885
  };
2679
2886
  const stopAudio = () => {
2680
2887
  audioStopped = true;
@@ -2832,7 +3039,7 @@ function getServerErrorMessage(error) {
2832
3039
  if (error != null && typeof error === "object" && "message" in error && typeof error.message === "string") {
2833
3040
  return error.message;
2834
3041
  }
2835
- return getErrorMessage11(error);
3042
+ return getErrorMessage12(error);
2836
3043
  }
2837
3044
  var SERVER_ERROR_STATUS_CODES = {
2838
3045
  authentication_error: 401,
@@ -2877,7 +3084,7 @@ var GatewayRealtimeModel = class {
2877
3084
  async doCreateClientSecret(options) {
2878
3085
  const secret = await this.config.createClientSecret({
2879
3086
  modelId: this.modelId,
2880
- ...(options == null ? void 0 : options.expiresAfterSeconds) != null && {
3087
+ ...options?.expiresAfterSeconds != null && {
2881
3088
  expiresAfterSeconds: options.expiresAfterSeconds
2882
3089
  }
2883
3090
  });
@@ -2911,14 +3118,130 @@ function toGatewayRealtimeUrl(baseURL, modelId) {
2911
3118
  return url.toString();
2912
3119
  }
2913
3120
 
2914
- // src/tool/exa-search.ts
3121
+ // src/tool/browserbase-fetch.ts
2915
3122
  import {
2916
3123
  createProviderExecutedToolFactory,
2917
- lazySchema as lazySchema10,
2918
- zodSchema as zodSchema10
3124
+ lazySchema as lazySchema12,
3125
+ zodSchema as zodSchema12
2919
3126
  } from "@ai-sdk/provider-utils";
2920
- var exaSearchInputSchema = lazySchema10(
2921
- () => zodSchema10(
3127
+ var jsonObjectSchema = z.record(z.string(), z.unknown());
3128
+ var browserbaseFetchInputSchema = lazySchema12(
3129
+ () => zodSchema12(
3130
+ z.object({
3131
+ url: z.string().url().describe("URL of the page to fetch."),
3132
+ allow_redirects: z.boolean().optional().describe("Whether to follow HTTP redirects (default: false)."),
3133
+ allow_insecure_ssl: z.boolean().optional().describe(
3134
+ "Whether to bypass TLS certificate verification (default: false). Only use for trusted hosts."
3135
+ ),
3136
+ proxies: z.boolean().optional().describe(
3137
+ "Whether to route the request through Browserbase proxies (default: false)."
3138
+ ),
3139
+ format: z.enum(["raw", "json", "markdown"]).optional().describe(
3140
+ "Output format. raw returns the response body unchanged, markdown returns page content as Markdown, and json returns structured content using schema."
3141
+ ),
3142
+ schema: jsonObjectSchema.optional().describe(
3143
+ "JSON Schema for structured extraction. Only use with format set to json."
3144
+ )
3145
+ })
3146
+ )
3147
+ );
3148
+ var browserbaseFetchOutputSchema = lazySchema12(
3149
+ () => zodSchema12(
3150
+ z.union([
3151
+ z.object({
3152
+ id: z.string(),
3153
+ content: z.union([z.string(), jsonObjectSchema]),
3154
+ contentType: z.string(),
3155
+ encoding: z.string(),
3156
+ headers: z.record(z.string(), z.string()),
3157
+ statusCode: z.number()
3158
+ }),
3159
+ z.object({
3160
+ error: z.enum([
3161
+ "api_error",
3162
+ "configuration_error",
3163
+ "execution_error",
3164
+ "invalid_input",
3165
+ "rate_limit",
3166
+ "timeout",
3167
+ "unknown"
3168
+ ]),
3169
+ statusCode: z.number().optional(),
3170
+ message: z.string()
3171
+ })
3172
+ ])
3173
+ )
3174
+ );
3175
+ var browserbaseFetchToolFactory = createProviderExecutedToolFactory({
3176
+ id: "gateway.browserbase_fetch",
3177
+ inputSchema: browserbaseFetchInputSchema,
3178
+ outputSchema: browserbaseFetchOutputSchema
3179
+ });
3180
+ var browserbaseFetch = (config = {}) => browserbaseFetchToolFactory(config);
3181
+
3182
+ // src/tool/browserbase-search.ts
3183
+ import {
3184
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
3185
+ lazySchema as lazySchema13,
3186
+ zodSchema as zodSchema13
3187
+ } from "@ai-sdk/provider-utils";
3188
+ var browserbaseSearchInputSchema = lazySchema13(
3189
+ () => zodSchema13(
3190
+ z.object({
3191
+ query: z.string().min(1).max(200).describe("Web search query. Must be between 1 and 200 characters."),
3192
+ num_results: z.number().int().min(1).max(25).optional().describe("Maximum number of results to return (1-25, default: 10).")
3193
+ })
3194
+ )
3195
+ );
3196
+ var browserbaseSearchOutputSchema = lazySchema13(
3197
+ () => zodSchema13(
3198
+ z.union([
3199
+ z.object({
3200
+ query: z.string(),
3201
+ requestId: z.string(),
3202
+ results: z.array(
3203
+ z.object({
3204
+ id: z.string(),
3205
+ title: z.string(),
3206
+ url: z.string(),
3207
+ author: z.string().optional(),
3208
+ favicon: z.string().optional(),
3209
+ image: z.string().optional(),
3210
+ publishedDate: z.string().optional()
3211
+ })
3212
+ )
3213
+ }),
3214
+ z.object({
3215
+ error: z.enum([
3216
+ "api_error",
3217
+ "configuration_error",
3218
+ "execution_error",
3219
+ "invalid_input",
3220
+ "rate_limit",
3221
+ "timeout",
3222
+ "unknown"
3223
+ ]),
3224
+ statusCode: z.number().optional(),
3225
+ message: z.string()
3226
+ })
3227
+ ])
3228
+ )
3229
+ );
3230
+ var browserbaseSearchToolFactory = createProviderExecutedToolFactory2({
3231
+ id: "gateway.browserbase_search",
3232
+ inputSchema: browserbaseSearchInputSchema,
3233
+ outputSchema: browserbaseSearchOutputSchema
3234
+ });
3235
+ var browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
3236
+
3237
+ // src/tool/exa-search.ts
3238
+ import {
3239
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
3240
+ lazySchema as lazySchema14,
3241
+ zodSchema as zodSchema14
3242
+ } from "@ai-sdk/provider-utils";
3243
+ var exaSearchInputSchema = lazySchema14(
3244
+ () => zodSchema14(
2922
3245
  z.object({
2923
3246
  query: z.string().describe("Natural-language web search query. This is required."),
2924
3247
  type: z.enum(["auto", "fast", "instant"]).optional().describe(
@@ -2988,8 +3311,8 @@ var exaSearchInputSchema = lazySchema10(
2988
3311
  })
2989
3312
  )
2990
3313
  );
2991
- var exaSearchOutputSchema = lazySchema10(
2992
- () => zodSchema10(
3314
+ var exaSearchOutputSchema = lazySchema14(
3315
+ () => zodSchema14(
2993
3316
  z.union([
2994
3317
  z.object({
2995
3318
  requestId: z.string(),
@@ -3036,7 +3359,7 @@ var exaSearchOutputSchema = lazySchema10(
3036
3359
  ])
3037
3360
  )
3038
3361
  );
3039
- var exaSearchToolFactory = createProviderExecutedToolFactory({
3362
+ var exaSearchToolFactory = createProviderExecutedToolFactory3({
3040
3363
  id: "gateway.exa_search",
3041
3364
  inputSchema: exaSearchInputSchema,
3042
3365
  outputSchema: exaSearchOutputSchema
@@ -3045,12 +3368,12 @@ var exaSearch = (config = {}) => exaSearchToolFactory(config);
3045
3368
 
3046
3369
  // src/tool/parallel-search.ts
3047
3370
  import {
3048
- createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
3049
- lazySchema as lazySchema11,
3050
- zodSchema as zodSchema11
3371
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
3372
+ lazySchema as lazySchema15,
3373
+ zodSchema as zodSchema15
3051
3374
  } from "@ai-sdk/provider-utils";
3052
- var parallelSearchInputSchema = lazySchema11(
3053
- () => zodSchema11(
3375
+ var parallelSearchInputSchema = lazySchema15(
3376
+ () => zodSchema15(
3054
3377
  z.object({
3055
3378
  objective: z.string().describe(
3056
3379
  "Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
@@ -3089,8 +3412,8 @@ var parallelSearchInputSchema = lazySchema11(
3089
3412
  })
3090
3413
  )
3091
3414
  );
3092
- var parallelSearchOutputSchema = lazySchema11(
3093
- () => zodSchema11(
3415
+ var parallelSearchOutputSchema = lazySchema15(
3416
+ () => zodSchema15(
3094
3417
  z.union([
3095
3418
  // Success response
3096
3419
  z.object({
@@ -3121,7 +3444,7 @@ var parallelSearchOutputSchema = lazySchema11(
3121
3444
  ])
3122
3445
  )
3123
3446
  );
3124
- var parallelSearchToolFactory = createProviderExecutedToolFactory2({
3447
+ var parallelSearchToolFactory = createProviderExecutedToolFactory4({
3125
3448
  id: "gateway.parallel_search",
3126
3449
  inputSchema: parallelSearchInputSchema,
3127
3450
  outputSchema: parallelSearchOutputSchema
@@ -3130,12 +3453,12 @@ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
3130
3453
 
3131
3454
  // src/tool/perplexity-search.ts
3132
3455
  import {
3133
- createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
3134
- lazySchema as lazySchema12,
3135
- zodSchema as zodSchema12
3456
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
3457
+ lazySchema as lazySchema16,
3458
+ zodSchema as zodSchema16
3136
3459
  } from "@ai-sdk/provider-utils";
3137
- var perplexitySearchInputSchema = lazySchema12(
3138
- () => zodSchema12(
3460
+ var perplexitySearchInputSchema = lazySchema16(
3461
+ () => zodSchema16(
3139
3462
  z.object({
3140
3463
  query: z.union([z.string(), z.array(z.string())]).describe(
3141
3464
  "Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
@@ -3176,8 +3499,8 @@ var perplexitySearchInputSchema = lazySchema12(
3176
3499
  })
3177
3500
  )
3178
3501
  );
3179
- var perplexitySearchOutputSchema = lazySchema12(
3180
- () => zodSchema12(
3502
+ var perplexitySearchOutputSchema = lazySchema16(
3503
+ () => zodSchema16(
3181
3504
  z.union([
3182
3505
  // Success response
3183
3506
  z.object({
@@ -3207,7 +3530,7 @@ var perplexitySearchOutputSchema = lazySchema12(
3207
3530
  ])
3208
3531
  )
3209
3532
  );
3210
- var perplexitySearchToolFactory = createProviderExecutedToolFactory3({
3533
+ var perplexitySearchToolFactory = createProviderExecutedToolFactory5({
3211
3534
  id: "gateway.perplexity_search",
3212
3535
  inputSchema: perplexitySearchInputSchema,
3213
3536
  outputSchema: perplexitySearchOutputSchema
@@ -3216,9 +3539,9 @@ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
3216
3539
 
3217
3540
  // src/tool/tako-search.ts
3218
3541
  import {
3219
- createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
3220
- lazySchema as lazySchema13,
3221
- zodSchema as zodSchema13
3542
+ createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
3543
+ lazySchema as lazySchema17,
3544
+ zodSchema as zodSchema17
3222
3545
  } from "@ai-sdk/provider-utils";
3223
3546
  var takoDataSourceInputSchema = z.object({
3224
3547
  count: z.number().optional().describe(
@@ -3257,8 +3580,8 @@ var takoWebSourceInputSchema = z.object({
3257
3580
  "Keep results published on or before this ISO date (YYYY-MM-DD)."
3258
3581
  )
3259
3582
  });
3260
- var takoSearchInputSchema = lazySchema13(
3261
- () => zodSchema13(
3583
+ var takoSearchInputSchema = lazySchema17(
3584
+ () => zodSchema17(
3262
3585
  z.object({
3263
3586
  query: z.string().describe(
3264
3587
  'Natural-language search query. Include the entity, metric, and time period. Quote a phrase to force it to one entity, for example "Tesla":PRODUCT price.'
@@ -3388,8 +3711,8 @@ var takoWebResultSchema = z.object({
3388
3711
  publish_date: z.string().nullish(),
3389
3712
  content: takoResultContentSchema.nullish()
3390
3713
  }).passthrough();
3391
- var takoSearchOutputSchema = lazySchema13(
3392
- () => zodSchema13(
3714
+ var takoSearchOutputSchema = lazySchema17(
3715
+ () => zodSchema17(
3393
3716
  z.union([
3394
3717
  z.object({
3395
3718
  request_id: z.string(),
@@ -3418,7 +3741,7 @@ var takoSearchOutputSchema = lazySchema13(
3418
3741
  ])
3419
3742
  )
3420
3743
  );
3421
- var takoSearchToolFactory = createProviderExecutedToolFactory4({
3744
+ var takoSearchToolFactory = createProviderExecutedToolFactory6({
3422
3745
  id: "gateway.tako_search",
3423
3746
  inputSchema: takoSearchInputSchema,
3424
3747
  outputSchema: takoSearchOutputSchema
@@ -3427,6 +3750,20 @@ var takoSearch = (config = {}) => takoSearchToolFactory(config);
3427
3750
 
3428
3751
  // src/gateway-tools.ts
3429
3752
  var gatewayTools = {
3753
+ /**
3754
+ * Fetch page content using Browserbase's lightweight Fetch API.
3755
+ *
3756
+ * Supports raw, Markdown, and schema-driven JSON output as well as redirects,
3757
+ * proxy routing, and TLS controls.
3758
+ */
3759
+ browserbaseFetch,
3760
+ /**
3761
+ * Search the web using Browserbase's Search API for fast, structured results.
3762
+ *
3763
+ * Returns titles, URLs, and available publication metadata without requiring
3764
+ * a browser session.
3765
+ */
3766
+ browserbaseSearch,
3430
3767
  /**
3431
3768
  * Search the web using Exa for current information and token-efficient
3432
3769
  * excerpts optimized for agent workflows.
@@ -3467,12 +3804,11 @@ var gatewayTools = {
3467
3804
  import { getContext } from "@vercel/oidc";
3468
3805
  import { getVercelOidcToken } from "@vercel/oidc";
3469
3806
  async function getVercelRequestId() {
3470
- var _a12;
3471
- return (_a12 = getContext().headers) == null ? void 0 : _a12["x-vercel-id"];
3807
+ return getContext().headers?.["x-vercel-id"];
3472
3808
  }
3473
3809
 
3474
3810
  // src/version.ts
3475
- var VERSION = true ? "4.0.80" : "0.0.0-test";
3811
+ var VERSION = true ? "4.0.100" : "0.0.0-test";
3476
3812
 
3477
3813
  // src/gateway-provider.ts
3478
3814
  var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
@@ -3481,12 +3817,11 @@ var gatewayClientSecretResponseSchema = z.object({
3481
3817
  expiresAt: z.number().nullish()
3482
3818
  });
3483
3819
  function createGateway(options = {}) {
3484
- var _a12, _b12;
3485
3820
  let pendingMetadata = null;
3486
3821
  let metadataCache = null;
3487
- const cacheRefreshMillis = (_a12 = options.metadataCacheRefreshMillis) != null ? _a12 : 1e3 * 60 * 5;
3822
+ const cacheRefreshMillis = options.metadataCacheRefreshMillis ?? 1e3 * 60 * 5;
3488
3823
  let lastFetchTime = 0;
3489
- const baseURL = (_b12 = withoutTrailingSlash(options.baseURL)) != null ? _b12 : "https://ai-gateway.vercel.sh/v4/ai";
3824
+ const baseURL = withoutTrailingSlash(options.baseURL) ?? "https://ai-gateway.vercel.sh/v4/ai";
3490
3825
  const createAuthHeaders = (auth) => withUserAgentSuffix(
3491
3826
  {
3492
3827
  Authorization: `Bearer ${auth.token}`,
@@ -3495,7 +3830,7 @@ function createGateway(options = {}) {
3495
3830
  ...options.teamIdOrSlug != null ? { [VERCEL_AI_GATEWAY_TEAM_HEADER]: options.teamIdOrSlug } : {},
3496
3831
  ...options.headers
3497
3832
  },
3498
- `ai-sdk/gateway/${VERSION}`
3833
+ `ai-sdk-gateway/${VERSION}`
3499
3834
  );
3500
3835
  const getHeaders = async () => {
3501
3836
  try {
@@ -3527,7 +3862,7 @@ function createGateway(options = {}) {
3527
3862
  const headers = createAuthHeaders(auth);
3528
3863
  const url = new URL("/v1/realtime/client-secrets", baseURL).toString();
3529
3864
  try {
3530
- const { value } = await postJsonToApi9({
3865
+ const { value } = await postJsonToApi10({
3531
3866
  url,
3532
3867
  headers,
3533
3868
  body: {
@@ -3537,15 +3872,12 @@ function createGateway(options = {}) {
3537
3872
  expiresIn: params.expiresAfterSeconds
3538
3873
  }
3539
3874
  },
3540
- successfulResponseHandler: createJsonResponseHandler12(
3875
+ successfulResponseHandler: createJsonResponseHandler13(
3541
3876
  gatewayClientSecretResponseSchema
3542
3877
  ),
3543
- failedResponseHandler: createJsonErrorResponseHandler12({
3878
+ failedResponseHandler: createJsonErrorResponseHandler13({
3544
3879
  errorSchema: z.any(),
3545
- errorToMessage: (data) => {
3546
- var _a13;
3547
- return (_a13 = getErrorMessage12(data)) != null ? _a13 : "unknown error";
3548
- }
3880
+ errorToMessage: (data) => getErrorMessage13(data) ?? "unknown error"
3549
3881
  }),
3550
3882
  fetch: options.fetch
3551
3883
  });
@@ -3602,8 +3934,7 @@ function createGateway(options = {}) {
3602
3934
  o11yHeaders: createO11yHeaders()
3603
3935
  });
3604
3936
  const getAvailableModels = async () => {
3605
- var _a13, _b13, _c;
3606
- const now = (_c = (_b13 = (_a13 = options._internal) == null ? void 0 : _a13.currentDate) == null ? void 0 : _b13.call(_a13).getTime()) != null ? _c : Date.now();
3937
+ const now = options._internal?.currentDate?.().getTime() ?? Date.now();
3607
3938
  if (!pendingMetadata || now - lastFetchTime > cacheRefreshMillis) {
3608
3939
  lastFetchTime = now;
3609
3940
  pendingMetadata = new GatewayFetchMetadata({
@@ -3713,6 +4044,17 @@ function createGateway(options = {}) {
3713
4044
  };
3714
4045
  provider.rerankingModel = createRerankingModel;
3715
4046
  provider.reranking = createRerankingModel;
4047
+ const createEvaluationModel = (modelId) => {
4048
+ return new GatewayEvaluationModel(modelId, {
4049
+ provider: "gateway",
4050
+ baseURL,
4051
+ headers: getHeaders,
4052
+ fetch: options.fetch,
4053
+ o11yHeaders: createO11yHeaders()
4054
+ });
4055
+ };
4056
+ provider.evaluationModel = createEvaluationModel;
4057
+ provider.evaluation = createEvaluationModel;
3716
4058
  const createSpeechModel = (modelId) => {
3717
4059
  return new GatewaySpeechModel(modelId, {
3718
4060
  provider: "gateway",