permdock 0.18.0 → 0.19.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 (311) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +6 -6
  3. package/dist/{adoption-scan-CxExBYSJ.js → adoption-scan-C_VQ-J2f.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 +4 -4
  8. package/dist/{approval-normalize-CUjgSsOl.js → approval-normalize-hlfO9BJv.js} +8 -1
  9. package/dist/{approval-policies-oNnckT12.d.ts → approval-policies-CYqdqAob.d.ts} +1 -1
  10. package/dist/{approval-prompt-Bg7gDSqd.d.ts → approval-prompt-BxYbwOAU.d.ts} +1 -1
  11. package/dist/approvals/index.d.ts +4 -4
  12. package/dist/approvals/index.js +3 -3
  13. package/dist/{approvals-DGId_hgJ.js → approvals-CuXILe52.js} +9 -6
  14. package/dist/{arazzo--riLuGY0.js → arazzo-4vfaXj0U.js} +2 -2
  15. package/dist/{arazzo-CEDbb-uM.js → arazzo-Dc969CA2.js} +1 -1
  16. package/dist/astro/index.d.ts +4 -4
  17. package/dist/astro/index.js +2 -2
  18. package/dist/{audience-B4YR9UpV.js → audience-GCXRRAeZ.js} +1 -1
  19. package/dist/authzen/index.d.ts +5 -5
  20. package/dist/authzen/index.js +3 -3
  21. package/dist/{automation-Bfa_wD1h.d.ts → automation-BJiJT_Xr.d.ts} +1 -1
  22. package/dist/better-auth/index.d.ts +1 -1
  23. package/dist/better-auth/index.js +1 -1
  24. package/dist/better-supabase/index.d.ts +20 -17
  25. package/dist/better-supabase/index.js +10 -10
  26. package/dist/{better-supabase-BJtQ-kNf.js → better-supabase-ayun1IKE.js} +38 -4
  27. package/dist/{bind-B4pMH9bm.js → bind-BnKPWRrE.js} +4 -4
  28. package/dist/{bind-DR6ku3A9.d.ts → bind-SpRxR213.d.ts} +7 -7
  29. package/dist/{body-CJQwYVa8.js → body-C9JbIoqb.js} +1 -1
  30. package/dist/{build-instance-BFMFQdE_.js → build-instance-DrIbZVnm.js} +1 -1
  31. package/dist/{capability-BZ_veK9o.d.ts → capability-Ci2S8Cdu.d.ts} +1 -1
  32. package/dist/{casbin-bKC1FpEx.js → casbin-C1TQqWkK.js} +1 -1
  33. package/dist/{casbin-DCQHkkyj.js → casbin-ChbpgfNR.js} +1 -1
  34. package/dist/catalog/index.d.ts +5 -5
  35. package/dist/catalog/index.js +5 -5
  36. package/dist/catalog-BTPySmbp.js +1 -0
  37. package/dist/{catalog-zzNuR3sY.js → catalog-DjDc87R2.js} +1 -1
  38. package/dist/{catalog-doc-C4DGfJCO.js → catalog-doc-nrgfbh8I.js} +2 -1
  39. package/dist/{catalog-D1fw8qif.js → catalog-s0waIrfY.js} +2 -2
  40. package/dist/{challenge-B2O2OLEk.js → challenge-D57I5G1k.js} +1 -1
  41. package/dist/chat/index.d.ts +1 -1
  42. package/dist/chat/index.js +2 -2
  43. package/dist/chat-sdk/index.d.ts +3 -3
  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/index.d.ts +5 -5
  49. package/dist/cli/index.js +3 -3
  50. package/dist/{client-CH7vzSAY.d.ts → client-JK504UCq.d.ts} +15 -2
  51. package/dist/cloud/index.d.ts +8 -8
  52. package/dist/cloud/index.js +2 -2
  53. package/dist/{cloud-C0vXBmLG.js → cloud-Dgj4FiEG.js} +2 -2
  54. package/dist/{codemod-C-L0w-u7.js → codemod-DN_fBt43.js} +2 -2
  55. package/dist/{codemod-eYI1FbeJ.js → codemod-WWxwgM77.js} +1 -1
  56. package/dist/{collect-CU85z6Ta.js → collect-DMQ6Sxr6.js} +2 -2
  57. package/dist/{collect-D878zLDP.js → collect-DN_x7hvV.js} +1 -1
  58. package/dist/collect-eSTXOZDC.js +1 -0
  59. package/dist/compile/index.d.ts +1 -1
  60. package/dist/{compile-DBm0ub4p.d.ts → compile-RaRUQhmD.d.ts} +2 -2
  61. package/dist/{completion-Dauc6pVT.js → completion-DnmUvCw0.js} +1 -1
  62. package/dist/{config-DWp2PucY.js → config-CmuEoob8.js} +1 -1
  63. package/dist/{config-COHmivz9.js → config-D2oXUwos.js} +8 -5
  64. package/dist/{config-report-DKpFm5ID.js → config-report-BVm8Dhbj.js} +2 -2
  65. package/dist/{config-shape-tsxHx71E.js → config-shape-D9paLhEX.js} +5 -1
  66. package/dist/{connection-B72dg5Q2.js → connection-QFsv-kbh.js} +1 -1
  67. package/dist/{context-DeammvFl.js → context-YhyXyqBI.js} +3 -2
  68. package/dist/convex/index.d.ts +4 -4
  69. package/dist/convex/index.js +3 -3
  70. package/dist/{core-D87h2kpR.d.ts → core-DNRWXyj4.d.ts} +2 -2
  71. package/dist/{core-B8sLve3z.js → core-ZIWZBi6-.js} +5 -5
  72. package/dist/{create-BzwjZuRS.d.ts → create-0B_bjJc-.d.ts} +7 -7
  73. package/dist/{create-BrQXL-Wt.d.ts → create-BECB6fns.d.ts} +6 -6
  74. package/dist/{create-C-tm3KIF.js → create-CAZyXZFC.js} +4 -4
  75. package/dist/{create-3A7J9KRR.js → create-CegYmYHu.js} +69 -29
  76. package/dist/{create-CtoT1lIQ.d.ts → create-DJ_5REgN.d.ts} +4 -4
  77. package/dist/decide-set-DXEPepY1.js +100 -0
  78. package/dist/{delegation-input-FTxMK3ji.js → delegation-input-DcXhiMkf.js} +1 -1
  79. package/dist/delivery/index.d.ts +4 -4
  80. package/dist/delivery/index.js +1 -1
  81. package/dist/{denied-text-DlIxt8fh.d.ts → denied-text-CF-2h8Vz.d.ts} +1 -1
  82. package/dist/{describe-BKtC_8PG.d.ts → describe-DyN-HX6o.d.ts} +1 -1
  83. package/dist/{diff-BnNHqtHj.js → diff-BOU7sSnv.js} +4 -4
  84. package/dist/{diff-CBCzOTWM.js → diff-BrmvcPXk.js} +1 -1
  85. package/dist/{doctor-CkYKCuX7.js → doctor-BhhNMkU8.js} +242 -65
  86. package/dist/{doctor-xUpR5rXg.js → doctor-CL1OigyD.js} +15 -5
  87. package/dist/drizzle/index.d.ts +3 -3
  88. package/dist/elysia/index.d.ts +4 -4
  89. package/dist/elysia/index.js +4 -4
  90. package/dist/{errors-TpzkEKgJ.d.ts → errors-POWcCXy7.d.ts} +1 -1
  91. package/dist/{errors-B6R_lg2a.js → errors-ynga1EQy.js} +1 -1
  92. package/dist/{evaluate-Czbj7thS.js → evaluate-CrKkjgXS.js} +2 -2
  93. package/dist/{evaluations-CisTTURl.d.ts → evaluations--rkKhMqY.d.ts} +3 -3
  94. package/dist/{evaluations-h3KoJAPa.js → evaluations-CNMVJVD6.js} +3 -3
  95. package/dist/eve/index.d.ts +4 -4
  96. package/dist/eve/index.js +3 -3
  97. package/dist/express/index.d.ts +4 -4
  98. package/dist/express/index.js +3 -3
  99. package/dist/fastify/index.d.ts +4 -4
  100. package/dist/fastify/index.js +3 -3
  101. package/dist/{fetch-adapter-DH-NJPbL.js → fetch-adapter-Bm1iZolz.js} +3 -3
  102. package/dist/{fetch-adapter-BdmfnbJM.d.ts → fetch-adapter-Bq4AB3W2.d.ts} +2 -2
  103. package/dist/{fields-CrjL6A49.js → fields-COvJbUva.js} +1 -1
  104. package/dist/{from-snapshot-DMlSSo9b.js → from-snapshot-DHnb8Fh4.js} +2 -2
  105. package/dist/{gen-mf-MRwVr.js → gen-D0NqzeOP.js} +2 -2
  106. package/dist/{gen-BEIN-DRM.js → gen-DonXr9Hg.js} +1 -1
  107. package/dist/h3/index.d.ts +4 -4
  108. package/dist/h3/index.js +3 -3
  109. package/dist/{helpers-DmqGy63f.js → helpers-D-MXwkOF.js} +28 -4
  110. package/dist/hono/index.d.ts +4 -4
  111. package/dist/hono/index.js +5 -5
  112. package/dist/{hosted-BFNXwcjd.d.ts → hosted-H1xp5Dfw.d.ts} +1 -1
  113. package/dist/{hosted-waouw2V-.js → hosted-iOGBI_ER.js} +4 -3
  114. package/dist/{import-C1XXpG_m.js → import-C8ffNykt.js} +2 -2
  115. package/dist/{import-DObwEota.js → import-DNaFHm53.js} +1 -1
  116. package/dist/{index-CVGio3cH.d.ts → index-B9-ZXNa-.d.ts} +4 -4
  117. package/dist/{index-BhnOOnp9.d.ts → index-C2pmTzFx.d.ts} +2 -2
  118. package/dist/{index-Dfv9Toct.d.ts → index-C5Tfpjex.d.ts} +1 -1
  119. package/dist/{index-CdUTE6qd.d.ts → index-Cm6mHTZ-.d.ts} +16 -10
  120. package/dist/{index-rFp6X_QP.d.ts → index-DLlWORcK.d.ts} +5 -5
  121. package/dist/{index-CdMOd-GY.d.ts → index-DZnpRB0q.d.ts} +24 -6
  122. package/dist/index.d.ts +17 -17
  123. package/dist/index.js +15 -15
  124. package/dist/{init-DS3PEsCG.js → init-4aRjat-S.js} +3 -3
  125. package/dist/{init-CNJ8lLjo.js → init-QfBfkrGu.js} +1 -1
  126. package/dist/{instance-options-2sFGSdsf.d.ts → instance-options-D6hyIKJF.d.ts} +1 -1
  127. package/dist/{instance-snapshot-BWa71my8.js → instance-snapshot-DXxcizAb.js} +3 -3
  128. package/dist/jwt/index.d.ts +4 -4
  129. package/dist/{kernel-30Z2zM_d.js → kernel-B2UCK36Z.js} +7 -7
  130. package/dist/kysely/index.d.ts +3 -3
  131. package/dist/{login-DUVzBLh7.js → login-Cg1la2yJ.js} +3 -3
  132. package/dist/{login-BgK5Jloo.js → login-lPtJIjbO.js} +1 -1
  133. package/dist/{manifest-wclLWBVH.js → manifest-CDhdXgf6.js} +38 -37
  134. package/dist/{map-error-BH16Ah8P.js → map-error-EOhahOVA.js} +3 -3
  135. package/dist/mcp/index.d.ts +57 -17
  136. package/dist/mcp/index.js +199 -53
  137. package/dist/{module-values-B8tNIxdd.js → module-values-BYuNtdK5.js} +1 -1
  138. package/dist/nest/index.d.ts +4 -4
  139. package/dist/nest/index.js +5 -5
  140. package/dist/next/index.d.ts +12 -12
  141. package/dist/next/index.js +8 -8
  142. package/dist/next/plugin.d.ts +1 -1
  143. package/dist/next/plugin.js +1 -1
  144. package/dist/node/index.d.ts +4 -4
  145. package/dist/node/index.js +2 -2
  146. package/dist/openai/index.d.ts +4 -4
  147. package/dist/openai/index.js +3 -3
  148. package/dist/openapi/index.d.ts +2 -2
  149. package/dist/{openapi-C4gFqeRz.js → openapi-C3BIVLTd.js} +2 -2
  150. package/dist/{openapi-zMEB9qxn.js → openapi-Cr0B3p2h.js} +2 -2
  151. package/dist/orpc/index.d.ts +21 -17
  152. package/dist/orpc/index.js +18 -11
  153. package/dist/otel/index.d.ts +3 -3
  154. package/dist/{output-BFWLER4r.js → output-DYq_o2dM.js} +1 -1
  155. package/dist/{ownership-D-mIt-w0.js → ownership-CrmMERZv.js} +1 -1
  156. package/dist/{parse-UTC-sDrt.js → parse-CXTT7hBq.js} +1 -1
  157. package/dist/{parse-local-manifest-DvjTQNuO.d.ts → parse-local-manifest-CQjRmzrw.d.ts} +1 -1
  158. package/dist/{parse-local-manifest-CxcSMQgl.js → parse-local-manifest-Ce2N-Opr.js} +1 -1
  159. package/dist/pdp/index.d.ts +3 -3
  160. package/dist/pdp/index.js +2 -2
  161. package/dist/{permdock-ffY4CMd9.d.ts → permdock-B45vPQb4.d.ts} +4 -4
  162. package/dist/{permdock-D-_WrdKu.js → permdock-DeOfonuG.js} +6 -6
  163. package/dist/{permissions-B3ggI88M.js → permissions-Rk9_Gm04.js} +1 -1
  164. package/dist/{policy-cV_wwPb8.js → policy-DTmkP72P.js} +2 -2
  165. package/dist/{policy-from-catalog-B68hGC0S.js → policy-from-catalog-Cljh_B5H.js} +6 -6
  166. package/dist/{policy-BtKSApSt.d.ts → policy-re2Oag8s.d.ts} +1 -1
  167. package/dist/{policy-types-D-GwfQTc.d.ts → policy-types-Ky7P23CP.d.ts} +24 -2
  168. package/dist/{postgrest-D84p5dbA.d.ts → postgrest-pwxeaeOW.d.ts} +1 -1
  169. package/dist/powersync-B96MUB_Q.js +1 -0
  170. package/dist/{powersync-9PYOE1wt.js → powersync-BoqBik-G.js} +77 -38
  171. package/dist/{powersync-DStC_g0B.js → powersync-PKC4yT62.js} +2 -2
  172. package/dist/prisma/index.d.ts +2 -2
  173. package/dist/{problem-BVLHFK33.js → problem-BWP1l86g.js} +8 -7
  174. package/dist/{protected-action-B40tU3yP.js → protected-action-CD1HXwQK.js} +2 -2
  175. package/dist/{protected-action-Ds_EUY8B.d.ts → protected-action-DHPqBLhz.d.ts} +5 -5
  176. package/dist/{provider-OtnIiFWm.d.ts → provider-C-CbGEii.d.ts} +1 -1
  177. package/dist/{provider-CY4TSSJo.js → provider-qESIf_C0.js} +5 -2
  178. package/dist/{provider-store-BQP_pp8s.js → provider-store-BTHGJH9j.js} +3 -2
  179. package/dist/pull-BjdsS9x1.js +1 -0
  180. package/dist/{pull-DLP4I1Kl.js → pull-FG0Tf8aF.js} +3 -3
  181. package/dist/{push-BSb8j1EW.js → push-CI5G7lRS.js} +3 -3
  182. package/dist/{pushed-policy-Ck3FZcoy.d.ts → pushed-policy-B94r9DlN.d.ts} +1 -1
  183. package/dist/{pushed-policy-BecMsTtM.js → pushed-policy-DftSiyD3.js} +1 -1
  184. package/dist/react/index.d.ts +6 -6
  185. package/dist/react/index.js +3 -3
  186. package/dist/react/provider-client.d.ts +1 -1
  187. package/dist/react/provider-client.js +1 -1
  188. package/dist/react-native/index.d.ts +28 -14
  189. package/dist/react-native/index.js +57 -37
  190. package/dist/{replay-E5X9E1lC.d.ts → replay-BqmXcP7x.d.ts} +1 -1
  191. package/dist/{request-context-DM6_jY1n.js → request-context-uvaevbBu.js} +1 -1
  192. package/dist/resend/index.d.ts +4 -4
  193. package/dist/resend/index.js +2 -2
  194. package/dist/{resolve-names-CBl4r4_r.js → resolve-names-Dg8560iu.js} +2 -2
  195. package/dist/{rls-DGBL-jDY.js → rls-CJbWbxXv.js} +19 -13
  196. package/dist/{rls-pAHGYgTb.js → rls-DJSczevJ.js} +1 -1
  197. package/dist/{role-builder-CMW4wWzn.js → role-builder-C_2kWB_x.js} +1 -1
  198. package/dist/rpc-D7cDHIVE.d.ts +22 -0
  199. package/dist/{rpc-KwX_Jcxz.js → rpc-m5hPklf-.js} +16 -6
  200. package/dist/run-4m-TyVTD.js +1 -0
  201. package/dist/{run-B7lv3NuK.js → run-BigMDvGR.js} +3 -3
  202. package/dist/{run-ticket-DPaD27_r.d.ts → run-ticket-DRA3POCY.d.ts} +2 -2
  203. package/dist/{saas-B8H1MsQ3.js → saas-BHeoBqbW.js} +4 -4
  204. package/dist/{scan-0r3OZqqK.js → scan-BKLwCSVV.js} +1 -1
  205. package/dist/{schema-CuX70xgH.js → schema-BlnU_TzE.js} +4 -0
  206. package/dist/{schema-B_9tXrbG.js → schema-CLuBlCCr.js} +1 -1
  207. package/dist/scim/index.d.ts +1 -1
  208. package/dist/server/index.d.ts +10 -10
  209. package/dist/server/index.js +5 -5
  210. package/dist/{server-types-3OnXjZ2D.d.ts → server-types-CwpJe664.d.ts} +31 -13
  211. package/dist/{sink-ogbVkyeo.d.ts → sink-7Lrch8dn.d.ts} +2 -2
  212. package/dist/{skills-B4MPRxQd.js → skills-CyD_3eoi.js} +1 -1
  213. package/dist/{skills-C9sTD70r.js → skills-D42EyC8G.js} +1 -1
  214. package/dist/{snapshot-DN_8J27z.js → snapshot-DHPih65J.js} +2 -1
  215. package/dist/{snapshot-cache-B4YvlGG_.d.ts → snapshot-cache-B9weL8NE.d.ts} +1 -1
  216. package/dist/solid/index.d.ts +5 -5
  217. package/dist/solid/index.js +3 -2
  218. package/dist/solid-start/index.d.ts +4 -4
  219. package/dist/solid-start/index.js +3 -3
  220. package/dist/{sources-xdQShLDU.d.ts → sources-4d3fl7cq.d.ts} +1 -1
  221. package/dist/{src-Brzq_0in.js → src-HDDf9Eum.js} +28 -13
  222. package/dist/ssf/index.d.ts +3 -3
  223. package/dist/ssf/index.js +2 -2
  224. package/dist/{standard-webhooks-BfPaZ6T1.d.ts → standard-webhooks-BGi8pUwo.d.ts} +2 -2
  225. package/dist/{store-DmVqy74I.js → store-CSOsXd5s.js} +8 -6
  226. package/dist/{store-DYeB-_U3.d.ts → store-CjJaZI_g.d.ts} +31 -4
  227. package/dist/{store-options--zWn48PK.js → store-options-CDvoX52-.js} +31 -8
  228. package/dist/{stores-EPul_8MN.d.ts → stores-Cam6GGAV.d.ts} +5 -5
  229. package/dist/{stores-BYFopOm1.js → stores-PpYVQ5yF.js} +1 -1
  230. package/dist/{stream-CDvF0sJm.js → stream-DQ3rbO3J.js} +1 -1
  231. package/dist/supabase/client.d.ts +1 -1
  232. package/dist/supabase/client.js +32 -4
  233. package/dist/supabase/index.d.ts +10 -5
  234. package/dist/supabase/index.js +1 -1
  235. package/dist/supabase/middleware.d.ts +5 -5
  236. package/dist/supabase/middleware.js +5 -5
  237. package/dist/{supabase-BiViJpQ4.js → supabase-CVZuytCC.js} +2 -2
  238. package/dist/{supabase-CogTyJH2.js → supabase-DBuZK2pP.js} +2 -2
  239. package/dist/supabase-hook-2M-EpoRp.js +1 -0
  240. package/dist/{supabase-hook-DX38Hj8h.js → supabase-hook-Btk56XD6.js} +151 -55
  241. package/dist/{supautils-BGf6zRvM.js → supautils-lwXmXPP_.js} +7 -7
  242. package/dist/svelte/index.d.ts +5 -5
  243. package/dist/svelte/index.js +3 -3
  244. package/dist/svelte/runtime.d.ts +3 -3
  245. package/dist/svelte/runtime.js +1 -1
  246. package/dist/svelte/source.d.ts +5 -5
  247. package/dist/svelte/source.js +2 -2
  248. package/dist/sveltekit/index.d.ts +4 -4
  249. package/dist/sveltekit/index.js +2 -2
  250. package/dist/{tables-BfOk0ymL.js → tables-B72q9UFD.js} +1 -1
  251. package/dist/tanstack-start/index.d.ts +4 -4
  252. package/dist/tanstack-start/index.js +2 -2
  253. package/dist/terminal/index.d.ts +5 -5
  254. package/dist/terminal/index.js +4 -4
  255. package/dist/testing/core.d.ts +1 -1
  256. package/dist/testing/core.js +1 -1
  257. package/dist/testing/fixtures/index.d.ts +1 -1
  258. package/dist/testing/fixtures/index.js +1 -1
  259. package/dist/testing/index.d.ts +23 -23
  260. package/dist/testing/index.js +22 -22
  261. package/dist/testing/saas/index.d.ts +3 -3
  262. package/dist/testing/saas/index.js +2 -2
  263. package/dist/testing/saas/permissions.js +1 -1
  264. package/dist/trpc/index.d.ts +15 -8
  265. package/dist/trpc/index.js +23 -19
  266. package/dist/{type-helpers-i1EJ3Eb1.d.ts → type-helpers-CDxxNswo.d.ts} +1 -1
  267. package/dist/{types-CqcsNCaN.d.ts → types--HfnkawU.d.ts} +13 -1
  268. package/dist/{types-NYoj8JBm.d.ts → types-7Vlz1Wi2.d.ts} +1 -0
  269. package/dist/{types-B8qUkGja.d.ts → types-BVn1w_0o.d.ts} +2 -2
  270. package/dist/{types-DmbfLu2p.d.ts → types-BlYPxJDR.d.ts} +9 -4
  271. package/dist/{types-D19MK4t-.d.ts → types-Bwdumeos.d.ts} +3 -3
  272. package/dist/{types-3Y8UpFkF.d.ts → types-BwuNGQRm.d.ts} +68 -4
  273. package/dist/{types-D-JO7lh8.d.ts → types-CChFKY10.d.ts} +5 -5
  274. package/dist/{types-CDVXR6YD.d.ts → types-Do4yihST.d.ts} +1 -1
  275. package/dist/{types-CCEeSCMB.d.ts → types-Do8qBcRO.d.ts} +3 -3
  276. package/dist/{types-o1vu6Ks3.d.ts → types-OLSfBLa5.d.ts} +4 -4
  277. package/dist/{types-DGf_cpKF.d.ts → types-g0Vk9k2c.d.ts} +2 -2
  278. package/dist/{types-Ck1KOfug.d.ts → types-oaqeYKQu.d.ts} +2 -2
  279. package/dist/unplugin/index.d.ts +1 -1
  280. package/dist/unplugin/index.js +1 -1
  281. package/dist/{usage-DYtRVkcN.js → usage-BLhhEPcZ.js} +1 -1
  282. package/dist/{usage-DC0UKe6C.js → usage-C-wta3rx.js} +4 -4
  283. package/dist/usage-Csc_ZRd0.js +1 -0
  284. package/dist/{validation-error-Dx8PipbO.d.ts → validation-error-AhCHeeff.d.ts} +1 -1
  285. package/dist/{verify-Bpj0hauG.js → verify-CaaZlnP5.js} +78 -57
  286. package/dist/{version-cache-DzNKWiI6.d.ts → version-cache-Ddvrfn1R.d.ts} +1 -1
  287. package/dist/vue/index.d.ts +5 -5
  288. package/dist/vue/index.js +2 -2
  289. package/dist/{waiter-NK_UuZbb.d.ts → waiter-CROiWRIP.d.ts} +2 -2
  290. package/dist/watch-CS69ftMP.js +1 -0
  291. package/dist/{watch-CBHADqBH.js → watch-Dz2LNM1R.js} +2 -2
  292. package/dist/webmcp/index.d.ts +1 -1
  293. package/dist/{where-scope-BKrqUDVk.js → where-scope-BAyOsPQW.js} +1 -1
  294. package/dist/{who-can-KhVWMxtf.js → who-can-jPfTABf-.js} +1 -1
  295. package/dist/workflow/index.d.ts +3 -3
  296. package/dist/workflow/index.js +2 -2
  297. package/dist/workflow-sdk/index.d.ts +4 -4
  298. package/dist/{wrap-BHGA-SMM.d.ts → wrap-C-4o-Dpy.d.ts} +2 -2
  299. package/package.json +1 -1
  300. package/schemas/catalog-v1.json +8 -0
  301. package/skills/permdock-agents/references/runtimes.md +2 -2
  302. package/skills/permdock-wire/references/adapters.md +1 -1
  303. package/dist/catalog-Caqhbdix.js +0 -1
  304. package/dist/collect-KCtOigxx.js +0 -1
  305. package/dist/powersync-xNRlC4jN.js +0 -1
  306. package/dist/pull-UBjDnf4b.js +0 -1
  307. package/dist/run-UPbacxPg.js +0 -1
  308. package/dist/stream-W2RuUYly.d.ts +0 -13
  309. package/dist/supabase-hook-BN46IrVI.js +0 -1
  310. package/dist/usage-Cl5eb-e1.js +0 -1
  311. package/dist/watch-OYwAPCzx.js +0 -1
@@ -9,11 +9,39 @@ import { r as authzUserTopic, t as AUTHZ_EVENT } from "../authz-topic-Dbc-HDOS.j
9
9
  */
10
10
  function supabaseRealtimeRefresh(client, options) {
11
11
  return (refresh) => {
12
- const channel = client.channel(authzUserTopic(options.userId), { config: { private: true } });
13
- channel.on("broadcast", { event: AUTHZ_EVENT }, refresh);
14
- channel.subscribe();
12
+ let stopped = false;
13
+ const onChange = () => {
14
+ if (!stopped) refresh();
15
+ };
16
+ const shared = options.channel;
17
+ if (shared !== void 0) shared.on("broadcast", { event: AUTHZ_EVENT }, onChange);
18
+ const open = () => {
19
+ if (shared !== void 0) return;
20
+ const channel = client.channel(authzUserTopic(options.userId), { config: { private: true } });
21
+ channel.on("broadcast", { event: AUTHZ_EVENT }, onChange);
22
+ channel.subscribe();
23
+ return channel;
24
+ };
25
+ let owned = open();
26
+ const close = () => {
27
+ if (owned !== void 0) {
28
+ client.removeChannel(owned);
29
+ owned = void 0;
30
+ }
31
+ };
32
+ const offForeground = options.foreground?.((active) => {
33
+ if (stopped) return;
34
+ if (active === false) {
35
+ close();
36
+ return;
37
+ }
38
+ owned ??= open();
39
+ refresh();
40
+ });
15
41
  return () => {
16
- client.removeChannel(channel);
42
+ stopped = true;
43
+ offForeground?.();
44
+ close();
17
45
  };
18
46
  };
19
47
  }
@@ -1,8 +1,8 @@
1
- import { Kt as Instant, yr as Subject } from "../policy-types-D-GwfQTc.js";
2
- import { i as ApprovalPolicySource } from "../approval-policies-oNnckT12.js";
3
- import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types-CqcsNCaN.js";
4
- import { a as SupabaseRpcClient, c as readSubjectRecord, i as SupabaseRpcCaller, n as PostgrestSourcesOptions, o as SupabaseRpcResult, r as SubjectRecord, s as postgrestSources, t as PostgrestSources } from "../postgrest-D84p5dbA.js";
5
- import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-xdQShLDU.js";
1
+ import { qt as Instant, xr as Subject } from "../policy-types-Ky7P23CP.js";
2
+ import { i as ApprovalPolicySource } from "../approval-policies-CYqdqAob.js";
3
+ import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types--HfnkawU.js";
4
+ import { a as SupabaseRpcClient, c as readSubjectRecord, i as SupabaseRpcCaller, n as PostgrestSourcesOptions, o as SupabaseRpcResult, r as SubjectRecord, s as postgrestSources, t as PostgrestSources } from "../postgrest-pwxeaeOW.js";
5
+ import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-4d3fl7cq.js";
6
6
  import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-B5yF3CIq.js";
7
7
  import { t as SqlQuery } from "../sql-B80DFdpG.js";
8
8
  import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-CNLsV2SL.js";
@@ -87,6 +87,11 @@ type TableApprovalPolicySourceOptions = {
87
87
  * `permdock`, where `rls.approvals.tenantPolicies` writes it.
88
88
  */
89
89
  readonly schema?: string;
90
+ /**
91
+ * The function to call, when `rls.approvals.tenantPolicies.function` renames
92
+ * it. Defaults to `permdock_approval_policies_for`.
93
+ */
94
+ readonly function?: string;
90
95
  };
91
96
  /**
92
97
  * Approval policies from the table `rls.approvals.tenantPolicies` generates:
@@ -1,6 +1,6 @@
1
1
  import { n as AUTHZ_TOPIC, r as authzUserTopic, t as AUTHZ_EVENT } from "../authz-topic-Dbc-HDOS.js";
2
2
  import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-BBCPDOGP.js";
3
- import { a as supabaseApprovalStore, i as tableApprovalPolicySource, n as supabaseRls, o as supabaseClaims, r as tableApprovalDelegationSource, s as exchangeCapability, t as authorizeSql } from "../supabase-BiViJpQ4.js";
3
+ import { a as supabaseApprovalStore, i as tableApprovalPolicySource, n as supabaseRls, o as supabaseClaims, r as tableApprovalDelegationSource, s as exchangeCapability, t as authorizeSql } from "../supabase-CVZuytCC.js";
4
4
  import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-C4vkzZJV.js";
5
5
  import { a as delegationOf, c as subjectFromSupabaseSession, i as actorOf, n as postgrestSources, r as readSubjectRecord, s as subjectFromSupabase } from "../postgrest-BrjrckDG.js";
6
6
  import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-BdzBobNK.js";
@@ -1,10 +1,10 @@
1
- import { E as Policy, M as PolicyVocabulary, _r as Principal, yr as Subject } from "../policy-types-D-GwfQTc.js";
1
+ import { D as Policy, N as PolicyVocabulary, xr as Subject, yr as Principal } from "../policy-types-Ky7P23CP.js";
2
2
  import { u as Permission } from "../permission-types-CAY-GU7e.js";
3
- import { a as PermDock } from "../permdock-ffY4CMd9.js";
4
- import { t as InstanceOptions } from "../instance-options-2sFGSdsf.js";
3
+ import { a as PermDock } from "../permdock-B45vPQb4.js";
4
+ import { t as InstanceOptions } from "../instance-options-D6hyIKJF.js";
5
5
  import { t as RequestContext } from "../request-context-C2_1lchh.js";
6
- import { i as OpenApiHooks } from "../server-types-3OnXjZ2D.js";
7
- import { n as ServerAdapterServices } from "../bind-DR6ku3A9.js";
6
+ import { i as OpenApiHooks } from "../server-types-CwpJe664.js";
7
+ import { n as ServerAdapterServices } from "../bind-SpRxR213.js";
8
8
  import { FetchHandler, Middleware } from "@supabase/middleware";
9
9
  //#region src/supabase/middleware.d.ts
10
10
  /**
@@ -1,11 +1,11 @@
1
1
  import { t as compact } from "../compact-CAf557ZB.js";
2
- import { l as withApp } from "../permdock-D-_WrdKu.js";
2
+ import { l as withApp } from "../permdock-DeOfonuG.js";
3
3
  import { t as composeWraps } from "../wrap-C5PWzgkq.js";
4
4
  import { r as credentialSubject } from "../credential-B3Hj4puZ.js";
5
- import { o as methodNotAllowed } from "../problem-BVLHFK33.js";
6
- import { r as instanceOptions } from "../build-instance-BFMFQdE_.js";
7
- import { t as createPermDock$1 } from "../create-3A7J9KRR.js";
8
- import { n as attached } from "../bind-B4pMH9bm.js";
5
+ import { o as methodNotAllowed } from "../problem-BWP1l86g.js";
6
+ import { r as instanceOptions } from "../build-instance-DrIbZVnm.js";
7
+ import { t as createPermDock$1 } from "../create-CegYmYHu.js";
8
+ import { n as attached } from "../bind-BnKPWRrE.js";
9
9
  import { defineMiddleware } from "@supabase/middleware";
10
10
  //#region src/supabase/middleware.ts
11
11
  const SECRET_KEY_NAME = /^[A-Za-z0-9_-]+$/u;
@@ -2,7 +2,7 @@ import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
2
2
  import { d as isoNow, i as dateAt, p as nowSeconds, u as isoAt } from "./time-nR1JesoH.js";
3
3
  import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
4
4
  import { s as ApprovalError } from "./types-CcUXciSj.js";
5
- import { c as decodeApprovalCursor, l as encodeApprovalCursor, s as approvalPageSize, t as applyApprovalVerdict } from "./store-DmVqy74I.js";
5
+ import { c as decodeApprovalCursor, l as encodeApprovalCursor, s as approvalPageSize, t as applyApprovalVerdict } from "./store-CSOsXd5s.js";
6
6
  import { a as parseCapability } from "./capability-zN6T9fxe.js";
7
7
  import { t as loadJose } from "./load-jose-DZ4dnjri.js";
8
8
  import "./budget-BBCPDOGP.js";
@@ -351,7 +351,7 @@ function rowsOf$1(result) {
351
351
  * until it is fixed.
352
352
  */
353
353
  function tableApprovalPolicySource(options) {
354
- const fn = quoteQualifiedTable(`${options.schema ?? "permdock"}.permdock_approval_policies_for`);
354
+ const fn = quoteQualifiedTable(`${options.schema ?? "permdock"}.${options.function ?? "permdock_approval_policies_for"}`);
355
355
  return {
356
356
  name: "table",
357
357
  async approvalPoliciesFor(query) {
@@ -47,7 +47,7 @@ const hookGenerate = defineLeaf({
47
47
  const budget = given(flags.budget);
48
48
  const schema = given(flags.schema);
49
49
  const grantsOut = given(flags["grants-out"]);
50
- const { runSupabase } = await import("./supabase-hook-BN46IrVI.js");
50
+ const { runSupabase } = await import("./supabase-hook-2M-EpoRp.js");
51
51
  return runSupabase({
52
52
  cwd: ctx.cwd,
53
53
  config: ctx.config,
@@ -76,7 +76,7 @@ const inspect = defineLeaf({
76
76
  },
77
77
  async run(ctx, { flags }) {
78
78
  const out = flags.out === "" ? true : flags.out === "-" ? void 0 : flags.out;
79
- const { runSupabase } = await import("./supabase-hook-BN46IrVI.js");
79
+ const { runSupabase } = await import("./supabase-hook-2M-EpoRp.js");
80
80
  return runSupabase({
81
81
  cwd: ctx.cwd,
82
82
  config: ctx.config,
@@ -0,0 +1 @@
1
+ export { i as runSupabase } from "./supabase-hook-Btk56XD6.js";
@@ -10,7 +10,7 @@ import { c as requirePolicy } from "./load-BaEamml-.js";
10
10
  import "./budget-BBCPDOGP.js";
11
11
  import { i as qualifySqlTable } from "./sql-0WjxIp9g.js";
12
12
  import { i as scopeColumn } from "./compile-B_oJqmIg.js";
13
- import { t as authorizeSql } from "./supabase-BiViJpQ4.js";
13
+ import { t as authorizeSql } from "./supabase-CVZuytCC.js";
14
14
  import { a as hookApiNames, d as keptKeys, t as AUTHZ_VERSION_TABLE, u as roleManifest } from "./sources-C4vkzZJV.js";
15
15
  import { o as readMemberships } from "./postgrest-BrjrckDG.js";
16
16
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
@@ -18,14 +18,14 @@ import { n as GRANTS_MARKER, r as HOOK_MARKER, s as hookMarkerFields } from "./m
18
18
  import { n as formatManifestJson, t as MANIFEST_FILE } from "./manifest-json-CAGzls-C.js";
19
19
  import { n as MIGRATION_DIRS } from "./constants-DcJABbLW.js";
20
20
  import { f as writeOutputFiles, l as partPath, r as driftOf, u as pgDeltaPath } from "./output-files-CM0BnH05.js";
21
+ import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
21
22
  import { A as quoteQualified, D as qualified, F as firstScopeType, I as scopeTypeOf, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, l as USER_ID_HELPER, r as HELPERS, y as subjectIdSql } from "./shared-DyYVEjKC.js";
22
- import { E as TOKEN_SCOPE_ALLOWS, J as apiKeyFields, K as API_KEY_ALLOWS, R as globalRoleSource, _ as PERMISSION_HELPERS, at as memberForHelper, b as permissionKeysForHelper, bt as checkSuspension, ct as memberIdsHelper, dt as permittedForHelper, et as hasMemberFor, ft as permittedIdsHelper, g as OWNERSHIP, h as ASSIGNMENTS, lt as memberOfHelper, ot as memberForSources, rt as isTeamScope, st as memberForTable, tt as hasPermittedUsers, ut as memberRoleOf, v as checkName, vt as activeRowSql, x as permittedByPermissionHelper } from "./tables-BfOk0ymL.js";
23
- import { a as guardedTables, t as ownershipRules, u as roleNames } from "./ownership-D-mIt-w0.js";
23
+ import { E as TOKEN_SCOPE_ALLOWS, J as apiKeyFields, K as API_KEY_ALLOWS, R as globalRoleSource, _ as PERMISSION_HELPERS, at as memberForHelper, b as permissionKeysForHelper, bt as checkSuspension, ct as memberIdsHelper, dt as permittedForHelper, et as hasMemberFor, ft as permittedIdsHelper, g as OWNERSHIP, h as ASSIGNMENTS, lt as memberOfHelper, ot as memberForSources, rt as isTeamScope, st as memberForTable, tt as hasPermittedUsers, ut as memberRoleOf, v as checkName, vt as activeRowSql, x as permittedByPermissionHelper } from "./tables-B72q9UFD.js";
24
+ import { a as guardedTables, t as ownershipRules, u as roleNames } from "./ownership-CrmMERZv.js";
24
25
  import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
25
26
  import { a as splitUndiffed, r as tableKey, t as decidingColumns } from "./deciding-columns-NB4wcyBf.js";
26
- import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
27
- import { c as ACTOR_MAY_WRITE, f as readOnlyActorKinds } from "./fields-CrjL6A49.js";
28
- import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-CBl4r4_r.js";
27
+ import { c as ACTOR_MAY_WRITE, f as readOnlyActorKinds } from "./fields-COvJbUva.js";
28
+ import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-Dg8560iu.js";
29
29
  import { existsSync, readFileSync, readdirSync } from "node:fs";
30
30
  import { dirname, join, posix, resolve } from "node:path";
31
31
  //#region ../../node_modules/.pnpm/smol-toml@1.9.1/node_modules/smol-toml/dist/error.js
@@ -1398,14 +1398,20 @@ function helpersDefined(sql, schema) {
1398
1398
  }
1399
1399
  /**
1400
1400
  * SQL files that may hold the generated helpers: `rls.out` (else `rls.sql`; its
1401
- * `helpers` part when it has `{part}`), the SQL files next to the hook, and the
1402
- * migration folders, not the hook itself.
1401
+ * `helpers` part when it has `{part}`), pg-delta's helpers part, the SQL files
1402
+ * next to the hook, and the migration folders, not the hook itself.
1403
1403
  */
1404
- function helperSources(cwd, config, hookOut) {
1404
+ function helperSources(cwd, config, hookOut, helpersSchema) {
1405
1405
  const hook = resolve(cwd, hookOut);
1406
1406
  const files = new Set(sqlFiles(cwd, config.doctor?.migrations ?? MIGRATION_DIRS));
1407
- const rlsOut = resolve(cwd, partPath(config.rls?.out ?? "rls.sql", "helpers"));
1408
- if (rlsOut.endsWith(".sql") && existsSync(rlsOut)) files.add(rlsOut);
1407
+ const out = config.rls?.out ?? "rls.sql";
1408
+ const schemas = resolveSchemas(cwd, config);
1409
+ const candidates = [partPath(out, "helpers")];
1410
+ if (schemas.mode === "pg-delta" && !out.includes("{part}")) candidates.push(pgDeltaPath(schemas.schemaDir, "helpers", helpersSchema));
1411
+ for (const candidate of candidates) {
1412
+ const path = resolve(cwd, candidate);
1413
+ if (path.endsWith(".sql") && existsSync(path)) files.add(path);
1414
+ }
1409
1415
  const beside = dirname(hook);
1410
1416
  if (existsSync(beside)) {
1411
1417
  for (const entry of readdirSync(beside, { withFileTypes: true })) if (entry.isFile() && entry.name.endsWith(".sql")) files.add(join(beside, entry.name));
@@ -1415,7 +1421,7 @@ function helperSources(cwd, config, hookOut) {
1415
1421
  }
1416
1422
  function missingHelpersInFiles(cwd, config, manifest) {
1417
1423
  const found = /* @__PURE__ */ new Set();
1418
- for (const file of helperSources(cwd, config, manifest.hook.out)) for (const name of helpersDefined(readFileSync(file, "utf8"), manifest.helpers.schema)) found.add(name);
1424
+ for (const file of helperSources(cwd, config, manifest.hook.out, manifest.helpers.schema)) for (const name of helpersDefined(readFileSync(file, "utf8"), manifest.helpers.schema)) found.add(name);
1419
1425
  return manifest.helpers.functions.filter((name) => !found.has(name));
1420
1426
  }
1421
1427
  async function missingHelpersInDb(db, manifest, connect = pgConnector("permdock supabase hook generate --db-url-stdin")) {
@@ -1895,11 +1901,11 @@ const MANAGES = "permdock_manages";
1895
1901
  */
1896
1902
  const APPROVES = "permdock_approves";
1897
1903
  const MANAGES_FOR = "permdock_manages_for";
1898
- function named(value) {
1904
+ function named$1(value) {
1899
1905
  return typeof value === "string" && value !== "";
1900
1906
  }
1901
- function checked(managers) {
1902
- if (typeof managers !== "object" || managers === null || !("table" in managers && named(managers.table)) || !("user" in managers && named(managers.user)) || !("manager" in managers && named(managers.manager))) throw configError("PermDock CLI: rls.approvals.managers needs { table, user, manager }: the table that names each user's manager, its user column and its manager column");
1907
+ function checked$1(managers) {
1908
+ if (typeof managers !== "object" || managers === null || !("table" in managers && named$1(managers.table)) || !("user" in managers && named$1(managers.user)) || !("manager" in managers && named$1(managers.manager))) throw configError("PermDock CLI: rls.approvals.managers needs { table, user, manager }: the table that names each user's manager, its user column and its manager column");
1903
1909
  return {
1904
1910
  table: managers.table,
1905
1911
  user: managers.user,
@@ -1910,13 +1916,16 @@ function checked(managers) {
1910
1916
  * `rls.approvals.managers`: `permdock_manages(p_requester, p_levels)` walks the
1911
1917
  * app's manager table up to `levels` steps (at most `MAX_MANAGER_LEVELS`) with
1912
1918
  * a cycle guard, and `permdock_approves` decides `manager` leaves with it and
1913
- * every other leaf through the two-argument `permdock_is_approver`. The
1914
- * requester never manages themselves into an approval. Without `delegations`,
1915
- * the four-argument `permdock_is_approver` is written here; with them,
1916
- * `approvalDelegationsSql` writes it and calls `permdock_approves` first.
1919
+ * every other leaf through `base`, the two-argument check. The requester never
1920
+ * manages themselves into an approval. `permdock_is_approver(p_approvers,
1921
+ * p_tenant, p_requester)` routes through `permdock_approves`, so the call with
1922
+ * a requester decides `manager` leaves; without one they match nobody. Without
1923
+ * `delegations`, the four-argument `permdock_is_approver` is written here; with
1924
+ * them, `approvalDelegationsSql` writes it and calls `permdock_approves`
1925
+ * first.
1917
1926
  */
1918
- function approvalManagersSql(ctx, given, isApprover, delegations) {
1919
- const managers = checked(given);
1927
+ function approvalManagersSql(ctx, given, isApprover, base, delegations) {
1928
+ const managers = checked$1(given);
1920
1929
  const table = quoteQualified(managers.table);
1921
1930
  const user = quoteIdent(managers.user);
1922
1931
  const boss = quoteIdent(managers.manager);
@@ -1937,6 +1946,21 @@ as $$
1937
1946
  $$;
1938
1947
  revoke execute on function ${isApprover}(jsonb, text, text, text) from public, anon;
1939
1948
  grant execute on function ${isApprover}(jsonb, text, text, text) to authenticated;
1949
+ `;
1950
+ const twoArguments = `
1951
+ -- approvers with managers: the two-argument call decides manager leaves when it passes the requester
1952
+ drop function if exists ${isApprover}(jsonb, text);
1953
+ create or replace function ${isApprover}(p_approvers jsonb, p_tenant text default null, p_requester text default null)
1954
+ returns boolean
1955
+ language sql
1956
+ stable
1957
+ security definer
1958
+ set search_path = ''
1959
+ as $$
1960
+ select coalesce(${approves}(p_approvers, p_tenant, p_requester), false)
1961
+ $$;
1962
+ revoke execute on function ${isApprover}(jsonb, text, text) from public, anon;
1963
+ grant execute on function ${isApprover}(jsonb, text, text) to authenticated;
1940
1964
  `;
1941
1965
  return `
1942
1966
  -- approval managers: whether p_user manages p_requester within p_levels steps of ${managers.table}
@@ -2030,12 +2054,12 @@ begin
2030
2054
  end loop;
2031
2055
  return false;
2032
2056
  else
2033
- return ${isApprover}(p_approvers, p_tenant);
2057
+ return ${base}(p_approvers, p_tenant);
2034
2058
  end case;
2035
2059
  end;
2036
2060
  $$;
2037
2061
  revoke execute on function ${approves}(jsonb, text, text) from public, anon, authenticated;
2038
- ${entry}`;
2062
+ ${twoArguments}${entry}`;
2039
2063
  }
2040
2064
  //#endregion
2041
2065
  //#region src/cli/rls/approval-policies.ts
@@ -2047,6 +2071,14 @@ const APPROVAL_POLICIES = {
2047
2071
  table: "approval_policies",
2048
2072
  read: "permdock_approval_policies_for"
2049
2073
  };
2074
+ const COLUMN_DEFAULTS = {
2075
+ id: "id",
2076
+ tenant: "tenant",
2077
+ name: "name",
2078
+ body: "body",
2079
+ enabled: "enabled",
2080
+ createdAt: "created_at"
2081
+ };
2050
2082
  const KEY = /^[A-Za-z][\w-]*(?:\.[A-Za-z][\w-]*)+$/u;
2051
2083
  /**
2052
2084
  * `rls.approvals.tenantPolicies`: one table of `ApprovalPolicy` bodies, a
@@ -2057,41 +2089,69 @@ const KEY = /^[A-Za-z][\w-]*(?:\.[A-Za-z][\w-]*)+$/u;
2057
2089
  * the row's tenant set, floors first, and only the owner may execute it, since
2058
2090
  * it reads every tenant.
2059
2091
  */
2060
- function approvalPoliciesSql(ctx, options, actorMayWrite = false) {
2092
+ function named(value) {
2093
+ return typeof value === "string" && value !== "";
2094
+ }
2095
+ /** `options` with its optional parts checked; `manage` is the only required one. */
2096
+ function checked(options) {
2061
2097
  if (options === null || typeof options !== "object" || !("manage" in options) || typeof options.manage !== "string" || !KEY.test(options.manage)) throw configError("PermDock CLI: rls.approvals.tenantPolicies needs { manage: '<permission key>' }, the permission whose holders in a tenant edit its approval policies");
2098
+ const given = { ...options };
2099
+ for (const key of ["table", "function"]) if (given[key] !== void 0 && !named(given[key])) throw configError(`PermDock CLI: rls.approvals.tenantPolicies.${key} must be a non-empty string`);
2100
+ const columns = given["columns"];
2101
+ if (columns !== void 0) {
2102
+ if (typeof columns !== "object" || columns === null) throw configError("PermDock CLI: rls.approvals.tenantPolicies.columns must be an object of column names");
2103
+ for (const [key, value] of Object.entries(columns)) if (!Object.hasOwn(COLUMN_DEFAULTS, key) || !named(value)) throw configError(`PermDock CLI: rls.approvals.tenantPolicies.columns.${key} must be a column name; the keys are ${Object.keys(COLUMN_DEFAULTS).join(", ")}`);
2104
+ }
2105
+ const path = given["path"];
2106
+ if (path !== void 0 && !(Array.isArray(path) && path.every(named))) throw configError("PermDock CLI: rls.approvals.tenantPolicies.path must be a list of keys");
2107
+ return given;
2108
+ }
2109
+ function approvalPoliciesSql(ctx, given, actorMayWrite = false) {
2110
+ const options = checked(given);
2062
2111
  const root = ctx.scopes[0]?.name;
2063
2112
  if (root === void 0) throw configError("PermDock CLI: rls.approvals.tenantPolicies needs a tenant scope; declare one in the policy's scopes");
2064
- const table = qualified(ctx, APPROVAL_POLICIES.table);
2065
- const fn = qualified(ctx, APPROVAL_POLICIES.read);
2066
- const member = `tenant in (select m.id::text from ${qualified(ctx, memberIdsHelper(root))}() m(id))`;
2113
+ const column = (key) => quoteIdent(options.columns?.[key] ?? COLUMN_DEFAULTS[key]);
2114
+ const id = column("id");
2115
+ const tenantColumn = column("tenant");
2116
+ const name = column("name");
2117
+ const bodyColumn = column("body");
2118
+ const enabled = column("enabled");
2119
+ const createdAt = column("createdAt");
2120
+ const path = options.path ?? [];
2121
+ const keys = `{${path.map((key) => `"${key.replaceAll("\"", String.raw`\"`)}"`).join(",")}}`;
2122
+ const policyIn = (alias) => path.length === 0 ? `${alias}${bodyColumn}` : `(${alias}${bodyColumn} #> ${quoteLiteral(keys)})`;
2123
+ const tableName = options.table === void 0 ? APPROVAL_POLICIES.table : options.table.split(".").at(-1) ?? APPROVAL_POLICIES.table;
2124
+ const table = options.table === void 0 ? qualified(ctx, APPROVAL_POLICIES.table) : quoteQualified(options.table);
2125
+ const fn = qualified(ctx, options.function ?? APPROVAL_POLICIES.read);
2126
+ const member = `${tenantColumn} in (select m.id::text from ${qualified(ctx, memberIdsHelper(root))}() m(id))`;
2067
2127
  const manages = `exists (
2068
2128
  select 1
2069
2129
  from ${qualified(ctx, checkName(permittedByPermissionHelper(root)))}(${quoteLiteral(options.manage)}) i(id)
2070
- where i.id::text = tenant
2130
+ where i.id::text = ${tenantColumn}
2071
2131
  )`;
2072
2132
  const writable = actorMayWrite ? ` and (select ${qualified(ctx, ACTOR_MAY_WRITE)}())` : "";
2073
- const own = `tenant is not null and ${subjectIdSql(ctx)} is not null and ${manages}${writable}`;
2074
- const policy = (name) => quoteIdent(`${APPROVAL_POLICIES.table}_${name}`);
2133
+ const own = `${tenantColumn} is not null and ${subjectIdSql(ctx)} is not null and ${manages}${writable}`;
2134
+ const policy = (suffix) => quoteIdent(`${tableName}_${suffix}`);
2075
2135
  return `
2076
2136
  -- approval policies: requirements a tenant keeps as data, plus platform floors (tenant null); tableApprovalPolicySource reads them
2077
2137
  create table if not exists ${table} (
2078
- id text primary key default gen_random_uuid()::text,
2079
- tenant text,
2080
- name text not null,
2081
- body jsonb not null,
2082
- enabled boolean not null default true,
2083
- created_at timestamptz not null default now(),
2138
+ ${id} text primary key default gen_random_uuid()::text,
2139
+ ${tenantColumn} text,
2140
+ ${name} text not null,
2141
+ ${bodyColumn} jsonb not null,
2142
+ ${enabled} boolean not null default true,
2143
+ ${createdAt} timestamptz not null default now(),
2084
2144
  updated_at timestamptz not null default now(),
2085
- constraint ${quoteIdent(`${APPROVAL_POLICIES.table}_body`)} check (jsonb_typeof(body) = 'object' and body ? 'approval')
2145
+ constraint ${quoteIdent(`${tableName}_body`)} check (jsonb_typeof(${policyIn("")}) = 'object' and ${policyIn("")} ? 'approval')
2086
2146
  );
2087
- create index if not exists ${quoteIdent(`${APPROVAL_POLICIES.table}_tenant`)} on ${table} (tenant);
2147
+ create index if not exists ${quoteIdent(`${tableName}_tenant`)} on ${table} (${tenantColumn});
2088
2148
  alter table ${table} enable row level security;
2089
2149
  revoke all on table ${table} from anon, public;
2090
2150
  grant select, insert, update, delete on table ${table} to authenticated;
2091
2151
  drop policy if exists ${policy("read")} on ${table};
2092
2152
  create policy ${policy("read")} on ${table}
2093
2153
  for select to authenticated
2094
- using (tenant is null or ${member});
2154
+ using (${tenantColumn} is null or ${member});
2095
2155
  drop policy if exists ${policy("insert")} on ${table};
2096
2156
  create policy ${policy("insert")} on ${table}
2097
2157
  for insert to authenticated
@@ -2114,13 +2174,13 @@ stable
2114
2174
  set search_path = ''
2115
2175
  as $$
2116
2176
  select case
2117
- when p.tenant is null then p.body - 'tenant'
2118
- else p.body || jsonb_build_object('tenant', p.tenant)
2177
+ when p.${tenantColumn} is null then ${policyIn("p.")} - 'tenant'
2178
+ else ${policyIn("p.")} || jsonb_build_object('tenant', p.${tenantColumn})
2119
2179
  end
2120
2180
  from ${table} p
2121
- where p.enabled
2122
- and (p.tenant is null or p.tenant = any(coalesce(p_tenants, '{}')))
2123
- order by p.tenant nulls first, p.created_at, p.id;
2181
+ where p.${enabled}
2182
+ and (p.${tenantColumn} is null or p.${tenantColumn} = any(coalesce(p_tenants, '{}')))
2183
+ order by p.${tenantColumn} nulls first, p.${createdAt}, p.${id};
2124
2184
  $$;
2125
2185
  revoke execute on function ${fn}(text[]) from public, anon, authenticated;
2126
2186
  `;
@@ -2145,7 +2205,12 @@ const APPROVAL_STORE = {
2145
2205
  list: "permdock_approval_list",
2146
2206
  expire: "permdock_approval_expire",
2147
2207
  cancel: "permdock_approval_cancel",
2148
- isApprover: IS_APPROVER
2208
+ isApprover: IS_APPROVER,
2209
+ /**
2210
+ * The two-argument check `permdock_approves` falls back to for non-manager
2211
+ * leaves.
2212
+ */
2213
+ isApproverBase: "permdock_is_approver_base"
2149
2214
  };
2150
2215
  /** `body` as the row's filter columns hold it. */
2151
2216
  const COLUMNS = `p_request ->> 'token',
@@ -2353,8 +2418,9 @@ ${serverOnly(fn(APPROVAL_STORE.cancel), "jsonb, text, text, text")}
2353
2418
  `;
2354
2419
  }
2355
2420
  /**
2356
- * `permdock_is_approver(p_approvers jsonb, p_tenant text default null)`: true
2357
- * when the signed-in user matches the serialised approvers of a request
2421
+ * `permdock_is_approver(p_approvers jsonb, p_tenant text default null)`, or
2422
+ * with `rls.approvals.managers` its base `permdock_is_approver_base`: true when
2423
+ * the signed-in user matches the serialised approvers of a request
2358
2424
  * (`approvers.by`), for policies on the app's own approval views. A list needs
2359
2425
  * every item and `any-of` one of them; `user` compares the user id and
2360
2426
  * `holder(permission)` reads `permitted_<root>_ids_by_permission` in
@@ -2362,8 +2428,10 @@ ${serverOnly(fn(APPROVAL_STORE.cancel), "jsonb, text, text, text")}
2362
2428
  * other grantee approvers need facts the database does not hold for every
2363
2429
  * membership source, so they match nobody.
2364
2430
  */
2365
- function isApproverSql(ctx) {
2366
- const fn = qualified(ctx, APPROVAL_STORE.isApprover);
2431
+ function isApproverSql(ctx, managers = false) {
2432
+ const fn = qualified(ctx, managers ? APPROVAL_STORE.isApproverBase : APPROVAL_STORE.isApprover);
2433
+ const exposure = managers ? `revoke execute on function ${fn}(jsonb, text) from public, anon, authenticated;` : `revoke execute on function ${fn}(jsonb, text) from public, anon;
2434
+ grant execute on function ${fn}(jsonb, text) to authenticated;`;
2367
2435
  const root = ctx.scopes[0]?.name;
2368
2436
  const inTenant = root === void 0 ? "false" : `exists (
2369
2437
  select 1
@@ -2423,8 +2491,7 @@ begin
2423
2491
  end case;
2424
2492
  end;
2425
2493
  $$;
2426
- revoke execute on function ${fn}(jsonb, text) from public, anon;
2427
- grant execute on function ${fn}(jsonb, text) to authenticated;
2494
+ ${exposure}
2428
2495
  `;
2429
2496
  }
2430
2497
  /**
@@ -2466,7 +2533,7 @@ function approvalsSql(ctx, approvals, jsonSchema, actorMayWrite = false) {
2466
2533
  ...approvals,
2467
2534
  table
2468
2535
  }, jsonSchema);
2469
- return store + isApproverSql(ctx) + (managers === void 0 ? "" : approvalManagersSql(ctx, managers, qualified(ctx, APPROVAL_STORE.isApprover), delegations === true)) + (delegations === true ? approvalDelegationsSql(ctx, actorMayWrite, managers !== void 0) : "") + (delegations === true || managers !== void 0 ? requestApproversSql(ctx) : "") + (tenantPolicies === void 0 ? "" : approvalPoliciesSql(ctx, tenantPolicies, actorMayWrite));
2536
+ return store + isApproverSql(ctx, managers !== void 0) + (managers === void 0 ? "" : approvalManagersSql(ctx, managers, qualified(ctx, APPROVAL_STORE.isApprover), qualified(ctx, APPROVAL_STORE.isApproverBase), delegations === true)) + (delegations === true ? approvalDelegationsSql(ctx, actorMayWrite, managers !== void 0) : "") + (delegations === true || managers !== void 0 ? requestApproversSql(ctx) : "") + (tenantPolicies === void 0 ? "" : approvalPoliciesSql(ctx, tenantPolicies, actorMayWrite));
2470
2537
  }
2471
2538
  /**
2472
2539
  * The objects `rls.approvals.delegations` adds; `tableApprovalDelegationSource`
@@ -2811,6 +2878,7 @@ end;
2811
2878
  $$;`;
2812
2879
  return `-- approval store adopted onto ${adopt.table}: ApprovalRequest bodies in ${adopt.body ?? "body"}, keyed by ${adopt.token ?? "token"}; supabaseApprovalStore calls the functions below
2813
2880
  alter table ${table} add column if not exists ${token} text;
2881
+ comment on column ${table}.${token} is '@bsb identifier: the approval token is a SHA-256 digest of the decision inputs, which the approval is bound to, not a secret';
2814
2882
  alter table ${table} add column if not exists ${body} jsonb;
2815
2883
  create unique index if not exists ${index("token")} on ${table} (${token});
2816
2884
  create index if not exists ${index("page")} on ${table} ((${body} ->> 'createdAt') collate "C", ${token} collate "C");
@@ -2990,7 +3058,7 @@ function hookSql(parts) {
2990
3058
  return `${parts.schema === "public" ? "" : `create schema if not exists ${schema};\nrevoke all on schema ${schema} from public;\n\n`}create or replace function ${fn}(event jsonb)
2991
3059
  returns jsonb
2992
3060
  language plpgsql
2993
- stable
3061
+ stable${parts.hook.security === "definer" ? "\nsecurity definer" : ""}
2994
3062
  set search_path = ''
2995
3063
  as $$
2996
3064
  declare
@@ -3045,6 +3113,10 @@ $$;`;
3045
3113
  function grantsSql(parts) {
3046
3114
  const schema = quoteIdent(parts.schema);
3047
3115
  const fn = `${schema}.custom_access_token_hook`;
3116
+ if (parts.hook.security === "definer") return `-- supabase_auth_admin: execute only; the hook reads with its owner's rights
3117
+ revoke execute on function ${fn}(jsonb) from authenticated, anon, public;
3118
+ grant usage on schema ${schema} to supabase_auth_admin;
3119
+ grant execute on function ${fn}(jsonb) to supabase_auth_admin;${extraRevokesSql(parts.extra, parts.before)}`;
3048
3120
  return [
3049
3121
  `-- supabase_auth_admin: the grants and read policies the hook needs
3050
3122
  grant usage on schema ${schema} to supabase_auth_admin;
@@ -3054,6 +3126,13 @@ revoke execute on function ${fn}(jsonb) from authenticated, anon, public;${extra
3054
3126
  parts.version ? authAdminRead(`${parts.schema}.${AUTHZ_VERSION_TABLE}`, "version") : ""
3055
3127
  ].filter((chunk) => chunk !== "").join("\n");
3056
3128
  }
3129
+ /**
3130
+ * A definer hook calls `hook.claims` and `hook.before` functions as its owner,
3131
+ * so they need no grant; they are still revoked from the client roles.
3132
+ */
3133
+ function extraRevokesSql(extra, before) {
3134
+ return [...extra.map((entry) => `\nrevoke all on function ${quoteTable(entry.fn)}(uuid) from public, anon, authenticated;`), ...before.map((fn) => `\nrevoke all on function ${quoteTable(fn)}(jsonb) from public, anon, authenticated;`)].join("");
3135
+ }
3057
3136
  function extraGrantsSql(extra) {
3058
3137
  return [...[...new Set(extra.map((entry) => entry.fn.split(".")[0]))].map((name) => `\ngrant usage on schema ${quoteIdent(name ?? "")} to supabase_auth_admin;`), ...extra.map((entry) => `\nrevoke all on function ${quoteTable(entry.fn)}(uuid) from public, anon, authenticated;\ngrant execute on function ${quoteTable(entry.fn)}(uuid) to supabase_auth_admin;`)].join("");
3059
3138
  }
@@ -3785,10 +3864,27 @@ budget, the claims the hook writes, the membership sources and the columns that
3785
3864
  file differs.
3786
3865
  `;
3787
3866
  /**
3788
- * `supabase.hook.out`, else pg-delta's per-schema path under pg-delta, else
3867
+ * The hook part of `rls generate --split`: `rls.out` with `{part}` replaced by
3868
+ * `hook`, when `rls.split` lists `hook`, or, without `rls.split`, when that
3869
+ * file carries the hook marker.
3870
+ */
3871
+ function splitHookOut(cwd, config) {
3872
+ const out = config.rls?.out;
3873
+ if (out?.includes("{part}") !== true) return;
3874
+ const rel = partPath(out, "hook");
3875
+ const split = config.rls?.split;
3876
+ if (split !== void 0) return split.includes("hook") ? rel : void 0;
3877
+ const path = resolve(cwd, rel);
3878
+ return existsSync(path) && readFileSync(path, "utf8").includes("-- permdock:hook v1") ? rel : void 0;
3879
+ }
3880
+ /**
3881
+ * `supabase.hook.out`, else the hook part of `rls generate --split`, else
3882
+ * pg-delta's per-schema path under pg-delta, else
3789
3883
  * `supabase/permdock-hook.sql`.
3790
3884
  */
3791
3885
  function hookOut(cwd, config, schema, flag) {
3886
+ const split = config.supabase?.hook?.out === void 0 ? splitHookOut(cwd, config) : void 0;
3887
+ if (split !== void 0) return split;
3792
3888
  const schemas = resolveSchemas(cwd, config, flag);
3793
3889
  return config.supabase?.hook?.out !== void 0 || schemas.mode !== "pg-delta" ? defaultOut(config) : pgDeltaPath(schemas.schemaDir, "hook", schema ?? config.supabase?.hook?.schema ?? config.rls?.schema ?? "permdock");
3794
3890
  }
@@ -3995,8 +4091,8 @@ async function runSupabase(input) {
3995
4091
  };
3996
4092
  const generated = supabaseHookSql(await loadScopes(input.cwd, input.config), input.config, overrides, grantsLabel(input.grantsOut));
3997
4093
  const { grants, manifest } = generated;
3998
- const sql = schemas.mode === "pg-delta" && typeof input.out !== "string" && input.config.supabase?.hook?.out === void 0 ? declarativeSql(generated.sql) : generated.sql;
3999
4094
  const outRel = typeof input.out === "string" ? input.out : hookOut(input.cwd, input.config, input.schema, flag);
4095
+ const sql = schemas.mode === "pg-delta" && typeof input.out !== "string" && input.config.supabase?.hook?.out === void 0 && splitHookOut(input.cwd, input.config) === void 0 ? declarativeSql(generated.sql) : generated.sql;
4000
4096
  const outPath = resolve(input.cwd, outRel);
4001
4097
  const hook = input.config.supabase?.hook;
4002
4098
  const grantsFile = input.grantsOut === void 0 ? [] : [{
@@ -1,22 +1,22 @@
1
1
  import { c as listPermissions, u as renamedKeys } from "./permission-registry-B8tYxPIt.js";
2
2
  import { d as scopeList, s as resolveScope } from "./scopes-BSdYaGHs.js";
3
3
  import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
4
- import { l as policyLevels } from "./policy-cV_wwPb8.js";
4
+ import { l as policyLevels } from "./policy-DTmkP72P.js";
5
5
  import { a as describeError, i as configError } from "./errors-BhRkoNS7.js";
6
6
  import "./budget-BBCPDOGP.js";
7
7
  import { d as sqlTextArray, i as qualifySqlTable } from "./sql-0WjxIp9g.js";
8
8
  import { l as roleColumn } from "./sources-C4vkzZJV.js";
9
9
  import { t as beforeFirst } from "./text-BMFRfBqc.js";
10
10
  import { c as parseSplit } from "./output-files-CM0BnH05.js";
11
- import { x as resolveAuthorize } from "./supabase-hook-DX38Hj8h.js";
11
+ import { x as resolveAuthorize } from "./supabase-hook-Btk56XD6.js";
12
12
  import { A as quoteQualified, C as parseMembershipsFlag, D as qualified, F as firstScopeType, O as quoteIdent, R as tenantTypeOf, a as customRolesOn, j as quoteTable, k as quoteLiteral, s as signedIn, t as CUSTOM_ROLES } from "./shared-DyYVEjKC.js";
13
- import { G as byKey, H as rolesTableScope, O as tokenScopesPlan, Q as graphSqlName, V as raiseSql, W as byCodeUnit, Y as apiKeysPlan, a as closureDepths, bt as checkSuspension, i as tablelessResources, o as graphPlan, r as tableNames, t as resolveVias, z as currentKeyExpr } from "./tables-BfOk0ymL.js";
14
- import { o as assignableRoles, r as unsatisfiedKinds, t as ownershipRules, u as roleNames } from "./ownership-D-mIt-w0.js";
13
+ import { G as byKey, H as rolesTableScope, O as tokenScopesPlan, Q as graphSqlName, V as raiseSql, W as byCodeUnit, Y as apiKeysPlan, a as closureDepths, bt as checkSuspension, i as tablelessResources, o as graphPlan, r as tableNames, t as resolveVias, z as currentKeyExpr } from "./tables-B72q9UFD.js";
14
+ import { o as assignableRoles, r as unsatisfiedKinds, t as ownershipRules, u as roleNames } from "./ownership-CrmMERZv.js";
15
15
  import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
16
16
  import { i as group, o as sqlStatements } from "./deciding-columns-NB4wcyBf.js";
17
- import { d as orSql, h as branchClauses } from "./fields-CrjL6A49.js";
18
- import { t as resolveNames } from "./resolve-names-CBl4r4_r.js";
19
- import { m as tableFor } from "./verify-Bpj0hauG.js";
17
+ import { d as orSql, h as branchClauses } from "./fields-COvJbUva.js";
18
+ import { t as resolveNames } from "./resolve-names-Dg8560iu.js";
19
+ import { m as tableFor } from "./verify-CaaZlnP5.js";
20
20
  //#region src/cli/rls/custom-role-rebuild.ts
21
21
  const PREFIX = "PermDock CLI";
22
22
  /** A column of the roles-table row `r`. */
@@ -1,11 +1,11 @@
1
- import { c as requiredPlans } from "../errors-TpzkEKgJ.js";
2
- import { i as describe } from "../describe-BKtC_8PG.js";
1
+ import { c as requiredPlans } from "../errors-POWcCXy7.js";
2
+ import { i as describe } from "../describe-DyN-HX6o.js";
3
3
  import { t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
4
- import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-DYeB-_U3.js";
4
+ import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-CjJaZI_g.js";
5
5
  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-L9UOwATg.js";
6
6
  import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
7
- import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-D19MK4t-.js";
8
- import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-EPul_8MN.js";
7
+ import { i as ProtectedProps, n as ProtectedActionReadable, r as SveltePermDockOptions, s as PermissionBoundaryProps, t as PermDockDefaults } from "../types-Bwdumeos.js";
8
+ import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-Cam6GGAV.js";
9
9
  import { Component } from "svelte";
10
10
  //#region src/svelte/index.d.ts
11
11
  export declare const Protected: Component<ProtectedProps>;
@@ -3,10 +3,10 @@ import { n as describe } from "../describe-BZAlPHxT.js";
3
3
  import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BV3O1eud.js";
4
4
  import { r as approvalHeaders } from "../protected-action-OpOxtTsN.js";
5
5
  import { u as slotContent } from "../views-MWmJ6Y4P.js";
6
- import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options--zWn48PK.js";
7
- import { n as getUi, t as getStore } from "../context-DeammvFl.js";
6
+ import { a as eventSourceRefresh, i as broadcastChannelRefresh, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-CDvoX52-.js";
7
+ import { n as getUi, t as getStore } from "../context-YhyXyqBI.js";
8
8
  import { n as viewFor, t as scopedFor } from "../runtime-rf0ZuyF3.js";
9
- import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-BYFopOm1.js";
9
+ import { a as gate, c as memberships, d as protectedAction, f as roles, h as tenant, i as filtered, l as permission, m as subject, n as assignable, o as getDescribe, p as setPermDock, r as assignablePermissions, s as getPermDock, t as approval, u as permissions } from "../stores-PpYVQ5yF.js";
10
10
  import "svelte/internal/disclose-version";
11
11
  import * as $ from "svelte/internal/client";
12
12
  import { onDestroy } from "svelte";