better-supabase 0.31.0 → 0.32.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 (1687) hide show
  1. package/dist/access-sql-Dao1C0fz.js +383 -0
  2. package/dist/actor-B5b0i1Fs.js +149 -0
  3. package/dist/actor-DseNR02I.d.ts +104 -0
  4. package/dist/adapter-CPPN80mx.js +2231 -0
  5. package/dist/agents-BEiBtYmh.d.ts +115 -0
  6. package/dist/ai-cache-D9D36eh4.js +86 -0
  7. package/dist/ai-cache-FMYzw7lW.d.ts +80 -0
  8. package/dist/ai-chat-B_P--Ie2.d.ts +532 -0
  9. package/dist/ai-files-DCMVGSds.js +337 -0
  10. package/dist/ai-message-cnroprVB.js +13 -0
  11. package/dist/ai-schedules-D_q1iclL.d.ts +164 -0
  12. package/dist/ai-sdk/agents/index.d.ts +8 -12
  13. package/dist/ai-sdk/agents/index.js +10 -12
  14. package/dist/ai-sdk/batches/index.d.ts +12 -7
  15. package/dist/ai-sdk/batches/index.js +16 -9
  16. package/dist/ai-sdk/cache/index.d.ts +2 -4
  17. package/dist/ai-sdk/cache/index.js +3 -4
  18. package/dist/ai-sdk/chat/index.d.ts +77 -2
  19. package/dist/ai-sdk/chat/index.js +179 -28
  20. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  21. package/dist/ai-sdk/embeddings/index.js +1 -1
  22. package/dist/ai-sdk/files/index.d.ts +3 -5
  23. package/dist/ai-sdk/files/index.js +5 -6
  24. package/dist/ai-sdk/index.d.ts +75 -21
  25. package/dist/ai-sdk/index.js +112 -66
  26. package/dist/ai-sdk/mcp/index.d.ts +28 -13
  27. package/dist/ai-sdk/mcp/index.js +56 -17
  28. package/dist/ai-sdk/memory/index.d.ts +3 -5
  29. package/dist/ai-sdk/memory/index.js +3 -4
  30. package/dist/ai-sdk/react/index.d.ts +2 -2
  31. package/dist/ai-sdk/react/index.js +3 -1
  32. package/dist/ai-sdk/react/server.d.ts +7 -4
  33. package/dist/ai-sdk/react/server.js +10 -3
  34. package/dist/ai-sdk/workflow/index.d.ts +12 -13
  35. package/dist/ai-sdk/workflow/index.js +17 -17
  36. package/dist/ai-sdk/workflow/react/index.d.ts +1 -3
  37. package/dist/ai-sdk/workflow/react/index.js +3 -3
  38. package/dist/ai-sdk/workflow/react/server.d.ts +1 -3
  39. package/dist/ai-sdk/workflow/react/server.js +1 -2
  40. package/dist/anchors-sCLvYj-8.d.ts +36 -0
  41. package/dist/api-CwzVbbw4.d.ts +483 -0
  42. package/dist/api-keys-u2sXB-CZ.d.ts +211 -0
  43. package/dist/api-wwix_K5c.js +691 -0
  44. package/dist/app-tables-DomvYx5b.d.ts +26 -0
  45. package/dist/approvals-Da4uAANx.js +166 -0
  46. package/dist/approvals-idpuhILk.d.ts +127 -0
  47. package/dist/assistant-CMKsaeJd.d.ts +209 -0
  48. package/dist/astro/index.d.ts +8 -10
  49. package/dist/astro/index.js +8 -9
  50. package/dist/attachments-BWtUQgsL.js +375 -0
  51. package/dist/attributes-BZNkR2z2.js +51 -0
  52. package/dist/auth-link-BmJsQG4a.js +117 -0
  53. package/dist/auth-link-DRjtI1Ky.d.ts +102 -0
  54. package/dist/auth-module-CVo86UKh.js +50 -0
  55. package/dist/auth-reply-BMPJQssh.d.ts +9 -0
  56. package/dist/auth-reply-Cnwn3I_q.js +30 -0
  57. package/dist/auth-wFlGgwTZ.js +19 -0
  58. package/dist/authorization-CYu_UKX4.d.ts +3723 -0
  59. package/dist/authorization-hooks-CldgvzBZ.d.ts +219 -0
  60. package/dist/authorizer-AswD5q6g.d.ts +116 -0
  61. package/dist/authorizer-D6po_XZA.js +171 -0
  62. package/dist/automation-acq3iK9y.js +74 -0
  63. package/dist/automations-BfH8GJqv.js +27 -0
  64. package/dist/automations-Bw5cX7oj.js +29 -0
  65. package/dist/automations-CCc5RUw-.js +31 -0
  66. package/dist/automations-Dou1t3lt.js +313 -0
  67. package/dist/availability-CebEOfMN.d.ts +236 -0
  68. package/dist/base64-CVyKHBBw.js +41 -0
  69. package/dist/batch-limit-DqQ3d6op.js +4 -0
  70. package/dist/before-route-Ra3OhI2x.js +29 -0
  71. package/dist/better-result/index.d.ts +4 -6
  72. package/dist/better-result/index.js +2 -3
  73. package/dist/bind-8LYVJE5W.d.ts +102 -0
  74. package/dist/block-authors-C5z3tGVu.d.ts +10 -0
  75. package/dist/block-authors-DCQ4zl8e.js +13 -0
  76. package/dist/block-env-BsLgZL2l.d.ts +30 -0
  77. package/dist/block-event-listener-DCi7c89M.js +15 -0
  78. package/dist/block-events-Bp6GPIBN.js +82 -0
  79. package/dist/block-fields-Bjcv6_zc.js +139 -0
  80. package/dist/block-fields-Puv5m5D3.d.ts +56 -0
  81. package/dist/block-helpers-I7UzjNEf.js +435 -0
  82. package/dist/block-helpers-JxiD1iw4.d.ts +56 -0
  83. package/dist/block-hooks-CJP5kGEa.d.ts +115 -0
  84. package/dist/block-hooks-CadxQ9-_.js +129 -0
  85. package/dist/block-method-DIbWG4Mj.js +20 -0
  86. package/dist/block-method-QSaPsL2P.d.ts +12 -0
  87. package/dist/block-subjects-SyJwfgrX.d.ts +4 -0
  88. package/dist/block-subjects-cRlVtKDO.js +54 -0
  89. package/dist/block-tenant-Bun03JuO.js +13 -0
  90. package/dist/block-transport-Bbf1ZZre.d.ts +67 -0
  91. package/dist/blocks/access-requests/index.d.ts +9 -15
  92. package/dist/blocks/access-requests/index.js +11 -14
  93. package/dist/blocks/activities/index.d.ts +13 -21
  94. package/dist/blocks/activities/index.js +16 -21
  95. package/dist/blocks/agents/index.d.ts +4 -8
  96. package/dist/blocks/agents/index.js +11 -14
  97. package/dist/blocks/ai-cache/index.d.ts +3 -5
  98. package/dist/blocks/ai-cache/index.js +5 -6
  99. package/dist/blocks/ai-chat/index.d.ts +10 -19
  100. package/dist/blocks/ai-chat/index.js +20 -28
  101. package/dist/blocks/ai-files/index.d.ts +5 -9
  102. package/dist/blocks/ai-files/index.js +5 -6
  103. package/dist/blocks/ai-keys/index.d.ts +4 -10
  104. package/dist/blocks/ai-keys/index.js +14 -18
  105. package/dist/blocks/ai-schedules/index.d.ts +3 -5
  106. package/dist/blocks/ai-schedules/index.js +14 -16
  107. package/dist/blocks/announcements/index.d.ts +12 -20
  108. package/dist/blocks/announcements/index.js +12 -16
  109. package/dist/blocks/api-keys/index.d.ts +8 -16
  110. package/dist/blocks/api-keys/index.js +17 -22
  111. package/dist/blocks/approvals/index.d.ts +4 -8
  112. package/dist/blocks/approvals/index.js +7 -173
  113. package/dist/blocks/assets/index.d.ts +9 -17
  114. package/dist/blocks/assets/index.js +13 -17
  115. package/dist/blocks/assignment/index.d.ts +9 -17
  116. package/dist/blocks/assignment/index.js +10 -14
  117. package/dist/blocks/attachments/index.d.ts +6 -18
  118. package/dist/blocks/attachments/index.js +19 -24
  119. package/dist/blocks/audit/index.d.ts +15 -31
  120. package/dist/blocks/audit/index.js +27 -35
  121. package/dist/blocks/automations/index.d.ts +14 -26
  122. package/dist/blocks/automations/index.js +18 -23
  123. package/dist/blocks/billable-time/index.d.ts +9 -19
  124. package/dist/blocks/billable-time/index.js +15 -20
  125. package/dist/blocks/billing/index.d.ts +12 -22
  126. package/dist/blocks/billing/index.js +19 -24
  127. package/dist/blocks/bookings/index.d.ts +8 -18
  128. package/dist/blocks/bookings/index.js +17 -23
  129. package/dist/blocks/bulk/index.d.ts +6 -12
  130. package/dist/blocks/bulk/index.js +10 -13
  131. package/dist/blocks/calendar/index.d.ts +13 -23
  132. package/dist/blocks/calendar/index.js +35 -32
  133. package/dist/blocks/catalog/index.d.ts +12 -20
  134. package/dist/blocks/catalog/index.js +17 -21
  135. package/dist/blocks/channels/index.d.ts +9 -17
  136. package/dist/blocks/channels/index.js +11 -15
  137. package/dist/blocks/collections/index.d.ts +11 -17
  138. package/dist/blocks/collections/index.js +13 -16
  139. package/dist/blocks/comments/index.d.ts +16 -26
  140. package/dist/blocks/comments/index.js +21 -26
  141. package/dist/blocks/compliance/index.d.ts +9 -17
  142. package/dist/blocks/compliance/index.js +13 -17
  143. package/dist/blocks/connectors/index.d.ts +4 -8
  144. package/dist/blocks/connectors/index.js +13 -16
  145. package/dist/blocks/contacts/index.d.ts +10 -18
  146. package/dist/blocks/contacts/index.js +12 -16
  147. package/dist/blocks/content/index.d.ts +8 -16
  148. package/dist/blocks/content/index.js +13 -17
  149. package/dist/blocks/contracts/index.d.ts +11 -21
  150. package/dist/blocks/contracts/index.js +17 -22
  151. package/dist/blocks/courses/index.d.ts +11 -21
  152. package/dist/blocks/courses/index.js +17 -22
  153. package/dist/blocks/created-by/index.d.ts +3 -7
  154. package/dist/blocks/created-by/index.js +4 -5
  155. package/dist/blocks/custom-fields/index.d.ts +10 -16
  156. package/dist/blocks/custom-fields/index.js +13 -16
  157. package/dist/blocks/data-lifecycle/index.d.ts +10 -26
  158. package/dist/blocks/data-lifecycle/index.js +17 -23
  159. package/dist/blocks/deals/index.d.ts +12 -20
  160. package/dist/blocks/deals/index.js +18 -22
  161. package/dist/blocks/dispatch/index.d.ts +11 -23
  162. package/dist/blocks/dispatch/index.js +19 -24
  163. package/dist/blocks/documents/index.d.ts +4 -8
  164. package/dist/blocks/documents/index.js +9 -12
  165. package/dist/blocks/domains/index.d.ts +8 -14
  166. package/dist/blocks/domains/index.js +12 -15
  167. package/dist/blocks/donations/index.d.ts +13 -23
  168. package/dist/blocks/donations/index.js +21 -26
  169. package/dist/blocks/drive/index.d.ts +116 -20
  170. package/dist/blocks/drive/index.js +138 -26
  171. package/dist/blocks/employees/index.d.ts +13 -23
  172. package/dist/blocks/employees/index.js +18 -23
  173. package/dist/blocks/enrichment/index.d.ts +8 -16
  174. package/dist/blocks/enrichment/index.js +11 -15
  175. package/dist/blocks/enrollments/index.d.ts +9 -17
  176. package/dist/blocks/enrollments/index.js +13 -17
  177. package/dist/blocks/entitlements/index.d.ts +8 -14
  178. package/dist/blocks/entitlements/index.js +8 -11
  179. package/dist/blocks/expenses/index.d.ts +22 -19
  180. package/dist/blocks/expenses/index.js +25 -23
  181. package/dist/blocks/field-history/index.d.ts +6 -10
  182. package/dist/blocks/field-history/index.js +5 -7
  183. package/dist/blocks/flags/index.d.ts +49 -20
  184. package/dist/blocks/flags/index.js +65 -19
  185. package/dist/blocks/forecasts/index.d.ts +10 -16
  186. package/dist/blocks/forecasts/index.js +11 -14
  187. package/dist/blocks/forms/index.d.ts +11 -25
  188. package/dist/blocks/forms/index.js +17 -24
  189. package/dist/blocks/goals/index.d.ts +8 -12
  190. package/dist/blocks/goals/index.js +9 -11
  191. package/dist/blocks/guests/index.d.ts +9 -19
  192. package/dist/blocks/guests/index.js +14 -19
  193. package/dist/blocks/hiring/index.d.ts +10 -18
  194. package/dist/blocks/hiring/index.js +12 -15
  195. package/dist/blocks/identities/index.d.ts +7 -11
  196. package/dist/blocks/identities/index.js +7 -9
  197. package/dist/blocks/imports/index.d.ts +8 -18
  198. package/dist/blocks/imports/index.js +11 -16
  199. package/dist/blocks/inbox/index.d.ts +11 -21
  200. package/dist/blocks/inbox/index.js +26 -23
  201. package/dist/blocks/incidents/index.d.ts +9 -17
  202. package/dist/blocks/incidents/index.js +14 -18
  203. package/dist/blocks/index.d.ts +14 -20
  204. package/dist/blocks/index.js +17 -20
  205. package/dist/blocks/inventory/index.d.ts +11 -17
  206. package/dist/blocks/inventory/index.js +12 -15
  207. package/dist/blocks/invoices/index.d.ts +34 -21
  208. package/dist/blocks/invoices/index.js +31 -18
  209. package/dist/blocks/knowledge/index.d.ts +3 -5
  210. package/dist/blocks/knowledge/index.js +5 -6
  211. package/dist/blocks/lead-scoring/index.d.ts +10 -14
  212. package/dist/blocks/lead-scoring/index.js +11 -13
  213. package/dist/blocks/leases/index.d.ts +11 -21
  214. package/dist/blocks/leases/index.js +20 -25
  215. package/dist/blocks/leave/index.d.ts +50 -17
  216. package/dist/blocks/leave/index.js +35 -14
  217. package/dist/blocks/ledger/index.d.ts +9 -17
  218. package/dist/blocks/ledger/index.js +13 -17
  219. package/dist/blocks/mail-sync/index.d.ts +6 -12
  220. package/dist/blocks/mail-sync/index.js +26 -25
  221. package/dist/blocks/memberships/index.d.ts +5 -9
  222. package/dist/blocks/memberships/index.js +4 -5
  223. package/dist/blocks/memory/index.d.ts +4 -8
  224. package/dist/blocks/memory/index.js +12 -15
  225. package/dist/blocks/messaging/index.d.ts +14 -24
  226. package/dist/blocks/messaging/index.js +19 -24
  227. package/dist/blocks/metrics/index.d.ts +9 -17
  228. package/dist/blocks/metrics/index.js +14 -18
  229. package/dist/blocks/mfa/index.d.ts +5 -9
  230. package/dist/blocks/mfa/index.js +7 -9
  231. package/dist/blocks/moderation/index.d.ts +9 -17
  232. package/dist/blocks/moderation/index.js +13 -17
  233. package/dist/blocks/notifications/index.d.ts +18 -34
  234. package/dist/blocks/notifications/index.js +32 -42
  235. package/dist/blocks/numbering/index.d.ts +6 -12
  236. package/dist/blocks/numbering/index.js +8 -11
  237. package/dist/blocks/oauth-server/index.d.ts +7 -13
  238. package/dist/blocks/oauth-server/index.js +12 -15
  239. package/dist/blocks/onboarding/index.d.ts +7 -13
  240. package/dist/blocks/onboarding/index.js +8 -11
  241. package/dist/blocks/orders/index.d.ts +17 -29
  242. package/dist/blocks/orders/index.js +22 -28
  243. package/dist/blocks/organizations/index.d.ts +11 -21
  244. package/dist/blocks/organizations/index.js +16 -19
  245. package/dist/blocks/outbox/index.d.ts +4 -6
  246. package/dist/blocks/outbox/index.js +11 -13
  247. package/dist/blocks/passes/index.d.ts +12 -22
  248. package/dist/blocks/passes/index.js +20 -25
  249. package/dist/blocks/permissions/index.d.ts +45 -15
  250. package/dist/blocks/permissions/index.js +99 -19
  251. package/dist/blocks/pipelines/index.d.ts +12 -18
  252. package/dist/blocks/pipelines/index.js +12 -15
  253. package/dist/blocks/posts/index.d.ts +10 -18
  254. package/dist/blocks/posts/index.js +15 -19
  255. package/dist/blocks/profiles/index.d.ts +8 -12
  256. package/dist/blocks/profiles/index.js +9 -11
  257. package/dist/blocks/promotions/index.d.ts +11 -17
  258. package/dist/blocks/promotions/index.js +13 -16
  259. package/dist/blocks/push/index.d.ts +12 -18
  260. package/dist/blocks/push/index.js +13 -16
  261. package/dist/blocks/queue/index.d.ts +187 -39
  262. package/dist/blocks/queue/index.js +226 -60
  263. package/dist/blocks/quotes/index.d.ts +13 -21
  264. package/dist/blocks/quotes/index.js +14 -17
  265. package/dist/blocks/rank/index.d.ts +7 -13
  266. package/dist/blocks/rank/index.js +8 -10
  267. package/dist/blocks/reactions/index.d.ts +11 -19
  268. package/dist/blocks/reactions/index.js +13 -17
  269. package/dist/blocks/relations/index.d.ts +11 -21
  270. package/dist/blocks/relations/index.js +18 -23
  271. package/dist/blocks/reminders/index.d.ts +12 -22
  272. package/dist/blocks/reminders/index.js +21 -25
  273. package/dist/blocks/reviews/index.d.ts +9 -15
  274. package/dist/blocks/reviews/index.js +11 -14
  275. package/dist/blocks/saved-views/index.d.ts +11 -21
  276. package/dist/blocks/saved-views/index.js +16 -21
  277. package/dist/blocks/scores/index.d.ts +6 -12
  278. package/dist/blocks/scores/index.js +10 -13
  279. package/dist/blocks/search/index.d.ts +9 -19
  280. package/dist/blocks/search/index.js +15 -19
  281. package/dist/blocks/security-events/index.d.ts +10 -24
  282. package/dist/blocks/security-events/index.js +17 -23
  283. package/dist/blocks/segments/index.d.ts +10 -18
  284. package/dist/blocks/segments/index.js +11 -15
  285. package/dist/blocks/sequences/index.d.ts +9 -17
  286. package/dist/blocks/sequences/index.js +15 -19
  287. package/dist/blocks/service-accounts/index.d.ts +9 -15
  288. package/dist/blocks/service-accounts/index.js +11 -14
  289. package/dist/blocks/sessions/index.d.ts +4 -8
  290. package/dist/blocks/sessions/index.js +9 -11
  291. package/dist/blocks/settings/index.d.ts +8 -16
  292. package/dist/blocks/settings/index.js +14 -18
  293. package/dist/blocks/share-links/index.d.ts +9 -17
  294. package/dist/blocks/share-links/index.js +16 -20
  295. package/dist/blocks/shipments/index.d.ts +14 -24
  296. package/dist/blocks/shipments/index.js +25 -31
  297. package/dist/blocks/signatures/index.d.ts +10 -16
  298. package/dist/blocks/signatures/index.js +10 -13
  299. package/dist/blocks/signing-keys/index.d.ts +5 -9
  300. package/dist/blocks/signing-keys/index.js +8 -10
  301. package/dist/blocks/sla/index.d.ts +11 -19
  302. package/dist/blocks/sla/index.js +17 -21
  303. package/dist/blocks/sso/index.d.ts +7 -19
  304. package/dist/blocks/sso/index.js +14 -21
  305. package/dist/blocks/state-machine/index.d.ts +7 -13
  306. package/dist/blocks/state-machine/index.js +9 -12
  307. package/dist/blocks/subjects/index.d.ts +7 -11
  308. package/dist/blocks/subjects/index.js +12 -14
  309. package/dist/blocks/tags/index.d.ts +11 -21
  310. package/dist/blocks/tags/index.js +20 -25
  311. package/dist/blocks/tasks/index.d.ts +13 -27
  312. package/dist/blocks/tasks/index.js +22 -29
  313. package/dist/blocks/teams/index.d.ts +8 -14
  314. package/dist/blocks/teams/index.js +10 -13
  315. package/dist/blocks/templates/index.d.ts +12 -22
  316. package/dist/blocks/templates/index.js +16 -21
  317. package/dist/blocks/time-tracking/index.d.ts +31 -25
  318. package/dist/blocks/time-tracking/index.js +29 -29
  319. package/dist/blocks/timeline/index.d.ts +10 -14
  320. package/dist/blocks/timeline/index.js +11 -13
  321. package/dist/blocks/trash/index.d.ts +10 -18
  322. package/dist/blocks/trash/index.js +11 -14
  323. package/dist/blocks/undo/index.d.ts +4 -8
  324. package/dist/blocks/undo/index.js +6 -8
  325. package/dist/blocks/updated-at/index.d.ts +3 -7
  326. package/dist/blocks/updated-at/index.js +4 -5
  327. package/dist/blocks/usage/index.d.ts +6 -10
  328. package/dist/blocks/usage/index.js +10 -13
  329. package/dist/blocks/vercel-marketplace/index.d.ts +9 -17
  330. package/dist/blocks/vercel-marketplace/index.js +17 -21
  331. package/dist/blocks/versions/index.d.ts +10 -20
  332. package/dist/blocks/versions/index.js +17 -22
  333. package/dist/blocks/waitlist/index.d.ts +10 -16
  334. package/dist/blocks/waitlist/index.js +11 -14
  335. package/dist/blocks/webhooks/index.d.ts +16 -34
  336. package/dist/blocks/webhooks/index.js +33 -44
  337. package/dist/blocks/workflow-editor/index.d.ts +13 -21
  338. package/dist/blocks/workflow-editor/index.js +21 -27
  339. package/dist/blocks/workflows/index.d.ts +8 -14
  340. package/dist/blocks/workflows/index.js +14 -18
  341. package/dist/bookings-DG443336.d.ts +285 -0
  342. package/dist/bucket-Clq5xINQ.d.ts +693 -0
  343. package/dist/build-Ckxct2EX.js +2065 -0
  344. package/dist/build-D1-V9dd8.js +732 -0
  345. package/dist/carrier-D2b_028L.d.ts +165 -0
  346. package/dist/casing-DQzG9ANZ.js +15 -0
  347. package/dist/channel-B_kufDZy.d.ts +101 -0
  348. package/dist/channels-BxeTTtCY.js +113 -0
  349. package/dist/chat-sdk/index.d.ts +174 -41
  350. package/dist/chat-sdk/index.js +425 -83
  351. package/dist/claims-DRmafYVK.js +90 -0
  352. package/dist/claims-DouHL7ZL.js +62 -0
  353. package/dist/cli/_format-Ba0DoWjl.js +99 -0
  354. package/dist/cli/add-ChoHyBhz.js +1222 -0
  355. package/dist/cli/add-DlYL-1mF.js +1 -0
  356. package/dist/cli/add-fzRPyIED.js +98 -0
  357. package/dist/cli/agent-59XWXsRi.js +184 -0
  358. package/dist/cli/app-table-files-C0OtdUVu.js +343 -0
  359. package/dist/cli/arazzo-1.0-D3OaSeZw.js +531 -0
  360. package/dist/cli/arazzo-1.1-DaT2KAkP.js +704 -0
  361. package/dist/cli/args-_ZVgRBkx.js +26 -0
  362. package/dist/cli/asyncapi-3.0.0-Ca-UwtUW.js +5592 -0
  363. package/dist/cli/asyncapi-3.1.0-DUxf5zNu.js +5832 -0
  364. package/dist/cli/backfill-Dq2XMXf9.js +292 -0
  365. package/dist/cli/bin.js +5 -5
  366. package/dist/cli/blocks-CCzp0eAH.js +155 -0
  367. package/dist/cli/blocks-DVhJOzFj.js +1 -0
  368. package/dist/cli/cache-CoC-1i1O.js +643 -0
  369. package/dist/cli/codemod-block-renames-Dt3X1Wvg.js +238 -0
  370. package/dist/cli/codemod-pyf6HmS9.js +2883 -0
  371. package/dist/cli/command-BpZ4AuhR.js +1021 -0
  372. package/dist/cli/compare-yl4sSwVn.js +8 -0
  373. package/dist/cli/completion-B08Q0xB3.js +29 -0
  374. package/dist/cli/completion-CwL7e93t.js +210 -0
  375. package/dist/cli/completion-DHTT6rjI.js +1 -0
  376. package/dist/cli/config-D-Upz3jV.js +46 -0
  377. package/dist/cli/config-D0m2rQqk.js +1 -0
  378. package/dist/cli/config-Dyl3iX3u.js +2029 -0
  379. package/dist/cli/config-edit-C6sQ1MqT.js +619 -0
  380. package/dist/cli/config-group-D4JWh4kG.js +388 -0
  381. package/dist/cli/content-mapper-ChSVT9Tq.js +181 -0
  382. package/dist/cli/db-B8zfxjl2.js +77 -0
  383. package/dist/cli/db-dFzhcozO.js +246 -0
  384. package/dist/cli/detect-BcUDaO8I.js +83 -0
  385. package/dist/cli/dist-CYnD1kyT.js +128 -0
  386. package/dist/cli/dist-MKwjiW2w.js +1114 -0
  387. package/dist/cli/doctor-BKZsztFV.js +4647 -0
  388. package/dist/cli/env-BAJn6wCA.js +142 -0
  389. package/dist/cli/env-BCuUsWOh.js +1109 -0
  390. package/dist/cli/env-D70ihdbB.js +1 -0
  391. package/dist/cli/env-UN6PJFX6.js +1 -0
  392. package/dist/cli/errors-DcJ_PayO.js +97 -0
  393. package/dist/cli/exec-CXBufciC.js +461 -0
  394. package/dist/cli/fastest-levenshtein-B_QF6At5.js +119 -0
  395. package/dist/cli/files-DQayErI8.js +999 -0
  396. package/dist/cli/fresh-import-CdO2oQaQ.js +39 -0
  397. package/dist/cli/gen-BN_eh6rE.js +390 -0
  398. package/dist/cli/guards-DxwRG0Uv.js +7 -0
  399. package/dist/cli/in-stack-diff-huI7fGMX.js +185 -0
  400. package/dist/cli/index.d.ts +1 -53
  401. package/dist/cli/index.js +10 -11
  402. package/dist/cli/init-CaDDt8F6.js +556 -0
  403. package/dist/cli/io-CQzy8PEZ.js +36 -0
  404. package/dist/cli/json5-DhsZB2va.js +784 -0
  405. package/dist/cli/jsonc-DU9Clnrz.js +1 -0
  406. package/dist/cli/jsonc-u_UiXFxs.js +43 -0
  407. package/dist/cli/keys-CxajkV_7.js +105 -0
  408. package/dist/cli/legacy-prefix-D8Jfku6I.js +153 -0
  409. package/dist/cli/live-KU41LMGE.js +339 -0
  410. package/dist/cli/mcp-C_m-TpLJ.js +240 -0
  411. package/dist/cli/metadata-Bq4ra7zo.js +149 -0
  412. package/dist/cli/migrate-DHG2Qz_K.js +45 -0
  413. package/dist/cli/migration-safety-STVbiKhz.js +925 -0
  414. package/dist/cli/migrations-O1QZoMiH.js +116 -0
  415. package/dist/cli/module-migration-DB9ntWM-.js +118 -0
  416. package/dist/cli/moved-BAFPdJz_.js +253 -0
  417. package/dist/cli/ohash-imLR_J5Y.js +276 -0
  418. package/dist/cli/openapi-3.0-BJiTNq_x.js +927 -0
  419. package/dist/cli/openapi-3.1-BcWCoii2.js +869 -0
  420. package/dist/cli/openapi-3.2-MXPkeoTk.js +1030 -0
  421. package/dist/cli/orphans-CPcR85QN.js +27 -0
  422. package/dist/cli/parse-BueItuNJ.js +181 -0
  423. package/dist/cli/powersync-CN3QPF2K.js +375 -0
  424. package/dist/cli/powersync-DfeGl5N1.js +1 -0
  425. package/dist/cli/preset-BQnjDCSR.js +100 -0
  426. package/dist/cli/print-DG7TRCi8.js +66 -0
  427. package/dist/cli/prompts-D9b6uf21.js +1133 -0
  428. package/dist/cli/providers-DpfoF3VC.js +298 -0
  429. package/dist/cli/prune-workflows-DcNJUS1m.js +153 -0
  430. package/dist/cli/redact--zOGdWzo.js +37 -0
  431. package/dist/cli/remove-BpfYqP45.js +237 -0
  432. package/dist/cli/render-Q7jnLn_C.js +2213 -0
  433. package/dist/cli/rolldown-runtime-DegdyBIC.js +25 -0
  434. package/dist/cli/run-9NfabanB.js +703 -0
  435. package/dist/cli/run-D6K-qQIX.js +1450 -0
  436. package/dist/cli/run-dY9uOC3W.js +62 -0
  437. package/dist/cli/seed-B4H0Lco9.js +187 -0
  438. package/dist/cli/seed-BIB6-WPa.js +1 -0
  439. package/dist/cli/shared-PrvYREVy.js +150 -0
  440. package/dist/cli/shell-C1U618XA.js +9 -0
  441. package/dist/cli/skills-jZThjL3B.js +120 -0
  442. package/dist/cli/snapshot-UfJsqfys.js +728 -0
  443. package/dist/cli/source-F3YTVvFo.js +317 -0
  444. package/dist/cli/source-args-DJMrW_jW.js +58 -0
  445. package/dist/cli/spec-DsLQuJKp.js +7449 -0
  446. package/dist/cli/spec-HQOBVbEO.js +1 -0
  447. package/dist/cli/sql-layout-CZ66pY8j.js +260 -0
  448. package/dist/cli/stack-147NqctC.js +134 -0
  449. package/dist/cli/stack-env-BQhbUFa7.js +92 -0
  450. package/dist/cli/stack-status-Mxgqb3I4.js +45 -0
  451. package/dist/cli/stacks-C5YL6Un9.js +230 -0
  452. package/dist/cli/style-B5-nByxb.js +34 -0
  453. package/dist/cli/supabase-toml-B6-eEV5p.js +1155 -0
  454. package/dist/cli/sync-B12wbtFd.js +318 -0
  455. package/dist/cli/table-D9FbJS8h.js +88 -0
  456. package/dist/cli/toml-VX0BsvYq.js +422 -0
  457. package/dist/cli/topics-Cdg0V7Tt.js +29 -0
  458. package/dist/cli/trace-D3TNqWBg.js +6 -0
  459. package/dist/cli/upgrade-AgUXFDo6.js +270 -0
  460. package/dist/cli/upgrade-C20z49De.js +40 -0
  461. package/dist/cli/validate-C_WTnX1U.js +7426 -0
  462. package/dist/cli/version-DEUWW8cv.js +3 -0
  463. package/dist/cli/yaml-JsusTbcC.js +2250 -0
  464. package/dist/client/index.d.ts +7 -7
  465. package/dist/client/index.js +9 -12
  466. package/dist/client/native/index.d.ts +7 -23
  467. package/dist/client/native/index.js +15 -22
  468. package/dist/client-BLor58Je.js +290 -0
  469. package/dist/clone-H_gCsL29.js +32 -0
  470. package/dist/cloud-event-CLvsaPqH.js +62 -0
  471. package/dist/cloud-event-bcaMqEbN.d.ts +62 -0
  472. package/dist/codecs-B1VO2BGL.d.ts +220 -0
  473. package/dist/codecs-B9v5Y5HH.js +357 -0
  474. package/dist/commerce/index.d.ts +5 -13
  475. package/dist/commerce/index.js +13 -16
  476. package/dist/compiler-CWishtY2.d.ts +12 -0
  477. package/dist/compose-BRBlPSEY.js +52 -0
  478. package/dist/composite-BZMkWNOQ.js +125 -0
  479. package/dist/composite-ClLWZIwX.d.ts +79 -0
  480. package/dist/config/index.d.ts +6 -6
  481. package/dist/config/index.js +7 -7
  482. package/dist/config-BhExAhNK.js +1102 -0
  483. package/dist/config-MDRA2sre.js +1672 -0
  484. package/dist/connectors-BImAu75R.d.ts +145 -0
  485. package/dist/context-DSevnLrT.js +40 -0
  486. package/dist/context-DcxfrCml.d.ts +4267 -0
  487. package/dist/controller-BJmh7gFm.js +78 -0
  488. package/dist/controller-D_UJBaEU.d.ts +50 -0
  489. package/dist/controller-y1kSMuCU.js +72 -0
  490. package/dist/conversion-7U1WeLxK.d.ts +84 -0
  491. package/dist/conversion-Bj9j3KnG.js +76 -0
  492. package/dist/cookie-DDkqvqe4.d.ts +3 -0
  493. package/dist/cookie-DJI6xXJ9.js +4 -0
  494. package/dist/cors-9SDsndtb.d.ts +13 -0
  495. package/dist/cors-DrDFLMNn.js +23 -0
  496. package/dist/create/index.d.ts +4 -28
  497. package/dist/create/index.js +9 -15
  498. package/dist/create/lite/index.d.ts +5 -25
  499. package/dist/create/lite/index.js +14 -24
  500. package/dist/create/oauth/index.d.ts +1 -1
  501. package/dist/create/oauth/index.js +1 -2
  502. package/dist/create/supabase/index.d.ts +2 -4
  503. package/dist/create/supabase/index.js +3 -6
  504. package/dist/create-blocks-D7q1boXV.js +367 -0
  505. package/dist/credentials/index.d.ts +6 -10
  506. package/dist/credentials/index.js +11 -12
  507. package/dist/cron-BD8VrQQl.js +147 -0
  508. package/dist/cron-route-DSITg1yC.js +23 -0
  509. package/dist/csv-Bwn9insJ.js +88 -0
  510. package/dist/csv-Dd1iKsk-.d.ts +26 -0
  511. package/dist/data-engine-B-D6bdyx.d.ts +269 -0
  512. package/dist/data-engine-BbqQwso_.js +174 -0
  513. package/dist/data-hooks-BToeAcQ_.js +277 -0
  514. package/dist/db-exception-Dv18UZ-I.js +30 -0
  515. package/dist/deal-forecast-CN_BEy9s.d.ts +21 -0
  516. package/dist/deal-forecast-DsVFoMkJ.js +38 -0
  517. package/dist/define-3RbqoF1S.d.ts +1242 -0
  518. package/dist/define-B6D55cO0.js +2073 -0
  519. package/dist/define-block-22Jv4U_-.js +63 -0
  520. package/dist/define-block-B_i9VPcc.d.ts +1669 -0
  521. package/dist/delegation-BRHHXERz.js +152 -0
  522. package/dist/delivery-CWcbh87x.d.ts +69 -0
  523. package/dist/delivery-SmPHu2_H.js +28 -0
  524. package/dist/delivery-events-0mAEuscm.js +52 -0
  525. package/dist/documents-6ov2gWh3.d.ts +150 -0
  526. package/dist/edge/index.d.ts +17 -23
  527. package/dist/edge/index.js +18 -22
  528. package/dist/elysia/index.d.ts +2 -6
  529. package/dist/elysia/index.js +4 -6
  530. package/dist/email-BRm6wMWQ.d.ts +40 -0
  531. package/dist/embeddings--v4BJdUL.js +127 -0
  532. package/dist/embeddings-K0lH--nt.d.ts +76 -0
  533. package/dist/ended-CCoE7XXY.d.ts +22 -0
  534. package/dist/entitlements-XwpuBbKN.d.ts +52 -0
  535. package/dist/entitlements-sLoj3M6Y.js +44 -0
  536. package/dist/entity-naming-BES3pkQI.js +130 -0
  537. package/dist/entity-schema-DEIz0I8i.js +38 -0
  538. package/dist/env/index.d.ts +1 -1
  539. package/dist/env/index.js +1 -2
  540. package/dist/envelope-DAtaFJue.js +89 -0
  541. package/dist/errors-B7tCfCvX.js +327 -0
  542. package/dist/errors-BdjHv5SV.js +43 -0
  543. package/dist/errors-D3-4c-XF.js +102 -0
  544. package/dist/escape-like-CK6L7gkj.d.ts +26 -0
  545. package/dist/escape-like-gxNXs145.js +6 -0
  546. package/dist/eve/index.d.ts +247 -16
  547. package/dist/eve/index.js +334 -26
  548. package/dist/eve-Cf-QRGij.d.ts +213 -0
  549. package/dist/event-calendar-DUtFyRrv.d.ts +63 -0
  550. package/dist/event-map-DxfsFgQT.js +18 -0
  551. package/dist/events/index.d.ts +3 -3
  552. package/dist/events/index.js +7 -8
  553. package/dist/events-BRKIxVQD.js +25 -0
  554. package/dist/events-CfDdOwqg.d.ts +850 -0
  555. package/dist/events-Da482tiF.js +81 -0
  556. package/dist/executor-BDMqPbVU.js +482 -0
  557. package/dist/executor-C0_TT717.js +840 -0
  558. package/dist/executor-CAhykadW.d.ts +168 -0
  559. package/dist/executor-CbDX34I9.d.ts +99 -0
  560. package/dist/executor-Dc4Pl44u.js +207 -0
  561. package/dist/executor-ynEwaUZy.d.ts +35 -0
  562. package/dist/expo/index.d.ts +5 -9
  563. package/dist/expo/index.js +10 -12
  564. package/dist/extension-DQ9-oOVC.js +58 -0
  565. package/dist/extension-LgaDPMJs.js +120 -0
  566. package/dist/extension-WdHd5uqI.js +102 -0
  567. package/dist/extension-rdpYvpyN.js +52 -0
  568. package/dist/extension-shared-DJb_PfD4.js +59 -0
  569. package/dist/extra-Dz9n5y1s.js +9 -0
  570. package/dist/field-errors-tQr-anYL.d.ts +208 -0
  571. package/dist/field-formats-Cap-V7UP.js +101 -0
  572. package/dist/field-formats-DVukMbRa.d.ts +36 -0
  573. package/dist/fields-AKKMirg_.d.ts +76 -0
  574. package/dist/fields-BBcdKD-S.js +107 -0
  575. package/dist/filter-evaluate-Bhq99aEN.d.ts +35 -0
  576. package/dist/filter-evaluate-D_LLfdtE.js +216 -0
  577. package/dist/filter-query-B7A4l2xn.d.ts +131 -0
  578. package/dist/filter-query-Ds7Z6lgZ.js +565 -0
  579. package/dist/flags-B5B4mkZV.d.ts +315 -0
  580. package/dist/flags-D0npSE-5.js +361 -0
  581. package/dist/flags-sdk/index.d.ts +217 -28
  582. package/dist/flags-sdk/index.js +255 -35
  583. package/dist/form-definition-8cCCt5zj.js +362 -0
  584. package/dist/form-definition-BN8shngm.d.ts +117 -0
  585. package/dist/format-BT0Z3V54.d.ts +77 -0
  586. package/dist/framework-B1h-uquj.js +57 -0
  587. package/dist/framework-CyDn_SXR.d.ts +45 -0
  588. package/dist/function-contract-Bf6llTkE.js +7 -0
  589. package/dist/function-contract-DgDBYbXu.d.ts +25 -0
  590. package/dist/gateway-Cg_MgGen.d.ts +120 -0
  591. package/dist/gateway-options-DQGQzdkD.js +26 -0
  592. package/dist/gateway-options-Mut8jih_.d.ts +27 -0
  593. package/dist/guards-CsRa6v57.js +11 -0
  594. package/dist/guest-actions-CEwttioE.js +8 -0
  595. package/dist/guest-actions-DfHHp98H.d.ts +3 -0
  596. package/dist/h3/index.d.ts +2 -6
  597. package/dist/h3/index.js +4 -6
  598. package/dist/h3/v1/index.d.ts +3 -5
  599. package/dist/h3/v1/index.js +4 -5
  600. package/dist/history-6KiVNWdH.js +269 -0
  601. package/dist/hmac-DNcfpmI9.js +22 -0
  602. package/dist/hono/index.d.ts +14 -19
  603. package/dist/hono/index.js +14 -16
  604. package/dist/http-BDC1IvBX.js +27 -0
  605. package/dist/http-BRUI3qim.js +140 -0
  606. package/dist/http-D4lH1xqY.js +39 -0
  607. package/dist/image-url-bsGeybeg.js +83 -0
  608. package/dist/impersonation-BOCJcsmS.d.ts +26 -0
  609. package/dist/impersonation-D-quM36V.js +61 -0
  610. package/dist/inbox-BmSA9K01.d.ts +326 -0
  611. package/dist/index-8w4OB5En.d.ts +102 -0
  612. package/dist/index-B2871MHr.d.ts +234 -0
  613. package/dist/index-B5_J-MaK.d.ts +152 -0
  614. package/dist/index-BWR29Vvw.d.ts +76 -0
  615. package/dist/index-CRrBZtKm.d.ts +326 -0
  616. package/dist/index-CTpEQvIv.d.ts +291 -0
  617. package/dist/index-D2BGCjIz.d.ts +570 -0
  618. package/dist/index-D66_dYVi.d.ts +667 -0
  619. package/dist/index-Dj4VKpYZ.d.ts +49 -0
  620. package/dist/index-DzBFdI9I.d.ts +145 -0
  621. package/dist/index-lazpPVr0.d.ts +402 -0
  622. package/dist/index-xCpjvDVm.d.ts +637 -0
  623. package/dist/index.d.ts +13 -41
  624. package/dist/index.js +29 -34
  625. package/dist/instance-property-BlH7QSDl.js +6 -0
  626. package/dist/instances-D31jrmKh.js +16636 -0
  627. package/dist/invalidate-DAB9CaPm.d.ts +19 -0
  628. package/dist/iso4217-oKsif_hW.js +175 -0
  629. package/dist/json-O5vFw243.js +21 -0
  630. package/dist/json-schema-D9eVL_xi.js +884 -0
  631. package/dist/jwks-cache-IZaiICAV.js +48 -0
  632. package/dist/jws-B8p0ppgh.js +204 -0
  633. package/dist/jws-CxgTsbgG.d.ts +64 -0
  634. package/dist/kit-CJKo0soh.d.ts +92 -0
  635. package/dist/kit-CVZDd1X9.js +132 -0
  636. package/dist/knowledge-BUwbpS8I.d.ts +215 -0
  637. package/dist/knowledge-DdZzUTQ-.js +299 -0
  638. package/dist/lint/index.d.ts +1 -5
  639. package/dist/lint/index.js +8 -10
  640. package/dist/list/index.d.ts +3 -3
  641. package/dist/list/index.js +3 -3
  642. package/dist/list-query-CZ-K5aHX.d.ts +220 -0
  643. package/dist/list-query-D-tgs1eY.js +558 -0
  644. package/dist/live-BVi3q4bX.js +277 -0
  645. package/dist/logger-0LfhvwE4.d.ts +16 -0
  646. package/dist/logger-BkF8ukXV.js +20 -0
  647. package/dist/lookup-upE-e1zw.js +17 -0
  648. package/dist/management-DtX4ic1F.d.ts +55 -0
  649. package/dist/mapper/bin.js +13 -17
  650. package/dist/mcp/index.d.ts +8 -18
  651. package/dist/mcp/index.js +24 -29
  652. package/dist/mcp/sdk/index.d.ts +7 -11
  653. package/dist/mcp/sdk/index.js +12 -14
  654. package/dist/message-Cc4bkdNw.d.ts +97 -0
  655. package/dist/messages-CRk1g6oe.js +512 -0
  656. package/dist/messaging-DMhtGxVv.d.ts +295 -0
  657. package/dist/methods-BjfDv4Gy.js +9 -0
  658. package/dist/metric-definition-2KQYeUZ1.d.ts +67 -0
  659. package/dist/metric-definition-D4H6IQT7.js +116 -0
  660. package/dist/mfa-CM5r904M.d.ts +34 -0
  661. package/dist/model-Lxa_mOzB.d.ts +338 -0
  662. package/dist/model-messages-BcrkjsPE.js +205 -0
  663. package/dist/model-messages-CGSUU450.d.ts +32 -0
  664. package/dist/money-BgpAd7d3.d.ts +89 -0
  665. package/dist/money-DH--bbYr.js +196 -0
  666. package/dist/money-codec-SKPm8FPw.js +40 -0
  667. package/dist/my-work-kinds-DNPq3ccL.js +10 -0
  668. package/dist/nestjs/index.d.ts +3 -5
  669. package/dist/nestjs/index.js +5 -6
  670. package/dist/next/client/index.d.ts +1 -5
  671. package/dist/next/client/index.js +2 -4
  672. package/dist/next/image/index.d.ts +1 -3
  673. package/dist/next/image/index.js +2 -3
  674. package/dist/next/index.d.ts +93 -103
  675. package/dist/next/index.js +87 -87
  676. package/dist/node/index.d.ts +3 -3
  677. package/dist/node/index.js +6 -7
  678. package/dist/node-headers-C3FExlg9.js +54 -0
  679. package/dist/node-headers-TnS4T7V_.d.ts +25 -0
  680. package/dist/nuxt/index.d.ts +0 -2
  681. package/dist/nuxt/index.js +1 -2
  682. package/dist/operations-BNFbWv1t.js +28 -0
  683. package/dist/operations-D51ONRvR.d.ts +4 -0
  684. package/dist/optional-peer-5SOYr3lL.js +31 -0
  685. package/dist/options--rohtkkC.js +4 -0
  686. package/dist/options-1iHDmlZ5.js +8 -0
  687. package/dist/options-2QJXZPPS.js +4 -0
  688. package/dist/options-B-JqrC61.d.ts +8 -0
  689. package/dist/options-B3xH2JvJ.js +8 -0
  690. package/dist/options-B4sTqDrt.js +4 -0
  691. package/dist/options-B56njigZ.js +19 -0
  692. package/dist/options-B5A3UmKY.d.ts +17 -0
  693. package/dist/options-B6m9gYRH.d.ts +11 -0
  694. package/dist/options-B7Pl708M.js +8 -0
  695. package/dist/options-B7YrdiUc.js +11 -0
  696. package/dist/options-B8c2_hIB.js +9 -0
  697. package/dist/options-B9w_Y08G.d.ts +6 -0
  698. package/dist/options-BDF60ouf.js +4 -0
  699. package/dist/options-BDMPjyrI.js +4 -0
  700. package/dist/options-BHdHuY5r.js +14 -0
  701. package/dist/options-BLMeCbtT.js +31 -0
  702. package/dist/options-BLQePOPy.d.ts +8 -0
  703. package/dist/options-BLn1PFyu.js +4 -0
  704. package/dist/options-BMO-FnOT.js +7 -0
  705. package/dist/options-BNRvoEkj.js +4 -0
  706. package/dist/options-BPQOiVx2.js +7 -0
  707. package/dist/options-BSTJmfX4.js +10 -0
  708. package/dist/options-BTRH26MJ.js +9 -0
  709. package/dist/options-BTaQszYn.js +9 -0
  710. package/dist/options-BYo7hMHK.js +10 -0
  711. package/dist/options-B_bxCZYM.js +7 -0
  712. package/dist/options-BaBaVWS-.js +10 -0
  713. package/dist/options-BamaRO-q.d.ts +12 -0
  714. package/dist/options-BcBdiPSZ.js +7 -0
  715. package/dist/options-BfY4pyQE.js +23 -0
  716. package/dist/options-BgCS5ODi.js +9 -0
  717. package/dist/options-Bi96Lzuf.js +9 -0
  718. package/dist/options-BjEsSoFp.js +17 -0
  719. package/dist/options-Bkx8vwip.js +4 -0
  720. package/dist/options-BmFSI07A.js +4 -0
  721. package/dist/options-BmwDdKwE.js +7 -0
  722. package/dist/options-Bn3NjXfn.js +7 -0
  723. package/dist/options-BqK4xV67.js +13 -0
  724. package/dist/options-Bs2dC-at.js +11 -0
  725. package/dist/options-BvttpM1M.js +4 -0
  726. package/dist/options-Bwrwb8do.d.ts +10 -0
  727. package/dist/options-BxdqA2Ex.js +19 -0
  728. package/dist/options-BzxR82Tu.js +9 -0
  729. package/dist/options-C-NFS6e3.js +13 -0
  730. package/dist/options-C13-dVMH.js +7 -0
  731. package/dist/options-C1RIyAe1.js +7 -0
  732. package/dist/options-C1kZ3qLd.js +8 -0
  733. package/dist/options-C2RjdunU.js +27 -0
  734. package/dist/options-C4kpi6HE.js +8 -0
  735. package/dist/options-C5MfwOAO.js +8 -0
  736. package/dist/options-C5fKQ3EJ.d.ts +10 -0
  737. package/dist/options-CJR59q8s.js +17 -0
  738. package/dist/options-CJVYQue3.d.ts +10 -0
  739. package/dist/options-CLy7CcMn.js +8 -0
  740. package/dist/options-COfEYic3.js +8 -0
  741. package/dist/options-CRwTY_q2.d.ts +58 -0
  742. package/dist/options-CcW7h8mv.js +9 -0
  743. package/dist/options-Ceu2j1vv.js +7 -0
  744. package/dist/options-CgBKgmI8.js +7 -0
  745. package/dist/options-CgMiQGOF.js +9 -0
  746. package/dist/options-CptvcSmF.js +11 -0
  747. package/dist/options-CsLUAt04.js +8 -0
  748. package/dist/options-CtyjhSGk.js +15 -0
  749. package/dist/options-CuPWezcV.js +7 -0
  750. package/dist/options-CyDOOWlk.js +7 -0
  751. package/dist/options-CyYZvdSy.js +10 -0
  752. package/dist/options-CzIPn0fF.js +4 -0
  753. package/dist/options-CzWjw2HY.js +10 -0
  754. package/dist/options-CztbWdz9.js +4 -0
  755. package/dist/options-D4LuPM8a.js +4 -0
  756. package/dist/options-D4dxMGHF.js +7 -0
  757. package/dist/options-D5a9CHgP.js +7 -0
  758. package/dist/options-D6tpMRvp.d.ts +13 -0
  759. package/dist/options-D848Os4l.js +10 -0
  760. package/dist/options-DCZPW5gR.d.ts +15 -0
  761. package/dist/options-DFSHZFLN.js +4 -0
  762. package/dist/options-DFemc2im.js +9 -0
  763. package/dist/options-DFgHHwzD.js +12 -0
  764. package/dist/options-DNZ9r_Vo.d.ts +8 -0
  765. package/dist/options-DP7NwQPZ.js +4 -0
  766. package/dist/options-DPQaafyc.js +7 -0
  767. package/dist/options-DQkhhBLy.js +4 -0
  768. package/dist/options-DTTz33na.js +9 -0
  769. package/dist/options-DToWdVqW.js +4 -0
  770. package/dist/options-DUNUGuhM.js +4 -0
  771. package/dist/options-DWgpi5ns.js +7 -0
  772. package/dist/options-DeamnVOY.d.ts +12 -0
  773. package/dist/options-Dg7eK-_J.d.ts +8 -0
  774. package/dist/options-DiIlMZpc.js +8 -0
  775. package/dist/options-DjFbIRgV.js +16 -0
  776. package/dist/options-DjtCYRWb.js +4 -0
  777. package/dist/options-Dk6D88Zx.d.ts +6 -0
  778. package/dist/options-DpwRG4tO.js +8 -0
  779. package/dist/options-DvgKdZ2K.js +9 -0
  780. package/dist/options-DwIoRvic.js +4 -0
  781. package/dist/options-GwwLsKf5.js +8 -0
  782. package/dist/options-I1ZHfDP0.d.ts +58 -0
  783. package/dist/options-Itq7QYoW.js +20 -0
  784. package/dist/options-JnPEVbBJ.js +17 -0
  785. package/dist/options-Jwux4JDX.js +7 -0
  786. package/dist/options-Lg76d-cV.js +7 -0
  787. package/dist/options-Lh6uxepF.d.ts +24 -0
  788. package/dist/options-Oki2W_c3.js +4 -0
  789. package/dist/options-PM7IaIFP.js +10 -0
  790. package/dist/options-PTLBl6QT.js +7 -0
  791. package/dist/options-PheFo4JY.js +10 -0
  792. package/dist/options-SlC_jZ7y.js +4 -0
  793. package/dist/options-Sq4bYbf5.js +13 -0
  794. package/dist/options-XiD_Y3oK.js +14 -0
  795. package/dist/options-Z-bd_H1E.js +88 -0
  796. package/dist/options-ax_ssX_m.js +4 -0
  797. package/dist/options-bNB8_nlW.js +23 -0
  798. package/dist/options-eIEk0vqV.js +4 -0
  799. package/dist/options-eLIedotm.js +7 -0
  800. package/dist/options-jg0FMHA5.js +4 -0
  801. package/dist/options-mypVYaqR.js +9 -0
  802. package/dist/options-ompJjxkV.js +4 -0
  803. package/dist/options-pbc4H8_A.js +7 -0
  804. package/dist/options-uUGi0Phf.d.ts +14 -0
  805. package/dist/options-yRwYr4up.js +4 -0
  806. package/dist/options-z2Zhi97E.js +9 -0
  807. package/dist/options-zYV6M0vr.js +8 -0
  808. package/dist/orpc/index.d.ts +13 -19
  809. package/dist/orpc/index.js +20 -23
  810. package/dist/otel/index.d.ts +4 -6
  811. package/dist/otel/index.js +8 -10
  812. package/dist/outbox-C44Aa94K.d.ts +197 -0
  813. package/dist/payments-B4JchZuJ.js +15 -0
  814. package/dist/payments-BBGSGRQ7.d.ts +112 -0
  815. package/dist/permissions-B9aZZ9LR.js +43 -0
  816. package/dist/permissions-controller-B4uI5IPH.js +33 -0
  817. package/dist/pg-error-D92B6jlF.js +25 -0
  818. package/dist/plugin-Ca2qBiFZ.js +47 -0
  819. package/dist/pool-Bji4lnQM.d.ts +121 -0
  820. package/dist/pool-errors-JrZie6u3.js +26 -0
  821. package/dist/ports-C-hdygkZ.js +150 -0
  822. package/dist/ports-zFqRNXVJ.d.ts +87 -0
  823. package/dist/postgres/index.d.ts +5 -11
  824. package/dist/postgres/index.js +7 -9
  825. package/dist/postgrest-2WjRrtmX.d.ts +51 -0
  826. package/dist/postgrest-executor-lf8Mt4J0.js +1064 -0
  827. package/dist/powersync/index.d.ts +7 -25
  828. package/dist/powersync/index.js +14 -24
  829. package/dist/preset/index.d.ts +3 -3
  830. package/dist/preset/index.js +3 -3
  831. package/dist/preset-om2rbdYw.js +1038 -0
  832. package/dist/problem-C0SVHhd3.js +161 -0
  833. package/dist/problem-NGBjN-TO.d.ts +77 -0
  834. package/dist/project-oNHntJ6T.js +1749 -0
  835. package/dist/provider-B6qpleR9.js +56 -0
  836. package/dist/provider-CH8McX3b.d.ts +142 -0
  837. package/dist/providers-C9sBIBYE.js +62 -0
  838. package/dist/push-token-CO28k46S.js +15 -0
  839. package/dist/push-token-a3Ev1U3L.d.ts +22 -0
  840. package/dist/queries-BLrxg_GL.js +238 -0
  841. package/dist/query/index.d.ts +3 -3
  842. package/dist/query/index.js +11 -15
  843. package/dist/range-BN3kpJAE.d.ts +6 -0
  844. package/dist/range-Nrh_qtb_.js +6 -0
  845. package/dist/rank-keys-CEBzd9Xa.js +59 -0
  846. package/dist/rank-result-B_xLQCBV.d.ts +12 -0
  847. package/dist/rank-result-DzaTKKhH.js +17 -0
  848. package/dist/rate-limit-C89Yzwd9.d.ts +48 -0
  849. package/dist/rate-limit-CRhlLFhP.js +380 -0
  850. package/dist/rate-limit-DXJbLVg0.js +48 -0
  851. package/dist/ratelimit-headers-CpB-cDD6.js +61 -0
  852. package/dist/react/index.d.ts +11 -11
  853. package/dist/react/index.js +6 -6
  854. package/dist/react/native/index.d.ts +3 -5
  855. package/dist/react/native/index.js +5 -5
  856. package/dist/react/server.d.ts +13 -15
  857. package/dist/react/server.js +9 -10
  858. package/dist/react/session.d.ts +4 -6
  859. package/dist/react/session.js +2 -3
  860. package/dist/react-C40oomj7.js +1006 -0
  861. package/dist/react-CqOVutZj.js +80 -0
  862. package/dist/react-router/index.d.ts +8 -12
  863. package/dist/react-router/index.js +9 -11
  864. package/dist/read-set-DEDoIHMM.js +198 -0
  865. package/dist/realtime/index.d.ts +7 -7
  866. package/dist/realtime/index.js +6 -7
  867. package/dist/realtime-status-CocmAOPv.js +10 -0
  868. package/dist/realtime-status-D3oUx3o4.d.ts +6 -0
  869. package/dist/record-bindings-jTZw-GVe.js +25 -0
  870. package/dist/record-form-DCIui2Ol.d.ts +80 -0
  871. package/dist/record-type-oQxekQTX.js +219 -0
  872. package/dist/recordings-Dlpq8jUG.d.ts +117 -0
  873. package/dist/records/index.d.ts +10 -14
  874. package/dist/records/index.js +13 -16
  875. package/dist/refresh-B8t_KE3s.js +142 -0
  876. package/dist/refresh-BK9epzeC.d.ts +52 -0
  877. package/dist/refusal-DEuFVi4s.d.ts +30 -0
  878. package/dist/refusal-DhX7Xpfp.js +63 -0
  879. package/dist/relay-CllqA-lV.js +248 -0
  880. package/dist/resolve-DVOtYTAc.d.ts +287 -0
  881. package/dist/resolve-FW8oeXvh.js +927 -0
  882. package/dist/resolved-names-DYYyh35i.js +130 -0
  883. package/dist/resource-BfsTJnxZ.d.ts +119 -0
  884. package/dist/resource-Cn6Bn-_o.js +517 -0
  885. package/dist/resource-DQ4kIBpa.js +104 -0
  886. package/dist/resource-execute-DQRS7PFt.d.ts +13 -0
  887. package/dist/resource-schemas-Bq0g2RCQ.js +81 -0
  888. package/dist/resource-types-DF6KDAZM.d.ts +155 -0
  889. package/dist/resources-B0Vy7_wv.js +63 -0
  890. package/dist/resources-CeY53FiJ.d.ts +5 -0
  891. package/dist/respond-C2qvP1wv.js +106 -0
  892. package/dist/respond-CkwkvFdZ.d.ts +108 -0
  893. package/dist/result-8xza7w5W.js +145 -0
  894. package/dist/result-DTOQRyGY.d.ts +347 -0
  895. package/dist/rows-Ce8dsmfM.js +79 -0
  896. package/dist/rows-D-RqIsRz.js +38 -0
  897. package/dist/rrule-BLpe2449.js +289 -0
  898. package/dist/run-keys-BnzqxtYc.d.ts +59 -0
  899. package/dist/run-state-D0Tbl-nM.d.ts +11 -0
  900. package/dist/run-state-DGiyDQxH.js +12 -0
  901. package/dist/run-watch-DJk4Q603.js +52 -0
  902. package/dist/runtime-qslVrC9l.js +43 -0
  903. package/dist/sales-lines-Bde9cV5F.d.ts +36 -0
  904. package/dist/sales-lines-axwWhnLk.js +44 -0
  905. package/dist/sales-shared-CY3s_wBx.js +21 -0
  906. package/dist/sandboxes-DDWuD9fh.d.ts +85 -0
  907. package/dist/schemas-CpoEiAeT.js +213 -0
  908. package/dist/scope-dD_OAgRU.js +89 -0
  909. package/dist/scores-Bql-ABl0.d.ts +172 -0
  910. package/dist/scores-Bvk_JgXL.js +176 -0
  911. package/dist/search-DtbkD0h0.js +8 -0
  912. package/dist/server/index.d.ts +35 -69
  913. package/dist/server/index.js +51 -59
  914. package/dist/server-types-C3p3jUqr.d.ts +583 -0
  915. package/dist/session-BOch2y2z.d.ts +96 -0
  916. package/dist/session-status-DRBRnZHx.d.ts +80 -0
  917. package/dist/shared-Bmcnxwie.js +16 -0
  918. package/dist/shared-Ci1g9nl4.js +90 -0
  919. package/dist/shared-DsBcvj6q.d.ts +9 -0
  920. package/dist/sign-in-BmigClRh.js +730 -0
  921. package/dist/sign-in-C9pZE1kM.d.ts +53 -0
  922. package/dist/sign-in-CXOg2Dwb.js +399 -0
  923. package/dist/sign-in-Dxyi4aKu.d.ts +83 -0
  924. package/dist/signatures-CBn7w4VR.js +144 -0
  925. package/dist/signatures-jPr9JXyw.d.ts +41 -0
  926. package/dist/signers-Cz5ZhTHH.d.ts +380 -0
  927. package/dist/signing-keys-BC5_hJN5.js +163 -0
  928. package/dist/signing-keys-DS-rIVzz.d.ts +117 -0
  929. package/dist/simplify-BzThKn5b.js +82 -0
  930. package/dist/solid/index.d.ts +12 -22
  931. package/dist/solid/index.js +10 -16
  932. package/dist/solid-start/index.d.ts +7 -9
  933. package/dist/solid-start/index.js +8 -9
  934. package/dist/spec/index.d.ts +6 -48
  935. package/dist/spec/index.js +23 -39
  936. package/dist/spec-6Vr7sc0Z.js +123 -0
  937. package/dist/spec-pins-CuQ2anBw.d.ts +125 -0
  938. package/dist/spec-pins-FKUzgF6K.js +61 -0
  939. package/dist/sql/index.d.ts +4 -4
  940. package/dist/sql/index.js +4 -4
  941. package/dist/sql-BPV51R3A.js +140626 -0
  942. package/dist/sql-C1K5JALb.js +420 -0
  943. package/dist/sql-type-XWMeZRAl.js +33 -0
  944. package/dist/sqlite/index.d.ts +3 -9
  945. package/dist/sqlite/index.js +5 -8
  946. package/dist/sso-BEvNf1oW.d.ts +159 -0
  947. package/dist/sso-CRnaFJh0.js +216 -0
  948. package/dist/ssr/index.d.ts +5 -5
  949. package/dist/ssr/index.js +3 -3
  950. package/dist/standard-BD2aOUsf.js +24 -0
  951. package/dist/standard-DRX6Ch1j.d.ts +5 -0
  952. package/dist/stats-BTJgRMEp.js +82 -0
  953. package/dist/statuses-BTrQ5H4S.js +27 -0
  954. package/dist/statuses-Bv-0XoYC.js +27 -0
  955. package/dist/storage/index.d.ts +3 -3
  956. package/dist/storage/index.js +27 -40
  957. package/dist/storage-api-COQr77e8.js +9 -0
  958. package/dist/store-CKKzmsWB.js +68 -0
  959. package/dist/store-c7QxUHX-.d.ts +81 -0
  960. package/dist/streams/index.d.ts +3 -7
  961. package/dist/streams/index.js +5 -6
  962. package/dist/streams/redis/index.d.ts +1 -3
  963. package/dist/streams/redis/index.js +6 -7
  964. package/dist/stripe/index.d.ts +1 -3
  965. package/dist/stripe/index.js +3 -4
  966. package/dist/stripe-Bl-sjnl6.d.ts +154 -0
  967. package/dist/stripe-DKRwRWew.js +31 -0
  968. package/dist/subject-readers-BARV5rNp.js +48 -0
  969. package/dist/subject-readers-DWkVSbFr.d.ts +19 -0
  970. package/dist/subject-type-BarjdHZV.js +7 -0
  971. package/dist/subjects-BGwLJ3IB.d.ts +148 -0
  972. package/dist/subjects-vci6Wufh.d.ts +86 -0
  973. package/dist/subscribers-C57054Pc.js +32 -0
  974. package/dist/summaries-CUemsYwV.d.ts +67 -0
  975. package/dist/supabase-mcp-DY32eoax.d.ts +44 -0
  976. package/dist/supabase-mcp-QvebHckf.js +27 -0
  977. package/dist/support-rZbdU35s.d.ts +351 -0
  978. package/dist/support-view-CvDEgyGY.js +17 -0
  979. package/dist/support-view-WY4Y-A40.d.ts +15 -0
  980. package/dist/svelte/index.d.ts +11 -21
  981. package/dist/svelte/index.js +9 -15
  982. package/dist/sveltekit/index.d.ts +10 -14
  983. package/dist/sveltekit/index.js +12 -14
  984. package/dist/table-schema-CwXg7oBz.d.ts +77 -0
  985. package/dist/table-schema-D-ss9ozY.js +291 -0
  986. package/dist/tables-BSiVuKKx.js +72 -0
  987. package/dist/tags-BVLELhOf.d.ts +28 -0
  988. package/dist/tags-CW-KvjdL.js +38 -0
  989. package/dist/tanstack-db/index.d.ts +4 -8
  990. package/dist/tanstack-db/index.js +4 -6
  991. package/dist/tanstack-start/index.d.ts +8 -12
  992. package/dist/tanstack-start/index.js +8 -10
  993. package/dist/tax-BD9dN1rx.d.ts +168 -0
  994. package/dist/tax-BwckP5dv.js +139 -0
  995. package/dist/tee-CVOMhEX-.js +100 -0
  996. package/dist/template-CNq9xcfx.js +125 -0
  997. package/dist/temporal-DKTdGK9i.js +94 -0
  998. package/dist/temporal-required-w_2u4EDp.js +19 -0
  999. package/dist/tenant-BR7fvPj7.js +26 -0
  1000. package/dist/tenant-RKvGBB-U.d.ts +15 -0
  1001. package/dist/tenant-source-46lMuMEn.js +7 -0
  1002. package/dist/testing/index.d.ts +77 -123
  1003. package/dist/testing/index.js +145 -117
  1004. package/dist/timeline-Bs-FGMIJ.js +49 -0
  1005. package/dist/timeline-Ck8OFuAN.d.ts +147 -0
  1006. package/dist/timing-B6yHayKA.js +94 -0
  1007. package/dist/topic-BBBCVLyS.js +640 -0
  1008. package/dist/topic-Dr8VYE4D.d.ts +411 -0
  1009. package/dist/transport-CS4cVH4S.js +30 -0
  1010. package/dist/ttl-cache-C5S0L2wx.js +31 -0
  1011. package/dist/types-BiedVwz_.d.ts +192 -0
  1012. package/dist/types-CCmW3MqI.d.ts +449 -0
  1013. package/dist/types-CL-z0A4K.d.ts +660 -0
  1014. package/dist/types-CvlJNzX4.d.ts +215 -0
  1015. package/dist/types-D9FY9qSJ.d.ts +247 -0
  1016. package/dist/types-DWZubmwk.d.ts +648 -0
  1017. package/dist/types-DnrJ_crV.js +28 -0
  1018. package/dist/types-Pv5WPfIC.d.ts +175 -0
  1019. package/dist/types-WZUVlTXs.d.ts +907 -0
  1020. package/dist/undo-BdoEJ6Ot.d.ts +44 -0
  1021. package/dist/undo-Dki6Ujak.js +43 -0
  1022. package/dist/upload-claim-Bo2mpBz4.js +32 -0
  1023. package/dist/usage-D27Uw426.d.ts +230 -0
  1024. package/dist/user-change-Ngy8z1fZ.js +133 -0
  1025. package/dist/variants-BaMleC56.js +51 -0
  1026. package/dist/vault-Dx0LaNMX.d.ts +60 -0
  1027. package/dist/vercel-connect/index.d.ts +194 -20
  1028. package/dist/vercel-connect/index.js +265 -33
  1029. package/dist/vercel-sandbox/index.d.ts +166 -0
  1030. package/dist/vercel-sandbox/index.js +171 -0
  1031. package/dist/verify-DY_j4GPZ.js +129 -0
  1032. package/dist/verify-DnL0Fgu0.d.ts +144 -0
  1033. package/dist/view-DmEZA1fL.d.ts +95 -0
  1034. package/dist/view-YnesSUEa.js +244 -0
  1035. package/dist/vue/index.d.ts +12 -22
  1036. package/dist/vue/index.js +10 -16
  1037. package/dist/watch-topic-BB7T05sc.d.ts +29 -0
  1038. package/dist/watch-topic-C2KxpeaB.js +56 -0
  1039. package/dist/wire-DIoLA8VL.js +90 -0
  1040. package/dist/wiring-DJBSLdyF.js +12 -0
  1041. package/dist/workflow-sdk/builder/index.d.ts +12 -14
  1042. package/dist/workflow-sdk/builder/index.js +12 -11
  1043. package/dist/workflow-sdk/index.d.ts +62 -6
  1044. package/dist/workflow-sdk/index.js +75 -10
  1045. package/dist/workflow-sdk/world/index.d.ts +13 -20
  1046. package/dist/workflow-sdk/world/index.js +115 -26
  1047. package/dist/workflow-sdk-BL3wzkdp.js +2749 -0
  1048. package/dist/workflow-sdk-D5zRSwxh.js +302 -0
  1049. package/dist/workflow-sdk-DMpVSMB7.d.ts +171 -0
  1050. package/dist/workflows-DKTw2PZo.d.ts +256 -0
  1051. package/dist/yjs/index.d.ts +3 -5
  1052. package/dist/yjs/index.js +6 -7
  1053. package/package.json +45 -31
  1054. package/schemas/config-v1.json +57 -3
  1055. package/schemas/snapshot-v2.json +7 -0
  1056. package/skills/better-supabase/SKILL.md +4 -4
  1057. package/skills/better-supabase/references/block-extensions.md +2 -2
  1058. package/skills/better-supabase/references/troubleshooting.md +1 -1
  1059. package/skills/better-supabase/references/ui-recipes.md +73 -36
  1060. package/skills/better-supabase-api/SKILL.md +1 -1
  1061. package/skills/better-supabase-api/references/adapters.md +3 -3
  1062. package/skills/better-supabase-api/references/ai.md +8 -0
  1063. package/skills/better-supabase-auth/SKILL.md +19 -19
  1064. package/skills/better-supabase-auth/references/authorization-providers.md +1 -1
  1065. package/dist/access-sql-CTDNuxRv.js +0 -385
  1066. package/dist/actor-CoveJgya.d.ts +0 -106
  1067. package/dist/actor-go7p9-CJ.js +0 -150
  1068. package/dist/adapter-BTbj5N9C.js +0 -2251
  1069. package/dist/agents-CM_cCtcr.d.ts +0 -117
  1070. package/dist/ai-cache-BFRKxgZ4.js +0 -87
  1071. package/dist/ai-cache-BTGqckta.d.ts +0 -82
  1072. package/dist/ai-chat-B7_vQvxU.d.ts +0 -619
  1073. package/dist/ai-files-m_2z3rH1.js +0 -339
  1074. package/dist/ai-message-DfaP8sis.js +0 -14
  1075. package/dist/ai-schedules-CZEfo-_M.d.ts +0 -166
  1076. package/dist/anchors-7F34QyHa.d.ts +0 -40
  1077. package/dist/api-3C0AWFeP.js +0 -696
  1078. package/dist/api-59rv5hL6.d.ts +0 -495
  1079. package/dist/api-keys-JE-aykZE.d.ts +0 -213
  1080. package/dist/app-tables-B2mKMNRQ.d.ts +0 -28
  1081. package/dist/approvals-BfEafAzt.d.ts +0 -129
  1082. package/dist/assistant-B49qATbj.d.ts +0 -157
  1083. package/dist/attachments-BXbLnNxm.js +0 -376
  1084. package/dist/attributes-Bzf51_nc.js +0 -47
  1085. package/dist/auth-DyF_LRxd.js +0 -20
  1086. package/dist/auth-link-B4NL84XU.d.ts +0 -104
  1087. package/dist/auth-link-D3-bU6yz.js +0 -118
  1088. package/dist/auth-module-BbmX-N4L.js +0 -52
  1089. package/dist/auth-reply-Dj124sbX.d.ts +0 -11
  1090. package/dist/auth-reply-tlXB2FQ9.js +0 -31
  1091. package/dist/authorization-DfEkyFt_.d.ts +0 -3867
  1092. package/dist/authorization-hooks-BWhkMZfH.d.ts +0 -221
  1093. package/dist/authorizer-B6X09otb.d.ts +0 -118
  1094. package/dist/authorizer-BGhXaDmo.js +0 -172
  1095. package/dist/automation-D41DXyvT.js +0 -75
  1096. package/dist/automations-8L3NEuoq.js +0 -29
  1097. package/dist/automations-BKjJpktQ.js +0 -33
  1098. package/dist/automations-BMuqwZZn.js +0 -314
  1099. package/dist/automations-EzXteupo.js +0 -31
  1100. package/dist/availability-BdeKCHpl.d.ts +0 -236
  1101. package/dist/base64-B9Wlsdj7.js +0 -42
  1102. package/dist/batch-limit-DKVQDz4o.js +0 -5
  1103. package/dist/before-route-B23K2zYU.js +0 -30
  1104. package/dist/bind-DAx0bMSi.d.ts +0 -104
  1105. package/dist/block-authors-Bw3zdzgl.js +0 -14
  1106. package/dist/block-authors-DzXLUiIq.d.ts +0 -12
  1107. package/dist/block-env-Dz7Caxk0.d.ts +0 -32
  1108. package/dist/block-event-listener-Bu6G0TFH.js +0 -16
  1109. package/dist/block-events-IWAyafO3.js +0 -83
  1110. package/dist/block-fields-BE7pInWZ.d.ts +0 -58
  1111. package/dist/block-fields-BjXgX_5c.js +0 -140
  1112. package/dist/block-helpers-B0f0ZVb5.js +0 -437
  1113. package/dist/block-helpers-D5emQ2O6.d.ts +0 -62
  1114. package/dist/block-hooks-B8itxzEE.d.ts +0 -117
  1115. package/dist/block-hooks-DKtz0HRh.js +0 -130
  1116. package/dist/block-method-C9hWdHom.js +0 -21
  1117. package/dist/block-method-CiVa2G-J.d.ts +0 -14
  1118. package/dist/block-subjects-C1_9DkSA.d.ts +0 -6
  1119. package/dist/block-subjects-DFSuFY1a.js +0 -55
  1120. package/dist/block-tenant-DHp7subc.js +0 -14
  1121. package/dist/block-transport-9EUA3q_I.d.ts +0 -69
  1122. package/dist/bookings-xsmM2TA_.d.ts +0 -289
  1123. package/dist/bucket-SvRQwYS4.d.ts +0 -705
  1124. package/dist/build-CH2N3Yf0.js +0 -2073
  1125. package/dist/build-DbIRFcHQ.js +0 -735
  1126. package/dist/carrier-KzeYXVrW.d.ts +0 -169
  1127. package/dist/casing-DdFWEtqr.js +0 -16
  1128. package/dist/channel-JcMd5lNP.d.ts +0 -105
  1129. package/dist/channels-CfcFPuo_.js +0 -114
  1130. package/dist/claims-Bp9My7XP.js +0 -88
  1131. package/dist/claims-DTy6R6my.js +0 -63
  1132. package/dist/cli/_format-Cax5EsM9.js +0 -101
  1133. package/dist/cli/add-B9wP0YGU.js +0 -99
  1134. package/dist/cli/add-DjZXKd7X.js +0 -1231
  1135. package/dist/cli/add-ZcEOEK23.js +0 -1
  1136. package/dist/cli/agent-CbuPvI2x.js +0 -185
  1137. package/dist/cli/app-table-files-mtvjHa48.js +0 -346
  1138. package/dist/cli/arazzo-1.0-BalU61-_.js +0 -532
  1139. package/dist/cli/arazzo-1.1-Bnfasbun.js +0 -705
  1140. package/dist/cli/args-UEwg0l-N.js +0 -27
  1141. package/dist/cli/asyncapi-3.0.0-C78dBjR6.js +0 -5593
  1142. package/dist/cli/asyncapi-3.1.0-g-7aIfV1.js +0 -5833
  1143. package/dist/cli/backfill-Coshdvh_.js +0 -293
  1144. package/dist/cli/blocks-BWCuA0nq.js +0 -156
  1145. package/dist/cli/blocks-hiSazThw.js +0 -1
  1146. package/dist/cli/cache-x2wWAy0h.js +0 -607
  1147. package/dist/cli/codemod-BnjV7BpC.js +0 -2634
  1148. package/dist/cli/codemod-block-renames-BuSaTE_G.js +0 -239
  1149. package/dist/cli/command-CCAwhiOh.js +0 -1003
  1150. package/dist/cli/compare-BmIWVEui.js +0 -9
  1151. package/dist/cli/completion-BJaB84Pe.js +0 -211
  1152. package/dist/cli/completion-BkUhs1ms.js +0 -1
  1153. package/dist/cli/completion-DmUVsUVQ.js +0 -30
  1154. package/dist/cli/config-Cskysxp-.js +0 -2000
  1155. package/dist/cli/config-Df5cXWNN.js +0 -1
  1156. package/dist/cli/config-edit-CrWfk8s3.js +0 -621
  1157. package/dist/cli/config-group-CP-B9uRt.js +0 -390
  1158. package/dist/cli/config-zId1jkLx.js +0 -47
  1159. package/dist/cli/content-mapper-DvOSOdTE.js +0 -182
  1160. package/dist/cli/db-CQCLx7cx.js +0 -78
  1161. package/dist/cli/db-DXKyVEDF.js +0 -247
  1162. package/dist/cli/detect-D9JaAX20.js +0 -84
  1163. package/dist/cli/dist-D_VbPAMR.js +0 -129
  1164. package/dist/cli/dist-DuiMMRbJ.js +0 -1112
  1165. package/dist/cli/doctor-Ywy8oJEU.js +0 -4684
  1166. package/dist/cli/env-BK0xKMeU.js +0 -1113
  1167. package/dist/cli/env-Bat6ogep.js +0 -1
  1168. package/dist/cli/env-CNjT_uOV.js +0 -1
  1169. package/dist/cli/env-XMiKvhtV.js +0 -143
  1170. package/dist/cli/errors-BTe6A15O.js +0 -98
  1171. package/dist/cli/exec-Ca5s-ygi.js +0 -463
  1172. package/dist/cli/fastest-levenshtein-dhRRvrM2.js +0 -120
  1173. package/dist/cli/files-CX71yBm8.js +0 -1010
  1174. package/dist/cli/fresh-import-DzgsGHkX.js +0 -40
  1175. package/dist/cli/gen-B-FbQmG1.js +0 -394
  1176. package/dist/cli/guards-CUlDNYZs.js +0 -8
  1177. package/dist/cli/in-stack-diff-Cp-tVPj2.js +0 -186
  1178. package/dist/cli/init-fb9e1BKX.js +0 -559
  1179. package/dist/cli/io-DH1kcmmP.js +0 -37
  1180. package/dist/cli/json5-ChRycquj.js +0 -787
  1181. package/dist/cli/jsonc-C8M0EhHB.js +0 -1
  1182. package/dist/cli/jsonc-D5Fu67jw.js +0 -45
  1183. package/dist/cli/keys-ORiPz1sM.js +0 -106
  1184. package/dist/cli/legacy-prefix-R7UChFFl.js +0 -154
  1185. package/dist/cli/live-DIt7TP-N.js +0 -341
  1186. package/dist/cli/mcp-CVWwraga.js +0 -241
  1187. package/dist/cli/metadata-CannIjel.js +0 -150
  1188. package/dist/cli/migrate-Ht2TzIQF.js +0 -46
  1189. package/dist/cli/migration-safety-nNyB05I-.js +0 -928
  1190. package/dist/cli/migrations-bAd7dpk1.js +0 -117
  1191. package/dist/cli/module-migration-CkNux8dr.js +0 -119
  1192. package/dist/cli/moved-C3WyRHkA.js +0 -254
  1193. package/dist/cli/ohash-BjQY1cBb.js +0 -277
  1194. package/dist/cli/openapi-3.0-t7xwkuRH.js +0 -928
  1195. package/dist/cli/openapi-3.1-CVze7tBS.js +0 -870
  1196. package/dist/cli/openapi-3.2-CFoMYM01.js +0 -1031
  1197. package/dist/cli/orphans-BAboqyVM.js +0 -28
  1198. package/dist/cli/parse-DjHbTaFI.js +0 -182
  1199. package/dist/cli/powersync-B2v0tDwp.js +0 -377
  1200. package/dist/cli/powersync-D3mAQ6QE.js +0 -1
  1201. package/dist/cli/preset-BwmIfFnh.js +0 -101
  1202. package/dist/cli/print-CxQ0rBKT.js +0 -68
  1203. package/dist/cli/prompts-jqnr94b9.js +0 -1140
  1204. package/dist/cli/providers-DtI90lSw.js +0 -301
  1205. package/dist/cli/redact-KGAk2Ul9.js +0 -38
  1206. package/dist/cli/remove-DYtE4IZ4.js +0 -239
  1207. package/dist/cli/render-QGWfEoiB.js +0 -2225
  1208. package/dist/cli/rolldown-runtime-kJ_i4yPo.js +0 -26
  1209. package/dist/cli/run-B5aMwErM.js +0 -63
  1210. package/dist/cli/run-BNoJKf5I.js +0 -706
  1211. package/dist/cli/run-DiYX1XEa.js +0 -1459
  1212. package/dist/cli/seed-C-Hu2n_E.js +0 -188
  1213. package/dist/cli/seed-Cm-c0BDd.js +0 -1
  1214. package/dist/cli/shared-D_CFi5di.js +0 -151
  1215. package/dist/cli/shell-Btv_4Yhe.js +0 -10
  1216. package/dist/cli/skills-D98y0bSB.js +0 -121
  1217. package/dist/cli/snapshot-BlQ4DDcJ.js +0 -734
  1218. package/dist/cli/source-CelMBQMj.js +0 -320
  1219. package/dist/cli/source-args-v8ljFDfc.js +0 -59
  1220. package/dist/cli/spec-BxcoGE0h.js +0 -1
  1221. package/dist/cli/spec-iBx1LcYO.js +0 -7530
  1222. package/dist/cli/sql-layout-Dp4Rottt.js +0 -261
  1223. package/dist/cli/stack-B2slzrYH.js +0 -135
  1224. package/dist/cli/stack-env-3ziggrU3.js +0 -93
  1225. package/dist/cli/stack-status-BkkYRlXG.js +0 -46
  1226. package/dist/cli/stacks-CiDBH1dB.js +0 -232
  1227. package/dist/cli/style-Bm2X5JrN.js +0 -35
  1228. package/dist/cli/supabase-toml-CncmQbO0.js +0 -1164
  1229. package/dist/cli/sync-BnORI43S.js +0 -322
  1230. package/dist/cli/table-D6HUECKI.js +0 -89
  1231. package/dist/cli/toml-DB-MNnFs.js +0 -424
  1232. package/dist/cli/topics-BpdnYmWb.js +0 -30
  1233. package/dist/cli/trace-VbdO6bcN.js +0 -7
  1234. package/dist/cli/upgrade-CR6-WmIc.js +0 -272
  1235. package/dist/cli/upgrade-fz92aCnh.js +0 -41
  1236. package/dist/cli/validate-B3lF3-jB.js +0 -7522
  1237. package/dist/cli/version-Dz8ZlOuh.js +0 -4
  1238. package/dist/cli/yaml-CYCbJ6et.js +0 -2252
  1239. package/dist/client-C_mlji5R.js +0 -288
  1240. package/dist/clone-CkG0-hlI.js +0 -33
  1241. package/dist/cloud-event-0pQ9vFNS.d.ts +0 -64
  1242. package/dist/cloud-event-XsM53POL.js +0 -63
  1243. package/dist/codecs-CMWlhHZ0.d.ts +0 -222
  1244. package/dist/codecs-CSUFGrdP.js +0 -358
  1245. package/dist/compiler-BEeVWXPS.d.ts +0 -14
  1246. package/dist/compose-DKW0Tr3e.js +0 -53
  1247. package/dist/composite-B4qB6k31.js +0 -130
  1248. package/dist/composite-BJ9s-IJJ.d.ts +0 -83
  1249. package/dist/config-B7g-HDis.js +0 -1111
  1250. package/dist/config-R0m0fBiD.js +0 -1679
  1251. package/dist/connectors-uC5baoFV.d.ts +0 -147
  1252. package/dist/context-DBicfUNz.js +0 -41
  1253. package/dist/context-DWWoP1wK.d.ts +0 -4344
  1254. package/dist/controller-BEliOBOv.js +0 -79
  1255. package/dist/controller-Br9dGKGe.d.ts +0 -52
  1256. package/dist/controller-W97g2WGG.js +0 -73
  1257. package/dist/conversion-Dq1S7xzE.js +0 -77
  1258. package/dist/conversion-g8HzH9My.d.ts +0 -86
  1259. package/dist/cors-h_v7TPxl.js +0 -24
  1260. package/dist/cors-kLq6VM06.d.ts +0 -15
  1261. package/dist/create-blocks-BfrDUSM6.js +0 -370
  1262. package/dist/cron-DdT4ti8a.js +0 -148
  1263. package/dist/cron-route-FjKgRvTY.js +0 -24
  1264. package/dist/csv-2rXGPNtP.js +0 -89
  1265. package/dist/csv-DhHQS2x_.d.ts +0 -28
  1266. package/dist/data-engine-D1BkmBoR.js +0 -173
  1267. package/dist/data-engine-rvbR2C4F.d.ts +0 -273
  1268. package/dist/data-hooks-CdcZfVS1.js +0 -280
  1269. package/dist/db-exception-Lngc1W49.js +0 -31
  1270. package/dist/deal-forecast-CKBnRodz.js +0 -39
  1271. package/dist/deal-forecast-LwO-Z4_C.d.ts +0 -23
  1272. package/dist/define-D-dLADd5.js +0 -2084
  1273. package/dist/define-D8_9X5fZ.d.ts +0 -1263
  1274. package/dist/define-block-BGqOO8B3.js +0 -64
  1275. package/dist/define-block-DWVZSZv1.d.ts +0 -1687
  1276. package/dist/delegation-C7eWP2r8.d.ts +0 -14
  1277. package/dist/delegation-DGOIiT8k.js +0 -153
  1278. package/dist/delivery-Bm0jxmzI.js +0 -29
  1279. package/dist/delivery-events-DbL8IHIY.js +0 -53
  1280. package/dist/delivery-n6lZGuGx.d.ts +0 -71
  1281. package/dist/documents-BbwYyynk.d.ts +0 -152
  1282. package/dist/email-B3YxEzwC.d.ts +0 -42
  1283. package/dist/embeddings-I3s5sTDt.d.ts +0 -78
  1284. package/dist/embeddings-vVzseUw0.js +0 -128
  1285. package/dist/ended-EZzN9QTM.d.ts +0 -26
  1286. package/dist/entitlements-CBjm2lvD.d.ts +0 -54
  1287. package/dist/entitlements-tGL6-69B.js +0 -45
  1288. package/dist/entity-naming-Dtyq5sKE.js +0 -131
  1289. package/dist/entity-schema-B1YmMtP8.js +0 -39
  1290. package/dist/envelope-DEI2iX-d.js +0 -90
  1291. package/dist/errors-BVFgt8BZ.js +0 -328
  1292. package/dist/errors-CyxMxzlu.js +0 -44
  1293. package/dist/escape-like-DHfx6jRr.js +0 -7
  1294. package/dist/escape-like-PReMbEEU.d.ts +0 -30
  1295. package/dist/eve-BfhVFV33.d.ts +0 -157
  1296. package/dist/event-calendar-DVLs2wUO.d.ts +0 -65
  1297. package/dist/event-map-CtPFhcOp.js +0 -19
  1298. package/dist/events-B2qbZps6.d.ts +0 -854
  1299. package/dist/events-D6IZ5CE8.js +0 -82
  1300. package/dist/events-DuLhzjP6.js +0 -26
  1301. package/dist/executor-BfirBzOr.d.ts +0 -174
  1302. package/dist/executor-BlS0kCrN.d.ts +0 -104
  1303. package/dist/executor-C2Ne-Scm.js +0 -208
  1304. package/dist/executor-DXQIx4sW.d.ts +0 -37
  1305. package/dist/executor-DqIci3Jb.js +0 -486
  1306. package/dist/executor-WolvKszH.js +0 -843
  1307. package/dist/extension-DTaHjwdc.js +0 -59
  1308. package/dist/extension-DeAd_MqI.js +0 -121
  1309. package/dist/extension-DzCc0IOd.js +0 -103
  1310. package/dist/extension-mGylYROs.js +0 -53
  1311. package/dist/extension-shared-Djm8mGHD.js +0 -60
  1312. package/dist/extra-CGQ2_q3S.js +0 -10
  1313. package/dist/field-errors-CEjsMAgd.d.ts +0 -216
  1314. package/dist/field-formats-C6QKA3UR.js +0 -102
  1315. package/dist/field-formats-CAFNkKSN.d.ts +0 -38
  1316. package/dist/fields-BBm49w-E.js +0 -108
  1317. package/dist/fields-snbaZ14h.d.ts +0 -78
  1318. package/dist/filter-evaluate-BRpNiNPG.d.ts +0 -37
  1319. package/dist/filter-evaluate-lCToXzZI.js +0 -217
  1320. package/dist/filter-query-CQ6d5GnQ.js +0 -566
  1321. package/dist/filter-query-DBt7OKuH.d.ts +0 -133
  1322. package/dist/flags-DDKTThrO.d.ts +0 -246
  1323. package/dist/flags-DF_SCqp5.js +0 -279
  1324. package/dist/form-definition-BTpM_tz1.js +0 -363
  1325. package/dist/form-definition-BjEtH8BT.d.ts +0 -119
  1326. package/dist/format-u-65igKI.d.ts +0 -79
  1327. package/dist/framework-CqiZk89W.js +0 -58
  1328. package/dist/framework-DVYTtQXA.d.ts +0 -47
  1329. package/dist/function-contract-DxFNOmsm.d.ts +0 -27
  1330. package/dist/function-contract-pEmsaUIf.js +0 -8
  1331. package/dist/gateway-Ve7cByEr.d.ts +0 -115
  1332. package/dist/gateway-options-BlVCqgb8.d.ts +0 -29
  1333. package/dist/gateway-options-Cl74B7k6.js +0 -27
  1334. package/dist/guards-6F2bCtQR.js +0 -12
  1335. package/dist/guest-actions-1T1DeS5Y.d.ts +0 -5
  1336. package/dist/guest-actions-B7zdhfnh.js +0 -9
  1337. package/dist/history-GH1HJWQV.js +0 -271
  1338. package/dist/hmac-B3CTTlfv.js +0 -23
  1339. package/dist/http-7-UvHjQe.js +0 -28
  1340. package/dist/http-BjjojWg3.js +0 -40
  1341. package/dist/http-DzbloBR-.js +0 -141
  1342. package/dist/image-url-_d7xYsXK.js +0 -84
  1343. package/dist/impersonation-DM3oWNoD.js +0 -62
  1344. package/dist/impersonation-YTa9dZUv.d.ts +0 -28
  1345. package/dist/inbox-c8B86Trp.d.ts +0 -321
  1346. package/dist/index-B4wttiLh.d.ts +0 -407
  1347. package/dist/index-Clyd2Goi.d.ts +0 -338
  1348. package/dist/index-Cxsnd-OL.d.ts +0 -305
  1349. package/dist/index-D98bQs8a.d.ts +0 -665
  1350. package/dist/index-DIdPoQtO.d.ts +0 -240
  1351. package/dist/index-DbyDZZlc.d.ts +0 -53
  1352. package/dist/index-I8YLxKq8.d.ts +0 -729
  1353. package/dist/index-NRMMhhEi.d.ts +0 -104
  1354. package/dist/index-X2fkPUwb.d.ts +0 -51
  1355. package/dist/index-eRBuKtMt.d.ts +0 -158
  1356. package/dist/index-pZn6S_iq.d.ts +0 -149
  1357. package/dist/index-uIU65iEn.d.ts +0 -588
  1358. package/dist/instance-property-hRh88y_s.js +0 -7
  1359. package/dist/instances-DY_ORk5g.js +0 -16605
  1360. package/dist/invalidate-DMp4eqfF.d.ts +0 -21
  1361. package/dist/iso4217-B-durg_y.js +0 -176
  1362. package/dist/json-DaByVJpw.js +0 -22
  1363. package/dist/json-schema-DHJxiizN.js +0 -888
  1364. package/dist/jwks-cache-DEsKI0hJ.js +0 -49
  1365. package/dist/jws-D0toeQlA.d.ts +0 -66
  1366. package/dist/jws-DOgHJKHb.js +0 -205
  1367. package/dist/kit-B8yWCRN7.d.ts +0 -94
  1368. package/dist/kit-Bcd9wYCV.js +0 -133
  1369. package/dist/knowledge-CsLPACGJ.d.ts +0 -217
  1370. package/dist/knowledge-tCrrU99q.js +0 -300
  1371. package/dist/list-query-BcU8NnNL.d.ts +0 -222
  1372. package/dist/list-query-BnpA2BDg.js +0 -559
  1373. package/dist/live-C21DgbsD.js +0 -275
  1374. package/dist/logger-DWVYUmwi.d.ts +0 -18
  1375. package/dist/logger-glM28NVN.js +0 -21
  1376. package/dist/lookup-BaP5bI27.js +0 -18
  1377. package/dist/management-wtecfrNf.d.ts +0 -57
  1378. package/dist/message-Bg4TKA12.d.ts +0 -99
  1379. package/dist/messages-ecPW_nOv.js +0 -492
  1380. package/dist/messaging-DQP09JsY.d.ts +0 -297
  1381. package/dist/methods-Cund9ZBe.js +0 -11
  1382. package/dist/metric-definition-BjxVn4R5.js +0 -117
  1383. package/dist/metric-definition-EAYI1r2n.d.ts +0 -69
  1384. package/dist/mfa-oIOYTpvc.d.ts +0 -36
  1385. package/dist/model-hwpvole9.d.ts +0 -340
  1386. package/dist/model-messages-CkZSDDHP.js +0 -206
  1387. package/dist/model-messages-DrR4lZ_c.d.ts +0 -34
  1388. package/dist/money-BNRdJQzA.d.ts +0 -91
  1389. package/dist/money-BZl985O-.js +0 -197
  1390. package/dist/money-codec-BJuS2zEW.js +0 -41
  1391. package/dist/my-work-kinds-BU3SlA-6.js +0 -11
  1392. package/dist/node-headers-BPtMP4_V.d.ts +0 -27
  1393. package/dist/node-headers-C71zNQHe.js +0 -55
  1394. package/dist/operations-DVHRHvv6.js +0 -29
  1395. package/dist/operations-hm1Isvvs.d.ts +0 -6
  1396. package/dist/optional-peer-C1NbBRJm.js +0 -32
  1397. package/dist/options-3OYOU56e.js +0 -11
  1398. package/dist/options-56zYYXxc.js +0 -10
  1399. package/dist/options-5WvWOkAm.d.ts +0 -26
  1400. package/dist/options-62woPFn3.js +0 -12
  1401. package/dist/options-7ixoOoap.js +0 -10
  1402. package/dist/options-9dSU5RML.js +0 -5
  1403. package/dist/options-B0YZtAkb.d.ts +0 -15
  1404. package/dist/options-B2Kz_tCx.js +0 -10
  1405. package/dist/options-B5E2MGIz.js +0 -15
  1406. package/dist/options-B685YSzQ.js +0 -5
  1407. package/dist/options-B692WoK6.js +0 -9
  1408. package/dist/options-BHU1wc74.js +0 -5
  1409. package/dist/options-BHy0Z5Zd.js +0 -5
  1410. package/dist/options-BJtdsK7b.js +0 -8
  1411. package/dist/options-BKDxrPvE.js +0 -5
  1412. package/dist/options-BLfymS4s.js +0 -5
  1413. package/dist/options-BOCRbzh3.js +0 -5
  1414. package/dist/options-BOqfYsM1.js +0 -13
  1415. package/dist/options-BQWJqwHO.js +0 -9
  1416. package/dist/options-BQunK6_Y.js +0 -8
  1417. package/dist/options-BQyrZjwM.js +0 -28
  1418. package/dist/options-BR9xTHZW.js +0 -5
  1419. package/dist/options-BRUdd5jY.js +0 -8
  1420. package/dist/options-BSsYXjhC.js +0 -9
  1421. package/dist/options-BTmaRzx2.d.ts +0 -60
  1422. package/dist/options-BUCQYAeJ.d.ts +0 -10
  1423. package/dist/options-B_NrjVDt.d.ts +0 -12
  1424. package/dist/options-BawzwlmC.js +0 -11
  1425. package/dist/options-BbLDAp7G.d.ts +0 -10
  1426. package/dist/options-BfPsL7E2.js +0 -9
  1427. package/dist/options-Bfmwwc78.js +0 -8
  1428. package/dist/options-BhsdveDk.js +0 -21
  1429. package/dist/options-BomoTH-8.js +0 -5
  1430. package/dist/options-BtjkzIVh.js +0 -8
  1431. package/dist/options-Bvi9bl4H.js +0 -5
  1432. package/dist/options-BwKNmaJo.js +0 -5
  1433. package/dist/options-BxpLtyk-.js +0 -18
  1434. package/dist/options-BzB2QxL3.js +0 -5
  1435. package/dist/options-C078wBP0.js +0 -5
  1436. package/dist/options-C3AdsFJ6.js +0 -9
  1437. package/dist/options-C7C5OhmL.d.ts +0 -8
  1438. package/dist/options-C87u6eSa.js +0 -10
  1439. package/dist/options-CBAEGxwS.js +0 -8
  1440. package/dist/options-CDSCkYxu.d.ts +0 -14
  1441. package/dist/options-CDUr8zzX.js +0 -8
  1442. package/dist/options-CF6EVF_G.js +0 -17
  1443. package/dist/options-CFjGxfa8.js +0 -5
  1444. package/dist/options-CI6P0xhV.js +0 -10
  1445. package/dist/options-CJFMK9A_.js +0 -8
  1446. package/dist/options-CLpgx7en.js +0 -10
  1447. package/dist/options-CSCXNYJO.d.ts +0 -8
  1448. package/dist/options-CTXHj9zr.js +0 -16
  1449. package/dist/options-CTl8T88w.js +0 -11
  1450. package/dist/options-CUIOOv4z.js +0 -15
  1451. package/dist/options-CZDmtsbV.js +0 -8
  1452. package/dist/options-CZTscdPB.js +0 -5
  1453. package/dist/options-CZdKndeo.js +0 -9
  1454. package/dist/options-C_7g9TTq.d.ts +0 -12
  1455. package/dist/options-Cb2FOFj5.js +0 -5
  1456. package/dist/options-CbOstLa7.js +0 -5
  1457. package/dist/options-CcXgWlvm.js +0 -24
  1458. package/dist/options-CfVPctAw.js +0 -89
  1459. package/dist/options-Cjgaf8ub.js +0 -8
  1460. package/dist/options-CoSPgWKy.js +0 -9
  1461. package/dist/options-CpZ2HlSU.js +0 -32
  1462. package/dist/options-CsSe8Nba.js +0 -8
  1463. package/dist/options-CsvJR-r2.js +0 -9
  1464. package/dist/options-Cucv6sWP.js +0 -12
  1465. package/dist/options-CyjL9lTf.js +0 -5
  1466. package/dist/options-D-OOO9V2.d.ts +0 -10
  1467. package/dist/options-D0Y6ZMe8.js +0 -5
  1468. package/dist/options-D0bzZx9a.d.ts +0 -10
  1469. package/dist/options-D0sj5abR.js +0 -9
  1470. package/dist/options-D1hSuf50.d.ts +0 -12
  1471. package/dist/options-D610Fa6T.js +0 -5
  1472. package/dist/options-D96dScev.js +0 -24
  1473. package/dist/options-DFpyP1bg.js +0 -5
  1474. package/dist/options-DJEcS4DX.js +0 -5
  1475. package/dist/options-DJbN3bi9.js +0 -11
  1476. package/dist/options-DKoQoRCy.js +0 -13
  1477. package/dist/options-DM1qaMMQ.js +0 -9
  1478. package/dist/options-DNgSwhsm.js +0 -11
  1479. package/dist/options-DOIwzRXL.js +0 -16
  1480. package/dist/options-DRIgHh4O.d.ts +0 -16
  1481. package/dist/options-DRrZmJyI.js +0 -8
  1482. package/dist/options-DSCW40_5.js +0 -12
  1483. package/dist/options-DUMUsvml.js +0 -5
  1484. package/dist/options-DWwL5Kaz.js +0 -9
  1485. package/dist/options-DZHZYlpD.js +0 -10
  1486. package/dist/options-DZLkeqWn.js +0 -9
  1487. package/dist/options-DZRpXKQE.js +0 -5
  1488. package/dist/options-DZen3UiC.js +0 -14
  1489. package/dist/options-D_9Vxx7f.js +0 -8
  1490. package/dist/options-DcHl59RC.js +0 -11
  1491. package/dist/options-Dcaql09y.js +0 -11
  1492. package/dist/options-DcnBNYmV.js +0 -8
  1493. package/dist/options-DdpM-fiP.js +0 -9
  1494. package/dist/options-DhoLMknl.js +0 -10
  1495. package/dist/options-DlohRAYd.d.ts +0 -13
  1496. package/dist/options-Dpy-Ruo-.js +0 -14
  1497. package/dist/options-DsVuVRH3.d.ts +0 -17
  1498. package/dist/options-DtAJxfHS.js +0 -8
  1499. package/dist/options-Dz9Yo52Z.js +0 -8
  1500. package/dist/options-HnfETSHr.d.ts +0 -19
  1501. package/dist/options-LqUXTpML.js +0 -8
  1502. package/dist/options-MsloEAIB.js +0 -5
  1503. package/dist/options-P2FxqYpd.js +0 -17
  1504. package/dist/options-_1gAIMq7.d.ts +0 -60
  1505. package/dist/options-aT89JqlB.js +0 -5
  1506. package/dist/options-cVKZu9b0.js +0 -9
  1507. package/dist/options-eTepQ1rZ.js +0 -15
  1508. package/dist/options-fkShrmGQ.js +0 -8
  1509. package/dist/options-gUvfr3no.js +0 -11
  1510. package/dist/options-hynwKWuf.js +0 -20
  1511. package/dist/options-jsOCvLUz.js +0 -10
  1512. package/dist/options-o5wCw8H7.d.ts +0 -14
  1513. package/dist/options-p49DFg3H.js +0 -8
  1514. package/dist/options-pYNpXKcg.js +0 -8
  1515. package/dist/options-qtETCHzW.js +0 -10
  1516. package/dist/options-rnKlqYEr.js +0 -5
  1517. package/dist/options-sU_zGkiV.js +0 -10
  1518. package/dist/options-xq4MXG1M.js +0 -5
  1519. package/dist/options-zzlznRA7.js +0 -10
  1520. package/dist/outbox-BZ712Z3X.d.ts +0 -199
  1521. package/dist/payments-BXvabJOw.js +0 -16
  1522. package/dist/payments-BYcN34Fp.d.ts +0 -114
  1523. package/dist/permissions-controller-BMsqIE5T.js +0 -34
  1524. package/dist/pg-error-B5QLDcbG.js +0 -26
  1525. package/dist/plugin-AKwwe2gF.js +0 -48
  1526. package/dist/pool-DDR1ndk7.d.ts +0 -123
  1527. package/dist/pool-errors-JUBcGrre.js +0 -27
  1528. package/dist/ports-DOrPTJzl.d.ts +0 -89
  1529. package/dist/ports-DvpNseap.js +0 -152
  1530. package/dist/postgrest-AJc8hnJU.d.ts +0 -53
  1531. package/dist/postgrest-executor-B_Uezhrm.js +0 -1068
  1532. package/dist/preset-CXhpPmPV.js +0 -1042
  1533. package/dist/problem-Bf0cJ7tk.js +0 -162
  1534. package/dist/problem-DNwN8iGz.d.ts +0 -79
  1535. package/dist/project-DJ9Uo0sT.js +0 -1760
  1536. package/dist/provider-B6g7rBZX.js +0 -57
  1537. package/dist/provider-CWjzAIX9.d.ts +0 -112
  1538. package/dist/push-token-B4vcIU4s.d.ts +0 -24
  1539. package/dist/push-token-D6REHMMw.js +0 -16
  1540. package/dist/queries-BWYYS9um.js +0 -239
  1541. package/dist/range-DwpWe8e7.js +0 -7
  1542. package/dist/range-p5V4rBhZ.d.ts +0 -8
  1543. package/dist/rank-keys-DcPMt_Jk.js +0 -60
  1544. package/dist/rank-result-BBJIK-k_.js +0 -18
  1545. package/dist/rank-result-Bwe7igy-.d.ts +0 -14
  1546. package/dist/rate-limit-BWKGlhTM.js +0 -49
  1547. package/dist/rate-limit-Bztf32cl.d.ts +0 -50
  1548. package/dist/rate-limit-fZ_d8gSE.js +0 -380
  1549. package/dist/ratelimit-headers-kEcXyO3H.js +0 -62
  1550. package/dist/react-BKCnIuZs.js +0 -79
  1551. package/dist/react-mdVjpewL.js +0 -1016
  1552. package/dist/read-set-B1sDib5O.js +0 -199
  1553. package/dist/realtime-status-BhNkb-Ow.d.ts +0 -8
  1554. package/dist/realtime-status-asHvhiOh.js +0 -11
  1555. package/dist/record-bindings-Z51mGfhB.js +0 -26
  1556. package/dist/record-form-CubgBrtI.d.ts +0 -82
  1557. package/dist/record-type-BEUyEsFx.js +0 -221
  1558. package/dist/recordings-DeZYx-Kv.d.ts +0 -119
  1559. package/dist/refresh-D02Pbf5B.d.ts +0 -54
  1560. package/dist/refresh-DLBgnxjL.js +0 -144
  1561. package/dist/refusal-B0VmlAxF.d.ts +0 -32
  1562. package/dist/refusal-DDlInPff.js +0 -64
  1563. package/dist/relay-CIKcAVjf.js +0 -248
  1564. package/dist/resolve-B0mW2m7f.js +0 -932
  1565. package/dist/resolve-CtX6T0c0.d.ts +0 -288
  1566. package/dist/resolved-names-kMRjmSIy.js +0 -133
  1567. package/dist/resource-BUJcZKiW.js +0 -520
  1568. package/dist/resource-DvgXqZB_.js +0 -105
  1569. package/dist/resource-WxN0IsvB.d.ts +0 -123
  1570. package/dist/resource-execute-BzqR8DdD.d.ts +0 -15
  1571. package/dist/resource-schemas-up6bKOUi.js +0 -82
  1572. package/dist/resource-types-BVbHgTPg.d.ts +0 -157
  1573. package/dist/resources-BSbRa0Ab.d.ts +0 -7
  1574. package/dist/resources-jb3R6rEa.js +0 -64
  1575. package/dist/respond-CZMWbUs3.js +0 -107
  1576. package/dist/respond-Dzu_-EPH.d.ts +0 -112
  1577. package/dist/result-DZeA5KS6.d.ts +0 -351
  1578. package/dist/result-ntFBW2p2.js +0 -146
  1579. package/dist/rows-BdqXmiB-.js +0 -80
  1580. package/dist/rows-jijHLVE_.js +0 -39
  1581. package/dist/rrule-C9Ot6ax8.js +0 -290
  1582. package/dist/run-state-BMCD_1Lt.d.ts +0 -13
  1583. package/dist/run-state-CgBKzYMW.js +0 -13
  1584. package/dist/run-watch-B-LoK5m1.js +0 -53
  1585. package/dist/runtime-LRJM7UqY.js +0 -44
  1586. package/dist/sales-lines-BsmrNHe9.d.ts +0 -38
  1587. package/dist/sales-lines-DO7oRu1o.js +0 -45
  1588. package/dist/sales-shared-BuTA8JK7.js +0 -22
  1589. package/dist/schemas-CLOTvdsC.js +0 -216
  1590. package/dist/scope-DgWjuXUw.js +0 -90
  1591. package/dist/scores-Y8TvyJi1.d.ts +0 -174
  1592. package/dist/scores-bY2Is0kx.js +0 -177
  1593. package/dist/search-Cn_DGluL.js +0 -9
  1594. package/dist/server-types-BkTIxW_H.d.ts +0 -597
  1595. package/dist/session-BOzx2qHC.d.ts +0 -100
  1596. package/dist/session-status-BP8eYVnA.d.ts +0 -82
  1597. package/dist/shared-BeHTi8Fu.js +0 -17
  1598. package/dist/shared-Bf-I13Ht.js +0 -91
  1599. package/dist/shared-CRRfQAKG.d.ts +0 -11
  1600. package/dist/sign-in-BzihC_8k.d.ts +0 -50
  1601. package/dist/sign-in-CmPK1AgM.js +0 -402
  1602. package/dist/sign-in-CuZ1Ag7O.js +0 -718
  1603. package/dist/sign-in-D54FLMQy.d.ts +0 -55
  1604. package/dist/signatures-CX1b4WHa.js +0 -145
  1605. package/dist/signatures-Dkx9OE8j.d.ts +0 -43
  1606. package/dist/signers-ZmxO1I05.d.ts +0 -390
  1607. package/dist/signing-keys-CWtpMask.js +0 -164
  1608. package/dist/signing-keys-udgP7Aod.d.ts +0 -119
  1609. package/dist/simplify-DDO0j0LI.js +0 -83
  1610. package/dist/spec-BMvCCNnd.js +0 -124
  1611. package/dist/spec-pins-BZkKfwY8.d.ts +0 -127
  1612. package/dist/spec-pins-D3zDek-u.js +0 -62
  1613. package/dist/sql-CYt7EhH0.js +0 -421
  1614. package/dist/sql-DHp0L7zK.js +0 -138385
  1615. package/dist/sql-type-iUSZpaUu.js +0 -34
  1616. package/dist/sso-CkU_4mtK.d.ts +0 -161
  1617. package/dist/sso-DdDpJQzw.js +0 -217
  1618. package/dist/standard-BA3mLh6w.js +0 -25
  1619. package/dist/standard-DBV730sF.d.ts +0 -7
  1620. package/dist/stats-BHl1-zj9.js +0 -83
  1621. package/dist/statuses-Alll5Ip6.js +0 -29
  1622. package/dist/statuses-zRcc2TeZ.js +0 -28
  1623. package/dist/storage-api-Dg78Wqsg.js +0 -10
  1624. package/dist/store-CpheI-lN.d.ts +0 -83
  1625. package/dist/store-McN-2esd.js +0 -69
  1626. package/dist/stripe-BJUfp5jM.js +0 -32
  1627. package/dist/stripe-X22LjuH-.d.ts +0 -156
  1628. package/dist/subject-readers-CB5Te02u.d.ts +0 -21
  1629. package/dist/subject-readers-VHcrWhmq.js +0 -49
  1630. package/dist/subject-type-BRnK7Av3.js +0 -8
  1631. package/dist/subjects-BYCL-6hA.d.ts +0 -145
  1632. package/dist/subjects-CiBNKy2y.d.ts +0 -90
  1633. package/dist/subscribers-BvZxcd63.js +0 -33
  1634. package/dist/summaries-8jQTELIX.d.ts +0 -69
  1635. package/dist/supabase-mcp-Dz9DgrKP.js +0 -28
  1636. package/dist/supabase-mcp-Z4vtsuoO.d.ts +0 -46
  1637. package/dist/support-BxyPOFk4.d.ts +0 -357
  1638. package/dist/support-view-g4YLBeqX.js +0 -18
  1639. package/dist/support-view-nqUWKHEs.d.ts +0 -17
  1640. package/dist/table-schema-BlF6k62Q.d.ts +0 -81
  1641. package/dist/table-schema-C80xItaV.js +0 -293
  1642. package/dist/tables-Cb-3_VWc.js +0 -73
  1643. package/dist/tags-CIZTqtlY.js +0 -39
  1644. package/dist/tags-Cm48BsOa.d.ts +0 -30
  1645. package/dist/tax-BkCNWWMc.js +0 -140
  1646. package/dist/tax-DPShHual.d.ts +0 -170
  1647. package/dist/tee-V97_v1ZS.js +0 -101
  1648. package/dist/template-Drgg3v2J.js +0 -126
  1649. package/dist/temporal-Dbo0fLzc.js +0 -95
  1650. package/dist/temporal-required-DcLhnDhQ.js +0 -20
  1651. package/dist/tenant-BgIiMQpo.js +0 -27
  1652. package/dist/tenant-FfgNhd5x.d.ts +0 -17
  1653. package/dist/tenant-source-bqWpSr86.js +0 -8
  1654. package/dist/timeline-DqEoD8bb.d.ts +0 -151
  1655. package/dist/timeline-Dz3hO2I6.js +0 -50
  1656. package/dist/timing-dypS0nxW.js +0 -95
  1657. package/dist/topic-BaUElNw2.d.ts +0 -415
  1658. package/dist/topic-DnsNG4Kj.js +0 -643
  1659. package/dist/ttl-cache-Bhr9swjT.js +0 -32
  1660. package/dist/types-B-D6fYx2.d.ts +0 -194
  1661. package/dist/types-CK2X2wCB.d.ts +0 -618
  1662. package/dist/types-CMN0h_Ix.d.ts +0 -461
  1663. package/dist/types-CPl9uJ0G.d.ts +0 -912
  1664. package/dist/types-CwQgFo8c.d.ts +0 -177
  1665. package/dist/types-DMihLukJ.d.ts +0 -251
  1666. package/dist/types-R6syp1el.js +0 -29
  1667. package/dist/types-iCyZ3lMx.d.ts +0 -217
  1668. package/dist/types-nspa5I-a.d.ts +0 -664
  1669. package/dist/undo-0HkWXASn.d.ts +0 -46
  1670. package/dist/undo-BbftL9-4.js +0 -44
  1671. package/dist/upload-claim-B1ZU8ydB.js +0 -33
  1672. package/dist/usage-BkWAPkg2.d.ts +0 -232
  1673. package/dist/user-change-DgWC6RRC.js +0 -135
  1674. package/dist/variants-Cy--Ub-a.js +0 -53
  1675. package/dist/vault-BkdPmL7f.d.ts +0 -62
  1676. package/dist/verify-41mZmspj.d.ts +0 -146
  1677. package/dist/verify-7EucfCnv.js +0 -130
  1678. package/dist/view-C8Ve14ja.js +0 -247
  1679. package/dist/view-C8_xvD-j.d.ts +0 -97
  1680. package/dist/watch-topic-BabDTZ-L.d.ts +0 -31
  1681. package/dist/watch-topic-CuaWfCuv.js +0 -57
  1682. package/dist/wire-ChYn1g21.js +0 -91
  1683. package/dist/wiring-CDNuQoJJ.js +0 -13
  1684. package/dist/workflow-sdk-Cf0LAOFF.js +0 -242
  1685. package/dist/workflow-sdk-DJJkP0dT.js +0 -2545
  1686. package/dist/workflow-sdk-rg3IbCZC.d.ts +0 -163
  1687. package/dist/workflows-xL6t0TXx.d.ts +0 -258
@@ -0,0 +1,2029 @@
1
+ import { n as CliError } from "./errors-DcJ_PayO.js";
2
+ import { i as readStdin, t as display } from "./io-CQzy8PEZ.js";
3
+ import { t as isRecord } from "./guards-DxwRG0Uv.js";
4
+ import { c as resolve$1, i as extname$1, n as basename$1, o as join$1, r as dirname$1, s as normalize$1, t as resolveModulePath } from "./dist-MKwjiW2w.js";
5
+ import { _ as parse$1, d as readSupabaseToml, f as schemaPaths, g as tomlNumber, p as sqlWorkflow, s as findUp } from "./supabase-toml-B6-eEV5p.js";
6
+ import { A as strictObject, C as optional, D as record, E as rawCheck, M as union, N as unknown, O as regex, S as objectWithRest, T as pipe, _ as minLength, a as array, b as number, c as exactOptional, f as lazy, g as maxValue, h as maxLength, j as string, k as safeParse, l as getDotPath, m as literal, o as boolean, p as length, s as custom, u as integer, v as minValue, w as picklist, y as nullable } from "./env-BCuUsWOh.js";
7
+ import { t as importFresh } from "./fresh-import-CdO2oQaQ.js";
8
+ import { n as readStackStatus } from "./stack-status-Mxgqb3I4.js";
9
+ import * as nodeUtil from "node:util";
10
+ import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
11
+ import { dirname, join, resolve } from "node:path";
12
+ import { readFile, rm } from "node:fs/promises";
13
+ import { pathToFileURL } from "node:url";
14
+ import { APP_COLUMN_ACCESS, APP_COLUMN_FORMATS, APP_COLUMN_TYPES, APP_ON_DELETE_ACTIONS, APP_ROLLUP_AGGREGATES, APP_TABLE_EVENT_KINDS, CONFIG_GROUPS, GEN_TASKS, INTEGRATION_NAMES, RENAMED_CONFIG_KEYS, SKILLS_AGENTS, providerApiProblem, resolveConfig } from "better-supabase/config";
15
+ import { CONVENTION_FIELDS } from "better-supabase/preset";
16
+ import { SCOPE_ID_TYPES, parseBsbComment, scopeProblems, tableTagComments } from "better-supabase/sql";
17
+ import { homedir } from "node:os";
18
+ // src/cli/subject-tag.ts
19
+ const PERMISSION_PREFIX = "can-";
20
+ function text$1(value) {
21
+ return typeof value === "string" ? value : void 0;
22
+ }
23
+ function columns(value) {
24
+ return typeof value === "string" ? value.split(",").map((item) => item.trim()).filter((item) => item !== "") : [];
25
+ }
26
+ /**
27
+ * The `subject` entry a tag stands for. `table` is the tagged table. Options
28
+ * the tag has no word for (`search.from`, `search.watch`, row grants) stay in
29
+ * `subjects`.
30
+ */
31
+ function subjectFromTag(args, table) {
32
+ const tenant = text$1(args["tenant"]);
33
+ const searchTitle = text$1(args["search-title"]);
34
+ const searchBody = columns(args["search-body"]);
35
+ const description = text$1(args["search-description"]);
36
+ const exclude = text$1(args["search-exclude"]);
37
+ const versions = columns(args["versions"]);
38
+ const rank = text$1(args["rank"]);
39
+ const permissions = Object.fromEntries(Object.entries(args).flatMap(([key, value]) => key.startsWith(PERMISSION_PREFIX) && typeof value === "string" ? [[key.slice(4), value]] : []));
40
+ const search = searchTitle !== void 0 || searchBody.length > 0 || description !== void 0 || exclude !== void 0 || args["search"] === true;
41
+ const id = text$1(args["id"]);
42
+ const idType = text$1(args["id-type"]);
43
+ const title = text$1(args["title"]);
44
+ const url = text$1(args["url"]);
45
+ const scope = text$1(args["scope"]);
46
+ const deletedAt = text$1(args["deleted-at"]);
47
+ const rankGroup = text$1(args["rank-group"]);
48
+ return {
49
+ table,
50
+ ...id === void 0 ? {} : { id },
51
+ ...idType === void 0 ? {} : { idType },
52
+ ...tenant === void 0 ? {} : { tenant: tenant === "false" ? false : tenant },
53
+ ...title === void 0 ? {} : { title },
54
+ ...url === void 0 ? {} : { url },
55
+ ...scope === void 0 ? {} : { scope },
56
+ ...args["cascade"] === true ? { cascade: true } : {},
57
+ ...deletedAt === void 0 ? {} : { deletedAt },
58
+ ...Object.keys(permissions).length === 0 ? {} : { permissions },
59
+ ...search ? { search: {
60
+ ...searchTitle === void 0 ? {} : { title: searchTitle },
61
+ ...searchBody.length === 0 ? {} : { body: searchBody },
62
+ ...description === void 0 ? {} : { description },
63
+ ...exclude === void 0 ? {} : { exclude }
64
+ } } : {},
65
+ ...rank === void 0 && rankGroup === void 0 ? {} : { rank: {
66
+ column: rank ?? "rank",
67
+ ...rankGroup === void 0 ? {} : { group: rankGroup }
68
+ } },
69
+ ...versions.length === 0 ? {} : { versions: {
70
+ columns: versions,
71
+ auto: args["versions-auto"] !== "false"
72
+ } }
73
+ };
74
+ }
75
+ /**
76
+ * The tag arguments for `subject`, or `undefined` when the entry holds an
77
+ * option a tag can't carry, so it stays in `subjects`.
78
+ */
79
+ function subjectTagArgs(type, subject, table) {
80
+ const permissions = Object.entries(subject.permissions ?? {});
81
+ if (permissions.some(([, value]) => typeof value !== "string") || subject.search?.from !== void 0 || subject.search?.watch !== void 0) return;
82
+ const args = {};
83
+ const set = (key, value) => {
84
+ if (value !== void 0) args[key] = value;
85
+ };
86
+ set("type", type === table ? void 0 : type);
87
+ set("id", subject.id);
88
+ set("id-type", subject.idType);
89
+ set("tenant", subject.tenant === false ? "false" : subject.tenant);
90
+ set("title", subject.title);
91
+ set("url", subject.url);
92
+ set("scope", subject.scope);
93
+ set("cascade", subject.cascade === true ? true : void 0);
94
+ set("deleted-at", subject.deletedAt);
95
+ set("search-title", subject.search?.title);
96
+ set("search-body", subject.search?.body === void 0 ? void 0 : subject.search.body.join(","));
97
+ set("search-description", subject.search?.description);
98
+ set("search-exclude", subject.search?.exclude);
99
+ set("search", subject.search !== void 0 && Object.keys(args).every((key) => !key.startsWith("search-")) ? true : void 0);
100
+ set("rank", subject.rank?.column);
101
+ set("rank-group", subject.rank?.group);
102
+ if (subject.versions !== void 0) {
103
+ set("versions", subject.versions.columns.join(","));
104
+ set("versions-auto", subject.versions.auto ? void 0 : "false");
105
+ }
106
+ for (const [action, key] of permissions) set(`${PERMISSION_PREFIX}${action}`, typeof key === "string" ? key : void 0);
107
+ return args;
108
+ }
109
+ // src/cli/gen/table-tags.ts
110
+ const DISTANCES = /* @__PURE__ */ new Set([
111
+ "cosine",
112
+ "l2",
113
+ "inner_product"
114
+ ]);
115
+ function isDistance(value) {
116
+ return DISTANCES.has(value);
117
+ }
118
+ const IMPORT_PREFIX = "import:";
119
+ function isColumnType(value) {
120
+ return APP_COLUMN_TYPES.some((type) => type === value);
121
+ }
122
+ function isEventKind(value) {
123
+ return APP_TABLE_EVENT_KINDS.some((kind) => kind === value);
124
+ }
125
+ function list(value) {
126
+ return typeof value === "string" ? value.split(",").map((item) => item.trim()).filter((item) => item !== "") : [];
127
+ }
128
+ function text(value) {
129
+ return typeof value === "string" ? value : void 0;
130
+ }
131
+ /**
132
+ * `config` with the per-table features the schema's `@bsb` table comments turn
133
+ * on (ADR 0102): `subject`, `realtime`, `vector-search`, `json` (`column=Type`,
134
+ * or `column=import:module#Name`), `encrypted` (`column=type`, a bare column is
135
+ * text) and `events` (`on`, `include`). `audit`, `audit-reads` and `expose`
136
+ * change the table's SQL only, so `gen` has nothing to read from them. A key
137
+ * the config sets itself wins, so a project can move to tags one table at a
138
+ * time. Tables outside `config.schemas` are ignored.
139
+ */
140
+ function withTableTags(config, tables) {
141
+ const subjects = { ...config.subjects };
142
+ const realtimeTables = [...config.realtime.tables];
143
+ const realtimeGlobal = [...config.realtime.global];
144
+ const realtimeUsers = { ...config.realtime.users };
145
+ const vectorSearch = [...config.vectorSearch];
146
+ const json = { ...config.json };
147
+ const appTables = { ...config.appTables };
148
+ const fromTags = /* @__PURE__ */ new Set();
149
+ const eventTables = /* @__PURE__ */ new Set();
150
+ let changed = false;
151
+ for (const table of tables) {
152
+ if (!config.schemas.includes(table.schema)) continue;
153
+ const { tags } = parseBsbComment(table.comment);
154
+ if (tags.length === 0) continue;
155
+ const qualified = `${table.schema}.${table.name}`;
156
+ const short = table.schema === "public" ? table.name : qualified;
157
+ const names = /* @__PURE__ */ new Set([short, qualified]);
158
+ for (const tag of tags) if (tag.name === "subject") {
159
+ const type = text(tag.args["type"]) ?? table.name;
160
+ if (subjects[type] === void 0) {
161
+ subjects[type] = subjectFromTag(tag.args, short);
162
+ changed = true;
163
+ }
164
+ } else if (tag.name === "realtime" && !realtimeTables.some((each) => names.has(each))) {
165
+ realtimeTables.push(short);
166
+ const user = text(tag.args["user"]);
167
+ if (tag.args["global"] === true) realtimeGlobal.push(short);
168
+ if (user !== void 0) realtimeUsers[short] = user;
169
+ changed = true;
170
+ } else if (tag.name === "json") for (const [column, value] of Object.entries(tag.args)) {
171
+ const key = `${short}.${column}`;
172
+ const taken = [key, `${qualified}.${column}`].some((each) => each in json);
173
+ if (typeof value === "string" && !taken) {
174
+ json[key] = value.startsWith(IMPORT_PREFIX) ? { import: value.slice(7) } : { type: value };
175
+ changed = true;
176
+ }
177
+ }
178
+ else if (tag.name === "encrypted" && table.schema === "public") for (const [column, value] of Object.entries(tag.args)) {
179
+ const type = value === true ? "text" : value;
180
+ const own = appTables[table.name];
181
+ const existing = own?.columns?.[column];
182
+ const key = `${table.name}.${column}`;
183
+ if (isColumnType(type) && (existing === void 0 || fromTags.has(key))) {
184
+ fromTags.add(key);
185
+ const entry = {
186
+ ...existing,
187
+ type,
188
+ encrypted: true
189
+ };
190
+ appTables[table.name] = {
191
+ ...own,
192
+ columns: {
193
+ ...own?.columns,
194
+ [column]: entry
195
+ }
196
+ };
197
+ changed = true;
198
+ }
199
+ }
200
+ else if (tag.name === "server" && table.schema === "public") for (const column of Object.keys(tag.args)) {
201
+ const own = appTables[table.name];
202
+ const existing = own?.columns?.[column];
203
+ const key = `${table.name}.${column}`;
204
+ if (existing === void 0 || fromTags.has(key)) {
205
+ fromTags.add(key);
206
+ const entry = {
207
+ type: "text",
208
+ ...existing,
209
+ access: "server"
210
+ };
211
+ appTables[table.name] = {
212
+ ...own,
213
+ columns: {
214
+ ...own?.columns,
215
+ [column]: entry
216
+ }
217
+ };
218
+ changed = true;
219
+ }
220
+ }
221
+ else if (tag.name === "events" && table.schema === "public" && appTables[table.name]?.events === void 0) {
222
+ const on = list(tag.args["on"]).filter(isEventKind);
223
+ const include = list(tag.args["include"]);
224
+ const events = on.length === 0 && include.length === 0 ? true : {
225
+ ...on.length === 0 ? {} : { on },
226
+ ...include.length === 0 ? {} : { include }
227
+ };
228
+ appTables[table.name] = {
229
+ ...appTables[table.name],
230
+ events
231
+ };
232
+ eventTables.add(table.name);
233
+ changed = true;
234
+ } else if (tag.name === "vector-search" && !vectorSearch.some((each) => names.has(each.table))) {
235
+ const column = text(tag.args["column"]);
236
+ const distance = text(tag.args["distance"]) ?? "cosine";
237
+ if (column !== void 0 && isDistance(distance)) {
238
+ vectorSearch.push({
239
+ table: short,
240
+ column,
241
+ distance
242
+ });
243
+ changed = true;
244
+ }
245
+ }
246
+ }
247
+ for (const name of eventTables) {
248
+ const type = Object.entries(subjects).find(([, subject]) => subject.table === name || subject.table === `public.${name}`)?.[0];
249
+ if (type !== void 0) appTables[name] = {
250
+ ...appTables[name],
251
+ subject: { type }
252
+ };
253
+ }
254
+ return changed ? {
255
+ ...config,
256
+ subjects,
257
+ vectorSearch,
258
+ json,
259
+ appTables,
260
+ realtime: {
261
+ ...config.realtime,
262
+ tables: realtimeTables,
263
+ global: realtimeGlobal,
264
+ users: realtimeUsers
265
+ }
266
+ } : config;
267
+ }
268
+ // ../../node_modules/.pnpm/rc9@3.1.0/node_modules/rc9/dist/_chunks/libs/flat.mjs
269
+ function isBuffer(obj) {
270
+ return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
271
+ }
272
+ function keyIdentity(key) {
273
+ return key;
274
+ }
275
+ function flatten(target, opts) {
276
+ opts = opts || {};
277
+ const delimiter = opts.delimiter || ".";
278
+ const maxDepth = opts.maxDepth;
279
+ const transformKey = opts.transformKey || keyIdentity;
280
+ const output = {};
281
+ function step(object, prev, currentDepth) {
282
+ currentDepth = currentDepth || 1;
283
+ Object.keys(object).forEach(function(key) {
284
+ const value = object[key];
285
+ const isarray = opts.safe && Array.isArray(value);
286
+ const type = Object.prototype.toString.call(value);
287
+ const isbuffer = isBuffer(value);
288
+ const isobject = type === "[object Object]" || type === "[object Array]";
289
+ const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
290
+ if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
291
+ output[newKey] = value;
292
+ });
293
+ }
294
+ step(target);
295
+ return output;
296
+ }
297
+ function unflatten(target, opts) {
298
+ opts = opts || {};
299
+ const delimiter = opts.delimiter || ".";
300
+ const overwrite = opts.overwrite || false;
301
+ const transformKey = opts.transformKey || keyIdentity;
302
+ const result = {};
303
+ if (isBuffer(target) || Object.prototype.toString.call(target) !== "[object Object]") return target;
304
+ function getkey(key) {
305
+ const parsedKey = Number(key);
306
+ return isNaN(parsedKey) || key.indexOf(".") !== -1 || opts.object ? key : parsedKey;
307
+ }
308
+ function addKeys(keyPrefix, recipient, target) {
309
+ return Object.keys(target).reduce(function(result, key) {
310
+ result[keyPrefix + delimiter + key] = target[key];
311
+ return result;
312
+ }, recipient);
313
+ }
314
+ function isEmpty(val) {
315
+ const type = Object.prototype.toString.call(val);
316
+ const isArray = type === "[object Array]";
317
+ const isObject = type === "[object Object]";
318
+ if (!val) return true;
319
+ else if (isArray) return !val.length;
320
+ else if (isObject) return !Object.keys(val).length;
321
+ }
322
+ target = Object.keys(target).reduce(function(result, key) {
323
+ const type = Object.prototype.toString.call(target[key]);
324
+ if (!(type === "[object Object]" || type === "[object Array]") || isEmpty(target[key])) {
325
+ result[key] = target[key];
326
+ return result;
327
+ } else return addKeys(key, result, flatten(target[key], opts));
328
+ }, {});
329
+ Object.keys(target).forEach(function(key) {
330
+ const split = key.split(delimiter).map(transformKey);
331
+ let key1 = getkey(split.shift());
332
+ let key2 = getkey(split[0]);
333
+ let recipient = result;
334
+ while (key2 !== void 0) {
335
+ if (key1 === "__proto__") return;
336
+ const type = Object.prototype.toString.call(recipient[key1]);
337
+ const isobject = type === "[object Object]" || type === "[object Array]";
338
+ if (!overwrite && !isobject && typeof recipient[key1] !== "undefined") return;
339
+ if (overwrite && !isobject || !overwrite && recipient[key1] == null) recipient[key1] = typeof key2 === "number" && !opts.object ? [] : {};
340
+ recipient = recipient[key1];
341
+ if (split.length > 0) {
342
+ key1 = getkey(split.shift());
343
+ key2 = getkey(split[0]);
344
+ }
345
+ }
346
+ recipient[key1] = unflatten(target[key], opts);
347
+ });
348
+ return result;
349
+ }
350
+ // ../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs
351
+ const suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
352
+ const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
353
+ const JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
354
+ function jsonParseTransform(key, value) {
355
+ if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
356
+ warnKeyDropped(key);
357
+ return;
358
+ }
359
+ return value;
360
+ }
361
+ function warnKeyDropped(key) {
362
+ console.warn(`[destr] Dropping "${key}" key to prevent prototype pollution.`);
363
+ }
364
+ function destr(value, options = {}) {
365
+ if (typeof value !== "string") return value;
366
+ if (value[0] === "\"" && value[value.length - 1] === "\"" && value.indexOf("\\") === -1) return value.slice(1, -1);
367
+ const _value = value.trim();
368
+ if (_value.length <= 9) switch (_value.toLowerCase()) {
369
+ case "true": return true;
370
+ case "false": return false;
371
+ case "undefined": return;
372
+ case "null": return null;
373
+ case "nan": return NaN;
374
+ case "infinity": return Number.POSITIVE_INFINITY;
375
+ case "-infinity": return Number.NEGATIVE_INFINITY;
376
+ }
377
+ if (!JsonSigRx.test(value)) {
378
+ if (options.strict) throw new SyntaxError("[destr] Invalid JSON");
379
+ return value;
380
+ }
381
+ try {
382
+ if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
383
+ if (options.strict) throw new Error("[destr] Possible prototype pollution");
384
+ return JSON.parse(value, jsonParseTransform);
385
+ }
386
+ return JSON.parse(value);
387
+ } catch (error) {
388
+ if (options.strict) throw error;
389
+ return value;
390
+ }
391
+ }
392
+ // ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
393
+ function isPlainObject$1(value) {
394
+ if (value === null || typeof value !== "object") return false;
395
+ const prototype = Object.getPrototypeOf(value);
396
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
397
+ if (Symbol.iterator in value) return false;
398
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
399
+ return true;
400
+ }
401
+ function _defu(baseObject, defaults, namespace = ".", merger) {
402
+ if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
403
+ const object = { ...defaults };
404
+ for (const key of Object.keys(baseObject)) {
405
+ if (key === "__proto__" || key === "constructor") continue;
406
+ const value = baseObject[key];
407
+ if (value === null || value === void 0) continue;
408
+ if (merger && merger(object, key, value, namespace)) continue;
409
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
410
+ else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
411
+ else object[key] = value;
412
+ }
413
+ return object;
414
+ }
415
+ function createDefu(merger) {
416
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
417
+ }
418
+ const defu = createDefu();
419
+ // ../../node_modules/.pnpm/rc9@3.1.0/node_modules/rc9/dist/index.mjs
420
+ const RE_KEY_VAL = /^\s*([^\s=]+)\s*=\s*(.*)?\s*$/;
421
+ const RE_LINES = /\n|\r|\r\n/;
422
+ const defaults = {
423
+ name: ".conf",
424
+ dir: process.cwd(),
425
+ flat: false
426
+ };
427
+ function withDefaults(options) {
428
+ if (typeof options === "string") options = { name: options };
429
+ return {
430
+ ...defaults,
431
+ ...options
432
+ };
433
+ }
434
+ function parse(contents, options = {}) {
435
+ const config = {};
436
+ const lines = contents.split(RE_LINES);
437
+ for (const line of lines) {
438
+ const match = line.match(RE_KEY_VAL);
439
+ if (!match) continue;
440
+ const key = match[1];
441
+ if (!key || key === "__proto__" || key === "constructor") continue;
442
+ const value = destr((match[2] || "").trim());
443
+ if (key.endsWith("[]")) {
444
+ const nkey = key.slice(0, Math.max(0, key.length - 2));
445
+ config[nkey] = (config[nkey] || []).concat(value);
446
+ continue;
447
+ }
448
+ config[key] = value;
449
+ }
450
+ return options.flat ? config : unflatten(config, { overwrite: true });
451
+ }
452
+ function parseFile(path, options) {
453
+ if (!existsSync(path)) return {};
454
+ return parse(readFileSync(path, "utf8"), options);
455
+ }
456
+ function read(options) {
457
+ options = withDefaults(options);
458
+ return parseFile(resolve(options.dir, options.name), options);
459
+ }
460
+ function userConfigDir() {
461
+ return process.env.XDG_CONFIG_HOME || resolve(homedir(), ".config");
462
+ }
463
+ function readUserConfig(options) {
464
+ options = withDefaults(options);
465
+ options.dir = userConfigDir();
466
+ return read(options);
467
+ }
468
+ // ../../node_modules/.pnpm/c12@4.0.0-rc.3_dotenv@17.4.2_giget@3.3.1_jiti@2.7.0_magicast@0.5.5/node_modules/c12/dist/index.mjs
469
+ async function setupDotenv(options) {
470
+ const targetEnvironment = options.env ?? process.env;
471
+ const environment = await loadDotenv({
472
+ cwd: options.cwd,
473
+ fileName: options.fileName ?? ".env",
474
+ env: targetEnvironment,
475
+ interpolate: options.interpolate ?? true,
476
+ expandFileReferences: options.expandFileReferences ?? false,
477
+ parse: options.parse
478
+ });
479
+ const dotenvVars = getDotEnvVars(targetEnvironment);
480
+ for (const key in environment) {
481
+ if (key.startsWith("_")) continue;
482
+ if (targetEnvironment[key] === void 0 || dotenvVars.has(key)) targetEnvironment[key] = environment[key];
483
+ }
484
+ return environment;
485
+ }
486
+ async function loadDotenv(options) {
487
+ const environment = Object.create(null);
488
+ const cwd = resolve$1(options.cwd || ".");
489
+ const _fileName = options.fileName || ".env";
490
+ const dotenvFiles = typeof _fileName === "string" ? [_fileName] : _fileName;
491
+ const dotenvVars = getDotEnvVars(options.env || {});
492
+ Object.assign(environment, options.env);
493
+ for (const file of dotenvFiles) {
494
+ const dotenvFile = resolve$1(cwd, file);
495
+ if (!statSync(dotenvFile, { throwIfNoEntry: false })?.isFile()) continue;
496
+ const parsed = await readEnvFile(dotenvFile, options.parse);
497
+ for (const key in parsed) {
498
+ if (key in environment && !dotenvVars.has(key)) continue;
499
+ environment[key] = parsed[key];
500
+ dotenvVars.add(key);
501
+ }
502
+ }
503
+ if (options.expandFileReferences) {
504
+ for (const key in environment) if (key.endsWith("_FILE")) {
505
+ const targetKey = key.slice(0, -5);
506
+ if (environment[targetKey] === void 0) {
507
+ const filePath = environment[key];
508
+ if (filePath && statSync(filePath, { throwIfNoEntry: false })?.isFile()) {
509
+ environment[targetKey] = readFileSync(filePath, "utf8").trim();
510
+ dotenvVars.add(targetKey);
511
+ }
512
+ }
513
+ }
514
+ }
515
+ if (options.interpolate) interpolate(environment);
516
+ return environment;
517
+ }
518
+ let _parseEnv = nodeUtil.parseEnv;
519
+ async function readEnvFile(path, parse) {
520
+ const src = readFileSync(path, "utf8");
521
+ if (parse) return parse(src);
522
+ if (!_parseEnv) try {
523
+ const dotenv = await import("dotenv");
524
+ _parseEnv = (src) => dotenv.parse(src);
525
+ } catch {
526
+ throw new Error("Failed to parse .env file: `node:util.parseEnv` is not available and `dotenv` package is not installed. Please upgrade your runtime, install `dotenv` as a dependency or provide a custom `parse` option.");
527
+ }
528
+ return _parseEnv(src);
529
+ }
530
+ function interpolate(target, source = {}, parse = (v) => v) {
531
+ const raw = { ...target };
532
+ const resolvedValues = /* @__PURE__ */ new Map();
533
+ function getValue(key) {
534
+ return source[key] === void 0 ? raw[key] : source[key];
535
+ }
536
+ function interpolate(value, parents = []) {
537
+ if (typeof value !== "string") return value;
538
+ let result = "";
539
+ let index = 0;
540
+ while (index < value.length) {
541
+ const char = value[index];
542
+ if (char === "\\" && value[index + 1] === "$") {
543
+ result += "$";
544
+ index += 2;
545
+ continue;
546
+ }
547
+ const ref = char === "$" ? parseRef(value, index) : void 0;
548
+ if (!ref) {
549
+ result += char;
550
+ index++;
551
+ continue;
552
+ }
553
+ if (parents.includes(ref.key)) {
554
+ if (ref.defaultValue !== void 0) {
555
+ result += interpolate(ref.defaultValue, parents);
556
+ index = ref.end;
557
+ continue;
558
+ }
559
+ console.warn(`Please avoid recursive environment variables ( loop: ${parents.join(" > ")} > ${ref.key} )`);
560
+ return "";
561
+ }
562
+ let resolved = resolvedValues.has(ref.key) ? resolvedValues.get(ref.key) : interpolate(getValue(ref.key), [...parents, ref.key]);
563
+ if (ref.defaultValue !== void 0 && (resolved === void 0 || ref.operator === ":-" && resolved === "")) resolved = interpolate(ref.defaultValue, parents);
564
+ result += resolved === void 0 ? value.slice(index, ref.end) : resolved;
565
+ index = ref.end;
566
+ }
567
+ return parse(result);
568
+ }
569
+ for (const key in target) {
570
+ target[key] = interpolate(getValue(key));
571
+ resolvedValues.set(key, target[key]);
572
+ }
573
+ }
574
+ const REF_NAME_RE = /\w+/y;
575
+ const BRACED_REF_NAME_RE = /[\w:]+/y;
576
+ function parseRef(input, start) {
577
+ let index = start + 1;
578
+ const braced = input[index] === "{";
579
+ if (braced) index++;
580
+ const nameRe = braced ? BRACED_REF_NAME_RE : REF_NAME_RE;
581
+ nameRe.lastIndex = index;
582
+ const name = nameRe.exec(input);
583
+ if (!name) return;
584
+ let key = name[0];
585
+ index = nameRe.lastIndex;
586
+ if (!braced) return {
587
+ key,
588
+ end: index
589
+ };
590
+ if (input[index] === "}") return {
591
+ key,
592
+ end: index + 1
593
+ };
594
+ if (input[index] === "-") {
595
+ let operator = "-";
596
+ if (key.endsWith(":")) {
597
+ key = key.slice(0, -1);
598
+ operator = ":-";
599
+ }
600
+ const defaultValue = key ? readDefault(input, index + 1) : void 0;
601
+ if (!defaultValue) return;
602
+ return {
603
+ key,
604
+ operator,
605
+ defaultValue: defaultValue.value,
606
+ end: defaultValue.end
607
+ };
608
+ }
609
+ return {
610
+ key,
611
+ end: index
612
+ };
613
+ }
614
+ function readDefault(input, start) {
615
+ let value = "";
616
+ let depth = 1;
617
+ for (let index = start; index < input.length; index++) {
618
+ const char = input[index];
619
+ if (char === "\\" && index + 1 < input.length) {
620
+ const next = input[index + 1];
621
+ value += next === "{" || next === "}" ? next : char + next;
622
+ index++;
623
+ continue;
624
+ }
625
+ if (char === "$" && input[index + 1] === "{") {
626
+ depth++;
627
+ value += "${";
628
+ index++;
629
+ continue;
630
+ }
631
+ if (char === "{") depth++;
632
+ if (char === "}") {
633
+ depth--;
634
+ if (depth === 0) return {
635
+ value,
636
+ end: index + 1
637
+ };
638
+ }
639
+ value += char;
640
+ }
641
+ }
642
+ function getDotEnvVars(targetEnvironment) {
643
+ const globalRegistry = globalThis.__c12_dotenv_vars__ ||= /* @__PURE__ */ new Map();
644
+ if (!globalRegistry.has(targetEnvironment)) globalRegistry.set(targetEnvironment, /* @__PURE__ */ new Set());
645
+ return globalRegistry.get(targetEnvironment);
646
+ }
647
+ const _normalize = (p) => p?.replace(/\\/g, "/");
648
+ let importCounter = 0;
649
+ const ASYNC_LOADERS = {
650
+ ".json": () => JSON.parse,
651
+ ".yaml": () => import("./yaml-JsusTbcC.js").then((r) => r.parseYAML),
652
+ ".yml": () => import("./yaml-JsusTbcC.js").then((r) => r.parseYAML),
653
+ ".jsonc": () => import("./jsonc-DU9Clnrz.js").then((r) => (source) => r.parseJSONC(source, { allowTrailingComma: true })),
654
+ ".json5": () => import("./json5-DhsZB2va.js").then((r) => r.parseJSON5),
655
+ ".toml": () => import("./toml-VX0BsvYq.js").then((r) => r.parseTOML)
656
+ };
657
+ const SUPPORTED_EXTENSIONS = Object.freeze([
658
+ ".js",
659
+ ".ts",
660
+ ".mjs",
661
+ ".cjs",
662
+ ".mts",
663
+ ".cts",
664
+ ".json",
665
+ ".jsonc",
666
+ ".json5",
667
+ ".yaml",
668
+ ".yml",
669
+ ".toml"
670
+ ]);
671
+ async function loadConfig$1(options) {
672
+ options.cwd = resolve$1(process.cwd(), options.cwd || ".");
673
+ options.name = options.name || "config";
674
+ options.envName = options.envName ?? process.env.NODE_ENV;
675
+ options.configFile = options.configFile ?? (options.name === "config" ? "config" : `${options.name}.config`);
676
+ options.rcFile = options.rcFile ?? `.${options.name}rc`;
677
+ if (options.extend !== false) options.extend = {
678
+ extendKey: "extends",
679
+ dedupe: true,
680
+ ...options.extend
681
+ };
682
+ const _merger = options.merger || defu;
683
+ const r = {
684
+ config: {},
685
+ cwd: options.cwd,
686
+ configFile: resolve$1(options.cwd, options.configFile),
687
+ layers: [],
688
+ _configFile: void 0
689
+ };
690
+ const rawConfigs = {
691
+ overrides: options.overrides,
692
+ main: void 0,
693
+ rc: void 0,
694
+ packageJson: void 0,
695
+ defaultConfig: options.defaultConfig
696
+ };
697
+ if (options.dotenv) await setupDotenv({
698
+ cwd: options.cwd,
699
+ ...options.dotenv === true ? {} : options.dotenv
700
+ });
701
+ const seen = options.extend && options.extend.dedupe !== false ? /* @__PURE__ */ new Set() : void 0;
702
+ const _mainConfig = await resolveConfig$1(".", options, {}, seen);
703
+ if (_mainConfig.configFile) {
704
+ rawConfigs.main = _mainConfig.config;
705
+ r.configFile = _mainConfig.configFile;
706
+ r._configFile = _mainConfig._configFile;
707
+ }
708
+ if (_mainConfig.meta) r.meta = _mainConfig.meta;
709
+ if (options.rcFile) {
710
+ const rcSources = [];
711
+ rcSources.push(read({
712
+ name: options.rcFile,
713
+ dir: options.cwd
714
+ }));
715
+ if (options.globalRc) {
716
+ const { findWorkspaceDir } = await import("./dist-CYnD1kyT.js");
717
+ const workspaceDir = await findWorkspaceDir(options.cwd).catch(() => {});
718
+ if (workspaceDir) rcSources.push(read({
719
+ name: options.rcFile,
720
+ dir: workspaceDir
721
+ }));
722
+ rcSources.push(readUserConfig({ name: options.rcFile }));
723
+ rcSources.push(read({
724
+ name: options.rcFile,
725
+ dir: homedir()
726
+ }));
727
+ }
728
+ rawConfigs.rc = _merger({}, ...rcSources);
729
+ }
730
+ if (options.packageJson) {
731
+ const keys = (Array.isArray(options.packageJson) ? options.packageJson : [typeof options.packageJson === "string" ? options.packageJson : options.name]).filter((t) => t && typeof t === "string");
732
+ const { readPackageJSON } = await import("./dist-CYnD1kyT.js");
733
+ const pkgJsonFile = await readPackageJSON(options.cwd).catch(() => {});
734
+ rawConfigs.packageJson = _merger({}, ...keys.map((key) => pkgJsonFile?.[key]));
735
+ }
736
+ const configs = {};
737
+ for (const key in rawConfigs) {
738
+ const value = rawConfigs[key];
739
+ const config = await (typeof value === "function" ? value({
740
+ configs,
741
+ rawConfigs
742
+ }) : value);
743
+ configs[key] = key === "overrides" ? applyEnvConfig(config, options) : config;
744
+ }
745
+ if (Array.isArray(configs.main)) r.config = configs.main;
746
+ else {
747
+ r.config = _merger(configs.overrides, configs.main, configs.rc, configs.packageJson, configs.defaultConfig);
748
+ if (options.extend) {
749
+ await extendConfig(r.config, options, seen);
750
+ r.layers = r.config._layers;
751
+ delete r.config._layers;
752
+ r.config = _merger(r.config, ...r.layers.map((e) => e.config));
753
+ }
754
+ }
755
+ r.layers = [...[
756
+ configs.overrides && {
757
+ config: configs.overrides,
758
+ configFile: void 0,
759
+ cwd: void 0
760
+ },
761
+ {
762
+ config: configs.main,
763
+ configFile: options.configFile,
764
+ cwd: options.cwd
765
+ },
766
+ configs.rc && {
767
+ config: configs.rc,
768
+ configFile: options.rcFile
769
+ },
770
+ configs.packageJson && {
771
+ config: configs.packageJson,
772
+ configFile: "package.json"
773
+ }
774
+ ].filter((l) => l && l.config), ...r.layers];
775
+ if (options.defaults) r.config = _merger(r.config, options.defaults);
776
+ if (options.omit$Keys) {
777
+ for (const key in r.config) if (key.startsWith("$")) delete r.config[key];
778
+ }
779
+ if (options.configFileRequired && !r._configFile) throw new Error(`Required config (${r.configFile}) cannot be resolved.`);
780
+ if (options.schema != null) r.config = await validateConfig(r.config, options.schema);
781
+ return r;
782
+ }
783
+ async function extendConfig(config, options, seen) {
784
+ config._layers = config._layers || [];
785
+ if (!options.extend) return;
786
+ let keys = options.extend.extendKey;
787
+ if (typeof keys === "string") keys = [keys];
788
+ const extendSources = [];
789
+ for (const key of keys) {
790
+ extendSources.push(...(Array.isArray(config[key]) ? config[key] : [config[key]]).filter(Boolean));
791
+ delete config[key];
792
+ }
793
+ for (let extendSource of extendSources) {
794
+ const originalExtendSource = extendSource;
795
+ let sourceOptions = {};
796
+ if (extendSource.source) {
797
+ sourceOptions = extendSource.options || {};
798
+ extendSource = extendSource.source;
799
+ }
800
+ if (Array.isArray(extendSource)) {
801
+ sourceOptions = extendSource[1] || {};
802
+ extendSource = extendSource[0];
803
+ }
804
+ if (typeof extendSource !== "string") {
805
+ console.warn(`Cannot extend config from \`${JSON.stringify(originalExtendSource)}\` in ${options.cwd}`);
806
+ continue;
807
+ }
808
+ const _config = await resolveConfig$1(extendSource, options, sourceOptions, seen);
809
+ if (_config === DUPLICATE) continue;
810
+ if (!_config.config) {
811
+ console.warn(`Cannot extend config from \`${extendSource}\` in ${options.cwd}`);
812
+ continue;
813
+ }
814
+ await extendConfig(_config.config, {
815
+ ...options,
816
+ cwd: _config.cwd
817
+ }, seen);
818
+ config._layers.push(_config);
819
+ if (_config.config._layers) {
820
+ config._layers.push(..._config.config._layers);
821
+ delete _config.config._layers;
822
+ }
823
+ }
824
+ }
825
+ const GIGET_PREFIXES = [
826
+ "gh:",
827
+ "github:",
828
+ "gitlab:",
829
+ "bitbucket:",
830
+ "https://",
831
+ "http://"
832
+ ];
833
+ const NPM_PACKAGE_RE = /^(@[\da-z~-][\d._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*($|\/.*)/;
834
+ async function resolveConfig$1(source, options, sourceOptions = {}, seen) {
835
+ if (options.resolve) {
836
+ const res = await options.resolve(source, options);
837
+ if (res) {
838
+ const file = res._configFile || res.configFile;
839
+ const cwd = res.cwd && resolve$1(options.cwd, res.cwd);
840
+ return _isDuplicateLayer(seen, file && resolve$1(cwd || options.cwd, file), cwd) ? DUPLICATE : res;
841
+ }
842
+ }
843
+ const _merger = options.merger || defu;
844
+ const customProviderKeys = Object.keys(sourceOptions.giget?.providers || {}).map((key) => `${key}:`);
845
+ const gigetPrefixes = customProviderKeys.length > 0 ? [.../* @__PURE__ */ new Set([...customProviderKeys, ...GIGET_PREFIXES])] : GIGET_PREFIXES;
846
+ if (options.giget !== false && gigetPrefixes.some((prefix) => source.startsWith(prefix))) {
847
+ if (seen?.has(`giget:${source}`)) return DUPLICATE;
848
+ seen?.add(`giget:${source}`);
849
+ const { downloadTemplate } = await import("giget").catch((error) => {
850
+ throw new Error(`Extending config from \`${source}\` requires \`giget\` peer dependency to be installed.\n\nInstall it with: \`npx nypm i giget\``, { cause: error });
851
+ });
852
+ const { digest } = await import("./ohash-imLR_J5Y.js").then((n) => n.dist_exports);
853
+ const cloneName = source.replace(/\W+/g, "_").split("_").splice(0, 3).join("_") + "_" + digest(source).slice(0, 10).replace(/[-_]/g, "");
854
+ let cloneDir;
855
+ const localNodeModules = resolve$1(options.cwd, "node_modules");
856
+ const parentDir = dirname$1(options.cwd);
857
+ if (basename$1(parentDir) === ".c12") cloneDir = join$1(parentDir, cloneName);
858
+ else if (existsSync(localNodeModules)) cloneDir = join$1(localNodeModules, ".c12", cloneName);
859
+ else cloneDir = process.env.XDG_CACHE_HOME ? resolve$1(process.env.XDG_CACHE_HOME, "c12", cloneName) : resolve$1(homedir(), ".cache/c12", cloneName);
860
+ const install = sourceOptions.install ? defu(sourceOptions.install === true ? {} : sourceOptions.install, { ignoreWorkspace: true }) : false;
861
+ if (existsSync(cloneDir) && !install) await rm(cloneDir, { recursive: true });
862
+ source = (await downloadTemplate(source, {
863
+ dir: cloneDir,
864
+ install,
865
+ force: Boolean(install),
866
+ auth: sourceOptions.auth,
867
+ ...options.giget,
868
+ ...sourceOptions.giget
869
+ })).dir;
870
+ }
871
+ if (NPM_PACKAGE_RE.test(source)) source = tryResolve(source, options) || source;
872
+ const ext = extname$1(source);
873
+ const isDir = _isDirectory(resolve$1(options.cwd, source)) ?? (!ext || ext === basename$1(source));
874
+ const cwd = resolve$1(options.cwd, isDir ? source : dirname$1(source));
875
+ if (isDir) source = options.configFile;
876
+ const res = {
877
+ config: void 0,
878
+ configFile: void 0,
879
+ cwd,
880
+ source,
881
+ sourceOptions
882
+ };
883
+ res.configFile = tryResolve(resolve$1(cwd, source), options) || tryResolve(resolve$1(cwd, ".config", source.replace(/\.config$/, "")), options) || tryResolve(resolve$1(cwd, ".config", source), options) || source;
884
+ if (!existsSync(res.configFile)) return res;
885
+ if (_isDuplicateLayer(seen, res.configFile, res.cwd)) return DUPLICATE;
886
+ res._configFile = res.configFile;
887
+ const configFileExt = extname$1(res.configFile) || "";
888
+ if (configFileExt in ASYNC_LOADERS) res.config = (await ASYNC_LOADERS[configFileExt]())(await readFile(res.configFile, "utf8"));
889
+ else {
890
+ const _resolveModule = options.resolveModule || _resolveDefaultExport;
891
+ if (options.import) res.config = _resolveModule(await options.import(res.configFile));
892
+ else {
893
+ const _configURL = pathToFileURL(res.configFile);
894
+ _configURL.search = `_${++importCounter}`;
895
+ res.config = await import(_configURL.href).then(_resolveModule, async (error) => {
896
+ const { createJiti } = await import("jiti").catch(() => {
897
+ throw new Error(`Failed to load config file \`${res.configFile}\`: ${error?.message}. Hint install \`jiti\` for compatibility.`, { cause: error });
898
+ });
899
+ const jiti = createJiti(join$1(options.cwd || ".", options.configFile || "/"), {
900
+ interopDefault: true,
901
+ moduleCache: false,
902
+ extensions: [...SUPPORTED_EXTENSIONS],
903
+ ...options.jitiOptions
904
+ });
905
+ options.import = (id) => jiti.import(id);
906
+ return _resolveModule(await options.import(res.configFile));
907
+ });
908
+ }
909
+ }
910
+ if (typeof res.config === "function") res.config = await res.config(options.context);
911
+ if (res.config && typeof res.config === "object" && !Array.isArray(res.config) && !Object.isExtensible(res.config)) res.config = { ...res.config };
912
+ res.configFile = _normalize(res.configFile);
913
+ res.source = _normalize(res.source);
914
+ if (res.config == null) return res;
915
+ res.config = applyEnvConfig(res.config, options);
916
+ res.meta = defu(res.sourceOptions.meta, res.config.$meta);
917
+ delete res.config.$meta;
918
+ if (res.sourceOptions.overrides) res.config = _merger(applyEnvConfig(res.sourceOptions.overrides, options), res.config);
919
+ return res;
920
+ }
921
+ function applyEnvConfig(config, options) {
922
+ if (!config) return config;
923
+ const envConfigs = [...new Set((Array.isArray(options.envName) ? options.envName : [options.envName]).filter(Boolean).reverse())].flatMap((envName) => [config.$env?.[envName], config["$" + envName]]).filter((c) => c && Object.keys(c).length > 0);
924
+ if (envConfigs.length === 0) return config;
925
+ return (options.envMerger || options.merger || defu)({}, ...envConfigs, config);
926
+ }
927
+ async function validateConfig(config, schema) {
928
+ if (typeof schema?.["~standard"]?.validate !== "function") throw new TypeError("Invalid `schema` option: expected a Standard Schema (https://standardschema.dev).");
929
+ const result = await schema["~standard"].validate(config);
930
+ if (result.issues) {
931
+ const messages = result.issues.map((issue) => {
932
+ const path = issue.path?.map((p) => String(typeof p === "object" ? p.key : p)).join(".");
933
+ return ` - ${path ? `${path}: ` : ""}${issue.message}`;
934
+ });
935
+ throw new Error(`Config validation failed (${schema["~standard"].vendor}):\n${messages.join("\n")}`, { cause: result.issues });
936
+ }
937
+ return result.value;
938
+ }
939
+ const DUPLICATE = Symbol("duplicate");
940
+ function _layerKey(path) {
941
+ try {
942
+ return _normalize(realpathSync(path));
943
+ } catch {
944
+ return _normalize(resolve$1(path));
945
+ }
946
+ }
947
+ function _isDuplicateLayer(seen, configFile, cwd) {
948
+ const path = configFile || cwd;
949
+ if (!seen || !path) return false;
950
+ const key = _layerKey(path);
951
+ if (seen.has(key)) return true;
952
+ seen.add(key);
953
+ if (configFile && cwd) seen.add(_layerKey(cwd));
954
+ return false;
955
+ }
956
+ function tryResolve(id, options) {
957
+ const res = resolveModulePath(id, {
958
+ try: true,
959
+ from: pathToFileURL(join$1(options.cwd || ".", options.configFile || "/")),
960
+ suffixes: ["", "/index"],
961
+ extensions: SUPPORTED_EXTENSIONS,
962
+ cache: false
963
+ });
964
+ return res ? normalize$1(res) : void 0;
965
+ }
966
+ function _resolveDefaultExport(mod) {
967
+ return mod !== null && (typeof mod === "object" || typeof mod === "function") && "default" in mod ? mod.default : mod;
968
+ }
969
+ function _isDirectory(path) {
970
+ try {
971
+ return statSync(path).isDirectory();
972
+ } catch {
973
+ return null;
974
+ }
975
+ }
976
+ // src/cli/block-config-schema.ts
977
+ /**
978
+ * `blocks.<name>.values`: table to column to label to an app value, a list of
979
+ * app values, or `null`. The module context checks the names.
980
+ */
981
+ const valueMapsSchema = record(string(), record(string(), record(string(), nullable(union([string(), array(string())])))));
982
+ /**
983
+ * `records.<type>.permissions`: action to a key, or to `{ key, rows, owner,
984
+ * also }`. The subject registry checks the names.
985
+ */
986
+ const subjectPermissionsSchema = record(string(), union([string(), strictObject({
987
+ key: optional(string()),
988
+ rows: optional(string()),
989
+ owner: optional(string()),
990
+ also: optional(string())
991
+ })]));
992
+ /** `records.<type>.search`. The subject registry checks the names. */
993
+ const subjectSearchSchema = strictObject({
994
+ title: optional(string()),
995
+ body: optional(array(string())),
996
+ description: optional(string()),
997
+ exclude: optional(string()),
998
+ from: optional(strictObject({
999
+ view: string(),
1000
+ key: string()
1001
+ })),
1002
+ watch: optional(array(strictObject({
1003
+ table: string(),
1004
+ key: string(),
1005
+ via: optional(string()),
1006
+ through: optional(array(strictObject({
1007
+ table: string(),
1008
+ from: string(),
1009
+ to: string()
1010
+ })))
1011
+ })))
1012
+ });
1013
+ // src/cli/config-moved.ts
1014
+ /** Where each top-level key of a 0.14 config moved in 0.15. */
1015
+ const MOVED_KEYS = new Map([...Object.entries(CONFIG_GROUPS).flatMap(([group, keys]) => keys.filter((key) => key !== "tables").map((key) => [key, `${group}.${key}`])), ...RENAMED_CONFIG_KEYS.map(([grouped, flat]) => [flat, grouped])]);
1016
+ const TABLES_REMOVED = "removed in 0.28: tables are SQL in `supabase/schemas` with `@bsb` tags in the table comment; run `better-supabase migrate schema-first`";
1017
+ /** `sql` keys that moved before 0.15, with where they went. */
1018
+ const MOVED_SQL_KEYS = [["modules", "moved to the top-level `blocks` key in 0.9; run `better-supabase codemod 0.9`"], ["naming", "`sql.naming.tenant` moved to `blocks.memberships.names.organization`"]];
1019
+ /** Moved `sql` keys in one config block, under `sql` or `database.sql`. */
1020
+ function movedSqlIssues(prefix, block) {
1021
+ if (!isRecord(block)) return [];
1022
+ const database = block["database"];
1023
+ return [["sql", block["sql"]], ["database.sql", isRecord(database) ? database["sql"] : void 0]].flatMap(([path, sql]) => isRecord(sql) ? MOVED_SQL_KEYS.filter(([key]) => key in sql).map(([key, message]) => `${prefix}${path}.${key}: ${message}`) : []);
1024
+ }
1025
+ const SCAFFOLD_REMOVED = "removed in 0.15 with `better-supabase scaffold api`; delete it. `defineApi` includes every table and block instance, and `createOrpc(betterSupabase).router(api)` serves it: https://bettersupabase.com/docs/frameworks/orpc#serve-the-api";
1026
+ /** Top-level keys 0.15 removed, with what replaces them. */
1027
+ const REMOVED_KEYS = /* @__PURE__ */ new Map([
1028
+ ["plugins", "removed in 0.15: the updated-at, created-by, trash and memberships blocks carry these columns now; run `better-supabase codemod 0.15`"],
1029
+ ["scaffold", SCAFFOLD_REMOVED],
1030
+ ["tables", TABLES_REMOVED],
1031
+ ["appTables", TABLES_REMOVED],
1032
+ ["records", "renamed to `subjects` in 0.28; rename the key. A table's subject now comes from `@bsb subject` in its comment"]
1033
+ ]);
1034
+ const RECORD_TYPES_MOVED = "renamed to `gen.recordTypes` in 0.15; run `better-supabase codemod 0.15`";
1035
+ /** Keys of the flat 0.14 config in one config block. */
1036
+ function movedGroupIssues(prefix, block) {
1037
+ if (!isRecord(block)) return [];
1038
+ const gen = block["gen"];
1039
+ const tooling = block["tooling"];
1040
+ const genIssues = isRecord(gen) && "generateFeatures" in gen ? [`${prefix}gen.generateFeatures: ${RECORD_TYPES_MOVED}`] : [];
1041
+ const toolingIssues = isRecord(tooling) && "scaffold" in tooling ? [`${prefix}tooling.scaffold: ${SCAFFOLD_REMOVED}`] : [];
1042
+ return Object.keys(block).flatMap((key) => {
1043
+ if (key === "generateFeatures") return [`${prefix}${key}: ${RECORD_TYPES_MOVED}`];
1044
+ if (key === "gen") return genIssues;
1045
+ if (key === "tooling") return toolingIssues;
1046
+ const removed = REMOVED_KEYS.get(key);
1047
+ if (removed !== void 0) return [`${prefix}${key}: ${removed}`];
1048
+ const moved = MOVED_KEYS.get(key);
1049
+ return moved === void 0 ? [] : [`${prefix}${key}: moved to \`${moved}\` in 0.15; run \`better-supabase codemod 0.15\``];
1050
+ });
1051
+ }
1052
+ /**
1053
+ * Keys of the flat 0.14 config, and `sql` keys moved before it, in the config
1054
+ * or one of its environment blocks, each as `path: message`.
1055
+ */
1056
+ function movedKeyIssues(value) {
1057
+ if (!isRecord(value)) return [];
1058
+ const blocks = [["", value]];
1059
+ for (const [key, block] of Object.entries(value)) if (key === "$env" && isRecord(block)) for (const [name, env] of Object.entries(block)) blocks.push([`$env.${name}.`, env]);
1060
+ else if (key.startsWith("$")) blocks.push([`${key}.`, block]);
1061
+ return [...blocks.flatMap(([prefix, block]) => movedSqlIssues(prefix, block)), ...blocks.flatMap(([prefix, block]) => movedGroupIssues(prefix, block))];
1062
+ }
1063
+ // src/cli/names.ts
1064
+ const HOOK_FRAMEWORKS = [
1065
+ "react",
1066
+ "vue",
1067
+ "svelte",
1068
+ "solid"
1069
+ ];
1070
+ const INTEGRATIONS = INTEGRATION_NAMES;
1071
+ const isGenTask = (value) => GEN_TASKS.some((task) => task === value);
1072
+ // src/cli/powersync/config-schema.ts
1073
+ /** `gen.powersync`. */
1074
+ const powersyncGenSchema = strictObject({
1075
+ instances: pipe(array(string()), minLength(1, "lists at least one block instance")),
1076
+ out: optional(string()),
1077
+ import: optional(string())
1078
+ });
1079
+ // src/cli/config-schema.ts
1080
+ const strings = array(string());
1081
+ const stringRecord = record(string(), string());
1082
+ const privilege = pipe(string(), regex(/^(?:select|insert|update|delete|(?:select|insert|update)\s*\(\s*(?:[a-z_][a-z0-9_$]*(?:\s*,\s*[a-z_][a-z0-9_$]*)*|\*(?:\s*,\s*-\s*[a-z_][a-z0-9_$]*)*)\s*\))$/, "Use select, insert, update or delete, name columns such as \"update(title, body)\", or exclude them from every column with \"select(*, -secret)\""));
1083
+ const privileges = array(privilege);
1084
+ const triggerValue = union([string(), strictObject({
1085
+ from: string(),
1086
+ via: lazy(() => triggerValue),
1087
+ select: string(),
1088
+ key: exactOptional(string())
1089
+ })]);
1090
+ const triggerValues = record(string(), triggerValue);
1091
+ const isGenerator = (value) => typeof value === "object" && value !== null && "name" in value && typeof value.name === "string" && "generate" in value && typeof value.generate === "function";
1092
+ const generator = custom(isGenerator, "must be a generator: { name, generate(input) }");
1093
+ /**
1094
+ * The top level of `better-supabase.config.*`. It rejects unknown keys and
1095
+ * checks the leaves a typo or an old value breaks; nested objects the library
1096
+ * reads loosely stay loose.
1097
+ */
1098
+ const entityName = pipe(string(), regex(/^[a-z][a-z0-9_]{0,40}$/, "an entity name is lowercase letters, digits and underscores"));
1099
+ const ADOPT_REMOVED = "ownership \"adopt\" was removed: a block now leaves alone every table your schema already has. Delete the key, or run `better-supabase codemod`.";
1100
+ const instanceKeys = {
1101
+ block: optional(string()),
1102
+ on: optional(union([strings, record(string(), record(string(), unknown()))])),
1103
+ uses: optional(stringRecord),
1104
+ tables: optional(record(string(), nullable(string())))
1105
+ };
1106
+ const blockEntries = {
1107
+ ...instanceKeys,
1108
+ ownership: optional(picklist(["managed", "custom"], (issue) => issue.input === "adopt" ? ADOPT_REMOVED : issue.message)),
1109
+ schema: optional(string()),
1110
+ columns: optional(record(string(), record(string(), nullable(string())))),
1111
+ values: optional(valueMapsSchema),
1112
+ idType: optional(string()),
1113
+ owner: optional(picklist([
1114
+ "tenant",
1115
+ "user",
1116
+ "none"
1117
+ ])),
1118
+ ownTablePolicies: optional(picklist(["block", "app"])),
1119
+ functions: optional(stringRecord),
1120
+ permissions: optional(stringRecord),
1121
+ names: optional(union([entityName, record(string(), union([entityName, strictObject({
1122
+ name: optional(entityName),
1123
+ plural: optional(entityName),
1124
+ url: optional(string()),
1125
+ subject: optional(literal(false))
1126
+ })]))])),
1127
+ options: optional(record(string(), unknown())),
1128
+ callbacks: optional(strictObject({
1129
+ schema: optional(string()),
1130
+ functions: optional(stringRecord)
1131
+ })),
1132
+ events: optional(boolean()),
1133
+ audit: optional(boolean()),
1134
+ api: optional(union([
1135
+ string(),
1136
+ literal(false),
1137
+ strictObject({
1138
+ schema: string(),
1139
+ functions: optional(strings)
1140
+ })
1141
+ ]))
1142
+ };
1143
+ const disabledRow = strictObject({
1144
+ table: string(),
1145
+ id: string(),
1146
+ disabledAt: optional(string()),
1147
+ status: optional(string()),
1148
+ active: optional(strings)
1149
+ });
1150
+ const activeTenantSource = union([picklist(["claim", "resolver"]), strictObject({
1151
+ profileColumn: string(),
1152
+ key: optional(string())
1153
+ })]);
1154
+ const permissionsBlock = strictObject({
1155
+ ...blockEntries,
1156
+ model: optional(picklist([
1157
+ "roles",
1158
+ "catalog",
1159
+ "provider",
1160
+ "custom"
1161
+ ])),
1162
+ roles: optional(record(string(), strings)),
1163
+ functions: optional(strictObject({
1164
+ can: optional(string()),
1165
+ tenantIdsWith: optional(string()),
1166
+ isPlatform: optional(string()),
1167
+ canUser: optional(string()),
1168
+ canAssign: optional(string()),
1169
+ canAssignFor: optional(string()),
1170
+ permissionClaims: optional(string())
1171
+ })),
1172
+ platformClaim: optional(string()),
1173
+ scopes: optional(record(string(), strings)),
1174
+ disabled: optional(strictObject({
1175
+ tenant: optional(union([string(), disabledRow])),
1176
+ user: optional(union([string(), disabledRow])),
1177
+ userKey: optional(string())
1178
+ })),
1179
+ activeTenant: optional(activeTenantSource)
1180
+ });
1181
+ /**
1182
+ * `blocks`: a list of names, or each block's config. The schema checks the keys
1183
+ * every block shares; `resolveConfig` checks the tables, columns, functions,
1184
+ * actions, hooks and entities each module declares.
1185
+ */
1186
+ const blocksSchema = lazy((input) => Array.isArray(input) ? strings : objectWithRest({ permissions: optional(permissionsBlock) }, strictObject(blockEntries)));
1187
+ const scopeName = pipe(string(), regex(/^[a-z][a-z0-9_]*$/, "Use lower case letters, digits and _"));
1188
+ const membershipScope = union([strictObject({ column: string() }), strictObject({ value: string() })]);
1189
+ const authorization = strictObject({
1190
+ apiVersion: literal(1),
1191
+ name: string(),
1192
+ scopes: array(strictObject({
1193
+ name: scopeName,
1194
+ idType: optional(picklist(SCOPE_ID_TYPES)),
1195
+ parent: optional(string())
1196
+ })),
1197
+ tenantScope: scopeName,
1198
+ functions: strictObject({
1199
+ idsWith: string(),
1200
+ isPlatform: string(),
1201
+ idsWithFor: optional(string()),
1202
+ isPlatformFor: optional(string()),
1203
+ memberIds: optional(string()),
1204
+ memberIdsFor: optional(string()),
1205
+ teamIdsOf: optional(string()),
1206
+ canAssign: optional(string()),
1207
+ canAssignFor: optional(string()),
1208
+ permissionsFor: optional(string()),
1209
+ canApprove: optional(string()),
1210
+ isApprover: optional(string()),
1211
+ holdersOf: optional(string()),
1212
+ actorMayWrite: optional(string()),
1213
+ permitted: optional(string()),
1214
+ rowsWith: optional(string()),
1215
+ rowsWithFor: optional(string()),
1216
+ portalSubjects: optional(string()),
1217
+ portalParties: optional(string())
1218
+ }),
1219
+ requires: optional(array(strictObject({
1220
+ function: string(),
1221
+ args: optional(string()),
1222
+ role: string()
1223
+ }))),
1224
+ permissions: optional(array(strictObject({
1225
+ key: string(),
1226
+ sqlComplete: optional(boolean()),
1227
+ scopes: optional(strings)
1228
+ }))),
1229
+ operations: optional(record(string(), strictObject({
1230
+ permission: pipe(string(), minLength(1)),
1231
+ meta: optional(strictObject({
1232
+ risk: optional(picklist([
1233
+ "low",
1234
+ "medium",
1235
+ "high"
1236
+ ])),
1237
+ effects: optional(array(picklist([
1238
+ "read",
1239
+ "write",
1240
+ "delete",
1241
+ "external"
1242
+ ]))),
1243
+ title: optional(string())
1244
+ }))
1245
+ }))),
1246
+ memberships: optional(array(strictObject({
1247
+ table: string(),
1248
+ userColumn: string(),
1249
+ scope: membershipScope,
1250
+ idColumn: string(),
1251
+ rolesTable: optional(string())
1252
+ }))),
1253
+ suspension: optional(strictObject({
1254
+ user: optional(disabledRow),
1255
+ tenant: optional(disabledRow)
1256
+ })),
1257
+ roleSources: optional(array(strictObject({
1258
+ table: string(),
1259
+ role: strictObject({
1260
+ column: string(),
1261
+ through: strictObject({
1262
+ table: string(),
1263
+ id: string(),
1264
+ column: string()
1265
+ })
1266
+ })
1267
+ }))),
1268
+ decidingColumns: optional(array(pipe(string(), regex(/^[A-Za-z_][\w$]*\.[A-Za-z_][\w$]*\.[A-Za-z_][\w$]*$/, "Use schema.table.column")))),
1269
+ tokenHook: optional(strictObject({
1270
+ function: string(),
1271
+ tenantClaim: optional(string()),
1272
+ activeOrganizationFrom: optional(activeTenantSource),
1273
+ ownedClaims: pipe(strings, minLength(1, "List at least one claim")),
1274
+ registeredClaims: optional(array(strictObject({
1275
+ name: string(),
1276
+ function: string()
1277
+ }))),
1278
+ budget: optional(strictObject({
1279
+ claims: strings,
1280
+ bytes: pipe(number(), integer("Use a whole number of bytes"), minValue(1, "Use at least 1 byte")),
1281
+ truncatedClaim: optional(string())
1282
+ })),
1283
+ markers: optional(strictObject({
1284
+ hook: optional(string()),
1285
+ grants: optional(string())
1286
+ })),
1287
+ grantsCommand: optional(string())
1288
+ })),
1289
+ delegation: optional(strictObject({ scopes: optional(record(string(), strings)) })),
1290
+ approvals: optional(strictObject({ distinctApprover: optional(boolean()) })),
1291
+ problems: optional(strings)
1292
+ });
1293
+ const checkedAuthorization = pipe(authorization, rawCheck(({ dataset, addIssue }) => {
1294
+ if (!dataset.typed) return;
1295
+ for (const problem of scopeProblems(dataset.value)) addIssue({ message: problem });
1296
+ }));
1297
+ const jsonSchema$1 = record(string(), unknown());
1298
+ const presetInstance = strictObject({
1299
+ ...instanceKeys,
1300
+ names: optional(stringRecord),
1301
+ options: optional(jsonSchema$1)
1302
+ });
1303
+ const onDelete = optional(picklist(APP_ON_DELETE_ACTIONS));
1304
+ const positiveInteger = pipe(number(), integer(), minValue(1));
1305
+ const bucket = strictObject({
1306
+ id: optional(string()),
1307
+ public: optional(boolean()),
1308
+ path: union([string(), pipe(strings, minLength(1))]),
1309
+ policy: optional(union([picklist([
1310
+ "tenant",
1311
+ "owner",
1312
+ "public",
1313
+ "none"
1314
+ ]), strictObject({
1315
+ access: strictObject({
1316
+ read: string(),
1317
+ list: optional(string()),
1318
+ write: string(),
1319
+ delete: optional(string())
1320
+ }),
1321
+ scope: optional(string()),
1322
+ segment: optional(positiveInteger),
1323
+ sql: optional(union([literal("provider"), strictObject({
1324
+ idsWith: string(),
1325
+ isPlatform: string()
1326
+ })]))
1327
+ })])),
1328
+ fileSizeLimit: optional(string()),
1329
+ allowedMimeTypes: optional(strings),
1330
+ versioning: optional(boolean()),
1331
+ lifecycle: optional(strictObject({ rules: pipe(array(strictObject({
1332
+ id: optional(string()),
1333
+ status: optional(picklist(["Enabled", "Disabled"])),
1334
+ noncurrentVersionExpiration: strictObject({
1335
+ noncurrentDays: positiveInteger,
1336
+ newerNoncurrentVersions: optional(pipe(number(), integer(), minValue(1), maxValue(100)))
1337
+ })
1338
+ })), minLength(1), maxLength(1e3)) }))
1339
+ });
1340
+ const appTableEntries = {
1341
+ columns: optional(record(string(), strictObject({
1342
+ type: picklist(APP_COLUMN_TYPES),
1343
+ nullable: optional(boolean()),
1344
+ default: optional(string()),
1345
+ unique: optional(boolean()),
1346
+ references: optional(union([strictObject({
1347
+ table: string(),
1348
+ onDelete
1349
+ }), strictObject({
1350
+ block: string(),
1351
+ table: string(),
1352
+ onDelete
1353
+ })])),
1354
+ format: optional(picklist(APP_COLUMN_FORMATS)),
1355
+ options: optional(array(string())),
1356
+ min: optional(number()),
1357
+ max: optional(number()),
1358
+ comment: optional(string()),
1359
+ identity: optional(boolean()),
1360
+ access: optional(picklist(APP_COLUMN_ACCESS)),
1361
+ encrypted: optional(boolean())
1362
+ }))),
1363
+ timestamps: optional(boolean()),
1364
+ id: optional(picklist(["uuid", "bigint"])),
1365
+ unique: optional(array(array(string()))),
1366
+ indexes: optional(array(array(string()))),
1367
+ comment: optional(string()),
1368
+ auditReads: optional(boolean()),
1369
+ subject: optional(strictObject({
1370
+ type: string(),
1371
+ title: optional(string()),
1372
+ url: optional(string()),
1373
+ search: optional(strictObject({
1374
+ title: optional(string()),
1375
+ body: optional(array(string()))
1376
+ })),
1377
+ permissions: optional(record(string(), string())),
1378
+ rank: optional(union([literal(true), strictObject({ group: optional(string()) })])),
1379
+ softDelete: optional(boolean()),
1380
+ versions: optional(union([literal(true), strictObject({
1381
+ columns: optional(strings),
1382
+ auto: optional(boolean())
1383
+ })]))
1384
+ })),
1385
+ rollups: optional(record(string(), strictObject({
1386
+ table: string(),
1387
+ via: string(),
1388
+ aggregate: picklist(APP_ROLLUP_AGGREGATES),
1389
+ column: optional(string()),
1390
+ where: optional(strictObject({
1391
+ column: string(),
1392
+ equals: string()
1393
+ }))
1394
+ }))),
1395
+ lookups: optional(record(string(), strictObject({
1396
+ via: string(),
1397
+ column: string()
1398
+ }))),
1399
+ events: optional(union([literal(true), strictObject({
1400
+ on: optional(array(picklist(APP_TABLE_EVENT_KINDS))),
1401
+ include: optional(strings)
1402
+ })]))
1403
+ };
1404
+ const appTableOwner = optional(picklist([
1405
+ "inherit",
1406
+ "user",
1407
+ "none"
1408
+ ]));
1409
+ const appTables = record(string(), strictObject({
1410
+ ...appTableEntries,
1411
+ owner: appTableOwner
1412
+ }));
1413
+ /** A `/create` design keeps `scope` until designs move to the config shape. */
1414
+ const designAppTables = record(string(), strictObject({
1415
+ ...appTableEntries,
1416
+ scope: appTableOwner
1417
+ }));
1418
+ const FLAT = {
1419
+ source: optional(strictObject({
1420
+ dbUrl: optional(string()),
1421
+ projectRef: optional(string()),
1422
+ accessToken: optional(string()),
1423
+ snapshot: optional(string()),
1424
+ lite: optional(boolean())
1425
+ })),
1426
+ schemas: optional(strings),
1427
+ casing: optional(picklist(["snake", "camel"])),
1428
+ tables: optional(record(string(), strictObject({
1429
+ casing: optional(picklist(["snake", "camel"])),
1430
+ exclude: optional(boolean()),
1431
+ serviceRole: optional(boolean()),
1432
+ relations: optional(stringRecord),
1433
+ insertOptional: optional(strings)
1434
+ }))),
1435
+ output: optional(string()),
1436
+ postgrestVersion: optional(string()),
1437
+ recordTypes: optional(boolean()),
1438
+ hooks: optional(union([picklist(HOOK_FRAMEWORKS), literal(false)])),
1439
+ json: optional(record(string(), union([strictObject({
1440
+ import: string(),
1441
+ schema: optional(jsonSchema$1)
1442
+ }), strictObject({
1443
+ type: string(),
1444
+ schema: optional(jsonSchema$1)
1445
+ })], "Use { import } or { type }, with an optional schema"))),
1446
+ codecs: optional(strictObject({
1447
+ timestamptz: optional(picklist([
1448
+ "string",
1449
+ "instant",
1450
+ "utc"
1451
+ ])),
1452
+ int8: optional(picklist([
1453
+ "number",
1454
+ "string",
1455
+ "bigint"
1456
+ ])),
1457
+ numeric: optional(picklist(["number", "string"]))
1458
+ })),
1459
+ relations: optional(strictObject({ nullableUnderRls: optional(boolean()) })),
1460
+ sensitive: optional(strings),
1461
+ storagePaths: optional(stringRecord),
1462
+ functions: optional(record(string(), strictObject({ notNull: optional(union([literal(true), strings])) }))),
1463
+ expose: optional(record(string(), union([
1464
+ privileges,
1465
+ strictObject({
1466
+ anon: optional(privileges),
1467
+ authenticated: optional(privileges),
1468
+ serviceRole: optional(privileges)
1469
+ }),
1470
+ strictObject({
1471
+ execute: array(picklist(["anon", "authenticated"])),
1472
+ serviceRole: optional(boolean())
1473
+ })
1474
+ ]))),
1475
+ readSets: optional(strings),
1476
+ generators: optional(array(generator)),
1477
+ organization: optional(strictObject({
1478
+ column: optional(string()),
1479
+ onMissing: optional(picklist(["error", "skip"])),
1480
+ header: optional(string())
1481
+ })),
1482
+ claims: optional(strictObject({
1483
+ scope: optional(string()),
1484
+ features: optional(string()),
1485
+ memberships: optional(string()),
1486
+ permissions: optional(string())
1487
+ })),
1488
+ buckets: optional(record(string(), bucket)),
1489
+ topics: optional(stringRecord),
1490
+ realtime: optional(strictObject({
1491
+ tables: optional(strings),
1492
+ global: optional(strings),
1493
+ users: optional(stringRecord),
1494
+ policies: optional(strictObject({
1495
+ from: strings,
1496
+ output: string()
1497
+ })),
1498
+ triggers: optional(array(strictObject({
1499
+ topic: string(),
1500
+ table: string(),
1501
+ values: optional(triggerValues),
1502
+ events: optional(array(picklist([
1503
+ "insert",
1504
+ "update",
1505
+ "delete"
1506
+ ]))),
1507
+ event: optional(union([string(), strictObject({
1508
+ insert: optional(string()),
1509
+ update: optional(string()),
1510
+ delete: optional(string())
1511
+ })])),
1512
+ payload: optional(union([picklist(["keys", "row"]), record(string(), union([triggerValue, strictObject({ sql: string() })]))])),
1513
+ topics: optional(array(strictObject({
1514
+ topic: string(),
1515
+ values: optional(triggerValues)
1516
+ }))),
1517
+ functionSchema: optional(string()),
1518
+ when: optional(strictObject({ changed: pipe(array(string()), minLength(1)) }))
1519
+ })))
1520
+ })),
1521
+ entitlements: optional(strictObject({
1522
+ customer: optional(string()),
1523
+ key: optional(string()),
1524
+ memberships: optional(picklist(["tenant", "provider"])),
1525
+ source: optional(union([picklist(["stripe-sync", "custom"]), strictObject({ plans: strictObject({
1526
+ subscriptions: strictObject({
1527
+ table: string(),
1528
+ tenant: string(),
1529
+ plan: string(),
1530
+ status: optional(string()),
1531
+ activeStatuses: optional(strings)
1532
+ }),
1533
+ features: strictObject({
1534
+ table: string(),
1535
+ plan: string(),
1536
+ feature: string(),
1537
+ included: optional(string()),
1538
+ value: optional(string())
1539
+ })
1540
+ }) })])),
1541
+ claim: optional(union([literal(false), strictObject({
1542
+ maxTenants: optional(number()),
1543
+ keys: optional(stringRecord)
1544
+ })]))
1545
+ })),
1546
+ authorization: optional(checkedAuthorization),
1547
+ vectorSearch: optional(record(string(), union([string(), strictObject({
1548
+ column: string(),
1549
+ distance: optional(picklist([
1550
+ "cosine",
1551
+ "l2",
1552
+ "inner_product"
1553
+ ])),
1554
+ type: optional(picklist(["vector", "halfvec"])),
1555
+ key: optional(string()),
1556
+ hybrid: optional(strictObject({
1557
+ tsvector: string(),
1558
+ config: optional(string()),
1559
+ k: optional(number())
1560
+ })),
1561
+ boost: optional(string()),
1562
+ prefilter: optional(strings),
1563
+ predicate: optional(string()),
1564
+ boostMode: optional(picklist(["multiply", "add"])),
1565
+ order: optional(string())
1566
+ })]))),
1567
+ subjects: optional(record(pipe(string(), regex(/^[a-z][a-z0-9_-]{0,62}$/, "a subject type is lowercase letters, digits, hyphens and underscores")), strictObject({
1568
+ table: string(),
1569
+ id: optional(string()),
1570
+ idType: optional(string()),
1571
+ tenant: optional(union([string(), literal(false)])),
1572
+ title: optional(string()),
1573
+ url: optional(string()),
1574
+ permissions: optional(subjectPermissionsSchema),
1575
+ scope: optional(string()),
1576
+ cascade: optional(boolean()),
1577
+ deletedAt: optional(string()),
1578
+ held: optional(string()),
1579
+ search: optional(subjectSearchSchema),
1580
+ rank: optional(strictObject({
1581
+ column: string(),
1582
+ group: optional(string())
1583
+ })),
1584
+ versions: optional(strictObject({
1585
+ columns: strings,
1586
+ auto: boolean()
1587
+ }))
1588
+ }))),
1589
+ appTables: optional(appTables),
1590
+ blocks: optional(blocksSchema),
1591
+ sql: optional(strictObject({
1592
+ workflow: optional(picklist([
1593
+ "pg-delta",
1594
+ "migra",
1595
+ "migrations"
1596
+ ])),
1597
+ dir: optional(string()),
1598
+ prefix: optional(string()),
1599
+ testsDir: optional(string()),
1600
+ schema: optional(string()),
1601
+ api: optional(string()),
1602
+ owner: optional(picklist([
1603
+ "tenant",
1604
+ "user",
1605
+ "none"
1606
+ ])),
1607
+ ownTablePolicies: optional(picklist(["block", "app"])),
1608
+ tenantColumn: optional(string())
1609
+ })),
1610
+ seed: optional(strictObject({
1611
+ entry: optional(string()),
1612
+ output: optional(string()),
1613
+ perTenant: optional(string())
1614
+ })),
1615
+ openapi: optional(strictObject({
1616
+ entry: optional(string()),
1617
+ output: optional(string())
1618
+ })),
1619
+ specs: optional(strictObject({
1620
+ entry: optional(string()),
1621
+ outputs: optional(array(strictObject({
1622
+ format: pipe(string(), minLength(1)),
1623
+ version: optional(string()),
1624
+ output: optional(string()),
1625
+ overlays: optional(strings),
1626
+ serialize: optional(picklist(["json", "yaml"])),
1627
+ ui: optional(picklist([
1628
+ "scalar",
1629
+ "swagger",
1630
+ "redoc",
1631
+ "elements",
1632
+ "rapidoc"
1633
+ ]))
1634
+ }))),
1635
+ failOn: optional(picklist([
1636
+ "error",
1637
+ "warning",
1638
+ "never"
1639
+ ])),
1640
+ manifest: optional(string())
1641
+ })),
1642
+ doctor: optional(strictObject({
1643
+ ignore: optional(strings),
1644
+ only: optional(strings),
1645
+ strict: optional(boolean()),
1646
+ format: optional(picklist([
1647
+ "text",
1648
+ "sarif",
1649
+ "github"
1650
+ ])),
1651
+ output: optional(string()),
1652
+ sources: optional(strings),
1653
+ policyHelperLimit: optional(number()),
1654
+ claimsLimit: optional(number()),
1655
+ migrationSafety: optional(strictObject({ since: optional(string()) }))
1656
+ })),
1657
+ env: optional(strictObject({
1658
+ output: optional(string()),
1659
+ prefix: optional(string())
1660
+ })),
1661
+ integrations: optional(array(picklist(INTEGRATIONS))),
1662
+ skills: optional(strictObject({ agents: optional(array(picklist(SKILLS_AGENTS))) })),
1663
+ keys: optional(strictObject({ output: optional(string()) }))
1664
+ };
1665
+ const pickEntries = (keys) => Object.fromEntries(keys.map((key) => [key, FLAT[key]]));
1666
+ const ENTRIES = {
1667
+ database: optional(strictObject(pickEntries([
1668
+ "source",
1669
+ "schemas",
1670
+ "sql",
1671
+ "seed",
1672
+ "expose",
1673
+ "buckets",
1674
+ "realtime",
1675
+ "topics",
1676
+ "vectorSearch"
1677
+ ]))),
1678
+ auth: optional(strictObject({
1679
+ tenant: optional(strictObject({
1680
+ claim: optional(string()),
1681
+ column: optional(string()),
1682
+ onMissing: optional(picklist(["error", "skip"])),
1683
+ header: optional(string())
1684
+ })),
1685
+ ...pickEntries([
1686
+ "claims",
1687
+ "authorization",
1688
+ "entitlements"
1689
+ ])
1690
+ })),
1691
+ subjects: FLAT.subjects,
1692
+ blocks: FLAT.blocks,
1693
+ adapters: FLAT.integrations,
1694
+ gen: optional(strictObject({
1695
+ tasks: optional(array(picklist(GEN_TASKS))),
1696
+ watchInterval: optional(pipe(number(), minValue(1, "must be a positive number of ms"))),
1697
+ contentMapper: optional(boolean()),
1698
+ powersync: optional(powersyncGenSchema),
1699
+ ...pickEntries([
1700
+ "output",
1701
+ "casing",
1702
+ "postgrestVersion",
1703
+ "recordTypes",
1704
+ "hooks",
1705
+ "tables",
1706
+ "json",
1707
+ "codecs",
1708
+ "relations",
1709
+ "sensitive",
1710
+ "storagePaths",
1711
+ "functions",
1712
+ "generators",
1713
+ "readSets"
1714
+ ])
1715
+ })),
1716
+ api: optional(strictObject(pickEntries(["openapi", "specs"]))),
1717
+ tooling: optional(strictObject(pickEntries([
1718
+ "doctor",
1719
+ "env",
1720
+ "keys",
1721
+ "skills"
1722
+ ])))
1723
+ };
1724
+ const EnvironmentSchema = strictObject(ENTRIES);
1725
+ /**
1726
+ * The shape of a `/create` design; `parseDesign` adds the rules a schema can't
1727
+ * state.
1728
+ */
1729
+ /**
1730
+ * A preset name, or the conventions that differ from the defaults and the
1731
+ * blocks.
1732
+ */
1733
+ const PresetSchema = union([pipe(string(), minLength(1)), strictObject({
1734
+ ...Object.fromEntries(CONVENTION_FIELDS.map((field) => [field.key, optional(field.multi === true ? array(picklist(field.values)) : picklist(field.values))])),
1735
+ blocks: optional(array(string())),
1736
+ instances: optional(record(string(), presetInstance))
1737
+ })]);
1738
+ strictObject({
1739
+ version: optional(pipe(number(), integer(), minValue(0))),
1740
+ preset: optional(PresetSchema),
1741
+ appTables: optional(designAppTables),
1742
+ extraColumns: optional(record(string(), stringRecord)),
1743
+ positions: optional(record(string(), pipe(array(number()), length(2))))
1744
+ });
1745
+ const ConfigSchema = strictObject({
1746
+ $schema: optional(string()),
1747
+ preset: optional(PresetSchema),
1748
+ ...ENTRIES,
1749
+ $env: optional(record(string(), EnvironmentSchema)),
1750
+ $development: optional(EnvironmentSchema),
1751
+ $production: optional(EnvironmentSchema),
1752
+ $test: optional(EnvironmentSchema),
1753
+ $ci: optional(EnvironmentSchema)
1754
+ });
1755
+ /** Each issue as `path: message`, the path in config keys. */
1756
+ function configIssues(value) {
1757
+ const moved = movedKeyIssues(value);
1758
+ if (moved.length > 0) return moved;
1759
+ const auth = typeof value === "object" && value !== null && "auth" in value ? value.auth : void 0;
1760
+ if (typeof value === "object" && value !== null && typeof auth === "object" && auth !== null && "authorization" in auth) {
1761
+ const provider = auth.authorization;
1762
+ const problem = typeof provider === "object" && provider !== null ? providerApiProblem(provider) : void 0;
1763
+ if (problem !== void 0) {
1764
+ const { authorization: _, ...rest } = auth;
1765
+ return [`auth.authorization.apiVersion: ${problem}`, ...configIssues({
1766
+ ...value,
1767
+ auth: rest
1768
+ })];
1769
+ }
1770
+ }
1771
+ const result = safeParse(ConfigSchema, value);
1772
+ if (result.success) return [];
1773
+ return result.issues.map((issue) => {
1774
+ const path = getDotPath(issue);
1775
+ return path ? `${path}: ${issue.message}` : issue.message;
1776
+ });
1777
+ }
1778
+ strictObject(blockEntries);
1779
+ // src/cli/core/credentials.ts
1780
+ /** The first source that has a value, in order. */
1781
+ function first(sources) {
1782
+ for (const [from, value] of sources) if (value !== void 0 && value !== "") return {
1783
+ value,
1784
+ from
1785
+ };
1786
+ }
1787
+ /**
1788
+ * The Supabase access token: `source.accessToken`, then
1789
+ * `$SUPABASE_ACCESS_TOKEN`.
1790
+ */
1791
+ function accessToken(config, env) {
1792
+ return first([["database.source.accessToken", config.source.accessToken], ["$SUPABASE_ACCESS_TOKEN", env.SUPABASE_ACCESS_TOKEN]]);
1793
+ }
1794
+ /**
1795
+ * A connection string given by the user: `--db-url-stdin`, `source.dbUrl`,
1796
+ * `$DATABASE_URL`, then `$SUPABASE_DB_URL`.
1797
+ */
1798
+ function databaseUrlCredential(config, env, fromStdin) {
1799
+ return first([
1800
+ ["--db-url-stdin", fromStdin],
1801
+ ["database.source.dbUrl", config.source.dbUrl],
1802
+ ["$DATABASE_URL", env.DATABASE_URL],
1803
+ ["$SUPABASE_DB_URL", env.SUPABASE_DB_URL]
1804
+ ]);
1805
+ }
1806
+ // src/cli/schema-tags.ts
1807
+ /** The `@bsb` table comments in the project's declarative schema files. */
1808
+ async function schemaTagComments(config) {
1809
+ const toml = await readSupabaseToml(config.root);
1810
+ const { files } = await schemaPaths(config.root, toml, sqlWorkflow(config, toml));
1811
+ return (await Promise.all(files.map((path) => readFile(resolve(config.root, path), "utf-8")))).flatMap((sql) => tableTagComments(sql));
1812
+ }
1813
+ /**
1814
+ * `config` with the features the schema files' `@bsb` table comments turn on
1815
+ * (ADR 0102), so the SQL modules, `gen` and doctor read the same config. A key
1816
+ * the config sets itself wins. `appTables` stays as declared: `encrypted` and
1817
+ * `events` tags describe tables whose SQL the files already hold, and `gen`
1818
+ * reads them from the snapshot.
1819
+ */
1820
+ async function withSchemaTags(config) {
1821
+ const tagged = withTableTags(config, await schemaTagComments(config));
1822
+ return tagged === config ? config : {
1823
+ ...tagged,
1824
+ appTables: config.appTables
1825
+ };
1826
+ }
1827
+ // src/cli/config.ts
1828
+ const CONFIG_FILES = [
1829
+ "better-supabase.config.ts",
1830
+ "better-supabase.config.mts",
1831
+ "better-supabase.config.js",
1832
+ "better-supabase.config.mjs",
1833
+ "better-supabase.config.json"
1834
+ ];
1835
+ function configIn(dir) {
1836
+ for (const name of CONFIG_FILES) {
1837
+ const path = join(dir, name);
1838
+ if (existsSync(path)) return path;
1839
+ }
1840
+ }
1841
+ function findConfig(cwd, explicit) {
1842
+ if (explicit) return resolve(cwd, explicit);
1843
+ return configIn(cwd);
1844
+ }
1845
+ /**
1846
+ * `--config`, else the first `better-supabase.config.*` at or above `cwd`,
1847
+ * within the same `.git` boundary as the Supabase project search.
1848
+ */
1849
+ function discoverConfig(cwd, explicit) {
1850
+ if (explicit) return resolve(cwd, explicit);
1851
+ const dir = findUp(cwd, (candidate) => configIn(candidate) !== void 0);
1852
+ return dir === void 0 ? void 0 : configIn(dir);
1853
+ }
1854
+ /** The named export, then `default`, of a project module. */
1855
+ async function importExport(path, name) {
1856
+ if (!existsSync(path)) throw new CliError("not_found", `Module not found: ${path}`);
1857
+ const loaded = await importFresh(path);
1858
+ return loaded[name] ?? loaded["default"];
1859
+ }
1860
+ function isConfig(value) {
1861
+ return configIssues(value).length === 0;
1862
+ }
1863
+ const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1864
+ /**
1865
+ * Objects merge key by key; arrays and every other value replace what `base`
1866
+ * had.
1867
+ */
1868
+ function mergeConfig(base, override) {
1869
+ const merged = { ...base };
1870
+ for (const [key, value] of Object.entries(override)) {
1871
+ if (value === void 0) continue;
1872
+ const current = merged[key];
1873
+ merged[key] = isPlainObject(current) && isPlainObject(value) ? mergeConfig(current, value) : value;
1874
+ }
1875
+ return merged;
1876
+ }
1877
+ /**
1878
+ * A config without the removed top-level `tables` and `records` keys: the
1879
+ * tables as `appTables`, and the records merged into `subjects`. `migrate
1880
+ * schema-first` reads them to write the tables as SQL.
1881
+ */
1882
+ function takeLegacyTables(config) {
1883
+ if (!isPlainObject(config)) return {};
1884
+ const { tables, appTables, records, ...rest } = config;
1885
+ const subjects = isPlainObject(records) ? records : void 0;
1886
+ return {
1887
+ config: subjects === void 0 ? rest : {
1888
+ ...rest,
1889
+ subjects: {
1890
+ ...subjects,
1891
+ ...isPlainObject(rest["subjects"]) ? rest["subjects"] : {}
1892
+ }
1893
+ },
1894
+ appTables: isPlainObject(tables) ? tables : appTables
1895
+ };
1896
+ }
1897
+ /**
1898
+ * The config with the `environment` blocks merged in: `$env.<name>`, then the
1899
+ * `$development`, `$production`, `$test` or `$ci` shorthand. Every `$` key is
1900
+ * dropped from the result.
1901
+ */
1902
+ function applyEnvironment(config, environment) {
1903
+ const { $schema: _schema, $env, $development, $production, $test, $ci, ...base } = config;
1904
+ if (environment === void 0) return base;
1905
+ const shorthand = (/* @__PURE__ */ new Map([
1906
+ ["development", $development],
1907
+ ["production", $production],
1908
+ ["test", $test],
1909
+ ["ci", $ci]
1910
+ ])).get(environment);
1911
+ let merged = { ...base };
1912
+ for (const block of [$env?.[environment], shorthand]) if (block) merged = mergeConfig(merged, block);
1913
+ if (!isConfig(merged)) throw new CliError("config_invalid", `The ${environment} environment makes the config invalid:\n${configIssues(merged).map((issue) => ` ${issue}`).join("\n")}`);
1914
+ return merged;
1915
+ }
1916
+ function defaultConfig(cwd, explicit, environment, path = discoverConfig(cwd, explicit)) {
1917
+ const resolved = resolveConfig({}, !path || explicit ? cwd : dirname(path));
1918
+ return environment === void 0 ? resolved : {
1919
+ ...resolved,
1920
+ environment
1921
+ };
1922
+ }
1923
+ /**
1924
+ * Loads `better-supabase.config.*` with c12 and checks it against the config
1925
+ * schema. c12 imports `.ts` natively (Node 24 strips the types), so no loader
1926
+ * is needed; rc files, `package.json`, env overrides and `extends` are off so
1927
+ * the one file is the whole config. `environment` merges its blocks in
1928
+ * (`applyEnvironment`); c12's own `envName` is off because it concatenates
1929
+ * arrays. A discovered file sets the project root to its own directory;
1930
+ * `--config` keeps `cwd` as the root. `path` is the file `discoverConfig`
1931
+ * found, for callers that already looked it up.
1932
+ */
1933
+ async function loadConfig(cwd, explicit, environment, path = discoverConfig(cwd, explicit), options = {}) {
1934
+ const withEnvironment = (resolved) => environment === void 0 ? resolved : {
1935
+ ...resolved,
1936
+ environment
1937
+ };
1938
+ if (!path) return withEnvironment(resolveConfig({}, cwd));
1939
+ if (!existsSync(path)) throw new CliError("config_not_found", `Config file not found: ${path}`);
1940
+ const { config } = await loadConfig$1({
1941
+ cwd,
1942
+ configFile: path,
1943
+ rcFile: false,
1944
+ globalRc: false,
1945
+ packageJson: false,
1946
+ dotenv: false,
1947
+ envName: false,
1948
+ extend: false,
1949
+ giget: false
1950
+ });
1951
+ const legacy = options.legacyTables === true ? takeLegacyTables(config) : {};
1952
+ const current = legacy.config ?? config;
1953
+ if (!isConfig(current)) {
1954
+ const issues = configIssues(current);
1955
+ throw new CliError("config_invalid", `${display(cwd, path)} is not a valid config:\n${issues.map((issue) => ` ${issue}`).join("\n")}`, { issues });
1956
+ }
1957
+ return withEnvironment(await withSchemaTags(resolveConfig({
1958
+ ...applyEnvironment(current, environment),
1959
+ ...legacy.appTables === void 0 ? {} : { appTables: legacy.appTables }
1960
+ }, explicit ? cwd : dirname(path))));
1961
+ }
1962
+ /** `[db] port` or `[api] port` from `supabase/config.toml`. */
1963
+ async function readSupabasePort(root, section) {
1964
+ const toml = await readSupabaseToml(root);
1965
+ return toml ? tomlNumber(toml.document, [section, "port"]) : void 0;
1966
+ }
1967
+ /** The connection string piped in for `--db-url-stdin`, when it was passed. */
1968
+ async function stdinDatabaseUrl(enabled, io) {
1969
+ if (enabled !== true) return;
1970
+ const url = (await readStdin(io, "--db-url-stdin")).trim();
1971
+ if (!url) throw new CliError("missing_value", "--db-url-stdin read nothing from stdin. Pipe the connection string: printf %s \"$URL\" | better-supabase <command> --db-url-stdin", { flag: "--db-url-stdin" });
1972
+ return url;
1973
+ }
1974
+ /**
1975
+ * Connection string: stdin, config, `$DATABASE_URL`, `$SUPABASE_DB_URL`, then
1976
+ * the local stack: the `[db] port` in `config.toml`, else the running stack's
1977
+ * `DB_URL`. With neither it fails with `not_found` rather than guess a port.
1978
+ */
1979
+ async function databaseUrl(config, env, fromStdin, stack = env.BSB_STACK) {
1980
+ const given = databaseUrlCredential(config, env, fromStdin);
1981
+ if (given) return given.value;
1982
+ if (stack !== void 0 && stack !== "") return namedStackUrl(config.root, stack, env);
1983
+ let resolved = localUrls.get(config);
1984
+ if (!resolved) {
1985
+ resolved = localDatabaseUrl(config.root, env);
1986
+ localUrls.set(config, resolved);
1987
+ }
1988
+ return resolved;
1989
+ }
1990
+ /**
1991
+ * The database of `supabase/stacks/<name>/config.toml`, a stack kept for one
1992
+ * purpose such as tests or a demo.
1993
+ */
1994
+ async function namedStackUrl(root, name, env) {
1995
+ if (!/^[a-z0-9][a-z0-9_-]*$/u.test(name)) throw new CliError("invalid_value", `--stack "${name}" must be lowercase letters, digits, dashes or underscores.`, { flag: "--stack" });
1996
+ const toml = await readSupabaseToml(root);
1997
+ const file = toml ? join(dirname(resolve(root, toml.path)), "stacks", name, "config.toml") : void 0;
1998
+ const db = file !== void 0 && existsSync(file) ? parse$1(await readFile(file, "utf-8"))["db"] : void 0;
1999
+ const port = typeof db === "object" && db !== null && "port" in db && typeof db.port === "number" ? db.port : void 0;
2000
+ if (port !== void 0) return `postgresql://postgres:postgres@127.0.0.1:${port}/postgres`;
2001
+ return statusDatabaseUrl(root, env, name, `supabase/stacks/${name}/config.toml sets no [db] port`);
2002
+ }
2003
+ /** One lookup per loaded config, so a run asks `supabase status` at most once. */
2004
+ const localUrls = /* @__PURE__ */ new WeakMap();
2005
+ async function localDatabaseUrl(root, env) {
2006
+ const port = await readSupabasePort(root, "db");
2007
+ if (port !== void 0) return `postgresql://postgres:postgres@127.0.0.1:${port}/postgres`;
2008
+ return statusDatabaseUrl(root, env, void 0, await readSupabaseToml(root) ? "supabase/config.toml sets no [db] port" : "there is no supabase/config.toml");
2009
+ }
2010
+ /** The running stack's `DB_URL`, or `not_found` naming both places it looked. */
2011
+ async function statusDatabaseUrl(root, env, stack, noPort) {
2012
+ let failure;
2013
+ try {
2014
+ const status = await readStackStatus(root, env, stack === void 0 ? {} : { stack });
2015
+ const url = status.ok ? status.status["DB_URL"] : void 0;
2016
+ if (typeof url === "string" && url.length > 0) return url;
2017
+ failure = status.ok ? "printed no DB_URL" : `failed (exit ${String(status.code)})`;
2018
+ } catch (error) {
2019
+ if (error instanceof CliError && error.code === "supabase_cli_missing") failure = "could not run";
2020
+ else if (error instanceof CliError) failure = `failed: ${error.message}`;
2021
+ else throw error;
2022
+ }
2023
+ const command = stack === void 0 ? "supabase status" : `supabase status --stack ${stack}`;
2024
+ throw new CliError("not_found", `No database to connect to: ${noPort}, and \`${command}\` ${failure}. Start the stack, set [db] port, or pass $DATABASE_URL or --db-url-stdin.`, {
2025
+ suggestion: stack === void 0 ? "supabase start" : `supabase start --stack ${stack}`,
2026
+ ...stack === void 0 ? {} : { flag: "--stack" }
2027
+ });
2028
+ }
2029
+ export { findConfig as a, readSupabasePort as c, GEN_TASKS as d, INTEGRATIONS as f, subjectTagArgs as h, discoverConfig as i, stdinDatabaseUrl as l, withTableTags as m, databaseUrl as n, importExport as o, isGenTask as p, defaultConfig as r, loadConfig as s, applyEnvironment as t, accessToken as u };