better-supabase 0.32.0 → 0.33.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 (455) hide show
  1. package/README.md +11 -10
  2. package/codemods/0.32.json +31 -0
  3. package/dist/{adapter-CPPN80mx.js → adapter-CWzyKepA.js} +45 -16
  4. package/dist/{agents-BEiBtYmh.d.ts → agents-DXiOPB3V.d.ts} +4 -4
  5. package/dist/{ai-cache-FMYzw7lW.d.ts → ai-cache-CLiAXCPH.d.ts} +4 -4
  6. package/dist/{ai-chat-B_P--Ie2.d.ts → ai-chat-DlcBdOhJ.d.ts} +4 -4
  7. package/dist/{ai-schedules-D_q1iclL.d.ts → ai-schedules-Drx2KRTn.d.ts} +5 -5
  8. package/dist/ai-sdk/agents/index.d.ts +6 -6
  9. package/dist/ai-sdk/batches/index.d.ts +3 -3
  10. package/dist/ai-sdk/cache/index.d.ts +1 -1
  11. package/dist/ai-sdk/chat/index.d.ts +2 -2
  12. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  13. package/dist/ai-sdk/files/index.d.ts +1 -1
  14. package/dist/ai-sdk/index.d.ts +5 -5
  15. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  16. package/dist/ai-sdk/memory/index.d.ts +3 -3
  17. package/dist/ai-sdk/workflow/index.d.ts +3 -3
  18. package/dist/{api-keys-u2sXB-CZ.d.ts → api-keys-DbIbkGxx.d.ts} +4 -4
  19. package/dist/{api-CwzVbbw4.d.ts → api-myq2e9t5.d.ts} +5 -6
  20. package/dist/{app-tables-DomvYx5b.d.ts → app-tables-IrglDJCs.d.ts} +1 -1
  21. package/dist/{approvals-idpuhILk.d.ts → approvals-DZoGtNFv.d.ts} +5 -5
  22. package/dist/{assistant-CMKsaeJd.d.ts → assistant-BEbRPjhn.d.ts} +2 -2
  23. package/dist/astro/index.d.ts +7 -8
  24. package/dist/astro/index.js +5 -5
  25. package/dist/{auth-module-CVo86UKh.js → auth-module-CqXdm8qD.js} +1 -1
  26. package/dist/{authorization-CYu_UKX4.d.ts → authorization-BlmDNI2b.d.ts} +12 -1
  27. package/dist/{authorization-hooks-CldgvzBZ.d.ts → authorization-hooks-CxwsRnfV.d.ts} +2 -2
  28. package/dist/{authorizer-D6po_XZA.js → authorizer-BtIPDO-c.js} +33 -10
  29. package/dist/better-result/index.d.ts +3 -3
  30. package/dist/{bind-8LYVJE5W.d.ts → bind-DP-KLgYI.d.ts} +7 -7
  31. package/dist/{block-env-BsLgZL2l.d.ts → block-env-CJ38ZSTP.d.ts} +4 -4
  32. package/dist/{block-helpers-JxiD1iw4.d.ts → block-helpers-disoUWCp.d.ts} +1 -1
  33. package/dist/{block-hooks-CJP5kGEa.d.ts → block-hooks-DrA_d1dJ.d.ts} +2 -2
  34. package/dist/{block-subjects-SyJwfgrX.d.ts → block-subjects-Br2MQNFn.d.ts} +1 -1
  35. package/dist/block-tables-CQTU71zn.d.ts +34 -0
  36. package/dist/{block-transport-Bbf1ZZre.d.ts → block-transport-BEtC_Kis.d.ts} +2 -2
  37. package/dist/blocks/access-requests/index.d.ts +5 -5
  38. package/dist/blocks/activities/index.d.ts +9 -9
  39. package/dist/blocks/agents/index.d.ts +4 -4
  40. package/dist/blocks/ai-cache/index.d.ts +3 -3
  41. package/dist/blocks/ai-chat/index.d.ts +8 -8
  42. package/dist/blocks/ai-files/index.d.ts +3 -3
  43. package/dist/blocks/ai-keys/index.d.ts +4 -4
  44. package/dist/blocks/ai-schedules/index.d.ts +3 -3
  45. package/dist/blocks/announcements/index.d.ts +8 -8
  46. package/dist/blocks/api-keys/index.d.ts +4 -108
  47. package/dist/blocks/approvals/index.d.ts +4 -4
  48. package/dist/blocks/assets/index.d.ts +6 -6
  49. package/dist/blocks/assignment/index.d.ts +7 -7
  50. package/dist/blocks/attachments/index.d.ts +4 -4
  51. package/dist/blocks/audit/index.d.ts +13 -13
  52. package/dist/blocks/automations/index.d.ts +12 -12
  53. package/dist/blocks/billable-time/index.d.ts +6 -6
  54. package/dist/blocks/billing/index.d.ts +9 -9
  55. package/dist/blocks/bookings/index.d.ts +4 -4
  56. package/dist/blocks/bulk/index.d.ts +4 -4
  57. package/dist/blocks/calendar/index.d.ts +5 -5
  58. package/dist/blocks/catalog/index.d.ts +6 -6
  59. package/dist/blocks/channels/index.d.ts +7 -7
  60. package/dist/blocks/collections/index.d.ts +6 -6
  61. package/dist/blocks/comments/index.d.ts +10 -10
  62. package/dist/blocks/compliance/index.d.ts +5 -5
  63. package/dist/blocks/connectors/index.d.ts +4 -4
  64. package/dist/blocks/contacts/index.d.ts +6 -6
  65. package/dist/blocks/content/index.d.ts +5 -5
  66. package/dist/blocks/contracts/index.d.ts +6 -6
  67. package/dist/blocks/courses/index.d.ts +5 -5
  68. package/dist/blocks/created-by/index.d.ts +2 -2
  69. package/dist/blocks/custom-fields/index.d.ts +6 -6
  70. package/dist/blocks/data-lifecycle/index.d.ts +8 -8
  71. package/dist/blocks/deals/index.d.ts +6 -6
  72. package/dist/blocks/dispatch/index.d.ts +6 -6
  73. package/dist/blocks/documents/index.d.ts +4 -4
  74. package/dist/blocks/domains/index.d.ts +6 -6
  75. package/dist/blocks/donations/index.d.ts +6 -6
  76. package/dist/blocks/drive/index.d.ts +6 -6
  77. package/dist/blocks/employees/index.d.ts +8 -8
  78. package/dist/blocks/enrichment/index.d.ts +6 -6
  79. package/dist/blocks/enrollments/index.d.ts +6 -6
  80. package/dist/blocks/entitlements/index.d.ts +6 -6
  81. package/dist/blocks/entitlements/index.js +2 -23
  82. package/dist/blocks/expenses/index.d.ts +5 -5
  83. package/dist/blocks/field-history/index.d.ts +4 -4
  84. package/dist/blocks/flags/index.d.ts +5 -5
  85. package/dist/blocks/flags/index.js +1 -1
  86. package/dist/blocks/forecasts/index.d.ts +6 -6
  87. package/dist/blocks/forms/index.d.ts +6 -6
  88. package/dist/blocks/goals/index.d.ts +4 -4
  89. package/dist/blocks/guests/index.d.ts +6 -6
  90. package/dist/blocks/hiring/index.d.ts +6 -6
  91. package/dist/blocks/identities/index.d.ts +5 -5
  92. package/dist/blocks/imports/index.d.ts +5 -5
  93. package/dist/blocks/inbox/index.d.ts +10 -10
  94. package/dist/blocks/incidents/index.d.ts +5 -5
  95. package/dist/blocks/index.d.ts +9 -9
  96. package/dist/blocks/inventory/index.d.ts +6 -6
  97. package/dist/blocks/invoices/index.d.ts +8 -8
  98. package/dist/blocks/knowledge/index.d.ts +3 -3
  99. package/dist/blocks/lead-scoring/index.d.ts +7 -7
  100. package/dist/blocks/leases/index.d.ts +6 -6
  101. package/dist/blocks/leave/index.d.ts +5 -5
  102. package/dist/blocks/ledger/index.d.ts +6 -6
  103. package/dist/blocks/mail-sync/index.d.ts +5 -5
  104. package/dist/blocks/memberships/index.d.ts +2 -2
  105. package/dist/blocks/memberships/index.js +1 -1
  106. package/dist/blocks/memory/index.d.ts +4 -4
  107. package/dist/blocks/messaging/index.d.ts +11 -11
  108. package/dist/blocks/metrics/index.d.ts +6 -6
  109. package/dist/blocks/mfa/index.d.ts +2 -2
  110. package/dist/blocks/moderation/index.d.ts +6 -6
  111. package/dist/blocks/notifications/index.d.ts +11 -11
  112. package/dist/blocks/numbering/index.d.ts +4 -4
  113. package/dist/blocks/oauth-server/index.d.ts +5 -5
  114. package/dist/blocks/onboarding/index.d.ts +5 -5
  115. package/dist/blocks/orders/index.d.ts +7 -7
  116. package/dist/blocks/organizations/index.d.ts +8 -8
  117. package/dist/blocks/organizations/index.js +1 -1
  118. package/dist/blocks/outbox/index.d.ts +4 -4
  119. package/dist/blocks/passes/index.d.ts +8 -8
  120. package/dist/blocks/permissions/index.d.ts +12 -7
  121. package/dist/blocks/permissions/index.js +6 -6
  122. package/dist/blocks/pipelines/index.d.ts +6 -6
  123. package/dist/blocks/posts/index.d.ts +5 -5
  124. package/dist/blocks/profiles/index.d.ts +4 -4
  125. package/dist/blocks/promotions/index.d.ts +5 -5
  126. package/dist/blocks/push/index.d.ts +7 -7
  127. package/dist/blocks/queue/index.d.ts +6 -6
  128. package/dist/blocks/queue/index.js +2 -2
  129. package/dist/blocks/quotes/index.d.ts +8 -8
  130. package/dist/blocks/rank/index.d.ts +4 -4
  131. package/dist/blocks/reactions/index.d.ts +9 -9
  132. package/dist/blocks/relations/index.d.ts +7 -7
  133. package/dist/blocks/reminders/index.d.ts +8 -8
  134. package/dist/blocks/reviews/index.d.ts +5 -5
  135. package/dist/blocks/saved-views/index.d.ts +6 -6
  136. package/dist/blocks/scores/index.d.ts +5 -5
  137. package/dist/blocks/search/index.d.ts +7 -7
  138. package/dist/blocks/security-events/index.d.ts +7 -7
  139. package/dist/blocks/segments/index.d.ts +7 -7
  140. package/dist/blocks/sequences/index.d.ts +6 -6
  141. package/dist/blocks/service-accounts/index.d.ts +5 -5
  142. package/dist/blocks/sessions/index.d.ts +2 -2
  143. package/dist/blocks/settings/index.d.ts +6 -6
  144. package/dist/blocks/share-links/index.d.ts +5 -5
  145. package/dist/blocks/shipments/index.d.ts +6 -6
  146. package/dist/blocks/signatures/index.d.ts +5 -5
  147. package/dist/blocks/signing-keys/index.d.ts +4 -4
  148. package/dist/blocks/sla/index.d.ts +7 -7
  149. package/dist/blocks/sso/index.d.ts +6 -6
  150. package/dist/blocks/state-machine/index.d.ts +5 -5
  151. package/dist/blocks/subjects/index.d.ts +6 -6
  152. package/dist/blocks/tags/index.d.ts +6 -6
  153. package/dist/blocks/tasks/index.d.ts +9 -9
  154. package/dist/blocks/teams/index.d.ts +4 -4
  155. package/dist/blocks/templates/index.d.ts +7 -7
  156. package/dist/blocks/time-tracking/index.d.ts +7 -7
  157. package/dist/blocks/timeline/index.d.ts +8 -8
  158. package/dist/blocks/trash/index.d.ts +6 -6
  159. package/dist/blocks/undo/index.d.ts +4 -4
  160. package/dist/blocks/updated-at/index.d.ts +2 -2
  161. package/dist/blocks/usage/index.d.ts +4 -4
  162. package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
  163. package/dist/blocks/versions/index.d.ts +6 -6
  164. package/dist/blocks/waitlist/index.d.ts +5 -5
  165. package/dist/blocks/webhooks/index.d.ts +13 -13
  166. package/dist/blocks/workflow-editor/index.d.ts +9 -9
  167. package/dist/blocks/workflow-editor/index.js +2 -1
  168. package/dist/blocks/workflows/index.d.ts +7 -7
  169. package/dist/{bookings-DG443336.d.ts → bookings-Br0VXzaf.d.ts} +3 -3
  170. package/dist/{bucket-Clq5xINQ.d.ts → bucket-DvG66r5G.d.ts} +1 -1
  171. package/dist/chat-sdk/index.d.ts +6 -6
  172. package/dist/claim-names-BKig1LOk.js +24 -0
  173. package/dist/claims/index.d.ts +8 -0
  174. package/dist/claims/index.js +8 -0
  175. package/dist/{claims-DRmafYVK.js → claims-CqTr_N1n.js} +13 -5
  176. package/dist/cli/{add-fzRPyIED.js → add-BDLLVLI8.js} +3 -2
  177. package/dist/cli/add-BaOCKKt6.js +1 -0
  178. package/dist/cli/{add-ChoHyBhz.js → add-D2pKTbPw.js} +11 -11
  179. package/dist/cli/{app-table-files-C0OtdUVu.js → app-table-files-CimWi_eh.js} +3 -3
  180. package/dist/cli/{providers-DpfoF3VC.js → authorization-DJkkOjjG.js} +25 -93
  181. package/dist/cli/{backfill-Dq2XMXf9.js → backfill-B1xAsdL4.js} +3 -3
  182. package/dist/cli/bin.js +1 -1
  183. package/dist/cli/{blocks-DVhJOzFj.js → blocks-DtZtn-R4.js} +1 -1
  184. package/dist/cli/{blocks-CCzp0eAH.js → blocks-rBeis04I.js} +1 -1
  185. package/dist/cli/{cache-CoC-1i1O.js → cache-CvBRwv02.js} +1 -1
  186. package/dist/cli/{codemod-pyf6HmS9.js → codemod-DYbVbJ-e.js} +5 -4
  187. package/dist/cli/{config-D0m2rQqk.js → config-CrwCec-B.js} +1 -1
  188. package/dist/cli/{config-Dyl3iX3u.js → config-DrrkMihk.js} +1 -0
  189. package/dist/cli/{content-mapper-ChSVT9Tq.js → content-mapper-DrhtDsAm.js} +2 -2
  190. package/dist/cli/{db-dFzhcozO.js → db-Diy1OebO.js} +2 -2
  191. package/dist/cli/{doctor-BKZsztFV.js → doctor-Dn4TzGmw.js} +59 -19
  192. package/dist/cli/{gen-BN_eh6rE.js → gen-BbeS0KgF.js} +14 -14
  193. package/dist/cli/index.d.ts +1 -1
  194. package/dist/cli/index.js +7 -7
  195. package/dist/cli/{init-CaDDt8F6.js → init-C30xdMSs.js} +9 -9
  196. package/dist/cli/{live-KU41LMGE.js → live-Ctc8Qh9Y.js} +2 -2
  197. package/dist/cli/{mcp-C_m-TpLJ.js → mcp-5J0kUOtD.js} +2 -2
  198. package/dist/cli/{metadata-Bq4ra7zo.js → metadata-DxhUNctA.js} +3 -3
  199. package/dist/cli/{migrate-DHG2Qz_K.js → migrate-ockrh3UX.js} +1 -1
  200. package/dist/cli/{migration-safety-STVbiKhz.js → migration-safety-CLrqC0D-.js} +2 -2
  201. package/dist/cli/{migrations-O1QZoMiH.js → migrations-CZTg2UJM.js} +2 -2
  202. package/dist/cli/{module-migration-DB9ntWM-.js → module-migration-BptQzmj2.js} +2 -2
  203. package/dist/cli/powersync-CmsXOuui.js +1 -0
  204. package/dist/cli/{powersync-CN3QPF2K.js → powersync-DIvsipKr.js} +3 -3
  205. package/dist/cli/{print-DG7TRCi8.js → print-DdHt8xCc.js} +2 -2
  206. package/dist/cli/providers-k-1cEna6.js +99 -0
  207. package/dist/cli/{prune-workflows-DcNJUS1m.js → prune-workflows-Ddv-GfkO.js} +3 -3
  208. package/dist/cli/{remove-BpfYqP45.js → remove-DEEQDoc7.js} +5 -5
  209. package/dist/cli/{render-Q7jnLn_C.js → render-SjSVz8yK.js} +7 -4
  210. package/dist/cli/{run-D6K-qQIX.js → run-DdhIK7-K.js} +9 -8
  211. package/dist/cli/{run-9NfabanB.js → run-Ixt9mEb6.js} +29 -29
  212. package/dist/cli/{seed-B4H0Lco9.js → seed-BpaqqyO8.js} +2 -2
  213. package/dist/cli/seed-ByLneY1H.js +1 -0
  214. package/dist/cli/{shared-PrvYREVy.js → shared-p6sxli_5.js} +1 -1
  215. package/dist/cli/{snapshot-UfJsqfys.js → snapshot-Dd_8B9g-.js} +3 -3
  216. package/dist/cli/{source-F3YTVvFo.js → source-BYvVe_Es.js} +1 -1
  217. package/dist/cli/{source-args-DJMrW_jW.js → source-args-Bz5QQne2.js} +1 -1
  218. package/dist/cli/{spec-DsLQuJKp.js → spec-BxQgllJY.js} +2 -2
  219. package/dist/cli/{spec-HQOBVbEO.js → spec-liRzcZTa.js} +1 -1
  220. package/dist/cli/{sql-layout-CZ66pY8j.js → sql-layout-DHwiUOaD.js} +2 -2
  221. package/dist/cli/{sync-B12wbtFd.js → sync-CreQWj53.js} +4 -4
  222. package/dist/cli/{upgrade-AgUXFDo6.js → upgrade-3NQOUO1_.js} +5 -5
  223. package/dist/cli/{upgrade-C20z49De.js → upgrade-U7IKj45h.js} +2 -2
  224. package/dist/cli/{version-DEUWW8cv.js → version-mBwP-aMG.js} +1 -1
  225. package/dist/client/index.d.ts +6 -6
  226. package/dist/client/index.js +1 -1
  227. package/dist/client/native/index.d.ts +5 -5
  228. package/dist/client/native/index.js +1 -1
  229. package/dist/{client-BLor58Je.js → client-Bky2z09B.js} +1 -1
  230. package/dist/{cloud-event-bcaMqEbN.d.ts → cloud-event-DXWmXrus.d.ts} +1 -1
  231. package/dist/{compiler-CWishtY2.d.ts → compiler-qlXlokKn.d.ts} +2 -2
  232. package/dist/{composite-ClLWZIwX.d.ts → composite-CIxjVcL1.d.ts} +7 -7
  233. package/dist/{composite-BZMkWNOQ.js → composite-D2JnIiHt.js} +2 -2
  234. package/dist/config/index.d.ts +3 -3
  235. package/dist/config/index.js +2 -2
  236. package/dist/{config-BhExAhNK.js → config-Bu6pwqcO.js} +1 -1
  237. package/dist/{connectors-BImAu75R.d.ts → connectors-Cf2LeAuZ.d.ts} +4 -4
  238. package/dist/{context-DcxfrCml.d.ts → context-D7jICqdN.d.ts} +15 -3
  239. package/dist/contract/index.d.ts +16 -0
  240. package/dist/contract/index.js +0 -0
  241. package/dist/{controller-D_UJBaEU.d.ts → controller-DxtxeYdf.d.ts} +1 -1
  242. package/dist/{conversion-7U1WeLxK.d.ts → conversion-C9rndpEI.d.ts} +1 -1
  243. package/dist/create/index.d.ts +3 -3
  244. package/dist/create/index.js +1 -1
  245. package/dist/create/lite/index.d.ts +4 -4
  246. package/dist/create/lite/index.js +1 -1
  247. package/dist/credentials/index.d.ts +4 -4
  248. package/dist/{data-engine-B-D6bdyx.d.ts → data-engine-CMENsp3d.d.ts} +1 -1
  249. package/dist/{define-3RbqoF1S.d.ts → define-ITQA71fw.d.ts} +5 -5
  250. package/dist/{define-block-B_i9VPcc.d.ts → define-block-COmMkx2x.d.ts} +12 -12
  251. package/dist/{delegation-BRHHXERz.js → delegation-C2rLpkHO.js} +2 -7
  252. package/dist/{documents-6ov2gWh3.d.ts → documents-DeZw83ue.d.ts} +3 -3
  253. package/dist/edge/index.d.ts +13 -13
  254. package/dist/edge/index.js +9 -9
  255. package/dist/elysia/index.d.ts +1 -1
  256. package/dist/elysia/index.js +1 -1
  257. package/dist/{embeddings-K0lH--nt.d.ts → embeddings-rVR2AKVz.d.ts} +1 -1
  258. package/dist/{ended-CCoE7XXY.d.ts → ended-NC_ZesY4.d.ts} +2 -2
  259. package/dist/entitlements-Dydkg-TV.js +47 -0
  260. package/dist/{entitlements-XwpuBbKN.d.ts → entitlements-w04ivvAy.d.ts} +21 -3
  261. package/dist/{envelope-DAtaFJue.js → envelope-CapD-JtH.js} +3 -2
  262. package/dist/eve/index.d.ts +9 -9
  263. package/dist/eve/index.js +2 -2
  264. package/dist/{eve-Cf-QRGij.d.ts → eve-DIKjuPp5.d.ts} +2 -2
  265. package/dist/events/index.d.ts +3 -3
  266. package/dist/{events-CfDdOwqg.d.ts → events-DVt3Z9hw.d.ts} +1 -1
  267. package/dist/{executor-ynEwaUZy.d.ts → executor-CFmee_nV.d.ts} +1 -1
  268. package/dist/{executor-CAhykadW.d.ts → executor-CHnoKOxk.d.ts} +4 -4
  269. package/dist/{executor-CbDX34I9.d.ts → executor-DqNRrFxx.d.ts} +1 -1
  270. package/dist/expo/index.d.ts +4 -4
  271. package/dist/expo/index.js +3 -3
  272. package/dist/{extension-LgaDPMJs.js → extension-Z8Pe7fXA.js} +1 -1
  273. package/dist/{field-errors-tQr-anYL.d.ts → field-errors-DKCaSlZw.d.ts} +10 -10
  274. package/dist/{fields-AKKMirg_.d.ts → fields-CAVk9dxX.d.ts} +1 -1
  275. package/dist/{filter-evaluate-Bhq99aEN.d.ts → filter-evaluate-Bz3Fzhz2.d.ts} +1 -1
  276. package/dist/{filter-query-B7A4l2xn.d.ts → filter-query-DV-x8fio.d.ts} +1 -1
  277. package/dist/{flags-D0npSE-5.js → flags-0EXDD3Iz.js} +1 -1
  278. package/dist/{flags-B5B4mkZV.d.ts → flags-6emyAXly.d.ts} +2 -2
  279. package/dist/flags-sdk/index.d.ts +2 -2
  280. package/dist/flags-sdk/index.js +1 -1
  281. package/dist/{framework-CyDn_SXR.d.ts → framework-BFlaPuvv.d.ts} +8 -7
  282. package/dist/{framework-B1h-uquj.js → framework-ChzJYkJW.js} +3 -2
  283. package/dist/{gateway-Cg_MgGen.d.ts → gateway-DaekJ_Me.d.ts} +3 -3
  284. package/dist/h3/index.d.ts +1 -1
  285. package/dist/h3/index.js +1 -1
  286. package/dist/h3/v1/index.d.ts +1 -1
  287. package/dist/h3/v1/index.js +1 -1
  288. package/dist/hono/index.d.ts +14 -13
  289. package/dist/hono/index.js +9 -8
  290. package/dist/{inbox-BmSA9K01.d.ts → inbox-DavCzW7b.d.ts} +5 -5
  291. package/dist/{index-D2BGCjIz.d.ts → index-BIAtapnD.d.ts} +5 -5
  292. package/dist/{index-B2871MHr.d.ts → index-BZCmy767.d.ts} +5 -5
  293. package/dist/{index-B5_J-MaK.d.ts → index-BdC2IqkU.d.ts} +5 -5
  294. package/dist/{index-xCpjvDVm.d.ts → index-BgkHbf9C.d.ts} +14 -14
  295. package/dist/{index-CRrBZtKm.d.ts → index-BvcMQYL-.d.ts} +1 -1
  296. package/dist/index-CbUXFzQV.d.ts +107 -0
  297. package/dist/index-CiE37wKX.d.ts +289 -0
  298. package/dist/{index-lazpPVr0.d.ts → index-D18su_r5.d.ts} +3 -3
  299. package/dist/{index-D66_dYVi.d.ts → index-DU0UwWvL.d.ts} +4 -4
  300. package/dist/{index-CTpEQvIv.d.ts → index-Dvpu22CJ.d.ts} +1 -1
  301. package/dist/index-IKfbX_39.d.ts +23 -0
  302. package/dist/{index-DzBFdI9I.d.ts → index-M1izbwbN.d.ts} +1 -1
  303. package/dist/index.d.ts +6 -6
  304. package/dist/{kit-CVZDd1X9.js → kit-9pZP5iLU.js} +42 -11
  305. package/dist/{kit-CJKo0soh.d.ts → kit-OgFOW9rX.d.ts} +4 -4
  306. package/dist/{knowledge-BUwbpS8I.d.ts → knowledge-BBC2sfAY.d.ts} +5 -5
  307. package/dist/lint/index.d.ts +1 -1
  308. package/dist/lint/index.js +1 -1
  309. package/dist/list/index.d.ts +3 -3
  310. package/dist/{list-query-CZ-K5aHX.d.ts → list-query-C7V8kUaD.d.ts} +3 -3
  311. package/dist/mapper/bin.js +6 -6
  312. package/dist/mcp/index.d.ts +4 -289
  313. package/dist/mcp/index.js +52 -18
  314. package/dist/mcp/sdk/index.d.ts +6 -6
  315. package/dist/mcp/sdk/index.js +2 -2
  316. package/dist/{messaging-DMhtGxVv.d.ts → messaging-D5z2TR37.d.ts} +4 -4
  317. package/dist/nestjs/index.d.ts +2 -2
  318. package/dist/nestjs/index.js +1 -1
  319. package/dist/next/client/index.d.ts +1 -1
  320. package/dist/next/index.d.ts +28 -26
  321. package/dist/next/index.js +11 -10
  322. package/dist/node/index.d.ts +2 -2
  323. package/dist/node/index.js +1 -1
  324. package/dist/{operations-D51ONRvR.d.ts → operations-CsCwruKT.d.ts} +1 -1
  325. package/dist/orpc/index.d.ts +8 -8
  326. package/dist/orpc/index.js +8 -8
  327. package/dist/otel/index.d.ts +2 -2
  328. package/dist/otel/index.js +4 -4
  329. package/dist/{outbox-C44Aa94K.d.ts → outbox-7zgh-7nw.d.ts} +4 -4
  330. package/dist/{permissions-B9aZZ9LR.js → permissions-BDt27oYF.js} +19 -14
  331. package/dist/permissions-BP593xxk.d.ts +44 -0
  332. package/dist/{pool-Bji4lnQM.d.ts → pool-D-4HyhuW.d.ts} +3 -3
  333. package/dist/{ports-zFqRNXVJ.d.ts → ports-BVLhLUvR.d.ts} +1 -1
  334. package/dist/{ports-C-hdygkZ.js → ports-CmEXVqhg.js} +1 -1
  335. package/dist/postgres/index.d.ts +4 -4
  336. package/dist/{postgrest-2WjRrtmX.d.ts → postgrest-DZtM2nIS.d.ts} +1 -1
  337. package/dist/powersync/index.d.ts +6 -6
  338. package/dist/preset/index.d.ts +3 -3
  339. package/dist/{project-oNHntJ6T.js → project-D4ArwcS5.js} +2 -2
  340. package/dist/{provider-CH8McX3b.d.ts → provider-BI0KC4u5.d.ts} +1 -1
  341. package/dist/{push-token-a3Ev1U3L.d.ts → push-token-B0j171on.d.ts} +1 -1
  342. package/dist/query/index.d.ts +1 -1
  343. package/dist/react/index.d.ts +8 -8
  344. package/dist/react/index.js +3 -3
  345. package/dist/react/native/index.d.ts +1 -1
  346. package/dist/react/native/index.js +1 -1
  347. package/dist/react/server.d.ts +8 -8
  348. package/dist/react/server.js +3 -3
  349. package/dist/react/session.d.ts +2 -2
  350. package/dist/{react-C40oomj7.js → react-COIov1yC.js} +1 -1
  351. package/dist/react-router/index.d.ts +6 -7
  352. package/dist/react-router/index.js +6 -6
  353. package/dist/realtime/index.d.ts +6 -6
  354. package/dist/realtime/index.js +1 -1
  355. package/dist/{record-form-DCIui2Ol.d.ts → record-form-DU2EoVsv.d.ts} +1 -1
  356. package/dist/{recordings-Dlpq8jUG.d.ts → recordings-D69Va7gP.d.ts} +1 -1
  357. package/dist/records/index.d.ts +9 -9
  358. package/dist/{refresh-BK9epzeC.d.ts → refresh-BtbC2rZe.d.ts} +1 -1
  359. package/dist/{refusal-DhX7Xpfp.js → refusal-5c6UMpUP.js} +3 -3
  360. package/dist/{refusal-DEuFVi4s.d.ts → refusal-CGi-0Q18.d.ts} +3 -3
  361. package/dist/{resolve-DVOtYTAc.d.ts → resolve--LfVoOMg.d.ts} +1 -1
  362. package/dist/{resource-Cn6Bn-_o.js → resource-BbWk4hoP.js} +59 -15
  363. package/dist/{resource-BfsTJnxZ.d.ts → resource-DWllVW8k.d.ts} +6 -1
  364. package/dist/{resource-execute-DQRS7PFt.d.ts → resource-execute-DUBYKTYU.d.ts} +2 -2
  365. package/dist/{resource-types-DF6KDAZM.d.ts → resource-types-RgaljPs0.d.ts} +4 -4
  366. package/dist/{resources-CeY53FiJ.d.ts → resources-Bki1J4jy.d.ts} +2 -2
  367. package/dist/{resources-B0Vy7_wv.js → resources-DYSx9NYM.js} +1 -1
  368. package/dist/{respond-CkwkvFdZ.d.ts → respond-BYOV7KZp.d.ts} +1 -1
  369. package/dist/{respond-C2qvP1wv.js → respond-DLH4tD2d.js} +1 -1
  370. package/dist/{sales-lines-Bde9cV5F.d.ts → sales-lines-DuNVoKHA.d.ts} +1 -1
  371. package/dist/{sandboxes-DDWuD9fh.d.ts → sandboxes-B2hBoBvJ.d.ts} +1 -1
  372. package/dist/{scores-Bql-ABl0.d.ts → scores-FAORS4qU.d.ts} +5 -5
  373. package/dist/server/index.d.ts +31 -28
  374. package/dist/server/index.js +15 -11
  375. package/dist/{server-types-C3p3jUqr.d.ts → server-types-C2hlvhP4.d.ts} +39 -101
  376. package/dist/{session-BOch2y2z.d.ts → session-B4VasaAA.d.ts} +6 -6
  377. package/dist/{session-status-DRBRnZHx.d.ts → session-status-D8CBxCqv.d.ts} +2 -2
  378. package/dist/{sign-in-BmigClRh.js → sign-in-BMm1xhKq.js} +1 -1
  379. package/dist/{sign-in-Dxyi4aKu.d.ts → sign-in-CX1a5i2P.d.ts} +3 -34
  380. package/dist/{sign-in-CXOg2Dwb.js → sign-in-CxdoTEp5.js} +2 -2
  381. package/dist/{signers-Cz5ZhTHH.d.ts → signers-6ih6i9aq.d.ts} +4 -4
  382. package/dist/{signing-keys-DS-rIVzz.d.ts → signing-keys-De09WNJ3.d.ts} +2 -2
  383. package/dist/snapshot-BGsJw9xn.d.ts +83 -0
  384. package/dist/{view-YnesSUEa.js → snapshot-CVMSyTHH.js} +3 -109
  385. package/dist/solid/index.d.ts +10 -10
  386. package/dist/solid/index.js +1 -1
  387. package/dist/solid-start/index.d.ts +6 -7
  388. package/dist/solid-start/index.js +5 -5
  389. package/dist/spec/index.d.ts +2 -2
  390. package/dist/sql/index.d.ts +6 -5
  391. package/dist/sql/index.js +2 -2
  392. package/dist/{sql-BPV51R3A.js → sql-DiUP7fKX.js} +162 -77
  393. package/dist/sqlite/index.d.ts +3 -3
  394. package/dist/{sso-BEvNf1oW.d.ts → sso-CuzAjsc8.d.ts} +3 -3
  395. package/dist/ssr/index.d.ts +5 -5
  396. package/dist/ssr/index.js +1 -1
  397. package/dist/storage/index.d.ts +3 -3
  398. package/dist/storage/index.js +1 -1
  399. package/dist/streams/index.d.ts +1 -1
  400. package/dist/{subject-readers-DWkVSbFr.d.ts → subject-readers-BlD8tALG.d.ts} +2 -2
  401. package/dist/{subjects-vci6Wufh.d.ts → subjects-Bv2dPflD.d.ts} +3 -3
  402. package/dist/{support-rZbdU35s.d.ts → support-DxYI6sDM.d.ts} +4 -4
  403. package/dist/{support-view-WY4Y-A40.d.ts → support-view-DSmCett7.d.ts} +1 -1
  404. package/dist/svelte/index.d.ts +9 -9
  405. package/dist/svelte/index.js +1 -1
  406. package/dist/sveltekit/index.d.ts +7 -8
  407. package/dist/sveltekit/index.js +5 -5
  408. package/dist/{tags-BVLELhOf.d.ts → tags--k2fbPfO.d.ts} +1 -1
  409. package/dist/tanstack-db/index.d.ts +3 -3
  410. package/dist/tanstack-start/index.d.ts +6 -7
  411. package/dist/tanstack-start/index.js +5 -5
  412. package/dist/{tenant-RKvGBB-U.d.ts → tenant-B3IIq8Eq.d.ts} +4 -5
  413. package/dist/tenant-Beqd7TTq.js +48 -0
  414. package/dist/testing/index.d.ts +71 -32
  415. package/dist/testing/index.js +136 -16
  416. package/dist/{timeline-Ck8OFuAN.d.ts → timeline-Bq658xsi.d.ts} +5 -5
  417. package/dist/{topic-Dr8VYE4D.d.ts → topic-D2MyBeaI.d.ts} +5 -5
  418. package/dist/{topic-BBBCVLyS.js → topic-k17VvXRj.js} +1 -1
  419. package/dist/{types-Pv5WPfIC.d.ts → types-BBqP9H6w.d.ts} +4 -4
  420. package/dist/{types-CCmW3MqI.d.ts → types-BFEKRmEK.d.ts} +2 -2
  421. package/dist/{types-WZUVlTXs.d.ts → types-BkYEUWdz.d.ts} +189 -1
  422. package/dist/{types-D9FY9qSJ.d.ts → types-C8UyJOPJ.d.ts} +3 -3
  423. package/dist/{types-CvlJNzX4.d.ts → types-DCoqai8o.d.ts} +4 -4
  424. package/dist/{types-DWZubmwk.d.ts → types-Dh2OGEW5.d.ts} +10 -10
  425. package/dist/{types-BiedVwz_.d.ts → types-TH3zlMiM.d.ts} +1 -1
  426. package/dist/{types-CL-z0A4K.d.ts → types-d0JBRTAg.d.ts} +7 -7
  427. package/dist/{undo-BdoEJ6Ot.d.ts → undo-22ofP6Zp.d.ts} +2 -2
  428. package/dist/{usage-D27Uw426.d.ts → usage-CNCT6_3D.d.ts} +4 -4
  429. package/dist/{vault-Dx0LaNMX.d.ts → vault-yGQD5Rdl.d.ts} +2 -2
  430. package/dist/vercel-connect/index.d.ts +1 -1
  431. package/dist/vercel-sandbox/index.d.ts +2 -2
  432. package/dist/{verify-DnL0Fgu0.d.ts → verify-BQu3eBNW.d.ts} +2 -2
  433. package/dist/view-BfEqjZJ_.js +117 -0
  434. package/dist/{view-DmEZA1fL.d.ts → view-Cy2XxYp1.d.ts} +14 -2
  435. package/dist/vue/index.d.ts +10 -10
  436. package/dist/vue/index.js +1 -1
  437. package/dist/{watch-topic-BB7T05sc.d.ts → watch-topic-q6krNw0T.d.ts} +1 -1
  438. package/dist/workflow-sdk/builder/index.d.ts +3 -3
  439. package/dist/workflow-sdk/builder/index.js +1 -1
  440. package/dist/workflow-sdk/index.d.ts +1 -1
  441. package/dist/workflow-sdk/index.js +1 -1
  442. package/dist/workflow-sdk/world/index.d.ts +1 -1
  443. package/dist/{workflow-sdk-D5zRSwxh.js → workflow-sdk-q2jnEaAJ.js} +2 -2
  444. package/dist/{workflow-sdk-DMpVSMB7.d.ts → workflow-sdk-yIkECybp.d.ts} +3 -3
  445. package/dist/{workflows-DKTw2PZo.d.ts → workflows-BljkWRxE.d.ts} +3 -3
  446. package/dist/yjs/index.d.ts +2 -2
  447. package/dist/yjs/index.js +1 -1
  448. package/package.json +12 -1
  449. package/schemas/config-v1.json +3 -0
  450. package/schemas/doctor-report-v1.json +1 -0
  451. package/dist/authorizer-AswD5q6g.d.ts +0 -116
  452. package/dist/cli/add-DlYL-1mF.js +0 -1
  453. package/dist/cli/powersync-DfeGl5N1.js +0 -1
  454. package/dist/cli/seed-BIB6-WPa.js +0 -1
  455. package/dist/tenant-BR7fvPj7.js +0 -26
@@ -1,6 +1,6 @@
1
- import { d as MutationIntent, ot as SchemaMeta } from "./types-WZUVlTXs.js";
2
- import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, c as MutationNotice, k as BlockEventsMatching, o as EventHub, st as SubjectEventData } from "./events-CfDdOwqg.js";
3
- import { i as EventSink, n as CloudEventOptions, t as CloudEvent } from "./cloud-event-bcaMqEbN.js";
1
+ import { d as MutationIntent, ot as SchemaMeta } from "./types-BkYEUWdz.js";
2
+ import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, c as MutationNotice, k as BlockEventsMatching, o as EventHub, st as SubjectEventData } from "./events-DVt3Z9hw.js";
3
+ import { i as EventSink, n as CloudEventOptions, t as CloudEvent } from "./cloud-event-DXWmXrus.js";
4
4
  /**
5
5
  * Listens to the block events that match `pattern` (`'support.started'` or
6
6
  * `'support.*'`), typed by `events`: a block's events, `defineBlocks(...)` or
@@ -1,7 +1,7 @@
1
- import { E as AccessPolicySql } from "./types-WZUVlTXs.js";
2
- import { p as AnyBlocksConfig, t as AuthorizationFunctions } from "./authorization-CYu_UKX4.js";
3
- import { nt as ReadSet } from "./define-3RbqoF1S.js";
4
- import { R as TableGrant, Tr as AppTableConfig, Vr as CatalogPolicy, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, cn as ResolvedConfig, g as BlockSqlAccessProvider, h as BlockSql, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-DcxfrCml.js";
1
+ import { E as AccessPolicySql } from "./types-BkYEUWdz.js";
2
+ import { p as AnyBlocksConfig, t as AuthorizationFunctions } from "./authorization-BlmDNI2b.js";
3
+ import { nt as ReadSet } from "./define-ITQA71fw.js";
4
+ import { R as TableGrant, Tr as AppTableConfig, Vr as CatalogPolicy, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, cn as ResolvedConfig, g as BlockSqlAccessProvider, h as BlockSql, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-D7jICqdN.js";
5
5
  import { t as SubjectConfig } from "./subjects-BGwLJ3IB.js";
6
6
  /** A module's SQL for `layout`, without header; `undefined` in custom mode. */
7
7
  declare function moduleBody(name: string, layout?: BlockSqlLayout): string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { b as DbError, f as Result, t as AsyncResult } from "./result-DTOQRyGY.js";
2
- import { C as TransformOptions, N as StorageClient, Q as StoragePath, a as BucketConnectOptions, i as BucketConfig, n as Bucket, r as BucketClient, s as BucketPolicy, v as StorageAdminClient } from "./bucket-Clq5xINQ.js";
2
+ import { C as TransformOptions, N as StorageClient, Q as StoragePath, a as BucketConnectOptions, i as BucketConfig, n as Bucket, r as BucketClient, s as BucketPolicy, v as StorageAdminClient } from "./bucket-DvG66r5G.js";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  /** Maps a Storage error (`StorageApiError`, fetch failures) to a `DbError`. */
5
5
  declare function fromStorageError(raw: unknown, table?: string): DbError;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The claim `forContext({ permissions })` sets: the permission keys the work
3
+ * may use. `better_supabase.cap_allows` refuses every other key, and a job
4
+ * queued under a cap keeps it.
5
+ */
6
+ declare const PERMISSION_CAP_CLAIM = "bsb_permission_cap";
7
+ /**
8
+ * The authorization version an access token hook writes, so caches key on it. A
9
+ * provider bumps it when a user's grants change.
10
+ */
11
+ declare const AUTHZ_VERSION_CLAIM = "authz_ver";
12
+ /** The caller's memberships, as a list of `{ scope, id, roles }`. */
13
+ declare const MEMBERSHIPS_CLAIM = "memberships";
14
+ /** Plan features per tenant (`{ [tenantId]: string[] }`). */
15
+ declare const FEATURES_CLAIM = "features";
16
+ /** Permission keys per tenant (`{ [tenantId]: string[] }`). */
17
+ declare const PERMISSIONS_CLAIM = "permissions";
18
+ /**
19
+ * Set to `true` when the hook left permission keys out of the `permissions`
20
+ * claim. A provider that declares `tokenHook.truncatedClaim` uses its own.
21
+ */
22
+ declare const PERMISSIONS_TRUNCATED_CLAIM = "permissions_truncated";
23
+ export { PERMISSIONS_TRUNCATED_CLAIM as a, PERMISSIONS_CLAIM as i, FEATURES_CLAIM as n, PERMISSION_CAP_CLAIM as o, MEMBERSHIPS_CLAIM as r, AUTHZ_VERSION_CLAIM as t };
@@ -1,4 +1,4 @@
1
- import { n as RouteGuardOptions } from "./refusal-DEuFVi4s.js";
1
+ import { n as RouteGuardOptions } from "./refusal-CGi-0Q18.js";
2
2
  import { t as Validated } from "./shared-DsBcvj6q.js";
3
3
  import { AnyEntry, Contributions } from "@supabase/middleware";
4
4
  import { IncomingMessage, ServerResponse } from "node:http";
package/dist/index.d.ts CHANGED
@@ -2,15 +2,15 @@
2
2
  import { n as DbException, t as escapeLike } from "./escape-like-CK6L7gkj.js";
3
3
  import { A as isConflict, C as DbErrorMatchers, D as ValidationIssue, E as RawDbError, F as statusOf, M as isForeignKey, N as mapDbError, O as dbError, P as matchDbError, S as DbErrorKinds, T as ErrorMapper, _ as ok, a as BetterResultOk, b as DbError, c as DbErrorClasses, d as Ok, f as Result, g as fromBetterResult, h as err, i as BetterResultErrors, j as isDbError, k as isCheck, l as Err, m as defineBetterResultErrors, n as BetterResultApi, o as BetterResultValue, r as BetterResultErr, s as DbErrorClass, t as AsyncResult, u as MappedDbError, v as toBetterResult, w as DbErrorOf, x as DbErrorKind, y as toDbError } from "./result-DTOQRyGY.js";
4
4
  import { n as validate, t as StandardSchemaV1 } from "./standard-DRX6Ch1j.js";
5
- import { $ as RecordRef, A as BucketMeta, At as NoExtension, B as FunctionMeta, Bt as Executor, C as not, Ct as ApplyExtension, D as AccessTopicPolicy, Dt as HasFlag, E as AccessPolicySql, Et as ExtensionsOf, F as Codec, Ft as RequestContext, G as GeneratedColumns, H as FunctionSignature, I as ColumnMeta, It as WithExtension, J as ModelTypes, K as Insert, L as DatabaseOf, Lt as definePlugin, M as Casing, Mt as Plugin, N as CheckConstraint, Nt as RepositoryApi, O as AnyFunctions, Ot as HookArgs, P as ClaimsMeta, Pt as RepositoryExtension, Q as RealtimeTableMeta, R as Flags, Rt as ExecuteContext, S as column, St as AnyPlugin, T as AccessBucketPolicy, Tt as ExtensionOf, U as FunctionTypes, V as FunctionResult, Vt as RpcContext, W as FunctionsOf, X as PrimaryKeyColumn, Y as ModelsOf, Z as PrimaryKeyValue, _ as SelectColumn, a as CountMode, at as Schema, b as UpdateOp, c as Include, ct as SubjectTypeOf, d as MutationIntent, dt as TableMeta, et as RelationMeta, f as MutationKind, ft as UniqueConstraint, g as Quantifier, gt as WritableColumns, h as OrderTerm, ht as Update, i as Condition, it as Row, j as BucketPolicyName, jt as PLUGIN_API_VERSION, k as AnyModels, kt as MutationEvent, l as InsertOp, lt as TableFlags, m as Operation, mt as UniqueWhere, n as Aggregation, nt as Relations, o as DeleteOp, ot as SchemaMeta, p as MutationOp, pt as UniqueKeyName, q as ModelFlags, r as ColumnOp, rt as ResultColumn, s as FunctionSource, st as Simplify, t as AggregateFn, tt as RelationTypes, u as Measure, ut as TableKey, v as SelectOp, w as or, wt as CallOptions, x as and, xt as Actor, y as Selection, z as ForeignKeyConstraint, zt as ExecuteResult } from "./types-WZUVlTXs.js";
6
- import { Ct as Events, O as BlockEventType, T as BlockEvent, a as EventHandler, bt as EventMap, c as MutationNotice, d as RpcNotice, i as ErrorEvent, l as QueryEvent, n as AuthOutageEvent, o as EventHub, r as BetterSupabaseEvents, s as EventName, t as AuthEvent, u as RefreshEvent } from "./events-CfDdOwqg.js";
5
+ import { $ as RecordRef, A as BucketMeta, At as NoExtension, B as FunctionMeta, Bt as Executor, C as not, Ct as ApplyExtension, D as AccessTopicPolicy, Dt as HasFlag, E as AccessPolicySql, Et as ExtensionsOf, F as Codec, Ft as RequestContext, G as GeneratedColumns, H as FunctionSignature, I as ColumnMeta, It as WithExtension, J as ModelTypes, K as Insert, L as DatabaseOf, Lt as definePlugin, M as Casing, Mt as Plugin, N as CheckConstraint, Nt as RepositoryApi, O as AnyFunctions, Ot as HookArgs, P as ClaimsMeta, Pt as RepositoryExtension, Q as RealtimeTableMeta, R as Flags, Rt as ExecuteContext, S as column, St as AnyPlugin, T as AccessBucketPolicy, Tt as ExtensionOf, U as FunctionTypes, V as FunctionResult, Vt as RpcContext, W as FunctionsOf, X as PrimaryKeyColumn, Y as ModelsOf, Z as PrimaryKeyValue, _ as SelectColumn, a as CountMode, at as Schema, b as UpdateOp, c as Include, ct as SubjectTypeOf, d as MutationIntent, dt as TableMeta, et as RelationMeta, f as MutationKind, ft as UniqueConstraint, g as Quantifier, gt as WritableColumns, h as OrderTerm, ht as Update, i as Condition, it as Row, j as BucketPolicyName, jt as PLUGIN_API_VERSION, k as AnyModels, kt as MutationEvent, l as InsertOp, lt as TableFlags, m as Operation, mt as UniqueWhere, n as Aggregation, nt as Relations, o as DeleteOp, ot as SchemaMeta, p as MutationOp, pt as UniqueKeyName, q as ModelFlags, r as ColumnOp, rt as ResultColumn, s as FunctionSource, st as Simplify, t as AggregateFn, tt as RelationTypes, u as Measure, ut as TableKey, v as SelectOp, w as or, wt as CallOptions, x as and, xt as Actor, y as Selection, z as ForeignKeyConstraint, zt as ExecuteResult } from "./types-BkYEUWdz.js";
6
+ import { Ct as Events, O as BlockEventType, T as BlockEvent, a as EventHandler, bt as EventMap, c as MutationNotice, d as RpcNotice, i as ErrorEvent, l as QueryEvent, n as AuthOutageEvent, o as EventHub, r as BetterSupabaseEvents, s as EventName, t as AuthEvent, u as RefreshEvent } from "./events-DVt3Z9hw.js";
7
7
  import { i as silentLogger, n as Logger, r as consoleLogger, t as LogFields } from "./logger-0LfhvwE4.js";
8
8
  import { a as ProblemFormat, c as fromProblem, d as toProblem, i as ProblemDetails, l as isProblem, n as PROBLEM_CONTENT_TYPE, o as ProblemOptions, r as PROBLEM_TYPE_BASE, s as ProblemResponseOptions, t as BlockProblemOptions, u as problemResponse } from "./problem-NGBjN-TO.js";
9
- import { $ as SearchArgs, $t as CacheTarget, A as OffsetPageArgs, At as GetArgs, B as Returned, Bt as OrderByInput, C as FindExt, Ct as AggregateResult, D as ManyWriteArgs, Dt as CountArg, E as ManyResult, Et as ColumnOrderByArg, F as PageOf, Ft as MeasureArg, G as UpsertArgs, Gt as SelectArg, Ht as ReadArgs, It as MeasureKey, J as WriteManyArgs, Jt as WhereArg, K as UpsertManyArgs, Kt as SortDirection, Lt as MutableWhere, Mt as IncludeArgs, Nt as JsonPathOps, Ot as CountArgs, Pt as ListArgs, Q as recordStats, Qt as CacheAdapter, R as Repository, Rt as NumericMeasureArg, S as DeleteExt, St as AggregateOrderByArg, Tt as ColumnOrderBy, U as RpcOptions, Ut as RelationMeasureArg, V as RowFilter, Vt as Payload, W as UpdateArgs, Wt as RequestArgs, X as EMPTY_STATS, Xt as BucketRegistry, Y as DbStats, Yt as WhereInput, Z as StatsRecorder, Zt as BucketsHelper, _ as CursorPage, _t as TableSpecs, a as explainPostgrest, at as ReadSetParamType, b as DbHelpers, bt as AggregateArgs, c as RpcDefinition, ct as ReadSetParams, dt as isReadSet, en as MemoryCache, f as BlocksHelper, ft as readSetTables, g as ConflictTarget, gt as Specs, h as DbOf, ht as ReadMethod, i as PostgrestExecutorOptions, in as rpcCacheTargets, it as ReadSetOptions, j as OffsetRangeArgs, jt as IncludeArg, k as OffsetPage, kt as FieldFilter, l as SupabaseOptions, lt as ReadSetResult, m as DbExtras, mt as QuerySpec, n as defineSupabase, nn as memoryCache, nt as ReadSet, o as postgrestExecutor, ot as ReadSetParamTypes, p as DbBlockSource, pt as InferResult, q as WriteArgs, qt as SortSpec, r as PostgrestClientLike, rn as rowKey, rt as ReadSetAuth, s as ConnectOptions, st as ReadSetParamValue, t as BetterSupabase, tn as cacheTargetOf, tt as InferReadSetParams, u as ApiOptions, ut as defineReadSet, v as CursorPageArgs, vt as isQuerySpec, w as GetKey, wt as AggregateRow, x as DeleteArgs, xt as AggregateOrderBy, y as Db, yt as specTables, z as RepositoryOf, zt as OrderByArg } from "./define-3RbqoF1S.js";
10
- import { Q as StoragePath } from "./bucket-Clq5xINQ.js";
11
- import { a as PostgrestPlan, n as PlanLimit, o as compilePostgrest, r as PlanOrder, t as PlanFilter } from "./postgrest-2WjRrtmX.js";
9
+ import { $ as SearchArgs, $t as CacheTarget, A as OffsetPageArgs, At as GetArgs, B as Returned, Bt as OrderByInput, C as FindExt, Ct as AggregateResult, D as ManyWriteArgs, Dt as CountArg, E as ManyResult, Et as ColumnOrderByArg, F as PageOf, Ft as MeasureArg, G as UpsertArgs, Gt as SelectArg, Ht as ReadArgs, It as MeasureKey, J as WriteManyArgs, Jt as WhereArg, K as UpsertManyArgs, Kt as SortDirection, Lt as MutableWhere, Mt as IncludeArgs, Nt as JsonPathOps, Ot as CountArgs, Pt as ListArgs, Q as recordStats, Qt as CacheAdapter, R as Repository, Rt as NumericMeasureArg, S as DeleteExt, St as AggregateOrderByArg, Tt as ColumnOrderBy, U as RpcOptions, Ut as RelationMeasureArg, V as RowFilter, Vt as Payload, W as UpdateArgs, Wt as RequestArgs, X as EMPTY_STATS, Xt as BucketRegistry, Y as DbStats, Yt as WhereInput, Z as StatsRecorder, Zt as BucketsHelper, _ as CursorPage, _t as TableSpecs, a as explainPostgrest, at as ReadSetParamType, b as DbHelpers, bt as AggregateArgs, c as RpcDefinition, ct as ReadSetParams, dt as isReadSet, en as MemoryCache, f as BlocksHelper, ft as readSetTables, g as ConflictTarget, gt as Specs, h as DbOf, ht as ReadMethod, i as PostgrestExecutorOptions, in as rpcCacheTargets, it as ReadSetOptions, j as OffsetRangeArgs, jt as IncludeArg, k as OffsetPage, kt as FieldFilter, l as SupabaseOptions, lt as ReadSetResult, m as DbExtras, mt as QuerySpec, n as defineSupabase, nn as memoryCache, nt as ReadSet, o as postgrestExecutor, ot as ReadSetParamTypes, p as DbBlockSource, pt as InferResult, q as WriteArgs, qt as SortSpec, r as PostgrestClientLike, rn as rowKey, rt as ReadSetAuth, s as ConnectOptions, st as ReadSetParamValue, t as BetterSupabase, tn as cacheTargetOf, tt as InferReadSetParams, u as ApiOptions, ut as defineReadSet, v as CursorPageArgs, vt as isQuerySpec, w as GetKey, wt as AggregateRow, x as DeleteArgs, xt as AggregateOrderBy, y as Db, yt as specTables, z as RepositoryOf, zt as OrderByArg } from "./define-ITQA71fw.js";
10
+ import { Q as StoragePath } from "./bucket-DvG66r5G.js";
11
+ import { a as PostgrestPlan, n as PlanLimit, o as compilePostgrest, r as PlanOrder, t as PlanFilter } from "./postgrest-DZtM2nIS.js";
12
12
  import { i as FieldSpec, n as TableSchema, o as TableSchemaSpec, r as tableSchema, t as StandardJSONSchemaV1 } from "./table-schema-CwXg7oBz.js";
13
- import { n as postgrestCompiler, t as Compiler } from "./compiler-CWishtY2.js";
13
+ import { n as postgrestCompiler, t as Compiler } from "./compiler-qlXlokKn.js";
14
14
  import { t as SPEC_PINS } from "./spec-pins-CuQ2anBw.js";
15
15
  /**
16
16
  * A message for every `DbError` kind: a string, or a function of the error.
@@ -1,10 +1,10 @@
1
1
  import { n as dbError } from "./errors-B7tCfCvX.js";
2
2
  import { n as validate } from "./standard-BD2aOUsf.js";
3
- import { n as claimAt } from "./claims-DRmafYVK.js";
3
+ import { n as claimAt } from "./claims-CqTr_N1n.js";
4
+ import { i as toSession } from "./view-BfEqjZJ_.js";
4
5
  import { t as authContext } from "./context-DSevnLrT.js";
5
- import { a as isRequestMemo, r as checkPermission } from "./authorizer-D6po_XZA.js";
6
- import { n as toSession } from "./view-YnesSUEa.js";
7
- import { i as guard, s as settle } from "./respond-C2qvP1wv.js";
6
+ import { a as isRequestMemo, r as checkPermission } from "./authorizer-BtIPDO-c.js";
7
+ import { i as guard, s as settle } from "./respond-DLH4tD2d.js";
8
8
  // src/server/kit.ts
9
9
  /** `FormData` as a plain object; repeated keys become arrays. */
10
10
  function formDataObject(form) {
@@ -23,13 +23,29 @@ function actionError(error) {
23
23
  error
24
24
  };
25
25
  }
26
+ /**
27
+ * The purpose of a route check: `GET` and `HEAD` read, other methods write.
28
+ * Without a method the route is read.
29
+ */
30
+ function routePurpose(method) {
31
+ const upper = method?.toUpperCase();
32
+ return {
33
+ operation: "route",
34
+ intent: upper === void 0 || upper === "GET" || upper === "HEAD" ? "read" : "write"
35
+ };
36
+ }
37
+ const ACTION_PURPOSE = {
38
+ operation: "action",
39
+ intent: "write"
40
+ };
26
41
  /** What a `permission` on an action or route is checked against. */
27
42
  function callerResource(input) {
28
43
  if (input === void 0 || input instanceof Request) return { type: "route" };
29
44
  if (typeof input !== "object" || input === null || Array.isArray(input) || input instanceof FormData) return { type: "action" };
30
45
  return {
31
46
  type: "action",
32
- properties: input
47
+ properties: input,
48
+ source: "input"
33
49
  };
34
50
  }
35
51
  /**
@@ -47,17 +63,30 @@ async function loadResource(load) {
47
63
  if (!settled.ok) return settled.error;
48
64
  const { data } = settled;
49
65
  if (typeof data !== "object" || data === null || !("type" in data) || typeof data.type !== "string") return unavailable;
50
- return data;
66
+ const resource = data;
67
+ return resource.properties === void 0 || resource.source !== void 0 ? resource : {
68
+ ...resource,
69
+ source: "loaded"
70
+ };
51
71
  }
52
72
  /** The scope's `RequestMemo`, when the scope is a server context. */
53
73
  function memoOf(scope) {
54
74
  return scope && "memo" in scope && isRequestMemo(scope.memo) ? scope.memo : void 0;
55
75
  }
76
+ /** The scope's request id and approval, when the scope is a server context. */
77
+ function scopeFields(scope) {
78
+ const requestId = scope && "requestId" in scope ? scope.requestId : void 0;
79
+ const approval = scope && "approval" in scope ? scope.approval : void 0;
80
+ return {
81
+ ...typeof requestId === "string" ? { requestId } : {},
82
+ ...typeof approval === "string" ? { approval } : {}
83
+ };
84
+ }
56
85
  /**
57
86
  * `requireTenant`, `roles`, `permission` and `authorize`, in that order: the
58
87
  * session and tenant, or why the caller is refused.
59
88
  */
60
- async function authorizeCaller(auth, checks, input, tenant, authorizer, scope) {
89
+ async function authorizeCaller(auth, checks, input, tenant, authorizer, scope, purpose = routePurpose()) {
61
90
  const session = toSession(auth);
62
91
  if (checks.requireTenant && tenant === void 0) return dbError("forbidden", "Choose an organization first", { code: "NO_TENANT" });
63
92
  if (checks.roles && !hasRole(auth, checks.roles, checks.roleClaim)) return dbError("forbidden", "You do not have the role this needs", { code: "MISSING_ROLE" });
@@ -75,8 +104,10 @@ async function authorizeCaller(auth, checks, input, tenant, authorizer, scope) {
75
104
  resource,
76
105
  context: {
77
106
  ...authContext(auth),
78
- ...tenant === void 0 ? {} : { tenant }
107
+ ...tenant === void 0 ? {} : { tenant },
108
+ ...scopeFields(scope)
79
109
  },
110
+ ...purpose,
80
111
  ...memo ? { runtime: { memo } } : {}
81
112
  });
82
113
  if (!permitted.ok) return permitted.error;
@@ -88,8 +119,8 @@ async function authorizeCaller(auth, checks, input, tenant, authorizer, scope) {
88
119
  };
89
120
  }
90
121
  /** `guard`, then `authorizeCaller`: the caller, or the refusal. */
91
- async function requireCaller(auth, options, tenant, authorizer, scope) {
92
- return guard(auth, options.allow, options.aal, options.scopes) ?? authorizeCaller(auth, options, void 0, tenant, authorizer, scope);
122
+ async function requireCaller(auth, options, tenant, authorizer, scope, method) {
123
+ return guard(auth, options.allow, options.aal, options.scopes) ?? authorizeCaller(auth, options, void 0, tenant, authorizer, scope, routePurpose(method));
93
124
  }
94
125
  /**
95
126
  * Runs an action body with the guard, input validation and authorize checks
@@ -106,7 +137,7 @@ async function runAction(auth, options, input, tenant, body, authorizer, scope)
106
137
  if (!checked.ok) return actionError(checked.error);
107
138
  parsed = checked.data;
108
139
  }
109
- const caller = await authorizeCaller(auth, options, parsed, tenant, authorizer, scope);
140
+ const caller = await authorizeCaller(auth, options, parsed, tenant, authorizer, scope, ACTION_PURPOSE);
110
141
  if ("kind" in caller) return actionError(caller);
111
142
  const settled = await settle(() => body(parsed, caller));
112
143
  return settled.ok ? {
@@ -1,8 +1,8 @@
1
1
  import { b as DbError } from "./result-DTOQRyGY.js";
2
- import { r as AuthState } from "./resolve-DVOtYTAc.js";
3
- import { i as AuthorizationResource } from "./authorizer-AswD5q6g.js";
4
- import { t as AuthSession } from "./view-DmEZA1fL.js";
5
- import { r as GuardOptions } from "./respond-CkwkvFdZ.js";
2
+ import { Xt as AuthorizationResource } from "./types-BkYEUWdz.js";
3
+ import { r as AuthState } from "./resolve--LfVoOMg.js";
4
+ import { n as AuthSession } from "./view-Cy2XxYp1.js";
5
+ import { r as GuardOptions } from "./respond-BYOV7KZp.js";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
7
7
  /**
8
8
  * What a server action returns: plain data, safe across any serialization
@@ -1,11 +1,11 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
3
3
  import { n as Logger } from "./logger-0LfhvwE4.js";
4
- import { r as BlockTemporalOptions } from "./block-helpers-JxiD1iw4.js";
5
- import { t as BlockTransport } from "./block-transport-Bbf1ZZre.js";
6
- import { n as BlockHooks } from "./block-hooks-CJP5kGEa.js";
7
- import { f as AiFiles, o as AiFile } from "./types-D9FY9qSJ.js";
8
- import { _ as JobHandler } from "./types-DWZubmwk.js";
4
+ import { r as BlockTemporalOptions } from "./block-helpers-disoUWCp.js";
5
+ import { t as BlockTransport } from "./block-transport-BEtC_Kis.js";
6
+ import { n as BlockHooks } from "./block-hooks-DrA_d1dJ.js";
7
+ import { f as AiFiles, o as AiFile } from "./types-C8UyJOPJ.js";
8
+ import { _ as JobHandler } from "./types-Dh2OGEW5.js";
9
9
  /**
10
10
  * Turns texts into vectors. `model` is stored with each document, so a document
11
11
  * embedded by another model can be found and embedded again.
@@ -1,4 +1,4 @@
1
- import { Mt as Plugin, Pt as RepositoryExtension, m as Operation } from "../types-WZUVlTXs.js";
1
+ import { Mt as Plugin, Pt as RepositoryExtension, m as Operation } from "../types-BkYEUWdz.js";
2
2
  type GuardLevel = "off" | "warn" | "error";
3
3
  /** A level, or a level with the rule's option: `['error', 500]`. */
4
4
  type GuardSetting<Option = never> = GuardLevel | ([Option] extends [never] ? never : readonly [GuardLevel, Option]);
@@ -3,7 +3,7 @@ import { n as dbError } from "../errors-B7tCfCvX.js";
3
3
  import { t as lookupOf } from "../lookup-upE-e1zw.js";
4
4
  import { r as definePlugin } from "../plugin-Ca2qBiFZ.js";
5
5
  import { t as simplify } from "../simplify-BzThKn5b.js";
6
- import { o as tenantFrom, s as tenantPathsFor } from "../claims-DRmafYVK.js";
6
+ import { o as tenantFrom, s as tenantPathsFor } from "../claims-CqTr_N1n.js";
7
7
  // src/lint/guards.ts
8
8
  /** Catches data-exposure and correctness mistakes; everything else off. */
9
9
  function safeGuards() {
@@ -1,4 +1,4 @@
1
- import { _ as FilterRule, a as FilterDateValue, b as encodeFilterQuery, c as FilterFieldLabels, d as FilterLimits, f as FilterNode, g as FilterRelativeDate, h as FilterQuery, i as FilterCombinator, l as FilterFieldType, m as FilterOperatorSpec, n as FILTER_OPERATOR_LABELS, o as FilterField, p as FilterOperatorArity, r as FilterClock, s as FilterFieldInfo, t as FILTER_OPERATORS, u as FilterGroupNode, v as ListFilterConfig, y as decodeFilterQuery } from "../filter-query-B7A4l2xn.js";
2
- import { _ as UNSET, a as ListExtra, c as ListParseOptions, d as ListQuery, f as ListQueryConfig, g as ParserSpec, h as OpenApiParameter, i as ListDefinition, l as ListParseResult, m as ListSearchParams, n as FacetCounts, o as ListPage, p as ListQueryInput, r as FacetInfo, s as ListPagination, t as FacetCountFields, u as ListParsers, v as defineListQuery } from "../list-query-CZ-K5aHX.js";
3
- import { n as FilterRecordField, r as evaluateFilterQuery, t as FilterEvaluation } from "../filter-evaluate-Bhq99aEN.js";
1
+ import { _ as FilterRule, a as FilterDateValue, b as encodeFilterQuery, c as FilterFieldLabels, d as FilterLimits, f as FilterNode, g as FilterRelativeDate, h as FilterQuery, i as FilterCombinator, l as FilterFieldType, m as FilterOperatorSpec, n as FILTER_OPERATOR_LABELS, o as FilterField, p as FilterOperatorArity, r as FilterClock, s as FilterFieldInfo, t as FILTER_OPERATORS, u as FilterGroupNode, v as ListFilterConfig, y as decodeFilterQuery } from "../filter-query-DV-x8fio.js";
2
+ import { _ as UNSET, a as ListExtra, c as ListParseOptions, d as ListQuery, f as ListQueryConfig, g as ParserSpec, h as OpenApiParameter, i as ListDefinition, l as ListParseResult, m as ListSearchParams, n as FacetCounts, o as ListPage, p as ListQueryInput, r as FacetInfo, s as ListPagination, t as FacetCountFields, u as ListParsers, v as defineListQuery } from "../list-query-C7V8kUaD.js";
3
+ import { n as FilterRecordField, r as evaluateFilterQuery, t as FilterEvaluation } from "../filter-evaluate-Bz3Fzhz2.js";
4
4
  export { FILTER_OPERATORS, FILTER_OPERATOR_LABELS, type FacetCountFields, type FacetCounts, type FacetInfo, type FilterClock, type FilterCombinator, type FilterDateValue, type FilterEvaluation, type FilterField, type FilterFieldInfo, type FilterFieldLabels, type FilterFieldType, type FilterGroupNode, type FilterLimits, type FilterNode, type FilterOperatorArity, type FilterOperatorSpec, type FilterQuery, type FilterRecordField, type FilterRelativeDate, type FilterRule, type ListDefinition, type ListExtra, type ListFilterConfig, type ListPage, type ListPagination, type ListParseOptions, type ListParseResult, type ListParsers, type ListQuery, type ListQueryConfig, type ListQueryInput, type ListSearchParams, type OpenApiParameter, type ParserSpec, UNSET, decodeFilterQuery, defineListQuery, encodeFilterQuery, evaluateFilterQuery };
@@ -1,7 +1,7 @@
1
1
  import { D as ValidationIssue, t as AsyncResult } from "./result-DTOQRyGY.js";
2
- import { O as AnyFunctions, a as CountMode, it as Row, k as AnyModels, ut as TableKey } from "./types-WZUVlTXs.js";
3
- import { A as OffsetPageArgs, C as FindExt, Gt as SelectArg, Vt as Payload, Yt as WhereInput, _ as CursorPage, jt as IncludeArg, k as OffsetPage, t as BetterSupabase, v as CursorPageArgs, z as RepositoryOf, zt as OrderByArg } from "./define-3RbqoF1S.js";
4
- import { c as FilterFieldLabels, h as FilterQuery, o as FilterField, r as FilterClock, s as FilterFieldInfo, v as ListFilterConfig } from "./filter-query-B7A4l2xn.js";
2
+ import { O as AnyFunctions, a as CountMode, it as Row, k as AnyModels, ut as TableKey } from "./types-BkYEUWdz.js";
3
+ import { A as OffsetPageArgs, C as FindExt, Gt as SelectArg, Vt as Payload, Yt as WhereInput, _ as CursorPage, jt as IncludeArg, k as OffsetPage, t as BetterSupabase, v as CursorPageArgs, z as RepositoryOf, zt as OrderByArg } from "./define-ITQA71fw.js";
4
+ import { c as FilterFieldLabels, h as FilterQuery, o as FilterField, r as FilterClock, s as FilterFieldInfo, v as ListFilterConfig } from "./filter-query-DV-x8fio.js";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
  /** Facet value meaning "not set": filters with `is null`. */
7
7
  declare const UNSET = "__unset__";
@@ -1,10 +1,10 @@
1
- import { t as VERSION } from "../cli/version-DEUWW8cv.js";
2
- import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-CoC-1i1O.js";
3
- import { t as loadSnapshot } from "../cli/snapshot-UfJsqfys.js";
4
- import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-Q7jnLn_C.js";
5
- import { i as discoverConfig, s as loadConfig } from "../cli/config-Dyl3iX3u.js";
1
+ import { t as VERSION } from "../cli/version-mBwP-aMG.js";
2
+ import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-CvBRwv02.js";
3
+ import { t as loadSnapshot } from "../cli/snapshot-Dd_8B9g-.js";
4
+ import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-SjSVz8yK.js";
5
+ import { i as discoverConfig, s as loadConfig } from "../cli/config-DrrkMihk.js";
6
6
  import { i as parseEnv, n as configEnvironment } from "../cli/env-BCuUsWOh.js";
7
- import { s as schemaStampPath } from "../cli/content-mapper-ChSVT9Tq.js";
7
+ import { s as schemaStampPath } from "../cli/content-mapper-DrhtDsAm.js";
8
8
  import { existsSync, realpathSync } from "node:fs";
9
9
  import { basename, dirname, join, resolve } from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -1,289 +1,4 @@
1
- import { O as AnyFunctions, k as AnyModels, ut as TableKey } from "../types-WZUVlTXs.js";
2
- import { t as OperationTable } from "../operations-D51ONRvR.js";
3
- import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-AswD5q6g.js";
4
- import { t as BetterSupabase } from "../define-3RbqoF1S.js";
5
- import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-C3p3jUqr.js";
6
- import { r as GuardOptions } from "../respond-CkwkvFdZ.js";
7
- import { D as ResourceOperation } from "../model-Lxa_mOzB.js";
8
- import { l as ResourceRouteOptions } from "../resource-types-DF6KDAZM.js";
9
- import { StandardSchemaV1 } from "@standard-schema/spec";
10
- /**
11
- * The JSON Schema dialect of tool schemas, which depends on the protocol
12
- * revision.
13
- */
14
- type ToolSchemaTarget = "draft-2020-12" | "draft-07";
15
- /** A JSON object. */
16
- type Json = Readonly<Record<string, unknown>>;
17
- /** `McpOptions.requiredRoles`: the roles, or the roles and the claim to read. */
18
- type RequiredRoles = readonly string[] | {
19
- readonly roles: readonly string[];
20
- readonly claim?: string;
21
- };
22
- export declare const MCP_PROTOCOL_VERSION: string;
23
- /** MCP tool annotations (hints for clients, not guarantees). */
24
- interface ToolAnnotations {
25
- readonly title?: string;
26
- readonly readOnlyHint?: boolean;
27
- readonly destructiveHint?: boolean;
28
- readonly idempotentHint?: boolean;
29
- readonly openWorldHint?: boolean;
30
- }
31
- /** A tool as listed by `tools/list`. */
32
- interface ToolInfo {
33
- readonly name: string;
34
- readonly title?: string;
35
- readonly description?: string;
36
- readonly inputSchema: Json;
37
- readonly outputSchema?: Json;
38
- readonly annotations?: ToolAnnotations;
39
- }
40
- interface ToolResult {
41
- readonly content: readonly {
42
- readonly type: "text";
43
- readonly text: string;
44
- }[];
45
- readonly structuredContent?: Json;
46
- readonly isError?: boolean;
47
- }
48
- /** What a server tells clients about itself. */
49
- interface ServerDescription {
50
- readonly info: {
51
- readonly name: string;
52
- readonly version: string;
53
- readonly title?: string;
54
- };
55
- readonly instructions?: string;
56
- }
57
- /** A server that one transport-free dispatcher can answer for. */
58
- interface ProtocolServer extends ServerDescription {
59
- listTools(): Promise<readonly ToolInfo[]>;
60
- /** The tool's result, or `undefined` when no tool has the name. */
61
- callTool(name: string, args: unknown): Promise<ToolResult | undefined>;
62
- }
63
- /**
64
- * The JSON-RPC response to one message, or `undefined` for a notification. It
65
- * answers `initialize`, `server/discover`, `ping`, `tools/list` and
66
- * `tools/call`, for message-based transports such as stdio.
67
- */
68
- export declare function answerMessage(message: unknown, server: ProtocolServer): Promise<Json | undefined>;
69
- /** The response to one line of a newline-delimited JSON-RPC stream. */
70
- export declare function answerLine(line: string, server: ProtocolServer): Promise<Json | undefined>;
71
- interface ToolContext<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, B = unknown> extends ServerContext<M, F, E, C, P, B> {
72
- readonly request: Request;
73
- readonly signal: AbortSignal;
74
- }
75
- interface McpTool<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, B = unknown> {
76
- readonly info: ToolInfo;
77
- /**
78
- * The input schema in another dialect, for clients on an older protocol
79
- * revision. Without it, `info.inputSchema` is rewritten.
80
- */
81
- readonly inputSchemaFor?: (target: ToolSchemaTarget) => Json | undefined;
82
- /** Validates arguments; its output is what `run` receives. */
83
- readonly input?: StandardSchemaV1;
84
- /** Opaque data for the `authorize` and `visible` hooks. Never sent to clients. */
85
- readonly meta?: unknown;
86
- /**
87
- * Checked by the authorizer on every call; callers it denies don't see the
88
- * tool.
89
- */
90
- readonly permission?: unknown;
91
- /** The provider operation the tool checks, in place of `mcp.tool.<name>`. */
92
- readonly operation?: string;
93
- run(args: never, ctx: ToolContext<M, F, E, C, P, B>): unknown;
94
- }
95
- /** What the `authorize` and `visible` hooks see of a tool. */
96
- interface ToolRef {
97
- readonly info: ToolInfo;
98
- /**
99
- * The tool's `meta`, e.g. a permission. For table tools, the resource's
100
- * `meta` for that operation.
101
- */
102
- readonly meta: unknown;
103
- }
104
- /** The outcome of `authorize`. `scopes` turns a refusal into an OAuth challenge. */
105
- type ToolDecision = {
106
- readonly allowed: true;
107
- } | {
108
- readonly allowed: false;
109
- readonly reason?: string;
110
- /** OAuth scopes the call needs, sent in an `insufficient_scope` challenge. */
111
- readonly scopes?: readonly string[];
112
- };
113
- interface ToolDefinition<M extends AnyModels, F extends AnyFunctions, E, I, C = unknown, P = unknown, Ref = unknown, B = unknown> {
114
- readonly name: string;
115
- readonly title?: string;
116
- readonly description: string;
117
- /**
118
- * Validator for the arguments. Its JSON Schema comes from Standard JSON
119
- * Schema (zod 4, arktype, valibot) unless `inputSchema` is given.
120
- */
121
- readonly input?: StandardSchemaV1<unknown, I>;
122
- readonly inputSchema?: Json;
123
- readonly outputSchema?: Json;
124
- /**
125
- * The dialect `input` converts to for `ToolInfo` and the `tools` list.
126
- * Defaults to `draft-2020-12`. `tools/list` converts again for clients on
127
- * 2025-06-18 and earlier, which get draft-07.
128
- */
129
- readonly jsonSchemaTarget?: ToolSchemaTarget;
130
- readonly annotations?: ToolAnnotations;
131
- /** Opaque data for the `authorize` and `visible` hooks. Never sent to clients. */
132
- readonly meta?: unknown;
133
- /**
134
- * Checked by the authorizer after the arguments are validated, with the tool
135
- * as the resource (`mcp_tool`). `tools/list` hides the tool from callers it
136
- * denies.
137
- */
138
- readonly permission?: Ref;
139
- /**
140
- * The provider operation whose permission the tool checks, in place of
141
- * `mcp.tool.<name>` (`invoices.void`).
142
- */
143
- readonly operation?: string;
144
- run(args: I, ctx: ToolContext<M, F, E, C, P, B>): unknown;
145
- }
146
- /**
147
- * A table's tools: the REST resource options, plus `meta` per operation for
148
- * `authorize` and `visible`.
149
- */
150
- type ToolResourceOptions<M extends AnyModels, T extends TableKey<M>, Ref = string> = ResourceRouteOptions<M, T, Ref> & {
151
- /**
152
- * Opaque data per operation, e.g. a permission, passed to `authorize` and
153
- * `visible` as the table tool's `meta`. Never sent to clients. An operation
154
- * without an entry gets `undefined`.
155
- */
156
- readonly meta?: { readonly [K in ResourceOperation]?: unknown; };
157
- };
158
- type ToolResources<M extends AnyModels, Ref = string> = { readonly [T in TableKey<M>]?: ToolResourceOptions<M, T, Ref> | true; };
159
- interface McpOptions<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, Ref = string, B = unknown> extends ServerOptions, Omit<GuardOptions, "scopes"> {
160
- readonly name: string;
161
- readonly version: string;
162
- readonly title?: string;
163
- /** Sent to clients on `initialize`, e.g. how the tools fit together. */
164
- readonly instructions?: string;
165
- /**
166
- * Tables exposed as tools: `<table>_list`, `_get`, `_create`, `_update`,
167
- * `_delete`.
168
- */
169
- readonly resources?: ToolResources<M, Ref>;
170
- readonly tools?: readonly McpTool<M, F, E, C, P, B>[];
171
- /**
172
- * The authorization provider's operations (`authorization.operations` in the
173
- * config). A tool's `mcp.tool.<name>` entry replaces its `permission`, so the
174
- * provider decides what each tool needs.
175
- */
176
- readonly operations?: OperationTable;
177
- /**
178
- * Canonical URL of this MCP server (RFC 9728 `resource`). Defaults to the
179
- * request URL without query; on Supabase Edge Functions, to the public
180
- * `<origin>/functions/v1/<slug>` the gateway forwards.
181
- */
182
- readonly resource?: string | ((request: Request) => string);
183
- /**
184
- * Defaults to Supabase Auth of `env.url` (`<url>/auth/v1`); on Supabase Edge
185
- * Functions, to Auth on the public origin.
186
- */
187
- readonly authorizationServers?: readonly string[];
188
- /**
189
- * Scopes the tools need, published as RFC 9728 `scopes_supported` and in
190
- * `insufficient_scope` challenges. `offline_access` is left out: refresh
191
- * tokens are between the client and the authorization server.
192
- */
193
- readonly advertisedScopes?: readonly string[];
194
- /**
195
- * Scopes a delegated token (an OAuth client or an `act` chain) needs to call
196
- * the server at all. A missing one answers 403 `insufficient_scope`.
197
- */
198
- readonly requiredScopes?: readonly string[];
199
- /**
200
- * Roles a signed-in user needs to call the server at all, read from a claim
201
- * (`app_metadata.role` by default; a string or an array of strings). Users
202
- * without one get 403; service-role callers pass.
203
- *
204
- * ```ts
205
- * requiredRoles: { roles: ['admin', 'support'], claim: 'app_metadata.roles' }
206
- * ```
207
- */
208
- readonly requiredRoles?: RequiredRoles;
209
- /**
210
- * Read the session cookie. Defaults to false: MCP clients send bearer tokens,
211
- * and a cookie would let any page the user visits call the tools. Turn it on
212
- * only together with `allowedOrigins`.
213
- */
214
- readonly cookies?: boolean;
215
- /**
216
- * Origins allowed to call the server (DNS rebinding protection). Defaults to
217
- * any.
218
- */
219
- readonly allowedOrigins?: readonly string[];
220
- /**
221
- * Answers CORS preflights and adds `Access-Control-*` headers, so browser MCP
222
- * clients can call the server. The allowed origin is `allowedOrigins` when
223
- * set, any origin otherwise. Defaults to true.
224
- */
225
- readonly cors?: boolean;
226
- /**
227
- * Hostnames the `Host` header may name, without the port (DNS rebinding
228
- * protection). List the production, preview and local hosts. Defaults to
229
- * any.
230
- */
231
- readonly allowedHosts?: readonly string[];
232
- /**
233
- * A page that explains how to connect, published as RFC 9728
234
- * `resource_documentation`.
235
- */
236
- readonly resourceDocumentation?: string;
237
- /** Custom jsonb types, as in `createOpenApi`. */
238
- readonly json?: Readonly<Record<string, unknown>>;
239
- /**
240
- * Include internal error messages in tool results. Defaults to `NODE_ENV ===
241
- * 'development'`.
242
- */
243
- readonly exposeErrors?: boolean;
244
- /**
245
- * Keeps the invocation alive for event sink sends a tool started, e.g.
246
- * `EdgeRuntime.waitUntil` or Next's `after`.
247
- */
248
- readonly waitUntil?: (promise: Promise<unknown>) => void;
249
- /**
250
- * Decides each `tools/call` after the arguments are validated and before
251
- * `run`. `args` are the validated arguments (raw for table tools, which
252
- * validate in the repository). A refusal is a tool error; a refusal with
253
- * `scopes` is a 403 `insufficient_scope` challenge naming them.
254
- */
255
- readonly authorize?: (ctx: ToolContext<M, F, E, C, P, B>, tool: ToolRef, args: unknown) => ToolDecision | Promise<ToolDecision>;
256
- /**
257
- * Whether the caller sees a tool in `tools/list`. A hidden tool is called
258
- * like an unknown one. Lists are cached per token (`cacheScope: 'private'`).
259
- */
260
- readonly visible?: (ctx: ToolContext<M, F, E, C, P, B>, tool: ToolRef) => boolean | Promise<boolean>;
261
- }
262
- interface BetterMcp<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, Ref = string, B = unknown> extends BetterServer<M, F, E, C, P, B> {
263
- /**
264
- * Everything in one handler: the MCP endpoint and
265
- * `/.well-known/oauth-protected-resource`.
266
- */
267
- readonly fetch: (request: Request) => Promise<Response>;
268
- /** The Streamable HTTP endpoint (POST JSON-RPC). */
269
- readonly endpoint: (request: Request) => Promise<Response>;
270
- /** RFC 9728 protected resource metadata. */
271
- metadata(request: Request): Response;
272
- readonly tools: readonly ToolInfo[];
273
- /** Adds a tool typed against this app's repositories. */
274
- tool<I = Record<string, unknown>>(definition: ToolDefinition<M, F, E, I, C, P, Ref, B>): this;
275
- /** Calls a tool directly, e.g. from tests or another transport. */
276
- call(name: string, args: unknown, ctx: ToolContext<M, F, E, C, P, B>): Promise<ToolResult>;
277
- }
278
- /** A custom tool. Pass it in `createMcp({ tools: [...] })`. */
279
- export declare function defineTool<M extends AnyModels, F extends AnyFunctions, E, I = Record<string, unknown>, C = unknown, P = unknown, Ref = unknown, B = unknown>(definition: ToolDefinition<M, F, E, I, C, P, Ref, B>): McpTool<M, F, E, C, P, B>;
280
- /**
281
- * An MCP server (Streamable HTTP, stateless) whose tools run as the caller: the
282
- * Bearer token from the MCP client is verified and every query goes through
283
- * RLS. Answers 401 with RFC 9728 metadata so clients can sign in with Supabase
284
- * Auth's OAuth server.
285
- */
286
- export declare function createMcp<M extends AnyModels, D, F extends AnyFunctions, E, C = unknown, P = unknown, A extends AnyAuthorizer | undefined = undefined, B = unknown>(betterSupabase: BetterSupabase<M, D, F, E, C, P, B>, options: McpOptions<M, F, E, C, P, PermissionRef<A>, B> & {
287
- readonly authorizer?: A;
288
- }): BetterMcp<M, F, E, C, P, PermissionRef<A>, B>;
289
- export type { BetterMcp, GuardOptions, McpOptions, McpTool, ProtocolServer, ResourceRouteOptions, ServerDescription, ToolAnnotations, ToolContext, ToolDecision, ToolDefinition, ToolInfo, ToolRef, ToolResourceOptions, ToolResources, ToolResult };
1
+ import { r as GuardOptions } from "../respond-BYOV7KZp.js";
2
+ import { l as ResourceRouteOptions } from "../resource-types-RgaljPs0.js";
3
+ import { _ as ToolResult, a as ToolDecision, c as ToolResourceOptions, d as defineTool, f as MCP_PROTOCOL_VERSION, g as ToolInfo, h as ToolAnnotations, i as ToolContext, l as ToolResources, m as ServerDescription, n as McpOptions, o as ToolDefinition, p as ProtocolServer, r as McpTool, s as ToolRef, t as BetterMcp, u as createMcp, v as answerLine, y as answerMessage } from "../index-CiE37wKX.js";
4
+ export { type BetterMcp, type GuardOptions, MCP_PROTOCOL_VERSION, type McpOptions, type McpTool, type ProtocolServer, type ResourceRouteOptions, type ServerDescription, type ToolAnnotations, type ToolContext, type ToolDecision, type ToolDefinition, type ToolInfo, type ToolRef, type ToolResourceOptions, type ToolResources, type ToolResult, answerLine, answerMessage, createMcp, defineTool };