@madarco/agentbox 0.27.1 → 0.28.0-nightly.202607251721

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 (364) hide show
  1. package/CHANGELOG.md +87 -4
  2. package/README.md +7 -3
  3. package/dist/_cloud-attach-XZYF324R.js +26 -0
  4. package/dist/admin-client-NOZ5CCAH.js +15 -0
  5. package/dist/chunk-2VW37PW4.js +1694 -0
  6. package/dist/chunk-2VW37PW4.js.map +1 -0
  7. package/dist/{chunk-HR7NHH5J.js → chunk-3UMM4VJH.js} +808 -57
  8. package/dist/chunk-3UMM4VJH.js.map +1 -0
  9. package/dist/chunk-5U5QOFL5.js +20 -0
  10. package/dist/chunk-5U5QOFL5.js.map +1 -0
  11. package/dist/chunk-6P6D77QP.js +285 -0
  12. package/dist/chunk-6P6D77QP.js.map +1 -0
  13. package/dist/chunk-6V366IZC.js +2892 -0
  14. package/dist/chunk-6V366IZC.js.map +1 -0
  15. package/dist/{chunk-KWOEUFVA.js → chunk-7J6G526Q.js} +6 -14
  16. package/dist/{chunk-KWOEUFVA.js.map → chunk-7J6G526Q.js.map} +1 -1
  17. package/dist/{chunk-IDH5A4RR.js → chunk-AYPAYY5R.js} +17 -4
  18. package/dist/chunk-AYPAYY5R.js.map +1 -0
  19. package/dist/{chunk-JGZSA5ZI.js → chunk-BHJCMTHP.js} +58 -15
  20. package/dist/chunk-BHJCMTHP.js.map +1 -0
  21. package/dist/{chunk-26IKZRTT.js → chunk-BLWAWGFX.js} +297 -1217
  22. package/dist/chunk-BLWAWGFX.js.map +1 -0
  23. package/dist/chunk-CGPUFXET.js +95 -0
  24. package/dist/chunk-CGPUFXET.js.map +1 -0
  25. package/dist/{chunk-SJ75AIA2.js → chunk-D6AODRNA.js} +12 -9
  26. package/dist/{chunk-SJ75AIA2.js.map → chunk-D6AODRNA.js.map} +1 -1
  27. package/dist/chunk-DPJMEG7U.js +11 -0
  28. package/dist/chunk-DPJMEG7U.js.map +1 -0
  29. package/dist/chunk-E2ITEZAQ.js +148 -0
  30. package/dist/chunk-E2ITEZAQ.js.map +1 -0
  31. package/dist/{chunk-JE6UI5YR.js → chunk-NKVCIH6N.js} +89 -223
  32. package/dist/chunk-NKVCIH6N.js.map +1 -0
  33. package/dist/chunk-OEYAVBA6.js +120 -0
  34. package/dist/chunk-OEYAVBA6.js.map +1 -0
  35. package/dist/{chunk-UJEH2NJT.js → chunk-PXYPQ5BO.js} +64 -264
  36. package/dist/chunk-PXYPQ5BO.js.map +1 -0
  37. package/dist/chunk-QESXSSO6.js +670 -0
  38. package/dist/chunk-QESXSSO6.js.map +1 -0
  39. package/dist/{chunk-NEF6MDJO.js → chunk-QJCK2AFX.js} +128 -26
  40. package/dist/chunk-QJCK2AFX.js.map +1 -0
  41. package/dist/chunk-RUJJY23M.js +84 -0
  42. package/dist/chunk-RUJJY23M.js.map +1 -0
  43. package/dist/{chunk-LL7NCMUU.js → chunk-SKNJRYM5.js} +7 -13
  44. package/dist/chunk-SKNJRYM5.js.map +1 -0
  45. package/dist/chunk-WFGAMJ5Q.js +689 -0
  46. package/dist/chunk-WFGAMJ5Q.js.map +1 -0
  47. package/dist/chunk-ZJL56TJD.js +1444 -0
  48. package/dist/chunk-ZJL56TJD.js.map +1 -0
  49. package/dist/{chunk-V5XXJH63.js → chunk-ZXOP4LBG.js} +5 -8
  50. package/dist/chunk-ZXOP4LBG.js.map +1 -0
  51. package/dist/control-plane-2VEM2KCL.js +31 -0
  52. package/dist/custody-client-P6XIXHRG.js +16 -0
  53. package/dist/{dist-TSFVB7AI.js → dist-2SYQI5S2.js} +11 -7
  54. package/dist/dist-2SYQI5S2.js.map +1 -0
  55. package/dist/{dist-KQTMCVME.js → dist-6QZMZEL7.js} +18 -11
  56. package/dist/dist-6QZMZEL7.js.map +1 -0
  57. package/dist/{dist-FTKS2GI4.js → dist-JHMILJUT.js} +10 -6
  58. package/dist/{dist-OO52HARR.js → dist-JOFZOZCY.js} +41 -25
  59. package/dist/{dist-O3LKOIE7.js → dist-KZ2GEEEX.js} +11 -7
  60. package/dist/dist-KZ2GEEEX.js.map +1 -0
  61. package/dist/{dist-Z6L5MM5D.js → dist-Q5NY4CF6.js} +10 -6
  62. package/dist/{dist-U2SVLJUQ.js → dist-SKMNEDVW.js} +8 -2
  63. package/dist/dist-SKMNEDVW.js.map +1 -0
  64. package/dist/dist-SRCKO7ZV.js +197 -0
  65. package/dist/dist-SRCKO7ZV.js.map +1 -0
  66. package/dist/{dist-WVYAURMF.js → dist-UXZQWKY6.js} +10 -6
  67. package/dist/dist-UXZQWKY6.js.map +1 -0
  68. package/dist/env-file-UDUDQMP4.js +11 -0
  69. package/dist/env-file-UDUDQMP4.js.map +1 -0
  70. package/dist/hub-adopt-ZS5CREYF.js +21 -0
  71. package/dist/hub-adopt-ZS5CREYF.js.map +1 -0
  72. package/dist/index.js +2461 -1905
  73. package/dist/index.js.map +1 -1
  74. package/dist/node-postgres-6JUOVUN5.js +3584 -0
  75. package/dist/node-postgres-6JUOVUN5.js.map +1 -0
  76. package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js → prepared-state-75DIZ55S-P6LE4N64.js} +3 -2
  77. package/dist/prepared-state-75DIZ55S-P6LE4N64.js.map +1 -0
  78. package/dist/remote-hub-SJ4XWBA5.js +9 -0
  79. package/dist/remote-hub-SJ4XWBA5.js.map +1 -0
  80. package/dist/sqlite-proxy-53E5D2VM.js +2882 -0
  81. package/dist/sqlite-proxy-53E5D2VM.js.map +1 -0
  82. package/package.json +1 -1
  83. package/runtime/_shared/ctl.cjs +29199 -16813
  84. package/runtime/digitalocean/ctl.cjs +29199 -16813
  85. package/runtime/docker/packages/ctl/dist/bin.cjs +29199 -16813
  86. package/runtime/e2b/ctl.cjs +29199 -16813
  87. package/runtime/hetzner/ctl.cjs +29199 -16813
  88. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  89. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  90. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +5 -5
  91. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +2 -2
  95. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +2 -2
  97. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +2 -2
  99. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  100. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +2 -2
  101. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  102. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +2 -2
  103. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +2 -2
  109. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  110. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  111. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +4 -4
  113. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +2 -2
  115. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +2 -2
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +2 -2
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +2 -2
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +2 -2
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +2 -2
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +2 -2
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +2 -2
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +2 -2
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +2 -2
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +2 -2
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js +2 -2
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js +2 -2
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js +2 -2
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js +2 -2
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +4 -2
  160. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  161. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  163. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  165. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  167. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  168. package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +3 -0
  169. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0gvv4ct._.js +4 -0
  170. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0pn9b49._.js +4 -0
  171. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_145bz8z._.js +9 -0
  172. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_14y990b._.js +3 -0
  173. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_1nl4l3q._.js +3 -0
  174. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_sqlite-proxy_index_05v_j5r.js +15 -0
  175. package/runtime/hub/apps/hub/.next/server/chunks/{[externals]__12m3qoa._.js → [externals]__0f3aqcx._.js} +2 -2
  176. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-9g1s8._.js +3 -0
  177. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-pvfxg._.js +3 -0
  178. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01amzh6._.js +3 -0
  179. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02q799_._.js +3 -0
  180. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03k22rl._.js +3 -0
  181. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04tqk-j._.js +3 -0
  182. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05ovf1y._.js +3 -0
  183. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05s-_x7._.js +3 -0
  184. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07dnyfi._.js +3 -0
  185. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07zk6qo._.js +3 -0
  186. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_59yi6._.js +3 -0
  187. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ajlo3d._.js +3 -0
  188. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0b5s54n._.js +3 -0
  189. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c4fiez._.js +3 -0
  190. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c9iff1._.js +3 -0
  191. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
  192. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dh6lzr._.js +3 -0
  193. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ey83ai._.js +3 -0
  194. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h6vdvr._.js +3 -0
  195. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lup7p4._.js +3 -0
  196. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0luxuu4._.js +3 -0
  197. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nl2u6u._.js +3 -0
  198. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nonp-6._.js +3 -0
  199. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0oplozy._.js +3 -0
  200. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p-6wgd._.js +3 -0
  201. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0rcnwbw._.js +3 -0
  202. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tuz1am._.js +3 -0
  203. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +1 -1
  204. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10ry4ss._.js +3 -0
  205. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11hv164._.js +3 -0
  206. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__154_i13._.js +3 -0
  207. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17676rc._.js +3 -0
  208. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bg1alc._.js +3 -0
  209. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cvqb1d._.js +3 -0
  210. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60gbz._.js +3 -0
  211. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dm0jmw._.js +6 -0
  212. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dv_b1t._.js +3 -0
  213. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fzxip4._.js +3 -0
  214. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4oj-e._.js +3 -0
  215. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i4gq_2._.js +3 -0
  216. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v1p7in._.js +3 -0
  217. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9_her._.js +4 -0
  218. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x1jkpb._.js +3 -0
  219. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yd8n5l._.js +3 -0
  220. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20t_rs8._.js +3 -0
  221. package/runtime/hub/apps/hub/.next/server/chunks/_033w048._.js +1 -1
  222. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  223. package/runtime/hub/apps/hub/.next/server/chunks/{_0760z6y._.js → _0907rw0._.js} +15 -15
  224. package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +1 -1
  225. package/runtime/hub/apps/hub/.next/server/chunks/_0lgs9kd._.js +1 -1
  226. package/runtime/hub/apps/hub/.next/server/chunks/_0pyhcqe._.js +1 -1
  227. package/runtime/hub/apps/hub/.next/server/chunks/_1-42ili._.js +1 -1
  228. package/runtime/hub/apps/hub/.next/server/chunks/_11__3wi._.js +1 -1
  229. package/runtime/hub/apps/hub/.next/server/chunks/_12flzuh._.js +1 -1
  230. package/runtime/hub/apps/hub/.next/server/chunks/_1bng7w9._.js +1 -1
  231. package/runtime/hub/apps/hub/.next/server/chunks/_1rpkqst._.js +1 -1
  232. package/runtime/hub/apps/hub/.next/server/chunks/_1wt72m1._.js +1 -1
  233. package/runtime/hub/apps/hub/.next/server/chunks/_1x3l5t8._.js +1 -1
  234. package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +62 -31
  235. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
  236. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_1uccfbf._.js +1 -1
  237. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
  238. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
  239. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
  240. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
  241. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
  242. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
  243. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
  244. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
  245. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0ebuy19._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0wxhi0-._.js +3 -0
  247. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0xe4ick._.js +9 -0
  248. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_14oaveu._.js +4 -0
  249. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_sqlite-proxy_index_1a6wfdg.js +15 -0
  250. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0-pm2yl._.js +3 -0
  251. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
  252. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
  253. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
  254. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
  255. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
  256. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0m1yf2b._.js +4 -0
  257. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0wv-3zo._.js +3 -0
  258. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
  259. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +2 -2
  260. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
  261. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{_0ro6vh6._.js → _0r2xlss._.js} +3 -3
  262. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +1 -1
  263. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +2 -25
  264. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  265. package/runtime/hub/apps/hub/.next/server/middleware.js +1 -1
  266. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  267. package/runtime/hub/apps/hub/.next/static/chunks/{2xc1sm79a6tsb.js → 2gsrna76i1d80.js} +1 -1
  268. package/runtime/hub/apps/hub/attach-helper.cjs +191 -0
  269. package/runtime/hub/apps/hub/{auth-DC44GQZY.js → auth-IRNNO3IK.js} +2 -2
  270. package/runtime/hub/apps/hub/{auth-config-LALRDYDO.js → auth-config-WJHIMGUE.js} +4 -2
  271. package/runtime/hub/apps/hub/{chunk-YJ5MJOXK.js → chunk-4LYVBRBC.js} +2094 -220
  272. package/runtime/hub/apps/hub/chunk-6AVSKCZJ.js +669 -0
  273. package/runtime/hub/apps/hub/{chunk-QSMPSV5Z.js → chunk-A5Y7LJMU.js} +57 -14
  274. package/runtime/hub/apps/hub/chunk-EDRFXO2M.js +35 -0
  275. package/runtime/hub/apps/hub/chunk-F2JI4GMX.js +2891 -0
  276. package/runtime/hub/apps/hub/{chunk-EHBJKZCL.js → chunk-O3K3ZGFF.js} +500 -35
  277. package/runtime/hub/apps/hub/chunk-RII6IKNJ.js +688 -0
  278. package/runtime/hub/apps/hub/{chunk-RXYOWSSN.js → chunk-RMEUA6PA.js} +120 -14
  279. package/runtime/hub/apps/hub/{chunk-3FJNKSNZ.js → chunk-SCHQR5KR.js} +3 -1
  280. package/runtime/hub/apps/hub/{dist-6FPPUSWZ.js → dist-2GEAA7QA.js} +15 -3
  281. package/runtime/hub/apps/hub/{dist-JG45OFT2.js → dist-36O6F6M3.js} +39 -24
  282. package/runtime/hub/apps/hub/{dist-3I7KUI6W.js → dist-IWLEL2TO.js} +21 -24
  283. package/runtime/hub/apps/hub/{dist-G6TXUSPZ.js → dist-NYKIT5W5.js} +10 -11
  284. package/runtime/hub/apps/hub/{dist-EQV4L7KP.js → dist-QB2IJ7OD.js} +7 -1
  285. package/runtime/hub/apps/hub/{dist-LYDHYTP2.js → dist-RBBXXGLI.js} +129 -26
  286. package/runtime/hub/apps/hub/{dist-GTVVXCBP.js → dist-RRJN2U5P.js} +10 -14
  287. package/runtime/hub/apps/hub/{dist-DX6IYMAH.js → dist-UWXGDCK4.js} +14 -11
  288. package/runtime/hub/apps/hub/{hub-token-COBZGSLS.js → hub-token-6USIMBPQ.js} +2 -2
  289. package/runtime/hub/apps/hub/hub-worker-SOFWVTWU.js +215 -0
  290. package/runtime/hub/apps/hub/node-postgres-DIU2H5VP.js +3583 -0
  291. package/runtime/hub/apps/hub/package.json +5 -2
  292. package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-2IFNUHHM.js → prepared-state-75DIZ55S-P5FHEORG.js} +1 -1
  293. package/runtime/hub/apps/hub/server.js +247 -66
  294. package/runtime/hub/apps/hub/sqlite-proxy-VJS3HIOV.js +2881 -0
  295. package/runtime/relay/bin.cjs +694 -13
  296. package/runtime/vercel/ctl.cjs +29199 -16813
  297. package/dist/_cloud-attach-WDGM6FL5.js +0 -19
  298. package/dist/chunk-26IKZRTT.js.map +0 -1
  299. package/dist/chunk-HR7NHH5J.js.map +0 -1
  300. package/dist/chunk-IDH5A4RR.js.map +0 -1
  301. package/dist/chunk-JE6UI5YR.js.map +0 -1
  302. package/dist/chunk-JGZSA5ZI.js.map +0 -1
  303. package/dist/chunk-LL7NCMUU.js.map +0 -1
  304. package/dist/chunk-NEF6MDJO.js.map +0 -1
  305. package/dist/chunk-UJEH2NJT.js.map +0 -1
  306. package/dist/chunk-V5XXJH63.js.map +0 -1
  307. package/dist/dist-KQTMCVME.js.map +0 -1
  308. package/dist/dist-O3LKOIE7.js.map +0 -1
  309. package/dist/dist-TSFVB7AI.js.map +0 -1
  310. package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +0 -3
  311. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +0 -3
  312. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +0 -3
  313. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +0 -3
  314. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +0 -3
  315. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +0 -3
  316. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +0 -3
  317. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +0 -3
  318. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +0 -3
  319. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +0 -3
  320. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +0 -3
  321. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +0 -3
  322. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xh14bo._.js +0 -3
  323. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +0 -3
  324. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +0 -3
  325. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +0 -3
  326. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +0 -3
  327. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +0 -3
  328. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +0 -3
  329. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19pc87s._.js +0 -3
  330. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +0 -3
  331. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +0 -3
  332. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +0 -3
  333. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +0 -3
  334. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +0 -3
  335. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +0 -3
  336. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +0 -3
  337. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1e4z_-v._.js +0 -3
  338. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +0 -3
  339. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +0 -3
  340. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4xycg._.js +0 -3
  341. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +0 -3
  342. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +0 -3
  343. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +0 -3
  344. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +0 -3
  345. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +0 -6
  346. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +0 -3
  347. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +0 -3
  348. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +0 -3
  349. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +0 -3
  350. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +0 -3
  351. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +0 -3
  352. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +0 -3
  353. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[externals]_pg_20c820g._.js +0 -3
  354. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0j0tjwn._.js +0 -3
  355. /package/dist/{_cloud-attach-WDGM6FL5.js.map → _cloud-attach-XZYF324R.js.map} +0 -0
  356. /package/dist/{dist-FTKS2GI4.js.map → admin-client-NOZ5CCAH.js.map} +0 -0
  357. /package/dist/{dist-OO52HARR.js.map → control-plane-2VEM2KCL.js.map} +0 -0
  358. /package/dist/{dist-U2SVLJUQ.js.map → custody-client-P6XIXHRG.js.map} +0 -0
  359. /package/dist/{dist-WVYAURMF.js.map → dist-JHMILJUT.js.map} +0 -0
  360. /package/dist/{dist-Z6L5MM5D.js.map → dist-JOFZOZCY.js.map} +0 -0
  361. /package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js.map → dist-Q5NY4CF6.js.map} +0 -0
  362. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_buildManifest.js +0 -0
  363. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_clientMiddlewareManifest.js +0 -0
  364. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_ssgManifest.js +0 -0
@@ -0,0 +1,688 @@
1
+ import { createRequire as __cr } from 'node:module'; import { fileURLToPath as __f } from 'node:url'; import { dirname as __d } from 'node:path'; const require = __cr(import.meta.url); const __filename = __f(import.meta.url); const __dirname = __d(__filename);
2
+ import {
3
+ Column,
4
+ PgTable,
5
+ SQL,
6
+ Subquery,
7
+ Table,
8
+ View,
9
+ ViewBaseConfig,
10
+ and,
11
+ asc,
12
+ between,
13
+ desc,
14
+ entityKind,
15
+ eq,
16
+ exists,
17
+ getTableUniqueName,
18
+ gt,
19
+ gte,
20
+ ilike,
21
+ inArray,
22
+ is,
23
+ isNotNull,
24
+ isNull,
25
+ like,
26
+ lt,
27
+ lte,
28
+ ne,
29
+ not,
30
+ notBetween,
31
+ notExists,
32
+ notIlike,
33
+ notInArray,
34
+ notLike,
35
+ or,
36
+ sql
37
+ } from "./chunk-F2JI4GMX.js";
38
+
39
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/primary-keys.js
40
+ var PrimaryKeyBuilder = class {
41
+ static [entityKind] = "PgPrimaryKeyBuilder";
42
+ /** @internal */
43
+ columns;
44
+ /** @internal */
45
+ name;
46
+ constructor(columns, name) {
47
+ this.columns = columns;
48
+ this.name = name;
49
+ }
50
+ /** @internal */
51
+ build(table) {
52
+ return new PrimaryKey(table, this.columns, this.name);
53
+ }
54
+ };
55
+ var PrimaryKey = class {
56
+ constructor(table, columns, name) {
57
+ this.table = table;
58
+ this.columns = columns;
59
+ this.name = name;
60
+ }
61
+ static [entityKind] = "PgPrimaryKey";
62
+ columns;
63
+ name;
64
+ getName() {
65
+ return this.name ?? `${this.table[PgTable.Symbol.Name]}_${this.columns.map((column) => column.name).join("_")}_pk`;
66
+ }
67
+ };
68
+
69
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/relations.js
70
+ var Relation = class {
71
+ constructor(sourceTable, referencedTable, relationName) {
72
+ this.sourceTable = sourceTable;
73
+ this.referencedTable = referencedTable;
74
+ this.relationName = relationName;
75
+ this.referencedTableName = referencedTable[Table.Symbol.Name];
76
+ }
77
+ static [entityKind] = "Relation";
78
+ referencedTableName;
79
+ fieldName;
80
+ };
81
+ var Relations = class {
82
+ constructor(table, config) {
83
+ this.table = table;
84
+ this.config = config;
85
+ }
86
+ static [entityKind] = "Relations";
87
+ };
88
+ var One = class _One extends Relation {
89
+ constructor(sourceTable, referencedTable, config, isNullable) {
90
+ super(sourceTable, referencedTable, config?.relationName);
91
+ this.config = config;
92
+ this.isNullable = isNullable;
93
+ }
94
+ static [entityKind] = "One";
95
+ withFieldName(fieldName) {
96
+ const relation = new _One(
97
+ this.sourceTable,
98
+ this.referencedTable,
99
+ this.config,
100
+ this.isNullable
101
+ );
102
+ relation.fieldName = fieldName;
103
+ return relation;
104
+ }
105
+ };
106
+ var Many = class _Many extends Relation {
107
+ constructor(sourceTable, referencedTable, config) {
108
+ super(sourceTable, referencedTable, config?.relationName);
109
+ this.config = config;
110
+ }
111
+ static [entityKind] = "Many";
112
+ withFieldName(fieldName) {
113
+ const relation = new _Many(
114
+ this.sourceTable,
115
+ this.referencedTable,
116
+ this.config
117
+ );
118
+ relation.fieldName = fieldName;
119
+ return relation;
120
+ }
121
+ };
122
+ function getOperators() {
123
+ return {
124
+ and,
125
+ between,
126
+ eq,
127
+ exists,
128
+ gt,
129
+ gte,
130
+ ilike,
131
+ inArray,
132
+ isNull,
133
+ isNotNull,
134
+ like,
135
+ lt,
136
+ lte,
137
+ ne,
138
+ not,
139
+ notBetween,
140
+ notExists,
141
+ notLike,
142
+ notIlike,
143
+ notInArray,
144
+ or,
145
+ sql
146
+ };
147
+ }
148
+ function getOrderByOperators() {
149
+ return {
150
+ sql,
151
+ asc,
152
+ desc
153
+ };
154
+ }
155
+ function extractTablesRelationalConfig(schema, configHelpers) {
156
+ if (Object.keys(schema).length === 1 && "default" in schema && !is(schema["default"], Table)) {
157
+ schema = schema["default"];
158
+ }
159
+ const tableNamesMap = {};
160
+ const relationsBuffer = {};
161
+ const tablesConfig = {};
162
+ for (const [key, value] of Object.entries(schema)) {
163
+ if (is(value, Table)) {
164
+ const dbName = getTableUniqueName(value);
165
+ const bufferedRelations = relationsBuffer[dbName];
166
+ tableNamesMap[dbName] = key;
167
+ tablesConfig[key] = {
168
+ tsName: key,
169
+ dbName: value[Table.Symbol.Name],
170
+ schema: value[Table.Symbol.Schema],
171
+ columns: value[Table.Symbol.Columns],
172
+ relations: bufferedRelations?.relations ?? {},
173
+ primaryKey: bufferedRelations?.primaryKey ?? []
174
+ };
175
+ for (const column of Object.values(
176
+ value[Table.Symbol.Columns]
177
+ )) {
178
+ if (column.primary) {
179
+ tablesConfig[key].primaryKey.push(column);
180
+ }
181
+ }
182
+ const extraConfig = value[Table.Symbol.ExtraConfigBuilder]?.(value[Table.Symbol.ExtraConfigColumns]);
183
+ if (extraConfig) {
184
+ for (const configEntry of Object.values(extraConfig)) {
185
+ if (is(configEntry, PrimaryKeyBuilder)) {
186
+ tablesConfig[key].primaryKey.push(...configEntry.columns);
187
+ }
188
+ }
189
+ }
190
+ } else if (is(value, Relations)) {
191
+ const dbName = getTableUniqueName(value.table);
192
+ const tableName = tableNamesMap[dbName];
193
+ const relations2 = value.config(
194
+ configHelpers(value.table)
195
+ );
196
+ let primaryKey;
197
+ for (const [relationName, relation] of Object.entries(relations2)) {
198
+ if (tableName) {
199
+ const tableConfig = tablesConfig[tableName];
200
+ tableConfig.relations[relationName] = relation;
201
+ if (primaryKey) {
202
+ tableConfig.primaryKey.push(...primaryKey);
203
+ }
204
+ } else {
205
+ if (!(dbName in relationsBuffer)) {
206
+ relationsBuffer[dbName] = {
207
+ relations: {},
208
+ primaryKey
209
+ };
210
+ }
211
+ relationsBuffer[dbName].relations[relationName] = relation;
212
+ }
213
+ }
214
+ }
215
+ }
216
+ return { tables: tablesConfig, tableNamesMap };
217
+ }
218
+ function createOne(sourceTable) {
219
+ return function one(table, config) {
220
+ return new One(
221
+ sourceTable,
222
+ table,
223
+ config,
224
+ config?.fields.reduce((res, f) => res && f.notNull, true) ?? false
225
+ );
226
+ };
227
+ }
228
+ function createMany(sourceTable) {
229
+ return function many(referencedTable, config) {
230
+ return new Many(sourceTable, referencedTable, config);
231
+ };
232
+ }
233
+ function normalizeRelation(schema, tableNamesMap, relation) {
234
+ if (is(relation, One) && relation.config) {
235
+ return {
236
+ fields: relation.config.fields,
237
+ references: relation.config.references
238
+ };
239
+ }
240
+ const referencedTableTsName = tableNamesMap[getTableUniqueName(relation.referencedTable)];
241
+ if (!referencedTableTsName) {
242
+ throw new Error(
243
+ `Table "${relation.referencedTable[Table.Symbol.Name]}" not found in schema`
244
+ );
245
+ }
246
+ const referencedTableConfig = schema[referencedTableTsName];
247
+ if (!referencedTableConfig) {
248
+ throw new Error(`Table "${referencedTableTsName}" not found in schema`);
249
+ }
250
+ const sourceTable = relation.sourceTable;
251
+ const sourceTableTsName = tableNamesMap[getTableUniqueName(sourceTable)];
252
+ if (!sourceTableTsName) {
253
+ throw new Error(
254
+ `Table "${sourceTable[Table.Symbol.Name]}" not found in schema`
255
+ );
256
+ }
257
+ const reverseRelations = [];
258
+ for (const referencedTableRelation of Object.values(
259
+ referencedTableConfig.relations
260
+ )) {
261
+ if (relation.relationName && relation !== referencedTableRelation && referencedTableRelation.relationName === relation.relationName || !relation.relationName && referencedTableRelation.referencedTable === relation.sourceTable) {
262
+ reverseRelations.push(referencedTableRelation);
263
+ }
264
+ }
265
+ if (reverseRelations.length > 1) {
266
+ throw relation.relationName ? new Error(
267
+ `There are multiple relations with name "${relation.relationName}" in table "${referencedTableTsName}"`
268
+ ) : new Error(
269
+ `There are multiple relations between "${referencedTableTsName}" and "${relation.sourceTable[Table.Symbol.Name]}". Please specify relation name`
270
+ );
271
+ }
272
+ if (reverseRelations[0] && is(reverseRelations[0], One) && reverseRelations[0].config) {
273
+ return {
274
+ fields: reverseRelations[0].config.references,
275
+ references: reverseRelations[0].config.fields
276
+ };
277
+ }
278
+ throw new Error(
279
+ `There is not enough information to infer relation "${sourceTableTsName}.${relation.fieldName}"`
280
+ );
281
+ }
282
+ function createTableRelationsHelpers(sourceTable) {
283
+ return {
284
+ one: createOne(sourceTable),
285
+ many: createMany(sourceTable)
286
+ };
287
+ }
288
+ function mapRelationalRow(tablesConfig, tableConfig, row, buildQueryResultSelection, mapColumnValue = (value) => value) {
289
+ const result = {};
290
+ for (const [
291
+ selectionItemIndex,
292
+ selectionItem
293
+ ] of buildQueryResultSelection.entries()) {
294
+ if (selectionItem.isJson) {
295
+ const relation = tableConfig.relations[selectionItem.tsKey];
296
+ const rawSubRows = row[selectionItemIndex];
297
+ const subRows = typeof rawSubRows === "string" ? JSON.parse(rawSubRows) : rawSubRows;
298
+ result[selectionItem.tsKey] = is(relation, One) ? subRows && mapRelationalRow(
299
+ tablesConfig,
300
+ tablesConfig[selectionItem.relationTableTsKey],
301
+ subRows,
302
+ selectionItem.selection,
303
+ mapColumnValue
304
+ ) : subRows.map(
305
+ (subRow) => mapRelationalRow(
306
+ tablesConfig,
307
+ tablesConfig[selectionItem.relationTableTsKey],
308
+ subRow,
309
+ selectionItem.selection,
310
+ mapColumnValue
311
+ )
312
+ );
313
+ } else {
314
+ const value = mapColumnValue(row[selectionItemIndex]);
315
+ const field = selectionItem.field;
316
+ let decoder;
317
+ if (is(field, Column)) {
318
+ decoder = field;
319
+ } else if (is(field, SQL)) {
320
+ decoder = field.decoder;
321
+ } else {
322
+ decoder = field.sql.decoder;
323
+ }
324
+ result[selectionItem.tsKey] = value === null ? null : decoder.mapFromDriverValue(value);
325
+ }
326
+ }
327
+ return result;
328
+ }
329
+
330
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/cache/core/cache.js
331
+ var Cache = class {
332
+ static [entityKind] = "Cache";
333
+ };
334
+ var NoopCache = class extends Cache {
335
+ strategy() {
336
+ return "all";
337
+ }
338
+ static [entityKind] = "NoopCache";
339
+ async get(_key) {
340
+ return void 0;
341
+ }
342
+ async put(_hashedQuery, _response, _tables, _config) {
343
+ }
344
+ async onMutate(_params) {
345
+ }
346
+ };
347
+ async function hashQuery(sql2, params) {
348
+ const dataToHash = `${sql2}-${JSON.stringify(params)}`;
349
+ const encoder = new TextEncoder();
350
+ const data = encoder.encode(dataToHash);
351
+ const hashBuffer = await crypto.subtle.digest("SHA-256", data);
352
+ const hashArray = [...new Uint8Array(hashBuffer)];
353
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
354
+ return hashHex;
355
+ }
356
+
357
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/logger.js
358
+ var ConsoleLogWriter = class {
359
+ static [entityKind] = "ConsoleLogWriter";
360
+ write(message) {
361
+ console.log(message);
362
+ }
363
+ };
364
+ var DefaultLogger = class {
365
+ static [entityKind] = "DefaultLogger";
366
+ writer;
367
+ constructor(config) {
368
+ this.writer = config?.writer ?? new ConsoleLogWriter();
369
+ }
370
+ logQuery(query, params) {
371
+ const stringifiedParams = params.map((p) => {
372
+ try {
373
+ return JSON.stringify(p);
374
+ } catch {
375
+ return String(p);
376
+ }
377
+ });
378
+ const paramsStr = stringifiedParams.length ? ` -- params: [${stringifiedParams.join(", ")}]` : "";
379
+ this.writer.write(`Query: ${query}${paramsStr}`);
380
+ }
381
+ };
382
+ var NoopLogger = class {
383
+ static [entityKind] = "NoopLogger";
384
+ logQuery() {
385
+ }
386
+ };
387
+
388
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/alias.js
389
+ var ColumnAliasProxyHandler = class {
390
+ constructor(table) {
391
+ this.table = table;
392
+ }
393
+ static [entityKind] = "ColumnAliasProxyHandler";
394
+ get(columnObj, prop) {
395
+ if (prop === "table") {
396
+ return this.table;
397
+ }
398
+ return columnObj[prop];
399
+ }
400
+ };
401
+ var TableAliasProxyHandler = class {
402
+ constructor(alias, replaceOriginalName) {
403
+ this.alias = alias;
404
+ this.replaceOriginalName = replaceOriginalName;
405
+ }
406
+ static [entityKind] = "TableAliasProxyHandler";
407
+ get(target, prop) {
408
+ if (prop === Table.Symbol.IsAlias) {
409
+ return true;
410
+ }
411
+ if (prop === Table.Symbol.Name) {
412
+ return this.alias;
413
+ }
414
+ if (this.replaceOriginalName && prop === Table.Symbol.OriginalName) {
415
+ return this.alias;
416
+ }
417
+ if (prop === ViewBaseConfig) {
418
+ return {
419
+ ...target[ViewBaseConfig],
420
+ name: this.alias,
421
+ isAlias: true
422
+ };
423
+ }
424
+ if (prop === Table.Symbol.Columns) {
425
+ const columns = target[Table.Symbol.Columns];
426
+ if (!columns) {
427
+ return columns;
428
+ }
429
+ const proxiedColumns = {};
430
+ Object.keys(columns).map((key) => {
431
+ proxiedColumns[key] = new Proxy(
432
+ columns[key],
433
+ new ColumnAliasProxyHandler(new Proxy(target, this))
434
+ );
435
+ });
436
+ return proxiedColumns;
437
+ }
438
+ const value = target[prop];
439
+ if (is(value, Column)) {
440
+ return new Proxy(value, new ColumnAliasProxyHandler(new Proxy(target, this)));
441
+ }
442
+ return value;
443
+ }
444
+ };
445
+ var RelationTableAliasProxyHandler = class {
446
+ constructor(alias) {
447
+ this.alias = alias;
448
+ }
449
+ static [entityKind] = "RelationTableAliasProxyHandler";
450
+ get(target, prop) {
451
+ if (prop === "sourceTable") {
452
+ return aliasedTable(target.sourceTable, this.alias);
453
+ }
454
+ return target[prop];
455
+ }
456
+ };
457
+ function aliasedTable(table, tableAlias) {
458
+ return new Proxy(table, new TableAliasProxyHandler(tableAlias, false));
459
+ }
460
+ function aliasedTableColumn(column, tableAlias) {
461
+ return new Proxy(
462
+ column,
463
+ new ColumnAliasProxyHandler(new Proxy(column.table, new TableAliasProxyHandler(tableAlias, false)))
464
+ );
465
+ }
466
+ function mapColumnsInAliasedSQLToAlias(query, alias) {
467
+ return new SQL.Aliased(mapColumnsInSQLToAlias(query.sql, alias), query.fieldAlias);
468
+ }
469
+ function mapColumnsInSQLToAlias(query, alias) {
470
+ return sql.join(query.queryChunks.map((c) => {
471
+ if (is(c, Column)) {
472
+ return aliasedTableColumn(c, alias);
473
+ }
474
+ if (is(c, SQL)) {
475
+ return mapColumnsInSQLToAlias(c, alias);
476
+ }
477
+ if (is(c, SQL.Aliased)) {
478
+ return mapColumnsInAliasedSQLToAlias(c, alias);
479
+ }
480
+ return c;
481
+ }));
482
+ }
483
+
484
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/query-promise.js
485
+ var QueryPromise = class {
486
+ static [entityKind] = "QueryPromise";
487
+ [Symbol.toStringTag] = "QueryPromise";
488
+ catch(onRejected) {
489
+ return this.then(void 0, onRejected);
490
+ }
491
+ finally(onFinally) {
492
+ return this.then(
493
+ (value) => {
494
+ onFinally?.();
495
+ return value;
496
+ },
497
+ (reason) => {
498
+ onFinally?.();
499
+ throw reason;
500
+ }
501
+ );
502
+ }
503
+ then(onFulfilled, onRejected) {
504
+ return this.execute().then(onFulfilled, onRejected);
505
+ }
506
+ };
507
+
508
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/selection-proxy.js
509
+ var SelectionProxyHandler = class _SelectionProxyHandler {
510
+ static [entityKind] = "SelectionProxyHandler";
511
+ config;
512
+ constructor(config) {
513
+ this.config = { ...config };
514
+ }
515
+ get(subquery, prop) {
516
+ if (prop === "_") {
517
+ return {
518
+ ...subquery["_"],
519
+ selectedFields: new Proxy(
520
+ subquery._.selectedFields,
521
+ this
522
+ )
523
+ };
524
+ }
525
+ if (prop === ViewBaseConfig) {
526
+ return {
527
+ ...subquery[ViewBaseConfig],
528
+ selectedFields: new Proxy(
529
+ subquery[ViewBaseConfig].selectedFields,
530
+ this
531
+ )
532
+ };
533
+ }
534
+ if (typeof prop === "symbol") {
535
+ return subquery[prop];
536
+ }
537
+ const columns = is(subquery, Subquery) ? subquery._.selectedFields : is(subquery, View) ? subquery[ViewBaseConfig].selectedFields : subquery;
538
+ const value = columns[prop];
539
+ if (is(value, SQL.Aliased)) {
540
+ if (this.config.sqlAliasedBehavior === "sql" && !value.isSelectionField) {
541
+ return value.sql;
542
+ }
543
+ const newValue = value.clone();
544
+ newValue.isSelectionField = true;
545
+ return newValue;
546
+ }
547
+ if (is(value, SQL)) {
548
+ if (this.config.sqlBehavior === "sql") {
549
+ return value;
550
+ }
551
+ throw new Error(
552
+ `You tried to reference "${prop}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`
553
+ );
554
+ }
555
+ if (is(value, Column)) {
556
+ if (this.config.alias) {
557
+ return new Proxy(
558
+ value,
559
+ new ColumnAliasProxyHandler(
560
+ new Proxy(
561
+ value.table,
562
+ new TableAliasProxyHandler(this.config.alias, this.config.replaceOriginalName ?? false)
563
+ )
564
+ )
565
+ );
566
+ }
567
+ return value;
568
+ }
569
+ if (typeof value !== "object" || value === null) {
570
+ return value;
571
+ }
572
+ return new Proxy(value, new _SelectionProxyHandler(this.config));
573
+ }
574
+ };
575
+
576
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/casing.js
577
+ function toSnakeCase(input) {
578
+ const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
579
+ return words.map((word) => word.toLowerCase()).join("_");
580
+ }
581
+ function toCamelCase(input) {
582
+ const words = input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? [];
583
+ return words.reduce((acc, word, i) => {
584
+ const formattedWord = i === 0 ? word.toLowerCase() : `${word[0].toUpperCase()}${word.slice(1)}`;
585
+ return acc + formattedWord;
586
+ }, "");
587
+ }
588
+ function noopCase(input) {
589
+ return input;
590
+ }
591
+ var CasingCache = class {
592
+ static [entityKind] = "CasingCache";
593
+ /** @internal */
594
+ cache = {};
595
+ cachedTables = {};
596
+ convert;
597
+ constructor(casing) {
598
+ this.convert = casing === "snake_case" ? toSnakeCase : casing === "camelCase" ? toCamelCase : noopCase;
599
+ }
600
+ getColumnCasing(column) {
601
+ if (!column.keyAsName) return column.name;
602
+ const schema = column.table[Table.Symbol.Schema] ?? "public";
603
+ const tableName = column.table[Table.Symbol.OriginalName];
604
+ const key = `${schema}.${tableName}.${column.name}`;
605
+ if (!this.cache[key]) {
606
+ this.cacheTable(column.table);
607
+ }
608
+ return this.cache[key];
609
+ }
610
+ cacheTable(table) {
611
+ const schema = table[Table.Symbol.Schema] ?? "public";
612
+ const tableName = table[Table.Symbol.OriginalName];
613
+ const tableKey = `${schema}.${tableName}`;
614
+ if (!this.cachedTables[tableKey]) {
615
+ for (const column of Object.values(table[Table.Symbol.Columns])) {
616
+ const columnKey = `${tableKey}.${column.name}`;
617
+ this.cache[columnKey] = this.convert(column.name);
618
+ }
619
+ this.cachedTables[tableKey] = true;
620
+ }
621
+ }
622
+ clearCache() {
623
+ this.cache = {};
624
+ this.cachedTables = {};
625
+ }
626
+ };
627
+
628
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/errors.js
629
+ var DrizzleError = class extends Error {
630
+ static [entityKind] = "DrizzleError";
631
+ constructor({ message, cause }) {
632
+ super(message);
633
+ this.name = "DrizzleError";
634
+ this.cause = cause;
635
+ }
636
+ };
637
+ var DrizzleQueryError = class _DrizzleQueryError extends Error {
638
+ constructor(query, params, cause) {
639
+ super(`Failed query: ${query}
640
+ params: ${params}`);
641
+ this.query = query;
642
+ this.params = params;
643
+ this.cause = cause;
644
+ Error.captureStackTrace(this, _DrizzleQueryError);
645
+ if (cause) this.cause = cause;
646
+ }
647
+ };
648
+ var TransactionRollbackError = class extends DrizzleError {
649
+ static [entityKind] = "TransactionRollbackError";
650
+ constructor() {
651
+ super({ message: "Rollback" });
652
+ }
653
+ };
654
+
655
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/query-builders/query-builder.js
656
+ var TypedQueryBuilder = class {
657
+ static [entityKind] = "TypedQueryBuilder";
658
+ /** @internal */
659
+ getSelectedFields() {
660
+ return this._.selectedFields;
661
+ }
662
+ };
663
+
664
+ export {
665
+ aliasedTable,
666
+ aliasedTableColumn,
667
+ mapColumnsInAliasedSQLToAlias,
668
+ mapColumnsInSQLToAlias,
669
+ QueryPromise,
670
+ SelectionProxyHandler,
671
+ CasingCache,
672
+ DrizzleError,
673
+ DrizzleQueryError,
674
+ TransactionRollbackError,
675
+ One,
676
+ Many,
677
+ getOperators,
678
+ getOrderByOperators,
679
+ extractTablesRelationalConfig,
680
+ normalizeRelation,
681
+ createTableRelationsHelpers,
682
+ mapRelationalRow,
683
+ TypedQueryBuilder,
684
+ NoopCache,
685
+ hashQuery,
686
+ DefaultLogger,
687
+ NoopLogger
688
+ };