better-supabase 0.28.0 → 0.30.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 (405) hide show
  1. package/dist/{agents-CMIB3802.d.ts → agents-CM_cCtcr.d.ts} +4 -4
  2. package/dist/{ai-cache-2LGgaT7F.d.ts → ai-cache-BTGqckta.d.ts} +4 -4
  3. package/dist/{ai-chat-BCaKsvLW.d.ts → ai-chat-B7_vQvxU.d.ts} +4 -4
  4. package/dist/{ai-schedules-yGZH-vQb.d.ts → ai-schedules-CZEfo-_M.d.ts} +5 -5
  5. package/dist/ai-sdk/agents/index.d.ts +6 -6
  6. package/dist/ai-sdk/batches/index.d.ts +3 -3
  7. package/dist/ai-sdk/cache/index.d.ts +1 -1
  8. package/dist/ai-sdk/chat/index.d.ts +1 -1
  9. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  10. package/dist/ai-sdk/files/index.d.ts +1 -1
  11. package/dist/ai-sdk/index.d.ts +5 -5
  12. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  13. package/dist/ai-sdk/memory/index.d.ts +3 -3
  14. package/dist/ai-sdk/workflow/index.d.ts +3 -3
  15. package/dist/{api-B1OkIWdx.d.ts → api-59rv5hL6.d.ts} +5 -5
  16. package/dist/{api-keys-ClhKBDcc.d.ts → api-keys-JE-aykZE.d.ts} +4 -4
  17. package/dist/{app-tables-62GqZIhd.d.ts → app-tables-yyVncXEt.d.ts} +1 -1
  18. package/dist/{approvals-C5fmPLsH.d.ts → approvals-BfEafAzt.d.ts} +5 -5
  19. package/dist/{assistant-ndGdOBax.d.ts → assistant-B49qATbj.d.ts} +2 -2
  20. package/dist/astro/index.d.ts +7 -7
  21. package/dist/{authorization-BCG1v0iC.d.ts → authorization-CDU9tYA_.d.ts} +17 -3
  22. package/dist/{authorization-hooks-DtzreCAq.d.ts → authorization-hooks-BWhkMZfH.d.ts} +2 -2
  23. package/dist/better-result/index.d.ts +3 -3
  24. package/dist/{bind-C54jD0r3.d.ts → bind-p7asfI6H.d.ts} +7 -7
  25. package/dist/{block-env-CM-LFfj4.d.ts → block-env-B8wG3xeh.d.ts} +4 -4
  26. package/dist/{block-helpers-CRpAHrp_.d.ts → block-helpers-D5emQ2O6.d.ts} +1 -1
  27. package/dist/{block-hooks-DZN2w69m.d.ts → block-hooks-B8itxzEE.d.ts} +2 -2
  28. package/dist/{block-subjects-CphkQPxp.d.ts → block-subjects-C1_9DkSA.d.ts} +1 -1
  29. package/dist/{block-transport-DWZSJrwN.d.ts → block-transport-9EUA3q_I.d.ts} +2 -2
  30. package/dist/blocks/access-requests/index.d.ts +5 -5
  31. package/dist/blocks/activities/index.d.ts +10 -10
  32. package/dist/blocks/activities/index.js +1 -1
  33. package/dist/blocks/agents/index.d.ts +4 -4
  34. package/dist/blocks/ai-cache/index.d.ts +3 -3
  35. package/dist/blocks/ai-chat/index.d.ts +7 -7
  36. package/dist/blocks/ai-files/index.d.ts +3 -3
  37. package/dist/blocks/ai-keys/index.d.ts +4 -4
  38. package/dist/blocks/ai-schedules/index.d.ts +3 -3
  39. package/dist/blocks/announcements/index.d.ts +8 -8
  40. package/dist/blocks/api-keys/index.d.ts +6 -6
  41. package/dist/blocks/approvals/index.d.ts +4 -4
  42. package/dist/blocks/assets/index.d.ts +6 -6
  43. package/dist/blocks/assignment/index.d.ts +7 -7
  44. package/dist/blocks/attachments/index.d.ts +4 -4
  45. package/dist/blocks/audit/index.d.ts +13 -13
  46. package/dist/blocks/automations/index.d.ts +12 -12
  47. package/dist/blocks/billable-time/index.d.ts +6 -6
  48. package/dist/blocks/billing/index.d.ts +9 -9
  49. package/dist/blocks/bookings/index.d.ts +4 -4
  50. package/dist/blocks/bulk/index.d.ts +4 -4
  51. package/dist/blocks/calendar/index.d.ts +5 -5
  52. package/dist/blocks/calendar/index.js +1 -1
  53. package/dist/blocks/catalog/index.d.ts +6 -6
  54. package/dist/blocks/channels/index.d.ts +7 -7
  55. package/dist/blocks/collections/index.d.ts +12 -12
  56. package/dist/blocks/collections/index.js +1 -1
  57. package/dist/blocks/comments/index.d.ts +10 -10
  58. package/dist/blocks/compliance/index.d.ts +5 -5
  59. package/dist/blocks/connectors/index.d.ts +4 -4
  60. package/dist/blocks/contacts/index.d.ts +7 -7
  61. package/dist/blocks/contacts/index.js +1 -1
  62. package/dist/blocks/content/index.d.ts +5 -5
  63. package/dist/blocks/contracts/index.d.ts +6 -6
  64. package/dist/blocks/courses/index.d.ts +5 -5
  65. package/dist/blocks/created-by/index.d.ts +2 -2
  66. package/dist/blocks/custom-fields/index.d.ts +6 -6
  67. package/dist/blocks/data-lifecycle/index.d.ts +8 -8
  68. package/dist/blocks/deals/index.d.ts +6 -6
  69. package/dist/blocks/dispatch/index.d.ts +7 -7
  70. package/dist/blocks/documents/index.d.ts +4 -4
  71. package/dist/blocks/domains/index.d.ts +6 -6
  72. package/dist/blocks/donations/index.d.ts +6 -6
  73. package/dist/blocks/drive/index.d.ts +6 -6
  74. package/dist/blocks/employees/index.d.ts +8 -8
  75. package/dist/blocks/enrichment/index.d.ts +6 -6
  76. package/dist/blocks/enrollments/index.d.ts +6 -6
  77. package/dist/blocks/entitlements/index.d.ts +6 -6
  78. package/dist/blocks/expenses/index.d.ts +5 -5
  79. package/dist/blocks/field-history/index.d.ts +4 -4
  80. package/dist/blocks/flags/index.d.ts +5 -5
  81. package/dist/blocks/forecasts/index.d.ts +6 -6
  82. package/dist/blocks/forms/index.d.ts +6 -6
  83. package/dist/blocks/goals/index.d.ts +4 -4
  84. package/dist/blocks/guests/index.d.ts +6 -6
  85. package/dist/blocks/hiring/index.d.ts +7 -7
  86. package/dist/blocks/identities/index.d.ts +5 -5
  87. package/dist/blocks/imports/index.d.ts +5 -5
  88. package/dist/blocks/inbox/index.d.ts +10 -10
  89. package/dist/blocks/incidents/index.d.ts +5 -5
  90. package/dist/blocks/index.d.ts +9 -9
  91. package/dist/blocks/inventory/index.d.ts +7 -7
  92. package/dist/blocks/invoices/index.d.ts +8 -8
  93. package/dist/blocks/knowledge/index.d.ts +3 -3
  94. package/dist/blocks/lead-scoring/index.d.ts +7 -7
  95. package/dist/blocks/leases/index.d.ts +6 -6
  96. package/dist/blocks/leave/index.d.ts +5 -5
  97. package/dist/blocks/ledger/index.d.ts +6 -6
  98. package/dist/blocks/mail-sync/index.d.ts +5 -5
  99. package/dist/blocks/memberships/index.d.ts +2 -2
  100. package/dist/blocks/memory/index.d.ts +4 -4
  101. package/dist/blocks/messaging/index.d.ts +11 -11
  102. package/dist/blocks/metrics/index.d.ts +6 -6
  103. package/dist/blocks/mfa/index.d.ts +2 -2
  104. package/dist/blocks/moderation/index.d.ts +6 -6
  105. package/dist/blocks/notifications/index.d.ts +12 -12
  106. package/dist/blocks/notifications/index.js +1 -1
  107. package/dist/blocks/numbering/index.d.ts +4 -4
  108. package/dist/blocks/oauth-server/index.d.ts +5 -5
  109. package/dist/blocks/onboarding/index.d.ts +5 -5
  110. package/dist/blocks/orders/index.d.ts +7 -7
  111. package/dist/blocks/organizations/index.d.ts +8 -8
  112. package/dist/blocks/outbox/index.d.ts +4 -4
  113. package/dist/blocks/passes/index.d.ts +8 -8
  114. package/dist/blocks/permissions/index.d.ts +6 -6
  115. package/dist/blocks/pipelines/index.d.ts +6 -6
  116. package/dist/blocks/posts/index.d.ts +5 -5
  117. package/dist/blocks/profiles/index.d.ts +4 -4
  118. package/dist/blocks/promotions/index.d.ts +5 -5
  119. package/dist/blocks/push/index.d.ts +6 -6
  120. package/dist/blocks/queue/index.d.ts +6 -6
  121. package/dist/blocks/quotes/index.d.ts +8 -8
  122. package/dist/blocks/rank/index.d.ts +5 -5
  123. package/dist/blocks/reactions/index.d.ts +9 -9
  124. package/dist/blocks/relations/index.d.ts +7 -7
  125. package/dist/blocks/reminders/index.d.ts +8 -8
  126. package/dist/blocks/reminders/index.js +1 -1
  127. package/dist/blocks/reviews/index.d.ts +5 -5
  128. package/dist/blocks/saved-views/index.d.ts +6 -6
  129. package/dist/blocks/scores/index.d.ts +5 -5
  130. package/dist/blocks/search/index.d.ts +8 -8
  131. package/dist/blocks/security-events/index.d.ts +7 -7
  132. package/dist/blocks/segments/index.d.ts +8 -8
  133. package/dist/blocks/sequences/index.d.ts +6 -6
  134. package/dist/blocks/service-accounts/index.d.ts +5 -5
  135. package/dist/blocks/sessions/index.d.ts +2 -2
  136. package/dist/blocks/settings/index.d.ts +6 -6
  137. package/dist/blocks/share-links/index.d.ts +5 -5
  138. package/dist/blocks/shipments/index.d.ts +6 -6
  139. package/dist/blocks/signatures/index.d.ts +5 -5
  140. package/dist/blocks/signing-keys/index.d.ts +4 -4
  141. package/dist/blocks/sla/index.d.ts +7 -7
  142. package/dist/blocks/sso/index.d.ts +6 -6
  143. package/dist/blocks/state-machine/index.d.ts +5 -5
  144. package/dist/blocks/subjects/index.d.ts +6 -6
  145. package/dist/blocks/tags/index.d.ts +6 -6
  146. package/dist/blocks/tasks/index.d.ts +9 -9
  147. package/dist/blocks/teams/index.d.ts +4 -4
  148. package/dist/blocks/templates/index.d.ts +7 -7
  149. package/dist/blocks/time-tracking/index.d.ts +7 -7
  150. package/dist/blocks/timeline/index.d.ts +8 -8
  151. package/dist/blocks/trash/index.d.ts +6 -6
  152. package/dist/blocks/undo/index.d.ts +4 -4
  153. package/dist/blocks/updated-at/index.d.ts +2 -2
  154. package/dist/blocks/usage/index.d.ts +4 -4
  155. package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
  156. package/dist/blocks/versions/index.d.ts +6 -6
  157. package/dist/blocks/waitlist/index.d.ts +5 -5
  158. package/dist/blocks/webhooks/index.d.ts +14 -14
  159. package/dist/blocks/webhooks/index.js +1 -1
  160. package/dist/blocks/workflow-editor/index.d.ts +9 -9
  161. package/dist/blocks/workflows/index.d.ts +7 -7
  162. package/dist/{bookings-CVw5-Q0Z.d.ts → bookings-xsmM2TA_.d.ts} +3 -3
  163. package/dist/{bucket-vc-QRrva.d.ts → bucket-SvRQwYS4.d.ts} +1 -1
  164. package/dist/chat-sdk/index.d.ts +6 -6
  165. package/dist/cli/add-BdhGOwkB.js +1 -0
  166. package/dist/cli/{add-DUyg9qna.js → add-D4w-Axib.js} +27 -85
  167. package/dist/cli/{add-BKcE_g9D.js → add-Dggyehsy.js} +2 -2
  168. package/dist/cli/{migrate-sVs1QYTM.js → app-table-files-CiGuwLkO.js} +90 -50
  169. package/dist/cli/{backfill-r9RELEEh.js → backfill-DjVjXW_P.js} +4 -4
  170. package/dist/cli/bin.js +1 -1
  171. package/dist/cli/{blocks-DTOFdrxL.js → blocks-Bbmb6W_F.js} +1 -1
  172. package/dist/cli/{blocks-k1OG8XDs.js → blocks-jRL9K1R8.js} +2 -2
  173. package/dist/cli/{cache-Czfw7Iow.js → cache-BuoIFlUJ.js} +1 -1
  174. package/dist/cli/{codemod-ClmbiLuL.js → codemod-DRavXBCb.js} +5 -5
  175. package/dist/cli/{command-CVzTJSLp.js → command-DIPmo0wh.js} +6 -1
  176. package/dist/cli/{completion-DxEXxFpz.js → completion-DxPxMtyP.js} +2 -2
  177. package/dist/cli/{completion-CNCqE-Gb.js → completion-DyLMSjOD.js} +1 -1
  178. package/dist/cli/{completion-Dpk6vh0p.js → completion-FUgqm2-N.js} +2 -2
  179. package/dist/cli/{config-EjNj3HfT.js → config-BfapErxs.js} +1 -1
  180. package/dist/cli/{config-KvV-sLZL.js → config-Cskysxp-.js} +38 -7
  181. package/dist/cli/{config-D2YUlzrl.js → config-Df5cXWNN.js} +1 -1
  182. package/dist/cli/{config-group-C8tjut39.js → config-group-CP-B9uRt.js} +2 -3
  183. package/dist/cli/{content-mapper-ez_mT0d4.js → content-mapper-BCtyfKXl.js} +2 -2
  184. package/dist/cli/{db-uYN6O5Eg.js → db-CWvH1_46.js} +3 -3
  185. package/dist/cli/{doctor-BD9oo4MG.js → doctor-Di2ZekfN.js} +57 -24
  186. package/dist/cli/{env-DEAtgGoj.js → env-B2CbnbzD.js} +2 -2
  187. package/dist/cli/env-CynGCICL.js +1 -0
  188. package/dist/cli/{gen-8Ya8n2sA.js → gen-STKC9vkK.js} +16 -16
  189. package/dist/cli/index.d.ts +9 -2
  190. package/dist/cli/index.js +8 -8
  191. package/dist/cli/{init-DgL3sDfQ.js → init-DW6_nIwj.js} +22 -10
  192. package/dist/cli/{keys-CsanNk-2.js → keys-V-HcO-21.js} +1 -1
  193. package/dist/cli/{live-CMMEct_F.js → live-0G4Plw3K.js} +2 -2
  194. package/dist/cli/{mcp-DEHtzAkq.js → mcp-flKS8iU5.js} +6 -14
  195. package/dist/cli/{metadata-BZh-cOzC.js → metadata-VARUbXEe.js} +3 -3
  196. package/dist/cli/migrate-Bkq07XcT.js +46 -0
  197. package/dist/cli/{migration-safety-ClnYNMdq.js → migration-safety-BfVeza5j.js} +2 -2
  198. package/dist/cli/{migrations-DWh38tO9.js → migrations-BCq7Zs2E.js} +2 -2
  199. package/dist/cli/{module-migration-CXfRJIV4.js → module-migration-lbeUrsYv.js} +2 -2
  200. package/dist/cli/{moved-Cnb4fp49.js → moved-DNOtp9LA.js} +1 -1
  201. package/dist/cli/{parse-BWM6IGhF.js → parse-BPf3kGnc.js} +1 -1
  202. package/dist/cli/{powersync-Dnyr-Wy5.js → powersync-B15CfH5Y.js} +4 -4
  203. package/dist/cli/powersync-DnBsDchT.js +1 -0
  204. package/dist/cli/{print-DJrSr56b.js → print-DjxpBRnv.js} +2 -2
  205. package/dist/cli/{providers-CpaISitn.js → providers-dyxcHQY3.js} +1 -1
  206. package/dist/cli/{remove-ChaieK3t.js → remove-BLq5gbal.js} +7 -7
  207. package/dist/cli/{render-DUNJ4Pss.js → render-CizUf3RW.js} +5 -5
  208. package/dist/cli/{run-CxFDjL1Q.js → run-ChEjR7yw.js} +3 -3
  209. package/dist/cli/{run-Cl9COGuy.js → run-ChOY6s4o.js} +9 -9
  210. package/dist/cli/{run-ChCQPYOh.js → run-MwM__teL.js} +41 -41
  211. package/dist/cli/seed-BOun22-k.js +1 -0
  212. package/dist/cli/{seed-BzVLTdRl.js → seed-CDnL4Tnc.js} +3 -3
  213. package/dist/cli/{shared-5uqc1GBj.js → shared-DV5wIv-7.js} +1 -1
  214. package/dist/cli/{skills-0gz_qjVb.js → skills-DM3oeIxY.js} +1 -1
  215. package/dist/cli/{snapshot-DdAP7LWO.js → snapshot-B5LXkVMC.js} +3 -3
  216. package/dist/cli/{source-2irbWSck.js → source-BoLNG_2A.js} +1 -1
  217. package/dist/cli/{source-args-DAcQt-Mh.js → source-args-v8ljFDfc.js} +1 -1
  218. package/dist/cli/{spec-_MS0ym5r.js → spec-D6QeE2Zx.js} +1 -1
  219. package/dist/cli/{spec-B7n4Rthp.js → spec-Dz-PGCaM.js} +3 -3
  220. package/dist/cli/{sql-layout-DYKkQw1k.js → sql-layout-zo02f3Dm.js} +2 -2
  221. package/dist/cli/{stack-CteM33gC.js → stack-ClESAZYf.js} +1 -1
  222. package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
  223. package/dist/cli/{sync-DnSOrQuA.js → sync-m-oZ_SyI.js} +4 -4
  224. package/dist/cli/{table-DeH8X0qz.js → table-dyKddjwo.js} +1 -1
  225. package/dist/cli/{upgrade-CWdrC-K3.js → upgrade-C9sgVZ5z.js} +5 -5
  226. package/dist/cli/{upgrade-cMy5fKkg.js → upgrade-WwEJaX3i.js} +3 -3
  227. package/dist/cli/{version-C5RAWmrD.js → version-D2BQuqta.js} +1 -1
  228. package/dist/client/index.d.ts +6 -6
  229. package/dist/client/native/index.d.ts +5 -5
  230. package/dist/{cloud-event-DcJwder2.d.ts → cloud-event-0pQ9vFNS.d.ts} +1 -1
  231. package/dist/{compiler-D3UmE7ao.d.ts → compiler-BEeVWXPS.d.ts} +2 -2
  232. package/dist/{composite-CWJvZgni.d.ts → composite-BJ9s-IJJ.d.ts} +7 -7
  233. package/dist/config/index.d.ts +4 -4
  234. package/dist/config/index.js +3 -3
  235. package/dist/{config-CvJHIy5q.js → config-bqKaPjst.js} +6 -27
  236. package/dist/{config-CTeR7XHK.js → config-r7njjNgh.js} +1 -1
  237. package/dist/{connectors-CHGiffYH.d.ts → connectors-uC5baoFV.d.ts} +4 -4
  238. package/dist/{context-BFEX0b7H.d.ts → context-nbYYjv7U.d.ts} +46 -51
  239. package/dist/{controller-Cl6HmMBk.d.ts → controller-TRocodqG.d.ts} +1 -1
  240. package/dist/{conversion-DlfStnln.d.ts → conversion-g8HzH9My.d.ts} +1 -1
  241. package/dist/create/index.d.ts +3 -3
  242. package/dist/create/index.js +2 -2
  243. package/dist/create/lite/index.d.ts +4 -4
  244. package/dist/create/lite/index.js +1 -1
  245. package/dist/credentials/index.d.ts +4 -4
  246. package/dist/{data-engine-BWoz9lED.d.ts → data-engine-rvbR2C4F.d.ts} +1 -1
  247. package/dist/{define-BLP6XtoL.d.ts → define-D8_9X5fZ.d.ts} +5 -5
  248. package/dist/{define-block-DibVN37N.d.ts → define-block-DWVZSZv1.d.ts} +12 -12
  249. package/dist/{documents-Cup1rpjF.d.ts → documents-BbwYyynk.d.ts} +3 -3
  250. package/dist/edge/index.d.ts +9 -9
  251. package/dist/elysia/index.d.ts +1 -1
  252. package/dist/{embeddings-D_RsS6ow.d.ts → embeddings-I3s5sTDt.d.ts} +1 -1
  253. package/dist/{ended-B8RyuUXF.d.ts → ended-EZzN9QTM.d.ts} +2 -2
  254. package/dist/{entitlements-Y-n4RGAd.d.ts → entitlements-B1i1-wfe.d.ts} +2 -2
  255. package/dist/eve/index.d.ts +5 -5
  256. package/dist/{eve-B7jxYPCw.d.ts → eve-BfhVFV33.d.ts} +2 -2
  257. package/dist/events/index.d.ts +3 -3
  258. package/dist/{events-Cc9DDQWH.d.ts → events-B2qbZps6.d.ts} +1 -1
  259. package/dist/{executor-DNPm13a9.d.ts → executor-BfirBzOr.d.ts} +4 -4
  260. package/dist/{executor-C-Ox9eKq.d.ts → executor-BlS0kCrN.d.ts} +1 -1
  261. package/dist/{executor-hGjrop3A.d.ts → executor-DXQIx4sW.d.ts} +1 -1
  262. package/dist/expo/index.d.ts +4 -4
  263. package/dist/{field-errors-Btn3czyz.d.ts → field-errors-tJvehEFc.d.ts} +10 -10
  264. package/dist/{fields-C3q2ypnO.d.ts → fields-snbaZ14h.d.ts} +1 -1
  265. package/dist/{filter-evaluate-CPxeae5X.d.ts → filter-evaluate-BRpNiNPG.d.ts} +1 -1
  266. package/dist/{filter-query-BXLs72G9.d.ts → filter-query-DBt7OKuH.d.ts} +1 -1
  267. package/dist/{flags-C01PLMJ-.d.ts → flags-DDKTThrO.d.ts} +2 -2
  268. package/dist/flags-sdk/index.d.ts +1 -1
  269. package/dist/{framework-GlxXiotm.d.ts → framework-DVYTtQXA.d.ts} +7 -7
  270. package/dist/{gateway-DzI687yd.d.ts → gateway-Ve7cByEr.d.ts} +3 -3
  271. package/dist/h3/index.d.ts +1 -1
  272. package/dist/h3/v1/index.d.ts +1 -1
  273. package/dist/hono/index.d.ts +9 -9
  274. package/dist/{inbox-NDKwSk_H.d.ts → inbox-c8B86Trp.d.ts} +5 -5
  275. package/dist/{index-DPMVWm_Z.d.ts → index-8US7qlvW.d.ts} +5 -5
  276. package/dist/{index-C_qlBJ3k.d.ts → index-B4wttiLh.d.ts} +4 -4
  277. package/dist/{index-CAY7rIQs.d.ts → index-BKrxynq9.d.ts} +5 -5
  278. package/dist/{index-BfYDY6eh.d.ts → index-BM6NmKSc.d.ts} +5 -5
  279. package/dist/{index-8wOL81rB.d.ts → index-BkzXwuIN.d.ts} +4 -3
  280. package/dist/{index-k-SyCzcQ.d.ts → index-CWAQRWY8.d.ts} +4 -4
  281. package/dist/{index-CQhPHHDF.d.ts → index-Cxsnd-OL.d.ts} +1 -1
  282. package/dist/{index-D1ckLbUM.d.ts → index-pZn6S_iq.d.ts} +1 -1
  283. package/dist/{index-C0_cweyT.d.ts → index-zsgNmE8m.d.ts} +14 -14
  284. package/dist/index.d.ts +6 -6
  285. package/dist/{kit-Dxx3MT8m.d.ts → kit-B8yWCRN7.d.ts} +3 -3
  286. package/dist/{knowledge-F1IhRI4Q.d.ts → knowledge-CsLPACGJ.d.ts} +5 -5
  287. package/dist/lint/index.d.ts +1 -1
  288. package/dist/list/index.d.ts +3 -3
  289. package/dist/{list-query-XHoYDlRN.d.ts → list-query-BcU8NnNL.d.ts} +3 -3
  290. package/dist/mapper/bin.js +6 -6
  291. package/dist/mcp/index.d.ts +6 -6
  292. package/dist/mcp/sdk/index.d.ts +6 -6
  293. package/dist/{messaging-C_Pr9tGx.d.ts → messaging-DQP09JsY.d.ts} +4 -4
  294. package/dist/nestjs/index.d.ts +2 -2
  295. package/dist/next/client/index.d.ts +1 -1
  296. package/dist/next/index.d.ts +103 -28
  297. package/dist/next/index.js +189 -49
  298. package/dist/node/index.d.ts +2 -2
  299. package/dist/{operations-DE7SOBw-.d.ts → operations-CB9atU2e.d.ts} +1 -1
  300. package/dist/{options-C4LuqmdG.js → options-BKBy5wM_.js} +2 -1
  301. package/dist/orpc/index.d.ts +8 -8
  302. package/dist/otel/index.d.ts +2 -2
  303. package/dist/otel/index.js +4 -4
  304. package/dist/{outbox-DxZgoKwp.d.ts → outbox-BZ712Z3X.d.ts} +4 -4
  305. package/dist/{pool-wjbAMqc1.d.ts → pool-DDR1ndk7.d.ts} +3 -3
  306. package/dist/{ports-DP0bthUk.d.ts → ports-hpbyMySO.d.ts} +1 -1
  307. package/dist/postgres/index.d.ts +4 -4
  308. package/dist/{postgrest-z-T0l23T.d.ts → postgrest-AJc8hnJU.d.ts} +1 -1
  309. package/dist/powersync/index.d.ts +6 -6
  310. package/dist/preset/index.d.ts +3 -3
  311. package/dist/preset/index.js +2 -2
  312. package/dist/{preset-DwuWNBip.js → preset-DCdEnJj9.js} +8 -13
  313. package/dist/{project-Bo1vZqVs.js → project-B32wb5J6.js} +4 -4
  314. package/dist/{provider-ClrIplXa.d.ts → provider-CWjzAIX9.d.ts} +1 -1
  315. package/dist/{push-token-v3xCcVU7.d.ts → push-token-DQ1ycFPU.d.ts} +1 -1
  316. package/dist/query/index.d.ts +1 -1
  317. package/dist/react/index.d.ts +8 -8
  318. package/dist/react/native/index.d.ts +1 -1
  319. package/dist/react/server.d.ts +8 -8
  320. package/dist/react/session.d.ts +2 -2
  321. package/dist/react-router/index.d.ts +6 -6
  322. package/dist/realtime/index.d.ts +6 -6
  323. package/dist/realtime/index.js +1 -1
  324. package/dist/{record-form-D2-F4IwS.d.ts → record-form-CubgBrtI.d.ts} +1 -1
  325. package/dist/{recordings-BBSJt_YV.d.ts → recordings-DeZYx-Kv.d.ts} +1 -1
  326. package/dist/records/index.d.ts +9 -9
  327. package/dist/{refresh-CCKB1Wa6.d.ts → refresh-D02Pbf5B.d.ts} +1 -1
  328. package/dist/{refusal-D_tklIEb.d.ts → refusal-B0VmlAxF.d.ts} +2 -2
  329. package/dist/{resolve-Bj1qD7Dy.d.ts → resolve-CtX6T0c0.d.ts} +1 -1
  330. package/dist/{resource-D8pzB5Qf.d.ts → resource-WxN0IsvB.d.ts} +1 -1
  331. package/dist/{resource-execute-BSTIfp1D.d.ts → resource-execute-BzqR8DdD.d.ts} +2 -2
  332. package/dist/{resource-types-D5WEvYtV.d.ts → resource-types-BVbHgTPg.d.ts} +4 -4
  333. package/dist/{resources-CsZ7RhZC.d.ts → resources-BSbRa0Ab.d.ts} +2 -2
  334. package/dist/{respond-BzRG-0qc.d.ts → respond-Dzu_-EPH.d.ts} +1 -1
  335. package/dist/{sales-lines-KxxStRzU.d.ts → sales-lines-BsmrNHe9.d.ts} +1 -1
  336. package/dist/{scores-B2BiNuVJ.d.ts → scores-Y8TvyJi1.d.ts} +5 -5
  337. package/dist/server/index.d.ts +24 -24
  338. package/dist/server/index.js +2 -2
  339. package/dist/{server-types-BlDiY-ya.d.ts → server-types-BkTIxW_H.d.ts} +11 -11
  340. package/dist/{session-BGP98Rgj.d.ts → session-BOzx2qHC.d.ts} +6 -6
  341. package/dist/{session-status-C4t7kbSn.d.ts → session-status-BP8eYVnA.d.ts} +2 -2
  342. package/dist/sign-in-BzihC_8k.d.ts +50 -0
  343. package/dist/{sign-in-NO7LWlw4.js → sign-in-Cyj3ZlFX.js} +120 -25
  344. package/dist/{signers-BKgmVh6A.d.ts → signers-ZmxO1I05.d.ts} +4 -4
  345. package/dist/{signing-keys-BNDUxpQL.d.ts → signing-keys-udgP7Aod.d.ts} +2 -2
  346. package/dist/solid/index.d.ts +10 -10
  347. package/dist/solid-start/index.d.ts +6 -6
  348. package/dist/spec/index.d.ts +2 -2
  349. package/dist/sql/index.d.ts +4 -4
  350. package/dist/sql/index.js +2 -2
  351. package/dist/{sql-B7vBP9g0.js → sql-CyeDg3Yh.js} +321 -212
  352. package/dist/sqlite/index.d.ts +3 -3
  353. package/dist/{sso-B0Txid2-.d.ts → sso-CkU_4mtK.d.ts} +3 -3
  354. package/dist/ssr/index.d.ts +5 -5
  355. package/dist/storage/index.d.ts +3 -3
  356. package/dist/streams/index.d.ts +1 -1
  357. package/dist/{subject-readers-DJbzlm8a.d.ts → subject-readers-CB5Te02u.d.ts} +5 -5
  358. package/dist/{subject-readers-CeeJJOQ4.js → subject-readers-VHcrWhmq.js} +2 -2
  359. package/dist/{subjects-BpIEN1MS.d.ts → subjects-CiBNKy2y.d.ts} +4 -4
  360. package/dist/{support-D7CMbhRT.d.ts → support-BxyPOFk4.d.ts} +4 -4
  361. package/dist/{support-view-CIDXF3_H.d.ts → support-view-nqUWKHEs.d.ts} +1 -1
  362. package/dist/svelte/index.d.ts +9 -9
  363. package/dist/sveltekit/index.d.ts +7 -7
  364. package/dist/{tags-Dg4Ywmqp.d.ts → tags-Cm48BsOa.d.ts} +1 -1
  365. package/dist/tanstack-db/index.d.ts +3 -3
  366. package/dist/tanstack-start/index.d.ts +6 -6
  367. package/dist/{tenant-CyLEXgot.d.ts → tenant-C9YE_kqK.d.ts} +2 -2
  368. package/dist/testing/index.d.ts +25 -25
  369. package/dist/testing/index.js +1 -1
  370. package/dist/{timeline-Cjl-1hiA.d.ts → timeline-DvXtXq5q.d.ts} +5 -5
  371. package/dist/{topic-B_DGdAEs.d.ts → topic-breZqx_4.d.ts} +5 -5
  372. package/dist/{types-Dp3UCr1e.d.ts → types-B-D6fYx2.d.ts} +1 -1
  373. package/dist/{types-DF8JYEf5.d.ts → types-C3I7S51U.d.ts} +2 -2
  374. package/dist/{types-Czq9Xtpa.d.ts → types-CK2X2wCB.d.ts} +5 -5
  375. package/dist/{types-DFdg_4yN.d.ts → types-CPl9uJ0G.d.ts} +2 -2
  376. package/dist/{types-DR1MHh7N.d.ts → types-CwQgFo8c.d.ts} +4 -4
  377. package/dist/{types-Dr9wZgNy.d.ts → types-DMihLukJ.d.ts} +3 -3
  378. package/dist/{types-A4yyKEsg.d.ts → types-iCyZ3lMx.d.ts} +4 -4
  379. package/dist/{types-BdaBfYIw.d.ts → types-nspa5I-a.d.ts} +7 -7
  380. package/dist/{undo-B1jwnVyN.d.ts → undo-0HkWXASn.d.ts} +2 -2
  381. package/dist/{usage-Dp45V42p.d.ts → usage-BkWAPkg2.d.ts} +4 -4
  382. package/dist/{vault-BghaujrZ.d.ts → vault-BkdPmL7f.d.ts} +2 -2
  383. package/dist/vercel-connect/index.d.ts +1 -1
  384. package/dist/{verify-CI8LgSpv.d.ts → verify-41mZmspj.d.ts} +2 -2
  385. package/dist/{view-BvNA7EOC.d.ts → view-C8_xvD-j.d.ts} +1 -1
  386. package/dist/vue/index.d.ts +10 -10
  387. package/dist/{watch-topic-1zIAtiNM.d.ts → watch-topic-ItO3dz8m.d.ts} +1 -1
  388. package/dist/workflow-sdk/builder/index.d.ts +3 -3
  389. package/dist/workflow-sdk/index.d.ts +1 -1
  390. package/dist/workflow-sdk/world/index.d.ts +1 -1
  391. package/dist/workflow-sdk/world/index.js +1 -1
  392. package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-BWPsdzVK.js} +36 -8
  393. package/dist/{workflow-sdk-BNsZrcVg.d.ts → workflow-sdk-rg3IbCZC.d.ts} +3 -3
  394. package/dist/{workflows-B0ZPAQu0.d.ts → workflows-xL6t0TXx.d.ts} +7 -4
  395. package/dist/yjs/index.d.ts +2 -2
  396. package/package.json +1 -2
  397. package/schemas/config-v1.json +5 -352
  398. package/schemas/doctor-report-v1.json +1 -0
  399. package/skills/better-supabase/references/ui-recipes.md +5 -5
  400. package/skills/better-supabase-auth/SKILL.md +8 -1
  401. package/dist/cli/add-pDOlqWUa.js +0 -1
  402. package/dist/cli/env-Cy2lWBRC.js +0 -1
  403. package/dist/cli/powersync-DURhWDVc.js +0 -1
  404. package/dist/cli/seed-BJ7c-ktX.js +0 -1
  405. package/dist/sign-in-CAadgm33.d.ts +0 -24
@@ -1,12 +1,12 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
3
3
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
4
4
  import { t as display } from "./io-DH1kcmmP.js";
5
- import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-KvV-sLZL.js";
5
+ import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-Cskysxp-.js";
6
6
  import { d as readSupabaseToml, f as schemaPaths, n as declarativeSchemasDir, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
7
7
  import { r as supabaseCli } from "./exec-Ca5s-ygi.js";
8
8
  import { t as connect } from "./db-CQCLx7cx.js";
9
- import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-DAcQt-Mh.js";
9
+ import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-v8ljFDfc.js";
10
10
  import { a as migrationFiles, i as isShadowFailure, o as migrationVersion, r as inStackDiff, t as MIGRATION_HEADER } from "./in-stack-diff-Cp-tVPj2.js";
11
11
  import { dirname, join, resolve } from "node:path";
12
12
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -1,36 +1,36 @@
1
- import { a as list, p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
- import { t as VERSION } from "./version-C5RAWmrD.js";
3
+ import { t as VERSION } from "./version-D2BQuqta.js";
4
4
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
5
5
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
6
6
  import { a as sameText, t as display } from "./io-DH1kcmmP.js";
7
- import { t as CACHE_DIR } from "./cache-Czfw7Iow.js";
7
+ import { t as CACHE_DIR } from "./cache-BuoIFlUJ.js";
8
8
  import { t as byCodePoint } from "./compare-BmIWVEui.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-DdAP7LWO.js";
10
- import { d as configFor, r as renderFiles, u as notNullTag } from "./render-DUNJ4Pss.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-B5LXkVMC.js";
10
+ import { d as configFor, r as renderFiles, u as notNullTag } from "./render-CizUf3RW.js";
11
11
  import { t as isRecord } from "./guards-CUlDNYZs.js";
12
- import { i as request } from "./source-2irbWSck.js";
13
- import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-KvV-sLZL.js";
14
- import { a as compiledReadSets, d as providerLabel } from "./providers-CpaISitn.js";
12
+ import { i as request } from "./source-BoLNG_2A.js";
13
+ import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-Cskysxp-.js";
14
+ import { a as compiledReadSets, d as providerLabel } from "./providers-dyxcHQY3.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-CncmQbO0.js";
16
16
  import { t as PROCESS_ENV } from "./env-BK0xKMeU.js";
17
17
  import { n as readStackStatus } from "./stack-status-BkkYRlXG.js";
18
18
  import { t as connect } from "./db-CQCLx7cx.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-ez_mT0d4.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-BCtyfKXl.js";
20
20
  import { c as insideRoot, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
21
- import { C as splinterTables, S as advisorRule, _ as withoutStrings, a as METADATA_GAPS_TEXT, b as appTablesOf, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$2, s as AUTHORIZATION_RULES, u as COMMANDS$2, v as BLOCK_PREFIX, x as appViewsOf, y as blockTargets } from "./run-Cl9COGuy.js";
22
- import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-DYKkQw1k.js";
23
- 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-5uqc1GBj.js";
24
- import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-CXfRJIV4.js";
25
- import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-ClnYNMdq.js";
21
+ import { C as splinterTables, S as advisorRule, _ as withoutStrings, a as METADATA_GAPS_TEXT, b as appTablesOf, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$2, s as AUTHORIZATION_RULES, u as COMMANDS$2, v as BLOCK_PREFIX, x as appViewsOf, y as blockTargets } from "./run-ChOY6s4o.js";
22
+ import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-zo02f3Dm.js";
23
+ 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-DV5wIv-7.js";
24
+ import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-lbeUrsYv.js";
25
+ import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-BfVeza5j.js";
26
26
  import { t as orphanedBlockFiles } from "./orphans-BAboqyVM.js";
27
- import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-CMMEct_F.js";
28
- import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-DAcQt-Mh.js";
27
+ import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-0G4Plw3K.js";
28
+ import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-v8ljFDfc.js";
29
29
  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-BuSaTE_G.js";
30
30
  import { n as PLATFORM_SCHEMAS } from "./in-stack-diff-Cp-tVPj2.js";
31
- import { i as staleVariables, r as stackEnvValues, t as PREFIX_NAMES } from "./stack-env-6hS-WEmh.js";
31
+ import { a as staleVariables, i as stackEnvValues, r as redactValue, t as PREFIX_NAMES } from "./stack-env-3ziggrU3.js";
32
32
  import { a as readSharedMemory, n as listStacks, t as branchName } from "./stacks-CiDBH1dB.js";
33
- import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-BZh-cOzC.js";
33
+ import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-VARUbXEe.js";
34
34
  import { existsSync } from "node:fs";
35
35
  import { dirname, resolve } from "node:path";
36
36
  import { createHash } from "node:crypto";
@@ -46,6 +46,16 @@ const PUBLIC_PREFIXES = [
46
46
  "EXPO_PUBLIC_",
47
47
  "NUXT_PUBLIC_"
48
48
  ];
49
+ /** `SUPABASE_URL`, plain or with a browser prefix. */
50
+ const URL_VARIABLE = new RegExp(`^(?:${PUBLIC_PREFIXES.join("|")})?SUPABASE_URL$`);
51
+ /** The URL without a trailing slash, `null` for a value that isn't one. */
52
+ function normalizedUrl(value) {
53
+ try {
54
+ return new URL(value).href.replace(/\/+$/, "");
55
+ } catch {
56
+ return null;
57
+ }
58
+ }
49
59
  function envEntries(file) {
50
60
  return file.text.split("\n").flatMap((raw, index) => {
51
61
  const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(raw);
@@ -89,7 +99,10 @@ async function loadStackEnvCheck(root, env, signal) {
89
99
  return { skipped: errorText(cause) };
90
100
  }
91
101
  }
92
- /** Checks on env files and the variables the shell exports (BS501 to BS503). */
102
+ /**
103
+ * Checks on env files and the variables the shell exports (BS501 to BS503 and
104
+ * BS506).
105
+ */
93
106
  const ENV_RULES = [
94
107
  {
95
108
  code: "BS501",
@@ -139,6 +152,26 @@ const ENV_RULES = [
139
152
  target: stale.variable,
140
153
  message: `${stale.message} Unset it or start the app with better-supabase dev run -- <cmd>.`
141
154
  }))
155
+ },
156
+ {
157
+ code: "BS506",
158
+ severity: "warning",
159
+ title: "Server and browser Supabase URLs differ",
160
+ description: "The session cookie name comes from the project URL. When SUPABASE_URL and a browser-prefixed spelling such as NEXT_PUBLIC_SUPABASE_URL point at different URLs, the server and the browser client read different cookies, and a sign-in on one side is invisible to the other. Use one URL, or set auth.cookie.name on both clients when the split is intended (a custom domain in the browser, the project URL on the server).",
161
+ check: (context) => context.envFiles.flatMap((file) => {
162
+ const urls = envEntries(file).filter((entry) => URL_VARIABLE.test(entry.key) && entry.value !== "");
163
+ const [server] = urls;
164
+ if (!server) return [];
165
+ const expected = normalizedUrl(server.value);
166
+ return urls.filter((entry) => expected !== null && normalizedUrl(entry.value) !== null && normalizedUrl(entry.value) !== expected).map((entry) => ({
167
+ message: `${entry.key} in ${file.path} (${redactValue(entry.value)}) differs from ${server.key} (${redactValue(server.value)}). The server and the browser then read different session cookies. Use one URL, or set auth.cookie.name on both clients.`,
168
+ target: `${file.path}:${entry.key}`,
169
+ location: {
170
+ file: file.path,
171
+ line: entry.line
172
+ }
173
+ }));
174
+ })
142
175
  }
143
176
  ];
144
177
  //#endregion
@@ -1576,14 +1609,14 @@ function namedTypes(on) {
1576
1609
  return isRecord(on) ? Object.keys(on) : [];
1577
1610
  }
1578
1611
  /**
1579
- * Block entries whose `on` names a type `config.records` doesn't register. The
1612
+ * Block entries whose `on` names a type `config.subjects` doesn't register. The
1580
1613
  * block's SQL refuses such a type when it renders, so this reports it before
1581
1614
  * `gen`.
1582
1615
  */
1583
1616
  function onUnknownRecordTypes(context) {
1584
1617
  const registered = new Set(Object.keys(context.config.subjects));
1585
1618
  return Object.entries(context.config.blocks).flatMap(([instance, entry]) => namedTypes(entry?.on).filter((type) => !registered.has(type)).map((type) => ({
1586
- message: `blocks.${instance}.on names "${type}", which is not a record type. Register it in config.records, or remove it from on.`,
1619
+ message: `blocks.${instance}.on names "${type}", which is not a record type. Register it in config.subjects, or remove it from on.`,
1587
1620
  target: `blocks.${instance}.on.${type}`
1588
1621
  })));
1589
1622
  }
@@ -2154,14 +2187,14 @@ const MODULE_RULES = [
2154
2187
  code: "BS331",
2155
2188
  severity: "error",
2156
2189
  title: "Subject registry names a missing table or column",
2157
- description: "An entry in `config.records` names a table, or a column of it (`id`, `tenant`, `title`, `deletedAt`, the `url` placeholders, `rank` and `search`), that the snapshot lacks. `subject_title`, `subject_url`, `can_subject` and every module that falls back to the registry then fail when they run.",
2190
+ description: "An entry in `config.subjects` names a table, or a column of it (`id`, `tenant`, `title`, `deletedAt`, the `url` placeholders, `rank` and `search`), that the snapshot lacks. `subject_title`, `subject_url`, `can_subject` and every module that falls back to the registry then fail when they run.",
2158
2191
  check: missingSubjectColumns
2159
2192
  },
2160
2193
  {
2161
2194
  code: "BS332",
2162
2195
  severity: "warning",
2163
2196
  title: "Subject table without RLS",
2164
- description: "A table in `config.records` has row level security disabled. `can_subject` treats a row the caller can read as visible, so without RLS every signed-in user passes the visibility half of the check for every row.",
2197
+ description: "A table in `config.subjects` has row level security disabled. `can_subject` treats a row the caller can read as visible, so without RLS every signed-in user passes the visibility half of the check for every row.",
2165
2198
  check: subjectsWithoutRls
2166
2199
  },
2167
2200
  {
@@ -2175,7 +2208,7 @@ const MODULE_RULES = [
2175
2208
  code: "BS346",
2176
2209
  severity: "warning",
2177
2210
  title: "Block on names an unknown record type",
2178
- description: "A block entry's `on` lists a type, or has a key, that `config.records` doesn't register, so the block's SQL refuses it when `gen` renders the migration. Register the type in `config.records` or remove it from `on`.",
2211
+ description: "A block entry's `on` lists a type, or has a key, that `config.subjects` doesn't register, so the block's SQL refuses it when `gen` renders the migration. Register the type in `config.subjects` or remove it from `on`.",
2179
2212
  check: onUnknownRecordTypes
2180
2213
  },
2181
2214
  {
@@ -1,10 +1,10 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
4
4
  import { n as readStackStatus, t as parseStackStatus } from "./stack-status-BkkYRlXG.js";
5
5
  import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
6
6
  import { r as publicPrefix, t as detectProject } from "./detect-D9JaAX20.js";
7
- import { n as prefixFromFlag, r as stackEnvValues } from "./stack-env-6hS-WEmh.js";
7
+ import { i as stackEnvValues, n as prefixFromFlag } from "./stack-env-3ziggrU3.js";
8
8
  import { existsSync } from "node:fs";
9
9
  import { resolve } from "node:path";
10
10
  import { readFile } from "node:fs/promises";
@@ -0,0 +1 @@
1
+ export { n as envCommand } from "./env-B2CbnbzD.js";
@@ -1,22 +1,22 @@
1
- import { a as list, p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { a as parseNames, i as failedResult, n as CliError } from "./errors-BTe6A15O.js";
4
- import { u as catalogFingerprint } from "./cache-Czfw7Iow.js";
5
- import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
6
- import { d as GEN_TASKS, p as isGenTask } from "./config-KvV-sLZL.js";
4
+ import { u as catalogFingerprint } from "./cache-BuoIFlUJ.js";
5
+ import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-B5LXkVMC.js";
6
+ import { d as GEN_TASKS, p as isGenTask } from "./config-Cskysxp-.js";
7
7
  import { c as insideRoot, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
8
- import { n as runGen } from "./run-Cl9COGuy.js";
9
- import { n as dataMigration } from "./migrations-DWh38tO9.js";
10
- import { t as syncModules } from "./sync-DnSOrQuA.js";
11
- import { t as addModules } from "./add-BKcE_g9D.js";
12
- import { n as listModules, t as printModule } from "./print-DJrSr56b.js";
13
- import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-DAcQt-Mh.js";
14
- import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-BZh-cOzC.js";
15
- import { a as runEnv } from "./env-DEAtgGoj.js";
16
- import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-B7n4Rthp.js";
17
- import { n as runPowerSync } from "./powersync-Dnyr-Wy5.js";
18
- import { t as runSeed } from "./seed-BzVLTdRl.js";
19
- import { t as upgrade } from "./upgrade-CWdrC-K3.js";
8
+ import { n as runGen } from "./run-ChOY6s4o.js";
9
+ import { n as dataMigration } from "./migrations-BCq7Zs2E.js";
10
+ import { t as syncModules } from "./sync-m-oZ_SyI.js";
11
+ import { t as addModules } from "./add-Dggyehsy.js";
12
+ import { n as listModules, t as printModule } from "./print-DjxpBRnv.js";
13
+ import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-v8ljFDfc.js";
14
+ import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-VARUbXEe.js";
15
+ import { a as runEnv } from "./env-B2CbnbzD.js";
16
+ import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-Dz-PGCaM.js";
17
+ import { n as runPowerSync } from "./powersync-B15CfH5Y.js";
18
+ import { t as runSeed } from "./seed-CDnL4Tnc.js";
19
+ import { t as upgrade } from "./upgrade-C9sgVZ5z.js";
20
20
  import { existsSync } from "node:fs";
21
21
  import { resolve } from "node:path";
22
22
  //#region src/cli/commands/sql.ts
@@ -398,6 +398,11 @@ interface CliCommandDef<T extends ArgsDef> {
398
398
  /** Values `completion` offers per argument: block, preset or task names. */
399
399
  readonly completions?: { readonly [K in keyof T & string]?: CompletionValues; };
400
400
  readonly runsWithInvalidConfig?: boolean;
401
+ /**
402
+ * Loads a config that still has the removed `tables` and `records` keys, for
403
+ * the command that moves them out (`migrate schema-first`).
404
+ */
405
+ readonly readsLegacyTables?: boolean;
401
406
  readonly run: (args: CliArgs<T>, context: CliContext) => Promise<CommandResult>;
402
407
  }
403
408
  /** Any citty command, whatever its arguments. */
@@ -794,9 +799,11 @@ export declare function emitModule(model: Model, options: EmitOptions): string;
794
799
  * `--config` keeps `cwd` as the root. `path` is the file `discoverConfig`
795
800
  * found, for callers that already looked it up.
796
801
  */
797
- export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined): Promise<ResolvedConfig>;
802
+ export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined, options?: {
803
+ readonly legacyTables?: boolean;
804
+ }): Promise<ResolvedConfig>;
798
805
  //#endregion
799
806
  //#region src/cli/version.d.ts
800
- export declare const VERSION = "0.28.0";
807
+ export declare const VERSION = "0.30.0";
801
808
  //#endregion
802
809
  export type { Catalog, CatalogCheck, CatalogColumn, CatalogColumnGrant, CatalogEnum, CatalogForeignKey, CatalogFunction, CatalogFunctionArg, CatalogGrant, CatalogIndex, CatalogPolicy, CatalogTable, CatalogTrigger, CatalogUnique, Choice, Cli, CliArgs, CliCommand, CliCommandDef, CliContext, CliEnv, CliErrorCode, CliErrorOptions, CliIo, CliLog, CliProblem, CliProblemExtensions, CommandResult, CreateCliOptions, ExitCode, ExtrasFunction, ExtrasHook, ExtrasHookFunction, ExtrasTable, ForeignKeyAction, Format, GeneratorMetadata, IntrospectionSource, ManagementSourceOptions, NextStep, Paint, Prompter, Queryable, RunOptions, RunResult, Snapshot, SnapshotBucket, SnapshotExtras };
package/dist/cli/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { a as list, r as defineCliCommand } from "./command-CVzTJSLp.js";
2
- import { i as run, n as createCli, r as help, t as commandNames } from "./run-ChCQPYOh.js";
3
- import { t as VERSION } from "./version-C5RAWmrD.js";
1
+ import { a as list, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
+ import { i as run, n as createCli, r as help, t as commandNames } from "./run-MwM__teL.js";
3
+ import { t as VERSION } from "./version-D2BQuqta.js";
4
4
  import { n as CliError, t as CLI_ERRORS_URL } from "./errors-BTe6A15O.js";
5
- import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
6
- import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-DUNJ4Pss.js";
7
- import { a as toCatalog, n as managementSource, r as pgSource } from "./source-2irbWSck.js";
8
- import { s as loadConfig } from "./config-KvV-sLZL.js";
9
- import { n as runGen } from "./run-Cl9COGuy.js";
5
+ import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-B5LXkVMC.js";
6
+ import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-CizUf3RW.js";
7
+ import { a as toCatalog, n as managementSource, r as pgSource } from "./source-BoLNG_2A.js";
8
+ import { s as loadConfig } from "./config-Cskysxp-.js";
9
+ import { n as runGen } from "./run-ChOY6s4o.js";
10
10
  //#region src/cli/introspect/from-catalog.ts
11
11
  /**
12
12
  * Builds a snapshot from catalog records: the inverse of `toCatalog`. Tests and
@@ -1,17 +1,18 @@
1
- import { a as list, p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists } from "./io-DH1kcmmP.js";
5
- import { l as TYPEGEN_VERSION } from "./cache-Czfw7Iow.js";
6
- import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
7
- import { a as toCatalog } from "./source-2irbWSck.js";
8
- import { a as findConfig, s as loadConfig } from "./config-KvV-sLZL.js";
9
- import { r as contentMapperFiles } from "./content-mapper-ez_mT0d4.js";
5
+ import { l as TYPEGEN_VERSION } from "./cache-BuoIFlUJ.js";
6
+ import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-B5LXkVMC.js";
7
+ import { a as toCatalog } from "./source-BoLNG_2A.js";
8
+ import { a as findConfig, s as loadConfig } from "./config-Cskysxp-.js";
9
+ import { r as contentMapperFiles } from "./content-mapper-BCtyfKXl.js";
10
10
  import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
11
- import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-DUyg9qna.js";
12
- import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-ClnYNMdq.js";
11
+ import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-D4w-Axib.js";
12
+ import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-BfVeza5j.js";
13
13
  import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
14
- import { s as enablePgDelta, t as syncModules } from "./sync-DnSOrQuA.js";
14
+ import { s as enablePgDelta, t as syncModules } from "./sync-m-oZ_SyI.js";
15
+ import { t as appTablePlan } from "./app-table-files-CiGuwLkO.js";
15
16
  import { existsSync } from "node:fs";
16
17
  import { join, posix, resolve } from "node:path";
17
18
  import { glob, readFile, readdir } from "node:fs/promises";
@@ -435,8 +436,19 @@ async function runInit(config, given, prompts, now = () => /* @__PURE__ */ new D
435
436
  ...designKeys(chosen.resolved, chosen.design),
436
437
  ...workflow === "pg-delta" ? {} : { sql: { workflow } }
437
438
  }), root);
438
- const synced = await syncModules(presetConfig, { "dry-run": args["dry-run"] === true }, plain, now);
439
+ const synced = await syncModules({
440
+ ...presetConfig,
441
+ appTables: {}
442
+ }, { "dry-run": args["dry-run"] === true }, plain, now);
439
443
  lines.push("", synced.output ?? synced.error ?? "");
444
+ const tables = await appTablePlan(presetConfig, "better-supabase init");
445
+ if (tables !== void 0) {
446
+ const wrote = await applyPlan(tables.plan, {
447
+ ...args,
448
+ force: true
449
+ });
450
+ lines.push("", ...changeLines(wrote));
451
+ }
440
452
  const glue = presetGlue(chosen.resolved);
441
453
  const glueLine = glue.length > 0 ? glueCommand(glue) : void 0;
442
454
  const wiring = wiringFor(configInstances(presetConfig));
@@ -1,4 +1,4 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { t as display } from "./io-DH1kcmmP.js";
3
3
  import { m as supabaseDir } from "./supabase-toml-CncmQbO0.js";
4
4
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
@@ -1,6 +1,6 @@
1
1
  import { r as errorText } from "./errors-BTe6A15O.js";
2
- import "./source-2irbWSck.js";
3
- import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-5uqc1GBj.js";
2
+ import "./source-BoLNG_2A.js";
3
+ import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-DV5wIv-7.js";
4
4
  //#region src/cli/doctor/reserved-roles.ts
5
5
  /**
6
6
  * Supautils' `reserved_roles` on Supabase. Nobody but a superuser may alter,
@@ -1,9 +1,9 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
2
- import { a as envelope, i as run } from "./run-ChCQPYOh.js";
3
- import { t as VERSION } from "./version-C5RAWmrD.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
+ import { a as envelope, i as run } from "./run-MwM__teL.js";
3
+ import { t as VERSION } from "./version-D2BQuqta.js";
4
4
  import { n as CliError } from "./errors-BTe6A15O.js";
5
5
  import { n as consentToken } from "./agent-CbuPvI2x.js";
6
- import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, o as boolean, t as PROCESS_ENV, x as object } from "./env-BK0xKMeU.js";
6
+ import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, t as PROCESS_ENV, x as object } from "./env-BK0xKMeU.js";
7
7
  import { createInterface } from "node:readline";
8
8
  import { answerLine } from "better-supabase/mcp";
9
9
  //#region src/cli/mcp/server.ts
@@ -19,7 +19,6 @@ const Input = object({
19
19
  blocks: optional(array(string$1())),
20
20
  text: optional(string$1()),
21
21
  preset: optional(string$1()),
22
- allow_breaking: optional(boolean()),
23
22
  confirm: optional(string$1())
24
23
  });
25
24
  const string = (description) => ({
@@ -97,17 +96,10 @@ const TOOLS = [
97
96
  ]),
98
97
  write("gen", "Regenerates the typed client and every other generated file.", {}, [], () => ["gen"]),
99
98
  write("upgrade", "Writes the upgrade steps of blocks behind their current version, then the SQL files of every block the config lists.", {}, [], () => ["upgrade"]),
100
- write("add_preset", "Applies a preset or Create URL: edits the config and writes the blocks' SQL.", {
101
- preset: PRESET,
102
- allow_breaking: {
103
- type: "boolean",
104
- description: "Write breaking app table changes such as a rename"
105
- }
106
- }, ["preset"], ({ preset, allow_breaking: allowBreaking }) => [
99
+ write("add_preset", "Applies a preset or Create URL: edits the config and writes the blocks' SQL.", { preset: PRESET }, ["preset"], ({ preset }) => [
107
100
  "add",
108
101
  "--preset",
109
- preset ?? "",
110
- ...allowBreaking === true ? ["--allow-breaking"] : []
102
+ preset ?? ""
111
103
  ]),
112
104
  write("add", "Adds blocks with the blocks they require.", { blocks: {
113
105
  type: "array",
@@ -1,8 +1,8 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { i as readStdin } from "./io-DH1kcmmP.js";
3
- import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-DdAP7LWO.js";
4
- import { c as metaPaths, n as render } from "./render-DUNJ4Pss.js";
5
- import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-Cl9COGuy.js";
3
+ import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-B5LXkVMC.js";
4
+ import { c as metaPaths, n as render } from "./render-CizUf3RW.js";
5
+ import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-ChOY6s4o.js";
6
6
  import { basename, join, relative, resolve, sep } from "node:path";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import { jsonSchema, standardSchema, valibot, zod } from "better-supabase/config";
@@ -0,0 +1,46 @@
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
+ import { i as plain } from "./style-Bm2X5JrN.js";
3
+ import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
4
+ import { t as appTablePlan } from "./app-table-files-CiGuwLkO.js";
5
+ //#region src/cli/commands/migrate.ts
6
+ const MIGRATE_ARGS = {};
7
+ /**
8
+ * Writes the tables that `appTables` renders as files you own under
9
+ * `supabase/schemas` (ADR 0102), with the config's per-table features as `@bsb`
10
+ * tags in each table's comment. It reads a config that still has `tables` (the
11
+ * loader accepts it for this command only), so run `upgrade` after removing
12
+ * it.
13
+ */
14
+ async function runMigrateSchemaFirst(config, args, deps = {}) {
15
+ const built = await appTablePlan(config, "better-supabase migrate schema-first");
16
+ if (built === void 0) return {
17
+ code: 0,
18
+ output: "The config has no app tables; there are no tables to move.",
19
+ data: {
20
+ tables: [],
21
+ files: []
22
+ }
23
+ };
24
+ const { plan, tables, files } = built;
25
+ const applied = await applyPlan(plan, args, deps.paint ?? plain);
26
+ const summary = applied.mode === "write" && applied.drift ? `Wrote ${String(files.length)} files for ${String(tables.length)} tables. Delete \`tables\` from the config and rename \`records\` to \`subjects\`, run \`better-supabase upgrade\` to remove the old app tables file, then \`better-supabase db diff\` to check that the schema is unchanged.` : void 0;
27
+ return planResult(plan, applied, {
28
+ data: {
29
+ tables,
30
+ files
31
+ },
32
+ ...summary === void 0 ? {} : { summary }
33
+ });
34
+ }
35
+ const migrateSchemaFirstCommand = defineCliCommand({
36
+ meta: commandMeta("migrate schema-first"),
37
+ readsLegacyTables: true,
38
+ args: {
39
+ ...MIGRATE_ARGS,
40
+ "dry-run": PLAN_ARGS["dry-run"],
41
+ check: PLAN_ARGS.check
42
+ },
43
+ run: (args, { config, paint }) => runMigrateSchemaFirst(config, args, { paint })
44
+ });
45
+ //#endregion
46
+ export { migrateSchemaFirstCommand };
@@ -1,5 +1,5 @@
1
- import { f as INTEGRATIONS } from "./config-KvV-sLZL.js";
2
- import { c as splitStatements } from "./shared-5uqc1GBj.js";
1
+ import { f as INTEGRATIONS } from "./config-Cskysxp-.js";
2
+ import { c as splitStatements } from "./shared-DV5wIv-7.js";
3
3
  import { dirname, join, posix } from "node:path";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { INTEGRATION_INFO, groupEntries } from "better-supabase/config";
@@ -1,7 +1,7 @@
1
- import { r as layoutFor } from "./providers-CpaISitn.js";
1
+ import { r as layoutFor } from "./providers-dyxcHQY3.js";
2
2
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
4
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-DYKkQw1k.js";
4
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
5
5
  import { resolve } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  import { moduleSchemaExtensions, renderBlocks } from "better-supabase/sql";
@@ -1,7 +1,7 @@
1
1
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
2
2
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
3
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-DYKkQw1k.js";
4
- import { i as stampAfter } from "./migrations-DWh38tO9.js";
3
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
4
+ import { i as stampAfter } from "./migrations-BCq7Zs2E.js";
5
5
  import { resolve } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  import { moduleSchemaExtensions } from "better-supabase/sql";
@@ -1,5 +1,5 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { s as positionalIndex } from "./parse-BWM6IGhF.js";
2
+ import { s as positionalIndex } from "./parse-BPf3kGnc.js";
3
3
  //#region src/cli/core/moved.ts
4
4
  const API_REPLACEMENT = "defineApi includes every table and block instance, and createOrpc(betterSupabase).router(api) serves it: https://bettersupabase.com/docs/frameworks/orpc#serve-the-api";
5
5
  /** Commands removed in 0.15, with what replaces them, longest path first. */
@@ -1,5 +1,5 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-kJ_i4yPo.js";
2
- import { t as GLOBAL_ARGS } from "./command-CVzTJSLp.js";
2
+ import { t as GLOBAL_ARGS } from "./command-DIPmo0wh.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  //#region src/cli/core/parse.ts
5
5
  /**
@@ -1,8 +1,8 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
2
- import { r as layoutFor } from "./providers-CpaISitn.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
+ import { r as layoutFor } from "./providers-dyxcHQY3.js";
3
3
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
4
- import { n as migrationsDir } from "./sql-layout-DYKkQw1k.js";
5
- import { i as stampAfter } from "./migrations-DWh38tO9.js";
4
+ import { n as migrationsDir } from "./sql-layout-zo02f3Dm.js";
5
+ import { i as stampAfter } from "./migrations-BCq7Zs2E.js";
6
6
  import { existsSync } from "node:fs";
7
7
  import { join, resolve } from "node:path";
8
8
  import { readFile, readdir } from "node:fs/promises";
@@ -0,0 +1 @@
1
+ export { t as powersyncStreamsCommand } from "./powersync-B15CfH5Y.js";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { n as layout } from "./providers-CpaISitn.js";
3
- import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-CXfRJIV4.js";
2
+ import { n as layout } from "./providers-dyxcHQY3.js";
3
+ import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-lbeUrsYv.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { resolve } from "node:path";
6
6
  import { SQL_MODULES, contractSignature, customContracts, moduleBody, moduleFilePaths } from "better-supabase/sql";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
2
  import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
3
- import { i as schemasDirOf, r as moduleLayoutFor } from "./sql-layout-DYKkQw1k.js";
3
+ import { i as schemasDirOf, r as moduleLayoutFor } from "./sql-layout-zo02f3Dm.js";
4
4
  import { resolve } from "node:path";
5
5
  import { MODULE_ID_TYPES, compileReadSets, moduleIdType, moduleLayout, modulePermissionKeys, resolveBlocks, scopeProblems, templateFunctions } from "better-supabase/sql";
6
6
  import { isReadSet } from "better-supabase";
@@ -1,17 +1,17 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
5
- import { r as layoutFor } from "./providers-CpaISitn.js";
5
+ import { r as layoutFor } from "./providers-dyxcHQY3.js";
6
6
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-CX71yBm8.js";
7
- import { a as sqlPlan } from "./sql-layout-DYKkQw1k.js";
8
- import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-DUyg9qna.js";
7
+ import { a as sqlPlan } from "./sql-layout-zo02f3Dm.js";
8
+ import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-D4w-Axib.js";
9
9
  import { t as detectProject } from "./detect-D9JaAX20.js";
10
10
  import { _ as wiringBlocks, a as configObject, c as mask, i as closingIndex, l as properties } from "./config-edit-CrWfk8s3.js";
11
- import { n as guardedRemoval } from "./sync-DnSOrQuA.js";
11
+ import { n as guardedRemoval } from "./sync-m-oZ_SyI.js";
12
12
  import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
13
- import { t as blockNames } from "./blocks-k1OG8XDs.js";
14
- import { i as tidyInline, t as cutRange } from "./config-group-C8tjut39.js";
13
+ import { t as blockNames } from "./blocks-jRL9K1R8.js";
14
+ import { i as tidyInline, t as cutRange } from "./config-group-CP-B9uRt.js";
15
15
  import { existsSync } from "node:fs";
16
16
  import { resolve } from "node:path";
17
17
  import { readFile } from "node:fs/promises";
@@ -1,11 +1,11 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { n as importPath } from "./io-DH1kcmmP.js";
3
- import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-Czfw7Iow.js";
3
+ import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-BuoIFlUJ.js";
4
4
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
5
- import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-DdAP7LWO.js";
5
+ import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-B5LXkVMC.js";
6
6
  import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
7
- import { a as toCatalog } from "./source-2irbWSck.js";
8
- import { m as withTableTags } from "./config-KvV-sLZL.js";
7
+ import { a as toCatalog } from "./source-BoLNG_2A.js";
8
+ import { m as withTableTags } from "./config-Cskysxp-.js";
9
9
  import { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
10
10
  import { entityNames } from "better-supabase/blocks";
11
11
  import { DEFAULT_CLAIMS, blockEntities, blockEntityRenames, blockSubjectTypes, tenantClaimPaths, tenantNameOf } from "better-supabase/config";
@@ -1477,7 +1477,7 @@ function emitModule(model, options) {
1477
1477
  if (extended) lines.push("/** The installed blocks' repository extensions; `defineSupabase` installs them. */", `type Extensions = readonly [${calls.map(({ fn }) => `ReturnType<typeof ${fn}>`).join(", ")}];`, `const extensions: Extensions = [${calls.map(({ call }) => call).join(", ")}];`, "");
1478
1478
  const subjectType = subjects.length > 0 ? "SubjectType" : "string";
1479
1479
  const schemaLine = extended ? `export const schema: Schema<Models, Database, Functions, ${subjectType}, ExtensionsOf<Extensions>> = defineSchema(meta, extensions);` : `export const schema: Schema<Models, Database, Functions${subjects.length > 0 ? ", SubjectType" : ""}> = defineSchema(meta);`;
1480
- if (subjects.length > 0) lines.push("/** The app's subject types, from `config.records`. */", `export const subjectTypes = [${subjects.map(q).join(", ")}] as const;`, "export type SubjectType = (typeof subjectTypes)[number];", "/** One subject: its type and its id as text. */", "export type RecordRef<T extends SubjectType = SubjectType> = { readonly type: T; readonly id: string };", "");
1480
+ if (subjects.length > 0) lines.push("/** The app's subject types, from `config.subjects`. */", `export const subjectTypes = [${subjects.map(q).join(", ")}] as const;`, "export type SubjectType = (typeof subjectTypes)[number];", "/** One subject: its type and its id as text. */", "export type RecordRef<T extends SubjectType = SubjectType> = { readonly type: T; readonly id: string };", "");
1481
1481
  lines.push(schemaLine, "");
1482
1482
  return lines.join("\n");
1483
1483
  }
@@ -1,9 +1,9 @@
1
- import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
1
+ import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { t as PROCESS_ENV } from "./env-BK0xKMeU.js";
4
4
  import { n as spawnInherited } from "./exec-Ca5s-ygi.js";
5
- import { i as staleVariables } from "./stack-env-6hS-WEmh.js";
6
- import { i as readStackEnv } from "./env-DEAtgGoj.js";
5
+ import { a as staleVariables } from "./stack-env-3ziggrU3.js";
6
+ import { i as readStackEnv } from "./env-B2CbnbzD.js";
7
7
  //#region src/cli/commands/run.ts
8
8
  const ARGS = {
9
9
  prefix: {