orcaq 1.0.26 → 1.0.28

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 (1434) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/-lZvfnzr.js +1 -0
  3. package/.output/public/_nuxt/ACi_yrrw.js +1 -0
  4. package/.output/public/_nuxt/AgentWorkspace.67IpTcyl.css +1 -0
  5. package/.output/public/_nuxt/B-E3EDXq.js +21 -0
  6. package/.output/public/_nuxt/B-o1cyu1.js +1 -0
  7. package/.output/public/_nuxt/B-rj9QI0.js +1 -0
  8. package/.output/public/_nuxt/B0pvfm-W.js +1 -0
  9. package/.output/public/_nuxt/B3XOCDJg.js +1 -0
  10. package/.output/public/_nuxt/B7iORLht.js +8 -0
  11. package/.output/public/_nuxt/B9xm8XSJ.js +1 -0
  12. package/.output/public/_nuxt/BDPGejuO.js +2 -0
  13. package/.output/public/_nuxt/BHFnD9yO.js +1 -0
  14. package/.output/public/_nuxt/BHp-OX9z.js +1 -0
  15. package/.output/public/_nuxt/BIW9Rd2L.js +1 -0
  16. package/.output/public/_nuxt/BJdgR-zN.js +1 -0
  17. package/.output/public/_nuxt/BKltSiU0.js +1 -0
  18. package/.output/public/_nuxt/BQAF7cM_.js +53 -0
  19. package/.output/public/_nuxt/BRpeq4XL.js +1 -0
  20. package/.output/public/_nuxt/BSs5g8DH.js +1 -0
  21. package/.output/public/_nuxt/BUuSKT2f.js +152 -0
  22. package/.output/public/_nuxt/BV4_2PzU.js +1 -0
  23. package/.output/public/_nuxt/BVmBXPoG.js +1 -0
  24. package/.output/public/_nuxt/BZEKLHO-.js +1 -0
  25. package/.output/public/_nuxt/BaseCodeEditor.SAr2eD8R.css +1 -0
  26. package/.output/public/_nuxt/BiOIaWuc.js +1 -0
  27. package/.output/public/_nuxt/BlWNlw-C.js +15 -0
  28. package/.output/public/_nuxt/BranJUWp.js +1 -0
  29. package/.output/public/_nuxt/BsnN2mQb.js +3 -0
  30. package/.output/public/_nuxt/BwddCgOY.js +1 -0
  31. package/.output/public/_nuxt/C26aAkUg.js +39 -0
  32. package/.output/public/_nuxt/CAcIcjka.js +9 -0
  33. package/.output/public/_nuxt/CO-m0olR.js +2 -0
  34. package/.output/public/_nuxt/CQNFvXDN.js +1 -0
  35. package/.output/public/_nuxt/CQQKPHb8.js +225 -0
  36. package/.output/public/_nuxt/CQr87mff.js +1 -0
  37. package/.output/public/_nuxt/C__Jz_zH.js +40 -0
  38. package/.output/public/_nuxt/CbjqLbgu.js +1 -0
  39. package/.output/public/_nuxt/CfblXyCF.js +1 -0
  40. package/.output/public/_nuxt/Cqe10li5.js +1 -0
  41. package/.output/public/_nuxt/CwtNS48a.js +1 -0
  42. package/.output/public/_nuxt/D4jtSPyP.js +3 -0
  43. package/.output/public/_nuxt/D8s-WG7x.js +1 -0
  44. package/.output/public/_nuxt/D9SCXF1G.js +1 -0
  45. package/.output/public/_nuxt/DAsY4LnG.js +1 -0
  46. package/.output/public/_nuxt/DM73sEXg.js +1 -0
  47. package/.output/public/_nuxt/DNmOzKte.js +1 -0
  48. package/.output/public/_nuxt/DdMwxl0I.js +1 -0
  49. package/.output/public/_nuxt/DfL_wWxk.js +1 -0
  50. package/.output/public/_nuxt/DftZZFKd.js +732 -0
  51. package/.output/public/_nuxt/DgPgl0Vt.js +39 -0
  52. package/.output/public/_nuxt/DpyvTVPg.js +8 -0
  53. package/.output/public/_nuxt/Ds4ET3BG.js +72 -0
  54. package/.output/public/_nuxt/Dwm3kp4S.js +3867 -0
  55. package/.output/public/_nuxt/DynamicTable.BW0D7NXb.css +1 -0
  56. package/.output/public/_nuxt/GqcI3eLm.js +67 -0
  57. package/.output/public/_nuxt/QuickQuery.CJ7tNjo4.css +1 -0
  58. package/.output/public/_nuxt/S6q6IfIg.js +6 -0
  59. package/.output/public/_nuxt/SzZsnvJ-.js +2 -0
  60. package/.output/public/_nuxt/T2yrk5P8.js +1 -0
  61. package/.output/public/_nuxt/UrLgZoyE.js +9 -0
  62. package/.output/public/_nuxt/W0T58tNs.js +1 -0
  63. package/.output/public/_nuxt/WrapperErdDiagram.DsE2QNGr.css +1 -0
  64. package/.output/public/_nuxt/Yzrsuije.js +1 -0
  65. package/.output/public/_nuxt/_fileId_.B3PtfMYN.css +1 -0
  66. package/.output/public/_nuxt/aKVabwds.js +1 -0
  67. package/.output/public/_nuxt/builds/latest.json +1 -1
  68. package/.output/public/_nuxt/builds/meta/1e32d709-950d-49a3-8d61-1b3385318747.json +1 -0
  69. package/.output/public/_nuxt/default.DC7ec2JI.css +1 -0
  70. package/.output/public/_nuxt/entry.Kia9TCip.css +1 -0
  71. package/.output/public/_nuxt/fuZLfV_i.js +1 -0
  72. package/.output/public/_nuxt/iDT-eQ46.js +1 -0
  73. package/.output/public/_nuxt/index.P0q-dO_S.css +1 -0
  74. package/.output/public/_nuxt/lN7hePE6.js +1 -0
  75. package/.output/public/_nuxt/logo.BsJ2Dfin.png +0 -0
  76. package/.output/public/_nuxt/mW-nBTJP.js +1 -0
  77. package/.output/public/_nuxt/rdXrKZa8.js +68 -0
  78. package/.output/public/_nuxt/vU5dtBjy.js +1 -0
  79. package/.output/public/logo-8-bits.svg +4 -0
  80. package/.output/server/chunks/_/create-adapter.mjs +68 -0
  81. package/.output/server/chunks/_/create-adapter.mjs.map +1 -0
  82. package/.output/server/chunks/_/database-error.mjs +53 -0
  83. package/.output/server/chunks/_/database-error.mjs.map +1 -0
  84. package/.output/server/chunks/_/database-roles.factory.mjs +737 -0
  85. package/.output/server/chunks/_/database-roles.factory.mjs.map +1 -0
  86. package/.output/server/chunks/_/db-connection.mjs +352 -0
  87. package/.output/server/chunks/_/db-connection.mjs.map +1 -0
  88. package/.output/server/chunks/_/error.mjs +25 -0
  89. package/.output/server/chunks/_/error.mjs.map +1 -0
  90. package/.output/server/chunks/_/functions.factory.mjs +174 -0
  91. package/.output/server/chunks/_/functions.factory.mjs.map +1 -0
  92. package/.output/server/chunks/_/instance-insights.factory.mjs +643 -0
  93. package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -0
  94. package/.output/server/chunks/_/metadata.factory.mjs +583 -0
  95. package/.output/server/chunks/_/metadata.factory.mjs.map +1 -0
  96. package/.output/server/chunks/_/query.factory.mjs +163 -0
  97. package/.output/server/chunks/_/query.factory.mjs.map +1 -0
  98. package/.output/server/chunks/_/tables.factory.mjs +788 -0
  99. package/.output/server/chunks/_/tables.factory.mjs.map +1 -0
  100. package/.output/server/chunks/_/views.factory.mjs +227 -0
  101. package/.output/server/chunks/_/views.factory.mjs.map +1 -0
  102. package/.output/server/chunks/build/client.manifest.mjs +565 -319
  103. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  104. package/.output/server/chunks/nitro/nitro.mjs +717 -804
  105. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  106. package/.output/server/chunks/routes/api/ai/agent.mjs +1626 -0
  107. package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -0
  108. package/.output/server/chunks/routes/api/ai/chat.mjs +2 -2
  109. package/.output/server/chunks/routes/api/database-export/export-database.mjs +16 -5
  110. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  111. package/.output/server/chunks/routes/api/database-import/import-database.mjs +31 -5
  112. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  113. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +13 -7
  114. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
  115. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +13 -7
  116. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
  117. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +13 -7
  118. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
  119. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +20 -9
  120. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
  121. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +13 -7
  122. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
  123. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +13 -7
  124. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
  125. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +13 -7
  126. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
  127. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +13 -7
  128. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
  129. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +13 -7
  130. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
  131. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +13 -7
  132. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
  133. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +13 -7
  134. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
  135. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +13 -7
  136. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
  137. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +13 -7
  138. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
  139. package/.output/server/chunks/routes/api/functions/definition.post.mjs +35 -0
  140. package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -0
  141. package/.output/server/chunks/routes/api/functions/delete.post.mjs +41 -0
  142. package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -0
  143. package/.output/server/chunks/routes/api/functions/overview.post.mjs +42 -0
  144. package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -0
  145. package/.output/server/chunks/routes/api/functions/rename.post.mjs +48 -0
  146. package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -0
  147. package/.output/server/chunks/routes/api/functions/signature.post.mjs +35 -0
  148. package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -0
  149. package/.output/server/chunks/routes/api/functions/update.post.mjs +45 -0
  150. package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -0
  151. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +55 -0
  152. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -0
  153. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +58 -0
  154. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -0
  155. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +55 -0
  156. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -0
  157. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +55 -0
  158. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -0
  159. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +55 -0
  160. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -0
  161. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +55 -0
  162. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -0
  163. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +55 -0
  164. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -0
  165. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +60 -0
  166. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -0
  167. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +15 -4
  168. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
  169. package/.output/server/chunks/routes/api/metadata/erd.post.mjs +34 -0
  170. package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -0
  171. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +36 -0
  172. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -0
  173. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +35 -0
  174. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -0
  175. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +103 -0
  176. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -0
  177. package/.output/server/chunks/routes/api/query/execute.post.mjs +46 -0
  178. package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -0
  179. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +44 -0
  180. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -0
  181. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +48 -0
  182. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -0
  183. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +49 -0
  184. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -0
  185. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +50 -0
  186. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -0
  187. package/.output/server/chunks/routes/api/tables/ddl.post.mjs +32 -0
  188. package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -0
  189. package/.output/server/chunks/routes/api/tables/export.post.mjs +47 -0
  190. package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -0
  191. package/.output/server/chunks/routes/api/tables/indexes.post.mjs +32 -0
  192. package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -0
  193. package/.output/server/chunks/routes/api/tables/meta.post.mjs +39 -0
  194. package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -0
  195. package/.output/server/chunks/routes/api/tables/overview.post.mjs +32 -0
  196. package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -0
  197. package/.output/server/chunks/routes/api/tables/rls.post.mjs +36 -0
  198. package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -0
  199. package/.output/server/chunks/routes/api/tables/rules.post.mjs +32 -0
  200. package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -0
  201. package/.output/server/chunks/routes/api/tables/size.post.mjs +32 -0
  202. package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -0
  203. package/.output/server/chunks/routes/api/tables/structure.post.mjs +32 -0
  204. package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -0
  205. package/.output/server/chunks/routes/api/tables/triggers.post.mjs +32 -0
  206. package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -0
  207. package/.output/server/chunks/routes/api/views/definition.post.mjs +27 -0
  208. package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -0
  209. package/.output/server/chunks/routes/api/views/dependencies.post.mjs +27 -0
  210. package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -0
  211. package/.output/server/chunks/routes/api/views/explain.post.mjs +29 -0
  212. package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -0
  213. package/.output/server/chunks/routes/api/views/indexes.post.mjs +27 -0
  214. package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -0
  215. package/.output/server/chunks/routes/api/views/meta.post.mjs +27 -0
  216. package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -0
  217. package/.output/server/chunks/routes/api/views/overview.post.mjs +27 -0
  218. package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -0
  219. package/.output/server/chunks/routes/renderer.mjs +4 -4
  220. package/.output/server/chunks/virtual/_virtual_spa-template.mjs +1 -1
  221. package/.output/server/index.mjs +3 -3
  222. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/dist/index.mjs +2756 -0
  223. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  224. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/node_modules/@ai-sdk/provider/package.json +63 -0
  225. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.19/package.json +81 -0
  226. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/dist/index.mjs +2549 -0
  227. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  228. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/node_modules/@ai-sdk/provider/package.json +57 -0
  229. package/.output/server/node_modules/.nitro/@ai-sdk/provider-utils@4.0.4/package.json +75 -0
  230. package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.2/dist/index.mjs +377 -0
  231. package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.2/package.json +57 -0
  232. package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.8/dist/index.mjs +404 -0
  233. package/.output/server/node_modules/.nitro/@ai-sdk/provider@3.0.8/package.json +63 -0
  234. package/.output/server/node_modules/.nitro/debug@4.3.4/node_modules/ms/index.js +162 -0
  235. package/.output/server/node_modules/.nitro/debug@4.3.4/node_modules/ms/package.json +37 -0
  236. package/.output/server/node_modules/.nitro/debug@4.3.4/package.json +59 -0
  237. package/.output/server/node_modules/.nitro/debug@4.3.4/src/browser.js +269 -0
  238. package/.output/server/node_modules/.nitro/debug@4.3.4/src/common.js +274 -0
  239. package/.output/server/node_modules/.nitro/debug@4.3.4/src/index.js +10 -0
  240. package/.output/server/node_modules/.nitro/debug@4.3.4/src/node.js +263 -0
  241. package/.output/server/node_modules/.nitro/debug@4.4.0/node_modules/ms/index.js +162 -0
  242. package/.output/server/node_modules/.nitro/debug@4.4.0/node_modules/ms/package.json +38 -0
  243. package/.output/server/node_modules/.nitro/debug@4.4.0/package.json +65 -0
  244. package/.output/server/node_modules/.nitro/debug@4.4.0/src/browser.js +272 -0
  245. package/.output/server/node_modules/.nitro/debug@4.4.0/src/common.js +292 -0
  246. package/.output/server/node_modules/.nitro/debug@4.4.0/src/index.js +10 -0
  247. package/.output/server/node_modules/.nitro/debug@4.4.0/src/node.js +263 -0
  248. package/.output/server/node_modules/.nitro/ms@2.1.2/index.js +162 -0
  249. package/.output/server/node_modules/.nitro/ms@2.1.2/package.json +37 -0
  250. package/.output/server/node_modules/.nitro/ms@2.1.3/index.js +162 -0
  251. package/.output/server/node_modules/.nitro/ms@2.1.3/package.json +38 -0
  252. package/.output/server/node_modules/.nitro/pg-connection-string@2.6.2/index.js +112 -0
  253. package/.output/server/node_modules/.nitro/pg-connection-string@2.6.2/package.json +40 -0
  254. package/.output/server/node_modules/.nitro/pg-connection-string@2.7.0/index.js +112 -0
  255. package/.output/server/node_modules/.nitro/pg-connection-string@2.7.0/package.json +40 -0
  256. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  257. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider/package.json +57 -0
  258. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
  259. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  260. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
  261. package/.output/server/node_modules/@ai-sdk/anthropic/node_modules/@ai-sdk/provider-utils/package.json +75 -0
  262. package/.output/server/node_modules/@ai-sdk/gateway/dist/index.mjs +539 -82
  263. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  264. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider/package.json +63 -0
  265. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
  266. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  267. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
  268. package/.output/server/node_modules/@ai-sdk/gateway/node_modules/@ai-sdk/provider-utils/package.json +81 -0
  269. package/.output/server/node_modules/@ai-sdk/gateway/package.json +16 -5
  270. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  271. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider/package.json +57 -0
  272. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
  273. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  274. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
  275. package/.output/server/node_modules/@ai-sdk/google/node_modules/@ai-sdk/provider-utils/package.json +75 -0
  276. package/.output/server/node_modules/@ai-sdk/openai/dist/index.mjs +1498 -961
  277. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  278. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider/package.json +63 -0
  279. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
  280. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  281. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
  282. package/.output/server/node_modules/@ai-sdk/openai/node_modules/@ai-sdk/provider-utils/package.json +81 -0
  283. package/.output/server/node_modules/@ai-sdk/openai/package.json +14 -5
  284. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  285. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider/package.json +57 -0
  286. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
  287. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  288. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
  289. package/.output/server/node_modules/@ai-sdk/openai-compatible/node_modules/@ai-sdk/provider-utils/package.json +75 -0
  290. package/.output/server/node_modules/@ai-sdk/provider/dist/index.mjs +32 -5
  291. package/.output/server/node_modules/@ai-sdk/provider/package.json +7 -1
  292. package/.output/server/node_modules/@ai-sdk/provider-utils/dist/index.mjs +231 -24
  293. package/.output/server/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  294. package/.output/server/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
  295. package/.output/server/node_modules/@ai-sdk/provider-utils/package.json +8 -2
  296. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  297. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider/package.json +57 -0
  298. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
  299. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
  300. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +57 -0
  301. package/.output/server/node_modules/@ai-sdk/xai/node_modules/@ai-sdk/provider-utils/package.json +75 -0
  302. package/.output/server/node_modules/@iconify/utils/node_modules/debug/node_modules/ms/index.js +162 -0
  303. package/.output/server/node_modules/@iconify/utils/node_modules/debug/node_modules/ms/package.json +38 -0
  304. package/.output/server/node_modules/@iconify/utils/node_modules/debug/package.json +65 -0
  305. package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/browser.js +272 -0
  306. package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/common.js +292 -0
  307. package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/index.js +10 -0
  308. package/.output/server/node_modules/@iconify/utils/node_modules/debug/src/node.js +263 -0
  309. package/.output/server/node_modules/@openrouter/ai-sdk-provider/dist/index.mjs +4656 -0
  310. package/.output/server/node_modules/@openrouter/ai-sdk-provider/package.json +82 -0
  311. package/.output/server/node_modules/ag-grid-community/dist/package/main.esm.mjs +50065 -0
  312. package/.output/server/node_modules/ag-grid-community/package.json +113 -0
  313. package/.output/server/node_modules/ai/dist/index.mjs +2069 -918
  314. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  315. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider/package.json +63 -0
  316. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2756 -0
  317. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/dist/index.mjs +404 -0
  318. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/node_modules/@ai-sdk/provider/package.json +63 -0
  319. package/.output/server/node_modules/ai/node_modules/@ai-sdk/provider-utils/package.json +81 -0
  320. package/.output/server/node_modules/ai/package.json +15 -6
  321. package/.output/server/node_modules/asn1/lib/ber/errors.js +13 -0
  322. package/.output/server/node_modules/asn1/lib/ber/index.js +27 -0
  323. package/.output/server/node_modules/asn1/lib/ber/reader.js +262 -0
  324. package/.output/server/node_modules/asn1/lib/ber/types.js +36 -0
  325. package/.output/server/node_modules/asn1/lib/ber/writer.js +317 -0
  326. package/.output/server/node_modules/asn1/lib/index.js +20 -0
  327. package/.output/server/node_modules/asn1/package.json +31 -0
  328. package/.output/server/node_modules/bcrypt-pbkdf/index.js +556 -0
  329. package/.output/server/node_modules/bcrypt-pbkdf/package.json +15 -0
  330. package/.output/server/node_modules/colorette/index.cjs +218 -0
  331. package/.output/server/node_modules/colorette/package.json +39 -0
  332. package/.output/server/node_modules/debug/node_modules/ms/index.js +162 -0
  333. package/.output/server/node_modules/debug/node_modules/ms/package.json +38 -0
  334. package/.output/server/node_modules/file-saver/dist/FileSaver.min.js +3 -0
  335. package/.output/server/node_modules/file-saver/package.json +40 -0
  336. package/.output/server/node_modules/get-package-type/async.cjs +52 -0
  337. package/.output/server/node_modules/get-package-type/cache.cjs +3 -0
  338. package/.output/server/node_modules/get-package-type/index.cjs +7 -0
  339. package/.output/server/node_modules/get-package-type/is-node-modules.cjs +15 -0
  340. package/.output/server/node_modules/get-package-type/package.json +35 -0
  341. package/.output/server/node_modules/get-package-type/sync.cjs +42 -0
  342. package/.output/server/node_modules/knex/knex.js +23 -0
  343. package/.output/server/node_modules/knex/knex.mjs +11 -0
  344. package/.output/server/node_modules/knex/lib/builder-interface-augmenter.js +120 -0
  345. package/.output/server/node_modules/knex/lib/client.js +495 -0
  346. package/.output/server/node_modules/knex/lib/constants.js +61 -0
  347. package/.output/server/node_modules/knex/lib/dialects/better-sqlite3/index.js +77 -0
  348. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-columncompiler.js +14 -0
  349. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-querybuilder.js +11 -0
  350. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-querycompiler.js +122 -0
  351. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-tablecompiler.js +37 -0
  352. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/crdb-viewcompiler.js +15 -0
  353. package/.output/server/node_modules/knex/lib/dialects/cockroachdb/index.js +86 -0
  354. package/.output/server/node_modules/knex/lib/dialects/index.js +34 -0
  355. package/.output/server/node_modules/knex/lib/dialects/mssql/index.js +500 -0
  356. package/.output/server/node_modules/knex/lib/dialects/mssql/mssql-formatter.js +34 -0
  357. package/.output/server/node_modules/knex/lib/dialects/mssql/query/mssql-querycompiler.js +601 -0
  358. package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-columncompiler.js +185 -0
  359. package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-compiler.js +91 -0
  360. package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-tablecompiler.js +378 -0
  361. package/.output/server/node_modules/knex/lib/dialects/mssql/schema/mssql-viewcompiler.js +55 -0
  362. package/.output/server/node_modules/knex/lib/dialects/mssql/transaction.js +176 -0
  363. package/.output/server/node_modules/knex/lib/dialects/mysql/index.js +206 -0
  364. package/.output/server/node_modules/knex/lib/dialects/mysql/query/mysql-querybuilder.js +14 -0
  365. package/.output/server/node_modules/knex/lib/dialects/mysql/query/mysql-querycompiler.js +292 -0
  366. package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-columncompiler.js +193 -0
  367. package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-compiler.js +60 -0
  368. package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-tablecompiler.js +405 -0
  369. package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-viewbuilder.js +21 -0
  370. package/.output/server/node_modules/knex/lib/dialects/mysql/schema/mysql-viewcompiler.js +15 -0
  371. package/.output/server/node_modules/knex/lib/dialects/mysql/transaction.js +46 -0
  372. package/.output/server/node_modules/knex/lib/dialects/mysql2/index.js +53 -0
  373. package/.output/server/node_modules/knex/lib/dialects/mysql2/transaction.js +44 -0
  374. package/.output/server/node_modules/knex/lib/dialects/oracle/index.js +92 -0
  375. package/.output/server/node_modules/knex/lib/dialects/oracle/query/oracle-querycompiler.js +343 -0
  376. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/internal/incrementUtils.js +22 -0
  377. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/internal/trigger.js +155 -0
  378. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-columnbuilder.js +17 -0
  379. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-columncompiler.js +126 -0
  380. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-compiler.js +124 -0
  381. package/.output/server/node_modules/knex/lib/dialects/oracle/schema/oracle-tablecompiler.js +197 -0
  382. package/.output/server/node_modules/knex/lib/dialects/oracle/utils.js +106 -0
  383. package/.output/server/node_modules/knex/lib/dialects/oracledb/index.js +381 -0
  384. package/.output/server/node_modules/knex/lib/dialects/oracledb/query/oracledb-querycompiler.js +481 -0
  385. package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-columncompiler.js +61 -0
  386. package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-tablecompiler.js +19 -0
  387. package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewbuilder.js +13 -0
  388. package/.output/server/node_modules/knex/lib/dialects/oracledb/schema/oracledb-viewcompiler.js +19 -0
  389. package/.output/server/node_modules/knex/lib/dialects/oracledb/transaction.js +98 -0
  390. package/.output/server/node_modules/knex/lib/dialects/oracledb/utils.js +208 -0
  391. package/.output/server/node_modules/knex/lib/dialects/pgnative/index.js +60 -0
  392. package/.output/server/node_modules/knex/lib/dialects/postgres/execution/pg-transaction.js +19 -0
  393. package/.output/server/node_modules/knex/lib/dialects/postgres/index.js +361 -0
  394. package/.output/server/node_modules/knex/lib/dialects/postgres/query/pg-querybuilder.js +43 -0
  395. package/.output/server/node_modules/knex/lib/dialects/postgres/query/pg-querycompiler.js +400 -0
  396. package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-columncompiler.js +156 -0
  397. package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-compiler.js +138 -0
  398. package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-tablecompiler.js +304 -0
  399. package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-viewbuilder.js +21 -0
  400. package/.output/server/node_modules/knex/lib/dialects/postgres/schema/pg-viewcompiler.js +35 -0
  401. package/.output/server/node_modules/knex/lib/dialects/redshift/index.js +86 -0
  402. package/.output/server/node_modules/knex/lib/dialects/redshift/query/redshift-querycompiler.js +163 -0
  403. package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-columnbuilder.js +22 -0
  404. package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-columncompiler.js +67 -0
  405. package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-compiler.js +14 -0
  406. package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-tablecompiler.js +122 -0
  407. package/.output/server/node_modules/knex/lib/dialects/redshift/schema/redshift-viewcompiler.js +11 -0
  408. package/.output/server/node_modules/knex/lib/dialects/redshift/transaction.js +32 -0
  409. package/.output/server/node_modules/knex/lib/dialects/sqlite3/execution/sqlite-transaction.js +25 -0
  410. package/.output/server/node_modules/knex/lib/dialects/sqlite3/index.js +250 -0
  411. package/.output/server/node_modules/knex/lib/dialects/sqlite3/query/sqlite-querybuilder.js +33 -0
  412. package/.output/server/node_modules/knex/lib/dialects/sqlite3/query/sqlite-querycompiler.js +334 -0
  413. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/ddl.js +400 -0
  414. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/compiler.js +327 -0
  415. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/parser-combinator.js +161 -0
  416. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/parser.js +638 -0
  417. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/sqlite-ddl-operations.js +41 -0
  418. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/tokenizer.js +38 -0
  419. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/internal/utils.js +12 -0
  420. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-columncompiler.js +50 -0
  421. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-compiler.js +80 -0
  422. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-tablecompiler.js +347 -0
  423. package/.output/server/node_modules/knex/lib/dialects/sqlite3/schema/sqlite-viewcompiler.js +40 -0
  424. package/.output/server/node_modules/knex/lib/execution/batch-insert.js +51 -0
  425. package/.output/server/node_modules/knex/lib/execution/internal/delay.js +6 -0
  426. package/.output/server/node_modules/knex/lib/execution/internal/ensure-connection-callback.js +41 -0
  427. package/.output/server/node_modules/knex/lib/execution/internal/query-executioner.js +62 -0
  428. package/.output/server/node_modules/knex/lib/execution/runner.js +325 -0
  429. package/.output/server/node_modules/knex/lib/execution/transaction.js +413 -0
  430. package/.output/server/node_modules/knex/lib/formatter/formatterUtils.js +42 -0
  431. package/.output/server/node_modules/knex/lib/formatter/rawFormatter.js +84 -0
  432. package/.output/server/node_modules/knex/lib/formatter/wrappingFormatter.js +250 -0
  433. package/.output/server/node_modules/knex/lib/formatter.js +25 -0
  434. package/.output/server/node_modules/knex/lib/index.js +3 -0
  435. package/.output/server/node_modules/knex/lib/knex-builder/FunctionHelper.js +80 -0
  436. package/.output/server/node_modules/knex/lib/knex-builder/Knex.js +59 -0
  437. package/.output/server/node_modules/knex/lib/knex-builder/internal/config-resolver.js +57 -0
  438. package/.output/server/node_modules/knex/lib/knex-builder/internal/parse-connection.js +87 -0
  439. package/.output/server/node_modules/knex/lib/knex-builder/make-knex.js +345 -0
  440. package/.output/server/node_modules/knex/lib/logger.js +76 -0
  441. package/.output/server/node_modules/knex/lib/migrations/common/MigrationsLoader.js +36 -0
  442. package/.output/server/node_modules/knex/lib/migrations/migrate/MigrationGenerator.js +84 -0
  443. package/.output/server/node_modules/knex/lib/migrations/migrate/Migrator.js +599 -0
  444. package/.output/server/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js +33 -0
  445. package/.output/server/node_modules/knex/lib/migrations/migrate/migrator-configuration-merger.js +58 -0
  446. package/.output/server/node_modules/knex/lib/migrations/migrate/sources/fs-migrations.js +74 -0
  447. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/cjs.stub +15 -0
  448. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/coffee.stub +13 -0
  449. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/eg.stub +14 -0
  450. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/js-schema.stub +22 -0
  451. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/js.stub +22 -0
  452. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-coffee.stub +34 -0
  453. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-eg.stub +43 -0
  454. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-js.stub +47 -0
  455. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-ls.stub +35 -0
  456. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/knexfile-ts.stub +47 -0
  457. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ls.stub +14 -0
  458. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/mjs.stub +23 -0
  459. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ts-schema.stub +21 -0
  460. package/.output/server/node_modules/knex/lib/migrations/migrate/stub/ts.stub +21 -0
  461. package/.output/server/node_modules/knex/lib/migrations/migrate/table-creator.js +77 -0
  462. package/.output/server/node_modules/knex/lib/migrations/migrate/table-resolver.js +27 -0
  463. package/.output/server/node_modules/knex/lib/migrations/seed/Seeder.js +137 -0
  464. package/.output/server/node_modules/knex/lib/migrations/seed/seeder-configuration-merger.js +60 -0
  465. package/.output/server/node_modules/knex/lib/migrations/seed/sources/fs-seeds.js +65 -0
  466. package/.output/server/node_modules/knex/lib/migrations/seed/stub/coffee.stub +9 -0
  467. package/.output/server/node_modules/knex/lib/migrations/seed/stub/eg.stub +11 -0
  468. package/.output/server/node_modules/knex/lib/migrations/seed/stub/js.stub +13 -0
  469. package/.output/server/node_modules/knex/lib/migrations/seed/stub/ls.stub +11 -0
  470. package/.output/server/node_modules/knex/lib/migrations/seed/stub/mjs.stub +12 -0
  471. package/.output/server/node_modules/knex/lib/migrations/seed/stub/ts.stub +13 -0
  472. package/.output/server/node_modules/knex/lib/migrations/util/fs.js +86 -0
  473. package/.output/server/node_modules/knex/lib/migrations/util/import-file.js +12 -0
  474. package/.output/server/node_modules/knex/lib/migrations/util/is-module-type.js +9 -0
  475. package/.output/server/node_modules/knex/lib/migrations/util/template.js +52 -0
  476. package/.output/server/node_modules/knex/lib/migrations/util/timestamp.js +14 -0
  477. package/.output/server/node_modules/knex/lib/query/analytic.js +52 -0
  478. package/.output/server/node_modules/knex/lib/query/constants.js +15 -0
  479. package/.output/server/node_modules/knex/lib/query/joinclause.js +270 -0
  480. package/.output/server/node_modules/knex/lib/query/method-constants.js +136 -0
  481. package/.output/server/node_modules/knex/lib/query/querybuilder.js +1793 -0
  482. package/.output/server/node_modules/knex/lib/query/querycompiler.js +1591 -0
  483. package/.output/server/node_modules/knex/lib/raw.js +139 -0
  484. package/.output/server/node_modules/knex/lib/ref.js +39 -0
  485. package/.output/server/node_modules/knex/lib/schema/builder.js +115 -0
  486. package/.output/server/node_modules/knex/lib/schema/columnbuilder.js +146 -0
  487. package/.output/server/node_modules/knex/lib/schema/columncompiler.js +307 -0
  488. package/.output/server/node_modules/knex/lib/schema/compiler.js +187 -0
  489. package/.output/server/node_modules/knex/lib/schema/internal/helpers.js +55 -0
  490. package/.output/server/node_modules/knex/lib/schema/tablebuilder.js +376 -0
  491. package/.output/server/node_modules/knex/lib/schema/tablecompiler.js +439 -0
  492. package/.output/server/node_modules/knex/lib/schema/viewbuilder.js +92 -0
  493. package/.output/server/node_modules/knex/lib/schema/viewcompiler.js +138 -0
  494. package/.output/server/node_modules/knex/lib/util/finally-mixin.js +13 -0
  495. package/.output/server/node_modules/knex/lib/util/helpers.js +95 -0
  496. package/.output/server/node_modules/knex/lib/util/is.js +32 -0
  497. package/.output/server/node_modules/knex/lib/util/nanoid.js +40 -0
  498. package/.output/server/node_modules/knex/lib/util/noop.js +1 -0
  499. package/.output/server/node_modules/knex/lib/util/save-async-stack.js +14 -0
  500. package/.output/server/node_modules/knex/lib/util/security.js +26 -0
  501. package/.output/server/node_modules/knex/lib/util/string.js +190 -0
  502. package/.output/server/node_modules/knex/lib/util/timeout.js +29 -0
  503. package/.output/server/node_modules/knex/node_modules/debug/node_modules/ms/index.js +162 -0
  504. package/.output/server/node_modules/knex/node_modules/debug/node_modules/ms/package.json +37 -0
  505. package/.output/server/node_modules/knex/node_modules/debug/package.json +59 -0
  506. package/.output/server/node_modules/knex/node_modules/debug/src/browser.js +269 -0
  507. package/.output/server/node_modules/knex/node_modules/debug/src/common.js +274 -0
  508. package/.output/server/node_modules/knex/node_modules/debug/src/index.js +10 -0
  509. package/.output/server/node_modules/knex/node_modules/debug/src/node.js +263 -0
  510. package/.output/server/node_modules/knex/node_modules/pg-connection-string/index.js +112 -0
  511. package/.output/server/node_modules/knex/node_modules/pg-connection-string/package.json +40 -0
  512. package/.output/server/node_modules/knex/package.json +267 -0
  513. package/.output/server/node_modules/lodash/_DataView.js +7 -0
  514. package/.output/server/node_modules/lodash/_Hash.js +32 -0
  515. package/.output/server/node_modules/lodash/_ListCache.js +32 -0
  516. package/.output/server/node_modules/lodash/_Map.js +7 -0
  517. package/.output/server/node_modules/lodash/_MapCache.js +32 -0
  518. package/.output/server/node_modules/lodash/_Promise.js +7 -0
  519. package/.output/server/node_modules/lodash/_Set.js +7 -0
  520. package/.output/server/node_modules/lodash/_SetCache.js +27 -0
  521. package/.output/server/node_modules/lodash/_Stack.js +27 -0
  522. package/.output/server/node_modules/lodash/_Symbol.js +6 -0
  523. package/.output/server/node_modules/lodash/_Uint8Array.js +6 -0
  524. package/.output/server/node_modules/lodash/_WeakMap.js +7 -0
  525. package/.output/server/node_modules/lodash/_apply.js +21 -0
  526. package/.output/server/node_modules/lodash/_arrayAggregator.js +22 -0
  527. package/.output/server/node_modules/lodash/_arrayEach.js +22 -0
  528. package/.output/server/node_modules/lodash/_arrayFilter.js +25 -0
  529. package/.output/server/node_modules/lodash/_arrayIncludes.js +17 -0
  530. package/.output/server/node_modules/lodash/_arrayIncludesWith.js +22 -0
  531. package/.output/server/node_modules/lodash/_arrayLikeKeys.js +49 -0
  532. package/.output/server/node_modules/lodash/_arrayMap.js +21 -0
  533. package/.output/server/node_modules/lodash/_arrayPush.js +20 -0
  534. package/.output/server/node_modules/lodash/_arrayReduce.js +26 -0
  535. package/.output/server/node_modules/lodash/_arraySome.js +23 -0
  536. package/.output/server/node_modules/lodash/_asciiToArray.js +12 -0
  537. package/.output/server/node_modules/lodash/_assignMergeValue.js +20 -0
  538. package/.output/server/node_modules/lodash/_assignValue.js +28 -0
  539. package/.output/server/node_modules/lodash/_assocIndexOf.js +21 -0
  540. package/.output/server/node_modules/lodash/_baseAggregator.js +21 -0
  541. package/.output/server/node_modules/lodash/_baseAssign.js +17 -0
  542. package/.output/server/node_modules/lodash/_baseAssignIn.js +17 -0
  543. package/.output/server/node_modules/lodash/_baseAssignValue.js +25 -0
  544. package/.output/server/node_modules/lodash/_baseClone.js +166 -0
  545. package/.output/server/node_modules/lodash/_baseCreate.js +30 -0
  546. package/.output/server/node_modules/lodash/_baseDelay.js +21 -0
  547. package/.output/server/node_modules/lodash/_baseDifference.js +67 -0
  548. package/.output/server/node_modules/lodash/_baseEach.js +14 -0
  549. package/.output/server/node_modules/lodash/_baseExtremum.js +32 -0
  550. package/.output/server/node_modules/lodash/_baseFilter.js +21 -0
  551. package/.output/server/node_modules/lodash/_baseFindIndex.js +24 -0
  552. package/.output/server/node_modules/lodash/_baseFlatten.js +38 -0
  553. package/.output/server/node_modules/lodash/_baseFor.js +16 -0
  554. package/.output/server/node_modules/lodash/_baseForOwn.js +16 -0
  555. package/.output/server/node_modules/lodash/_baseGet.js +24 -0
  556. package/.output/server/node_modules/lodash/_baseGetAllKeys.js +20 -0
  557. package/.output/server/node_modules/lodash/_baseGetTag.js +28 -0
  558. package/.output/server/node_modules/lodash/_baseGt.js +14 -0
  559. package/.output/server/node_modules/lodash/_baseHas.js +19 -0
  560. package/.output/server/node_modules/lodash/_baseHasIn.js +13 -0
  561. package/.output/server/node_modules/lodash/_baseIndexOf.js +20 -0
  562. package/.output/server/node_modules/lodash/_baseIsArguments.js +18 -0
  563. package/.output/server/node_modules/lodash/_baseIsEqual.js +28 -0
  564. package/.output/server/node_modules/lodash/_baseIsEqualDeep.js +83 -0
  565. package/.output/server/node_modules/lodash/_baseIsMap.js +18 -0
  566. package/.output/server/node_modules/lodash/_baseIsMatch.js +62 -0
  567. package/.output/server/node_modules/lodash/_baseIsNaN.js +12 -0
  568. package/.output/server/node_modules/lodash/_baseIsNative.js +47 -0
  569. package/.output/server/node_modules/lodash/_baseIsSet.js +18 -0
  570. package/.output/server/node_modules/lodash/_baseIsTypedArray.js +60 -0
  571. package/.output/server/node_modules/lodash/_baseIteratee.js +31 -0
  572. package/.output/server/node_modules/lodash/_baseKeys.js +30 -0
  573. package/.output/server/node_modules/lodash/_baseKeysIn.js +33 -0
  574. package/.output/server/node_modules/lodash/_baseMap.js +22 -0
  575. package/.output/server/node_modules/lodash/_baseMatches.js +22 -0
  576. package/.output/server/node_modules/lodash/_baseMatchesProperty.js +33 -0
  577. package/.output/server/node_modules/lodash/_baseMerge.js +42 -0
  578. package/.output/server/node_modules/lodash/_baseMergeDeep.js +94 -0
  579. package/.output/server/node_modules/lodash/_baseOrderBy.js +49 -0
  580. package/.output/server/node_modules/lodash/_basePickBy.js +30 -0
  581. package/.output/server/node_modules/lodash/_baseProperty.js +14 -0
  582. package/.output/server/node_modules/lodash/_basePropertyDeep.js +16 -0
  583. package/.output/server/node_modules/lodash/_basePropertyOf.js +14 -0
  584. package/.output/server/node_modules/lodash/_baseReduce.js +23 -0
  585. package/.output/server/node_modules/lodash/_baseRest.js +17 -0
  586. package/.output/server/node_modules/lodash/_baseSet.js +51 -0
  587. package/.output/server/node_modules/lodash/_baseSetToString.js +22 -0
  588. package/.output/server/node_modules/lodash/_baseSlice.js +31 -0
  589. package/.output/server/node_modules/lodash/_baseSome.js +22 -0
  590. package/.output/server/node_modules/lodash/_baseSortBy.js +21 -0
  591. package/.output/server/node_modules/lodash/_baseTimes.js +20 -0
  592. package/.output/server/node_modules/lodash/_baseToString.js +37 -0
  593. package/.output/server/node_modules/lodash/_baseTrim.js +19 -0
  594. package/.output/server/node_modules/lodash/_baseUnary.js +14 -0
  595. package/.output/server/node_modules/lodash/_baseUniq.js +72 -0
  596. package/.output/server/node_modules/lodash/_baseValues.js +19 -0
  597. package/.output/server/node_modules/lodash/_cacheHas.js +13 -0
  598. package/.output/server/node_modules/lodash/_castFunction.js +14 -0
  599. package/.output/server/node_modules/lodash/_castPath.js +21 -0
  600. package/.output/server/node_modules/lodash/_cloneArrayBuffer.js +16 -0
  601. package/.output/server/node_modules/lodash/_cloneBuffer.js +35 -0
  602. package/.output/server/node_modules/lodash/_cloneDataView.js +16 -0
  603. package/.output/server/node_modules/lodash/_cloneRegExp.js +17 -0
  604. package/.output/server/node_modules/lodash/_cloneSymbol.js +18 -0
  605. package/.output/server/node_modules/lodash/_cloneTypedArray.js +16 -0
  606. package/.output/server/node_modules/lodash/_compareAscending.js +41 -0
  607. package/.output/server/node_modules/lodash/_compareMultiple.js +44 -0
  608. package/.output/server/node_modules/lodash/_copyArray.js +20 -0
  609. package/.output/server/node_modules/lodash/_copyObject.js +40 -0
  610. package/.output/server/node_modules/lodash/_copySymbols.js +16 -0
  611. package/.output/server/node_modules/lodash/_copySymbolsIn.js +16 -0
  612. package/.output/server/node_modules/lodash/_coreJsData.js +6 -0
  613. package/.output/server/node_modules/lodash/_createAggregator.js +23 -0
  614. package/.output/server/node_modules/lodash/_createAssigner.js +37 -0
  615. package/.output/server/node_modules/lodash/_createBaseEach.js +32 -0
  616. package/.output/server/node_modules/lodash/_createBaseFor.js +25 -0
  617. package/.output/server/node_modules/lodash/_createSet.js +19 -0
  618. package/.output/server/node_modules/lodash/_customDefaultsAssignIn.js +29 -0
  619. package/.output/server/node_modules/lodash/_defineProperty.js +11 -0
  620. package/.output/server/node_modules/lodash/_equalArrays.js +84 -0
  621. package/.output/server/node_modules/lodash/_equalByTag.js +112 -0
  622. package/.output/server/node_modules/lodash/_equalObjects.js +90 -0
  623. package/.output/server/node_modules/lodash/_escapeHtmlChar.js +21 -0
  624. package/.output/server/node_modules/lodash/_escapeStringChar.js +22 -0
  625. package/.output/server/node_modules/lodash/_freeGlobal.js +4 -0
  626. package/.output/server/node_modules/lodash/_getAllKeys.js +16 -0
  627. package/.output/server/node_modules/lodash/_getAllKeysIn.js +17 -0
  628. package/.output/server/node_modules/lodash/_getMapData.js +18 -0
  629. package/.output/server/node_modules/lodash/_getMatchData.js +24 -0
  630. package/.output/server/node_modules/lodash/_getNative.js +17 -0
  631. package/.output/server/node_modules/lodash/_getPrototype.js +6 -0
  632. package/.output/server/node_modules/lodash/_getRawTag.js +46 -0
  633. package/.output/server/node_modules/lodash/_getSymbols.js +30 -0
  634. package/.output/server/node_modules/lodash/_getSymbolsIn.js +25 -0
  635. package/.output/server/node_modules/lodash/_getTag.js +58 -0
  636. package/.output/server/node_modules/lodash/_getValue.js +13 -0
  637. package/.output/server/node_modules/lodash/_hasPath.js +39 -0
  638. package/.output/server/node_modules/lodash/_hasUnicode.js +26 -0
  639. package/.output/server/node_modules/lodash/_hashClear.js +15 -0
  640. package/.output/server/node_modules/lodash/_hashDelete.js +17 -0
  641. package/.output/server/node_modules/lodash/_hashGet.js +30 -0
  642. package/.output/server/node_modules/lodash/_hashHas.js +23 -0
  643. package/.output/server/node_modules/lodash/_hashSet.js +23 -0
  644. package/.output/server/node_modules/lodash/_initCloneArray.js +26 -0
  645. package/.output/server/node_modules/lodash/_initCloneByTag.js +77 -0
  646. package/.output/server/node_modules/lodash/_initCloneObject.js +18 -0
  647. package/.output/server/node_modules/lodash/_isFlattenable.js +20 -0
  648. package/.output/server/node_modules/lodash/_isIndex.js +25 -0
  649. package/.output/server/node_modules/lodash/_isIterateeCall.js +30 -0
  650. package/.output/server/node_modules/lodash/_isKey.js +29 -0
  651. package/.output/server/node_modules/lodash/_isKeyable.js +15 -0
  652. package/.output/server/node_modules/lodash/_isMasked.js +20 -0
  653. package/.output/server/node_modules/lodash/_isPrototype.js +18 -0
  654. package/.output/server/node_modules/lodash/_isStrictComparable.js +15 -0
  655. package/.output/server/node_modules/lodash/_iteratorToArray.js +18 -0
  656. package/.output/server/node_modules/lodash/_listCacheClear.js +13 -0
  657. package/.output/server/node_modules/lodash/_listCacheDelete.js +35 -0
  658. package/.output/server/node_modules/lodash/_listCacheGet.js +19 -0
  659. package/.output/server/node_modules/lodash/_listCacheHas.js +16 -0
  660. package/.output/server/node_modules/lodash/_listCacheSet.js +26 -0
  661. package/.output/server/node_modules/lodash/_mapCacheClear.js +21 -0
  662. package/.output/server/node_modules/lodash/_mapCacheDelete.js +18 -0
  663. package/.output/server/node_modules/lodash/_mapCacheGet.js +16 -0
  664. package/.output/server/node_modules/lodash/_mapCacheHas.js +16 -0
  665. package/.output/server/node_modules/lodash/_mapCacheSet.js +22 -0
  666. package/.output/server/node_modules/lodash/_mapToArray.js +18 -0
  667. package/.output/server/node_modules/lodash/_matchesStrictComparable.js +20 -0
  668. package/.output/server/node_modules/lodash/_memoizeCapped.js +26 -0
  669. package/.output/server/node_modules/lodash/_nativeCreate.js +6 -0
  670. package/.output/server/node_modules/lodash/_nativeKeys.js +6 -0
  671. package/.output/server/node_modules/lodash/_nativeKeysIn.js +20 -0
  672. package/.output/server/node_modules/lodash/_nodeUtil.js +30 -0
  673. package/.output/server/node_modules/lodash/_objectToString.js +22 -0
  674. package/.output/server/node_modules/lodash/_overArg.js +15 -0
  675. package/.output/server/node_modules/lodash/_overRest.js +36 -0
  676. package/.output/server/node_modules/lodash/_reEscape.js +4 -0
  677. package/.output/server/node_modules/lodash/_reEvaluate.js +4 -0
  678. package/.output/server/node_modules/lodash/_reInterpolate.js +4 -0
  679. package/.output/server/node_modules/lodash/_root.js +9 -0
  680. package/.output/server/node_modules/lodash/_safeGet.js +21 -0
  681. package/.output/server/node_modules/lodash/_setCacheAdd.js +19 -0
  682. package/.output/server/node_modules/lodash/_setCacheHas.js +14 -0
  683. package/.output/server/node_modules/lodash/_setToArray.js +18 -0
  684. package/.output/server/node_modules/lodash/_setToString.js +14 -0
  685. package/.output/server/node_modules/lodash/_shortOut.js +37 -0
  686. package/.output/server/node_modules/lodash/_stackClear.js +15 -0
  687. package/.output/server/node_modules/lodash/_stackDelete.js +18 -0
  688. package/.output/server/node_modules/lodash/_stackGet.js +14 -0
  689. package/.output/server/node_modules/lodash/_stackHas.js +14 -0
  690. package/.output/server/node_modules/lodash/_stackSet.js +34 -0
  691. package/.output/server/node_modules/lodash/_strictIndexOf.js +23 -0
  692. package/.output/server/node_modules/lodash/_stringToArray.js +18 -0
  693. package/.output/server/node_modules/lodash/_stringToPath.js +27 -0
  694. package/.output/server/node_modules/lodash/_toKey.js +21 -0
  695. package/.output/server/node_modules/lodash/_toSource.js +26 -0
  696. package/.output/server/node_modules/lodash/_trimmedEndIndex.js +19 -0
  697. package/.output/server/node_modules/lodash/_unicodeToArray.js +40 -0
  698. package/.output/server/node_modules/lodash/assign.js +58 -0
  699. package/.output/server/node_modules/lodash/assignIn.js +40 -0
  700. package/.output/server/node_modules/lodash/assignInWith.js +38 -0
  701. package/.output/server/node_modules/lodash/attempt.js +35 -0
  702. package/.output/server/node_modules/lodash/chunk.js +50 -0
  703. package/.output/server/node_modules/lodash/clone.js +36 -0
  704. package/.output/server/node_modules/lodash/cloneDeep.js +29 -0
  705. package/.output/server/node_modules/lodash/compact.js +31 -0
  706. package/.output/server/node_modules/lodash/constant.js +26 -0
  707. package/.output/server/node_modules/lodash/defaults.js +64 -0
  708. package/.output/server/node_modules/lodash/defer.js +26 -0
  709. package/.output/server/node_modules/lodash/differenceWith.js +40 -0
  710. package/.output/server/node_modules/lodash/each.js +1 -0
  711. package/.output/server/node_modules/lodash/eq.js +37 -0
  712. package/.output/server/node_modules/lodash/escape.js +43 -0
  713. package/.output/server/node_modules/lodash/extend.js +1 -0
  714. package/.output/server/node_modules/lodash/filter.js +52 -0
  715. package/.output/server/node_modules/lodash/first.js +1 -0
  716. package/.output/server/node_modules/lodash/flatten.js +22 -0
  717. package/.output/server/node_modules/lodash/forEach.js +41 -0
  718. package/.output/server/node_modules/lodash/get.js +33 -0
  719. package/.output/server/node_modules/lodash/groupBy.js +41 -0
  720. package/.output/server/node_modules/lodash/has.js +35 -0
  721. package/.output/server/node_modules/lodash/hasIn.js +34 -0
  722. package/.output/server/node_modules/lodash/head.js +23 -0
  723. package/.output/server/node_modules/lodash/identity.js +21 -0
  724. package/.output/server/node_modules/lodash/includes.js +53 -0
  725. package/.output/server/node_modules/lodash/indexOf.js +42 -0
  726. package/.output/server/node_modules/lodash/isArguments.js +36 -0
  727. package/.output/server/node_modules/lodash/isArray.js +26 -0
  728. package/.output/server/node_modules/lodash/isArrayLike.js +33 -0
  729. package/.output/server/node_modules/lodash/isArrayLikeObject.js +33 -0
  730. package/.output/server/node_modules/lodash/isBuffer.js +38 -0
  731. package/.output/server/node_modules/lodash/isEmpty.js +77 -0
  732. package/.output/server/node_modules/lodash/isError.js +36 -0
  733. package/.output/server/node_modules/lodash/isFunction.js +37 -0
  734. package/.output/server/node_modules/lodash/isLength.js +35 -0
  735. package/.output/server/node_modules/lodash/isMap.js +27 -0
  736. package/.output/server/node_modules/lodash/isNil.js +25 -0
  737. package/.output/server/node_modules/lodash/isObject.js +31 -0
  738. package/.output/server/node_modules/lodash/isObjectLike.js +29 -0
  739. package/.output/server/node_modules/lodash/isPlainObject.js +62 -0
  740. package/.output/server/node_modules/lodash/isSet.js +27 -0
  741. package/.output/server/node_modules/lodash/isString.js +30 -0
  742. package/.output/server/node_modules/lodash/isSymbol.js +29 -0
  743. package/.output/server/node_modules/lodash/isTypedArray.js +27 -0
  744. package/.output/server/node_modules/lodash/keys.js +37 -0
  745. package/.output/server/node_modules/lodash/keysIn.js +32 -0
  746. package/.output/server/node_modules/lodash/last.js +20 -0
  747. package/.output/server/node_modules/lodash/map.js +53 -0
  748. package/.output/server/node_modules/lodash/max.js +29 -0
  749. package/.output/server/node_modules/lodash/memoize.js +73 -0
  750. package/.output/server/node_modules/lodash/merge.js +39 -0
  751. package/.output/server/node_modules/lodash/negate.js +40 -0
  752. package/.output/server/node_modules/lodash/noop.js +17 -0
  753. package/.output/server/node_modules/lodash/omitBy.js +29 -0
  754. package/.output/server/node_modules/lodash/package.json +19 -0
  755. package/.output/server/node_modules/lodash/pickBy.js +37 -0
  756. package/.output/server/node_modules/lodash/property.js +32 -0
  757. package/.output/server/node_modules/lodash/reduce.js +51 -0
  758. package/.output/server/node_modules/lodash/reject.js +46 -0
  759. package/.output/server/node_modules/lodash/some.js +51 -0
  760. package/.output/server/node_modules/lodash/sortBy.js +48 -0
  761. package/.output/server/node_modules/lodash/stubArray.js +23 -0
  762. package/.output/server/node_modules/lodash/stubFalse.js +18 -0
  763. package/.output/server/node_modules/lodash/tail.js +22 -0
  764. package/.output/server/node_modules/lodash/template.js +272 -0
  765. package/.output/server/node_modules/lodash/templateSettings.js +67 -0
  766. package/.output/server/node_modules/lodash/toArray.js +58 -0
  767. package/.output/server/node_modules/lodash/toFinite.js +42 -0
  768. package/.output/server/node_modules/lodash/toInteger.js +36 -0
  769. package/.output/server/node_modules/lodash/toNumber.js +64 -0
  770. package/.output/server/node_modules/lodash/toPlainObject.js +32 -0
  771. package/.output/server/node_modules/lodash/toString.js +28 -0
  772. package/.output/server/node_modules/lodash/transform.js +65 -0
  773. package/.output/server/node_modules/lodash/uniq.js +25 -0
  774. package/.output/server/node_modules/lodash/uniqueId.js +28 -0
  775. package/.output/server/node_modules/lodash/values.js +34 -0
  776. package/.output/server/node_modules/papaparse/package.json +58 -0
  777. package/.output/server/node_modules/papaparse/papaparse.js +1945 -0
  778. package/.output/server/node_modules/pg/node_modules/pg-connection-string/index.js +112 -0
  779. package/.output/server/node_modules/pg/node_modules/pg-connection-string/package.json +40 -0
  780. package/.output/server/node_modules/safer-buffer/package.json +34 -0
  781. package/.output/server/node_modules/safer-buffer/safer.js +77 -0
  782. package/.output/server/node_modules/ssh2/lib/Channel.js +295 -0
  783. package/.output/server/node_modules/ssh2/lib/agent.js +1123 -0
  784. package/.output/server/node_modules/ssh2/lib/client.js +2176 -0
  785. package/.output/server/node_modules/ssh2/lib/http-agents.js +84 -0
  786. package/.output/server/node_modules/ssh2/lib/index.js +44 -0
  787. package/.output/server/node_modules/ssh2/lib/keygen.js +582 -0
  788. package/.output/server/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
  789. package/.output/server/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
  790. package/.output/server/node_modules/ssh2/lib/protocol/constants.js +356 -0
  791. package/.output/server/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
  792. package/.output/server/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
  793. package/.output/server/node_modules/ssh2/lib/protocol/handlers.js +16 -0
  794. package/.output/server/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
  795. package/.output/server/node_modules/ssh2/lib/protocol/kex.js +1908 -0
  796. package/.output/server/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
  797. package/.output/server/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
  798. package/.output/server/node_modules/ssh2/lib/protocol/utils.js +356 -0
  799. package/.output/server/node_modules/ssh2/lib/protocol/zlib.js +255 -0
  800. package/.output/server/node_modules/ssh2/lib/server.js +1380 -0
  801. package/.output/server/node_modules/ssh2/lib/utils.js +336 -0
  802. package/.output/server/node_modules/ssh2/package.json +49 -0
  803. package/.output/server/node_modules/ssh2/util/pagent.exe +0 -0
  804. package/.output/server/node_modules/tarn/dist/PendingOperation.js +48 -0
  805. package/.output/server/node_modules/tarn/dist/Pool.js +516 -0
  806. package/.output/server/node_modules/tarn/dist/PromiseInspection.js +21 -0
  807. package/.output/server/node_modules/tarn/dist/Resource.js +19 -0
  808. package/.output/server/node_modules/tarn/dist/TimeoutError.js +5 -0
  809. package/.output/server/node_modules/tarn/dist/tarn.js +10 -0
  810. package/.output/server/node_modules/tarn/dist/utils.js +60 -0
  811. package/.output/server/node_modules/tarn/package.json +66 -0
  812. package/.output/server/node_modules/tweetnacl/nacl-fast.js +2388 -0
  813. package/.output/server/node_modules/tweetnacl/package.json +58 -0
  814. package/.output/server/package.json +20 -35
  815. package/package.json +1 -1
  816. package/.output/public/_nuxt/AKIL8y6B.js +0 -1
  817. package/.output/public/_nuxt/B5vWsFeq.js +0 -160
  818. package/.output/public/_nuxt/B7OaQ1wH.js +0 -8
  819. package/.output/public/_nuxt/BG-9_o0s.js +0 -3
  820. package/.output/public/_nuxt/BHnp06h8.js +0 -1
  821. package/.output/public/_nuxt/BKxFOGv6.js +0 -1
  822. package/.output/public/_nuxt/BNIRlgC1.js +0 -1
  823. package/.output/public/_nuxt/BNdHe5KI.js +0 -1
  824. package/.output/public/_nuxt/BQANhp-y.js +0 -1
  825. package/.output/public/_nuxt/BUYy1lWT.js +0 -215
  826. package/.output/public/_nuxt/Ber6tLDb.js +0 -1
  827. package/.output/public/_nuxt/BgEovngA.js +0 -1
  828. package/.output/public/_nuxt/BhgYrVrc.js +0 -6
  829. package/.output/public/_nuxt/BmnOz39b.js +0 -2
  830. package/.output/public/_nuxt/BuKJVBv4.js +0 -1
  831. package/.output/public/_nuxt/BxMjn94S.js +0 -4
  832. package/.output/public/_nuxt/C1dxTB9p.js +0 -39
  833. package/.output/public/_nuxt/C4mc67xO.js +0 -31
  834. package/.output/public/_nuxt/CAOPafml.js +0 -1
  835. package/.output/public/_nuxt/CPxn9ATh.js +0 -1
  836. package/.output/public/_nuxt/CQ_P7x7z.js +0 -3
  837. package/.output/public/_nuxt/CS9PCQVw.js +0 -6
  838. package/.output/public/_nuxt/CdEjcJco.js +0 -1
  839. package/.output/public/_nuxt/CeQk_zaG.js +0 -3867
  840. package/.output/public/_nuxt/CijEBUIh.js +0 -9
  841. package/.output/public/_nuxt/Cn-07UHL.js +0 -1
  842. package/.output/public/_nuxt/D4_A4fm4.js +0 -1
  843. package/.output/public/_nuxt/DAs4584G.js +0 -72
  844. package/.output/public/_nuxt/DBO1CAN4.js +0 -1
  845. package/.output/public/_nuxt/DF7Phtj8.js +0 -39
  846. package/.output/public/_nuxt/DMMO4O3Y.js +0 -1
  847. package/.output/public/_nuxt/DP-hoxaC.js +0 -1
  848. package/.output/public/_nuxt/DREcM-oC.js +0 -20
  849. package/.output/public/_nuxt/DX-rdvVh.js +0 -28
  850. package/.output/public/_nuxt/DXei3mDv.js +0 -1
  851. package/.output/public/_nuxt/DZcRPyDc.js +0 -26
  852. package/.output/public/_nuxt/D_QjJZ_n.js +0 -1
  853. package/.output/public/_nuxt/Dj2IVxO7.js +0 -1
  854. package/.output/public/_nuxt/DmMeuvwr.js +0 -1
  855. package/.output/public/_nuxt/DqlhGxxN.js +0 -32
  856. package/.output/public/_nuxt/DynamicTable.DJeANwbG.css +0 -1
  857. package/.output/public/_nuxt/GmXmO94-.js +0 -1
  858. package/.output/public/_nuxt/HPyUOgdi.js +0 -1
  859. package/.output/public/_nuxt/MdxV8r4v.js +0 -1
  860. package/.output/public/_nuxt/Mp6jDt1I.js +0 -1
  861. package/.output/public/_nuxt/QuickQuery.h4epNPla.css +0 -1
  862. package/.output/public/_nuxt/WrapperErdDiagram.DeMTjOwN.css +0 -1
  863. package/.output/public/_nuxt/Zvfofmwe.js +0 -1
  864. package/.output/public/_nuxt/_fileId_.BHiWIaF7.css +0 -1
  865. package/.output/public/_nuxt/builds/meta/db42d692-1628-4dd8-9442-d7621bdd9ac6.json +0 -1
  866. package/.output/public/_nuxt/cQYBDqKG.js +0 -1
  867. package/.output/public/_nuxt/default.BfdyU-m9.css +0 -1
  868. package/.output/public/_nuxt/entry.0UG0MnUy.css +0 -1
  869. package/.output/public/_nuxt/fIC3FurW.js +0 -1
  870. package/.output/public/_nuxt/index.BHg08rtV.css +0 -1
  871. package/.output/public/_nuxt/n9bD6NrC.js +0 -2
  872. package/.output/public/_nuxt/ykQL1ia3.js +0 -271
  873. package/.output/public/_nuxt/zD3bTrJp.js +0 -1
  874. package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs +0 -700
  875. package/.output/server/chunks/routes/api/database-roles/adapters/postgres.adapter.mjs.map +0 -1
  876. package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs +0 -2
  877. package/.output/server/chunks/routes/api/database-roles/adapters/types.mjs.map +0 -1
  878. package/.output/server/chunks/routes/api/database-roles/index.mjs +0 -39
  879. package/.output/server/chunks/routes/api/database-roles/index.mjs.map +0 -1
  880. package/.output/server/chunks/routes/api/delete-function.mjs +0 -65
  881. package/.output/server/chunks/routes/api/delete-function.mjs.map +0 -1
  882. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +0 -100
  883. package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +0 -1
  884. package/.output/server/chunks/routes/api/execute-bulk-update.mjs +0 -105
  885. package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +0 -1
  886. package/.output/server/chunks/routes/api/execute.mjs +0 -47
  887. package/.output/server/chunks/routes/api/execute.mjs.map +0 -1
  888. package/.output/server/chunks/routes/api/export-table-data.mjs +0 -229
  889. package/.output/server/chunks/routes/api/export-table-data.mjs.map +0 -1
  890. package/.output/server/chunks/routes/api/get-function-signature.mjs +0 -96
  891. package/.output/server/chunks/routes/api/get-function-signature.mjs.map +0 -1
  892. package/.output/server/chunks/routes/api/get-one-function.mjs +0 -34
  893. package/.output/server/chunks/routes/api/get-one-function.mjs.map +0 -1
  894. package/.output/server/chunks/routes/api/get-one-table.mjs +0 -180
  895. package/.output/server/chunks/routes/api/get-one-table.mjs.map +0 -1
  896. package/.output/server/chunks/routes/api/get-over-view-function.mjs +0 -41
  897. package/.output/server/chunks/routes/api/get-over-view-function.mjs.map +0 -1
  898. package/.output/server/chunks/routes/api/get-over-view-tables.mjs +0 -53
  899. package/.output/server/chunks/routes/api/get-over-view-tables.mjs.map +0 -1
  900. package/.output/server/chunks/routes/api/get-over-view-views.mjs +0 -44
  901. package/.output/server/chunks/routes/api/get-over-view-views.mjs.map +0 -1
  902. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +0 -123
  903. package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +0 -1
  904. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +0 -220
  905. package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +0 -1
  906. package/.output/server/chunks/routes/api/get-table-ddl.mjs +0 -185
  907. package/.output/server/chunks/routes/api/get-table-ddl.mjs.map +0 -1
  908. package/.output/server/chunks/routes/api/get-table-size.mjs +0 -49
  909. package/.output/server/chunks/routes/api/get-table-size.mjs.map +0 -1
  910. package/.output/server/chunks/routes/api/get-table-structure.mjs +0 -111
  911. package/.output/server/chunks/routes/api/get-table-structure.mjs.map +0 -1
  912. package/.output/server/chunks/routes/api/get-tables.mjs +0 -287
  913. package/.output/server/chunks/routes/api/get-tables.mjs.map +0 -1
  914. package/.output/server/chunks/routes/api/get-view-definition.mjs +0 -57
  915. package/.output/server/chunks/routes/api/get-view-definition.mjs.map +0 -1
  916. package/.output/server/chunks/routes/api/getMetricMonitor.mjs +0 -46
  917. package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +0 -1
  918. package/.output/server/chunks/routes/api/raw-execute.mjs +0 -47
  919. package/.output/server/chunks/routes/api/raw-execute.mjs.map +0 -1
  920. package/.output/server/chunks/routes/api/rename-function.mjs +0 -77
  921. package/.output/server/chunks/routes/api/rename-function.mjs.map +0 -1
  922. package/.output/server/chunks/routes/api/update-function.mjs +0 -65
  923. package/.output/server/chunks/routes/api/update-function.mjs.map +0 -1
  924. package/.output/server/node_modules/@ioredis/commands/built/commands.json +0 -2447
  925. package/.output/server/node_modules/@ioredis/commands/built/index.js +0 -208
  926. package/.output/server/node_modules/@ioredis/commands/package.json +0 -52
  927. package/.output/server/node_modules/@sqltools/formatter/lib/core/Formatter.js +0 -234
  928. package/.output/server/node_modules/@sqltools/formatter/lib/core/Indentation.js +0 -42
  929. package/.output/server/node_modules/@sqltools/formatter/lib/core/InlineBlock.js +0 -60
  930. package/.output/server/node_modules/@sqltools/formatter/lib/core/Params.js +0 -21
  931. package/.output/server/node_modules/@sqltools/formatter/lib/core/Tokenizer.js +0 -272
  932. package/.output/server/node_modules/@sqltools/formatter/lib/core/escapeRegExp.js +0 -10
  933. package/.output/server/node_modules/@sqltools/formatter/lib/core/last.js +0 -7
  934. package/.output/server/node_modules/@sqltools/formatter/lib/core/types.js +0 -22
  935. package/.output/server/node_modules/@sqltools/formatter/lib/languages/Db2Formatter.js +0 -585
  936. package/.output/server/node_modules/@sqltools/formatter/lib/languages/N1qlFormatter.js +0 -257
  937. package/.output/server/node_modules/@sqltools/formatter/lib/languages/PlSqlFormatter.js +0 -459
  938. package/.output/server/node_modules/@sqltools/formatter/lib/languages/StandardSqlFormatter.js +0 -369
  939. package/.output/server/node_modules/@sqltools/formatter/lib/languages/utils/abstract.js +0 -23
  940. package/.output/server/node_modules/@sqltools/formatter/lib/sqlFormatter.js +0 -34
  941. package/.output/server/node_modules/@sqltools/formatter/package.json +0 -59
  942. package/.output/server/node_modules/ansis/index.js +0 -1
  943. package/.output/server/node_modules/ansis/package.json +0 -28
  944. package/.output/server/node_modules/app-root-path/index.js +0 -4
  945. package/.output/server/node_modules/app-root-path/lib/app-root-path.js +0 -30
  946. package/.output/server/node_modules/app-root-path/lib/resolve.js +0 -128
  947. package/.output/server/node_modules/app-root-path/package.json +0 -66
  948. package/.output/server/node_modules/balanced-match/index.js +0 -62
  949. package/.output/server/node_modules/balanced-match/package.json +0 -48
  950. package/.output/server/node_modules/brace-expansion/index.js +0 -203
  951. package/.output/server/node_modules/brace-expansion/package.json +0 -46
  952. package/.output/server/node_modules/cluster-key-slot/lib/index.js +0 -166
  953. package/.output/server/node_modules/cluster-key-slot/package.json +0 -56
  954. package/.output/server/node_modules/dedent/dist/dedent.js +0 -73
  955. package/.output/server/node_modules/dedent/package.json +0 -119
  956. package/.output/server/node_modules/denque/index.js +0 -481
  957. package/.output/server/node_modules/denque/package.json +0 -58
  958. package/.output/server/node_modules/dotenv/lib/main.js +0 -361
  959. package/.output/server/node_modules/dotenv/package.json +0 -61
  960. package/.output/server/node_modules/glob/dist/commonjs/glob.js +0 -247
  961. package/.output/server/node_modules/glob/dist/commonjs/has-magic.js +0 -27
  962. package/.output/server/node_modules/glob/dist/commonjs/ignore.js +0 -119
  963. package/.output/server/node_modules/glob/dist/commonjs/index.js +0 -68
  964. package/.output/server/node_modules/glob/dist/commonjs/package.json +0 -3
  965. package/.output/server/node_modules/glob/dist/commonjs/pattern.js +0 -219
  966. package/.output/server/node_modules/glob/dist/commonjs/processor.js +0 -301
  967. package/.output/server/node_modules/glob/dist/commonjs/walker.js +0 -387
  968. package/.output/server/node_modules/glob/package.json +0 -99
  969. package/.output/server/node_modules/inherits/inherits.js +0 -9
  970. package/.output/server/node_modules/inherits/inherits_browser.js +0 -27
  971. package/.output/server/node_modules/inherits/package.json +0 -29
  972. package/.output/server/node_modules/ioredis/built/Command.js +0 -349
  973. package/.output/server/node_modules/ioredis/built/DataHandler.js +0 -220
  974. package/.output/server/node_modules/ioredis/built/Pipeline.js +0 -334
  975. package/.output/server/node_modules/ioredis/built/Redis.js +0 -697
  976. package/.output/server/node_modules/ioredis/built/ScanStream.js +0 -51
  977. package/.output/server/node_modules/ioredis/built/Script.js +0 -62
  978. package/.output/server/node_modules/ioredis/built/SubscriptionSet.js +0 -41
  979. package/.output/server/node_modules/ioredis/built/autoPipelining.js +0 -159
  980. package/.output/server/node_modules/ioredis/built/cluster/ClusterOptions.js +0 -22
  981. package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriber.js +0 -202
  982. package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +0 -224
  983. package/.output/server/node_modules/ioredis/built/cluster/ConnectionPool.js +0 -154
  984. package/.output/server/node_modules/ioredis/built/cluster/DelayQueue.js +0 -53
  985. package/.output/server/node_modules/ioredis/built/cluster/index.js +0 -862
  986. package/.output/server/node_modules/ioredis/built/cluster/util.js +0 -100
  987. package/.output/server/node_modules/ioredis/built/connectors/AbstractConnector.js +0 -26
  988. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +0 -45
  989. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +0 -37
  990. package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/index.js +0 -305
  991. package/.output/server/node_modules/ioredis/built/connectors/StandaloneConnector.js +0 -69
  992. package/.output/server/node_modules/ioredis/built/connectors/index.js +0 -7
  993. package/.output/server/node_modules/ioredis/built/constants/TLSProfiles.js +0 -149
  994. package/.output/server/node_modules/ioredis/built/errors/ClusterAllFailedError.js +0 -15
  995. package/.output/server/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +0 -14
  996. package/.output/server/node_modules/ioredis/built/errors/index.js +0 -5
  997. package/.output/server/node_modules/ioredis/built/index.js +0 -62
  998. package/.output/server/node_modules/ioredis/built/redis/RedisOptions.js +0 -55
  999. package/.output/server/node_modules/ioredis/built/redis/event_handler.js +0 -292
  1000. package/.output/server/node_modules/ioredis/built/transaction.js +0 -93
  1001. package/.output/server/node_modules/ioredis/built/utils/Commander.js +0 -117
  1002. package/.output/server/node_modules/ioredis/built/utils/applyMixin.js +0 -8
  1003. package/.output/server/node_modules/ioredis/built/utils/debug.js +0 -95
  1004. package/.output/server/node_modules/ioredis/built/utils/index.js +0 -297
  1005. package/.output/server/node_modules/ioredis/built/utils/lodash.js +0 -9
  1006. package/.output/server/node_modules/ioredis/package.json +0 -100
  1007. package/.output/server/node_modules/lodash.defaults/index.js +0 -668
  1008. package/.output/server/node_modules/lodash.defaults/package.json +0 -19
  1009. package/.output/server/node_modules/lodash.isarguments/index.js +0 -229
  1010. package/.output/server/node_modules/lodash.isarguments/package.json +0 -19
  1011. package/.output/server/node_modules/lru-cache/dist/commonjs/index.js +0 -1546
  1012. package/.output/server/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  1013. package/.output/server/node_modules/lru-cache/package.json +0 -116
  1014. package/.output/server/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
  1015. package/.output/server/node_modules/minimatch/dist/commonjs/ast.js +0 -592
  1016. package/.output/server/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -152
  1017. package/.output/server/node_modules/minimatch/dist/commonjs/escape.js +0 -22
  1018. package/.output/server/node_modules/minimatch/dist/commonjs/index.js +0 -1017
  1019. package/.output/server/node_modules/minimatch/dist/commonjs/package.json +0 -3
  1020. package/.output/server/node_modules/minimatch/dist/commonjs/unescape.js +0 -24
  1021. package/.output/server/node_modules/minimatch/package.json +0 -82
  1022. package/.output/server/node_modules/minipass/dist/commonjs/index.js +0 -1028
  1023. package/.output/server/node_modules/minipass/dist/commonjs/package.json +0 -3
  1024. package/.output/server/node_modules/minipass/package.json +0 -82
  1025. package/.output/server/node_modules/path-scurry/dist/commonjs/index.js +0 -2014
  1026. package/.output/server/node_modules/path-scurry/dist/commonjs/package.json +0 -3
  1027. package/.output/server/node_modules/path-scurry/package.json +0 -89
  1028. package/.output/server/node_modules/redis-errors/index.js +0 -7
  1029. package/.output/server/node_modules/redis-errors/lib/modern.js +0 -59
  1030. package/.output/server/node_modules/redis-errors/lib/old.js +0 -119
  1031. package/.output/server/node_modules/redis-errors/package.json +0 -41
  1032. package/.output/server/node_modules/redis-parser/index.js +0 -3
  1033. package/.output/server/node_modules/redis-parser/lib/parser.js +0 -552
  1034. package/.output/server/node_modules/redis-parser/package.json +0 -53
  1035. package/.output/server/node_modules/reflect-metadata/Reflect.js +0 -1415
  1036. package/.output/server/node_modules/reflect-metadata/package.json +0 -68
  1037. package/.output/server/node_modules/safe-buffer/index.js +0 -65
  1038. package/.output/server/node_modules/safe-buffer/package.json +0 -51
  1039. package/.output/server/node_modules/sha.js/hash.js +0 -81
  1040. package/.output/server/node_modules/sha.js/index.js +0 -15
  1041. package/.output/server/node_modules/sha.js/package.json +0 -30
  1042. package/.output/server/node_modules/sha.js/sha.js +0 -94
  1043. package/.output/server/node_modules/sha.js/sha1.js +0 -99
  1044. package/.output/server/node_modules/sha.js/sha224.js +0 -53
  1045. package/.output/server/node_modules/sha.js/sha256.js +0 -135
  1046. package/.output/server/node_modules/sha.js/sha384.js +0 -57
  1047. package/.output/server/node_modules/sha.js/sha512.js +0 -260
  1048. package/.output/server/node_modules/sql-highlight/lib/escapeHtml.js +0 -59
  1049. package/.output/server/node_modules/sql-highlight/lib/index.js +0 -85
  1050. package/.output/server/node_modules/sql-highlight/lib/keywords.js +0 -145
  1051. package/.output/server/node_modules/sql-highlight/package.json +0 -49
  1052. package/.output/server/node_modules/standard-as-callback/built/index.js +0 -41
  1053. package/.output/server/node_modules/standard-as-callback/built/utils.js +0 -23
  1054. package/.output/server/node_modules/standard-as-callback/package.json +0 -40
  1055. package/.output/server/node_modules/tslib/package.json +0 -47
  1056. package/.output/server/node_modules/tslib/tslib.js +0 -484
  1057. package/.output/server/node_modules/typeorm/cache/DbQueryResultCache.js +0 -264
  1058. package/.output/server/node_modules/typeorm/cache/QueryResultCacheFactory.js +0 -42
  1059. package/.output/server/node_modules/typeorm/cache/RedisQueryResultCache.js +0 -197
  1060. package/.output/server/node_modules/typeorm/common/DeepPartial.js +0 -4
  1061. package/.output/server/node_modules/typeorm/common/EntityTarget.js +0 -4
  1062. package/.output/server/node_modules/typeorm/common/MixedList.js +0 -4
  1063. package/.output/server/node_modules/typeorm/common/ObjectLiteral.js +0 -4
  1064. package/.output/server/node_modules/typeorm/common/ObjectType.js +0 -4
  1065. package/.output/server/node_modules/typeorm/common/RelationType.js +0 -4
  1066. package/.output/server/node_modules/typeorm/connection/Connection.js +0 -16
  1067. package/.output/server/node_modules/typeorm/connection/ConnectionManager.js +0 -66
  1068. package/.output/server/node_modules/typeorm/connection/ConnectionMetadataBuilder.js +0 -74
  1069. package/.output/server/node_modules/typeorm/connection/ConnectionOptionsReader.js +0 -198
  1070. package/.output/server/node_modules/typeorm/connection/options-reader/ConnectionOptionsEnvReader.js +0 -111
  1071. package/.output/server/node_modules/typeorm/container.js +0 -60
  1072. package/.output/server/node_modules/typeorm/data-source/DataSource.js +0 -517
  1073. package/.output/server/node_modules/typeorm/decorator/Check.js +0 -27
  1074. package/.output/server/node_modules/typeorm/decorator/EntityRepository.js +0 -21
  1075. package/.output/server/node_modules/typeorm/decorator/Exclusion.js +0 -27
  1076. package/.output/server/node_modules/typeorm/decorator/ForeignKey.js +0 -44
  1077. package/.output/server/node_modules/typeorm/decorator/Generated.js +0 -24
  1078. package/.output/server/node_modules/typeorm/decorator/Index.js +0 -56
  1079. package/.output/server/node_modules/typeorm/decorator/Unique.js +0 -50
  1080. package/.output/server/node_modules/typeorm/decorator/columns/Column.js +0 -78
  1081. package/.output/server/node_modules/typeorm/decorator/columns/CreateDateColumn.js +0 -21
  1082. package/.output/server/node_modules/typeorm/decorator/columns/DeleteDateColumn.js +0 -20
  1083. package/.output/server/node_modules/typeorm/decorator/columns/ObjectIdColumn.js +0 -27
  1084. package/.output/server/node_modules/typeorm/decorator/columns/PrimaryColumn.js +0 -63
  1085. package/.output/server/node_modules/typeorm/decorator/columns/PrimaryGeneratedColumn.js +0 -59
  1086. package/.output/server/node_modules/typeorm/decorator/columns/UpdateDateColumn.js +0 -20
  1087. package/.output/server/node_modules/typeorm/decorator/columns/VersionColumn.js +0 -21
  1088. package/.output/server/node_modules/typeorm/decorator/columns/ViewColumn.js +0 -19
  1089. package/.output/server/node_modules/typeorm/decorator/columns/VirtualColumn.js +0 -49
  1090. package/.output/server/node_modules/typeorm/decorator/entity/ChildEntity.js +0 -25
  1091. package/.output/server/node_modules/typeorm/decorator/entity/Entity.js +0 -31
  1092. package/.output/server/node_modules/typeorm/decorator/entity/TableInheritance.js +0 -22
  1093. package/.output/server/node_modules/typeorm/decorator/entity-view/ViewEntity.js +0 -32
  1094. package/.output/server/node_modules/typeorm/decorator/listeners/AfterInsert.js +0 -19
  1095. package/.output/server/node_modules/typeorm/decorator/listeners/AfterLoad.js +0 -19
  1096. package/.output/server/node_modules/typeorm/decorator/listeners/AfterRecover.js +0 -19
  1097. package/.output/server/node_modules/typeorm/decorator/listeners/AfterRemove.js +0 -19
  1098. package/.output/server/node_modules/typeorm/decorator/listeners/AfterSoftRemove.js +0 -19
  1099. package/.output/server/node_modules/typeorm/decorator/listeners/AfterUpdate.js +0 -19
  1100. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeInsert.js +0 -19
  1101. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRecover.js +0 -19
  1102. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRemove.js +0 -19
  1103. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeSoftRemove.js +0 -19
  1104. package/.output/server/node_modules/typeorm/decorator/listeners/BeforeUpdate.js +0 -19
  1105. package/.output/server/node_modules/typeorm/decorator/listeners/EventSubscriber.js +0 -17
  1106. package/.output/server/node_modules/typeorm/decorator/options/ColumnOptions.js +0 -4
  1107. package/.output/server/node_modules/typeorm/decorator/options/EntityOptions.js +0 -4
  1108. package/.output/server/node_modules/typeorm/decorator/options/IndexOptions.js +0 -4
  1109. package/.output/server/node_modules/typeorm/decorator/options/JoinColumnOptions.js +0 -4
  1110. package/.output/server/node_modules/typeorm/decorator/options/JoinTableOptions.js +0 -4
  1111. package/.output/server/node_modules/typeorm/decorator/options/RelationOptions.js +0 -4
  1112. package/.output/server/node_modules/typeorm/decorator/options/ValueTransformer.js +0 -4
  1113. package/.output/server/node_modules/typeorm/decorator/relations/JoinColumn.js +0 -27
  1114. package/.output/server/node_modules/typeorm/decorator/relations/JoinTable.js +0 -34
  1115. package/.output/server/node_modules/typeorm/decorator/relations/ManyToMany.js +0 -46
  1116. package/.output/server/node_modules/typeorm/decorator/relations/ManyToOne.js +0 -46
  1117. package/.output/server/node_modules/typeorm/decorator/relations/OneToMany.js +0 -37
  1118. package/.output/server/node_modules/typeorm/decorator/relations/OneToOne.js +0 -45
  1119. package/.output/server/node_modules/typeorm/decorator/relations/RelationCount.js +0 -23
  1120. package/.output/server/node_modules/typeorm/decorator/relations/RelationId.js +0 -22
  1121. package/.output/server/node_modules/typeorm/decorator/tree/Tree.js +0 -21
  1122. package/.output/server/node_modules/typeorm/decorator/tree/TreeChildren.js +0 -34
  1123. package/.output/server/node_modules/typeorm/decorator/tree/TreeLevelColumn.js +0 -19
  1124. package/.output/server/node_modules/typeorm/decorator/tree/TreeParent.js +0 -33
  1125. package/.output/server/node_modules/typeorm/driver/DriverFactory.js +0 -98
  1126. package/.output/server/node_modules/typeorm/driver/DriverUtils.js +0 -228
  1127. package/.output/server/node_modules/typeorm/driver/Query.js +0 -16
  1128. package/.output/server/node_modules/typeorm/driver/SqlInMemory.js +0 -15
  1129. package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlDriver.js +0 -847
  1130. package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlQueryRunner.js +0 -1709
  1131. package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresDriver.js +0 -103
  1132. package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresQueryRunner.js +0 -146
  1133. package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js +0 -153
  1134. package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -126
  1135. package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorDriver.js +0 -78
  1136. package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorQueryRunner.js +0 -98
  1137. package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachDriver.js +0 -885
  1138. package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachQueryRunner.js +0 -2453
  1139. package/.output/server/node_modules/typeorm/driver/cordova/CordovaDriver.js +0 -76
  1140. package/.output/server/node_modules/typeorm/driver/cordova/CordovaQueryRunner.js +0 -170
  1141. package/.output/server/node_modules/typeorm/driver/expo/ExpoDriver.js +0 -29
  1142. package/.output/server/node_modules/typeorm/driver/expo/ExpoDriverFactory.js +0 -22
  1143. package/.output/server/node_modules/typeorm/driver/expo/ExpoQueryRunner.js +0 -65
  1144. package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyDriver.js +0 -75
  1145. package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyQueryRunner.js +0 -169
  1146. package/.output/server/node_modules/typeorm/driver/mongodb/MongoDriver.js +0 -404
  1147. package/.output/server/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js +0 -701
  1148. package/.output/server/node_modules/typeorm/driver/mongodb/bson.typings.js +0 -5
  1149. package/.output/server/node_modules/typeorm/driver/mongodb/typings.js +0 -23
  1150. package/.output/server/node_modules/typeorm/driver/mysql/MysqlDriver.js +0 -1105
  1151. package/.output/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js +0 -2139
  1152. package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptDriver.js +0 -94
  1153. package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptQueryRunner.js +0 -92
  1154. package/.output/server/node_modules/typeorm/driver/oracle/OracleDriver.js +0 -869
  1155. package/.output/server/node_modules/typeorm/driver/oracle/OracleQueryRunner.js +0 -1884
  1156. package/.output/server/node_modules/typeorm/driver/postgres/PostgresDriver.js +0 -1259
  1157. package/.output/server/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js +0 -2729
  1158. package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeDriver.js +0 -728
  1159. package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeQueryRunner.js +0 -107
  1160. package/.output/server/node_modules/typeorm/driver/sap/SapDriver.js +0 -681
  1161. package/.output/server/node_modules/typeorm/driver/sap/SapQueryRunner.js +0 -2054
  1162. package/.output/server/node_modules/typeorm/driver/spanner/SpannerDriver.js +0 -613
  1163. package/.output/server/node_modules/typeorm/driver/spanner/SpannerQueryRunner.js +0 -1464
  1164. package/.output/server/node_modules/typeorm/driver/sqlite/SqliteDriver.js +0 -174
  1165. package/.output/server/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js +0 -124
  1166. package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteDriver.js +0 -695
  1167. package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +0 -1511
  1168. package/.output/server/node_modules/typeorm/driver/sqljs/SqljsDriver.js +0 -250
  1169. package/.output/server/node_modules/typeorm/driver/sqljs/SqljsQueryRunner.js +0 -123
  1170. package/.output/server/node_modules/typeorm/driver/sqlserver/MssqlParameter.js +0 -23
  1171. package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerDriver.js +0 -922
  1172. package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerQueryRunner.js +0 -2484
  1173. package/.output/server/node_modules/typeorm/driver/types/DatabaseType.js +0 -4
  1174. package/.output/server/node_modules/typeorm/driver/types/GeoJsonTypes.js +0 -4
  1175. package/.output/server/node_modules/typeorm/driver/types/MetadataTableType.js +0 -11
  1176. package/.output/server/node_modules/typeorm/driver/types/ReplicationMode.js +0 -4
  1177. package/.output/server/node_modules/typeorm/entity-manager/EntityManager.js +0 -853
  1178. package/.output/server/node_modules/typeorm/entity-manager/EntityManagerFactory.js +0 -24
  1179. package/.output/server/node_modules/typeorm/entity-manager/MongoEntityManager.js +0 -668
  1180. package/.output/server/node_modules/typeorm/entity-manager/SqljsEntityManager.js +0 -44
  1181. package/.output/server/node_modules/typeorm/entity-schema/EntitySchema.js +0 -15
  1182. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js +0 -8
  1183. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedError.js +0 -18
  1184. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaOptions.js +0 -11
  1185. package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaTransformer.js +0 -333
  1186. package/.output/server/node_modules/typeorm/error/AlreadyHasActiveConnectionError.js +0 -16
  1187. package/.output/server/node_modules/typeorm/error/CannotAttachTreeChildrenEntityError.js +0 -16
  1188. package/.output/server/node_modules/typeorm/error/CannotConnectAlreadyConnectedError.js +0 -15
  1189. package/.output/server/node_modules/typeorm/error/CannotCreateEntityIdMapError.js +0 -21
  1190. package/.output/server/node_modules/typeorm/error/CannotDetermineEntityError.js +0 -16
  1191. package/.output/server/node_modules/typeorm/error/CannotExecuteNotConnectedError.js +0 -15
  1192. package/.output/server/node_modules/typeorm/error/CannotGetEntityManagerNotConnectedError.js +0 -15
  1193. package/.output/server/node_modules/typeorm/error/CannotReflectMethodParameterTypeError.js +0 -18
  1194. package/.output/server/node_modules/typeorm/error/CircularRelationsError.js +0 -16
  1195. package/.output/server/node_modules/typeorm/error/ColumnTypeUndefinedError.js +0 -19
  1196. package/.output/server/node_modules/typeorm/error/ConnectionIsNotSetError.js +0 -15
  1197. package/.output/server/node_modules/typeorm/error/ConnectionNotFoundError.js +0 -15
  1198. package/.output/server/node_modules/typeorm/error/CustomRepositoryCannotInheritRepositoryError.js +0 -18
  1199. package/.output/server/node_modules/typeorm/error/CustomRepositoryDoesNotHaveEntityError.js +0 -18
  1200. package/.output/server/node_modules/typeorm/error/CustomRepositoryNotFoundError.js +0 -18
  1201. package/.output/server/node_modules/typeorm/error/DataTypeNotSupportedError.js +0 -14
  1202. package/.output/server/node_modules/typeorm/error/DriverOptionNotSetError.js +0 -16
  1203. package/.output/server/node_modules/typeorm/error/DriverPackageNotInstalledError.js +0 -16
  1204. package/.output/server/node_modules/typeorm/error/EntityMetadataNotFoundError.js +0 -29
  1205. package/.output/server/node_modules/typeorm/error/EntityNotFoundError.js +0 -42
  1206. package/.output/server/node_modules/typeorm/error/EntityPropertyNotFoundError.js +0 -17
  1207. package/.output/server/node_modules/typeorm/error/FindRelationsNotFoundError.js +0 -23
  1208. package/.output/server/node_modules/typeorm/error/ForbiddenTransactionModeOverrideError.js +0 -16
  1209. package/.output/server/node_modules/typeorm/error/InitializedRelationError.js +0 -20
  1210. package/.output/server/node_modules/typeorm/error/InsertValuesMissingError.js +0 -16
  1211. package/.output/server/node_modules/typeorm/error/LimitOnUpdateNotSupportedError.js +0 -15
  1212. package/.output/server/node_modules/typeorm/error/LockNotSupportedOnGivenDriverError.js +0 -15
  1213. package/.output/server/node_modules/typeorm/error/MetadataAlreadyExistsError.js +0 -18
  1214. package/.output/server/node_modules/typeorm/error/MetadataWithSuchNameAlreadyExistsError.js +0 -16
  1215. package/.output/server/node_modules/typeorm/error/MissingDeleteDateColumnError.js +0 -12
  1216. package/.output/server/node_modules/typeorm/error/MissingDriverError.js +0 -16
  1217. package/.output/server/node_modules/typeorm/error/MissingJoinColumnError.js +0 -23
  1218. package/.output/server/node_modules/typeorm/error/MissingJoinTableError.js +0 -23
  1219. package/.output/server/node_modules/typeorm/error/MissingPrimaryColumnError.js +0 -13
  1220. package/.output/server/node_modules/typeorm/error/MustBeEntityError.js +0 -15
  1221. package/.output/server/node_modules/typeorm/error/NestedSetMultipleRootError.js +0 -12
  1222. package/.output/server/node_modules/typeorm/error/NoConnectionForRepositoryError.js +0 -16
  1223. package/.output/server/node_modules/typeorm/error/NoConnectionOptionError.js +0 -16
  1224. package/.output/server/node_modules/typeorm/error/NoNeedToReleaseEntityManagerError.js +0 -17
  1225. package/.output/server/node_modules/typeorm/error/NoVersionOrUpdateDateColumnError.js +0 -15
  1226. package/.output/server/node_modules/typeorm/error/OffsetWithoutLimitNotSupportedError.js +0 -17
  1227. package/.output/server/node_modules/typeorm/error/OptimisticLockCanNotBeUsedError.js +0 -15
  1228. package/.output/server/node_modules/typeorm/error/OptimisticLockVersionMismatchError.js +0 -15
  1229. package/.output/server/node_modules/typeorm/error/PersistedEntityNotFoundError.js +0 -15
  1230. package/.output/server/node_modules/typeorm/error/PessimisticLockTransactionRequiredError.js +0 -15
  1231. package/.output/server/node_modules/typeorm/error/PrimaryColumnCannotBeNullableError.js +0 -13
  1232. package/.output/server/node_modules/typeorm/error/QueryFailedError.js +0 -30
  1233. package/.output/server/node_modules/typeorm/error/QueryRunnerAlreadyReleasedError.js +0 -12
  1234. package/.output/server/node_modules/typeorm/error/QueryRunnerProviderAlreadyReleasedError.js +0 -16
  1235. package/.output/server/node_modules/typeorm/error/RepositoryNotTreeError.js +0 -32
  1236. package/.output/server/node_modules/typeorm/error/ReturningStatementNotSupportedError.js +0 -16
  1237. package/.output/server/node_modules/typeorm/error/SubjectRemovedAndUpdatedError.js +0 -16
  1238. package/.output/server/node_modules/typeorm/error/SubjectWithoutIdentifierError.js +0 -17
  1239. package/.output/server/node_modules/typeorm/error/TransactionAlreadyStartedError.js +0 -15
  1240. package/.output/server/node_modules/typeorm/error/TransactionNotStartedError.js +0 -15
  1241. package/.output/server/node_modules/typeorm/error/TreeRepositoryNotSupportedError.js +0 -12
  1242. package/.output/server/node_modules/typeorm/error/TypeORMError.js +0 -23
  1243. package/.output/server/node_modules/typeorm/error/UpdateValuesMissingError.js +0 -12
  1244. package/.output/server/node_modules/typeorm/error/UsingJoinColumnIsNotAllowedError.js +0 -13
  1245. package/.output/server/node_modules/typeorm/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +0 -14
  1246. package/.output/server/node_modules/typeorm/error/UsingJoinTableIsNotAllowedError.js +0 -14
  1247. package/.output/server/node_modules/typeorm/error/UsingJoinTableOnlyOnOneSideAllowedError.js +0 -14
  1248. package/.output/server/node_modules/typeorm/error/index.js +0 -66
  1249. package/.output/server/node_modules/typeorm/find-options/EqualOperator.js +0 -13
  1250. package/.output/server/node_modules/typeorm/find-options/FindManyOptions.js +0 -4
  1251. package/.output/server/node_modules/typeorm/find-options/FindOneOptions.js +0 -4
  1252. package/.output/server/node_modules/typeorm/find-options/FindOperator.js +0 -96
  1253. package/.output/server/node_modules/typeorm/find-options/FindOperatorType.js +0 -4
  1254. package/.output/server/node_modules/typeorm/find-options/FindOptionsOrder.js +0 -4
  1255. package/.output/server/node_modules/typeorm/find-options/FindOptionsRelations.js +0 -4
  1256. package/.output/server/node_modules/typeorm/find-options/FindOptionsSelect.js +0 -4
  1257. package/.output/server/node_modules/typeorm/find-options/FindOptionsUtils.js +0 -350
  1258. package/.output/server/node_modules/typeorm/find-options/FindOptionsWhere.js +0 -4
  1259. package/.output/server/node_modules/typeorm/find-options/FindTreeOptions.js +0 -4
  1260. package/.output/server/node_modules/typeorm/find-options/JoinOptions.js +0 -4
  1261. package/.output/server/node_modules/typeorm/find-options/OrderByCondition.js +0 -4
  1262. package/.output/server/node_modules/typeorm/find-options/operator/And.js +0 -9
  1263. package/.output/server/node_modules/typeorm/find-options/operator/Any.js +0 -13
  1264. package/.output/server/node_modules/typeorm/find-options/operator/ArrayContainedBy.js +0 -13
  1265. package/.output/server/node_modules/typeorm/find-options/operator/ArrayContains.js +0 -13
  1266. package/.output/server/node_modules/typeorm/find-options/operator/ArrayOverlap.js +0 -13
  1267. package/.output/server/node_modules/typeorm/find-options/operator/Between.js +0 -13
  1268. package/.output/server/node_modules/typeorm/find-options/operator/Equal.js +0 -17
  1269. package/.output/server/node_modules/typeorm/find-options/operator/ILike.js +0 -13
  1270. package/.output/server/node_modules/typeorm/find-options/operator/In.js +0 -13
  1271. package/.output/server/node_modules/typeorm/find-options/operator/IsNull.js +0 -13
  1272. package/.output/server/node_modules/typeorm/find-options/operator/JsonContains.js +0 -13
  1273. package/.output/server/node_modules/typeorm/find-options/operator/LessThan.js +0 -13
  1274. package/.output/server/node_modules/typeorm/find-options/operator/LessThanOrEqual.js +0 -13
  1275. package/.output/server/node_modules/typeorm/find-options/operator/Like.js +0 -13
  1276. package/.output/server/node_modules/typeorm/find-options/operator/MoreThan.js +0 -13
  1277. package/.output/server/node_modules/typeorm/find-options/operator/MoreThanOrEqual.js +0 -13
  1278. package/.output/server/node_modules/typeorm/find-options/operator/Not.js +0 -14
  1279. package/.output/server/node_modules/typeorm/find-options/operator/Or.js +0 -9
  1280. package/.output/server/node_modules/typeorm/find-options/operator/Raw.js +0 -12
  1281. package/.output/server/node_modules/typeorm/globals.js +0 -182
  1282. package/.output/server/node_modules/typeorm/index.js +0 -196
  1283. package/.output/server/node_modules/typeorm/index.mjs +0 -422
  1284. package/.output/server/node_modules/typeorm/logger/AbstractLogger.js +0 -238
  1285. package/.output/server/node_modules/typeorm/logger/AdvancedConsoleLogger.js +0 -56
  1286. package/.output/server/node_modules/typeorm/logger/DebugLogger.js +0 -78
  1287. package/.output/server/node_modules/typeorm/logger/FileLogger.js +0 -88
  1288. package/.output/server/node_modules/typeorm/logger/FormattedConsoleLogger.js +0 -59
  1289. package/.output/server/node_modules/typeorm/logger/Logger.js +0 -4
  1290. package/.output/server/node_modules/typeorm/logger/LoggerFactory.js +0 -39
  1291. package/.output/server/node_modules/typeorm/logger/LoggerOptions.js +0 -4
  1292. package/.output/server/node_modules/typeorm/logger/SimpleConsoleLogger.js +0 -57
  1293. package/.output/server/node_modules/typeorm/metadata/CheckMetadata.js +0 -35
  1294. package/.output/server/node_modules/typeorm/metadata/ColumnMetadata.js +0 -618
  1295. package/.output/server/node_modules/typeorm/metadata/EmbeddedMetadata.js +0 -224
  1296. package/.output/server/node_modules/typeorm/metadata/EntityListenerMetadata.js +0 -77
  1297. package/.output/server/node_modules/typeorm/metadata/EntityMetadata.js +0 -692
  1298. package/.output/server/node_modules/typeorm/metadata/ExclusionMetadata.js +0 -35
  1299. package/.output/server/node_modules/typeorm/metadata/ForeignKeyMetadata.js +0 -57
  1300. package/.output/server/node_modules/typeorm/metadata/IndexMetadata.js +0 -144
  1301. package/.output/server/node_modules/typeorm/metadata/RelationCountMetadata.js +0 -39
  1302. package/.output/server/node_modules/typeorm/metadata/RelationIdMetadata.js +0 -62
  1303. package/.output/server/node_modules/typeorm/metadata/RelationMetadata.js +0 -440
  1304. package/.output/server/node_modules/typeorm/metadata/UniqueMetadata.js +0 -101
  1305. package/.output/server/node_modules/typeorm/metadata/types/EventListenerTypes.js +0 -22
  1306. package/.output/server/node_modules/typeorm/metadata-args/MetadataArgsStorage.js +0 -236
  1307. package/.output/server/node_modules/typeorm/metadata-builder/ClosureJunctionEntityMetadataBuilder.js +0 -145
  1308. package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataBuilder.js +0 -838
  1309. package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataValidator.js +0 -258
  1310. package/.output/server/node_modules/typeorm/metadata-builder/JunctionEntityMetadataBuilder.js +0 -287
  1311. package/.output/server/node_modules/typeorm/metadata-builder/MetadataUtils.js +0 -44
  1312. package/.output/server/node_modules/typeorm/metadata-builder/RelationJoinColumnBuilder.js +0 -185
  1313. package/.output/server/node_modules/typeorm/migration/Migration.js +0 -21
  1314. package/.output/server/node_modules/typeorm/migration/MigrationExecutor.js +0 -534
  1315. package/.output/server/node_modules/typeorm/naming-strategy/DefaultNamingStrategy.js +0 -145
  1316. package/.output/server/node_modules/typeorm/naming-strategy/LegacyOracleNamingStrategy.js +0 -50
  1317. package/.output/server/node_modules/typeorm/package.json +0 -268
  1318. package/.output/server/node_modules/typeorm/persistence/EntityPersistExecutor.js +0 -170
  1319. package/.output/server/node_modules/typeorm/persistence/Subject.js +0 -239
  1320. package/.output/server/node_modules/typeorm/persistence/SubjectChangedColumnsComputer.js +0 -216
  1321. package/.output/server/node_modules/typeorm/persistence/SubjectDatabaseEntityLoader.js +0 -135
  1322. package/.output/server/node_modules/typeorm/persistence/SubjectExecutor.js +0 -760
  1323. package/.output/server/node_modules/typeorm/persistence/SubjectTopologicalSorter.js +0 -174
  1324. package/.output/server/node_modules/typeorm/persistence/subject-builder/CascadesSubjectBuilder.js +0 -107
  1325. package/.output/server/node_modules/typeorm/persistence/subject-builder/ManyToManySubjectBuilder.js +0 -218
  1326. package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js +0 -181
  1327. package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +0 -155
  1328. package/.output/server/node_modules/typeorm/persistence/tree/ClosureSubjectExecutor.js +0 -241
  1329. package/.output/server/node_modules/typeorm/persistence/tree/MaterializedPathSubjectExecutor.js +0 -125
  1330. package/.output/server/node_modules/typeorm/persistence/tree/NestedSetSubjectExecutor.js +0 -271
  1331. package/.output/server/node_modules/typeorm/platform/PlatformTools.js +0 -243
  1332. package/.output/server/node_modules/typeorm/query-builder/Alias.js +0 -29
  1333. package/.output/server/node_modules/typeorm/query-builder/Brackets.js +0 -19
  1334. package/.output/server/node_modules/typeorm/query-builder/DeleteQueryBuilder.js +0 -200
  1335. package/.output/server/node_modules/typeorm/query-builder/InsertQueryBuilder.js +0 -745
  1336. package/.output/server/node_modules/typeorm/query-builder/JoinAttribute.js +0 -175
  1337. package/.output/server/node_modules/typeorm/query-builder/NotBrackets.js +0 -17
  1338. package/.output/server/node_modules/typeorm/query-builder/QueryBuilder.js +0 -1139
  1339. package/.output/server/node_modules/typeorm/query-builder/QueryBuilderUtils.js +0 -32
  1340. package/.output/server/node_modules/typeorm/query-builder/QueryExpressionMap.js +0 -328
  1341. package/.output/server/node_modules/typeorm/query-builder/RelationIdLoader.js +0 -503
  1342. package/.output/server/node_modules/typeorm/query-builder/RelationLoader.js +0 -283
  1343. package/.output/server/node_modules/typeorm/query-builder/RelationQueryBuilder.js +0 -155
  1344. package/.output/server/node_modules/typeorm/query-builder/RelationRemover.js +0 -143
  1345. package/.output/server/node_modules/typeorm/query-builder/RelationUpdater.js +0 -152
  1346. package/.output/server/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js +0 -176
  1347. package/.output/server/node_modules/typeorm/query-builder/SelectQueryBuilder.js +0 -2656
  1348. package/.output/server/node_modules/typeorm/query-builder/SoftDeleteQueryBuilder.js +0 -368
  1349. package/.output/server/node_modules/typeorm/query-builder/UpdateQueryBuilder.js +0 -498
  1350. package/.output/server/node_modules/typeorm/query-builder/index.js +0 -20
  1351. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountAttribute.js +0 -80
  1352. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountLoader.js +0 -168
  1353. package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountMetadataToAttributeTransformer.js +0 -55
  1354. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdAttribute.js +0 -88
  1355. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdLoader.js +0 -275
  1356. package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdMetadataToAttributeTransformer.js +0 -55
  1357. package/.output/server/node_modules/typeorm/query-builder/result/DeleteResult.js +0 -17
  1358. package/.output/server/node_modules/typeorm/query-builder/result/InsertResult.js +0 -28
  1359. package/.output/server/node_modules/typeorm/query-builder/result/UpdateResult.js +0 -29
  1360. package/.output/server/node_modules/typeorm/query-builder/transformer/DocumentToEntityTransformer.js +0 -196
  1361. package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +0 -112
  1362. package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToNewEntityTransformer.js +0 -92
  1363. package/.output/server/node_modules/typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js +0 -447
  1364. package/.output/server/node_modules/typeorm/query-runner/BaseQueryRunner.js +0 -454
  1365. package/.output/server/node_modules/typeorm/query-runner/QueryLock.js +0 -28
  1366. package/.output/server/node_modules/typeorm/query-runner/QueryResult.js +0 -17
  1367. package/.output/server/node_modules/typeorm/repository/AbstractRepository.js +0 -92
  1368. package/.output/server/node_modules/typeorm/repository/BaseEntity.js +0 -328
  1369. package/.output/server/node_modules/typeorm/repository/MongoRepository.js +0 -305
  1370. package/.output/server/node_modules/typeorm/repository/RemoveOptions.js +0 -4
  1371. package/.output/server/node_modules/typeorm/repository/Repository.js +0 -379
  1372. package/.output/server/node_modules/typeorm/repository/SaveOptions.js +0 -4
  1373. package/.output/server/node_modules/typeorm/repository/TreeRepository.js +0 -255
  1374. package/.output/server/node_modules/typeorm/schema-builder/MongoSchemaBuilder.js +0 -66
  1375. package/.output/server/node_modules/typeorm/schema-builder/RdbmsSchemaBuilder.js +0 -929
  1376. package/.output/server/node_modules/typeorm/schema-builder/options/TableCheckOptions.js +0 -4
  1377. package/.output/server/node_modules/typeorm/schema-builder/options/TableColumnOptions.js +0 -4
  1378. package/.output/server/node_modules/typeorm/schema-builder/options/TableExclusionOptions.js +0 -4
  1379. package/.output/server/node_modules/typeorm/schema-builder/options/TableForeignKeyOptions.js +0 -4
  1380. package/.output/server/node_modules/typeorm/schema-builder/options/TableIndexOptions.js +0 -4
  1381. package/.output/server/node_modules/typeorm/schema-builder/options/TableOptions.js +0 -4
  1382. package/.output/server/node_modules/typeorm/schema-builder/options/TableUniqueOptions.js +0 -4
  1383. package/.output/server/node_modules/typeorm/schema-builder/options/ViewOptions.js +0 -4
  1384. package/.output/server/node_modules/typeorm/schema-builder/table/Table.js +0 -296
  1385. package/.output/server/node_modules/typeorm/schema-builder/table/TableCheck.js +0 -49
  1386. package/.output/server/node_modules/typeorm/schema-builder/table/TableColumn.js +0 -117
  1387. package/.output/server/node_modules/typeorm/schema-builder/table/TableExclusion.js +0 -43
  1388. package/.output/server/node_modules/typeorm/schema-builder/table/TableForeignKey.js +0 -72
  1389. package/.output/server/node_modules/typeorm/schema-builder/table/TableIndex.js +0 -68
  1390. package/.output/server/node_modules/typeorm/schema-builder/table/TableUnique.js +0 -50
  1391. package/.output/server/node_modules/typeorm/schema-builder/util/TableUtils.js +0 -41
  1392. package/.output/server/node_modules/typeorm/schema-builder/util/ViewUtils.js +0 -27
  1393. package/.output/server/node_modules/typeorm/schema-builder/view/View.js +0 -71
  1394. package/.output/server/node_modules/typeorm/subscriber/Broadcaster.js +0 -660
  1395. package/.output/server/node_modules/typeorm/subscriber/BroadcasterResult.js +0 -30
  1396. package/.output/server/node_modules/typeorm/subscriber/event/QueryEvent.js +0 -4
  1397. package/.output/server/node_modules/typeorm/util/ApplyValueTransformers.js +0 -25
  1398. package/.output/server/node_modules/typeorm/util/DateUtils.js +0 -229
  1399. package/.output/server/node_modules/typeorm/util/DepGraph.js +0 -230
  1400. package/.output/server/node_modules/typeorm/util/DirectoryExportedClassesLoader.js +0 -65
  1401. package/.output/server/node_modules/typeorm/util/ImportUtils.js +0 -66
  1402. package/.output/server/node_modules/typeorm/util/InstanceChecker.js +0 -104
  1403. package/.output/server/node_modules/typeorm/util/ObjectUtils.js +0 -49
  1404. package/.output/server/node_modules/typeorm/util/OrmUtils.js +0 -443
  1405. package/.output/server/node_modules/typeorm/util/PathUtils.js +0 -33
  1406. package/.output/server/node_modules/typeorm/util/RandomGenerator.js +0 -154
  1407. package/.output/server/node_modules/typeorm/util/SqlTagUtils.js +0 -43
  1408. package/.output/server/node_modules/typeorm/util/StringUtils.js +0 -113
  1409. package/.output/server/node_modules/typeorm/util/TreeRepositoryUtils.js +0 -67
  1410. package/.output/server/node_modules/typeorm/util/VersionUtils.js +0 -27
  1411. package/.output/server/node_modules/typeorm/util/escapeRegExp.js +0 -10
  1412. package/.output/server/node_modules/uuid/dist/cjs/index.js +0 -31
  1413. package/.output/server/node_modules/uuid/dist/cjs/max.js +0 -3
  1414. package/.output/server/node_modules/uuid/dist/cjs/md5.js +0 -13
  1415. package/.output/server/node_modules/uuid/dist/cjs/native.js +0 -4
  1416. package/.output/server/node_modules/uuid/dist/cjs/nil.js +0 -3
  1417. package/.output/server/node_modules/uuid/dist/cjs/package.json +0 -1
  1418. package/.output/server/node_modules/uuid/dist/cjs/parse.js +0 -11
  1419. package/.output/server/node_modules/uuid/dist/cjs/regex.js +0 -3
  1420. package/.output/server/node_modules/uuid/dist/cjs/rng.js +0 -13
  1421. package/.output/server/node_modules/uuid/dist/cjs/sha1.js +0 -13
  1422. package/.output/server/node_modules/uuid/dist/cjs/stringify.js +0 -39
  1423. package/.output/server/node_modules/uuid/dist/cjs/v1.js +0 -87
  1424. package/.output/server/node_modules/uuid/dist/cjs/v1ToV6.js +0 -13
  1425. package/.output/server/node_modules/uuid/dist/cjs/v3.js +0 -14
  1426. package/.output/server/node_modules/uuid/dist/cjs/v35.js +0 -41
  1427. package/.output/server/node_modules/uuid/dist/cjs/v4.js +0 -29
  1428. package/.output/server/node_modules/uuid/dist/cjs/v5.js +0 -14
  1429. package/.output/server/node_modules/uuid/dist/cjs/v6.js +0 -19
  1430. package/.output/server/node_modules/uuid/dist/cjs/v6ToV1.js +0 -13
  1431. package/.output/server/node_modules/uuid/dist/cjs/v7.js +0 -69
  1432. package/.output/server/node_modules/uuid/dist/cjs/validate.js +0 -7
  1433. package/.output/server/node_modules/uuid/dist/cjs/version.js +0 -10
  1434. package/.output/server/node_modules/uuid/package.json +0 -132
@@ -0,0 +1,1626 @@
1
+ import { tool, generateText, Output, ToolLoopAgent, stepCountIs, createAgentUIStreamResponse, smoothStream } from 'ai';
2
+ import { d as defineEventHandler, r as readBody, c as createError } from '../../../nitro/nitro.mjs';
3
+ import { g as getDatabaseSource, D as DatabaseClientType } from '../../../_/db-connection.mjs';
4
+ import { createAnthropic } from '@ai-sdk/anthropic';
5
+ import { createGoogleGenerativeAI } from '@ai-sdk/google';
6
+ import { createOpenAI } from '@ai-sdk/openai';
7
+ import { createXai } from '@ai-sdk/xai';
8
+ import { createOpenRouter } from '@openrouter/ai-sdk-provider';
9
+ import { z } from 'zod/v4';
10
+ import Papa from 'papaparse';
11
+ import 'ssh2';
12
+ import 'node:net';
13
+ import 'node:http';
14
+ import 'node:https';
15
+ import 'node:events';
16
+ import 'node:buffer';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'node:crypto';
20
+ import 'node:url';
21
+ import '@iconify/utils';
22
+ import 'consola';
23
+ import 'knex';
24
+ import 'pg';
25
+
26
+ function createProviderModel(provider, apiKey, model) {
27
+ switch (provider) {
28
+ case "openai": {
29
+ const openai = createOpenAI({ apiKey });
30
+ return openai(model);
31
+ }
32
+ case "google": {
33
+ const google = createGoogleGenerativeAI({ apiKey });
34
+ return google(model);
35
+ }
36
+ case "anthropic": {
37
+ const anthropic = createAnthropic({ apiKey });
38
+ return anthropic(model);
39
+ }
40
+ case "xai": {
41
+ const xai = createXai({ apiKey });
42
+ return xai(model);
43
+ }
44
+ case "openrouter": {
45
+ const openrouter = createOpenRouter({
46
+ apiKey
47
+ });
48
+ return openrouter(model);
49
+ }
50
+ default:
51
+ throw new Error(`Unsupported provider: ${provider}`);
52
+ }
53
+ }
54
+
55
+ const AGENT_COMMAND_OPTIONS = [
56
+ {
57
+ id: "generate-query",
58
+ label: "Generate Query",
59
+ toolName: "generate_query",
60
+ category: "SQL",
61
+ description: "Turn a natural language request into SQL for the active schema.",
62
+ insertText: "Generate SQL for ",
63
+ icon: "hugeicons:ai-brain-03",
64
+ promptHint: "The user wants help drafting SQL from natural language. Prefer generate_query first and keep the response focused on producing or refining SQL."
65
+ },
66
+ {
67
+ id: "render-table",
68
+ label: "Render Table",
69
+ toolName: "render_table",
70
+ category: "Execution",
71
+ description: "Run a read-only SQL query and show the result rows as a table.",
72
+ insertText: "Run this query and show the table result for ",
73
+ icon: "hugeicons:table-01",
74
+ promptHint: "The user expects concrete table output. After generating or receiving read-only SQL, prefer render_table and summarize the returned rows briefly."
75
+ },
76
+ {
77
+ id: "visualize-table",
78
+ label: "Visualize Table",
79
+ toolName: "visualize_table",
80
+ category: "Charts",
81
+ description: "Build a bar, line, pie, or scatter chart from a read-only query.",
82
+ insertText: "Visualize this data as a bar, line, pie, or scatter chart for ",
83
+ icon: "hugeicons:chart-line-data-01",
84
+ promptHint: "The user wants a chart-oriented answer. Prefer visualize_table for read-only SQL, and ask for the chart type only if it is still missing."
85
+ },
86
+ {
87
+ id: "describe-table",
88
+ label: "Describe Table",
89
+ toolName: "describe_table",
90
+ category: "Schema",
91
+ description: "Inspect columns, keys, relationships, and table structure.",
92
+ insertText: "Describe the structure of table ",
93
+ icon: "hugeicons:database",
94
+ promptHint: "The user is asking about schema shape, keys, or relationships. Prefer describe_table when a specific table is involved."
95
+ },
96
+ {
97
+ id: "explain-query",
98
+ label: "Explain Query",
99
+ toolName: "explain_query",
100
+ category: "Performance",
101
+ description: "Analyze a query plan and explain possible performance issues.",
102
+ insertText: "Explain why this query is slow: ",
103
+ icon: "hugeicons:activity-02",
104
+ promptHint: "The user is focused on query performance. Prefer explain_query once a concrete SQL statement is available."
105
+ },
106
+ {
107
+ id: "detect-anomaly",
108
+ label: "Detect Anomaly",
109
+ toolName: "detect_anomaly",
110
+ category: "Quality",
111
+ description: "Scan for nulls, duplicates, orphaned keys, and outlier values.",
112
+ insertText: "Detect anomalies in table ",
113
+ icon: "hugeicons:search-list-01",
114
+ promptHint: "The user wants data quality checks. Prefer detect_anomaly for table-level validation and summarize the findings with severity."
115
+ }
116
+ ];
117
+ const getAgentCommandOptionsByIds = (ids) => {
118
+ const allowedIds = new Set(ids);
119
+ return AGENT_COMMAND_OPTIONS.filter((option) => allowedIds.has(option.id));
120
+ };
121
+
122
+ var FunctionSchemaEnum = /* @__PURE__ */ ((FunctionSchemaEnum2) => {
123
+ FunctionSchemaEnum2["Function"] = "FUNCTION";
124
+ FunctionSchemaEnum2["Procedure"] = "PROCEDURE";
125
+ return FunctionSchemaEnum2;
126
+ })(FunctionSchemaEnum || {});
127
+ var ViewSchemaEnum = /* @__PURE__ */ ((ViewSchemaEnum2) => {
128
+ ViewSchemaEnum2["View"] = "VIEW";
129
+ ViewSchemaEnum2["MaterializedView"] = "MATERIALIZED_VIEW";
130
+ return ViewSchemaEnum2;
131
+ })(ViewSchemaEnum || {});
132
+
133
+ const DEFAULT_RENDER_LIMIT = 100;
134
+ const MAX_RENDER_LIMIT = 500;
135
+ const MAX_EXPORT_LIMIT = 1e5;
136
+ const SELECT_PATTERN = /^(select|with|values|table)\b/i;
137
+ const MUTATION_PATTERN = /^(insert|update|delete|drop|truncate|alter|create|grant|revoke|comment|refresh|vacuum)\b/i;
138
+ const POSTGRES_OID_TYPE_MAP = {
139
+ 16: "bool",
140
+ 20: "int8",
141
+ 21: "int2",
142
+ 23: "int4",
143
+ 25: "text",
144
+ 114: "json",
145
+ 700: "float4",
146
+ 701: "float8",
147
+ 1043: "varchar",
148
+ 1082: "date",
149
+ 1114: "timestamp",
150
+ 1184: "timestamptz",
151
+ 1700: "numeric",
152
+ 2950: "uuid",
153
+ 3802: "jsonb"
154
+ };
155
+ function stripSqlComments(sql) {
156
+ return sql.replace(/\/\*[\s\S]*?\*\//g, "").replace(/--.*$/gm, "");
157
+ }
158
+ function stripMarkdownCodeFence(sql) {
159
+ var _a;
160
+ const trimmed = sql.trim();
161
+ const match = trimmed.match(/^```(?:sql)?\s*([\s\S]*?)```$/i);
162
+ return ((_a = match == null ? void 0 : match[1]) == null ? void 0 : _a.trim()) || trimmed;
163
+ }
164
+ function normalizeSql(sql) {
165
+ return stripSqlComments(stripMarkdownCodeFence(sql)).trim().replace(/;+\s*$/, "");
166
+ }
167
+ function isSelectLikeSql(sql) {
168
+ return SELECT_PATTERN.test(normalizeSql(sql));
169
+ }
170
+ function isMutationSql(sql) {
171
+ return MUTATION_PATTERN.test(normalizeSql(sql));
172
+ }
173
+ function clampLimit(limit) {
174
+ if (!limit || Number.isNaN(limit)) {
175
+ return DEFAULT_RENDER_LIMIT;
176
+ }
177
+ return Math.max(1, Math.min(limit, MAX_RENDER_LIMIT));
178
+ }
179
+ function quoteIdentifier(identifier) {
180
+ if (!/^[A-Za-z_][A-Za-z0-9_$]*$/.test(identifier)) {
181
+ throw new Error(`Invalid SQL identifier: ${identifier}`);
182
+ }
183
+ return `"${identifier.replace(/"/g, '""')}"`;
184
+ }
185
+ function getQualifiedTableName(schemaName, tableName) {
186
+ return `${quoteIdentifier(schemaName)}.${quoteIdentifier(tableName)}`;
187
+ }
188
+ function resolveFieldType(field) {
189
+ const oid = Number(field.dataTypeID);
190
+ return POSTGRES_OID_TYPE_MAP[oid] || String(field.dataTypeID || "unknown");
191
+ }
192
+
193
+ const NUMERIC_COLUMN_PATTERN = /(smallint|integer|bigint|decimal|numeric|real|double precision|float|serial)/i;
194
+ function findCanonicalTableName(snapshot, requestedTableName) {
195
+ const trimmed = requestedTableName.trim();
196
+ if (!snapshot) {
197
+ return trimmed;
198
+ }
199
+ const exactMatch = snapshot.tables.find((name) => name === trimmed);
200
+ if (exactMatch) {
201
+ return exactMatch;
202
+ }
203
+ const lowerCaseMatch = snapshot.tables.find(
204
+ (name) => name.toLowerCase() === trimmed.toLowerCase()
205
+ );
206
+ if (!lowerCaseMatch) {
207
+ throw new Error(
208
+ `Table "${requestedTableName}" does not exist in schema ${snapshot.name}.`
209
+ );
210
+ }
211
+ return lowerCaseMatch;
212
+ }
213
+ function resolveTableDetail(snapshot, requestedTableName) {
214
+ if (!(snapshot == null ? void 0 : snapshot.tableDetails)) {
215
+ throw new Error("Schema metadata is not available for this workspace.");
216
+ }
217
+ const tableName = findCanonicalTableName(snapshot, requestedTableName);
218
+ const detail = snapshot.tableDetails[tableName];
219
+ if (!detail) {
220
+ throw new Error(`Missing metadata for table "${tableName}".`);
221
+ }
222
+ return { tableName, detail };
223
+ }
224
+ function assertDatabaseAdapter(adapter) {
225
+ if (!adapter) {
226
+ throw new Error("A database connection is required for this tool.");
227
+ }
228
+ }
229
+ function buildColumnDescription(columnName) {
230
+ const normalized = columnName.toLowerCase();
231
+ if (normalized === "id") {
232
+ return "Primary identifier for each row.";
233
+ }
234
+ if (normalized.endsWith("_id")) {
235
+ return "Reference to a related record.";
236
+ }
237
+ if (normalized.includes("created_at")) {
238
+ return "Timestamp when the row was created.";
239
+ }
240
+ if (normalized.includes("updated_at")) {
241
+ return "Timestamp when the row was last updated.";
242
+ }
243
+ if (normalized.includes("status")) {
244
+ return "Lifecycle or state marker for the row.";
245
+ }
246
+ return void 0;
247
+ }
248
+ function toColumnsForDescribe(detail) {
249
+ var _a, _b, _c;
250
+ const primaryKeys = new Set(
251
+ ((_a = detail.primary_keys) != null ? _a : []).map((key) => key.column)
252
+ );
253
+ const foreignKeys = new Map(
254
+ ((_b = detail.foreign_keys) != null ? _b : []).map((key) => [key.column, key])
255
+ );
256
+ return ((_c = detail.columns) != null ? _c : []).map((column) => {
257
+ const foreignKey = foreignKeys.get(column.name);
258
+ return {
259
+ name: column.name,
260
+ type: column.short_type_name || column.type,
261
+ isPrimaryKey: primaryKeys.has(column.name),
262
+ isForeignKey: !!foreignKey,
263
+ isNullable: column.is_nullable,
264
+ referencesTable: foreignKey == null ? void 0 : foreignKey.referenced_table,
265
+ description: buildColumnDescription(column.name)
266
+ };
267
+ });
268
+ }
269
+ function buildTableSummary(tableName, columns, relatedTables) {
270
+ const readableName = tableName.replace(/_/g, " ");
271
+ const summaryLines = [`Table ${tableName} stores ${readableName} records.`];
272
+ if (relatedTables.length > 0) {
273
+ summaryLines.push(
274
+ `It is directly related to ${relatedTables.slice(0, 4).join(", ")}.`
275
+ );
276
+ }
277
+ const importantColumns = columns.filter((column) => column.isPrimaryKey || column.isForeignKey).map((column) => column.name);
278
+ if (importantColumns.length > 0) {
279
+ summaryLines.push(
280
+ `Key columns include ${importantColumns.slice(0, 4).join(", ")}.`
281
+ );
282
+ }
283
+ return summaryLines.join(" ");
284
+ }
285
+ function getIssueSeverity(ratio) {
286
+ if (ratio >= 0.2) {
287
+ return "high";
288
+ }
289
+ if (ratio >= 0.05) {
290
+ return "medium";
291
+ }
292
+ return "low";
293
+ }
294
+ function calculateCleanScore(issues) {
295
+ const score = issues.reduce((currentScore, issue) => {
296
+ if (issue.severity === "high") {
297
+ return currentScore - 25;
298
+ }
299
+ if (issue.severity === "medium") {
300
+ return currentScore - 12;
301
+ }
302
+ return currentScore - 5;
303
+ }, 100);
304
+ return Math.max(0, score);
305
+ }
306
+ function buildDuplicateCandidates(detail) {
307
+ var _a, _b;
308
+ const primaryKeys = new Set(
309
+ ((_a = detail.primary_keys) != null ? _a : []).map((key) => key.column)
310
+ );
311
+ return ((_b = detail.columns) != null ? _b : []).filter((column) => {
312
+ if (primaryKeys.has(column.name) || column.is_nullable) {
313
+ return false;
314
+ }
315
+ const name = column.name.toLowerCase();
316
+ return name === "email" || name === "slug" || name === "code" || name.endsWith("_code") || name.endsWith("_number");
317
+ }).slice(0, 3);
318
+ }
319
+ function getNumericColumns(detail) {
320
+ var _a;
321
+ return ((_a = detail.columns) != null ? _a : []).filter((column) => NUMERIC_COLUMN_PATTERN.test(column.type)).slice(0, 4);
322
+ }
323
+ function toQuotedColumnName(columnName) {
324
+ return quoteIdentifier(columnName);
325
+ }
326
+ function serializeSingleSnapshot(schema) {
327
+ var _a, _b, _c, _d, _e;
328
+ const { name, tables, tableDetails, views, viewDetails, functions } = schema;
329
+ const lines = [];
330
+ const parts = [`${tables.length} tables`];
331
+ if (views.length) parts.push(`${views.length} views`);
332
+ if (functions.length) parts.push(`${functions.length} functions`);
333
+ lines.push(`Schema: ${name} (${parts.join(", ")})`);
334
+ if (tables.length && tableDetails) {
335
+ lines.push("");
336
+ lines.push(" Tables:");
337
+ for (const tableName of tables) {
338
+ const detail = tableDetails[tableName];
339
+ if (!detail) {
340
+ lines.push(` - ${name}.${tableName}`);
341
+ continue;
342
+ }
343
+ lines.push("");
344
+ lines.push(` Table: ${name}.${tableName}`);
345
+ if ((_a = detail.columns) == null ? void 0 : _a.length) {
346
+ const pkSet = new Set(((_b = detail.primary_keys) != null ? _b : []).map((k) => k.column));
347
+ const fkSet = new Set(((_c = detail.foreign_keys) != null ? _c : []).map((k) => k.column));
348
+ for (const c of detail.columns) {
349
+ const flags = [];
350
+ if (pkSet.has(c.name)) flags.push("PK");
351
+ if (fkSet.has(c.name)) flags.push("FK");
352
+ if (!c.is_nullable) flags.push("NOT NULL");
353
+ const typeName = c.short_type_name || c.type;
354
+ const flagStr = flags.length ? ` [${flags.join(", ")}]` : "";
355
+ lines.push(` - ${c.name}: ${typeName}${flagStr}`);
356
+ }
357
+ }
358
+ if ((_d = detail.foreign_keys) == null ? void 0 : _d.length) {
359
+ lines.push(" References:");
360
+ for (const fk of detail.foreign_keys) {
361
+ lines.push(
362
+ ` ${tableName}.${fk.column} \u2192 ${fk.referenced_table_schema}.${fk.referenced_table}.${fk.referenced_column}`
363
+ );
364
+ }
365
+ }
366
+ }
367
+ }
368
+ if (views.length) {
369
+ lines.push("");
370
+ lines.push(" Views:");
371
+ for (const view of views) {
372
+ const typeLabel = view.type === ViewSchemaEnum.MaterializedView ? "MATERIALIZED VIEW" : "VIEW";
373
+ const detail = viewDetails == null ? void 0 : viewDetails[view.name];
374
+ if (!((_e = detail == null ? void 0 : detail.columns) == null ? void 0 : _e.length)) {
375
+ lines.push(` - ${name}.${view.name} (${typeLabel})`);
376
+ continue;
377
+ }
378
+ lines.push("");
379
+ lines.push(` View: ${name}.${view.name} (${typeLabel})`);
380
+ for (const c of detail.columns) {
381
+ const typeName = c.short_type_name || c.type;
382
+ const nullable = c.is_nullable ? "" : " NOT NULL";
383
+ lines.push(` - ${c.name}: ${typeName}${nullable}`);
384
+ }
385
+ }
386
+ }
387
+ if (functions.length) {
388
+ lines.push("");
389
+ lines.push(" Functions:");
390
+ for (const fn of functions) {
391
+ const typeLabel = fn.type === FunctionSchemaEnum.Procedure ? "PROCEDURE" : "FUNCTION";
392
+ const params = fn.parameters || "none";
393
+ lines.push(` - ${fn.name} (${typeLabel}) params: ${params}`);
394
+ }
395
+ }
396
+ return lines;
397
+ }
398
+ function buildSchemaContext(schemaSnapshot) {
399
+ const snapshots = !schemaSnapshot ? [] : Array.isArray(schemaSnapshot) ? schemaSnapshot : [schemaSnapshot];
400
+ if (snapshots.length === 0) {
401
+ return "No schema context is currently loaded.";
402
+ }
403
+ const lines = [];
404
+ if (snapshots.length > 0) {
405
+ lines.push(`Available schemas (${snapshots.length}):`);
406
+ for (const snapshot of snapshots) {
407
+ lines.push("");
408
+ lines.push(...serializeSingleSnapshot(snapshot));
409
+ }
410
+ }
411
+ return lines.join("\n");
412
+ }
413
+
414
+ function buildAgentSystemPrompt(schemaSnapshots, selectedCommandOptions) {
415
+ const resolvedSchema = buildSchemaContext(schemaSnapshots);
416
+ const selectedOptions = (selectedCommandOptions == null ? void 0 : selectedCommandOptions.length) ? getAgentCommandOptionsByIds(selectedCommandOptions) : [];
417
+ const sectionIdentity = [
418
+ "# You are Orca Agent.",
419
+ "",
420
+ "You help users explore schemas, reason about SQL, explain database structures, and suggest safe next steps for the current database.",
421
+ "You have DIRECT access to a connected database via tools."
422
+ ].join("\n");
423
+ const sectionAvailableTools = [
424
+ "## Available tools",
425
+ "Use tools whenever they can produce a structured result:",
426
+ "- `generate_query` \u2014 convert natural language into SQL.",
427
+ "- `render_table` \u2014 execute SQL and show structured rows.",
428
+ "- `export_file` \u2014 package structured rows into CSV, JSON, SQL for download.",
429
+ "- `visualize_table` \u2014 execute read-only SQL and render a bar, line, pie, or scatter chart.",
430
+ "- `describe_table` \u2014 schema introspection (columns, keys, relationships).",
431
+ "- `explain_query` \u2014 performance analysis via EXPLAIN.",
432
+ "- `detect_anomaly` \u2014 data quality scans (nulls, duplicates, orphan FKs, outliers)."
433
+ ].join("\n");
434
+ const sectionConnection = [
435
+ "## Connection",
436
+ "NEVER ask the user for connection info, credentials, or database details \u2014 the database is already connected."
437
+ ].join("\n");
438
+ const sectionReadQueries = [
439
+ "## READ queries (SELECT)",
440
+ "For read-only requests, call tools immediately without asking for confirmation.",
441
+ "Workflow:",
442
+ " 1. Call generate_query to convert the request to SQL.",
443
+ " 2. Call render_table to execute the SQL and return results.",
444
+ " 3. If the user asks to export, save, download, dump, return JSON, or open the result in Excel/Sheets, call `export_file` using the rows returned from `render_table`.",
445
+ " 4. Summarize the results clearly for the user.",
446
+ "",
447
+ "If the user asks for a chart or visualization, call `visualize_table` instead of `render_table` once you have a read-only SQL query.",
448
+ "If the user asks to visualize data but is missing ANY of the following, call `askClarification` BEFORE calling `visualize_table`:",
449
+ " - Chart type not specified \u2192 ask them to pick: bar, line, pie, scatter",
450
+ " - The intended metric/measure column is ambiguous (e.g. table has multiple numeric columns)",
451
+ " - The intended dimension/label column is ambiguous",
452
+ " - The time range or filter condition is unclear for a line/scatter chart",
453
+ "Only call `visualize_table` once ALL required inputs (sql + chartType) are unambiguous."
454
+ ].join("\n");
455
+ const sectionMutationQueries = [
456
+ "## MUTATION queries (INSERT / UPDATE / DELETE / DROP / TRUNCATE / ALTER)",
457
+ "NEVER auto-execute mutation SQL. Always follow this workflow:",
458
+ " 1. Call generate_query to produce the SQL.",
459
+ " 2. STOP. Show the generated SQL to the user and explain exactly what it will change.",
460
+ " 3. Explicitly ask the user to confirm before proceeding.",
461
+ " 4. Only call render_table after the user gives clear approval.",
462
+ 'Even if the user says "just do it" \u2014 still show the SQL and ask once before executing.'
463
+ ].join("\n");
464
+ const sectionRules = [
465
+ "## Rules",
466
+ "- Stay grounded in the provided schema context.",
467
+ "- Never invent tables or columns that are not present in the schema context.",
468
+ "- If schema context is incomplete, say what is missing before making assumptions.",
469
+ "- After generating a read-only query, prefer calling `render_table` so the user gets concrete results.",
470
+ "- For destructive or mutating SQL, explain the plan clearly and let the approval flow gate execution.",
471
+ "- Only call `export_file` for structured row data. Prefer `render_table` first, then export the returned rows.",
472
+ "- Keep narration concise and let tool blocks carry the detailed output."
473
+ ].join("\n");
474
+ const sectionClarification = [
475
+ "## Clarification tool",
476
+ "Use `askClarification` when you cannot safely proceed without more information. Concrete triggers:",
477
+ ' - User wants a visualization but did not specify chart type \u2192 question type: `single`, suggestions: ["bar","line","pie","scatter"]',
478
+ " - User wants a visualization but the table has multiple numeric columns and intent is unclear \u2192 question type: `single`, suggestions: list the column names",
479
+ " - User request references an entity that maps to multiple tables in the schema \u2192 question type: `single`",
480
+ ' - User asks to "update/delete something" without specifying a filter condition \u2192 question type: `open`',
481
+ " - User asks for a trend/time-series but no date column is obvious \u2192 question type: `single`, suggestions: list candidate date columns",
482
+ "",
483
+ "Rules for calling `askClarification`:",
484
+ " - Call it at most ONCE per user turn \u2014 batch all open questions into a single call.",
485
+ " - Populate `suggestions` with 3\u20135 concrete options whenever the answer set is bounded (column names, chart types, table names).",
486
+ " - Use `type: single` when exactly one answer is needed, `multiple` for multi-select, `open` for free text.",
487
+ " - Mark `required: true` for questions that block execution; `required: false` for nice-to-have context.",
488
+ ' - After the conversation contains a "[Quiz answers]" message, NEVER call `askClarification` again \u2014 use the answers and proceed fully.',
489
+ " - Do NOT call `askClarification` to confirm read-only queries \u2014 just execute them."
490
+ ].join("\n");
491
+ const sectionUserIntent = selectedOptions.length ? [
492
+ "## Current user intent focus",
493
+ "The user explicitly selected these tool intents before sending the message:",
494
+ ...selectedOptions.map((o) => `- ${o.label}: ${o.promptHint}`),
495
+ "Honor these hints when they fit the request, but do not invent missing information or bypass any approval rule."
496
+ ].join("\n") : null;
497
+ const sectionSchema = [
498
+ "## Database schema (always loaded)",
499
+ resolvedSchema
500
+ ].join("\n");
501
+ return [
502
+ sectionIdentity,
503
+ sectionAvailableTools,
504
+ sectionConnection,
505
+ sectionReadQueries,
506
+ sectionMutationQueries,
507
+ sectionRules,
508
+ sectionClarification,
509
+ ...sectionUserIntent ? [sectionUserIntent] : [],
510
+ sectionSchema
511
+ ].join("\n\n");
512
+ }
513
+
514
+ const AgentToolName = {
515
+ GenerateQuery: "generate_query",
516
+ RenderTable: "render_table",
517
+ VisualizeTable: "visualize_table",
518
+ ExplainQuery: "explain_query",
519
+ DetectAnomaly: "detect_anomaly",
520
+ DescribeTable: "describe_table",
521
+ /** Re-executes SQL on the server and exports rows — no row data in context window */
522
+ ExportQueryResult: "export_query_result",
523
+ /** Exports free-form text (notes, scripts, docs) directly to a file */
524
+ ExportContent: "export_content",
525
+ AskClarification: "askClarification"
526
+ };
527
+
528
+ const getPlanString = (node, key) => {
529
+ const value = node[key];
530
+ return typeof value === "string" ? value : "";
531
+ };
532
+ const getPlanNumber = (node, key) => {
533
+ const value = Number(node[key]);
534
+ return Number.isFinite(value) ? value : 0;
535
+ };
536
+ function formatPlanTree(node, depth = 0) {
537
+ const indent = " ".repeat(depth);
538
+ const relationName = getPlanString(node, "Relation Name");
539
+ const relationSuffix = relationName ? ` on ${relationName}` : "";
540
+ const cost = `${getPlanNumber(node, "Startup Cost").toFixed(2)}..${getPlanNumber(node, "Total Cost").toFixed(2)}`;
541
+ const actualTotalTime = getPlanNumber(node, "Actual Total Time");
542
+ const actual = actualTotalTime > 0 ? ` actual=${actualTotalTime.toFixed(2)}ms` : "";
543
+ const currentLine = `${indent}${getPlanString(node, "Node Type")}${relationSuffix} (cost=${cost}${actual})`;
544
+ const childLines = Array.isArray(node.Plans) ? node.Plans.flatMap((child) => formatPlanTree(child, depth + 1)) : [];
545
+ return [currentLine, ...childLines];
546
+ }
547
+ function findSlowestPlanNode(node) {
548
+ const children = Array.isArray(node.Plans) ? node.Plans : [];
549
+ return children.reduce((slowest, child) => {
550
+ const nestedSlowest = findSlowestPlanNode(child);
551
+ const slowestCost = getPlanNumber(slowest, "Actual Total Time") || getPlanNumber(slowest, "Total Cost");
552
+ const nestedCost = getPlanNumber(nestedSlowest, "Actual Total Time") || getPlanNumber(nestedSlowest, "Total Cost");
553
+ return nestedCost > slowestCost ? nestedSlowest : slowest;
554
+ }, node);
555
+ }
556
+ function buildExplainSuggestions(slowestNode) {
557
+ const suggestions = [];
558
+ const nodeType = getPlanString(slowestNode, "Node Type");
559
+ const relationName = getPlanString(slowestNode, "Relation Name").trim();
560
+ const filter = getPlanString(slowestNode, "Filter").trim();
561
+ const sortKey = Array.isArray(slowestNode["Sort Key"]) ? slowestNode["Sort Key"].map((value) => String(value)).join(", ") : "";
562
+ if (nodeType.includes("Seq Scan") && relationName) {
563
+ suggestions.push(
564
+ `Consider an index on ${relationName}${filter ? ` for filter ${filter}` : ""}.`
565
+ );
566
+ }
567
+ if (nodeType.includes("Sort") && sortKey) {
568
+ suggestions.push(`Consider an index that supports ORDER BY ${sortKey}.`);
569
+ }
570
+ if (nodeType.includes("Nested Loop") || nodeType.includes("Hash Join")) {
571
+ suggestions.push(
572
+ "Review join predicates and ensure join keys are indexed."
573
+ );
574
+ }
575
+ if (suggestions.length === 0) {
576
+ suggestions.push(
577
+ "Review the slowest plan node, filter predicates, and row estimates before tuning."
578
+ );
579
+ }
580
+ return suggestions;
581
+ }
582
+ function buildExplainSummary(slowestNode) {
583
+ const nodeType = getPlanString(slowestNode, "Node Type") || "Plan node";
584
+ const relationName = getPlanString(slowestNode, "Relation Name").trim();
585
+ const cost = getPlanNumber(slowestNode, "Actual Total Time") || getPlanNumber(slowestNode, "Total Cost");
586
+ if (relationName) {
587
+ return `${nodeType} on ${relationName} is the dominant cost in this plan (${cost.toFixed(2)}).`;
588
+ }
589
+ return `${nodeType} is the dominant cost in this plan (${cost.toFixed(2)}).`;
590
+ }
591
+
592
+ const PREVIEW_LIMIT = 20;
593
+ const MIME_TYPE_BY_FORMAT = {
594
+ csv: "text/csv;charset=utf-8",
595
+ json: "application/json;charset=utf-8",
596
+ sql: "application/sql;charset=utf-8",
597
+ markdown: "text/markdown;charset=utf-8",
598
+ txt: "text/plain;charset=utf-8",
599
+ tsv: "text/tab-separated-values;charset=utf-8",
600
+ xml: "application/xml;charset=utf-8",
601
+ yaml: "application/yaml;charset=utf-8",
602
+ html: "text/html;charset=utf-8"
603
+ };
604
+ const EXTENSION_BY_FORMAT = {
605
+ csv: "csv",
606
+ json: "json",
607
+ sql: "sql",
608
+ markdown: "md",
609
+ txt: "txt",
610
+ tsv: "tsv",
611
+ xml: "xml",
612
+ yaml: "yaml",
613
+ html: "html"
614
+ };
615
+ const SQL_TYPE_PRIORITY = [
616
+ "boolean",
617
+ "integer",
618
+ "numeric",
619
+ "timestamp",
620
+ "jsonb"
621
+ ];
622
+ function collectColumns(rows) {
623
+ const columns = [];
624
+ const seen = /* @__PURE__ */ new Set();
625
+ for (const row of rows) {
626
+ for (const key of Object.keys(row)) {
627
+ if (seen.has(key)) continue;
628
+ seen.add(key);
629
+ columns.push(key);
630
+ }
631
+ }
632
+ return columns;
633
+ }
634
+ function sanitizeFilename(filename) {
635
+ return filename.trim().replace(/\.[a-z0-9]+$/i, "").replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/-{2,}/g, "-").replace(/^-|-$/g, "") || "export";
636
+ }
637
+ function withExtension(filename, format) {
638
+ const safeName = sanitizeFilename(filename);
639
+ const extension = EXTENSION_BY_FORMAT[format];
640
+ return safeName.endsWith(`.${extension}`) ? safeName : `${safeName}.${extension}`;
641
+ }
642
+ function toPreview(rows, columns) {
643
+ return {
644
+ columns,
645
+ rows: rows.slice(0, PREVIEW_LIMIT),
646
+ truncated: rows.length > PREVIEW_LIMIT
647
+ };
648
+ }
649
+ function escapeSqlIdentifier(identifier) {
650
+ return `"${identifier.replace(/"/g, '""')}"`;
651
+ }
652
+ function escapeSqlValue(value) {
653
+ if (value === null || typeof value === "undefined") {
654
+ return "NULL";
655
+ }
656
+ if (typeof value === "number") {
657
+ return Number.isFinite(value) ? String(value) : "NULL";
658
+ }
659
+ if (typeof value === "boolean") {
660
+ return value ? "TRUE" : "FALSE";
661
+ }
662
+ if (value instanceof Date) {
663
+ return `'${value.toISOString().replace(/'/g, "''")}'`;
664
+ }
665
+ if (typeof value === "object") {
666
+ return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
667
+ }
668
+ return `'${String(value).replace(/'/g, "''")}'`;
669
+ }
670
+ function inferSqlType(values) {
671
+ let bestType = "text";
672
+ for (const value of values) {
673
+ if (value === null || typeof value === "undefined") continue;
674
+ const inferredType = (() => {
675
+ if (typeof value === "boolean") return "boolean";
676
+ if (typeof value === "number") {
677
+ return Number.isInteger(value) ? "integer" : "numeric";
678
+ }
679
+ if (value instanceof Date) return "timestamp";
680
+ if (typeof value === "object") return "jsonb";
681
+ if (typeof value === "string") {
682
+ const parsedDate = Date.parse(value);
683
+ if (!Number.isNaN(parsedDate) && /[-:TZ]/.test(value)) {
684
+ return "timestamp";
685
+ }
686
+ }
687
+ return "text";
688
+ })();
689
+ if (SQL_TYPE_PRIORITY.indexOf(inferredType) > SQL_TYPE_PRIORITY.indexOf(bestType)) {
690
+ bestType = inferredType;
691
+ }
692
+ }
693
+ return bestType;
694
+ }
695
+ function toSqlContent(rows, tableName, columns) {
696
+ const safeTableName = escapeSqlIdentifier(tableName);
697
+ const createStatement = columns.length ? `CREATE TABLE ${safeTableName} (
698
+ ${columns.map((column) => {
699
+ const values = rows.map((row) => row[column]);
700
+ return ` ${escapeSqlIdentifier(column)} ${inferSqlType(values)}`;
701
+ }).join(",\n")}
702
+ );` : `CREATE TABLE ${safeTableName} ();`;
703
+ const insertStatements = rows.map((row) => {
704
+ const columnList = columns.map(escapeSqlIdentifier).join(", ");
705
+ const values = columns.map((column) => escapeSqlValue(row[column])).join(", ");
706
+ return `INSERT INTO ${safeTableName} (${columnList}) VALUES (${values});`;
707
+ });
708
+ return [createStatement, ...insertStatements].join("\n\n");
709
+ }
710
+ function toMarkdownContent(rows, columns) {
711
+ if (columns.length === 0) return "";
712
+ const header = `| ${columns.join(" | ")} |`;
713
+ const separator = `| ${columns.map(() => "---").join(" | ")} |`;
714
+ const bodyRows = rows.map((row) => {
715
+ const cells = columns.map((col) => {
716
+ const value = row[col];
717
+ if (value === null || value === void 0) return "";
718
+ if (typeof value === "object") return JSON.stringify(value);
719
+ return String(value).replace(/\|/g, "\\|");
720
+ });
721
+ return `| ${cells.join(" | ")} |`;
722
+ });
723
+ return [header, separator, ...bodyRows].join("\n");
724
+ }
725
+ function toTsvContent(rows, columns) {
726
+ const header = columns.join(" ");
727
+ const bodyRows = rows.map(
728
+ (row) => columns.map((col) => {
729
+ const value = row[col];
730
+ if (value === null || value === void 0) return "";
731
+ if (typeof value === "object") return JSON.stringify(value);
732
+ return String(value).replace(/\t/g, " ").replace(/\n/g, " ");
733
+ }).join(" ")
734
+ );
735
+ return [header, ...bodyRows].join("\n");
736
+ }
737
+ function toTxtContent(rows, columns) {
738
+ if (columns.length === 0 || rows.length === 0) return "";
739
+ const widths = columns.map((col) => {
740
+ const max = Math.max(
741
+ col.length,
742
+ ...rows.map((row) => {
743
+ const v = row[col];
744
+ if (v === null || v === void 0) return 0;
745
+ return String(typeof v === "object" ? JSON.stringify(v) : v).length;
746
+ })
747
+ );
748
+ return Math.min(max, 50);
749
+ });
750
+ const pad = (val, width) => val.padEnd(width).slice(0, width);
751
+ const divider = widths.map((w) => "-".repeat(w)).join(" ");
752
+ const header = columns.map((col, i) => pad(col, widths[i])).join(" ");
753
+ const bodyRows = rows.map(
754
+ (row) => columns.map((col, i) => {
755
+ const v = row[col];
756
+ const str = v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
757
+ return pad(str, widths[i]);
758
+ }).join(" ")
759
+ );
760
+ return [header, divider, ...bodyRows].join("\n");
761
+ }
762
+ function escapeXmlValue(value) {
763
+ if (value === null || value === void 0) return "";
764
+ const str = typeof value === "object" ? JSON.stringify(value) : String(value);
765
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
766
+ }
767
+ function toXmlContent(rows, columns, tableName) {
768
+ const tagName = tableName.replace(/[^a-zA-Z0-9_]/g, "_") || "row";
769
+ const items = rows.map((row) => {
770
+ const fields = columns.map((col) => {
771
+ const safeCol = col.replace(/[^a-zA-Z0-9_]/g, "_") || "_col";
772
+ return ` <${safeCol}>${escapeXmlValue(row[col])}</${safeCol}>`;
773
+ });
774
+ return ` <${tagName}>
775
+ ${fields.join("\n")}
776
+ </${tagName}>`;
777
+ });
778
+ return `<?xml version="1.0" encoding="UTF-8"?>
779
+ <data>
780
+ ${items.join("\n")}
781
+ </data>`;
782
+ }
783
+ function yamlScalar(value, indent) {
784
+ if (value === null || value === void 0) return "null";
785
+ if (typeof value === "boolean") return value ? "true" : "false";
786
+ if (typeof value === "number") return String(value);
787
+ if (typeof value === "object") {
788
+ if (Array.isArray(value)) {
789
+ const items = value.map((item) => `${indent} - ${yamlScalar(item, `${indent} `)}`).join("\n");
790
+ return `
791
+ ${items}`;
792
+ }
793
+ const obj = value;
794
+ const entries = Object.entries(obj).map(([k, v]) => `${indent} ${k}: ${yamlScalar(v, `${indent} `)}`).join("\n");
795
+ return `
796
+ ${entries}`;
797
+ }
798
+ const str = String(value);
799
+ if (/[:#\[\]{}&*!|>'"%@`\n]/.test(str) || str.trim() !== str) {
800
+ return `"${str.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n")}"`;
801
+ }
802
+ return str;
803
+ }
804
+ function toYamlContent(rows, columns) {
805
+ const items = rows.map((row) => {
806
+ const fields = columns.map((col, i) => {
807
+ const prefix = i === 0 ? "- " : " ";
808
+ return `${prefix}${col}: ${yamlScalar(row[col], " ")}`;
809
+ });
810
+ return fields.join("\n");
811
+ });
812
+ return items.join("\n") + "\n";
813
+ }
814
+ function toHtmlContent(rows, columns, tableName) {
815
+ const escapeHtml = (v) => {
816
+ const str = v === null || v === void 0 ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
817
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
818
+ };
819
+ const thead = `<thead>
820
+ <tr>
821
+ ${columns.map((c) => ` <th>${escapeHtml(c)}</th>`).join("\n")}
822
+ </tr>
823
+ </thead>`;
824
+ const tbody = `<tbody>
825
+ ${rows.map(
826
+ (row) => ` <tr>
827
+ ${columns.map((col) => ` <td>${escapeHtml(row[col])}</td>`).join("\n")}
828
+ </tr>`
829
+ ).join("\n")}
830
+ </tbody>`;
831
+ return `<!DOCTYPE html>
832
+ <html lang="en">
833
+ <head>
834
+ <meta charset="UTF-8">
835
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
836
+ <title>${tableName}</title>
837
+ <style>
838
+ body { font-family: sans-serif; padding: 1rem; }
839
+ table { border-collapse: collapse; width: 100%; }
840
+ th, td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
841
+ th { background: #f4f4f4; font-weight: 600; }
842
+ tr:nth-child(even) { background: #fafafa; }
843
+ </style>
844
+ </head>
845
+ <body>
846
+ <h2>${tableName}</h2>
847
+ <table>
848
+ ${thead}
849
+ ${tbody}
850
+ </table>
851
+ </body>
852
+ </html>`;
853
+ }
854
+ function buildExportFileResult({
855
+ data,
856
+ content: rawContent,
857
+ filename,
858
+ format,
859
+ tableName
860
+ }) {
861
+ const resolvedBaseName = filename || tableName || "export";
862
+ const resolvedFilename = withExtension(resolvedBaseName, format);
863
+ if (rawContent !== void 0) {
864
+ const text = rawContent;
865
+ const preview2 = {
866
+ columns: [],
867
+ rows: [],
868
+ truncated: false
869
+ };
870
+ return {
871
+ filename: resolvedFilename,
872
+ mimeType: MIME_TYPE_BY_FORMAT[format],
873
+ content: text,
874
+ format,
875
+ encoding: "utf8",
876
+ fileSize: Buffer.byteLength(text, "utf8"),
877
+ preview: preview2
878
+ };
879
+ }
880
+ const rows = Array.isArray(data) ? data : [];
881
+ const columns = collectColumns(rows);
882
+ if (rows.length === 0) {
883
+ return {
884
+ filename: resolvedFilename,
885
+ mimeType: MIME_TYPE_BY_FORMAT[format],
886
+ content: "",
887
+ format,
888
+ encoding: "utf8",
889
+ fileSize: 0,
890
+ preview: toPreview([], columns),
891
+ error: "No rows available to export."
892
+ };
893
+ }
894
+ const preview = toPreview(rows, columns);
895
+ let content;
896
+ switch (format) {
897
+ case "csv":
898
+ content = Papa.unparse(rows);
899
+ break;
900
+ case "json":
901
+ content = JSON.stringify(rows, null, 2);
902
+ break;
903
+ case "sql":
904
+ content = toSqlContent(rows, tableName || "export_data", columns);
905
+ break;
906
+ case "markdown":
907
+ content = toMarkdownContent(rows, columns);
908
+ break;
909
+ case "txt":
910
+ content = toTxtContent(rows, columns);
911
+ break;
912
+ case "tsv":
913
+ content = toTsvContent(rows, columns);
914
+ break;
915
+ case "xml":
916
+ content = toXmlContent(rows, columns, tableName || "export_data");
917
+ break;
918
+ case "yaml":
919
+ content = toYamlContent(rows, columns);
920
+ break;
921
+ case "html":
922
+ content = toHtmlContent(rows, columns, tableName || "export_data");
923
+ break;
924
+ default:
925
+ content = Papa.unparse(rows);
926
+ }
927
+ return {
928
+ filename: resolvedFilename,
929
+ mimeType: MIME_TYPE_BY_FORMAT[format],
930
+ content,
931
+ format,
932
+ encoding: "utf8",
933
+ fileSize: Buffer.byteLength(content, "utf8"),
934
+ preview
935
+ };
936
+ }
937
+
938
+ function rowsToRecords(rows, fields = []) {
939
+ return rows.map((row) => {
940
+ if (Array.isArray(row)) {
941
+ return row.reduce((record, value, index) => {
942
+ var _a;
943
+ const name = ((_a = fields[index]) == null ? void 0 : _a.name) || `column_${index + 1}`;
944
+ record[name] = value;
945
+ return record;
946
+ }, {});
947
+ }
948
+ return row || {};
949
+ });
950
+ }
951
+ function getCountFromRows(rows) {
952
+ const firstRow = rows[0];
953
+ if (!firstRow) {
954
+ return 0;
955
+ }
956
+ const countValue = Object.values(firstRow)[0];
957
+ const parsed = Number(countValue);
958
+ return Number.isFinite(parsed) ? parsed : 0;
959
+ }
960
+ const toFiniteNumber = (value) => {
961
+ if (typeof value === "number" && Number.isFinite(value)) {
962
+ return value;
963
+ }
964
+ if (typeof value === "string" && value.trim()) {
965
+ const parsed = Number(value);
966
+ return Number.isFinite(parsed) ? parsed : null;
967
+ }
968
+ return null;
969
+ };
970
+ const isNumericColumn = (rows, key) => rows.some((row) => toFiniteNumber(row[key]) !== null);
971
+ const inferLabelField = (rows, keys) => keys.find((key) => !isNumericColumn(rows, key)) || keys[0] || null;
972
+ const buildSeriesPoints = (rows, labelField, valueField) => {
973
+ const points = [];
974
+ for (let index = 0; index < rows.length; index += 1) {
975
+ const row = rows[index];
976
+ const value = toFiniteNumber(row[valueField]);
977
+ if (value === null) {
978
+ continue;
979
+ }
980
+ const rawLabel = row[labelField];
981
+ const label = rawLabel === null || typeof rawLabel === "undefined" || rawLabel === "" ? `Row ${index + 1}` : String(rawLabel);
982
+ points.push({
983
+ label,
984
+ x: label,
985
+ y: value
986
+ });
987
+ }
988
+ return points;
989
+ };
990
+ const buildScatterPoints = (rows, xField, yField, labelField) => {
991
+ const points = [];
992
+ for (let index = 0; index < rows.length; index += 1) {
993
+ const row = rows[index];
994
+ const xValue = toFiniteNumber(row[xField]);
995
+ const yValue = toFiniteNumber(row[yField]);
996
+ if (xValue === null || yValue === null) {
997
+ continue;
998
+ }
999
+ const rawLabel = labelField ? row[labelField] : null;
1000
+ const label = rawLabel === null || typeof rawLabel === "undefined" || rawLabel === "" ? `Point ${index + 1}` : String(rawLabel);
1001
+ points.push({
1002
+ label,
1003
+ x: xValue,
1004
+ y: yValue
1005
+ });
1006
+ }
1007
+ return points;
1008
+ };
1009
+ async function visualizeTableResult(adapter, sql, chartType) {
1010
+ const normalizedSql = normalizeSql(sql);
1011
+ if (!normalizedSql) {
1012
+ throw new Error("SQL is required.");
1013
+ }
1014
+ if (!isSelectLikeSql(normalizedSql)) {
1015
+ throw new Error("Only read-only SELECT queries can be visualized.");
1016
+ }
1017
+ const safeLimit = Math.min(MAX_RENDER_LIMIT, 50);
1018
+ const wrappedSql = `SELECT * FROM (${normalizedSql}) AS agent_chart_result LIMIT ${safeLimit + 1}`;
1019
+ const result = await adapter.rawOut(wrappedSql);
1020
+ const rows = rowsToRecords(result.rows || [], result.fields || []);
1021
+ const truncated = rows.length > safeLimit;
1022
+ const visibleRows = truncated ? rows.slice(0, safeLimit) : rows;
1023
+ const keys = (result.fields || []).map((field) => field.name || "unknown");
1024
+ if (visibleRows.length === 0 || keys.length === 0) {
1025
+ throw new Error(
1026
+ "No rows returned. Try a query with grouped or measurable data."
1027
+ );
1028
+ }
1029
+ if (chartType === "scatter") {
1030
+ const numericKeys = keys.filter((key) => isNumericColumn(visibleRows, key));
1031
+ if (numericKeys.length < 2) {
1032
+ throw new Error("Scatter charts require at least two numeric columns.");
1033
+ }
1034
+ const xField = numericKeys[0];
1035
+ const yField = numericKeys[1];
1036
+ const labelField2 = inferLabelField(
1037
+ visibleRows,
1038
+ keys.filter((key) => key !== xField && key !== yField)
1039
+ );
1040
+ const points2 = buildScatterPoints(visibleRows, xField, yField, labelField2);
1041
+ if (points2.length === 0) {
1042
+ throw new Error(
1043
+ "Could not build scatter chart points from the query result."
1044
+ );
1045
+ }
1046
+ return {
1047
+ sql: normalizedSql,
1048
+ chartType,
1049
+ xField,
1050
+ yField,
1051
+ labelField: labelField2 || void 0,
1052
+ points: points2,
1053
+ rowCount: points2.length,
1054
+ truncated
1055
+ };
1056
+ }
1057
+ const labelField = inferLabelField(visibleRows, keys);
1058
+ if (!labelField) {
1059
+ throw new Error("Could not infer a label column for the chart.");
1060
+ }
1061
+ const valueField = keys.find(
1062
+ (key) => key !== labelField && isNumericColumn(visibleRows, key)
1063
+ );
1064
+ if (!valueField) {
1065
+ throw new Error(
1066
+ "This chart needs at least one numeric column in the result."
1067
+ );
1068
+ }
1069
+ const points = buildSeriesPoints(visibleRows, labelField, valueField);
1070
+ if (points.length === 0) {
1071
+ throw new Error("Could not build chart points from the query result.");
1072
+ }
1073
+ return {
1074
+ sql: normalizedSql,
1075
+ chartType,
1076
+ xField: labelField,
1077
+ yField: valueField,
1078
+ labelField,
1079
+ points,
1080
+ rowCount: points.length,
1081
+ truncated
1082
+ };
1083
+ }
1084
+ async function renderTableResult(adapter, sql, limit) {
1085
+ const normalizedSql = normalizeSql(sql);
1086
+ if (!normalizedSql) {
1087
+ throw new Error("SQL is required.");
1088
+ }
1089
+ if (!isSelectLikeSql(normalizedSql)) {
1090
+ const mutationResult = await adapter.rawOut(
1091
+ normalizedSql
1092
+ );
1093
+ return {
1094
+ sql: normalizedSql,
1095
+ columns: [
1096
+ { name: "operation", type: "text" },
1097
+ { name: "affected_rows", type: "integer" }
1098
+ ],
1099
+ rows: [
1100
+ {
1101
+ operation: mutationResult.command || "MUTATION",
1102
+ affected_rows: mutationResult.rowCount || 0
1103
+ }
1104
+ ],
1105
+ rowCount: 1,
1106
+ truncated: false
1107
+ };
1108
+ }
1109
+ const safeLimit = clampLimit(limit);
1110
+ const wrappedSql = `SELECT * FROM (${normalizedSql}) AS agent_result LIMIT ${safeLimit + 1}`;
1111
+ const result = await adapter.rawOut(wrappedSql);
1112
+ const rows = rowsToRecords(result.rows || [], result.fields || []);
1113
+ const truncated = rows.length > safeLimit;
1114
+ const visibleRows = truncated ? rows.slice(0, safeLimit) : rows;
1115
+ return {
1116
+ sql: normalizedSql,
1117
+ columns: (result.fields || []).map((field) => ({
1118
+ name: field.name || "unknown",
1119
+ type: resolveFieldType(field)
1120
+ })),
1121
+ rows: visibleRows,
1122
+ rowCount: visibleRows.length,
1123
+ truncated
1124
+ };
1125
+ }
1126
+
1127
+ function findSnapshotForTable(schemaSnapshots, schemaName) {
1128
+ if (!(schemaSnapshots == null ? void 0 : schemaSnapshots.length)) return void 0;
1129
+ const snapshot = schemaSnapshots.find(
1130
+ (s) => s.name.toLowerCase() === schemaName.toLowerCase()
1131
+ ) || schemaSnapshots[0];
1132
+ return snapshot;
1133
+ }
1134
+ function resolveActiveTools(adapter, schemaSnapshots) {
1135
+ const hasSnapshot = !!(schemaSnapshots == null ? void 0 : schemaSnapshots.length);
1136
+ if (adapter) {
1137
+ return [
1138
+ AgentToolName.GenerateQuery,
1139
+ AgentToolName.RenderTable,
1140
+ AgentToolName.ExportQueryResult,
1141
+ AgentToolName.ExportContent,
1142
+ AgentToolName.VisualizeTable,
1143
+ AgentToolName.ExplainQuery,
1144
+ ...hasSnapshot ? [AgentToolName.DetectAnomaly, AgentToolName.DescribeTable] : [],
1145
+ AgentToolName.AskClarification
1146
+ ];
1147
+ }
1148
+ return hasSnapshot ? [
1149
+ AgentToolName.GenerateQuery,
1150
+ AgentToolName.DescribeTable,
1151
+ AgentToolName.ExportContent,
1152
+ AgentToolName.AskClarification
1153
+ ] : [
1154
+ AgentToolName.GenerateQuery,
1155
+ AgentToolName.ExportContent,
1156
+ AgentToolName.AskClarification
1157
+ ];
1158
+ }
1159
+ function createDbAgentTools({
1160
+ model,
1161
+ adapter,
1162
+ dialect,
1163
+ schemaSnapshots
1164
+ }) {
1165
+ const resolvedSchemaContext = buildSchemaContext(schemaSnapshots);
1166
+ return {
1167
+ generate_query: tool({
1168
+ description: "Convert a natural language request into SQL for the active database schema. Always call this first before render_table.",
1169
+ inputSchema: z.object({
1170
+ prompt: z.string().min(1),
1171
+ // schema override per-call nếu agent muốn pass schema cụ thể
1172
+ schema: z.string().optional(),
1173
+ dialect: z.enum(["postgresql", "mysql", "sqlite"]).default("postgresql")
1174
+ }),
1175
+ execute: async (input) => {
1176
+ const result = await generateText({
1177
+ model,
1178
+ system: [
1179
+ `You convert user requests into ${input.dialect || dialect || "postgresql"} SQL.`,
1180
+ "Return a single SQL statement only.",
1181
+ "Default to SELECT queries. Only generate mutation SQL (INSERT/UPDATE/DELETE/DROP/TRUNCATE/ALTER) when the user EXPLICITLY and clearly requests a data change.",
1182
+ "If the intent is ambiguous, generate a SELECT instead.",
1183
+ "Never reference tables or columns outside the provided schema context.",
1184
+ "Set isMutation: true for ANY statement that modifies data or schema."
1185
+ ].join("\n"),
1186
+ prompt: [
1187
+ // input.schema (per-call override) → full snapshot context → fallback
1188
+ `Schema:
1189
+ ${input.schema || resolvedSchemaContext}`,
1190
+ `User request: ${input.prompt}`
1191
+ ].join("\n\n"),
1192
+ output: Output.object({
1193
+ schema: z.object({
1194
+ sql: z.string().describe("A single valid SQL statement."),
1195
+ isMutation: z.boolean().describe(
1196
+ "True if the SQL modifies data (INSERT/UPDATE/DELETE/DROP etc)."
1197
+ ),
1198
+ explanation: z.string().describe(
1199
+ "A short plain-English explanation of what the query does."
1200
+ )
1201
+ })
1202
+ })
1203
+ });
1204
+ const parsed = result.output;
1205
+ const sql = normalizeSql(parsed.sql);
1206
+ const isMutation = parsed.isMutation || isMutationSql(sql);
1207
+ return {
1208
+ sql,
1209
+ isMutation,
1210
+ explanation: parsed.explanation
1211
+ };
1212
+ }
1213
+ }),
1214
+ render_table: tool({
1215
+ description: "Execute SQL and return results. For SELECT queries, call immediately after generate_query. For mutation SQL (INSERT/UPDATE/DELETE/DROP/TRUNCATE/ALTER), this tool requires explicit user approval \u2014 NEVER call it with mutation SQL unless the user has confirmed after seeing the SQL.",
1216
+ inputSchema: z.object({
1217
+ sql: z.string().min(1),
1218
+ limit: z.number().int().min(1).max(MAX_RENDER_LIMIT).default(100)
1219
+ }),
1220
+ needsApproval: (input) => isMutationSql(input.sql),
1221
+ execute: async (input) => {
1222
+ assertDatabaseAdapter(adapter);
1223
+ return renderTableResult(adapter, input.sql, input.limit);
1224
+ }
1225
+ }),
1226
+ visualize_table: tool({
1227
+ description: "Execute a read-only SQL query and render a chart. Use this when the user wants a visualization and has chosen one of these chart types: bar, line, pie, or scatter. Ask the user to choose a chart type before calling this tool if they did not specify one.",
1228
+ inputSchema: z.object({
1229
+ sql: z.string().min(1),
1230
+ chartType: z.enum(["bar", "line", "pie", "scatter"])
1231
+ }),
1232
+ execute: async (input) => {
1233
+ assertDatabaseAdapter(adapter);
1234
+ const result = await visualizeTableResult(
1235
+ adapter,
1236
+ input.sql,
1237
+ input.chartType
1238
+ );
1239
+ return result;
1240
+ }
1241
+ }),
1242
+ //TODO: need to enhance this not stable
1243
+ export_query_result: tool({
1244
+ description: [
1245
+ "Re-execute a SQL SELECT query and export the result rows to a downloadable file.",
1246
+ "IMPORTANT: Pass only the `sql` string \u2014 do NOT pass row data from render_table.",
1247
+ "The tool fetches rows fresh from the database, so context window stays small.",
1248
+ "Use this after generate_query when the user asks to download/export query results.",
1249
+ "",
1250
+ "Supported formats:",
1251
+ " csv \u2014 spreadsheet (Excel, Google Sheets)",
1252
+ " tsv \u2014 tab-separated (also Excel-compatible)",
1253
+ " json \u2014 JSON array",
1254
+ " sql \u2014 INSERT statements for re-importing",
1255
+ " xml \u2014 XML document"
1256
+ ].join("\n"),
1257
+ inputSchema: z.object({
1258
+ sql: z.string().min(1).describe("The SQL SELECT query to execute and export."),
1259
+ format: z.enum(["csv", "tsv", "json", "sql", "xml"]),
1260
+ filename: z.string().min(1).optional(),
1261
+ limit: z.number().int().min(1).max(MAX_EXPORT_LIMIT).default(MAX_EXPORT_LIMIT).describe("Max rows to export. Defaults to 100 000.")
1262
+ }),
1263
+ needsApproval: (input) => isMutationSql(input.sql),
1264
+ execute: async (input) => {
1265
+ assertDatabaseAdapter(adapter);
1266
+ const sql = normalizeSql(input.sql);
1267
+ const result = await adapter.rawOut(sql);
1268
+ const rows = rowsToRecords(result.rows || [], result.fields || []);
1269
+ const limited = rows.slice(0, input.limit);
1270
+ return buildExportFileResult({
1271
+ data: limited,
1272
+ filename: input.filename,
1273
+ format: input.format
1274
+ });
1275
+ }
1276
+ }),
1277
+ export_content: tool({
1278
+ description: [
1279
+ "Export any free-form text content to a downloadable file.",
1280
+ "Use this when the user wants to save something that is NOT a table result:",
1281
+ " - Chat knowledge, analysis summaries, or reports \u2192 format: markdown",
1282
+ " - A SQL query or migration script \u2192 format: sql or txt",
1283
+ " - Plain notes or output \u2192 format: txt",
1284
+ " - Hand-crafted YAML config \u2192 format: yaml",
1285
+ " - An HTML page \u2192 format: html",
1286
+ "The `content` string is written as-is \u2014 no parsing or transformation is applied."
1287
+ ].join("\n"),
1288
+ inputSchema: z.object({
1289
+ content: z.string().min(1).describe("The raw text to write into the file."),
1290
+ format: z.enum([
1291
+ "markdown",
1292
+ "txt",
1293
+ "sql",
1294
+ "json",
1295
+ "yaml",
1296
+ "html",
1297
+ "xml",
1298
+ "csv",
1299
+ "tsv"
1300
+ ]),
1301
+ filename: z.string().min(1).optional()
1302
+ }),
1303
+ execute: async (input) => {
1304
+ return buildExportFileResult({
1305
+ content: input.content,
1306
+ filename: input.filename,
1307
+ format: input.format
1308
+ });
1309
+ }
1310
+ }),
1311
+ explain_query: tool({
1312
+ description: "Run EXPLAIN on a query and return a readable summary of the execution plan. Use this when the user asks about query performance, slow queries, or indexes.",
1313
+ inputSchema: z.object({
1314
+ sql: z.string().min(1)
1315
+ }),
1316
+ execute: async (input) => {
1317
+ var _a;
1318
+ assertDatabaseAdapter(adapter);
1319
+ const normalizedSql = normalizeSql(input.sql);
1320
+ const explainPrefix = isMutationSql(normalizedSql) ? "EXPLAIN (FORMAT JSON)" : "EXPLAIN (ANALYZE, FORMAT JSON)";
1321
+ const result = await adapter.rawOut(
1322
+ `${explainPrefix} ${normalizedSql}`
1323
+ );
1324
+ const rows = rowsToRecords(result.rows || [], result.fields || []);
1325
+ const planValue = (_a = rows[0]) == null ? void 0 : _a["QUERY PLAN"];
1326
+ const planJson = Array.isArray(planValue) ? planValue[0] : planValue;
1327
+ const rootPlan = planJson == null ? void 0 : planJson.Plan;
1328
+ if (!rootPlan) {
1329
+ throw new Error("Could not parse the EXPLAIN plan.");
1330
+ }
1331
+ const slowestNode = findSlowestPlanNode(rootPlan);
1332
+ const rawPlan = formatPlanTree(rootPlan).join("\n");
1333
+ return {
1334
+ rawPlan,
1335
+ summary: buildExplainSummary(slowestNode),
1336
+ slowestNode: String(slowestNode["Node Type"] || "Unknown"),
1337
+ estimatedCost: Number(rootPlan["Total Cost"] || 0),
1338
+ suggestions: buildExplainSuggestions(slowestNode)
1339
+ };
1340
+ }
1341
+ }),
1342
+ detect_anomaly: tool({
1343
+ description: "Scan a table for data quality issues: nulls, duplicate identifiers, orphan foreign keys, and numeric outliers. Use when the user asks about data quality or cleanliness.",
1344
+ inputSchema: z.object({
1345
+ tableName: z.string().min(1),
1346
+ schemaName: z.string().min(1),
1347
+ checks: z.array(z.enum(["nulls", "duplicates", "orphan_fk", "outliers"])).default(["nulls", "duplicates", "orphan_fk"])
1348
+ }),
1349
+ execute: async (input) => {
1350
+ var _a;
1351
+ assertDatabaseAdapter(adapter);
1352
+ const snapshot = findSnapshotForTable(
1353
+ schemaSnapshots,
1354
+ input.schemaName
1355
+ );
1356
+ const { tableName, detail } = resolveTableDetail(
1357
+ snapshot,
1358
+ input.tableName
1359
+ );
1360
+ const qualifiedTable = getQualifiedTableName(
1361
+ (snapshot == null ? void 0 : snapshot.name) || "public",
1362
+ tableName
1363
+ );
1364
+ const issues = [];
1365
+ const countResult = await adapter.rawOut(
1366
+ `SELECT COUNT(*)::int AS total FROM ${qualifiedTable}`
1367
+ );
1368
+ const totalRows = getCountFromRows(
1369
+ rowsToRecords(countResult.rows || [], countResult.fields || [])
1370
+ );
1371
+ if (input.checks.includes("nulls") && totalRows > 0) {
1372
+ const nullableCandidates = detail.columns.filter((column) => column.is_nullable).slice(0, 8);
1373
+ for (const column of nullableCandidates) {
1374
+ const result = await adapter.rawOut(
1375
+ `SELECT COUNT(*)::int AS count FROM ${qualifiedTable} WHERE ${toQuotedColumnName(column.name)} IS NULL`
1376
+ );
1377
+ const nullCount = getCountFromRows(
1378
+ rowsToRecords(result.rows || [], result.fields || [])
1379
+ );
1380
+ if (nullCount <= 0) continue;
1381
+ const ratio = totalRows === 0 ? 0 : nullCount / totalRows;
1382
+ issues.push({
1383
+ type: "nulls",
1384
+ severity: getIssueSeverity(ratio),
1385
+ column: column.name,
1386
+ description: `${column.name} has ${nullCount} NULL values (${(ratio * 100).toFixed(1)}% of scanned rows).`,
1387
+ fixSql: `UPDATE ${qualifiedTable} SET ${toQuotedColumnName(column.name)} = /* default value */ WHERE ${toQuotedColumnName(column.name)} IS NULL;`
1388
+ });
1389
+ }
1390
+ }
1391
+ if (input.checks.includes("duplicates") && totalRows > 0) {
1392
+ for (const column of buildDuplicateCandidates(detail)) {
1393
+ const result = await adapter.rawOut(
1394
+ `SELECT COUNT(*)::int AS duplicate_groups FROM (
1395
+ SELECT ${toQuotedColumnName(column.name)}
1396
+ FROM ${qualifiedTable}
1397
+ WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
1398
+ GROUP BY ${toQuotedColumnName(column.name)}
1399
+ HAVING COUNT(*) > 1
1400
+ ) duplicate_values`
1401
+ );
1402
+ const duplicateGroups = getCountFromRows(
1403
+ rowsToRecords(result.rows || [], result.fields || [])
1404
+ );
1405
+ if (duplicateGroups <= 0) continue;
1406
+ issues.push({
1407
+ type: "duplicates",
1408
+ severity: duplicateGroups > 10 ? "high" : "medium",
1409
+ column: column.name,
1410
+ description: `${duplicateGroups} duplicate value groups were found in ${column.name}.`,
1411
+ fixSql: `SELECT ${toQuotedColumnName(column.name)}, COUNT(*) FROM ${qualifiedTable} GROUP BY ${toQuotedColumnName(column.name)} HAVING COUNT(*) > 1;`
1412
+ });
1413
+ }
1414
+ }
1415
+ if (input.checks.includes("orphan_fk") && totalRows > 0) {
1416
+ for (const foreignKey of (_a = detail.foreign_keys) != null ? _a : []) {
1417
+ const referencedTable = getQualifiedTableName(
1418
+ foreignKey.referenced_table_schema,
1419
+ foreignKey.referenced_table
1420
+ );
1421
+ const result = await adapter.rawOut(
1422
+ `SELECT COUNT(*)::int AS count
1423
+ FROM ${qualifiedTable} source
1424
+ LEFT JOIN ${referencedTable} target
1425
+ ON source.${toQuotedColumnName(foreignKey.column)} = target.${toQuotedColumnName(foreignKey.referenced_column)}
1426
+ WHERE source.${toQuotedColumnName(foreignKey.column)} IS NOT NULL
1427
+ AND target.${toQuotedColumnName(foreignKey.referenced_column)} IS NULL`
1428
+ );
1429
+ const orphanCount = getCountFromRows(
1430
+ rowsToRecords(result.rows || [], result.fields || [])
1431
+ );
1432
+ if (orphanCount <= 0) continue;
1433
+ const ratio = totalRows === 0 ? 0 : orphanCount / totalRows;
1434
+ issues.push({
1435
+ type: "orphan_fk",
1436
+ severity: getIssueSeverity(ratio),
1437
+ column: foreignKey.column,
1438
+ description: `${orphanCount} rows in ${tableName}.${foreignKey.column} reference missing ${foreignKey.referenced_table}.${foreignKey.referenced_column} rows.`,
1439
+ fixSql: `DELETE FROM ${qualifiedTable} WHERE ${toQuotedColumnName(foreignKey.column)} IS NOT NULL AND ${toQuotedColumnName(foreignKey.column)} NOT IN (SELECT ${toQuotedColumnName(foreignKey.referenced_column)} FROM ${referencedTable});`
1440
+ });
1441
+ }
1442
+ }
1443
+ if (input.checks.includes("outliers") && totalRows > 0) {
1444
+ for (const column of getNumericColumns(detail)) {
1445
+ const result = await adapter.rawOut(
1446
+ `WITH stats AS (
1447
+ SELECT
1448
+ percentile_cont(0.25) WITHIN GROUP (ORDER BY ${toQuotedColumnName(column.name)}) AS q1,
1449
+ percentile_cont(0.75) WITHIN GROUP (ORDER BY ${toQuotedColumnName(column.name)}) AS q3
1450
+ FROM ${qualifiedTable}
1451
+ WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
1452
+ )
1453
+ SELECT COUNT(*)::int AS count
1454
+ FROM ${qualifiedTable}, stats
1455
+ WHERE ${toQuotedColumnName(column.name)} IS NOT NULL
1456
+ AND (
1457
+ ${toQuotedColumnName(column.name)} < q1 - 1.5 * (q3 - q1)
1458
+ OR ${toQuotedColumnName(column.name)} > q3 + 1.5 * (q3 - q1)
1459
+ )`
1460
+ );
1461
+ const outlierCount = getCountFromRows(
1462
+ rowsToRecords(result.rows || [], result.fields || [])
1463
+ );
1464
+ if (outlierCount <= 0) continue;
1465
+ const ratio = totalRows === 0 ? 0 : outlierCount / totalRows;
1466
+ issues.push({
1467
+ type: "outliers",
1468
+ severity: getIssueSeverity(ratio),
1469
+ column: column.name,
1470
+ description: `${outlierCount} potential outliers were found in ${column.name}.`,
1471
+ fixSql: `SELECT * FROM ${qualifiedTable} ORDER BY ${toQuotedColumnName(column.name)} DESC LIMIT 20;`
1472
+ });
1473
+ }
1474
+ }
1475
+ return {
1476
+ issues,
1477
+ scannedRows: totalRows,
1478
+ cleanScore: calculateCleanScore(issues)
1479
+ };
1480
+ }
1481
+ }),
1482
+ describe_table: tool({
1483
+ description: "Summarize a table, its columns, and its direct relationships using schema metadata. Use this when the user asks about table structure, columns, or relationships.",
1484
+ inputSchema: z.object({
1485
+ tableName: z.string().min(1),
1486
+ schemaName: z.string().min(1)
1487
+ }),
1488
+ execute: async (input) => {
1489
+ var _a;
1490
+ const snapshot = findSnapshotForTable(
1491
+ schemaSnapshots,
1492
+ input.schemaName
1493
+ );
1494
+ const { tableName, detail } = resolveTableDetail(
1495
+ snapshot,
1496
+ input.tableName
1497
+ );
1498
+ const columns = toColumnsForDescribe(detail);
1499
+ const relatedTables = Array.from(
1500
+ new Set(((_a = detail.foreign_keys) != null ? _a : []).map((key) => key.referenced_table))
1501
+ );
1502
+ return {
1503
+ tableName,
1504
+ summary: buildTableSummary(tableName, columns, relatedTables),
1505
+ columns,
1506
+ relatedTables
1507
+ };
1508
+ }
1509
+ }),
1510
+ askClarification: tool({
1511
+ description: 'Ask the user clarifying questions when their request is genuinely ambiguous. Call this tool at most ONCE per user message. Never call it again after the conversation contains a "[Quiz answers]" message.',
1512
+ inputSchema: z.object({
1513
+ context: z.string().describe("One sentence explaining why clarification is needed."),
1514
+ questions: z.array(
1515
+ z.object({
1516
+ id: z.string().describe('Short camelCase identifier, e.g. "lang"'),
1517
+ question: z.string(),
1518
+ type: z.enum(["single", "multiple", "open"]),
1519
+ suggestions: z.array(z.string()).min(0).max(5).describe("3\u20135 suggestion chips shown to the user"),
1520
+ required: z.boolean()
1521
+ })
1522
+ ).min(1).max(5)
1523
+ }),
1524
+ execute: async () => ({ acknowledged: true })
1525
+ })
1526
+ };
1527
+ }
1528
+
1529
+ function resolveDialect(body) {
1530
+ if (body.dialect) {
1531
+ return body.dialect;
1532
+ }
1533
+ if (body.dbType === DatabaseClientType.MYSQL) {
1534
+ return "mysql";
1535
+ }
1536
+ return "postgresql";
1537
+ }
1538
+ function resolveDatabaseClientType(body) {
1539
+ if (body.dbType === DatabaseClientType.MYSQL) {
1540
+ return DatabaseClientType.MYSQL;
1541
+ }
1542
+ return DatabaseClientType.POSTGRES;
1543
+ }
1544
+ function resolveSchemaSnapshots(body) {
1545
+ var _a;
1546
+ if ((_a = body.schemaSnapshots) == null ? void 0 : _a.length) {
1547
+ return body.schemaSnapshots;
1548
+ }
1549
+ if (body.schemaSnapshot) {
1550
+ return [body.schemaSnapshot];
1551
+ }
1552
+ return void 0;
1553
+ }
1554
+ const agent = defineEventHandler(async (event) => {
1555
+ const body = await readBody(event);
1556
+ const {
1557
+ provider,
1558
+ model,
1559
+ apiKey,
1560
+ messages,
1561
+ dbConnectionString,
1562
+ selectedCommandOptions,
1563
+ sendReasoning
1564
+ } = body;
1565
+ const dialect = resolveDialect(body);
1566
+ const schemaSnapshots = resolveSchemaSnapshots(body);
1567
+ if (!apiKey) {
1568
+ throw createError({ statusCode: 400, message: "API key is required" });
1569
+ }
1570
+ if (!provider || !model) {
1571
+ throw createError({
1572
+ statusCode: 400,
1573
+ message: "Provider and model are required"
1574
+ });
1575
+ }
1576
+ try {
1577
+ const providerModel = createProviderModel(
1578
+ provider,
1579
+ apiKey,
1580
+ model
1581
+ );
1582
+ const adapter = dbConnectionString ? await getDatabaseSource({
1583
+ dbConnectionString,
1584
+ type: resolveDatabaseClientType(body)
1585
+ }) : null;
1586
+ const tools = createDbAgentTools({
1587
+ model: providerModel,
1588
+ adapter,
1589
+ dialect,
1590
+ schemaSnapshots
1591
+ });
1592
+ const agent = new ToolLoopAgent({
1593
+ model: providerModel,
1594
+ instructions: buildAgentSystemPrompt(
1595
+ schemaSnapshots,
1596
+ selectedCommandOptions
1597
+ ),
1598
+ tools,
1599
+ stopWhen: ({ steps }) => steps.some(
1600
+ (s) => {
1601
+ var _a;
1602
+ return (_a = s.toolCalls) == null ? void 0 : _a.some(
1603
+ (tc) => tc.toolName === "askClarification"
1604
+ );
1605
+ }
1606
+ ) || stepCountIs(5)({ steps }),
1607
+ activeTools: resolveActiveTools(adapter, schemaSnapshots)
1608
+ });
1609
+ return await createAgentUIStreamResponse({
1610
+ agent,
1611
+ uiMessages: messages || [],
1612
+ sendReasoning: sendReasoning != null ? sendReasoning : true,
1613
+ experimental_transform: smoothStream(),
1614
+ sendSources: true
1615
+ });
1616
+ } catch (error) {
1617
+ console.error("DB Agent API Error:", error);
1618
+ throw createError({
1619
+ statusCode: 500,
1620
+ message: error instanceof Error ? error.message : "Failed to process DB agent request"
1621
+ });
1622
+ }
1623
+ });
1624
+
1625
+ export { agent as default };
1626
+ //# sourceMappingURL=agent.mjs.map