permdock 0.35.1 → 0.37.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 (339) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +2 -2
  3. package/dist/{adoption-scan-B_jVJgMK.js → adoption-scan-sufK4R53.js} +1 -1
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +3 -3
  7. package/dist/ai-sdk/index.js +3 -3
  8. package/dist/app/index.d.ts +1 -1
  9. package/dist/app/index.js +1 -1
  10. package/dist/{approval-prompt-BKxaKtby.d.ts → approval-prompt-DCC4jp2s.d.ts} +1 -1
  11. package/dist/approvals/index.d.ts +3 -3
  12. package/dist/{arazzo-CKsNFj_5.js → arazzo-BxtTsEK2.js} +2 -2
  13. package/dist/{arazzo-D-fDq8Dv.js → arazzo-D0ctRNBU.js} +1 -1
  14. package/dist/astro/index.d.ts +4 -4
  15. package/dist/astro/index.js +1 -1
  16. package/dist/authzen/index.d.ts +6 -6
  17. package/dist/authzen/index.js +1 -1
  18. package/dist/{automation-C7WH5XcZ.d.ts → automation-DdarCGcn.d.ts} +1 -1
  19. package/dist/better-auth/index.d.ts +1 -1
  20. package/dist/better-supabase/index.d.ts +23 -14
  21. package/dist/better-supabase/index.js +8 -8
  22. package/dist/{bind-DPptdk31.js → bind-BNYcJ1D9.js} +2 -2
  23. package/dist/{bind-BnrOLyJq.d.ts → bind-CLvD4iLc.d.ts} +7 -7
  24. package/dist/{bsb-access-tags-1oVQZWKp.js → bsb-access-tags-LCaE48SK.js} +1 -1
  25. package/dist/{bsb-action-keys-BfZAwg-9.js → bsb-action-keys-LgveZiHJ.js} +2 -2
  26. package/dist/{bsb-actions-BHiyBxQZ.js → bsb-actions-DcDxQ_Ku.js} +3 -3
  27. package/dist/{budgets-hi-ecgEd.js → budgets-DFnMBpKz.js} +3 -3
  28. package/dist/{build-instance-DZEWYO-A.js → build-instance-BGpABVbM.js} +1 -1
  29. package/dist/bundle-size-CGd8wVIu.js +1 -0
  30. package/dist/{bundle-size-DbXV65Ix.js → bundle-size-Pgm7BB5m.js} +2 -2
  31. package/dist/{capability-BW-vAxJi.d.ts → capability-CsiHf7K3.d.ts} +1 -1
  32. package/dist/{casbin-CWfeuRmI.js → casbin-CMEY_GT4.js} +1 -1
  33. package/dist/{casbin-DqiTIceJ.js → casbin-CkLvGuUb.js} +1 -1
  34. package/dist/catalog/index.d.ts +4 -4
  35. package/dist/{catalog-CBPFyRv7.js → catalog-DYC6wfAj.js} +1 -1
  36. package/dist/{catalog-BExjL94D.js → catalog-SnaPhbZ1.js} +2 -2
  37. package/dist/{catalog-doc-D4g3nyFB.js → catalog-doc-BX97oFAn.js} +1 -1
  38. package/dist/catalog-e6QRd1JP.js +1 -0
  39. package/dist/chat/index.d.ts +1 -1
  40. package/dist/chat/index.js +1 -1
  41. package/dist/chat-sdk/index.d.ts +3 -3
  42. package/dist/claims-size-B0OvYh9z.js +1 -0
  43. package/dist/{claims-size-BUhCWS88.js → claims-size-ZiUJBn0r.js} +42 -8
  44. package/dist/claude-agent/index.d.ts +3 -3
  45. package/dist/claude-agent/index.js +2 -2
  46. package/dist/clerk/index.d.ts +2 -2
  47. package/dist/cli/bin.js +1 -1
  48. package/dist/cli/generate/watch-worker.js +1 -1
  49. package/dist/cli/index.d.ts +6 -6
  50. package/dist/cli/index.js +1 -1
  51. package/dist/cli/plugins/app.d.ts +1 -1
  52. package/dist/cli/plugins/app.js +1 -1
  53. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  54. package/dist/cli/plugins/openapi.d.ts +1 -1
  55. package/dist/cli/plugins/openapi.js +1 -1
  56. package/dist/cli/plugins/powersync.d.ts +1 -1
  57. package/dist/cli/plugins/powersync.js +1 -1
  58. package/dist/cli/plugins/rls.d.ts +2 -2
  59. package/dist/cli/plugins/rls.js +1 -1
  60. package/dist/cli/plugins/schemas.d.ts +1 -1
  61. package/dist/cli/plugins/schemas.js +1 -1
  62. package/dist/cli/plugins/scim.d.ts +2 -2
  63. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  64. package/dist/cli/plugins/supabase-hook.js +1 -1
  65. package/dist/cli/plugins/supabase.d.ts +3 -3
  66. package/dist/cli/plugins/supabase.js +2 -2
  67. package/dist/cli/plugins/ui.d.ts +1 -1
  68. package/dist/cli/plugins/ui.js +1 -1
  69. package/dist/{client-subject-YAGMzRa-.d.ts → client-subject-DSF0IYGW.d.ts} +2 -2
  70. package/dist/cloud/index.d.ts +8 -8
  71. package/dist/{cloud-CvA_LeOt.js → cloud-N4IUVluH.js} +2 -2
  72. package/dist/{codemod-DduTfuWM.js → codemod-C9SQqhNG.js} +5 -5
  73. package/dist/{codemod-CA0MQoG4.js → codemod-D5a5oDJX.js} +1 -1
  74. package/dist/collect-C2_CKZ09.js +1 -0
  75. package/dist/{collect-Ba7ccZ23.js → collect-CcE8QBtZ.js} +2 -2
  76. package/dist/{collect-CPimbkC5.js → collect-Co-w8Eg2.js} +1 -1
  77. package/dist/compile/index.d.ts +1 -1
  78. package/dist/{compile-D-BULiHE.js → compile-BFV2WG67.js} +6 -6
  79. package/dist/{compile-CoUadQXF.d.ts → compile-CFV4wDo9.d.ts} +2 -2
  80. package/dist/{completion-DXdFnwLY.js → completion-BUWG1FGo.js} +1 -1
  81. package/dist/{config-BWYfHYvW.js → config-B3Bc6Tly.js} +1 -1
  82. package/dist/{config-report-pg-66Bdr.js → config-report-3IhYuH4v.js} +2 -2
  83. package/dist/{context-rioF4fQl.js → context-CNI2jibq.js} +1 -1
  84. package/dist/convex/index.d.ts +4 -4
  85. package/dist/convex/index.js +2 -2
  86. package/dist/{core-DIUrkFNL.js → core-BFR-V5CL.js} +2 -2
  87. package/dist/{core-DCMIztx1.d.ts → core-BOWoKYve.d.ts} +2 -2
  88. package/dist/{create-BRY0OtFV.js → create-BICq9l-p.js} +2 -2
  89. package/dist/{create-T_NqxU31.d.ts → create-BTthKNP0.d.ts} +7 -7
  90. package/dist/{create-iCwrnaFE.d.ts → create-BaKdh-D8.d.ts} +6 -6
  91. package/dist/{create-BMRnaZel.js → create-Dapy8DIK.js} +3 -3
  92. package/dist/{create-BYL8xCJB.d.ts → create-Y6DnNpuP.d.ts} +4 -4
  93. package/dist/{credentials-DzNrCNZY.d.ts → credentials-e872ACwg.d.ts} +2 -2
  94. package/dist/{custom-role-rebuild-wzN8pqDk.js → custom-role-rebuild-QFXiMHqJ.js} +1 -1
  95. package/dist/{define-permdock-Bhye7WSY.d.ts → define-permdock-8YZPaa9x.d.ts} +6 -6
  96. package/dist/{define-permdock-CO7YNrOF.js → define-permdock-B0q7Rg9b.js} +1 -1
  97. package/dist/delivery/index.d.ts +4 -4
  98. package/dist/{denied-text-DgNqDAPH.d.ts → denied-text-u4OC-MYV.d.ts} +1 -1
  99. package/dist/{describe-DEoWvk00.d.ts → describe-DLGEciCs.d.ts} +1 -1
  100. package/dist/{diff-CS8ks9h3.js → diff-BebUlh4Z.js} +1 -1
  101. package/dist/{diff-CkSZF7LO.js → diff-Sxca4_5q.js} +3 -3
  102. package/dist/{doctor-B55XfWdG.js → doctor-DP7HwXw_.js} +2 -2
  103. package/dist/{doctor-Cs0Xl46A.js → doctor-DhpDQ5C6.js} +102 -32
  104. package/dist/drizzle/index.d.ts +3 -3
  105. package/dist/elysia/index.d.ts +4 -4
  106. package/dist/elysia/index.js +1 -1
  107. package/dist/{errors-BliKrfmP.d.ts → errors-C35fh_2K.d.ts} +1 -1
  108. package/dist/{evaluations-CUkSKioS.d.ts → evaluations-BiZYgET4.d.ts} +3 -3
  109. package/dist/eve/index.d.ts +4 -4
  110. package/dist/eve/index.js +2 -2
  111. package/dist/{execute-Vfo2CAhv.js → execute-g-nMgY4t.js} +4 -4
  112. package/dist/{explain-D4ipf8IH.js → explain-BrvY9cXX.js} +1 -1
  113. package/dist/{explain-DISCeeYS.js → explain-CgKGadRa.js} +2 -2
  114. package/dist/express/index.d.ts +4 -4
  115. package/dist/express/index.js +1 -1
  116. package/dist/fastify/index.d.ts +4 -4
  117. package/dist/fastify/index.js +1 -1
  118. package/dist/{fetch-adapter-Ds2-fUUi.d.ts → fetch-adapter-CQSxXotl.d.ts} +2 -2
  119. package/dist/{fetch-adapter-BXQc4NoV.js → fetch-adapter-dmABnF7F.js} +1 -1
  120. package/dist/{fields-CwFej4gp.js → fields-CKX-qjWb.js} +1 -1
  121. package/dist/{gen-M_5UU5Ck.js → gen-CTRqv1H2.js} +4 -4
  122. package/dist/gen-D-orrO2e.js +1 -0
  123. package/dist/{gen-kind-DLz0P-TB.js → gen-kind-DLnQ-vCe.js} +1 -1
  124. package/dist/{generate-CNkkKAL-.js → generate-DcPnvokU.js} +94 -15
  125. package/dist/{generate-GCDLA8vW.js → generate-dbQzpEqb.js} +3 -3
  126. package/dist/{generate-options-O3mVjjcG.js → generate-options-4jvPn7w3.js} +9 -9
  127. package/dist/h3/index.d.ts +4 -4
  128. package/dist/h3/index.js +2 -2
  129. package/dist/{helper-calls-B5MOl99d.js → helper-calls-DN1PJcNY.js} +53 -1
  130. package/dist/hono/index.d.ts +4 -4
  131. package/dist/hono/index.js +1 -1
  132. package/dist/{hook-sql-y0CJBLJr.js → hook-sql-3yPtwas6.js} +283 -13
  133. package/dist/{hosted-DZgmEG4b.d.ts → hosted-Cl7q35D-.d.ts} +1 -1
  134. package/dist/{import-CQSJ6xcN.js → import-DEUiWePf.js} +1 -1
  135. package/dist/{import-Bz6IKoMM.js → import-wBO24zgo.js} +1 -1
  136. package/dist/{index-Cjr8Q-uq.d.ts → index-B1hyWi7O.d.ts} +11 -10
  137. package/dist/{index-ktQ7E4qB.d.ts → index-BtPvYUww.d.ts} +4 -4
  138. package/dist/{index-CWBCzwOp.d.ts → index-D9DsY164.d.ts} +4 -4
  139. package/dist/{index-DBBRSw6r.d.ts → index-DYvFRQle.d.ts} +2 -2
  140. package/dist/{index-CAE_Z53Y.d.ts → index-L6lt50lg.d.ts} +1 -1
  141. package/dist/{index-BOJPdIBk.d.ts → index-p5y3whIg.d.ts} +4 -4
  142. package/dist/index.d.ts +15 -15
  143. package/dist/index.js +3 -3
  144. package/dist/{init-Cfb0VX3T.js → init-CUviJnno.js} +3 -3
  145. package/dist/{init-BucxAxRw.js → init-DqOKr99S.js} +1 -1
  146. package/dist/{inspect-functions-CzrQtRDb.js → inspect-functions-Uv3Ndkty.js} +1 -1
  147. package/dist/{instance-options-DDERlopm.d.ts → instance-options-CUNLusL6.d.ts} +1 -1
  148. package/dist/{interactive-only-Bbq9e61G.js → interactive-only-CylKSukS.js} +1 -1
  149. package/dist/jwt/index.d.ts +4 -4
  150. package/dist/{kernel-DSnWVZ0O.js → kernel-yI0nUyuX.js} +3 -3
  151. package/dist/{keys-BWhAnANj.js → keys-CA3SdBHQ.js} +1 -1
  152. package/dist/kysely/index.d.ts +3 -3
  153. package/dist/{lazy-provider-Clt2095H.d.ts → lazy-provider-B22nfOsw.d.ts} +1 -1
  154. package/dist/{login-CU89mk0U.js → login-BMONKzI_.js} +3 -3
  155. package/dist/{login-qYcM0hKh.js → login-mcxQxTAL.js} +1 -1
  156. package/dist/{manifest-schema-N3v2RVL-.js → manifest-schema-CkROwfT9.js} +1 -1
  157. package/dist/{manifest-Bu9gUrI0.js → manifest-tO5SjSGH.js} +63 -52
  158. package/dist/{manifest-CIWOmdlP.js → manifest-teSfgeqF.js} +1 -1
  159. package/dist/mcp/index.d.ts +8 -8
  160. package/dist/mcp/index.js +2 -2
  161. package/dist/{measure-C_Z0a7B8.js → measure-r811lN7F.js} +2 -2
  162. package/dist/{memberships-CNoAlsma.js → memberships-CDiSsFTu.js} +1 -1
  163. package/dist/{memberships-4e6qi8Uv.js → memberships-DiCbNRny.js} +1 -1
  164. package/dist/{model-BYCtXS_g.js → model-wt3wihiH.js} +2 -2
  165. package/dist/{names-DBxKx2bz.js → names-DwGleRKB.js} +3 -3
  166. package/dist/nest/index.d.ts +4 -4
  167. package/dist/nest/index.js +1 -1
  168. package/dist/next/index.d.ts +11 -11
  169. package/dist/next/index.js +3 -3
  170. package/dist/next/plugin.d.ts +1 -1
  171. package/dist/next/plugin.js +1 -1
  172. package/dist/node/index.d.ts +4 -4
  173. package/dist/node/index.js +1 -1
  174. package/dist/openai/index.d.ts +4 -4
  175. package/dist/openai/index.js +3 -3
  176. package/dist/openapi/index.d.ts +2 -2
  177. package/dist/{openapi-DIhS8iHN.js → openapi-BZHc6R7A.js} +100 -5
  178. package/dist/{openapi-ZIlGKUwQ.js → openapi-CNWuAQZi.js} +1 -1
  179. package/dist/{openapi-document-D5IhoJo0.js → openapi-document-CHJI74v_.js} +1 -1
  180. package/dist/orpc/index.d.ts +5 -5
  181. package/dist/orpc/index.js +2 -2
  182. package/dist/otel/index.d.ts +3 -3
  183. package/dist/{output-DIjUJioq.js → output-Bfc3EpB2.js} +1 -1
  184. package/dist/{ownership-Bmt-z0rF.js → ownership-BuQFLjZ5.js} +3 -3
  185. package/dist/{parse-local-manifest-DoLQFkRb.d.ts → parse-local-manifest-BE_R-Ish.d.ts} +1 -1
  186. package/dist/pdp/index.d.ts +3 -3
  187. package/dist/pdp/index.js +1 -1
  188. package/dist/{permdock-JM9TKevZ.js → permdock-CbavFN6u.js} +6 -2
  189. package/dist/{permdock-DkvkGVF0.d.ts → permdock-NJ4-pCZy.d.ts} +7 -5
  190. package/dist/{permissions-xPyAmuXi.js → permissions-BPYOb5OB.js} +1 -1
  191. package/dist/{pipeline-BAGSNnct.js → pipeline-DW7cy40F.js} +2 -2
  192. package/dist/{plugin-DDPXES4k.d.ts → plugin-YAJ25tft.d.ts} +2 -2
  193. package/dist/{policy-BoUbJ2c0.d.ts → policy-BlOumPY5.d.ts} +1 -1
  194. package/dist/{policy-D8RxFeZO.js → policy-DTk6NZm-.js} +1 -1
  195. package/dist/{policy-bundle-DC_xq2R5.js → policy-bundle-C7Hz9Rrs.js} +3 -3
  196. package/dist/{policy-types-DuM3k5Ao.d.ts → policy-types-CRWqx8qf.d.ts} +7 -2
  197. package/dist/{postgrest-B1bTbVE4.d.ts → postgrest-BGYDQhG1.d.ts} +7 -6
  198. package/dist/{powersync-CgCMKvaU.js → powersync-CeuhNT0R.js} +1 -1
  199. package/dist/{powersync-CiQ97gzz.js → powersync-CoP_nlGj.js} +8 -8
  200. package/dist/{powersync-BlfO3_jN.js → powersync-LpKFefiH.js} +1 -1
  201. package/dist/prisma/index.d.ts +2 -2
  202. package/dist/{protected-action-gBxeetqY.d.ts → protected-action-BbQb5G_c.d.ts} +5 -5
  203. package/dist/{provider-Clt2095H.d.ts → provider-B22nfOsw.d.ts} +1 -1
  204. package/dist/{provider-BwqzED5h.js → provider-hQFC3b98.js} +32 -5
  205. package/dist/{prune-config-CbhJ_XvD.js → prune-config-C0uSbf1I.js} +4 -4
  206. package/dist/{pull-DLyCr-7L.js → pull-A1SkxAyb.js} +3 -3
  207. package/dist/pull-CNMED72E.js +1 -0
  208. package/dist/{push-D5so0ptb.js → push-Br0Uz5pT.js} +2 -2
  209. package/dist/{pushed-policy-C65TbLtU.d.ts → pushed-policy-B2AXpqRr.d.ts} +1 -1
  210. package/dist/{rbac-DbyaaNLa.js → rbac-Dx88RLxH.js} +3 -3
  211. package/dist/react/index.d.ts +6 -6
  212. package/dist/react/lazy.d.ts +6 -6
  213. package/dist/react/provider-client-lazy.d.ts +1 -1
  214. package/dist/react/provider-client.d.ts +1 -1
  215. package/dist/react-native/index.d.ts +8 -8
  216. package/dist/{rename-CI6NIF9t.js → rename-RnOp8vDq.js} +2 -2
  217. package/dist/replay-DjZ4I8QN.d.ts +3 -0
  218. package/dist/{report-DF0zUNut.js → report-Dp-ApWVC.js} +1 -1
  219. package/dist/{report-XdCm1y_J.js → report-x9GeUvjx.js} +1 -1
  220. package/dist/{request-context-CqqdiVp4.js → request-context-C9FFFpuH.js} +1 -1
  221. package/dist/resend/index.d.ts +4 -4
  222. package/dist/{resolve-names-BR6PiCrx.js → resolve-names-Ch5Ve5l4.js} +4 -4
  223. package/dist/{resolver-D2c1CcoZ.js → resolver-C9-dU-SZ.js} +30 -14
  224. package/dist/{rls-BfUIMNeV.js → rls-CHJbaZxj.js} +13 -12
  225. package/dist/{rls-CdQW7v9D.js → rls-DgYAJpVW.js} +5 -5
  226. package/dist/{rls-files-68-nKfmG.js → rls-files-RZ7PGrzg.js} +1 -1
  227. package/dist/{rls-options-DCLdZaTZ.d.ts → rls-options-BWWTZWjh.d.ts} +1 -1
  228. package/dist/{row-conditions-DwIJocfQ.js → row-conditions-BjARoFLU.js} +1 -1
  229. package/dist/{rpc-BYFB37KV.d.ts → rpc-CqKQCBPN.d.ts} +1 -1
  230. package/dist/{rpc-BQPa7tLP.js → rpc-RDBrKR7N.js} +1 -1
  231. package/dist/{run-B2Axta4z.js → run-CbJPONx5.js} +2 -2
  232. package/dist/run-iPVAxorh.js +1 -0
  233. package/dist/{run-ticket-CRldclc7.d.ts → run-ticket-BIRal-vH.d.ts} +2 -2
  234. package/dist/{saas-DSeazNrN.js → saas-CHviJgF2.js} +2 -2
  235. package/dist/{scan-DNzOELYT.js → scan-DjTW-y6E.js} +1 -1
  236. package/dist/{schema-CJc23R4a.js → schema-DVyxM9xS.js} +1 -1
  237. package/dist/scim/index.d.ts +1 -1
  238. package/dist/seeds/index.d.ts +1 -1
  239. package/dist/{seeds-BZMPfWcC.d.ts → seeds-K00R0810.d.ts} +1 -1
  240. package/dist/server/index.d.ts +11 -11
  241. package/dist/server/index.js +1 -1
  242. package/dist/{server-types-FkdDSB9h.d.ts → server-types-CaKNUxdc.d.ts} +8 -8
  243. package/dist/{sink-CoMI_OVw.d.ts → sink-CCirKrLv.d.ts} +2 -2
  244. package/dist/{size-CY6rK6l9.js → size-Dm3777Ev.js} +3 -3
  245. package/dist/{skills-TqrLrmuv.js → skills-BYc8rmHF.js} +1 -1
  246. package/dist/{skills-DTpSMQRg.js → skills-BdmjI4D2.js} +1 -1
  247. package/dist/{snapshot-cache-R1lJjYmI.d.ts → snapshot-cache-Dh_owfVu.d.ts} +1 -1
  248. package/dist/{snapshot-size-NklqBKcV.js → snapshot-size-CpdksnSr.js} +1 -1
  249. package/dist/{snapshot-size-D6ixbYvH.js → snapshot-size-I_-fxGry.js} +1 -1
  250. package/dist/solid/index.d.ts +5 -5
  251. package/dist/solid-start/index.d.ts +4 -4
  252. package/dist/solid-start/index.js +2 -2
  253. package/dist/{sources-Dp6FQ8np.d.ts → sources-CD1OiqqK.d.ts} +1 -1
  254. package/dist/{src-BXDohWNO.js → src-10d_jun2.js} +4 -4
  255. package/dist/ssf/index.d.ts +3 -3
  256. package/dist/{standard-webhooks-D2FwHtMX.d.ts → standard-webhooks-CiV4_mv2.d.ts} +2 -2
  257. package/dist/{store-core-aluQ3R1M.d.ts → store-core-fRqdlrep.d.ts} +4 -4
  258. package/dist/{stores-hHICuiQl.d.ts → stores-BXPRg1Ot.d.ts} +5 -5
  259. package/dist/{subject-cache-Bn4oJY_R.d.ts → subject-cache-1EtpGx3y.d.ts} +9 -1
  260. package/dist/supabase/index.d.ts +8 -8
  261. package/dist/supabase/index.js +4 -4
  262. package/dist/supabase/middleware.d.ts +5 -5
  263. package/dist/supabase/middleware.js +3 -3
  264. package/dist/{supabase-MitbozF6.js → supabase-BAuqWNj3.js} +2 -2
  265. package/dist/{supabase-ByhSqBDB.js → supabase-CeJAHqZp.js} +2 -2
  266. package/dist/{supabase-hook-RFLW2YPX.js → supabase-hook-BbwsceID.js} +5 -5
  267. package/dist/supabase-hook-CObLSH20.js +2 -0
  268. package/dist/{supabase-schemas-CVhpyYB6.js → supabase-schemas-RG58AMTu.js} +1 -1
  269. package/dist/{supautils-C85NuESf.js → supautils-ym4X20ig.js} +2 -1
  270. package/dist/svelte/index.d.ts +5 -5
  271. package/dist/svelte/runtime.d.ts +3 -3
  272. package/dist/svelte/source.d.ts +5 -5
  273. package/dist/sveltekit/index.d.ts +4 -4
  274. package/dist/sveltekit/index.js +1 -1
  275. package/dist/{table-reads-D0M_X-pj.js → table-reads--NupdCFw.js} +3 -3
  276. package/dist/{table-reads-Dso5UyeT.js → table-reads-Glf0BHSE.js} +1 -1
  277. package/dist/{tables-DrrGtayG.js → tables-Dyfviku5.js} +4 -4
  278. package/dist/tanstack-start/index.d.ts +4 -4
  279. package/dist/tanstack-start/index.js +1 -1
  280. package/dist/{tenant-check-D6fnfQBP.js → tenant-check-Bfd4hotj.js} +3 -3
  281. package/dist/terminal/index.d.ts +5 -5
  282. package/dist/terminal/index.js +2 -2
  283. package/dist/testing/core.d.ts +1 -1
  284. package/dist/testing/core.js +1 -1
  285. package/dist/testing/fixtures/index.d.ts +3 -3
  286. package/dist/testing/fixtures/index.js +1753 -162
  287. package/dist/testing/index.d.ts +22 -22
  288. package/dist/testing/index.js +6 -6
  289. package/dist/testing/saas/index.d.ts +3 -3
  290. package/dist/testing/saas/index.js +2 -2
  291. package/dist/testing/saas/permissions.js +1 -1
  292. package/dist/trpc/index.d.ts +5 -5
  293. package/dist/trpc/index.js +2 -2
  294. package/dist/{type-helpers-CsWH9z8p.d.ts → type-helpers-DTlfU9zX.d.ts} +1 -1
  295. package/dist/{types-BzsplNgO.d.ts → types-BGDafbIK.d.ts} +4 -4
  296. package/dist/{types-BGN3coSe.d.ts → types-BdghnYGo.d.ts} +1 -1
  297. package/dist/{types-Cvfe-G_N.d.ts → types-C1jxMZ4q.d.ts} +2 -2
  298. package/dist/{types-D3GI2B9O.d.ts → types-C2GmBHtC.d.ts} +3 -3
  299. package/dist/{types-dtDg4goh.d.ts → types-CAGo84uV.d.ts} +4 -4
  300. package/dist/{types-DRMoZjJm.d.ts → types-CN3Tk7bb.d.ts} +2 -2
  301. package/dist/{types-CKwI6AT4.d.ts → types-CzAFVtMz.d.ts} +1 -1
  302. package/dist/{types-CBUYbPwl.d.ts → types-Jxy_Ko7f.d.ts} +2 -2
  303. package/dist/{types-BwjOhlgx.d.ts → types-XhEnMpL6.d.ts} +4 -4
  304. package/dist/{types-D417woMp.d.ts → types-ZjPv-GgQ.d.ts} +3 -3
  305. package/dist/{types-config-DYRoZ8Iw.d.ts → types-config-B3eAej9-.d.ts} +2 -2
  306. package/dist/{types-run-CeCrWO0v.d.ts → types-run-sP7yLp61.d.ts} +1 -1
  307. package/dist/unplugin/index.d.ts +1 -1
  308. package/dist/unplugin/index.js +1 -1
  309. package/dist/{usage-Cv4WDRWv.js → usage-7Hwk_akY.js} +4 -4
  310. package/dist/usage-Bwl8YAmq.js +1 -0
  311. package/dist/{usage-DBaJfCZB.js → usage-nZP7EeRj.js} +1 -1
  312. package/dist/{validation-error-MZ7KLNHt.d.ts → validation-error-OX59FaXR.d.ts} +1 -1
  313. package/dist/{verify-DT9WS_Gm.js → verify-DOCJgGlw.js} +9 -9
  314. package/dist/{version-cache-Ccrfu2A4.js → version-cache-l9Zrfvhz.js} +8 -6
  315. package/dist/vue/index.d.ts +5 -5
  316. package/dist/{waiter-DdwtUSzB.d.ts → waiter-CyF-YowB.d.ts} +2 -2
  317. package/dist/{warm-BZ0ZwSmO.js → warm-BOrs0-_j.js} +1 -1
  318. package/dist/{warm-znYuJoUZ.d.ts → warm-BYF-zxiy.d.ts} +1 -1
  319. package/dist/watch-5WP3ZCcR.js +1 -0
  320. package/dist/{watch-14vng0pg.js → watch-BFDMb5N4.js} +1 -1
  321. package/dist/{watch-DuIAsqFR.js → watch-DYsWhTvO.js} +2 -2
  322. package/dist/webmcp/index.d.ts +1 -1
  323. package/dist/workflow/index.d.ts +3 -3
  324. package/dist/workflow/index.js +1 -1
  325. package/dist/workflow-sdk/index.d.ts +4 -4
  326. package/dist/{wrap-C36-eV-C.d.ts → wrap-CPvBX9lm.d.ts} +2 -2
  327. package/package.json +2 -2
  328. package/schemas/supabase-manifest-v1.json +1 -1
  329. package/dist/bundle-size-BRFeBvuv.js +0 -1
  330. package/dist/catalog-sR0m6x2g.js +0 -1
  331. package/dist/claims-size-C6oKGuOM.js +0 -1
  332. package/dist/collect-CIdE3FGC.js +0 -1
  333. package/dist/gen-vr1udb1p.js +0 -1
  334. package/dist/pull-IQPhpX4y.js +0 -1
  335. package/dist/replay-B__gzUx3.d.ts +0 -3
  336. package/dist/run-CfvcMtPK.js +0 -1
  337. package/dist/supabase-hook-DZk7PV7Z.js +0 -2
  338. package/dist/usage-DOcCnIdW.js +0 -1
  339. package/dist/watch-Be7ja4dL.js +0 -1
@@ -1,15 +1,15 @@
1
1
  import { c as isConditionDate, l as isConditionRef, o as hasConditionOp } from "./refs-Cix9Zjis.js";
2
2
  import { n as findPermission } from "./permission-registry-DstT40VS.js";
3
- import { t as getPermDock } from "./permdock-JM9TKevZ.js";
4
- import { A as memoryCustomRoleSource, _ as localSnapshotManifest } from "./src-BXDohWNO.js";
3
+ import { t as getPermDock } from "./permdock-CbavFN6u.js";
4
+ import { A as memoryCustomRoleSource, _ as localSnapshotManifest } from "./src-10d_jun2.js";
5
5
  import { f as usageResult } from "./errors-DgLOqc6j.js";
6
6
  import { t as applyFiles } from "./files-DuV7wRim.js";
7
7
  import { i as fileDrift } from "./output-files-8lfALMSU.js";
8
8
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-3aUUP6Nx.js";
9
9
  import { r as pgConnector } from "./pg-DmS5ITHu.js";
10
10
  import { c as requirePolicy } from "./load-m7jmit3y.js";
11
- import { t as canFixture } from "./verify-DT9WS_Gm.js";
12
- import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-DbyaaNLa.js";
11
+ import { t as canFixture } from "./verify-DOCJgGlw.js";
12
+ import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-Dx88RLxH.js";
13
13
  import { a as quoteIdent, s as quoteQualified } from "./quote-LNaBdCGA.js";
14
14
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.js";
15
15
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
@@ -18,15 +18,15 @@ import { d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-C6Id63F8.js";
18
18
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
19
19
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
20
20
  import { s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-T4GaBh9X.js";
21
- import { t as ownershipRules } from "./ownership-Bmt-z0rF.js";
22
- import { a as tableFor } from "./compile-D-BULiHE.js";
23
- import { i as tableNames, r as tableNameOf } from "./tables-DrrGtayG.js";
21
+ import { t as ownershipRules } from "./ownership-BuQFLjZ5.js";
22
+ import { a as tableFor } from "./compile-BFV2WG67.js";
23
+ import { i as tableNames, r as tableNameOf } from "./tables-Dyfviku5.js";
24
24
  import { l as policyLevels } from "./policy-CZBJDcTx.js";
25
25
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
26
26
  import { t as requiresApproval } from "./approval-required-B-R4Yw3J.js";
27
27
  import { o as sqlFiles } from "./files-DAR51W3J.js";
28
28
  import { o as parseSqlLenient } from "./ast-Dnm2TOHN.js";
29
- import { n as resolveSchemas } from "./supabase-schemas-CVhpyYB6.js";
29
+ import { n as resolveSchemas } from "./supabase-schemas-RG58AMTu.js";
30
30
  import { existsSync, readFileSync } from "node:fs";
31
31
  import { join, resolve } from "node:path";
32
32
  // src/cli/powersync/claims.ts
@@ -1 +1 @@
1
- export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-CiQ97gzz.js";
1
+ export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-CoP_nlGj.js";
@@ -1,6 +1,6 @@
1
- import { Ar as Subject, Fr as Condition, qt as Instant } from "../policy-types-DuM3k5Ao.js";
1
+ import { Ar as Subject, Fr as Condition, qt as Instant } from "../policy-types-CRWqx8qf.js";
2
2
  import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-C9F1sU1d.js";
3
- import { p as WhereResult } from "../permdock-DkvkGVF0.js";
3
+ import { p as WhereResult } from "../permdock-NJ4-pCZy.js";
4
4
  import { r as RelationsMapping } from "../graph-sql-Ds3nbevr.js";
5
5
  /**
6
6
  * A model's non-nullable scalar fields and its scalar list fields, by Prisma
@@ -1,10 +1,10 @@
1
- import { Dr as Membership, N as PolicyVocabulary, ir as Decision } from "./policy-types-DuM3k5Ao.js";
1
+ import { Dr as Membership, N as PolicyVocabulary, ir as Decision } from "./policy-types-CRWqx8qf.js";
2
2
  import { r as Role, w as Permission } from "./vocabulary-DHfKPIC5.js";
3
- import { d as UncheckedData, s as RowData } from "./permdock-DkvkGVF0.js";
4
- import { r as DescribeOptions, t as DecisionDescription } from "./describe-DEoWvk00.js";
5
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView } from "./store-core-aluQ3R1M.js";
3
+ import { d as UncheckedData, s as RowData } from "./permdock-NJ4-pCZy.js";
4
+ import { r as DescribeOptions, t as DecisionDescription } from "./describe-DLGEciCs.js";
5
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView } from "./store-core-fRqdlrep.js";
6
6
  import { r as RefreshTrigger } from "./refresh-on-C1zIMtJr.js";
7
- import { r as ProtectedProps } from "./types-BzsplNgO.js";
7
+ import { r as ProtectedProps } from "./types-BGDafbIK.js";
8
8
  import { ReactNode } from "react";
9
9
  /**
10
10
  * The instance with every check. It loads the evaluator on first use and
@@ -1,4 +1,4 @@
1
- import { n as PermDockProviderProps } from "./types-BzsplNgO.js";
1
+ import { n as PermDockProviderProps } from "./types-BGDafbIK.js";
2
2
  import { ReactElement } from "react";
3
3
  declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
4
4
  export { PermDockProvider as t };
@@ -1,8 +1,8 @@
1
1
  import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { n as freezeDeep } from "./freeze-DGfJq_j2.js";
3
- import { a as delegatedScopeMap } from "./permdock-JM9TKevZ.js";
3
+ import { a as delegatedScopeMap } from "./permdock-CbavFN6u.js";
4
4
  import { i as qualifySqlTable, l as sqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
5
- import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-CIWOmdlP.js";
5
+ import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-teSfgeqF.js";
6
6
  import { y as parseAnswer } from "./permission-registry-DstT40VS.js";
7
7
  import { o as holder, r as approverLeaves } from "./approvers-BkY_ZfWl.js";
8
8
  import { n as asApprover } from "./approval-normalize-C6je8vWN.js";
@@ -149,6 +149,11 @@ function actionKeysOf(catalog, problems) {
149
149
  // src/better-supabase/approvers.ts
150
150
  /** `rls.approvals`' approver check, executable by `authenticated`. */
151
151
  const IS_APPROVER = "permdock_is_approver";
152
+ /**
153
+ * `rls.approvals`' approver check as a set, for better-supabase's
154
+ * `isApproverMany`.
155
+ */
156
+ const APPROVER_REQUEST_IDS = "permdock_approver_request_ids";
152
157
  /** The manager walk `rls.approvals.managers` writes. */
153
158
  const MANAGES = "permdock_manages";
154
159
  /**
@@ -177,6 +182,7 @@ function isApproverTemplate(input) {
177
182
  if (current && input.covers !== true) return { problems: [`requestApprovers needs the five-argument ${IS_APPROVER}, which \`permdock rls generate\` writes with rls.approvals.delegations or rls.approvals.managers. Set one, run it, then \`permdock supabase inspect --out\`.`] };
178
183
  const passed = current ? ", ({approvers})::jsonb" : "";
179
184
  const branches = [];
185
+ const kinds = {};
180
186
  for (const [kind, given] of Object.entries(input.approvers)) {
181
187
  if (kind === "") {
182
188
  problems.push("approvers has an empty kind, which no request has.");
@@ -191,6 +197,7 @@ function isApproverTemplate(input) {
191
197
  } else if (leaf.kind !== "permission") problems.push(`The ${kind} approvers name a ${leaf.kind} approver, which ${IS_APPROVER} cannot check in SQL, so it matches nobody. Use user(), holder(), manager() or anyOf().`);
192
198
  else if (keys !== void 0 && !keys.has(leaf.permission)) problems.push(`The ${kind} approver permission ${leaf.permission} is not in the catalog. Run \`permdock catalog\` after adding it to the policy.`);
193
199
  }
200
+ kinds[kind] = approvers;
194
201
  const json = `${quoteSqlLiteral(JSON.stringify(approvers))}::jsonb`;
195
202
  branches.push(input.covers === true ? `when ${quoteSqlLiteral(kind)} then ${fn}(${json}, ({tenant})::text, ({requester})::text, ${quoteSqlLiteral(resourceOf(kind))}${passed})` : `when ${quoteSqlLiteral(kind)} then ${fn}(${json}, ({tenant})::text)`);
196
203
  }
@@ -199,6 +206,16 @@ function isApproverTemplate(input) {
199
206
  return { problems };
200
207
  }
201
208
  if (!input.rootTenant) problems.push(`The tenant scope "${input.tenantScope}" is not a root scope, and ${IS_APPROVER} checks holder() approvers at the root scope, so they match nobody.`);
209
+ if (input.many === null) problems.push(`isApproverMany needs ${input.schema}.${APPROVER_REQUEST_IDS}, which \`permdock rls generate\` writes with rls.approvals. Run it, then \`permdock supabase inspect --out\`.`);
210
+ const manyFn = `${sqlIdent(input.schema)}.${sqlIdent(APPROVER_REQUEST_IDS)}`;
211
+ const many = input.many === true ? {
212
+ template: `${manyFn}({requests}, ${quoteSqlLiteral(JSON.stringify(kinds))}::jsonb, ${current ? "true" : "false"})`,
213
+ requires: {
214
+ function: manyFn,
215
+ args: "jsonb, jsonb, boolean",
216
+ role: "postgres"
217
+ }
218
+ } : void 0;
202
219
  const otherwise = current ? `${fn}(null::jsonb, ({tenant})::text, ({requester})::text, pg_catalog.split_part({kind}, '.', 1)${passed})` : "false";
203
220
  return {
204
221
  template: branches.length === 0 ? otherwise : `case {kind} ${branches.join(" ")} else ${otherwise} end`,
@@ -207,6 +224,7 @@ function isApproverTemplate(input) {
207
224
  args: current ? "jsonb, text, text, text, jsonb" : input.covers === true ? "jsonb, text, text, text" : "jsonb, text",
208
225
  role: "postgres"
209
226
  },
227
+ ...many === void 0 ? {} : { many },
210
228
  problems
211
229
  };
212
230
  }
@@ -510,7 +528,7 @@ function providerFunctions(input) {
510
528
  });
511
529
  }
512
530
  }
513
- const isApprover = isApproverOf(input, helpers, requires);
531
+ const { isApprover, isApproverMany } = isApproverOf(input, helpers, requires) ?? {};
514
532
  const call = (name, sql, role, args) => {
515
533
  const fn = `${schema}.${sqlIdent(name)}`;
516
534
  requires.push({
@@ -567,6 +585,7 @@ function providerFunctions(input) {
567
585
  ...portal.portalParties === void 0 ? {} : { portalParties: portal.portalParties },
568
586
  ...actorMayWrite === void 0 ? {} : { actorMayWrite },
569
587
  ...isApprover === void 0 ? {} : { isApprover },
588
+ ...isApproverMany === void 0 ? {} : { isApproverMany },
570
589
  ...permitted === void 0 ? {} : { permitted },
571
590
  ...canIn === void 0 ? {} : { canIn },
572
591
  ...subject === void 0 ? {} : { subject },
@@ -582,7 +601,8 @@ function providerFunctions(input) {
582
601
  }
583
602
  /**
584
603
  * `isApprover` from `approvers` (with `approver` as its `'ai-tool'` entry) or
585
- * `requestApprovers`, over `permdock_is_approver`.
604
+ * `requestApprovers`, over `permdock_is_approver`, and with `isApproverMany`
605
+ * its set form over `permdock_approver_request_ids`.
586
606
  */
587
607
  function isApproverOf(input, helpers, requires) {
588
608
  const { options } = input;
@@ -599,13 +619,20 @@ function isApproverOf(input, helpers, requires) {
599
619
  listed: helpers.has(IS_APPROVER),
600
620
  covers: /\bp_requester\b/u.test(helpers.get("permdock_is_approver")?.args ?? ""),
601
621
  managers: helpers.has(MANAGES),
622
+ ...options.isApproverMany === true ? { many: helpers.has("permdock_approver_request_ids") ? true : null } : {},
602
623
  tenantScope: input.tenantScope,
603
624
  rootTenant: input.rootTenant,
604
625
  catalog: input.catalog
605
626
  });
606
627
  input.problems.push(...built.problems);
607
628
  if (built.requires !== void 0) requires.push(built.requires);
608
- return built.template;
629
+ if (built.template === void 0) return;
630
+ if (built.many === void 0) return { isApprover: built.template };
631
+ requires.push(built.many.requires);
632
+ return {
633
+ isApprover: built.template,
634
+ isApproverMany: built.many.template
635
+ };
609
636
  }
610
637
  // src/better-supabase/provider-hook.ts
611
638
  const TEAM_IDS_TRUNCATED = "team_ids_truncated";
@@ -1,16 +1,16 @@
1
1
  import { n as CliError } from "./errors-DgLOqc6j.js";
2
2
  import { i as refuseDirty, t as applyFiles } from "./files-DuV7wRim.js";
3
3
  import { a as rel } from "./files-DAR51W3J.js";
4
- import { t as genFiles } from "./gen-M_5UU5Ck.js";
5
- import { t as projectContext } from "./context-rioF4fQl.js";
6
- import { t as emitPluginFiles } from "./pipeline-BAGSNnct.js";
4
+ import { t as genFiles } from "./gen-CTRqv1H2.js";
5
+ import { t as projectContext } from "./context-CNI2jibq.js";
6
+ import { t as emitPluginFiles } from "./pipeline-DW7cy40F.js";
7
7
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
8
8
  import { S as restatedFacts, c as withDerivedDefaults, o as readParsedConfig, t as configFileIn } from "./config-Dan6vcvj.js";
9
9
  import { c as requirePolicy } from "./load-m7jmit3y.js";
10
10
  import { n as restatedDefaults, r as withoutPath } from "./resolve-config-Cu_mE2wt.js";
11
11
  import { n as writtenPaths, t as configProperty } from "./config-paths-CQvGng3k.js";
12
12
  import { r as removeProperty, t as applyEditsStrict } from "./edits-CqU8s2GC.js";
13
- import { n as commandFor } from "./compile-D-BULiHE.js";
13
+ import { n as commandFor } from "./compile-BFV2WG67.js";
14
14
  import { r as schemaTables, t as restatedSchemaDefaults } from "./schema-tables-Ba9LE_XB.js";
15
15
  import { readFileSync } from "node:fs";
16
16
  // src/cli/codemod/prune-config.ts
@@ -1,10 +1,10 @@
1
1
  import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
3
- import { n as parseSupabaseManifest } from "./manifest-CIWOmdlP.js";
4
- import { o as formatCatalogJson } from "./catalog-doc-D4g3nyFB.js";
3
+ import { n as parseSupabaseManifest } from "./manifest-teSfgeqF.js";
4
+ import { o as formatCatalogJson } from "./catalog-doc-BX97oFAn.js";
5
5
  import { t as catalogPath } from "./catalog-path-bG0XxHMu.js";
6
6
  import { a as describeError } from "./errors-DgLOqc6j.js";
7
- import { o as nonEmptyOr } from "./output-DIjUJioq.js";
7
+ import { o as nonEmptyOr } from "./output-Bfc3EpB2.js";
8
8
  import { s as cliVersion } from "./version-D-jWyJb9.js";
9
9
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
10
10
  import { n as formatManifestJson } from "./manifest-json-DMaBWmcG.js";
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-A1SkxAyb.js";
@@ -3,8 +3,8 @@ import { r as pushedPolicy } from "./pushed-policy-dm_hFstN.js";
3
3
  import { r as isRecord } from "./compact-C4LFuqbW.js";
4
4
  import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
5
5
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
6
- import { n as parseSupabaseManifest } from "./manifest-CIWOmdlP.js";
7
- import { n as runCatalog } from "./catalog-BExjL94D.js";
6
+ import { n as parseSupabaseManifest } from "./manifest-teSfgeqF.js";
7
+ import { n as runCatalog } from "./catalog-SnaPhbZ1.js";
8
8
  import { a as describeError, n as CliError } from "./errors-DgLOqc6j.js";
9
9
  import { n as httpRequest, t as authFailure } from "./http-BbX_Ou3_.js";
10
10
  import { s as cliVersion } from "./version-D-jWyJb9.js";
@@ -1,4 +1,4 @@
1
- import { D as Policy, Fr as Condition, Gn as Grantee, W as WireValidity, b as GrantMeta, dn as SnapshotScope, f as BreakGlassSpec, nr as AppObligation, s as ApprovalRequirement, y as GrantLimit } from "./policy-types-DuM3k5Ao.js";
1
+ import { D as Policy, Fr as Condition, Gn as Grantee, W as WireValidity, b as GrantMeta, dn as SnapshotScope, f as BreakGlassSpec, nr as AppObligation, s as ApprovalRequirement, y as GrantLimit } from "./policy-types-CRWqx8qf.js";
2
2
  import { t as JsonSchemaNode } from "./json-schema-DAeA-lJa.js";
3
3
  /**
4
4
  * One code grant as `permdock cloud push` sends it. `portable: false` marks a
@@ -1,4 +1,4 @@
1
- import { n as authorizeSql } from "./supabase-ByhSqBDB.js";
1
+ import { n as authorizeSql } from "./supabase-CeJAHqZp.js";
2
2
  import { i as configError } from "./errors-DgLOqc6j.js";
3
3
  import { r as relationCondition, t as inheritCondition } from "./grantee-conditions-Dob6QQAc.js";
4
4
  import { c as rootScope, d as scopeList, s as resolveScope } from "./scopes-B-KX9EI8.js";
@@ -10,9 +10,9 @@ import { n as isForbiddenKey } from "./paths-CeS_gpHf.js";
10
10
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
11
11
  import { u as isoAt } from "./time-r0CKBm57.js";
12
12
  import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
13
- import { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-Bbq9e61G.js";
13
+ import { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-CylKSukS.js";
14
14
  import { S as sqlType, a as kindFilterSql, b as idTypeOf, c as roleKindSql, d as subjectClaimSql, f as subjectIdSql, h as CLAIM, i as keyTenantSql, o as liveSessionSql, p as tenantClaimSql, s as memberVia, u as subjectClaimJsonSql } from "./subject-B7p94Y0s.js";
15
- import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, h as memberIdsHelper, l as inheritedRowsHelper, n as CLOSURE, r as graphHelper, x as scopeSources } from "./names-DBxKx2bz.js";
15
+ import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, h as memberIdsHelper, l as inheritedRowsHelper, n as CLOSURE, r as graphHelper, x as scopeSources } from "./names-DwGleRKB.js";
16
16
  import { a as quoteIdent, c as quoteTable, i as qualified, l as textArrayLiteral, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";
17
17
  // src/cli/sql/conditions.ts
18
18
  const MAX_CLAIM_DEPTH = 8;
@@ -1,10 +1,10 @@
1
- import { i as describe } from "../describe-DEoWvk00.js";
2
- import { c as requiredPlans } from "../errors-BliKrfmP.js";
1
+ import { i as describe } from "../describe-DLGEciCs.js";
2
+ import { c as requiredPlans } from "../errors-C35fh_2K.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-gBxeetqY.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BbQb5G_c.js";
6
6
  import { t as onlineRefresh } from "../refresh-online-vtUfV6dk.js";
7
- import { t as PermDockProvider } from "../provider-Clt2095H.js";
8
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-BzsplNgO.js";
9
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-aluQ3R1M.js";
7
+ import { t as PermDockProvider } from "../provider-B22nfOsw.js";
8
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-BGDafbIK.js";
9
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-fRqdlrep.js";
10
10
  export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionOutcome, type PermissionSet, type PermissionState, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -1,10 +1,10 @@
1
- import { i as describe } from "../describe-DEoWvk00.js";
2
- import { c as requiredPlans } from "../errors-BliKrfmP.js";
1
+ import { i as describe } from "../describe-DLGEciCs.js";
2
+ import { c as requiredPlans } from "../errors-C35fh_2K.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-gBxeetqY.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BbQb5G_c.js";
6
6
  import { t as onlineRefresh } from "../refresh-online-vtUfV6dk.js";
7
- import { t as PermDockProvider } from "../lazy-provider-Clt2095H.js";
8
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-BzsplNgO.js";
9
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-aluQ3R1M.js";
7
+ import { t as PermDockProvider } from "../lazy-provider-B22nfOsw.js";
8
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-BGDafbIK.js";
9
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-fRqdlrep.js";
10
10
  export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionOutcome, type PermissionSet, type PermissionState, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../lazy-provider-Clt2095H.js";
1
+ import { t as PermDockProvider } from "../lazy-provider-B22nfOsw.js";
2
2
  export { PermDockProvider };
@@ -1,2 +1,2 @@
1
- import { t as PermDockProvider } from "../provider-Clt2095H.js";
1
+ import { t as PermDockProvider } from "../provider-B22nfOsw.js";
2
2
  export { PermDockProvider };
@@ -1,15 +1,15 @@
1
- import { i as describe } from "../describe-DEoWvk00.js";
1
+ import { i as describe } from "../describe-DLGEciCs.js";
2
2
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
3
- import { c as requiredPlans } from "../errors-BliKrfmP.js";
3
+ import { c as requiredPlans } from "../errors-C35fh_2K.js";
4
4
  import { i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-gBxeetqY.js";
6
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, t as ClientStore, v as TenantView, y as ActionResult } from "../store-core-aluQ3R1M.js";
7
- import { r as ProtectedProps, t as PermDockDefaults } from "../types-BzsplNgO.js";
8
- import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-DoLQFkRb.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, n as Protected, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-BbQb5G_c.js";
6
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, t as ClientStore, v as TenantView, y as ActionResult } from "../store-core-fRqdlrep.js";
7
+ import { r as ProtectedProps, t as PermDockDefaults } from "../types-BGDafbIK.js";
8
+ import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-BE_R-Ish.js";
9
9
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
10
- import { $t as LocalRowColumn, Dr as Membership, Qt as LocalMembershipRows, Sr as CustomRole, en as LocalRowValue, nn as LocalSnapshotRows, qt as Instant, rn as Snapshot, tn as LocalSnapshotManifest, ut as SnapshotSource } from "../policy-types-DuM3k5Ao.js";
10
+ import { $t as LocalRowColumn, Dr as Membership, Qt as LocalMembershipRows, Sr as CustomRole, en as LocalRowValue, nn as LocalSnapshotRows, qt as Instant, rn as Snapshot, tn as LocalSnapshotManifest, ut as SnapshotSource } from "../policy-types-CRWqx8qf.js";
11
11
  import { n as RealtimeRefreshClient, t as RealtimeRefreshChannel } from "../client-V95IvZsF.js";
12
- import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-dtDg4goh.js";
12
+ import { a as SubscribeOnline, i as SubscribeForeground, n as ReactNativePermDockProviderProps, r as SnapshotStorage, t as NativeRevalidate } from "../types-CAGo84uV.js";
13
13
  import { ReactElement } from "react";
14
14
  /**
15
15
  * `true` once the provider has a snapshot to answer from: storage was read or a
@@ -3,9 +3,9 @@ import "./sources-C6Id63F8.js";
3
3
  import { i as configError, n as CliError } from "./errors-DgLOqc6j.js";
4
4
  import { i as refuseDirty, n as fileSummary, t as applyFiles } from "./files-DuV7wRim.js";
5
5
  import { a as loadModule, r as leavesOf, s as pickNamed, t as asPermissionTree } from "./load-m7jmit3y.js";
6
- import { a as resolveAuthorize } from "./rbac-DbyaaNLa.js";
6
+ import { a as resolveAuthorize } from "./rbac-Dx88RLxH.js";
7
7
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
8
- import { n as legacyKeySql } from "./custom-role-rebuild-wzN8pqDk.js";
8
+ import { n as legacyKeySql } from "./custom-role-rebuild-QFXiMHqJ.js";
9
9
  import { n as byKey } from "./compare-8SNJN-9U.js";
10
10
  import { a as quoteIdent, o as quoteLiteral } from "./quote-LNaBdCGA.js";
11
11
  import { a as nameOf, o as nodes, r as child, u as walk } from "./ast-CAOxvn9t.js";
@@ -0,0 +1,3 @@
1
+ import { l as ReplayStore } from "./types-C1jxMZ4q.js";
2
+ declare function memoryReplayStore(): ReplayStore;
3
+ export { memoryReplayStore as t };
@@ -1 +1 @@
1
- export { t as NON_LEAKPROOF_INDEXED_SQL, n as POLICIES_MAX, r as REPORT_POLICIES_SQL, i as TABLE_READ_RULES, a as droppedPolicy, o as policiesFor, s as reportFiles, c as rlsReport, l as runRlsReport } from "./report-XdCm1y_J.js";
1
+ export { t as NON_LEAKPROOF_INDEXED_SQL, n as POLICIES_MAX, r as REPORT_POLICIES_SQL, i as TABLE_READ_RULES, a as droppedPolicy, o as policiesFor, s as reportFiles, c as rlsReport, l as runRlsReport } from "./report-x9GeUvjx.js";
@@ -4,7 +4,7 @@ import { a as rel, o as sqlFiles } from "./files-DAR51W3J.js";
4
4
  import { n as MIGRATION_DIRS } from "./constants-PCJiir_3.js";
5
5
  import { a as parseSqlFile, c as readPolicy, d as sqlCalls, i as isPolicyCommand, t as SqlSyntaxError } from "./ast-Dnm2TOHN.js";
6
6
  import { i as taggedAccessPolicies } from "./bsb-access-Bcw6GrQm.js";
7
- import { a as helperCallKeys, i as callsHelper } from "./helper-calls-B5MOl99d.js";
7
+ import { i as callsHelper, o as helperCallKeys } from "./helper-calls-DN1PJcNY.js";
8
8
  import { n as supabaseDir } from "./supabase-dir-0lxKbrYu.js";
9
9
  import { readFileSync } from "node:fs";
10
10
  import { deparse } from "pgsql-parser";
@@ -1,5 +1,5 @@
1
1
  import { t as assertAppData } from "./app-data-DbSPSPIl.js";
2
- import { t as buildInstance } from "./build-instance-DZEWYO-A.js";
2
+ import { t as buildInstance } from "./build-instance-BGpABVbM.js";
3
3
  import { n as wrapPermDock } from "./wrap-CsfsaJhd.js";
4
4
  // src/core/request-context.ts
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { n as ApprovalUrl, t as ApprovalPrompt } from "../approval-prompt-BKxaKtby.js";
2
- import { d as EmailTransport, o as DeliveryResult, u as EmailMessage } from "../types-D3GI2B9O.js";
3
- import { X as DecisionSink } from "../policy-types-DuM3k5Ao.js";
4
- import { l as ReplayStore } from "../types-Cvfe-G_N.js";
1
+ import { n as ApprovalUrl, t as ApprovalPrompt } from "../approval-prompt-DCC4jp2s.js";
2
+ import { d as EmailTransport, o as DeliveryResult, u as EmailMessage } from "../types-C2GmBHtC.js";
3
+ import { X as DecisionSink } from "../policy-types-CRWqx8qf.js";
4
+ import { l as ReplayStore } from "../types-C1jxMZ4q.js";
5
5
  type ApprovalEmailOptions = {
6
6
  /**
7
7
  * The app's approval page: a base the request id is appended to, or a
@@ -4,12 +4,12 @@ import { d as scopeList } from "./scopes-B-KX9EI8.js";
4
4
  import "./budget-BH81q2cj.js";
5
5
  import "./sources-C6Id63F8.js";
6
6
  import { i as configError } from "./errors-DgLOqc6j.js";
7
- import { t as FIELD_VIEWS } from "./fields-CwFej4gp.js";
8
- import { C as forUserContext, d as permittedByPermissionHelper, et as graphPlan, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-DrrGtayG.js";
7
+ import { t as FIELD_VIEWS } from "./fields-CKX-qjWb.js";
8
+ import { C as forUserContext, d as permittedByPermissionHelper, et as graphPlan, i as tableNames, o as PERMISSION_HELPERS, p as holderSources, s as checkName, w as grantBodies } from "./tables-Dyfviku5.js";
9
9
  import { b as idTypeOf, x as scopeTypeOf } from "./subject-B7p94Y0s.js";
10
- import { S as scopeTable, b as restrictedHelper, c as hasPermittedUsers, f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, i as graphSqlName, l as inheritedRowsHelper, r as graphHelper, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-DBxKx2bz.js";
10
+ import { S as scopeTable, b as restrictedHelper, c as hasPermittedUsers, f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, i as graphSqlName, l as inheritedRowsHelper, r as graphHelper, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-DwGleRKB.js";
11
11
  import { a as quoteIdent, i as qualified, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
12
- import { D as globalRoleRows, m as holderBody } from "./interactive-only-Bbq9e61G.js";
12
+ import { D as globalRoleRows, m as holderBody } from "./interactive-only-CylKSukS.js";
13
13
  // src/cli/rls/permission-holders.ts
14
14
  /**
15
15
  * `permitted_<scope>_users(p_permission, p_id)`. Names are part of the SQL
@@ -1,13 +1,13 @@
1
1
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
2
2
  import { f as nowMillis } from "./time-r0CKBm57.js";
3
- import { l as appOf, u as withApp } from "./permdock-JM9TKevZ.js";
3
+ import { l as appOf, u as withApp } from "./permdock-CbavFN6u.js";
4
4
  import { t as anonymousSubject } from "./subject-DkxY-AhF.js";
5
- import { i as instanceCache, n as memorySubjectCache, r as readSubjectRecord, t as memoryVersionCache } from "./version-cache-Ccrfu2A4.js";
5
+ import { i as instanceCache, n as memorySubjectCache, r as readSubjectRecord, t as memoryVersionCache } from "./version-cache-l9Zrfvhz.js";
6
6
  import { t as readMemberships } from "./read-memberships-DVBitJZG.js";
7
7
  import { a as permissionStates } from "./checks-DSm45qH7.js";
8
8
  import { t as instanceOptions } from "./instance-options-CLErhA76.js";
9
- import { n as versionSources } from "./define-permdock-CO7YNrOF.js";
10
- import { t as buildInstance } from "./build-instance-DZEWYO-A.js";
9
+ import { n as versionSources } from "./define-permdock-B0q7Rg9b.js";
10
+ import { t as buildInstance } from "./build-instance-BGpABVbM.js";
11
11
  import { n as NO_GRANT } from "./decision-hHv4UZgy.js";
12
12
  import { a as hookApiNames } from "./sources-C6Id63F8.js";
13
13
  import { o as subjectFromSupabase } from "./definition-options-DLBlRrPO.js";
@@ -136,9 +136,15 @@ function postgrestSources(client, given = {}) {
136
136
  const batch = wanted.get(memo);
137
137
  wanted.delete(memo);
138
138
  if (batch === void 0) return;
139
- const { authz, roles } = batch;
140
- if (authz === void 0 || roles === void 0 || versionsFn === void 0 || combinedMissing || authz.user !== roles.user) {
141
- if (authz !== void 0) single(authz, "authz");
139
+ const [authz, ...otherAuthz] = batch.authz;
140
+ const pairIndex = authz === void 0 ? -1 : batch.roles.findIndex((want) => want.user === authz.user);
141
+ const roles = pairIndex === -1 ? void 0 : batch.roles[pairIndex];
142
+ const otherRoles = batch.roles.filter((_, index) => index !== pairIndex);
143
+ for (const want of otherAuthz) single(want, "authz");
144
+ for (const want of otherRoles) single(want, "roles");
145
+ if (authz === void 0) return;
146
+ if (roles === void 0 || versionsFn === void 0 || combinedMissing) {
147
+ single(authz, "authz");
142
148
  if (roles !== void 0) single(roles, "roles");
143
149
  return;
144
150
  }
@@ -167,21 +173,26 @@ function postgrestSources(client, given = {}) {
167
173
  });
168
174
  };
169
175
  /**
170
- * A version read of one instance. The user's and the tenant's reads that
171
- * start in the same tick leave as one `versionsFn` call.
176
+ * A version read of one instance. The user's read and the first tenant read
177
+ * for that user that start in the same tick leave as one `versionsFn` call;
178
+ * every other read in that tick leaves on its own.
172
179
  */
173
180
  const versionRpc = (memo, kind, user, tenant) => {
174
181
  if (memo === void 0 || versionsFn === void 0 || combinedMissing) return kind === "authz" ? callRpc(client, schema, versionFn, { p_user: user }) : callRpc(client, schema, rolesVersionFn, { p_tenant: tenant });
175
182
  return new Promise((settle, fail) => {
176
- const batch = wanted.get(memo) ?? { queued: false };
183
+ const batch = wanted.get(memo) ?? {
184
+ authz: [],
185
+ roles: [],
186
+ queued: false
187
+ };
177
188
  const want = {
178
189
  user,
179
190
  ...tenant === void 0 ? {} : { tenant },
180
191
  settle,
181
192
  fail
182
193
  };
183
- if (kind === "authz") batch.authz = want;
184
- else batch.roles = want;
194
+ if (kind === "authz") batch.authz.push(want);
195
+ else batch.roles.push(want);
185
196
  wanted.set(memo, batch);
186
197
  if (!batch.queued) {
187
198
  batch.queued = true;
@@ -301,7 +312,8 @@ function postgrestSources(client, given = {}) {
301
312
  },
302
313
  list,
303
314
  async globalRolesFor(principal, context) {
304
- return [...(await live(principal.id, context?.memo))?.roles ?? []];
315
+ const scopeTo = tenantScoped && context?.tenant !== "" ? context?.tenant : void 0;
316
+ return [...(await live(principal.id, context?.memo, scopeTo))?.roles ?? []];
305
317
  }
306
318
  },
307
319
  customRoles(principal) {
@@ -468,7 +480,11 @@ function createResolver(given) {
468
480
  if (options.subjects !== void 0 && id !== void 0 && known !== void 0) try {
469
481
  await options.subjects.record(id, known);
470
482
  const record = result?.subject === void 0 ? void 0 : readSubjectRecord(result.subject);
471
- if (record?.active === true && (result?.subjectTenant ?? tenant ?? null) === (tenant ?? null) && record.id === id && record.authzVersion === known) await options.subjects.seed(record);
483
+ const restrictedTo = result?.subjectTenant ?? null;
484
+ if (record?.active === true && (restrictedTo ?? tenant ?? null) === (tenant ?? null) && record.id === id && record.authzVersion === known) await options.subjects.seed(restrictedTo === null ? record : {
485
+ ...record,
486
+ tenant: restrictedTo
487
+ });
472
488
  } catch {}
473
489
  const { permdock } = await buildInstance({
474
490
  policy: options.policy,
@@ -2,19 +2,19 @@ import "./sources-C6Id63F8.js";
2
2
  import { a as describeError, f as usageResult, o as exitCodeOfError } from "./errors-DgLOqc6j.js";
3
3
  import { n as openPgPool, r as pgConnector, t as connectPgPool } from "./pg-DmS5ITHu.js";
4
4
  import { i as taggedAccessPolicies } from "./bsb-access-Bcw6GrQm.js";
5
- import { n as resolveSchemas, r as schemasRefusal, t as isSupabaseSchemas } from "./supabase-schemas-CVhpyYB6.js";
6
- import { o as nonEmptyOr } from "./output-DIjUJioq.js";
5
+ import { n as resolveSchemas, r as schemasRefusal, t as isSupabaseSchemas } from "./supabase-schemas-RG58AMTu.js";
6
+ import { o as nonEmptyOr } from "./output-Bfc3EpB2.js";
7
7
  import { n as packageManagerOf, t as addLine } from "./peer-D77JpXe-.js";
8
- import { n as describeExplain, t as runRlsGenerate } from "./generate-CNkkKAL-.js";
9
- import { c as INDEX_COLUMNS_SQL, f as readTableIndexFacts, s as COLUMNS_SQL } from "./compile-D-BULiHE.js";
8
+ import { n as describeExplain, t as runRlsGenerate } from "./generate-DcPnvokU.js";
9
+ import { c as INDEX_COLUMNS_SQL, f as readTableIndexFacts, s as COLUMNS_SQL } from "./compile-BFV2WG67.js";
10
10
  import { r as escapeSqlIdent } from "./sql-T4GaBh9X.js";
11
11
  import { t as beforeFirst } from "./text-D704xHVl.js";
12
- import { a as helperCallKeys, i as callsHelper, t as HELPER_TABLES } from "./helper-calls-B5MOl99d.js";
13
- import { u as isPlatformSchema } from "./report-XdCm1y_J.js";
14
- import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-CwFej4gp.js";
15
- import { a as verifyResult, i as verifyIgnores, n as runRlsVerify, r as rlsFinding } from "./verify-DT9WS_Gm.js";
16
- import { r as parseRbacAuthorize } from "./rbac-DbyaaNLa.js";
17
- import { n as configuredTableReads } from "./table-reads-D0M_X-pj.js";
12
+ import { a as conditionShown, i as callsHelper, o as helperCallKeys, t as HELPER_TABLES } from "./helper-calls-DN1PJcNY.js";
13
+ import { u as isPlatformSchema } from "./report-x9GeUvjx.js";
14
+ import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-CKX-qjWb.js";
15
+ import { a as verifyResult, i as verifyIgnores, n as runRlsVerify, r as rlsFinding } from "./verify-DOCJgGlw.js";
16
+ import { r as parseRbacAuthorize } from "./rbac-Dx88RLxH.js";
17
+ import { n as configuredTableReads } from "./table-reads--NupdCFw.js";
18
18
  import { r as isRecord } from "./compact-C4LFuqbW.js";
19
19
  import { a as rel, o as sqlFiles } from "./files-DAR51W3J.js";
20
20
  import { t as importFromApp } from "./app-peer-BnMh5lqz.js";
@@ -582,7 +582,7 @@ function diffMixed(expected, actual) {
582
582
  if (level !== void 0) {
583
583
  if (level.conditioned) notes.push(rlsFinding("level-unconditioned", policy.table, `${policy.name}/${key}`, `${policy.table}: policy ${policy.name} passes ${key}, which skips the level's row condition, so holders of it are denied there; use ${level.rowHelper}(${policy.table.slice(policy.table.lastIndexOf(".") + 1)}, '${level.permission}')`, "info"));
584
584
  } else if (!permissions.has(key)) drift.push(rlsFinding("undeclared-key", policy.table, `${policy.name}/${key}`, `${policy.table}: policy ${policy.name} passes ${key}, which the policy does not declare, so it always denies`));
585
- else if (conditioned.has(key) && blind.has(key)) drift.push(rlsFinding("condition-blind", policy.table, `${policy.name}/${key}`, `${policy.table}: policy ${policy.name} passes ${key}, whose grants carry row conditions the helpers do not check: the policy grants more than the application does`));
585
+ else if (conditioned.has(key) && blind.has(key) && !conditionShown(policy.expression, key, expected.coverage?.[key])) drift.push(rlsFinding("condition-blind", policy.table, `${policy.name}/${key}`, `${policy.table}: policy ${policy.name} passes ${key}, whose grants carry row conditions the helpers do not check: the policy grants more than the application does`));
586
586
  }
587
587
  }
588
588
  if (expected.readOnlyActors === true) drift.push(...unguardedWrites(actual.policies, ACTOR_MAY_WRITE));
@@ -944,6 +944,7 @@ async function introspectHelpersOnly(db, expected, generated, connect, readOnlyA
944
944
  seeds: generated.seeds ?? [],
945
945
  permissions: generated.keys?.permissions ?? [],
946
946
  rowConditions: generated.keys?.rowConditions ?? [],
947
+ ...generated.keys?.coverage === void 0 ? {} : { coverage: generated.keys.coverage },
947
948
  levels: generated.keys?.levels ?? [],
948
949
  readOnlyActors
949
950
  }, await introspectMixed(db, schema, connect));
@@ -1073,7 +1074,7 @@ async function runRls(input) {
1073
1074
  });
1074
1075
  }
1075
1076
  case "import": {
1076
- const { runRlsImport } = await import("./import-Bz6IKoMM.js");
1077
+ const { runRlsImport } = await import("./import-wBO24zgo.js");
1077
1078
  return runRlsImport({
1078
1079
  cwd: input.cwd,
1079
1080
  config: input.config,