better-supabase 0.35.0 → 0.36.0

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 (520) hide show
  1. package/dist/{adapter-CWzyKepA.js → adapter-ddQ9Hzka.js} +126 -91
  2. package/dist/{agents-DXiOPB3V.d.ts → agents-BwUHtvD6.d.ts} +4 -4
  3. package/dist/{ai-cache-CLiAXCPH.d.ts → ai-cache-CPOP2PYz.d.ts} +4 -4
  4. package/dist/{ai-chat-DlcBdOhJ.d.ts → ai-chat-BZhfCHHr.d.ts} +106 -25
  5. package/dist/{ai-schedules-Drx2KRTn.d.ts → ai-schedules-BZPmySUa.d.ts} +5 -5
  6. package/dist/ai-sdk/agents/index.d.ts +6 -6
  7. package/dist/ai-sdk/batches/index.d.ts +3 -3
  8. package/dist/ai-sdk/cache/index.d.ts +1 -1
  9. package/dist/ai-sdk/chat/index.d.ts +2 -2
  10. package/dist/ai-sdk/chat/index.js +3 -272
  11. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  12. package/dist/ai-sdk/files/index.d.ts +1 -1
  13. package/dist/ai-sdk/index.d.ts +5 -5
  14. package/dist/ai-sdk/index.js +2 -3
  15. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  16. package/dist/ai-sdk/memory/index.d.ts +3 -3
  17. package/dist/ai-sdk/workflow/index.d.ts +6 -5
  18. package/dist/ai-sdk/workflow/index.js +9 -9
  19. package/dist/{api-myq2e9t5.d.ts → api-XEaCJbgv.d.ts} +5 -5
  20. package/dist/{api-keys-DbIbkGxx.d.ts → api-keys-C82fMru4.d.ts} +4 -4
  21. package/dist/{app-tables-X3yzJljM.d.ts → app-tables-C0XVpQEJ.d.ts} +1 -1
  22. package/dist/{approvals-Da4uAANx.js → approvals-D8gR1R8R.js} +95 -11
  23. package/dist/{approvals-DZoGtNFv.d.ts → approvals-DqCv7f-G.d.ts} +101 -7
  24. package/dist/{assistant-BEbRPjhn.d.ts → assistant-5heV2GeR.d.ts} +7 -3
  25. package/dist/assistant-BHZ6fqBR.js +300 -0
  26. package/dist/astro/index.d.ts +7 -7
  27. package/dist/astro/index.js +5 -5
  28. package/dist/{auth-module-CqXdm8qD.js → auth-module-DkqapRZJ.js} +1 -1
  29. package/dist/{authorization-D1P3VBOd.d.ts → authorization-2Rv1AJQJ.d.ts} +114 -39
  30. package/dist/{authorization-hooks-CxwsRnfV.d.ts → authorization-hooks-C0GfMvFm.d.ts} +8 -2
  31. package/dist/authz-topic-D7fPUY4P.js +13 -0
  32. package/dist/{availability-CebEOfMN.d.ts → availability-CZlcrkqD.d.ts} +49 -8
  33. package/dist/{base64-CVyKHBBw.js → base64-CEBz6-Jj.js} +9 -2
  34. package/dist/better-result/index.d.ts +3 -3
  35. package/dist/{bind-Bvv-Zrdh.d.ts → bind-C2XvMlfg.d.ts} +7 -7
  36. package/dist/{block-env-h_uPl2f_.d.ts → block-env-BQrtLPyc.d.ts} +4 -4
  37. package/dist/{block-helpers-disoUWCp.d.ts → block-helpers-BNtM1tqy.d.ts} +1 -1
  38. package/dist/{block-hooks-DrA_d1dJ.d.ts → block-hooks-CtMsgLQr.d.ts} +2 -2
  39. package/dist/{block-subjects-Br2MQNFn.d.ts → block-subjects-Bkieh2Xk.d.ts} +1 -1
  40. package/dist/{block-tables-pj3eHfoP.d.ts → block-tables-DPOgnT3y.d.ts} +1 -1
  41. package/dist/{block-transport-BEtC_Kis.d.ts → block-transport-CDmOUuLZ.d.ts} +2 -2
  42. package/dist/blocks/access-requests/index.d.ts +5 -5
  43. package/dist/blocks/activities/index.d.ts +9 -9
  44. package/dist/blocks/agents/index.d.ts +4 -4
  45. package/dist/blocks/ai-cache/index.d.ts +3 -3
  46. package/dist/blocks/ai-chat/index.d.ts +8 -8
  47. package/dist/blocks/ai-chat/index.js +80 -20
  48. package/dist/blocks/ai-files/index.d.ts +3 -3
  49. package/dist/blocks/ai-keys/index.d.ts +4 -4
  50. package/dist/blocks/ai-schedules/index.d.ts +3 -3
  51. package/dist/blocks/announcements/index.d.ts +8 -8
  52. package/dist/blocks/api-keys/index.d.ts +3 -3
  53. package/dist/blocks/approvals/index.d.ts +16 -5
  54. package/dist/blocks/approvals/index.js +7 -4
  55. package/dist/blocks/assets/index.d.ts +6 -6
  56. package/dist/blocks/assignment/index.d.ts +7 -7
  57. package/dist/blocks/attachments/index.d.ts +4 -4
  58. package/dist/blocks/audit/index.d.ts +13 -13
  59. package/dist/blocks/audit/index.js +1 -1
  60. package/dist/blocks/automations/index.d.ts +12 -12
  61. package/dist/blocks/billable-time/index.d.ts +6 -6
  62. package/dist/blocks/billing/index.d.ts +9 -9
  63. package/dist/blocks/billing/index.js +1 -1
  64. package/dist/blocks/bookings/index.d.ts +6 -6
  65. package/dist/blocks/bulk/index.d.ts +4 -4
  66. package/dist/blocks/calendar/index.d.ts +46 -8
  67. package/dist/blocks/calendar/index.js +306 -47
  68. package/dist/blocks/catalog/index.d.ts +39 -17
  69. package/dist/blocks/catalog/index.js +35 -15
  70. package/dist/blocks/channels/index.d.ts +7 -7
  71. package/dist/blocks/collections/index.d.ts +6 -6
  72. package/dist/blocks/comments/index.d.ts +10 -10
  73. package/dist/blocks/compliance/index.d.ts +5 -5
  74. package/dist/blocks/connectors/index.d.ts +4 -4
  75. package/dist/blocks/contacts/index.d.ts +6 -6
  76. package/dist/blocks/content/index.d.ts +5 -5
  77. package/dist/blocks/contracts/index.d.ts +6 -6
  78. package/dist/blocks/courses/index.d.ts +5 -5
  79. package/dist/blocks/created-by/index.d.ts +2 -2
  80. package/dist/blocks/custom-fields/index.d.ts +6 -6
  81. package/dist/blocks/data-lifecycle/index.d.ts +8 -8
  82. package/dist/blocks/deals/index.d.ts +6 -6
  83. package/dist/blocks/dispatch/index.d.ts +6 -6
  84. package/dist/blocks/documents/index.d.ts +4 -4
  85. package/dist/blocks/documents/index.js +1 -1
  86. package/dist/blocks/domains/index.d.ts +6 -6
  87. package/dist/blocks/donations/index.d.ts +6 -6
  88. package/dist/blocks/drive/index.d.ts +6 -6
  89. package/dist/blocks/employees/index.d.ts +8 -8
  90. package/dist/blocks/enrichment/index.d.ts +6 -6
  91. package/dist/blocks/enrollments/index.d.ts +74 -9
  92. package/dist/blocks/enrollments/index.js +67 -3
  93. package/dist/blocks/entitlements/index.d.ts +6 -6
  94. package/dist/blocks/expenses/index.d.ts +93 -6
  95. package/dist/blocks/expenses/index.js +95 -4
  96. package/dist/blocks/field-history/index.d.ts +4 -4
  97. package/dist/blocks/flags/index.d.ts +5 -5
  98. package/dist/blocks/forecasts/index.d.ts +6 -6
  99. package/dist/blocks/forms/index.d.ts +6 -6
  100. package/dist/blocks/goals/index.d.ts +4 -4
  101. package/dist/blocks/guests/index.d.ts +6 -6
  102. package/dist/blocks/hiring/index.d.ts +6 -6
  103. package/dist/blocks/identities/index.d.ts +5 -5
  104. package/dist/blocks/imports/index.d.ts +5 -5
  105. package/dist/blocks/inbox/index.d.ts +11 -11
  106. package/dist/blocks/inbox/index.js +56 -1
  107. package/dist/blocks/incidents/index.d.ts +5 -5
  108. package/dist/blocks/index.d.ts +9 -9
  109. package/dist/blocks/inventory/index.d.ts +6 -6
  110. package/dist/blocks/invoices/index.d.ts +26 -10
  111. package/dist/blocks/invoices/index.js +23 -7
  112. package/dist/blocks/knowledge/index.d.ts +4 -4
  113. package/dist/blocks/knowledge/index.js +1 -1
  114. package/dist/blocks/lead-scoring/index.d.ts +7 -7
  115. package/dist/blocks/leases/index.d.ts +6 -6
  116. package/dist/blocks/leave/index.d.ts +88 -15
  117. package/dist/blocks/leave/index.js +65 -14
  118. package/dist/blocks/ledger/index.d.ts +6 -6
  119. package/dist/blocks/mail-sync/index.d.ts +5 -5
  120. package/dist/blocks/memberships/index.d.ts +2 -2
  121. package/dist/blocks/memory/index.d.ts +5 -5
  122. package/dist/blocks/memory/index.js +30 -5
  123. package/dist/blocks/messaging/index.d.ts +11 -11
  124. package/dist/blocks/metrics/index.d.ts +6 -6
  125. package/dist/blocks/mfa/index.d.ts +2 -2
  126. package/dist/blocks/moderation/index.d.ts +6 -6
  127. package/dist/blocks/notifications/index.d.ts +11 -11
  128. package/dist/blocks/notifications/index.js +1 -1
  129. package/dist/blocks/numbering/index.d.ts +4 -4
  130. package/dist/blocks/oauth-server/index.d.ts +5 -5
  131. package/dist/blocks/oauth-server/index.js +1 -1
  132. package/dist/blocks/onboarding/index.d.ts +5 -5
  133. package/dist/blocks/orders/index.d.ts +7 -7
  134. package/dist/blocks/organizations/index.d.ts +8 -8
  135. package/dist/blocks/outbox/index.d.ts +4 -4
  136. package/dist/blocks/outbox/index.js +1 -1
  137. package/dist/blocks/passes/index.d.ts +8 -8
  138. package/dist/blocks/passes/index.js +2 -2
  139. package/dist/blocks/permissions/index.d.ts +7 -7
  140. package/dist/blocks/pipelines/index.d.ts +6 -6
  141. package/dist/blocks/posts/index.d.ts +5 -5
  142. package/dist/blocks/profiles/index.d.ts +4 -4
  143. package/dist/blocks/promotions/index.d.ts +5 -5
  144. package/dist/blocks/push/index.d.ts +7 -7
  145. package/dist/blocks/queue/index.d.ts +6 -6
  146. package/dist/blocks/queue/index.js +2 -2
  147. package/dist/blocks/quotes/index.d.ts +119 -27
  148. package/dist/blocks/quotes/index.js +111 -17
  149. package/dist/blocks/rank/index.d.ts +4 -4
  150. package/dist/blocks/reactions/index.d.ts +9 -9
  151. package/dist/blocks/relations/index.d.ts +7 -7
  152. package/dist/blocks/reminders/index.d.ts +78 -11
  153. package/dist/blocks/reminders/index.js +118 -6
  154. package/dist/blocks/reviews/index.d.ts +5 -5
  155. package/dist/blocks/saved-views/index.d.ts +6 -6
  156. package/dist/blocks/scores/index.d.ts +5 -5
  157. package/dist/blocks/search/index.d.ts +7 -7
  158. package/dist/blocks/security-events/index.d.ts +7 -7
  159. package/dist/blocks/security-events/index.js +1 -1
  160. package/dist/blocks/segments/index.d.ts +7 -7
  161. package/dist/blocks/sequences/index.d.ts +6 -6
  162. package/dist/blocks/service-accounts/index.d.ts +5 -5
  163. package/dist/blocks/sessions/index.d.ts +2 -2
  164. package/dist/blocks/sessions/index.js +1 -1
  165. package/dist/blocks/settings/index.d.ts +6 -6
  166. package/dist/blocks/share-links/index.d.ts +5 -5
  167. package/dist/blocks/shipments/index.d.ts +6 -6
  168. package/dist/blocks/shipments/index.js +1 -1
  169. package/dist/blocks/signatures/index.d.ts +5 -5
  170. package/dist/blocks/signing-keys/index.d.ts +4 -4
  171. package/dist/blocks/signing-keys/index.js +2 -2
  172. package/dist/blocks/sla/index.d.ts +7 -7
  173. package/dist/blocks/sso/index.d.ts +6 -6
  174. package/dist/blocks/state-machine/index.d.ts +27 -7
  175. package/dist/blocks/state-machine/index.js +7 -2
  176. package/dist/blocks/subjects/index.d.ts +6 -6
  177. package/dist/blocks/tags/index.d.ts +6 -6
  178. package/dist/blocks/tasks/index.d.ts +9 -9
  179. package/dist/blocks/teams/index.d.ts +4 -4
  180. package/dist/blocks/templates/index.d.ts +7 -7
  181. package/dist/blocks/time-tracking/index.d.ts +7 -7
  182. package/dist/blocks/timeline/index.d.ts +8 -8
  183. package/dist/blocks/trash/index.d.ts +6 -6
  184. package/dist/blocks/undo/index.d.ts +4 -4
  185. package/dist/blocks/updated-at/index.d.ts +2 -2
  186. package/dist/blocks/usage/index.d.ts +4 -4
  187. package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
  188. package/dist/blocks/vercel-marketplace/index.js +3 -3
  189. package/dist/blocks/versions/index.d.ts +6 -6
  190. package/dist/blocks/waitlist/index.d.ts +5 -5
  191. package/dist/blocks/waitlist/index.js +1 -1
  192. package/dist/blocks/webhooks/index.d.ts +13 -13
  193. package/dist/blocks/webhooks/index.js +5 -5
  194. package/dist/blocks/workflow-editor/index.d.ts +10 -10
  195. package/dist/blocks/workflow-editor/index.js +65 -2
  196. package/dist/blocks/workflows/index.d.ts +7 -7
  197. package/dist/{bookings-Br0VXzaf.d.ts → bookings-Dj5cvXKv.d.ts} +4 -4
  198. package/dist/{bucket-DvG66r5G.d.ts → bucket-CrsJNHzi.d.ts} +1 -1
  199. package/dist/chat-sdk/index.d.ts +6 -6
  200. package/dist/claims/index.d.ts +6 -6
  201. package/dist/claims/index.js +2 -2
  202. package/dist/cli/{add-DzgsOE8V.js → add-D2CH8t_B.js} +2 -2
  203. package/dist/cli/add-De73Ghlh.js +1 -0
  204. package/dist/cli/{add-CYreXA68.js → add-Duf1-19E.js} +16 -14
  205. package/dist/cli/{agent-59XWXsRi.js → agent-Tqq3MAqx.js} +26 -1
  206. package/dist/cli/{app-table-files-BnISa3uY.js → app-table-files-ha8X0rRE.js} +2 -2
  207. package/dist/cli/app-tables-BIyQcsHH.js +42 -0
  208. package/dist/cli/{backfill-BLLTSDSa.js → backfill-CLgA6-ll.js} +3 -3
  209. package/dist/cli/bin.js +1 -1
  210. package/dist/cli/{blocks-uzh1g_0v.js → blocks-9AeouX4h.js} +2 -2
  211. package/dist/cli/{blocks-CpRvI7x8.js → blocks-BVB1fMMj.js} +1 -1
  212. package/dist/cli/{cache-BPWC7tGD.js → cache-aMk9vF1_.js} +1 -1
  213. package/dist/cli/{codemod-CbJVS_kG.js → codemod-B5wrcnF2.js} +113 -4
  214. package/dist/cli/{command-BpZ4AuhR.js → command-DM_x_yzZ.js} +6 -0
  215. package/dist/cli/{completion-DHTT6rjI.js → completion-CusuUJNn.js} +1 -1
  216. package/dist/cli/{completion-B08Q0xB3.js → completion-Cx2UYd-y.js} +2 -2
  217. package/dist/cli/{completion-CwL7e93t.js → completion-DbYb3N8e.js} +2 -2
  218. package/dist/cli/{config-D-Upz3jV.js → config-BeuImpav.js} +1 -1
  219. package/dist/cli/{content-mapper-Cjkm2Sg3.js → content-mapper-CEtdbshU.js} +2 -2
  220. package/dist/cli/{db-Diy1OebO.js → db-CeiQzhPq.js} +2 -2
  221. package/dist/cli/{doctor-D94FEJZs.js → doctor-DaOUWfRN.js} +386 -49
  222. package/dist/cli/env-BfWbheiC.js +1 -0
  223. package/dist/cli/{env-BAJn6wCA.js → env-DVV10l_r.js} +1 -1
  224. package/dist/cli/{gen-Cd0VNDjE.js → gen-BO-2NF-G.js} +14 -14
  225. package/dist/cli/index.d.ts +1 -1
  226. package/dist/cli/index.js +7 -7
  227. package/dist/cli/{init-Co1N9ZoA.js → init-Xit9Hnbb.js} +9 -9
  228. package/dist/cli/{keys-CxajkV_7.js → keys-DJTN2Avl.js} +1 -1
  229. package/dist/cli/{live-NFNeZsP7.js → live-CuMpyRjF.js} +2 -2
  230. package/dist/cli/{mcp-WZ8t7NMz.js → mcp-C7d4j5cq.js} +4 -4
  231. package/dist/cli/{metadata-BzMkmrZR.js → metadata-D2YvkY2D.js} +3 -3
  232. package/dist/cli/{migrate-C9gyDAV7.js → migrate-BCXxyTKt.js} +2 -2
  233. package/dist/cli/{migration-safety-BNi8PIiM.js → migration-safety-DfwTOBQ4.js} +1 -1
  234. package/dist/cli/{migrations-Ds0J_TmZ.js → migrations-nomh4TBo.js} +2 -2
  235. package/dist/cli/{module-migration-hFrlzQZ5.js → module-migration--9T_T-zt.js} +2 -2
  236. package/dist/cli/{moved-BAFPdJz_.js → moved-CT6i1csY.js} +1 -1
  237. package/dist/cli/{parse-BueItuNJ.js → parse-qgJylE_A.js} +1 -1
  238. package/dist/cli/{powersync-oFiwgsBi.js → powersync-DB9WZsIv.js} +4 -4
  239. package/dist/cli/powersync-IBM_v_eJ.js +1 -0
  240. package/dist/cli/{print-BtreoJSm.js → print-S6IF5rZm.js} +2 -2
  241. package/dist/cli/{providers-Be2dgyuR.js → providers-BDTcal71.js} +1 -1
  242. package/dist/cli/{prune-workflows-BPxgRrqY.js → prune-workflows-Zr2DjByi.js} +3 -3
  243. package/dist/cli/{remove-B4ad996E.js → remove-CPX5Tg5s.js} +6 -6
  244. package/dist/cli/{render-C-Mfq-o3.js → render-Bp7a7XQ9.js} +18 -4
  245. package/dist/cli/{run-D2nuyyPo.js → run-BclCFEyP.js} +12 -48
  246. package/dist/cli/{run-dY9uOC3W.js → run-BlVaLnt_.js} +2 -2
  247. package/dist/cli/{run-cLdnJHH0.js → run-kgG50x_Z.js} +44 -43
  248. package/dist/cli/{seed-BpaqqyO8.js → seed-Cn2R91cd.js} +2 -2
  249. package/dist/cli/seed-DGGjReq4.js +1 -0
  250. package/dist/cli/{shared-DCHxLAEL.js → shared-D60W9NS-.js} +1 -1
  251. package/dist/cli/{skills-jZThjL3B.js → skills-DH-yPDny.js} +1 -1
  252. package/dist/cli/{snapshot-CloKPNxv.js → snapshot-C3_eQUgY.js} +2 -2
  253. package/dist/cli/{source-Bwyp18Rj.js → source-Bk6XwIAK.js} +1 -1
  254. package/dist/cli/{spec-DsVq4_qV.js → spec-BDTpcBns.js} +1 -1
  255. package/dist/cli/{spec-DAUF4ybu.js → spec-C8ydQwZC.js} +3 -3
  256. package/dist/cli/{sql-layout-CHpEL0oq.js → sql-layout-DVQ20UMi.js} +2 -2
  257. package/dist/cli/{stack-147NqctC.js → stack-CmhSfY5V.js} +3 -2
  258. package/dist/cli/{sync-DZu1r34s.js → sync-D-WO4Yvl.js} +4 -4
  259. package/dist/cli/{table-D9FbJS8h.js → table-k5OABwy3.js} +1 -1
  260. package/dist/cli/{upgrade-Bpvi70zm.js → upgrade-DGe5Pv6v.js} +5 -5
  261. package/dist/cli/{upgrade-A-BALvp3.js → upgrade-XdhMuHAu.js} +3 -3
  262. package/dist/cli/{version-B59mZJoy.js → version-DKfeme2I.js} +1 -1
  263. package/dist/client/index.d.ts +6 -6
  264. package/dist/client/index.js +1 -1
  265. package/dist/client/native/index.d.ts +5 -5
  266. package/dist/client/native/index.js +2 -2
  267. package/dist/{client-Bky2z09B.js → client-DrejIxsu.js} +1 -1
  268. package/dist/{cloud-event-DXWmXrus.d.ts → cloud-event-BEmAUdl1.d.ts} +1 -1
  269. package/dist/commerce/index.js +1 -1
  270. package/dist/{compiler-qlXlokKn.d.ts → compiler-BOW4yPcW.d.ts} +2 -2
  271. package/dist/{composite-CIxjVcL1.d.ts → composite-B-oAH16L.d.ts} +7 -7
  272. package/dist/{composite-D2JnIiHt.js → composite-BidYZWZY.js} +3 -3
  273. package/dist/config/index.d.ts +3 -3
  274. package/dist/config/index.js +4 -4
  275. package/dist/{config-BZWSFxkG.js → config-BKxjItQ-.js} +3 -3
  276. package/dist/{config-DQP0IvDX.js → config-BrRlSxhx.js} +1 -1
  277. package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-CrLRW4Ol.d.ts} +4 -4
  278. package/dist/{context-CderJRZf.d.ts → context-yfOlyAqb.d.ts} +3 -3
  279. package/dist/contract/index.d.ts +9 -9
  280. package/dist/{controller-DaWA9eWS.d.ts → controller-CAcLEndc.d.ts} +1 -1
  281. package/dist/{conversion-C9rndpEI.d.ts → conversion-s1NtB6S-.d.ts} +1 -1
  282. package/dist/create/index.d.ts +3 -3
  283. package/dist/create/index.js +3 -3
  284. package/dist/create/lite/index.d.ts +4 -4
  285. package/dist/create/lite/index.js +2 -2
  286. package/dist/credentials/index.d.ts +4 -4
  287. package/dist/credentials/index.js +1 -1
  288. package/dist/{cron-route-DSITg1yC.js → cron-route-uTsC2BD0.js} +1 -1
  289. package/dist/{data-engine-CMENsp3d.d.ts → data-engine-CX1oYDZl.d.ts} +1 -1
  290. package/dist/{define-ITQA71fw.d.ts → define-BvkaC3Oh.d.ts} +5 -5
  291. package/dist/{define-B6D55cO0.js → define-Duh2mMYk.js} +1 -1
  292. package/dist/{define-block-COmMkx2x.d.ts → define-block-Ds3aLZwz.d.ts} +12 -12
  293. package/dist/{documents-DeZw83ue.d.ts → documents-Btk0MhC0.d.ts} +3 -3
  294. package/dist/edge/index.d.ts +9 -9
  295. package/dist/edge/index.js +7 -7
  296. package/dist/elysia/index.d.ts +1 -1
  297. package/dist/elysia/index.js +1 -1
  298. package/dist/{embeddings-rVR2AKVz.d.ts → embeddings-CI6P_mtD.d.ts} +1 -1
  299. package/dist/{ended-NC_ZesY4.d.ts → ended-iq2wp8fc.d.ts} +8 -3
  300. package/dist/{entitlements-BefkpQIz.d.ts → entitlements-Dhu-4vlH.d.ts} +2 -2
  301. package/dist/env/index.d.ts +1 -1
  302. package/dist/{messages-CRk1g6oe.js → errors-0Qid9fGz.js} +107 -3
  303. package/dist/eve/index.d.ts +9 -9
  304. package/dist/eve/index.js +3 -3
  305. package/dist/{eve-DIKjuPp5.d.ts → eve-DleYrhwj.d.ts} +2 -2
  306. package/dist/{event-calendar-DUtFyRrv.d.ts → event-calendar-DPMcqy7Q.d.ts} +1 -1
  307. package/dist/events/index.d.ts +3 -3
  308. package/dist/{events-DVt3Z9hw.d.ts → events-DCw3c6pj.d.ts} +1 -1
  309. package/dist/{executor-DqNRrFxx.d.ts → executor-B-o7QMPp.d.ts} +16 -2
  310. package/dist/{executor-CFmee_nV.d.ts → executor-DoSNec_H.d.ts} +1 -1
  311. package/dist/{executor-CHnoKOxk.d.ts → executor-H8ZLkeHj.d.ts} +4 -4
  312. package/dist/{executor-BDMqPbVU.js → executor-RYiR4z47.js} +71 -37
  313. package/dist/expo/index.d.ts +4 -4
  314. package/dist/expo/index.js +7 -7
  315. package/dist/{field-errors-D1meOs_H.d.ts → field-errors-DXZk9Qjt.d.ts} +10 -10
  316. package/dist/{fields-CAVk9dxX.d.ts → fields-CP46SPNE.d.ts} +1 -1
  317. package/dist/{filter-evaluate-Bz3Fzhz2.d.ts → filter-evaluate-Bkbb0nuQ.d.ts} +1 -1
  318. package/dist/{filter-query-DV-x8fio.d.ts → filter-query-Xj40B5KT.d.ts} +1 -1
  319. package/dist/{flags-6emyAXly.d.ts → flags-Cuew4tGx.d.ts} +2 -2
  320. package/dist/flags-sdk/index.d.ts +2 -2
  321. package/dist/{framework-BFlaPuvv.d.ts → framework-Byr_j8G-.d.ts} +8 -8
  322. package/dist/{framework-ChzJYkJW.js → framework-z3KTPRjk.js} +4 -4
  323. package/dist/{gateway-DaekJ_Me.d.ts → gateway-B9k89AC4.d.ts} +3 -3
  324. package/dist/h3/index.d.ts +1 -1
  325. package/dist/h3/index.js +1 -1
  326. package/dist/h3/v1/index.d.ts +1 -1
  327. package/dist/h3/v1/index.js +1 -1
  328. package/dist/hono/index.d.ts +9 -10
  329. package/dist/hono/index.js +8 -8
  330. package/dist/{inbox-DavCzW7b.d.ts → inbox-yGfUVQr2.d.ts} +61 -6
  331. package/dist/{index-Dvpu22CJ.d.ts → index-1uV69AZq.d.ts} +1 -1
  332. package/dist/{index-BbDiBiKt.d.ts → index-6H-8Ib1w.d.ts} +4 -4
  333. package/dist/{index-M1izbwbN.d.ts → index-Ag-T51Jl.d.ts} +1 -1
  334. package/dist/{index-ZQZMQF4l.d.ts → index-BUluRi0b.d.ts} +6 -6
  335. package/dist/{index-BQlLxOj5.d.ts → index-C78VPlXW.d.ts} +1 -1
  336. package/dist/{index-D18su_r5.d.ts → index-CY612vAg.d.ts} +10 -5
  337. package/dist/{index-DXUiRyEk.d.ts → index-CnzGRpeH.d.ts} +5 -5
  338. package/dist/{index-BIAtapnD.d.ts → index-Dbd1E5Au.d.ts} +5 -5
  339. package/dist/{index-ChLuLxy-.d.ts → index-Dv6lfL5p.d.ts} +14 -14
  340. package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
  341. package/dist/{index-D9aV0Fvx.d.ts → index-kkZwp5M1.d.ts} +6 -6
  342. package/dist/{index-C13UgV67.d.ts → index-lMApFSAd.d.ts} +5 -5
  343. package/dist/index.d.ts +7 -7
  344. package/dist/index.js +1 -1
  345. package/dist/{instances-D9YrkoAy.js → instances-xQ2lupVE.js} +218 -11
  346. package/dist/jwks-cache-CBKtICNV.js +114 -0
  347. package/dist/{jws-B8p0ppgh.js → jws-De9qjIPV.js} +1 -1
  348. package/dist/{kit-9pZP5iLU.js → kit-D5rRAKWJ.js} +2 -2
  349. package/dist/{kit-OgFOW9rX.d.ts → kit-DCuO1ZhB.d.ts} +4 -4
  350. package/dist/{knowledge-DdZzUTQ-.js → knowledge-CJnZOaix.js} +67 -7
  351. package/dist/{knowledge-BBC2sfAY.d.ts → knowledge-DWXAxvkN.d.ts} +82 -11
  352. package/dist/lint/index.d.ts +1 -1
  353. package/dist/list/index.d.ts +3 -3
  354. package/dist/{list-query-C7V8kUaD.d.ts → list-query-D1h3Dmnk.d.ts} +3 -3
  355. package/dist/mapper/bin.js +5 -5
  356. package/dist/mcp/index.d.ts +3 -3
  357. package/dist/mcp/index.js +5 -5
  358. package/dist/mcp/sdk/index.d.ts +6 -6
  359. package/dist/mcp/sdk/index.js +2 -2
  360. package/dist/{messaging-D5z2TR37.d.ts → messaging-Bfe4p9Pm.d.ts} +4 -4
  361. package/dist/{model-messages-BcrkjsPE.js → model-messages-CIHqP7Z3.js} +1 -1
  362. package/dist/nestjs/index.d.ts +2 -2
  363. package/dist/nestjs/index.js +1 -1
  364. package/dist/next/client/index.d.ts +1 -1
  365. package/dist/next/index.d.ts +331 -79
  366. package/dist/next/index.js +520 -105
  367. package/dist/node/index.d.ts +2 -2
  368. package/dist/node/index.js +1 -1
  369. package/dist/{operations-t_hlXkS4.d.ts → operations-SWpzGC_K.d.ts} +1 -1
  370. package/dist/{options-D4dxMGHF.js → options-Bgnm4pTD.js} +1 -0
  371. package/dist/{options-C13-dVMH.js → options-D-jiqb0l.js} +2 -0
  372. package/dist/{options-C9bp3SEA.js → options-DqmTs2nv.js} +2 -1
  373. package/dist/{options-CuPWezcV.js → options-RYbyaVhv.js} +3 -1
  374. package/dist/options-SOjQVgfS.js +37 -0
  375. package/dist/{options-JnPEVbBJ.js → options-ScQ6Hnxo.js} +2 -1
  376. package/dist/{options-CuaWhsQS.js → options-X61tvckX.js} +2 -1
  377. package/dist/orpc/index.d.ts +8 -8
  378. package/dist/orpc/index.js +6 -6
  379. package/dist/otel/index.d.ts +2 -2
  380. package/dist/otel/index.js +4 -4
  381. package/dist/{outbox-7zgh-7nw.d.ts → outbox-BFZS6Kvz.d.ts} +4 -4
  382. package/dist/{permissions-C8p6RlIZ.d.ts → permissions-2UlVQDzY.d.ts} +1 -1
  383. package/dist/{pool-D-4HyhuW.d.ts → pool-yO-LzZAd.d.ts} +3 -3
  384. package/dist/{ports-CmEXVqhg.js → ports-CkygVOeE.js} +2 -2
  385. package/dist/{ports-C-8uduFM.d.ts → ports-prqYrReN.d.ts} +1 -1
  386. package/dist/postgres/index.d.ts +4 -4
  387. package/dist/{postgrest-DZtM2nIS.d.ts → postgrest-Bjain6nf.d.ts} +1 -1
  388. package/dist/powersync/index.d.ts +6 -6
  389. package/dist/preset/index.d.ts +3 -3
  390. package/dist/preset/index.js +3 -3
  391. package/dist/{preset-B_sSI9vg.js → preset-BvHNleCo.js} +2 -2
  392. package/dist/{project-DVlXQGEp.js → project-CBvowdKY.js} +5 -5
  393. package/dist/{provider-BI0KC4u5.d.ts → provider-bIAzxVMB.d.ts} +1 -1
  394. package/dist/{push-token-D41lOoE8.d.ts → push-token-DtqJeg8w.d.ts} +1 -1
  395. package/dist/query/index.d.ts +1 -1
  396. package/dist/{rate-limit-CRhlLFhP.js → rate-limit-BJ4EMdAy.js} +1 -1
  397. package/dist/react/index.d.ts +9 -9
  398. package/dist/react/index.js +3 -3
  399. package/dist/react/native/index.d.ts +1 -1
  400. package/dist/react/native/index.js +1 -1
  401. package/dist/react/server.d.ts +9 -9
  402. package/dist/react/server.js +2 -2
  403. package/dist/react/session.d.ts +2 -32
  404. package/dist/react/session.js +1 -37
  405. package/dist/{react-COIov1yC.js → react-DZ7AW2yf.js} +2 -2
  406. package/dist/react-router/index.d.ts +6 -6
  407. package/dist/react-router/index.js +5 -5
  408. package/dist/realtime/index.d.ts +6 -6
  409. package/dist/{record-form-DU2EoVsv.d.ts → record-form-BQA-lawE.d.ts} +1 -1
  410. package/dist/{recordings-D69Va7gP.d.ts → recordings-Bw5LoocX.d.ts} +1 -1
  411. package/dist/records/index.d.ts +9 -9
  412. package/dist/{refusal-CGi-0Q18.d.ts → refusal-BX1EvmpJ.d.ts} +3 -3
  413. package/dist/{refusal-5c6UMpUP.js → refusal-rnbr6RZD.js} +2 -2
  414. package/dist/{refresh-B8t_KE3s.js → request-kind-tNDM5Z_o.js} +15 -31
  415. package/dist/{resolve--LfVoOMg.d.ts → resolve-BIpQRhvF.d.ts} +97 -36
  416. package/dist/{resolve-FW8oeXvh.js → resolve-CZV31iCm.js} +402 -392
  417. package/dist/{resolved-names-h-3UbKcw.js → resolved-names-b6P2--jK.js} +1 -1
  418. package/dist/{resource-BbWk4hoP.js → resource-COaS9_i8.js} +1 -1
  419. package/dist/{resource-DWllVW8k.d.ts → resource-CaYpB07K.d.ts} +1 -1
  420. package/dist/{resource-execute-DUBYKTYU.d.ts → resource-execute-A1NbR-sd.d.ts} +2 -2
  421. package/dist/{resource-types-RgaljPs0.d.ts → resource-types-CTcc37WL.d.ts} +4 -4
  422. package/dist/{resources-Bki1J4jy.d.ts → resources-13ZFX1G6.d.ts} +2 -2
  423. package/dist/{resources-DYSx9NYM.js → resources-DhiK3yLO.js} +1 -1
  424. package/dist/{respond-DLH4tD2d.js → respond-8A3EOo61.js} +1 -1
  425. package/dist/{respond-BYOV7KZp.d.ts → respond-CAxhkwAi.d.ts} +15 -19
  426. package/dist/{sales-lines-DuNVoKHA.d.ts → sales-lines-wQHuL-pa.d.ts} +1 -1
  427. package/dist/{sandboxes-B2hBoBvJ.d.ts → sandboxes-BF9RxxCU.d.ts} +1 -1
  428. package/dist/{scores-FAORS4qU.d.ts → scores-Ce8MxQX9.d.ts} +5 -5
  429. package/dist/server/index.d.ts +58 -36
  430. package/dist/server/index.js +35 -41
  431. package/dist/{server-types-C2hlvhP4.d.ts → server-types-DEjva0MW.d.ts} +19 -17
  432. package/dist/{session-B4VasaAA.d.ts → session-BA0YDmjt.d.ts} +11 -12
  433. package/dist/session-BjPYE4dT.js +180 -0
  434. package/dist/session-CeYL3EPm.d.ts +77 -0
  435. package/dist/{session-status-D8CBxCqv.d.ts → session-status-Df6tuKY9.d.ts} +4 -3
  436. package/dist/{sign-in-CX1a5i2P.d.ts → sign-in-4u4vLtXG.d.ts} +16 -4
  437. package/dist/{sign-in-CxdoTEp5.js → sign-in-djgvab1X.js} +3 -3
  438. package/dist/{sign-in-BMm1xhKq.js → sign-in-k2lXELeC.js} +2 -2
  439. package/dist/{signatures-CBn7w4VR.js → signatures-DK01D2S7.js} +1 -1
  440. package/dist/{signers-6ih6i9aq.d.ts → signers-Dw9DBZjJ.d.ts} +4 -4
  441. package/dist/{signing-keys-De09WNJ3.d.ts → signing-keys-FglIQ6iL.d.ts} +2 -2
  442. package/dist/{signing-keys-BC5_hJN5.js → signing-keys-sGaXklwD.js} +1 -1
  443. package/dist/{snapshot-CVMSyTHH.js → snapshot-BOA7lkRg.js} +9 -17
  444. package/dist/solid/index.d.ts +10 -10
  445. package/dist/solid/index.js +1 -1
  446. package/dist/solid-start/index.d.ts +6 -6
  447. package/dist/solid-start/index.js +5 -5
  448. package/dist/spec/index.d.ts +2 -2
  449. package/dist/sql/index.d.ts +5 -5
  450. package/dist/sql/index.js +3 -3
  451. package/dist/{sql-C9nO-Mat.js → sql-BChN3Hxv.js} +7382 -2219
  452. package/dist/sqlite/index.d.ts +3 -3
  453. package/dist/{sso-CuzAjsc8.d.ts → sso-B7w7h8RJ.d.ts} +3 -3
  454. package/dist/ssr/index.d.ts +5 -6
  455. package/dist/ssr/index.js +3 -3
  456. package/dist/storage/index.d.ts +3 -3
  457. package/dist/storage/index.js +1 -1
  458. package/dist/streams/index.d.ts +1 -1
  459. package/dist/{subject-readers-BlD8tALG.d.ts → subject-readers-YL8H9G8X.d.ts} +2 -2
  460. package/dist/{subjects-Bv2dPflD.d.ts → subjects-CVjAE7nz.d.ts} +3 -3
  461. package/dist/{support-DxYI6sDM.d.ts → support-BwtMgjVg.d.ts} +4 -4
  462. package/dist/{support-view-DSmCett7.d.ts → support-view-GykHOIQ2.d.ts} +1 -1
  463. package/dist/svelte/index.d.ts +9 -9
  464. package/dist/svelte/index.js +1 -1
  465. package/dist/sveltekit/index.d.ts +7 -7
  466. package/dist/sveltekit/index.js +5 -5
  467. package/dist/{tags--k2fbPfO.d.ts → tags-CAfvzA1U.d.ts} +1 -1
  468. package/dist/tanstack-db/index.d.ts +3 -3
  469. package/dist/tanstack-start/index.d.ts +6 -6
  470. package/dist/tanstack-start/index.js +5 -5
  471. package/dist/{tenant-gezshhcs.d.ts → tenant-lBgoqg9T.d.ts} +1 -1
  472. package/dist/testing/index.d.ts +27 -28
  473. package/dist/testing/index.js +5 -5
  474. package/dist/{timeline-Bq658xsi.d.ts → timeline-CrO48Qa6.d.ts} +5 -5
  475. package/dist/{topic-BVq5RdsI.d.ts → topic-x-mrN_Ff.d.ts} +5 -5
  476. package/dist/{types-C8UyJOPJ.d.ts → types-6PMaLIyw.d.ts} +3 -3
  477. package/dist/{types-Dh2OGEW5.d.ts → types-BdhE7I8Z.d.ts} +5 -5
  478. package/dist/{types-BkYEUWdz.d.ts → types-BzIYSSWK.d.ts} +16 -1
  479. package/dist/{types-DCoqai8o.d.ts → types-C7K8mu9B.d.ts} +45 -15
  480. package/dist/{types-d0JBRTAg.d.ts → types-C9XfFGmA.d.ts} +128 -13
  481. package/dist/{types-hTj5OuFo.d.ts → types-CJqNGQKb.d.ts} +2 -2
  482. package/dist/{types-TH3zlMiM.d.ts → types-D5uf0l4_.d.ts} +1 -1
  483. package/dist/{types-BBqP9H6w.d.ts → types-auvHrNWC.d.ts} +4 -4
  484. package/dist/{undo-22ofP6Zp.d.ts → undo-CdKp5_2X.d.ts} +2 -2
  485. package/dist/{usage-CNCT6_3D.d.ts → usage-DZ8j5Tm_.d.ts} +4 -4
  486. package/dist/{vault-yGQD5Rdl.d.ts → vault-DjbG4XQS.d.ts} +2 -2
  487. package/dist/vercel-connect/index.d.ts +1 -1
  488. package/dist/vercel-sandbox/index.d.ts +2 -2
  489. package/dist/{verify-DY_j4GPZ.js → verify-96j8d5ps.js} +1 -1
  490. package/dist/{verify-BQu3eBNW.d.ts → verify-HOiu3lRR.d.ts} +2 -2
  491. package/dist/{view-BfEqjZJ_.js → view-Ch0Qtr36.js} +1 -1
  492. package/dist/{view-Cy2XxYp1.d.ts → view-DdDY88SC.d.ts} +1 -1
  493. package/dist/vue/index.d.ts +10 -10
  494. package/dist/vue/index.js +1 -1
  495. package/dist/{watch-topic-BOclyLFd.d.ts → watch-topic-D6bcqOrJ.d.ts} +1 -1
  496. package/dist/workflow-sdk/builder/index.d.ts +29 -5
  497. package/dist/workflow-sdk/builder/index.js +39 -12
  498. package/dist/workflow-sdk/index.d.ts +1 -1
  499. package/dist/workflow-sdk/index.js +2 -2
  500. package/dist/workflow-sdk/world/index.d.ts +1 -1
  501. package/dist/workflow-sdk/world/index.js +1 -1
  502. package/dist/{workflow-sdk-BL3wzkdp.js → workflow-sdk-CBS8L2Ku.js} +5 -0
  503. package/dist/{workflow-sdk-yIkECybp.d.ts → workflow-sdk-D3H10W5h.d.ts} +3 -3
  504. package/dist/{workflows-BljkWRxE.d.ts → workflows-BI4yKqFh.d.ts} +3 -3
  505. package/dist/yjs/index.d.ts +2 -2
  506. package/dist/yjs/index.js +1 -1
  507. package/package.json +1 -1
  508. package/schemas/config-v1.json +126 -0
  509. package/schemas/doctor-report-v1.json +4 -0
  510. package/skills/better-supabase-auth/SKILL.md +45 -11
  511. package/dist/cli/add-BaB3y1lv.js +0 -1
  512. package/dist/cli/env-UN6PJFX6.js +0 -1
  513. package/dist/cli/powersync-J2Kms2NT.js +0 -1
  514. package/dist/cli/seed-ByLneY1H.js +0 -1
  515. package/dist/errors-D3-4c-XF.js +0 -102
  516. package/dist/http-BDC1IvBX.js +0 -27
  517. package/dist/jwks-cache-IZaiICAV.js +0 -48
  518. package/dist/options-Itq7QYoW.js +0 -20
  519. package/dist/refresh-BtbC2rZe.d.ts +0 -52
  520. package/dist/snapshot-BGsJw9xn.d.ts +0 -83
@@ -1,43 +1,44 @@
1
- import { a as list, m as commandMeta, r as defineCliCommand } from "./command-BpZ4AuhR.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DM_x_yzZ.js";
2
2
  import { i as plain } from "./style-B5-nByxb.js";
3
- import { t as VERSION } from "./version-B59mZJoy.js";
3
+ import { t as VERSION$1 } from "./version-DKfeme2I.js";
4
4
  import { n as CliError, r as errorText } from "./errors-DcJ_PayO.js";
5
- import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-59XWXsRi.js";
5
+ import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-Tqq3MAqx.js";
6
6
  import { a as sameText, t as display } from "./io-CQzy8PEZ.js";
7
- import { t as CACHE_DIR } from "./cache-BPWC7tGD.js";
7
+ import { t as CACHE_DIR } from "./cache-aMk9vF1_.js";
8
8
  import { t as byCodePoint } from "./compare-yl4sSwVn.js";
9
- import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError } from "./snapshot-CloKPNxv.js";
10
- import { d as configFor, r as renderFiles, u as notNullTag } from "./render-C-Mfq-o3.js";
9
+ import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError, x as installedVersion } from "./snapshot-C3_eQUgY.js";
10
+ import { d as configFor, r as renderFiles, u as notNullTag } from "./render-Bp7a7XQ9.js";
11
11
  import { o as providerLabel } from "./authorization-DJkkOjjG.js";
12
12
  import { t as isRecord } from "./guards-DxwRG0Uv.js";
13
- import { i as request } from "./source-Bwyp18Rj.js";
13
+ import { i as request } from "./source-Bk6XwIAK.js";
14
14
  import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-DrrkMihk.js";
15
15
  import { a as findRepoRoot, c as httpHooks, d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, n as declarativeSchemasDir, p as sqlWorkflow, u as pgFunctionHooks } from "./supabase-toml-B6-eEV5p.js";
16
16
  import { t as PROCESS_ENV } from "./env-BCuUsWOh.js";
17
17
  import { n as readStackStatus } from "./stack-status-Mxgqb3I4.js";
18
18
  import { t as connect } from "./db-B8zfxjl2.js";
19
- import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-Cjkm2Sg3.js";
19
+ import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-CEtdbshU.js";
20
20
  import { c as insideRoot, i as changeLines, r as applyPlan } from "./files-DQayErI8.js";
21
- import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-CHpEL0oq.js";
22
- import { a as permissionCatalogKeys, i as lineOf, l as tableObject, n as exposed, o as policyObject, r as exposedSchemas, s as qualified, t as catalogOf, u as workflowOf } from "./shared-DCHxLAEL.js";
23
- import { C as appTablesOf, S as adoptionContext, _ as BLOCK_PREFIX, a as METADATA_GAPS_TEXT, b as splinterTables, c as entitlementsModule, d as appliesTo, f as escape$2, g as withoutStrings, h as policyHelpers, l as COMMANDS$2, m as functionObject, p as functionBody, s as AUTHORIZATION_RULES, u as RLS_RULES, v as blockTargets, w as appViewsOf, x as accessModule, y as advisorRule } from "./run-D2nuyyPo.js";
24
- import { a as compiledReadSets } from "./providers-Be2dgyuR.js";
25
- import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-hFrlzQZ5.js";
26
- import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-BNi8PIiM.js";
21
+ import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-DVQ20UMi.js";
22
+ import { a as permissionCatalogKeys, i as lineOf, l as tableObject, n as exposed, o as policyObject, r as exposedSchemas, s as qualified, t as catalogOf, u as workflowOf } from "./shared-D60W9NS-.js";
23
+ import { i as appViewsOf, n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-BIyQcsHH.js";
24
+ import { _ as BLOCK_PREFIX, a as METADATA_GAPS_TEXT, b as splinterTables, c as entitlementsModule, d as appliesTo, f as escape$3, g as withoutStrings, h as policyHelpers, l as COMMANDS$2, m as functionObject, p as functionBody, s as AUTHORIZATION_RULES, u as RLS_RULES, v as blockTargets, y as advisorRule } from "./run-BclCFEyP.js";
25
+ import { a as compiledReadSets } from "./providers-BDTcal71.js";
26
+ import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration--9T_T-zt.js";
27
+ import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-DfwTOBQ4.js";
27
28
  import { t as orphanedBlockFiles } from "./orphans-CPcR85QN.js";
28
- import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-NFNeZsP7.js";
29
+ import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-CuMpyRjF.js";
29
30
  import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-Bz5QQne2.js";
30
31
  import { i as PLUGIN_SUBPATH_RENAMES, n as BLOCK_SUBPATH_RENAMES, o as SPEC_SUBPATH_RENAMES, t as BLOCK_EXPORT_RENAMES } from "./codemod-block-renames-Dt3X1Wvg.js";
31
32
  import { n as PLATFORM_SCHEMAS } from "./in-stack-diff-huI7fGMX.js";
32
33
  import { a as staleVariables, i as stackEnvValues, r as redactValue, t as PREFIX_NAMES } from "./stack-env-BQhbUFa7.js";
33
34
  import { a as readSharedMemory, n as listStacks, t as branchName } from "./stacks-C5YL6Un9.js";
34
- import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-BzMkmrZR.js";
35
+ import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-D2YvkY2D.js";
35
36
  import { existsSync } from "node:fs";
36
- import { dirname, resolve } from "node:path";
37
+ import { dirname, join, relative, resolve } from "node:path";
37
38
  import { createHash } from "node:crypto";
38
39
  import { glob, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
39
40
  import { DEFAULT_ACTIVE_TENANT, tenantClaimPaths, tenantNameOf } from "better-supabase/config";
40
- import { SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_NAMES, TENANT_SCOPE_POLICY, adoptedTables, adoptedViews, appTablePolicyNotes, blockFileState, blockSqlVersion, contractSignature, customContracts, dataExportPlan, excludedColumns, expiredFlagsQuery, hasColumnAccess, migrationOptionUses, moduleDeprecations, moduleEventTriggers, moduleFileVersion, moduleLayout, notNullCheckName, renderBlocks, sameBlockFile, sameTenantColumn, sameTenantTrigger, scopePolicyName, sharedRolesProblems, subjectColumns, widenedCommands } from "better-supabase/sql";
41
+ import { SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_NAMES, TENANT_SCOPE_POLICY, adoptedTables, adoptedViews, appTablePolicyNotes, blockFileState, blockSqlVersion, blockTables, contractSignature, customContracts, dataExportPlan, excludedColumns, expiredFlagsQuery, hasColumnAccess, migrationOptionUses, moduleDeprecations, moduleEventTriggers, moduleFileVersion, moduleLayout, notNullCheckName, renderBlocks, sameBlockFile, sameTenantColumn, sameTenantTrigger, scopePolicyName, sharedRolesProblems, subjectColumns, widenedCommands } from "better-supabase/sql";
41
42
  import { defineBucket, parseSize } from "better-supabase/storage";
42
43
  // src/cli/doctor/env.ts
43
44
  const PUBLIC_PREFIXES = [
@@ -668,6 +669,78 @@ const APP_TABLE_SCOPE_RULES = [{
668
669
  return findings;
669
670
  }
670
671
  }];
672
+ // src/cli/doctor/block-writes.ts
673
+ /**
674
+ * A supabase-js write: `.from("x").insert(`, with an optional `.schema("s")`
675
+ * right before it. The groups are the schema, the table and the method.
676
+ */
677
+ const DIRECT_WRITE = /(?:\.schema\(\s*["'`]([A-Za-z_][\w$]*)["'`]\s*\)\s*)?\.from\(\s*["'`]([A-Za-z_][\w$]*)["'`]\s*\)\s*\.(insert|update|upsert|delete)\s*\(/g;
678
+ /**
679
+ * The tables blocks create. Tables of the app's that a block runs over (ADR 0098)
680
+ * are the app's to write.
681
+ */
682
+ function ownedTables(context) {
683
+ const own = appTablesOf(context);
684
+ const qualified = /* @__PURE__ */ new Map();
685
+ const named = /* @__PURE__ */ new Map();
686
+ for (const [block, tables] of Object.entries(blockTables(context.config).byBlock)) for (const [logical, table] of Object.entries(tables)) if (!Object.hasOwn(own, table.table)) {
687
+ qualified.set(table.table, {
688
+ block,
689
+ logical,
690
+ table
691
+ });
692
+ if (!named.has(table.name)) named.set(table.name, {
693
+ block,
694
+ logical,
695
+ table
696
+ });
697
+ }
698
+ return {
699
+ qualified,
700
+ named,
701
+ own
702
+ };
703
+ }
704
+ /**
705
+ * The block table a `.from()` writes. Without `.schema()`, a table of the app's
706
+ * in `public` wins; otherwise the name is the block's, reached through a client
707
+ * created with `db: { schema }`.
708
+ */
709
+ function writtenTable(owned, schema, name) {
710
+ if (schema !== void 0) return owned.qualified.get(`${schema}.${name}`);
711
+ return owned.qualified.get(`public.${name}`) ?? (Object.hasOwn(owned.own, `public.${name}`) ? void 0 : owned.named.get(name));
712
+ }
713
+ const lineAt$2 = (text, index) => text.slice(0, index).split("\n").length;
714
+ /**
715
+ * App code that writes a block's table with supabase-js (BS351), which skips
716
+ * the block's functions: its events, hooks and checks.
717
+ */
718
+ function directBlockWrites(context) {
719
+ if (context.config.blockNames.length === 0) return [];
720
+ const owned = ownedTables(context);
721
+ if (owned.qualified.size === 0) return [];
722
+ return context.sources.flatMap((file) => [...file.text.matchAll(DIRECT_WRITE)].flatMap((match) => {
723
+ const [, schema, name = "", method = ""] = match;
724
+ const entry = writtenTable(owned, schema, name);
725
+ if (entry === void 0) return [];
726
+ const line = lineAt$2(file.text, match.index);
727
+ return [{
728
+ message: `${file.path}:${String(line)} calls .${method}() on ${entry.table.table}, the ${entry.logical} table of blocks.${entry.block}. A direct write skips the block's functions, so its events, hooks and checks don't run. Write it through the ${entry.block} API that createBlocks returns.`,
729
+ target: `${file.path}:${String(line)}`,
730
+ location: {
731
+ file: file.path,
732
+ line
733
+ }
734
+ }];
735
+ }));
736
+ }
737
+ const BLOCK_WRITE_RULES = [{
738
+ code: "BS351",
739
+ severity: "warning",
740
+ title: "App code writes a block's table directly",
741
+ description: "A source file calls `.from(\"x\").insert()`, `.update()`, `.upsert()` or `.delete()` on a table a block creates (`blockTables(config).byBlock`). The write skips the block's functions, so its events, hooks and the checks it runs before a write don't run, and the block's other tables can disagree with the row. Write it through the block's API from `createBlocks`. Tables of yours that a block runs over are yours to write and are not reported.",
742
+ check: directBlockWrites
743
+ }];
671
744
  // src/cli/doctor/claims.ts
672
745
  const PERMISSIONS_AUTHORIZER = /\bpermissionsAuthorizer\s*\(/;
673
746
  /**
@@ -756,6 +829,57 @@ const COOKIE_RULES = [{
756
829
  check: encodingDrift
757
830
  }];
758
831
  // src/cli/doctor/dependencies.ts
832
+ /** `node_modules` holds a better-supabase the lockfile doesn't name. */
833
+ function installOffLock(context) {
834
+ const { installed, lock } = context.install ?? {};
835
+ if (installed === void 0 || lock === void 0 || lock.versions.length === 0 || lock.versions.includes(installed)) return [];
836
+ return [{
837
+ message: `node_modules has better-supabase@${installed}, but ${lock.path} locks ${lock.versions.join(", ")}. gen, add and upgrade then write the SQL and types of a release your teammates and CI don't run. Run \`${lock.install}\`.`,
838
+ target: lock.path
839
+ }];
840
+ }
841
+ const AHEAD = "A newer better-supabase release wrote it, so this install is behind: install the release your lockfile and teammates use, then run `better-supabase upgrade --check`.";
842
+ /** Block files or `better_supabase.blocks` rows newer than this release. */
843
+ async function blocksAhead(context) {
844
+ if (context.config.blockNames.length === 0) return [];
845
+ const ships = `better-supabase@${VERSION$1}`;
846
+ const findings = [];
847
+ for (const { file, path, installed } of await moduleFiles(context)) {
848
+ const version = moduleFileVersion(file.contents)?.version ?? 1;
849
+ if (file.kind !== "schema" || installed === void 0 || installed <= version) continue;
850
+ findings.push({
851
+ message: `${path} has ${file.instance ?? file.module} version ${String(installed)}; ${ships} ships version ${String(version)}. ${AHEAD}`,
852
+ target: path,
853
+ location: {
854
+ file: path,
855
+ line: 1
856
+ }
857
+ });
858
+ }
859
+ const db = context.database;
860
+ if (!db || "skipped" in db) return findings;
861
+ let rows;
862
+ try {
863
+ rows = await db.query("select name, to_jsonb(b) ->> 'block' as block, version from better_supabase.blocks b");
864
+ } catch {
865
+ return findings;
866
+ }
867
+ for (const row of rows) {
868
+ const instance = context.config.instances[row.name];
869
+ const module = SQL_MODULES[row.block ?? instance?.block ?? row.name];
870
+ if (!module || instance === void 0) continue;
871
+ const version = blockSqlVersion(module);
872
+ if (row.version <= version) continue;
873
+ findings.push({
874
+ message: `The database has ${row.name} version ${String(row.version)}; ${ships} ships version ${String(version)}. ${AHEAD}`,
875
+ target: `better_supabase.blocks.${row.name}`
876
+ });
877
+ }
878
+ return findings;
879
+ }
880
+ async function releaseMismatch(context) {
881
+ return [...installOffLock(context), ...await blocksAhead(context)];
882
+ }
759
883
  function contentMapperSetup(context) {
760
884
  const setup = context.contentMapper;
761
885
  if (context.config.gen.contentMapper !== true || setup === void 0) return [];
@@ -774,22 +898,32 @@ function contentMapperSetup(context) {
774
898
  });
775
899
  return findings;
776
900
  }
777
- const DEPENDENCY_RULES = [{
778
- code: "BS601",
779
- severity: "warning",
780
- title: "Peer outside its range",
781
- description: "An optional peer of better-supabase is installed at a version outside the range better-supabase declares. With strict peer checks the install fails, and the subpath that needs the peer can break at runtime.",
782
- check: (context) => (context.peers ?? []).flatMap((peer) => peer.installed !== void 0 && satisfies(peer.installed, peer.range) === false ? [{
783
- message: `${peer.name}@${peer.installed} is installed, but better-supabase needs ${peer.range}. Install a version in that range, or remove ${peer.name} if nothing imports it.`,
784
- target: peer.name
785
- }] : [])
786
- }, {
787
- code: "BS602",
788
- severity: "error",
789
- title: "Content mapper not set up",
790
- description: "gen.contentMapper is on, but tsc can't load the content mapper: tsconfig.json has no contentMappers entry for better-supabase, the project resolves TypeScript older than 7.1, or the typecheck script runs tsc without --runExternalCode. Imports of schema.bsb then have no types.",
791
- check: contentMapperSetup
792
- }];
901
+ const DEPENDENCY_RULES = [
902
+ {
903
+ code: "BS601",
904
+ severity: "warning",
905
+ title: "Peer outside its range",
906
+ description: "An optional peer of better-supabase is installed at a version outside the range better-supabase declares. With strict peer checks the install fails, and the subpath that needs the peer can break at runtime.",
907
+ check: (context) => (context.peers ?? []).flatMap((peer) => peer.installed !== void 0 && satisfies(peer.installed, peer.range) === false ? [{
908
+ message: `${peer.name}@${peer.installed} is installed, but better-supabase needs ${peer.range}. Install a version in that range, or remove ${peer.name} if nothing imports it.`,
909
+ target: peer.name
910
+ }] : [])
911
+ },
912
+ {
913
+ code: "BS602",
914
+ severity: "error",
915
+ title: "Content mapper not set up",
916
+ description: "gen.contentMapper is on, but tsc can't load the content mapper: tsconfig.json has no contentMappers entry for better-supabase, the project resolves TypeScript older than 7.1, or the typecheck script runs tsc without --runExternalCode. Imports of schema.bsb then have no types.",
917
+ check: contentMapperSetup
918
+ },
919
+ {
920
+ code: "BS607",
921
+ severity: "warning",
922
+ title: "Installed better-supabase differs from the lockfile or the database",
923
+ description: "The better-supabase in `node_modules` is not a version the lockfile resolves, or a block file or `better_supabase.blocks` records a block version newer than the installed release ships. Either way the CLI renders SQL and types for another release than the one your team and CI run. Run the package manager's install, or install the release that wrote the newer blocks.",
924
+ check: releaseMismatch
925
+ }
926
+ ];
793
927
  // src/cli/doctor/flags.ts
794
928
  /** Flags past their `expires_at` extra column that aren't archived. */
795
929
  async function expiredFlags(context) {
@@ -1475,7 +1609,7 @@ function attachmentSubjects(context) {
1475
1609
  * only with one of `keys`.
1476
1610
  */
1477
1611
  function tenantOnly(expression, column, keys) {
1478
- const col = `(?:"?\\w+"?\\.)?"?${escape$2(column)}"?(?:::\\w+)?`;
1612
+ const col = `(?:"?\\w+"?\\.)?"?${escape$3(column)}"?(?:::\\w+)?`;
1479
1613
  const key = `'([^']*)'(?:::text)?`;
1480
1614
  const atoms = [
1481
1615
  `${col}\\s*=\\s*\\(?\\s*(?:select\\s+)?better_supabase\\.current_tenant_id\\(\\)(?:\\s+as\\s+\\w+)?`,
@@ -2339,6 +2473,51 @@ function aal2WithoutMfa(context) {
2339
2473
  }
2340
2474
  }];
2341
2475
  }
2476
+ // src/cli/doctor/next-cache.ts
2477
+ /** The `next.config` file names Next.js loads, in its order. */
2478
+ const NEXT_CONFIG_FILES = [
2479
+ "next.config.ts",
2480
+ "next.config.mts",
2481
+ "next.config.mjs",
2482
+ "next.config.js"
2483
+ ];
2484
+ /** Files whose presence means the app deploys to Vercel. */
2485
+ const VERCEL_FILES = [
2486
+ "vercel.ts",
2487
+ "vercel.json",
2488
+ ".vercel/project.json"
2489
+ ];
2490
+ /** A remote cache scope that `bsb.cached()` or `bsb.bootstrap()` reads. */
2491
+ const REMOTE_SCOPE = /\bbsb\.remote\s*\(|\bscope\s*:\s*["'`]remote["'`]|["'`]use cache: remote["'`]/;
2492
+ /** `cacheHandlers.remote`, or `createNextConfig`'s `remoteCacheHandler`. */
2493
+ const REMOTE_HANDLER = /\bremoteCacheHandler\s*:|\bcacheHandlers\s*:\s*\{[^}]*\bremote\s*:/s;
2494
+ /**
2495
+ * `'use cache: remote'` entries without a remote handler outside Vercel
2496
+ * (BS608): Next.js keeps them in each instance's memory, so every instance and
2497
+ * every deploy misses on its own.
2498
+ */
2499
+ function remoteWithoutHandler(context) {
2500
+ if (context.vercel === true) return [];
2501
+ const config = context.nextConfig;
2502
+ if (config && REMOTE_HANDLER.test(config.text)) return [];
2503
+ const file = context.sources.find((source) => REMOTE_SCOPE.test(source.text));
2504
+ if (!file) return [];
2505
+ return [{
2506
+ message: `${file.path} caches in the remote scope, but ${config?.path ?? "next.config"} sets no remote cache handler and the app doesn't deploy to Vercel. Each instance then keeps its own in-memory copy. Set \`remoteCacheHandler\` in createNextConfig (or \`cacheHandlers.remote\`) to a shared handler such as Redis.`,
2507
+ target: `${file.path}:remote`,
2508
+ location: {
2509
+ file: file.path,
2510
+ line: lineOf(file.text, REMOTE_SCOPE) ?? 1
2511
+ }
2512
+ }];
2513
+ }
2514
+ const NEXT_CACHE_RULES = [{
2515
+ code: "BS608",
2516
+ severity: "warning",
2517
+ title: "Remote cache scope without a remote cache handler",
2518
+ description: "`bsb.remote()` and `bsb.cached({ scope: \"remote\" })` run in `'use cache: remote'`. Vercel provides a shared remote handler; elsewhere Next.js falls back to an in-memory one per instance, so entries are never shared and every deploy starts cold. Set `cacheHandlers.remote` (`remoteCacheHandler` in `createNextConfig`).",
2519
+ check: remoteWithoutHandler
2520
+ }];
2342
2521
  // src/cli/doctor/not-valid.ts
2343
2522
  /** `(organization_id IS NOT NULL)` as `organization_id`. */
2344
2523
  const NOT_NULL = /^\(*\s*("(?:[^"]|"")+"|[\w$]+)\s+is\s+not\s+null\s*\)*$/iu;
@@ -2562,6 +2741,60 @@ const PGDELTA_RULES = [
2562
2741
  check: missingExtensions
2563
2742
  }
2564
2743
  ];
2744
+ // src/cli/doctor/plain-secrets.ts
2745
+ /**
2746
+ * The blocks that keep a secret out of the row, in the order doctor offers
2747
+ * them.
2748
+ */
2749
+ const SECRET_BLOCKS = ["field-encryption", "credentials"];
2750
+ /**
2751
+ * A column named for a secret: `credentials`, `access_token`, `client_secret`.
2752
+ * `token_hash`, `secret_id` and `credential_ref` end in another word, so they
2753
+ * don't match.
2754
+ */
2755
+ const SECRET_NAME = /(?:^|_)(?:credentials?|tokens?|secrets?)$/i;
2756
+ /** Types that hold the value as written. */
2757
+ const PLAIN_TYPES = /* @__PURE__ */ new Set([
2758
+ "text",
2759
+ "varchar",
2760
+ "bpchar",
2761
+ "json",
2762
+ "jsonb"
2763
+ ]);
2764
+ function remedy(block, table, column) {
2765
+ switch (block) {
2766
+ case "field-encryption": return `set \`encrypted: true\` on appTables.${table.name}.columns.${column} so field-encryption stores it as ciphertext under a Vault data key`;
2767
+ case "credentials": return "store the secret in Vault with the credentials block and keep a credential_ref jsonb in the row";
2768
+ default: return block;
2769
+ }
2770
+ }
2771
+ const encryptedInConfig = (context, table, column) => table.schema === "public" && context.config.appTables[table.name]?.columns?.[column.name]?.encrypted === true;
2772
+ /**
2773
+ * Plain secret columns in the app's tables while a block that would keep them
2774
+ * out of the row is installed (BS352).
2775
+ */
2776
+ function plainSecretColumns(context) {
2777
+ const offered = SECRET_BLOCKS.filter((block) => context.config.blockNames.includes(block));
2778
+ if (offered.length === 0) return [];
2779
+ const own = appTablesOf(context);
2780
+ const blockOwned = new Set(Object.values(blockTables(context.config).byBlock).flatMap((tables) => Object.values(tables).map((table) => table.table)));
2781
+ return catalogOf(context).tables.filter((table) => table.kind === "table" && Object.hasOwn(own, qualified(table)) && !blockOwned.has(qualified(table))).flatMap((table) => table.columns.filter((column) => SECRET_NAME.test(column.name) && PLAIN_TYPES.has(column.udt) && !column.generated && !encryptedInConfig(context, table, column)).map((column) => {
2782
+ const target = `${qualified(table)}.${column.name}`;
2783
+ const fixes = offered.map((block) => remedy(block, table, column.name));
2784
+ return {
2785
+ message: `${target} stores a ${column.udt} value named like a secret in plain text, and ${offered.join(" and ")} ${offered.length === 1 ? "is" : "are"} installed. Anyone who can read the row or a backup reads the secret. To keep it out of the row, ${fixes.join(", or ")}.`,
2786
+ target,
2787
+ object: tableObject(table)
2788
+ };
2789
+ }));
2790
+ }
2791
+ const PLAIN_SECRET_RULES = [{
2792
+ code: "BS352",
2793
+ severity: "warning",
2794
+ title: "Plain secret column next to a block that encrypts it",
2795
+ description: "One of your tables has a `text`, `varchar` or `json` column whose name ends in `credentials`, `token` or `secret`, and `field-encryption` or `credentials` is installed. The value sits in the row as written, so every role that reads the row, and every backup, has the secret. Mark the column `encrypted: true` in `appTables` (field-encryption), or move the secret to Vault with the credentials block and store a `credential_ref` instead. Block tables, columns already marked `encrypted` and names such as `token_hash` or `secret_id` are not reported.",
2796
+ check: plainSecretColumns
2797
+ }];
2565
2798
  // src/cli/doctor/policies.ts
2566
2799
  const AUTH_ROLE = /\bauth"?\s*\.\s*"?role"?\s*\(\s*\)/i;
2567
2800
  /** A check of who is calling: the JWT, the user id, or the session role. */
@@ -2803,7 +3036,7 @@ const POLICY_RULES = [
2803
3036
  const dot = name.indexOf(".");
2804
3037
  const schema = name.slice(0, dot);
2805
3038
  if (schema === "auth" || volatility.get(name) === "immutable") return false;
2806
- return new RegExp(`(?<!\\bselect\\s+)(?<![\\w."])(?:"?${escape$2(schema)}"?\\.)?"?${escape$2(name.slice(dot + 1))}"?\\s*\\(\\s*\\)`, "i").test(text);
3039
+ return new RegExp(`(?<!\\bselect\\s+)(?<![\\w."])(?:"?${escape$3(schema)}"?\\.)?"?${escape$3(name.slice(dot + 1))}"?\\s*\\(\\s*\\)`, "i").test(text);
2807
3040
  });
2808
3041
  if (bare.length === 0) return [];
2809
3042
  return [{
@@ -2981,7 +3214,7 @@ const APP_COLUMN_FORMAT = {
2981
3214
  */
2982
3215
  const skipsNullKeys = (predicate, columns) => {
2983
3216
  if (!predicate) return false;
2984
- return predicate.split(/\s+AND\s+/i).every((part) => columns.some((column) => new RegExp(`^\\(*\\s*"?${escape$2(column)}"?\\s+IS\\s+NOT\\s+NULL\\s*\\)*$`, "i").test(part.trim())));
3217
+ return predicate.split(/\s+AND\s+/i).every((part) => columns.some((column) => new RegExp(`^\\(*\\s*"?${escape$3(column)}"?\\s+IS\\s+NOT\\s+NULL\\s*\\)*$`, "i").test(part.trim())));
2985
3218
  };
2986
3219
  /**
2987
3220
  * Whether the first `columns.length` columns of an index are exactly `columns`,
@@ -3081,7 +3314,7 @@ const SCHEMA_DESIGN_RULES = [
3081
3314
  if (table.kind !== "table") return [];
3082
3315
  const column = table.columns.find((entry) => SOFT_DELETE.test(entry.name) && entry.nullable);
3083
3316
  if (!column) return [];
3084
- const isNull = new RegExp(`"?${escape$2(column.name)}"?\\s+IS\\s+NULL`, "i");
3317
+ const isNull = new RegExp(`"?${escape$3(column.name)}"?\\s+IS\\s+NULL`, "i");
3085
3318
  if (table.indexes.some((index) => index.partial && (index.predicate === void 0 || index.predicate !== null && isNull.test(index.predicate)))) return [];
3086
3319
  return [{
3087
3320
  message: `${qualified(table)} soft-deletes with ${column.name}, but no index has \`where ${column.name} is null\`. Index the live rows you list, for example \`create index on ${qualified(table)} (created_at desc) where ${column.name} is null;\`.`,
@@ -3106,7 +3339,7 @@ const SCHEMA_DESIGN_RULES = [
3106
3339
  return table.columns.filter((column) => {
3107
3340
  if (!column.isArray && column.udt !== "jsonb") return false;
3108
3341
  if (table.indexes.some((index) => index.columns[0] === column.name && (index.method === void 0 || index.method === "gin"))) return false;
3109
- const used = new RegExp(`"?${escape$2(column.name)}"?\\s*${CONTAINS}|${CONTAINS}\\s*[\\w."]*\\b${escape$2(column.name)}\\b`);
3342
+ const used = new RegExp(`"?${escape$3(column.name)}"?\\s*${CONTAINS}|${CONTAINS}\\s*[\\w."]*\\b${escape$3(column.name)}\\b`);
3110
3343
  return filtered.has(column.name) || used.test(own) || functions.includes(table.name) && used.test(functions);
3111
3344
  }).map((column) => ({
3112
3345
  message: `${qualified(table)}.${column.name} is filtered by containment but has no GIN index, so each query scans the table. Run \`create index on ${qualified(table)} using gin (${column.name}${column.udt === "jsonb" ? " jsonb_path_ops" : ""});\`${column.udt === "jsonb" ? " (`jsonb_path_ops` supports `@>` only; drop it for `?`)" : ""}.`,
@@ -3364,13 +3597,13 @@ function listedKeys(files) {
3364
3597
  })));
3365
3598
  }
3366
3599
  const camel = (name) => name.replaceAll(/-([a-z0-9])/g, (_, letter) => letter.toUpperCase());
3367
- const escape$1 = (text) => text.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
3600
+ const escape$2 = (text) => text.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
3368
3601
  /**
3369
3602
  * Whether a source line outside a comment passes the instance a provider:
3370
3603
  * `enrichment: blocks.enrichment.with({ provider })` or `.using(...)`.
3371
3604
  */
3372
3605
  function wired(sources, entry) {
3373
- const keys = [.../* @__PURE__ */ new Set([entry.instance, camel(entry.instance)])].map(escape$1);
3606
+ const keys = [.../* @__PURE__ */ new Set([entry.instance, camel(entry.instance)])].map(escape$2);
3374
3607
  const pattern = new RegExp(`(?:^|[\\s{,])["']?(?:${keys.join("|")})["']?\\s*:\\s*[\\w$.\\[\\]"'-]*\\.(?:with|using)\\(`);
3375
3608
  return sources.some((file) => file.text.split("\n").some((line) => {
3376
3609
  const code = line.trim();
@@ -3932,6 +4165,7 @@ const RULES = [
3932
4165
  ...SCHEMA_DESIGN_RULES,
3933
4166
  ...HOOK_RULES,
3934
4167
  ...COOKIE_RULES,
4168
+ ...NEXT_CACHE_RULES,
3935
4169
  ...CLAIM_RULES,
3936
4170
  ...REMOVED_API_RULES,
3937
4171
  ...AUTHORIZATION_RULES,
@@ -3944,6 +4178,8 @@ const RULES = [
3944
4178
  ...FLAG_RULES,
3945
4179
  ...REALTIME_RULES,
3946
4180
  ...ADOPTION_RULES,
4181
+ ...BLOCK_WRITE_RULES,
4182
+ ...PLAIN_SECRET_RULES,
3947
4183
  ...MIGRATION_SAFETY_RULES,
3948
4184
  ...NOT_VALID_RULES,
3949
4185
  ...APP_TABLE_SCOPE_RULES,
@@ -4277,16 +4513,16 @@ function openLive(config, env, source, pg) {
4277
4513
  };
4278
4514
  }
4279
4515
  // src/cli/doctor/locate.ts
4280
- const escape = (name) => name.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
4516
+ const escape$1 = (name) => name.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
4281
4517
  /**
4282
4518
  * Where a table, function or policy is declared: declarative schemas first,
4283
4519
  * then the newest migration.
4284
4520
  */
4285
4521
  function locate(files, object) {
4286
- const name = `"?${escape(object.name)}"?`;
4287
- const qualifiedName = `(?:"?${escape(object.schema)}"?\\.)?${name}`;
4522
+ const name = `"?${escape$1(object.name)}"?`;
4523
+ const qualifiedName = `(?:"?${escape$1(object.schema)}"?\\.)?${name}`;
4288
4524
  if (object.kind === "policy" && object.table !== void 0) {
4289
- const onTable = new RegExp(`create\\s+policy\\s+${name}\\s+on\\s+(?:only\\s+)?(?:"?${escape(object.schema)}"?\\.)?"?${escape(object.table)}"?(?:\\s|;|$)`, "i");
4525
+ const onTable = new RegExp(`create\\s+policy\\s+${name}\\s+on\\s+(?:only\\s+)?(?:"?${escape$1(object.schema)}"?\\.)?"?${escape$1(object.table)}"?(?:\\s|;|$)`, "i");
4290
4526
  for (const file of files) {
4291
4527
  const match = onTable.exec(file.text);
4292
4528
  if (match) return {
@@ -4348,6 +4584,101 @@ function explainClaims(args) {
4348
4584
  return { error: `--claims is not valid JSON: ${errorText(cause)}` };
4349
4585
  }
4350
4586
  }
4587
+ // src/cli/lockfile.ts
4588
+ /** The lockfiles doctor reads, in the order it looks for them in a folder. */
4589
+ const LOCKFILES = [
4590
+ "pnpm-lock.yaml",
4591
+ "package-lock.json",
4592
+ "yarn.lock",
4593
+ "bun.lock"
4594
+ ];
4595
+ const INSTALL = {
4596
+ "pnpm-lock.yaml": "pnpm install",
4597
+ "package-lock.json": "npm install",
4598
+ "yarn.lock": "yarn install",
4599
+ "bun.lock": "bun install"
4600
+ };
4601
+ const escape = (text) => text.replaceAll(/[.*+?^${}()|[\]\\/]/g, String.raw`\$&`);
4602
+ /** A semver version at the start of a string, without pnpm's peer suffix. */
4603
+ const VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?/;
4604
+ function packageLockVersions(name, text) {
4605
+ let data;
4606
+ try {
4607
+ data = JSON.parse(text);
4608
+ } catch {
4609
+ return [];
4610
+ }
4611
+ const packages = typeof data === "object" && data !== null && "packages" in data ? data.packages : void 0;
4612
+ if (typeof packages !== "object" || packages === null) return [];
4613
+ return Object.entries(packages).flatMap(([path, entry]) => (path === `node_modules/${name}` || path.endsWith(`/node_modules/${name}`)) && typeof entry === "object" && entry !== null && "version" in entry && typeof entry.version === "string" && !("link" in entry && entry.link === true) ? [entry.version] : []);
4614
+ }
4615
+ /**
4616
+ * The registry versions of `name` that `text`, a lockfile of kind `kind`,
4617
+ * resolves. Each format names a package by its resolved version:
4618
+ * `name@1.2.3(peer@4)` keys in pnpm, `node_modules/name` entries in npm, a
4619
+ * `version` line under the `name@range` header in yarn, and `"name@1.2.3"` in
4620
+ * bun.
4621
+ */
4622
+ function lockedVersions(kind, name, text) {
4623
+ const at = escape(name);
4624
+ let found;
4625
+ switch (kind) {
4626
+ case "pnpm-lock.yaml":
4627
+ found = [...text.matchAll(new RegExp(String.raw`^\s+['"]?/?${at}@([^:'"\s]+)['"]?:`, "gm"))].map((match) => match[1] ?? "");
4628
+ break;
4629
+ case "package-lock.json":
4630
+ found = packageLockVersions(name, text);
4631
+ break;
4632
+ case "yarn.lock":
4633
+ found = [...text.matchAll(new RegExp(String.raw`^"?${at}@(?!workspace:|link:|portal:|file:)[^\n]*:\n(?:[ \t]+[^\n]*\n)*?[ \t]+version:? "?([^"\n]+)"?`, "gm"))].map((match) => match[1] ?? "");
4634
+ break;
4635
+ case "bun.lock":
4636
+ found = [...text.matchAll(new RegExp(String.raw`"${at}@([^"]+)"`, "g"))].map((match) => match[1] ?? "");
4637
+ break;
4638
+ default: return kind;
4639
+ }
4640
+ return [...new Set(found.flatMap((version) => {
4641
+ const match = VERSION.exec(version);
4642
+ return match ? [match[0]] : [];
4643
+ }))];
4644
+ }
4645
+ async function readLockfile(dir) {
4646
+ for (const kind of LOCKFILES) {
4647
+ const path = join(dir, kind);
4648
+ const text = await readFile(path, "utf-8").catch(() => void 0);
4649
+ if (text !== void 0) return {
4650
+ kind,
4651
+ path,
4652
+ text
4653
+ };
4654
+ }
4655
+ }
4656
+ /**
4657
+ * The versions of `name` in the nearest lockfile at or above `root`, the one
4658
+ * the package manager installs from.
4659
+ */
4660
+ async function lockedPackage(name, root) {
4661
+ let dir = root;
4662
+ for (;;) {
4663
+ const lockfile = await readLockfile(dir);
4664
+ if (lockfile) return {
4665
+ path: relative(root, lockfile.path),
4666
+ install: INSTALL[lockfile.kind],
4667
+ versions: lockedVersions(lockfile.kind, name, lockfile.text)
4668
+ };
4669
+ const parent = dirname(dir);
4670
+ if (parent === dir) return;
4671
+ dir = parent;
4672
+ }
4673
+ }
4674
+ /** The better-supabase that `root` installs, next to the lockfile's (BS607). */
4675
+ async function betterSupabaseInstall(root) {
4676
+ const [installed, lock] = await Promise.all([installedVersion("better-supabase", root), lockedPackage("better-supabase", root)]);
4677
+ return {
4678
+ installed,
4679
+ lock
4680
+ };
4681
+ }
4351
4682
  // src/cli/commands/doctor.ts
4352
4683
  const ARGS = {
4353
4684
  format: {
@@ -4497,7 +4828,8 @@ async function runDoctor(config, args, env, options = {}) {
4497
4828
  ...options.advisors === void 0 ? {} : { advisors: options.advisors },
4498
4829
  ...options.database === void 0 ? {} : { database: options.database }
4499
4830
  };
4500
- const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers, contentMapper, stackEnv, localStacks] = await Promise.all([
4831
+ const vercel = VERCEL_FILES.some((path) => existsSync(resolve(config.root, path)));
4832
+ const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers, contentMapper, stackEnv, localStacks, nextConfig, install] = await Promise.all([
4501
4833
  options.snapshot ?? loadSnapshot(config, env, source, pg, opened.open),
4502
4834
  Promise.all(ENV_FILES.map((path) => readText(config.root, path))).then((files) => files.filter((file) => file !== void 0)),
4503
4835
  readSupabaseToml(config.root).then(async (toml) => [toml, await sqlFiles(config.root, toml, sqlWorkflow(config, toml))]),
@@ -4507,7 +4839,9 @@ async function runDoctor(config, args, env, options = {}) {
4507
4839
  options.peers ?? peerVersions(config.root).catch(() => []),
4508
4840
  options.contentMapper ?? (config.gen.contentMapper === true && rules.some((rule) => rule.code === "BS602") ? contentMapperSetup$1(config.root) : void 0),
4509
4841
  options.stackEnv ?? (rules.some((rule) => rule.code === "BS503") ? loadStackEnvCheck(config.root, env, options.signal) : void 0),
4510
- options.localStacks ?? (rules.some((rule) => rule.code === "BS700" || rule.code === "BS701") ? loadLocalStackCheck(config.root, env) : void 0)
4842
+ options.localStacks ?? (rules.some((rule) => rule.code === "BS700" || rule.code === "BS701") ? loadLocalStackCheck(config.root, env) : void 0),
4843
+ Promise.all(NEXT_CONFIG_FILES.map((path) => readText(config.root, path))).then((files) => files.find((file) => file !== void 0)),
4844
+ options.install ?? (rules.some((rule) => rule.code === "BS607") ? betterSupabaseInstall(config.root).catch(() => void 0) : void 0)
4511
4845
  ]).catch(async (cause) => {
4512
4846
  await opened.close();
4513
4847
  throw cause;
@@ -4527,10 +4861,13 @@ async function runDoctor(config, args, env, options = {}) {
4527
4861
  sources,
4528
4862
  readSets,
4529
4863
  peers,
4864
+ ...install ? { install } : {},
4530
4865
  ...contentMapper ? { contentMapper } : {},
4531
4866
  ...stackEnv ? { stackEnv } : {},
4532
4867
  shellEnv: env[PROCESS_ENV] ?? {},
4533
4868
  ...localStacks ? { localStacks } : {},
4869
+ ...nextConfig ? { nextConfig } : {},
4870
+ vercel,
4534
4871
  ...live.advisors ? { advisors: live.advisors } : {},
4535
4872
  ...live.database ? { database: live.database } : {},
4536
4873
  ...stats ? { stats } : {},
@@ -4584,7 +4921,7 @@ async function runDoctor(config, args, env, options = {}) {
4584
4921
  } : finding) : findings, {
4585
4922
  format,
4586
4923
  rules,
4587
- version: VERSION,
4924
+ version: VERSION$1,
4588
4925
  fallbackFile: repoPath(context.configToml?.path ?? "package.json"),
4589
4926
  ...options.paint && !out ? { paint: options.paint } : {}
4590
4927
  });
@@ -4620,7 +4957,7 @@ async function runDoctor(config, args, env, options = {}) {
4620
4957
  }
4621
4958
  return format === "json" ? {
4622
4959
  code,
4623
- data: jsonReport(findings, VERSION),
4960
+ data: jsonReport(findings, VERSION$1),
4624
4961
  ...failure
4625
4962
  } : {
4626
4963
  code,
@@ -0,0 +1 @@
1
+ export { n as envCommand } from "./env-DVV10l_r.js";
@@ -1,4 +1,4 @@
1
- import { m as commandMeta, r as defineCliCommand } from "./command-BpZ4AuhR.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DM_x_yzZ.js";
2
2
  import { n as CliError } from "./errors-DcJ_PayO.js";
3
3
  import { r as readIfExists, t as display } from "./io-CQzy8PEZ.js";
4
4
  import { n as readStackStatus, t as parseStackStatus } from "./stack-status-Mxgqb3I4.js";