orcaq 1.0.20

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 (1018) hide show
  1. package/.output/nitro.json +15 -0
  2. package/.output/public/_nuxt/8qASMGdV.js +1 -0
  3. package/.output/public/_nuxt/9lJACZIQ.js +19 -0
  4. package/.output/public/_nuxt/B2DnNiWd.js +1 -0
  5. package/.output/public/_nuxt/B6E6ObS_.js +8 -0
  6. package/.output/public/_nuxt/BH83_dXo.js +39 -0
  7. package/.output/public/_nuxt/BIKqrFbQ.js +1 -0
  8. package/.output/public/_nuxt/BNjPC06x.js +1 -0
  9. package/.output/public/_nuxt/BPQ-Pz1w.js +39 -0
  10. package/.output/public/_nuxt/BRpgKkVT.js +51 -0
  11. package/.output/public/_nuxt/BTCLPbPY.js +4 -0
  12. package/.output/public/_nuxt/BUV-RarV.js +1 -0
  13. package/.output/public/_nuxt/Bh6RgYlO.js +1 -0
  14. package/.output/public/_nuxt/Bq3cyzOD.js +1 -0
  15. package/.output/public/_nuxt/Bt9sU68B.js +9 -0
  16. package/.output/public/_nuxt/BwpH2ZxJ.js +1 -0
  17. package/.output/public/_nuxt/C25Tmn1m.js +1 -0
  18. package/.output/public/_nuxt/C2HlI1ss.js +1 -0
  19. package/.output/public/_nuxt/CU3ZV9iV.js +1 -0
  20. package/.output/public/_nuxt/CbcyysXi.js +1 -0
  21. package/.output/public/_nuxt/CepyvMhE.js +1 -0
  22. package/.output/public/_nuxt/CrgoNCm2.js +2 -0
  23. package/.output/public/_nuxt/CuBKbBH_.js +1 -0
  24. package/.output/public/_nuxt/CulD8qYQ.js +193 -0
  25. package/.output/public/_nuxt/CustomEdge.BNBpjEHb.css +1 -0
  26. package/.output/public/_nuxt/CylkLpwm.js +1 -0
  27. package/.output/public/_nuxt/D-bWLYHw.js +1 -0
  28. package/.output/public/_nuxt/D-zecHND.js +1 -0
  29. package/.output/public/_nuxt/D8vj6kFe.js +160 -0
  30. package/.output/public/_nuxt/DIETYtCL.js +1 -0
  31. package/.output/public/_nuxt/DJ4vUzxS.js +1 -0
  32. package/.output/public/_nuxt/DK-itzXx.js +8 -0
  33. package/.output/public/_nuxt/DL3T5jYo.js +3867 -0
  34. package/.output/public/_nuxt/DUsuhY9i.js +1 -0
  35. package/.output/public/_nuxt/DXV2HFBA.js +224 -0
  36. package/.output/public/_nuxt/Dh2zppOR.js +1 -0
  37. package/.output/public/_nuxt/DlAUqK2U.js +1 -0
  38. package/.output/public/_nuxt/DlmSeCnw.js +5 -0
  39. package/.output/public/_nuxt/DswTpYG4.js +1 -0
  40. package/.output/public/_nuxt/DynamicTable.DJeANwbG.css +1 -0
  41. package/.output/public/_nuxt/G830WtVn.js +1 -0
  42. package/.output/public/_nuxt/ICwM1E4-.js +15 -0
  43. package/.output/public/_nuxt/QZbJy9YW.js +31 -0
  44. package/.output/public/_nuxt/QuickQueryTable.DS_ON57S.css +1 -0
  45. package/.output/public/_nuxt/UXhX8z2W.js +1 -0
  46. package/.output/public/_nuxt/WrapperErdDiagram.DwhUd9Wr.css +1 -0
  47. package/.output/public/_nuxt/_fileId_.DmPfwyyD.css +1 -0
  48. package/.output/public/_nuxt/_tabViewId_.9Axt3zoi.css +1 -0
  49. package/.output/public/_nuxt/builds/latest.json +1 -0
  50. package/.output/public/_nuxt/builds/meta/6364d5cf-4642-479f-ba12-6440c56702af.json +1 -0
  51. package/.output/public/_nuxt/default.DixIpIal.css +1 -0
  52. package/.output/public/_nuxt/entry.GqPNPe1e.css +1 -0
  53. package/.output/public/_nuxt/index.CrXmf4gr.css +1 -0
  54. package/.output/public/_nuxt/ivUnXl9B.js +1 -0
  55. package/.output/public/_nuxt/pAheHeBV.js +36 -0
  56. package/.output/public/_nuxt/s5fCn4j5.js +1 -0
  57. package/.output/public/favicon.ico +0 -0
  58. package/.output/public/logo.png +0 -0
  59. package/.output/public/manifest.json +25 -0
  60. package/.output/public/robots.txt +1 -0
  61. package/.output/public/vite.svg +1 -0
  62. package/.output/server/chunks/_/error-500.mjs +8 -0
  63. package/.output/server/chunks/_/error-500.mjs.map +1 -0
  64. package/.output/server/chunks/build/client.manifest.mjs +773 -0
  65. package/.output/server/chunks/build/client.manifest.mjs.map +1 -0
  66. package/.output/server/chunks/nitro/nitro.mjs +6432 -0
  67. package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
  68. package/.output/server/chunks/routes/api/ai/chat.mjs +77 -0
  69. package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -0
  70. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +100 -0
  71. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +1 -0
  72. package/.output/server/chunks/routes/api/execute-bulk-update.mjs +105 -0
  73. package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +1 -0
  74. package/.output/server/chunks/routes/api/execute.mjs +47 -0
  75. package/.output/server/chunks/routes/api/execute.mjs.map +1 -0
  76. package/.output/server/chunks/routes/api/get-one-function.mjs +28 -0
  77. package/.output/server/chunks/routes/api/get-one-function.mjs.map +1 -0
  78. package/.output/server/chunks/routes/api/get-one-table.mjs +180 -0
  79. package/.output/server/chunks/routes/api/get-one-table.mjs.map +1 -0
  80. package/.output/server/chunks/routes/api/get-over-view-function.mjs +41 -0
  81. package/.output/server/chunks/routes/api/get-over-view-function.mjs.map +1 -0
  82. package/.output/server/chunks/routes/api/get-over-view-tables.mjs +53 -0
  83. package/.output/server/chunks/routes/api/get-over-view-tables.mjs.map +1 -0
  84. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +112 -0
  85. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +1 -0
  86. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +152 -0
  87. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +1 -0
  88. package/.output/server/chunks/routes/api/get-table-size.mjs +49 -0
  89. package/.output/server/chunks/routes/api/get-table-size.mjs.map +1 -0
  90. package/.output/server/chunks/routes/api/get-table-structure.mjs +111 -0
  91. package/.output/server/chunks/routes/api/get-table-structure.mjs.map +1 -0
  92. package/.output/server/chunks/routes/api/get-tables.mjs +287 -0
  93. package/.output/server/chunks/routes/api/get-tables.mjs.map +1 -0
  94. package/.output/server/chunks/routes/api/getMetricMonitor.mjs +46 -0
  95. package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +1 -0
  96. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +28 -0
  97. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -0
  98. package/.output/server/chunks/routes/api/raw-execute.mjs +48 -0
  99. package/.output/server/chunks/routes/api/raw-execute.mjs.map +1 -0
  100. package/.output/server/chunks/routes/renderer.mjs +316 -0
  101. package/.output/server/chunks/routes/renderer.mjs.map +1 -0
  102. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
  103. package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
  104. package/.output/server/index.mjs +14 -0
  105. package/.output/server/index.mjs.map +1 -0
  106. package/.output/server/node_modules/@ai-sdk/anthropic/dist/index.mjs +4374 -0
  107. package/.output/server/node_modules/@ai-sdk/anthropic/package.json +74 -0
  108. package/.output/server/node_modules/@ai-sdk/gateway/dist/index.mjs +1082 -0
  109. package/.output/server/node_modules/@ai-sdk/gateway/package.json +69 -0
  110. package/.output/server/node_modules/@ai-sdk/google/dist/index.mjs +2007 -0
  111. package/.output/server/node_modules/@ai-sdk/google/package.json +74 -0
  112. package/.output/server/node_modules/@ai-sdk/openai/dist/index.mjs +5956 -0
  113. package/.output/server/node_modules/@ai-sdk/openai/package.json +74 -0
  114. package/.output/server/node_modules/@ai-sdk/openai-compatible/dist/index.mjs +1551 -0
  115. package/.output/server/node_modules/@ai-sdk/openai-compatible/package.json +74 -0
  116. package/.output/server/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  117. package/.output/server/node_modules/@ai-sdk/provider/package.json +57 -0
  118. package/.output/server/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
  119. package/.output/server/node_modules/@ai-sdk/provider-utils/package.json +75 -0
  120. package/.output/server/node_modules/@ai-sdk/xai/dist/index.mjs +2214 -0
  121. package/.output/server/node_modules/@ai-sdk/xai/package.json +68 -0
  122. package/.output/server/node_modules/@babel/parser/lib/index.js +14246 -0
  123. package/.output/server/node_modules/@babel/parser/package.json +50 -0
  124. package/.output/server/node_modules/@iconify/utils/lib/colors/index.mjs +350 -0
  125. package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.mjs +188 -0
  126. package/.output/server/node_modules/@iconify/utils/lib/css/common.mjs +90 -0
  127. package/.output/server/node_modules/@iconify/utils/lib/css/format.mjs +38 -0
  128. package/.output/server/node_modules/@iconify/utils/lib/css/icon.mjs +76 -0
  129. package/.output/server/node_modules/@iconify/utils/lib/css/icons.mjs +168 -0
  130. package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.mjs +22 -0
  131. package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.mjs +14 -0
  132. package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.mjs +16 -0
  133. package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.mjs +22 -0
  134. package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.mjs +33 -0
  135. package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.mjs +51 -0
  136. package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.mjs +84 -0
  137. package/.output/server/node_modules/@iconify/utils/lib/emoji/data.mjs +16 -0
  138. package/.output/server/node_modules/@iconify/utils/lib/emoji/format.mjs +44 -0
  139. package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.mjs +58 -0
  140. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.mjs +231 -0
  141. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.mjs +31 -0
  142. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.mjs +164 -0
  143. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.mjs +216 -0
  144. package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.mjs +113 -0
  145. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.mjs +104 -0
  146. package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.mjs +34 -0
  147. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.mjs +75 -0
  148. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.mjs +97 -0
  149. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.mjs +54 -0
  150. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.mjs +97 -0
  151. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.mjs +45 -0
  152. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.mjs +105 -0
  153. package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.mjs +54 -0
  154. package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.mjs +24 -0
  155. package/.output/server/node_modules/@iconify/utils/lib/icon/merge.mjs +20 -0
  156. package/.output/server/node_modules/@iconify/utils/lib/icon/name.mjs +53 -0
  157. package/.output/server/node_modules/@iconify/utils/lib/icon/square.mjs +23 -0
  158. package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.mjs +16 -0
  159. package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.mjs +182 -0
  160. package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.mjs +22 -0
  161. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +28 -0
  162. package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.mjs +46 -0
  163. package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.mjs +66 -0
  164. package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.mjs +51 -0
  165. package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.mjs +23 -0
  166. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.mjs +62 -0
  167. package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.mjs +161 -0
  168. package/.output/server/node_modules/@iconify/utils/lib/index.mjs +64 -0
  169. package/.output/server/node_modules/@iconify/utils/lib/loader/custom.mjs +50 -0
  170. package/.output/server/node_modules/@iconify/utils/lib/loader/loader.mjs +59 -0
  171. package/.output/server/node_modules/@iconify/utils/lib/loader/modern.mjs +80 -0
  172. package/.output/server/node_modules/@iconify/utils/lib/loader/utils.mjs +92 -0
  173. package/.output/server/node_modules/@iconify/utils/lib/misc/objects.mjs +30 -0
  174. package/.output/server/node_modules/@iconify/utils/lib/misc/strings.mjs +17 -0
  175. package/.output/server/node_modules/@iconify/utils/lib/misc/title.mjs +5 -0
  176. package/.output/server/node_modules/@iconify/utils/lib/svg/build.mjs +119 -0
  177. package/.output/server/node_modules/@iconify/utils/lib/svg/defs.mjs +30 -0
  178. package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.mjs +20 -0
  179. package/.output/server/node_modules/@iconify/utils/lib/svg/html.mjs +9 -0
  180. package/.output/server/node_modules/@iconify/utils/lib/svg/id.mjs +28 -0
  181. package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.mjs +19 -0
  182. package/.output/server/node_modules/@iconify/utils/lib/svg/parse.mjs +83 -0
  183. package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.mjs +70 -0
  184. package/.output/server/node_modules/@iconify/utils/lib/svg/size.mjs +40 -0
  185. package/.output/server/node_modules/@iconify/utils/lib/svg/trim.mjs +5 -0
  186. package/.output/server/node_modules/@iconify/utils/lib/svg/url.mjs +11 -0
  187. package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.mjs +8 -0
  188. package/.output/server/node_modules/@iconify/utils/package.json +447 -0
  189. package/.output/server/node_modules/@ioredis/commands/built/commands.json +2447 -0
  190. package/.output/server/node_modules/@ioredis/commands/built/index.js +208 -0
  191. package/.output/server/node_modules/@ioredis/commands/package.json +52 -0
  192. package/.output/server/node_modules/@opentelemetry/api/build/src/api/context.js +81 -0
  193. package/.output/server/node_modules/@opentelemetry/api/build/src/api/diag.js +93 -0
  194. package/.output/server/node_modules/@opentelemetry/api/build/src/api/metrics.js +61 -0
  195. package/.output/server/node_modules/@opentelemetry/api/build/src/api/propagation.js +89 -0
  196. package/.output/server/node_modules/@opentelemetry/api/build/src/api/trace.js +79 -0
  197. package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +63 -0
  198. package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +55 -0
  199. package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +23 -0
  200. package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/utils.js +51 -0
  201. package/.output/server/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +38 -0
  202. package/.output/server/node_modules/@opentelemetry/api/build/src/context/context.js +55 -0
  203. package/.output/server/node_modules/@opentelemetry/api/build/src/context-api.js +24 -0
  204. package/.output/server/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +59 -0
  205. package/.output/server/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +57 -0
  206. package/.output/server/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +45 -0
  207. package/.output/server/node_modules/@opentelemetry/api/build/src/diag/types.js +44 -0
  208. package/.output/server/node_modules/@opentelemetry/api/build/src/diag-api.js +29 -0
  209. package/.output/server/node_modules/@opentelemetry/api/build/src/index.js +81 -0
  210. package/.output/server/node_modules/@opentelemetry/api/build/src/internal/global-utils.js +64 -0
  211. package/.output/server/node_modules/@opentelemetry/api/build/src/internal/semver.js +122 -0
  212. package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/Metric.js +25 -0
  213. package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +127 -0
  214. package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +31 -0
  215. package/.output/server/node_modules/@opentelemetry/api/build/src/metrics-api.js +24 -0
  216. package/.output/server/node_modules/@opentelemetry/api/build/src/platform/index.js +29 -0
  217. package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js +22 -0
  218. package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/index.js +29 -0
  219. package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +34 -0
  220. package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +41 -0
  221. package/.output/server/node_modules/@opentelemetry/api/build/src/propagation-api.js +24 -0
  222. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +69 -0
  223. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +75 -0
  224. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +32 -0
  225. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +55 -0
  226. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +54 -0
  227. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +42 -0
  228. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/context-utils.js +82 -0
  229. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +103 -0
  230. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +46 -0
  231. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +24 -0
  232. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +27 -0
  233. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/span_kind.js +46 -0
  234. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +49 -0
  235. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/status.js +23 -0
  236. package/.output/server/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +26 -0
  237. package/.output/server/node_modules/@opentelemetry/api/build/src/trace-api.js +24 -0
  238. package/.output/server/node_modules/@opentelemetry/api/build/src/version.js +21 -0
  239. package/.output/server/node_modules/@opentelemetry/api/package.json +113 -0
  240. package/.output/server/node_modules/@sqltools/formatter/lib/core/Formatter.js +234 -0
  241. package/.output/server/node_modules/@sqltools/formatter/lib/core/Indentation.js +42 -0
  242. package/.output/server/node_modules/@sqltools/formatter/lib/core/InlineBlock.js +60 -0
  243. package/.output/server/node_modules/@sqltools/formatter/lib/core/Params.js +21 -0
  244. package/.output/server/node_modules/@sqltools/formatter/lib/core/Tokenizer.js +272 -0
  245. package/.output/server/node_modules/@sqltools/formatter/lib/core/escapeRegExp.js +10 -0
  246. package/.output/server/node_modules/@sqltools/formatter/lib/core/last.js +7 -0
  247. package/.output/server/node_modules/@sqltools/formatter/lib/core/types.js +22 -0
  248. package/.output/server/node_modules/@sqltools/formatter/lib/languages/Db2Formatter.js +585 -0
  249. package/.output/server/node_modules/@sqltools/formatter/lib/languages/N1qlFormatter.js +257 -0
  250. package/.output/server/node_modules/@sqltools/formatter/lib/languages/PlSqlFormatter.js +459 -0
  251. package/.output/server/node_modules/@sqltools/formatter/lib/languages/StandardSqlFormatter.js +369 -0
  252. package/.output/server/node_modules/@sqltools/formatter/lib/languages/utils/abstract.js +23 -0
  253. package/.output/server/node_modules/@sqltools/formatter/lib/sqlFormatter.js +34 -0
  254. package/.output/server/node_modules/@sqltools/formatter/package.json +59 -0
  255. package/.output/server/node_modules/@standard-schema/spec/dist/index.js +0 -0
  256. package/.output/server/node_modules/@standard-schema/spec/package.json +52 -0
  257. package/.output/server/node_modules/@vercel/oidc/dist/auth-config.js +84 -0
  258. package/.output/server/node_modules/@vercel/oidc/dist/get-context.js +34 -0
  259. package/.output/server/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js +80 -0
  260. package/.output/server/node_modules/@vercel/oidc/dist/index.js +33 -0
  261. package/.output/server/node_modules/@vercel/oidc/dist/oauth.js +88 -0
  262. package/.output/server/node_modules/@vercel/oidc/dist/token-error.js +40 -0
  263. package/.output/server/node_modules/@vercel/oidc/dist/token-io.js +78 -0
  264. package/.output/server/node_modules/@vercel/oidc/dist/token-util.js +198 -0
  265. package/.output/server/node_modules/@vercel/oidc/dist/token.js +53 -0
  266. package/.output/server/node_modules/@vercel/oidc/package.json +52 -0
  267. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6690 -0
  268. package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
  269. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
  270. package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
  271. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1404 -0
  272. package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
  273. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1789 -0
  274. package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
  275. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6654 -0
  276. package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
  277. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1669 -0
  278. package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
  279. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
  280. package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
  281. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
  282. package/.output/server/node_modules/@vue/shared/package.json +47 -0
  283. package/.output/server/node_modules/ai/dist/index.mjs +12363 -0
  284. package/.output/server/node_modules/ai/package.json +106 -0
  285. package/.output/server/node_modules/ansis/index.js +1 -0
  286. package/.output/server/node_modules/ansis/package.json +28 -0
  287. package/.output/server/node_modules/app-root-path/index.js +4 -0
  288. package/.output/server/node_modules/app-root-path/lib/app-root-path.js +30 -0
  289. package/.output/server/node_modules/app-root-path/lib/resolve.js +128 -0
  290. package/.output/server/node_modules/app-root-path/package.json +66 -0
  291. package/.output/server/node_modules/balanced-match/index.js +62 -0
  292. package/.output/server/node_modules/balanced-match/package.json +48 -0
  293. package/.output/server/node_modules/bindings/bindings.js +221 -0
  294. package/.output/server/node_modules/bindings/package.json +28 -0
  295. package/.output/server/node_modules/brace-expansion/index.js +203 -0
  296. package/.output/server/node_modules/brace-expansion/package.json +46 -0
  297. package/.output/server/node_modules/cluster-key-slot/lib/index.js +166 -0
  298. package/.output/server/node_modules/cluster-key-slot/package.json +56 -0
  299. package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
  300. package/.output/server/node_modules/consola/dist/core.mjs +512 -0
  301. package/.output/server/node_modules/consola/dist/index.mjs +651 -0
  302. package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
  303. package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
  304. package/.output/server/node_modules/consola/package.json +136 -0
  305. package/.output/server/node_modules/dayjs/dayjs.min.js +1 -0
  306. package/.output/server/node_modules/dayjs/package.json +84 -0
  307. package/.output/server/node_modules/debug/package.json +65 -0
  308. package/.output/server/node_modules/debug/src/browser.js +272 -0
  309. package/.output/server/node_modules/debug/src/common.js +292 -0
  310. package/.output/server/node_modules/debug/src/index.js +10 -0
  311. package/.output/server/node_modules/debug/src/node.js +263 -0
  312. package/.output/server/node_modules/dedent/dist/dedent.js +73 -0
  313. package/.output/server/node_modules/dedent/package.json +119 -0
  314. package/.output/server/node_modules/denque/index.js +481 -0
  315. package/.output/server/node_modules/denque/package.json +58 -0
  316. package/.output/server/node_modules/devalue/index.js +3 -0
  317. package/.output/server/node_modules/devalue/package.json +34 -0
  318. package/.output/server/node_modules/devalue/src/base64.js +110 -0
  319. package/.output/server/node_modules/devalue/src/constants.js +6 -0
  320. package/.output/server/node_modules/devalue/src/parse.js +160 -0
  321. package/.output/server/node_modules/devalue/src/stringify.js +232 -0
  322. package/.output/server/node_modules/devalue/src/uneval.js +351 -0
  323. package/.output/server/node_modules/devalue/src/utils.js +113 -0
  324. package/.output/server/node_modules/dotenv/lib/main.js +361 -0
  325. package/.output/server/node_modules/dotenv/package.json +61 -0
  326. package/.output/server/node_modules/entities/lib/decode.js +536 -0
  327. package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
  328. package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
  329. package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
  330. package/.output/server/node_modules/entities/package.json +90 -0
  331. package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  332. package/.output/server/node_modules/estree-walker/package.json +37 -0
  333. package/.output/server/node_modules/eventsource-parser/dist/index.js +106 -0
  334. package/.output/server/node_modules/eventsource-parser/dist/stream.js +29 -0
  335. package/.output/server/node_modules/eventsource-parser/package.json +115 -0
  336. package/.output/server/node_modules/file-uri-to-path/index.js +66 -0
  337. package/.output/server/node_modules/file-uri-to-path/package.json +32 -0
  338. package/.output/server/node_modules/glob/dist/commonjs/glob.js +247 -0
  339. package/.output/server/node_modules/glob/dist/commonjs/has-magic.js +27 -0
  340. package/.output/server/node_modules/glob/dist/commonjs/ignore.js +119 -0
  341. package/.output/server/node_modules/glob/dist/commonjs/index.js +68 -0
  342. package/.output/server/node_modules/glob/dist/commonjs/package.json +3 -0
  343. package/.output/server/node_modules/glob/dist/commonjs/pattern.js +219 -0
  344. package/.output/server/node_modules/glob/dist/commonjs/processor.js +301 -0
  345. package/.output/server/node_modules/glob/dist/commonjs/walker.js +387 -0
  346. package/.output/server/node_modules/glob/package.json +99 -0
  347. package/.output/server/node_modules/has-flag/index.js +8 -0
  348. package/.output/server/node_modules/has-flag/package.json +46 -0
  349. package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
  350. package/.output/server/node_modules/hookable/package.json +49 -0
  351. package/.output/server/node_modules/inherits/inherits.js +9 -0
  352. package/.output/server/node_modules/inherits/inherits_browser.js +27 -0
  353. package/.output/server/node_modules/inherits/package.json +29 -0
  354. package/.output/server/node_modules/ioredis/built/Command.js +349 -0
  355. package/.output/server/node_modules/ioredis/built/DataHandler.js +220 -0
  356. package/.output/server/node_modules/ioredis/built/Pipeline.js +334 -0
  357. package/.output/server/node_modules/ioredis/built/Redis.js +697 -0
  358. package/.output/server/node_modules/ioredis/built/ScanStream.js +51 -0
  359. package/.output/server/node_modules/ioredis/built/Script.js +62 -0
  360. package/.output/server/node_modules/ioredis/built/SubscriptionSet.js +41 -0
  361. package/.output/server/node_modules/ioredis/built/autoPipelining.js +159 -0
  362. package/.output/server/node_modules/ioredis/built/cluster/ClusterOptions.js +22 -0
  363. package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriber.js +202 -0
  364. package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +224 -0
  365. package/.output/server/node_modules/ioredis/built/cluster/ConnectionPool.js +154 -0
  366. package/.output/server/node_modules/ioredis/built/cluster/DelayQueue.js +53 -0
  367. package/.output/server/node_modules/ioredis/built/cluster/index.js +862 -0
  368. package/.output/server/node_modules/ioredis/built/cluster/util.js +100 -0
  369. package/.output/server/node_modules/ioredis/built/connectors/AbstractConnector.js +26 -0
  370. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +45 -0
  371. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +37 -0
  372. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/index.js +305 -0
  373. package/.output/server/node_modules/ioredis/built/connectors/StandaloneConnector.js +69 -0
  374. package/.output/server/node_modules/ioredis/built/connectors/index.js +7 -0
  375. package/.output/server/node_modules/ioredis/built/constants/TLSProfiles.js +149 -0
  376. package/.output/server/node_modules/ioredis/built/errors/ClusterAllFailedError.js +15 -0
  377. package/.output/server/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +14 -0
  378. package/.output/server/node_modules/ioredis/built/errors/index.js +5 -0
  379. package/.output/server/node_modules/ioredis/built/index.js +62 -0
  380. package/.output/server/node_modules/ioredis/built/redis/RedisOptions.js +55 -0
  381. package/.output/server/node_modules/ioredis/built/redis/event_handler.js +292 -0
  382. package/.output/server/node_modules/ioredis/built/transaction.js +93 -0
  383. package/.output/server/node_modules/ioredis/built/utils/Commander.js +117 -0
  384. package/.output/server/node_modules/ioredis/built/utils/applyMixin.js +8 -0
  385. package/.output/server/node_modules/ioredis/built/utils/debug.js +95 -0
  386. package/.output/server/node_modules/ioredis/built/utils/index.js +297 -0
  387. package/.output/server/node_modules/ioredis/built/utils/lodash.js +9 -0
  388. package/.output/server/node_modules/ioredis/package.json +100 -0
  389. package/.output/server/node_modules/lodash.defaults/index.js +668 -0
  390. package/.output/server/node_modules/lodash.defaults/package.json +19 -0
  391. package/.output/server/node_modules/lodash.isarguments/index.js +229 -0
  392. package/.output/server/node_modules/lodash.isarguments/package.json +19 -0
  393. package/.output/server/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
  394. package/.output/server/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  395. package/.output/server/node_modules/lru-cache/package.json +116 -0
  396. package/.output/server/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  397. package/.output/server/node_modules/minimatch/dist/commonjs/ast.js +592 -0
  398. package/.output/server/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
  399. package/.output/server/node_modules/minimatch/dist/commonjs/escape.js +22 -0
  400. package/.output/server/node_modules/minimatch/dist/commonjs/index.js +1017 -0
  401. package/.output/server/node_modules/minimatch/dist/commonjs/package.json +3 -0
  402. package/.output/server/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
  403. package/.output/server/node_modules/minimatch/package.json +82 -0
  404. package/.output/server/node_modules/minipass/dist/commonjs/index.js +1028 -0
  405. package/.output/server/node_modules/minipass/dist/commonjs/package.json +3 -0
  406. package/.output/server/node_modules/minipass/package.json +82 -0
  407. package/.output/server/node_modules/ms/index.js +162 -0
  408. package/.output/server/node_modules/ms/package.json +38 -0
  409. package/.output/server/node_modules/path-scurry/dist/commonjs/index.js +2014 -0
  410. package/.output/server/node_modules/path-scurry/dist/commonjs/package.json +3 -0
  411. package/.output/server/node_modules/path-scurry/package.json +89 -0
  412. package/.output/server/node_modules/pg/lib/client.js +650 -0
  413. package/.output/server/node_modules/pg/lib/connection-parameters.js +167 -0
  414. package/.output/server/node_modules/pg/lib/connection.js +222 -0
  415. package/.output/server/node_modules/pg/lib/crypto/cert-signatures.js +121 -0
  416. package/.output/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  417. package/.output/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  418. package/.output/server/node_modules/pg/lib/crypto/utils-webcrypto.js +88 -0
  419. package/.output/server/node_modules/pg/lib/crypto/utils.js +9 -0
  420. package/.output/server/node_modules/pg/lib/defaults.js +84 -0
  421. package/.output/server/node_modules/pg/lib/index.js +58 -0
  422. package/.output/server/node_modules/pg/lib/native/client.js +307 -0
  423. package/.output/server/node_modules/pg/lib/native/index.js +2 -0
  424. package/.output/server/node_modules/pg/lib/native/query.js +168 -0
  425. package/.output/server/node_modules/pg/lib/query.js +253 -0
  426. package/.output/server/node_modules/pg/lib/result.js +108 -0
  427. package/.output/server/node_modules/pg/lib/stream.js +81 -0
  428. package/.output/server/node_modules/pg/lib/type-overrides.js +35 -0
  429. package/.output/server/node_modules/pg/lib/utils.js +206 -0
  430. package/.output/server/node_modules/pg/package.json +62 -0
  431. package/.output/server/node_modules/pg-cloudflare/dist/empty.js +4 -0
  432. package/.output/server/node_modules/pg-cloudflare/package.json +32 -0
  433. package/.output/server/node_modules/pg-connection-string/index.js +112 -0
  434. package/.output/server/node_modules/pg-connection-string/package.json +40 -0
  435. package/.output/server/node_modules/pg-cursor/index.js +265 -0
  436. package/.output/server/node_modules/pg-cursor/package.json +38 -0
  437. package/.output/server/node_modules/pg-int8/index.js +100 -0
  438. package/.output/server/node_modules/pg-int8/package.json +24 -0
  439. package/.output/server/node_modules/pg-pool/index.js +471 -0
  440. package/.output/server/node_modules/pg-pool/package.json +41 -0
  441. package/.output/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
  442. package/.output/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
  443. package/.output/server/node_modules/pg-protocol/dist/index.js +15 -0
  444. package/.output/server/node_modules/pg-protocol/dist/messages.js +160 -0
  445. package/.output/server/node_modules/pg-protocol/dist/parser.js +304 -0
  446. package/.output/server/node_modules/pg-protocol/dist/serializer.js +189 -0
  447. package/.output/server/node_modules/pg-protocol/package.json +35 -0
  448. package/.output/server/node_modules/pg-query-stream/dist/index.js +48 -0
  449. package/.output/server/node_modules/pg-query-stream/package.json +60 -0
  450. package/.output/server/node_modules/pg-types/index.js +47 -0
  451. package/.output/server/node_modules/pg-types/lib/arrayParser.js +11 -0
  452. package/.output/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
  453. package/.output/server/node_modules/pg-types/lib/builtins.js +73 -0
  454. package/.output/server/node_modules/pg-types/lib/textParsers.js +215 -0
  455. package/.output/server/node_modules/pg-types/package.json +42 -0
  456. package/.output/server/node_modules/pgpass/lib/helper.js +233 -0
  457. package/.output/server/node_modules/pgpass/lib/index.js +23 -0
  458. package/.output/server/node_modules/pgpass/package.json +41 -0
  459. package/.output/server/node_modules/postgres-array/index.js +97 -0
  460. package/.output/server/node_modules/postgres-array/package.json +35 -0
  461. package/.output/server/node_modules/postgres-bytea/index.js +31 -0
  462. package/.output/server/node_modules/postgres-bytea/package.json +34 -0
  463. package/.output/server/node_modules/postgres-date/index.js +116 -0
  464. package/.output/server/node_modules/postgres-date/package.json +33 -0
  465. package/.output/server/node_modules/postgres-interval/index.js +125 -0
  466. package/.output/server/node_modules/postgres-interval/package.json +36 -0
  467. package/.output/server/node_modules/redis-errors/index.js +7 -0
  468. package/.output/server/node_modules/redis-errors/lib/modern.js +59 -0
  469. package/.output/server/node_modules/redis-errors/lib/old.js +119 -0
  470. package/.output/server/node_modules/redis-errors/package.json +41 -0
  471. package/.output/server/node_modules/redis-parser/index.js +3 -0
  472. package/.output/server/node_modules/redis-parser/lib/parser.js +552 -0
  473. package/.output/server/node_modules/redis-parser/package.json +53 -0
  474. package/.output/server/node_modules/reflect-metadata/Reflect.js +1415 -0
  475. package/.output/server/node_modules/reflect-metadata/package.json +68 -0
  476. package/.output/server/node_modules/safe-buffer/index.js +65 -0
  477. package/.output/server/node_modules/safe-buffer/package.json +51 -0
  478. package/.output/server/node_modules/sha.js/hash.js +81 -0
  479. package/.output/server/node_modules/sha.js/index.js +15 -0
  480. package/.output/server/node_modules/sha.js/package.json +30 -0
  481. package/.output/server/node_modules/sha.js/sha.js +94 -0
  482. package/.output/server/node_modules/sha.js/sha1.js +99 -0
  483. package/.output/server/node_modules/sha.js/sha224.js +53 -0
  484. package/.output/server/node_modules/sha.js/sha256.js +135 -0
  485. package/.output/server/node_modules/sha.js/sha384.js +57 -0
  486. package/.output/server/node_modules/sha.js/sha512.js +260 -0
  487. package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
  488. package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  489. package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
  490. package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
  491. package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
  492. package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
  493. package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  494. package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  495. package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
  496. package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
  497. package/.output/server/node_modules/source-map-js/package.json +71 -0
  498. package/.output/server/node_modules/source-map-js/source-map.js +8 -0
  499. package/.output/server/node_modules/split2/index.js +141 -0
  500. package/.output/server/node_modules/split2/package.json +39 -0
  501. package/.output/server/node_modules/sql-highlight/lib/escapeHtml.js +59 -0
  502. package/.output/server/node_modules/sql-highlight/lib/index.js +85 -0
  503. package/.output/server/node_modules/sql-highlight/lib/keywords.js +145 -0
  504. package/.output/server/node_modules/sql-highlight/package.json +49 -0
  505. package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node +0 -0
  506. package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node.bak +0 -0
  507. package/.output/server/node_modules/sqlite3/lib/sqlite3-binding.js +1 -0
  508. package/.output/server/node_modules/sqlite3/lib/sqlite3.js +207 -0
  509. package/.output/server/node_modules/sqlite3/lib/trace.js +38 -0
  510. package/.output/server/node_modules/sqlite3/package.json +89 -0
  511. package/.output/server/node_modules/standard-as-callback/built/index.js +41 -0
  512. package/.output/server/node_modules/standard-as-callback/built/utils.js +23 -0
  513. package/.output/server/node_modules/standard-as-callback/package.json +40 -0
  514. package/.output/server/node_modules/supports-color/index.js +152 -0
  515. package/.output/server/node_modules/supports-color/package.json +58 -0
  516. package/.output/server/node_modules/tslib/package.json +47 -0
  517. package/.output/server/node_modules/tslib/tslib.js +484 -0
  518. package/.output/server/node_modules/typeorm/cache/DbQueryResultCache.js +264 -0
  519. package/.output/server/node_modules/typeorm/cache/QueryResultCacheFactory.js +42 -0
  520. package/.output/server/node_modules/typeorm/cache/RedisQueryResultCache.js +197 -0
  521. package/.output/server/node_modules/typeorm/common/DeepPartial.js +4 -0
  522. package/.output/server/node_modules/typeorm/common/EntityTarget.js +4 -0
  523. package/.output/server/node_modules/typeorm/common/MixedList.js +4 -0
  524. package/.output/server/node_modules/typeorm/common/ObjectLiteral.js +4 -0
  525. package/.output/server/node_modules/typeorm/common/ObjectType.js +4 -0
  526. package/.output/server/node_modules/typeorm/common/RelationType.js +4 -0
  527. package/.output/server/node_modules/typeorm/connection/Connection.js +16 -0
  528. package/.output/server/node_modules/typeorm/connection/ConnectionManager.js +66 -0
  529. package/.output/server/node_modules/typeorm/connection/ConnectionMetadataBuilder.js +74 -0
  530. package/.output/server/node_modules/typeorm/connection/ConnectionOptionsReader.js +198 -0
  531. package/.output/server/node_modules/typeorm/connection/options-reader/ConnectionOptionsEnvReader.js +111 -0
  532. package/.output/server/node_modules/typeorm/container.js +60 -0
  533. package/.output/server/node_modules/typeorm/data-source/DataSource.js +517 -0
  534. package/.output/server/node_modules/typeorm/decorator/Check.js +27 -0
  535. package/.output/server/node_modules/typeorm/decorator/EntityRepository.js +21 -0
  536. package/.output/server/node_modules/typeorm/decorator/Exclusion.js +27 -0
  537. package/.output/server/node_modules/typeorm/decorator/ForeignKey.js +44 -0
  538. package/.output/server/node_modules/typeorm/decorator/Generated.js +24 -0
  539. package/.output/server/node_modules/typeorm/decorator/Index.js +56 -0
  540. package/.output/server/node_modules/typeorm/decorator/Unique.js +50 -0
  541. package/.output/server/node_modules/typeorm/decorator/columns/Column.js +78 -0
  542. package/.output/server/node_modules/typeorm/decorator/columns/CreateDateColumn.js +21 -0
  543. package/.output/server/node_modules/typeorm/decorator/columns/DeleteDateColumn.js +20 -0
  544. package/.output/server/node_modules/typeorm/decorator/columns/ObjectIdColumn.js +27 -0
  545. package/.output/server/node_modules/typeorm/decorator/columns/PrimaryColumn.js +63 -0
  546. package/.output/server/node_modules/typeorm/decorator/columns/PrimaryGeneratedColumn.js +59 -0
  547. package/.output/server/node_modules/typeorm/decorator/columns/UpdateDateColumn.js +20 -0
  548. package/.output/server/node_modules/typeorm/decorator/columns/VersionColumn.js +21 -0
  549. package/.output/server/node_modules/typeorm/decorator/columns/ViewColumn.js +19 -0
  550. package/.output/server/node_modules/typeorm/decorator/columns/VirtualColumn.js +49 -0
  551. package/.output/server/node_modules/typeorm/decorator/entity/ChildEntity.js +25 -0
  552. package/.output/server/node_modules/typeorm/decorator/entity/Entity.js +31 -0
  553. package/.output/server/node_modules/typeorm/decorator/entity/TableInheritance.js +22 -0
  554. package/.output/server/node_modules/typeorm/decorator/entity-view/ViewEntity.js +32 -0
  555. package/.output/server/node_modules/typeorm/decorator/listeners/AfterInsert.js +19 -0
  556. package/.output/server/node_modules/typeorm/decorator/listeners/AfterLoad.js +19 -0
  557. package/.output/server/node_modules/typeorm/decorator/listeners/AfterRecover.js +19 -0
  558. package/.output/server/node_modules/typeorm/decorator/listeners/AfterRemove.js +19 -0
  559. package/.output/server/node_modules/typeorm/decorator/listeners/AfterSoftRemove.js +19 -0
  560. package/.output/server/node_modules/typeorm/decorator/listeners/AfterUpdate.js +19 -0
  561. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeInsert.js +19 -0
  562. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRecover.js +19 -0
  563. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRemove.js +19 -0
  564. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeSoftRemove.js +19 -0
  565. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeUpdate.js +19 -0
  566. package/.output/server/node_modules/typeorm/decorator/listeners/EventSubscriber.js +17 -0
  567. package/.output/server/node_modules/typeorm/decorator/options/ColumnOptions.js +4 -0
  568. package/.output/server/node_modules/typeorm/decorator/options/EntityOptions.js +4 -0
  569. package/.output/server/node_modules/typeorm/decorator/options/IndexOptions.js +4 -0
  570. package/.output/server/node_modules/typeorm/decorator/options/JoinColumnOptions.js +4 -0
  571. package/.output/server/node_modules/typeorm/decorator/options/JoinTableOptions.js +4 -0
  572. package/.output/server/node_modules/typeorm/decorator/options/RelationOptions.js +4 -0
  573. package/.output/server/node_modules/typeorm/decorator/options/ValueTransformer.js +4 -0
  574. package/.output/server/node_modules/typeorm/decorator/relations/JoinColumn.js +27 -0
  575. package/.output/server/node_modules/typeorm/decorator/relations/JoinTable.js +34 -0
  576. package/.output/server/node_modules/typeorm/decorator/relations/ManyToMany.js +46 -0
  577. package/.output/server/node_modules/typeorm/decorator/relations/ManyToOne.js +46 -0
  578. package/.output/server/node_modules/typeorm/decorator/relations/OneToMany.js +37 -0
  579. package/.output/server/node_modules/typeorm/decorator/relations/OneToOne.js +45 -0
  580. package/.output/server/node_modules/typeorm/decorator/relations/RelationCount.js +23 -0
  581. package/.output/server/node_modules/typeorm/decorator/relations/RelationId.js +22 -0
  582. package/.output/server/node_modules/typeorm/decorator/tree/Tree.js +21 -0
  583. package/.output/server/node_modules/typeorm/decorator/tree/TreeChildren.js +34 -0
  584. package/.output/server/node_modules/typeorm/decorator/tree/TreeLevelColumn.js +19 -0
  585. package/.output/server/node_modules/typeorm/decorator/tree/TreeParent.js +33 -0
  586. package/.output/server/node_modules/typeorm/driver/DriverFactory.js +98 -0
  587. package/.output/server/node_modules/typeorm/driver/DriverUtils.js +228 -0
  588. package/.output/server/node_modules/typeorm/driver/Query.js +16 -0
  589. package/.output/server/node_modules/typeorm/driver/SqlInMemory.js +15 -0
  590. package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlDriver.js +847 -0
  591. package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlQueryRunner.js +1709 -0
  592. package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresDriver.js +103 -0
  593. package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresQueryRunner.js +146 -0
  594. package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js +153 -0
  595. package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js +126 -0
  596. package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorDriver.js +78 -0
  597. package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorQueryRunner.js +98 -0
  598. package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachDriver.js +885 -0
  599. package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachQueryRunner.js +2453 -0
  600. package/.output/server/node_modules/typeorm/driver/cordova/CordovaDriver.js +76 -0
  601. package/.output/server/node_modules/typeorm/driver/cordova/CordovaQueryRunner.js +170 -0
  602. package/.output/server/node_modules/typeorm/driver/expo/ExpoDriver.js +29 -0
  603. package/.output/server/node_modules/typeorm/driver/expo/ExpoDriverFactory.js +22 -0
  604. package/.output/server/node_modules/typeorm/driver/expo/ExpoQueryRunner.js +65 -0
  605. package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyDriver.js +75 -0
  606. package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyQueryRunner.js +169 -0
  607. package/.output/server/node_modules/typeorm/driver/mongodb/MongoDriver.js +404 -0
  608. package/.output/server/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js +701 -0
  609. package/.output/server/node_modules/typeorm/driver/mongodb/bson.typings.js +5 -0
  610. package/.output/server/node_modules/typeorm/driver/mongodb/typings.js +23 -0
  611. package/.output/server/node_modules/typeorm/driver/mysql/MysqlDriver.js +1105 -0
  612. package/.output/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js +2139 -0
  613. package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptDriver.js +94 -0
  614. package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptQueryRunner.js +92 -0
  615. package/.output/server/node_modules/typeorm/driver/oracle/OracleDriver.js +869 -0
  616. package/.output/server/node_modules/typeorm/driver/oracle/OracleQueryRunner.js +1884 -0
  617. package/.output/server/node_modules/typeorm/driver/postgres/PostgresDriver.js +1259 -0
  618. package/.output/server/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js +2729 -0
  619. package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeDriver.js +728 -0
  620. package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeQueryRunner.js +107 -0
  621. package/.output/server/node_modules/typeorm/driver/sap/SapDriver.js +681 -0
  622. package/.output/server/node_modules/typeorm/driver/sap/SapQueryRunner.js +2054 -0
  623. package/.output/server/node_modules/typeorm/driver/spanner/SpannerDriver.js +613 -0
  624. package/.output/server/node_modules/typeorm/driver/spanner/SpannerQueryRunner.js +1464 -0
  625. package/.output/server/node_modules/typeorm/driver/sqlite/SqliteDriver.js +174 -0
  626. package/.output/server/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js +124 -0
  627. package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteDriver.js +695 -0
  628. package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +1511 -0
  629. package/.output/server/node_modules/typeorm/driver/sqljs/SqljsDriver.js +250 -0
  630. package/.output/server/node_modules/typeorm/driver/sqljs/SqljsQueryRunner.js +123 -0
  631. package/.output/server/node_modules/typeorm/driver/sqlserver/MssqlParameter.js +23 -0
  632. package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerDriver.js +922 -0
  633. package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerQueryRunner.js +2484 -0
  634. package/.output/server/node_modules/typeorm/driver/types/DatabaseType.js +4 -0
  635. package/.output/server/node_modules/typeorm/driver/types/GeoJsonTypes.js +4 -0
  636. package/.output/server/node_modules/typeorm/driver/types/MetadataTableType.js +11 -0
  637. package/.output/server/node_modules/typeorm/driver/types/ReplicationMode.js +4 -0
  638. package/.output/server/node_modules/typeorm/entity-manager/EntityManager.js +853 -0
  639. package/.output/server/node_modules/typeorm/entity-manager/EntityManagerFactory.js +24 -0
  640. package/.output/server/node_modules/typeorm/entity-manager/MongoEntityManager.js +668 -0
  641. package/.output/server/node_modules/typeorm/entity-manager/SqljsEntityManager.js +44 -0
  642. package/.output/server/node_modules/typeorm/entity-schema/EntitySchema.js +15 -0
  643. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js +8 -0
  644. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedError.js +18 -0
  645. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaOptions.js +11 -0
  646. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaTransformer.js +333 -0
  647. package/.output/server/node_modules/typeorm/error/AlreadyHasActiveConnectionError.js +16 -0
  648. package/.output/server/node_modules/typeorm/error/CannotAttachTreeChildrenEntityError.js +16 -0
  649. package/.output/server/node_modules/typeorm/error/CannotConnectAlreadyConnectedError.js +15 -0
  650. package/.output/server/node_modules/typeorm/error/CannotCreateEntityIdMapError.js +21 -0
  651. package/.output/server/node_modules/typeorm/error/CannotDetermineEntityError.js +16 -0
  652. package/.output/server/node_modules/typeorm/error/CannotExecuteNotConnectedError.js +15 -0
  653. package/.output/server/node_modules/typeorm/error/CannotGetEntityManagerNotConnectedError.js +15 -0
  654. package/.output/server/node_modules/typeorm/error/CannotReflectMethodParameterTypeError.js +18 -0
  655. package/.output/server/node_modules/typeorm/error/CircularRelationsError.js +16 -0
  656. package/.output/server/node_modules/typeorm/error/ColumnTypeUndefinedError.js +19 -0
  657. package/.output/server/node_modules/typeorm/error/ConnectionIsNotSetError.js +15 -0
  658. package/.output/server/node_modules/typeorm/error/ConnectionNotFoundError.js +15 -0
  659. package/.output/server/node_modules/typeorm/error/CustomRepositoryCannotInheritRepositoryError.js +18 -0
  660. package/.output/server/node_modules/typeorm/error/CustomRepositoryDoesNotHaveEntityError.js +18 -0
  661. package/.output/server/node_modules/typeorm/error/CustomRepositoryNotFoundError.js +18 -0
  662. package/.output/server/node_modules/typeorm/error/DataTypeNotSupportedError.js +14 -0
  663. package/.output/server/node_modules/typeorm/error/DriverOptionNotSetError.js +16 -0
  664. package/.output/server/node_modules/typeorm/error/DriverPackageNotInstalledError.js +16 -0
  665. package/.output/server/node_modules/typeorm/error/EntityMetadataNotFoundError.js +29 -0
  666. package/.output/server/node_modules/typeorm/error/EntityNotFoundError.js +42 -0
  667. package/.output/server/node_modules/typeorm/error/EntityPropertyNotFoundError.js +17 -0
  668. package/.output/server/node_modules/typeorm/error/FindRelationsNotFoundError.js +23 -0
  669. package/.output/server/node_modules/typeorm/error/ForbiddenTransactionModeOverrideError.js +16 -0
  670. package/.output/server/node_modules/typeorm/error/InitializedRelationError.js +20 -0
  671. package/.output/server/node_modules/typeorm/error/InsertValuesMissingError.js +16 -0
  672. package/.output/server/node_modules/typeorm/error/LimitOnUpdateNotSupportedError.js +15 -0
  673. package/.output/server/node_modules/typeorm/error/LockNotSupportedOnGivenDriverError.js +15 -0
  674. package/.output/server/node_modules/typeorm/error/MetadataAlreadyExistsError.js +18 -0
  675. package/.output/server/node_modules/typeorm/error/MetadataWithSuchNameAlreadyExistsError.js +16 -0
  676. package/.output/server/node_modules/typeorm/error/MissingDeleteDateColumnError.js +12 -0
  677. package/.output/server/node_modules/typeorm/error/MissingDriverError.js +16 -0
  678. package/.output/server/node_modules/typeorm/error/MissingJoinColumnError.js +23 -0
  679. package/.output/server/node_modules/typeorm/error/MissingJoinTableError.js +23 -0
  680. package/.output/server/node_modules/typeorm/error/MissingPrimaryColumnError.js +13 -0
  681. package/.output/server/node_modules/typeorm/error/MustBeEntityError.js +15 -0
  682. package/.output/server/node_modules/typeorm/error/NestedSetMultipleRootError.js +12 -0
  683. package/.output/server/node_modules/typeorm/error/NoConnectionForRepositoryError.js +16 -0
  684. package/.output/server/node_modules/typeorm/error/NoConnectionOptionError.js +16 -0
  685. package/.output/server/node_modules/typeorm/error/NoNeedToReleaseEntityManagerError.js +17 -0
  686. package/.output/server/node_modules/typeorm/error/NoVersionOrUpdateDateColumnError.js +15 -0
  687. package/.output/server/node_modules/typeorm/error/OffsetWithoutLimitNotSupportedError.js +17 -0
  688. package/.output/server/node_modules/typeorm/error/OptimisticLockCanNotBeUsedError.js +15 -0
  689. package/.output/server/node_modules/typeorm/error/OptimisticLockVersionMismatchError.js +15 -0
  690. package/.output/server/node_modules/typeorm/error/PersistedEntityNotFoundError.js +15 -0
  691. package/.output/server/node_modules/typeorm/error/PessimisticLockTransactionRequiredError.js +15 -0
  692. package/.output/server/node_modules/typeorm/error/PrimaryColumnCannotBeNullableError.js +13 -0
  693. package/.output/server/node_modules/typeorm/error/QueryFailedError.js +30 -0
  694. package/.output/server/node_modules/typeorm/error/QueryRunnerAlreadyReleasedError.js +12 -0
  695. package/.output/server/node_modules/typeorm/error/QueryRunnerProviderAlreadyReleasedError.js +16 -0
  696. package/.output/server/node_modules/typeorm/error/RepositoryNotTreeError.js +32 -0
  697. package/.output/server/node_modules/typeorm/error/ReturningStatementNotSupportedError.js +16 -0
  698. package/.output/server/node_modules/typeorm/error/SubjectRemovedAndUpdatedError.js +16 -0
  699. package/.output/server/node_modules/typeorm/error/SubjectWithoutIdentifierError.js +17 -0
  700. package/.output/server/node_modules/typeorm/error/TransactionAlreadyStartedError.js +15 -0
  701. package/.output/server/node_modules/typeorm/error/TransactionNotStartedError.js +15 -0
  702. package/.output/server/node_modules/typeorm/error/TreeRepositoryNotSupportedError.js +12 -0
  703. package/.output/server/node_modules/typeorm/error/TypeORMError.js +23 -0
  704. package/.output/server/node_modules/typeorm/error/UpdateValuesMissingError.js +12 -0
  705. package/.output/server/node_modules/typeorm/error/UsingJoinColumnIsNotAllowedError.js +13 -0
  706. package/.output/server/node_modules/typeorm/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +14 -0
  707. package/.output/server/node_modules/typeorm/error/UsingJoinTableIsNotAllowedError.js +14 -0
  708. package/.output/server/node_modules/typeorm/error/UsingJoinTableOnlyOnOneSideAllowedError.js +14 -0
  709. package/.output/server/node_modules/typeorm/error/index.js +66 -0
  710. package/.output/server/node_modules/typeorm/find-options/EqualOperator.js +13 -0
  711. package/.output/server/node_modules/typeorm/find-options/FindManyOptions.js +4 -0
  712. package/.output/server/node_modules/typeorm/find-options/FindOneOptions.js +4 -0
  713. package/.output/server/node_modules/typeorm/find-options/FindOperator.js +96 -0
  714. package/.output/server/node_modules/typeorm/find-options/FindOperatorType.js +4 -0
  715. package/.output/server/node_modules/typeorm/find-options/FindOptionsOrder.js +4 -0
  716. package/.output/server/node_modules/typeorm/find-options/FindOptionsRelations.js +4 -0
  717. package/.output/server/node_modules/typeorm/find-options/FindOptionsSelect.js +4 -0
  718. package/.output/server/node_modules/typeorm/find-options/FindOptionsUtils.js +350 -0
  719. package/.output/server/node_modules/typeorm/find-options/FindOptionsWhere.js +4 -0
  720. package/.output/server/node_modules/typeorm/find-options/FindTreeOptions.js +4 -0
  721. package/.output/server/node_modules/typeorm/find-options/JoinOptions.js +4 -0
  722. package/.output/server/node_modules/typeorm/find-options/OrderByCondition.js +4 -0
  723. package/.output/server/node_modules/typeorm/find-options/operator/And.js +9 -0
  724. package/.output/server/node_modules/typeorm/find-options/operator/Any.js +13 -0
  725. package/.output/server/node_modules/typeorm/find-options/operator/ArrayContainedBy.js +13 -0
  726. package/.output/server/node_modules/typeorm/find-options/operator/ArrayContains.js +13 -0
  727. package/.output/server/node_modules/typeorm/find-options/operator/ArrayOverlap.js +13 -0
  728. package/.output/server/node_modules/typeorm/find-options/operator/Between.js +13 -0
  729. package/.output/server/node_modules/typeorm/find-options/operator/Equal.js +17 -0
  730. package/.output/server/node_modules/typeorm/find-options/operator/ILike.js +13 -0
  731. package/.output/server/node_modules/typeorm/find-options/operator/In.js +13 -0
  732. package/.output/server/node_modules/typeorm/find-options/operator/IsNull.js +13 -0
  733. package/.output/server/node_modules/typeorm/find-options/operator/JsonContains.js +13 -0
  734. package/.output/server/node_modules/typeorm/find-options/operator/LessThan.js +13 -0
  735. package/.output/server/node_modules/typeorm/find-options/operator/LessThanOrEqual.js +13 -0
  736. package/.output/server/node_modules/typeorm/find-options/operator/Like.js +13 -0
  737. package/.output/server/node_modules/typeorm/find-options/operator/MoreThan.js +13 -0
  738. package/.output/server/node_modules/typeorm/find-options/operator/MoreThanOrEqual.js +13 -0
  739. package/.output/server/node_modules/typeorm/find-options/operator/Not.js +14 -0
  740. package/.output/server/node_modules/typeorm/find-options/operator/Or.js +9 -0
  741. package/.output/server/node_modules/typeorm/find-options/operator/Raw.js +12 -0
  742. package/.output/server/node_modules/typeorm/globals.js +182 -0
  743. package/.output/server/node_modules/typeorm/index.js +196 -0
  744. package/.output/server/node_modules/typeorm/index.mjs +422 -0
  745. package/.output/server/node_modules/typeorm/logger/AbstractLogger.js +238 -0
  746. package/.output/server/node_modules/typeorm/logger/AdvancedConsoleLogger.js +56 -0
  747. package/.output/server/node_modules/typeorm/logger/DebugLogger.js +78 -0
  748. package/.output/server/node_modules/typeorm/logger/FileLogger.js +88 -0
  749. package/.output/server/node_modules/typeorm/logger/FormattedConsoleLogger.js +59 -0
  750. package/.output/server/node_modules/typeorm/logger/Logger.js +4 -0
  751. package/.output/server/node_modules/typeorm/logger/LoggerFactory.js +39 -0
  752. package/.output/server/node_modules/typeorm/logger/LoggerOptions.js +4 -0
  753. package/.output/server/node_modules/typeorm/logger/SimpleConsoleLogger.js +57 -0
  754. package/.output/server/node_modules/typeorm/metadata/CheckMetadata.js +35 -0
  755. package/.output/server/node_modules/typeorm/metadata/ColumnMetadata.js +618 -0
  756. package/.output/server/node_modules/typeorm/metadata/EmbeddedMetadata.js +224 -0
  757. package/.output/server/node_modules/typeorm/metadata/EntityListenerMetadata.js +77 -0
  758. package/.output/server/node_modules/typeorm/metadata/EntityMetadata.js +692 -0
  759. package/.output/server/node_modules/typeorm/metadata/ExclusionMetadata.js +35 -0
  760. package/.output/server/node_modules/typeorm/metadata/ForeignKeyMetadata.js +57 -0
  761. package/.output/server/node_modules/typeorm/metadata/IndexMetadata.js +144 -0
  762. package/.output/server/node_modules/typeorm/metadata/RelationCountMetadata.js +39 -0
  763. package/.output/server/node_modules/typeorm/metadata/RelationIdMetadata.js +62 -0
  764. package/.output/server/node_modules/typeorm/metadata/RelationMetadata.js +440 -0
  765. package/.output/server/node_modules/typeorm/metadata/UniqueMetadata.js +101 -0
  766. package/.output/server/node_modules/typeorm/metadata/types/EventListenerTypes.js +22 -0
  767. package/.output/server/node_modules/typeorm/metadata-args/MetadataArgsStorage.js +236 -0
  768. package/.output/server/node_modules/typeorm/metadata-builder/ClosureJunctionEntityMetadataBuilder.js +145 -0
  769. package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataBuilder.js +838 -0
  770. package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataValidator.js +258 -0
  771. package/.output/server/node_modules/typeorm/metadata-builder/JunctionEntityMetadataBuilder.js +287 -0
  772. package/.output/server/node_modules/typeorm/metadata-builder/MetadataUtils.js +44 -0
  773. package/.output/server/node_modules/typeorm/metadata-builder/RelationJoinColumnBuilder.js +185 -0
  774. package/.output/server/node_modules/typeorm/migration/Migration.js +21 -0
  775. package/.output/server/node_modules/typeorm/migration/MigrationExecutor.js +534 -0
  776. package/.output/server/node_modules/typeorm/naming-strategy/DefaultNamingStrategy.js +145 -0
  777. package/.output/server/node_modules/typeorm/naming-strategy/LegacyOracleNamingStrategy.js +50 -0
  778. package/.output/server/node_modules/typeorm/package.json +268 -0
  779. package/.output/server/node_modules/typeorm/persistence/EntityPersistExecutor.js +170 -0
  780. package/.output/server/node_modules/typeorm/persistence/Subject.js +239 -0
  781. package/.output/server/node_modules/typeorm/persistence/SubjectChangedColumnsComputer.js +216 -0
  782. package/.output/server/node_modules/typeorm/persistence/SubjectDatabaseEntityLoader.js +135 -0
  783. package/.output/server/node_modules/typeorm/persistence/SubjectExecutor.js +760 -0
  784. package/.output/server/node_modules/typeorm/persistence/SubjectTopologicalSorter.js +174 -0
  785. package/.output/server/node_modules/typeorm/persistence/subject-builder/CascadesSubjectBuilder.js +107 -0
  786. package/.output/server/node_modules/typeorm/persistence/subject-builder/ManyToManySubjectBuilder.js +218 -0
  787. package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js +181 -0
  788. package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +155 -0
  789. package/.output/server/node_modules/typeorm/persistence/tree/ClosureSubjectExecutor.js +241 -0
  790. package/.output/server/node_modules/typeorm/persistence/tree/MaterializedPathSubjectExecutor.js +125 -0
  791. package/.output/server/node_modules/typeorm/persistence/tree/NestedSetSubjectExecutor.js +271 -0
  792. package/.output/server/node_modules/typeorm/platform/PlatformTools.js +243 -0
  793. package/.output/server/node_modules/typeorm/query-builder/Alias.js +29 -0
  794. package/.output/server/node_modules/typeorm/query-builder/Brackets.js +19 -0
  795. package/.output/server/node_modules/typeorm/query-builder/DeleteQueryBuilder.js +200 -0
  796. package/.output/server/node_modules/typeorm/query-builder/InsertQueryBuilder.js +745 -0
  797. package/.output/server/node_modules/typeorm/query-builder/JoinAttribute.js +175 -0
  798. package/.output/server/node_modules/typeorm/query-builder/NotBrackets.js +17 -0
  799. package/.output/server/node_modules/typeorm/query-builder/QueryBuilder.js +1139 -0
  800. package/.output/server/node_modules/typeorm/query-builder/QueryBuilderUtils.js +32 -0
  801. package/.output/server/node_modules/typeorm/query-builder/QueryExpressionMap.js +328 -0
  802. package/.output/server/node_modules/typeorm/query-builder/RelationIdLoader.js +503 -0
  803. package/.output/server/node_modules/typeorm/query-builder/RelationLoader.js +283 -0
  804. package/.output/server/node_modules/typeorm/query-builder/RelationQueryBuilder.js +155 -0
  805. package/.output/server/node_modules/typeorm/query-builder/RelationRemover.js +143 -0
  806. package/.output/server/node_modules/typeorm/query-builder/RelationUpdater.js +152 -0
  807. package/.output/server/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js +176 -0
  808. package/.output/server/node_modules/typeorm/query-builder/SelectQueryBuilder.js +2656 -0
  809. package/.output/server/node_modules/typeorm/query-builder/SoftDeleteQueryBuilder.js +368 -0
  810. package/.output/server/node_modules/typeorm/query-builder/UpdateQueryBuilder.js +498 -0
  811. package/.output/server/node_modules/typeorm/query-builder/index.js +20 -0
  812. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountAttribute.js +80 -0
  813. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountLoader.js +168 -0
  814. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountMetadataToAttributeTransformer.js +55 -0
  815. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdAttribute.js +88 -0
  816. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdLoader.js +275 -0
  817. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdMetadataToAttributeTransformer.js +55 -0
  818. package/.output/server/node_modules/typeorm/query-builder/result/DeleteResult.js +17 -0
  819. package/.output/server/node_modules/typeorm/query-builder/result/InsertResult.js +28 -0
  820. package/.output/server/node_modules/typeorm/query-builder/result/UpdateResult.js +29 -0
  821. package/.output/server/node_modules/typeorm/query-builder/transformer/DocumentToEntityTransformer.js +196 -0
  822. package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +112 -0
  823. package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToNewEntityTransformer.js +92 -0
  824. package/.output/server/node_modules/typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js +447 -0
  825. package/.output/server/node_modules/typeorm/query-runner/BaseQueryRunner.js +454 -0
  826. package/.output/server/node_modules/typeorm/query-runner/QueryLock.js +28 -0
  827. package/.output/server/node_modules/typeorm/query-runner/QueryResult.js +17 -0
  828. package/.output/server/node_modules/typeorm/repository/AbstractRepository.js +92 -0
  829. package/.output/server/node_modules/typeorm/repository/BaseEntity.js +328 -0
  830. package/.output/server/node_modules/typeorm/repository/MongoRepository.js +305 -0
  831. package/.output/server/node_modules/typeorm/repository/RemoveOptions.js +4 -0
  832. package/.output/server/node_modules/typeorm/repository/Repository.js +379 -0
  833. package/.output/server/node_modules/typeorm/repository/SaveOptions.js +4 -0
  834. package/.output/server/node_modules/typeorm/repository/TreeRepository.js +255 -0
  835. package/.output/server/node_modules/typeorm/schema-builder/MongoSchemaBuilder.js +66 -0
  836. package/.output/server/node_modules/typeorm/schema-builder/RdbmsSchemaBuilder.js +929 -0
  837. package/.output/server/node_modules/typeorm/schema-builder/options/TableCheckOptions.js +4 -0
  838. package/.output/server/node_modules/typeorm/schema-builder/options/TableColumnOptions.js +4 -0
  839. package/.output/server/node_modules/typeorm/schema-builder/options/TableExclusionOptions.js +4 -0
  840. package/.output/server/node_modules/typeorm/schema-builder/options/TableForeignKeyOptions.js +4 -0
  841. package/.output/server/node_modules/typeorm/schema-builder/options/TableIndexOptions.js +4 -0
  842. package/.output/server/node_modules/typeorm/schema-builder/options/TableOptions.js +4 -0
  843. package/.output/server/node_modules/typeorm/schema-builder/options/TableUniqueOptions.js +4 -0
  844. package/.output/server/node_modules/typeorm/schema-builder/options/ViewOptions.js +4 -0
  845. package/.output/server/node_modules/typeorm/schema-builder/table/Table.js +296 -0
  846. package/.output/server/node_modules/typeorm/schema-builder/table/TableCheck.js +49 -0
  847. package/.output/server/node_modules/typeorm/schema-builder/table/TableColumn.js +117 -0
  848. package/.output/server/node_modules/typeorm/schema-builder/table/TableExclusion.js +43 -0
  849. package/.output/server/node_modules/typeorm/schema-builder/table/TableForeignKey.js +72 -0
  850. package/.output/server/node_modules/typeorm/schema-builder/table/TableIndex.js +68 -0
  851. package/.output/server/node_modules/typeorm/schema-builder/table/TableUnique.js +50 -0
  852. package/.output/server/node_modules/typeorm/schema-builder/util/TableUtils.js +41 -0
  853. package/.output/server/node_modules/typeorm/schema-builder/util/ViewUtils.js +27 -0
  854. package/.output/server/node_modules/typeorm/schema-builder/view/View.js +71 -0
  855. package/.output/server/node_modules/typeorm/subscriber/Broadcaster.js +660 -0
  856. package/.output/server/node_modules/typeorm/subscriber/BroadcasterResult.js +30 -0
  857. package/.output/server/node_modules/typeorm/subscriber/event/QueryEvent.js +4 -0
  858. package/.output/server/node_modules/typeorm/util/ApplyValueTransformers.js +25 -0
  859. package/.output/server/node_modules/typeorm/util/DateUtils.js +229 -0
  860. package/.output/server/node_modules/typeorm/util/DepGraph.js +230 -0
  861. package/.output/server/node_modules/typeorm/util/DirectoryExportedClassesLoader.js +65 -0
  862. package/.output/server/node_modules/typeorm/util/ImportUtils.js +66 -0
  863. package/.output/server/node_modules/typeorm/util/InstanceChecker.js +104 -0
  864. package/.output/server/node_modules/typeorm/util/ObjectUtils.js +49 -0
  865. package/.output/server/node_modules/typeorm/util/OrmUtils.js +443 -0
  866. package/.output/server/node_modules/typeorm/util/PathUtils.js +33 -0
  867. package/.output/server/node_modules/typeorm/util/RandomGenerator.js +154 -0
  868. package/.output/server/node_modules/typeorm/util/SqlTagUtils.js +43 -0
  869. package/.output/server/node_modules/typeorm/util/StringUtils.js +113 -0
  870. package/.output/server/node_modules/typeorm/util/TreeRepositoryUtils.js +67 -0
  871. package/.output/server/node_modules/typeorm/util/VersionUtils.js +27 -0
  872. package/.output/server/node_modules/typeorm/util/escapeRegExp.js +10 -0
  873. package/.output/server/node_modules/ufo/dist/index.mjs +630 -0
  874. package/.output/server/node_modules/ufo/package.json +47 -0
  875. package/.output/server/node_modules/unhead/dist/plugins.mjs +94 -0
  876. package/.output/server/node_modules/unhead/dist/server.mjs +220 -0
  877. package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +48 -0
  878. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
  879. package/.output/server/node_modules/unhead/dist/shared/unhead.Cp0iF6eN.mjs +177 -0
  880. package/.output/server/node_modules/unhead/dist/shared/unhead.DGkFBTYv.mjs +172 -0
  881. package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
  882. package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +70 -0
  883. package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +166 -0
  884. package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
  885. package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
  886. package/.output/server/node_modules/unhead/package.json +101 -0
  887. package/.output/server/node_modules/uuid/dist/cjs/index.js +31 -0
  888. package/.output/server/node_modules/uuid/dist/cjs/max.js +3 -0
  889. package/.output/server/node_modules/uuid/dist/cjs/md5.js +13 -0
  890. package/.output/server/node_modules/uuid/dist/cjs/native.js +4 -0
  891. package/.output/server/node_modules/uuid/dist/cjs/nil.js +3 -0
  892. package/.output/server/node_modules/uuid/dist/cjs/package.json +1 -0
  893. package/.output/server/node_modules/uuid/dist/cjs/parse.js +11 -0
  894. package/.output/server/node_modules/uuid/dist/cjs/regex.js +3 -0
  895. package/.output/server/node_modules/uuid/dist/cjs/rng.js +13 -0
  896. package/.output/server/node_modules/uuid/dist/cjs/sha1.js +13 -0
  897. package/.output/server/node_modules/uuid/dist/cjs/stringify.js +39 -0
  898. package/.output/server/node_modules/uuid/dist/cjs/v1.js +87 -0
  899. package/.output/server/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
  900. package/.output/server/node_modules/uuid/dist/cjs/v3.js +14 -0
  901. package/.output/server/node_modules/uuid/dist/cjs/v35.js +41 -0
  902. package/.output/server/node_modules/uuid/dist/cjs/v4.js +29 -0
  903. package/.output/server/node_modules/uuid/dist/cjs/v5.js +14 -0
  904. package/.output/server/node_modules/uuid/dist/cjs/v6.js +19 -0
  905. package/.output/server/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
  906. package/.output/server/node_modules/uuid/dist/cjs/v7.js +69 -0
  907. package/.output/server/node_modules/uuid/dist/cjs/validate.js +7 -0
  908. package/.output/server/node_modules/uuid/dist/cjs/version.js +10 -0
  909. package/.output/server/node_modules/uuid/package.json +132 -0
  910. package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
  911. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  912. package/.output/server/node_modules/vue/index.js +7 -0
  913. package/.output/server/node_modules/vue/index.mjs +1 -0
  914. package/.output/server/node_modules/vue/package.json +112 -0
  915. package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
  916. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
  917. package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
  918. package/.output/server/node_modules/xtend/mutable.js +17 -0
  919. package/.output/server/node_modules/xtend/package.json +55 -0
  920. package/.output/server/node_modules/zod/index.js +4 -0
  921. package/.output/server/node_modules/zod/package.json +135 -0
  922. package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
  923. package/.output/server/node_modules/zod/v3/errors.js +9 -0
  924. package/.output/server/node_modules/zod/v3/external.js +6 -0
  925. package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  926. package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  927. package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  928. package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
  929. package/.output/server/node_modules/zod/v3/index.js +4 -0
  930. package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
  931. package/.output/server/node_modules/zod/v3/package.json +6 -0
  932. package/.output/server/node_modules/zod/v3/types.js +3695 -0
  933. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
  934. package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
  935. package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
  936. package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
  937. package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
  938. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
  939. package/.output/server/node_modules/zod/v4/classic/index.js +4 -0
  940. package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
  941. package/.output/server/node_modules/zod/v4/classic/package.json +6 -0
  942. package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
  943. package/.output/server/node_modules/zod/v4/classic/schemas.js +1157 -0
  944. package/.output/server/node_modules/zod/v4/core/api.js +1082 -0
  945. package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
  946. package/.output/server/node_modules/zod/v4/core/core.js +76 -0
  947. package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
  948. package/.output/server/node_modules/zod/v4/core/errors.js +182 -0
  949. package/.output/server/node_modules/zod/v4/core/index.js +16 -0
  950. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  951. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
  952. package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
  953. package/.output/server/node_modules/zod/v4/core/package.json +6 -0
  954. package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
  955. package/.output/server/node_modules/zod/v4/core/regexes.js +133 -0
  956. package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
  957. package/.output/server/node_modules/zod/v4/core/schemas.js +2095 -0
  958. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +437 -0
  959. package/.output/server/node_modules/zod/v4/core/util.js +651 -0
  960. package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
  961. package/.output/server/node_modules/zod/v4/index.js +3 -0
  962. package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
  963. package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
  964. package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
  965. package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
  966. package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
  967. package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
  968. package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
  969. package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
  970. package/.output/server/node_modules/zod/v4/locales/en.js +109 -0
  971. package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
  972. package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
  973. package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
  974. package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
  975. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
  976. package/.output/server/node_modules/zod/v4/locales/fr.js +108 -0
  977. package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
  978. package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
  979. package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
  980. package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
  981. package/.output/server/node_modules/zod/v4/locales/index.js +49 -0
  982. package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
  983. package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
  984. package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
  985. package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
  986. package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
  987. package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
  988. package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
  989. package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
  990. package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
  991. package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
  992. package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
  993. package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
  994. package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
  995. package/.output/server/node_modules/zod/v4/locales/package.json +6 -0
  996. package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
  997. package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
  998. package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
  999. package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
  1000. package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
  1001. package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
  1002. package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
  1003. package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
  1004. package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
  1005. package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
  1006. package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
  1007. package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
  1008. package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
  1009. package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
  1010. package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
  1011. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
  1012. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
  1013. package/.output/server/node_modules/zod/v4/package.json +6 -0
  1014. package/.output/server/package.json +95 -0
  1015. package/README.md +46 -0
  1016. package/bin/cli.mjs +113 -0
  1017. package/bin/entry.cjs +84 -0
  1018. package/package.json +48 -0
@@ -0,0 +1,2214 @@
1
+ // src/xai-provider.ts
2
+ import {
3
+ OpenAICompatibleImageModel
4
+ } from "@ai-sdk/openai-compatible";
5
+ import {
6
+ NoSuchModelError
7
+ } from "@ai-sdk/provider";
8
+ import {
9
+ generateId,
10
+ loadApiKey,
11
+ withoutTrailingSlash,
12
+ withUserAgentSuffix
13
+ } from "@ai-sdk/provider-utils";
14
+
15
+ // src/xai-chat-language-model.ts
16
+ import {
17
+ APICallError
18
+ } from "@ai-sdk/provider";
19
+ import {
20
+ combineHeaders,
21
+ createEventSourceResponseHandler,
22
+ createJsonResponseHandler,
23
+ extractResponseHeaders,
24
+ parseProviderOptions,
25
+ postJsonToApi,
26
+ safeParseJSON
27
+ } from "@ai-sdk/provider-utils";
28
+ import { z as z3 } from "zod/v4";
29
+
30
+ // src/convert-to-xai-chat-messages.ts
31
+ import {
32
+ UnsupportedFunctionalityError
33
+ } from "@ai-sdk/provider";
34
+ import { convertToBase64 } from "@ai-sdk/provider-utils";
35
+ function convertToXaiChatMessages(prompt) {
36
+ var _a;
37
+ const messages = [];
38
+ const warnings = [];
39
+ for (const { role, content } of prompt) {
40
+ switch (role) {
41
+ case "system": {
42
+ messages.push({ role: "system", content });
43
+ break;
44
+ }
45
+ case "user": {
46
+ if (content.length === 1 && content[0].type === "text") {
47
+ messages.push({ role: "user", content: content[0].text });
48
+ break;
49
+ }
50
+ messages.push({
51
+ role: "user",
52
+ content: content.map((part) => {
53
+ switch (part.type) {
54
+ case "text": {
55
+ return { type: "text", text: part.text };
56
+ }
57
+ case "file": {
58
+ if (part.mediaType.startsWith("image/")) {
59
+ const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
60
+ return {
61
+ type: "image_url",
62
+ image_url: {
63
+ url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`
64
+ }
65
+ };
66
+ } else {
67
+ throw new UnsupportedFunctionalityError({
68
+ functionality: `file part media type ${part.mediaType}`
69
+ });
70
+ }
71
+ }
72
+ }
73
+ })
74
+ });
75
+ break;
76
+ }
77
+ case "assistant": {
78
+ let text = "";
79
+ const toolCalls = [];
80
+ for (const part of content) {
81
+ switch (part.type) {
82
+ case "text": {
83
+ text += part.text;
84
+ break;
85
+ }
86
+ case "tool-call": {
87
+ toolCalls.push({
88
+ id: part.toolCallId,
89
+ type: "function",
90
+ function: {
91
+ name: part.toolName,
92
+ arguments: JSON.stringify(part.input)
93
+ }
94
+ });
95
+ break;
96
+ }
97
+ }
98
+ }
99
+ messages.push({
100
+ role: "assistant",
101
+ content: text,
102
+ tool_calls: toolCalls.length > 0 ? toolCalls : void 0
103
+ });
104
+ break;
105
+ }
106
+ case "tool": {
107
+ for (const toolResponse of content) {
108
+ if (toolResponse.type === "tool-approval-response") {
109
+ continue;
110
+ }
111
+ const output = toolResponse.output;
112
+ let contentValue;
113
+ switch (output.type) {
114
+ case "text":
115
+ case "error-text":
116
+ contentValue = output.value;
117
+ break;
118
+ case "execution-denied":
119
+ contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
120
+ break;
121
+ case "content":
122
+ case "json":
123
+ case "error-json":
124
+ contentValue = JSON.stringify(output.value);
125
+ break;
126
+ }
127
+ messages.push({
128
+ role: "tool",
129
+ tool_call_id: toolResponse.toolCallId,
130
+ content: contentValue
131
+ });
132
+ }
133
+ break;
134
+ }
135
+ default: {
136
+ const _exhaustiveCheck = role;
137
+ throw new Error(`Unsupported role: ${_exhaustiveCheck}`);
138
+ }
139
+ }
140
+ }
141
+ return { messages, warnings };
142
+ }
143
+
144
+ // src/convert-xai-chat-usage.ts
145
+ function convertXaiChatUsage(usage) {
146
+ var _a, _b, _c, _d;
147
+ const cacheReadTokens = (_b = (_a = usage.prompt_tokens_details) == null ? void 0 : _a.cached_tokens) != null ? _b : 0;
148
+ const reasoningTokens = (_d = (_c = usage.completion_tokens_details) == null ? void 0 : _c.reasoning_tokens) != null ? _d : 0;
149
+ return {
150
+ inputTokens: {
151
+ total: usage.prompt_tokens,
152
+ noCache: usage.prompt_tokens - cacheReadTokens,
153
+ cacheRead: cacheReadTokens,
154
+ cacheWrite: void 0
155
+ },
156
+ outputTokens: {
157
+ total: usage.completion_tokens,
158
+ text: usage.completion_tokens - reasoningTokens,
159
+ reasoning: reasoningTokens
160
+ },
161
+ raw: usage
162
+ };
163
+ }
164
+
165
+ // src/get-response-metadata.ts
166
+ function getResponseMetadata({
167
+ id,
168
+ model,
169
+ created,
170
+ created_at
171
+ }) {
172
+ const unixTime = created != null ? created : created_at;
173
+ return {
174
+ id: id != null ? id : void 0,
175
+ modelId: model != null ? model : void 0,
176
+ timestamp: unixTime != null ? new Date(unixTime * 1e3) : void 0
177
+ };
178
+ }
179
+
180
+ // src/map-xai-finish-reason.ts
181
+ function mapXaiFinishReason(finishReason) {
182
+ switch (finishReason) {
183
+ case "stop":
184
+ return "stop";
185
+ case "length":
186
+ return "length";
187
+ case "tool_calls":
188
+ case "function_call":
189
+ return "tool-calls";
190
+ case "content_filter":
191
+ return "content-filter";
192
+ default:
193
+ return "other";
194
+ }
195
+ }
196
+
197
+ // src/xai-chat-options.ts
198
+ import { z } from "zod/v4";
199
+ var webSourceSchema = z.object({
200
+ type: z.literal("web"),
201
+ country: z.string().length(2).optional(),
202
+ excludedWebsites: z.array(z.string()).max(5).optional(),
203
+ allowedWebsites: z.array(z.string()).max(5).optional(),
204
+ safeSearch: z.boolean().optional()
205
+ });
206
+ var xSourceSchema = z.object({
207
+ type: z.literal("x"),
208
+ excludedXHandles: z.array(z.string()).optional(),
209
+ includedXHandles: z.array(z.string()).optional(),
210
+ postFavoriteCount: z.number().int().optional(),
211
+ postViewCount: z.number().int().optional(),
212
+ /**
213
+ * @deprecated use `includedXHandles` instead
214
+ */
215
+ xHandles: z.array(z.string()).optional()
216
+ });
217
+ var newsSourceSchema = z.object({
218
+ type: z.literal("news"),
219
+ country: z.string().length(2).optional(),
220
+ excludedWebsites: z.array(z.string()).max(5).optional(),
221
+ safeSearch: z.boolean().optional()
222
+ });
223
+ var rssSourceSchema = z.object({
224
+ type: z.literal("rss"),
225
+ links: z.array(z.string().url()).max(1)
226
+ // currently only supports one RSS link
227
+ });
228
+ var searchSourceSchema = z.discriminatedUnion("type", [
229
+ webSourceSchema,
230
+ xSourceSchema,
231
+ newsSourceSchema,
232
+ rssSourceSchema
233
+ ]);
234
+ var xaiProviderOptions = z.object({
235
+ reasoningEffort: z.enum(["low", "high"]).optional(),
236
+ /**
237
+ * Whether to enable parallel function calling during tool use.
238
+ * When true, the model can call multiple functions in parallel.
239
+ * When false, the model will call functions sequentially.
240
+ * Defaults to true.
241
+ */
242
+ parallel_function_calling: z.boolean().optional(),
243
+ searchParameters: z.object({
244
+ /**
245
+ * search mode preference
246
+ * - "off": disables search completely
247
+ * - "auto": model decides whether to search (default)
248
+ * - "on": always enables search
249
+ */
250
+ mode: z.enum(["off", "auto", "on"]),
251
+ /**
252
+ * whether to return citations in the response
253
+ * defaults to true
254
+ */
255
+ returnCitations: z.boolean().optional(),
256
+ /**
257
+ * start date for search data (ISO8601 format: YYYY-MM-DD)
258
+ */
259
+ fromDate: z.string().optional(),
260
+ /**
261
+ * end date for search data (ISO8601 format: YYYY-MM-DD)
262
+ */
263
+ toDate: z.string().optional(),
264
+ /**
265
+ * maximum number of search results to consider
266
+ * defaults to 20
267
+ */
268
+ maxSearchResults: z.number().min(1).max(50).optional(),
269
+ /**
270
+ * data sources to search from.
271
+ * defaults to [{ type: 'web' }, { type: 'x' }] if not specified.
272
+ *
273
+ * @example
274
+ * sources: [{ type: 'web', country: 'US' }, { type: 'x' }]
275
+ */
276
+ sources: z.array(searchSourceSchema).optional()
277
+ }).optional()
278
+ });
279
+
280
+ // src/xai-error.ts
281
+ import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
282
+ import { z as z2 } from "zod/v4";
283
+ var xaiErrorDataSchema = z2.object({
284
+ error: z2.object({
285
+ message: z2.string(),
286
+ type: z2.string().nullish(),
287
+ param: z2.any().nullish(),
288
+ code: z2.union([z2.string(), z2.number()]).nullish()
289
+ })
290
+ });
291
+ var xaiFailedResponseHandler = createJsonErrorResponseHandler({
292
+ errorSchema: xaiErrorDataSchema,
293
+ errorToMessage: (data) => data.error.message
294
+ });
295
+
296
+ // src/xai-prepare-tools.ts
297
+ import {
298
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError2
299
+ } from "@ai-sdk/provider";
300
+ function prepareTools({
301
+ tools,
302
+ toolChoice
303
+ }) {
304
+ tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
305
+ const toolWarnings = [];
306
+ if (tools == null) {
307
+ return { tools: void 0, toolChoice: void 0, toolWarnings };
308
+ }
309
+ const xaiTools2 = [];
310
+ for (const tool of tools) {
311
+ if (tool.type === "provider") {
312
+ toolWarnings.push({
313
+ type: "unsupported",
314
+ feature: `provider-defined tool ${tool.name}`
315
+ });
316
+ } else {
317
+ xaiTools2.push({
318
+ type: "function",
319
+ function: {
320
+ name: tool.name,
321
+ description: tool.description,
322
+ parameters: tool.inputSchema
323
+ }
324
+ });
325
+ }
326
+ }
327
+ if (toolChoice == null) {
328
+ return { tools: xaiTools2, toolChoice: void 0, toolWarnings };
329
+ }
330
+ const type = toolChoice.type;
331
+ switch (type) {
332
+ case "auto":
333
+ case "none":
334
+ return { tools: xaiTools2, toolChoice: type, toolWarnings };
335
+ case "required":
336
+ return { tools: xaiTools2, toolChoice: "required", toolWarnings };
337
+ case "tool":
338
+ return {
339
+ tools: xaiTools2,
340
+ toolChoice: {
341
+ type: "function",
342
+ function: { name: toolChoice.toolName }
343
+ },
344
+ toolWarnings
345
+ };
346
+ default: {
347
+ const _exhaustiveCheck = type;
348
+ throw new UnsupportedFunctionalityError2({
349
+ functionality: `tool choice type: ${_exhaustiveCheck}`
350
+ });
351
+ }
352
+ }
353
+ }
354
+
355
+ // src/xai-chat-language-model.ts
356
+ var XaiChatLanguageModel = class {
357
+ constructor(modelId, config) {
358
+ this.specificationVersion = "v3";
359
+ this.supportedUrls = {
360
+ "image/*": [/^https?:\/\/.*$/]
361
+ };
362
+ this.modelId = modelId;
363
+ this.config = config;
364
+ }
365
+ get provider() {
366
+ return this.config.provider;
367
+ }
368
+ async getArgs({
369
+ prompt,
370
+ maxOutputTokens,
371
+ temperature,
372
+ topP,
373
+ topK,
374
+ frequencyPenalty,
375
+ presencePenalty,
376
+ stopSequences,
377
+ seed,
378
+ responseFormat,
379
+ providerOptions,
380
+ tools,
381
+ toolChoice
382
+ }) {
383
+ var _a, _b, _c;
384
+ const warnings = [];
385
+ const options = (_a = await parseProviderOptions({
386
+ provider: "xai",
387
+ providerOptions,
388
+ schema: xaiProviderOptions
389
+ })) != null ? _a : {};
390
+ if (topK != null) {
391
+ warnings.push({ type: "unsupported", feature: "topK" });
392
+ }
393
+ if (frequencyPenalty != null) {
394
+ warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
395
+ }
396
+ if (presencePenalty != null) {
397
+ warnings.push({ type: "unsupported", feature: "presencePenalty" });
398
+ }
399
+ if (stopSequences != null) {
400
+ warnings.push({ type: "unsupported", feature: "stopSequences" });
401
+ }
402
+ const { messages, warnings: messageWarnings } = convertToXaiChatMessages(prompt);
403
+ warnings.push(...messageWarnings);
404
+ const {
405
+ tools: xaiTools2,
406
+ toolChoice: xaiToolChoice,
407
+ toolWarnings
408
+ } = prepareTools({
409
+ tools,
410
+ toolChoice
411
+ });
412
+ warnings.push(...toolWarnings);
413
+ const baseArgs = {
414
+ // model id
415
+ model: this.modelId,
416
+ // standard generation settings
417
+ max_completion_tokens: maxOutputTokens,
418
+ temperature,
419
+ top_p: topP,
420
+ seed,
421
+ reasoning_effort: options.reasoningEffort,
422
+ // parallel function calling
423
+ parallel_function_calling: options.parallel_function_calling,
424
+ // response format
425
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
426
+ type: "json_schema",
427
+ json_schema: {
428
+ name: (_b = responseFormat.name) != null ? _b : "response",
429
+ schema: responseFormat.schema,
430
+ strict: true
431
+ }
432
+ } : { type: "json_object" } : void 0,
433
+ // search parameters
434
+ search_parameters: options.searchParameters ? {
435
+ mode: options.searchParameters.mode,
436
+ return_citations: options.searchParameters.returnCitations,
437
+ from_date: options.searchParameters.fromDate,
438
+ to_date: options.searchParameters.toDate,
439
+ max_search_results: options.searchParameters.maxSearchResults,
440
+ sources: (_c = options.searchParameters.sources) == null ? void 0 : _c.map((source) => {
441
+ var _a2;
442
+ return {
443
+ type: source.type,
444
+ ...source.type === "web" && {
445
+ country: source.country,
446
+ excluded_websites: source.excludedWebsites,
447
+ allowed_websites: source.allowedWebsites,
448
+ safe_search: source.safeSearch
449
+ },
450
+ ...source.type === "x" && {
451
+ excluded_x_handles: source.excludedXHandles,
452
+ included_x_handles: (_a2 = source.includedXHandles) != null ? _a2 : source.xHandles,
453
+ post_favorite_count: source.postFavoriteCount,
454
+ post_view_count: source.postViewCount
455
+ },
456
+ ...source.type === "news" && {
457
+ country: source.country,
458
+ excluded_websites: source.excludedWebsites,
459
+ safe_search: source.safeSearch
460
+ },
461
+ ...source.type === "rss" && {
462
+ links: source.links
463
+ }
464
+ };
465
+ })
466
+ } : void 0,
467
+ // messages in xai format
468
+ messages,
469
+ // tools in xai format
470
+ tools: xaiTools2,
471
+ tool_choice: xaiToolChoice
472
+ };
473
+ return {
474
+ args: baseArgs,
475
+ warnings
476
+ };
477
+ }
478
+ async doGenerate(options) {
479
+ var _a, _b;
480
+ const { args: body, warnings } = await this.getArgs(options);
481
+ const url = `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/chat/completions`;
482
+ const {
483
+ responseHeaders,
484
+ value: response,
485
+ rawValue: rawResponse
486
+ } = await postJsonToApi({
487
+ url,
488
+ headers: combineHeaders(this.config.headers(), options.headers),
489
+ body,
490
+ failedResponseHandler: xaiFailedResponseHandler,
491
+ successfulResponseHandler: createJsonResponseHandler(
492
+ xaiChatResponseSchema
493
+ ),
494
+ abortSignal: options.abortSignal,
495
+ fetch: this.config.fetch
496
+ });
497
+ if (response.error != null) {
498
+ throw new APICallError({
499
+ message: response.error,
500
+ url,
501
+ requestBodyValues: body,
502
+ statusCode: 200,
503
+ responseHeaders,
504
+ responseBody: JSON.stringify(rawResponse),
505
+ isRetryable: response.code === "The service is currently unavailable"
506
+ });
507
+ }
508
+ const choice = response.choices[0];
509
+ const content = [];
510
+ if (choice.message.content != null && choice.message.content.length > 0) {
511
+ let text = choice.message.content;
512
+ const lastMessage = body.messages[body.messages.length - 1];
513
+ if ((lastMessage == null ? void 0 : lastMessage.role) === "assistant" && text === lastMessage.content) {
514
+ text = "";
515
+ }
516
+ if (text.length > 0) {
517
+ content.push({ type: "text", text });
518
+ }
519
+ }
520
+ if (choice.message.reasoning_content != null && choice.message.reasoning_content.length > 0) {
521
+ content.push({
522
+ type: "reasoning",
523
+ text: choice.message.reasoning_content
524
+ });
525
+ }
526
+ if (choice.message.tool_calls != null) {
527
+ for (const toolCall of choice.message.tool_calls) {
528
+ content.push({
529
+ type: "tool-call",
530
+ toolCallId: toolCall.id,
531
+ toolName: toolCall.function.name,
532
+ input: toolCall.function.arguments
533
+ });
534
+ }
535
+ }
536
+ if (response.citations != null) {
537
+ for (const url2 of response.citations) {
538
+ content.push({
539
+ type: "source",
540
+ sourceType: "url",
541
+ id: this.config.generateId(),
542
+ url: url2
543
+ });
544
+ }
545
+ }
546
+ return {
547
+ content,
548
+ finishReason: {
549
+ unified: mapXaiFinishReason(choice.finish_reason),
550
+ raw: (_b = choice.finish_reason) != null ? _b : void 0
551
+ },
552
+ usage: convertXaiChatUsage(response.usage),
553
+ // defined when there is no error
554
+ request: { body },
555
+ response: {
556
+ ...getResponseMetadata(response),
557
+ headers: responseHeaders,
558
+ body: rawResponse
559
+ },
560
+ warnings
561
+ };
562
+ }
563
+ async doStream(options) {
564
+ var _a;
565
+ const { args, warnings } = await this.getArgs(options);
566
+ const body = {
567
+ ...args,
568
+ stream: true,
569
+ stream_options: {
570
+ include_usage: true
571
+ }
572
+ };
573
+ const url = `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/chat/completions`;
574
+ const { responseHeaders, value: response } = await postJsonToApi({
575
+ url,
576
+ headers: combineHeaders(this.config.headers(), options.headers),
577
+ body,
578
+ failedResponseHandler: xaiFailedResponseHandler,
579
+ successfulResponseHandler: async ({ response: response2 }) => {
580
+ const responseHeaders2 = extractResponseHeaders(response2);
581
+ const contentType = response2.headers.get("content-type");
582
+ if (contentType == null ? void 0 : contentType.includes("application/json")) {
583
+ const responseBody = await response2.text();
584
+ const parsedError = await safeParseJSON({
585
+ text: responseBody,
586
+ schema: xaiStreamErrorSchema
587
+ });
588
+ if (parsedError.success) {
589
+ throw new APICallError({
590
+ message: parsedError.value.error,
591
+ url,
592
+ requestBodyValues: body,
593
+ statusCode: 200,
594
+ responseHeaders: responseHeaders2,
595
+ responseBody,
596
+ isRetryable: parsedError.value.code === "The service is currently unavailable"
597
+ });
598
+ }
599
+ throw new APICallError({
600
+ message: "Invalid JSON response",
601
+ url,
602
+ requestBodyValues: body,
603
+ statusCode: 200,
604
+ responseHeaders: responseHeaders2,
605
+ responseBody
606
+ });
607
+ }
608
+ return createEventSourceResponseHandler(xaiChatChunkSchema)({
609
+ response: response2,
610
+ url,
611
+ requestBodyValues: body
612
+ });
613
+ },
614
+ abortSignal: options.abortSignal,
615
+ fetch: this.config.fetch
616
+ });
617
+ let finishReason = {
618
+ unified: "other",
619
+ raw: void 0
620
+ };
621
+ let usage = void 0;
622
+ let isFirstChunk = true;
623
+ const contentBlocks = {};
624
+ const lastReasoningDeltas = {};
625
+ let activeReasoningBlockId = void 0;
626
+ const self = this;
627
+ return {
628
+ stream: response.pipeThrough(
629
+ new TransformStream({
630
+ start(controller) {
631
+ controller.enqueue({ type: "stream-start", warnings });
632
+ },
633
+ transform(chunk, controller) {
634
+ if (options.includeRawChunks) {
635
+ controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
636
+ }
637
+ if (!chunk.success) {
638
+ controller.enqueue({ type: "error", error: chunk.error });
639
+ return;
640
+ }
641
+ const value = chunk.value;
642
+ if (isFirstChunk) {
643
+ controller.enqueue({
644
+ type: "response-metadata",
645
+ ...getResponseMetadata(value)
646
+ });
647
+ isFirstChunk = false;
648
+ }
649
+ if (value.citations != null) {
650
+ for (const url2 of value.citations) {
651
+ controller.enqueue({
652
+ type: "source",
653
+ sourceType: "url",
654
+ id: self.config.generateId(),
655
+ url: url2
656
+ });
657
+ }
658
+ }
659
+ if (value.usage != null) {
660
+ usage = convertXaiChatUsage(value.usage);
661
+ }
662
+ const choice = value.choices[0];
663
+ if ((choice == null ? void 0 : choice.finish_reason) != null) {
664
+ finishReason = {
665
+ unified: mapXaiFinishReason(choice.finish_reason),
666
+ raw: choice.finish_reason
667
+ };
668
+ }
669
+ if ((choice == null ? void 0 : choice.delta) == null) {
670
+ return;
671
+ }
672
+ const delta = choice.delta;
673
+ const choiceIndex = choice.index;
674
+ if (delta.content != null && delta.content.length > 0) {
675
+ const textContent = delta.content;
676
+ if (activeReasoningBlockId != null && !contentBlocks[activeReasoningBlockId].ended) {
677
+ controller.enqueue({
678
+ type: "reasoning-end",
679
+ id: activeReasoningBlockId
680
+ });
681
+ contentBlocks[activeReasoningBlockId].ended = true;
682
+ activeReasoningBlockId = void 0;
683
+ }
684
+ const lastMessage = body.messages[body.messages.length - 1];
685
+ if ((lastMessage == null ? void 0 : lastMessage.role) === "assistant" && textContent === lastMessage.content) {
686
+ return;
687
+ }
688
+ const blockId = `text-${value.id || choiceIndex}`;
689
+ if (contentBlocks[blockId] == null) {
690
+ contentBlocks[blockId] = { type: "text", ended: false };
691
+ controller.enqueue({
692
+ type: "text-start",
693
+ id: blockId
694
+ });
695
+ }
696
+ controller.enqueue({
697
+ type: "text-delta",
698
+ id: blockId,
699
+ delta: textContent
700
+ });
701
+ }
702
+ if (delta.reasoning_content != null && delta.reasoning_content.length > 0) {
703
+ const blockId = `reasoning-${value.id || choiceIndex}`;
704
+ if (lastReasoningDeltas[blockId] === delta.reasoning_content) {
705
+ return;
706
+ }
707
+ lastReasoningDeltas[blockId] = delta.reasoning_content;
708
+ if (contentBlocks[blockId] == null) {
709
+ contentBlocks[blockId] = { type: "reasoning", ended: false };
710
+ activeReasoningBlockId = blockId;
711
+ controller.enqueue({
712
+ type: "reasoning-start",
713
+ id: blockId
714
+ });
715
+ }
716
+ controller.enqueue({
717
+ type: "reasoning-delta",
718
+ id: blockId,
719
+ delta: delta.reasoning_content
720
+ });
721
+ }
722
+ if (delta.tool_calls != null) {
723
+ if (activeReasoningBlockId != null && !contentBlocks[activeReasoningBlockId].ended) {
724
+ controller.enqueue({
725
+ type: "reasoning-end",
726
+ id: activeReasoningBlockId
727
+ });
728
+ contentBlocks[activeReasoningBlockId].ended = true;
729
+ activeReasoningBlockId = void 0;
730
+ }
731
+ for (const toolCall of delta.tool_calls) {
732
+ const toolCallId = toolCall.id;
733
+ controller.enqueue({
734
+ type: "tool-input-start",
735
+ id: toolCallId,
736
+ toolName: toolCall.function.name
737
+ });
738
+ controller.enqueue({
739
+ type: "tool-input-delta",
740
+ id: toolCallId,
741
+ delta: toolCall.function.arguments
742
+ });
743
+ controller.enqueue({
744
+ type: "tool-input-end",
745
+ id: toolCallId
746
+ });
747
+ controller.enqueue({
748
+ type: "tool-call",
749
+ toolCallId,
750
+ toolName: toolCall.function.name,
751
+ input: toolCall.function.arguments
752
+ });
753
+ }
754
+ }
755
+ },
756
+ flush(controller) {
757
+ for (const [blockId, block] of Object.entries(contentBlocks)) {
758
+ if (!block.ended) {
759
+ controller.enqueue({
760
+ type: block.type === "text" ? "text-end" : "reasoning-end",
761
+ id: blockId
762
+ });
763
+ }
764
+ }
765
+ controller.enqueue({ type: "finish", finishReason, usage });
766
+ }
767
+ })
768
+ ),
769
+ request: { body },
770
+ response: { headers: responseHeaders }
771
+ };
772
+ }
773
+ };
774
+ var xaiUsageSchema = z3.object({
775
+ prompt_tokens: z3.number(),
776
+ completion_tokens: z3.number(),
777
+ total_tokens: z3.number(),
778
+ prompt_tokens_details: z3.object({
779
+ text_tokens: z3.number().nullish(),
780
+ audio_tokens: z3.number().nullish(),
781
+ image_tokens: z3.number().nullish(),
782
+ cached_tokens: z3.number().nullish()
783
+ }).nullish(),
784
+ completion_tokens_details: z3.object({
785
+ reasoning_tokens: z3.number().nullish(),
786
+ audio_tokens: z3.number().nullish(),
787
+ accepted_prediction_tokens: z3.number().nullish(),
788
+ rejected_prediction_tokens: z3.number().nullish()
789
+ }).nullish()
790
+ });
791
+ var xaiChatResponseSchema = z3.object({
792
+ id: z3.string().nullish(),
793
+ created: z3.number().nullish(),
794
+ model: z3.string().nullish(),
795
+ choices: z3.array(
796
+ z3.object({
797
+ message: z3.object({
798
+ role: z3.literal("assistant"),
799
+ content: z3.string().nullish(),
800
+ reasoning_content: z3.string().nullish(),
801
+ tool_calls: z3.array(
802
+ z3.object({
803
+ id: z3.string(),
804
+ type: z3.literal("function"),
805
+ function: z3.object({
806
+ name: z3.string(),
807
+ arguments: z3.string()
808
+ })
809
+ })
810
+ ).nullish()
811
+ }),
812
+ index: z3.number(),
813
+ finish_reason: z3.string().nullish()
814
+ })
815
+ ).nullish(),
816
+ object: z3.literal("chat.completion").nullish(),
817
+ usage: xaiUsageSchema.nullish(),
818
+ citations: z3.array(z3.string().url()).nullish(),
819
+ code: z3.string().nullish(),
820
+ error: z3.string().nullish()
821
+ });
822
+ var xaiChatChunkSchema = z3.object({
823
+ id: z3.string().nullish(),
824
+ created: z3.number().nullish(),
825
+ model: z3.string().nullish(),
826
+ choices: z3.array(
827
+ z3.object({
828
+ delta: z3.object({
829
+ role: z3.enum(["assistant"]).optional(),
830
+ content: z3.string().nullish(),
831
+ reasoning_content: z3.string().nullish(),
832
+ tool_calls: z3.array(
833
+ z3.object({
834
+ id: z3.string(),
835
+ type: z3.literal("function"),
836
+ function: z3.object({
837
+ name: z3.string(),
838
+ arguments: z3.string()
839
+ })
840
+ })
841
+ ).nullish()
842
+ }),
843
+ finish_reason: z3.string().nullish(),
844
+ index: z3.number()
845
+ })
846
+ ),
847
+ usage: xaiUsageSchema.nullish(),
848
+ citations: z3.array(z3.string().url()).nullish()
849
+ });
850
+ var xaiStreamErrorSchema = z3.object({
851
+ code: z3.string(),
852
+ error: z3.string()
853
+ });
854
+
855
+ // src/responses/xai-responses-language-model.ts
856
+ import {
857
+ combineHeaders as combineHeaders2,
858
+ createEventSourceResponseHandler as createEventSourceResponseHandler2,
859
+ createJsonResponseHandler as createJsonResponseHandler2,
860
+ parseProviderOptions as parseProviderOptions2,
861
+ postJsonToApi as postJsonToApi2
862
+ } from "@ai-sdk/provider-utils";
863
+
864
+ // src/responses/convert-to-xai-responses-input.ts
865
+ async function convertToXaiResponsesInput({
866
+ prompt
867
+ }) {
868
+ var _a, _b, _c, _d, _e;
869
+ const input = [];
870
+ const inputWarnings = [];
871
+ for (const message of prompt) {
872
+ switch (message.role) {
873
+ case "system": {
874
+ input.push({
875
+ role: "system",
876
+ content: message.content
877
+ });
878
+ break;
879
+ }
880
+ case "user": {
881
+ let userContent = "";
882
+ for (const block of message.content) {
883
+ switch (block.type) {
884
+ case "text": {
885
+ userContent += block.text;
886
+ break;
887
+ }
888
+ case "file": {
889
+ inputWarnings.push({
890
+ type: "other",
891
+ message: `xAI Responses API does not support ${block.type} in user messages`
892
+ });
893
+ break;
894
+ }
895
+ default: {
896
+ const _exhaustiveCheck = block;
897
+ inputWarnings.push({
898
+ type: "other",
899
+ message: "xAI Responses API does not support this content type in user messages"
900
+ });
901
+ }
902
+ }
903
+ }
904
+ input.push({
905
+ role: "user",
906
+ content: userContent
907
+ });
908
+ break;
909
+ }
910
+ case "assistant": {
911
+ for (const part of message.content) {
912
+ switch (part.type) {
913
+ case "text": {
914
+ const id = typeof ((_b = (_a = part.providerOptions) == null ? void 0 : _a.xai) == null ? void 0 : _b.itemId) === "string" ? part.providerOptions.xai.itemId : void 0;
915
+ input.push({
916
+ role: "assistant",
917
+ content: part.text,
918
+ id
919
+ });
920
+ break;
921
+ }
922
+ case "tool-call": {
923
+ if (part.providerExecuted) {
924
+ break;
925
+ }
926
+ const id = typeof ((_d = (_c = part.providerOptions) == null ? void 0 : _c.xai) == null ? void 0 : _d.itemId) === "string" ? part.providerOptions.xai.itemId : void 0;
927
+ input.push({
928
+ type: "function_call",
929
+ id: id != null ? id : part.toolCallId,
930
+ call_id: part.toolCallId,
931
+ name: part.toolName,
932
+ arguments: JSON.stringify(part.input),
933
+ status: "completed"
934
+ });
935
+ break;
936
+ }
937
+ case "tool-result": {
938
+ break;
939
+ }
940
+ case "reasoning":
941
+ case "file": {
942
+ inputWarnings.push({
943
+ type: "other",
944
+ message: `xAI Responses API does not support ${part.type} in assistant messages`
945
+ });
946
+ break;
947
+ }
948
+ default: {
949
+ const _exhaustiveCheck = part;
950
+ inputWarnings.push({
951
+ type: "other",
952
+ message: "xAI Responses API does not support this content type in assistant messages"
953
+ });
954
+ }
955
+ }
956
+ }
957
+ break;
958
+ }
959
+ case "tool": {
960
+ for (const part of message.content) {
961
+ if (part.type === "tool-approval-response") {
962
+ continue;
963
+ }
964
+ const output = part.output;
965
+ let outputValue;
966
+ switch (output.type) {
967
+ case "text":
968
+ case "error-text":
969
+ outputValue = output.value;
970
+ break;
971
+ case "execution-denied":
972
+ outputValue = (_e = output.reason) != null ? _e : "tool execution denied";
973
+ break;
974
+ case "json":
975
+ case "error-json":
976
+ outputValue = JSON.stringify(output.value);
977
+ break;
978
+ case "content":
979
+ outputValue = output.value.map((item) => {
980
+ if (item.type === "text") {
981
+ return item.text;
982
+ }
983
+ return "";
984
+ }).join("");
985
+ break;
986
+ default: {
987
+ const _exhaustiveCheck = output;
988
+ outputValue = "";
989
+ }
990
+ }
991
+ input.push({
992
+ type: "function_call_output",
993
+ call_id: part.toolCallId,
994
+ output: outputValue
995
+ });
996
+ }
997
+ break;
998
+ }
999
+ default: {
1000
+ const _exhaustiveCheck = message;
1001
+ inputWarnings.push({
1002
+ type: "other",
1003
+ message: "unsupported message role"
1004
+ });
1005
+ }
1006
+ }
1007
+ }
1008
+ return { input, inputWarnings };
1009
+ }
1010
+
1011
+ // src/responses/convert-xai-responses-usage.ts
1012
+ function convertXaiResponsesUsage(usage) {
1013
+ var _a, _b, _c, _d;
1014
+ const cacheReadTokens = (_b = (_a = usage.input_tokens_details) == null ? void 0 : _a.cached_tokens) != null ? _b : 0;
1015
+ const reasoningTokens = (_d = (_c = usage.output_tokens_details) == null ? void 0 : _c.reasoning_tokens) != null ? _d : 0;
1016
+ return {
1017
+ inputTokens: {
1018
+ total: usage.input_tokens,
1019
+ noCache: usage.input_tokens - cacheReadTokens,
1020
+ cacheRead: cacheReadTokens,
1021
+ cacheWrite: void 0
1022
+ },
1023
+ outputTokens: {
1024
+ total: usage.output_tokens,
1025
+ text: usage.output_tokens - reasoningTokens,
1026
+ reasoning: reasoningTokens
1027
+ },
1028
+ raw: usage
1029
+ };
1030
+ }
1031
+
1032
+ // src/responses/map-xai-responses-finish-reason.ts
1033
+ function mapXaiResponsesFinishReason(finishReason) {
1034
+ switch (finishReason) {
1035
+ case "stop":
1036
+ case "completed":
1037
+ return "stop";
1038
+ case "length":
1039
+ return "length";
1040
+ case "tool_calls":
1041
+ case "function_call":
1042
+ return "tool-calls";
1043
+ case "content_filter":
1044
+ return "content-filter";
1045
+ default:
1046
+ return "other";
1047
+ }
1048
+ }
1049
+
1050
+ // src/responses/xai-responses-api.ts
1051
+ import { z as z4 } from "zod/v4";
1052
+ var annotationSchema = z4.union([
1053
+ z4.object({
1054
+ type: z4.literal("url_citation"),
1055
+ url: z4.string(),
1056
+ title: z4.string().optional()
1057
+ }),
1058
+ z4.object({
1059
+ type: z4.string()
1060
+ })
1061
+ ]);
1062
+ var messageContentPartSchema = z4.object({
1063
+ type: z4.string(),
1064
+ text: z4.string().optional(),
1065
+ logprobs: z4.array(z4.any()).optional(),
1066
+ annotations: z4.array(annotationSchema).optional()
1067
+ });
1068
+ var reasoningSummaryPartSchema = z4.object({
1069
+ type: z4.string(),
1070
+ text: z4.string()
1071
+ });
1072
+ var toolCallSchema = z4.object({
1073
+ name: z4.string().optional(),
1074
+ arguments: z4.string().optional(),
1075
+ input: z4.string().optional(),
1076
+ call_id: z4.string().optional(),
1077
+ id: z4.string(),
1078
+ status: z4.string(),
1079
+ action: z4.any().optional()
1080
+ });
1081
+ var outputItemSchema = z4.discriminatedUnion("type", [
1082
+ z4.object({
1083
+ type: z4.literal("web_search_call"),
1084
+ ...toolCallSchema.shape
1085
+ }),
1086
+ z4.object({
1087
+ type: z4.literal("x_search_call"),
1088
+ ...toolCallSchema.shape
1089
+ }),
1090
+ z4.object({
1091
+ type: z4.literal("code_interpreter_call"),
1092
+ ...toolCallSchema.shape
1093
+ }),
1094
+ z4.object({
1095
+ type: z4.literal("code_execution_call"),
1096
+ ...toolCallSchema.shape
1097
+ }),
1098
+ z4.object({
1099
+ type: z4.literal("view_image_call"),
1100
+ ...toolCallSchema.shape
1101
+ }),
1102
+ z4.object({
1103
+ type: z4.literal("view_x_video_call"),
1104
+ ...toolCallSchema.shape
1105
+ }),
1106
+ z4.object({
1107
+ type: z4.literal("custom_tool_call"),
1108
+ ...toolCallSchema.shape
1109
+ }),
1110
+ z4.object({
1111
+ type: z4.literal("message"),
1112
+ role: z4.string(),
1113
+ content: z4.array(messageContentPartSchema),
1114
+ id: z4.string(),
1115
+ status: z4.string()
1116
+ }),
1117
+ z4.object({
1118
+ type: z4.literal("function_call"),
1119
+ name: z4.string(),
1120
+ arguments: z4.string(),
1121
+ call_id: z4.string(),
1122
+ id: z4.string()
1123
+ }),
1124
+ z4.object({
1125
+ type: z4.literal("reasoning"),
1126
+ id: z4.string(),
1127
+ summary: z4.array(reasoningSummaryPartSchema),
1128
+ status: z4.string()
1129
+ })
1130
+ ]);
1131
+ var xaiResponsesUsageSchema = z4.object({
1132
+ input_tokens: z4.number(),
1133
+ output_tokens: z4.number(),
1134
+ total_tokens: z4.number().optional(),
1135
+ input_tokens_details: z4.object({
1136
+ cached_tokens: z4.number().optional()
1137
+ }).optional(),
1138
+ output_tokens_details: z4.object({
1139
+ reasoning_tokens: z4.number().optional()
1140
+ }).optional(),
1141
+ num_sources_used: z4.number().optional(),
1142
+ num_server_side_tools_used: z4.number().optional()
1143
+ });
1144
+ var xaiResponsesResponseSchema = z4.object({
1145
+ id: z4.string().nullish(),
1146
+ created_at: z4.number().nullish(),
1147
+ model: z4.string().nullish(),
1148
+ object: z4.literal("response"),
1149
+ output: z4.array(outputItemSchema),
1150
+ usage: xaiResponsesUsageSchema,
1151
+ status: z4.string()
1152
+ });
1153
+ var xaiResponsesChunkSchema = z4.union([
1154
+ z4.object({
1155
+ type: z4.literal("response.created"),
1156
+ response: xaiResponsesResponseSchema.partial({ usage: true, status: true })
1157
+ }),
1158
+ z4.object({
1159
+ type: z4.literal("response.in_progress"),
1160
+ response: xaiResponsesResponseSchema.partial({ usage: true, status: true })
1161
+ }),
1162
+ z4.object({
1163
+ type: z4.literal("response.output_item.added"),
1164
+ item: outputItemSchema,
1165
+ output_index: z4.number()
1166
+ }),
1167
+ z4.object({
1168
+ type: z4.literal("response.output_item.done"),
1169
+ item: outputItemSchema,
1170
+ output_index: z4.number()
1171
+ }),
1172
+ z4.object({
1173
+ type: z4.literal("response.content_part.added"),
1174
+ item_id: z4.string(),
1175
+ output_index: z4.number(),
1176
+ content_index: z4.number(),
1177
+ part: messageContentPartSchema
1178
+ }),
1179
+ z4.object({
1180
+ type: z4.literal("response.content_part.done"),
1181
+ item_id: z4.string(),
1182
+ output_index: z4.number(),
1183
+ content_index: z4.number(),
1184
+ part: messageContentPartSchema
1185
+ }),
1186
+ z4.object({
1187
+ type: z4.literal("response.output_text.delta"),
1188
+ item_id: z4.string(),
1189
+ output_index: z4.number(),
1190
+ content_index: z4.number(),
1191
+ delta: z4.string(),
1192
+ logprobs: z4.array(z4.any()).optional()
1193
+ }),
1194
+ z4.object({
1195
+ type: z4.literal("response.output_text.done"),
1196
+ item_id: z4.string(),
1197
+ output_index: z4.number(),
1198
+ content_index: z4.number(),
1199
+ text: z4.string(),
1200
+ logprobs: z4.array(z4.any()).optional(),
1201
+ annotations: z4.array(annotationSchema).optional()
1202
+ }),
1203
+ z4.object({
1204
+ type: z4.literal("response.output_text.annotation.added"),
1205
+ item_id: z4.string(),
1206
+ output_index: z4.number(),
1207
+ content_index: z4.number(),
1208
+ annotation_index: z4.number(),
1209
+ annotation: annotationSchema
1210
+ }),
1211
+ z4.object({
1212
+ type: z4.literal("response.reasoning_summary_part.added"),
1213
+ item_id: z4.string(),
1214
+ output_index: z4.number(),
1215
+ summary_index: z4.number(),
1216
+ part: reasoningSummaryPartSchema
1217
+ }),
1218
+ z4.object({
1219
+ type: z4.literal("response.reasoning_summary_part.done"),
1220
+ item_id: z4.string(),
1221
+ output_index: z4.number(),
1222
+ summary_index: z4.number(),
1223
+ part: reasoningSummaryPartSchema
1224
+ }),
1225
+ z4.object({
1226
+ type: z4.literal("response.reasoning_summary_text.delta"),
1227
+ item_id: z4.string(),
1228
+ output_index: z4.number(),
1229
+ summary_index: z4.number(),
1230
+ delta: z4.string()
1231
+ }),
1232
+ z4.object({
1233
+ type: z4.literal("response.reasoning_summary_text.done"),
1234
+ item_id: z4.string(),
1235
+ output_index: z4.number(),
1236
+ summary_index: z4.number(),
1237
+ text: z4.string()
1238
+ }),
1239
+ z4.object({
1240
+ type: z4.literal("response.web_search_call.in_progress"),
1241
+ item_id: z4.string(),
1242
+ output_index: z4.number()
1243
+ }),
1244
+ z4.object({
1245
+ type: z4.literal("response.web_search_call.searching"),
1246
+ item_id: z4.string(),
1247
+ output_index: z4.number()
1248
+ }),
1249
+ z4.object({
1250
+ type: z4.literal("response.web_search_call.completed"),
1251
+ item_id: z4.string(),
1252
+ output_index: z4.number()
1253
+ }),
1254
+ z4.object({
1255
+ type: z4.literal("response.x_search_call.in_progress"),
1256
+ item_id: z4.string(),
1257
+ output_index: z4.number()
1258
+ }),
1259
+ z4.object({
1260
+ type: z4.literal("response.x_search_call.searching"),
1261
+ item_id: z4.string(),
1262
+ output_index: z4.number()
1263
+ }),
1264
+ z4.object({
1265
+ type: z4.literal("response.x_search_call.completed"),
1266
+ item_id: z4.string(),
1267
+ output_index: z4.number()
1268
+ }),
1269
+ z4.object({
1270
+ type: z4.literal("response.custom_tool_call_input.done"),
1271
+ item_id: z4.string(),
1272
+ output_index: z4.number()
1273
+ }),
1274
+ z4.object({
1275
+ type: z4.literal("response.custom_tool_call_input.delta"),
1276
+ item_id: z4.string(),
1277
+ output_index: z4.number()
1278
+ }),
1279
+ z4.object({
1280
+ type: z4.literal("response.code_execution_call.in_progress"),
1281
+ item_id: z4.string(),
1282
+ output_index: z4.number()
1283
+ }),
1284
+ z4.object({
1285
+ type: z4.literal("response.code_execution_call.executing"),
1286
+ item_id: z4.string(),
1287
+ output_index: z4.number()
1288
+ }),
1289
+ z4.object({
1290
+ type: z4.literal("response.code_execution_call.completed"),
1291
+ item_id: z4.string(),
1292
+ output_index: z4.number()
1293
+ }),
1294
+ z4.object({
1295
+ type: z4.literal("response.code_interpreter_call.in_progress"),
1296
+ item_id: z4.string(),
1297
+ output_index: z4.number()
1298
+ }),
1299
+ z4.object({
1300
+ type: z4.literal("response.code_interpreter_call.executing"),
1301
+ item_id: z4.string(),
1302
+ output_index: z4.number()
1303
+ }),
1304
+ z4.object({
1305
+ type: z4.literal("response.code_interpreter_call.interpreting"),
1306
+ item_id: z4.string(),
1307
+ output_index: z4.number()
1308
+ }),
1309
+ z4.object({
1310
+ type: z4.literal("response.code_interpreter_call.completed"),
1311
+ item_id: z4.string(),
1312
+ output_index: z4.number()
1313
+ }),
1314
+ // Code interpreter code streaming events
1315
+ z4.object({
1316
+ type: z4.literal("response.code_interpreter_call_code.delta"),
1317
+ item_id: z4.string(),
1318
+ output_index: z4.number(),
1319
+ delta: z4.string()
1320
+ }),
1321
+ z4.object({
1322
+ type: z4.literal("response.code_interpreter_call_code.done"),
1323
+ item_id: z4.string(),
1324
+ output_index: z4.number(),
1325
+ code: z4.string()
1326
+ }),
1327
+ z4.object({
1328
+ type: z4.literal("response.done"),
1329
+ response: xaiResponsesResponseSchema
1330
+ }),
1331
+ z4.object({
1332
+ type: z4.literal("response.completed"),
1333
+ response: xaiResponsesResponseSchema
1334
+ })
1335
+ ]);
1336
+
1337
+ // src/responses/xai-responses-options.ts
1338
+ import { z as z5 } from "zod/v4";
1339
+ var xaiResponsesProviderOptions = z5.object({
1340
+ /**
1341
+ * Constrains how hard a reasoning model thinks before responding.
1342
+ * Possible values are `low` (uses fewer reasoning tokens), `medium` and `high` (uses more reasoning tokens).
1343
+ */
1344
+ reasoningEffort: z5.enum(["low", "medium", "high"]).optional(),
1345
+ /**
1346
+ * Whether to store the input message(s) and model response for later retrieval.
1347
+ * @default true
1348
+ */
1349
+ store: z5.boolean().optional(),
1350
+ /**
1351
+ * The ID of the previous response from the model.
1352
+ */
1353
+ previousResponseId: z5.string().optional()
1354
+ });
1355
+
1356
+ // src/responses/xai-responses-prepare-tools.ts
1357
+ import {
1358
+ UnsupportedFunctionalityError as UnsupportedFunctionalityError3
1359
+ } from "@ai-sdk/provider";
1360
+ import { validateTypes } from "@ai-sdk/provider-utils";
1361
+
1362
+ // src/tool/web-search.ts
1363
+ import {
1364
+ createProviderToolFactoryWithOutputSchema,
1365
+ lazySchema,
1366
+ zodSchema
1367
+ } from "@ai-sdk/provider-utils";
1368
+ import { z as z6 } from "zod/v4";
1369
+ var webSearchArgsSchema = lazySchema(
1370
+ () => zodSchema(
1371
+ z6.object({
1372
+ allowedDomains: z6.array(z6.string()).max(5).optional(),
1373
+ excludedDomains: z6.array(z6.string()).max(5).optional(),
1374
+ enableImageUnderstanding: z6.boolean().optional()
1375
+ })
1376
+ )
1377
+ );
1378
+ var webSearchOutputSchema = lazySchema(
1379
+ () => zodSchema(
1380
+ z6.object({
1381
+ query: z6.string(),
1382
+ sources: z6.array(
1383
+ z6.object({
1384
+ title: z6.string(),
1385
+ url: z6.string(),
1386
+ snippet: z6.string()
1387
+ })
1388
+ )
1389
+ })
1390
+ )
1391
+ );
1392
+ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema({
1393
+ id: "xai.web_search",
1394
+ inputSchema: lazySchema(() => zodSchema(z6.object({}))),
1395
+ outputSchema: webSearchOutputSchema
1396
+ });
1397
+ var webSearch = (args = {}) => webSearchToolFactory(args);
1398
+
1399
+ // src/tool/x-search.ts
1400
+ import {
1401
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
1402
+ lazySchema as lazySchema2,
1403
+ zodSchema as zodSchema2
1404
+ } from "@ai-sdk/provider-utils";
1405
+ import { z as z7 } from "zod/v4";
1406
+ var xSearchArgsSchema = lazySchema2(
1407
+ () => zodSchema2(
1408
+ z7.object({
1409
+ allowedXHandles: z7.array(z7.string()).max(10).optional(),
1410
+ excludedXHandles: z7.array(z7.string()).max(10).optional(),
1411
+ fromDate: z7.string().optional(),
1412
+ toDate: z7.string().optional(),
1413
+ enableImageUnderstanding: z7.boolean().optional(),
1414
+ enableVideoUnderstanding: z7.boolean().optional()
1415
+ })
1416
+ )
1417
+ );
1418
+ var xSearchOutputSchema = lazySchema2(
1419
+ () => zodSchema2(
1420
+ z7.object({
1421
+ query: z7.string(),
1422
+ posts: z7.array(
1423
+ z7.object({
1424
+ author: z7.string(),
1425
+ text: z7.string(),
1426
+ url: z7.string(),
1427
+ likes: z7.number()
1428
+ })
1429
+ )
1430
+ })
1431
+ )
1432
+ );
1433
+ var xSearchToolFactory = createProviderToolFactoryWithOutputSchema2({
1434
+ id: "xai.x_search",
1435
+ inputSchema: lazySchema2(() => zodSchema2(z7.object({}))),
1436
+ outputSchema: xSearchOutputSchema
1437
+ });
1438
+ var xSearch = (args = {}) => xSearchToolFactory(args);
1439
+
1440
+ // src/responses/xai-responses-prepare-tools.ts
1441
+ async function prepareResponsesTools({
1442
+ tools,
1443
+ toolChoice
1444
+ }) {
1445
+ const normalizedTools = (tools == null ? void 0 : tools.length) ? tools : void 0;
1446
+ const toolWarnings = [];
1447
+ if (normalizedTools == null) {
1448
+ return { tools: void 0, toolChoice: void 0, toolWarnings };
1449
+ }
1450
+ const xaiTools2 = [];
1451
+ const toolByName = /* @__PURE__ */ new Map();
1452
+ for (const tool of normalizedTools) {
1453
+ toolByName.set(tool.name, tool);
1454
+ if (tool.type === "provider") {
1455
+ switch (tool.id) {
1456
+ case "xai.web_search": {
1457
+ const args = await validateTypes({
1458
+ value: tool.args,
1459
+ schema: webSearchArgsSchema
1460
+ });
1461
+ xaiTools2.push({
1462
+ type: "web_search",
1463
+ allowed_domains: args.allowedDomains,
1464
+ excluded_domains: args.excludedDomains,
1465
+ enable_image_understanding: args.enableImageUnderstanding
1466
+ });
1467
+ break;
1468
+ }
1469
+ case "xai.x_search": {
1470
+ const args = await validateTypes({
1471
+ value: tool.args,
1472
+ schema: xSearchArgsSchema
1473
+ });
1474
+ xaiTools2.push({
1475
+ type: "x_search",
1476
+ allowed_x_handles: args.allowedXHandles,
1477
+ excluded_x_handles: args.excludedXHandles,
1478
+ from_date: args.fromDate,
1479
+ to_date: args.toDate,
1480
+ enable_image_understanding: args.enableImageUnderstanding,
1481
+ enable_video_understanding: args.enableVideoUnderstanding
1482
+ });
1483
+ break;
1484
+ }
1485
+ case "xai.code_execution": {
1486
+ xaiTools2.push({
1487
+ type: "code_interpreter"
1488
+ });
1489
+ break;
1490
+ }
1491
+ case "xai.view_image": {
1492
+ xaiTools2.push({
1493
+ type: "view_image"
1494
+ });
1495
+ break;
1496
+ }
1497
+ case "xai.view_x_video": {
1498
+ xaiTools2.push({
1499
+ type: "view_x_video"
1500
+ });
1501
+ break;
1502
+ }
1503
+ case "xai.file_search": {
1504
+ xaiTools2.push({
1505
+ type: "file_search"
1506
+ });
1507
+ break;
1508
+ }
1509
+ case "xai.mcp": {
1510
+ xaiTools2.push({
1511
+ type: "mcp"
1512
+ });
1513
+ break;
1514
+ }
1515
+ default: {
1516
+ toolWarnings.push({
1517
+ type: "unsupported",
1518
+ feature: `provider-defined tool ${tool.name}`
1519
+ });
1520
+ break;
1521
+ }
1522
+ }
1523
+ } else {
1524
+ xaiTools2.push({
1525
+ type: "function",
1526
+ name: tool.name,
1527
+ description: tool.description,
1528
+ parameters: tool.inputSchema
1529
+ });
1530
+ }
1531
+ }
1532
+ if (toolChoice == null) {
1533
+ return { tools: xaiTools2, toolChoice: void 0, toolWarnings };
1534
+ }
1535
+ const type = toolChoice.type;
1536
+ switch (type) {
1537
+ case "auto":
1538
+ case "none":
1539
+ return { tools: xaiTools2, toolChoice: type, toolWarnings };
1540
+ case "required":
1541
+ return { tools: xaiTools2, toolChoice: "required", toolWarnings };
1542
+ case "tool": {
1543
+ const selectedTool = toolByName.get(toolChoice.toolName);
1544
+ if (selectedTool == null) {
1545
+ return {
1546
+ tools: xaiTools2,
1547
+ toolChoice: void 0,
1548
+ toolWarnings
1549
+ };
1550
+ }
1551
+ if (selectedTool.type === "provider") {
1552
+ switch (selectedTool.id) {
1553
+ case "xai.web_search":
1554
+ return {
1555
+ tools: xaiTools2,
1556
+ toolChoice: { type: "web_search" },
1557
+ toolWarnings
1558
+ };
1559
+ case "xai.x_search":
1560
+ return {
1561
+ tools: xaiTools2,
1562
+ toolChoice: { type: "x_search" },
1563
+ toolWarnings
1564
+ };
1565
+ case "xai.code_execution":
1566
+ return {
1567
+ tools: xaiTools2,
1568
+ toolChoice: { type: "code_interpreter" },
1569
+ toolWarnings
1570
+ };
1571
+ case "xai.view_image":
1572
+ return {
1573
+ tools: xaiTools2,
1574
+ toolChoice: { type: "view_image" },
1575
+ toolWarnings
1576
+ };
1577
+ case "xai.view_x_video":
1578
+ return {
1579
+ tools: xaiTools2,
1580
+ toolChoice: { type: "view_x_video" },
1581
+ toolWarnings
1582
+ };
1583
+ case "xai.file_search":
1584
+ return {
1585
+ tools: xaiTools2,
1586
+ toolChoice: { type: "file_search" },
1587
+ toolWarnings
1588
+ };
1589
+ case "xai.mcp":
1590
+ return {
1591
+ tools: xaiTools2,
1592
+ toolChoice: { type: "mcp" },
1593
+ toolWarnings
1594
+ };
1595
+ default:
1596
+ toolWarnings.push({
1597
+ type: "unsupported",
1598
+ feature: `provider-defined tool ${selectedTool.name}`
1599
+ });
1600
+ return { tools: xaiTools2, toolChoice: void 0, toolWarnings };
1601
+ }
1602
+ }
1603
+ return {
1604
+ tools: xaiTools2,
1605
+ toolChoice: { type: "function", name: selectedTool.name },
1606
+ toolWarnings
1607
+ };
1608
+ }
1609
+ default: {
1610
+ const _exhaustiveCheck = type;
1611
+ throw new UnsupportedFunctionalityError3({
1612
+ functionality: `tool choice type: ${_exhaustiveCheck}`
1613
+ });
1614
+ }
1615
+ }
1616
+ }
1617
+
1618
+ // src/responses/xai-responses-language-model.ts
1619
+ var XaiResponsesLanguageModel = class {
1620
+ constructor(modelId, config) {
1621
+ this.specificationVersion = "v3";
1622
+ this.supportedUrls = {
1623
+ "image/*": [/^https?:\/\/.*$/]
1624
+ };
1625
+ this.modelId = modelId;
1626
+ this.config = config;
1627
+ }
1628
+ get provider() {
1629
+ return this.config.provider;
1630
+ }
1631
+ async getArgs({
1632
+ prompt,
1633
+ maxOutputTokens,
1634
+ temperature,
1635
+ topP,
1636
+ stopSequences,
1637
+ seed,
1638
+ providerOptions,
1639
+ tools,
1640
+ toolChoice
1641
+ }) {
1642
+ var _a, _b, _c, _d;
1643
+ const warnings = [];
1644
+ const options = (_a = await parseProviderOptions2({
1645
+ provider: "xai",
1646
+ providerOptions,
1647
+ schema: xaiResponsesProviderOptions
1648
+ })) != null ? _a : {};
1649
+ if (stopSequences != null) {
1650
+ warnings.push({ type: "unsupported", feature: "stopSequences" });
1651
+ }
1652
+ const webSearchToolName = (_b = tools == null ? void 0 : tools.find(
1653
+ (tool) => tool.type === "provider" && tool.id === "xai.web_search"
1654
+ )) == null ? void 0 : _b.name;
1655
+ const xSearchToolName = (_c = tools == null ? void 0 : tools.find(
1656
+ (tool) => tool.type === "provider" && tool.id === "xai.x_search"
1657
+ )) == null ? void 0 : _c.name;
1658
+ const codeExecutionToolName = (_d = tools == null ? void 0 : tools.find(
1659
+ (tool) => tool.type === "provider" && tool.id === "xai.code_execution"
1660
+ )) == null ? void 0 : _d.name;
1661
+ const { input, inputWarnings } = await convertToXaiResponsesInput({
1662
+ prompt,
1663
+ store: true
1664
+ });
1665
+ warnings.push(...inputWarnings);
1666
+ const {
1667
+ tools: xaiTools2,
1668
+ toolChoice: xaiToolChoice,
1669
+ toolWarnings
1670
+ } = await prepareResponsesTools({
1671
+ tools,
1672
+ toolChoice
1673
+ });
1674
+ warnings.push(...toolWarnings);
1675
+ const baseArgs = {
1676
+ model: this.modelId,
1677
+ input,
1678
+ max_output_tokens: maxOutputTokens,
1679
+ temperature,
1680
+ top_p: topP,
1681
+ seed,
1682
+ ...options.reasoningEffort != null && {
1683
+ reasoning: { effort: options.reasoningEffort }
1684
+ },
1685
+ ...options.store === false && {
1686
+ store: options.store,
1687
+ include: ["reasoning.encrypted_content"]
1688
+ },
1689
+ ...options.previousResponseId != null && {
1690
+ previous_response_id: options.previousResponseId
1691
+ }
1692
+ };
1693
+ if (xaiTools2 && xaiTools2.length > 0) {
1694
+ baseArgs.tools = xaiTools2;
1695
+ }
1696
+ if (xaiToolChoice != null) {
1697
+ baseArgs.tool_choice = xaiToolChoice;
1698
+ }
1699
+ return {
1700
+ args: baseArgs,
1701
+ warnings,
1702
+ webSearchToolName,
1703
+ xSearchToolName,
1704
+ codeExecutionToolName
1705
+ };
1706
+ }
1707
+ async doGenerate(options) {
1708
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1709
+ const {
1710
+ args: body,
1711
+ warnings,
1712
+ webSearchToolName,
1713
+ xSearchToolName,
1714
+ codeExecutionToolName
1715
+ } = await this.getArgs(options);
1716
+ const {
1717
+ responseHeaders,
1718
+ value: response,
1719
+ rawValue: rawResponse
1720
+ } = await postJsonToApi2({
1721
+ url: `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/responses`,
1722
+ headers: combineHeaders2(this.config.headers(), options.headers),
1723
+ body,
1724
+ failedResponseHandler: xaiFailedResponseHandler,
1725
+ successfulResponseHandler: createJsonResponseHandler2(
1726
+ xaiResponsesResponseSchema
1727
+ ),
1728
+ abortSignal: options.abortSignal,
1729
+ fetch: this.config.fetch
1730
+ });
1731
+ const content = [];
1732
+ const webSearchSubTools = [
1733
+ "web_search",
1734
+ "web_search_with_snippets",
1735
+ "browse_page"
1736
+ ];
1737
+ const xSearchSubTools = [
1738
+ "x_user_search",
1739
+ "x_keyword_search",
1740
+ "x_semantic_search",
1741
+ "x_thread_fetch"
1742
+ ];
1743
+ for (const part of response.output) {
1744
+ if (part.type === "web_search_call" || part.type === "x_search_call" || part.type === "code_interpreter_call" || part.type === "code_execution_call" || part.type === "view_image_call" || part.type === "view_x_video_call" || part.type === "custom_tool_call") {
1745
+ let toolName = (_b = part.name) != null ? _b : "";
1746
+ if (webSearchSubTools.includes((_c = part.name) != null ? _c : "") || part.type === "web_search_call") {
1747
+ toolName = webSearchToolName != null ? webSearchToolName : "web_search";
1748
+ } else if (xSearchSubTools.includes((_d = part.name) != null ? _d : "") || part.type === "x_search_call") {
1749
+ toolName = xSearchToolName != null ? xSearchToolName : "x_search";
1750
+ } else if (part.name === "code_execution" || part.type === "code_interpreter_call" || part.type === "code_execution_call") {
1751
+ toolName = codeExecutionToolName != null ? codeExecutionToolName : "code_execution";
1752
+ }
1753
+ const toolInput = part.type === "custom_tool_call" ? (_e = part.input) != null ? _e : "" : (_f = part.arguments) != null ? _f : "";
1754
+ content.push({
1755
+ type: "tool-call",
1756
+ toolCallId: part.id,
1757
+ toolName,
1758
+ input: toolInput,
1759
+ providerExecuted: true
1760
+ });
1761
+ continue;
1762
+ }
1763
+ switch (part.type) {
1764
+ case "message": {
1765
+ for (const contentPart of part.content) {
1766
+ if (contentPart.text) {
1767
+ content.push({
1768
+ type: "text",
1769
+ text: contentPart.text
1770
+ });
1771
+ }
1772
+ if (contentPart.annotations) {
1773
+ for (const annotation of contentPart.annotations) {
1774
+ if (annotation.type === "url_citation" && "url" in annotation) {
1775
+ content.push({
1776
+ type: "source",
1777
+ sourceType: "url",
1778
+ id: this.config.generateId(),
1779
+ url: annotation.url,
1780
+ title: (_g = annotation.title) != null ? _g : annotation.url
1781
+ });
1782
+ }
1783
+ }
1784
+ }
1785
+ }
1786
+ break;
1787
+ }
1788
+ case "function_call": {
1789
+ content.push({
1790
+ type: "tool-call",
1791
+ toolCallId: part.call_id,
1792
+ toolName: part.name,
1793
+ input: part.arguments
1794
+ });
1795
+ break;
1796
+ }
1797
+ default: {
1798
+ break;
1799
+ }
1800
+ }
1801
+ }
1802
+ return {
1803
+ content,
1804
+ finishReason: {
1805
+ unified: mapXaiResponsesFinishReason(response.status),
1806
+ raw: (_h = response.status) != null ? _h : void 0
1807
+ },
1808
+ usage: convertXaiResponsesUsage(response.usage),
1809
+ request: { body },
1810
+ response: {
1811
+ ...getResponseMetadata(response),
1812
+ headers: responseHeaders,
1813
+ body: rawResponse
1814
+ },
1815
+ warnings
1816
+ };
1817
+ }
1818
+ async doStream(options) {
1819
+ var _a;
1820
+ const {
1821
+ args,
1822
+ warnings,
1823
+ webSearchToolName,
1824
+ xSearchToolName,
1825
+ codeExecutionToolName
1826
+ } = await this.getArgs(options);
1827
+ const body = {
1828
+ ...args,
1829
+ stream: true
1830
+ };
1831
+ const { responseHeaders, value: response } = await postJsonToApi2({
1832
+ url: `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/responses`,
1833
+ headers: combineHeaders2(this.config.headers(), options.headers),
1834
+ body,
1835
+ failedResponseHandler: xaiFailedResponseHandler,
1836
+ successfulResponseHandler: createEventSourceResponseHandler2(
1837
+ xaiResponsesChunkSchema
1838
+ ),
1839
+ abortSignal: options.abortSignal,
1840
+ fetch: this.config.fetch
1841
+ });
1842
+ let finishReason = {
1843
+ unified: "other",
1844
+ raw: void 0
1845
+ };
1846
+ let usage = void 0;
1847
+ let isFirstChunk = true;
1848
+ const contentBlocks = {};
1849
+ const seenToolCalls = /* @__PURE__ */ new Set();
1850
+ const self = this;
1851
+ return {
1852
+ stream: response.pipeThrough(
1853
+ new TransformStream({
1854
+ start(controller) {
1855
+ controller.enqueue({ type: "stream-start", warnings });
1856
+ },
1857
+ transform(chunk, controller) {
1858
+ var _a2, _b, _c, _d, _e, _f, _g, _h;
1859
+ if (options.includeRawChunks) {
1860
+ controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
1861
+ }
1862
+ if (!chunk.success) {
1863
+ controller.enqueue({ type: "error", error: chunk.error });
1864
+ return;
1865
+ }
1866
+ const event = chunk.value;
1867
+ if (event.type === "response.created" || event.type === "response.in_progress") {
1868
+ if (isFirstChunk) {
1869
+ controller.enqueue({
1870
+ type: "response-metadata",
1871
+ ...getResponseMetadata(event.response)
1872
+ });
1873
+ isFirstChunk = false;
1874
+ }
1875
+ return;
1876
+ }
1877
+ if (event.type === "response.reasoning_summary_part.added") {
1878
+ const blockId = `reasoning-${event.item_id}`;
1879
+ controller.enqueue({
1880
+ type: "reasoning-start",
1881
+ id: blockId
1882
+ });
1883
+ }
1884
+ if (event.type === "response.reasoning_summary_text.delta") {
1885
+ const blockId = `reasoning-${event.item_id}`;
1886
+ controller.enqueue({
1887
+ type: "reasoning-delta",
1888
+ id: blockId,
1889
+ delta: event.delta
1890
+ });
1891
+ return;
1892
+ }
1893
+ if (event.type === "response.reasoning_summary_text.done") {
1894
+ const blockId = `reasoning-${event.item_id}`;
1895
+ controller.enqueue({
1896
+ type: "reasoning-end",
1897
+ id: blockId
1898
+ });
1899
+ }
1900
+ if (event.type === "response.output_text.delta") {
1901
+ const blockId = `text-${event.item_id}`;
1902
+ if (contentBlocks[blockId] == null) {
1903
+ contentBlocks[blockId] = { type: "text" };
1904
+ controller.enqueue({
1905
+ type: "text-start",
1906
+ id: blockId
1907
+ });
1908
+ }
1909
+ controller.enqueue({
1910
+ type: "text-delta",
1911
+ id: blockId,
1912
+ delta: event.delta
1913
+ });
1914
+ return;
1915
+ }
1916
+ if (event.type === "response.output_text.done") {
1917
+ if (event.annotations) {
1918
+ for (const annotation of event.annotations) {
1919
+ if (annotation.type === "url_citation" && "url" in annotation) {
1920
+ controller.enqueue({
1921
+ type: "source",
1922
+ sourceType: "url",
1923
+ id: self.config.generateId(),
1924
+ url: annotation.url,
1925
+ title: (_a2 = annotation.title) != null ? _a2 : annotation.url
1926
+ });
1927
+ }
1928
+ }
1929
+ }
1930
+ return;
1931
+ }
1932
+ if (event.type === "response.output_text.annotation.added") {
1933
+ const annotation = event.annotation;
1934
+ if (annotation.type === "url_citation" && "url" in annotation) {
1935
+ controller.enqueue({
1936
+ type: "source",
1937
+ sourceType: "url",
1938
+ id: self.config.generateId(),
1939
+ url: annotation.url,
1940
+ title: (_b = annotation.title) != null ? _b : annotation.url
1941
+ });
1942
+ }
1943
+ return;
1944
+ }
1945
+ if (event.type === "response.done" || event.type === "response.completed") {
1946
+ const response2 = event.response;
1947
+ if (response2.usage) {
1948
+ usage = convertXaiResponsesUsage(response2.usage);
1949
+ }
1950
+ if (response2.status) {
1951
+ finishReason = {
1952
+ unified: mapXaiResponsesFinishReason(response2.status),
1953
+ raw: response2.status
1954
+ };
1955
+ }
1956
+ return;
1957
+ }
1958
+ if (event.type === "response.output_item.added" || event.type === "response.output_item.done") {
1959
+ const part = event.item;
1960
+ if (part.type === "web_search_call" || part.type === "x_search_call" || part.type === "code_interpreter_call" || part.type === "code_execution_call" || part.type === "view_image_call" || part.type === "view_x_video_call" || part.type === "custom_tool_call") {
1961
+ const webSearchSubTools = [
1962
+ "web_search",
1963
+ "web_search_with_snippets",
1964
+ "browse_page"
1965
+ ];
1966
+ const xSearchSubTools = [
1967
+ "x_user_search",
1968
+ "x_keyword_search",
1969
+ "x_semantic_search",
1970
+ "x_thread_fetch"
1971
+ ];
1972
+ let toolName = (_c = part.name) != null ? _c : "";
1973
+ if (webSearchSubTools.includes((_d = part.name) != null ? _d : "") || part.type === "web_search_call") {
1974
+ toolName = webSearchToolName != null ? webSearchToolName : "web_search";
1975
+ } else if (xSearchSubTools.includes((_e = part.name) != null ? _e : "") || part.type === "x_search_call") {
1976
+ toolName = xSearchToolName != null ? xSearchToolName : "x_search";
1977
+ } else if (part.name === "code_execution" || part.type === "code_interpreter_call" || part.type === "code_execution_call") {
1978
+ toolName = codeExecutionToolName != null ? codeExecutionToolName : "code_execution";
1979
+ }
1980
+ const toolInput = part.type === "custom_tool_call" ? (_f = part.input) != null ? _f : "" : (_g = part.arguments) != null ? _g : "";
1981
+ const shouldEmit = part.type === "custom_tool_call" ? event.type === "response.output_item.done" : !seenToolCalls.has(part.id);
1982
+ if (shouldEmit && !seenToolCalls.has(part.id)) {
1983
+ seenToolCalls.add(part.id);
1984
+ controller.enqueue({
1985
+ type: "tool-input-start",
1986
+ id: part.id,
1987
+ toolName
1988
+ });
1989
+ controller.enqueue({
1990
+ type: "tool-input-delta",
1991
+ id: part.id,
1992
+ delta: toolInput
1993
+ });
1994
+ controller.enqueue({
1995
+ type: "tool-input-end",
1996
+ id: part.id
1997
+ });
1998
+ controller.enqueue({
1999
+ type: "tool-call",
2000
+ toolCallId: part.id,
2001
+ toolName,
2002
+ input: toolInput,
2003
+ providerExecuted: true
2004
+ });
2005
+ }
2006
+ return;
2007
+ }
2008
+ if (part.type === "message") {
2009
+ for (const contentPart of part.content) {
2010
+ if (contentPart.text && contentPart.text.length > 0) {
2011
+ const blockId = `text-${part.id}`;
2012
+ if (contentBlocks[blockId] == null) {
2013
+ contentBlocks[blockId] = { type: "text" };
2014
+ controller.enqueue({
2015
+ type: "text-start",
2016
+ id: blockId
2017
+ });
2018
+ controller.enqueue({
2019
+ type: "text-delta",
2020
+ id: blockId,
2021
+ delta: contentPart.text
2022
+ });
2023
+ }
2024
+ }
2025
+ if (contentPart.annotations) {
2026
+ for (const annotation of contentPart.annotations) {
2027
+ if (annotation.type === "url_citation" && "url" in annotation) {
2028
+ controller.enqueue({
2029
+ type: "source",
2030
+ sourceType: "url",
2031
+ id: self.config.generateId(),
2032
+ url: annotation.url,
2033
+ title: (_h = annotation.title) != null ? _h : annotation.url
2034
+ });
2035
+ }
2036
+ }
2037
+ }
2038
+ }
2039
+ } else if (part.type === "function_call") {
2040
+ if (!seenToolCalls.has(part.call_id)) {
2041
+ seenToolCalls.add(part.call_id);
2042
+ controller.enqueue({
2043
+ type: "tool-input-start",
2044
+ id: part.call_id,
2045
+ toolName: part.name
2046
+ });
2047
+ controller.enqueue({
2048
+ type: "tool-input-delta",
2049
+ id: part.call_id,
2050
+ delta: part.arguments
2051
+ });
2052
+ controller.enqueue({
2053
+ type: "tool-input-end",
2054
+ id: part.call_id
2055
+ });
2056
+ controller.enqueue({
2057
+ type: "tool-call",
2058
+ toolCallId: part.call_id,
2059
+ toolName: part.name,
2060
+ input: part.arguments
2061
+ });
2062
+ }
2063
+ }
2064
+ }
2065
+ },
2066
+ flush(controller) {
2067
+ for (const [blockId, block] of Object.entries(contentBlocks)) {
2068
+ if (block.type === "text") {
2069
+ controller.enqueue({
2070
+ type: "text-end",
2071
+ id: blockId
2072
+ });
2073
+ }
2074
+ }
2075
+ controller.enqueue({ type: "finish", finishReason, usage });
2076
+ }
2077
+ })
2078
+ ),
2079
+ request: { body },
2080
+ response: { headers: responseHeaders }
2081
+ };
2082
+ }
2083
+ };
2084
+
2085
+ // src/tool/code-execution.ts
2086
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3 } from "@ai-sdk/provider-utils";
2087
+ import { z as z8 } from "zod/v4";
2088
+ var codeExecutionOutputSchema = z8.object({
2089
+ output: z8.string().describe("the output of the code execution"),
2090
+ error: z8.string().optional().describe("any error that occurred")
2091
+ });
2092
+ var codeExecutionToolFactory = createProviderToolFactoryWithOutputSchema3({
2093
+ id: "xai.code_execution",
2094
+ inputSchema: z8.object({}).describe("no input parameters"),
2095
+ outputSchema: codeExecutionOutputSchema
2096
+ });
2097
+ var codeExecution = (args = {}) => codeExecutionToolFactory(args);
2098
+
2099
+ // src/tool/view-image.ts
2100
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4 } from "@ai-sdk/provider-utils";
2101
+ import { z as z9 } from "zod/v4";
2102
+ var viewImageOutputSchema = z9.object({
2103
+ description: z9.string().describe("description of the image"),
2104
+ objects: z9.array(z9.string()).optional().describe("objects detected in the image")
2105
+ });
2106
+ var viewImageToolFactory = createProviderToolFactoryWithOutputSchema4({
2107
+ id: "xai.view_image",
2108
+ inputSchema: z9.object({}).describe("no input parameters"),
2109
+ outputSchema: viewImageOutputSchema
2110
+ });
2111
+ var viewImage = (args = {}) => viewImageToolFactory(args);
2112
+
2113
+ // src/tool/view-x-video.ts
2114
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5 } from "@ai-sdk/provider-utils";
2115
+ import { z as z10 } from "zod/v4";
2116
+ var viewXVideoOutputSchema = z10.object({
2117
+ transcript: z10.string().optional().describe("transcript of the video"),
2118
+ description: z10.string().describe("description of the video content"),
2119
+ duration: z10.number().optional().describe("duration in seconds")
2120
+ });
2121
+ var viewXVideoToolFactory = createProviderToolFactoryWithOutputSchema5({
2122
+ id: "xai.view_x_video",
2123
+ inputSchema: z10.object({}).describe("no input parameters"),
2124
+ outputSchema: viewXVideoOutputSchema
2125
+ });
2126
+ var viewXVideo = (args = {}) => viewXVideoToolFactory(args);
2127
+
2128
+ // src/tool/index.ts
2129
+ var xaiTools = {
2130
+ codeExecution,
2131
+ viewImage,
2132
+ viewXVideo,
2133
+ webSearch,
2134
+ xSearch
2135
+ };
2136
+
2137
+ // src/version.ts
2138
+ var VERSION = true ? "3.0.13" : "0.0.0-test";
2139
+
2140
+ // src/xai-provider.ts
2141
+ var xaiErrorStructure = {
2142
+ errorSchema: xaiErrorDataSchema,
2143
+ errorToMessage: (data) => data.error.message
2144
+ };
2145
+ function createXai(options = {}) {
2146
+ var _a;
2147
+ const baseURL = withoutTrailingSlash(
2148
+ (_a = options.baseURL) != null ? _a : "https://api.x.ai/v1"
2149
+ );
2150
+ const getHeaders = () => withUserAgentSuffix(
2151
+ {
2152
+ Authorization: `Bearer ${loadApiKey({
2153
+ apiKey: options.apiKey,
2154
+ environmentVariableName: "XAI_API_KEY",
2155
+ description: "xAI API key"
2156
+ })}`,
2157
+ ...options.headers
2158
+ },
2159
+ `ai-sdk/xai/${VERSION}`
2160
+ );
2161
+ const createChatLanguageModel = (modelId) => {
2162
+ return new XaiChatLanguageModel(modelId, {
2163
+ provider: "xai.chat",
2164
+ baseURL,
2165
+ headers: getHeaders,
2166
+ generateId,
2167
+ fetch: options.fetch
2168
+ });
2169
+ };
2170
+ const createResponsesLanguageModel = (modelId) => {
2171
+ return new XaiResponsesLanguageModel(modelId, {
2172
+ provider: "xai.responses",
2173
+ baseURL,
2174
+ headers: getHeaders,
2175
+ generateId,
2176
+ fetch: options.fetch
2177
+ });
2178
+ };
2179
+ const createImageModel = (modelId) => {
2180
+ return new OpenAICompatibleImageModel(modelId, {
2181
+ provider: "xai.image",
2182
+ url: ({ path }) => `${baseURL}${path}`,
2183
+ headers: getHeaders,
2184
+ fetch: options.fetch,
2185
+ errorStructure: xaiErrorStructure
2186
+ });
2187
+ };
2188
+ const provider = (modelId) => createChatLanguageModel(modelId);
2189
+ provider.specificationVersion = "v3";
2190
+ provider.languageModel = createChatLanguageModel;
2191
+ provider.chat = createChatLanguageModel;
2192
+ provider.responses = createResponsesLanguageModel;
2193
+ provider.embeddingModel = (modelId) => {
2194
+ throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });
2195
+ };
2196
+ provider.textEmbeddingModel = provider.embeddingModel;
2197
+ provider.imageModel = createImageModel;
2198
+ provider.image = createImageModel;
2199
+ provider.tools = xaiTools;
2200
+ return provider;
2201
+ }
2202
+ var xai = createXai();
2203
+ export {
2204
+ VERSION,
2205
+ codeExecution,
2206
+ createXai,
2207
+ viewImage,
2208
+ viewXVideo,
2209
+ webSearch,
2210
+ xSearch,
2211
+ xai,
2212
+ xaiTools
2213
+ };
2214
+ //# sourceMappingURL=index.mjs.map